Skip to content

Commit

Permalink
plat/qemu: add PNOR support
Browse files Browse the repository at this point in the history
To access the PNOR, OPAL/skiboot drives the BMC SPI controller using
the iLPC2AHB device of the BMC SuperIO controller and accesses the
flash contents using the LPC FW address space on which the PNOR is
remapped.

The QEMU PowerNV machine now integrates such models (SuperIO
controller, iLPC2AHB device) and also a pseudo Aspeed SoC AHB memory
space populated with the SPI controller registers (same model as for
ARM). The AHB window giving access to the contents of the BMC SPI
controller flash modules is mapped on the LPC FW address space.

The change should be compatible for machine without PNOR support.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
  • Loading branch information
legoater authored and stewartsmith committed Jun 19, 2018
1 parent 28ba76c commit 35cd7a3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions platforms/qemu/qemu.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#include <bt.h>
#include <errorlog.h>
#include <ipmi.h>
#include <ast.h>
#include <platforms/astbmc/astbmc.h>

/* BT config */
#define BT_IO_BASE 0xe4
Expand Down Expand Up @@ -78,6 +80,9 @@ static void qemu_ipmi_setenables(void)

static void qemu_init(void)
{
/* Initialize PNOR/NVRAM */
pnor_init();

/* Setup UART console for use by Linux via OPAL API */
set_opal_console(&uart_opal_con);

Expand Down Expand Up @@ -241,6 +246,9 @@ static bool qemu_probe(void)

psi_set_external_irq_policy(EXTERNAL_IRQ_POLICY_SKIBOOT);

/* Initialize AHB accesses via AST2400 */
ast_io_init();

/* Setup UART and use it as console */
uart_init();

Expand All @@ -254,5 +262,7 @@ DECLARE_PLATFORM(qemu) = {
.external_irq = qemu_ext_irq_serirq_cpld,
.cec_power_down = qemu_ipmi_power_down,
.cec_reboot = qemu_ipmi_reboot,
.start_preload_resource = flash_start_preload_resource,
.resource_loaded = flash_resource_loaded,
.terminate = ipmi_terminate,
};

0 comments on commit 35cd7a3

Please sign in to comment.