I have encountered a problem, which I have traced back to the kernel, when using an SD card on an eSATA plug that boots from NAND.
The problem is that the SD card is not recognised at all, but in some cases it may be recognised if it is inserted in a particular way (ie very quickly), or perhaps the first SD card that is inserted is recognised, but after it is removed, no other SD cards may be recognised.
My investigations tell me:
- SATA support (using the "sata_mv" module) was first offered in kernel version 2.6.33
- "Official support" for the eSATA Sheevaplug arrived with 2.6.34
- On an eSATA plug, with all kernels since 2.6.34, /dev/mmcblk0 is just fine if the plug is booted with arcNumber 2097
- Conversely, with all kernels since 2.6.34, if an eSATA plug is booted with arcNumber 2678, /dev/mmcblk0 is not recognised
- In the kernel source, in arch/arm/mach-kirkwood/sheevaplug-setup.c, there is some relevant code
Here are fragments of the code that I have been looking at:
static struct mvsdio_platform_data sheevaplug_mvsdio_data = {
/* unfortunately the CD signal has not been connected */
};
static struct mvsdio_platform_data sheeva_esata_mvsdio_data = {
.gpio_write_protect = 44, /* MPP44 used as SD write protect */
.gpio_card_detect = 47, /* MPP47 used as SD card detect */
};
static unsigned int sheevaplug_mpp_config[] __initdata = {
MPP29_GPIO, /* USB Power Enable */
MPP49_GPIO, /* LED */
0
};
static unsigned int sheeva_esata_mpp_config[] __initdata = {
MPP29_GPIO, /* USB Power Enable */
MPP44_GPIO, /* SD Write Protect */
MPP47_GPIO, /* SD Card Detect */
MPP49_GPIO, /* LED Green */
0
};
And here is where those different settings come into play:
/* setup gpio pin select */
if (machine_is_sheeva_esata())
kirkwood_mpp_conf(sheeva_esata_mpp_config);
else
kirkwood_mpp_conf(sheevaplug_mpp_config)
/* enable sd wp and sd cd on plugs with esata */
if (machine_is_sheeva_esata())
kirkwood_sdio_init(&sheeva_esata_mvsdio_data);
else
kirkwood_sdio_init(&sheevaplug_mvsdio_data);
Given the symptoms (that an eSATA plug can cope just fine with SD cards when it boots with arcNumber 2097 - albeit without the ability to use the eSATA port), it seems to me that the problem must lie here.
I don't know why there are different GPIO settings for eSATA and non-eSATA plugs, and by hacking the code I've so far only been able to create a totally non-bootable kernel. I'll try to find time again tomorrow to try again.