[PATCH v48 00/12] hw/sd/sdcard: Add eMMC support

Philippe Mathieu-Daudé posted 12 patches 1 month, 4 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20240710141408.69275-1-philmd@linaro.org
Maintainers: "Philippe Mathieu-Daudé" <philmd@linaro.org>, Bin Meng <bmeng.cn@gmail.com>
include/hw/sd/sd.h |   3 +
hw/sd/sd.c         | 418 ++++++++++++++++++++++++++++++++++++++++++++-
hw/sd/trace-events |   3 +
3 files changed, 418 insertions(+), 6 deletions(-)
[PATCH v48 00/12] hw/sd/sdcard: Add eMMC support
Posted by Philippe Mathieu-Daudé 1 month, 4 weeks ago
Tag to test Aspeed tree:
  https://gitlab.com/philmd/qemu/-/tags/aspeed_emmc-v8

Since v43:
- Reordered and squashed commits (Cédric)

Since v42:
- Stick to spec v4.3 (re-simplified EXT_CSD register & migrate)
- Fill CID register
- Few changes to CSD register
- Implement 'boot-mode' reset timing
- Add 'boot-size' property

Cédric Le Goater (2):
  hw/sd/sdcard: Add emmc_cmd_SET_RELATIVE_ADDR handler (CMD3)
  hw/sd/sdcard: Fix SET_BLOCK_COUNT command argument on eMMC (CMD23)

Joel Stanley (1):
  hw/sd/sdcard: Support boot area in emmc image

Luc Michel (1):
  hw/sd/sdcard: Implement eMMC sleep state (CMD5)

Philippe Mathieu-Daudé (6):
  hw/sd/sdcard: Basis for eMMC support
  hw/sd/sdcard: Register generic command handlers
  hw/sd/sdcard: Register unimplemented command handlers
  hw/sd/sdcard: Add mmc_cmd_PROGRAM_CID handler (CMD26)
  hw/sd/sdcard: Add eMMC 'boot-size' property
  hw/sd/sdcard: Implement eMMC 'boot-mode'

Sai Pavan Boddu (1):
  hw/sd/sdcard: Add mmc SWITCH function support (CMD6)

Vincent Palatin (1):
  hw/sd/sdcard: Add emmc_cmd_SEND_EXT_CSD handler (CMD8)

 include/hw/sd/sd.h |   3 +
 hw/sd/sd.c         | 418 ++++++++++++++++++++++++++++++++++++++++++++-
 hw/sd/trace-events |   3 +
 3 files changed, 418 insertions(+), 6 deletions(-)

-- 
2.41.0


Re: [PATCH v48 00/12] hw/sd/sdcard: Add eMMC support
Posted by Cédric Le Goater 1 month, 4 weeks ago
Hello,

On 7/10/24 4:13 PM, Philippe Mathieu-Daudé wrote:
> Tag to test Aspeed tree:
>    https://gitlab.com/philmd/qemu/-/tags/aspeed_emmc-v8

I gave this branch a try and the rainier machine boots correctly with
a baked emmc image :

   Tested-by: Cédric Le Goater <clg@redhat.com>

However, I am seeing a *lot* of printf messages :

   sd_blk_read: read error on host side
   sd_blk_write: write error on host side

which were introduced by the initial implementation a1bb27b1e98a. This
doesn't occur with my tree though.

Thanks,

C.





> 
> Since v43:
> - Reordered and squashed commits (Cédric)
> 
> Since v42:
> - Stick to spec v4.3 (re-simplified EXT_CSD register & migrate)
> - Fill CID register
> - Few changes to CSD register
> - Implement 'boot-mode' reset timing
> - Add 'boot-size' property
> 
> Cédric Le Goater (2):
>    hw/sd/sdcard: Add emmc_cmd_SET_RELATIVE_ADDR handler (CMD3)
>    hw/sd/sdcard: Fix SET_BLOCK_COUNT command argument on eMMC (CMD23)
> 
> Joel Stanley (1):
>    hw/sd/sdcard: Support boot area in emmc image
> 
> Luc Michel (1):
>    hw/sd/sdcard: Implement eMMC sleep state (CMD5)
> 
> Philippe Mathieu-Daudé (6):
>    hw/sd/sdcard: Basis for eMMC support
>    hw/sd/sdcard: Register generic command handlers
>    hw/sd/sdcard: Register unimplemented command handlers
>    hw/sd/sdcard: Add mmc_cmd_PROGRAM_CID handler (CMD26)
>    hw/sd/sdcard: Add eMMC 'boot-size' property
>    hw/sd/sdcard: Implement eMMC 'boot-mode'
> 
> Sai Pavan Boddu (1):
>    hw/sd/sdcard: Add mmc SWITCH function support (CMD6)
> 
> Vincent Palatin (1):
>    hw/sd/sdcard: Add emmc_cmd_SEND_EXT_CSD handler (CMD8)
> 
>   include/hw/sd/sd.h |   3 +
>   hw/sd/sd.c         | 418 ++++++++++++++++++++++++++++++++++++++++++++-
>   hw/sd/trace-events |   3 +
>   3 files changed, 418 insertions(+), 6 deletions(-)
> 


