~beagleboard-kernel/+junk/2.6-stable

« back to all changes in this revision

Viewing changes to patches/for_next/0106-OMAP4-hwmod-Naming-of-address-space.patch

  • Committer: Robert Nelson
  • Date: 2011-05-30 18:22:18 UTC
  • Revision ID: robertcnelson@gmail.com-20110530182218-kl9c2elev8wckknd
Tags: 2.6.39-x0
2.6.39-x0 release

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
From aa6cbaeb91cbc23678fb4633a6a0c657f06d9e5c Mon Sep 17 00:00:00 2001
2
 
From: Kishon Vijay Abraham I <kishon@ti.com>
3
 
Date: Thu, 24 Feb 2011 15:16:50 +0530
4
 
Subject: [PATCH 106/258] OMAP4: hwmod: Naming of address space
5
 
 
6
 
Added a name to address space belonging to SDMA and MPU facilitating
7
 
the driver to get the address space info by name. Added a revision
8
 
member inorder to facilitate the driver to differentiate between
9
 
mcbsp in different omap.
10
 
Also added a platform_get_irq in probe to get irq number by index since
11
 
from OMAP4, there will be a single irq line.
12
 
 
13
 
Signed-off-by: Benoit Cousson <b-cousson@ti.com>
14
 
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
15
 
Signed-off-by: Tony Lindgren <tony@atomide.com>
16
 
---
17
 
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c |    8 ++++++++
18
 
 arch/arm/plat-omap/include/plat/mcbsp.h    |    1 +
19
 
 arch/arm/plat-omap/mcbsp.c                 |    4 ++++
20
 
 3 files changed, 13 insertions(+), 0 deletions(-)
21
 
 
22
 
diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
23
 
index 79a8601..673b011 100644
24
 
--- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
25
 
+++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
26
 
@@ -25,6 +25,7 @@
27
 
 #include <plat/gpio.h>
28
 
 #include <plat/dma.h>
29
 
 #include <plat/mcspi.h>
30
 
+#include <plat/mcbsp.h>
31
 
 
32
 
 #include "omap_hwmod_common_data.h"
33
 
 
34
 
@@ -2737,6 +2738,7 @@ static struct omap_hwmod_class_sysconfig omap44xx_mcbsp_sysc = {
35
 
 static struct omap_hwmod_class omap44xx_mcbsp_hwmod_class = {
36
 
        .name   = "mcbsp",
37
 
        .sysc   = &omap44xx_mcbsp_sysc,
38
 
+       .rev    = MCBSP_CONFIG_TYPE4,
39
 
 };
40
 
 
41
 
 /* mcbsp1 */
42
 
@@ -2752,6 +2754,7 @@ static struct omap_hwmod_dma_info omap44xx_mcbsp1_sdma_reqs[] = {
43
 
 
44
 
 static struct omap_hwmod_addr_space omap44xx_mcbsp1_addrs[] = {
45
 
        {
46
 
+               .name           = "mpu",
47
 
                .pa_start       = 0x40122000,
48
 
                .pa_end         = 0x401220ff,
49
 
                .flags          = ADDR_TYPE_RT
50
 
@@ -2770,6 +2773,7 @@ static struct omap_hwmod_ocp_if omap44xx_l4_abe__mcbsp1 = {
51
 
 
52
 
 static struct omap_hwmod_addr_space omap44xx_mcbsp1_dma_addrs[] = {
53
 
        {
54
 
+               .name           = "dma",
55
 
                .pa_start       = 0x49022000,
56
 
                .pa_end         = 0x490220ff,
57
 
                .flags          = ADDR_TYPE_RT
58
 
@@ -2823,6 +2827,7 @@ static struct omap_hwmod_dma_info omap44xx_mcbsp2_sdma_reqs[] = {
59
 
 
60
 
 static struct omap_hwmod_addr_space omap44xx_mcbsp2_addrs[] = {
61
 
        {
62
 
+               .name           = "mpu",
63
 
                .pa_start       = 0x40124000,
64
 
                .pa_end         = 0x401240ff,
65
 
                .flags          = ADDR_TYPE_RT
66
 
@@ -2841,6 +2846,7 @@ static struct omap_hwmod_ocp_if omap44xx_l4_abe__mcbsp2 = {
67
 
 
68
 
 static struct omap_hwmod_addr_space omap44xx_mcbsp2_dma_addrs[] = {
69
 
        {
70
 
+               .name           = "dma",
71
 
                .pa_start       = 0x49024000,
72
 
                .pa_end         = 0x490240ff,
73
 
                .flags          = ADDR_TYPE_RT
74
 
@@ -2894,6 +2900,7 @@ static struct omap_hwmod_dma_info omap44xx_mcbsp3_sdma_reqs[] = {
75
 
 
76
 
 static struct omap_hwmod_addr_space omap44xx_mcbsp3_addrs[] = {
77
 
        {
78
 
+               .name           = "mpu",
79
 
                .pa_start       = 0x40126000,
80
 
                .pa_end         = 0x401260ff,
81
 
                .flags          = ADDR_TYPE_RT
82
 
@@ -2912,6 +2919,7 @@ static struct omap_hwmod_ocp_if omap44xx_l4_abe__mcbsp3 = {
83
 
 
84
 
 static struct omap_hwmod_addr_space omap44xx_mcbsp3_dma_addrs[] = {
85
 
        {
86
 
+               .name           = "dma",
87
 
                .pa_start       = 0x49026000,
88
 
                .pa_end         = 0x490260ff,
89
 
                .flags          = ADDR_TYPE_RT
90
 
diff --git a/arch/arm/plat-omap/include/plat/mcbsp.h b/arch/arm/plat-omap/include/plat/mcbsp.h
91
 
index f084b6a..afcbb7b 100644
92
 
--- a/arch/arm/plat-omap/include/plat/mcbsp.h
93
 
+++ b/arch/arm/plat-omap/include/plat/mcbsp.h
94
 
@@ -39,6 +39,7 @@ static struct platform_device omap_mcbsp##port_nr = { \
95
 
 
96
 
 #define MCBSP_CONFIG_TYPE2     0x2
97
 
 #define MCBSP_CONFIG_TYPE3     0x3
98
 
+#define MCBSP_CONFIG_TYPE4     0x4
99
 
 
100
 
 #define OMAP7XX_MCBSP1_BASE    0xfffb1000
101
 
 #define OMAP7XX_MCBSP2_BASE    0xfffb1800
102
 
diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c
103
 
index 5f25ae5..62bd073 100644
104
 
--- a/arch/arm/plat-omap/mcbsp.c
105
 
+++ b/arch/arm/plat-omap/mcbsp.c
106
 
@@ -1812,6 +1812,10 @@ static int __devinit omap_mcbsp_probe(struct platform_device *pdev)
107
 
        mcbsp->tx_irq = platform_get_irq_byname(pdev, "tx");
108
 
        mcbsp->rx_irq = platform_get_irq_byname(pdev, "rx");
109
 
 
110
 
+       /* From OMAP4 there will be a single irq line */
111
 
+       if (mcbsp->tx_irq == -ENXIO)
112
 
+               mcbsp->tx_irq = platform_get_irq(pdev, 0);
113
 
+
114
 
        res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "rx");
115
 
        if (!res) {
116
 
                dev_err(&pdev->dev, "%s:mcbsp%d has invalid rx DMA channel\n",
117
 
1.7.1
118