qemu/include/hw/ppc/pnv_homer.h
Nicholas Piggin 70bc5c2498 ppc/pnv: Make HOMER memory a RAM region
The HOMER is a region of memory used by host and firmware and
microconrollers. It has very little logic by itself, just some BAR
registers. Users of this memory should operate on it rather than
have HOMER implement them with MMIO registers, which is not the
right model.

This change switches the implementation of HOMER from MMIO to RAM,
and moves the OCC register implementation to in-memory structure
accesses performed by the OCC model.

This has the downside that access to unimplemented regions of HOMER
are no longer flagged. Perhaps that could be done by adding a memory
region for HOMER, and ram subregions under that for each implemented
part. But for now this takes the simpler approach.

Note: This brings some data structure definitions from skiboot, which
does not match QEMU coding style but is not changed to make comparisons
and updates simpler.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
2025-03-11 22:43:30 +10:00

61 lines
1.8 KiB
C

/*
* QEMU PowerPC PowerNV Emulation of a few HOMER related registers
*
* Copyright (c) 2019, IBM Corporation.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PPC_PNV_HOMER_H
#define PPC_PNV_HOMER_H
#include "hw/ppc/pnv.h"
#include "qom/object.h"
#define TYPE_PNV_HOMER "pnv-homer"
OBJECT_DECLARE_TYPE(PnvHomer, PnvHomerClass,
PNV_HOMER)
#define TYPE_PNV8_HOMER TYPE_PNV_HOMER "-POWER8"
DECLARE_INSTANCE_CHECKER(PnvHomer, PNV8_HOMER,
TYPE_PNV8_HOMER)
#define TYPE_PNV9_HOMER TYPE_PNV_HOMER "-POWER9"
DECLARE_INSTANCE_CHECKER(PnvHomer, PNV9_HOMER,
TYPE_PNV9_HOMER)
#define TYPE_PNV10_HOMER TYPE_PNV_HOMER "-POWER10"
DECLARE_INSTANCE_CHECKER(PnvHomer, PNV10_HOMER,
TYPE_PNV10_HOMER)
struct PnvHomer {
DeviceState parent;
PnvChip *chip;
MemoryRegion pba_regs;
MemoryRegion mem;
hwaddr base;
};
struct PnvHomerClass {
DeviceClass parent_class;
/* Get base address of HOMER memory */
hwaddr (*get_base)(PnvChip *chip);
/* Size of HOMER memory */
int size;
int pba_size;
const MemoryRegionOps *pba_ops;
};
#endif /* PPC_PNV_HOMER_H */