vserver 2.0 rc7
[linux-2.6.git] / arch / arm / mach-omap / board-osk.c
index 51c6168..a951fc8 100644 (file)
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 
-#include <asm/arch/clocks.h>
 #include <asm/arch/gpio.h>
-#include <asm/arch/fpga.h>
 #include <asm/arch/usb.h>
+#include <asm/arch/mux.h>
+#include <asm/arch/tc.h>
 
 #include "common.h"
 
@@ -52,7 +52,7 @@ static int __initdata osk_serial_ports[OMAP_MAX_NR_PORTS] = {1, 0, 0};
 static struct resource osk5912_smc91x_resources[] = {
        [0] = {
                .start  = OMAP_OSK_ETHR_START,          /* Physical */
-               .end    = OMAP_OSK_ETHR_START + SZ_4K,
+               .end    = OMAP_OSK_ETHR_START + 0xf,
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
@@ -64,13 +64,32 @@ static struct resource osk5912_smc91x_resources[] = {
 
 static struct platform_device osk5912_smc91x_device = {
        .name           = "smc91x",
-       .id             = 0,
+       .id             = -1,
        .num_resources  = ARRAY_SIZE(osk5912_smc91x_resources),
        .resource       = osk5912_smc91x_resources,
 };
 
+static struct resource osk5912_cf_resources[] = {
+       [0] = {
+               .start  = OMAP_GPIO_IRQ(62),
+               .end    = OMAP_GPIO_IRQ(62),
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device osk5912_cf_device = {
+       .name           = "omap_cf",
+       .id             = -1,
+       .dev = {
+               .platform_data  = (void *) 2 /* CS2 */,
+       },
+       .num_resources  = ARRAY_SIZE(osk5912_cf_resources),
+       .resource       = osk5912_cf_resources,
+};
+
 static struct platform_device *osk5912_devices[] __initdata = {
        &osk5912_smc91x_device,
+       &osk5912_cf_device,
 };
 
 static void __init osk_init_smc91x(void)
@@ -80,6 +99,20 @@ static void __init osk_init_smc91x(void)
                return;
        }
        omap_set_gpio_edge_ctrl(0, OMAP_GPIO_RISING_EDGE);
+
+       /* Check EMIFS wait states to fix errors with SMC_GET_PKT_HDR */
+       EMIFS_CCS(1) |= 0x2;
+}
+
+static void __init osk_init_cf(void)
+{
+       omap_cfg_reg(M7_1610_GPIO62);
+       if ((omap_request_gpio(62)) < 0) {
+               printk("Error requesting gpio 62 for CF irq\n");
+               return;
+       }
+       /* it's really active-low */
+       omap_set_gpio_edge_ctrl(62, OMAP_GPIO_FALLING_EDGE);
 }
 
 void osk_init_irq(void)
@@ -87,12 +120,22 @@ void osk_init_irq(void)
        omap_init_irq();
        omap_gpio_init();
        osk_init_smc91x();
+       osk_init_cf();
 }
 
 static struct omap_usb_config osk_usb_config __initdata = {
-       /* has usb host and device, but no Mini-AB port */
+       /* has usb host connector (A) ... for development it can also
+        * be used, with a NONSTANDARD gender-bending cable/dongle, as
+        * a peripheral.
+        */
+#ifdef CONFIG_USB_GADGET_OMAP
+       .register_dev   = 1,
+       .hmc_mode       = 0,
+#else
        .register_host  = 1,
        .hmc_mode       = 16,
+       .rwc            = 1,
+#endif
        .pins[0]        = 2,
 };
 
@@ -102,9 +145,10 @@ static struct omap_board_config_kernel osk_config[] = {
 
 static void __init osk_init(void)
 {
-        platform_add_devices(osk5912_devices, ARRAY_SIZE(osk5912_devices));
+       platform_add_devices(osk5912_devices, ARRAY_SIZE(osk5912_devices));
        omap_board_config = osk_config;
        omap_board_config_size = ARRAY_SIZE(osk_config);
+       USB_TRANSCEIVER_CTRL_REG |= (3 << 1);
 }
 
 static void __init osk_map_io(void)