Commit de6f604de245b19ce2e330bc63b6522af134d7ae
Committed by
Heiko Schocher
1 parent
211e47549b
Exists in
master
and in
54 other branches
mxc_i2c: specify i2c base address in config file
The following platforms had their config files changed flea3, imx31_phycore, mx35pdk, mx53ard, mx53evk, mx53smd and mx53loco. Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> Acked-by: Stefano Babic <sbabic@denx.de>
Showing 10 changed files with 20 additions and 29 deletions Side-by-side Diff
arch/arm/include/asm/arch-mx31/imx-regs.h
... | ... | @@ -606,6 +606,13 @@ |
606 | 606 | #define UART4_BASE 0x43FB0000 |
607 | 607 | #define UART5_BASE 0x43FB4000 |
608 | 608 | |
609 | +#define I2C1_BASE_ADDR 0x43f80000 | |
610 | +#define I2C1_CLK_OFFSET 26 | |
611 | +#define I2C2_BASE_ADDR 0x43F98000 | |
612 | +#define I2C2_CLK_OFFSET 28 | |
613 | +#define I2C3_BASE_ADDR 0x43f84000 | |
614 | +#define I2C3_CLK_OFFSET 30 | |
615 | + | |
609 | 616 | #define ESDCTL_SDE (1 << 31) |
610 | 617 | #define ESDCTL_CMD_RW (0 << 28) |
611 | 618 | #define ESDCTL_CMD_PRECHARGE (1 << 28) |
arch/arm/include/asm/arch-mx35/imx-regs.h
... | ... | @@ -39,7 +39,7 @@ |
39 | 39 | #define MAX_BASE_ADDR 0x43F04000 |
40 | 40 | #define EVTMON_BASE_ADDR 0x43F08000 |
41 | 41 | #define CLKCTL_BASE_ADDR 0x43F0C000 |
42 | -#define I2C_BASE_ADDR 0x43F80000 | |
42 | +#define I2C1_BASE_ADDR 0x43F80000 | |
43 | 43 | #define I2C3_BASE_ADDR 0x43F84000 |
44 | 44 | #define ATA_BASE_ADDR 0x43F8C000 |
45 | 45 | #define UART1_BASE 0x43F90000 |
drivers/i2c/mxc_i2c.c
... | ... | @@ -59,27 +59,10 @@ |
59 | 59 | #define I2SR_IIF (1 << 1) |
60 | 60 | #define I2SR_RX_NO_AK (1 << 0) |
61 | 61 | |
62 | -#if defined(CONFIG_SYS_I2C_MX31_PORT1) | |
63 | -#define I2C_BASE 0x43f80000 | |
64 | -#define I2C_CLK_OFFSET 26 | |
65 | -#elif defined (CONFIG_SYS_I2C_MX31_PORT2) | |
66 | -#define I2C_BASE 0x43f98000 | |
67 | -#define I2C_CLK_OFFSET 28 | |
68 | -#elif defined (CONFIG_SYS_I2C_MX31_PORT3) | |
69 | -#define I2C_BASE 0x43f84000 | |
70 | -#define I2C_CLK_OFFSET 30 | |
71 | -#elif defined(CONFIG_SYS_I2C_MX53_PORT1) | |
72 | -#define I2C_BASE I2C1_BASE_ADDR | |
73 | -#elif defined(CONFIG_SYS_I2C_MX53_PORT2) | |
74 | -#define I2C_BASE I2C2_BASE_ADDR | |
75 | -#elif defined(CONFIG_SYS_I2C_MX35_PORT1) | |
76 | -#define I2C_BASE I2C_BASE_ADDR | |
77 | -#elif defined(CONFIG_SYS_I2C_MX35_PORT2) | |
78 | -#define I2C_BASE I2C2_BASE_ADDR | |
79 | -#elif defined(CONFIG_SYS_I2C_MX35_PORT3) | |
80 | -#define I2C_BASE I2C3_BASE_ADDR | |
62 | +#ifdef CONFIG_SYS_I2C_BASE | |
63 | +#define I2C_BASE CONFIG_SYS_I2C_BASE | |
81 | 64 | #else |
82 | -#error "define CONFIG_SYS_I2C_MX<Processor>_PORTx to use the mx I2C driver" | |
65 | +#error "define CONFIG_SYS_I2C_BASE to use the mxc_i2c driver" | |
83 | 66 | #endif |
84 | 67 | |
85 | 68 | #define I2C_MAX_TIMEOUT 10000 |
... | ... | @@ -114,7 +97,7 @@ |
114 | 97 | (struct clock_control_regs *)CCM_BASE; |
115 | 98 | |
116 | 99 | /* start the required I2C clock */ |
117 | - writel(readl(&sc_regs->cgr0) | (3 << I2C_CLK_OFFSET), | |
100 | + writel(readl(&sc_regs->cgr0) | (3 << CONFIG_SYS_I2C_CLK_OFFSET), | |
118 | 101 | &sc_regs->cgr0); |
119 | 102 | #endif |
120 | 103 |
include/configs/flea3.h
include/configs/imx31_phycore.h
... | ... | @@ -54,7 +54,8 @@ |
54 | 54 | |
55 | 55 | #define CONFIG_HARD_I2C |
56 | 56 | #define CONFIG_I2C_MXC |
57 | -#define CONFIG_SYS_I2C_MX31_PORT2 | |
57 | +#define CONFIG_SYS_I2C_BASE I2C2_BASE_ADDR | |
58 | +#define CONFIG_SYS_I2C_CLK_OFFSET I2C2_CLK_OFFSET | |
58 | 59 | #define CONFIG_SYS_I2C_SPEED 100000 |
59 | 60 | |
60 | 61 | #define CONFIG_MXC_UART |
include/configs/mx35pdk.h
include/configs/mx53ard.h
include/configs/mx53evk.h
include/configs/mx53loco.h
include/configs/mx53smd.h