tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: sdmmc question.



On Wed, May 24, 2023 at 09:39:11AM +0000, Taylor R Campbell wrote:
> > Date: Tue, 23 May 2023 22:54:13 -0700
> > From: Phil Nelson <phil%netbsd.org@localhost>
> > 
> >    I'm presuming that we'll need something in the dev/spi/files.spi,
> > but haven't figured out what to say to get it to work.   And I'm
> > assuming there is a .c file that needs to implement the interface
> > between the sdmmc and the spi, but I'm not sure.   Do we need
> > something in another place?  
> 
> Guessing someone will need to write a driver for sdmmc at spi
> following Chapter 7: SPI Mode of the SD specification:
> 
> https://www.sdcard.org/downloads/pls/pdf/?p=Part1_Physical_Layer_Simplified_Specification_Ver9.00.jpg&f=Part1_Physical_Layer_Simplified_Specification_Ver9.00.pdf&e=EN_SS1_9
> 
> You'll probably want to create a driver, say `sdspi', at
> sys/dev/spi/sd_spi.c that implements struct sdmmc_chip_functions and
> does config_found with sdmmcbus_attach_args and .iattr = "sdmmcbus",
> and with

I have dome something like that for NetBSD/tsarmips:
https://www-soc.lip6.fr/svn/netbsdtsar/trunk/netbsd-8/src/sys/arch/tsarmips/

In this case I had a SPI driver called vcispi:
device vcispi : sdmmcbus
attach vcispi at cluster
file arch/tsarmips/soclib/vcispi.c      vcispi

But in my case the sdmmc commands were handled in the vcispi driver (and
for some part maybe in hardware - I don't remember the details).
This may help, but you'll probably need a sdspi to make the translation
between sdmmc commands and our SPI drivers.

-- 
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference
--


Home | Main Index | Thread Index | Old Index