[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 18/24] hw/arm/mps2-tz: Support ROMs as well as RAMs
From: |
Peter Maydell |
Subject: |
[PATCH 18/24] hw/arm/mps2-tz: Support ROMs as well as RAMs |
Date: |
Fri, 5 Feb 2021 17:00:13 +0000 |
The AN505 and AN521 don't have any read-only memory, but the AN524
does; add a flag to ROMInfo to mark a region as ROM.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
hw/arm/mps2-tz.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/hw/arm/mps2-tz.c b/hw/arm/mps2-tz.c
index b46b32746e0..ce5e804c734 100644
--- a/hw/arm/mps2-tz.c
+++ b/hw/arm/mps2-tz.c
@@ -92,8 +92,10 @@ typedef struct RAMInfo {
* Flag values:
* IS_ALIAS: this RAM area is an alias to the upstream end of the
* MPC specified by its .mpc value
+ * IS_ROM: this RAM area is read-only
*/
#define IS_ALIAS 1
+#define IS_ROM 2
struct MPS2TZMachineClass {
MachineClass parent;
@@ -209,6 +211,7 @@ static MemoryRegion *mr_for_raminfo(MPS2TZMachineState *mms,
if (raminfo->mrindex < 0) {
/* Means this RAMInfo is for QEMU's "system memory" */
MachineState *machine = MACHINE(mms);
+ assert(!(raminfo->flags & IS_ROM));
return machine->ram;
}
@@ -217,6 +220,9 @@ static MemoryRegion *mr_for_raminfo(MPS2TZMachineState *mms,
memory_region_init_ram(ram, NULL, raminfo->name,
raminfo->size, &error_fatal);
+ if (raminfo->flags & IS_ROM) {
+ memory_region_set_readonly(ram, true);
+ }
return ram;
}
--
2.20.1
- [PATCH 19/24] hw/arm/mps2-tz: Get armv7m_load_kernel() size argument from RAMInfo, (continued)
- [PATCH 19/24] hw/arm/mps2-tz: Get armv7m_load_kernel() size argument from RAMInfo, Peter Maydell, 2021/02/05
- [PATCH 13/24] hw/arm/mps2-tz: Move device IRQ info to data structures, Peter Maydell, 2021/02/05
- [PATCH 20/24] hw/arm/mps2-tz: Add new mps3-an524 board, Peter Maydell, 2021/02/05
- [PATCH 22/24] hw/arm/mps2-tz: Provide PL031 RTC on mps3-an524, Peter Maydell, 2021/02/05
- [PATCH 23/24] docs/system/arm/mps2.rst: Document the new mps3-an524 board, Peter Maydell, 2021/02/05
- [PATCH 18/24] hw/arm/mps2-tz: Support ROMs as well as RAMs,
Peter Maydell <=
- [PATCH 15/24] hw/arm/mps2-tz: Allow boards to have different PPCInfo data, Peter Maydell, 2021/02/05
- [PATCH 24/24] hw/arm/mps2: Update old infocenter.arm.com URLs, Peter Maydell, 2021/02/05
- [PATCH 16/24] hw/arm/mps2-tz: Make RAM arrangement board-specific, Peter Maydell, 2021/02/05
- [PATCH 21/24] hw/arm/mps2-tz: Stub out USB controller for mps3-an524, Peter Maydell, 2021/02/05
- [PATCH 17/24] hw/arm/mps2-tz: Set MachineClass default_ram info from RAMInfo data, Peter Maydell, 2021/02/05
- [PATCH 14/24] hw/arm/mps2-tz: Size the uart-irq-orgate based on the number of UARTs, Peter Maydell, 2021/02/05
- [PATCH 12/24] hw/arm/mps2-tz: Allow PPCPortInfo structures to specify device interrupts, Peter Maydell, 2021/02/05
- Re: [PATCH 00/24] hw/arm: New board model mps3-an524, Philippe Mathieu-Daudé, 2021/02/05