* [PULL 01/16] hw/i2c/aspeed: Fix old reg slave receive
2022-10-25 15:20 [PULL 00/16] aspeed queue Cédric Le Goater
@ 2022-10-25 15:20 ` Cédric Le Goater
2022-10-25 15:20 ` [PULL 02/16] tests/avocado/machine_aspeed.py: Fix typos on buildroot Cédric Le Goater
` (15 subsequent siblings)
16 siblings, 0 replies; 21+ messages in thread
From: Cédric Le Goater @ 2022-10-25 15:20 UTC (permalink / raw)
To: qemu-arm, qemu-devel
Cc: Peter Maydell, Joel Stanley, Alistair Francis,
Philippe Mathieu-Daudé, qemu-block, Peter Delevoryas,
Klaus Jensen, Cédric Le Goater
From: Peter Delevoryas <peter@pjd.dev>
I think when Klaus ported his slave mode changes from the original patch
series to the rewritten I2C module, he changed the behavior of the first
byte that is received by the slave device.
What's supposed to happen is that the AspeedI2CBus's slave device's
i2c_event callback should run, and if the event is "send_async", then it
should populate the byte buffer with the 8-bit I2C address that is being
sent to. Since we only support "send_async", the lowest bit should
always be 0 (indicating that the master is requesting to send data).
This is the code Klaus had previously, for reference. [1]
switch (event) {
case I2C_START_SEND:
bus->buf = bus->dev_addr << 1;
bus->buf &= I2CD_BYTE_BUF_RX_MASK;
bus->buf <<= I2CD_BYTE_BUF_RX_SHIFT;
bus->intr_status |= (I2CD_INTR_SLAVE_ADDR_RX_MATCH | I2CD_INTR_RX_DONE);
aspeed_i2c_set_state(bus, I2CD_STXD);
break;
[1]: https://lore.kernel.org/qemu-devel/20220331165737.1073520-4-its@irrelevant.dk/
Fixes: a8d48f59cd021b25 ("hw/i2c/aspeed: add slave device in old register mode")
Signed-off-by: Peter Delevoryas <peter@pjd.dev>
Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
Message-Id: <20220820225712.713209-2-peter@pjd.dev>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
include/hw/i2c/aspeed_i2c.h | 1 +
hw/i2c/aspeed_i2c.c | 8 +++++---
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/include/hw/i2c/aspeed_i2c.h b/include/hw/i2c/aspeed_i2c.h
index 300a89b34301..adc904d6c1f8 100644
--- a/include/hw/i2c/aspeed_i2c.h
+++ b/include/hw/i2c/aspeed_i2c.h
@@ -130,6 +130,7 @@ REG32(I2CD_CMD, 0x14) /* I2CD Command/Status */
SHARED_FIELD(M_TX_CMD, 1, 1)
SHARED_FIELD(M_START_CMD, 0, 1)
REG32(I2CD_DEV_ADDR, 0x18) /* Slave Device Address */
+ SHARED_FIELD(SLAVE_DEV_ADDR1, 0, 7)
REG32(I2CD_POOL_CTRL, 0x1C) /* Pool Buffer Control */
SHARED_FIELD(RX_COUNT, 24, 5)
SHARED_FIELD(RX_SIZE, 16, 5)
diff --git a/hw/i2c/aspeed_i2c.c b/hw/i2c/aspeed_i2c.c
index 42c6d69b82f0..c166fd20fa11 100644
--- a/hw/i2c/aspeed_i2c.c
+++ b/hw/i2c/aspeed_i2c.c
@@ -1131,7 +1131,9 @@ static int aspeed_i2c_bus_slave_event(I2CSlave *slave, enum i2c_event event)
AspeedI2CBus *bus = ASPEED_I2C_BUS(qbus->parent);
uint32_t reg_intr_sts = aspeed_i2c_bus_intr_sts_offset(bus);
uint32_t reg_byte_buf = aspeed_i2c_bus_byte_buf_offset(bus);
- uint32_t value;
+ uint32_t reg_dev_addr = aspeed_i2c_bus_dev_addr_offset(bus);
+ uint32_t dev_addr = SHARED_ARRAY_FIELD_EX32(bus->regs, reg_dev_addr,
+ SLAVE_DEV_ADDR1);
if (aspeed_i2c_is_new_mode(bus->controller)) {
return aspeed_i2c_bus_new_slave_event(bus, event);
@@ -1139,8 +1141,8 @@ static int aspeed_i2c_bus_slave_event(I2CSlave *slave, enum i2c_event event)
switch (event) {
case I2C_START_SEND_ASYNC:
- value = SHARED_ARRAY_FIELD_EX32(bus->regs, reg_byte_buf, TX_BUF);
- SHARED_ARRAY_FIELD_DP32(bus->regs, reg_byte_buf, RX_BUF, value << 1);
+ /* Bit[0] == 0 indicates "send". */
+ SHARED_ARRAY_FIELD_DP32(bus->regs, reg_byte_buf, RX_BUF, dev_addr << 1);
ARRAY_FIELD_DP32(bus->regs, I2CD_INTR_STS, SLAVE_ADDR_RX_MATCH, 1);
SHARED_ARRAY_FIELD_DP32(bus->regs, reg_intr_sts, RX_DONE, 1);
--
2.37.3
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PULL 02/16] tests/avocado/machine_aspeed.py: Fix typos on buildroot
2022-10-25 15:20 [PULL 00/16] aspeed queue Cédric Le Goater
2022-10-25 15:20 ` [PULL 01/16] hw/i2c/aspeed: Fix old reg slave receive Cédric Le Goater
@ 2022-10-25 15:20 ` Cédric Le Goater
2022-10-25 15:20 ` [PULL 03/16] ssi: cache SSIPeripheralClass to avoid GET_CLASS() Cédric Le Goater
` (14 subsequent siblings)
16 siblings, 0 replies; 21+ messages in thread
From: Cédric Le Goater @ 2022-10-25 15:20 UTC (permalink / raw)
To: qemu-arm, qemu-devel
Cc: Peter Maydell, Joel Stanley, Alistair Francis,
Philippe Mathieu-Daudé, qemu-block, Cédric Le Goater,
Thomas Huth, Richard Henderson
Replace 'buidroot' and 'builroot' by 'buildroot'.
Fixes: f7bc7da0724f ("test/avocado/machine_aspeed.py: Add tests using buildroot images")
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Message-Id: <20220923084803.498337-2-clg@kaod.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
tests/avocado/machine_aspeed.py | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/tests/avocado/machine_aspeed.py b/tests/avocado/machine_aspeed.py
index 124649a24b58..fba652702681 100644
--- a/tests/avocado/machine_aspeed.py
+++ b/tests/avocado/machine_aspeed.py
@@ -92,7 +92,7 @@ def test_arm_ast2500_romulus_openbmc_v2_9_0(self):
self.do_test_arm_aspeed(image_path)
- def do_test_arm_aspeed_buidroot_start(self, image, cpu_id):
+ def do_test_arm_aspeed_buildroot_start(self, image, cpu_id):
self.require_netdev('user')
self.vm.set_console()
@@ -111,11 +111,11 @@ def do_test_arm_aspeed_buidroot_start(self, image, cpu_id):
exec_command(self, 'root')
time.sleep(0.1)
- def do_test_arm_aspeed_buidroot_poweroff(self):
+ def do_test_arm_aspeed_buildroot_poweroff(self):
exec_command_and_wait_for_pattern(self, 'poweroff',
'reboot: System halted');
- def test_arm_ast2500_evb_builroot(self):
+ def test_arm_ast2500_evb_buildroot(self):
"""
:avocado: tags=arch:arm
:avocado: tags=machine:ast2500-evb
@@ -129,7 +129,7 @@ def test_arm_ast2500_evb_builroot(self):
self.vm.add_args('-device',
'tmp105,bus=aspeed.i2c.bus.3,address=0x4d,id=tmp-test');
- self.do_test_arm_aspeed_buidroot_start(image_path, '0x0')
+ self.do_test_arm_aspeed_buildroot_start(image_path, '0x0')
exec_command_and_wait_for_pattern(self,
'echo lm75 0x4d > /sys/class/i2c-dev/i2c-3/device/new_device',
@@ -141,9 +141,9 @@ def test_arm_ast2500_evb_builroot(self):
exec_command_and_wait_for_pattern(self,
'cat /sys/class/hwmon/hwmon1/temp1_input', '18000')
- self.do_test_arm_aspeed_buidroot_poweroff()
+ self.do_test_arm_aspeed_buildroot_poweroff()
- def test_arm_ast2600_evb_builroot(self):
+ def test_arm_ast2600_evb_buildroot(self):
"""
:avocado: tags=arch:arm
:avocado: tags=machine:ast2600-evb
@@ -159,7 +159,7 @@ def test_arm_ast2600_evb_builroot(self):
'tmp105,bus=aspeed.i2c.bus.3,address=0x4d,id=tmp-test');
self.vm.add_args('-device',
'ds1338,bus=aspeed.i2c.bus.3,address=0x32');
- self.do_test_arm_aspeed_buidroot_start(image_path, '0xf00')
+ self.do_test_arm_aspeed_buildroot_start(image_path, '0xf00')
exec_command_and_wait_for_pattern(self,
'echo lm75 0x4d > /sys/class/i2c-dev/i2c-3/device/new_device',
@@ -177,7 +177,7 @@ def test_arm_ast2600_evb_builroot(self):
year = time.strftime("%Y")
exec_command_and_wait_for_pattern(self, 'hwclock -f /dev/rtc1', year);
- self.do_test_arm_aspeed_buidroot_poweroff()
+ self.do_test_arm_aspeed_buildroot_poweroff()
class AST2x00MachineSDK(QemuSystemTest):
--
2.37.3
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PULL 03/16] ssi: cache SSIPeripheralClass to avoid GET_CLASS()
2022-10-25 15:20 [PULL 00/16] aspeed queue Cédric Le Goater
2022-10-25 15:20 ` [PULL 01/16] hw/i2c/aspeed: Fix old reg slave receive Cédric Le Goater
2022-10-25 15:20 ` [PULL 02/16] tests/avocado/machine_aspeed.py: Fix typos on buildroot Cédric Le Goater
@ 2022-10-25 15:20 ` Cédric Le Goater
2023-05-12 4:02 ` Philippe Mathieu-Daudé
2022-10-25 15:20 ` [PULL 04/16] aspeed/smc: Cache AspeedSMCClass Cédric Le Goater
` (13 subsequent siblings)
16 siblings, 1 reply; 21+ messages in thread
From: Cédric Le Goater @ 2022-10-25 15:20 UTC (permalink / raw)
To: qemu-arm, qemu-devel
Cc: Peter Maydell, Joel Stanley, Alistair Francis,
Philippe Mathieu-Daudé, qemu-block, Alex Bennée,
Cédric Le Goater
From: Alex Bennée <alex.bennee@linaro.org>
Investigating why some BMC models are so slow compared to a plain ARM
virt machines I did some profiling of:
./qemu-system-arm -M romulus-bmc -nic user \
-drive
file=obmc-phosphor-image-romulus.static.mtd,format=raw,if=mtd \
-nographic -serial mon:stdio
And saw that object_class_dynamic_cast_assert was dominating the
profile times. We have a number of cases in this model of the SSI bus.
As the class is static once the object is created we just cache it and
use it instead of the dynamic case macros.
Profiling against:
./tests/venv/bin/avocado run \
tests/avocado/machine_aspeed.py:test_arm_ast2500_romulus_openbmc_v2_9_0
Before: 35.565 s ± 0.087 s
After: 15.713 s ± 0.287 s
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Cc: Cédric Le Goater <clg@kaod.org>
Tested-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20220811151413.3350684-6-alex.bennee@linaro.org>
Message-Id: <20220923084803.498337-6-clg@kaod.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
include/hw/ssi/ssi.h | 3 +++
hw/ssi/ssi.c | 18 ++++++++----------
2 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/include/hw/ssi/ssi.h b/include/hw/ssi/ssi.h
index f411858ab083..6950f86810d3 100644
--- a/include/hw/ssi/ssi.h
+++ b/include/hw/ssi/ssi.h
@@ -59,6 +59,9 @@ struct SSIPeripheralClass {
struct SSIPeripheral {
DeviceState parent_obj;
+ /* cache the class */
+ SSIPeripheralClass *spc;
+
/* Chip select state */
bool cs;
};
diff --git a/hw/ssi/ssi.c b/hw/ssi/ssi.c
index 003931fb509e..d54a109beeb5 100644
--- a/hw/ssi/ssi.c
+++ b/hw/ssi/ssi.c
@@ -38,9 +38,8 @@ static void ssi_cs_default(void *opaque, int n, int level)
bool cs = !!level;
assert(n == 0);
if (s->cs != cs) {
- SSIPeripheralClass *ssc = SSI_PERIPHERAL_GET_CLASS(s);
- if (ssc->set_cs) {
- ssc->set_cs(s, cs);
+ if (s->spc->set_cs) {
+ s->spc->set_cs(s, cs);
}
}
s->cs = cs;
@@ -48,11 +47,11 @@ static void ssi_cs_default(void *opaque, int n, int level)
static uint32_t ssi_transfer_raw_default(SSIPeripheral *dev, uint32_t val)
{
- SSIPeripheralClass *ssc = SSI_PERIPHERAL_GET_CLASS(dev);
+ SSIPeripheralClass *ssc = dev->spc;
if ((dev->cs && ssc->cs_polarity == SSI_CS_HIGH) ||
- (!dev->cs && ssc->cs_polarity == SSI_CS_LOW) ||
- ssc->cs_polarity == SSI_CS_NONE) {
+ (!dev->cs && ssc->cs_polarity == SSI_CS_LOW) ||
+ ssc->cs_polarity == SSI_CS_NONE) {
return ssc->transfer(dev, val);
}
return 0;
@@ -67,6 +66,7 @@ static void ssi_peripheral_realize(DeviceState *dev, Error **errp)
ssc->cs_polarity != SSI_CS_NONE) {
qdev_init_gpio_in_named(dev, ssi_cs_default, SSI_GPIO_CS, 1);
}
+ s->spc = ssc;
ssc->realize(s, errp);
}
@@ -115,13 +115,11 @@ uint32_t ssi_transfer(SSIBus *bus, uint32_t val)
{
BusState *b = BUS(bus);
BusChild *kid;
- SSIPeripheralClass *ssc;
uint32_t r = 0;
QTAILQ_FOREACH(kid, &b->children, sibling) {
- SSIPeripheral *peripheral = SSI_PERIPHERAL(kid->child);
- ssc = SSI_PERIPHERAL_GET_CLASS(peripheral);
- r |= ssc->transfer_raw(peripheral, val);
+ SSIPeripheral *p = SSI_PERIPHERAL(kid->child);
+ r |= p->spc->transfer_raw(p, val);
}
return r;
--
2.37.3
^ permalink raw reply related [flat|nested] 21+ messages in thread
* Re: [PULL 03/16] ssi: cache SSIPeripheralClass to avoid GET_CLASS()
2022-10-25 15:20 ` [PULL 03/16] ssi: cache SSIPeripheralClass to avoid GET_CLASS() Cédric Le Goater
@ 2023-05-12 4:02 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 21+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-05-12 4:02 UTC (permalink / raw)
To: Cédric Le Goater, qemu-arm, qemu-devel
Cc: Peter Maydell, Joel Stanley, Alistair Francis,
Philippe Mathieu-Daudé, qemu-block, Alex Bennée
Hi Alex,
On 25/10/22 17:20, Cédric Le Goater wrote:
> From: Alex Bennée <alex.bennee@linaro.org>
>
> Investigating why some BMC models are so slow compared to a plain ARM
> virt machines I did some profiling of:
>
> ./qemu-system-arm -M romulus-bmc -nic user \
> -drive
> file=obmc-phosphor-image-romulus.static.mtd,format=raw,if=mtd \
> -nographic -serial mon:stdio
>
> And saw that object_class_dynamic_cast_assert was dominating the
> profile times. We have a number of cases in this model of the SSI bus.
> As the class is static once the object is created we just cache it and
> use it instead of the dynamic case macros.
>
> Profiling against:
>
> ./tests/venv/bin/avocado run \
> tests/avocado/machine_aspeed.py:test_arm_ast2500_romulus_openbmc_v2_9_0
>
> Before: 35.565 s ± 0.087 s
> After: 15.713 s ± 0.287 s
Do you remember if you were using --enable-qom-cast-debug when
profiling this?
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> Cc: Cédric Le Goater <clg@kaod.org>
> Tested-by: Cédric Le Goater <clg@kaod.org>
> Reviewed-by: Cédric Le Goater <clg@kaod.org>
> Message-Id: <20220811151413.3350684-6-alex.bennee@linaro.org>
> Message-Id: <20220923084803.498337-6-clg@kaod.org>
> Signed-off-by: Cédric Le Goater <clg@kaod.org>
> ---
> include/hw/ssi/ssi.h | 3 +++
> hw/ssi/ssi.c | 18 ++++++++----------
> 2 files changed, 11 insertions(+), 10 deletions(-)
>
> diff --git a/include/hw/ssi/ssi.h b/include/hw/ssi/ssi.h
> index f411858ab083..6950f86810d3 100644
> --- a/include/hw/ssi/ssi.h
> +++ b/include/hw/ssi/ssi.h
> @@ -59,6 +59,9 @@ struct SSIPeripheralClass {
> struct SSIPeripheral {
> DeviceState parent_obj;
>
> + /* cache the class */
> + SSIPeripheralClass *spc;
> +
> /* Chip select state */
> bool cs;
> };
> diff --git a/hw/ssi/ssi.c b/hw/ssi/ssi.c
> index 003931fb509e..d54a109beeb5 100644
> --- a/hw/ssi/ssi.c
> +++ b/hw/ssi/ssi.c
> @@ -38,9 +38,8 @@ static void ssi_cs_default(void *opaque, int n, int level)
> bool cs = !!level;
> assert(n == 0);
> if (s->cs != cs) {
> - SSIPeripheralClass *ssc = SSI_PERIPHERAL_GET_CLASS(s);
> - if (ssc->set_cs) {
> - ssc->set_cs(s, cs);
> + if (s->spc->set_cs) {
> + s->spc->set_cs(s, cs);
> }
> }
> s->cs = cs;
> @@ -48,11 +47,11 @@ static void ssi_cs_default(void *opaque, int n, int level)
>
> static uint32_t ssi_transfer_raw_default(SSIPeripheral *dev, uint32_t val)
> {
> - SSIPeripheralClass *ssc = SSI_PERIPHERAL_GET_CLASS(dev);
> + SSIPeripheralClass *ssc = dev->spc;
>
> if ((dev->cs && ssc->cs_polarity == SSI_CS_HIGH) ||
> - (!dev->cs && ssc->cs_polarity == SSI_CS_LOW) ||
> - ssc->cs_polarity == SSI_CS_NONE) {
> + (!dev->cs && ssc->cs_polarity == SSI_CS_LOW) ||
> + ssc->cs_polarity == SSI_CS_NONE) {
> return ssc->transfer(dev, val);
> }
> return 0;
> @@ -67,6 +66,7 @@ static void ssi_peripheral_realize(DeviceState *dev, Error **errp)
> ssc->cs_polarity != SSI_CS_NONE) {
> qdev_init_gpio_in_named(dev, ssi_cs_default, SSI_GPIO_CS, 1);
> }
> + s->spc = ssc;
>
> ssc->realize(s, errp);
> }
> @@ -115,13 +115,11 @@ uint32_t ssi_transfer(SSIBus *bus, uint32_t val)
> {
> BusState *b = BUS(bus);
> BusChild *kid;
> - SSIPeripheralClass *ssc;
> uint32_t r = 0;
>
> QTAILQ_FOREACH(kid, &b->children, sibling) {
> - SSIPeripheral *peripheral = SSI_PERIPHERAL(kid->child);
> - ssc = SSI_PERIPHERAL_GET_CLASS(peripheral);
> - r |= ssc->transfer_raw(peripheral, val);
> + SSIPeripheral *p = SSI_PERIPHERAL(kid->child);
> + r |= p->spc->transfer_raw(p, val);
> }
>
> return r;
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PULL 04/16] aspeed/smc: Cache AspeedSMCClass
2022-10-25 15:20 [PULL 00/16] aspeed queue Cédric Le Goater
` (2 preceding siblings ...)
2022-10-25 15:20 ` [PULL 03/16] ssi: cache SSIPeripheralClass to avoid GET_CLASS() Cédric Le Goater
@ 2022-10-25 15:20 ` Cédric Le Goater
2023-05-12 4:00 ` Philippe Mathieu-Daudé
2022-10-25 15:20 ` [PULL 05/16] ast2600: Drop NEON from the CPU features Cédric Le Goater
` (12 subsequent siblings)
16 siblings, 1 reply; 21+ messages in thread
From: Cédric Le Goater @ 2022-10-25 15:20 UTC (permalink / raw)
To: qemu-arm, qemu-devel
Cc: Peter Maydell, Joel Stanley, Alistair Francis,
Philippe Mathieu-Daudé, qemu-block, Cédric Le Goater
Store a reference on the AspeedSMC class under the flash object and
use it when accessing the flash contents. Avoiding the class cast
checkers in these hot paths improves performance by 10% when running
the aspeed avocado tests.
Message-Id: <20220923084803.498337-7-clg@kaod.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
include/hw/ssi/aspeed_smc.h | 2 ++
hw/ssi/aspeed_smc.c | 9 ++++-----
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/include/hw/ssi/aspeed_smc.h b/include/hw/ssi/aspeed_smc.h
index 2d5f8f3d8f68..8e1dda556b91 100644
--- a/include/hw/ssi/aspeed_smc.h
+++ b/include/hw/ssi/aspeed_smc.h
@@ -30,6 +30,7 @@
#include "qom/object.h"
struct AspeedSMCState;
+struct AspeedSMCClass;
#define TYPE_ASPEED_SMC_FLASH "aspeed.smc.flash"
OBJECT_DECLARE_SIMPLE_TYPE(AspeedSMCFlash, ASPEED_SMC_FLASH)
@@ -37,6 +38,7 @@ struct AspeedSMCFlash {
SysBusDevice parent_obj;
struct AspeedSMCState *controller;
+ struct AspeedSMCClass *asc;
uint8_t cs;
MemoryRegion mmio;
diff --git a/hw/ssi/aspeed_smc.c b/hw/ssi/aspeed_smc.c
index faed7e0cbe17..22df4be528a7 100644
--- a/hw/ssi/aspeed_smc.c
+++ b/hw/ssi/aspeed_smc.c
@@ -388,7 +388,7 @@ static inline int aspeed_smc_flash_cmd(const AspeedSMCFlash *fl)
static inline int aspeed_smc_flash_addr_width(const AspeedSMCFlash *fl)
{
const AspeedSMCState *s = fl->controller;
- AspeedSMCClass *asc = ASPEED_SMC_GET_CLASS(s);
+ AspeedSMCClass *asc = fl->asc;
if (asc->addr_width) {
return asc->addr_width(s);
@@ -420,7 +420,7 @@ static uint32_t aspeed_smc_check_segment_addr(const AspeedSMCFlash *fl,
uint32_t addr)
{
const AspeedSMCState *s = fl->controller;
- AspeedSMCClass *asc = ASPEED_SMC_GET_CLASS(s);
+ AspeedSMCClass *asc = fl->asc;
AspeedSegments seg;
asc->reg_to_segment(s, s->regs[R_SEG_ADDR0 + fl->cs], &seg);
@@ -1234,7 +1234,6 @@ static const TypeInfo aspeed_smc_info = {
static void aspeed_smc_flash_realize(DeviceState *dev, Error **errp)
{
AspeedSMCFlash *s = ASPEED_SMC_FLASH(dev);
- AspeedSMCClass *asc;
g_autofree char *name = g_strdup_printf(TYPE_ASPEED_SMC_FLASH ".%d", s->cs);
if (!s->controller) {
@@ -1242,14 +1241,14 @@ static void aspeed_smc_flash_realize(DeviceState *dev, Error **errp)
return;
}
- asc = ASPEED_SMC_GET_CLASS(s->controller);
+ s->asc = ASPEED_SMC_GET_CLASS(s->controller);
/*
* Use the default segment value to size the memory region. This
* can be changed by FW at runtime.
*/
memory_region_init_io(&s->mmio, OBJECT(s), &aspeed_smc_flash_ops,
- s, name, asc->segments[s->cs].size);
+ s, name, s->asc->segments[s->cs].size);
sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->mmio);
}
--
2.37.3
^ permalink raw reply related [flat|nested] 21+ messages in thread
* Re: [PULL 04/16] aspeed/smc: Cache AspeedSMCClass
2022-10-25 15:20 ` [PULL 04/16] aspeed/smc: Cache AspeedSMCClass Cédric Le Goater
@ 2023-05-12 4:00 ` Philippe Mathieu-Daudé
2023-05-12 7:06 ` Cédric Le Goater
0 siblings, 1 reply; 21+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-05-12 4:00 UTC (permalink / raw)
To: Cédric Le Goater, qemu-arm, qemu-devel
Cc: Peter Maydell, Joel Stanley, Alistair Francis,
Philippe Mathieu-Daudé, qemu-block, Alex Bennée
Hi Cédric,
On 25/10/22 17:20, Cédric Le Goater wrote:
> Store a reference on the AspeedSMC class under the flash object and
> use it when accessing the flash contents. Avoiding the class cast
> checkers in these hot paths improves performance by 10% when running
> the aspeed avocado tests.
I doubt you still have your benchmark number, but do you remember
if you were using --enable-qom-cast-debug ?
> Message-Id: <20220923084803.498337-7-clg@kaod.org>
> Signed-off-by: Cédric Le Goater <clg@kaod.org>
> ---
> include/hw/ssi/aspeed_smc.h | 2 ++
> hw/ssi/aspeed_smc.c | 9 ++++-----
> 2 files changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/include/hw/ssi/aspeed_smc.h b/include/hw/ssi/aspeed_smc.h
> index 2d5f8f3d8f68..8e1dda556b91 100644
> --- a/include/hw/ssi/aspeed_smc.h
> +++ b/include/hw/ssi/aspeed_smc.h
> @@ -30,6 +30,7 @@
> #include "qom/object.h"
>
> struct AspeedSMCState;
> +struct AspeedSMCClass;
>
> #define TYPE_ASPEED_SMC_FLASH "aspeed.smc.flash"
> OBJECT_DECLARE_SIMPLE_TYPE(AspeedSMCFlash, ASPEED_SMC_FLASH)
> @@ -37,6 +38,7 @@ struct AspeedSMCFlash {
> SysBusDevice parent_obj;
>
> struct AspeedSMCState *controller;
> + struct AspeedSMCClass *asc;
> uint8_t cs;
>
> MemoryRegion mmio;
> diff --git a/hw/ssi/aspeed_smc.c b/hw/ssi/aspeed_smc.c
> index faed7e0cbe17..22df4be528a7 100644
> --- a/hw/ssi/aspeed_smc.c
> +++ b/hw/ssi/aspeed_smc.c
> @@ -388,7 +388,7 @@ static inline int aspeed_smc_flash_cmd(const AspeedSMCFlash *fl)
> static inline int aspeed_smc_flash_addr_width(const AspeedSMCFlash *fl)
> {
> const AspeedSMCState *s = fl->controller;
> - AspeedSMCClass *asc = ASPEED_SMC_GET_CLASS(s);
> + AspeedSMCClass *asc = fl->asc;
>
> if (asc->addr_width) {
> return asc->addr_width(s);
> @@ -420,7 +420,7 @@ static uint32_t aspeed_smc_check_segment_addr(const AspeedSMCFlash *fl,
> uint32_t addr)
> {
> const AspeedSMCState *s = fl->controller;
> - AspeedSMCClass *asc = ASPEED_SMC_GET_CLASS(s);
> + AspeedSMCClass *asc = fl->asc;
> AspeedSegments seg;
>
> asc->reg_to_segment(s, s->regs[R_SEG_ADDR0 + fl->cs], &seg);
> @@ -1234,7 +1234,6 @@ static const TypeInfo aspeed_smc_info = {
> static void aspeed_smc_flash_realize(DeviceState *dev, Error **errp)
> {
> AspeedSMCFlash *s = ASPEED_SMC_FLASH(dev);
> - AspeedSMCClass *asc;
> g_autofree char *name = g_strdup_printf(TYPE_ASPEED_SMC_FLASH ".%d", s->cs);
>
> if (!s->controller) {
> @@ -1242,14 +1241,14 @@ static void aspeed_smc_flash_realize(DeviceState *dev, Error **errp)
> return;
> }
>
> - asc = ASPEED_SMC_GET_CLASS(s->controller);
> + s->asc = ASPEED_SMC_GET_CLASS(s->controller);
>
> /*
> * Use the default segment value to size the memory region. This
> * can be changed by FW at runtime.
> */
> memory_region_init_io(&s->mmio, OBJECT(s), &aspeed_smc_flash_ops,
> - s, name, asc->segments[s->cs].size);
> + s, name, s->asc->segments[s->cs].size);
> sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->mmio);
> }
>
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PULL 04/16] aspeed/smc: Cache AspeedSMCClass
2023-05-12 4:00 ` Philippe Mathieu-Daudé
@ 2023-05-12 7:06 ` Cédric Le Goater
0 siblings, 0 replies; 21+ messages in thread
From: Cédric Le Goater @ 2023-05-12 7:06 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-arm, qemu-devel
Cc: Peter Maydell, Joel Stanley, Alistair Francis, qemu-block,
Alex Bennée
Hello,
On 5/12/23 06:00, Philippe Mathieu-Daudé wrote:
> Hi Cédric,
>
> On 25/10/22 17:20, Cédric Le Goater wrote:
>> Store a reference on the AspeedSMC class under the flash object and
>> use it when accessing the flash contents. Avoiding the class cast
>> checkers in these hot paths improves performance by 10% when running
>> the aspeed avocado tests.
>
> I doubt you still have your benchmark number, but do you remember
> if you were using --enable-qom-cast-debug ?
It is relatively easy to run.
Grab :
https://github.com/legoater/qemu-aspeed-boot/raw/master/images/ast2500-evb/buildroot-2023.02/flash.img
and run :
qemu-system-arm -M ast2500-evb,execute-in-place=true -net user -drive file=./flash.img,format=raw,if=mtd -nographic
I tried with and without --enable-qom-cast-debug. It doesn't make
much difference.
C.
>
>> Message-Id: <20220923084803.498337-7-clg@kaod.org>
>> Signed-off-by: Cédric Le Goater <clg@kaod.org>
>> ---
>> include/hw/ssi/aspeed_smc.h | 2 ++
>> hw/ssi/aspeed_smc.c | 9 ++++-----
>> 2 files changed, 6 insertions(+), 5 deletions(-)
>>
>> diff --git a/include/hw/ssi/aspeed_smc.h b/include/hw/ssi/aspeed_smc.h
>> index 2d5f8f3d8f68..8e1dda556b91 100644
>> --- a/include/hw/ssi/aspeed_smc.h
>> +++ b/include/hw/ssi/aspeed_smc.h
>> @@ -30,6 +30,7 @@
>> #include "qom/object.h"
>> struct AspeedSMCState;
>> +struct AspeedSMCClass;
>> #define TYPE_ASPEED_SMC_FLASH "aspeed.smc.flash"
>> OBJECT_DECLARE_SIMPLE_TYPE(AspeedSMCFlash, ASPEED_SMC_FLASH)
>> @@ -37,6 +38,7 @@ struct AspeedSMCFlash {
>> SysBusDevice parent_obj;
>> struct AspeedSMCState *controller;
>> + struct AspeedSMCClass *asc;
>> uint8_t cs;
>> MemoryRegion mmio;
>> diff --git a/hw/ssi/aspeed_smc.c b/hw/ssi/aspeed_smc.c
>> index faed7e0cbe17..22df4be528a7 100644
>> --- a/hw/ssi/aspeed_smc.c
>> +++ b/hw/ssi/aspeed_smc.c
>> @@ -388,7 +388,7 @@ static inline int aspeed_smc_flash_cmd(const AspeedSMCFlash *fl)
>> static inline int aspeed_smc_flash_addr_width(const AspeedSMCFlash *fl)
>> {
>> const AspeedSMCState *s = fl->controller;
>> - AspeedSMCClass *asc = ASPEED_SMC_GET_CLASS(s);
>> + AspeedSMCClass *asc = fl->asc;
>> if (asc->addr_width) {
>> return asc->addr_width(s);
>> @@ -420,7 +420,7 @@ static uint32_t aspeed_smc_check_segment_addr(const AspeedSMCFlash *fl,
>> uint32_t addr)
>> {
>> const AspeedSMCState *s = fl->controller;
>> - AspeedSMCClass *asc = ASPEED_SMC_GET_CLASS(s);
>> + AspeedSMCClass *asc = fl->asc;
>> AspeedSegments seg;
>> asc->reg_to_segment(s, s->regs[R_SEG_ADDR0 + fl->cs], &seg);
>> @@ -1234,7 +1234,6 @@ static const TypeInfo aspeed_smc_info = {
>> static void aspeed_smc_flash_realize(DeviceState *dev, Error **errp)
>> {
>> AspeedSMCFlash *s = ASPEED_SMC_FLASH(dev);
>> - AspeedSMCClass *asc;
>> g_autofree char *name = g_strdup_printf(TYPE_ASPEED_SMC_FLASH ".%d", s->cs);
>> if (!s->controller) {
>> @@ -1242,14 +1241,14 @@ static void aspeed_smc_flash_realize(DeviceState *dev, Error **errp)
>> return;
>> }
>> - asc = ASPEED_SMC_GET_CLASS(s->controller);
>> + s->asc = ASPEED_SMC_GET_CLASS(s->controller);
>> /*
>> * Use the default segment value to size the memory region. This
>> * can be changed by FW at runtime.
>> */
>> memory_region_init_io(&s->mmio, OBJECT(s), &aspeed_smc_flash_ops,
>> - s, name, asc->segments[s->cs].size);
>> + s, name, s->asc->segments[s->cs].size);
>> sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->mmio);
>> }
>
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PULL 05/16] ast2600: Drop NEON from the CPU features
2022-10-25 15:20 [PULL 00/16] aspeed queue Cédric Le Goater
` (3 preceding siblings ...)
2022-10-25 15:20 ` [PULL 04/16] aspeed/smc: Cache AspeedSMCClass Cédric Le Goater
@ 2022-10-25 15:20 ` Cédric Le Goater
2022-10-25 15:20 ` [PULL 06/16] hw/arm/aspeed: increase Bletchley memory size Cédric Le Goater
` (11 subsequent siblings)
16 siblings, 0 replies; 21+ messages in thread
From: Cédric Le Goater @ 2022-10-25 15:20 UTC (permalink / raw)
To: qemu-arm, qemu-devel
Cc: Peter Maydell, Joel Stanley, Alistair Francis,
Philippe Mathieu-Daudé, qemu-block, Cédric Le Goater
Currently, the CPU features exposed to the AST2600 QEMU machines are :
half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt
vfpd32 lpae evtstrm
But, the features of the Cortex A7 CPU on the Aspeed AST2600 A3 SoC
are :
half thumb fastmult vfp edsp vfpv3 vfpv3d16 tls vfpv4 idiva idivt
lpae evtstrm
Drop NEON support in the Aspeed AST2600 SoC.
Reviewed-by: Joel Stanley <joel@jms.id.au>
Message-Id: <20220928164719.655586-3-clg@kaod.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
hw/arm/aspeed_ast2600.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/hw/arm/aspeed_ast2600.c b/hw/arm/aspeed_ast2600.c
index aa2cd90bec17..cd75465c2bdd 100644
--- a/hw/arm/aspeed_ast2600.c
+++ b/hw/arm/aspeed_ast2600.c
@@ -307,6 +307,8 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev, Error **errp)
object_property_set_int(OBJECT(&s->cpu[i]), "cntfrq", 1125000000,
&error_abort);
+ object_property_set_bool(OBJECT(&s->cpu[i]), "neon", false,
+ &error_abort);
object_property_set_link(OBJECT(&s->cpu[i]), "memory",
OBJECT(s->memory), &error_abort);
--
2.37.3
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PULL 06/16] hw/arm/aspeed: increase Bletchley memory size
2022-10-25 15:20 [PULL 00/16] aspeed queue Cédric Le Goater
` (4 preceding siblings ...)
2022-10-25 15:20 ` [PULL 05/16] ast2600: Drop NEON from the CPU features Cédric Le Goater
@ 2022-10-25 15:20 ` Cédric Le Goater
2022-10-25 15:20 ` [PULL 07/16] m25p80: Add basic support for the SFDP command Cédric Le Goater
` (10 subsequent siblings)
16 siblings, 0 replies; 21+ messages in thread
From: Cédric Le Goater @ 2022-10-25 15:20 UTC (permalink / raw)
To: qemu-arm, qemu-devel
Cc: Peter Maydell, Joel Stanley, Alistair Francis,
Philippe Mathieu-Daudé, qemu-block, Patrick Williams,
Cédric Le Goater
From: Patrick Williams <patrick@stwcx.xyz>
For the PVT-class hardware we have increased the memory size of
this device to 2 GiB. Adjust the device model accordingly.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20221007110529.3657749-1-patrick@stwcx.xyz>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
hw/arm/aspeed.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
index bc3ecdb6199e..bc5c1e167773 100644
--- a/hw/arm/aspeed.c
+++ b/hw/arm/aspeed.c
@@ -1330,6 +1330,13 @@ static void aspeed_machine_fuji_class_init(ObjectClass *oc, void *data)
aspeed_soc_num_cpus(amc->soc_name);
};
+/* On 32-bit hosts, lower RAM to 1G because of the 2047 MB limit */
+#if HOST_LONG_BITS == 32
+#define BLETCHLEY_BMC_RAM_SIZE (1 * GiB)
+#else
+#define BLETCHLEY_BMC_RAM_SIZE (2 * GiB)
+#endif
+
static void aspeed_machine_bletchley_class_init(ObjectClass *oc, void *data)
{
MachineClass *mc = MACHINE_CLASS(oc);
@@ -1344,7 +1351,7 @@ static void aspeed_machine_bletchley_class_init(ObjectClass *oc, void *data)
amc->num_cs = 2;
amc->macs_mask = ASPEED_MAC2_ON;
amc->i2c_init = bletchley_bmc_i2c_init;
- mc->default_ram_size = 512 * MiB;
+ mc->default_ram_size = BLETCHLEY_BMC_RAM_SIZE;
mc->default_cpus = mc->min_cpus = mc->max_cpus =
aspeed_soc_num_cpus(amc->soc_name);
}
--
2.37.3
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PULL 07/16] m25p80: Add basic support for the SFDP command
2022-10-25 15:20 [PULL 00/16] aspeed queue Cédric Le Goater
` (5 preceding siblings ...)
2022-10-25 15:20 ` [PULL 06/16] hw/arm/aspeed: increase Bletchley memory size Cédric Le Goater
@ 2022-10-25 15:20 ` Cédric Le Goater
2022-10-25 15:20 ` [PULL 08/16] m25p80: Add the n25q256a SFDP table Cédric Le Goater
` (9 subsequent siblings)
16 siblings, 0 replies; 21+ messages in thread
From: Cédric Le Goater @ 2022-10-25 15:20 UTC (permalink / raw)
To: qemu-arm, qemu-devel
Cc: Peter Maydell, Joel Stanley, Alistair Francis,
Philippe Mathieu-Daudé, qemu-block, Cédric Le Goater,
Francisco Iglesias
JEDEC STANDARD JESD216 for Serial Flash Discovery Parameters (SFDP)
provides a mean to describe the features of a serial flash device
using a set of internal parameter tables.
This is the initial framework for the RDSFDP command giving access to
a private SFDP area under the flash. This area now needs to be
populated with the flash device characteristics, using a new
'sfdp_read' handler under FlashPartInfo.
Reviewed-by: Francisco Iglesias <frasse.iglesias@gmail.com>
Message-Id: <20220722063602.128144-2-clg@kaod.org>
Message-Id: <20221013161241.2805140-2-clg@kaod.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
hw/block/m25p80_sfdp.h | 18 ++++++++++++++++++
hw/block/m25p80.c | 27 +++++++++++++++++++++++++++
MAINTAINERS | 2 +-
hw/block/trace-events | 1 +
4 files changed, 47 insertions(+), 1 deletion(-)
create mode 100644 hw/block/m25p80_sfdp.h
diff --git a/hw/block/m25p80_sfdp.h b/hw/block/m25p80_sfdp.h
new file mode 100644
index 000000000000..230b07ef3308
--- /dev/null
+++ b/hw/block/m25p80_sfdp.h
@@ -0,0 +1,18 @@
+/*
+ * M25P80 SFDP
+ *
+ * Copyright (c) 2020, IBM Corporation.
+ *
+ * This code is licensed under the GPL version 2 or later. See the
+ * COPYING file in the top-level directory.
+ */
+
+#ifndef HW_M25P80_SFDP_H
+#define HW_M25P80_SFDP_H
+
+/*
+ * SFDP area has a 3 bytes address space.
+ */
+#define M25P80_SFDP_MAX_SIZE (1 << 24)
+
+#endif
diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c
index a8d2519141f7..abdc4c0b0da7 100644
--- a/hw/block/m25p80.c
+++ b/hw/block/m25p80.c
@@ -35,6 +35,7 @@
#include "qapi/error.h"
#include "trace.h"
#include "qom/object.h"
+#include "m25p80_sfdp.h"
/* 16 MiB max in 3 byte address mode */
#define MAX_3BYTES_SIZE 0x1000000
@@ -72,6 +73,7 @@ typedef struct FlashPartInfo {
* This field inform how many die is in the chip.
*/
uint8_t die_cnt;
+ uint8_t (*sfdp_read)(uint32_t sfdp_addr);
} FlashPartInfo;
/* adapted from linux */
@@ -355,6 +357,7 @@ typedef enum {
BULK_ERASE = 0xc7,
READ_FSR = 0x70,
RDCR = 0x15,
+ RDSFDP = 0x5a,
READ = 0x03,
READ4 = 0x13,
@@ -421,6 +424,7 @@ typedef enum {
STATE_COLLECTING_DATA,
STATE_COLLECTING_VAR_LEN_DATA,
STATE_READING_DATA,
+ STATE_READING_SFDP,
} CMDState;
typedef enum {
@@ -679,6 +683,8 @@ static inline int get_addr_length(Flash *s)
}
switch (s->cmd_in_progress) {
+ case RDSFDP:
+ return 3;
case PP4:
case PP4_4:
case QPP_4:
@@ -823,6 +829,11 @@ static void complete_collecting_data(Flash *s)
" by device\n");
}
break;
+
+ case RDSFDP:
+ s->state = STATE_READING_SFDP;
+ break;
+
default:
break;
}
@@ -1431,6 +1442,16 @@ static void decode_new_cmd(Flash *s, uint32_t value)
qemu_log_mask(LOG_GUEST_ERROR, "M25P80: Unknown cmd %x\n", value);
}
break;
+ case RDSFDP:
+ if (s->pi->sfdp_read) {
+ s->needed_bytes = get_addr_length(s) + 1; /* SFDP addr + dummy */
+ s->pos = 0;
+ s->len = 0;
+ s->state = STATE_COLLECTING_DATA;
+ break;
+ }
+ /* Fallthrough */
+
default:
s->pos = 0;
s->len = 1;
@@ -1538,6 +1559,12 @@ static uint32_t m25p80_transfer8(SSIPeripheral *ss, uint32_t tx)
}
}
break;
+ case STATE_READING_SFDP:
+ assert(s->pi->sfdp_read);
+ r = s->pi->sfdp_read(s->cur_addr);
+ trace_m25p80_read_sfdp(s, s->cur_addr, (uint8_t)r);
+ s->cur_addr = (s->cur_addr + 1) & (M25P80_SFDP_MAX_SIZE - 1);
+ break;
default:
case STATE_IDLE:
diff --git a/MAINTAINERS b/MAINTAINERS
index e3d5b7e09c46..32e495e16533 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1915,7 +1915,7 @@ SSI
M: Alistair Francis <alistair@alistair23.me>
S: Maintained
F: hw/ssi/*
-F: hw/block/m25p80.c
+F: hw/block/m25p80*
F: include/hw/ssi/ssi.h
X: hw/ssi/xilinx_*
F: tests/qtest/m25p80-test.c
diff --git a/hw/block/trace-events b/hw/block/trace-events
index d86b53520cc5..2c45a62bd59c 100644
--- a/hw/block/trace-events
+++ b/hw/block/trace-events
@@ -80,5 +80,6 @@ m25p80_page_program(void *s, uint32_t addr, uint8_t tx) "[%p] page program cur_a
m25p80_transfer(void *s, uint8_t state, uint32_t len, uint8_t needed, uint32_t pos, uint32_t cur_addr, uint8_t t) "[%p] Transfer state 0x%"PRIx8" len 0x%"PRIx32" needed 0x%"PRIx8" pos 0x%"PRIx32" addr 0x%"PRIx32" tx 0x%"PRIx8
m25p80_read_byte(void *s, uint32_t addr, uint8_t v) "[%p] Read byte 0x%"PRIx32"=0x%"PRIx8
m25p80_read_data(void *s, uint32_t pos, uint8_t v) "[%p] Read data 0x%"PRIx32"=0x%"PRIx8
+m25p80_read_sfdp(void *s, uint32_t addr, uint8_t v) "[%p] Read SFDP 0x%"PRIx32"=0x%"PRIx8
m25p80_binding(void *s) "[%p] Binding to IF_MTD drive"
m25p80_binding_no_bdrv(void *s) "[%p] No BDRV - binding to RAM"
--
2.37.3
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PULL 08/16] m25p80: Add the n25q256a SFDP table
2022-10-25 15:20 [PULL 00/16] aspeed queue Cédric Le Goater
` (6 preceding siblings ...)
2022-10-25 15:20 ` [PULL 07/16] m25p80: Add basic support for the SFDP command Cédric Le Goater
@ 2022-10-25 15:20 ` Cédric Le Goater
2022-10-25 15:20 ` [PULL 09/16] m25p80: Add erase size for mx25l25635e Cédric Le Goater
` (8 subsequent siblings)
16 siblings, 0 replies; 21+ messages in thread
From: Cédric Le Goater @ 2022-10-25 15:20 UTC (permalink / raw)
To: qemu-arm, qemu-devel
Cc: Peter Maydell, Joel Stanley, Alistair Francis,
Philippe Mathieu-Daudé, qemu-block, Cédric Le Goater,
Francisco Iglesias
The same values were collected on 4 differents OpenPower systems,
palmettos, romulus and tacoma.
The SFDP table size is defined as being 0x100 bytes but it could be
bigger. Only the mandatory table for basic features is available at
byte 0x30.
Reviewed-by: Francisco Iglesias <frasse.iglesias@gmail.com>
Message-Id: <20220722063602.128144-3-clg@kaod.org>
Message-Id: <20221013161241.2805140-3-clg@kaod.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
hw/block/m25p80_sfdp.h | 2 ++
hw/block/m25p80.c | 8 +++---
hw/block/m25p80_sfdp.c | 58 ++++++++++++++++++++++++++++++++++++++++++
hw/block/meson.build | 1 +
4 files changed, 66 insertions(+), 3 deletions(-)
create mode 100644 hw/block/m25p80_sfdp.c
diff --git a/hw/block/m25p80_sfdp.h b/hw/block/m25p80_sfdp.h
index 230b07ef3308..7245412cc18c 100644
--- a/hw/block/m25p80_sfdp.h
+++ b/hw/block/m25p80_sfdp.h
@@ -15,4 +15,6 @@
*/
#define M25P80_SFDP_MAX_SIZE (1 << 24)
+uint8_t m25p80_sfdp_n25q256a(uint32_t addr);
+
#endif
diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c
index abdc4c0b0da7..13e7b28fd2b0 100644
--- a/hw/block/m25p80.c
+++ b/hw/block/m25p80.c
@@ -247,13 +247,15 @@ static const FlashPartInfo known_devices[] = {
{ INFO("n25q128a11", 0x20bb18, 0, 64 << 10, 256, ER_4K) },
{ INFO("n25q128a13", 0x20ba18, 0, 64 << 10, 256, ER_4K) },
{ INFO("n25q256a11", 0x20bb19, 0, 64 << 10, 512, ER_4K) },
- { INFO("n25q256a13", 0x20ba19, 0, 64 << 10, 512, ER_4K) },
+ { INFO("n25q256a13", 0x20ba19, 0, 64 << 10, 512, ER_4K),
+ .sfdp_read = m25p80_sfdp_n25q256a },
{ INFO("n25q512a11", 0x20bb20, 0, 64 << 10, 1024, ER_4K) },
{ INFO("n25q512a13", 0x20ba20, 0, 64 << 10, 1024, ER_4K) },
{ INFO("n25q128", 0x20ba18, 0, 64 << 10, 256, 0) },
{ INFO("n25q256a", 0x20ba19, 0, 64 << 10, 512,
- ER_4K | HAS_SR_BP3_BIT6 | HAS_SR_TB) },
- { INFO("n25q512a", 0x20ba20, 0, 64 << 10, 1024, ER_4K) },
+ ER_4K | HAS_SR_BP3_BIT6 | HAS_SR_TB),
+ .sfdp_read = m25p80_sfdp_n25q256a },
+ { INFO("n25q512a", 0x20ba20, 0, 64 << 10, 1024, ER_4K) },
{ INFO("n25q512ax3", 0x20ba20, 0x1000, 64 << 10, 1024, ER_4K) },
{ INFO("mt25ql512ab", 0x20ba20, 0x1044, 64 << 10, 1024, ER_4K | ER_32K) },
{ INFO_STACKED("mt35xu01g", 0x2c5b1b, 0x104100, 128 << 10, 1024,
diff --git a/hw/block/m25p80_sfdp.c b/hw/block/m25p80_sfdp.c
new file mode 100644
index 000000000000..24ec05de79a1
--- /dev/null
+++ b/hw/block/m25p80_sfdp.c
@@ -0,0 +1,58 @@
+/*
+ * M25P80 Serial Flash Discoverable Parameter (SFDP)
+ *
+ * Copyright (c) 2020, IBM Corporation.
+ *
+ * This code is licensed under the GPL version 2 or later. See the
+ * COPYING file in the top-level directory.
+ */
+
+#include "qemu/osdep.h"
+#include "qemu/host-utils.h"
+#include "m25p80_sfdp.h"
+
+#define define_sfdp_read(model) \
+ uint8_t m25p80_sfdp_##model(uint32_t addr) \
+ { \
+ assert(is_power_of_2(sizeof(sfdp_##model))); \
+ return sfdp_##model[addr & (sizeof(sfdp_##model) - 1)]; \
+ }
+
+/*
+ * Micron
+ */
+static const uint8_t sfdp_n25q256a[] = {
+ 0x53, 0x46, 0x44, 0x50, 0x00, 0x01, 0x00, 0xff,
+ 0x00, 0x00, 0x01, 0x09, 0x30, 0x00, 0x00, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xe5, 0x20, 0xfb, 0xff, 0xff, 0xff, 0xff, 0x0f,
+ 0x29, 0xeb, 0x27, 0x6b, 0x08, 0x3b, 0x27, 0xbb,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x27, 0xbb,
+ 0xff, 0xff, 0x29, 0xeb, 0x0c, 0x20, 0x10, 0xd8,
+ 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+};
+define_sfdp_read(n25q256a);
diff --git a/hw/block/meson.build b/hw/block/meson.build
index 1908abd45cbe..b434d5654caf 100644
--- a/hw/block/meson.build
+++ b/hw/block/meson.build
@@ -12,6 +12,7 @@ softmmu_ss.add(when: 'CONFIG_ONENAND', if_true: files('onenand.c'))
softmmu_ss.add(when: 'CONFIG_PFLASH_CFI01', if_true: files('pflash_cfi01.c'))
softmmu_ss.add(when: 'CONFIG_PFLASH_CFI02', if_true: files('pflash_cfi02.c'))
softmmu_ss.add(when: 'CONFIG_SSI_M25P80', if_true: files('m25p80.c'))
+softmmu_ss.add(when: 'CONFIG_SSI_M25P80', if_true: files('m25p80_sfdp.c'))
softmmu_ss.add(when: 'CONFIG_SWIM', if_true: files('swim.c'))
softmmu_ss.add(when: 'CONFIG_XEN', if_true: files('xen-block.c'))
softmmu_ss.add(when: 'CONFIG_TC58128', if_true: files('tc58128.c'))
--
2.37.3
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PULL 09/16] m25p80: Add erase size for mx25l25635e
2022-10-25 15:20 [PULL 00/16] aspeed queue Cédric Le Goater
` (7 preceding siblings ...)
2022-10-25 15:20 ` [PULL 08/16] m25p80: Add the n25q256a SFDP table Cédric Le Goater
@ 2022-10-25 15:20 ` Cédric Le Goater
2022-10-25 15:20 ` [PULL 10/16] m25p80: Add the mx25l25635e SFPD table Cédric Le Goater
` (7 subsequent siblings)
16 siblings, 0 replies; 21+ messages in thread
From: Cédric Le Goater @ 2022-10-25 15:20 UTC (permalink / raw)
To: qemu-arm, qemu-devel
Cc: Peter Maydell, Joel Stanley, Alistair Francis,
Philippe Mathieu-Daudé, qemu-block, Cédric Le Goater,
Francisco Iglesias
Reviewed-by: Francisco Iglesias <frasse.iglesias@gmail.com>
Message-Id: <20221013161241.2805140-4-clg@kaod.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
hw/block/m25p80.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c
index 13e7b28fd2b0..637c25d76e37 100644
--- a/hw/block/m25p80.c
+++ b/hw/block/m25p80.c
@@ -232,7 +232,8 @@ static const FlashPartInfo known_devices[] = {
{ INFO("mx25l6405d", 0xc22017, 0, 64 << 10, 128, 0) },
{ INFO("mx25l12805d", 0xc22018, 0, 64 << 10, 256, 0) },
{ INFO("mx25l12855e", 0xc22618, 0, 64 << 10, 256, 0) },
- { INFO6("mx25l25635e", 0xc22019, 0xc22019, 64 << 10, 512, 0) },
+ { INFO6("mx25l25635e", 0xc22019, 0xc22019, 64 << 10, 512,
+ ER_4K | ER_32K) },
{ INFO("mx25l25655e", 0xc22619, 0, 64 << 10, 512, 0) },
{ INFO("mx66l51235f", 0xc2201a, 0, 64 << 10, 1024, ER_4K | ER_32K) },
{ INFO("mx66u51235f", 0xc2253a, 0, 64 << 10, 1024, ER_4K | ER_32K) },
--
2.37.3
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PULL 10/16] m25p80: Add the mx25l25635e SFPD table
2022-10-25 15:20 [PULL 00/16] aspeed queue Cédric Le Goater
` (8 preceding siblings ...)
2022-10-25 15:20 ` [PULL 09/16] m25p80: Add erase size for mx25l25635e Cédric Le Goater
@ 2022-10-25 15:20 ` Cédric Le Goater
2022-10-25 15:20 ` [PULL 11/16] m25p80: Add the mx25l25635f " Cédric Le Goater
` (6 subsequent siblings)
16 siblings, 0 replies; 21+ messages in thread
From: Cédric Le Goater @ 2022-10-25 15:20 UTC (permalink / raw)
To: qemu-arm, qemu-devel
Cc: Peter Maydell, Joel Stanley, Alistair Francis,
Philippe Mathieu-Daudé, qemu-block, Cédric Le Goater,
Francisco Iglesias
The SFDP table is 0x80 bytes long. The mandatory table for basic
features is available at byte 0x30 and an extra Macronix specific
table is available at 0x60.
4B opcodes are not supported.
Reviewed-by: Francisco Iglesias <frasse.iglesias@gmail.com>
Message-Id: <20220722063602.128144-4-clg@kaod.org>
Message-Id: <20221013161241.2805140-5-clg@kaod.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
hw/block/m25p80_sfdp.h | 3 +++
hw/block/m25p80.c | 2 +-
hw/block/m25p80_sfdp.c | 26 ++++++++++++++++++++++++++
3 files changed, 30 insertions(+), 1 deletion(-)
diff --git a/hw/block/m25p80_sfdp.h b/hw/block/m25p80_sfdp.h
index 7245412cc18c..ecdb9c7f693f 100644
--- a/hw/block/m25p80_sfdp.h
+++ b/hw/block/m25p80_sfdp.h
@@ -17,4 +17,7 @@
uint8_t m25p80_sfdp_n25q256a(uint32_t addr);
+uint8_t m25p80_sfdp_mx25l25635e(uint32_t addr);
+
+
#endif
diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c
index 637c25d76e37..5ddc544e1b83 100644
--- a/hw/block/m25p80.c
+++ b/hw/block/m25p80.c
@@ -233,7 +233,7 @@ static const FlashPartInfo known_devices[] = {
{ INFO("mx25l12805d", 0xc22018, 0, 64 << 10, 256, 0) },
{ INFO("mx25l12855e", 0xc22618, 0, 64 << 10, 256, 0) },
{ INFO6("mx25l25635e", 0xc22019, 0xc22019, 64 << 10, 512,
- ER_4K | ER_32K) },
+ ER_4K | ER_32K), .sfdp_read = m25p80_sfdp_mx25l25635e },
{ INFO("mx25l25655e", 0xc22619, 0, 64 << 10, 512, 0) },
{ INFO("mx66l51235f", 0xc2201a, 0, 64 << 10, 1024, ER_4K | ER_32K) },
{ INFO("mx66u51235f", 0xc2253a, 0, 64 << 10, 1024, ER_4K | ER_32K) },
diff --git a/hw/block/m25p80_sfdp.c b/hw/block/m25p80_sfdp.c
index 24ec05de79a1..6499c4c39954 100644
--- a/hw/block/m25p80_sfdp.c
+++ b/hw/block/m25p80_sfdp.c
@@ -56,3 +56,29 @@ static const uint8_t sfdp_n25q256a[] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
};
define_sfdp_read(n25q256a);
+
+
+/*
+ * Matronix
+ */
+
+/* mx25l25635e. No 4B opcodes */
+static const uint8_t sfdp_mx25l25635e[] = {
+ 0x53, 0x46, 0x44, 0x50, 0x00, 0x01, 0x01, 0xff,
+ 0x00, 0x00, 0x01, 0x09, 0x30, 0x00, 0x00, 0xff,
+ 0xc2, 0x00, 0x01, 0x04, 0x60, 0x00, 0x00, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xe5, 0x20, 0xf3, 0xff, 0xff, 0xff, 0xff, 0x0f,
+ 0x44, 0xeb, 0x08, 0x6b, 0x08, 0x3b, 0x04, 0xbb,
+ 0xee, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xff,
+ 0xff, 0xff, 0x00, 0xff, 0x0c, 0x20, 0x0f, 0x52,
+ 0x10, 0xd8, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x00, 0x36, 0x00, 0x27, 0xf7, 0x4f, 0xff, 0xff,
+ 0xd9, 0xc8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+};
+define_sfdp_read(mx25l25635e)
--
2.37.3
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PULL 11/16] m25p80: Add the mx25l25635f SFPD table
2022-10-25 15:20 [PULL 00/16] aspeed queue Cédric Le Goater
` (9 preceding siblings ...)
2022-10-25 15:20 ` [PULL 10/16] m25p80: Add the mx25l25635e SFPD table Cédric Le Goater
@ 2022-10-25 15:20 ` Cédric Le Goater
2022-10-25 15:20 ` [PULL 12/16] m25p80: Add the mx66l1g45g SFDP table Cédric Le Goater
` (5 subsequent siblings)
16 siblings, 0 replies; 21+ messages in thread
From: Cédric Le Goater @ 2022-10-25 15:20 UTC (permalink / raw)
To: qemu-arm, qemu-devel
Cc: Peter Maydell, Joel Stanley, Alistair Francis,
Philippe Mathieu-Daudé, qemu-block, Cédric Le Goater,
Francisco Iglesias
The mx25l25635e and mx25l25635f chips have the same JEDEC id but the
mx25l25635f has more capabilities reported in the SFDP table. Support
for 4B opcodes is of interest because it is exploited by the Linux
kernel.
The SFDP table size is 0x200 bytes long. The mandatory table for basic
features is available at byte 0x30 and an extra Macronix specific
table is available at 0x60.
Reviewed-by: Francisco Iglesias <frasse.iglesias@gmail.com>
Message-Id: <20220722063602.128144-5-clg@kaod.org>
Message-Id: <20221013161241.2805140-6-clg@kaod.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
hw/block/m25p80_sfdp.h | 1 +
hw/block/m25p80.c | 2 ++
hw/block/m25p80_sfdp.c | 68 ++++++++++++++++++++++++++++++++++++++++++
3 files changed, 71 insertions(+)
diff --git a/hw/block/m25p80_sfdp.h b/hw/block/m25p80_sfdp.h
index ecdb9c7f693f..506817bdc952 100644
--- a/hw/block/m25p80_sfdp.h
+++ b/hw/block/m25p80_sfdp.h
@@ -18,6 +18,7 @@
uint8_t m25p80_sfdp_n25q256a(uint32_t addr);
uint8_t m25p80_sfdp_mx25l25635e(uint32_t addr);
+uint8_t m25p80_sfdp_mx25l25635f(uint32_t addr);
#endif
diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c
index 5ddc544e1b83..ffed1d69d5a9 100644
--- a/hw/block/m25p80.c
+++ b/hw/block/m25p80.c
@@ -234,6 +234,8 @@ static const FlashPartInfo known_devices[] = {
{ INFO("mx25l12855e", 0xc22618, 0, 64 << 10, 256, 0) },
{ INFO6("mx25l25635e", 0xc22019, 0xc22019, 64 << 10, 512,
ER_4K | ER_32K), .sfdp_read = m25p80_sfdp_mx25l25635e },
+ { INFO6("mx25l25635f", 0xc22019, 0xc22019, 64 << 10, 512,
+ ER_4K | ER_32K), .sfdp_read = m25p80_sfdp_mx25l25635f },
{ INFO("mx25l25655e", 0xc22619, 0, 64 << 10, 512, 0) },
{ INFO("mx66l51235f", 0xc2201a, 0, 64 << 10, 1024, ER_4K | ER_32K) },
{ INFO("mx66u51235f", 0xc2253a, 0, 64 << 10, 1024, ER_4K | ER_32K) },
diff --git a/hw/block/m25p80_sfdp.c b/hw/block/m25p80_sfdp.c
index 6499c4c39954..70c13aea7c63 100644
--- a/hw/block/m25p80_sfdp.c
+++ b/hw/block/m25p80_sfdp.c
@@ -82,3 +82,71 @@ static const uint8_t sfdp_mx25l25635e[] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
};
define_sfdp_read(mx25l25635e)
+
+static const uint8_t sfdp_mx25l25635f[] = {
+ 0x53, 0x46, 0x44, 0x50, 0x00, 0x01, 0x01, 0xff,
+ 0x00, 0x00, 0x01, 0x09, 0x30, 0x00, 0x00, 0xff,
+ 0xc2, 0x00, 0x01, 0x04, 0x60, 0x00, 0x00, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xe5, 0x20, 0xf3, 0xff, 0xff, 0xff, 0xff, 0x0f,
+ 0x44, 0xeb, 0x08, 0x6b, 0x08, 0x3b, 0x04, 0xbb,
+ 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xff,
+ 0xff, 0xff, 0x44, 0xeb, 0x0c, 0x20, 0x0f, 0x52,
+ 0x10, 0xd8, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x00, 0x36, 0x00, 0x27, 0x9d, 0xf9, 0xc0, 0x64,
+ 0x85, 0xcb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xc2, 0xf5, 0x08, 0x0a,
+ 0x08, 0x04, 0x03, 0x06, 0x00, 0x00, 0x07, 0x29,
+ 0x17, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+};
+define_sfdp_read(mx25l25635f);
--
2.37.3
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PULL 12/16] m25p80: Add the mx66l1g45g SFDP table
2022-10-25 15:20 [PULL 00/16] aspeed queue Cédric Le Goater
` (10 preceding siblings ...)
2022-10-25 15:20 ` [PULL 11/16] m25p80: Add the mx25l25635f " Cédric Le Goater
@ 2022-10-25 15:20 ` Cédric Le Goater
2022-10-25 15:20 ` [PULL 13/16] m25p80: Add the w25q256 SFPD table Cédric Le Goater
` (4 subsequent siblings)
16 siblings, 0 replies; 21+ messages in thread
From: Cédric Le Goater @ 2022-10-25 15:20 UTC (permalink / raw)
To: qemu-arm, qemu-devel
Cc: Peter Maydell, Joel Stanley, Alistair Francis,
Philippe Mathieu-Daudé, qemu-block, Cédric Le Goater,
Francisco Iglesias
The SFDP table size is 0x200 bytes long. The mandatory table for basic
features is available at byte 0x30 plus some more Macronix specific
tables.
Reviewed-by: Francisco Iglesias <frasse.iglesias@gmail.com>
Message-Id: <20220722063602.128144-6-clg@kaod.org>
Message-Id: <20221013161241.2805140-7-clg@kaod.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
hw/block/m25p80_sfdp.h | 2 +-
hw/block/m25p80.c | 3 +-
hw/block/m25p80_sfdp.c | 68 ++++++++++++++++++++++++++++++++++++++++++
3 files changed, 71 insertions(+), 2 deletions(-)
diff --git a/hw/block/m25p80_sfdp.h b/hw/block/m25p80_sfdp.h
index 506817bdc952..ec829644b047 100644
--- a/hw/block/m25p80_sfdp.h
+++ b/hw/block/m25p80_sfdp.h
@@ -19,6 +19,6 @@ uint8_t m25p80_sfdp_n25q256a(uint32_t addr);
uint8_t m25p80_sfdp_mx25l25635e(uint32_t addr);
uint8_t m25p80_sfdp_mx25l25635f(uint32_t addr);
-
+uint8_t m25p80_sfdp_mx66l1g45g(uint32_t addr);
#endif
diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c
index ffed1d69d5a9..376be327e575 100644
--- a/hw/block/m25p80.c
+++ b/hw/block/m25p80.c
@@ -240,7 +240,8 @@ static const FlashPartInfo known_devices[] = {
{ INFO("mx66l51235f", 0xc2201a, 0, 64 << 10, 1024, ER_4K | ER_32K) },
{ INFO("mx66u51235f", 0xc2253a, 0, 64 << 10, 1024, ER_4K | ER_32K) },
{ INFO("mx66u1g45g", 0xc2253b, 0, 64 << 10, 2048, ER_4K | ER_32K) },
- { INFO("mx66l1g45g", 0xc2201b, 0, 64 << 10, 2048, ER_4K | ER_32K) },
+ { INFO("mx66l1g45g", 0xc2201b, 0, 64 << 10, 2048, ER_4K | ER_32K),
+ .sfdp_read = m25p80_sfdp_mx66l1g45g },
/* Micron */
{ INFO("n25q032a11", 0x20bb16, 0, 64 << 10, 64, ER_4K) },
diff --git a/hw/block/m25p80_sfdp.c b/hw/block/m25p80_sfdp.c
index 70c13aea7c63..38c3ced34d2e 100644
--- a/hw/block/m25p80_sfdp.c
+++ b/hw/block/m25p80_sfdp.c
@@ -150,3 +150,71 @@ static const uint8_t sfdp_mx25l25635f[] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
};
define_sfdp_read(mx25l25635f);
+
+static const uint8_t sfdp_mx66l1g45g[] = {
+ 0x53, 0x46, 0x44, 0x50, 0x06, 0x01, 0x02, 0xff,
+ 0x00, 0x06, 0x01, 0x10, 0x30, 0x00, 0x00, 0xff,
+ 0xc2, 0x00, 0x01, 0x04, 0x10, 0x01, 0x00, 0xff,
+ 0x84, 0x00, 0x01, 0x02, 0xc0, 0x00, 0x00, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xe5, 0x20, 0xfb, 0xff, 0xff, 0xff, 0xff, 0x3f,
+ 0x44, 0xeb, 0x08, 0x6b, 0x08, 0x3b, 0x04, 0xbb,
+ 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xff,
+ 0xff, 0xff, 0x44, 0xeb, 0x0c, 0x20, 0x0f, 0x52,
+ 0x10, 0xd8, 0x00, 0xff, 0xd6, 0x49, 0xc5, 0x00,
+ 0x85, 0xdf, 0x04, 0xe3, 0x44, 0x03, 0x67, 0x38,
+ 0x30, 0xb0, 0x30, 0xb0, 0xf7, 0xbd, 0xd5, 0x5c,
+ 0x4a, 0x9e, 0x29, 0xff, 0xf0, 0x50, 0xf9, 0x85,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x7f, 0xef, 0xff, 0xff, 0x21, 0x5c, 0xdc, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x00, 0x36, 0x00, 0x27, 0x9d, 0xf9, 0xc0, 0x64,
+ 0x85, 0xcb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xc2, 0xf5, 0x08, 0x00, 0x0c, 0x04, 0x08, 0x08,
+ 0x01, 0x00, 0x19, 0x0f, 0x01, 0x01, 0x06, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+};
+define_sfdp_read(mx66l1g45g);
--
2.37.3
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PULL 13/16] m25p80: Add the w25q256 SFPD table
2022-10-25 15:20 [PULL 00/16] aspeed queue Cédric Le Goater
` (11 preceding siblings ...)
2022-10-25 15:20 ` [PULL 12/16] m25p80: Add the mx66l1g45g SFDP table Cédric Le Goater
@ 2022-10-25 15:20 ` Cédric Le Goater
2022-10-25 15:20 ` [PULL 14/16] m25p80: Add the w25q512jv " Cédric Le Goater
` (3 subsequent siblings)
16 siblings, 0 replies; 21+ messages in thread
From: Cédric Le Goater @ 2022-10-25 15:20 UTC (permalink / raw)
To: qemu-arm, qemu-devel
Cc: Peter Maydell, Joel Stanley, Alistair Francis,
Philippe Mathieu-Daudé, qemu-block, Cédric Le Goater,
Francisco Iglesias
The SFDP table size is 0x100 bytes long. Only the mandatory table for
basic features is available at byte 0x80.
Reviewed-by: Francisco Iglesias <frasse.iglesias@gmail.com>
Message-Id: <20220722063602.128144-7-clg@kaod.org>
Message-Id: <20221013161241.2805140-8-clg@kaod.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
hw/block/m25p80_sfdp.h | 2 ++
hw/block/m25p80.c | 3 ++-
hw/block/m25p80_sfdp.c | 40 ++++++++++++++++++++++++++++++++++++++++
3 files changed, 44 insertions(+), 1 deletion(-)
diff --git a/hw/block/m25p80_sfdp.h b/hw/block/m25p80_sfdp.h
index ec829644b047..595be9000daa 100644
--- a/hw/block/m25p80_sfdp.h
+++ b/hw/block/m25p80_sfdp.h
@@ -21,4 +21,6 @@ uint8_t m25p80_sfdp_mx25l25635e(uint32_t addr);
uint8_t m25p80_sfdp_mx25l25635f(uint32_t addr);
uint8_t m25p80_sfdp_mx66l1g45g(uint32_t addr);
+uint8_t m25p80_sfdp_w25q256(uint32_t addr);
+
#endif
diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c
index 376be327e575..6119c57c8980 100644
--- a/hw/block/m25p80.c
+++ b/hw/block/m25p80.c
@@ -345,7 +345,8 @@ static const FlashPartInfo known_devices[] = {
{ INFO("w25q64", 0xef4017, 0, 64 << 10, 128, ER_4K) },
{ INFO("w25q80", 0xef5014, 0, 64 << 10, 16, ER_4K) },
{ INFO("w25q80bl", 0xef4014, 0, 64 << 10, 16, ER_4K) },
- { INFO("w25q256", 0xef4019, 0, 64 << 10, 512, ER_4K) },
+ { INFO("w25q256", 0xef4019, 0, 64 << 10, 512, ER_4K),
+ .sfdp_read = m25p80_sfdp_w25q256 },
{ INFO("w25q512jv", 0xef4020, 0, 64 << 10, 1024, ER_4K) },
{ INFO("w25q01jvq", 0xef4021, 0, 64 << 10, 2048, ER_4K) },
};
diff --git a/hw/block/m25p80_sfdp.c b/hw/block/m25p80_sfdp.c
index 38c3ced34d2e..5b011559d43d 100644
--- a/hw/block/m25p80_sfdp.c
+++ b/hw/block/m25p80_sfdp.c
@@ -218,3 +218,43 @@ static const uint8_t sfdp_mx66l1g45g[] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
};
define_sfdp_read(mx66l1g45g);
+
+/*
+ * Windbond
+ */
+
+static const uint8_t sfdp_w25q256[] = {
+ 0x53, 0x46, 0x44, 0x50, 0x00, 0x01, 0x00, 0xff,
+ 0x00, 0x00, 0x01, 0x09, 0x80, 0x00, 0x00, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xe5, 0x20, 0xf3, 0xff, 0xff, 0xff, 0xff, 0x0f,
+ 0x44, 0xeb, 0x08, 0x6b, 0x08, 0x3b, 0x42, 0xbb,
+ 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
+ 0xff, 0xff, 0x21, 0xeb, 0x0c, 0x20, 0x0f, 0x52,
+ 0x10, 0xd8, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+};
+define_sfdp_read(w25q256);
--
2.37.3
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PULL 14/16] m25p80: Add the w25q512jv SFPD table
2022-10-25 15:20 [PULL 00/16] aspeed queue Cédric Le Goater
` (12 preceding siblings ...)
2022-10-25 15:20 ` [PULL 13/16] m25p80: Add the w25q256 SFPD table Cédric Le Goater
@ 2022-10-25 15:20 ` Cédric Le Goater
2022-10-25 15:20 ` [PULL 15/16] m25p80: Add the w25q01jvq " Cédric Le Goater
` (2 subsequent siblings)
16 siblings, 0 replies; 21+ messages in thread
From: Cédric Le Goater @ 2022-10-25 15:20 UTC (permalink / raw)
To: qemu-arm, qemu-devel
Cc: Peter Maydell, Joel Stanley, Alistair Francis,
Philippe Mathieu-Daudé, qemu-block, Cédric Le Goater,
Francisco Iglesias
The SFDP table size is 0x100 bytes long. The mandatory table for basic
features is available at byte 0x80 and two extra Winbond specifics
table are available at 0xC0 and 0xF0.
Reviewed-by: Francisco Iglesias <frasse.iglesias@gmail.com>
Message-Id: <20220722063602.128144-8-clg@kaod.org>
Message-Id: <20221013161241.2805140-9-clg@kaod.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
hw/block/m25p80_sfdp.h | 1 +
hw/block/m25p80.c | 3 ++-
hw/block/m25p80_sfdp.c | 36 ++++++++++++++++++++++++++++++++++++
3 files changed, 39 insertions(+), 1 deletion(-)
diff --git a/hw/block/m25p80_sfdp.h b/hw/block/m25p80_sfdp.h
index 595be9000daa..e50f57e48e43 100644
--- a/hw/block/m25p80_sfdp.h
+++ b/hw/block/m25p80_sfdp.h
@@ -22,5 +22,6 @@ uint8_t m25p80_sfdp_mx25l25635f(uint32_t addr);
uint8_t m25p80_sfdp_mx66l1g45g(uint32_t addr);
uint8_t m25p80_sfdp_w25q256(uint32_t addr);
+uint8_t m25p80_sfdp_w25q512jv(uint32_t addr);
#endif
diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c
index 6119c57c8980..8353a00a0595 100644
--- a/hw/block/m25p80.c
+++ b/hw/block/m25p80.c
@@ -347,7 +347,8 @@ static const FlashPartInfo known_devices[] = {
{ INFO("w25q80bl", 0xef4014, 0, 64 << 10, 16, ER_4K) },
{ INFO("w25q256", 0xef4019, 0, 64 << 10, 512, ER_4K),
.sfdp_read = m25p80_sfdp_w25q256 },
- { INFO("w25q512jv", 0xef4020, 0, 64 << 10, 1024, ER_4K) },
+ { INFO("w25q512jv", 0xef4020, 0, 64 << 10, 1024, ER_4K),
+ .sfdp_read = m25p80_sfdp_w25q512jv },
{ INFO("w25q01jvq", 0xef4021, 0, 64 << 10, 2048, ER_4K) },
};
diff --git a/hw/block/m25p80_sfdp.c b/hw/block/m25p80_sfdp.c
index 5b011559d43d..dad3d7e64f9f 100644
--- a/hw/block/m25p80_sfdp.c
+++ b/hw/block/m25p80_sfdp.c
@@ -258,3 +258,39 @@ static const uint8_t sfdp_w25q256[] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
};
define_sfdp_read(w25q256);
+
+static const uint8_t sfdp_w25q512jv[] = {
+ 0x53, 0x46, 0x44, 0x50, 0x06, 0x01, 0x01, 0xff,
+ 0x00, 0x06, 0x01, 0x10, 0x80, 0x00, 0x00, 0xff,
+ 0x84, 0x00, 0x01, 0x02, 0xd0, 0x00, 0x00, 0xff,
+ 0x03, 0x00, 0x01, 0x02, 0xf0, 0x00, 0x00, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xe5, 0x20, 0xfb, 0xff, 0xff, 0xff, 0xff, 0x1f,
+ 0x44, 0xeb, 0x08, 0x6b, 0x08, 0x3b, 0x42, 0xbb,
+ 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
+ 0xff, 0xff, 0x40, 0xeb, 0x0c, 0x20, 0x0f, 0x52,
+ 0x10, 0xd8, 0x00, 0x00, 0x36, 0x02, 0xa6, 0x00,
+ 0x82, 0xea, 0x14, 0xe2, 0xe9, 0x63, 0x76, 0x33,
+ 0x7a, 0x75, 0x7a, 0x75, 0xf7, 0xa2, 0xd5, 0x5c,
+ 0x19, 0xf7, 0x4d, 0xff, 0xe9, 0x70, 0xf9, 0xa5,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0x0a, 0xf0, 0xff, 0x21, 0xff, 0xdc, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+};
+define_sfdp_read(w25q512jv);
--
2.37.3
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PULL 15/16] m25p80: Add the w25q01jvq SFPD table
2022-10-25 15:20 [PULL 00/16] aspeed queue Cédric Le Goater
` (13 preceding siblings ...)
2022-10-25 15:20 ` [PULL 14/16] m25p80: Add the w25q512jv " Cédric Le Goater
@ 2022-10-25 15:20 ` Cédric Le Goater
2022-10-25 15:20 ` [PULL 16/16] arm/aspeed: Replace mx25l25635e chip model Cédric Le Goater
2022-10-26 18:54 ` [PULL 00/16] aspeed queue Stefan Hajnoczi
16 siblings, 0 replies; 21+ messages in thread
From: Cédric Le Goater @ 2022-10-25 15:20 UTC (permalink / raw)
To: qemu-arm, qemu-devel
Cc: Peter Maydell, Joel Stanley, Alistair Francis,
Philippe Mathieu-Daudé, qemu-block, Patrick Williams,
Francisco Iglesias, Cédric Le Goater
From: Patrick Williams <patrick@stwcx.xyz>
Generated from hardware using the following command and then padding
with 0xff to fill out a power-of-2:
hexdump -v -e '8/1 "0x%02x, " "\n"' sfdp`
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Reviewed-by: Francisco Iglesias <frasse.iglesias@gmail.com>
[ clg: removed extern ]
Message-Id: <20221006224424.3556372-1-patrick@stwcx.xyz>
Message-Id: <20221013161241.2805140-10-clg@kaod.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
hw/block/m25p80_sfdp.h | 2 ++
hw/block/m25p80.c | 3 ++-
hw/block/m25p80_sfdp.c | 36 ++++++++++++++++++++++++++++++++++++
3 files changed, 40 insertions(+), 1 deletion(-)
diff --git a/hw/block/m25p80_sfdp.h b/hw/block/m25p80_sfdp.h
index e50f57e48e43..df7adfb5cec6 100644
--- a/hw/block/m25p80_sfdp.h
+++ b/hw/block/m25p80_sfdp.h
@@ -24,4 +24,6 @@ uint8_t m25p80_sfdp_mx66l1g45g(uint32_t addr);
uint8_t m25p80_sfdp_w25q256(uint32_t addr);
uint8_t m25p80_sfdp_w25q512jv(uint32_t addr);
+uint8_t m25p80_sfdp_w25q01jvq(uint32_t addr);
+
#endif
diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c
index 8353a00a0595..02adc8752736 100644
--- a/hw/block/m25p80.c
+++ b/hw/block/m25p80.c
@@ -349,7 +349,8 @@ static const FlashPartInfo known_devices[] = {
.sfdp_read = m25p80_sfdp_w25q256 },
{ INFO("w25q512jv", 0xef4020, 0, 64 << 10, 1024, ER_4K),
.sfdp_read = m25p80_sfdp_w25q512jv },
- { INFO("w25q01jvq", 0xef4021, 0, 64 << 10, 2048, ER_4K) },
+ { INFO("w25q01jvq", 0xef4021, 0, 64 << 10, 2048, ER_4K),
+ .sfdp_read = m25p80_sfdp_w25q01jvq },
};
typedef enum {
diff --git a/hw/block/m25p80_sfdp.c b/hw/block/m25p80_sfdp.c
index dad3d7e64f9f..77615fa29e5b 100644
--- a/hw/block/m25p80_sfdp.c
+++ b/hw/block/m25p80_sfdp.c
@@ -294,3 +294,39 @@ static const uint8_t sfdp_w25q512jv[] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
};
define_sfdp_read(w25q512jv);
+
+static const uint8_t sfdp_w25q01jvq[] = {
+ 0x53, 0x46, 0x44, 0x50, 0x06, 0x01, 0x01, 0xff,
+ 0x00, 0x06, 0x01, 0x10, 0x80, 0x00, 0x00, 0xff,
+ 0x84, 0x00, 0x01, 0x02, 0xd0, 0x00, 0x00, 0xff,
+ 0x03, 0x00, 0x01, 0x02, 0xf0, 0x00, 0x00, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xe5, 0x20, 0xfb, 0xff, 0xff, 0xff, 0xff, 0x3f,
+ 0x44, 0xeb, 0x08, 0x6b, 0x08, 0x3b, 0x42, 0xbb,
+ 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
+ 0xff, 0xff, 0x40, 0xeb, 0x0c, 0x20, 0x0f, 0x52,
+ 0x10, 0xd8, 0x00, 0x00, 0x36, 0x02, 0xa6, 0x00,
+ 0x82, 0xea, 0x14, 0xe2, 0xe9, 0x63, 0x76, 0x33,
+ 0x7a, 0x75, 0x7a, 0x75, 0xf7, 0xa2, 0xd5, 0x5c,
+ 0x19, 0xf7, 0x4d, 0xff, 0xe9, 0x70, 0xf9, 0xa5,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0x0a, 0xf0, 0xff, 0x21, 0xff, 0xdc, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+};
+define_sfdp_read(w25q01jvq);
--
2.37.3
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PULL 16/16] arm/aspeed: Replace mx25l25635e chip model
2022-10-25 15:20 [PULL 00/16] aspeed queue Cédric Le Goater
` (14 preceding siblings ...)
2022-10-25 15:20 ` [PULL 15/16] m25p80: Add the w25q01jvq " Cédric Le Goater
@ 2022-10-25 15:20 ` Cédric Le Goater
2022-10-26 18:54 ` [PULL 00/16] aspeed queue Stefan Hajnoczi
16 siblings, 0 replies; 21+ messages in thread
From: Cédric Le Goater @ 2022-10-25 15:20 UTC (permalink / raw)
To: qemu-arm, qemu-devel
Cc: Peter Maydell, Joel Stanley, Alistair Francis,
Philippe Mathieu-Daudé, qemu-block, Cédric Le Goater,
Francisco Iglesias
A mx25l25635f chip model is generally found on these machines. It's
newer and uses 4B opcodes which is better to exercise the support in
the Linux kernel.
Reviewed-by: Francisco Iglesias <frasse.iglesias@gmail.com>
Message-Id: <20220722063602.128144-9-clg@kaod.org>
Message-Id: <20221013161241.2805140-11-clg@kaod.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
hw/arm/aspeed.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
index bc5c1e167773..f8bc6d4a1406 100644
--- a/hw/arm/aspeed.c
+++ b/hw/arm/aspeed.c
@@ -1099,7 +1099,7 @@ static void aspeed_machine_palmetto_class_init(ObjectClass *oc, void *data)
amc->soc_name = "ast2400-a1";
amc->hw_strap1 = PALMETTO_BMC_HW_STRAP1;
amc->fmc_model = "n25q256a";
- amc->spi_model = "mx25l25635e";
+ amc->spi_model = "mx25l25635f";
amc->num_cs = 1;
amc->i2c_init = palmetto_bmc_i2c_init;
mc->default_ram_size = 256 * MiB;
@@ -1150,7 +1150,7 @@ static void aspeed_machine_ast2500_evb_class_init(ObjectClass *oc, void *data)
amc->soc_name = "ast2500-a1";
amc->hw_strap1 = AST2500_EVB_HW_STRAP1;
amc->fmc_model = "mx25l25635e";
- amc->spi_model = "mx25l25635e";
+ amc->spi_model = "mx25l25635f";
amc->num_cs = 1;
amc->i2c_init = ast2500_evb_i2c_init;
mc->default_ram_size = 512 * MiB;
@@ -1200,7 +1200,7 @@ static void aspeed_machine_witherspoon_class_init(ObjectClass *oc, void *data)
mc->desc = "OpenPOWER Witherspoon BMC (ARM1176)";
amc->soc_name = "ast2500-a1";
amc->hw_strap1 = WITHERSPOON_BMC_HW_STRAP1;
- amc->fmc_model = "mx25l25635e";
+ amc->fmc_model = "mx25l25635f";
amc->spi_model = "mx66l1g45g";
amc->num_cs = 2;
amc->i2c_init = witherspoon_bmc_i2c_init;
--
2.37.3
^ permalink raw reply related [flat|nested] 21+ messages in thread
* Re: [PULL 00/16] aspeed queue
2022-10-25 15:20 [PULL 00/16] aspeed queue Cédric Le Goater
` (15 preceding siblings ...)
2022-10-25 15:20 ` [PULL 16/16] arm/aspeed: Replace mx25l25635e chip model Cédric Le Goater
@ 2022-10-26 18:54 ` Stefan Hajnoczi
16 siblings, 0 replies; 21+ messages in thread
From: Stefan Hajnoczi @ 2022-10-26 18:54 UTC (permalink / raw)
To: Cédric Le Goater
Cc: qemu-arm, qemu-devel, Peter Maydell, Joel Stanley,
Alistair Francis, Philippe Mathieu-Daudé, qemu-block,
Cédric Le Goater
[-- Attachment #1: Type: text/plain, Size: 115 bytes --]
Applied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/7.2 for any user-visible changes.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 21+ messages in thread