Re: [PATCH v48 00/12] hw/sd/sdcard: Add eMMC support
Posted by Philippe Mathieu-Daudé 1 month, 4 weeks ago
On 11/7/24 13:03, Cédric Le Goater wrote:
> Hello,
> 
> On 7/10/24 4:13 PM, Philippe Mathieu-Daudé wrote:
>> Tag to test Aspeed tree:
>>    https://gitlab.com/philmd/qemu/-/tags/aspeed_emmc-v8
> 
> I gave this branch a try and the rainier machine boots correctly with
> a baked emmc image :
> 
>    Tested-by: Cédric Le Goater <clg@redhat.com>
> 
> However, I am seeing a *lot* of printf messages :
> 
>    sd_blk_read: read error on host side
>    sd_blk_write: write error on host side

Ah, I noticed that too but thought it was trace events, not
fprintf.

> which were introduced by the initial implementation a1bb27b1e98a. This
> doesn't occur with my tree though.

I'll have a look (my first thought was latent issue exposed).

Thanks!

Phil.


Re: [PATCH v48 00/12] hw/sd/sdcard: Add eMMC support
Posted by Cédric Le Goater 1 month, 4 weeks ago
On 7/10/24 4:13 PM, Philippe Mathieu-Daudé wrote:
> Tag to test Aspeed tree:
>    https://gitlab.com/philmd/qemu/-/tags/aspeed_emmc-v8
> 
> Since v43:
> - Reordered and squashed commits (Cédric)
> 
> Since v42:
> - Stick to spec v4.3 (re-simplified EXT_CSD register & migrate)
> - Fill CID register
> - Few changes to CSD register
> - Implement 'boot-mode' reset timing
> - Add 'boot-size' property
> 
> Cédric Le Goater (2):
>    hw/sd/sdcard: Add emmc_cmd_SET_RELATIVE_ADDR handler (CMD3)
>    hw/sd/sdcard: Fix SET_BLOCK_COUNT command argument on eMMC (CMD23)
> 
> Joel Stanley (1):
>    hw/sd/sdcard: Support boot area in emmc image
> 
> Luc Michel (1):
>    hw/sd/sdcard: Implement eMMC sleep state (CMD5)
> 
> Philippe Mathieu-Daudé (6):
>    hw/sd/sdcard: Basis for eMMC support
>    hw/sd/sdcard: Register generic command handlers
>    hw/sd/sdcard: Register unimplemented command handlers
>    hw/sd/sdcard: Add mmc_cmd_PROGRAM_CID handler (CMD26)
>    hw/sd/sdcard: Add eMMC 'boot-size' property
>    hw/sd/sdcard: Implement eMMC 'boot-mode'
> 
> Sai Pavan Boddu (1):
>    hw/sd/sdcard: Add mmc SWITCH function support (CMD6)
> 
> Vincent Palatin (1):
>    hw/sd/sdcard: Add emmc_cmd_SEND_EXT_CSD handler (CMD8)
> 
>   include/hw/sd/sd.h |   3 +
>   hw/sd/sd.c         | 418 ++++++++++++++++++++++++++++++++++++++++++++-
>   hw/sd/trace-events |   3 +
>   3 files changed, 418 insertions(+), 6 deletions(-)


Shall we merge now ?

Thanks,

C.




Re: [PATCH v48 00/12] hw/sd/sdcard: Add eMMC support
Posted by Philippe Mathieu-Daudé 1 month, 4 weeks ago
On 10/7/24 17:35, Cédric Le Goater wrote:
> On 7/10/24 4:13 PM, Philippe Mathieu-Daudé wrote:
>> Tag to test Aspeed tree:
>>    https://gitlab.com/philmd/qemu/-/tags/aspeed_emmc-v8
>>
>> Since v43:
>> - Reordered and squashed commits (Cédric)


