Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
[pandora-kernel.git] / arch / arm / mach-imx / mm-imx35.c
index c880e6d..98769ae 100644 (file)
@@ -25,9 +25,9 @@
 #include <asm/hardware/cache-l2x0.h>
 
 #include <mach/common.h>
+#include <mach/devices-common.h>
 #include <mach/hardware.h>
 #include <mach/iomux-v3.h>
-#include <mach/gpio.h>
 #include <mach/irqs.h>
 
 static struct map_desc mx35_io_desc[] __initdata = {
@@ -50,14 +50,61 @@ void __init imx35_init_early(void)
        mxc_arch_reset_init(MX35_IO_ADDRESS(MX35_WDOG_BASE_ADDR));
 }
 
-static struct mxc_gpio_port imx35_gpio_ports[] = {
-       DEFINE_IMX_GPIO_PORT_IRQ(MX35, 0, 1, MX35_INT_GPIO1),
-       DEFINE_IMX_GPIO_PORT_IRQ(MX35, 1, 2, MX35_INT_GPIO2),
-       DEFINE_IMX_GPIO_PORT_IRQ(MX35, 2, 3, MX35_INT_GPIO3),
-};
-
 void __init mx35_init_irq(void)
 {
        mxc_init_irq(MX35_IO_ADDRESS(MX35_AVIC_BASE_ADDR));
-       mxc_gpio_init(imx35_gpio_ports, ARRAY_SIZE(imx35_gpio_ports));
+}
+
+static struct sdma_script_start_addrs imx35_to1_sdma_script __initdata = {
+       .ap_2_ap_addr = 642,
+       .uart_2_mcu_addr = 817,
+       .mcu_2_app_addr = 747,
+       .uartsh_2_mcu_addr = 1183,
+       .per_2_shp_addr = 1033,
+       .mcu_2_shp_addr = 961,
+       .ata_2_mcu_addr = 1333,
+       .mcu_2_ata_addr = 1252,
+       .app_2_mcu_addr = 683,
+       .shp_2_per_addr = 1111,
+       .shp_2_mcu_addr = 892,
+};
+
+static struct sdma_script_start_addrs imx35_to2_sdma_script __initdata = {
+       .ap_2_ap_addr = 729,
+       .uart_2_mcu_addr = 904,
+       .per_2_app_addr = 1597,
+       .mcu_2_app_addr = 834,
+       .uartsh_2_mcu_addr = 1270,
+       .per_2_shp_addr = 1120,
+       .mcu_2_shp_addr = 1048,
+       .ata_2_mcu_addr = 1429,
+       .mcu_2_ata_addr = 1339,
+       .app_2_per_addr = 1531,
+       .app_2_mcu_addr = 770,
+       .shp_2_per_addr = 1198,
+       .shp_2_mcu_addr = 979,
+};
+
+static struct sdma_platform_data imx35_sdma_pdata __initdata = {
+       .sdma_version = 2,
+       .fw_name = "sdma-imx35-to2.bin",
+       .script_addrs = &imx35_to2_sdma_script,
+};
+
+void __init imx35_soc_init(void)
+{
+       int to_version = mx35_revision() >> 4;
+
+       /* i.mx35 has the i.mx31 type gpio */
+       mxc_register_gpio("imx31-gpio", 0, MX35_GPIO1_BASE_ADDR, SZ_16K, MX35_INT_GPIO1, 0);
+       mxc_register_gpio("imx31-gpio", 1, MX35_GPIO2_BASE_ADDR, SZ_16K, MX35_INT_GPIO2, 0);
+       mxc_register_gpio("imx31-gpio", 2, MX35_GPIO3_BASE_ADDR, SZ_16K, MX35_INT_GPIO3, 0);
+
+       if (to_version == 1) {
+               strncpy(imx35_sdma_pdata.fw_name, "sdma-imx35-to1.bin",
+                       strlen(imx35_sdma_pdata.fw_name));
+               imx35_sdma_pdata.script_addrs = &imx35_to1_sdma_script;
+       }
+
+       imx_add_imx_sdma(MX35_SDMA_BASE_ADDR, MX35_INT_SDMA, &imx35_sdma_pdata);
 }