diff options
Diffstat (limited to 'arch/arm/mach-mx25')
-rw-r--r-- | arch/arm/mach-mx25/Kconfig | 1 | ||||
-rw-r--r-- | arch/arm/mach-mx25/Makefile | 2 | ||||
-rw-r--r-- | arch/arm/mach-mx25/clock.c | 14 | ||||
-rw-r--r-- | arch/arm/mach-mx25/devices.c | 62 | ||||
-rw-r--r-- | arch/arm/mach-mx25/devices.h | 3 | ||||
-rw-r--r-- | arch/arm/mach-mx25/mach-mx25pdk.c (renamed from arch/arm/mach-mx25/mx25pdk.c) | 67 |
6 files changed, 145 insertions, 4 deletions
diff --git a/arch/arm/mach-mx25/Kconfig b/arch/arm/mach-mx25/Kconfig index cc28f56eae80..54d217314ee9 100644 --- a/arch/arm/mach-mx25/Kconfig +++ b/arch/arm/mach-mx25/Kconfig | |||
@@ -3,7 +3,6 @@ if ARCH_MX25 | |||
3 | comment "MX25 platforms:" | 3 | comment "MX25 platforms:" |
4 | 4 | ||
5 | config MACH_MX25_3DS | 5 | config MACH_MX25_3DS |
6 | select ARCH_MXC_IOMUX_V3 | ||
7 | bool "Support MX25PDK (3DS) Platform" | 6 | bool "Support MX25PDK (3DS) Platform" |
8 | 7 | ||
9 | endif | 8 | endif |
diff --git a/arch/arm/mach-mx25/Makefile b/arch/arm/mach-mx25/Makefile index fe23836a9f3d..10cebc5ced8c 100644 --- a/arch/arm/mach-mx25/Makefile +++ b/arch/arm/mach-mx25/Makefile | |||
@@ -1,3 +1,3 @@ | |||
1 | obj-y := mm.o devices.o | 1 | obj-y := mm.o devices.o |
2 | obj-$(CONFIG_ARCH_MX25) += clock.o | 2 | obj-$(CONFIG_ARCH_MX25) += clock.o |
3 | obj-$(CONFIG_MACH_MX25_3DS) += mx25pdk.o | 3 | obj-$(CONFIG_MACH_MX25_3DS) += mach-mx25pdk.o |
diff --git a/arch/arm/mach-mx25/clock.c b/arch/arm/mach-mx25/clock.c index 37e1359ad0c0..155014993b13 100644 --- a/arch/arm/mach-mx25/clock.c +++ b/arch/arm/mach-mx25/clock.c | |||
@@ -124,6 +124,11 @@ static unsigned long get_rate_gpt(struct clk *clk) | |||
124 | return get_rate_per(5); | 124 | return get_rate_per(5); |
125 | } | 125 | } |
126 | 126 | ||
127 | static unsigned long get_rate_lcdc(struct clk *clk) | ||
128 | { | ||
129 | return get_rate_per(7); | ||
130 | } | ||
131 | |||
127 | static unsigned long get_rate_otg(struct clk *clk) | 132 | static unsigned long get_rate_otg(struct clk *clk) |
128 | { | 133 | { |
129 | return 48000000; /* FIXME */ | 134 | return 48000000; /* FIXME */ |
@@ -167,6 +172,8 @@ DEFINE_CLOCK(cspi1_clk, 0, CCM_CGCR1, 5, get_rate_ipg, NULL, NULL); | |||
167 | DEFINE_CLOCK(cspi2_clk, 0, CCM_CGCR1, 6, get_rate_ipg, NULL, NULL); | 172 | DEFINE_CLOCK(cspi2_clk, 0, CCM_CGCR1, 6, get_rate_ipg, NULL, NULL); |
168 | DEFINE_CLOCK(cspi3_clk, 0, CCM_CGCR1, 7, get_rate_ipg, NULL, NULL); | 173 | DEFINE_CLOCK(cspi3_clk, 0, CCM_CGCR1, 7, get_rate_ipg, NULL, NULL); |
169 | DEFINE_CLOCK(fec_ahb_clk, 0, CCM_CGCR0, 23, NULL, NULL, NULL); | 174 | DEFINE_CLOCK(fec_ahb_clk, 0, CCM_CGCR0, 23, NULL, NULL, NULL); |
175 | DEFINE_CLOCK(lcdc_ahb_clk, 0, CCM_CGCR0, 24, NULL, NULL, NULL); | ||
176 | DEFINE_CLOCK(lcdc_per_clk, 0, CCM_CGCR0, 7, NULL, NULL, &lcdc_ahb_clk); | ||
170 | DEFINE_CLOCK(uart1_clk, 0, CCM_CGCR2, 14, get_rate_uart, NULL, &uart_per_clk); | 177 | DEFINE_CLOCK(uart1_clk, 0, CCM_CGCR2, 14, get_rate_uart, NULL, &uart_per_clk); |
171 | DEFINE_CLOCK(uart2_clk, 0, CCM_CGCR2, 15, get_rate_uart, NULL, &uart_per_clk); | 178 | DEFINE_CLOCK(uart2_clk, 0, CCM_CGCR2, 15, get_rate_uart, NULL, &uart_per_clk); |
172 | DEFINE_CLOCK(uart3_clk, 0, CCM_CGCR2, 16, get_rate_uart, NULL, &uart_per_clk); | 179 | DEFINE_CLOCK(uart3_clk, 0, CCM_CGCR2, 16, get_rate_uart, NULL, &uart_per_clk); |
@@ -182,6 +189,8 @@ DEFINE_CLOCK(kpp_clk, 0, CCM_CGCR1, 28, get_rate_ipg, NULL, NULL); | |||
182 | DEFINE_CLOCK(tsc_clk, 0, CCM_CGCR2, 13, get_rate_ipg, NULL, NULL); | 189 | DEFINE_CLOCK(tsc_clk, 0, CCM_CGCR2, 13, get_rate_ipg, NULL, NULL); |
183 | DEFINE_CLOCK(i2c_clk, 0, CCM_CGCR0, 6, get_rate_i2c, NULL, NULL); | 190 | DEFINE_CLOCK(i2c_clk, 0, CCM_CGCR0, 6, get_rate_i2c, NULL, NULL); |
184 | DEFINE_CLOCK(fec_clk, 0, CCM_CGCR1, 15, get_rate_ipg, NULL, &fec_ahb_clk); | 191 | DEFINE_CLOCK(fec_clk, 0, CCM_CGCR1, 15, get_rate_ipg, NULL, &fec_ahb_clk); |
192 | DEFINE_CLOCK(dryice_clk, 0, CCM_CGCR1, 8, get_rate_ipg, NULL, NULL); | ||
193 | DEFINE_CLOCK(lcdc_clk, 0, CCM_CGCR1, 29, get_rate_lcdc, NULL, &lcdc_per_clk); | ||
185 | 194 | ||
186 | #define _REGISTER_CLOCK(d, n, c) \ | 195 | #define _REGISTER_CLOCK(d, n, c) \ |
187 | { \ | 196 | { \ |
@@ -214,6 +223,8 @@ static struct clk_lookup lookups[] = { | |||
214 | _REGISTER_CLOCK("imx-i2c.1", NULL, i2c_clk) | 223 | _REGISTER_CLOCK("imx-i2c.1", NULL, i2c_clk) |
215 | _REGISTER_CLOCK("imx-i2c.2", NULL, i2c_clk) | 224 | _REGISTER_CLOCK("imx-i2c.2", NULL, i2c_clk) |
216 | _REGISTER_CLOCK("fec.0", NULL, fec_clk) | 225 | _REGISTER_CLOCK("fec.0", NULL, fec_clk) |
226 | _REGISTER_CLOCK("imxdi_rtc.0", NULL, dryice_clk) | ||
227 | _REGISTER_CLOCK("imx-fb.0", NULL, lcdc_clk) | ||
217 | }; | 228 | }; |
218 | 229 | ||
219 | int __init mx25_clocks_init(void) | 230 | int __init mx25_clocks_init(void) |
@@ -228,6 +239,9 @@ int __init mx25_clocks_init(void) | |||
228 | __raw_writel((0xf << 16) | (3 << 26), CRM_BASE + CCM_CGCR1); | 239 | __raw_writel((0xf << 16) | (3 << 26), CRM_BASE + CCM_CGCR1); |
229 | __raw_writel((1 << 5), CRM_BASE + CCM_CGCR2); | 240 | __raw_writel((1 << 5), CRM_BASE + CCM_CGCR2); |
230 | 241 | ||
242 | /* Clock source for lcdc is upll */ | ||
243 | __raw_writel(__raw_readl(CRM_BASE+0x64) | (1 << 7), CRM_BASE + 0x64); | ||
244 | |||
231 | mxc_timer_init(&gpt_clk, MX25_IO_ADDRESS(MX25_GPT1_BASE_ADDR), 54); | 245 | mxc_timer_init(&gpt_clk, MX25_IO_ADDRESS(MX25_GPT1_BASE_ADDR), 54); |
232 | 246 | ||
233 | return 0; | 247 | return 0; |
diff --git a/arch/arm/mach-mx25/devices.c b/arch/arm/mach-mx25/devices.c index 9fdeea1c083b..3f4b8a0b5fac 100644 --- a/arch/arm/mach-mx25/devices.c +++ b/arch/arm/mach-mx25/devices.c | |||
@@ -438,3 +438,65 @@ struct platform_device mx25_fec_device = { | |||
438 | .num_resources = ARRAY_SIZE(mx25_fec_resources), | 438 | .num_resources = ARRAY_SIZE(mx25_fec_resources), |
439 | .resource = mx25_fec_resources, | 439 | .resource = mx25_fec_resources, |
440 | }; | 440 | }; |
441 | |||
442 | static struct resource mxc_nand_resources[] = { | ||
443 | { | ||
444 | .start = MX25_NFC_BASE_ADDR, | ||
445 | .end = MX25_NFC_BASE_ADDR + 0x1fff, | ||
446 | .flags = IORESOURCE_MEM, | ||
447 | }, | ||
448 | { | ||
449 | .start = MX25_INT_NANDFC, | ||
450 | .end = MX25_INT_NANDFC, | ||
451 | .flags = IORESOURCE_IRQ, | ||
452 | }, | ||
453 | }; | ||
454 | |||
455 | struct platform_device mxc_nand_device = { | ||
456 | .name = "mxc_nand", | ||
457 | .id = 0, | ||
458 | .num_resources = ARRAY_SIZE(mxc_nand_resources), | ||
459 | .resource = mxc_nand_resources, | ||
460 | }; | ||
461 | |||
462 | static struct resource mx25_rtc_resources[] = { | ||
463 | { | ||
464 | .start = MX25_DRYICE_BASE_ADDR, | ||
465 | .end = MX25_DRYICE_BASE_ADDR + 0x40, | ||
466 | .flags = IORESOURCE_MEM, | ||
467 | }, | ||
468 | { | ||
469 | .start = MX25_INT_DRYICE, | ||
470 | .flags = IORESOURCE_IRQ | ||
471 | }, | ||
472 | }; | ||
473 | |||
474 | struct platform_device mx25_rtc_device = { | ||
475 | .name = "imxdi_rtc", | ||
476 | .id = 0, | ||
477 | .num_resources = ARRAY_SIZE(mx25_rtc_resources), | ||
478 | .resource = mx25_rtc_resources, | ||
479 | }; | ||
480 | |||
481 | static struct resource mx25_fb_resources[] = { | ||
482 | { | ||
483 | .start = MX25_LCDC_BASE_ADDR, | ||
484 | .end = MX25_LCDC_BASE_ADDR + 0xfff, | ||
485 | .flags = IORESOURCE_MEM, | ||
486 | }, | ||
487 | { | ||
488 | .start = MX25_INT_LCDC, | ||
489 | .end = MX25_INT_LCDC, | ||
490 | .flags = IORESOURCE_IRQ, | ||
491 | }, | ||
492 | }; | ||
493 | |||
494 | struct platform_device mx25_fb_device = { | ||
495 | .name = "imx-fb", | ||
496 | .id = 0, | ||
497 | .resource = mx25_fb_resources, | ||
498 | .num_resources = ARRAY_SIZE(mx25_fb_resources), | ||
499 | .dev = { | ||
500 | .coherent_dma_mask = 0xFFFFFFFF, | ||
501 | }, | ||
502 | }; | ||
diff --git a/arch/arm/mach-mx25/devices.h b/arch/arm/mach-mx25/devices.h index fe5420fcd11f..39560e13bc0d 100644 --- a/arch/arm/mach-mx25/devices.h +++ b/arch/arm/mach-mx25/devices.h | |||
@@ -18,3 +18,6 @@ extern struct platform_device mxc_i2c_device0; | |||
18 | extern struct platform_device mxc_i2c_device1; | 18 | extern struct platform_device mxc_i2c_device1; |
19 | extern struct platform_device mxc_i2c_device2; | 19 | extern struct platform_device mxc_i2c_device2; |
20 | extern struct platform_device mx25_fec_device; | 20 | extern struct platform_device mx25_fec_device; |
21 | extern struct platform_device mxc_nand_device; | ||
22 | extern struct platform_device mx25_rtc_device; | ||
23 | extern struct platform_device mx25_fb_device; | ||
diff --git a/arch/arm/mach-mx25/mx25pdk.c b/arch/arm/mach-mx25/mach-mx25pdk.c index 6f06089246eb..83d74109e7d8 100644 --- a/arch/arm/mach-mx25/mx25pdk.c +++ b/arch/arm/mach-mx25/mach-mx25pdk.c | |||
@@ -35,8 +35,9 @@ | |||
35 | #include <mach/imx-uart.h> | 35 | #include <mach/imx-uart.h> |
36 | #include <mach/mx25.h> | 36 | #include <mach/mx25.h> |
37 | #include <mach/mxc_nand.h> | 37 | #include <mach/mxc_nand.h> |
38 | #include <mach/imxfb.h> | ||
38 | #include "devices.h" | 39 | #include "devices.h" |
39 | #include <mach/iomux.h> | 40 | #include <mach/iomux-mx25.h> |
40 | 41 | ||
41 | static struct imxuart_platform_data uart_pdata = { | 42 | static struct imxuart_platform_data uart_pdata = { |
42 | .flags = IMXUART_HAVE_RTSCTS, | 43 | .flags = IMXUART_HAVE_RTSCTS, |
@@ -54,6 +55,31 @@ static struct pad_desc mx25pdk_pads[] = { | |||
54 | MX25_PAD_FEC_TX_CLK__FEC_TX_CLK, | 55 | MX25_PAD_FEC_TX_CLK__FEC_TX_CLK, |
55 | MX25_PAD_A17__GPIO_2_3, /* FEC_EN, GPIO 35 */ | 56 | MX25_PAD_A17__GPIO_2_3, /* FEC_EN, GPIO 35 */ |
56 | MX25_PAD_D12__GPIO_4_8, /* FEC_RESET_B, GPIO 104 */ | 57 | MX25_PAD_D12__GPIO_4_8, /* FEC_RESET_B, GPIO 104 */ |
58 | |||
59 | /* LCD */ | ||
60 | MX25_PAD_LD0__LD0, | ||
61 | MX25_PAD_LD1__LD1, | ||
62 | MX25_PAD_LD2__LD2, | ||
63 | MX25_PAD_LD3__LD3, | ||
64 | MX25_PAD_LD4__LD4, | ||
65 | MX25_PAD_LD5__LD5, | ||
66 | MX25_PAD_LD6__LD6, | ||
67 | MX25_PAD_LD7__LD7, | ||
68 | MX25_PAD_LD8__LD8, | ||
69 | MX25_PAD_LD9__LD9, | ||
70 | MX25_PAD_LD10__LD10, | ||
71 | MX25_PAD_LD11__LD11, | ||
72 | MX25_PAD_LD12__LD12, | ||
73 | MX25_PAD_LD13__LD13, | ||
74 | MX25_PAD_LD14__LD14, | ||
75 | MX25_PAD_LD15__LD15, | ||
76 | MX25_PAD_GPIO_E__LD16, | ||
77 | MX25_PAD_GPIO_F__LD17, | ||
78 | MX25_PAD_HSYNC__HSYNC, | ||
79 | MX25_PAD_VSYNC__VSYNC, | ||
80 | MX25_PAD_LSCLK__LSCLK, | ||
81 | MX25_PAD_OE_ACD__OE_ACD, | ||
82 | MX25_PAD_CONTRAST__CONTRAST, | ||
57 | }; | 83 | }; |
58 | 84 | ||
59 | static struct fec_platform_data mx25_fec_pdata = { | 85 | static struct fec_platform_data mx25_fec_pdata = { |
@@ -77,6 +103,40 @@ static void __init mx25pdk_fec_reset(void) | |||
77 | gpio_set_value(FEC_RESET_B_GPIO, 1); | 103 | gpio_set_value(FEC_RESET_B_GPIO, 1); |
78 | } | 104 | } |
79 | 105 | ||
106 | static struct mxc_nand_platform_data mx25pdk_nand_board_info = { | ||
107 | .width = 1, | ||
108 | .hw_ecc = 1, | ||
109 | .flash_bbt = 1, | ||
110 | }; | ||
111 | |||
112 | static struct imx_fb_videomode mx25pdk_modes[] = { | ||
113 | { | ||
114 | .mode = { | ||
115 | .name = "CRT-VGA", | ||
116 | .refresh = 60, | ||
117 | .xres = 640, | ||
118 | .yres = 480, | ||
119 | .pixclock = 39683, | ||
120 | .left_margin = 45, | ||
121 | .right_margin = 114, | ||
122 | .upper_margin = 33, | ||
123 | .lower_margin = 11, | ||
124 | .hsync_len = 1, | ||
125 | .vsync_len = 1, | ||
126 | }, | ||
127 | .bpp = 16, | ||
128 | .pcr = 0xFA208B80, | ||
129 | }, | ||
130 | }; | ||
131 | |||
132 | static struct imx_fb_platform_data mx25pdk_fb_pdata = { | ||
133 | .mode = mx25pdk_modes, | ||
134 | .num_modes = ARRAY_SIZE(mx25pdk_modes), | ||
135 | .pwmr = 0x00A903FF, | ||
136 | .lscr1 = 0x00120300, | ||
137 | .dmacr = 0x00020010, | ||
138 | }; | ||
139 | |||
80 | static void __init mx25pdk_init(void) | 140 | static void __init mx25pdk_init(void) |
81 | { | 141 | { |
82 | mxc_iomux_v3_setup_multiple_pads(mx25pdk_pads, | 142 | mxc_iomux_v3_setup_multiple_pads(mx25pdk_pads, |
@@ -84,6 +144,9 @@ static void __init mx25pdk_init(void) | |||
84 | 144 | ||
85 | mxc_register_device(&mxc_uart_device0, &uart_pdata); | 145 | mxc_register_device(&mxc_uart_device0, &uart_pdata); |
86 | mxc_register_device(&mxc_usbh2, NULL); | 146 | mxc_register_device(&mxc_usbh2, NULL); |
147 | mxc_register_device(&mxc_nand_device, &mx25pdk_nand_board_info); | ||
148 | mxc_register_device(&mx25_rtc_device, NULL); | ||
149 | mxc_register_device(&mx25_fb_device, &mx25pdk_fb_pdata); | ||
87 | 150 | ||
88 | mx25pdk_fec_reset(); | 151 | mx25pdk_fec_reset(); |
89 | mxc_register_device(&mx25_fec_device, &mx25_fec_pdata); | 152 | mxc_register_device(&mx25_fec_device, &mx25_fec_pdata); |
@@ -102,7 +165,7 @@ MACHINE_START(MX25_3DS, "Freescale MX25PDK (3DS)") | |||
102 | /* Maintainer: Freescale Semiconductor, Inc. */ | 165 | /* Maintainer: Freescale Semiconductor, Inc. */ |
103 | .phys_io = MX25_AIPS1_BASE_ADDR, | 166 | .phys_io = MX25_AIPS1_BASE_ADDR, |
104 | .io_pg_offst = ((MX25_AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc, | 167 | .io_pg_offst = ((MX25_AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc, |
105 | .boot_params = PHYS_OFFSET + 0x100, | 168 | .boot_params = MX25_PHYS_OFFSET + 0x100, |
106 | .map_io = mx25_map_io, | 169 | .map_io = mx25_map_io, |
107 | .init_irq = mx25_init_irq, | 170 | .init_irq = mx25_init_irq, |
108 | .init_machine = mx25pdk_init, | 171 | .init_machine = mx25pdk_init, |