Skip to content

Commit aaa5f95

Browse files
committed
qemu: Pull in fixes for ARM MPS2/3 platform
Pull patch series from upstream QEMU for: hw/arm: Fix modelling of SSE-300 TCMs and SRAM https://patchwork.kernel.org/project/qemu-devel/list/?series=479755 Signed-off-by: Kumar Gala <[email protected]>
1 parent 1a20acf commit aaa5f95

18 files changed

+528
-42
lines changed

meta-zephyr-sdk/recipes-devtools/qemu/files/0001-hw-misc-mps2-scc-Add-QEMU-interface-comment.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From e7e98396465486ba1dba055c54fb9ee258a159d1 Mon Sep 17 00:00:00 2001
1+
From 4455b24e9b396bcf3bcf90ccf7453af28aff5a82 Mon Sep 17 00:00:00 2001
22
From: Peter Maydell <[email protected]>
33
Date: Mon, 12 Apr 2021 14:43:15 +0100
4-
Subject: [PATCH 01/10] hw/misc/mps2-scc: Add "QEMU interface" comment
4+
Subject: [PATCH 01/16] hw/misc/mps2-scc: Add "QEMU interface" comment
55

66
The MPS2 SCC device doesn't have any documentation of its properties;
77
add a "QEMU interface" format comment describing them.

meta-zephyr-sdk/recipes-devtools/qemu/files/0002-hw-misc-mps2-scc-Support-using-CFG0-bit-0-for-remapp.patch

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
From 91b5b1545419eb1954421b9c25e90f6475a8f521 Mon Sep 17 00:00:00 2001
1+
From 6c88579eb30dc6e81bca150ba6be00547cc37185 Mon Sep 17 00:00:00 2001
22
From: Peter Maydell <[email protected]>
3-
Date: Mon, 12 Apr 2021 14:43:16 +0100
4-
Subject: [PATCH 02/10] hw/misc/mps2-scc: Support using CFG0 bit 0 for
3+
Date: Tue, 4 May 2021 13:09:11 +0100
4+
Subject: [PATCH 02/16] hw/misc/mps2-scc: Support using CFG0 bit 0 for
55
remapping
6+
MIME-Version: 1.0
7+
Content-Type: text/plain; charset=UTF-8
8+
Content-Transfer-Encoding: 8bit
69

710
On some boards, SCC config register CFG0 bit 0 controls whether
811
parts of the board memory map are remapped. Support this with:
@@ -13,6 +16,8 @@ parts of the board memory map are remapped. Support this with:
1316

1417
Signed-off-by: Peter Maydell <[email protected]>
1518
Reviewed-by: Richard Henderson <[email protected]>
19+
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
20+
Message-id: [email protected]
1621
---
1722
hw/misc/mps2-scc.c | 13 ++++++++++---
1823
include/hw/misc/mps2-scc.h | 9 +++++++++

meta-zephyr-sdk/recipes-devtools/qemu/files/0003-hw-arm-mps2-tz-Implement-AN524-memory-remapping-via-.patch

Lines changed: 34 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,25 @@
1-
From 6c3dcb888a263dec0d0e47faf82f095204c1d32c Mon Sep 17 00:00:00 2001
1+
From aefcd8789c4046d9612629060a6c8b0b98af753a Mon Sep 17 00:00:00 2001
22
From: Peter Maydell <[email protected]>
3-
Date: Mon, 12 Apr 2021 14:43:17 +0100
4-
Subject: [PATCH 03/10] hw/arm/mps2-tz: Implement AN524 memory remapping via
3+
Date: Tue, 4 May 2021 13:09:12 +0100
4+
Subject: [PATCH 03/16] hw/arm/mps2-tz: Implement AN524 memory remapping via
55
machine property
6+
MIME-Version: 1.0
7+
Content-Type: text/plain; charset=UTF-8
8+
Content-Transfer-Encoding: 8bit
69

7-
The AN524 FPGA image supports two memory maps, which differ
8-
in where the QSPI and BRAM are. In the default map, the BRAM
9-
is at 0x0000_0000, and the QSPI at 0x2800_0000. In the second
10-
map, they are the other way around.
10+
The AN524 FPGA image supports two memory maps, which differ in where
11+
the QSPI and BRAM are. In the default map, the BRAM is at
12+
0x0000_0000, and the QSPI at 0x2800_0000. In the second map, they
13+
are the other way around.
1114

