From: David Brownell <dbrown...@users.sourceforge.net>

This provides basic support for the CF slot on the dm6446 EVM.
Insert/remove events are not (currently) supported.

On a very small sample of cards, using "hdparm -tT" to measure
(and correct for buffer access), throughput is about 1.5 MB/sec.
That's a third what an ATA drive gives on the same system; the
CF cards do not support DMA access modes.  Root on an SD card
remains the fastest choice for non-NFS root (over 8 MB/sec).

(Unrelated:  remove obsolete ref to RTC.)

Signed-off-by: David Brownell <dbrown...@users.sourceforge.net>
---
Same as before, but the probe() call got rid of an #ifdef

 arch/arm/mach-davinci/Kconfig            |   11 +++++++++
 arch/arm/mach-davinci/board-dm644x-evm.c |   33 ++++++++++++++++++-----------
 2 files changed, 32 insertions(+), 12 deletions(-)

--- a/arch/arm/mach-davinci/Kconfig
+++ b/arch/arm/mach-davinci/Kconfig
@@ -26,6 +26,17 @@ config MACH_DAVINCI_EVM
          Configure this option to specify the whether the board used
          for development is a DM644x EVM
 
+config MACH_DAVINCI_EVM_CF
+       bool "Use CompactFlash, not IDE drive"
+       depends on MACH_DAVINCI_EVM && BLK_DEV_PALMCHIP_BK3710
+       help
+         Enable this if you want to use a CompactFlash card instead of
+         an IDE/ATA drive.  The CF card will be used in "True IDE" mode.
+
+         At this writing, CF insert and remove events are not supported.
+         Insert the CF at boot time, and leave it there until you power
+         the system off.
+
 config MACH_DAVINCI_DM646X_EVM
        bool "TI DM646x EVM"
        default n
--- a/arch/arm/mach-davinci/board-dm644x-evm.c
+++ b/arch/arm/mach-davinci/board-dm644x-evm.c
@@ -192,11 +192,6 @@ static struct platform_device davinci_fb
        .num_resources = 0,
 };
 
-static struct platform_device rtc_dev = {
-       .name           = "rtc_davinci_evm",
-       .id             = -1,
-};
-
 static struct resource ide_resources[] = {
        {
                .start          = DAVINCI_CFC_ATA_BASE,
@@ -368,6 +363,13 @@ static struct pcf857x_platform_data pcf_
 
 /* U35 - various I/O signals used to manage USB, CF, ATA, etc */
 
+#ifdef CONFIG_MACH_DAVINCI_EVM_CF
+#define USE_CF         1
+#else
+#define USE_CF         0
+#endif
+#define USE_HDD                (!USE_CF)
+
 static int
 evm_u35_setup(struct i2c_client *client, int gpio, unsigned ngpio, void *c)
 {
@@ -383,9 +385,9 @@ evm_u35_setup(struct i2c_client *client,
        gpio_request(gpio + 2, "VLYNQ_EN");
        gpio_direction_output(gpio + 2, 1);
 
-       /* p3 = n3V3_CF_RESET (initial: stay in reset) */
+       /* p3 = n3V3_CF_RESET (initial: stay reset unless using CF) */
        gpio_request(gpio + 3, "nCF_RESET");
-       gpio_direction_output(gpio + 3, 0);
+       gpio_direction_output(gpio + 3, USE_CF);
 
        /* (p4 unused) */
 
@@ -393,13 +395,13 @@ evm_u35_setup(struct i2c_client *client,
        gpio_request(gpio + 5, "WLAN_RESET");
        gpio_direction_output(gpio + 5, 1);
 
-       /* p6 = nATA_SEL (initial: select) */
+       /* p6 = nATA_SEL (initial: select unless CF is used) */
        gpio_request(gpio + 6, "nATA_SEL");
-       gpio_direction_output(gpio + 6, 0);
+       gpio_direction_output(gpio + 6, !USE_HDD);
 
-       /* p7 = nCF_SEL (initial: deselect) */
+       /* p7 = nCF_SEL (initial: select only if CF is used) */
        gpio_request(gpio + 7, "nCF_SEL");
-       gpio_direction_output(gpio + 7, 1);
+       gpio_direction_output(gpio + 7, !USE_CF);
 
        /* irlml6401 switches over 1A, in under 8 msec;
         * now it can be managed by nDRV_VBUS ...
@@ -488,6 +490,14 @@ static struct i2c_client *dm6446evm_msp;
 static int dm6446evm_msp_probe(struct i2c_client *client,
                const struct i2c_device_id *id)
 {
+       if (USE_CF) {
+               static const u8 cmdbuf[4] = { 4, 6, 0, BIT(3) | BIT(0), };
+
+               /* CF slot powered up: BIT(3) set.
+                * SmartMedia powered off: BIT(0) set.
+                */
+               i2c_master_send(client, cmdbuf, sizeof cmdbuf);
+       }
        dm6446evm_msp = client;
        return 0;
 }
@@ -612,7 +622,6 @@ static void __init evm_init_i2c(void)
 
 static struct platform_device *davinci_evm_devices[] __initdata = {
        &davinci_fb_device,
-       &rtc_dev,
 };
 
 static struct davinci_uart_config uart_config __initdata = {

_______________________________________________
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to