Hello,
We have an micro sd card attached to our spi0, cs 3. We cannot make it work in Linux though. It seems to work fine in u-boot.
Kernel message is:
... mmc_spi spi0.3: ASSUMING 3.2-3.4 V slot power mmc_spi spi0.3: setup: unsupported mode bits 4 mmc_spi spi0.3: can't change chip-select polarity mmc_spi spi0.3: SD/MMC host mmc0, no DMA, no WP, no poweroff ... mmc0: card lacks mandatory switch function, performance might suffer. ... mmc0: host does not support reading read-only switch. assuming write-enable. ------------[ cut here ]------------ WARNING: at drivers/mmc/core/core.c:990 Modules linked in: CPU: 0 PID: 8 Comm: kworker/u2:1 Not tainted 3.10.10-ADI-2013R1-svn9708 #95 Workqueue: kmmcd _mmc_rescan task: 0103dac0 ti: 01048000 task.ti: 01048000 ADSP-BF516-0.2 300(MHz CCLK) 100(MHz SCLK) (mpu off) Linux version 3.10.10-ADI-2013R1-svn9708 (mk@PCHe-Ubuntu) (gcc version 4.3.5 (ADI-2011R1-RC4) ) #95 Tue Nov 19 11:00:21 CET 2013 SEQUENCER STATUS: Not tainted SEQSTAT: 00002021 IPEND: 8008 IMASK: ffff SYSCFG: 0006 EXCAUSE : 0x21 physical IVG3 asserted : <0xffa00650> { _trap + 0x0 } physical IVG15 asserted : <0xffa00dc8> { _evt_system_call + 0x0 } logical irq 6 mapped : <0xffa00290> { _bfin_coretmr_interrupt + 0x0 } logical irq 27 mapped : <0x000fa27c> { _bfin_twi_interrupt_entry + 0x0 } logical irq 35 mapped : <0x000f4ecc> { _bfin_mac_interrupt + 0x0 } RETE: <0x00000000> /* Maybe null pointer? */ RETN: <0x01049ddc> /* kernel dynamic memory */ RETX: <0x00000480> /* Maybe fixed code section */ RETS: <0x00100d00> { _mmc_sd_init_card + 0xd4 } PC : <0x000fb042> { _mmc_set_clock + 0xa } DCPLB_FAULT_ADDR: <0x015538c0> /* kernel dynamic memory */ ICPLB_FAULT_ADDR: <0x000fb042> { _mmc_set_clock + 0xa } PROCESSOR STATE: R0 : 00061a80 R1 : 00000000 R2 : 00000058 R3 : 00000000 R4 : 00000000 R5 : 0103ca05 R6 : 00000000 R7 : 00000000 P0 : 0000194c P1 : 01553800 P2 : 001fa988 P3 : 01553800 P4 : 01049df0 P5 : 01553400 FP : 01038e00 SP : 01049d00 LB0: 000c7c86 LT0: 000c7c86 LC0: 00000000 LB1: 000c65a0 LT1: 000c6594 LC1: 00000000 B0 : 0000005c L0 : 00000000 M0 : 00000010 I0 : 001fb4d4 B1 : 0016ff50 L1 : 00000000 M1 : 00000007 I1 : 001e7b04 B2 : 0017f898 L2 : 00000000 M2 : 00001802 I2 : 001e6130 B3 : 00000000 L3 : 00000000 M3 : 0000005b I3 : 00000057 A0.w: 00000000 A0.x: 00000000 A1.w: 00000000 A1.x: 00000000 USP : 00000000 ASTAT: 02002062 ---[ end trace 63bc9a61e7067c0b ]--- Hardware Trace: 0 Target : <0x00003dbc> { _trap_c + 0x0 } Source : <0xffa005e4> { _exception_to_level5 + 0xa4 } CALL pcrel 1 Target : <0xffa00540> { _exception_to_level5 + 0x0 } Source : <0xffa003f8> { _bfin_return_from_exception + 0x18 } RTX 2 Target : <0xffa003e0> { _bfin_return_from_exception + 0x0 } Source : <0xffa0049a> { _ex_trap_c + 0x72 } JUMP.S 3 Target : <0xffa00428> { _ex_trap_c + 0x0 } Source : <0xffa006aa> { _trap + 0x5a } JUMP (P4) 4 Target : <0xffa00650> { _trap + 0x0 } FAULT : <0x000fb042> { _mmc_set_clock + 0xa } BUG Source : <0x000fb040> { _mmc_set_clock + 0x8 } IF !CC JUMP pcrel (BP) 5 Target : <0x000fb038> { _mmc_set_clock + 0x0 } Source : <0x00100cfc> { _mmc_sd_init_card + 0xd0 } CALL pcrel 6 Target : <0x00100cfa> { _mmc_sd_init_card + 0xce } Source : <0x00100dc0> { _mmc_sd_init_card + 0x194 } JUMP.S 7 Target : <0x00100dba> { _mmc_sd_init_card + 0x18e } Source : <0x00100cf4> { _mmc_sd_init_card + 0xc8 } IF CC JUMP pcrel (BP) 8 Target : <0x00100cee> { _mmc_sd_init_card + 0xc2 } Source : <0x00100d9a> { _mmc_sd_init_card + 0x16e } JUMP.S 9 Target : <0x00100d96> { _mmc_sd_init_card + 0x16a } Source : <0x00100ce6> { _mmc_sd_init_card + 0xba } IF CC JUMP pcrel 10 Target : <0x00100ce2> { _mmc_sd_init_card + 0xb6 } Source : <0x001003bc> { _mmc_sd_switch_hs + 0x8c } RTS 11 Target : <0x001003b2> { _mmc_sd_switch_hs + 0x82 } Source : <0x0010034c> { _mmc_sd_switch_hs + 0x1c } IF CC JUMP pcrel 12 Target : <0x00100330> { _mmc_sd_switch_hs + 0x0 } Source : <0x00100cde> { _mmc_sd_init_card + 0xb2 } CALL pcrel 13 Target : <0x00100cd0> { _mmc_sd_init_card + 0xa4 } Source : <0x00100528> { _mmc_sd_setup_card + 0x60 } RTS 14 Target : <0x00100520> { _mmc_sd_setup_card + 0x58 } Source : <0x0010073a> { _mmc_sd_setup_card + 0x272 } JUMP.S 15 Target : <0x00100738> { _mmc_sd_setup_card + 0x270 } Source : <0x0016dd32> { _printk + 0x26 } RTS mmc0: new SD card on SPI ... Nov 20 12:00:51 kernel: mmc_spi spi0.3: setup: unsupported mode bits 4 ...
Our board files contains the following:
#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) static struct bfin5xx_spi_chip mmc_spi_chip_info = { .enable_dma = 0, }; #endif #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) { .modalias = "mmc_spi", .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ .bus_num = 0, .chip_select = 3, .controller_data = &mmc_spi_chip_info, .mode = SPI_MODE_3, }, #endif
We've tried both with the 2010 and the newest 2013r1 Linux. Same thing. We've tried another sd card. Different error, but still no luck. The sd card that's currently attached is working fine on another board that uses the Blackfin SDH.
What are we doing wrong?