qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2 00/25] SDCard: housekeeping, improve SPI, introduce new Specs
@ 2018-01-03 21:24 Philippe Mathieu-Daudé
  0 siblings, 0 replies; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-01-03 21:24 UTC (permalink / raw)
  To: Alistair Francis, Peter Maydell, Igor Mitsyanko, Andrew Baumann,
	Olbrich, Andrzej Zaborowski
  Cc: Philippe Mathieu-Daudé, qemu-devel, Edgar E . Iglesias,
	Prasad J Pandit, Peter Crosthwaite, Paul Brook,
	Marc-André Lureau

Hi,

This series intends to simplify the sdcard device:
- add trace points,
- have a more robust SD mode,
- improve the SPI mode,
- introduce the MMC mode (split for a later series)

3 patches as tagged RFC as I need to fix few XXX comments,
checking back the specs.

Since v1:
- rewrote mostly all patches to keep it simpler.

Regards,

Phil.

$ git backport-diff
[----] : patches are identical
[####] : number of functional differences between upstream/downstream patch
[down] : patch is downstream-only
The flags [FC] indicate (F)unctional and (C)ontextual differences, respectively

001/25:[down] 'sdcard: reorder SDState struct members'
002/25:[0026] [FC] 'sdcard: replace DPRINTF() by trace events'
003/25:[----] [-C] 'sdcard: add more trace events'
004/25:[down] 'sdcard: define SDCARD_CMD_MAX instead of using the magic '64''
005/25:[down] 'sdcard: display command name when tracing CMD/ACMD'
006/25:[----] [-C] 'sdcard: let cmd_valid_while_locked() returns a bool'
007/25:[down] 'sdcard: rename sd_set_$REG() functions called once as sd_reset_$REG()'
008/25:[down] 'sdcard: use the registerfields API to access the OCR register'
009/25:[down] 'sdcard: use G_BYTE from cutils'
010/25:[down] 'sdcard: remove unreachable code'
011/25:[down] 'sdcard: replace switch(unique case) statements -> if(case)'
012/25:[down] 'sdcard: use a 16-bit integer for the 16-bit RCA register'
013/25:[down] 'sdcard: let function handling response codes returns the response size'
014/25:[down] 'sdcard: add missing command CMD55'
015/25:[down] 'sdcard: add missing CMD54 SDIO command'
016/25:[down] 'sdcard: add missing SPI legal commands'
017/25:[down] 'sdcard: fix SPI response length'
018/25:[down] 'sdcard: add an enum for the SD PHY Spec version'
019/25:[down] 'sdcard: check if the card capacity is supported'
020/25:[down] 'sdcard: Don't always set the high capacity bit'
021/25:[down] 'sdcard: add cmd_version_supported(), improve cmd_class_supported()'
022/25:[down] 'sdcard: remove unreachable SPI commands'
023/25:[down] 'sdcard: store the bus protocol in an enum'
024/25:[down] 'sdcard: introduce Spec v3.01 SD commands'
025/25:[down] 'sdcard: introduce Spec v4.51 & v5.1 MMC commands'

Based-on: 20180103183418.23730-26-f4bug@amsat.org
          (SDHCI: add qtests and fix few issues)

Philippe Mathieu-Daudé (25):
  sdcard: reorder SDState struct members
  sdcard: replace DPRINTF() by trace events
  sdcard: add more trace events
  sdcard: define SDCARD_CMD_MAX instead of using the magic '64'
  sdcard: display command name when tracing CMD/ACMD
  sdcard: let cmd_valid_while_locked() returns a bool
  sdcard: rename sd_set_$REG() functions called once as sd_reset_$REG()
  sdcard: use the registerfields API to access the OCR register
  sdcard: use G_BYTE from cutils
  sdcard: remove unreachable code
  sdcard: replace switch(unique case) statements -> if(case)
  sdcard: use a 16-bit integer for the 16-bit RCA register
  sdcard: let function handling response codes returns the response size
  sdcard: add missing command CMD55
  sdcard: add missing CMD54 SDIO command
  sdcard: add missing SPI legal commands
  sdcard: fix SPI response length
  sdcard: add an enum for the SD PHY Spec version
  sdcard: check if the card capacity is supported
  sdcard: Don't always set the high capacity bit
  sdcard: add cmd_version_supported(), improve cmd_class_supported()
  sdcard: remove unreachable SPI commands
  sdcard: store the bus protocol in an enum
  sdcard: introduce Spec v3.01 SD commands
  sdcard: introduce Spec v4.51 & v5.1 MMC commands

 include/hw/sd/sd.h            |   6 +
 include/hw/sd/sdcard_legacy.h |   2 +-
 hw/sd/sd.c                    | 872 +++++++++++++++++++++++++++++-------------
 hw/sd/trace-events            |  15 +
 4 files changed, 627 insertions(+), 268 deletions(-)

-- 
2.15.1

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

* Re: [Qemu-devel] [PATCH v2 00/25] SDCard: housekeeping, improve  SPI, introduce new Specs
       [not found] <mailman.15762.1515014732.27992.qemu-devel@nongnu.org>
@ 2018-01-03 21:44 ` Programmingkid
  2018-01-04 17:57   ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 5+ messages in thread
From: Programmingkid @ 2018-01-03 21:44 UTC (permalink / raw)
  Cc: Alistair Francis, Peter Maydell, Igor Mitsyanko, Andrew Baumann,
	m.olbrich, Andrzej Zaborowski, Cc: Philippe Mathieu-Daud?,
	QEMU Developers, Edgar E . Iglesias, pjp, crosthwaite.peter,
	Paul Brook, Marc-Andr? Lureau


> On Jan 3, 2018, at 4:25 PM, qemu-devel-request@nongnu.org wrote:
> 
> Message: 10
> Date: Wed,  3 Jan 2018 18:24:11 -0300
> From: Philippe Mathieu-Daud? <f4bug@amsat.org>
> To: Alistair Francis <alistair.francis@xilinx.com>,	Peter Maydell
> 	<peter.maydell@linaro.org>,	Igor Mitsyanko <i.mitsyanko@gmail.com>,
> 	Andrew Baumann <Andrew.Baumann@microsoft.com>,	Olbrich
> 	<m.olbrich@pengutronix.de>, Andrzej Zaborowski <balrogg@gmail.com>
> Cc: Philippe Mathieu-Daud? <f4bug@amsat.org>,	qemu-devel@nongnu.org,
> 	"Edgar E . Iglesias" <edgar.iglesias@xilinx.com>,	Prasad J Pandit
> 	<pjp@fedoraproject.org>,	Peter Crosthwaite
> 	<crosthwaite.peter@gmail.com>,	Paul Brook <paul@codesourcery.com>,
> 	Marc-Andr? Lureau <marcandre.lureau@redhat.com>
> Subject: [Qemu-devel] [PATCH v2 00/25] SDCard: housekeeping, improve
> 	SPI, introduce new Specs
> Message-ID: <20180103212436.15762-1-f4bug@amsat.org>
> Content-Type: text/plain; charset=UTF-8
> 
> Hi,
> 
> This series intends to simplify the sdcard device:
> - add trace points,
> - have a more robust SD mode,
> - improve the SPI mode,
> - introduce the MMC mode (split for a later series)
> 
> 3 patches as tagged RFC as I need to fix few XXX comments,
> checking back the specs.
> 
> Since v1:
> - rewrote mostly all patches to keep it simpler.
> 
> Regards,
> 
> Phil.

Is there a way to make this SD card reader work with Mac OS X or Windows guests?

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

* Re: [Qemu-devel] [PATCH v2 00/25] SDCard: housekeeping, improve SPI, introduce new Specs
  2018-01-03 21:44 ` [Qemu-devel] [PATCH v2 00/25] SDCard: housekeeping, improve SPI, introduce new Specs Programmingkid
@ 2018-01-04 17:57   ` Philippe Mathieu-Daudé
  2018-01-04 19:36     ` Programmingkid
  0 siblings, 1 reply; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-01-04 17:57 UTC (permalink / raw)
  To: Programmingkid, Kevin O'Connor
  Cc: QEMU Developers, Alistair Francis, Peter Maydell, Igor Mitsyanko,
	Andrew Baumann, m.olbrich, Andrzej Zaborowski, Edgar E . Iglesias,
	Prasad J Pandit, Peter Crosthwaite, Paul Brook, Marc-Andr? Lureau

Hi John,

> Is there a way to make this SD card reader work with Mac OS X or Windows guests?

As noted by Kevin here:
http://lists.nongnu.org/archive/html/qemu-devel/2017-12/msg02765.html

If your machine has a PCI bus you can plug it there:
http://pcidb.net/view/1b36/0007

Linux kmod 'sdhci-pci' recognize it well.

I don't know if OSX/Win guests have a such driver.

If no, we could model the PCI7612:
https://pci-ids.ucw.cz/read/PC/104c/803b

Regards,

Phil.

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

* Re: [Qemu-devel] [PATCH v2 00/25] SDCard: housekeeping, improve SPI, introduce new Specs
  2018-01-04 17:57   ` Philippe Mathieu-Daudé
@ 2018-01-04 19:36     ` Programmingkid
  2018-01-04 19:44       ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 5+ messages in thread
From: Programmingkid @ 2018-01-04 19:36 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Kevin O'Connor, QEMU Developers, Alistair Francis,
	Peter Maydell, Igor Mitsyanko, Andrew Baumann, m.olbrich,
	Andrzej Zaborowski, Edgar E . Iglesias, Prasad J Pandit,
	Peter Crosthwaite, Paul Brook, Marc-Andr? Lureau


> On Jan 4, 2018, at 12:57 PM, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
> 
> Hi John,
> 
>> Is there a way to make this SD card reader work with Mac OS X or Windows guests?
> 
> As noted by Kevin here:
> http://lists.nongnu.org/archive/html/qemu-devel/2017-12/msg02765.html
> 
> If your machine has a PCI bus you can plug it there:
> http://pcidb.net/view/1b36/0007
> 
> Linux kmod 'sdhci-pci' recognize it well.
> 
> I don't know if OSX/Win guests have a such driver.
> 
> If no, we could model the PCI7612:
> https://pci-ids.ucw.cz/read/PC/104c/803b
> 
> Regards,
> 
> Phil.

Thanks for the reply. Using this command "-device sdhci-pci -device sd-card,drive=drive0 -drive id=drive0,if=none,file=<image file>" I was able to make the sd card reader work in Windows XP. I tried ejecting the image file and trying to mount another image file. This did
not work. The device was not recognized in Mac OS 9 or Mac OS X guests.

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

* Re: [Qemu-devel] [PATCH v2 00/25] SDCard: housekeeping, improve SPI, introduce new Specs
  2018-01-04 19:36     ` Programmingkid
@ 2018-01-04 19:44       ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-01-04 19:44 UTC (permalink / raw)
  To: Programmingkid
  Cc: Edgar E . Iglesias, Peter Maydell, Prasad J Pandit,
	Peter Crosthwaite, Igor Mitsyanko, QEMU Developers,
	Andrew Baumann, Alistair Francis, Kevin O'Connor, Paul Brook,
	Marc-Andr? Lureau, Olbrich

>> As noted by Kevin here:
>> http://lists.nongnu.org/archive/html/qemu-devel/2017-12/msg02765.html
>>
>> If your machine has a PCI bus you can plug it there:
>> http://pcidb.net/view/1b36/0007
>>
>> Linux kmod 'sdhci-pci' recognize it well.
>>
>> I don't know if OSX/Win guests have a such driver.
>>
>> If no, we could model the PCI7612:
>> https://pci-ids.ucw.cz/read/PC/104c/803b
>>
>> Regards,
>>
>> Phil.
>
> Thanks for the reply. Using this command "-device sdhci-pci -device sd-card,drive=drive0 -drive id=drive0,if=none,file=<image file>" I was able to make the sd card reader work in Windows XP. I tried ejecting the image file and trying to mount another image file. This did
> not work. The device was not recognized in Mac OS 9 or Mac OS X guests.

After spending 2 months in this code, I could expect a such problem,
but I don't have all the images to test all machines matrix.

Are you motivated in writing a simple eject/reinsert qtest? :)

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

end of thread, other threads:[~2018-01-04 19:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.15762.1515014732.27992.qemu-devel@nongnu.org>
2018-01-03 21:44 ` [Qemu-devel] [PATCH v2 00/25] SDCard: housekeeping, improve SPI, introduce new Specs Programmingkid
2018-01-04 17:57   ` Philippe Mathieu-Daudé
2018-01-04 19:36     ` Programmingkid
2018-01-04 19:44       ` Philippe Mathieu-Daudé
2018-01-03 21:24 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).