]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
[ARM] MX35 devices support
authorSascha Hauer <s.hauer@pengutronix.de>
Fri, 6 Feb 2009 14:38:51 +0000 (15:38 +0100)
committerSascha Hauer <s.hauer@pengutronix.de>
Fri, 13 Mar 2009 09:34:28 +0000 (10:34 +0100)
The i.MX35 basically features the same peripherals as the i.MX31 with
some differences:

- The i.MX35 has a FEC ethernet controller
- The NAND controller base addresses are different
- The i.MX35 has only 3 UARTs

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
arch/arm/mach-mx3/devices.c
arch/arm/mach-mx3/devices.h

index b7d4900b02e49897c3b41e6c2fcdabf087e7c64a..ab090602cea46fcd4dde3bd1212115e333a80e84 100644 (file)
@@ -84,6 +84,7 @@ struct platform_device mxc_uart_device2 = {
        .num_resources = ARRAY_SIZE(uart2),
 };
 
+#ifdef CONFIG_ARCH_MX31
 static struct resource uart3[] = {
        {
                .start = UART4_BASE_ADDR,
@@ -121,6 +122,7 @@ struct platform_device mxc_uart_device4 = {
        .resource = uart4,
        .num_resources = ARRAY_SIZE(uart4),
 };
+#endif /* CONFIG_ARCH_MX31 */
 
 /* GPIO port description */
 static struct mxc_gpio_port imx_gpio_ports[] = {
@@ -166,8 +168,8 @@ struct platform_device mxc_w1_master_device = {
 
 static struct resource mxc_nand_resources[] = {
        {
-               .start  = NFC_BASE_ADDR,
-               .end    = NFC_BASE_ADDR + 0xfff,
+               .start  = 0, /* runtime dependent */
+               .end    = 0,
                .flags  = IORESOURCE_MEM
        }, {
                .start  = MXC_INT_NANDFC,
@@ -290,3 +292,40 @@ struct platform_device mx3_fb = {
                .coherent_dma_mask = 0xffffffff,
        },
 };
+
+#ifdef CONFIG_ARCH_MX35
+static struct resource mxc_fec_resources[] = {
+       {
+               .start  = MXC_FEC_BASE_ADDR,
+               .end    = MXC_FEC_BASE_ADDR + 0xfff,
+               .flags  = IORESOURCE_MEM
+       }, {
+               .start  = MXC_INT_FEC,
+               .end    = MXC_INT_FEC,
+               .flags  = IORESOURCE_IRQ
+       },
+};
+
+struct platform_device mxc_fec_device = {
+       .name = "fec",
+       .id = 0,
+       .num_resources = ARRAY_SIZE(mxc_fec_resources),
+       .resource = mxc_fec_resources,
+};
+#endif
+
+static int mx3_devices_init(void)
+{
+       if (cpu_is_mx31()) {
+               mxc_nand_resources[0].start = MX31_NFC_BASE_ADDR;
+               mxc_nand_resources[0].end = MX31_NFC_BASE_ADDR + 0xfff;
+       }
+       if (cpu_is_mx35()) {
+               mxc_nand_resources[0].start = MX35_NFC_BASE_ADDR;
+               mxc_nand_resources[0].end = MX35_NFC_BASE_ADDR + 0xfff;
+       }
+
+       return 0;
+}
+
+subsys_initcall(mx3_devices_init);
index d1638518a9d6a4d80fdae7ac6aa1ae6a5f313899..4faac6552e0035255d2a85d345766d789c97b188 100644 (file)
@@ -11,3 +11,4 @@ extern struct platform_device mxc_i2c_device1;
 extern struct platform_device mxc_i2c_device2;
 extern struct platform_device mx3_ipu;
 extern struct platform_device mx3_fb;
+extern struct platform_device mxc_fec_device;