qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/2] hw/sd: Deprecate the SPI mode and the SPI to SD adapter
@ 2020-07-05 22:07 Philippe Mathieu-Daudé
  2020-07-05 22:07 ` [RFC PATCH 1/2] hw/sd/ssi-sd: Deprecate the SPI to SD card 'adapter' Philippe Mathieu-Daudé
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-05 22:07 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Thomas Huth, Alistair Francis,
	Philippe Mathieu-Daudé,
	libvir-list, qemu-arm

I tried to maintain the SPI mode because it is useful in
tiny embedded devices, and thought it would be helpful for
the AVR MCUs.
As AVR was blocked, I thought it was wise to deprecate the
SPI mode as users are interested in the faster MMC mode.
Today Thomas surprised me by posting an update of it!
https://www.mail-archive.com/qemu-devel@nongnu.org/msg720089.html

I'm still posting this as RFC to discuss, but I'm reconsiderating
keeping this mode a bit more.

Philippe Mathieu-Daudé (2):
  hw/sd/ssi-sd: Deprecate the SPI to SD card 'adapter'
  hw/sd/sdcard: Deprecate the SPI mode

 docs/system/deprecated.rst | 10 ++++++++++
 1 file changed, 10 insertions(+)

-- 
2.21.3



^ permalink raw reply	[flat|nested] 10+ messages in thread

* [RFC PATCH 1/2] hw/sd/ssi-sd: Deprecate the SPI to SD card 'adapter'
  2020-07-05 22:07 [RFC PATCH 0/2] hw/sd: Deprecate the SPI mode and the SPI to SD adapter Philippe Mathieu-Daudé
@ 2020-07-05 22:07 ` Philippe Mathieu-Daudé
  2020-07-06 17:27   ` Eric Blake
  2020-07-07  6:47   ` Peter Krempa
  2020-07-05 22:07 ` [RFC PATCH 2/2] hw/sd/sdcard: Deprecate the SPI mode Philippe Mathieu-Daudé
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 10+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-05 22:07 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Thomas Huth, Alistair Francis,
	Philippe Mathieu-Daudé,
	libvir-list, qemu-arm

This device duplicate the SPI mode of the sd-card device. The
SPI protocol is better handler in the sd-card, however as the
TYPE_SSI_SLAVE is not an interface, the sd-card can not implement
it easily to be pluggable on a SPI bus. Meanwhile the ssi-sd
device acts as a bridge, but is bitroting. Deprecate it.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 docs/system/deprecated.rst | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst
index 47f84be8e0..5e67d7f3e0 100644
--- a/docs/system/deprecated.rst
+++ b/docs/system/deprecated.rst
@@ -343,6 +343,11 @@ The 'ide-drive' device is deprecated. Users should use 'ide-hd' or
 The 'scsi-disk' device is deprecated. Users should use 'scsi-hd' or
 'scsi-cd' as appropriate to get a SCSI hard disk or CD-ROM as needed.
 
+``ssi-sd`` (since 5.1)
+'''''''''''''''''''''''''
+
+The 'ssi-sd' (SSI to SD card adapter) device is deprecated.
+
 System emulator machines
 ------------------------
 
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [RFC PATCH 2/2] hw/sd/sdcard: Deprecate the SPI mode
  2020-07-05 22:07 [RFC PATCH 0/2] hw/sd: Deprecate the SPI mode and the SPI to SD adapter Philippe Mathieu-Daudé
  2020-07-05 22:07 ` [RFC PATCH 1/2] hw/sd/ssi-sd: Deprecate the SPI to SD card 'adapter' Philippe Mathieu-Daudé
