| 1 | /* |
| 2 | * QEMU PowerNV PNOR simple model |
| 3 | * |
| 4 | * Copyright (c) 2019, IBM Corporation. |
| 5 | * |
| 6 | * This code is licensed under the GPL version 2 or later. See the |
| 7 | * COPYING file in the top-level directory. |
| 8 | */ |
| 9 | |
| 10 | #ifndef PPC_PNV_PNOR_H |
| 11 | #define PPC_PNV_PNOR_H |
| 12 | |
| 13 | #include "hw/core/sysbus.h" |
| 14 | |
| 15 | /* |
| 16 | * PNOR offset on the LPC FW address space. For now this should be 0 because |
| 17 | * skiboot 7.1 has a bug where IDSEL > 0 (LPC FW address > 256MB) access is |
| 18 | * not performed correctly. |
| 19 | */ |
| 20 | #define PNOR_SPI_OFFSET 0x00000000UL |
| 21 | |
| 22 | #define TYPE_PNV_PNOR "pnv-pnor" |
| 23 | OBJECT_DECLARE_SIMPLE_TYPE(PnvPnor, PNV_PNOR) |
| 24 | |
| 25 | struct PnvPnor { |
| 26 | SysBusDevice parent_obj; |
| 27 | |
| 28 | BlockBackend *blk; |
| 29 | |
| 30 | uint8_t *storage; |
| 31 | uint32_t lpc_address; /* Offset within LPC FW space */ |
| 32 | int64_t size; |
| 33 | MemoryRegion mmio; |
| 34 | }; |
| 35 | |
| 36 | #endif /* PPC_PNV_PNOR_H */ |