12-
In hardware, the initial mapping can be selected by the user
13-
by writing either "REMAP: BRAM" (the default) or "REMAP: QSPI"
14-
in the board configuration file. The guest can also dynamically
15-
change the mapping via the SCC CFG_REG0 register.
15+
In hardware, the initial mapping can be selected by the user by
16+
writing either "REMAP: BRAM" (the default) or "REMAP: QSPI" in the
17+
board configuration file. The board config file is acted on by the
18+
"Motherboard Configuration Controller", which is an entirely separate
19+
microcontroller on the dev board but outside the FPGA.
20+
21+
The guest can also dynamically change the mapping via the SCC
22+
CFG_REG0 register.
1623

1724
Implement this functionality for QEMU, using a machine property
1825
"remap" with valid values "BRAM" and "QSPI" to allow the user to set
@@ -21,10 +28,12 @@ wiring up the bit from the SCC register to also switch the mapping.
2128

2229
Signed-off-by: Peter Maydell <[email protected]>
2330
Reviewed-by: Richard Henderson <[email protected]>
31+
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
32+
Message-id: [email protected]
2433
---
2534
docs/system/arm/mps2.rst | 10 ++++
26-
hw/arm/mps2-tz.c | 106 ++++++++++++++++++++++++++++++++++++++-
27-
2 files changed, 115 insertions(+), 1 deletion(-)
35+
hw/arm/mps2-tz.c | 108 ++++++++++++++++++++++++++++++++++++++-
36+
2 files changed, 117 insertions(+), 1 deletion(-)
2837

2938
diff --git a/docs/system/arm/mps2.rst b/docs/system/arm/mps2.rst
3039
index f83b151787..8a75beb3a0 100644
@@ -45,7 +54,7 @@ index f83b151787..8a75beb3a0 100644
4554
+ Set ``BRAM``/``QSPI`` to select the initial memory mapping. The
4655
+ default is ``BRAM``.
4756
diff --git a/hw/arm/mps2-tz.c b/hw/arm/mps2-tz.c
48-
index 25016e464d..e980677932 100644
57+
index 25016e464d..70aa31a7f6 100644
4958
--- a/hw/arm/mps2-tz.c
5059
+++ b/hw/arm/mps2-tz.c
5160
@@ -55,6 +55,7 @@
@@ -69,7 +78,7 @@ index 25016e464d..e980677932 100644
6978
Clock *sysclk;
7079
Clock *s32kclk;
7180
+
72-
+ int remap;
81+
+ bool remap;
7382
+ qemu_irq remap_irq;
7483
};
7584

@@ -89,11 +98,11 @@ index 25016e464d..e980677932 100644
8998

9099
object_initialize_child(OBJECT(mms), "scc", scc, TYPE_MPS2_SCC);
91100
sccdev = DEVICE(scc);
92-
+ qdev_prop_set_uint32(sccdev, "scc-cfg0", mms->remap);
101+
+ qdev_prop_set_uint32(sccdev, "scc-cfg0", mms->remap ? 1 : 0);
93102
qdev_prop_set_uint32(sccdev, "scc-cfg4", 0x2);
94103
qdev_prop_set_uint32(sccdev, "scc-aid", 0x00200008);
95104
qdev_prop_set_uint32(sccdev, "scc-id", mmc->scc_id);
96-
@@ -573,6 +583,50 @@ static MemoryRegion *make_mpc(MPS2TZMachineState *mms, void *opaque,
105+
@@ -573,6 +583,52 @@ static MemoryRegion *make_mpc(MPS2TZMachineState *mms, void *opaque,
97106
return sysbus_mmio_get_region(SYS_BUS_DEVICE(mpc), 0);
98107
}
99108

@@ -125,13 +134,15 @@ index 25016e464d..e980677932 100644
125134
+ return;
126135
+ }
127136
+
137+
+ memory_region_transaction_begin();
128138
+ for (i = 0; i < 2; i++) {
129139
+ TZMPC *mpc = &mms->mpc[i];
130140
+ MemoryRegion *upstream = sysbus_mmio_get_region(SYS_BUS_DEVICE(mpc), 1);
131141
+ hwaddr addr = (i ^ map) ? 0x28000000 : 0;
132142
+
133143
+ memory_region_set_address(upstream, addr);
134144
+ }
145+
+ memory_region_transaction_commit();
135146
+}
136147
+
137148
+static void remap_irq_fn(void *opaque, int n, int level)
@@ -144,7 +155,7 @@ index 25016e464d..e980677932 100644
144155
static MemoryRegion *make_dma(MPS2TZMachineState *mms, void *opaque,
145156
const char *name, hwaddr size,
146157
const int *irqs)
147-
@@ -711,7 +765,7 @@ static uint32_t boot_ram_size(MPS2TZMachineState *mms)
158+
@@ -711,7 +767,7 @@ static uint32_t boot_ram_size(MPS2TZMachineState *mms)
148159
MPS2TZMachineClass *mmc = MPS2TZ_MACHINE_GET_CLASS(mms);
149160