@ 2020-07-05 22:07 ` Philippe Mathieu-Daudé
  2020-07-07  6:49   ` Peter Krempa
  2020-07-06 16:41 ` [RFC PATCH 0/2] hw/sd: Deprecate the SPI mode and the SPI to SD adapter Alistair Francis
  2020-07-10  9:27 ` Bin Meng
  3 siblings, 1 reply; 10+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-05 22:07 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Thomas Huth, Alistair Francis,
	Philippe Mathieu-Daudé,
	libvir-list, qemu-arm

SD cards be used with SPI, SD or MMC protocol.

Unfortunately, maintaining the SPI protocol make improving the
MMC mode very difficult. As of 2020 users are more interested
in using cards with the MMC protocol.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 docs/system/deprecated.rst | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst
index 5e67d7f3e0..01dca3d038 100644
--- a/docs/system/deprecated.rst
+++ b/docs/system/deprecated.rst
@@ -384,6 +384,11 @@ full SCSI support.  Use virtio-scsi instead when SCSI passthrough is required.
 Note this also applies to ``-device virtio-blk-pci,scsi=on|off``, which is an
 alias.
 
+``-device sd-card,spi=on`` (since 5.1)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The SPI mode of the 'sd-card' device is deprecated.
+
 Block device options
 ''''''''''''''''''''
 
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [RFC PATCH 0/2] hw/sd: Deprecate the SPI mode and the SPI to SD adapter
  2020-07-05 22:07 [RFC PATCH 0/2] hw/sd: Deprecate the SPI mode and the SPI to SD adapter Philippe Mathieu-Daudé
  2020-07-05 22:07 ` [RFC PATCH 1/2] hw/sd/ssi-sd: Deprecate the SPI to SD card 'adapter' Philippe Mathieu-Daudé
  2020-07-05 22:07 ` [RFC PATCH 2/2] hw/sd/sdcard: Deprecate the SPI mode Philippe Mathieu-Daudé
@ 2020-07-06 16:41 ` Alistair Francis
  2020-07-06 17:37   ` Philippe Mathieu-Daudé
  2020-07-10  9:27 ` Bin Meng
  3 siblings, 1 reply; 10+ messages in thread
From: Alistair Francis @ 2020-07-06 16:41 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Peter Maydell, Thomas Huth, Alistair Francis,
	qemu-devel@nongnu.org Developers, libvir-list, qemu-arm

On Sun, Jul 5, 2020 at 3:08 PM Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>
> I tried to maintain the SPI mode because it is useful in
> tiny embedded devices, and thought it would be helpful for
> the AVR MCUs.
> As AVR was blocked, I thought it was wise to deprecate the
> SPI mode as users are interested in the faster MMC mode.
> Today Thomas surprised me by posting an update of it!
> https://www.mail-archive.com/qemu-devel@nongnu.org/msg720089.html
>
> I'm still posting this as RFC to discuss, but I'm reconsiderating
> keeping this mode a bit more.

I think it's worth keeping.

I'm pretty sure the HiFive Unleashed (sifive_u in QEMU) uses SD over
SPI. There isn't an upstream model but I think there are out of tree
patches that hopefully one day will make it upstream.

Alistair

>
> Philippe Mathieu-Daudé (2):
>   hw/sd/ssi-sd: Deprecate the SPI to SD card 'adapter'
>   hw/sd/sdcard: Deprecate the SPI mode
>
>  docs/system/deprecated.rst | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> --
> 2.21.3
>
>


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [RFC PATCH 1/2] hw/sd/ssi-sd: Deprecate the SPI to SD card 'adapter'
  2020-07-05 22:07 ` [RFC PATCH 1/2] hw/sd/ssi-sd: Deprecate the SPI to SD card 'adapter' Philippe Mathieu-Daudé
@ 2020-07-06 17:27   ` Eric Blake
  2020-07-07  6:47   ` Peter Krempa
  1 sibling, 0 replies; 10+ messages in thread
From: Eric Blake @ 2020-07-06 17:27 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Thomas Huth, Peter Maydell, Alistair Francis, qemu-arm, libvir-list

