Beaglebone: Add second SD Card

hi,

I let this run for sometime & got this message:

[ 1.665527] Waiting for root device /dev/mmcblk0p2…
[ 1.754058] mmc0: host does not support reading read-only switch. assuming write-enable.
[ 1.767089] mmc0: new high speed SDHC card at address aaaa
[ 1.773529] mmcblk0: mmc0:aaaa SU08G 7.40 GiB
[ 1.780181] mmcblk0: p1 p2 p3
[ 1.858001] mmc1: host does not support reading read-only switch. assuming write-enable.
[ 1.868286] mmc1: new high speed SDHC card at address 0001
[ 1.874694] mmcblk1: mmc1:0001 00000 3.79 GiB

[ 240.151611] INFO: task kworker/u:1:36 blocked for more than 120 seconds.
[ 240.158721] “echo 0 > /proc/sys/kernel/hung_task_timeout_secs” disables this message.
[ 240.167083] kworker/u:1 D c0261211 0 36 2 0x00000000
[ 240.173889] INFO: task mmcqd/1:42 blocked for more than 120 seconds.
[ 240.180633] “echo 0 > /proc/sys/kernel/hung_task_timeout_secs” disables this message.
[ 240.188964] mmcqd/1 D c0261211 0 42 2 0x00000000
[ 360.191619] INFO: task kworker/u:1:36 blocked for more than 120 seconds.
[ 360.198730] “echo 0 > /proc/sys/kernel/hung_task_timeout_secs” disables this message.
[ 360.207092] kworker/u:1 D c0261211 0 36 2 0x00000000
[ 360.213897] INFO: task mmcqd/1:42 blocked for more than 120 seconds.
[ 360.220642] “echo 0 > /proc/sys/kernel/hung_task_timeout_secs” disables this message.
[ 360.228973] mmcqd/1 D c0261211 0 42 2 0x00000000
[ 480.231628] INFO: task kworker/u:1:36 blocked for more than 120 seconds.
[ 480.238739] “echo 0 > /proc/sys/kernel/hung_task_timeout_secs” disables this message.
[ 480.247070] kworker/u:1 D c0261211 0 36 2 0x00000000
[ 480.253875] INFO: task mmcqd/1:42 blocked for more than 120 seconds.
[ 480.260620] “echo 0 > /proc/sys/kernel/hung_task_timeout_secs” disables this message.
[ 480.268951] mmcqd/1 D c0261211 0 42 2 0x00000000
[ 600.271606] INFO: task kworker/u:1:36 blocked for more than 120 seconds.
[ 600.278717] “echo 0 > /proc/sys/kernel/hung_task_timeout_secs” disables this message.
[ 600.287078] kworker/u:1 D c0261211 0 36 2 0x00000000
[ 600.293884] INFO: task mmcqd/1:42 blocked for more than 120 seconds.
[ 600.300628] “echo 0 > /proc/sys/kernel/hung_task_timeout_secs” disables this message.
[ 600.308959] mmcqd/1 D c0261211 0 42 2 0x00000000
[ 720.311645] INFO: task kworker/u:1:36 blocked for more than 120 seconds.
[ 720.318756] “echo 0 > /proc/sys/kernel/hung_task_timeout_secs” disables this message.
[ 720.327117] kworker/u:1 D c0261211 0 36 2 0x00000000
[ 720.333923] INFO: task mmcqd/1:42 blocked for more than 120 seconds.
[ 720.340667] “echo 0 > /proc/sys/kernel/hung_task_timeout_secs” disables this message.
[ 720.348999] mmcqd/1 D c0261211 0 42 2 0x00000000

<7>[ 1472.531585] driver_probe_done: probe_count = 1

I googled a bit, seems like a known issue with mmc detection in omap/am335x. (Someone talked about a kernel hang up)

Any ideas? Anyone recollects any solution to this?

-Pj

This mostly is a problem with pin muxing. Can you share your code modifications?

It should be similar to this:
https://github.com/joelagnel/linux-kernel/commit/eb2de2da79861c191bcfff6c133a80b2dcbfe97b