150161
for (p = mmc->raminfo; p->name; p++) {
@@ -153,7 +164,7 @@ index 25016e464d..e980677932 100644
153164
return p->size;
154165
}
155166
}
156-
@@ -1095,6 +1149,16 @@ static void mps2tz_common_init(MachineState *machine)
167+
@@ -1095,6 +1151,16 @@ static void mps2tz_common_init(MachineState *machine)
157168

158169
create_non_mpc_ram(mms);
159170

@@ -170,7 +181,7 @@ index 25016e464d..e980677932 100644
170181
armv7m_load_kernel(ARM_CPU(first_cpu), machine->kernel_filename,
171182
boot_ram_size(mms));
172183
}
173-
@@ -1117,12 +1181,47 @@ static void mps2_tz_idau_check(IDAUInterface *ii, uint32_t address,
184+
@@ -1117,12 +1183,47 @@ static void mps2_tz_idau_check(IDAUInterface *ii, uint32_t address,
174185
*iregion = region;
175186
}
176187

@@ -186,9 +197,9 @@ index 25016e464d..e980677932 100644
186197
+ MPS2TZMachineState *mms = MPS2TZ_MACHINE(obj);
187198
+
188199
+ if (!strcmp(value, "BRAM")) {
189-
+ mms->remap = 0;
200+
+ mms->remap = false;
190201
+ } else if (!strcmp(value, "QSPI")) {
191-
+ mms->remap = 1;
202+
+ mms->remap = true;
192203
+ } else {
193204
+ error_setg(errp, "Invalid remap value");
194205
+ error_append_hint(errp, "Valid values are BRAM and QSPI.\n");
@@ -218,7 +229,7 @@ index 25016e464d..e980677932 100644
218229
iic->check = mps2_tz_idau_check;
219230
}
220231

221-
@@ -1225,6 +1324,11 @@ static void mps3tz_an524_class_init(ObjectClass *oc, void *data)
232+
@@ -1225,6 +1326,11 @@ static void mps3tz_an524_class_init(ObjectClass *oc, void *data)
222233
mmc->raminfo = an524_raminfo;
223234
mmc->armsse_type = TYPE_SSE200;
224235
mps2tz_set_default_ram_info(mmc);

meta-zephyr-sdk/recipes-devtools/qemu/files/0004-qemu-nios2-Add-Altera-MAX-10-board-support-for-Zephy.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From 6f6b4209a4912f968685cddc19cc4906e2f61095 Mon Sep 17 00:00:00 2001
1+
From 28b2a8f91060dcf14bcfb9d60caa5caf399623a9 Mon Sep 17 00:00:00 2001
22
From: Kumar Gala <[email protected]>
33
Date: Thu, 25 Mar 2021 18:24:50 -0500
4-
Subject: [PATCH 04/10] qemu/nios2: Add Altera MAX 10 board support for Zephyr
4+
Subject: [PATCH 04/16] qemu/nios2: Add Altera MAX 10 board support for Zephyr
55
OS
66

77
Exisitng 10m50_devboard is not supporting qemu-niso2 on Zephyr OS

meta-zephyr-sdk/recipes-devtools/qemu/files/0005-hw-sparc-Add-leon-at697-machine.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From 5f4dc79eaffbf7acb14a72443e81ee42b683a923 Mon Sep 17 00:00:00 2001
1+
From d7e0be4e797c79198728a4b4d2dd6e7e7160bebf Mon Sep 17 00:00:00 2001
22
From: Yasushi SHOJI <[email protected]>
33
Date: Wed, 9 Mar 2016 12:22:16 +0100
4-
Subject: [PATCH 05/10] hw/sparc: Add leon (at697) machine
4+
Subject: [PATCH 05/16] hw/sparc: Add leon (at697) machine
55

66
This commit add LEON2 support. It is taken from AdaCore Qemu
77
repository at https://github.com/adacore/qemu.

meta-zephyr-sdk/recipes-devtools/qemu/files/0006-hw-sparc-leon-Fix-compilation-errors.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From fb227dfc09dbaf347c982072203f625dde24c1d1 Mon Sep 17 00:00:00 2001
1+
From d6f7f09579a55c28fc29e57dc28ea03d3b2211ac Mon Sep 17 00:00:00 2001
22
From: Yasushi SHOJI <[email protected]>
33
Date: Thu, 5 Sep 2019 11:06:56 +0900
4-
Subject: [PATCH 06/10] hw/sparc/leon: Fix compilation errors
4+
Subject: [PATCH 06/16] hw/sparc/leon: Fix compilation errors
55

66
The previous commit, taken from AdaCore repository as is for future
77
reference, depends on other commit in the AdaCore repository and fails

meta-zephyr-sdk/recipes-devtools/qemu/files/0007-hw-sparc-leon-timer-Call-leon_timer_io_read-for-TIME.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From 5d266778f1d36d200cf07e15d82a885d398ce1a9 Mon Sep 17 00:00:00 2001
1+
From bdd73723d04fa722c56659e0bd2ed44a1ce4c108 Mon Sep 17 00:00:00 2001
22
From: Yasushi SHOJI <[email protected]>
33
Date: Fri, 17 May 2019 21:42:30 +0900
4-
Subject: [PATCH 07/10] hw/sparc/leon: timer: Call leon_timer_io_read() for
4+
Subject: [PATCH 07/16] hw/sparc/leon: timer: Call leon_timer_io_read() for
55
TIMER_1_COUNTER_REGISTER
66

77
Accessing timer1 counter register (offset 0x40) always returned 0

meta-zephyr-sdk/recipes-devtools/qemu/files/0008-hw-sparc-leon-Switch-to-transaction-based-ptimer-API.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From b1143ad203d22cbe2ab1af20b7f2ee3ae7451dbb Mon Sep 17 00:00:00 2001
1+
From a64a2a59b1637d1d06b1286802f756241f6e5546 Mon Sep 17 00:00:00 2001
22
From: Yasushi SHOJI <[email protected]>
33
Date: Mon, 9 Dec 2019 11:56:20 +0900
4-
Subject: [PATCH 08/10] hw/sparc/leon: Switch to transaction-based ptimer API
4+
Subject: [PATCH 08/16] hw/sparc/leon: Switch to transaction-based ptimer API
55

66
Switch the leon code away from old ptimers to the new
77
transaction-based ptimer API. This requires adding begin/commit calls

meta-zephyr-sdk/recipes-devtools/qemu/files/0009-hw-sparc-leon-Fix-compilation-errors-with-qemu-6-cha.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From e955eabb3289dd3584a997a0671dda44f0a5ecb0 Mon Sep 17 00:00:00 2001
1+
From fb9a3921040b1115db534f88a74997bffe3204be Mon Sep 17 00:00:00 2001
22
From: Kumar Gala <[email protected]>
33
Date: Thu, 25 Mar 2021 18:59:10 -0500
4-
Subject: [PATCH 09/10] hw/sparc/leon: Fix compilation errors with qemu 6
4+
Subject: [PATCH 09/16] hw/sparc/leon: Fix compilation errors with qemu 6
55
changes
66

77
Make updates to build due to upstream changes in qemu 6.0.0

meta-zephyr-sdk/recipes-devtools/qemu/files/0010-Add-ARC-support.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From 4970a86a1fce6420903f3b9dfdeb4bd0c8be5e8e Mon Sep 17 00:00:00 2001
1+
From c42894f665c808526bbec2659883e303ae15ef9b Mon Sep 17 00:00:00 2001
22
From: Alexey Brodkin <[email protected]>
33
Date: Fri, 16 Apr 2021 20:15:42 +0300
4-
Subject: [PATCH 10/10] Add ARC support
4+
Subject: [PATCH 10/16] Add ARC support
55

66
Signed-off-by: Alexey Brodkin <[email protected]>
77
---

0 commit comments

Comments
 (0)