Adding a second/third SD to the BeagleBone

Continuing to prototype my storage "cape", I got a EEPROM chip working
and recognized. However, the next problem seems to be a
timing/threading issue in the 3.2 kernel. The dmesg is the best place
to explain:

[ 0.136085] omap_uart.0: ttyO0 at MMIO 0x44e09000 (irq = 72) is a OMAP UART0
[ 0.582816] console [ttyO0] enabled
[ 0.586978] omap_uart.1: ttyO1 at MMIO 0x48022000 (irq = 73) is a OMAP UART1
[ 0.594834] omap_uart.2: ttyO2 at MMIO 0x48024000 (irq = 74) is a OMAP UART2
[ 0.602644] omap_uart.3: ttyO3 at MMIO 0x481a6000 (irq = 44) is a OMAP UART3
[ 0.610409] omap_uart.4: ttyO4 at MMIO 0x481a8000 (irq = 45) is a OMAP UART4
[ 0.618210] omap_uart.5: ttyO5 at MMIO 0x481aa000 (irq = 46) is a OMAP UART5
[ 0.626222] at24 1-0051: 32768 byte 24c256 EEPROM, writable, 64 bytes/write
[ 0.691240] No daughter card found
[ 0.694828] at24 1-0050: 32768 byte 24c256 EEPROM, writable, 64 bytes/write
[ 0.710015] Board name: A335BONE
[ 0.713390] Board version: 00A3
[ 0.716659] The board is a AM335x Beaglebone.
[ 0.722048] tps65217 1-0024: TPS65217 ID 0x7 version 1.0
[ 0.729449] omap_i2c.3: alias fck already exists
[ 0.734789] omap_i2c omap_i2c.3: bus 3 rev2.4.0 at 100 kHz
[ 0.741922] _omap_mux_get_by_name: Could not find signal leds-gpio
[ 0.748725] omap_hsmmc.0: alias fck already exists
[ 0.754644] at24 3-0054: 32768 byte 24c256 EEPROM, writable, 64 bytes/write
[ 0.863462] BeagleBone cape EEPROM: found eeprom at address 0x54
[ 0.869727] BeagleBone cape: WolfSkunkDesigns RedWolf BBone Storage
[ 0.876272] BeagleBone cape partnumber: REDWOLF-STORAGE
[ 0.881727] BeagleBone cape: initializing Storage cape MMC full
[ 0.888028] at24 3-0055: 32768 byte 24c256 EEPROM, writable, 64 bytes/write
[ 0.971240] BeagleBone cape EEPROM: could not read eeprom at address 0x55
[ 0.978364] at24 3-0056: 32768 byte 24c256 EEPROM, writable, 64 bytes/write
[ 1.061245] BeagleBone cape EEPROM: could not read eeprom at address 0x56
[ 1.068369] at24 3-0057: 32768 byte 24c256 EEPROM, writable, 64 bytes/write
[ 1.151239] BeagleBone cape EEPROM: could not read eeprom at address 0x57
[ 1.158315] BeagleBone cape: exporting ADC pins to sysfs
[ 1.165782] mtdoops: mtd device (mtddev=name/number) must be supplied
[ 1.172765] omap2-nand driver initializing
[ 1.177287] OneNAND driver initializing
[ 1.182697] CAN device driver interface
[ 1.186696] CAN bus driver for Bosch D_CAN controller 1.0

The problem is, once omap_hsmmc.0 is initalized, you can't add on
another MMC even if you got the pin mapping changed. Calling
omap_hsmmc_init() again causes a kernel panic. I'm very tempted to
move the initial call to it to beaglebone_cape_setup() from
mmc0_init().

Koen, you doing anything in the 3.6 kernel like this?

Continuing to prototype my storage "cape", I got a EEPROM chip working
and recognized. However, the next problem seems to be a
timing/threading issue in the 3.2 kernel. The dmesg is the best place
to explain:

