diff options
author | Markus Armbruster <armbru@redhat.com> | 2019-03-08 10:46:10 +0100 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2019-03-11 22:53:44 +0100 |
commit | ce14710f4fdfca32123d7efd3ddcbee984ef0ae5 (patch) | |
tree | 388b367cf788d97d74ba123bca43353e861af1a0 /hw/mips | |
parent | 940d5b132fab085bd8ec2bcfa5c1dd119785b217 (diff) |
pflash: Clean up after commit 368a354f02b, part 2
Our pflash devices are simplistically modelled has having
"num-blocks" sectors of equal size "sector-length". Real hardware
commonly has sectors of different sizes. How our "sector-length"
property is related to the physical device's multiple sector sizes
is unclear.
Helper functions pflash_cfi01_register() and pflash_cfi02_register()
create a pflash device, set properties including "sector-length" and
"num-blocks", and realize. They take parameters @size, @sector_len
and @nb_blocs.
QOMification left parameter @size unused. Obviously, @size should
match @sector_len and @nb_blocs, i.e. size == sector_len * nb_blocs.
All callers satisfy this.
Remove @nb_blocs and compute it from @size and @sector_len.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20190308094610.21210-16-armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Diffstat (limited to 'hw/mips')
-rw-r--r-- | hw/mips/mips_malta.c | 2 | ||||
-rw-r--r-- | hw/mips/mips_r4k.c | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index 69182962ef..439665ab45 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -1264,7 +1264,7 @@ void mips_malta_init(MachineState *machine) fl = pflash_cfi01_register(FLASH_ADDRESS, "mips_malta.bios", FLASH_SIZE, dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, - 65536, FLASH_SIZE >> 16, + 65536, 4, 0x0000, 0x0000, 0x0000, 0x0000, be); bios = pflash_cfi01_get_memory(fl); fl_idx++; diff --git a/hw/mips/mips_r4k.c b/hw/mips/mips_r4k.c index 0b9df466e7..93dbf76bb4 100644 --- a/hw/mips/mips_r4k.c +++ b/hw/mips/mips_r4k.c @@ -237,8 +237,7 @@ void mips_r4k_init(MachineState *machine) uint32_t mips_rom = 0x00400000; if (!pflash_cfi01_register(0x1fc00000, "mips_r4k.bios", mips_rom, blk_by_legacy_dinfo(dinfo), - sector_len, mips_rom / sector_len, - 4, 0, 0, 0, 0, be)) { + sector_len, 4, 0, 0, 0, 0, be)) { fprintf(stderr, "qemu: Error registering flash memory.\n"); } } else if (!qtest_enabled()) { |