Thanks,
Joel

Hi joel,

Here are the code changes:

these changes are done in arch/arm/mach-omap2/board-am335xevm.c

+/* Module pin mux for mmc1 */
+static struct pinmux_config mmc1_pin_mux_modular_hw[] = {

  • {“gpmc_ad3.mmc1_dat3”, OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLUP},
  • {“gpmc_ad2.mmc1_dat2”, OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLUP},
  • {“gpmc_ad1.mmc1_dat1”, OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLUP},
  • {“gpmc_ad0.mmc1_dat0”, OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLUP},
  • {“gpmc_csn1.mmc1_clk”, OMAP_MUX_MODE2 | AM33XX_PIN_INPUT_PULLUP},
  • {“gpmc_csn2.mmc1_cmd”, OMAP_MUX_MODE2 | AM33XX_PIN_INPUT_PULLUP},
  • {NULL, 0},
    +};

+static void mmc1_init_modular_hw(int evm_id, int profile)
+{

  • setup_pin_mux(mmc1_pin_mux_modular_hw);

This mostly is a problem with pin muxing. Can you share your code
modifications?

It should be similar to this:

https://github.com/joelagnel/linux-kernel/commit/eb2de2da79861c191bcfff6c133a80b2dcbfe97b

Thanks,
Joel

Hi joel,

Here are the code changes:

these changes are done in arch/arm/mach-omap2/board-am335xevm.c

[snip]

These are the only code changes that I have done. I'm not using CD or WP
pins. (The card does get detected).

In case you get any hints, please give inputs.

Koen here has done coding for an eMMC module in the 3.6/3.7 kernel
series, so it may be worth pushing up from the 3.2 series if it looks
like he's got things stable in 3.6 or 3.7.

Has this issue been resolved? Is there a working solution for a second SD card?

I had submitted a separate post asking about remoting the signals of the primary SD card, and was directed here as a related post. If a second SD card solution has been worked out, that would work for me too.

Thanks,

Ed Jubenville

What's the issue?

The board file for am335x_evm has the mmc1 pin mux and example platform
data, just use that. I run mmc1 for a custom cape second SD card with
no issue on Linux 3.2 from the evil vendor (TI, located in Arago)
kernel tree.

Maybe there'll be a mmc1 SD card cape some day...

-Andrew

Did you find that solution for a second SD card? If you do please help me.

marți, 16 octombrie 2012, 08:38:16 UTC+3, PJ a scris:

Did you find that solution for a second SD card? If you do please help
me.

What exactly is your issue? Adding another SD card on MMC1 works fine
for me on the 3.2 PSP kernel, which the below emails were in reference
to.

-Andrew

I try to add sd card on mmc1 and nand flash memory on my beaglebone and i don’t know how. I try to do compile kernel like in this video: http://www.youtube.com/watch?v=HJ9nUqYMjqs
and i can’t make it work.
Can you pls make me am totorial how to do that please.

luni, 10 iunie 2013, 15:16:00 UTC+3, Andrew Bradford a scris:

I done this change
static struct pinmux_config mmc1_pin_mux_modular_hw[] = {
{“gpmc_ad11.mmc1_dat3”, OMAP_MUX_MODE2 | AM33XX_PIN_INPUT_PULLUP},
{“gpmc_ad10.mmc1_dat2”, OMAP_MUX_MODE2 | AM33XX_PIN_INPUT_PULLUP},
{“gpmc_ad9.mmc1_dat1”, OMAP_MUX_MODE2 | AM33XX_PIN_INPUT_PULLUP},
{“gpmc_ad8.mmc1_dat0”, OMAP_MUX_MODE2 | AM33XX_PIN_INPUT_PULLUP},
{“gpmc_csn1.mmc1_clk”, OMAP_MUX_MODE2 | AM33XX_PIN_INPUT_PULLUP},
{“gpmc_csn2.mmc1_cmd”, OMAP_MUX_MODE2 | AM33XX_PIN_INPUT_PULLUP},
{NULL, 0},
};

static void mmc1_init_modular_hw(int evm_id, int profile) {
setup_pin_mux(mmc1_pin_mux_modular_hw);
am335x_mmc[1].mmc = 2;
am335x_mmc[1].caps = MMC_CAP_4_BIT_DATA;
am335x_mmc[1].gpio_cd = -EINVAL;
am335x_mmc[1].gpio_wp = -EINVAL;
am335x_mmc[1].ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34; /* 3V3 /
/
mmc will be initialized when mmc0_init is called */
return;
}

/* Beaglebone < Rev A3 */
static struct evm_dev_cfg beaglebone_old_dev_cfg[] = {
{tps65217_init, DEV_ON_BASEBOARD, PROFILE_NONE},
{rmii1_init, DEV_ON_BASEBOARD, PROFILE_NONE},
{usb0_init, DEV_ON_BASEBOARD, PROFILE_NONE},
{usb1_init, DEV_ON_BASEBOARD, PROFILE_NONE},
{i2c2_init, DEV_ON_BASEBOARD, PROFILE_NONE},
{mmc1_init_modular_hw, DEV_ON_BASEBOARD, PROFILE_NONE},
{mmc0_init, DEV_ON_BASEBOARD, PROFILE_NONE},
{bonew1_gpio_init, DEV_ON_BASEBOARD, PROFILE_ALL},
{NULL, 0, 0},
};

/* Beaglebone Rev A3 and after */
static struct evm_dev_cfg beaglebone_dev_cfg[] = {
{tps65217_init, DEV_ON_BASEBOARD, PROFILE_NONE},
{mii1_init, DEV_ON_BASEBOARD, PROFILE_NONE},
{usb0_init, DEV_ON_BASEBOARD, PROFILE_NONE},
{usb1_init, DEV_ON_BASEBOARD, PROFILE_NONE},
{i2c2_init, DEV_ON_BASEBOARD, PROFILE_NONE},
{mmc1_init_modular_hw, DEV_ON_BASEBOARD, PROFILE_NONE},
{mmc0_init, DEV_ON_BASEBOARD, PROFILE_NONE},
{boneleds_init, DEV_ON_BASEBOARD, PROFILE_ALL},
{bonew1_gpio_init, DEV_ON_BASEBOARD, PROFILE_ALL},
{NULL, 0, 0},
{NULL, 0, 0},
};

on that file arch/arm/mach-omap2/board-am335xevm.c but this file is not in the kernel that i build 3.2 i add it but still not work.
I try to add SD card on mmc1 and NAND flash memory on the GPMC pins
Can you help me?

From a HW perspective, did you add the required EXTERNAL pullup resistors on your board? Are all the traces to the MMC matched lengths in your PCB layout?

Gerald

I make the circuit use for mmc0 that is in the manual and for nand i use the circuit from http://beagleboardtoys.info/index.php?title=BeagleBone_4Gb_16-Bit_NAND_Module but i use only the resistors and capactor.
http://imageshack.us/g/13/circuitsl.jpg/
Resistor 10k
Capacitors 10uF and 0.1uF i use in the circuits

Your NAND schematic has no pin numbers on it.

I also see on MMC that you are not using the CD signal, which should not be required but may be due to SW. So, to say you used the MMC from the manual is incorrect.

Gerald

i use only this pins i add it on this photo http://imageshack.us/photo/my-images/580/circuits2.jpg/
Is ok ?

This are the component i use
http://ro.farnell.com/jsp/search/productdetail.jsp?sku=1764372
http://ro.farnell.com/jsp/search/productdetail.jsp?sku=2147273

Please say what is wrong.

I see no signal names on the NAND signals.

Gerald

I also see on MMC that you are not using the CD signal, which should not be required but may be due to SW. So, to say you used the MMC from the manual is incorrect.

And how i can connect this pin ?

Not sure you can from the expansion header. You can use a GPIO as that pin and modify the drivers to look for it. Without SW support ADDED tot he image, the MMC will not work.

Gerald

the back of the PCB
http://imageshack.us/photo/my-images/12/img20130610171249.jpg/

Can you make me an circuit how to connect correct ?