>> Cédric Le Goater (2):
>>    hw/sd/sdcard: Add emmc_cmd_SET_RELATIVE_ADDR handler (CMD3)
>>    hw/sd/sdcard: Fix SET_BLOCK_COUNT command argument on eMMC (CMD23)
>>
>> Joel Stanley (1):
>>    hw/sd/sdcard: Support boot area in emmc image
>>
>> Luc Michel (1):
>>    hw/sd/sdcard: Implement eMMC sleep state (CMD5)
>>
>> Philippe Mathieu-Daudé (6):
>>    hw/sd/sdcard: Basis for eMMC support
>>    hw/sd/sdcard: Register generic command handlers
>>    hw/sd/sdcard: Register unimplemented command handlers
>>    hw/sd/sdcard: Add mmc_cmd_PROGRAM_CID handler (CMD26)
>>    hw/sd/sdcard: Add eMMC 'boot-size' property
>>    hw/sd/sdcard: Implement eMMC 'boot-mode'
>>
>> Sai Pavan Boddu (1):
>>    hw/sd/sdcard: Add mmc SWITCH function support (CMD6)
>>
>> Vincent Palatin (1):
>>    hw/sd/sdcard: Add emmc_cmd_SEND_EXT_CSD handler (CMD8)
>>
>>   include/hw/sd/sd.h |   3 +
>>   hw/sd/sd.c         | 418 ++++++++++++++++++++++++++++++++++++++++++++-
>>   hw/sd/trace-events |   3 +
>>   3 files changed, 418 insertions(+), 6 deletions(-)
> 
> 
> Shall we merge now ?

Are you OK with this patchset?


Re: [PATCH v48 00/12] hw/sd/sdcard: Add eMMC support
Posted by Cédric Le Goater 1 month, 4 weeks ago
On 7/10/24 6:57 PM, Philippe Mathieu-Daudé wrote:
> On 10/7/24 17:35, Cédric Le Goater wrote:
>> On 7/10/24 4:13 PM, Philippe Mathieu-Daudé wrote:
>>> Tag to test Aspeed tree:
>>>    https://gitlab.com/philmd/qemu/-/tags/aspeed_emmc-v8
>>>
>>> Since v43:
>>> - Reordered and squashed commits (Cédric)
> 
> 
>>> Cédric Le Goater (2):
>>>    hw/sd/sdcard: Add emmc_cmd_SET_RELATIVE_ADDR handler (CMD3)
>>>    hw/sd/sdcard: Fix SET_BLOCK_COUNT command argument on eMMC (CMD23)
>>>
>>> Joel Stanley (1):
>>>    hw/sd/sdcard: Support boot area in emmc image
>>>
>>> Luc Michel (1):
>>>    hw/sd/sdcard: Implement eMMC sleep state (CMD5)
>>>
>>> Philippe Mathieu-Daudé (6):
>>>    hw/sd/sdcard: Basis for eMMC support
>>>    hw/sd/sdcard: Register generic command handlers
>>>    hw/sd/sdcard: Register unimplemented command handlers
>>>    hw/sd/sdcard: Add mmc_cmd_PROGRAM_CID handler (CMD26)
>>>    hw/sd/sdcard: Add eMMC 'boot-size' property
>>>    hw/sd/sdcard: Implement eMMC 'boot-mode'
>>>
>>> Sai Pavan Boddu (1):
>>>    hw/sd/sdcard: Add mmc SWITCH function support (CMD6)
>>>
>>> Vincent Palatin (1):
>>>    hw/sd/sdcard: Add emmc_cmd_SEND_EXT_CSD handler (CMD8)
>>>
>>>   include/hw/sd/sd.h |   3 +
>>>   hw/sd/sd.c         | 418 ++++++++++++++++++++++++++++++++++++++++++++-
>>>   hw/sd/trace-events |   3 +
>>>   3 files changed, 418 insertions(+), 6 deletions(-)
>>
>>
>> Shall we merge now ?
> 
> Are you OK with this patchset?
> 

Sure. let's move forward. I'll adapt the 6/7 patches for aspeed and
resend, possibly this week.


Thanks,

C.