On 7/5/20 5:07 PM, Philippe Mathieu-Daudé wrote:
> This device duplicate the SPI mode of the sd-card device. The

duplicates

> SPI protocol is better handler in the sd-card, however as the
> TYPE_SSI_SLAVE is not an interface, the sd-card can not implement
> it easily to be pluggable on a SPI bus. Meanwhile the ssi-sd
> device acts as a bridge, but is bitroting. Deprecate it.

bitrotting

> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>   docs/system/deprecated.rst | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst
> index 47f84be8e0..5e67d7f3e0 100644
> --- a/docs/system/deprecated.rst
> +++ b/docs/system/deprecated.rst
> @@ -343,6 +343,11 @@ The 'ide-drive' device is deprecated. Users should use 'ide-hd' or
>   The 'scsi-disk' device is deprecated. Users should use 'scsi-hd' or
>   'scsi-cd' as appropriate to get a SCSI hard disk or CD-ROM as needed.
>   
> +``ssi-sd`` (since 5.1)
> +'''''''''''''''''''''''''

Inconsistent line lengths

> +
> +The 'ssi-sd' (SSI to SD card adapter) device is deprecated.

What is the recommended replacement?  Or at least document if it is 
disappearing with no replacement.

> +
>   System emulator machines
>   ------------------------
>   
> 

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [RFC PATCH 0/2] hw/sd: Deprecate the SPI mode and the SPI to SD adapter
  2020-07-06 16:41 ` [RFC PATCH 0/2] hw/sd: Deprecate the SPI mode and the SPI to SD adapter Alistair Francis
@ 2020-07-06 17:37   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 10+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-06 17:37 UTC (permalink / raw)
  To: Alistair Francis
  Cc: Peter Maydell, Thomas Huth, Alistair Francis,
	qemu-devel@nongnu.org Developers, libvir-list, qemu-arm

On 7/6/20 6:41 PM, Alistair Francis wrote:
> On Sun, Jul 5, 2020 at 3:08 PM Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>>
>> I tried to maintain the SPI mode because it is useful in
>> tiny embedded devices, and thought it would be helpful for
>> the AVR MCUs.
>> As AVR was blocked, I thought it was wise to deprecate the
>> SPI mode as users are interested in the faster MMC mode.
>> Today Thomas surprised me by posting an update of it!
>> https://www.mail-archive.com/qemu-devel@nongnu.org/msg720089.html
>>
>> I'm still posting this as RFC to discuss, but I'm reconsiderating
>> keeping this mode a bit more.
> 
> I think it's worth keeping.
> 
> I'm pretty sure the HiFive Unleashed (sifive_u in QEMU) uses SD over
> SPI. There isn't an upstream model but I think there are out of tree
> patches that hopefully one day will make it upstream.

Glad to hear that! :)

> 
> Alistair
> 
>>
>> Philippe Mathieu-Daudé (2):
>>   hw/sd/ssi-sd: Deprecate the SPI to SD card 'adapter'
>>   hw/sd/sdcard: Deprecate the SPI mode
>>
>>  docs/system/deprecated.rst | 10 ++++++++++
>>  1 file changed, 10 insertions(+)
>>
>> --
>> 2.21.3
>>
>>
> 


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [RFC PATCH 1/2] hw/sd/ssi-sd: Deprecate the SPI to SD card 'adapter'
  2020-07-05 22:07 ` [RFC PATCH 1/2] hw/sd/ssi-sd: Deprecate the SPI to SD card 'adapter' Philippe Mathieu-Daudé
  2020-07-06 17:27   ` Eric Blake
@ 2020-07-07  6:47   ` Peter Krempa
  1 sibling, 0 replies; 10+ messages in thread
From: Peter Krempa @ 2020-07-07  6:47 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Peter Maydell, Thomas Huth, Alistair Francis, qemu-devel,
	libvir-list, qemu-arm