[ 0.136085] omap_uart.0: ttyO0 at MMIO 0x44e09000 (irq = 72) is a OMAP UART0
[ 0.582816] console [ttyO0] enabled
[ 0.586978] omap_uart.1: ttyO1 at MMIO 0x48022000 (irq = 73) is a OMAP UART1
[ 0.594834] omap_uart.2: ttyO2 at MMIO 0x48024000 (irq = 74) is a OMAP UART2
[ 0.602644] omap_uart.3: ttyO3 at MMIO 0x481a6000 (irq = 44) is a OMAP UART3
[ 0.610409] omap_uart.4: ttyO4 at MMIO 0x481a8000 (irq = 45) is a OMAP UART4
[ 0.618210] omap_uart.5: ttyO5 at MMIO 0x481aa000 (irq = 46) is a OMAP UART5
[ 0.626222] at24 1-0051: 32768 byte 24c256 EEPROM, writable, 64 bytes/write
[ 0.691240] No daughter card found
[ 0.694828] at24 1-0050: 32768 byte 24c256 EEPROM, writable, 64 bytes/write
[ 0.710015] Board name: A335BONE
[ 0.713390] Board version: 00A3
[ 0.716659] The board is a AM335x Beaglebone.
[ 0.722048] tps65217 1-0024: TPS65217 ID 0x7 version 1.0
[ 0.729449] omap_i2c.3: alias fck already exists
[ 0.734789] omap_i2c omap_i2c.3: bus 3 rev2.4.0 at 100 kHz
[ 0.741922] _omap_mux_get_by_name: Could not find signal leds-gpio
[ 0.748725] omap_hsmmc.0: alias fck already exists
[ 0.754644] at24 3-0054: 32768 byte 24c256 EEPROM, writable, 64 bytes/write
[ 0.863462] BeagleBone cape EEPROM: found eeprom at address 0x54
[ 0.869727] BeagleBone cape: WolfSkunkDesigns RedWolf BBone Storage
[ 0.876272] BeagleBone cape partnumber: REDWOLF-STORAGE
[ 0.881727] BeagleBone cape: initializing Storage cape MMC full
[ 0.888028] at24 3-0055: 32768 byte 24c256 EEPROM, writable, 64 bytes/write
[ 0.971240] BeagleBone cape EEPROM: could not read eeprom at address 0x55
[ 0.978364] at24 3-0056: 32768 byte 24c256 EEPROM, writable, 64 bytes/write
[ 1.061245] BeagleBone cape EEPROM: could not read eeprom at address 0x56
[ 1.068369] at24 3-0057: 32768 byte 24c256 EEPROM, writable, 64 bytes/write
[ 1.151239] BeagleBone cape EEPROM: could not read eeprom at address 0x57
[ 1.158315] BeagleBone cape: exporting ADC pins to sysfs
[ 1.165782] mtdoops: mtd device (mtddev=name/number) must be supplied
[ 1.172765] omap2-nand driver initializing
[ 1.177287] OneNAND driver initializing
[ 1.182697] CAN device driver interface
[ 1.186696] CAN bus driver for Bosch D_CAN controller 1.0

The problem is, once omap_hsmmc.0 is initalized, you can't add on
another MMC even if you got the pin mapping changed. Calling
omap_hsmmc_init() again causes a kernel panic. I'm very tempted to
move the initial call to it to beaglebone_cape_setup() from
mmc0_init().

For the eMMC cape I used this patch: https://github.com/beagleboard/kernel/blob/beaglebone-3.2/patches/beaglebone/0085-beaglebone-add-rudimentary-support-for-eMMC-cape.patch

And a matching kernel: https://github.com/koenkooi/linux/tree/linux-ti33x-psp-3.2.28-r16a+gitr720e07b4c1f687b61b147b31c698cb6816d72f01

Adapting that to your cape should be trivial.

Koen, you doing anything in the 3.6 kernel like this?

No mmc support in 3.6 yet, it depends on the EDMA driver going in. Matt has submitted the EDMA driver for am1808, so we only need a hack to enable it on am335x and write a filter driver so hsmmc can use it. Work has slowed down on that due to people being on vacation, but I hope to have a 3.6 kernel with working mmc at the end of september.

regards,

Koen

For the eMMC cape I used this patch: https://github.com/beagleboard/kernel/blob/beaglebone-3.2/patches/beaglebone/0085-beaglebone-add-rudimentary-support-for-eMMC-cape.patch

And a matching kernel: https://github.com/koenkooi/linux/tree/linux-ti33x-psp-3.2.28-r16a+gitr720e07b4c1f687b61b147b31c698cb6816d72f01

Adapting that to your cape should be trivial.

I was wondering about going that route; the patches look like to do
the trick. I have your kernel forked off of Github and cloned onto my
Gentoo-running 'bone, so I'll tweak the patch for "REDWOLF-STORAGE"
and see if that works nicely. I also have to finagle MMC over SPI via
the SPI0 pins; we got the module, but pointing said module to use
SPI0... maybe SPI1 as well...

Gotta love breadboarding a cape.

Koen, you doing anything in the 3.6 kernel like this?

No mmc support in 3.6 yet, it depends on the EDMA driver going in. Matt has submitted the EDMA driver for am1808, so we only need a hack to enable it on am335x and write a filter driver so hsmmc can use it. Work has slowed down on that due to people being on vacation, but I hope to have a 3.6 kernel with working mmc at the end of september.

Okay, I'll keep targeting 3.2 then. When 3.6 comes out for the 'bone
I'll switch over.

You can track the progress here: https://github.com/beagleboard/kernel/tree/beaglebone-3.6
That's where all the kernel development for all the beagleboard.org boards is happening.