aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2
diff options
context:
space:
mode:
authorKyle Manna <kyle.manna@fuel7.com>2011-10-18 14:47:41 -0400
committerPaul Walmsley <paul@pwsan.com>2011-12-16 00:44:34 -0500
commit4bf90f6573d04845917dc0ac38170746f84c533c (patch)
treee8f976c9adf7b632e37917ee3176eac41d7084ff /arch/arm/mach-omap2
parent91a36bdb3ada99ebf3a613a0dab2d741445ffd7f (diff)
ARM: OMAP: hwmod data: Add support for AM35xx UART4/ttyO3
Add hwmod support to enable access to UART4 of the AM35xx series of chips. The UART4 device referenced from the TRM will show up as ttyO3. This was tested on an AM3505. Signed-off-by: Kyle Manna <kyle.manna@fuel7.com> Signed-off-by: Paul Walmsley <paul@pwsan.com>
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r--arch/arm/mach-omap2/clock3xxx_data.c11
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_3xxx_data.c52
-rw-r--r--arch/arm/mach-omap2/prcm-common.h2
3 files changed, 65 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/clock3xxx_data.c b/arch/arm/mach-omap2/clock3xxx_data.c
index 5d0064a4fb5a..4e1b1a2f0537 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -2480,6 +2480,16 @@ static struct clk uart4_fck = {
2480 .recalc = &followparent_recalc, 2480 .recalc = &followparent_recalc,
2481}; 2481};
2482 2482
2483static struct clk uart4_fck_am35xx = {
2484 .name = "uart4_fck",
2485 .ops = &clkops_omap2_dflt_wait,
2486 .parent = &per_48m_fck,
2487 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
2488 .enable_bit = OMAP3430_EN_UART4_SHIFT,
2489 .clkdm_name = "core_l4_clkdm",
2490 .recalc = &followparent_recalc,
2491};
2492
2483static struct clk gpt2_fck = { 2493static struct clk gpt2_fck = {
2484 .name = "gpt2_fck", 2494 .name = "gpt2_fck",
2485 .ops = &clkops_omap2_dflt_wait, 2495 .ops = &clkops_omap2_dflt_wait,
@@ -3403,6 +3413,7 @@ static struct omap_clk omap3xxx_clks[] = {
3403 CLK(NULL, "per_48m_fck", &per_48m_fck, CK_3XXX), 3413 CLK(NULL, "per_48m_fck", &per_48m_fck, CK_3XXX),
3404 CLK(NULL, "uart3_fck", &uart3_fck, CK_3XXX), 3414 CLK(NULL, "uart3_fck", &uart3_fck, CK_3XXX),
3405 CLK(NULL, "uart4_fck", &uart4_fck, CK_36XX), 3415 CLK(NULL, "uart4_fck", &uart4_fck, CK_36XX),
3416 CLK(NULL, "uart4_fck", &uart4_fck_am35xx, CK_3505 | CK_3517),
3406 CLK(NULL, "gpt2_fck", &gpt2_fck, CK_3XXX), 3417 CLK(NULL, "gpt2_fck", &gpt2_fck, CK_3XXX),
3407 CLK(NULL, "gpt3_fck", &gpt3_fck, CK_3XXX), 3418 CLK(NULL, "gpt3_fck", &gpt3_fck, CK_3XXX),
3408 CLK(NULL, "gpt4_fck", &gpt4_fck, CK_3XXX), 3419 CLK(NULL, "gpt4_fck", &gpt4_fck, CK_3XXX),
diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index 126cb49c0de7..3be90feca77c 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -164,6 +164,7 @@ static struct omap_hwmod omap3xxx_uart1_hwmod;
164static struct omap_hwmod omap3xxx_uart2_hwmod; 164static struct omap_hwmod omap3xxx_uart2_hwmod;
165static struct omap_hwmod omap3xxx_uart3_hwmod; 165static struct omap_hwmod omap3xxx_uart3_hwmod;
166static struct omap_hwmod omap3xxx_uart4_hwmod; 166static struct omap_hwmod omap3xxx_uart4_hwmod;
167static struct omap_hwmod am35xx_uart4_hwmod;
167static struct omap_hwmod omap3xxx_usbhsotg_hwmod; 168static struct omap_hwmod omap3xxx_usbhsotg_hwmod;
168 169
169/* l3_core -> usbhsotg interface */ 170/* l3_core -> usbhsotg interface */
@@ -299,6 +300,23 @@ static struct omap_hwmod_ocp_if omap3_l4_per__uart4 = {
299 .user = OCP_USER_MPU | OCP_USER_SDMA, 300 .user = OCP_USER_MPU | OCP_USER_SDMA,
300}; 301};
301 302
303/* AM35xx: L4 CORE -> UART4 interface */
304static struct omap_hwmod_addr_space am35xx_uart4_addr_space[] = {
305 {
306 .pa_start = OMAP3_UART4_AM35XX_BASE,
307 .pa_end = OMAP3_UART4_AM35XX_BASE + SZ_1K - 1,
308 .flags = ADDR_MAP_ON_INIT | ADDR_TYPE_RT,
309 },
310};
311
312static struct omap_hwmod_ocp_if am35xx_l4_core__uart4 = {
313 .master = &omap3xxx_l4_core_hwmod,
314 .slave = &am35xx_uart4_hwmod,
315 .clk = "uart4_ick",
316 .addr = am35xx_uart4_addr_space,
317 .user = OCP_USER_MPU | OCP_USER_SDMA,
318};
319
302/* L4 CORE -> I2C1 interface */ 320/* L4 CORE -> I2C1 interface */
303static struct omap_hwmod_ocp_if omap3_l4_core__i2c1 = { 321static struct omap_hwmod_ocp_if omap3_l4_core__i2c1 = {
304 .master = &omap3xxx_l4_core_hwmod, 322 .master = &omap3xxx_l4_core_hwmod,
@@ -1309,6 +1327,39 @@ static struct omap_hwmod omap3xxx_uart4_hwmod = {
1309 .class = &omap2_uart_class, 1327 .class = &omap2_uart_class,
1310}; 1328};
1311 1329
1330static struct omap_hwmod_irq_info am35xx_uart4_mpu_irqs[] = {
1331 { .irq = INT_35XX_UART4_IRQ, },
1332};
1333
1334static struct omap_hwmod_dma_info am35xx_uart4_sdma_reqs[] = {
1335 { .name = "rx", .dma_req = AM35XX_DMA_UART4_RX, },
1336 { .name = "tx", .dma_req = AM35XX_DMA_UART4_TX, },
1337};
1338
1339static struct omap_hwmod_ocp_if *am35xx_uart4_slaves[] = {
1340 &am35xx_l4_core__uart4,
1341};
1342
1343static struct omap_hwmod am35xx_uart4_hwmod = {
1344 .name = "uart4",
1345 .mpu_irqs = am35xx_uart4_mpu_irqs,
1346 .sdma_reqs = am35xx_uart4_sdma_reqs,
1347 .main_clk = "uart4_fck",
1348 .prcm = {
1349 .omap2 = {
1350 .module_offs = CORE_MOD,
1351 .prcm_reg_id = 1,
1352 .module_bit = OMAP3430_EN_UART4_SHIFT,
1353 .idlest_reg_id = 1,
1354 .idlest_idle_bit = OMAP3430_EN_UART4_SHIFT,
1355 },
1356 },
1357 .slaves = am35xx_uart4_slaves,
1358 .slaves_cnt = ARRAY_SIZE(am35xx_uart4_slaves),
1359 .class = &omap2_uart_class,
1360};
1361
1362
1312static struct omap_hwmod_class i2c_class = { 1363static struct omap_hwmod_class i2c_class = {
1313 .name = "i2c", 1364 .name = "i2c",
1314 .sysc = &i2c_sysc, 1365 .sysc = &i2c_sysc,
@@ -3287,6 +3338,7 @@ static __initdata struct omap_hwmod *omap36xx_hwmods[] = {
3287static __initdata struct omap_hwmod *am35xx_hwmods[] = { 3338static __initdata struct omap_hwmod *am35xx_hwmods[] = {
3288 &omap3xxx_dss_core_hwmod, /* XXX ??? */ 3339 &omap3xxx_dss_core_hwmod, /* XXX ??? */
3289 &am35xx_usbhsotg_hwmod, 3340 &am35xx_usbhsotg_hwmod,
3341 &am35xx_uart4_hwmod,
3290 NULL 3342 NULL
3291}; 3343};
3292 3344
diff --git a/arch/arm/mach-omap2/prcm-common.h b/arch/arm/mach-omap2/prcm-common.h
index 0363dcb0ef93..da2d80f5fcbd 100644
--- a/arch/arm/mach-omap2/prcm-common.h
+++ b/arch/arm/mach-omap2/prcm-common.h
@@ -201,6 +201,8 @@
201#define OMAP3430_EN_MMC2_SHIFT 25 201#define OMAP3430_EN_MMC2_SHIFT 25
202#define OMAP3430_EN_MMC1_MASK (1 << 24) 202#define OMAP3430_EN_MMC1_MASK (1 << 24)
203#define OMAP3430_EN_MMC1_SHIFT 24 203#define OMAP3430_EN_MMC1_SHIFT 24
204#define OMAP3430_EN_UART4_MASK (1 << 23)
205#define OMAP3430_EN_UART4_SHIFT 23
204#define OMAP3430_EN_MCSPI4_MASK (1 << 21) 206#define OMAP3430_EN_MCSPI4_MASK (1 << 21)
205#define OMAP3430_EN_MCSPI4_SHIFT 21 207#define OMAP3430_EN_MCSPI4_SHIFT 21
206#define OMAP3430_EN_MCSPI3_MASK (1 << 20) 208#define OMAP3430_EN_MCSPI3_MASK (1 << 20)