diff options
author | Cédric Le Goater <clg@fr.ibm.com> | 2019-10-21 15:12:11 +0200 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2019-12-17 10:39:47 +1100 |
commit | 35dde5766211cac0e608b29b3f71922f116b5932 (patch) | |
tree | d30d9e4af9f39d6f1b81951b7cb59d2be5f2565c /include | |
parent | cb88904a54903ef6ba21a68a61d9cd51e2166304 (diff) | |
download | qemu-35dde5766211cac0e608b29b3f71922f116b5932.zip qemu-35dde5766211cac0e608b29b3f71922f116b5932.tar.gz qemu-35dde5766211cac0e608b29b3f71922f116b5932.tar.bz2 |
ppc/pnv: Add a PNOR model
On a POWERPC PowerNV system, the host firmware is stored in a PNOR
flash chip which contents is mapped on the LPC bus. This model adds a
simple dummy device to map the contents of a block device in the host
address space.
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20191021131215.3693-2-clg@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'include')
-rw-r--r-- | include/hw/ppc/pnv.h | 3 | ||||
-rw-r--r-- | include/hw/ppc/pnv_pnor.h | 25 |
2 files changed, 28 insertions, 0 deletions
diff --git a/include/hw/ppc/pnv.h b/include/hw/ppc/pnv.h index 0b4c722..5ecd3ba 100644 --- a/include/hw/ppc/pnv.h +++ b/include/hw/ppc/pnv.h @@ -24,6 +24,7 @@ #include "hw/sysbus.h" #include "hw/ipmi/ipmi.h" #include "hw/ppc/pnv_lpc.h" +#include "hw/ppc/pnv_pnor.h" #include "hw/ppc/pnv_psi.h" #include "hw/ppc/pnv_occ.h" #include "hw/ppc/pnv_homer.h" @@ -175,6 +176,8 @@ typedef struct PnvMachineState { IPMIBmc *bmc; Notifier powerdown_notifier; + + PnvPnor *pnor; } PnvMachineState; static inline bool pnv_chip_is_power9(const PnvChip *chip) diff --git a/include/hw/ppc/pnv_pnor.h b/include/hw/ppc/pnv_pnor.h new file mode 100644 index 0000000..dec8116 --- /dev/null +++ b/include/hw/ppc/pnv_pnor.h @@ -0,0 +1,25 @@ +/* + * QEMU PowerNV PNOR simple model + * + * Copyright (c) 2019, IBM Corporation. + * + * This code is licensed under the GPL version 2 or later. See the + * COPYING file in the top-level directory. + */ +#ifndef _PPC_PNV_PNOR_H +#define _PPC_PNV_PNOR_H + +#define TYPE_PNV_PNOR "pnv-pnor" +#define PNV_PNOR(obj) OBJECT_CHECK(PnvPnor, (obj), TYPE_PNV_PNOR) + +typedef struct PnvPnor { + SysBusDevice parent_obj; + + BlockBackend *blk; + + uint8_t *storage; + uint32_t size; + MemoryRegion mmio; +} PnvPnor; + +#endif /* _PPC_PNV_PNOR_H */ |