Hello,

On Wednesday 26 September 2012 14:41:51 dani wrote:
> Hi, I'm trying to make a micro sd card work connected to a bcm6348 board
> (livebox 1) SPI pins. I guessed the platform file of my device should be
> modified in order to make the kernel comunicate with the mmc_spi and
> recognice the microsd card.
> 
> I added this code in my platform data file (board_livebox.c):
> 
---------------------------------------------------------------------------------------------------------
> static struct mmc_spi_platform_data blue5g_mmc_spi_pdata = {
> .detect_delay = 1000,
> };
> 
> static struct bcm63xx_spi_pdata mmc_spi_chip_info = {
> .msg_ctl_width = 8,
> .msg_type_shift = 6,
> .num_chipselect = 1,
> };
> 
> static struct spi_board_info blue5g_spi_devices[] = {
> {
> .modalias = "mmc_spi",
> .max_speed_hz = 20000000,
> .bus_num = 0,
> .controller_data = &mmc_spi_chip_info,

I do not think this belongs here. dev-spi.c already takes care of properly 
registering the SPI controller with the appropriate msg_ctl_width and 
msg_type_shift.

> .platform_data = &blue5g_mmc_spi_pdata
> }
> };
> 
> etc.
> 
---------------------------------------------------------------------------------------------------------
> 
> I get this kernel messages when booting OpenWrt:
> 
> root@OpenWrt:/# dmesg |grep spi
> [ 0.500000] bcm63xx-spi bcm63xx-spi: registered master spi0
> [ 0.500000] spi spi0.0: bcm63xx_spi_setup, mode 0, 8 bits/w, 0 nsec/bit
> [ 0.500000] spi spi0.0: setup mode 0, 8 bits/w, 20000000 Hz max --> 0
> [ 0.504000] bcm63xx-spi bcm63xx-spi: registered child spi0.0
> [ 0.504000] bcm63xx-spi bcm63xx-spi: at 0xfffe0c00 (irq 9, FIFOs size 63)
> v0.1.2
> [ 0.580000] mmc_spi spi0.0: bcm63xx_spi_setup, mode 0, 8 bits/w, 0 nsec/bit
> [ 0.580000] mmc_spi spi0.0: setup mode 0, 8 bits/w, 20000000 Hz max --> 0
> [ 0.580000] mmc_spi spi0.0: ASSUMING 3.2-3.4 V slot power
> [ 0.588000] mmc_spi spi0.0: SD/MMC host mmc0, no DMA, no WP, no poweroff
> [ 0.628000] mmc_spi spi0.0: bcm63xx_spi_check_transfer, unsupported
> bits_per_word=0
> [ 0.664000] mmc_spi spi0.0: bcm63xx_spi_check_transfer, unsupported
> bits_per_word=0
> [ 0.672000] mmc_spi spi0.0: setup: unsupported mode bits 4
> [ 0.680000] mmc_spi spi0.0: can't change chip-select polarity
> [ 0.684000] mmc_spi spi0.0: bcm63xx_spi_setup, mode 0, 8 bits/w, 0 nsec/bit
> [ 0.684000] mmc_spi spi0.0: setup mode 0, 8 bits/w, 400000 Hz max --> 0
> [ 0.704000] mmc_spi spi0.0: bcm63xx_spi_check_transfer, unsupported
> bits_per_word=0

This does not look good, since the mmc_spi driver explicitely sets 
bits_per_word to 8, but for some reason the spi_transfer does not inherit from 
this, and we end up refusing the transfer.

> [ 0.724000] mmc_spi spi0.0: bcm63xx_spi_check_transfer, unsupported
> bits_per_word=0
> [ 0.972000] mmc_spi spi0.0: bcm63xx_spi_check_transfer, unsupported
> bits_per_word=0
> [ 0.980000] mmc_spi spi0.0: bcm63xx_spi_check_transfer, unsupported
> bits_per_word=0
> [ 0.988000] mmc_spi spi0.0: bcm63xx_spi_check_transfer, unsupported
> bits_per_word=0
> [ 0.996000] mmc_spi spi0.0: bcm63xx_spi_check_transfer, unsupported
> bits_per_word=0
> [ 1.008000] mmc_spi spi0.0: bcm63xx_spi_check_transfer, unsupported
> bits_per_word=0
> [ 1.016000] mmc_spi spi0.0: bcm63xx_spi_check_transfer, unsupported
> bits_per_word=0
> [ 1.024000] mmc_spi spi0.0: bcm63xx_spi_check_transfer, unsupported
> bits_per_word=0
> [ 1.032000] mmc_spi spi0.0: bcm63xx_spi_check_transfer, unsupported
> bits_per_word=0
> [ 1.040000] mmc_spi spi0.0: bcm63xx_spi_check_transfer, unsupported
> bits_per_word=0
> [ 1.048000] mmc_spi spi0.0: bcm63xx_spi_check_transfer, unsupported
> bits_per_word=0
> [ 1.056000] mmc_spi spi0.0: bcm63xx_spi_check_transfer, unsupported
> bits_per_word=0
> 
> I tried different values/variables in the previous code, but with almost
> the same result always. Isn't the mmc_spi supported by this particular
> SoC?. Any bug? or did I miss something?

I do not think you have posted every change you made

> 
> I use a 8GB Kingston SDHC (Class 4) microSD which seems to be tested OK in
> a RB433AH acordingly to:
> http://wiki.mikrotik.com/wiki/Supported_Hardware#Memory_cards
> 
> The pins are soldered directly fom the card to CS, MOSI, MISO, CLK spi pins
> at the SoC. No gpio used for CS.
> 
> Regards.
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to