mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
pflash: Clean up after commit 368a354f02
, 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>
This commit is contained in:
parent
940d5b132f
commit
ce14710f4f
23 changed files with 35 additions and 52 deletions
|
@ -155,8 +155,7 @@ static void sx1_init(MachineState *machine, const int version)
|
|||
if (!pflash_cfi01_register(OMAP_CS0_BASE,
|
||||
"omap_sx1.flash0-1", flash_size,
|
||||
blk_by_legacy_dinfo(dinfo),
|
||||
sector_size, flash_size / sector_size,
|
||||
4, 0, 0, 0, 0, be)) {
|
||||
sector_size, 4, 0, 0, 0, 0, be)) {
|
||||
fprintf(stderr, "qemu: Error registering flash memory %d.\n",
|
||||
fl_idx);
|
||||
}
|
||||
|
@ -179,8 +178,7 @@ static void sx1_init(MachineState *machine, const int version)
|
|||
if (!pflash_cfi01_register(OMAP_CS1_BASE,
|
||||
"omap_sx1.flash1-1", flash1_size,
|
||||
blk_by_legacy_dinfo(dinfo),
|
||||
sector_size, flash1_size / sector_size,
|
||||
4, 0, 0, 0, 0, be)) {
|
||||
sector_size, 4, 0, 0, 0, 0, be)) {
|
||||
fprintf(stderr, "qemu: Error registering flash memory %d.\n",
|
||||
fl_idx);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue