From ce14710f4fdfca32123d7efd3ddcbee984ef0ae5 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Fri, 8 Mar 2019 10:46:10 +0100 Subject: pflash: Clean up after commit 368a354f02b, part 2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Laszlo Ersek Reviewed-by: Alex Bennée Message-Id: <20190308094610.21210-16-armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daudé --- hw/sh4/r2d.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'hw/sh4') diff --git a/hw/sh4/r2d.c b/hw/sh4/r2d.c index 7d89c6d..0bcb769 100644 --- a/hw/sh4/r2d.c +++ b/hw/sh4/r2d.c @@ -299,8 +299,7 @@ static void r2d_init(MachineState *machine) dinfo = drive_get(IF_PFLASH, 0, 0); pflash_cfi02_register(0x0, "r2d.flash", FLASH_SIZE, dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, - 64 * KiB, FLASH_SIZE >> 16, - 1, 2, 0x0001, 0x227e, 0x2220, 0x2200, + 64 * KiB, 1, 2, 0x0001, 0x227e, 0x2220, 0x2200, 0x555, 0x2aa, 0); /* NIC: rtl8139 on-board, and 2 slots. */ -- cgit v1.1