From 3f4978c713255c8406875fbdf23ffed1129bc44b Mon Sep 17 00:00:00 2001 From: Heiko Schocher Date: Mon, 16 Jan 2012 21:12:24 +0000 Subject: i2c: common changes for multibus/multiadapter support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Heiko Schocher Signed-off-by: Simon Glass Cc: Henrik Nordström --- arch/m68k/lib/board.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'arch/m68k') diff --git a/arch/m68k/lib/board.c b/arch/m68k/lib/board.c index efc9fcc..582f47b 100644 --- a/arch/m68k/lib/board.c +++ b/arch/m68k/lib/board.c @@ -56,7 +56,7 @@ #include #if defined(CONFIG_HARD_I2C) || \ - defined(CONFIG_SOFT_I2C) + defined(CONFIG_SOFT_I2C) #include #endif @@ -142,11 +142,16 @@ static int init_func_ram (void) /***********************************************************************/ -#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C) +#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C) || \ + defined(CONFIG_SYS_I2C) static int init_func_i2c (void) { puts ("I2C: "); +#ifdef CONFIG_SYS_I2C + i2c_init_all(); +#else i2c_init (CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE); +#endif puts ("ready\n"); return (0); } @@ -178,7 +183,8 @@ init_fnc_t *init_sequence[] = { display_options, checkcpu, checkboard, -#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C) +#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C) || \ + defined(CONFIG_SYS_I2C) init_func_i2c, #endif #if defined(CONFIG_HARD_SPI) @@ -501,6 +507,11 @@ void board_init_r (gd_t *id, ulong dest_addr) spi_init_r (); #endif +#if defined(CONFIG_SYS_I2C) + /* Adjust I2C subsystem pointers after relocation */ + i2c_reloc_fixup(); +#endif + /* relocate environment function pointers etc. */ env_relocate (); -- cgit v1.1 From ea818dbbcd59300b56014ac2d67798a54994eb9b Mon Sep 17 00:00:00 2001 From: Heiko Schocher Date: Tue, 29 Jan 2013 08:53:15 +0100 Subject: i2c, soft-i2c: switch to new multibus/multiadapter support - added to soft_i2c driver new multibus/multiadpater support - adapted all config files, which uses this driver Signed-off-by: Heiko Schocher Cc: Simon Glass Cc: Stephen Warren --- arch/m68k/lib/board.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'arch/m68k') diff --git a/arch/m68k/lib/board.c b/arch/m68k/lib/board.c index 582f47b..2baafa5 100644 --- a/arch/m68k/lib/board.c +++ b/arch/m68k/lib/board.c @@ -56,7 +56,7 @@ #include #if defined(CONFIG_HARD_I2C) || \ - defined(CONFIG_SOFT_I2C) + defined(CONFIG_SYS_I2C) #include #endif @@ -142,8 +142,7 @@ static int init_func_ram (void) /***********************************************************************/ -#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C) || \ - defined(CONFIG_SYS_I2C) +#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C) static int init_func_i2c (void) { puts ("I2C: "); @@ -183,8 +182,7 @@ init_fnc_t *init_sequence[] = { display_options, checkcpu, checkboard, -#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C) || \ - defined(CONFIG_SYS_I2C) +#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C) init_func_i2c, #endif #if defined(CONFIG_HARD_SPI) -- cgit v1.1 From 00f792e0df9ae942427e44595a0f4379582accee Mon Sep 17 00:00:00 2001 From: Heiko Schocher Date: Wed, 24 Oct 2012 13:48:22 +0200 Subject: i2c, fsl_i2c: switch to new multibus/multiadapter support - added to fsl_i2c driver new multibus/multiadpater support - adapted all config files, which uses this driver Signed-off-by: Heiko Schocher Cc: Simon Glass Cc: Stephen Warren --- arch/m68k/cpu/mcf5227x/cpu_init.c | 2 +- arch/m68k/cpu/mcf5227x/speed.c | 2 +- arch/m68k/cpu/mcf523x/cpu_init.c | 2 +- arch/m68k/cpu/mcf523x/speed.c | 2 +- arch/m68k/cpu/mcf52x2/cpu_init.c | 4 ++-- arch/m68k/cpu/mcf52x2/speed.c | 4 ++-- arch/m68k/cpu/mcf532x/cpu_init.c | 4 ++-- arch/m68k/cpu/mcf532x/speed.c | 2 +- arch/m68k/cpu/mcf5445x/cpu_init.c | 2 +- arch/m68k/cpu/mcf5445x/speed.c | 4 ++-- arch/m68k/cpu/mcf547x_8x/cpu_init.c | 2 +- arch/m68k/cpu/mcf547x_8x/speed.c | 2 +- arch/m68k/include/asm/global_data.h | 2 +- 13 files changed, 17 insertions(+), 17 deletions(-) (limited to 'arch/m68k') diff --git a/arch/m68k/cpu/mcf5227x/cpu_init.c b/arch/m68k/cpu/mcf5227x/cpu_init.c index 1928eb3..e9ac21a 100644 --- a/arch/m68k/cpu/mcf5227x/cpu_init.c +++ b/arch/m68k/cpu/mcf5227x/cpu_init.c @@ -105,7 +105,7 @@ void cpu_init_f(void) out_be32(&fbcs->csmr5, CONFIG_SYS_CS5_MASK); #endif -#ifdef CONFIG_FSL_I2C +#ifdef CONFIG_SYS_I2C_FSL out_8(&gpio->par_i2c, GPIO_PAR_I2C_SCL_SCL | GPIO_PAR_I2C_SDA_SDA); #endif diff --git a/arch/m68k/cpu/mcf5227x/speed.c b/arch/m68k/cpu/mcf5227x/speed.c index 98f554a..30d3207 100644 --- a/arch/m68k/cpu/mcf5227x/speed.c +++ b/arch/m68k/cpu/mcf5227x/speed.c @@ -134,7 +134,7 @@ int get_clocks(void) gd->bus_clk = gd->arch.flb_clk; } -#ifdef CONFIG_FSL_I2C +#ifdef CONFIG_SYS_I2C_FSL gd->arch.i2c1_clk = gd->bus_clk; #endif diff --git a/arch/m68k/cpu/mcf523x/cpu_init.c b/arch/m68k/cpu/mcf523x/cpu_init.c index d1c0b40..1ad5d02 100644 --- a/arch/m68k/cpu/mcf523x/cpu_init.c +++ b/arch/m68k/cpu/mcf523x/cpu_init.c @@ -115,7 +115,7 @@ void cpu_init_f(void) out_be32(&fbcs->csmr7, CONFIG_SYS_CS7_MASK); #endif -#ifdef CONFIG_FSL_I2C +#ifdef CONFIG_SYS_I2C_FSL CONFIG_SYS_I2C_PINMUX_REG &= CONFIG_SYS_I2C_PINMUX_CLR; CONFIG_SYS_I2C_PINMUX_REG |= CONFIG_SYS_I2C_PINMUX_SET; #endif diff --git a/arch/m68k/cpu/mcf523x/speed.c b/arch/m68k/cpu/mcf523x/speed.c index ae46257..7876ba8 100644 --- a/arch/m68k/cpu/mcf523x/speed.c +++ b/arch/m68k/cpu/mcf523x/speed.c @@ -47,7 +47,7 @@ int get_clocks(void) gd->bus_clk = CONFIG_SYS_CLK; gd->cpu_clk = (gd->bus_clk * 2); -#ifdef CONFIG_FSL_I2C +#ifdef CONFIG_SYS_I2C_FSL gd->arch.i2c1_clk = gd->bus_clk; #endif diff --git a/arch/m68k/cpu/mcf52x2/cpu_init.c b/arch/m68k/cpu/mcf52x2/cpu_init.c index 5d0e9f0..5d01670 100644 --- a/arch/m68k/cpu/mcf52x2/cpu_init.c +++ b/arch/m68k/cpu/mcf52x2/cpu_init.c @@ -228,7 +228,7 @@ void cpu_init_f(void) /* FlexBus Chipselect */ init_fbcs(); -#ifdef CONFIG_FSL_I2C +#ifdef CONFIG_SYS_I2C_FSL CONFIG_SYS_I2C_PINMUX_REG = CONFIG_SYS_I2C_PINMUX_REG & CONFIG_SYS_I2C_PINMUX_CLR; CONFIG_SYS_I2C_PINMUX_REG |= CONFIG_SYS_I2C_PINMUX_SET; @@ -498,7 +498,7 @@ void cpu_init_f(void) init_fbcs(); #endif /* #ifndef CONFIG_MONITOR_IS_IN_RAM */ -#ifdef CONFIG_FSL_I2C +#ifdef CONFIG_SYS_I2C_FSL CONFIG_SYS_I2C_PINMUX_REG &= CONFIG_SYS_I2C_PINMUX_CLR; CONFIG_SYS_I2C_PINMUX_REG |= CONFIG_SYS_I2C_PINMUX_SET; #endif diff --git a/arch/m68k/cpu/mcf52x2/speed.c b/arch/m68k/cpu/mcf52x2/speed.c index ba7dbaa..ad68692 100644 --- a/arch/m68k/cpu/mcf52x2/speed.c +++ b/arch/m68k/cpu/mcf52x2/speed.c @@ -90,9 +90,9 @@ int get_clocks (void) gd->bus_clk = gd->cpu_clk; #endif -#ifdef CONFIG_FSL_I2C +#ifdef CONFIG_SYS_I2C_FSL gd->arch.i2c1_clk = gd->bus_clk; -#ifdef CONFIG_SYS_I2C2_OFFSET +#ifdef CONFIG_SYS_I2C2_FSL_OFFSET gd->arch.i2c2_clk = gd->bus_clk; #endif #endif diff --git a/arch/m68k/cpu/mcf532x/cpu_init.c b/arch/m68k/cpu/mcf532x/cpu_init.c index f571fad..bd7672d 100644 --- a/arch/m68k/cpu/mcf532x/cpu_init.c +++ b/arch/m68k/cpu/mcf532x/cpu_init.c @@ -98,7 +98,7 @@ void cpu_init_f(void) out_be32(&fbcs->csmr5, CONFIG_SYS_CS5_MASK); #endif -#ifdef CONFIG_FSL_I2C +#ifdef CONFIG_SYS_I2C_FSL out_8(&gpio->par_feci2c, GPIO_PAR_FECI2C_SDA_SDA | GPIO_PAR_FECI2C_SCL_SCL); #endif @@ -292,7 +292,7 @@ void cpu_init_f(void) out_be32(&fbcs->csmr5, CONFIG_SYS_CS5_MASK); #endif -#ifdef CONFIG_FSL_I2C +#ifdef CONFIG_SYS_I2C_FSL out_8(&gpio->par_feci2c, GPIO_PAR_FECI2C_SCL_SCL | GPIO_PAR_FECI2C_SDA_SDA); #endif diff --git a/arch/m68k/cpu/mcf532x/speed.c b/arch/m68k/cpu/mcf532x/speed.c index 8efb451..6e1d6a5 100644 --- a/arch/m68k/cpu/mcf532x/speed.c +++ b/arch/m68k/cpu/mcf532x/speed.c @@ -270,7 +270,7 @@ int get_clocks(void) gd->bus_clk = clock_pll(CONFIG_SYS_CLK / 1000, 0) * 1000; gd->cpu_clk = (gd->bus_clk * 3); -#ifdef CONFIG_FSL_I2C +#ifdef CONFIG_SYS_I2C_FSL gd->arch.i2c1_clk = gd->bus_clk; #endif diff --git a/arch/m68k/cpu/mcf5445x/cpu_init.c b/arch/m68k/cpu/mcf5445x/cpu_init.c index 6e947d0..3c53a7f 100644 --- a/arch/m68k/cpu/mcf5445x/cpu_init.c +++ b/arch/m68k/cpu/mcf5445x/cpu_init.c @@ -212,7 +212,7 @@ void cpu_init_f(void) GPIO_PAR_FBCTL_OE | GPIO_PAR_FBCTL_TA_TA | GPIO_PAR_FBCTL_RW_RW | GPIO_PAR_FBCTL_TS_TS); -#ifdef CONFIG_FSL_I2C +#ifdef CONFIG_SYS_FSL_I2C out_be16(&gpio->par_feci2c, GPIO_PAR_FECI2C_SCL_SCL | GPIO_PAR_FECI2C_SDA_SDA); #endif diff --git a/arch/m68k/cpu/mcf5445x/speed.c b/arch/m68k/cpu/mcf5445x/speed.c index 0276d4d..3b341b8 100644 --- a/arch/m68k/cpu/mcf5445x/speed.c +++ b/arch/m68k/cpu/mcf5445x/speed.c @@ -273,7 +273,7 @@ void setup_5445x_clocks(void) #endif } -#ifdef CONFIG_FSL_I2C +#ifdef CONFIG_SYS_I2C_FSL gd->arch.i2c1_clk = gd->bus_clk; #endif } @@ -289,7 +289,7 @@ int get_clocks(void) setup_5445x_clocks(); #endif -#ifdef CONFIG_FSL_I2C +#ifdef CONFIG_SYS_FSL_I2C gd->arch.i2c1_clk = gd->bus_clk; #endif diff --git a/arch/m68k/cpu/mcf547x_8x/cpu_init.c b/arch/m68k/cpu/mcf547x_8x/cpu_init.c index 4eb8a7c..4c529dc 100644 --- a/arch/m68k/cpu/mcf547x_8x/cpu_init.c +++ b/arch/m68k/cpu/mcf547x_8x/cpu_init.c @@ -95,7 +95,7 @@ void cpu_init_f(void) out_be32(&fbcs->csmr5, CONFIG_SYS_CS5_MASK); #endif -#ifdef CONFIG_FSL_I2C +#ifdef CONFIG_SYS_I2C_FSL out_be16(&gpio->par_feci2cirq, GPIO_PAR_FECI2CIRQ_SCL | GPIO_PAR_FECI2CIRQ_SDA); #endif diff --git a/arch/m68k/cpu/mcf547x_8x/speed.c b/arch/m68k/cpu/mcf547x_8x/speed.c index 41aae9d..80e006b 100644 --- a/arch/m68k/cpu/mcf547x_8x/speed.c +++ b/arch/m68k/cpu/mcf547x_8x/speed.c @@ -40,7 +40,7 @@ int get_clocks(void) gd->bus_clk = CONFIG_SYS_CLK; gd->cpu_clk = (gd->bus_clk * 2); -#ifdef CONFIG_FSL_I2C +#ifdef CONFIG_SYS_I2C_FSL gd->arch.i2c1_clk = gd->bus_clk; #endif diff --git a/arch/m68k/include/asm/global_data.h b/arch/m68k/include/asm/global_data.h index 3ec298f..58a481d 100644 --- a/arch/m68k/include/asm/global_data.h +++ b/arch/m68k/include/asm/global_data.h @@ -26,7 +26,7 @@ /* Architecture-specific global data */ struct arch_global_data { -#ifdef CONFIG_FSL_I2C +#ifdef CONFIG_SYS_I2C_FSL unsigned long i2c1_clk; unsigned long i2c2_clk; #endif -- cgit v1.1