On Mon, Jul 06, 2020 at 00:07:30 +0200, Philippe Mathieu-Daudé wrote:
> This device duplicate the SPI mode of the sd-card device. The
> SPI protocol is better handler in the sd-card, however as the
> TYPE_SSI_SLAVE is not an interface, the sd-card can not implement
> it easily to be pluggable on a SPI bus. Meanwhile the ssi-sd
> device acts as a bridge, but is bitroting. Deprecate it.
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  docs/system/deprecated.rst | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst
> index 47f84be8e0..5e67d7f3e0 100644
> --- a/docs/system/deprecated.rst
> +++ b/docs/system/deprecated.rst
> @@ -343,6 +343,11 @@ The 'ide-drive' device is deprecated. Users should use 'ide-hd' or
>  The 'scsi-disk' device is deprecated. Users should use 'scsi-hd' or
>  'scsi-cd' as appropriate to get a SCSI hard disk or CD-ROM as needed.
>  
> +``ssi-sd`` (since 5.1)
> +'''''''''''''''''''''''''
> +
> +The 'ssi-sd' (SSI to SD card adapter) device is deprecated.

libvirt didn't allow configuring this device yet, so from our view it's
okay to remove it.

ACKed-by: Peter Krempa <pkrempa@redhat.com>



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [RFC PATCH 2/2] hw/sd/sdcard: Deprecate the SPI mode
  2020-07-05 22:07 ` [RFC PATCH 2/2] hw/sd/sdcard: Deprecate the SPI mode Philippe Mathieu-Daudé
@ 2020-07-07  6:49   ` Peter Krempa
  0 siblings, 0 replies; 10+ messages in thread
From: Peter Krempa @ 2020-07-07  6:49 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Peter Maydell, Thomas Huth, Alistair Francis, qemu-devel,
	libvir-list, qemu-arm

On Mon, Jul 06, 2020 at 00:07:31 +0200, Philippe Mathieu-Daudé wrote:
> SD cards be used with SPI, SD or MMC protocol.
> 
> Unfortunately, maintaining the SPI protocol make improving the
> MMC mode very difficult. As of 2020 users are more interested
> in using cards with the MMC protocol.
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  docs/system/deprecated.rst | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst
> index 5e67d7f3e0..01dca3d038 100644
> --- a/docs/system/deprecated.rst
> +++ b/docs/system/deprecated.rst
> @@ -384,6 +384,11 @@ full SCSI support.  Use virtio-scsi instead when SCSI passthrough is required.
>  Note this also applies to ``-device virtio-blk-pci,scsi=on|off``, which is an
>  alias.
>  
> +``-device sd-card,spi=on`` (since 5.1)
> +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> +
> +The SPI mode of the 'sd-card' device is deprecated.

libvirt didn't implement this knob so it's okay to remove it without
replacement.

ACKed-by: Peter Krempa <pkrempa@redhat.com>




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [RFC PATCH 0/2] hw/sd: Deprecate the SPI mode and the SPI to SD adapter
  2020-07-05 22:07 [RFC PATCH 0/2] hw/sd: Deprecate the SPI mode and the SPI to SD adapter Philippe Mathieu-Daudé
                   ` (2 preceding siblings ...)
  2020-07-06 16:41 ` [RFC PATCH 0/2] hw/sd: Deprecate the SPI mode and the SPI to SD adapter Alistair Francis
@ 2020-07-10  9:27 ` Bin Meng
  2020-07-10 10:08   ` Philippe Mathieu-Daudé
  3 siblings, 1 reply; 10+ messages in thread
From: Bin Meng @ 2020-07-10  9:27 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, Pragnesh Patel
  Cc: Peter Maydell, Thomas Huth, Alistair Francis,
	qemu-devel@nongnu.org Developers, libvir-list, qemu-arm

Hi Philippe,

