* [PULL 00/26] aspeed queue
@ 2023-09-01 9:41 Cédric Le Goater
2023-09-01 9:41 ` [PULL 01/26] aspeed: Introduce helper for 32-bit hosts limitation Cédric Le Goater
` (27 more replies)
0 siblings, 28 replies; 31+ messages in thread
From: Cédric Le Goater @ 2023-09-01 9:41 UTC (permalink / raw)
To: qemu-arm, qemu-devel; +Cc: Cédric Le Goater
The following changes since commit 17780edd81d27fcfdb7a802efc870a99788bd2fc:
Merge tag 'quick-fix-pull-request' of https://gitlab.com/bsdimp/qemu into staging (2023-08-31 10:06:29 -0400)
are available in the Git repository at:
https://github.com/legoater/qemu/ tags/pull-aspeed-20230901
for you to fetch changes up to c3287c0f70dae07dd12322c5c8663f7b878826e7:
hw/sd: Introduce a "sd-card" SPI variant model (2023-09-01 11:40:04 +0200)
----------------------------------------------------------------
aspeed queue:
* Fixes for the Aspeed I2C model
* New SDK image for avocado tests
* blockdev support for flash device definition
* SD refactoring preparing ground for eMMC support
----------------------------------------------------------------
Cédric Le Goater (10):
aspeed: Introduce helper for 32-bit hosts limitation
tests/avocado/machine_aspeed.py: Update SDK images
hw/ssi: Add a "cs" property to SSIPeripheral
hw/ssi: Introduce a ssi_get_cs() helper
aspeed/smc: Wire CS lines at reset
hw/ssi: Check for duplicate CS indexes
aspeed: Create flash devices only when defaults are enabled
m25p80: Introduce an helper to retrieve the BlockBackend of a device
aspeed: Get the BlockBackend of FMC0 from the flash device
hw/sd: Introduce a "sd-card" SPI variant model
Hang Yu (3):
hw/i2c/aspeed: Fix Tx count and Rx size error in buffer pool mode
hw/i2c/aspeed: Fix TXBUF transmission start position error
hw/i2c/aspeed: Add support for buffer organization
Joel Stanley (1):
hw/sd: Add sd_cmd_SEND_TUNING_BLOCK() handler
Philippe Mathieu-Daudé (12):
hw/sd/sdcard: Return ILLEGAL for CMD19/CMD23 prior SD spec v3.01
hw/sd: When card is in wrong state, log which state it is
hw/sd: When card is in wrong state, log which spec version is used
hw/sd: Move proto_name to SDProto structure
hw/sd: Introduce sd_cmd_handler type
hw/sd: Add sd_cmd_illegal() handler
hw/sd: Add sd_cmd_unimplemented() handler
hw/sd: Add sd_cmd_GO_IDLE_STATE() handler
hw/sd: Add sd_cmd_SEND_OP_CMD() handler
hw/sd: Add sd_cmd_ALL_SEND_CID() handler
hw/sd: Add sd_cmd_SEND_RELATIVE_ADDR() handler
hw/sd: Add sd_cmd_SET_BLOCK_COUNT() handler
docs/system/arm/aspeed.rst | 35 +++-
include/hw/block/flash.h | 4 +
include/hw/i2c/aspeed_i2c.h | 5 +-
include/hw/sd/sd.h | 5 +
include/hw/ssi/ssi.h | 5 +
hw/arm/aspeed.c | 40 ++---
hw/arm/stellaris.c | 7 +-
hw/arm/xilinx_zynq.c | 1 +
hw/arm/xlnx-versal-virt.c | 1 +
hw/arm/xlnx-zcu102.c | 2 +
hw/block/m25p80.c | 6 +
hw/i2c/aspeed_i2c.c | 40 ++---
hw/microblaze/petalogix_ml605_mmu.c | 1 +
hw/riscv/sifive_u.c | 3 +-
hw/sd/sd.c | 348 ++++++++++++++++++++++--------------
hw/sd/sdmmc-internal.c | 2 +-
hw/ssi/aspeed_smc.c | 8 +
hw/ssi/ssi.c | 43 +++++
tests/avocado/machine_aspeed.py | 12 +-
19 files changed, 367 insertions(+), 201 deletions(-)
^ permalink raw reply [flat|nested] 31+ messages in thread
* [PULL 01/26] aspeed: Introduce helper for 32-bit hosts limitation
2023-09-01 9:41 [PULL 00/26] aspeed queue Cédric Le Goater
@ 2023-09-01 9:41 ` Cédric Le Goater
2023-09-01 9:41 ` [PULL 02/26] hw/i2c/aspeed: Fix Tx count and Rx size error in buffer pool mode Cédric Le Goater
` (26 subsequent siblings)
27 siblings, 0 replies; 31+ messages in thread
From: Cédric Le Goater @ 2023-09-01 9:41 UTC (permalink / raw)
To: qemu-arm, qemu-devel
Cc: Cédric Le Goater, Philippe Mathieu-Daudé,
Alex Bennée
On 32-bit hosts, RAM has a 2047 MB limit. Use a macro to define the
default ram size of machines (AST2600 SoC) that can have 2 GB.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
hw/arm/aspeed.c | 21 +++++++++------------
1 file changed, 9 insertions(+), 12 deletions(-)
diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
index 263626abeae1..b922a2c491cc 100644
--- a/hw/arm/aspeed.c
+++ b/hw/arm/aspeed.c
@@ -47,6 +47,13 @@ struct AspeedMachineState {
char *spi_model;
};
+/* On 32-bit hosts, lower RAM to 1G because of the 2047 MB limit */
+#if HOST_LONG_BITS == 32
+#define ASPEED_RAM_SIZE(sz) MIN((sz), 1 * GiB)
+#else
+#define ASPEED_RAM_SIZE(sz) (sz)
+#endif
+
/* Palmetto hardware value: 0x120CE416 */
#define PALMETTO_BMC_HW_STRAP1 ( \
SCU_AST2400_HW_STRAP_DRAM_SIZE(DRAM_SIZE_256MB) | \
@@ -1423,12 +1430,7 @@ static void aspeed_machine_rainier_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 FUJI_BMC_RAM_SIZE (1 * GiB)
-#else
-#define FUJI_BMC_RAM_SIZE (2 * GiB)
-#endif
+#define FUJI_BMC_RAM_SIZE ASPEED_RAM_SIZE(2 * GiB)
static void aspeed_machine_fuji_class_init(ObjectClass *oc, void *data)
{
@@ -1450,12 +1452,7 @@ 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
+#define BLETCHLEY_BMC_RAM_SIZE ASPEED_RAM_SIZE(2 * GiB)
static void aspeed_machine_bletchley_class_init(ObjectClass *oc, void *data)
{
--
2.41.0
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PULL 02/26] hw/i2c/aspeed: Fix Tx count and Rx size error in buffer pool mode
2023-09-01 9:41 [PULL 00/26] aspeed queue Cédric Le Goater
2023-09-01 9:41 ` [PULL 01/26] aspeed: Introduce helper for 32-bit hosts limitation Cédric Le Goater
@ 2023-09-01 9:41 ` Cédric Le Goater
2023-09-01 9:41 ` [PULL 03/26] hw/i2c/aspeed: Fix TXBUF transmission start position error Cédric Le Goater
` (25 subsequent siblings)
27 siblings, 0 replies; 31+ messages in thread
From: Cédric Le Goater @ 2023-09-01 9:41 UTC (permalink / raw)
To: qemu-arm, qemu-devel; +Cc: Hang Yu, Cédric Le Goater
From: Hang Yu <francis_yuu@stu.pku.edu.cn>
Fixed inconsistency between the regisiter bit field definition header file
and the ast2600 datasheet. The reg name is I2CD1C:Pool Buffer Control
Register in old register mode and I2CC0C: Master/Slave Pool Buffer Control
Register in new register mode. They share bit field
[12:8]:Transmit Data Byte Count and bit field
[29:24]:Actual Received Pool Buffer Size according to the datasheet.
According to the ast2600 datasheet,the actual Tx count is
Transmit Data Byte Count plus 1, and the max Rx size is
Receive Pool Buffer Size plus 1, both in Pool Buffer Control Register.
The version before forgot to plus 1, and mistake Rx count for Rx size.
Signed-off-by: Hang Yu <francis_yuu@stu.pku.edu.cn>
Fixes: 3be3d6ccf2ad ("aspeed: i2c: Migrate to registerfields API")
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
include/hw/i2c/aspeed_i2c.h | 4 ++--
hw/i2c/aspeed_i2c.c | 8 ++++----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/include/hw/i2c/aspeed_i2c.h b/include/hw/i2c/aspeed_i2c.h
index 51c944efeaae..2e1e15aaf0f7 100644
--- a/include/hw/i2c/aspeed_i2c.h
+++ b/include/hw/i2c/aspeed_i2c.h
@@ -139,9 +139,9 @@ REG32(I2CD_CMD, 0x14) /* I2CD Command/Status */
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_COUNT, 24, 6)
SHARED_FIELD(RX_SIZE, 16, 5)
- SHARED_FIELD(TX_COUNT, 9, 5)
+ SHARED_FIELD(TX_COUNT, 8, 5)
FIELD(I2CD_POOL_CTRL, OFFSET, 2, 6) /* AST2400 */
REG32(I2CD_BYTE_BUF, 0x20) /* Transmit/Receive Byte Buffer */
SHARED_FIELD(RX_BUF, 8, 8)
diff --git a/hw/i2c/aspeed_i2c.c b/hw/i2c/aspeed_i2c.c
index 1f071a3811f7..e485d8bfb836 100644
--- a/hw/i2c/aspeed_i2c.c
+++ b/hw/i2c/aspeed_i2c.c
@@ -236,7 +236,7 @@ static int aspeed_i2c_bus_send(AspeedI2CBus *bus, uint8_t pool_start)
uint32_t reg_byte_buf = aspeed_i2c_bus_byte_buf_offset(bus);
uint32_t reg_dma_len = aspeed_i2c_bus_dma_len_offset(bus);
int pool_tx_count = SHARED_ARRAY_FIELD_EX32(bus->regs, reg_pool_ctrl,
- TX_COUNT);
+ TX_COUNT) + 1;
if (SHARED_ARRAY_FIELD_EX32(bus->regs, reg_cmd, TX_BUFF_EN)) {
for (i = pool_start; i < pool_tx_count; i++) {
@@ -293,7 +293,7 @@ static void aspeed_i2c_bus_recv(AspeedI2CBus *bus)
uint32_t reg_dma_len = aspeed_i2c_bus_dma_len_offset(bus);
uint32_t reg_dma_addr = aspeed_i2c_bus_dma_addr_offset(bus);
int pool_rx_count = SHARED_ARRAY_FIELD_EX32(bus->regs, reg_pool_ctrl,
- RX_COUNT);
+ RX_SIZE) + 1;
if (SHARED_ARRAY_FIELD_EX32(bus->regs, reg_cmd, RX_BUFF_EN)) {
uint8_t *pool_base = aic->bus_pool_base(bus);
@@ -418,7 +418,7 @@ static void aspeed_i2c_bus_cmd_dump(AspeedI2CBus *bus)
uint32_t reg_intr_sts = aspeed_i2c_bus_intr_sts_offset(bus);
uint32_t reg_dma_len = aspeed_i2c_bus_dma_len_offset(bus);
if (SHARED_ARRAY_FIELD_EX32(bus->regs, reg_cmd, RX_BUFF_EN)) {
- count = SHARED_ARRAY_FIELD_EX32(bus->regs, reg_pool_ctrl, TX_COUNT);
+ count = SHARED_ARRAY_FIELD_EX32(bus->regs, reg_pool_ctrl, TX_COUNT) + 1;
} else if (SHARED_ARRAY_FIELD_EX32(bus->regs, reg_cmd, RX_DMA_EN)) {
count = bus->regs[reg_dma_len];
} else { /* BYTE mode */
@@ -490,7 +490,7 @@ static void aspeed_i2c_bus_handle_cmd(AspeedI2CBus *bus, uint64_t value)
*/
if (SHARED_ARRAY_FIELD_EX32(bus->regs, reg_cmd, TX_BUFF_EN)) {
if (SHARED_ARRAY_FIELD_EX32(bus->regs, reg_pool_ctrl, TX_COUNT)
- == 1) {
+ == 0) {
SHARED_ARRAY_FIELD_DP32(bus->regs, reg_cmd, M_TX_CMD, 0);
} else {
/*
--
2.41.0
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PULL 03/26] hw/i2c/aspeed: Fix TXBUF transmission start position error
2023-09-01 9:41 [PULL 00/26] aspeed queue Cédric Le Goater
2023-09-01 9:41 ` [PULL 01/26] aspeed: Introduce helper for 32-bit hosts limitation Cédric Le Goater
2023-09-01 9:41 ` [PULL 02/26] hw/i2c/aspeed: Fix Tx count and Rx size error in buffer pool mode Cédric Le Goater
@ 2023-09-01 9:41 ` Cédric Le Goater
2023-09-01 9:41 ` [PULL 04/26] hw/i2c/aspeed: Add support for buffer organization Cédric Le Goater
` (24 subsequent siblings)
27 siblings, 0 replies; 31+ messages in thread
From: Cédric Le Goater @ 2023-09-01 9:41 UTC (permalink / raw)
To: qemu-arm, qemu-devel; +Cc: Hang Yu, Cédric Le Goater
From: Hang Yu <francis_yuu@stu.pku.edu.cn>
According to the ast2600 datasheet and the linux aspeed i2c driver,
the TXBUF transmission start position should be TXBUF[0] instead
of TXBUF[1],so the arg pool_start is useless,and the address is not
included in TXBUF.So even if Tx Count equals zero,there is at least
1 byte data needs to be transmitted,and M_TX_CMD should not be cleared
at this condition.The driver url is:
https://github.com/AspeedTech-BMC/linux/blob/aspeed-master-v5.15/drivers/i2c/busses/i2c-ast2600.c
Signed-off-by: Hang Yu <francis_yuu@stu.pku.edu.cn>
Fixes: 6054fc73e8f4 ("aspeed/i2c: Add support for pool buffer transfers")
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
hw/i2c/aspeed_i2c.c | 30 ++++++------------------------
1 file changed, 6 insertions(+), 24 deletions(-)
diff --git a/hw/i2c/aspeed_i2c.c b/hw/i2c/aspeed_i2c.c
index e485d8bfb836..44905d789998 100644
--- a/hw/i2c/aspeed_i2c.c
+++ b/hw/i2c/aspeed_i2c.c
@@ -226,7 +226,7 @@ static int aspeed_i2c_dma_read(AspeedI2CBus *bus, uint8_t *data)
return 0;
}
-static int aspeed_i2c_bus_send(AspeedI2CBus *bus, uint8_t pool_start)
+static int aspeed_i2c_bus_send(AspeedI2CBus *bus)
{
AspeedI2CClass *aic = ASPEED_I2C_GET_CLASS(bus->controller);
int ret = -1;
@@ -239,7 +239,7 @@ static int aspeed_i2c_bus_send(AspeedI2CBus *bus, uint8_t pool_start)
TX_COUNT) + 1;
if (SHARED_ARRAY_FIELD_EX32(bus->regs, reg_cmd, TX_BUFF_EN)) {
- for (i = pool_start; i < pool_tx_count; i++) {
+ for (i = 0; i < pool_tx_count; i++) {
uint8_t *pool_base = aic->bus_pool_base(bus);
trace_aspeed_i2c_bus_send("BUF", i + 1, pool_tx_count,
@@ -273,7 +273,7 @@ static int aspeed_i2c_bus_send(AspeedI2CBus *bus, uint8_t pool_start)
}
SHARED_ARRAY_FIELD_DP32(bus->regs, reg_cmd, TX_DMA_EN, 0);
} else {
- trace_aspeed_i2c_bus_send("BYTE", pool_start, 1,
+ trace_aspeed_i2c_bus_send("BYTE", 0, 1,
bus->regs[reg_byte_buf]);
ret = i2c_send(bus->bus, bus->regs[reg_byte_buf]);
}
@@ -446,10 +446,8 @@ static void aspeed_i2c_bus_cmd_dump(AspeedI2CBus *bus)
*/
static void aspeed_i2c_bus_handle_cmd(AspeedI2CBus *bus, uint64_t value)
{
- uint8_t pool_start = 0;
uint32_t reg_intr_sts = aspeed_i2c_bus_intr_sts_offset(bus);
uint32_t reg_cmd = aspeed_i2c_bus_cmd_offset(bus);
- uint32_t reg_pool_ctrl = aspeed_i2c_bus_pool_ctrl_offset(bus);
uint32_t reg_dma_len = aspeed_i2c_bus_dma_len_offset(bus);
if (!aspeed_i2c_check_sram(bus)) {
@@ -483,27 +481,11 @@ static void aspeed_i2c_bus_handle_cmd(AspeedI2CBus *bus, uint64_t value)
SHARED_ARRAY_FIELD_DP32(bus->regs, reg_cmd, M_START_CMD, 0);
- /*
- * The START command is also a TX command, as the slave
- * address is sent on the bus. Drop the TX flag if nothing
- * else needs to be sent in this sequence.
- */
- if (SHARED_ARRAY_FIELD_EX32(bus->regs, reg_cmd, TX_BUFF_EN)) {
- if (SHARED_ARRAY_FIELD_EX32(bus->regs, reg_pool_ctrl, TX_COUNT)
- == 0) {
- SHARED_ARRAY_FIELD_DP32(bus->regs, reg_cmd, M_TX_CMD, 0);
- } else {
- /*
- * Increase the start index in the TX pool buffer to
- * skip the address byte.
- */
- pool_start++;
- }
- } else if (SHARED_ARRAY_FIELD_EX32(bus->regs, reg_cmd, TX_DMA_EN)) {
+ if (SHARED_ARRAY_FIELD_EX32(bus->regs, reg_cmd, TX_DMA_EN)) {
if (bus->regs[reg_dma_len] == 0) {
SHARED_ARRAY_FIELD_DP32(bus->regs, reg_cmd, M_TX_CMD, 0);
}
- } else {
+ } else if (!SHARED_ARRAY_FIELD_EX32(bus->regs, reg_cmd, TX_BUFF_EN)) {
SHARED_ARRAY_FIELD_DP32(bus->regs, reg_cmd, M_TX_CMD, 0);
}
@@ -520,7 +502,7 @@ static void aspeed_i2c_bus_handle_cmd(AspeedI2CBus *bus, uint64_t value)
if (SHARED_ARRAY_FIELD_EX32(bus->regs, reg_cmd, M_TX_CMD)) {
aspeed_i2c_set_state(bus, I2CD_MTXD);
- if (aspeed_i2c_bus_send(bus, pool_start)) {
+ if (aspeed_i2c_bus_send(bus)) {
SHARED_ARRAY_FIELD_DP32(bus->regs, reg_intr_sts, TX_NAK, 1);
i2c_end_transfer(bus->bus);
} else {
--
2.41.0
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PULL 04/26] hw/i2c/aspeed: Add support for buffer organization
2023-09-01 9:41 [PULL 00/26] aspeed queue Cédric Le Goater
` (2 preceding siblings ...)
2023-09-01 9:41 ` [PULL 03/26] hw/i2c/aspeed: Fix TXBUF transmission start position error Cédric Le Goater
@ 2023-09-01 9:41 ` Cédric Le Goater
2023-09-01 9:41 ` [PULL 05/26] tests/avocado/machine_aspeed.py: Update SDK images Cédric Le Goater
` (23 subsequent siblings)
27 siblings, 0 replies; 31+ messages in thread
From: Cédric Le Goater @ 2023-09-01 9:41 UTC (permalink / raw)
To: qemu-arm, qemu-devel; +Cc: Hang Yu, Cédric Le Goater
From: Hang Yu <francis_yuu@stu.pku.edu.cn>
Added support for the buffer organization option in pool buffer control
register.when set to 1,The buffer is split into two parts: Lower 16 bytes
for Tx and higher 16 bytes for Rx.
Signed-off-by: Hang Yu <francis_yuu@stu.pku.edu.cn>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
[ clg: checkpatch fixes ]
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
include/hw/i2c/aspeed_i2c.h | 1 +
hw/i2c/aspeed_i2c.c | 4 ++++
2 files changed, 5 insertions(+)
diff --git a/include/hw/i2c/aspeed_i2c.h b/include/hw/i2c/aspeed_i2c.h
index 2e1e15aaf0f7..a064479e599c 100644
--- a/include/hw/i2c/aspeed_i2c.h
+++ b/include/hw/i2c/aspeed_i2c.h
@@ -143,6 +143,7 @@ REG32(I2CD_POOL_CTRL, 0x1C) /* Pool Buffer Control */
SHARED_FIELD(RX_SIZE, 16, 5)
SHARED_FIELD(TX_COUNT, 8, 5)
FIELD(I2CD_POOL_CTRL, OFFSET, 2, 6) /* AST2400 */
+ SHARED_FIELD(BUF_ORGANIZATION, 0, 1) /* AST2600 */
REG32(I2CD_BYTE_BUF, 0x20) /* Transmit/Receive Byte Buffer */
SHARED_FIELD(RX_BUF, 8, 8)
SHARED_FIELD(TX_BUF, 0, 8)
diff --git a/hw/i2c/aspeed_i2c.c b/hw/i2c/aspeed_i2c.c
index 44905d789998..7275d40749a9 100644
--- a/hw/i2c/aspeed_i2c.c
+++ b/hw/i2c/aspeed_i2c.c
@@ -297,6 +297,10 @@ static void aspeed_i2c_bus_recv(AspeedI2CBus *bus)
if (SHARED_ARRAY_FIELD_EX32(bus->regs, reg_cmd, RX_BUFF_EN)) {
uint8_t *pool_base = aic->bus_pool_base(bus);
+ if (SHARED_ARRAY_FIELD_EX32(bus->regs, reg_pool_ctrl,
+ BUF_ORGANIZATION)) {
+ pool_base += 16;
+ }
for (i = 0; i < pool_rx_count; i++) {
pool_base[i] = i2c_recv(bus->bus);
--
2.41.0
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PULL 05/26] tests/avocado/machine_aspeed.py: Update SDK images
2023-09-01 9:41 [PULL 00/26] aspeed queue Cédric Le Goater
` (3 preceding siblings ...)
2023-09-01 9:41 ` [PULL 04/26] hw/i2c/aspeed: Add support for buffer organization Cédric Le Goater
@ 2023-09-01 9:41 ` Cédric Le Goater
2023-09-01 9:41 ` [PULL 06/26] hw/ssi: Add a "cs" property to SSIPeripheral Cédric Le Goater
` (22 subsequent siblings)
27 siblings, 0 replies; 31+ messages in thread
From: Cédric Le Goater @ 2023-09-01 9:41 UTC (permalink / raw)
To: qemu-arm, qemu-devel; +Cc: Cédric Le Goater, Joel Stanley
Switch to the latest v8.06 release which introduces interesting
changes for the AST2600 I2C and I3C models. Also take the AST2600 A2
images instead of the default since QEMU tries to model The AST2600 A3
SoC.
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
tests/avocado/machine_aspeed.py | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/tests/avocado/machine_aspeed.py b/tests/avocado/machine_aspeed.py
index 724ee72c0208..90f1b7cb77a1 100644
--- a/tests/avocado/machine_aspeed.py
+++ b/tests/avocado/machine_aspeed.py
@@ -316,8 +316,8 @@ def test_arm_ast2500_evb_sdk(self):
"""
image_url = ('https://github.com/AspeedTech-BMC/openbmc/releases/'
- 'download/v08.01/ast2500-default-obmc.tar.gz')
- image_hash = ('5375f82b4c43a79427909342a1e18b4e48bd663e38466862145d27bb358796fd')
+ 'download/v08.06/ast2500-default-obmc.tar.gz')
+ image_hash = ('e1755f3cadff69190438c688d52dd0f0d399b70a1e14b1d3d5540fc4851d38ca')
image_path = self.fetch_asset(image_url, asset_hash=image_hash,
algorithm='sha256')
archive.extract(image_path, self.workdir)
@@ -334,8 +334,8 @@ def test_arm_ast2600_evb_sdk(self):
"""
image_url = ('https://github.com/AspeedTech-BMC/openbmc/releases/'
- 'download/v08.01/ast2600-default-obmc.tar.gz')
- image_hash = ('f12ef15e8c1f03a214df3b91c814515c5e2b2f56119021398c1dbdd626817d15')
+ 'download/v08.06/ast2600-a2-obmc.tar.gz')
+ image_hash = ('9083506135f622d5e7351fcf7d4e1c7125cee5ba16141220c0ba88931f3681a4')
image_path = self.fetch_asset(image_url, asset_hash=image_hash,
algorithm='sha256')
archive.extract(image_path, self.workdir)
@@ -345,8 +345,8 @@ def test_arm_ast2600_evb_sdk(self):
self.vm.add_args('-device',
'ds1338,bus=aspeed.i2c.bus.5,address=0x32');
self.do_test_arm_aspeed_sdk_start(
- self.workdir + '/ast2600-default/image-bmc')
- self.wait_for_console_pattern('nodistro.0 ast2600-default ttyS4')
+ self.workdir + '/ast2600-a2/image-bmc')
+ self.wait_for_console_pattern('nodistro.0 ast2600-a2 ttyS4')
self.ssh_connect('root', '0penBmc', False)
self.ssh_command('dmesg -c > /dev/null')
--
2.41.0
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PULL 06/26] hw/ssi: Add a "cs" property to SSIPeripheral
2023-09-01 9:41 [PULL 00/26] aspeed queue Cédric Le Goater
` (4 preceding siblings ...)
2023-09-01 9:41 ` [PULL 05/26] tests/avocado/machine_aspeed.py: Update SDK images Cédric Le Goater
@ 2023-09-01 9:41 ` Cédric Le Goater
2023-09-01 9:41 ` [PULL 07/26] hw/ssi: Introduce a ssi_get_cs() helper Cédric Le Goater
` (21 subsequent siblings)
27 siblings, 0 replies; 31+ messages in thread
From: Cédric Le Goater @ 2023-09-01 9:41 UTC (permalink / raw)
To: qemu-arm, qemu-devel
Cc: Cédric Le Goater, Alistair Francis,
Philippe Mathieu-Daudé, Joel Stanley
Boards will use this new property to identify the device CS line and
wire the SPI controllers accordingly.
Cc: Alistair Francis <alistair@alistair23.me>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
include/hw/ssi/ssi.h | 3 +++
hw/ssi/ssi.c | 7 +++++++
2 files changed, 10 insertions(+)
diff --git a/include/hw/ssi/ssi.h b/include/hw/ssi/ssi.h
index 6950f86810d3..c5bdf1f2165f 100644
--- a/include/hw/ssi/ssi.h
+++ b/include/hw/ssi/ssi.h
@@ -64,6 +64,9 @@ struct SSIPeripheral {
/* Chip select state */
bool cs;
+
+ /* Chip select index */
+ uint8_t cs_index;
};
extern const VMStateDescription vmstate_ssi_peripheral;
diff --git a/hw/ssi/ssi.c b/hw/ssi/ssi.c
index d54a109beeb5..4e33e0ea5bc2 100644
--- a/hw/ssi/ssi.c
+++ b/hw/ssi/ssi.c
@@ -13,6 +13,7 @@
*/
#include "qemu/osdep.h"
+#include "hw/qdev-properties.h"
#include "hw/ssi/ssi.h"
#include "migration/vmstate.h"
#include "qemu/module.h"
@@ -71,6 +72,11 @@ static void ssi_peripheral_realize(DeviceState *dev, Error **errp)
ssc->realize(s, errp);
}
+static Property ssi_peripheral_properties[] = {
+ DEFINE_PROP_UINT8("cs", SSIPeripheral, cs_index, 0),
+ DEFINE_PROP_END_OF_LIST(),
+};
+
static void ssi_peripheral_class_init(ObjectClass *klass, void *data)
{
SSIPeripheralClass *ssc = SSI_PERIPHERAL_CLASS(klass);
@@ -81,6 +87,7 @@ static void ssi_peripheral_class_init(ObjectClass *klass, void *data)
if (!ssc->transfer_raw) {
ssc->transfer_raw = ssi_transfer_raw_default;
}
+ device_class_set_props(dc, ssi_peripheral_properties);
}
static const TypeInfo ssi_peripheral_info = {
--
2.41.0
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PULL 07/26] hw/ssi: Introduce a ssi_get_cs() helper
2023-09-01 9:41 [PULL 00/26] aspeed queue Cédric Le Goater
` (5 preceding siblings ...)
2023-09-01 9:41 ` [PULL 06/26] hw/ssi: Add a "cs" property to SSIPeripheral Cédric Le Goater
@ 2023-09-01 9:41 ` Cédric Le Goater
2023-09-01 9:41 ` [PULL 08/26] aspeed/smc: Wire CS lines at reset Cédric Le Goater
` (20 subsequent siblings)
27 siblings, 0 replies; 31+ messages in thread
From: Cédric Le Goater @ 2023-09-01 9:41 UTC (permalink / raw)
To: qemu-arm, qemu-devel
Cc: Cédric Le Goater, Alistair Francis,
Philippe Mathieu-Daudé, Joel Stanley
Simple routine to retrieve a DeviceState object on a SPI bus using its
CS index. It will be useful for the board to wire the CS lines.
Cc: Alistair Francis <alistair@alistair23.me>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
include/hw/ssi/ssi.h | 2 ++
hw/ssi/ssi.c | 15 +++++++++++++++
2 files changed, 17 insertions(+)
diff --git a/include/hw/ssi/ssi.h b/include/hw/ssi/ssi.h
index c5bdf1f2165f..3cdcbd539042 100644
--- a/include/hw/ssi/ssi.h
+++ b/include/hw/ssi/ssi.h
@@ -112,4 +112,6 @@ SSIBus *ssi_create_bus(DeviceState *parent, const char *name);
uint32_t ssi_transfer(SSIBus *bus, uint32_t val);
+DeviceState *ssi_get_cs(SSIBus *bus, uint8_t cs_index);
+
#endif
diff --git a/hw/ssi/ssi.c b/hw/ssi/ssi.c
index 4e33e0ea5bc2..54ca3c34e9d0 100644
--- a/hw/ssi/ssi.c
+++ b/hw/ssi/ssi.c
@@ -27,6 +27,21 @@ struct SSIBus {
#define TYPE_SSI_BUS "SSI"
OBJECT_DECLARE_SIMPLE_TYPE(SSIBus, SSI_BUS)
+DeviceState *ssi_get_cs(SSIBus *bus, uint8_t cs_index)
+{
+ BusState *b = BUS(bus);
+ BusChild *kid;
+
+ QTAILQ_FOREACH(kid, &b->children, sibling) {
+ SSIPeripheral *kid_ssi = SSI_PERIPHERAL(kid->child);
+ if (kid_ssi->cs_index == cs_index) {
+ return kid->child;
+ }
+ }
+
+ return NULL;
+}
+
static const TypeInfo ssi_bus_info = {
.name = TYPE_SSI_BUS,
.parent = TYPE_BUS,
--
2.41.0
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PULL 08/26] aspeed/smc: Wire CS lines at reset
2023-09-01 9:41 [PULL 00/26] aspeed queue Cédric Le Goater
` (6 preceding siblings ...)
2023-09-01 9:41 ` [PULL 07/26] hw/ssi: Introduce a ssi_get_cs() helper Cédric Le Goater
@ 2023-09-01 9:41 ` Cédric Le Goater
2023-09-01 9:41 ` [PULL 09/26] hw/ssi: Check for duplicate CS indexes Cédric Le Goater
` (19 subsequent siblings)
27 siblings, 0 replies; 31+ messages in thread
From: Cédric Le Goater @ 2023-09-01 9:41 UTC (permalink / raw)
To: qemu-arm, qemu-devel; +Cc: Cédric Le Goater, Joel Stanley
Currently, a set of default flash devices is created at machine init
and drives defined on the QEMU command line are associated to the FMC
and SPI controllers in sequence :
-drive file<file>,format=raw,if=mtd
-drive file<file1>,format=raw,if=mtd
The CS lines are wired in the same creation loop. This makes a strong
assumption on the ordering and is not very flexible since only a
limited set of flash devices can be defined : 1 FMC + 1 or 2 SPI,
which is less than what the SoC really supports.
A better alternative would be to define the flash devices on the
command line using a blockdev attached to a CS line of a SSI bus :
-blockdev node-name=fmc0,driver=file,filename=./flash.img
-device mx66u51235f,cs=0x0,bus=ssi.0,drive=fmc0
However, user created flash devices are not correctly wired to their
SPI controller and consequently can not be used by the machine. Fix
that and wire the CS lines of all available devices when the SSI bus
is reset.
Reviewed-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
hw/arm/aspeed.c | 5 +----
hw/ssi/aspeed_smc.c | 8 ++++++++
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
index b922a2c491cc..cd92cf9ce0bb 100644
--- a/hw/arm/aspeed.c
+++ b/hw/arm/aspeed.c
@@ -307,17 +307,14 @@ void aspeed_board_init_flashes(AspeedSMCState *s, const char *flashtype,
for (i = 0; i < count; ++i) {
DriveInfo *dinfo = drive_get(IF_MTD, 0, unit0 + i);
- qemu_irq cs_line;
DeviceState *dev;
dev = qdev_new(flashtype);
if (dinfo) {
qdev_prop_set_drive(dev, "drive", blk_by_legacy_dinfo(dinfo));
}
+ qdev_prop_set_uint8(dev, "cs", i);
qdev_realize_and_unref(dev, BUS(s->spi), &error_fatal);
-
- cs_line = qdev_get_gpio_in_named(dev, SSI_GPIO_CS, 0);
- qdev_connect_gpio_out_named(DEVICE(s), "cs", i, cs_line);
}
}
diff --git a/hw/ssi/aspeed_smc.c b/hw/ssi/aspeed_smc.c
index 72811693224d..2a4001b774a2 100644
--- a/hw/ssi/aspeed_smc.c
+++ b/hw/ssi/aspeed_smc.c
@@ -692,6 +692,14 @@ static void aspeed_smc_reset(DeviceState *d)
memset(s->regs, 0, sizeof s->regs);
}
+ for (i = 0; i < asc->cs_num_max; i++) {
+ DeviceState *dev = ssi_get_cs(s->spi, i);
+ if (dev) {
+ qemu_irq cs_line = qdev_get_gpio_in_named(dev, SSI_GPIO_CS, 0);
+ qdev_connect_gpio_out_named(DEVICE(s), "cs", i, cs_line);
+ }
+ }
+
/* Unselect all peripherals */
for (i = 0; i < asc->cs_num_max; ++i) {
s->regs[s->r_ctrl0 + i] |= CTRL_CE_STOP_ACTIVE;
--
2.41.0
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PULL 09/26] hw/ssi: Check for duplicate CS indexes
2023-09-01 9:41 [PULL 00/26] aspeed queue Cédric Le Goater
` (7 preceding siblings ...)
2023-09-01 9:41 ` [PULL 08/26] aspeed/smc: Wire CS lines at reset Cédric Le Goater
@ 2023-09-01 9:41 ` Cédric Le Goater
2023-09-01 9:41 ` [PULL 10/26] aspeed: Create flash devices only when defaults are enabled Cédric Le Goater
` (18 subsequent siblings)
27 siblings, 0 replies; 31+ messages in thread
From: Cédric Le Goater @ 2023-09-01 9:41 UTC (permalink / raw)
To: qemu-arm, qemu-devel
Cc: Cédric Le Goater, Edgar E. Iglesias, Alistair Francis,
Philippe Mathieu-Daudé, Joel Stanley
This to avoid indexes conflicts on the same SSI bus. Adapt machines
using multiple devices on the same bus to avoid breakage.
Cc: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
Cc: Alistair Francis <alistair@alistair23.me>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
hw/arm/stellaris.c | 4 +++-
hw/arm/xilinx_zynq.c | 1 +
hw/arm/xlnx-versal-virt.c | 1 +
hw/arm/xlnx-zcu102.c | 2 ++
hw/microblaze/petalogix_ml605_mmu.c | 1 +
hw/ssi/ssi.c | 21 +++++++++++++++++++++
6 files changed, 29 insertions(+), 1 deletion(-)
diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c
index f7e99baf6236..5a3106e00939 100644
--- a/hw/arm/stellaris.c
+++ b/hw/arm/stellaris.c
@@ -1242,7 +1242,9 @@ static void stellaris_init(MachineState *ms, stellaris_board_info *board)
qdev_get_child_bus(sddev, "sd-bus"),
&error_fatal);
- ssddev = ssi_create_peripheral(bus, "ssd0323");
+ ssddev = qdev_new("ssd0323");
+ qdev_prop_set_uint8(ssddev, "cs", 1);
+ qdev_realize_and_unref(ssddev, bus, &error_fatal);
gpio_d_splitter = qdev_new(TYPE_SPLIT_IRQ);
qdev_prop_set_uint32(gpio_d_splitter, "num-lines", 2);
diff --git a/hw/arm/xilinx_zynq.c b/hw/arm/xilinx_zynq.c
index 3190cc0b8dbc..8dc2ea83a93b 100644
--- a/hw/arm/xilinx_zynq.c
+++ b/hw/arm/xilinx_zynq.c
@@ -164,6 +164,7 @@ static inline int zynq_init_spi_flashes(uint32_t base_addr, qemu_irq irq,
blk_by_legacy_dinfo(dinfo),
&error_fatal);
}
+ qdev_prop_set_uint8(flash_dev, "cs", j);
qdev_realize_and_unref(flash_dev, BUS(spi), &error_fatal);
cs_line = qdev_get_gpio_in_named(flash_dev, SSI_GPIO_CS, 0);
diff --git a/hw/arm/xlnx-versal-virt.c b/hw/arm/xlnx-versal-virt.c
index 1ee2b8697fe2..88c561ff6328 100644
--- a/hw/arm/xlnx-versal-virt.c
+++ b/hw/arm/xlnx-versal-virt.c
@@ -740,6 +740,7 @@ static void versal_virt_init(MachineState *machine)
qdev_prop_set_drive_err(flash_dev, "drive",
blk_by_legacy_dinfo(dinfo), &error_fatal);
}
+ qdev_prop_set_uint8(flash_dev, "cs", i);
qdev_realize_and_unref(flash_dev, spi_bus, &error_fatal);
cs_line = qdev_get_gpio_in_named(flash_dev, SSI_GPIO_CS, 0);
diff --git a/hw/arm/xlnx-zcu102.c b/hw/arm/xlnx-zcu102.c
index 4c84bb932aa0..21483f75fd93 100644
--- a/hw/arm/xlnx-zcu102.c
+++ b/hw/arm/xlnx-zcu102.c
@@ -201,6 +201,7 @@ static void xlnx_zcu102_init(MachineState *machine)
qdev_prop_set_drive_err(flash_dev, "drive",
blk_by_legacy_dinfo(dinfo), &error_fatal);
}
+ qdev_prop_set_uint8(flash_dev, "cs", i);
qdev_realize_and_unref(flash_dev, spi_bus, &error_fatal);
cs_line = qdev_get_gpio_in_named(flash_dev, SSI_GPIO_CS, 0);
@@ -224,6 +225,7 @@ static void xlnx_zcu102_init(MachineState *machine)
qdev_prop_set_drive_err(flash_dev, "drive",
blk_by_legacy_dinfo(dinfo), &error_fatal);
}
+ qdev_prop_set_uint8(flash_dev, "cs", i);
qdev_realize_and_unref(flash_dev, spi_bus, &error_fatal);
cs_line = qdev_get_gpio_in_named(flash_dev, SSI_GPIO_CS, 0);
diff --git a/hw/microblaze/petalogix_ml605_mmu.c b/hw/microblaze/petalogix_ml605_mmu.c
index babb05303520..ea0fb68cf026 100644
--- a/hw/microblaze/petalogix_ml605_mmu.c
+++ b/hw/microblaze/petalogix_ml605_mmu.c
@@ -192,6 +192,7 @@ petalogix_ml605_init(MachineState *machine)
blk_by_legacy_dinfo(dinfo),
&error_fatal);
}
+ qdev_prop_set_uint8(dev, "cs", i);
qdev_realize_and_unref(dev, BUS(spi), &error_fatal);
cs_line = qdev_get_gpio_in_named(dev, SSI_GPIO_CS, 0);
diff --git a/hw/ssi/ssi.c b/hw/ssi/ssi.c
index 54ca3c34e9d0..1f3e540ab8a1 100644
--- a/hw/ssi/ssi.c
+++ b/hw/ssi/ssi.c
@@ -42,10 +42,31 @@ DeviceState *ssi_get_cs(SSIBus *bus, uint8_t cs_index)
return NULL;
}
+static bool ssi_bus_check_address(BusState *b, DeviceState *dev, Error **errp)
+{
+ SSIPeripheral *s = SSI_PERIPHERAL(dev);
+
+ if (ssi_get_cs(SSI_BUS(b), s->cs_index)) {
+ error_setg(errp, "CS index '0x%x' in use by a %s device", s->cs_index,
+ object_get_typename(OBJECT(dev)));
+ return false;
+ }
+
+ return true;
+}
+
+static void ssi_bus_class_init(ObjectClass *klass, void *data)
+{
+ BusClass *k = BUS_CLASS(klass);
+
+ k->check_address = ssi_bus_check_address;
+}
+
static const TypeInfo ssi_bus_info = {
.name = TYPE_SSI_BUS,
.parent = TYPE_BUS,
.instance_size = sizeof(SSIBus),
+ .class_init = ssi_bus_class_init,
};
static void ssi_cs_default(void *opaque, int n, int level)
--
2.41.0
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PULL 10/26] aspeed: Create flash devices only when defaults are enabled
2023-09-01 9:41 [PULL 00/26] aspeed queue Cédric Le Goater
` (8 preceding siblings ...)
2023-09-01 9:41 ` [PULL 09/26] hw/ssi: Check for duplicate CS indexes Cédric Le Goater
@ 2023-09-01 9:41 ` Cédric Le Goater
2023-09-01 9:41 ` [PULL 11/26] m25p80: Introduce an helper to retrieve the BlockBackend of a device Cédric Le Goater
` (17 subsequent siblings)
27 siblings, 0 replies; 31+ messages in thread
From: Cédric Le Goater @ 2023-09-01 9:41 UTC (permalink / raw)
To: qemu-arm, qemu-devel; +Cc: Cédric Le Goater, Joel Stanley
When the -nodefaults option is set, flash devices should be created
with :
-blockdev node-name=fmc0,driver=file,filename=./flash.img \
-device mx66u51235f,cs=0x0,bus=ssi.0,drive=fmc0 \
To be noted that in this case, the ROM will not be installed and the
initial boot sequence (U-Boot loading) will fetch instructions using
SPI transactions which is significantly slower. That's exactly how HW
operates though.
Reviewed-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
docs/system/arm/aspeed.rst | 35 +++++++++++++++++++++++++++++------
hw/arm/aspeed.c | 6 ++++--
2 files changed, 33 insertions(+), 8 deletions(-)
diff --git a/docs/system/arm/aspeed.rst b/docs/system/arm/aspeed.rst
index 80538422a1a4..b2dea54eedad 100644
--- a/docs/system/arm/aspeed.rst
+++ b/docs/system/arm/aspeed.rst
@@ -104,7 +104,7 @@ To boot a kernel directly from a Linux build tree:
-dtb arch/arm/boot/dts/aspeed-ast2600-evb.dtb \
-initrd rootfs.cpio
-The image should be attached as an MTD drive. Run :
+To boot the machine from the flash image, use an MTD drive :
.. code-block:: bash
@@ -117,23 +117,46 @@ Options specific to Aspeed machines are :
device by using the FMC controller to load the instructions, and
not simply from RAM. This takes a little longer.
- * ``fmc-model`` to change the FMC Flash model. FW needs support for
- the chip model to boot.
+ * ``fmc-model`` to change the default FMC Flash model. FW needs
+ support for the chip model to boot.
- * ``spi-model`` to change the SPI Flash model.
+ * ``spi-model`` to change the default SPI Flash model.
* ``bmc-console`` to change the default console device. Most of the
machines use the ``UART5`` device for a boot console, which is
mapped on ``/dev/ttyS4`` under Linux, but it is not always the
case.
-For instance, to start the ``ast2500-evb`` machine with a different
-FMC chip and a bigger (64M) SPI chip, use :
+To use other flash models, for instance a different FMC chip and a
+bigger (64M) SPI for the ``ast2500-evb`` machine, run :
.. code-block:: bash
-M ast2500-evb,fmc-model=mx25l25635e,spi-model=mx66u51235f
+When more flexibility is needed to define the flash devices, to use
+different flash models or define all flash devices (up to 8), the
+``-nodefaults`` QEMU option can be used to avoid creating the default
+flash devices.
+
+Flash devices should then be created from the command line and attached
+to a block device :
+
+.. code-block:: bash
+
+ $ qemu-system-arm -M ast2600-evb \
+ -blockdev node-name=fmc0,driver=file,filename=/path/to/fmc0.img \
+ -device mx66u51235f,bus=ssi.0,cs=0x0,drive=fmc0 \
+ -blockdev node-name=fmc1,driver=file,filename=/path/to/fmc1.img \
+ -device mx66u51235f,bus=ssi.0,cs=0x1,drive=fmc1 \
+ -blockdev node-name=spi1,driver=file,filename=/path/to/spi1.img \
+ -device mx66u51235f,cs=0x0,bus=ssi.1,drive=spi1 \
+ -nographic -nodefaults
+
+In that case, the machine boots fetching instructions from the FMC0
+device. It is slower to start but closer to what HW does. Using the
+machine option ``execute-in-place`` has a similar effect.
+
To change the boot console and use device ``UART3`` (``/dev/ttyS2``
under Linux), use :
diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
index cd92cf9ce0bb..271512ce5ced 100644
--- a/hw/arm/aspeed.c
+++ b/hw/arm/aspeed.c
@@ -396,12 +396,14 @@ static void aspeed_machine_init(MachineState *machine)
connect_serial_hds_to_uarts(bmc);
qdev_realize(DEVICE(&bmc->soc), NULL, &error_abort);
- aspeed_board_init_flashes(&bmc->soc.fmc,
+ if (defaults_enabled()) {
+ aspeed_board_init_flashes(&bmc->soc.fmc,
bmc->fmc_model ? bmc->fmc_model : amc->fmc_model,
amc->num_cs, 0);
- aspeed_board_init_flashes(&bmc->soc.spi[0],
+ aspeed_board_init_flashes(&bmc->soc.spi[0],
bmc->spi_model ? bmc->spi_model : amc->spi_model,
1, amc->num_cs);
+ }
if (machine->kernel_filename && sc->num_cpus > 1) {
/* With no u-boot we must set up a boot stub for the secondary CPU */
--
2.41.0
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PULL 11/26] m25p80: Introduce an helper to retrieve the BlockBackend of a device
2023-09-01 9:41 [PULL 00/26] aspeed queue Cédric Le Goater
` (9 preceding siblings ...)
2023-09-01 9:41 ` [PULL 10/26] aspeed: Create flash devices only when defaults are enabled Cédric Le Goater
@ 2023-09-01 9:41 ` Cédric Le Goater
2023-09-01 9:42 ` [PULL 12/26] aspeed: Get the BlockBackend of FMC0 from the flash device Cédric Le Goater
` (16 subsequent siblings)
27 siblings, 0 replies; 31+ messages in thread
From: Cédric Le Goater @ 2023-09-01 9:41 UTC (permalink / raw)
To: qemu-arm, qemu-devel
Cc: Cédric Le Goater, Alistair Francis,
Philippe Mathieu-Daudé, Joel Stanley
It will help in getting rid of some drive_get(IF_MTD) calls by
retrieving the BlockBackend directly from the m25p80 device.
Cc: Alistair Francis <alistair@alistair23.me>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
include/hw/block/flash.h | 4 ++++
hw/block/m25p80.c | 6 ++++++
2 files changed, 10 insertions(+)
diff --git a/include/hw/block/flash.h b/include/hw/block/flash.h
index 7198953702b7..de93756cbe8f 100644
--- a/include/hw/block/flash.h
+++ b/include/hw/block/flash.h
@@ -76,4 +76,8 @@ uint8_t ecc_digest(ECCState *s, uint8_t sample);
void ecc_reset(ECCState *s);
extern const VMStateDescription vmstate_ecc_state;
+/* m25p80.c */
+
+BlockBackend *m25p80_get_blk(DeviceState *dev);
+
#endif
diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c
index dc5ffbc4ff52..afc3fdf4d60b 100644
--- a/hw/block/m25p80.c
+++ b/hw/block/m25p80.c
@@ -25,6 +25,7 @@
#include "qemu/units.h"
#include "sysemu/block-backend.h"
#include "hw/block/block.h"
+#include "hw/block/flash.h"
#include "hw/qdev-properties.h"
#include "hw/qdev-properties-system.h"
#include "hw/ssi/ssi.h"
@@ -1830,3 +1831,8 @@ static void m25p80_register_types(void)
}
type_init(m25p80_register_types)
+
+BlockBackend *m25p80_get_blk(DeviceState *dev)
+{
+ return M25P80(dev)->blk;
+}
--
2.41.0
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PULL 12/26] aspeed: Get the BlockBackend of FMC0 from the flash device
2023-09-01 9:41 [PULL 00/26] aspeed queue Cédric Le Goater
` (10 preceding siblings ...)
2023-09-01 9:41 ` [PULL 11/26] m25p80: Introduce an helper to retrieve the BlockBackend of a device Cédric Le Goater
@ 2023-09-01 9:42 ` Cédric Le Goater
2023-09-01 9:42 ` [PULL 13/26] hw/sd/sdcard: Return ILLEGAL for CMD19/CMD23 prior SD spec v3.01 Cédric Le Goater
` (15 subsequent siblings)
27 siblings, 0 replies; 31+ messages in thread
From: Cédric Le Goater @ 2023-09-01 9:42 UTC (permalink / raw)
To: qemu-arm, qemu-devel
Cc: Cédric Le Goater, Philippe Mathieu-Daudé, Joel Stanley
and get rid of an unnecessary drive_get(IF_MTD) call.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
hw/arm/aspeed.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
index 271512ce5ced..f8ba67531a00 100644
--- a/hw/arm/aspeed.c
+++ b/hw/arm/aspeed.c
@@ -15,6 +15,7 @@
#include "hw/arm/aspeed.h"
#include "hw/arm/aspeed_soc.h"
#include "hw/arm/aspeed_eeprom.h"
+#include "hw/block/flash.h"
#include "hw/i2c/i2c_mux_pca954x.h"
#include "hw/i2c/smbus_eeprom.h"
#include "hw/misc/pca9552.h"
@@ -436,11 +437,12 @@ static void aspeed_machine_init(MachineState *machine)
}
if (!bmc->mmio_exec) {
- DriveInfo *mtd0 = drive_get(IF_MTD, 0, 0);
+ DeviceState *dev = ssi_get_cs(bmc->soc.fmc.spi, 0);
+ BlockBackend *fmc0 = dev ? m25p80_get_blk(dev) : NULL;
- if (mtd0) {
+ if (fmc0) {
uint64_t rom_size = memory_region_size(&bmc->soc.spi_boot);
- aspeed_install_boot_rom(bmc, blk_by_legacy_dinfo(mtd0), rom_size);
+ aspeed_install_boot_rom(bmc, fmc0, rom_size);
}
}
--
2.41.0
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PULL 13/26] hw/sd/sdcard: Return ILLEGAL for CMD19/CMD23 prior SD spec v3.01
2023-09-01 9:41 [PULL 00/26] aspeed queue Cédric Le Goater
` (11 preceding siblings ...)
2023-09-01 9:42 ` [PULL 12/26] aspeed: Get the BlockBackend of FMC0 from the flash device Cédric Le Goater
@ 2023-09-01 9:42 ` Cédric Le Goater
2023-09-01 9:42 ` [PULL 14/26] hw/sd: When card is in wrong state, log which state it is Cédric Le Goater
` (14 subsequent siblings)
27 siblings, 0 replies; 31+ messages in thread
From: Cédric Le Goater @ 2023-09-01 9:42 UTC (permalink / raw)
To: qemu-arm, qemu-devel
Cc: Philippe Mathieu-Daudé, Bin Meng, Cédric Le Goater
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
CMD19 (SEND_TUNING_BLOCK) and CMD23 (SET_BLOCK_COUNT) were
added in the Physical Layer Simplified Specification v3.01.
When earlier spec version is requested, we should return ILLEGAL.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Message-Id: <20220509141320.98374-1-philippe.mathieu.daude@gmail.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
hw/sd/sd.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 77a717d35507..0be9ee965ac9 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -1263,7 +1263,7 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
case 19: /* CMD19: SEND_TUNING_BLOCK (SD) */
if (sd->spec_version < SD_PHY_SPECv3_01_VERS) {
- break;
+ goto bad_cmd;
}
if (sd->state == sd_transfer_state) {
sd->state = sd_sendingdata_state;
@@ -1274,7 +1274,7 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
case 23: /* CMD23: SET_BLOCK_COUNT */
if (sd->spec_version < SD_PHY_SPECv3_01_VERS) {
- break;
+ goto bad_cmd;
}
switch (sd->state) {
case sd_transfer_state:
--
2.41.0
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PULL 14/26] hw/sd: When card is in wrong state, log which state it is
2023-09-01 9:41 [PULL 00/26] aspeed queue Cédric Le Goater
` (12 preceding siblings ...)
2023-09-01 9:42 ` [PULL 13/26] hw/sd/sdcard: Return ILLEGAL for CMD19/CMD23 prior SD spec v3.01 Cédric Le Goater
@ 2023-09-01 9:42 ` Cédric Le Goater
2023-09-01 9:42 ` [PULL 15/26] hw/sd: When card is in wrong state, log which spec version is used Cédric Le Goater
` (13 subsequent siblings)
27 siblings, 0 replies; 31+ messages in thread
From: Cédric Le Goater @ 2023-09-01 9:42 UTC (permalink / raw)
To: qemu-arm, qemu-devel
Cc: Philippe Mathieu-Daudé, Bin Meng, Cédric Le Goater
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
We report the card is in an inconsistent state, but don't precise
in which state it is. Add this information, as it is useful when
debugging problems.
Since we will reuse this code, extract as sd_invalid_state_for_cmd()
helper.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Message-Id: <20210624142209.1193073-2-f4bug@amsat.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
hw/sd/sd.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 0be9ee965ac9..4412559c05be 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -966,6 +966,14 @@ static bool address_in_range(SDState *sd, const char *desc,
return true;
}
+static sd_rsp_type_t sd_invalid_state_for_cmd(SDState *sd, SDRequest req)
+{
+ qemu_log_mask(LOG_GUEST_ERROR, "SD: CMD%i in a wrong state: %s\n",
+ req.cmd, sd_state_name(sd->state));
+
+ return sd_illegal;
+}
+
static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
{
uint32_t rca = 0x0000;
@@ -1534,9 +1542,7 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
return sd_illegal;
}
- qemu_log_mask(LOG_GUEST_ERROR, "SD: CMD%i in a wrong state: %s\n",
- req.cmd, sd_state_name(sd->state));
- return sd_illegal;
+ return sd_invalid_state_for_cmd(sd, req);
}
static sd_rsp_type_t sd_app_command(SDState *sd,
--
2.41.0
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PULL 15/26] hw/sd: When card is in wrong state, log which spec version is used
2023-09-01 9:41 [PULL 00/26] aspeed queue Cédric Le Goater
` (13 preceding siblings ...)
2023-09-01 9:42 ` [PULL 14/26] hw/sd: When card is in wrong state, log which state it is Cédric Le Goater
@ 2023-09-01 9:42 ` Cédric Le Goater
2023-09-01 9:42 ` [PULL 16/26] hw/sd: Move proto_name to SDProto structure Cédric Le Goater
` (12 subsequent siblings)
27 siblings, 0 replies; 31+ messages in thread
From: Cédric Le Goater @ 2023-09-01 9:42 UTC (permalink / raw)
To: qemu-arm, qemu-devel; +Cc: Philippe Mathieu-Daudé, Cédric Le Goater
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
Add the sd_version_str() helper.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
hw/sd/sd.c | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 4412559c05be..20e62aff70b6 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -145,6 +145,19 @@ struct SDState {
static void sd_realize(DeviceState *dev, Error **errp);
+static const char *sd_version_str(enum SDPhySpecificationVersion version)
+{
+ static const char *sdphy_version[] = {
+ [SD_PHY_SPECv1_10_VERS] = "v1.10",
+ [SD_PHY_SPECv2_00_VERS] = "v2.00",
+ [SD_PHY_SPECv3_01_VERS] = "v3.01",
+ };
+ if (version >= ARRAY_SIZE(sdphy_version)) {
+ return "unsupported version";
+ }
+ return sdphy_version[version];
+}
+
static const char *sd_state_name(enum SDCardStates state)
{
static const char *state_name[] = {
@@ -968,8 +981,9 @@ static bool address_in_range(SDState *sd, const char *desc,
static sd_rsp_type_t sd_invalid_state_for_cmd(SDState *sd, SDRequest req)
{
- qemu_log_mask(LOG_GUEST_ERROR, "SD: CMD%i in a wrong state: %s\n",
- req.cmd, sd_state_name(sd->state));
+ qemu_log_mask(LOG_GUEST_ERROR, "SD: CMD%i in a wrong state: %s (spec %s)\n",
+ req.cmd, sd_state_name(sd->state),
+ sd_version_str(sd->spec_version));
return sd_illegal;
}
--
2.41.0
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PULL 16/26] hw/sd: Move proto_name to SDProto structure
2023-09-01 9:41 [PULL 00/26] aspeed queue Cédric Le Goater
` (14 preceding siblings ...)
2023-09-01 9:42 ` [PULL 15/26] hw/sd: When card is in wrong state, log which spec version is used Cédric Le Goater
@ 2023-09-01 9:42 ` Cédric Le Goater
2023-09-01 9:42 ` [PULL 17/26] hw/sd: Introduce sd_cmd_handler type Cédric Le Goater
` (11 subsequent siblings)
27 siblings, 0 replies; 31+ messages in thread
From: Cédric Le Goater @ 2023-09-01 9:42 UTC (permalink / raw)
To: qemu-arm, qemu-devel
Cc: Philippe Mathieu-Daudé, Bin Meng, Cédric Le Goater
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
Introduce a new structure to hold the bus protocol specific
fields: SDProto. The first field is the protocol name.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Message-Id: <20210624142209.1193073-4-f4bug@amsat.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
include/hw/sd/sd.h | 2 ++
hw/sd/sd.c | 35 +++++++++++++++++++++++++++--------
2 files changed, 29 insertions(+), 8 deletions(-)
diff --git a/include/hw/sd/sd.h b/include/hw/sd/sd.h
index 3047adb2fc86..b322d8f19b17 100644
--- a/include/hw/sd/sd.h
+++ b/include/hw/sd/sd.h
@@ -124,6 +124,8 @@ struct SDCardClass {
void (*enable)(SDState *sd, bool enable);
bool (*get_inserted)(SDState *sd);
bool (*get_readonly)(SDState *sd);
+
+ const struct SDProto *proto;
};
#define TYPE_SD_BUS "sd-bus"
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 20e62aff70b6..f6aa3b0a80bf 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -87,6 +87,10 @@ enum SDCardStates {
sd_disconnect_state,
};
+typedef struct SDProto {
+ const char *name;
+} SDProto;
+
struct SDState {
DeviceState parent_obj;
@@ -137,7 +141,6 @@ struct SDState {
qemu_irq readonly_cb;
qemu_irq inserted_cb;
QEMUTimer *ocr_power_timer;
- const char *proto_name;
bool enable;
uint8_t dat_lines;
bool cmd_line;
@@ -145,6 +148,13 @@ struct SDState {
static void sd_realize(DeviceState *dev, Error **errp);
+static const struct SDProto *sd_proto(SDState *sd)
+{
+ SDCardClass *sc = SD_CARD_GET_CLASS(sd);
+
+ return sc->proto;
+}
+
static const char *sd_version_str(enum SDPhySpecificationVersion version)
{
static const char *sdphy_version[] = {
@@ -981,8 +991,8 @@ static bool address_in_range(SDState *sd, const char *desc,
static sd_rsp_type_t sd_invalid_state_for_cmd(SDState *sd, SDRequest req)
{
- qemu_log_mask(LOG_GUEST_ERROR, "SD: CMD%i in a wrong state: %s (spec %s)\n",
- req.cmd, sd_state_name(sd->state),
+ qemu_log_mask(LOG_GUEST_ERROR, "%s: CMD%i in a wrong state: %s (spec %s)\n",
+ sd_proto(sd)->name, req.cmd, sd_state_name(sd->state),
sd_version_str(sd->spec_version));
return sd_illegal;
@@ -997,7 +1007,7 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
* However there is no ACMD55, so we want to trace this particular case.
*/
if (req.cmd != 55 || sd->expecting_acmd) {
- trace_sdcard_normal_command(sd->proto_name,
+ trace_sdcard_normal_command(sd_proto(sd)->name,
sd_cmd_name(req.cmd), req.cmd,
req.arg, sd_state_name(sd->state));
}
@@ -1562,7 +1572,7 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
static sd_rsp_type_t sd_app_command(SDState *sd,
SDRequest req)
{
- trace_sdcard_app_command(sd->proto_name, sd_acmd_name(req.cmd),
+ trace_sdcard_app_command(sd_proto(sd)->name, sd_acmd_name(req.cmd),
req.cmd, req.arg, sd_state_name(sd->state));
sd->card_status |= APP_CMD;
switch (req.cmd) {
@@ -1856,7 +1866,7 @@ void sd_write_byte(SDState *sd, uint8_t value)
if (sd->card_status & (ADDRESS_ERROR | WP_VIOLATION))
return;
- trace_sdcard_write_data(sd->proto_name,
+ trace_sdcard_write_data(sd_proto(sd)->name,
sd_acmd_name(sd->current_cmd),
sd->current_cmd, value);
switch (sd->current_cmd) {
@@ -2012,7 +2022,7 @@ uint8_t sd_read_byte(SDState *sd)
io_len = (sd->ocr & (1 << 30)) ? 512 : sd->blk_len;
- trace_sdcard_read_data(sd->proto_name,
+ trace_sdcard_read_data(sd_proto(sd)->name,
sd_acmd_name(sd->current_cmd),
sd->current_cmd, io_len);
switch (sd->current_cmd) {
@@ -2131,6 +2141,14 @@ void sd_enable(SDState *sd, bool enable)
sd->enable = enable;
}
+static const SDProto sd_proto_spi = {
+ .name = "SPI",
+};
+
+static const SDProto sd_proto_sd = {
+ .name = "SD",
+};
+
static void sd_instance_init(Object *obj)
{
SDState *sd = SD_CARD(obj);
@@ -2149,9 +2167,10 @@ static void sd_instance_finalize(Object *obj)
static void sd_realize(DeviceState *dev, Error **errp)
{
SDState *sd = SD_CARD(dev);
+ SDCardClass *sc = SD_CARD_GET_CLASS(sd);
int ret;
- sd->proto_name = sd->spi ? "SPI" : "SD";
+ sc->proto = sd->spi ? &sd_proto_spi : &sd_proto_sd;
switch (sd->spec_version) {
case SD_PHY_SPECv1_10_VERS
--
2.41.0
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PULL 17/26] hw/sd: Introduce sd_cmd_handler type
2023-09-01 9:41 [PULL 00/26] aspeed queue Cédric Le Goater
` (15 preceding siblings ...)
2023-09-01 9:42 ` [PULL 16/26] hw/sd: Move proto_name to SDProto structure Cédric Le Goater
@ 2023-09-01 9:42 ` Cédric Le Goater
2023-09-01 9:42 ` [PULL 18/26] hw/sd: Add sd_cmd_illegal() handler Cédric Le Goater
` (10 subsequent siblings)
27 siblings, 0 replies; 31+ messages in thread
From: Cédric Le Goater @ 2023-09-01 9:42 UTC (permalink / raw)
To: qemu-arm, qemu-devel
Cc: Philippe Mathieu-Daudé, Bin Meng, Cédric Le Goater
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
Add 2 command handler arrays in SDProto, for CMD and ACMD.
Have sd_normal_command() / sd_app_command() use these arrays:
if an command handler is registered, call it, otherwise fall
back to current code base.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Message-Id: <20210624142209.1193073-5-f4bug@amsat.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
hw/sd/sd.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index f6aa3b0a80bf..889c44a5c07c 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -87,8 +87,12 @@ enum SDCardStates {
sd_disconnect_state,
};
+typedef sd_rsp_type_t (*sd_cmd_handler)(SDState *sd, SDRequest req);
+
typedef struct SDProto {
const char *name;
+ sd_cmd_handler cmd[SDMMC_CMD_MAX];
+ sd_cmd_handler acmd[SDMMC_CMD_MAX];
} SDProto;
struct SDState {
@@ -1031,6 +1035,10 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
return sd_illegal;
}
+ if (sd_proto(sd)->cmd[req.cmd]) {
+ return sd_proto(sd)->cmd[req.cmd](sd, req);
+ }
+
switch (req.cmd) {
/* Basic commands (Class 0 and Class 1) */
case 0: /* CMD0: GO_IDLE_STATE */
@@ -1575,6 +1583,11 @@ static sd_rsp_type_t sd_app_command(SDState *sd,
trace_sdcard_app_command(sd_proto(sd)->name, sd_acmd_name(req.cmd),
req.cmd, req.arg, sd_state_name(sd->state));
sd->card_status |= APP_CMD;
+
+ if (sd_proto(sd)->acmd[req.cmd]) {
+ return sd_proto(sd)->acmd[req.cmd](sd, req);
+ }
+
switch (req.cmd) {
case 6: /* ACMD6: SET_BUS_WIDTH */
if (sd->spi) {
--
2.41.0
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PULL 18/26] hw/sd: Add sd_cmd_illegal() handler
2023-09-01 9:41 [PULL 00/26] aspeed queue Cédric Le Goater
` (16 preceding siblings ...)
2023-09-01 9:42 ` [PULL 17/26] hw/sd: Introduce sd_cmd_handler type Cédric Le Goater
@ 2023-09-01 9:42 ` Cédric Le Goater
2023-09-01 9:42 ` [PULL 19/26] hw/sd: Add sd_cmd_unimplemented() handler Cédric Le Goater
` (9 subsequent siblings)
27 siblings, 0 replies; 31+ messages in thread
From: Cédric Le Goater @ 2023-09-01 9:42 UTC (permalink / raw)
To: qemu-arm, qemu-devel
Cc: Philippe Mathieu-Daudé, Bin Meng, Cédric Le Goater
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
Log illegal commands as GUEST_ERROR.
Note: we are logging back the SDIO commands (CMD5, CMD52-54).
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Message-Id: <20210624142209.1193073-6-f4bug@amsat.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
hw/sd/sd.c | 62 +++++++++++++++++++++++-------------------------------
1 file changed, 26 insertions(+), 36 deletions(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 889c44a5c07c..83a0d6825147 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -1002,6 +1002,15 @@ static sd_rsp_type_t sd_invalid_state_for_cmd(SDState *sd, SDRequest req)
return sd_illegal;
}
+static sd_rsp_type_t sd_cmd_illegal(SDState *sd, SDRequest req)
+{
+ qemu_log_mask(LOG_GUEST_ERROR, "%s: Unknown CMD%i for spec %s\n",
+ sd_proto(sd)->name, req.cmd,
+ sd_version_str(sd->spec_version));
+
+ return sd_illegal;
+}
+
static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
{
uint32_t rca = 0x0000;
@@ -1054,15 +1063,10 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
break;
case 1: /* CMD1: SEND_OP_CMD */
- if (!sd->spi)
- goto bad_cmd;
-
sd->state = sd_transfer_state;
return sd_r1;
case 2: /* CMD2: ALL_SEND_CID */
- if (sd->spi)
- goto bad_cmd;
switch (sd->state) {
case sd_ready_state:
sd->state = sd_identification_state;
@@ -1074,8 +1078,6 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
break;
case 3: /* CMD3: SEND_RELATIVE_ADDR */
- if (sd->spi)
- goto bad_cmd;
switch (sd->state) {
case sd_identification_state:
case sd_standby_state:
@@ -1089,8 +1091,6 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
break;
case 4: /* CMD4: SEND_DSR */
- if (sd->spi)
- goto bad_cmd;
switch (sd->state) {
case sd_standby_state:
break;
@@ -1100,9 +1100,6 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
}
break;
- case 5: /* CMD5: reserved for SDIO cards */
- return sd_illegal;
-
case 6: /* CMD6: SWITCH_FUNCTION */
switch (sd->mode) {
case sd_data_transfer_mode:
@@ -1118,8 +1115,6 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
break;
case 7: /* CMD7: SELECT/DESELECT_CARD */
- if (sd->spi)
- goto bad_cmd;
switch (sd->state) {
case sd_standby_state:
if (sd->rca != rca)
@@ -1249,8 +1244,6 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
break;
case 15: /* CMD15: GO_INACTIVE_STATE */
- if (sd->spi)
- goto bad_cmd;
switch (sd->mode) {
case sd_data_transfer_mode:
if (sd->rca != rca)
@@ -1303,7 +1296,7 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
case 19: /* CMD19: SEND_TUNING_BLOCK (SD) */
if (sd->spec_version < SD_PHY_SPECv3_01_VERS) {
- goto bad_cmd;
+ return sd_invalid_state_for_cmd(sd, req);
}
if (sd->state == sd_transfer_state) {
sd->state = sd_sendingdata_state;
@@ -1314,7 +1307,7 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
case 23: /* CMD23: SET_BLOCK_COUNT */
if (sd->spec_version < SD_PHY_SPECv3_01_VERS) {
- goto bad_cmd;
+ return sd_invalid_state_for_cmd(sd, req);
}
switch (sd->state) {
case sd_transfer_state:
@@ -1357,8 +1350,6 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
break;
case 26: /* CMD26: PROGRAM_CID */
- if (sd->spi)
- goto bad_cmd;
switch (sd->state) {
case sd_transfer_state:
sd->state = sd_receivingdata_state;
@@ -1508,15 +1499,6 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
}
break;
- case 52 ... 54:
- /* CMD52, CMD53, CMD54: reserved for SDIO cards
- * (see the SDIO Simplified Specification V2.0)
- * Handle as illegal command but do not complain
- * on stderr, as some OSes may use these in their
- * probing for presence of an SDIO card.
- */
- return sd_illegal;
-
/* Application specific commands (Class 8) */
case 55: /* CMD55: APP_CMD */
switch (sd->state) {
@@ -1557,19 +1539,12 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
break;
case 58: /* CMD58: READ_OCR (SPI) */
- if (!sd->spi) {
- goto bad_cmd;
- }
return sd_r3;
case 59: /* CMD59: CRC_ON_OFF (SPI) */
- if (!sd->spi) {
- goto bad_cmd;
- }
return sd_r1;
default:
- bad_cmd:
qemu_log_mask(LOG_GUEST_ERROR, "SD: Unknown CMD%i\n", req.cmd);
return sd_illegal;
}
@@ -2156,10 +2131,25 @@ void sd_enable(SDState *sd, bool enable)
static const SDProto sd_proto_spi = {
.name = "SPI",
+ .cmd = {
+ [2 ... 4] = sd_cmd_illegal,
+ [5] = sd_cmd_illegal,
+ [7] = sd_cmd_illegal,
+ [15] = sd_cmd_illegal,
+ [26] = sd_cmd_illegal,
+ [52 ... 54] = sd_cmd_illegal,
+ },
};
static const SDProto sd_proto_sd = {
.name = "SD",
+ .cmd = {
+ [1] = sd_cmd_illegal,
+ [5] = sd_cmd_illegal,
+ [52 ... 54] = sd_cmd_illegal,
+ [58] = sd_cmd_illegal,
+ [59] = sd_cmd_illegal,
+ },
};
static void sd_instance_init(Object *obj)
--
2.41.0
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PULL 19/26] hw/sd: Add sd_cmd_unimplemented() handler
2023-09-01 9:41 [PULL 00/26] aspeed queue Cédric Le Goater
` (17 preceding siblings ...)
2023-09-01 9:42 ` [PULL 18/26] hw/sd: Add sd_cmd_illegal() handler Cédric Le Goater
@ 2023-09-01 9:42 ` Cédric Le Goater
2023-09-01 9:42 ` [PULL 20/26] hw/sd: Add sd_cmd_GO_IDLE_STATE() handler Cédric Le Goater
` (8 subsequent siblings)
27 siblings, 0 replies; 31+ messages in thread
From: Cédric Le Goater @ 2023-09-01 9:42 UTC (permalink / raw)
To: qemu-arm, qemu-devel; +Cc: Philippe Mathieu-Daudé, Cédric Le Goater
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
[ clg: Fix redundant assignment of .cmd ]
Message-Id: <20210624142209.1193073-7-f4bug@amsat.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
hw/sd/sd.c | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 83a0d6825147..e88bfcb8c802 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -1011,6 +1011,15 @@ static sd_rsp_type_t sd_cmd_illegal(SDState *sd, SDRequest req)
return sd_illegal;
}
+/* Commands that are recognised but not yet implemented. */
+static sd_rsp_type_t sd_cmd_unimplemented(SDState *sd, SDRequest req)
+{
+ qemu_log_mask(LOG_UNIMP, "%s: CMD%i not implemented\n",
+ sd_proto(sd)->name, req.cmd);
+
+ return sd_illegal;
+}
+
static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
{
uint32_t rca = 0x0000;
@@ -1565,9 +1574,6 @@ static sd_rsp_type_t sd_app_command(SDState *sd,
switch (req.cmd) {
case 6: /* ACMD6: SET_BUS_WIDTH */
- if (sd->spi) {
- goto unimplemented_spi_cmd;
- }
switch (sd->state) {
case sd_transfer_state:
sd->sd_status[0] &= 0x3f;
@@ -1698,12 +1704,6 @@ static sd_rsp_type_t sd_app_command(SDState *sd,
default:
/* Fall back to standard commands. */
return sd_normal_command(sd, req);
-
- unimplemented_spi_cmd:
- /* Commands that are recognised but not yet implemented in SPI mode. */
- qemu_log_mask(LOG_UNIMP, "SD: CMD%i not implemented in SPI mode\n",
- req.cmd);
- return sd_illegal;
}
qemu_log_mask(LOG_GUEST_ERROR, "SD: ACMD%i in a wrong state\n", req.cmd);
@@ -2139,6 +2139,9 @@ static const SDProto sd_proto_spi = {
[26] = sd_cmd_illegal,
[52 ... 54] = sd_cmd_illegal,
},
+ .acmd = {
+ [6] = sd_cmd_unimplemented,
+ },
};
static const SDProto sd_proto_sd = {
--
2.41.0
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PULL 20/26] hw/sd: Add sd_cmd_GO_IDLE_STATE() handler
2023-09-01 9:41 [PULL 00/26] aspeed queue Cédric Le Goater
` (18 preceding siblings ...)
2023-09-01 9:42 ` [PULL 19/26] hw/sd: Add sd_cmd_unimplemented() handler Cédric Le Goater
@ 2023-09-01 9:42 ` Cédric Le Goater
2023-09-01 9:42 ` [PULL 21/26] hw/sd: Add sd_cmd_SEND_OP_CMD() handler Cédric Le Goater
` (7 subsequent siblings)
27 siblings, 0 replies; 31+ messages in thread
From: Cédric Le Goater @ 2023-09-01 9:42 UTC (permalink / raw)
To: qemu-arm, qemu-devel
Cc: Philippe Mathieu-Daudé, Bin Meng, Cédric Le Goater
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Message-Id: <20210624142209.1193073-8-f4bug@amsat.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
hw/sd/sd.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index e88bfcb8c802..535b72ff5c2a 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -1020,6 +1020,16 @@ static sd_rsp_type_t sd_cmd_unimplemented(SDState *sd, SDRequest req)
return sd_illegal;
}
+static sd_rsp_type_t sd_cmd_GO_IDLE_STATE(SDState *sd, SDRequest req)
+{
+ if (sd->state != sd_inactive_state) {
+ sd->state = sd_idle_state;
+ sd_reset(DEVICE(sd));
+ }
+
+ return sd->spi ? sd_r1 : sd_r0;
+}
+
static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
{
uint32_t rca = 0x0000;
@@ -1059,18 +1069,6 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
switch (req.cmd) {
/* Basic commands (Class 0 and Class 1) */
- case 0: /* CMD0: GO_IDLE_STATE */
- switch (sd->state) {
- case sd_inactive_state:
- return sd->spi ? sd_r1 : sd_r0;
-
- default:
- sd->state = sd_idle_state;
- sd_reset(DEVICE(sd));
- return sd->spi ? sd_r1 : sd_r0;
- }
- break;
-
case 1: /* CMD1: SEND_OP_CMD */
sd->state = sd_transfer_state;
return sd_r1;
@@ -2132,6 +2130,7 @@ void sd_enable(SDState *sd, bool enable)
static const SDProto sd_proto_spi = {
.name = "SPI",
.cmd = {
+ [0] = sd_cmd_GO_IDLE_STATE,
[2 ... 4] = sd_cmd_illegal,
[5] = sd_cmd_illegal,
[7] = sd_cmd_illegal,
@@ -2147,6 +2146,7 @@ static const SDProto sd_proto_spi = {
static const SDProto sd_proto_sd = {
.name = "SD",
.cmd = {
+ [0] = sd_cmd_GO_IDLE_STATE,
[1] = sd_cmd_illegal,
[5] = sd_cmd_illegal,
[52 ... 54] = sd_cmd_illegal,
--
2.41.0
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PULL 21/26] hw/sd: Add sd_cmd_SEND_OP_CMD() handler
2023-09-01 9:41 [PULL 00/26] aspeed queue Cédric Le Goater
` (19 preceding siblings ...)
2023-09-01 9:42 ` [PULL 20/26] hw/sd: Add sd_cmd_GO_IDLE_STATE() handler Cédric Le Goater
@ 2023-09-01 9:42 ` Cédric Le Goater
2023-09-01 9:42 ` [PULL 22/26] hw/sd: Add sd_cmd_ALL_SEND_CID() handler Cédric Le Goater
` (6 subsequent siblings)
27 siblings, 0 replies; 31+ messages in thread
From: Cédric Le Goater @ 2023-09-01 9:42 UTC (permalink / raw)
To: qemu-arm, qemu-devel; +Cc: Philippe Mathieu-Daudé, Cédric Le Goater
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
[ clg: Update cmd_abbrev ]
Message-Id: <20210624142209.1193073-9-f4bug@amsat.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
hw/sd/sd.c | 18 +++++++++---------
hw/sd/sdmmc-internal.c | 2 +-
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 535b72ff5c2a..bd67c50894fe 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -1030,6 +1030,13 @@ static sd_rsp_type_t sd_cmd_GO_IDLE_STATE(SDState *sd, SDRequest req)
return sd->spi ? sd_r1 : sd_r0;
}
+static sd_rsp_type_t sd_cmd_SEND_OP_CMD(SDState *sd, SDRequest req)
+{
+ sd->state = sd_transfer_state;
+
+ return sd_r1;
+}
+
static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
{
uint32_t rca = 0x0000;
@@ -1069,10 +1076,6 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
switch (req.cmd) {
/* Basic commands (Class 0 and Class 1) */
- case 1: /* CMD1: SEND_OP_CMD */
- sd->state = sd_transfer_state;
- return sd_r1;
-
case 2: /* CMD2: ALL_SEND_CID */
switch (sd->state) {
case sd_ready_state:
@@ -1622,11 +1625,6 @@ static sd_rsp_type_t sd_app_command(SDState *sd,
break;
case 41: /* ACMD41: SD_APP_OP_COND */
- if (sd->spi) {
- /* SEND_OP_CMD */
- sd->state = sd_transfer_state;
- return sd_r1;
- }
if (sd->state != sd_idle_state) {
break;
}
@@ -2131,6 +2129,7 @@ static const SDProto sd_proto_spi = {
.name = "SPI",
.cmd = {
[0] = sd_cmd_GO_IDLE_STATE,
+ [1] = sd_cmd_SEND_OP_CMD,
[2 ... 4] = sd_cmd_illegal,
[5] = sd_cmd_illegal,
[7] = sd_cmd_illegal,
@@ -2140,6 +2139,7 @@ static const SDProto sd_proto_spi = {
},
.acmd = {
[6] = sd_cmd_unimplemented,
+ [41] = sd_cmd_SEND_OP_CMD,
},
};
diff --git a/hw/sd/sdmmc-internal.c b/hw/sd/sdmmc-internal.c
index 2053def3f10b..8648a7808dcc 100644
--- a/hw/sd/sdmmc-internal.c
+++ b/hw/sd/sdmmc-internal.c
@@ -14,7 +14,7 @@
const char *sd_cmd_name(uint8_t cmd)
{
static const char *cmd_abbrev[SDMMC_CMD_MAX] = {
- [0] = "GO_IDLE_STATE",
+ [0] = "GO_IDLE_STATE", [1] = "SEND_OP_CMD",
[2] = "ALL_SEND_CID", [3] = "SEND_RELATIVE_ADDR",
[4] = "SET_DSR", [5] = "IO_SEND_OP_COND",
[6] = "SWITCH_FUNC", [7] = "SELECT/DESELECT_CARD",
--
2.41.0
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PULL 22/26] hw/sd: Add sd_cmd_ALL_SEND_CID() handler
2023-09-01 9:41 [PULL 00/26] aspeed queue Cédric Le Goater
` (20 preceding siblings ...)
2023-09-01 9:42 ` [PULL 21/26] hw/sd: Add sd_cmd_SEND_OP_CMD() handler Cédric Le Goater
@ 2023-09-01 9:42 ` Cédric Le Goater
2023-09-01 9:42 ` [PULL 23/26] hw/sd: Add sd_cmd_SEND_RELATIVE_ADDR() handler Cédric Le Goater
` (5 subsequent siblings)
27 siblings, 0 replies; 31+ messages in thread
From: Cédric Le Goater @ 2023-09-01 9:42 UTC (permalink / raw)
To: qemu-arm, qemu-devel
Cc: Philippe Mathieu-Daudé, Bin Meng, Cédric Le Goater
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Message-Id: <20210624142209.1193073-10-f4bug@amsat.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
hw/sd/sd.c | 23 ++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index bd67c50894fe..33ecff496ade 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -1037,6 +1037,17 @@ static sd_rsp_type_t sd_cmd_SEND_OP_CMD(SDState *sd, SDRequest req)
return sd_r1;
}
+static sd_rsp_type_t sd_cmd_ALL_SEND_CID(SDState *sd, SDRequest req)
+{
+ if (sd->state != sd_ready_state) {
+ return sd_invalid_state_for_cmd(sd, req);
+ }
+
+ sd->state = sd_identification_state;
+
+ return sd_r2_i;
+}
+
static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
{
uint32_t rca = 0x0000;
@@ -1076,17 +1087,6 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
switch (req.cmd) {
/* Basic commands (Class 0 and Class 1) */
- case 2: /* CMD2: ALL_SEND_CID */
- switch (sd->state) {
- case sd_ready_state:
- sd->state = sd_identification_state;
- return sd_r2_i;
-
- default:
- break;
- }
- break;
-
case 3: /* CMD3: SEND_RELATIVE_ADDR */
switch (sd->state) {
case sd_identification_state:
@@ -2148,6 +2148,7 @@ static const SDProto sd_proto_sd = {
.cmd = {
[0] = sd_cmd_GO_IDLE_STATE,
[1] = sd_cmd_illegal,
+ [2] = sd_cmd_ALL_SEND_CID,
[5] = sd_cmd_illegal,
[52 ... 54] = sd_cmd_illegal,
[58] = sd_cmd_illegal,
--
2.41.0
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PULL 23/26] hw/sd: Add sd_cmd_SEND_RELATIVE_ADDR() handler
2023-09-01 9:41 [PULL 00/26] aspeed queue Cédric Le Goater
` (21 preceding siblings ...)
2023-09-01 9:42 ` [PULL 22/26] hw/sd: Add sd_cmd_ALL_SEND_CID() handler Cédric Le Goater
@ 2023-09-01 9:42 ` Cédric Le Goater
2023-09-01 9:42 ` [PULL 24/26] hw/sd: Add sd_cmd_SEND_TUNING_BLOCK() handler Cédric Le Goater
` (4 subsequent siblings)
27 siblings, 0 replies; 31+ messages in thread
From: Cédric Le Goater @ 2023-09-01 9:42 UTC (permalink / raw)
To: qemu-arm, qemu-devel
Cc: Philippe Mathieu-Daudé, Bin Meng, Cédric Le Goater
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Message-Id: <20210624142209.1193073-11-f4bug@amsat.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
hw/sd/sd.c | 28 +++++++++++++++-------------
1 file changed, 15 insertions(+), 13 deletions(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 33ecff496ade..b46072424108 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -1048,6 +1048,20 @@ static sd_rsp_type_t sd_cmd_ALL_SEND_CID(SDState *sd, SDRequest req)
return sd_r2_i;
}
+static sd_rsp_type_t sd_cmd_SEND_RELATIVE_ADDR(SDState *sd, SDRequest req)
+{
+ switch (sd->state) {
+ case sd_identification_state:
+ case sd_standby_state:
+ sd->state = sd_standby_state;
+ sd_set_rca(sd);
+ return sd_r6;
+
+ default:
+ return sd_invalid_state_for_cmd(sd, req);
+ }
+}
+
static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
{
uint32_t rca = 0x0000;
@@ -1087,19 +1101,6 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
switch (req.cmd) {
/* Basic commands (Class 0 and Class 1) */
- case 3: /* CMD3: SEND_RELATIVE_ADDR */
- switch (sd->state) {
- case sd_identification_state:
- case sd_standby_state:
- sd->state = sd_standby_state;
- sd_set_rca(sd);
- return sd_r6;
-
- default:
- break;
- }
- break;
-
case 4: /* CMD4: SEND_DSR */
switch (sd->state) {
case sd_standby_state:
@@ -2149,6 +2150,7 @@ static const SDProto sd_proto_sd = {
[0] = sd_cmd_GO_IDLE_STATE,
[1] = sd_cmd_illegal,
[2] = sd_cmd_ALL_SEND_CID,
+ [3] = sd_cmd_SEND_RELATIVE_ADDR,
[5] = sd_cmd_illegal,
[52 ... 54] = sd_cmd_illegal,
[58] = sd_cmd_illegal,
--
2.41.0
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PULL 24/26] hw/sd: Add sd_cmd_SEND_TUNING_BLOCK() handler
2023-09-01 9:41 [PULL 00/26] aspeed queue Cédric Le Goater
` (22 preceding siblings ...)
2023-09-01 9:42 ` [PULL 23/26] hw/sd: Add sd_cmd_SEND_RELATIVE_ADDR() handler Cédric Le Goater
@ 2023-09-01 9:42 ` Cédric Le Goater
2023-09-01 9:42 ` [PULL 25/26] hw/sd: Add sd_cmd_SET_BLOCK_COUNT() handler Cédric Le Goater
` (3 subsequent siblings)
27 siblings, 0 replies; 31+ messages in thread
From: Cédric Le Goater @ 2023-09-01 9:42 UTC (permalink / raw)
To: qemu-arm, qemu-devel
Cc: Joel Stanley, Philippe Mathieu-Daudé, Cédric Le Goater
From: Joel Stanley <joel@jms.id.au>
Signed-off-by: Joel Stanley <joel@jms.id.au>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
hw/sd/sd.c | 28 +++++++++++++++++-----------
1 file changed, 17 insertions(+), 11 deletions(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index b46072424108..00a59450b726 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -1062,6 +1062,22 @@ static sd_rsp_type_t sd_cmd_SEND_RELATIVE_ADDR(SDState *sd, SDRequest req)
}
}
+static sd_rsp_type_t sd_cmd_SEND_TUNING_BLOCK(SDState *sd, SDRequest req)
+{
+ if (sd->spec_version < SD_PHY_SPECv3_01_VERS) {
+ return sd_cmd_illegal(sd, req);
+ }
+
+ if (sd->state != sd_transfer_state) {
+ return sd_invalid_state_for_cmd(sd, req);
+ }
+
+ sd->state = sd_sendingdata_state;
+ sd->data_offset = 0;
+
+ return sd_r1;
+}
+
static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
{
uint32_t rca = 0x0000;
@@ -1305,17 +1321,6 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
}
break;
- case 19: /* CMD19: SEND_TUNING_BLOCK (SD) */
- if (sd->spec_version < SD_PHY_SPECv3_01_VERS) {
- return sd_invalid_state_for_cmd(sd, req);
- }
- if (sd->state == sd_transfer_state) {
- sd->state = sd_sendingdata_state;
- sd->data_offset = 0;
- return sd_r1;
- }
- break;
-
case 23: /* CMD23: SET_BLOCK_COUNT */
if (sd->spec_version < SD_PHY_SPECv3_01_VERS) {
return sd_invalid_state_for_cmd(sd, req);
@@ -2152,6 +2157,7 @@ static const SDProto sd_proto_sd = {
[2] = sd_cmd_ALL_SEND_CID,
[3] = sd_cmd_SEND_RELATIVE_ADDR,
[5] = sd_cmd_illegal,
+ [19] = sd_cmd_SEND_TUNING_BLOCK,
[52 ... 54] = sd_cmd_illegal,
[58] = sd_cmd_illegal,
[59] = sd_cmd_illegal,
--
2.41.0
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PULL 25/26] hw/sd: Add sd_cmd_SET_BLOCK_COUNT() handler
2023-09-01 9:41 [PULL 00/26] aspeed queue Cédric Le Goater
` (23 preceding siblings ...)
2023-09-01 9:42 ` [PULL 24/26] hw/sd: Add sd_cmd_SEND_TUNING_BLOCK() handler Cédric Le Goater
@ 2023-09-01 9:42 ` Cédric Le Goater
2023-09-01 9:42 ` [PULL 26/26] hw/sd: Introduce a "sd-card" SPI variant model Cédric Le Goater
` (2 subsequent siblings)
27 siblings, 0 replies; 31+ messages in thread
From: Cédric Le Goater @ 2023-09-01 9:42 UTC (permalink / raw)
To: qemu-arm, qemu-devel; +Cc: Philippe Mathieu-Daudé, Cédric Le Goater
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
hw/sd/sd.c | 30 ++++++++++++++++--------------
1 file changed, 16 insertions(+), 14 deletions(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 00a59450b726..d1c0b132c227 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -1078,6 +1078,21 @@ static sd_rsp_type_t sd_cmd_SEND_TUNING_BLOCK(SDState *sd, SDRequest req)
return sd_r1;
}
+static sd_rsp_type_t sd_cmd_SET_BLOCK_COUNT(SDState *sd, SDRequest req)
+{
+ if (sd->spec_version < SD_PHY_SPECv3_01_VERS) {
+ return sd_cmd_illegal(sd, req);
+ }
+
+ if (sd->state != sd_transfer_state) {
+ return sd_invalid_state_for_cmd(sd, req);
+ }
+
+ sd->multi_blk_cnt = req.arg;
+
+ return sd_r1;
+}
+
static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
{
uint32_t rca = 0x0000;
@@ -1321,20 +1336,6 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
}
break;
- case 23: /* CMD23: SET_BLOCK_COUNT */
- if (sd->spec_version < SD_PHY_SPECv3_01_VERS) {
- return sd_invalid_state_for_cmd(sd, req);
- }
- switch (sd->state) {
- case sd_transfer_state:
- sd->multi_blk_cnt = req.arg;
- return sd_r1;
-
- default:
- break;
- }
- break;
-
/* Block write commands (Class 4) */
case 24: /* CMD24: WRITE_SINGLE_BLOCK */
case 25: /* CMD25: WRITE_MULTIPLE_BLOCK */
@@ -2158,6 +2159,7 @@ static const SDProto sd_proto_sd = {
[3] = sd_cmd_SEND_RELATIVE_ADDR,
[5] = sd_cmd_illegal,
[19] = sd_cmd_SEND_TUNING_BLOCK,
+ [23] = sd_cmd_SET_BLOCK_COUNT,
[52 ... 54] = sd_cmd_illegal,
[58] = sd_cmd_illegal,
[59] = sd_cmd_illegal,
--
2.41.0
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PULL 26/26] hw/sd: Introduce a "sd-card" SPI variant model
2023-09-01 9:41 [PULL 00/26] aspeed queue Cédric Le Goater
` (24 preceding siblings ...)
2023-09-01 9:42 ` [PULL 25/26] hw/sd: Add sd_cmd_SET_BLOCK_COUNT() handler Cédric Le Goater
@ 2023-09-01 9:42 ` Cédric Le Goater
2023-09-06 18:24 ` [PULL 00/26] aspeed queue Stefan Hajnoczi
2023-09-08 7:09 ` Cédric Le Goater
27 siblings, 0 replies; 31+ messages in thread
From: Cédric Le Goater @ 2023-09-01 9:42 UTC (permalink / raw)
To: qemu-arm, qemu-devel; +Cc: Cédric Le Goater, Philippe Mathieu-Daudé
and replace the SDState::spi attribute with a test checking the
SDProto array of commands.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
include/hw/sd/sd.h | 3 +++
hw/arm/stellaris.c | 3 +--
hw/riscv/sifive_u.c | 3 +--
hw/sd/sd.c | 54 +++++++++++++++++++++++++++++++++------------
4 files changed, 45 insertions(+), 18 deletions(-)
diff --git a/include/hw/sd/sd.h b/include/hw/sd/sd.h
index b322d8f19b17..2c8748fb9b97 100644
--- a/include/hw/sd/sd.h
+++ b/include/hw/sd/sd.h
@@ -93,6 +93,9 @@ typedef struct {
#define TYPE_SD_CARD "sd-card"
OBJECT_DECLARE_TYPE(SDState, SDCardClass, SD_CARD)
+#define TYPE_SD_CARD_SPI "sd-card-spi"
+DECLARE_INSTANCE_CHECKER(SDState, SD_CARD_SPI, TYPE_SD_CARD_SPI)
+
struct SDCardClass {
/*< private >*/
DeviceClass parent_class;
diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c
index 5a3106e00939..aa5b0ddfaa5a 100644
--- a/hw/arm/stellaris.c
+++ b/hw/arm/stellaris.c
@@ -1235,9 +1235,8 @@ static void stellaris_init(MachineState *ms, stellaris_board_info *board)
dinfo = drive_get(IF_SD, 0, 0);
blk = dinfo ? blk_by_legacy_dinfo(dinfo) : NULL;
- carddev = qdev_new(TYPE_SD_CARD);
+ carddev = qdev_new(TYPE_SD_CARD_SPI);
qdev_prop_set_drive_err(carddev, "drive", blk, &error_fatal);
- qdev_prop_set_bit(carddev, "spi", true);
qdev_realize_and_unref(carddev,
qdev_get_child_bus(sddev, "sd-bus"),
&error_fatal);
diff --git a/hw/riscv/sifive_u.c b/hw/riscv/sifive_u.c
index 35a335b8d0ba..ec76dce6c952 100644
--- a/hw/riscv/sifive_u.c
+++ b/hw/riscv/sifive_u.c
@@ -674,9 +674,8 @@ static void sifive_u_machine_init(MachineState *machine)
dinfo = drive_get(IF_SD, 0, 0);
blk = dinfo ? blk_by_legacy_dinfo(dinfo) : NULL;
- card_dev = qdev_new(TYPE_SD_CARD);
+ card_dev = qdev_new(TYPE_SD_CARD_SPI);
qdev_prop_set_drive_err(card_dev, "drive", blk, &error_fatal);
- qdev_prop_set_bit(card_dev, "spi", true);
qdev_realize_and_unref(card_dev,
qdev_get_child_bus(sd_dev, "sd-bus"),
&error_fatal);
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index d1c0b132c227..132daba4bd13 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -115,7 +115,6 @@ struct SDState {
uint8_t spec_version;
BlockBackend *blk;
- bool spi;
/* Runtime changeables */
@@ -159,6 +158,13 @@ static const struct SDProto *sd_proto(SDState *sd)
return sc->proto;
}
+static const SDProto sd_proto_spi;
+
+static bool sd_is_spi(SDState *sd)
+{
+ return sd_proto(sd) == &sd_proto_spi;
+}
+
static const char *sd_version_str(enum SDPhySpecificationVersion version)
{
static const char *sdphy_version[] = {
@@ -336,7 +342,7 @@ static void sd_set_ocr(SDState *sd)
/* All voltages OK */
sd->ocr = R_OCR_VDD_VOLTAGE_WIN_HI_MASK;
- if (sd->spi) {
+ if (sd_is_spi(sd)) {
/*
* We don't need to emulate power up sequence in SPI-mode.
* Thus, the card's power up status bit should be set to 1 when reset.
@@ -741,13 +747,12 @@ SDState *sd_init(BlockBackend *blk, bool is_spi)
SDState *sd;
Error *err = NULL;
- obj = object_new(TYPE_SD_CARD);
+ obj = object_new(is_spi ? TYPE_SD_CARD_SPI : TYPE_SD_CARD);
dev = DEVICE(obj);
if (!qdev_prop_set_drive_err(dev, "drive", blk, &err)) {
error_reportf_err(err, "sd_init failed: ");
return NULL;
}
- qdev_prop_set_bit(dev, "spi", is_spi);
/*
* Realizing the device properly would put it into the QOM
@@ -1027,7 +1032,7 @@ static sd_rsp_type_t sd_cmd_GO_IDLE_STATE(SDState *sd, SDRequest req)
sd_reset(DEVICE(sd));
}
- return sd->spi ? sd_r1 : sd_r0;
+ return sd_is_spi(sd) ? sd_r1 : sd_r0;
}
static sd_rsp_type_t sd_cmd_SEND_OP_CMD(SDState *sd, SDRequest req)
@@ -1203,7 +1208,7 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
/* No response if not exactly one VHS bit is set. */
if (!(req.arg >> 8) || (req.arg >> (ctz32(req.arg & ~0xff) + 1))) {
- return sd->spi ? sd_r7 : sd_r0;
+ return sd_is_spi(sd) ? sd_r7 : sd_r0;
}
/* Accept. */
@@ -1219,8 +1224,9 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
return sd_r2_s;
case sd_transfer_state:
- if (!sd->spi)
+ if (!sd_is_spi(sd)) {
break;
+ }
sd->state = sd_sendingdata_state;
memcpy(sd->data, sd->csd, 16);
sd->data_start = addr;
@@ -1241,8 +1247,9 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
return sd_r2_i;
case sd_transfer_state:
- if (!sd->spi)
+ if (!sd_is_spi(sd)) {
break;
+ }
sd->state = sd_sendingdata_state;
memcpy(sd->data, sd->cid, 16);
sd->data_start = addr;
@@ -1274,7 +1281,7 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
case 13: /* CMD13: SEND_STATUS */
switch (sd->mode) {
case sd_data_transfer_mode:
- if (!sd->spi && sd->rca != rca) {
+ if (!sd_is_spi(sd) && sd->rca != rca) {
return sd_r0;
}
@@ -1531,7 +1538,7 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
default:
break;
}
- if (!sd->spi) {
+ if (!sd_is_spi(sd)) {
if (sd->rca != rca) {
return sd_r0;
}
@@ -2184,11 +2191,8 @@ static void sd_instance_finalize(Object *obj)
static void sd_realize(DeviceState *dev, Error **errp)
{
SDState *sd = SD_CARD(dev);
- SDCardClass *sc = SD_CARD_GET_CLASS(sd);
int ret;
- sc->proto = sd->spi ? &sd_proto_spi : &sd_proto_sd;
-
switch (sd->spec_version) {
case SD_PHY_SPECv1_10_VERS
... SD_PHY_SPECv3_01_VERS:
@@ -2245,7 +2249,6 @@ static Property sd_properties[] = {
* whether card should be in SSI or MMC/SD mode. It is also up to the
* board to ensure that ssi transfers only occur when the chip select
* is asserted. */
- DEFINE_PROP_BOOL("spi", SDState, spi, false),
DEFINE_PROP_END_OF_LIST()
};
@@ -2272,6 +2275,7 @@ static void sd_class_init(ObjectClass *klass, void *data)
sc->enable = sd_enable;
sc->get_inserted = sd_get_inserted;
sc->get_readonly = sd_get_readonly;
+ sc->proto = &sd_proto_sd;
}
static const TypeInfo sd_info = {
@@ -2284,9 +2288,31 @@ static const TypeInfo sd_info = {
.instance_finalize = sd_instance_finalize,
};
+/*
+ * We do not model the chip select pin, so allow the board to select
+ * whether card should be in SSI or MMC/SD mode. It is also up to the
+ * board to ensure that ssi transfers only occur when the chip select
+ * is asserted.
+ */
+static void sd_spi_class_init(ObjectClass *klass, void *data)
+{
+ DeviceClass *dc = DEVICE_CLASS(klass);
+ SDCardClass *sc = SD_CARD_CLASS(klass);
+
+ dc->desc = "SD SPI";
+ sc->proto = &sd_proto_spi;
+}
+
+static const TypeInfo sd_spi_info = {
+ .name = TYPE_SD_CARD_SPI,
+ .parent = TYPE_SD_CARD,
+ .class_init = sd_spi_class_init,
+};
+
static void sd_register_types(void)
{
type_register_static(&sd_info);
+ type_register_static(&sd_spi_info);
}
type_init(sd_register_types)
--
2.41.0
^ permalink raw reply related [flat|nested] 31+ messages in thread
* Re: [PULL 00/26] aspeed queue
2023-09-01 9:41 [PULL 00/26] aspeed queue Cédric Le Goater
` (25 preceding siblings ...)
2023-09-01 9:42 ` [PULL 26/26] hw/sd: Introduce a "sd-card" SPI variant model Cédric Le Goater
@ 2023-09-06 18:24 ` Stefan Hajnoczi
2023-09-08 7:09 ` Cédric Le Goater
27 siblings, 0 replies; 31+ messages in thread
From: Stefan Hajnoczi @ 2023-09-06 18:24 UTC (permalink / raw)
To: Cédric Le Goater; +Cc: qemu-arm, qemu-devel, Cédric Le Goater
[-- Attachment #1: Type: text/plain, Size: 115 bytes --]
Applied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/8.2 for any user-visible changes.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PULL 00/26] aspeed queue
2023-09-01 9:41 [PULL 00/26] aspeed queue Cédric Le Goater
` (26 preceding siblings ...)
2023-09-06 18:24 ` [PULL 00/26] aspeed queue Stefan Hajnoczi
@ 2023-09-08 7:09 ` Cédric Le Goater
2023-09-08 7:52 ` Michael Tokarev
27 siblings, 1 reply; 31+ messages in thread
From: Cédric Le Goater @ 2023-09-08 7:09 UTC (permalink / raw)
To: qemu-arm, qemu-devel, Michael Tokarev
On 9/1/23 11:41, Cédric Le Goater wrote:
> The following changes since commit 17780edd81d27fcfdb7a802efc870a99788bd2fc:
>
> Merge tag 'quick-fix-pull-request' of https://gitlab.com/bsdimp/qemu into staging (2023-08-31 10:06:29 -0400)
>
> are available in the Git repository at:
>
> https://github.com/legoater/qemu/ tags/pull-aspeed-20230901
>
> for you to fetch changes up to c3287c0f70dae07dd12322c5c8663f7b878826e7:
>
> hw/sd: Introduce a "sd-card" SPI variant model (2023-09-01 11:40:04 +0200)
>
> ----------------------------------------------------------------
> aspeed queue:
>
> * Fixes for the Aspeed I2C model
> * New SDK image for avocado tests
> * blockdev support for flash device definition
> * SD refactoring preparing ground for eMMC support
>
> ----------------------------------------------------------------
> Cédric Le Goater (10):
> aspeed: Introduce helper for 32-bit hosts limitation
> tests/avocado/machine_aspeed.py: Update SDK images
> hw/ssi: Add a "cs" property to SSIPeripheral
> hw/ssi: Introduce a ssi_get_cs() helper
> aspeed/smc: Wire CS lines at reset
> hw/ssi: Check for duplicate CS indexes
> aspeed: Create flash devices only when defaults are enabled
> m25p80: Introduce an helper to retrieve the BlockBackend of a device
> aspeed: Get the BlockBackend of FMC0 from the flash device
> hw/sd: Introduce a "sd-card" SPI variant model
>
> Hang Yu (3):
> hw/i2c/aspeed: Fix Tx count and Rx size error in buffer pool mode
> hw/i2c/aspeed: Fix TXBUF transmission start position error
Michael,
I think the two above are candidates for stable.
Thanks,
C.
> hw/i2c/aspeed: Add support for buffer organization
>
> Joel Stanley (1):
> hw/sd: Add sd_cmd_SEND_TUNING_BLOCK() handler
>
> Philippe Mathieu-Daudé (12):
> hw/sd/sdcard: Return ILLEGAL for CMD19/CMD23 prior SD spec v3.01
> hw/sd: When card is in wrong state, log which state it is
> hw/sd: When card is in wrong state, log which spec version is used
> hw/sd: Move proto_name to SDProto structure
> hw/sd: Introduce sd_cmd_handler type
> hw/sd: Add sd_cmd_illegal() handler
> hw/sd: Add sd_cmd_unimplemented() handler
> hw/sd: Add sd_cmd_GO_IDLE_STATE() handler
> hw/sd: Add sd_cmd_SEND_OP_CMD() handler
> hw/sd: Add sd_cmd_ALL_SEND_CID() handler
> hw/sd: Add sd_cmd_SEND_RELATIVE_ADDR() handler
> hw/sd: Add sd_cmd_SET_BLOCK_COUNT() handler
>
> docs/system/arm/aspeed.rst | 35 +++-
> include/hw/block/flash.h | 4 +
> include/hw/i2c/aspeed_i2c.h | 5 +-
> include/hw/sd/sd.h | 5 +
> include/hw/ssi/ssi.h | 5 +
> hw/arm/aspeed.c | 40 ++---
> hw/arm/stellaris.c | 7 +-
> hw/arm/xilinx_zynq.c | 1 +
> hw/arm/xlnx-versal-virt.c | 1 +
> hw/arm/xlnx-zcu102.c | 2 +
> hw/block/m25p80.c | 6 +
> hw/i2c/aspeed_i2c.c | 40 ++---
> hw/microblaze/petalogix_ml605_mmu.c | 1 +
> hw/riscv/sifive_u.c | 3 +-
> hw/sd/sd.c | 348 ++++++++++++++++++++++--------------
> hw/sd/sdmmc-internal.c | 2 +-
> hw/ssi/aspeed_smc.c | 8 +
> hw/ssi/ssi.c | 43 +++++
> tests/avocado/machine_aspeed.py | 12 +-
> 19 files changed, 367 insertions(+), 201 deletions(-)
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PULL 00/26] aspeed queue
2023-09-08 7:09 ` Cédric Le Goater
@ 2023-09-08 7:52 ` Michael Tokarev
2023-09-08 8:25 ` Cédric Le Goater
0 siblings, 1 reply; 31+ messages in thread
From: Michael Tokarev @ 2023-09-08 7:52 UTC (permalink / raw)
To: Cédric Le Goater, qemu-arm, qemu-devel, qemu-stable
08.09.2023 10:09, Cédric Le Goater wrote:
..
>> Hang Yu (3):
>> hw/i2c/aspeed: Fix Tx count and Rx size error in buffer pool mode
>> hw/i2c/aspeed: Fix TXBUF transmission start position error
>
> Michael,
>
> I think the two above are candidates for stable.
Got it. I've noticed these two in master yesterday, but thought
i2c/aspeed priority is a bit lower than other stuff, - maybe
wrongly.
Picked these two up now.
Thank you for making me know!
/mjt
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PULL 00/26] aspeed queue
2023-09-08 7:52 ` Michael Tokarev
@ 2023-09-08 8:25 ` Cédric Le Goater
0 siblings, 0 replies; 31+ messages in thread
From: Cédric Le Goater @ 2023-09-08 8:25 UTC (permalink / raw)
To: Michael Tokarev, qemu-arm, qemu-devel, qemu-stable
On 9/8/23 09:52, Michael Tokarev wrote:
> 08.09.2023 10:09, Cédric Le Goater wrote:
> ..
>>> Hang Yu (3):
>>> hw/i2c/aspeed: Fix Tx count and Rx size error in buffer pool mode
>>> hw/i2c/aspeed: Fix TXBUF transmission start position error
>>
>> Michael,
>>
>> I think the two above are candidates for stable.
>
> Got it. I've noticed these two in master yesterday, but thought
> i2c/aspeed priority is a bit lower than other stuff, - maybe
> wrongly.
It is not hot material indeed but it does fix support for the
latest Aspeed SDK and a lot people simply use the disto QEMU.
> Picked these two up now.
Thanks, !
C.
^ permalink raw reply [flat|nested] 31+ messages in thread
end of thread, other threads:[~2023-09-08 8:26 UTC | newest]
Thread overview: 31+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-01 9:41 [PULL 00/26] aspeed queue Cédric Le Goater
2023-09-01 9:41 ` [PULL 01/26] aspeed: Introduce helper for 32-bit hosts limitation Cédric Le Goater
2023-09-01 9:41 ` [PULL 02/26] hw/i2c/aspeed: Fix Tx count and Rx size error in buffer pool mode Cédric Le Goater
2023-09-01 9:41 ` [PULL 03/26] hw/i2c/aspeed: Fix TXBUF transmission start position error Cédric Le Goater
2023-09-01 9:41 ` [PULL 04/26] hw/i2c/aspeed: Add support for buffer organization Cédric Le Goater
2023-09-01 9:41 ` [PULL 05/26] tests/avocado/machine_aspeed.py: Update SDK images Cédric Le Goater
2023-09-01 9:41 ` [PULL 06/26] hw/ssi: Add a "cs" property to SSIPeripheral Cédric Le Goater
2023-09-01 9:41 ` [PULL 07/26] hw/ssi: Introduce a ssi_get_cs() helper Cédric Le Goater
2023-09-01 9:41 ` [PULL 08/26] aspeed/smc: Wire CS lines at reset Cédric Le Goater
2023-09-01 9:41 ` [PULL 09/26] hw/ssi: Check for duplicate CS indexes Cédric Le Goater
2023-09-01 9:41 ` [PULL 10/26] aspeed: Create flash devices only when defaults are enabled Cédric Le Goater
2023-09-01 9:41 ` [PULL 11/26] m25p80: Introduce an helper to retrieve the BlockBackend of a device Cédric Le Goater
2023-09-01 9:42 ` [PULL 12/26] aspeed: Get the BlockBackend of FMC0 from the flash device Cédric Le Goater
2023-09-01 9:42 ` [PULL 13/26] hw/sd/sdcard: Return ILLEGAL for CMD19/CMD23 prior SD spec v3.01 Cédric Le Goater
2023-09-01 9:42 ` [PULL 14/26] hw/sd: When card is in wrong state, log which state it is Cédric Le Goater
2023-09-01 9:42 ` [PULL 15/26] hw/sd: When card is in wrong state, log which spec version is used Cédric Le Goater
2023-09-01 9:42 ` [PULL 16/26] hw/sd: Move proto_name to SDProto structure Cédric Le Goater
2023-09-01 9:42 ` [PULL 17/26] hw/sd: Introduce sd_cmd_handler type Cédric Le Goater
2023-09-01 9:42 ` [PULL 18/26] hw/sd: Add sd_cmd_illegal() handler Cédric Le Goater
2023-09-01 9:42 ` [PULL 19/26] hw/sd: Add sd_cmd_unimplemented() handler Cédric Le Goater
2023-09-01 9:42 ` [PULL 20/26] hw/sd: Add sd_cmd_GO_IDLE_STATE() handler Cédric Le Goater
2023-09-01 9:42 ` [PULL 21/26] hw/sd: Add sd_cmd_SEND_OP_CMD() handler Cédric Le Goater
2023-09-01 9:42 ` [PULL 22/26] hw/sd: Add sd_cmd_ALL_SEND_CID() handler Cédric Le Goater
2023-09-01 9:42 ` [PULL 23/26] hw/sd: Add sd_cmd_SEND_RELATIVE_ADDR() handler Cédric Le Goater
2023-09-01 9:42 ` [PULL 24/26] hw/sd: Add sd_cmd_SEND_TUNING_BLOCK() handler Cédric Le Goater
2023-09-01 9:42 ` [PULL 25/26] hw/sd: Add sd_cmd_SET_BLOCK_COUNT() handler Cédric Le Goater
2023-09-01 9:42 ` [PULL 26/26] hw/sd: Introduce a "sd-card" SPI variant model Cédric Le Goater
2023-09-06 18:24 ` [PULL 00/26] aspeed queue Stefan Hajnoczi
2023-09-08 7:09 ` Cédric Le Goater
2023-09-08 7:52 ` Michael Tokarev
2023-09-08 8:25 ` Cédric Le Goater
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).