aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2021-02-15 11:51:29 +0000
committerPeter Maydell <peter.maydell@linaro.org>2021-03-05 15:17:37 +0000
commiteb5180505bfb1e74b5b5e3ea90d0d61951392765 (patch)
tree1bc96bb34bbfa80cae2fc2ab5c9f1e0720b1fa99
parentb67f1b67c44e6bb75d5843a4360365b1262f4a6a (diff)
hw/arm/mps2-tz: Allow boards to have different PPCInfo data
The AN505 and AN521 have the same device layout, but the AN524 is somewhat different. Allow for more than one PPCInfo array, which can be selected based on the board type. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20210215115138.20465-16-peter.maydell@linaro.org
-rw-r--r--hw/arm/mps2-tz.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/hw/arm/mps2-tz.c b/hw/arm/mps2-tz.c
index 1c1fc34dd5..d20b206886 100644
--- a/hw/arm/mps2-tz.c
+++ b/hw/arm/mps2-tz.c
@@ -423,6 +423,8 @@ static void mps2tz_common_init(MachineState *machine)
MemoryRegion *system_memory = get_system_memory();
DeviceState *iotkitdev;
DeviceState *dev_splitter;
+ const PPCInfo *ppcs;
+ int num_ppcs;
int i;
if (strcmp(machine->cpu_type, mc->default_cpu_type) != 0) {
@@ -544,7 +546,7 @@ static void mps2tz_common_init(MachineState *machine)
* + wire up the PPC's control lines to the IoTKit object
*/
- const PPCInfo ppcs[] = { {
+ const PPCInfo an505_ppcs[] = { {
.name = "apb_ppcexp0",
.ports = {
{ "ssram-0", make_mpc, &mms->ssram_mpc[0], 0x58007000, 0x1000 },
@@ -598,7 +600,17 @@ static void mps2tz_common_init(MachineState *machine)
},
};
- for (i = 0; i < ARRAY_SIZE(ppcs); i++) {
+ switch (mmc->fpga_type) {
+ case FPGA_AN505:
+ case FPGA_AN521:
+ ppcs = an505_ppcs;
+ num_ppcs = ARRAY_SIZE(an505_ppcs);
+ break;
+ default:
+ g_assert_not_reached();
+ }
+
+ for (i = 0; i < num_ppcs; i++) {
const PPCInfo *ppcinfo = &ppcs[i];
TZPPC *ppc = &mms->ppc[i];
DeviceState *ppcdev;