aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorAndy Green <andy@warmcat.com>2011-07-10 07:27:14 -0400
committerPaul Walmsley <paul@pwsan.com>2011-07-10 07:27:14 -0400
commit3e6005221138bcfc08f1a35b6f9e43b53330e851 (patch)
tree276a76ad11a879d5df020a8eceb1839ae6449a3d /arch/arm
parentda7cdfac1b0c58d6863532dd3b432c3fbc034978 (diff)
I2C: OMAP2+: Set hwmod flags to only allow 16-bit accesses to i2c
Peter Maydell noticed when running under QEMU he was getting errors reporting 32-bit access to I2C peripheral unit registers that are documented to be 8 or 16-bit only[1][2] The I2C driver is blameless as it wraps its accesses in a function using __raw_writew and __raw_readw, it turned out it is the hwmod stuff. However the hwmod code already has a flag to force a perhipheral unit to only be accessed using 16-bit operations. This patch applies the 16-bit only flag to the 2430, OMAP3xxx and OMAP44xx hwmod structs. 2420 was already correctly marked up as 16-bit. The 2430 change will need testing by TI as arranged in the comments to the previous patch version. When the 16-bit flag is or-ed with other flags, it is placed first as requested in comments. [1] OMAP4430 Technical reference manual section 23.1.6.2 [2] OMAP3530 Techincal reference manual section 18.6 Cc: patches@linaro.org Cc: Ben Dooks <ben-linux@fluff.org> Reported-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Andy Green <andy.green@linaro.org> Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Kevin Hilman <khilman@ti.com> Signed-off-by: Paul Walmsley <paul@pwsan.com>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_2430_data.c2
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_3xxx_data.c3
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_44xx_data.c8
3 files changed, 9 insertions, 4 deletions
diff --git a/arch/arm/mach-omap2/omap_hwmod_2430_data.c b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
index 2a52f025bd06..19ddf082144d 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2430_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
@@ -1092,6 +1092,7 @@ static struct omap_hwmod_ocp_if *omap2430_i2c1_slaves[] = {
1092 1092
1093static struct omap_hwmod omap2430_i2c1_hwmod = { 1093static struct omap_hwmod omap2430_i2c1_hwmod = {
1094 .name = "i2c1", 1094 .name = "i2c1",
1095 .flags = HWMOD_16BIT_REG,
1095 .mpu_irqs = omap2_i2c1_mpu_irqs, 1096 .mpu_irqs = omap2_i2c1_mpu_irqs,
1096 .sdma_reqs = omap2_i2c1_sdma_reqs, 1097 .sdma_reqs = omap2_i2c1_sdma_reqs,
1097 .main_clk = "i2chs1_fck", 1098 .main_clk = "i2chs1_fck",
@@ -1127,6 +1128,7 @@ static struct omap_hwmod_ocp_if *omap2430_i2c2_slaves[] = {
1127 1128
1128static struct omap_hwmod omap2430_i2c2_hwmod = { 1129static struct omap_hwmod omap2430_i2c2_hwmod = {
1129 .name = "i2c2", 1130 .name = "i2c2",
1131 .flags = HWMOD_16BIT_REG,
1130 .mpu_irqs = omap2_i2c2_mpu_irqs, 1132 .mpu_irqs = omap2_i2c2_mpu_irqs,
1131 .sdma_reqs = omap2_i2c2_sdma_reqs, 1133 .sdma_reqs = omap2_i2c2_sdma_reqs,
1132 .main_clk = "i2chs2_fck", 1134 .main_clk = "i2chs2_fck",
diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index 1a52716e48bf..542a11b19a99 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -1615,6 +1615,7 @@ static struct omap_hwmod_ocp_if *omap3xxx_i2c1_slaves[] = {
1615 1615
1616static struct omap_hwmod omap3xxx_i2c1_hwmod = { 1616static struct omap_hwmod omap3xxx_i2c1_hwmod = {
1617 .name = "i2c1", 1617 .name = "i2c1",
1618 .flags = HWMOD_16BIT_REG,
1618 .mpu_irqs = omap2_i2c1_mpu_irqs, 1619 .mpu_irqs = omap2_i2c1_mpu_irqs,
1619 .sdma_reqs = omap2_i2c1_sdma_reqs, 1620 .sdma_reqs = omap2_i2c1_sdma_reqs,
1620 .main_clk = "i2c1_fck", 1621 .main_clk = "i2c1_fck",
@@ -1646,6 +1647,7 @@ static struct omap_hwmod_ocp_if *omap3xxx_i2c2_slaves[] = {
1646 1647
1647static struct omap_hwmod omap3xxx_i2c2_hwmod = { 1648static struct omap_hwmod omap3xxx_i2c2_hwmod = {
1648 .name = "i2c2", 1649 .name = "i2c2",
1650 .flags = HWMOD_16BIT_REG,
1649 .mpu_irqs = omap2_i2c2_mpu_irqs, 1651 .mpu_irqs = omap2_i2c2_mpu_irqs,
1650 .sdma_reqs = omap2_i2c2_sdma_reqs, 1652 .sdma_reqs = omap2_i2c2_sdma_reqs,
1651 .main_clk = "i2c2_fck", 1653 .main_clk = "i2c2_fck",
@@ -1688,6 +1690,7 @@ static struct omap_hwmod_ocp_if *omap3xxx_i2c3_slaves[] = {
1688 1690
1689static struct omap_hwmod omap3xxx_i2c3_hwmod = { 1691static struct omap_hwmod omap3xxx_i2c3_hwmod = {
1690 .name = "i2c3", 1692 .name = "i2c3",
1693 .flags = HWMOD_16BIT_REG,
1691 .mpu_irqs = i2c3_mpu_irqs, 1694 .mpu_irqs = i2c3_mpu_irqs,
1692 .sdma_reqs = i2c3_sdma_reqs, 1695 .sdma_reqs = i2c3_sdma_reqs,
1693 .main_clk = "i2c3_fck", 1696 .main_clk = "i2c3_fck",
diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
index b25ab836fbf0..2ebccb8820c5 100644
--- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
@@ -2201,7 +2201,7 @@ static struct omap_hwmod_ocp_if *omap44xx_i2c1_slaves[] = {
2201static struct omap_hwmod omap44xx_i2c1_hwmod = { 2201static struct omap_hwmod omap44xx_i2c1_hwmod = {
2202 .name = "i2c1", 2202 .name = "i2c1",
2203 .class = &omap44xx_i2c_hwmod_class, 2203 .class = &omap44xx_i2c_hwmod_class,
2204 .flags = HWMOD_INIT_NO_RESET, 2204 .flags = HWMOD_16BIT_REG | HWMOD_INIT_NO_RESET,
2205 .mpu_irqs = omap44xx_i2c1_irqs, 2205 .mpu_irqs = omap44xx_i2c1_irqs,
2206 .sdma_reqs = omap44xx_i2c1_sdma_reqs, 2206 .sdma_reqs = omap44xx_i2c1_sdma_reqs,
2207 .main_clk = "i2c1_fck", 2207 .main_clk = "i2c1_fck",
@@ -2254,7 +2254,7 @@ static struct omap_hwmod_ocp_if *omap44xx_i2c2_slaves[] = {
2254static struct omap_hwmod omap44xx_i2c2_hwmod = { 2254static struct omap_hwmod omap44xx_i2c2_hwmod = {
2255 .name = "i2c2", 2255 .name = "i2c2",
2256 .class = &omap44xx_i2c_hwmod_class, 2256 .class = &omap44xx_i2c_hwmod_class,
2257 .flags = HWMOD_INIT_NO_RESET, 2257 .flags = HWMOD_16BIT_REG | HWMOD_INIT_NO_RESET,
2258 .mpu_irqs = omap44xx_i2c2_irqs, 2258 .mpu_irqs = omap44xx_i2c2_irqs,
2259 .sdma_reqs = omap44xx_i2c2_sdma_reqs, 2259 .sdma_reqs = omap44xx_i2c2_sdma_reqs,
2260 .main_clk = "i2c2_fck", 2260 .main_clk = "i2c2_fck",
@@ -2307,7 +2307,7 @@ static struct omap_hwmod_ocp_if *omap44xx_i2c3_slaves[] = {
2307static struct omap_hwmod omap44xx_i2c3_hwmod = { 2307static struct omap_hwmod omap44xx_i2c3_hwmod = {
2308 .name = "i2c3", 2308 .name = "i2c3",
2309 .class = &omap44xx_i2c_hwmod_class, 2309 .class = &omap44xx_i2c_hwmod_class,
2310 .flags = HWMOD_INIT_NO_RESET, 2310 .flags = HWMOD_16BIT_REG | HWMOD_INIT_NO_RESET,
2311 .mpu_irqs = omap44xx_i2c3_irqs, 2311 .mpu_irqs = omap44xx_i2c3_irqs,
2312 .sdma_reqs = omap44xx_i2c3_sdma_reqs, 2312 .sdma_reqs = omap44xx_i2c3_sdma_reqs,
2313 .main_clk = "i2c3_fck", 2313 .main_clk = "i2c3_fck",
@@ -2360,7 +2360,7 @@ static struct omap_hwmod_ocp_if *omap44xx_i2c4_slaves[] = {
2360static struct omap_hwmod omap44xx_i2c4_hwmod = { 2360static struct omap_hwmod omap44xx_i2c4_hwmod = {
2361 .name = "i2c4", 2361 .name = "i2c4",
2362 .class = &omap44xx_i2c_hwmod_class, 2362 .class = &omap44xx_i2c_hwmod_class,
2363 .flags = HWMOD_INIT_NO_RESET, 2363 .flags = HWMOD_16BIT_REG | HWMOD_INIT_NO_RESET,
2364 .mpu_irqs = omap44xx_i2c4_irqs, 2364 .mpu_irqs = omap44xx_i2c4_irqs,
2365 .sdma_reqs = omap44xx_i2c4_sdma_reqs, 2365 .sdma_reqs = omap44xx_i2c4_sdma_reqs,
2366 .main_clk = "i2c4_fck", 2366 .main_clk = "i2c4_fck",