qemu/include/hw/ppc/pnv_pnor.h
Nicholas Piggin ce5a32d180 ppc/pnv: Move the PNOR LPC address into struct PnvPnor
Rather than use the hardcoded define throughout the tree for the
PNOR LPC address, keep it within the PnvPnor object.

This should solve a dead code issue in the BMC HIOMAP checks where
Coverity (correctly) reported that the sanity checks are dead code.
We would like to keep the sanity checks without turning them into a
compile time assert in case we would like to make them configurable
in future.

Fixes: 4c84a0a4a6 ("ppc/pnv: Add a PNOR address and size sanity checks")
Resolves: Coverity CID 1593723
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
2025-03-20 19:58:10 +10:00

36 lines
836 B
C

/*
* 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
#include "hw/sysbus.h"
/*
* PNOR offset on the LPC FW address space. For now this should be 0 because
* skiboot 7.1 has a bug where IDSEL > 0 (LPC FW address > 256MB) access is
* not performed correctly.
*/
#define PNOR_SPI_OFFSET 0x00000000UL
#define TYPE_PNV_PNOR "pnv-pnor"
OBJECT_DECLARE_SIMPLE_TYPE(PnvPnor, PNV_PNOR)
struct PnvPnor {
SysBusDevice parent_obj;
BlockBackend *blk;
uint8_t *storage;
uint32_t lpc_address; /* Offset within LPC FW space */
int64_t size;
MemoryRegion mmio;
};
#endif /* PPC_PNV_PNOR_H */