[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH 06/10] r2d: Flash memory creation is confused about si
From: |
Markus Armbruster |
Subject: |
[Qemu-ppc] [PATCH 06/10] r2d: Flash memory creation is confused about size, mark FIXME |
Date: |
Mon, 18 Feb 2019 13:56:11 +0100 |
pflash_cfi02_register() takes a size in bytes, a block size in bytes
and a number of blocks. r2d_init() passes FLASH_SIZE, 16 * KiB,
FLASH_SIZE >> 16. Does not compute: size doesn't match block size *
number of blocks. The latter happens to win. I tried to find
documentation on the physcial hardware, no luck.
For now, adjust the byte size passed to match the actual size created,
and add a FIXME comment.
Cc: Magnus Damm <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
---
hw/sh4/r2d.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/hw/sh4/r2d.c b/hw/sh4/r2d.c
index dcdb3728cb..ed18d1f351 100644
--- a/hw/sh4/r2d.c
+++ b/hw/sh4/r2d.c
@@ -290,7 +290,14 @@ static void r2d_init(MachineState *machine)
/* onboard flash memory */
dinfo = drive_get(IF_PFLASH, 0, 0);
- pflash_cfi02_register(0x0, NULL, "r2d.flash", FLASH_SIZE,
+ /*
+ * FIXME The code is confused about the size of the flash. It
+ * used to pass FLASH_SIZE bytes, in FLASH_SIZE >> 16 blocks of
+ * 16KiB each, which does not compute, but creates one of
+ * FLASH_SIZE / 4 bytes anyway. The current code does so too, but
+ * whether it's the right size is anybody's guess.
+ */
+ pflash_cfi02_register(0x0, NULL, "r2d.flash", FLASH_SIZE / 4,
dinfo ? blk_by_legacy_dinfo(dinfo) : NULL,
16 * KiB, FLASH_SIZE >> 16,
1, 4, 0x0000, 0x0000, 0x0000, 0x0000,
--
2.17.2
- [Qemu-ppc] [PATCH 03/10] hw: Use CFI_PFLASH0{1, 2} and TYPE_CFI_PFLASH0{1, 2}, (continued)
- [Qemu-ppc] [PATCH 03/10] hw: Use CFI_PFLASH0{1, 2} and TYPE_CFI_PFLASH0{1, 2}, Markus Armbruster, 2019/02/18
- Re: [Qemu-ppc] [PATCH 03/10] hw: Use CFI_PFLASH0{1, 2} and TYPE_CFI_PFLASH0{1, 2}, Laszlo Ersek, 2019/02/18
- Re: [Qemu-ppc] [Qemu-devel] [PATCH 03/10] hw: Use CFI_PFLASH0{1, 2} and TYPE_CFI_PFLASH0{1, 2}, Philippe Mathieu-Daudé, 2019/02/19
- Re: [Qemu-ppc] [PATCH 03/10] hw: Use CFI_PFLASH0{1, 2} and TYPE_CFI_PFLASH0{1, 2}, Alex Bennée, 2019/02/21
- [Qemu-ppc] [PATCH 10/10] hw/arm hw/xtensa: De-duplicate pflash creation code some, Markus Armbruster, 2019/02/18
- [Qemu-ppc] [PATCH 06/10] r2d: Flash memory creation is confused about size, mark FIXME,
Markus Armbruster <=
- Re: [Qemu-ppc] [Qemu-devel] [PATCH 06/10] r2d: Flash memory creation is confused about size, mark FIXME, Philippe Mathieu-Daudé, 2019/02/19
[Qemu-ppc] [PATCH 07/10] mips_malta: Clean up definition of flash memory size somewhat, Markus Armbruster, 2019/02/18