On Mon, Jul 6, 2020 at 6:07 AM Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>
> I tried to maintain the SPI mode because it is useful in
> tiny embedded devices, and thought it would be helpful for
> the AVR MCUs.
> As AVR was blocked, I thought it was wise to deprecate the
> SPI mode as users are interested in the faster MMC mode.
> Today Thomas surprised me by posting an update of it!
> https://www.mail-archive.com/qemu-devel@nongnu.org/msg720089.html
>
> I'm still posting this as RFC to discuss, but I'm reconsiderating
> keeping this mode a bit more.
>

AFAIK, SiFive folks (Pragnesh in cc) are investigating supporting QSPI
model on "sifive_u" machine, and it will definitely use this SPI over
SD model.

In fact, the QSPI is the last big gap in the "sifive_u" machine to
make it a complete platform for hardware replacement.

Regards,
Bin


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [RFC PATCH 0/2] hw/sd: Deprecate the SPI mode and the SPI to SD adapter
  2020-07-10  9:27 ` Bin Meng
@ 2020-07-10 10:08   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 10+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-10 10:08 UTC (permalink / raw)
  To: Bin Meng, Pragnesh Patel
  Cc: Peter Maydell, Thomas Huth, Alistair Francis,
	qemu-devel@nongnu.org Developers, libvir-list, qemu-arm

On 7/10/20 11:27 AM, Bin Meng wrote:
> Hi Philippe,
> 
> On Mon, Jul 6, 2020 at 6:07 AM Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>>
>> I tried to maintain the SPI mode because it is useful in
>> tiny embedded devices, and thought it would be helpful for
>> the AVR MCUs.
>> As AVR was blocked, I thought it was wise to deprecate the
>> SPI mode as users are interested in the faster MMC mode.
>> Today Thomas surprised me by posting an update of it!
>> https://www.mail-archive.com/qemu-devel@nongnu.org/msg720089.html
>>
>> I'm still posting this as RFC to discuss, but I'm reconsiderating
>> keeping this mode a bit more.
>>
> 
> AFAIK, SiFive folks (Pragnesh in cc) are investigating supporting QSPI
> model on "sifive_u" machine, and it will definitely use this SPI over
> SD model.
> 
> In fact, the QSPI is the last big gap in the "sifive_u" machine to
> make it a complete platform for hardware replacement.

Good news!

I have some idea about the design, but don't have the time to work
on it. Help in this area is welcomed, and I am happy to review the
patches.

The way I'd do it is keep the generic sd.c code and make it an abstract
class (or interface), and split SD / SPI protocols handling in different
implementation files. Only the negotiation at reset is common, once you
switch to a protocol mode you can't switch to another without resetting
the device. Also this would make the MMC protocol (already implemented
by Xilinx) upstreamable more easily.

Having different files also allows different maintenance granularity.

I haven't looked at QSPI, but I expect it to be quite different that
the old SPI mode.

Regards,

Phil.


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-07-10 10:09 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-05 22:07 [RFC PATCH 0/2] hw/sd: Deprecate the SPI mode and the SPI to SD adapter Philippe Mathieu-Daudé
2020-07-05 22:07 ` [RFC PATCH 1/2] hw/sd/ssi-sd: Deprecate the SPI to SD card 'adapter' Philippe Mathieu-Daudé
2020-07-06 17:27   ` Eric Blake
2020-07-07  6:47   ` Peter Krempa
2020-07-05 22:07 ` [RFC PATCH 2/2] hw/sd/sdcard: Deprecate the SPI mode Philippe Mathieu-Daudé
2020-07-07  6:49   ` Peter Krempa
2020-07-06 16:41 ` [RFC PATCH 0/2] hw/sd: Deprecate the SPI mode and the SPI to SD adapter Alistair Francis
2020-07-06 17:37   ` Philippe Mathieu-Daudé
2020-07-10  9:27 ` Bin Meng
2020-07-10 10:08   ` Philippe Mathieu-Daudé

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).