mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
ppc440_sdram: QOM'ify
Change the ppc440_sdram model to a QOM class derived from the PPC4xx-dcr-device and name it ppc4xx-sdram-ddr2. This is mostly modelling the DDR2 SDRAM controller found in the 460EX (used on the sam460ex board). Newer SoCs (regardless of their PPC core, e.g. 405EX) may have this controller but we only emulate enough of it for the sam460ex u-boot firmware. Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu> Reviewed-by: Cédric Le Goater <clg@kaod.org> Message-Id: <3e82ae575c7c41e464a0082d55ecb4ebcc4d4329.1664021647.git.balaton@eik.bme.hu> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
This commit is contained in:
parent
ef10aebb9a
commit
5f7effe4df
4 changed files with 96 additions and 52 deletions
|
@ -37,8 +37,6 @@ typedef struct {
|
|||
uint32_t bcr;
|
||||
} Ppc4xxSdramBank;
|
||||
|
||||
void ppc4xx_sdram_ddr2_enable(CPUPPCState *env);
|
||||
|
||||
void ppc4xx_sdram_banks(MemoryRegion *ram, int nr_banks,
|
||||
Ppc4xxSdramBank ram_banks[],
|
||||
const ram_addr_t sdram_bank_sizes[]);
|
||||
|
@ -138,4 +136,20 @@ struct Ppc4xxSdramDdrState {
|
|||
|
||||
void ppc4xx_sdram_ddr_enable(Ppc4xxSdramDdrState *s);
|
||||
|
||||
/* SDRAM DDR2 controller */
|
||||
#define TYPE_PPC4xx_SDRAM_DDR2 "ppc4xx-sdram-ddr2"
|
||||
OBJECT_DECLARE_SIMPLE_TYPE(Ppc4xxSdramDdr2State, PPC4xx_SDRAM_DDR2);
|
||||
struct Ppc4xxSdramDdr2State {
|
||||
Ppc4xxDcrDeviceState parent_obj;
|
||||
|
||||
MemoryRegion *dram_mr;
|
||||
uint32_t nbanks; /* Banks to use from 4, e.g. when board has less slots */
|
||||
Ppc4xxSdramBank bank[4];
|
||||
|
||||
uint32_t addr;
|
||||
uint32_t mcopt2;
|
||||
};
|
||||
|
||||
void ppc4xx_sdram_ddr2_enable(Ppc4xxSdramDdr2State *s);
|
||||
|
||||
#endif /* PPC4XX_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue