diff options
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-mx25/devices.c | 76 | ||||
-rw-r--r-- | arch/arm/mach-mx25/devices.h | 4 | ||||
-rw-r--r-- | arch/arm/plat-mxc/devices/platform-mxc_pwm.c | 29 | ||||
-rw-r--r-- | arch/arm/plat-mxc/include/mach/devices-common.h | 2 | ||||
-rw-r--r-- | arch/arm/plat-mxc/include/mach/mx25.h | 8 |
5 files changed, 32 insertions, 87 deletions
diff --git a/arch/arm/mach-mx25/devices.c b/arch/arm/mach-mx25/devices.c index 27d07ce55ee0..13a3c280a834 100644 --- a/arch/arm/mach-mx25/devices.c +++ b/arch/arm/mach-mx25/devices.c | |||
@@ -22,63 +22,6 @@ | |||
22 | #include <mach/mx25.h> | 22 | #include <mach/mx25.h> |
23 | #include <mach/irqs.h> | 23 | #include <mach/irqs.h> |
24 | 24 | ||
25 | static struct resource mxc_pwm_resources0[] = { | ||
26 | { | ||
27 | .start = 0x53fe0000, | ||
28 | .end = 0x53fe3fff, | ||
29 | .flags = IORESOURCE_MEM, | ||
30 | }, { | ||
31 | .start = 26, | ||
32 | .end = 26, | ||
33 | .flags = IORESOURCE_IRQ, | ||
34 | } | ||
35 | }; | ||
36 | |||
37 | struct platform_device mxc_pwm_device0 = { | ||
38 | .name = "mxc_pwm", | ||
39 | .id = 0, | ||
40 | .num_resources = ARRAY_SIZE(mxc_pwm_resources0), | ||
41 | .resource = mxc_pwm_resources0, | ||
42 | }; | ||
43 | |||
44 | static struct resource mxc_pwm_resources1[] = { | ||
45 | { | ||
46 | .start = 0x53fa0000, | ||
47 | .end = 0x53fa3fff, | ||
48 | .flags = IORESOURCE_MEM, | ||
49 | }, { | ||
50 | .start = 36, | ||
51 | .end = 36, | ||
52 | .flags = IORESOURCE_IRQ, | ||
53 | } | ||
54 | }; | ||
55 | |||
56 | struct platform_device mxc_pwm_device1 = { | ||
57 | .name = "mxc_pwm", | ||
58 | .id = 1, | ||
59 | .num_resources = ARRAY_SIZE(mxc_pwm_resources1), | ||
60 | .resource = mxc_pwm_resources1, | ||
61 | }; | ||
62 | |||
63 | static struct resource mxc_pwm_resources2[] = { | ||
64 | { | ||
65 | .start = 0x53fa8000, | ||
66 | .end = 0x53fabfff, | ||
67 | .flags = IORESOURCE_MEM, | ||
68 | }, { | ||
69 | .start = 41, | ||
70 | .end = 41, | ||
71 | .flags = IORESOURCE_IRQ, | ||
72 | } | ||
73 | }; | ||
74 | |||
75 | struct platform_device mxc_pwm_device2 = { | ||
76 | .name = "mxc_pwm", | ||
77 | .id = 2, | ||
78 | .num_resources = ARRAY_SIZE(mxc_pwm_resources2), | ||
79 | .resource = mxc_pwm_resources2, | ||
80 | }; | ||
81 | |||
82 | static struct resource mxc_keypad_resources[] = { | 25 | static struct resource mxc_keypad_resources[] = { |
83 | { | 26 | { |
84 | .start = 0x43fa8000, | 27 | .start = 0x43fa8000, |
@@ -98,25 +41,6 @@ struct platform_device mxc_keypad_device = { | |||
98 | .resource = mxc_keypad_resources, | 41 | .resource = mxc_keypad_resources, |
99 | }; | 42 | }; |
100 | 43 | ||
101 | static struct resource mxc_pwm_resources3[] = { | ||
102 | { | ||
103 | .start = 0x53fc8000, | ||
104 | .end = 0x53fcbfff, | ||
105 | .flags = IORESOURCE_MEM, | ||
106 | }, { | ||
107 | .start = 42, | ||
108 | .end = 42, | ||
109 | .flags = IORESOURCE_IRQ, | ||
110 | } | ||
111 | }; | ||
112 | |||
113 | struct platform_device mxc_pwm_device3 = { | ||
114 | .name = "mxc_pwm", | ||
115 | .id = 3, | ||
116 | .num_resources = ARRAY_SIZE(mxc_pwm_resources3), | ||
117 | .resource = mxc_pwm_resources3, | ||
118 | }; | ||
119 | |||
120 | static struct mxc_gpio_port imx_gpio_ports[] = { | 44 | static struct mxc_gpio_port imx_gpio_ports[] = { |
121 | { | 45 | { |
122 | .chip.label = "gpio-0", | 46 | .chip.label = "gpio-0", |
diff --git a/arch/arm/mach-mx25/devices.h b/arch/arm/mach-mx25/devices.h index 266c305a2ad7..afc60ddc6a31 100644 --- a/arch/arm/mach-mx25/devices.h +++ b/arch/arm/mach-mx25/devices.h | |||
@@ -1,7 +1,3 @@ | |||
1 | extern struct platform_device mxc_pwm_device0; | ||
2 | extern struct platform_device mxc_pwm_device1; | ||
3 | extern struct platform_device mxc_pwm_device2; | ||
4 | extern struct platform_device mxc_pwm_device3; | ||
5 | extern struct platform_device mxc_keypad_device; | 1 | extern struct platform_device mxc_keypad_device; |
6 | extern struct platform_device mx25_rtc_device; | 2 | extern struct platform_device mx25_rtc_device; |
7 | extern struct platform_device mx25_fb_device; | 3 | extern struct platform_device mx25_fb_device; |
diff --git a/arch/arm/plat-mxc/devices/platform-mxc_pwm.c b/arch/arm/plat-mxc/devices/platform-mxc_pwm.c index 3ebbc671638c..5a47d1e8553e 100644 --- a/arch/arm/plat-mxc/devices/platform-mxc_pwm.c +++ b/arch/arm/plat-mxc/devices/platform-mxc_pwm.c | |||
@@ -9,20 +9,35 @@ | |||
9 | #include <mach/hardware.h> | 9 | #include <mach/hardware.h> |
10 | #include <mach/devices-common.h> | 10 | #include <mach/devices-common.h> |
11 | 11 | ||
12 | #define imx_mxc_pwm_data_entry_single(soc) \ | 12 | #define imx_mxc_pwm_data_entry_single(soc, _id, _hwid, _size) \ |
13 | { \ | 13 | { \ |
14 | .iobase = soc ## _PWM_BASE_ADDR, \ | 14 | .id = _id, \ |
15 | .irq = soc ## _INT_PWM, \ | 15 | .iobase = soc ## _PWM ## _hwid ## _BASE_ADDR, \ |
16 | .iosize = _size, \ | ||
17 | .irq = soc ## _INT_PWM ## _hwid, \ | ||
16 | } | 18 | } |
19 | #define imx_mxc_pwm_data_entry(soc, _id, _hwid, _size) \ | ||
20 | [_id] = imx_mxc_pwm_data_entry_single(soc, _id, _hwid, _size) | ||
17 | 21 | ||
18 | #ifdef CONFIG_SOC_IMX21 | 22 | #ifdef CONFIG_SOC_IMX21 |
19 | const struct imx_mxc_pwm_data imx21_mxc_pwm_data __initconst = | 23 | const struct imx_mxc_pwm_data imx21_mxc_pwm_data __initconst = |
20 | imx_mxc_pwm_data_entry_single(MX21); | 24 | imx_mxc_pwm_data_entry_single(MX21, 0, , SZ_4K); |
21 | #endif /* ifdef CONFIG_SOC_IMX21 */ | 25 | #endif /* ifdef CONFIG_SOC_IMX21 */ |
22 | 26 | ||
27 | #ifdef CONFIG_ARCH_MX25 | ||
28 | const struct imx_mxc_pwm_data imx25_mxc_pwm_data[] __initconst = { | ||
29 | #define imx25_mxc_pwm_data_entry(_id, _hwid) \ | ||
30 | imx_mxc_pwm_data_entry(MX25, _id, _hwid, SZ_16K) | ||
31 | imx25_mxc_pwm_data_entry(0, 1), | ||
32 | imx25_mxc_pwm_data_entry(1, 2), | ||
33 | imx25_mxc_pwm_data_entry(2, 3), | ||
34 | imx25_mxc_pwm_data_entry(3, 4), | ||
35 | }; | ||
36 | #endif | ||
37 | |||
23 | #ifdef CONFIG_SOC_IMX27 | 38 | #ifdef CONFIG_SOC_IMX27 |
24 | const struct imx_mxc_pwm_data imx27_mxc_pwm_data __initconst = | 39 | const struct imx_mxc_pwm_data imx27_mxc_pwm_data __initconst = |
25 | imx_mxc_pwm_data_entry_single(MX27); | 40 | imx_mxc_pwm_data_entry_single(MX27, 0, , SZ_4K); |
26 | #endif /* ifdef CONFIG_SOC_IMX27 */ | 41 | #endif /* ifdef CONFIG_SOC_IMX27 */ |
27 | 42 | ||
28 | struct platform_device *__init imx_add_mxc_pwm( | 43 | struct platform_device *__init imx_add_mxc_pwm( |
@@ -31,7 +46,7 @@ struct platform_device *__init imx_add_mxc_pwm( | |||
31 | struct resource res[] = { | 46 | struct resource res[] = { |
32 | { | 47 | { |
33 | .start = data->iobase, | 48 | .start = data->iobase, |
34 | .end = data->iobase + SZ_4K - 1, | 49 | .end = data->iobase + data->iosize - 1, |
35 | .flags = IORESOURCE_MEM, | 50 | .flags = IORESOURCE_MEM, |
36 | }, { | 51 | }, { |
37 | .start = data->irq, | 52 | .start = data->irq, |
@@ -40,6 +55,6 @@ struct platform_device *__init imx_add_mxc_pwm( | |||
40 | }, | 55 | }, |
41 | }; | 56 | }; |
42 | 57 | ||
43 | return imx_add_platform_device("mxc_pwm", 0, | 58 | return imx_add_platform_device("mxc_pwm", data->id, |
44 | res, ARRAY_SIZE(res), NULL, 0); | 59 | res, ARRAY_SIZE(res), NULL, 0); |
45 | } | 60 | } |
diff --git a/arch/arm/plat-mxc/include/mach/devices-common.h b/arch/arm/plat-mxc/include/mach/devices-common.h index f5d0000acd62..07223b2cf171 100644 --- a/arch/arm/plat-mxc/include/mach/devices-common.h +++ b/arch/arm/plat-mxc/include/mach/devices-common.h | |||
@@ -217,7 +217,9 @@ struct platform_device *__init imx_add_mxc_nand( | |||
217 | const struct mxc_nand_platform_data *pdata); | 217 | const struct mxc_nand_platform_data *pdata); |
218 | 218 | ||
219 | struct imx_mxc_pwm_data { | 219 | struct imx_mxc_pwm_data { |
220 | int id; | ||
220 | resource_size_t iobase; | 221 | resource_size_t iobase; |
222 | resource_size_t iosize; | ||
221 | resource_size_t irq; | 223 | resource_size_t irq; |
222 | }; | 224 | }; |
223 | struct platform_device *__init imx_add_mxc_pwm( | 225 | struct platform_device *__init imx_add_mxc_pwm( |
diff --git a/arch/arm/plat-mxc/include/mach/mx25.h b/arch/arm/plat-mxc/include/mach/mx25.h index 0d31f828d218..cea851f09ca7 100644 --- a/arch/arm/plat-mxc/include/mach/mx25.h +++ b/arch/arm/plat-mxc/include/mach/mx25.h | |||
@@ -19,10 +19,14 @@ | |||
19 | #define MX25_CRM_BASE_ADDR (MX25_AIPS2_BASE_ADDR + 0x80000) | 19 | #define MX25_CRM_BASE_ADDR (MX25_AIPS2_BASE_ADDR + 0x80000) |
20 | #define MX25_GPT1_BASE_ADDR (MX25_AIPS2_BASE_ADDR + 0x90000) | 20 | #define MX25_GPT1_BASE_ADDR (MX25_AIPS2_BASE_ADDR + 0x90000) |
21 | #define MX25_GPIO4_BASE_ADDR (MX25_AIPS2_BASE_ADDR + 0x9c000) | 21 | #define MX25_GPIO4_BASE_ADDR (MX25_AIPS2_BASE_ADDR + 0x9c000) |
22 | #define MX25_PWM2_BASE_ADDR (MX25_AIPS2_BASE_ADDR + 0xa0000) | ||
22 | #define MX25_GPIO3_BASE_ADDR (MX25_AIPS2_BASE_ADDR + 0xa4000) | 23 | #define MX25_GPIO3_BASE_ADDR (MX25_AIPS2_BASE_ADDR + 0xa4000) |
24 | #define MX25_PWM3_BASE_ADDR (MX25_AIPS2_BASE_ADDR + 0xa8000) | ||
25 | #define MX25_PWM4_BASE_ADDR (MX25_AIPS2_BASE_ADDR + 0xc8000) | ||
23 | #define MX25_GPIO1_BASE_ADDR (MX25_AIPS2_BASE_ADDR + 0xcc000) | 26 | #define MX25_GPIO1_BASE_ADDR (MX25_AIPS2_BASE_ADDR + 0xcc000) |
24 | #define MX25_GPIO2_BASE_ADDR (MX25_AIPS2_BASE_ADDR + 0xd0000) | 27 | #define MX25_GPIO2_BASE_ADDR (MX25_AIPS2_BASE_ADDR + 0xd0000) |
25 | #define MX25_WDOG_BASE_ADDR (MX25_AIPS2_BASE_ADDR + 0xdc000) | 28 | #define MX25_WDOG_BASE_ADDR (MX25_AIPS2_BASE_ADDR + 0xdc000) |
29 | #define MX25_PWM1_BASE_ADDR (MX25_AIPS2_BASE_ADDR + 0xe0000) | ||
26 | 30 | ||
27 | #define MX25_UART1_BASE_ADDR 0x43f90000 | 31 | #define MX25_UART1_BASE_ADDR 0x43f90000 |
28 | #define MX25_UART2_BASE_ADDR 0x43f94000 | 32 | #define MX25_UART2_BASE_ADDR 0x43f94000 |
@@ -66,13 +70,17 @@ | |||
66 | #define MX25_INT_UART3 18 | 70 | #define MX25_INT_UART3 18 |
67 | #define MX25_INT_KPP 24 | 71 | #define MX25_INT_KPP 24 |
68 | #define MX25_INT_DRYICE 25 | 72 | #define MX25_INT_DRYICE 25 |
73 | #define MX25_INT_PWM1 26 | ||
69 | #define MX25_INT_UART2 32 | 74 | #define MX25_INT_UART2 32 |
70 | #define MX25_INT_NFC 33 | 75 | #define MX25_INT_NFC 33 |
71 | #define MX25_INT_SDMA 34 | 76 | #define MX25_INT_SDMA 34 |
72 | #define MX25_INT_USB_HS 35 | 77 | #define MX25_INT_USB_HS 35 |
78 | #define MX25_INT_PWM2 36 | ||
73 | #define MX25_INT_USB_OTG 37 | 79 | #define MX25_INT_USB_OTG 37 |
74 | #define MX25_INT_LCDC 39 | 80 | #define MX25_INT_LCDC 39 |
75 | #define MX25_INT_UART5 40 | 81 | #define MX25_INT_UART5 40 |
82 | #define MX25_INT_PWM3 41 | ||
83 | #define MX25_INT_PWM4 42 | ||
76 | #define MX25_INT_CAN1 43 | 84 | #define MX25_INT_CAN1 43 |
77 | #define MX25_INT_CAN2 44 | 85 | #define MX25_INT_CAN2 44 |
78 | #define MX25_INT_UART1 45 | 86 | #define MX25_INT_UART1 45 |