Instead of using a device specific feature for mapping the
flash memory multiple times over a wider region, use the
generic memory_region_add_subregion_aliased() helper.
There is no change in the memory layout.
* before:
$ qemu-system-arm -M canon-a1100 -S -monitor stdio
QEMU 5.2.90 monitor - type 'help' for more information
(qemu) info mtree
address-space: memory
0000000000000000-ffffffffffffffff (prio 0, i/o): system
0000000000000000-0000000003ffffff (prio 0, ram): ram
00000000c0210000-00000000c02100ff (prio 0, i/o): digic-timer
00000000c0210100-00000000c02101ff (prio 0, i/o): digic-timer
00000000c0210200-00000000c02102ff (prio 0, i/o): digic-timer
00000000c0800000-00000000c0800017 (prio 0, i/o): digic-uart
00000000f8000000-00000000ffffffff (prio 0, i/o): pflash
00000000f8000000-00000000f83fffff (prio 0, romd): alias pflash-alias
@pflash 0000000000000000-00000000003fffff
00000000f8400000-00000000f87fffff (prio 0, romd): alias pflash-alias
@pflash 0000000000000000-00000000003fffff
00000000f8800000-00000000f8bfffff (prio 0, romd): alias pflash-alias
@pflash 0000000000000000-00000000003fffff
...
00000000ff400000-00000000ff7fffff (prio 0, romd): alias pflash-alias
@pflash 0000000000000000-00000000003fffff
00000000ff800000-00000000ffbfffff (prio 0, romd): alias pflash-alias
@pflash 0000000000000000-00000000003fffff
00000000ffc00000-00000000ffffffff (prio 0, romd): alias pflash-alias
@pflash 0000000000000000-00000000003fffff
* after:
(qemu) info mtree
address-space: memory
0000000000000000-ffffffffffffffff (prio 0, i/o): system
0000000000000000-0000000003ffffff (prio 0, ram): ram
00000000c0210000-00000000c02100ff (prio 0, i/o): digic-timer
00000000c0210100-00000000c02101ff (prio 0, i/o): digic-timer
00000000c0210200-00000000c02102ff (prio 0, i/o): digic-timer
00000000c0800000-00000000c0800017 (prio 0, i/o): digic-uart
00000000f8000000-00000000ffffffff (prio 0, i/o): masked pflash [span of
4 MiB]
00000000f8000000-00000000f83fffff (prio 0, romd): alias pflash [#0/32]
@pflash 0000000000000000-00000000003fffff
00000000f8400000-00000000f87fffff (prio 0, romd): alias pflash [#1/32]
@pflash 0000000000000000-00000000003fffff
00000000f8800000-00000000f8bfffff (prio 0, romd): alias pflash [#2/32]
@pflash 0000000000000000-00000000003fffff
...
00000000ff400000-00000000ff7fffff (prio 0, romd): alias pflash
[#29/32] @pflash 0000000000000000-00000000003fffff
00000000ff800000-00000000ffbfffff (prio 0, romd): alias pflash
[#30/32] @pflash 0000000000000000-00000000003fffff
00000000ffc00000-00000000ffffffff (prio 0, romd): alias pflash
[#31/32] @pflash 0000000000000000-00000000003fffff
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
hw/arm/digic_boards.c | 8 +++++---
hw/arm/Kconfig | 1 +
2 files changed, 6 insertions(+), 3 deletions(-)