diff options
author | Abhilash Kesavan <a.kesavan@samsung.com> | 2012-11-20 04:20:38 -0500 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2012-11-20 04:20:38 -0500 |
commit | 7000fe8c7a072214d90ca1fc8189b25c30fdd918 (patch) | |
tree | d021bc6eb796679665a59623da46cbdeb5394ff9 /arch/arm/mach-exynos | |
parent | 840ed42942cc1ebbda2ed55f4019673b537fc5de (diff) |
ARM: EXYNOS: Setup legacy i2c controller interrupts
On Exynos5 we have a new high-speed i2c controller. The interrupt
sources for the legacy and new controller are muxed and are controlled
via the SYSCON I2C_CFG register. At reset the interrupt source is
configured for the high-speed controller, to continue using the old
i2c controller we need to modify the I2C_CFG register.
Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm/mach-exynos')
-rw-r--r-- | arch/arm/mach-exynos/include/mach/regs-pmu.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-exynos/mach-exynos5-dt.c | 24 |
2 files changed, 26 insertions, 0 deletions
diff --git a/arch/arm/mach-exynos/include/mach/regs-pmu.h b/arch/arm/mach-exynos/include/mach/regs-pmu.h index d4e392b811a3..684625ad3f39 100644 --- a/arch/arm/mach-exynos/include/mach/regs-pmu.h +++ b/arch/arm/mach-exynos/include/mach/regs-pmu.h | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <mach/map.h> | 15 | #include <mach/map.h> |
16 | 16 | ||
17 | #define S5P_PMUREG(x) (S5P_VA_PMU + (x)) | 17 | #define S5P_PMUREG(x) (S5P_VA_PMU + (x)) |
18 | #define S5P_SYSREG(x) (S3C_VA_SYS + (x)) | ||
18 | 19 | ||
19 | #define S5P_CENTRAL_SEQ_CONFIGURATION S5P_PMUREG(0x0200) | 20 | #define S5P_CENTRAL_SEQ_CONFIGURATION S5P_PMUREG(0x0200) |
20 | 21 | ||
@@ -230,6 +231,7 @@ | |||
230 | 231 | ||
231 | /* For EXYNOS5 */ | 232 | /* For EXYNOS5 */ |
232 | 233 | ||
234 | #define EXYNOS5_SYS_I2C_CFG S5P_SYSREG(0x0234) | ||
233 | #define EXYNOS5_USB_CFG S5P_PMUREG(0x0230) | 235 | #define EXYNOS5_USB_CFG S5P_PMUREG(0x0230) |
234 | 236 | ||
235 | #define EXYNOS5_AUTO_WDTRESET_DISABLE S5P_PMUREG(0x0408) | 237 | #define EXYNOS5_AUTO_WDTRESET_DISABLE S5P_PMUREG(0x0408) |
diff --git a/arch/arm/mach-exynos/mach-exynos5-dt.c b/arch/arm/mach-exynos/mach-exynos5-dt.c index db035374087e..f906f599a141 100644 --- a/arch/arm/mach-exynos/mach-exynos5-dt.c +++ b/arch/arm/mach-exynos/mach-exynos5-dt.c | |||
@@ -11,10 +11,12 @@ | |||
11 | 11 | ||
12 | #include <linux/of_platform.h> | 12 | #include <linux/of_platform.h> |
13 | #include <linux/serial_core.h> | 13 | #include <linux/serial_core.h> |
14 | #include <linux/io.h> | ||
14 | 15 | ||
15 | #include <asm/mach/arch.h> | 16 | #include <asm/mach/arch.h> |
16 | #include <asm/hardware/gic.h> | 17 | #include <asm/hardware/gic.h> |
17 | #include <mach/map.h> | 18 | #include <mach/map.h> |
19 | #include <mach/regs-pmu.h> | ||
18 | 20 | ||
19 | #include <plat/cpu.h> | 21 | #include <plat/cpu.h> |
20 | #include <plat/regs-serial.h> | 22 | #include <plat/regs-serial.h> |
@@ -91,6 +93,28 @@ static void __init exynos5250_dt_map_io(void) | |||
91 | 93 | ||
92 | static void __init exynos5250_dt_machine_init(void) | 94 | static void __init exynos5250_dt_machine_init(void) |
93 | { | 95 | { |
96 | struct device_node *i2c_np; | ||
97 | const char *i2c_compat = "samsung,s3c2440-i2c"; | ||
98 | unsigned int tmp; | ||
99 | |||
100 | /* | ||
101 | * Exynos5's legacy i2c controller and new high speed i2c | ||
102 | * controller have muxed interrupt sources. By default the | ||
103 | * interrupts for 4-channel HS-I2C controller are enabled. | ||
104 | * If node for first four channels of legacy i2c controller | ||
105 | * are available then re-configure the interrupts via the | ||
106 | * system register. | ||
107 | */ | ||
108 | for_each_compatible_node(i2c_np, NULL, i2c_compat) { | ||
109 | if (of_device_is_available(i2c_np)) { | ||
110 | if (of_alias_get_id(i2c_np, "i2c") < 4) { | ||
111 | tmp = readl(EXYNOS5_SYS_I2C_CFG); | ||
112 | writel(tmp & ~(0x1 << of_alias_get_id(i2c_np, "i2c")), | ||
113 | EXYNOS5_SYS_I2C_CFG); | ||
114 | } | ||
115 | } | ||
116 | } | ||
117 | |||
94 | of_platform_populate(NULL, of_default_bus_match_table, | 118 | of_platform_populate(NULL, of_default_bus_match_table, |
95 | exynos5250_auxdata_lookup, NULL); | 119 | exynos5250_auxdata_lookup, NULL); |
96 | } | 120 | } |