* Re: MicroSD (SPI mode) support in Linux-2.6.26-1
2009-01-23 13:40 ` Wolfgang Wegner
@ 2009-01-23 14:46 ` Andre Schwarz
2009-01-23 15:27 ` Andre Schwarz
1 sibling, 0 replies; 5+ messages in thread
From: Andre Schwarz @ 2009-01-23 14:46 UTC (permalink / raw)
To: Wolfgang Wegner; +Cc: linuxppc-dev, Sai Amruta
Wolfgang Wegner wrote:
> Hi Andre,
>
> On Fri, Jan 23, 2009 at 01:43:47PM +0100, Andre Schwarz wrote:
>
>> Sai Amruta wrote:
>>
>>> Hi All,
>>>
>>> I am using linux-2.6.26 on MPC8567 and microSD is connected through
>>> SPI interface.
>>> Is the existing mmc driver supports microSD?
>>>
>> yes - it's working perfectly fine on my MPC8343.
>> Even with SDHC cards ;-)
>>
>
> that's great to hear - is there anything like a HOWTO on how to set
> this up on top of the SPI driver (probably involving some custom GPIO
> stuff for card and WP detection) out there?
> I tried to but did not get it to work on MCF53xx (uClinux 2.6.23-uc0)
> and probably did not find the right search strings either.
>
> Regards,
> Wolfgang
>
>
I'm sorry - no README.
All I can do is provide the info how it works for me :
platform code : provide init and chips select functions.
static void mvblm7_spi_activate_cs(u8 cs, u8 polarity)
{
u32 data = in_be32( mvblm7_gpio + 2 );
if (polarity)
out_be32( mvblm7_gpio + 2, data | MVBLM7_MMC_CS );
else
out_be32( mvblm7_gpio + 2, data & ~MVBLM7_MMC_CS );
}
static void mvblm7_spi_deactivate_cs(u8 cs, u8 polarity)
{
u32 data = in_be32( mvblm7_gpio + 2 );
if (!polarity)
out_be32( mvblm7_gpio + 2, data | MVBLM7_MMC_CS );
else
out_be32( mvblm7_gpio + 2, data & ~MVBLM7_MMC_CS );
}
static struct mmc_spi_platform_data mvblm7_mmc_pdata = {
.ocr_mask = MMC_VDD_33_34,
};
static struct spi_board_info mvblm7_spi_boardinfo = {
.bus_num = 0x7000,
.chip_select = 0,
.max_speed_hz = 50000000,
.modalias = "mmc_spi",
.platform_data = &mvblm7_mmc_pdata,
};
static int __init mvblm7_spi_init(void)
{
return fsl_spi_init(&mvblm7_spi_boardinfo, 1,
mvblm7_spi_activate_cs,
mvblm7_spi_deactivate_cs);
}
machine_device_initcall(mvblm7, mvblm7_spi_init);
Kernel config :
CONFIG_MMC=y
CONFIG_MMC_BLOCK=y
CONFIG_MMC_BLOCK_BOUNCE=y
CONFIG_MMC_SPI=m
and of course the driver for your SPI controller ...
CONFIG_SPI=y
CONFIG_SPI_MASTER=y
CONFIG_SPI_MPC83xx=y
I've had no time to set up hotplug/card detect features.
Actually my system boots with card plugged in and and I do a "insmod
mmc_spi.ko" -> card gets probed.
->mount -t vfat /dev/mmcblk0p1 /mnt/mmc
hope this helps.
cheers,
Andre
MATRIX VISION GmbH, Talstraße 16, DE-71570 Oppenweiler
Registergericht: Amtsgericht Stuttgart, HRB 271090
Geschäftsführer: Gerhard Thullner, Werner Armingeon, Uwe Furtner, Hans-Joachim Reich
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: MicroSD (SPI mode) support in Linux-2.6.26-1
2009-01-23 13:40 ` Wolfgang Wegner
2009-01-23 14:46 ` Andre Schwarz
@ 2009-01-23 15:27 ` Andre Schwarz
1 sibling, 0 replies; 5+ messages in thread
From: Andre Schwarz @ 2009-01-23 15:27 UTC (permalink / raw)
To: Wolfgang Wegner; +Cc: linuxppc-dev
Wolfgang Wegner wrote:
> Hi Andre,
>
> On Fri, Jan 23, 2009 at 01:43:47PM +0100, Andre Schwarz wrote:
>
>> Sai Amruta wrote:
>>
>>> Hi All,
>>>
>>> I am using linux-2.6.26 on MPC8567 and microSD is connected through
>>> SPI interface.
>>> Is the existing mmc driver supports microSD?
>>>
>> yes - it's working perfectly fine on my MPC8343.
>> Even with SDHC cards ;-)
>>
>
> that's great to hear - is there anything like a HOWTO on how to set
> this up on top of the SPI driver (probably involving some custom GPIO
> stuff for card and WP detection) out there?
> I tried to but did not get it to work on MCF53xx (uClinux 2.6.23-uc0)
> and probably did not find the right search strings either.
>
> Regards,
> Wolfgang
>
>
Wolfgang,
of course I forgot the most important messages ... ;-)
mvBL-M7> insmod /modules/mmc_spi.ko
mvBL-M7> dmesg -c
mmc_spi spi28672.0: SD/MMC host mmc0, no DMA, no WP, no poweroff
mmc0: host does not support reading read-only switch. assuming write-enable.
mmc0: new SD card on SPI
mmcblk0: mmc0:0000 SD02G 1921024KiB
mmcblk0: p1
mvBL-M7> mount /mnt/mmc/
mvBL-M7> ls /mnt/mmc/
TestApp.JPG do
TestCSharpApp.exe mvBlueCOUGAR.msi
autostart mvPPC_6XX-NAND-20081010-0946.tgz
distribution.zip uInitrd.mvblm7_nova
mvBL-M7>
cheers,
Andre
MATRIX VISION GmbH, Talstraße 16, DE-71570 Oppenweiler
Registergericht: Amtsgericht Stuttgart, HRB 271090
Geschäftsführer: Gerhard Thullner, Werner Armingeon, Uwe Furtner, Hans-Joachim Reich
^ permalink raw reply [flat|nested] 5+ messages in thread