!
While being at it drop a leftover FIXME.
Resolves: #2343
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2343
I suppose we also need:
Cc: qemu-sta...@nongnu.org
Reviewed-by: Philippe Mathieu-Daudé
Fixes: fcc79f2e0955 ("hw/pflash: implement update buffer for block writes")
Sig
est.c | 23 +++
1 file changed, 23 insertions(+)
Reviewed-by: Philippe Mathieu-Daudé
Michael, Konstantin, QERR_UNSUPPORTED is only used by QGA.
Do you mind giving our maintainer's position on Markus
analysis so we can know how to proceed with this definition?
Regards,
Phil.
On 5/10/23 13:22, Markus Armbruster wrote:
Philippe Mathieu-Daudé writes:
Address the comment
On 12/6/24 15:07, Markus Armbruster wrote:
Philippe Mathieu-Daudé writes:
Michael, Konstantin, QERR_UNSUPPORTED is only used by QGA.
Do you mind giving our maintainer's position on Markus
analysis so we can know how to proceed with this definition?
Daniel Berrangé recently posted pa
anged, 3 insertions(+), 5 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé
Hi Zheyu,
On 18/6/24 17:23, Zheyu Ma wrote:
This patch fixes a heap-buffer-overflow issue in the flash_erase function
of the m25p80 flash memory emulation. The overflow occurs when the
combination of offset and length exceeds the allocated memory for the
storage. The patch adds a check to ensure
->flags & capa_to_assert) != capa_to_assert) {
regards,
Zheyu
On Tue, Jun 18, 2024 at 5:35 PM Philippe Mathieu-Daudé
mailto:phi...@linaro.org>> wrote:
Hi Zheyu,
On 18/6/24 17:23, Zheyu Ma wrote:
> This patch fixes a heap-buffer-overflow issue in the flash_erase
function
On 8/4/24 16:17, Philippe Mathieu-Daudé wrote:
Since this is Fix day, I went over this old bug:
https://gitlab.com/qemu-project/qemu/-/issues/487
It happens to be a QEMU implementation detail not
really related to the spec.
Philippe Mathieu-Daudé (2):
hw/sd/sdcard: Avoid OOB in sd_read_byte
There is no SEND_OP_CMD but SEND_OP_COND.
Signed-off-by: Philippe Mathieu-Daudé
---
hw/sd/sd.c | 6 +++---
hw/sd/sdmmc-internal.c | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index addeb1940f..331cef5779 100644
--- a/hw/sd/sd.c
+++ b
Various SD card cleanups and fixes accumulated over
the years. Various have been useful to help integrating
eMMC support (which will come later).
Based-on: <20240621075607.17902-1-phi...@linaro.org> st24_be_p()
Philippe Mathieu-Daudé (23):
hw/sd/sdcard: Correct code indentation
hw/sd/
Keep this handler style in sync with other handlers by
using a switch() case, which might become handy to
handle other states.
Signed-off-by: Philippe Mathieu-Daudé
---
hw/sd/sd.c | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index
Rather than using the obscure 0x4567 magic value,
use a real random one.
Signed-off-by: Philippe Mathieu-Daudé
---
hw/sd/sd.c | 8 ++--
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 30239b28bc..e1f13e316a 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
There is no ACMD6 command in SPI mode, remove the pointless
handler introduced in commit 946897ce18 ("sdcard: handles
more commands in SPI mode"). Keep sd_cmd_unimplemented()
since we'll reuse it later.
Signed-off-by: Philippe Mathieu-Daudé
---
hw/sd/sd.c | 2 +-
1 file chang
It will be useful later to assert only AC commands
(Addressed point-to-point Commands, defined as the
'sd_ac' enum) extract the RCA value from the command
argument.
Signed-off-by: Philippe Mathieu-Daudé
---
hw/sd/sd.c | 8 +++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff
Use registerfield-generated definitions to update card_status.
Signed-off-by: Philippe Mathieu-Daudé
---
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 c528c30bcf..24415cb9f0 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -1788,8
Signed-off-by: Philippe Mathieu-Daudé
---
hw/sd/sd.c | 1 +
hw/sd/trace-events | 3 ++-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 4e378f7cf7..2586d15cbd 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -1087,6 +1087,7 @@ static sd_rsp_type_t
e DAT handlers. This
fixes a bug that all normal commands were displayed
as APP commands.
Fixes: 2ed61fb57b ("sdcard: Display command name when tracing CMD/ACMD")
Signed-off-by: Philippe Mathieu-Daudé
---
hw/sd/sd.c | 12
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git
It will be useful later to assert only ADTC commands
(Addressed point-to-point Data Transfer Commands, defined
as the 'sd_adtc' enum) extract the address value from the
command argument.
Signed-off-by: Philippe Mathieu-Daudé
---
hw/sd/sd.c | 14 --
1 file changed, 8 insert
Useful to detect out of bound accesses.
Signed-off-by: Philippe Mathieu-Daudé
---
hw/sd/sd.c | 4 ++--
hw/sd/trace-events | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 2586d15cbd..c6cc1bab11 100644
--- a/hw/sd/sd.c
+++ b/hw/sd
The ld/st API helps noticing CID or CSD bytes refer
to the same field. Multi-bytes fields are stored MSB
first in CID / CSD.
Signed-off-by: Philippe Mathieu-Daudé
---
hw/sd/sd.c | 9 ++---
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 24415cb9f0
be stored overwriting data block
on underlying storage drive. Keep it in a dedicated
'vendor_data[]' array.
Signed-off-by: Philippe Mathieu-Daudé
---
RFC: Is it safe to reuse VMSTATE_UNUSED_V() (which happens
to be the same size)?
Cc: Peter Xu
Cc: Fabiano Rosas
---
hw/sd/sd.c | 17
NULL handler is already handled as illegal, no need to
duplicate (that keeps this array simpler to maintain).
Signed-off-by: Philippe Mathieu-Daudé
---
hw/sd/sd.c | 11 ---
1 file changed, 11 deletions(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index e9af834a8c..30239b28bc 100644
--- a/hw
These macros only save 3 chars and make the code harder
to maintain, simply remove them.
Signed-off-by: Philippe Mathieu-Daudé
---
hw/sd/sd.c | 15 +++
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 8d63a39a54..ca2c903c5b 100644
--- a/hw
From: Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé
---
hw/sd/sd.c | 20
1 file changed, 20 insertions(+)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index ca2c903c5b..95e23abd30 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
Having the mode switch displayed help to track incomplete
command implementations.
Signed-off-by: Philippe Mathieu-Daudé
---
hw/sd/sd.c | 75 +-
1 file changed, 41 insertions(+), 34 deletions(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index
Fix mis-alignment from commits 793d04f495 and 6380cd2052
("Add sd_cmd_SEND_TUNING_BLOCK" and "Add sd_cmd_SET_BLOCK_COUNT").
Signed-off-by: Philippe Mathieu-Daudé
---
hw/sd/sd.c | 34 +-
1 file changed, 17 insertions(+), 17 deletions(-)
diff
Extract sd_req_get_rca() so we can re-use it in various
SDProto handlers. Return a 16-bit value since RCA is 16-bit.
Signed-off-by: Philippe Mathieu-Daudé
---
hw/sd/sd.c | 15 +--
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 510784fc82
Extract sd_cmd_get_address() so we can re-use it
in various SDProto handlers. Use CARD_CAPACITY and
HWBLOCK_SHIFT definitions instead of magic values.
Signed-off-by: Philippe Mathieu-Daudé
---
hw/sd/sd.c | 10 +-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/hw/sd/sd.c b
Per sections 3.6.1 (SD Bus Protocol) and 7.3.2 (Responses):
In the CMD line the Most Significant Bit is transmitted first.
Use the stl_be_p() helper to store the value in big-endian.
Signed-off-by: Philippe Mathieu-Daudé
---
RFC because I'm surprised this has been unnoticed for 17
Per sections 3.6.1 (SD Bus Protocol), 4.3.4 "Data Write"
and 7.3.2 (Responses):
In the CMD line the Most Significant Bit is transmitted first.
Use the stl_be_p() helper to store the value in big-endian.
Signed-off-by: Philippe Mathieu-Daudé
---
RFC because I'm surprise
Signed-off-by: Philippe Mathieu-Daudé
---
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 c6cc1bab11..510784fc82 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -1716,7 +1716,7 @@ static sd_rsp_type_t sd_app_command(SDState *sd
From: Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé
---
hw/sd/sd.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 331cef5779..c528c30bcf 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
On 21/6/24 10:05, Philippe Mathieu-Daudé wrote:
Rather than using the obscure 0x4567 magic value,
use a real random one.
Signed-off-by: Philippe Mathieu-Daudé
---
hw/sd/sd.c | 8 ++--
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 30239b28bc
On 21/6/24 10:05, Philippe Mathieu-Daudé wrote:
Various SD card cleanups and fixes accumulated over
the years. Various have been useful to help integrating
eMMC support (which will come later).
Based-on: <20240621075607.17902-1-phi...@linaro.org> st24_be_p()
Philippe Mathieu-Daudé (23):
Rather than using the obscure 0x4567 magic value,
use a real random one.
Signed-off-by: Philippe Mathieu-Daudé
Tested-by: Cédric Le Goater
---
hw/sd/sd.c | 8 ++--
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index a48010cfc1..ec58c5e2a6 100644
:
(ret == len)
Bail out!
See
https://lore.kernel.org/qemu-devel/37f83be9-deb5-42a1-b704-14984351d...@linaro.org/
Signed-off-by: Philippe Mathieu-Daudé
---
Cc: Hao Wu
Cc: Shengtan Mao
Cc: Tyrone Ting
---
tests/qtest/npcm7xx_sdhci-test.c | 7 +++
1 file changed, 7 insertions(+)
diff --git
Since v1:
- various patches merged, few more added
Various SD card cleanups and fixes accumulated over
the years. Various have been useful to help integrating
eMMC support (which will come later).
Philippe Mathieu-Daudé (12):
tests/qtest: Disable npcm7xx_sdhci tests using hardcoded RCA
hw/sd
be stored overwriting data block
on underlying storage drive. Keep it in a dedicated
'vendor_data[]' array.
Signed-off-by: Philippe Mathieu-Daudé
Tested-by: Cédric Le Goater
---
RFC: Is it safe to reuse VMSTATE_UNUSED_V() (which happens
to be the same size)?
Cc: Peter Xu
Cc: Fabiano Ro
SWITCH_FUNCTION is only allowed in TRANSFER state
(See 4.8 "Card State Transition Table).
Signed-off-by: Philippe Mathieu-Daudé
---
hw/sd/sd.c | 4
1 file changed, 4 insertions(+)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index fce99d655d..3b885ba8a0 100644
--- a/hw/sd/sd.c
+++ b/hw/sd
e DAT handlers. This
fixes a bug that all normal commands were displayed
as APP commands.
Fixes: 2ed61fb57b ("sdcard: Display command name when tracing CMD/ACMD")
Signed-off-by: Philippe Mathieu-Daudé
Tested-by: Cédric Le Goater
---
hw/sd/sd.c | 12
1 file changed, 8 insertions(
Per sections 3.6.1 (SD Bus Protocol), 4.3.4 "Data Write"
and 7.3.2 (Responses):
In the CMD line the Most Significant Bit is transmitted first.
Use the stl_be_p() helper to store the value in big-endian.
Signed-off-by: Philippe Mathieu-Daudé
Tested-by: Cédric Le Goater
---
RFC b
Signed-off-by: Philippe Mathieu-Daudé
---
hw/sd/sd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 0742ba8b38..8816bd6671 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -557,7 +557,7 @@ FIELD(CSR, OUT_OF_RANGE, 31, 1)
static void
Keep direct reference to SDProto in SDState,
remove then unnecessary sd_proto().
Signed-off-by: Philippe Mathieu-Daudé
---
hw/sd/sd.c | 37 +
1 file changed, 17 insertions(+), 20 deletions(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 3b885ba8a0..6685fba4bb
Useful to detect out of bound accesses.
Signed-off-by: Philippe Mathieu-Daudé
Tested-by: Cédric Le Goater
---
hw/sd/sd.c | 4 ++--
hw/sd/trace-events | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 14bfcc5d6b..e4587a0a37 100644
SDCardStates enum values are specified, so assign them
correspondingly. It will be useful later when we add
states from later specs, which might not be continuous.
See CURRENT_STATE bits in section 4.10.1 "Card Status".
Signed-off-by: Philippe Mathieu-Daudé
---
hw/sd
Per sections 3.6.1 (SD Bus Protocol) and 7.3.2 (Responses):
In the CMD line the Most Significant Bit is transmitted first.
Use the stl_be_p() helper to store the value in big-endian.
Signed-off-by: Philippe Mathieu-Daudé
Tested-by: Cédric Le Goater
---
RFC because I'm surprised thi
Card entering sd_inactive_state powers off, and won't respond
anymore. Handle that once when entering sd_do_command().
Remove condition always true in sd_cmd_GO_IDLE_STATE().
Signed-off-by: Philippe Mathieu-Daudé
---
hw/sd/sd.c | 12 +++-
1 file changed, 7 insertions(+), 5 dele
Consolitate reading bytes on the DAT lines by introducing
a pair of helpers to reuse in all commands sending data.
Based-on: <20240625055354.23273-1-phi...@linaro.org>
Philippe Mathieu-Daudé (11):
hw/sd/sdcard: Introduce sd_cmd_to_sendingdata and sd_generic_read_byte
hw/sd/sdcard: C
Signed-off-by: Philippe Mathieu-Daudé
---
hw/sd/sd.c | 11 ++-
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 89006ba1b6..0011aa86da 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -1220,10 +1220,7 @@ static sd_rsp_type_t sd_normal_command(SDState
Signed-off-by: Philippe Mathieu-Daudé
---
hw/sd/sd.c | 24 ++--
1 file changed, 6 insertions(+), 18 deletions(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 0011aa86da..346bd657a7 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -1290,11 +1290,8 @@ static sd_rsp_type_t
lines to fetch the data.
Signed-off-by: Philippe Mathieu-Daudé
---
hw/sd/sd.c | 38 ++
1 file changed, 38 insertions(+)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 6685fba4bb..89006ba1b6 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -142,8 +142,10 @@ struct SDState
In order to modify the READ_SINGLE_BLOCK case in the
next commit, duplicate it first.
Signed-off-by: Philippe Mathieu-Daudé
---
hw/sd/sd.c | 18 ++
1 file changed, 18 insertions(+)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 346bd657a7..9aaa78a334 100644
--- a/hw/sd/sd.c
+++ b
Signed-off-by: Philippe Mathieu-Daudé
---
hw/sd/sd.c | 48 +++-
1 file changed, 19 insertions(+), 29 deletions(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 6af7b3f034..3d341495e9 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -562,6 +562,21 @@ static
Signed-off-by: Philippe Mathieu-Daudé
---
hw/sd/sd.c | 15 ---
1 file changed, 4 insertions(+), 11 deletions(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index bf78f06b5c..2f00184bb3 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -1681,10 +1681,9 @@ static sd_rsp_type_t sd_app_command
Signed-off-by: Philippe Mathieu-Daudé
---
hw/sd/sd.c | 17 -
1 file changed, 4 insertions(+), 13 deletions(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 3d341495e9..6e6b37bd2d 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -1180,6 +1180,7 @@ static sd_rsp_type_t sd_normal_command
Signed-off-by: Philippe Mathieu-Daudé
---
hw/sd/sd.c | 19 +++
1 file changed, 7 insertions(+), 12 deletions(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 6e6b37bd2d..bf78f06b5c 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -1626,10 +1626,12 @@ static sd_rsp_type_t
Signed-off-by: Philippe Mathieu-Daudé
---
hw/sd/sd.c | 13 ++---
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 023fcc63ac..af3a46373f 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -1763,10 +1763,7 @@ static sd_rsp_type_t sd_app_command(SDState
Signed-off-by: Philippe Mathieu-Daudé
---
hw/sd/sd.c | 16
1 file changed, 4 insertions(+), 12 deletions(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 2f00184bb3..023fcc63ac 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -1693,11 +1693,9 @@ static sd_rsp_type_t sd_app_command
Signed-off-by: Philippe Mathieu-Daudé
---
hw/sd/sd.c | 18 +++---
1 file changed, 3 insertions(+), 15 deletions(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 9aaa78a334..6af7b3f034 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -1383,11 +1383,8 @@ static sd_rsp_type_t sd_normal_command
On 25/6/24 08:10, Philippe Mathieu-Daudé wrote:
Signed-off-by: Philippe Mathieu-Daudé
---
hw/sd/sd.c | 11 ++-
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 89006ba1b6..0011aa86da 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -1220,10
Consolitate writing bytes on the DAT lines by introducing
a pair of helpers to reuse in all commands receiving data.
Based-on: <20240625061015.24095-1-phi...@linaro.org>
Philippe Mathieu-Daudé (7):
hw/sd/sdcard: Introduce sd_cmd_to_receivingdata /
sd_generic_write_byte
hw/sd/
Signed-off-by: Philippe Mathieu-Daudé
---
hw/sd/sd.c | 15 ++-
1 file changed, 2 insertions(+), 13 deletions(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index fff4be3ae2..9db3b32b0b 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -1491,17 +1491,7 @@ static sd_rsp_type_t sd_normal_command
,
- sd_generic_write_byte() on the DAT lines to push the data.
Signed-off-by: Philippe Mathieu-Daudé
---
hw/sd/sd.c | 28
1 file changed, 28 insertions(+)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 2df3c28cb7..7fea0afb62 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -1081,6 +1081,21
Signed-off-by: Philippe Mathieu-Daudé
---
hw/sd/sd.c | 15 ++-
1 file changed, 2 insertions(+), 13 deletions(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index b0f29034c0..82b44b65e0 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -1604,17 +1604,7 @@ static sd_rsp_type_t sd_normal_command
Signed-off-by: Philippe Mathieu-Daudé
---
hw/sd/sd.c | 9 +++--
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 82b44b65e0..fe2210d65a 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -1633,14 +1633,12 @@ static sd_rsp_type_t sd_normal_command(SDState
Signed-off-by: Philippe Mathieu-Daudé
---
hw/sd/sd.c | 15 ++-
1 file changed, 2 insertions(+), 13 deletions(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 9db3b32b0b..b0f29034c0 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -1494,17 +1494,7 @@ static sd_rsp_type_t sd_normal_command
In order to modify the WRITE_SINGLE_BLOCK case in the
next commit, duplicate it first.
Signed-off-by: Philippe Mathieu-Daudé
---
hw/sd/sd.c | 29 +
1 file changed, 29 insertions(+)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 7fea0afb62..8c30826754 100644
--- a/hw/sd
Signed-off-by: Philippe Mathieu-Daudé
---
hw/sd/sd.c | 11 ++-
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 8c30826754..fff4be3ae2 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -1081,7 +1081,6 @@ static sd_rsp_type_t sd_cmd_unimplemented
On 26/6/24 13:06, Akihiko Odaki wrote:
This suppresses LeakSanitizer warnings.
Signed-off-by: Akihiko Odaki
---
hw/ppc/spapr_vof.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Philippe Mathieu-Daudé
On 26/6/24 13:06, Akihiko Odaki wrote:
FDT properties are aligned by 4 bytes, not 8 bytes.
Signed-off-by: Akihiko Odaki
---
hw/ppc/vof.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/ppc/vof.c b/hw/ppc/vof.c
index e3b430a81f4f..b5b6514d79fc 100644
--- a/hw/ppc/vof.c
On 26/6/24 13:06, Akihiko Odaki wrote:
This suppresses LeakSanitizer warnings.
Signed-off-by: Akihiko Odaki
---
hw/core/cpu-common.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c
index 0f0a247f5642..42f38b01a97f 100644
--- a/hw/core/cpu-co
Recent SDHCI expect cards to support the v3.01 spec
to negociate lower I/O voltage. Select it by default.
Signed-off-by: Philippe Mathieu-Daudé
---
hw/sd/sd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index a48010cfc1..d0a1d5db18 100644
--- a/hw
Deprecate SD spec v1.10, use v3.01 as new default.
Philippe Mathieu-Daudé (3):
hw/sd/sdcard: Deprecate support for spec v1.10
hw/sd/sdcard: Use spec v3.01 by default
hw/sd/sdcard: Remove support for spec v1.10
docs/about/removed-features.rst | 5 +
include/hw/sd/sd.h
Support for spec v1.10 was deprecated in QEMU v9.1.
Signed-off-by: Philippe Mathieu-Daudé
---
docs/about/deprecated.rst | 6 --
docs/about/removed-features.rst | 5 +
include/hw/sd/sd.h | 1 -
hw/sd/sd.c | 12 ++--
4 files changed, 7
We use the v2.00 spec by default since commit 2f0939c234
("sdcard: Add a 'spec_version' property, default to Spec v2.00").
Time to deprecate the v1.10 which doesn't bring much, and
is not tested.
Signed-off-by: Philippe Mathieu-Daudé
---
docs/about/deprecated.rst | 6
On 27/6/24 15:12, Akihiko Odaki wrote:
On 2024/06/26 21:03, Philippe Mathieu-Daudé wrote:
On 26/6/24 13:06, Akihiko Odaki wrote:
FDT properties are aligned by 4 bytes, not 8 bytes.
Signed-off-by: Akihiko Odaki
---
hw/ppc/vof.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff
://gitlab.com/philmd/qemu/-/tags/emmc-v4
Cédric Le Goater (1):
hw/sd/sdcard: Introduce definitions for EXT_CSD register
Philippe Mathieu-Daudé (16):
hw/sd/sdcard: Deprecate support for spec v1.10
hw/sd/sdcard: Use spec v3.01 by default
hw/sd/sdcard: Track last command used to help logging
Recent SDHCI expect cards to support the v3.01 spec
to negociate lower I/O voltage. Select it by default.
Signed-off-by: Philippe Mathieu-Daudé
Reviewed-by: Cédric Le Goater
---
hw/sd/sd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index
We use the v2.00 spec by default since commit 2f0939c234
("sdcard: Add a 'spec_version' property, default to Spec v2.00").
Time to deprecate the v1.10 which doesn't bring much, and
is not tested.
Signed-off-by: Philippe Mathieu-Daudé
Reviewed-by: Cédric Le Goater
---
Useful to detect out of bound accesses.
Signed-off-by: Philippe Mathieu-Daudé
Tested-by: Cédric Le Goater
---
hw/sd/sd.c | 4 ++--
hw/sd/trace-events | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index bc87807793..090a6fdcdb 100644
e DAT handlers. This
fixes a bug that all normal commands were displayed
as APP commands.
Fixes: 2ed61fb57b ("sdcard: Display command name when tracing CMD/ACMD")
Signed-off-by: Philippe Mathieu-Daudé
Tested-by: Cédric Le Goater
---
hw/sd/sd.c | 12
1 file changed, 8 insertions(
be stored overwriting data block
on underlying storage drive. Keep it in a dedicated
'vendor_data[]' array.
Signed-off-by: Philippe Mathieu-Daudé
Tested-by: Cédric Le Goater
---
RFC: Is it safe to reuse VMSTATE_UNUSED_V() (which happens
to be the same size)?
Cc: Peter Xu
Cc: Fabiano Ro
Signed-off-by: Philippe Mathieu-Daudé
---
hw/sd/sd.c | 9 +++--
hw/sd/trace-events | 1 +
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 090a6fdcdb..464576751a 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -608,10 +608,15 @@ static void
Per sections 3.6.1 (SD Bus Protocol), 4.3.4 "Data Write"
and 7.3.2 (Responses):
In the CMD line the Most Significant Bit is transmitted first.
Use the stl_be_p() helper to store the value in big-endian.
Signed-off-by: Philippe Mathieu-Daudé
Tested-by: Cédric Le Goater
---
RFC b
Signed-off-by: Philippe Mathieu-Daudé
Tested-by: Cédric Le Goater
---
hw/sd/sd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 1f37d9c93a..135b7d2e23 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -561,7 +561,7 @@ FIELD(CSR, OUT_OF_RANGE
Per sections 3.6.1 (SD Bus Protocol) and 7.3.2 (Responses):
In the CMD line the Most Significant Bit is transmitted first.
Use the stl_be_p() helper to store the value in big-endian.
Signed-off-by: Philippe Mathieu-Daudé
Tested-by: Cédric Le Goater
---
RFC because I'm surprised thi
SDCardStates enum values are specified, so assign them
correspondingly. It will be useful later when we add
states from later specs, which might not be continuous.
See CURRENT_STATE bits in section 4.10.1 "Card Status".
Signed-off-by: Philippe Mathieu-Daudé
Tested-by: Cédric Le Goate
Card entering sd_inactive_state powers off, and won't respond
anymore. Handle that once when entering sd_do_command().
Remove condition always true in sd_cmd_GO_IDLE_STATE().
Signed-off-by: Philippe Mathieu-Daudé
Tested-by: Cédric Le Goater
---
hw/sd/sd.c | 12 +++-
1 file chang
SWITCH_FUNCTION is only allowed in TRANSFER state
(See 4.8 "Card State Transition Table).
Signed-off-by: Philippe Mathieu-Daudé
Tested-by: Cédric Le Goater
---
hw/sd/sd.c | 4
1 file changed, 4 insertions(+)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 7533a78cf6..8f441e418c 100644
Keep direct reference to SDProto in SDState,
remove then unnecessary sd_proto().
Signed-off-by: Philippe Mathieu-Daudé
Tested-by: Cédric Le Goater
---
hw/sd/sd.c | 37 +
1 file changed, 17 insertions(+), 20 deletions(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
From: Philippe Mathieu-Daudé
Extract sd_blk_len() helper, use definitions instead
of magic values.
Signed-off-by: Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé
---
hw/sd/sd.c | 10 +-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
Rather than using the obscure 0x4567 magic value,
use a real random one.
Signed-off-by: Philippe Mathieu-Daudé
Tested-by: Cédric Le Goater
---
hw/sd/sd.c | 11 ---
hw/sd/trace-events | 1 +
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
:
(ret == len)
Bail out!
See
https://lore.kernel.org/qemu-devel/37f83be9-deb5-42a1-b704-14984351d...@linaro.org/
Signed-off-by: Philippe Mathieu-Daudé
---
Cc: Hao Wu
Cc: Shengtan Mao
Cc: Tyrone Ting
---
tests/qtest/npcm7xx_sdhci-test.c | 7 +++
1 file changed, 7 insertions(+)
diff --git
From: Cédric Le Goater
Signed-off-by: Cédric Le Goater
Signed-off-by: Cédric Le Goater
Signed-off-by: Philippe Mathieu-Daudé
---
hw/sd/sdmmc-internal.h | 97 ++
1 file changed, 97 insertions(+)
diff --git a/hw/sd/sdmmc-internal.h b/hw/sd/sdmmc
Consolitate reading bytes on the DAT lines by introducing
a pair of helpers to reuse in all commands sending data.
Full series for testing:
https://gitlab.com/philmd/qemu/-/tags/emmc-v4
Based-on: <20240627162232.80428-1-phi...@linaro.org>
Philippe Mathieu-Daudé (11):
hw/sd/sdcard: Int
Signed-off-by: Philippe Mathieu-Daudé
---
hw/sd/sd.c | 24 ++--
1 file changed, 6 insertions(+), 18 deletions(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index f7735c39a8..8201f3245c 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -1312,11 +1312,8 @@ static sd_rsp_type_t
lines to fetch the data.
Signed-off-by: Philippe Mathieu-Daudé
---
hw/sd/sd.c | 39 +++
1 file changed, 39 insertions(+)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index d85b2906f4..1a8d06804d 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -142,8 +142,10 @@ struct SDState
Signed-off-by: Philippe Mathieu-Daudé
---
hw/sd/sd.c | 12 ++--
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 1a8d06804d..f7735c39a8 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -1086,7 +1086,6 @@ static sd_rsp_type_t sd_cmd_unimplemented
In order to modify the READ_SINGLE_BLOCK case in the
next commit, duplicate it first.
Signed-off-by: Philippe Mathieu-Daudé
---
hw/sd/sd.c | 18 ++
1 file changed, 18 insertions(+)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 8201f3245c..dfcb213aa9 100644
--- a/hw/sd/sd.c
+++ b
Signed-off-by: Philippe Mathieu-Daudé
---
hw/sd/sd.c | 18 +++---
1 file changed, 3 insertions(+), 15 deletions(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index dfcb213aa9..605269163d 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -1405,11 +1405,8 @@ static sd_rsp_type_t sd_normal_command
1 - 100 of 6121 matches
Mail list logo