aboutsummaryrefslogtreecommitdiff
path: root/hw/arm/mainstone.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2019-03-08 10:46:10 +0100
committerMarkus Armbruster <armbru@redhat.com>2019-03-11 22:53:44 +0100
commitce14710f4fdfca32123d7efd3ddcbee984ef0ae5 (patch)
tree388b367cf788d97d74ba123bca43353e861af1a0 /hw/arm/mainstone.c
parent940d5b132fab085bd8ec2bcfa5c1dd119785b217 (diff)
downloadqemu-ce14710f4fdfca32123d7efd3ddcbee984ef0ae5.zip
qemu-ce14710f4fdfca32123d7efd3ddcbee984ef0ae5.tar.gz
qemu-ce14710f4fdfca32123d7efd3ddcbee984ef0ae5.tar.bz2
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/arm/mainstone.c')
-rw-r--r--hw/arm/mainstone.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/hw/arm/mainstone.c b/hw/arm/mainstone.c
index 2a1c107..e96738a 100644
--- a/hw/arm/mainstone.c
+++ b/hw/arm/mainstone.c
@@ -152,8 +152,7 @@ static void mainstone_common_init(MemoryRegion *address_space_mem,
i ? "mainstone.flash1" : "mainstone.flash0",
MAINSTONE_FLASH,
blk_by_legacy_dinfo(dinfo),
- sector_len, MAINSTONE_FLASH / sector_len,
- 4, 0, 0, 0, 0, be)) {
+ sector_len, 4, 0, 0, 0, 0, be)) {
error_report("Error registering flash memory");
exit(1);
}