aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorEric Bénard <eric@eukrea.com>2010-06-08 05:03:00 -0400
committerSascha Hauer <s.hauer@pengutronix.de>2010-07-26 08:18:13 -0400
commit8402ed30e16c65ad8560ba3293c7cf9c259712eb (patch)
tree1a3a2ccde8c6c6f93e4f8fe75fa21d8dccb886cf /arch/arm
parent2518507f727e6bf663fd0f276369cbdeb6a0ccc0 (diff)
i.MX25: add AUDMUX and SSI support
* add clocks for audmux and ssi 1 & 2 * add irq for ssi 1 & 2 * add devices platform for ssi1 & 2 * update audmux-v2 for i.MX25 * add base addresses for audmux & ssi 1 & 2 * add iomux configuration for GPIO for AUD5 port Signed-off-by: Eric Bénard <eric@eukrea.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-mx25/clock.c18
-rw-r--r--arch/arm/mach-mx25/devices.c38
-rw-r--r--arch/arm/mach-mx25/devices.h2
-rw-r--r--arch/arm/plat-mxc/Kconfig1
-rw-r--r--arch/arm/plat-mxc/audmux-v2.c15
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux-mx25.h4
-rw-r--r--arch/arm/plat-mxc/include/mach/mx25.h7
7 files changed, 83 insertions, 2 deletions
diff --git a/arch/arm/mach-mx25/clock.c b/arch/arm/mach-mx25/clock.c
index 84f0f1efea4b..caeea7551582 100644
--- a/arch/arm/mach-mx25/clock.c
+++ b/arch/arm/mach-mx25/clock.c
@@ -109,6 +109,16 @@ static unsigned long get_rate_uart(struct clk *clk)
109 return get_rate_per(15); 109 return get_rate_per(15);
110} 110}
111 111
112static unsigned long get_rate_ssi2(struct clk *clk)
113{
114 return get_rate_per(14);
115}
116
117static unsigned long get_rate_ssi1(struct clk *clk)
118{
119 return get_rate_per(13);
120}
121
112static unsigned long get_rate_i2c(struct clk *clk) 122static unsigned long get_rate_i2c(struct clk *clk)
113{ 123{
114 return get_rate_per(6); 124 return get_rate_per(6);
@@ -171,6 +181,8 @@ static void clk_cgcr_disable(struct clk *clk)
171 181
172DEFINE_CLOCK(gpt_clk, 0, CCM_CGCR0, 5, get_rate_gpt, NULL, NULL); 182DEFINE_CLOCK(gpt_clk, 0, CCM_CGCR0, 5, get_rate_gpt, NULL, NULL);
173DEFINE_CLOCK(uart_per_clk, 0, CCM_CGCR0, 15, get_rate_uart, NULL, NULL); 183DEFINE_CLOCK(uart_per_clk, 0, CCM_CGCR0, 15, get_rate_uart, NULL, NULL);
184DEFINE_CLOCK(ssi1_per_clk, 0, CCM_CGCR0, 13, get_rate_ipg, NULL, NULL);
185DEFINE_CLOCK(ssi2_per_clk, 0, CCM_CGCR0, 14, get_rate_ipg, NULL, NULL);
174DEFINE_CLOCK(cspi1_clk, 0, CCM_CGCR1, 5, get_rate_ipg, NULL, NULL); 186DEFINE_CLOCK(cspi1_clk, 0, CCM_CGCR1, 5, get_rate_ipg, NULL, NULL);
175DEFINE_CLOCK(cspi2_clk, 0, CCM_CGCR1, 6, get_rate_ipg, NULL, NULL); 187DEFINE_CLOCK(cspi2_clk, 0, CCM_CGCR1, 6, get_rate_ipg, NULL, NULL);
176DEFINE_CLOCK(cspi3_clk, 0, CCM_CGCR1, 7, get_rate_ipg, NULL, NULL); 188DEFINE_CLOCK(cspi3_clk, 0, CCM_CGCR1, 7, get_rate_ipg, NULL, NULL);
@@ -194,6 +206,9 @@ DEFINE_CLOCK(i2c_clk, 0, CCM_CGCR0, 6, get_rate_i2c, NULL, NULL);
194DEFINE_CLOCK(fec_clk, 0, CCM_CGCR1, 15, get_rate_ipg, NULL, &fec_ahb_clk); 206DEFINE_CLOCK(fec_clk, 0, CCM_CGCR1, 15, get_rate_ipg, NULL, &fec_ahb_clk);
195DEFINE_CLOCK(dryice_clk, 0, CCM_CGCR1, 8, get_rate_ipg, NULL, NULL); 207DEFINE_CLOCK(dryice_clk, 0, CCM_CGCR1, 8, get_rate_ipg, NULL, NULL);
196DEFINE_CLOCK(lcdc_clk, 0, CCM_CGCR1, 29, get_rate_lcdc, NULL, &lcdc_per_clk); 208DEFINE_CLOCK(lcdc_clk, 0, CCM_CGCR1, 29, get_rate_lcdc, NULL, &lcdc_per_clk);
209DEFINE_CLOCK(ssi1_clk, 0, CCM_CGCR2, 11, get_rate_ssi1, NULL, &ssi1_per_clk);
210DEFINE_CLOCK(ssi2_clk, 1, CCM_CGCR2, 12, get_rate_ssi2, NULL, &ssi2_per_clk);
211DEFINE_CLOCK(audmux_clk, 0, CCM_CGCR1, 0, NULL, NULL, NULL);
197 212
198#define _REGISTER_CLOCK(d, n, c) \ 213#define _REGISTER_CLOCK(d, n, c) \
199 { \ 214 { \
@@ -228,6 +243,9 @@ static struct clk_lookup lookups[] = {
228 _REGISTER_CLOCK("fec.0", NULL, fec_clk) 243 _REGISTER_CLOCK("fec.0", NULL, fec_clk)
229 _REGISTER_CLOCK("imxdi_rtc.0", NULL, dryice_clk) 244 _REGISTER_CLOCK("imxdi_rtc.0", NULL, dryice_clk)
230 _REGISTER_CLOCK("imx-fb.0", NULL, lcdc_clk) 245 _REGISTER_CLOCK("imx-fb.0", NULL, lcdc_clk)
246 _REGISTER_CLOCK("imx-ssi.0", NULL, ssi1_clk)
247 _REGISTER_CLOCK("imx-ssi.1", NULL, ssi2_clk)
248 _REGISTER_CLOCK(NULL, "audmux", audmux_clk)
231}; 249};
232 250
233int __init mx25_clocks_init(void) 251int __init mx25_clocks_init(void)
diff --git a/arch/arm/mach-mx25/devices.c b/arch/arm/mach-mx25/devices.c
index d9766d4d5046..baf0a7913644 100644
--- a/arch/arm/mach-mx25/devices.c
+++ b/arch/arm/mach-mx25/devices.c
@@ -533,3 +533,41 @@ struct platform_device mx25_kpp_device = {
533 .num_resources = ARRAY_SIZE(mx25_kpp_resources), 533 .num_resources = ARRAY_SIZE(mx25_kpp_resources),
534 .resource = mx25_kpp_resources, 534 .resource = mx25_kpp_resources,
535}; 535};
536
537static struct resource imx_ssi_resources0[] = {
538 {
539 .start = MX25_SSI1_BASE_ADDR,
540 .end = MX25_SSI1_BASE_ADDR + 0x3fff,
541 .flags = IORESOURCE_MEM,
542 }, {
543 .start = MX25_INT_SSI1,
544 .end = MX25_INT_SSI1,
545 .flags = IORESOURCE_IRQ,
546 },
547};
548
549static struct resource imx_ssi_resources1[] = {
550 {
551 .start = MX25_SSI2_BASE_ADDR,
552 .end = MX25_SSI2_BASE_ADDR + 0x3fff,
553 .flags = IORESOURCE_MEM
554 }, {
555 .start = MX25_INT_SSI2,
556 .end = MX25_INT_SSI2,
557 .flags = IORESOURCE_IRQ,
558 },
559};
560
561struct platform_device imx_ssi_device0 = {
562 .name = "imx-ssi",
563 .id = 0,
564 .num_resources = ARRAY_SIZE(imx_ssi_resources0),
565 .resource = imx_ssi_resources0,
566};
567
568struct platform_device imx_ssi_device1 = {
569 .name = "imx-ssi",
570 .id = 1,
571 .num_resources = ARRAY_SIZE(imx_ssi_resources1),
572 .resource = imx_ssi_resources1,
573};
diff --git a/arch/arm/mach-mx25/devices.h b/arch/arm/mach-mx25/devices.h
index 8247fd451118..290843bdddf3 100644
--- a/arch/arm/mach-mx25/devices.h
+++ b/arch/arm/mach-mx25/devices.h
@@ -23,3 +23,5 @@ extern struct platform_device mx25_rtc_device;
23extern struct platform_device mx25_fb_device; 23extern struct platform_device mx25_fb_device;
24extern struct platform_device mxc_wdt; 24extern struct platform_device mxc_wdt;
25extern struct platform_device mx25_kpp_device; 25extern struct platform_device mx25_kpp_device;
26extern struct platform_device imx_ssi_device0;
27extern struct platform_device imx_ssi_device1;
diff --git a/arch/arm/plat-mxc/Kconfig b/arch/arm/plat-mxc/Kconfig
index 7f7ad6f289bd..902ba9e42c5b 100644
--- a/arch/arm/plat-mxc/Kconfig
+++ b/arch/arm/plat-mxc/Kconfig
@@ -25,6 +25,7 @@ config ARCH_MX25
25 select CPU_ARM926T 25 select CPU_ARM926T
26 select ARCH_MXC_IOMUX_V3 26 select ARCH_MXC_IOMUX_V3
27 select HAVE_FB_IMX 27 select HAVE_FB_IMX
28 select ARCH_MXC_AUDMUX_V2
28 help 29 help
29 This enables support for systems based on the Freescale i.MX25 family 30 This enables support for systems based on the Freescale i.MX25 family
30 31
diff --git a/arch/arm/plat-mxc/audmux-v2.c b/arch/arm/plat-mxc/audmux-v2.c
index 0c2cc5cd4d83..ab94d78a927f 100644
--- a/arch/arm/plat-mxc/audmux-v2.c
+++ b/arch/arm/plat-mxc/audmux-v2.c
@@ -191,6 +191,7 @@ static int mxc_audmux_v2_init(void)
191{ 191{
192 int ret; 192 int ret;
193 193
194#if defined(CONFIG_ARCH_MX3)
194 if (cpu_is_mx31()) 195 if (cpu_is_mx31())
195 audmux_base = MX31_IO_ADDRESS(MX31_AUDMUX_BASE_ADDR); 196 audmux_base = MX31_IO_ADDRESS(MX31_AUDMUX_BASE_ADDR);
196 197
@@ -204,7 +205,19 @@ static int mxc_audmux_v2_init(void)
204 } 205 }
205 audmux_base = MX35_IO_ADDRESS(MX35_AUDMUX_BASE_ADDR); 206 audmux_base = MX35_IO_ADDRESS(MX35_AUDMUX_BASE_ADDR);
206 } 207 }
207 208#endif
209#if defined(CONFIG_ARCH_MX25)
210 if (cpu_is_mx25()) {
211 audmux_clk = clk_get(NULL, "audmux");
212 if (IS_ERR(audmux_clk)) {
213 ret = PTR_ERR(audmux_clk);
214 printk(KERN_ERR "%s: cannot get clock: %d\n", __func__,
215 ret);
216 return ret;
217 }
218 audmux_base = MX25_IO_ADDRESS(MX25_AUDMUX_BASE_ADDR);
219 }
220#endif
208 audmux_debugfs_init(); 221 audmux_debugfs_init();
209 222
210 return 0; 223 return 0;
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx25.h b/arch/arm/plat-mxc/include/mach/iomux-mx25.h
index e88d01a125a6..1c8317e8ecce 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-mx25.h
+++ b/arch/arm/plat-mxc/include/mach/iomux-mx25.h
@@ -389,15 +389,19 @@
389#define MX25_PAD_KPP_ROW3__GPIO_3_0 IOMUX_PAD(0x3ac, 0x1b4, 0x15, 0, 0, NO_PAD_CTRL) 389#define MX25_PAD_KPP_ROW3__GPIO_3_0 IOMUX_PAD(0x3ac, 0x1b4, 0x15, 0, 0, NO_PAD_CTRL)
390 390
391#define MX25_PAD_KPP_COL0__KPP_COL0 IOMUX_PAD(0x3b0, 0x1b8, 0x10, 0, 0, KPP_CTL_COL) 391#define MX25_PAD_KPP_COL0__KPP_COL0 IOMUX_PAD(0x3b0, 0x1b8, 0x10, 0, 0, KPP_CTL_COL)
392#define MX25_PAD_KPP_COL0__AUD5_TXD IOMUX_PAD(0x3b0, 0x1b8, 0x12, 0, 0, PAD_CTL_PKE | PAD_CTL_PUS_100K_UP)
392#define MX25_PAD_KPP_COL0__GPIO_3_1 IOMUX_PAD(0x3b0, 0x1b8, 0x15, 0, 0, NO_PAD_CTRL) 393#define MX25_PAD_KPP_COL0__GPIO_3_1 IOMUX_PAD(0x3b0, 0x1b8, 0x15, 0, 0, NO_PAD_CTRL)
393 394
394#define MX25_PAD_KPP_COL1__KPP_COL1 IOMUX_PAD(0x3b4, 0x1bc, 0x10, 0, 0, KPP_CTL_COL) 395#define MX25_PAD_KPP_COL1__KPP_COL1 IOMUX_PAD(0x3b4, 0x1bc, 0x10, 0, 0, KPP_CTL_COL)
396#define MX25_PAD_KPP_COL1__AUD5_RXD IOMUX_PAD(0x3b4, 0x1bc, 0x12, 0, 0, PAD_CTL_PKE | PAD_CTL_PUS_100K_UP)
395#define MX25_PAD_KPP_COL1__GPIO_3_2 IOMUX_PAD(0x3b4, 0x1bc, 0x15, 0, 0, NO_PAD_CTRL) 397#define MX25_PAD_KPP_COL1__GPIO_3_2 IOMUX_PAD(0x3b4, 0x1bc, 0x15, 0, 0, NO_PAD_CTRL)
396 398
397#define MX25_PAD_KPP_COL2__KPP_COL2 IOMUX_PAD(0x3b8, 0x1c0, 0x10, 0, 0, KPP_CTL_COL) 399#define MX25_PAD_KPP_COL2__KPP_COL2 IOMUX_PAD(0x3b8, 0x1c0, 0x10, 0, 0, KPP_CTL_COL)
400#define MX25_PAD_KPP_COL2__AUD5_TXC IOMUX_PAD(0x3b8, 0x1c0, 0x12, 0, 0, PAD_CTL_PKE | PAD_CTL_PUS_100K_UP)
398#define MX25_PAD_KPP_COL2__GPIO_3_3 IOMUX_PAD(0x3b8, 0x1c0, 0x15, 0, 0, NO_PAD_CTRL) 401#define MX25_PAD_KPP_COL2__GPIO_3_3 IOMUX_PAD(0x3b8, 0x1c0, 0x15, 0, 0, NO_PAD_CTRL)
399 402
400#define MX25_PAD_KPP_COL3__KPP_COL3 IOMUX_PAD(0x3bc, 0x1c4, 0x10, 0, 0, KPP_CTL_COL) 403#define MX25_PAD_KPP_COL3__KPP_COL3 IOMUX_PAD(0x3bc, 0x1c4, 0x10, 0, 0, KPP_CTL_COL)
404#define MX25_PAD_KPP_COL3__AUD5_TXFS IOMUX_PAD(0x3bc, 0x1c4, 0x12, 0, 0, PAD_CTL_PKE | PAD_CTL_PUS_100K_UP)
401#define MX25_PAD_KPP_COL3__GPIO_3_4 IOMUX_PAD(0x3bc, 0x1c4, 0x15, 0, 0, NO_PAD_CTRL) 405#define MX25_PAD_KPP_COL3__GPIO_3_4 IOMUX_PAD(0x3bc, 0x1c4, 0x15, 0, 0, NO_PAD_CTRL)
402 406
403#define MX25_PAD_FEC_MDC__FEC_MDC IOMUX_PAD(0x3c0, 0x1c8, 0x10, 0, 0, NO_PAD_CTRL) 407#define MX25_PAD_FEC_MDC__FEC_MDC IOMUX_PAD(0x3c0, 0x1c8, 0x10, 0, 0, NO_PAD_CTRL)
diff --git a/arch/arm/plat-mxc/include/mach/mx25.h b/arch/arm/plat-mxc/include/mach/mx25.h
index f064ec8833bb..a1ba9d7c55d7 100644
--- a/arch/arm/plat-mxc/include/mach/mx25.h
+++ b/arch/arm/plat-mxc/include/mach/mx25.h
@@ -29,19 +29,24 @@
29 29
30#define MX25_UART1_BASE_ADDR 0x43f90000 30#define MX25_UART1_BASE_ADDR 0x43f90000
31#define MX25_UART2_BASE_ADDR 0x43f94000 31#define MX25_UART2_BASE_ADDR 0x43f94000
32#define MX25_AUDMUX_BASE_ADDR 0x43fb0000
32 33
33#define MX25_FEC_BASE_ADDR 0x50038000 34#define MX25_FEC_BASE_ADDR 0x50038000
35#define MX25_SSI2_BASE_ADDR 0x50014000
36#define MX25_SSI1_BASE_ADDR 0x50034000
34#define MX25_NFC_BASE_ADDR 0xbb000000 37#define MX25_NFC_BASE_ADDR 0xbb000000
35#define MX25_DRYICE_BASE_ADDR 0x53ffc000 38#define MX25_DRYICE_BASE_ADDR 0x53ffc000
36#define MX25_LCDC_BASE_ADDR 0x53fbc000 39#define MX25_LCDC_BASE_ADDR 0x53fbc000
37#define MX25_KPP_BASE_ADDR 0x43fa8000 40#define MX25_KPP_BASE_ADDR 0x43fa8000
38#define MX25_OTG_BASE_ADDR 0x53ff4000 41#define MX25_OTG_BASE_ADDR 0x53ff4000
39 42
43#define MX25_INT_SSI2 11
44#define MX25_INT_SSI1 12
40#define MX25_INT_DRYICE 25 45#define MX25_INT_DRYICE 25
41#define MX25_INT_FEC 57
42#define MX25_INT_NANDFC 33 46#define MX25_INT_NANDFC 33
43#define MX25_INT_LCDC 39 47#define MX25_INT_LCDC 39
44#define MX25_INT_KPP 24 48#define MX25_INT_KPP 24
49#define MX25_INT_FEC 57
45 50
46#if defined(IMX_NEEDS_DEPRECATED_SYMBOLS) 51#if defined(IMX_NEEDS_DEPRECATED_SYMBOLS)
47#define UART1_BASE_ADDR MX25_UART1_BASE_ADDR 52#define UART1_BASE_ADDR MX25_UART1_BASE_ADDR