mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 02:03:56 -06:00
hw/misc/mps2-scc: Support configurable number of OSCCLK values
Currently the MPS2 SCC device implements a fixed number of OSCCLK values (3). The variant of this device in the MPS3 AN524 board has 6 OSCCLK values. Switch to using a PROP_ARRAY, which allows board code to specify how large the OSCCLK array should be as well as its values. With a variable-length property array, the SCC no longer specifies default values for the OSCCLKs, so we must set them explicitly in the board code. This defaults are actually incorrect for the an521 and an505; we will correct this bug in a following patch. This is a migration compatibility break for all the mps boards. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20210215115138.20465-3-peter.maydell@linaro.org
This commit is contained in:
parent
a3e24690b8
commit
4fb013afcc
4 changed files with 26 additions and 15 deletions
|
@ -219,6 +219,11 @@ static MemoryRegion *make_scc(MPS2TZMachineState *mms, void *opaque,
|
|||
qdev_prop_set_uint32(sccdev, "scc-cfg4", 0x2);
|
||||
qdev_prop_set_uint32(sccdev, "scc-aid", 0x00200008);
|
||||
qdev_prop_set_uint32(sccdev, "scc-id", mmc->scc_id);
|
||||
/* This will need to be per-FPGA image eventually */
|
||||
qdev_prop_set_uint32(sccdev, "len-oscclk", 3);
|
||||
qdev_prop_set_uint32(sccdev, "oscclk[0]", 50000000);
|
||||
qdev_prop_set_uint32(sccdev, "oscclk[1]", 24576000);
|
||||
qdev_prop_set_uint32(sccdev, "oscclk[2]", 25000000);
|
||||
sysbus_realize(SYS_BUS_DEVICE(scc), &error_fatal);
|
||||
return sysbus_mmio_get_region(SYS_BUS_DEVICE(sccdev), 0);
|
||||
}
|
||||
|
|
|
@ -373,6 +373,11 @@ static void mps2_common_init(MachineState *machine)
|
|||
qdev_prop_set_uint32(sccdev, "scc-cfg4", 0x2);
|
||||
qdev_prop_set_uint32(sccdev, "scc-aid", 0x00200008);
|
||||
qdev_prop_set_uint32(sccdev, "scc-id", mmc->scc_id);
|
||||
/* All these FPGA images have the same OSCCLK configuration */
|
||||
qdev_prop_set_uint32(sccdev, "len-oscclk", 3);
|
||||
qdev_prop_set_uint32(sccdev, "oscclk[0]", 50000000);
|
||||
qdev_prop_set_uint32(sccdev, "oscclk[1]", 24576000);
|
||||
qdev_prop_set_uint32(sccdev, "oscclk[2]", 25000000);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&mms->scc), &error_fatal);
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(sccdev), 0, 0x4002f000);
|
||||
object_initialize_child(OBJECT(mms), "fpgaio",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue