[Arm-netbook] SD card issue
Frans Pop
elendil at planet.nl
Tue Mar 30 07:20:18 BST 2010
On Monday 29 March 2010, Ben Dooks wrote:
> IIRC, it isn't really a NAND chip, it is a board-mounted SD style
> device, and it may be that the system is sharing the card-detect lines.
I don't think so as it all does work correctly with the original ChiTech kernel.
AFAICT there is simply something miscoded in the kernel. Look at this:
Mar 30 05:29:16 kernel: [s3c_hsmmc_probe]: s3c-hsmmc.0: at 0xcfe00000 with irq 56. clk src: sclk_DOUTmpll_mmc0
Mar 30 05:29:16 kernel: [s3c_hsmmc_probe]: s3c-hsmmc.1: at 0xd0000000 with irq 57. clk src: sclk_DOUTmpll_mmc1
Mar 30 05:29:16 kernel: mmc1: host does not support reading read-only switch. assuming write-enable.
Mar 30 05:29:16 kernel: mmc1: new SD card at address 8879
[...]
Mar 30 05:29:16 kernel: mmc0: host does not support reading read-only switch. assuming write-enable.
Mar 30 05:29:16 kernel: mmc0: new high speed SD card at address c971
Mar 30 05:29:16 kernel: mmcblk0: mmc0:c971 SE02G 1931264KiB
Mar 30 05:29:16 kernel: mmcblk0: p1 p2
[... I remove the external card ...]
Mar 30 05:31:44 kernel: s3c-hsmmc: card removed.
Mar 30 05:31:45 kernel: mmc0: card c971 removed
Mar 30 05:31:50 kernel: Buffer I/O error on device mmcblk0p2, logical block 1
"Address 8879" is the same address I get when I insert the SD card in my
HP laptop. So, the initial identification is correct.
But when I remove the external card (i.e. 8879) on mmc1, the kernel thinks
that the internal one with address c971 on mmc0 was removed.
Initially we had the two devices reversed: the external card was assigned
to mmc0 and the internal one to mmc1. To fix this, Luke made the following
change in arch/arm/mach-s3c6410/mach-ctpc89e.c ("our" machine definition,
based on the one for SMDK6410):
static struct platform_device *pc89e_devices[] __initdata = {
[...]
- &s3c_device_hsmmc1, /* INAND initialize before SD card */
&s3c_device_hsmmc0,
+ &s3c_device_hsmmc1,
- &s3c_device_hsmmc2,
+ //&s3c_device_hsmmc2,
That resulted in the assignments being swapped, but I think that change is
incomplete (or incorrect?) and is causing this issue. Possibly additional
changes are needed in pc89e_hsmmc_init() or hsmmc_set_gpio()? Or maybe
the swapping of the devices needs to be done differently?
From reading the source it looks like card removal is signalled with an
interrupt. AFAICT s3c_hsmmc_irq() is getting called with the wrong
dev_id for the external card slot.
I have a debug log now. I'll see if I can get anything from that.
Cheers,
FJP
More information about the Arm-netbook
mailing list