summaryrefslogtreecommitdiffstats
path: root/include/hw/ppc
diff options
context:
space:
mode:
authorCédric Le Goater2019-10-21 15:12:11 +0200
committerDavid Gibson2019-12-17 00:39:47 +0100
commit35dde5766211cac0e608b29b3f71922f116b5932 (patch)
treed30d9e4af9f39d6f1b81951b7cb59d2be5f2565c /include/hw/ppc
parentMerge remote-tracking branch 'remotes/amarkovic/tags/mips-queue-dec-16-2019' ... (diff)
downloadqemu-35dde5766211cac0e608b29b3f71922f116b5932.tar.gz
qemu-35dde5766211cac0e608b29b3f71922f116b5932.tar.xz
qemu-35dde5766211cac0e608b29b3f71922f116b5932.zip
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/hw/ppc')
-rw-r--r--include/hw/ppc/pnv.h3
-rw-r--r--include/hw/ppc/pnv_pnor.h25
2 files changed, 28 insertions, 0 deletions
diff --git a/include/hw/ppc/pnv.h b/include/hw/ppc/pnv.h
index 0b4c722e6b..5ecd3ba6ed 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 0000000000..dec811695c
--- /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 */