aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2010-11-15 09:28:45 -0500
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>2010-11-19 15:54:36 -0500
commit742269e2d971957c84f364c4e9f5c6439964ef01 (patch)
treebebc9ea6b88df9424494000316e5b0c1098becdb /arch
parent2d58de2805f93bdb8fa0608d98e1871bb28ec091 (diff)
ARM: mx3: dynamically allocate imx2-wdt devices
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-mx3/Kconfig4
-rw-r--r--arch/arm/mach-mx3/devices-imx31.h4
-rw-r--r--arch/arm/mach-mx3/devices-imx35.h4
-rw-r--r--arch/arm/mach-mx3/devices.c33
-rw-r--r--arch/arm/mach-mx3/devices.h1
-rw-r--r--arch/arm/mach-mx3/mach-cpuimx35.c6
-rw-r--r--arch/arm/mach-mx3/mach-pcm037.c2
-rw-r--r--arch/arm/mach-mx3/mach-pcm043.c2
-rw-r--r--arch/arm/mach-mx3/mx31lite-db.c2
-rw-r--r--arch/arm/plat-mxc/devices/platform-imx2-wdt.c10
10 files changed, 26 insertions, 42 deletions
diff --git a/arch/arm/mach-mx3/Kconfig b/arch/arm/mach-mx3/Kconfig
index 157348354b7f..bcfcf9ad76e5 100644
--- a/arch/arm/mach-mx3/Kconfig
+++ b/arch/arm/mach-mx3/Kconfig
@@ -51,6 +51,7 @@ config MACH_PCM037
51 bool "Support Phytec pcm037 (i.MX31) platforms" 51 bool "Support Phytec pcm037 (i.MX31) platforms"
52 select SOC_IMX31 52 select SOC_IMX31
53 select IMX_HAVE_PLATFORM_FSL_USB2_UDC 53 select IMX_HAVE_PLATFORM_FSL_USB2_UDC
54 select IMX_HAVE_PLATFORM_IMX2_WDT
54 select IMX_HAVE_PLATFORM_IMX_I2C 55 select IMX_HAVE_PLATFORM_IMX_I2C
55 select IMX_HAVE_PLATFORM_IMX_UART 56 select IMX_HAVE_PLATFORM_IMX_UART
56 select IMX_HAVE_PLATFORM_MXC_EHCI 57 select IMX_HAVE_PLATFORM_MXC_EHCI
@@ -75,6 +76,7 @@ config MACH_MX31LITE
75 bool "Support MX31 LITEKIT (LogicPD)" 76 bool "Support MX31 LITEKIT (LogicPD)"
76 select SOC_IMX31 77 select SOC_IMX31
77 select MXC_ULPI if USB_ULPI 78 select MXC_ULPI if USB_ULPI
79 select IMX_HAVE_PLATFORM_IMX2_WDT
78 select IMX_HAVE_PLATFORM_IMX_UART 80 select IMX_HAVE_PLATFORM_IMX_UART
79 select IMX_HAVE_PLATFORM_MXC_EHCI 81 select IMX_HAVE_PLATFORM_MXC_EHCI
80 select IMX_HAVE_PLATFORM_MXC_MMC 82 select IMX_HAVE_PLATFORM_MXC_MMC
@@ -143,6 +145,7 @@ config MACH_PCM043
143 bool "Support Phytec pcm043 (i.MX35) platforms" 145 bool "Support Phytec pcm043 (i.MX35) platforms"
144 select SOC_IMX35 146 select SOC_IMX35
145 select IMX_HAVE_PLATFORM_FSL_USB2_UDC 147 select IMX_HAVE_PLATFORM_FSL_USB2_UDC
148 select IMX_HAVE_PLATFORM_IMX2_WDT
146 select IMX_HAVE_PLATFORM_IMX_I2C 149 select IMX_HAVE_PLATFORM_IMX_I2C
147 select IMX_HAVE_PLATFORM_IMX_SSI 150 select IMX_HAVE_PLATFORM_IMX_SSI
148 select IMX_HAVE_PLATFORM_IMX_UART 151 select IMX_HAVE_PLATFORM_IMX_UART
@@ -193,6 +196,7 @@ config MACH_EUKREA_CPUIMX35
193 bool "Support Eukrea CPUIMX35 Platform" 196 bool "Support Eukrea CPUIMX35 Platform"
194 select SOC_IMX35 197 select SOC_IMX35
195 select IMX_HAVE_PLATFORM_FSL_USB2_UDC 198 select IMX_HAVE_PLATFORM_FSL_USB2_UDC
199 select IMX_HAVE_PLATFORM_IMX2_WDT
196 select IMX_HAVE_PLATFORM_IMX_UART 200 select IMX_HAVE_PLATFORM_IMX_UART
197 select IMX_HAVE_PLATFORM_IMX_I2C 201 select IMX_HAVE_PLATFORM_IMX_I2C
198 select IMX_HAVE_PLATFORM_MXC_EHCI 202 select IMX_HAVE_PLATFORM_MXC_EHCI
diff --git a/arch/arm/mach-mx3/devices-imx31.h b/arch/arm/mach-mx3/devices-imx31.h
index 6571dd795e97..109f0bc3b524 100644
--- a/arch/arm/mach-mx3/devices-imx31.h
+++ b/arch/arm/mach-mx3/devices-imx31.h
@@ -13,6 +13,10 @@ extern const struct imx_fsl_usb2_udc_data imx31_fsl_usb2_udc_data __initconst;
13#define imx31_add_fsl_usb2_udc(pdata) \ 13#define imx31_add_fsl_usb2_udc(pdata) \
14 imx_add_fsl_usb2_udc(&imx31_fsl_usb2_udc_data, pdata) 14 imx_add_fsl_usb2_udc(&imx31_fsl_usb2_udc_data, pdata)
15 15
16extern const struct imx_imx2_wdt_data imx31_imx2_wdt_data __initconst;
17#define imx31_add_imx2_wdt(pdata) \
18 imx_add_imx2_wdt(&imx31_imx2_wdt_data)
19
16extern const struct imx_imx_i2c_data imx31_imx_i2c_data[] __initconst; 20extern const struct imx_imx_i2c_data imx31_imx_i2c_data[] __initconst;
17#define imx31_add_imx_i2c(id, pdata) \ 21#define imx31_add_imx_i2c(id, pdata) \
18 imx_add_imx_i2c(&imx31_imx_i2c_data[id], pdata) 22 imx_add_imx_i2c(&imx31_imx_i2c_data[id], pdata)
diff --git a/arch/arm/mach-mx3/devices-imx35.h b/arch/arm/mach-mx3/devices-imx35.h
index 849c48a2c472..763ee9754773 100644
--- a/arch/arm/mach-mx3/devices-imx35.h
+++ b/arch/arm/mach-mx3/devices-imx35.h
@@ -23,6 +23,10 @@ extern const struct imx_flexcan_data imx35_flexcan_data[] __initconst;
23#define imx35_add_flexcan0(pdata) imx35_add_flexcan(0, pdata) 23#define imx35_add_flexcan0(pdata) imx35_add_flexcan(0, pdata)
24#define imx35_add_flexcan1(pdata) imx35_add_flexcan(1, pdata) 24#define imx35_add_flexcan1(pdata) imx35_add_flexcan(1, pdata)
25 25
26extern const struct imx_imx2_wdt_data imx35_imx2_wdt_data __initconst;
27#define imx35_add_imx2_wdt(pdata) \
28 imx_add_imx2_wdt(&imx35_imx2_wdt_data)
29
26extern const struct imx_imx_i2c_data imx35_imx_i2c_data[] __initconst; 30extern const struct imx_imx_i2c_data imx35_imx_i2c_data[] __initconst;
27#define imx35_add_imx_i2c(id, pdata) \ 31#define imx35_add_imx_i2c(id, pdata) \
28 imx_add_imx_i2c(&imx35_imx_i2c_data[id], pdata) 32 imx_add_imx_i2c(&imx35_imx_i2c_data[id], pdata)
diff --git a/arch/arm/mach-mx3/devices.c b/arch/arm/mach-mx3/devices.c
index c122c0faaaa5..448fe5614e4f 100644
--- a/arch/arm/mach-mx3/devices.c
+++ b/arch/arm/mach-mx3/devices.c
@@ -95,19 +95,6 @@ struct platform_device mx3_camera = {
95 }, 95 },
96}; 96};
97 97
98static struct resource imx_wdt_resources[] = {
99 {
100 .flags = IORESOURCE_MEM,
101 },
102};
103
104struct platform_device imx_wdt_device0 = {
105 .name = "imx2-wdt",
106 .id = 0,
107 .num_resources = ARRAY_SIZE(imx_wdt_resources),
108 .resource = imx_wdt_resources,
109};
110
111static struct resource imx_rtc_resources[] = { 98static struct resource imx_rtc_resources[] = {
112 { 99 {
113 .start = MX31_RTC_BASE_ADDR, 100 .start = MX31_RTC_BASE_ADDR,
@@ -145,23 +132,3 @@ struct platform_device imx_kpp_device = {
145 .num_resources = ARRAY_SIZE(imx_kpp_resources), 132 .num_resources = ARRAY_SIZE(imx_kpp_resources),
146 .resource = imx_kpp_resources, 133 .resource = imx_kpp_resources,
147}; 134};
148
149static int __init mx3_devices_init(void)
150{
151#if defined(CONFIG_ARCH_MX31)
152 if (cpu_is_mx31()) {
153 imx_wdt_resources[0].start = MX31_WDOG_BASE_ADDR;
154 imx_wdt_resources[0].end = MX31_WDOG_BASE_ADDR + 0x3fff;
155 }
156#endif
157#if defined(CONFIG_ARCH_MX35)
158 if (cpu_is_mx35()) {
159 imx_wdt_resources[0].start = MX35_WDOG_BASE_ADDR;
160 imx_wdt_resources[0].end = MX35_WDOG_BASE_ADDR + 0x3fff;
161 }
162#endif
163
164 return 0;
165}
166
167subsys_initcall(mx3_devices_init);
diff --git a/arch/arm/mach-mx3/devices.h b/arch/arm/mach-mx3/devices.h
index 1bc2918ba04c..2f9f87725e7b 100644
--- a/arch/arm/mach-mx3/devices.h
+++ b/arch/arm/mach-mx3/devices.h
@@ -1,6 +1,5 @@
1extern struct platform_device mx3_ipu; 1extern struct platform_device mx3_ipu;
2extern struct platform_device mx3_fb; 2extern struct platform_device mx3_fb;
3extern struct platform_device mx3_camera; 3extern struct platform_device mx3_camera;
4extern struct platform_device imx_wdt_device0;
5extern struct platform_device imx_rtc_device0; 4extern struct platform_device imx_rtc_device0;
6extern struct platform_device imx_kpp_device; 5extern struct platform_device imx_kpp_device;
diff --git a/arch/arm/mach-mx3/mach-cpuimx35.c b/arch/arm/mach-mx3/mach-cpuimx35.c
index 0af1e84d8f9d..dda19883ffe2 100644
--- a/arch/arm/mach-mx3/mach-cpuimx35.c
+++ b/arch/arm/mach-mx3/mach-cpuimx35.c
@@ -72,10 +72,6 @@ static struct i2c_board_info eukrea_cpuimx35_i2c_devices[] = {
72 }, 72 },
73}; 73};
74 74
75static struct platform_device *devices[] __initdata = {
76 &imx_wdt_device0,
77};
78
79static struct pad_desc eukrea_cpuimx35_pads[] = { 75static struct pad_desc eukrea_cpuimx35_pads[] = {
80 /* UART1 */ 76 /* UART1 */
81 MX35_PAD_CTS1__UART1_CTS, 77 MX35_PAD_CTS1__UART1_CTS,
@@ -156,7 +152,7 @@ static void __init mxc_board_init(void)
156 ARRAY_SIZE(eukrea_cpuimx35_pads)); 152 ARRAY_SIZE(eukrea_cpuimx35_pads));
157 153
158 imx35_add_fec(NULL); 154 imx35_add_fec(NULL);
159 platform_add_devices(devices, ARRAY_SIZE(devices)); 155 imx35_add_imx2_wdt(NULL);
160 156
161 imx35_add_imx_uart0(&uart_pdata); 157 imx35_add_imx_uart0(&uart_pdata);
162 imx35_add_mxc_nand(&eukrea_cpuimx35_nand_board_info); 158 imx35_add_mxc_nand(&eukrea_cpuimx35_nand_board_info);
diff --git a/arch/arm/mach-mx3/mach-pcm037.c b/arch/arm/mach-mx3/mach-pcm037.c
index 2d297436820b..cb657692b805 100644
--- a/arch/arm/mach-mx3/mach-pcm037.c
+++ b/arch/arm/mach-mx3/mach-pcm037.c
@@ -440,7 +440,6 @@ static int __init pcm037_camera_alloc_dma(const size_t buf_size)
440static struct platform_device *devices[] __initdata = { 440static struct platform_device *devices[] __initdata = {
441 &pcm037_flash, 441 &pcm037_flash,
442 &pcm037_sram_device, 442 &pcm037_sram_device,
443 &imx_wdt_device0,
444 &pcm037_mt9t031, 443 &pcm037_mt9t031,
445 &pcm037_mt9v022, 444 &pcm037_mt9v022,
446}; 445};
@@ -606,6 +605,7 @@ static void __init mxc_board_init(void)
606 605
607 platform_add_devices(devices, ARRAY_SIZE(devices)); 606 platform_add_devices(devices, ARRAY_SIZE(devices));
608 607
608 imx31_add_imx2_wdt(NULL);
609 imx31_add_imx_uart0(&uart_pdata); 609 imx31_add_imx_uart0(&uart_pdata);
610 /* XXX: should't this have .flags = 0 (i.e. no RTSCTS) on PCM037_EET? */ 610 /* XXX: should't this have .flags = 0 (i.e. no RTSCTS) on PCM037_EET? */
611 imx31_add_imx_uart1(&uart_pdata); 611 imx31_add_imx_uart1(&uart_pdata);
diff --git a/arch/arm/mach-mx3/mach-pcm043.c b/arch/arm/mach-mx3/mach-pcm043.c
index f9e7da98b107..f2f2fd036273 100644
--- a/arch/arm/mach-mx3/mach-pcm043.c
+++ b/arch/arm/mach-mx3/mach-pcm043.c
@@ -138,7 +138,6 @@ static struct i2c_board_info pcm043_i2c_devices[] = {
138 138
139static struct platform_device *devices[] __initdata = { 139static struct platform_device *devices[] __initdata = {
140 &pcm043_flash, 140 &pcm043_flash,
141 &imx_wdt_device0,
142}; 141};
143 142
144static struct pad_desc pcm043_pads[] = { 143static struct pad_desc pcm043_pads[] = {
@@ -362,6 +361,7 @@ static void __init mxc_board_init(void)
362 361
363 imx35_add_fec(NULL); 362 imx35_add_fec(NULL);
364 platform_add_devices(devices, ARRAY_SIZE(devices)); 363 platform_add_devices(devices, ARRAY_SIZE(devices));
364 imx35_add_imx2_wdt(NULL);
365 365
366 imx35_add_imx_uart0(&uart_pdata); 366 imx35_add_imx_uart0(&uart_pdata);
367 imx35_add_mxc_nand(&pcm037_nand_board_info); 367 imx35_add_mxc_nand(&pcm037_nand_board_info);
diff --git a/arch/arm/mach-mx3/mx31lite-db.c b/arch/arm/mach-mx3/mx31lite-db.c
index a06161edba3f..3124ea837ac7 100644
--- a/arch/arm/mach-mx3/mx31lite-db.c
+++ b/arch/arm/mach-mx3/mx31lite-db.c
@@ -199,6 +199,6 @@ void __init mx31lite_db_init(void)
199 imx31_add_mxc_mmc(0, &mmc_pdata); 199 imx31_add_mxc_mmc(0, &mmc_pdata);
200 imx31_add_spi_imx0(&spi0_pdata); 200 imx31_add_spi_imx0(&spi0_pdata);
201 platform_device_register(&litekit_led_device); 201 platform_device_register(&litekit_led_device);
202 mxc_register_device(&imx_wdt_device0, NULL); 202 imx31_add_imx2_wdt(NULL);
203 mxc_register_device(&imx_rtc_device0, NULL); 203 mxc_register_device(&imx_rtc_device0, NULL);
204} 204}
diff --git a/arch/arm/plat-mxc/devices/platform-imx2-wdt.c b/arch/arm/plat-mxc/devices/platform-imx2-wdt.c
index d2c97aae1eee..c61bd4e63149 100644
--- a/arch/arm/plat-mxc/devices/platform-imx2-wdt.c
+++ b/arch/arm/plat-mxc/devices/platform-imx2-wdt.c
@@ -31,6 +31,16 @@ const struct imx_imx2_wdt_data imx27_imx2_wdt_data __initconst =
31 imx_imx2_wdt_data_entry_single(MX27, SZ_4K); 31 imx_imx2_wdt_data_entry_single(MX27, SZ_4K);
32#endif /* ifdef CONFIG_SOC_IMX27 */ 32#endif /* ifdef CONFIG_SOC_IMX27 */
33 33
34#ifdef CONFIG_SOC_IMX31
35const struct imx_imx2_wdt_data imx31_imx2_wdt_data __initconst =
36 imx_imx2_wdt_data_entry_single(MX31, SZ_16K);
37#endif /* ifdef CONFIG_SOC_IMX31 */
38
39#ifdef CONFIG_SOC_IMX35
40const struct imx_imx2_wdt_data imx35_imx2_wdt_data __initconst =
41 imx_imx2_wdt_data_entry_single(MX35, SZ_16K);
42#endif /* ifdef CONFIG_SOC_IMX35 */
43
34struct platform_device *__init imx_add_imx2_wdt( 44struct platform_device *__init imx_add_imx2_wdt(
35 const struct imx_imx2_wdt_data *data) 45 const struct imx_imx2_wdt_data *data)
36{ 46{