mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
ppc4xx_sdram: Get rid of the init RAM hack
The do_init parameter of ppc4xx_sdram_init() is used to map memory regions that is normally done by the firmware by programming the SDRAM controller. Do this from board code emulating what firmware would do when booting a kernel directly from -kernel without a firmware so we can get rid of this do_init hack. Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu> Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com> Message-Id: <d6c44c870befa1a075e21f1a59926dcdaff63f6b.1664021647.git.balaton@eik.bme.hu> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
This commit is contained in:
parent
8626982301
commit
68b9a2e38d
6 changed files with 15 additions and 14 deletions
|
@ -350,8 +350,7 @@ static void sdram_reset(void *opaque)
|
|||
void ppc4xx_sdram_init(CPUPPCState *env, qemu_irq irq, int nbanks,
|
||||
MemoryRegion *ram_memories,
|
||||
hwaddr *ram_bases,
|
||||
hwaddr *ram_sizes,
|
||||
int do_init)
|
||||
hwaddr *ram_sizes)
|
||||
{
|
||||
ppc4xx_sdram_t *sdram;
|
||||
int i;
|
||||
|
@ -369,9 +368,12 @@ void ppc4xx_sdram_init(CPUPPCState *env, qemu_irq irq, int nbanks,
|
|||
sdram, &dcr_read_sdram, &dcr_write_sdram);
|
||||
ppc_dcr_register(env, SDRAM0_CFGDATA,
|
||||
sdram, &dcr_read_sdram, &dcr_write_sdram);
|
||||
if (do_init) {
|
||||
sdram_map_bcr(sdram);
|
||||
}
|
||||
}
|
||||
|
||||
void ppc4xx_sdram_enable(CPUPPCState *env)
|
||||
{
|
||||
ppc_dcr_write(env->dcr_env, SDRAM0_CFGADDR, 0x20);
|
||||
ppc_dcr_write(env->dcr_env, SDRAM0_CFGDATA, 0x80000000);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue