Using PATA Platform Driver to access Memory Mapped CF Card

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I have a CF slot mapped to a GP bus on a board I'm porting linux to. It is
wired in 8-bit Memory Mode only with only A0 - A3 mapped from the address
bus (starting at 0x20000000). I know the arrangement works as this board is
successfully accessing CF cards using existing proprietary firmware.

I have added some platform specific initialisation to the kernel. I came to
the 0x2000000E by looking at some blackfin examples (particularly
mach-bf537/boards/stamp.c) - I do not know if this is exactly right

static struct pata_platform_info enet_pata_platform_data = {
	.ioport_shift = 0,
};

static struct resource enet_pata_resources[] = {
	{
		.start = 0x20000000,
		.end = 0x20000007,
		.flags = IORESOURCE_MEM,
	},
	{
		.start = 0x2000000E,
		.end = 0x2000000E,
		.flags = IORESOURCE_MEM,
	},
};

static struct platform_device enet_pata_device = {
	.name = "pata_platform",
	.id = -1,
	.num_resources = ARRAY_SIZE(enet_pata_resources),
	.resource = enet_pata_resources,
	.dev = {
		.platform_data = &enet_pata_platform_data,
	}
};

static struct platform_device *enet_devices[] __initdata = {
	&enet_pata_device,
};

static int __init enet_init(void)
{
	printk(KERN_INFO "%s(): registering device resources\n", __func__);
	platform_add_devices(enet_devices, ARRAY_SIZE(enet_devices));
	return 0;
}

arch_initcall(enet_init);

Which results in the following kernel messages (With a 512MB SanDisk Card):
[    0.065999] enet_init(): registering device resources
...
[    1.988931] scsi0 : pata_platform
[    1.996940] ata1: PATA max PIO0 no IRQ, using PIO polling mmio cmd
0x20000000 ctl 0x2000000e
...
[    2.168883] ata1.00: failed to IDENTIFY (I/O error, err_mask=0x2)
[    1.995794] ata1.01: NODEV after polling detection
[    2.013803] ata1.00: failed to IDENTIFY (I/O error, err_mask=0x2)
...
[    7.146794] ata1.01: NODEV after polling detection
[    7.164802] ata1.00: failed to IDENTIFY (I/O error, err_mask=0x2)
[   12.297794] ata1.01: NODEV after polling detection
[   12.315802] ata1.00: failed to IDENTIFY (I/O error, err_mask=0x2)
[   17.448794] ata1.01: NODEV after polling detection

And similar with a 1G UltraII and 4G Extreme III but they do not generate
the NODEV message. With no card inserted I get neither the NODEV nor the
failed to IDENTIFY messages. It looks like something is at least partially
working.

Can anyone tell me how to go about enabling an appropriate level of
debugging options, and what I should be looking out for?

TIA

Graeme
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux