diff options
Diffstat (limited to 'recipes/linux/linux-2.6.30/ronetix-pm9g45/0005-Add-CompactFlash-to-at91sam9g45-architecture.patch')
-rw-r--r-- | recipes/linux/linux-2.6.30/ronetix-pm9g45/0005-Add-CompactFlash-to-at91sam9g45-architecture.patch | 143 |
1 files changed, 143 insertions, 0 deletions
diff --git a/recipes/linux/linux-2.6.30/ronetix-pm9g45/0005-Add-CompactFlash-to-at91sam9g45-architecture.patch b/recipes/linux/linux-2.6.30/ronetix-pm9g45/0005-Add-CompactFlash-to-at91sam9g45-architecture.patch new file mode 100644 index 0000000000..e97052065d --- /dev/null +++ b/recipes/linux/linux-2.6.30/ronetix-pm9g45/0005-Add-CompactFlash-to-at91sam9g45-architecture.patch @@ -0,0 +1,143 @@ +From 2297a86fcf8d9e2ecceee3d0905a8f054d91e9a5 Mon Sep 17 00:00:00 2001 +From: Asen Dimov <dimov@ronetix.at> +Date: Tue, 2 Mar 2010 01:51:37 +0200 +Subject: [PATCH] Add CompactFlash to at91sam9g45 architecture + +--- + arch/arm/mach-at91/at91sam9g45_devices.c | 106 ++++++++++++++++++++++++++++++ + drivers/pcmcia/Kconfig | 2 +- + 2 files changed, 107 insertions(+), 1 deletions(-) + +diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c +index 3d9c66e..26d2b72 100644 +--- a/arch/arm/mach-at91/at91sam9g45_devices.c ++++ b/arch/arm/mach-at91/at91sam9g45_devices.c +@@ -507,6 +507,112 @@ void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data) + void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data) {} + #endif + ++/* -------------------------------------------------------------------- ++ * Compact Flash (PCMCIA or IDE) ++ * -------------------------------------------------------------------- ++ */ ++ ++#if defined(CONFIG_AT91_CF) || defined(CONFIG_AT91_CF_MODULE) || \ ++ defined(CONFIG_BLK_DEV_IDE_AT91) || defined(CONFIG_BLK_DEV_IDE_AT91_MODULE) ++ ++static struct at91_cf_data cf0_data; ++ ++static struct resource cf0_resources[] = { ++ [0] = { ++ .start = AT91_CHIPSELECT_4, ++ .end = AT91_CHIPSELECT_4 + SZ_256M - 1, ++ .flags = IORESOURCE_MEM | IORESOURCE_MEM_8AND16BIT, ++ } ++}; ++ ++static struct platform_device cf0_device = { ++ .id = 0, ++ .dev = { ++ .platform_data = &cf0_data, ++ }, ++ .resource = cf0_resources, ++ .num_resources = ARRAY_SIZE(cf0_resources), ++}; ++ ++static struct at91_cf_data cf1_data; ++ ++static struct resource cf1_resources[] = { ++ [0] = { ++ .start = AT91_CHIPSELECT_5, ++ .end = AT91_CHIPSELECT_5 + SZ_256M - 1, ++ .flags = IORESOURCE_MEM | IORESOURCE_MEM_8AND16BIT, ++ } ++}; ++ ++static struct platform_device cf1_device = { ++ .id = 1, ++ .dev = { ++ .platform_data = &cf1_data, ++ }, ++ .resource = cf1_resources, ++ .num_resources = ARRAY_SIZE(cf1_resources), ++}; ++ ++void __init at91_add_device_cf(struct at91_cf_data *data) ++{ ++ unsigned long csa; ++ struct platform_device *pdev; ++ ++ if (!data) ++ return; ++ ++ /* ++ * assign CS4 or CS5 to SMC with Compact Flash logic support, ++ * we assume SMC timings are configured by board code, ++ * except True IDE where timings are controlled by driver ++ */ ++ csa = at91_sys_read(AT91_MATRIX_EBICSA); ++ switch (data->chipselect) { ++ case 4: ++ at91_set_A_periph(AT91_PIN_PC10, 0); /* EBI0_NCS4/CFCS0 */ ++ csa |= AT91_MATRIX_EBI_CS4A_SMC_CF0; ++ cf0_data = *data; ++ pdev = &cf0_device; ++ break; ++ case 5: ++ at91_set_A_periph(AT91_PIN_PC11, 0); /* EBI0_NCS5/CFCS1 */ ++ csa |= AT91_MATRIX_EBI_CS5A_SMC_CF1; ++ cf1_data = *data; ++ pdev = &cf1_device; ++ break; ++ default: ++ printk(KERN_ERR "AT91 CF: bad chip-select requested (%u)\n", ++ data->chipselect); ++ return; ++ } ++ at91_sys_write(AT91_MATRIX_EBICSA, csa); ++ ++ if (data->det_pin) { ++ at91_set_gpio_input(data->det_pin, 1); ++ at91_set_deglitch(data->det_pin, 1); ++ } ++ ++ if (data->irq_pin) { ++ at91_set_gpio_input(data->irq_pin, 1); ++ at91_set_deglitch(data->irq_pin, 1); ++ } ++ ++ if (data->vcc_pin) ++ /* initially off */ ++ at91_set_gpio_output(data->vcc_pin, 0); ++ ++ /* enable EBI controlled pins */ ++ at91_set_A_periph(AT91_PIN_PC15, 0); /* NWAIT */ ++ at91_set_A_periph(AT91_PIN_PC8, 0); /* CFCE1 */ ++ at91_set_A_periph(AT91_PIN_PC9, 0); /* CFCE2 */ ++ at91_set_A_periph(AT91_PIN_PC12, 0); /* CFNRW */ ++ ++ pdev->name = (data->flags & AT91_CF_TRUE_IDE) ? "at91_ide" : "at91_cf"; ++ platform_device_register(pdev); ++} ++#else ++void __init at91_add_device_cf(struct at91_cf_data *data) {} ++#endif + + /* -------------------------------------------------------------------- + * NAND / SmartMedia +diff --git a/drivers/pcmcia/Kconfig b/drivers/pcmcia/Kconfig +index e42d141..5790c67 100644 +--- a/drivers/pcmcia/Kconfig ++++ b/drivers/pcmcia/Kconfig +@@ -270,7 +270,7 @@ config BFIN_CFPCMCIA + + config AT91_CF + tristate "AT91 CompactFlash Controller" +- depends on PCMCIA && (ARCH_AT91RM9200 || ARCH_AT91SAM9260 || ARCH_AT91SAM9G20) ++ depends on PCMCIA && (ARCH_AT91RM9200 || ARCH_AT91SAM9260 || ARCH_AT91SAM9G20 || ARCH_AT91SAM9G45) + help + Say Y here to support the CompactFlash controller on AT91 chips. + Or choose M to compile the driver as a module named "at91_cf". +-- +1.5.5.6 + |