mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 09:43:56 -06:00
hw/misc: Allwinner A10 DRAM Controller Emulation
During SPL boot several DRAM Controller registers are used. Most important registers are those related to DRAM initialization and calibration, where SPL initiates process and waits until certain bit is set/cleared. This patch adds these registers, initializes reset values from user's guide and updates state of registers as SPL expects it. Signed-off-by: Strahinja Jankovic <strahinja.p.jankovic@gmail.com> Reviewed-by: Niek Linnenbank <nieklinnenbank@gmail.com> Message-id: 20221226220303.14420-3-strahinja.p.jankovic@gmail.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
423ec28bb8
commit
edd3a59d5b
7 changed files with 261 additions and 0 deletions
|
@ -25,6 +25,7 @@
|
|||
#include "hw/boards.h"
|
||||
#include "hw/usb/hcd-ohci.h"
|
||||
|
||||
#define AW_A10_DRAMC_BASE 0x01c01000
|
||||
#define AW_A10_MMC0_BASE 0x01c0f000
|
||||
#define AW_A10_CCM_BASE 0x01c20000
|
||||
#define AW_A10_PIC_REG_BASE 0x01c20400
|
||||
|
@ -49,6 +50,8 @@ static void aw_a10_init(Object *obj)
|
|||
|
||||
object_initialize_child(obj, "ccm", &s->ccm, TYPE_AW_A10_CCM);
|
||||
|
||||
object_initialize_child(obj, "dramc", &s->dramc, TYPE_AW_A10_DRAMC);
|
||||
|
||||
object_initialize_child(obj, "emac", &s->emac, TYPE_AW_EMAC);
|
||||
|
||||
object_initialize_child(obj, "sata", &s->sata, TYPE_ALLWINNER_AHCI);
|
||||
|
@ -110,6 +113,10 @@ static void aw_a10_realize(DeviceState *dev, Error **errp)
|
|||
sysbus_realize(SYS_BUS_DEVICE(&s->ccm), &error_fatal);
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->ccm), 0, AW_A10_CCM_BASE);
|
||||
|
||||
/* DRAM Control Module */
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->dramc), &error_fatal);
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->dramc), 0, AW_A10_DRAMC_BASE);
|
||||
|
||||
/* FIXME use qdev NIC properties instead of nd_table[] */
|
||||
if (nd_table[0].used) {
|
||||
qemu_check_nic_model(&nd_table[0], TYPE_AW_EMAC);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue