aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mx25
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2010-02-25 08:01:49 -0500
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>2010-02-25 08:01:49 -0500
commit9b1489e989695c4d502865f8bec616c0f17e99ab (patch)
tree9f90bcc7491bec06db0463d5f24f1ac19b8becc4 /arch/arm/mach-mx25
parentbac3fcfad565c9bbceeed8b607f140c29df97355 (diff)
parent08268b78d6f0c659dc1d86453c57b336f6f4f9ae (diff)
Merge branch 'mxc-master' of git://git.pengutronix.de/git/imx/linux-2.6 into imx/master
Removed selection of COMMON_CLKDEV by CONFIG_ARCH_MX5. This is handled in 03e09cd8902717b66f940357257d8ad76114d9f2. arch/arm/plat-mxc/iomux-mx1-mx2.c was moved to arch/arm/plat-mxc/iomux-v1.c in 5e2e95f520538e095d10456acd28d9107317aa32 and got bug fixed in 5c17ef878fa25e04b1e8f1d8f5fa8b267753472c. The bug in arch/arm/plat-mxc/iomux-v1.c isn't present any more since bac3fcfad565c9bbceeed8b607f140c29df97355, so arch/arm/plat-mxc/iomux-mx1-mx2.c is simply deleted. Conflicts: arch/arm/plat-mxc/Kconfig arch/arm/plat-mxc/Makefile arch/arm/plat-mxc/iomux-mx1-mx2.c Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-mx25')
-rw-r--r--arch/arm/mach-mx25/Kconfig1
-rw-r--r--arch/arm/mach-mx25/clock.c12
-rw-r--r--arch/arm/mach-mx25/devices.c23
-rw-r--r--arch/arm/mach-mx25/devices.h1
-rw-r--r--arch/arm/mach-mx25/mach-mx25pdk.c55
5 files changed, 91 insertions, 1 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
3comment "MX25 platforms:" 3comment "MX25 platforms:"
4 4
5config MACH_MX25_3DS 5config MACH_MX25_3DS
6 select ARCH_MXC_IOMUX_V3
7 bool "Support MX25PDK (3DS) Platform" 6 bool "Support MX25PDK (3DS) Platform"
8 7
9endif 8endif
diff --git a/arch/arm/mach-mx25/clock.c b/arch/arm/mach-mx25/clock.c
index 744b52a613fc..56bf958d8c34 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
127static unsigned long get_rate_lcdc(struct clk *clk)
128{
129 return get_rate_per(7);
130}
131
127static unsigned long get_rate_otg(struct clk *clk) 132static 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);
167DEFINE_CLOCK(cspi2_clk, 0, CCM_CGCR1, 6, get_rate_ipg, NULL, NULL); 172DEFINE_CLOCK(cspi2_clk, 0, CCM_CGCR1, 6, get_rate_ipg, NULL, NULL);
168DEFINE_CLOCK(cspi3_clk, 0, CCM_CGCR1, 7, get_rate_ipg, NULL, NULL); 173DEFINE_CLOCK(cspi3_clk, 0, CCM_CGCR1, 7, get_rate_ipg, NULL, NULL);
169DEFINE_CLOCK(fec_ahb_clk, 0, CCM_CGCR0, 23, NULL, NULL, NULL); 174DEFINE_CLOCK(fec_ahb_clk, 0, CCM_CGCR0, 23, NULL, NULL, NULL);
175DEFINE_CLOCK(lcdc_ahb_clk, 0, CCM_CGCR0, 24, NULL, NULL, NULL);
176DEFINE_CLOCK(lcdc_per_clk, 0, CCM_CGCR0, 7, NULL, NULL, &lcdc_ahb_clk);
170DEFINE_CLOCK(uart1_clk, 0, CCM_CGCR2, 14, get_rate_uart, NULL, &uart_per_clk); 177DEFINE_CLOCK(uart1_clk, 0, CCM_CGCR2, 14, get_rate_uart, NULL, &uart_per_clk);
171DEFINE_CLOCK(uart2_clk, 0, CCM_CGCR2, 15, get_rate_uart, NULL, &uart_per_clk); 178DEFINE_CLOCK(uart2_clk, 0, CCM_CGCR2, 15, get_rate_uart, NULL, &uart_per_clk);
172DEFINE_CLOCK(uart3_clk, 0, CCM_CGCR2, 16, get_rate_uart, NULL, &uart_per_clk); 179DEFINE_CLOCK(uart3_clk, 0, CCM_CGCR2, 16, get_rate_uart, NULL, &uart_per_clk);
@@ -183,6 +190,7 @@ DEFINE_CLOCK(tsc_clk, 0, CCM_CGCR2, 13, get_rate_ipg, NULL, NULL);
183DEFINE_CLOCK(i2c_clk, 0, CCM_CGCR0, 6, get_rate_i2c, NULL, NULL); 190DEFINE_CLOCK(i2c_clk, 0, CCM_CGCR0, 6, get_rate_i2c, NULL, NULL);
184DEFINE_CLOCK(fec_clk, 0, CCM_CGCR1, 15, get_rate_ipg, NULL, &fec_ahb_clk); 191DEFINE_CLOCK(fec_clk, 0, CCM_CGCR1, 15, get_rate_ipg, NULL, &fec_ahb_clk);
185DEFINE_CLOCK(dryice_clk, 0, CCM_CGCR1, 8, get_rate_ipg, NULL, NULL); 192DEFINE_CLOCK(dryice_clk, 0, CCM_CGCR1, 8, get_rate_ipg, NULL, NULL);
193DEFINE_CLOCK(lcdc_clk, 0, CCM_CGCR1, 29, get_rate_lcdc, NULL, &lcdc_per_clk);
186 194
187#define _REGISTER_CLOCK(d, n, c) \ 195#define _REGISTER_CLOCK(d, n, c) \
188 { \ 196 { \
@@ -216,6 +224,7 @@ static struct clk_lookup lookups[] = {
216 _REGISTER_CLOCK("imx-i2c.2", NULL, i2c_clk) 224 _REGISTER_CLOCK("imx-i2c.2", NULL, i2c_clk)
217 _REGISTER_CLOCK("fec.0", NULL, fec_clk) 225 _REGISTER_CLOCK("fec.0", NULL, fec_clk)
218 _REGISTER_CLOCK("imxdi_rtc.0", NULL, dryice_clk) 226 _REGISTER_CLOCK("imxdi_rtc.0", NULL, dryice_clk)
227 _REGISTER_CLOCK("imx-fb.0", NULL, lcdc_clk)
219}; 228};
220 229
221int __init mx25_clocks_init(void) 230int __init mx25_clocks_init(void)
@@ -233,6 +242,9 @@ int __init mx25_clocks_init(void)
233 __raw_writel((0xf << 16) | (3 << 26), CRM_BASE + CCM_CGCR1); 242 __raw_writel((0xf << 16) | (3 << 26), CRM_BASE + CCM_CGCR1);
234 __raw_writel((1 << 5), CRM_BASE + CCM_CGCR2); 243 __raw_writel((1 << 5), CRM_BASE + CCM_CGCR2);
235 244
245 /* Clock source for lcdc is upll */
246 __raw_writel(__raw_readl(CRM_BASE+0x64) | (1 << 7), CRM_BASE + 0x64);
247
236 mxc_timer_init(&gpt_clk, MX25_IO_ADDRESS(MX25_GPT1_BASE_ADDR), 54); 248 mxc_timer_init(&gpt_clk, MX25_IO_ADDRESS(MX25_GPT1_BASE_ADDR), 54);
237 249
238 return 0; 250 return 0;
diff --git a/arch/arm/mach-mx25/devices.c b/arch/arm/mach-mx25/devices.c
index b0b75fc99058..3f4b8a0b5fac 100644
--- a/arch/arm/mach-mx25/devices.c
+++ b/arch/arm/mach-mx25/devices.c
@@ -477,3 +477,26 @@ struct platform_device mx25_rtc_device = {
477 .num_resources = ARRAY_SIZE(mx25_rtc_resources), 477 .num_resources = ARRAY_SIZE(mx25_rtc_resources),
478 .resource = mx25_rtc_resources, 478 .resource = mx25_rtc_resources,
479}; 479};
480
481static 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
494struct 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 37e6a0821447..39560e13bc0d 100644
--- a/arch/arm/mach-mx25/devices.h
+++ b/arch/arm/mach-mx25/devices.h
@@ -20,3 +20,4 @@ extern struct platform_device mxc_i2c_device2;
20extern struct platform_device mx25_fec_device; 20extern struct platform_device mx25_fec_device;
21extern struct platform_device mxc_nand_device; 21extern struct platform_device mxc_nand_device;
22extern struct platform_device mx25_rtc_device; 22extern struct platform_device mx25_rtc_device;
23extern struct platform_device mx25_fb_device;
diff --git a/arch/arm/mach-mx25/mach-mx25pdk.c b/arch/arm/mach-mx25/mach-mx25pdk.c
index cb85e2e7961a..83d74109e7d8 100644
--- a/arch/arm/mach-mx25/mach-mx25pdk.c
+++ b/arch/arm/mach-mx25/mach-mx25pdk.c
@@ -35,6 +35,7 @@
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-mx25.h> 40#include <mach/iomux-mx25.h>
40 41
@@ -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
59static struct fec_platform_data mx25_fec_pdata = { 85static struct fec_platform_data mx25_fec_pdata = {
@@ -83,6 +109,34 @@ static struct mxc_nand_platform_data mx25pdk_nand_board_info = {
83 .flash_bbt = 1, 109 .flash_bbt = 1,
84}; 110};
85 111
112static 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
132static 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
86static void __init mx25pdk_init(void) 140static void __init mx25pdk_init(void)
87{ 141{
88 mxc_iomux_v3_setup_multiple_pads(mx25pdk_pads, 142 mxc_iomux_v3_setup_multiple_pads(mx25pdk_pads,
@@ -92,6 +146,7 @@ static void __init mx25pdk_init(void)
92 mxc_register_device(&mxc_usbh2, NULL); 146 mxc_register_device(&mxc_usbh2, NULL);
93 mxc_register_device(&mxc_nand_device, &mx25pdk_nand_board_info); 147 mxc_register_device(&mxc_nand_device, &mx25pdk_nand_board_info);
94 mxc_register_device(&mx25_rtc_device, NULL); 148 mxc_register_device(&mx25_rtc_device, NULL);
149 mxc_register_device(&mx25_fb_device, &mx25pdk_fb_pdata);
95 150
96 mx25pdk_fec_reset(); 151 mx25pdk_fec_reset();
97 mxc_register_device(&mx25_fec_device, &mx25_fec_pdata); 152 mxc_register_device(&mx25_fec_device, &mx25_fec_pdata);