From eb5ba3aefdf0f6cbd61684eeb61428f11fa7613c Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 12 May 2017 21:09:49 -0600 Subject: i2c: Drop use of CONFIG_I2C_HARD This option is pretty old. It predates CONFIG_SYS_I2C which is itself deprecated in favour of driver model. Disable it for all boards. Also drop I2C options which depend on this. Signed-off-by: Simon Glass --- README | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'README') diff --git a/README b/README index 2ca0102b57b..86f0814f792 100644 --- a/README +++ b/README @@ -2213,22 +2213,9 @@ The following options need to be configured: - approved multibus support - better i2c mux support - ** Please consider updating your I2C driver now. ** + ** CONFIG_HARD_I2C is now being removed ** - These enable legacy I2C serial bus commands. Defining - CONFIG_HARD_I2C will include the appropriate I2C driver - for the selected CPU. - - This will allow you to use i2c commands at the u-boot - command line (as long as you set CONFIG_CMD_I2C in - CONFIG_COMMANDS) and communicate with i2c based realtime - clock chips. See common/cmd_i2c.c for a description of the - command line interface. - - CONFIG_HARD_I2C selects a hardware I2C controller. - - There are several other quantities that must also be - defined when you define CONFIG_HARD_I2C. +----under removal: In both cases you will need to define CONFIG_SYS_I2C_SPEED to be the frequency (in Hz) at which you wish your i2c bus -- cgit v1.3.1 From 69153988a6f4eda44257c6bc5afac484f8f95930 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 12 May 2017 21:09:56 -0600 Subject: i2c: Finish dropping use of CONFIG_I2C_HARD Drop use of this long-deprecated option. Signed-off-by: Simon Glass Reviewed-by: Tom Rini --- README | 16 ++++++++-------- cmd/eeprom.c | 2 -- common/board_f.c | 4 ++-- common/stdio.c | 5 +---- scripts/config_whitelist.txt | 1 - 5 files changed, 11 insertions(+), 17 deletions(-) (limited to 'README') diff --git a/README b/README index 86f0814f792..11fa84ccc45 100644 --- a/README +++ b/README @@ -2204,7 +2204,9 @@ The following options need to be configured: If you do not have i2c muxes on your board, omit this define. -- Legacy I2C Support: CONFIG_HARD_I2C +----under removal: + +- Legacy I2C Support: CONFIG_SOFT_I2C NOTE: It is intended to move drivers to CONFIG_SYS_I2C which provides the following compelling advantages: @@ -2213,14 +2215,12 @@ The following options need to be configured: - approved multibus support - better i2c mux support - ** CONFIG_HARD_I2C is now being removed ** - -----under removal: + ** CONFIG_SOFT_I2C is now being removed ** - In both cases you will need to define CONFIG_SYS_I2C_SPEED - to be the frequency (in Hz) at which you wish your i2c bus - to run and CONFIG_SYS_I2C_SLAVE to be the address of this node (ie - the CPU's i2c node address). + With CONFIG_SOFT_I2C you will need to define + CONFIG_SYS_I2C_SPEED to be the frequency (in Hz) at which you + wish your i2c bus to run and CONFIG_SYS_I2C_SLAVE to be the + address of this node (ie the CPU's i2c node address). Now, the u-boot i2c code for the mpc8xx (arch/powerpc/cpu/mpc8xx/i2c.c) sets the CPU up as a master node diff --git a/cmd/eeprom.c b/cmd/eeprom.c index 0a0e4a2c1cc..e43566bc56d 100644 --- a/cmd/eeprom.c +++ b/cmd/eeprom.c @@ -73,11 +73,9 @@ void eeprom_init(int bus) #endif /* I2C EEPROM */ -#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C) #if defined(CONFIG_SYS_I2C) if (bus >= 0) i2c_set_bus_num(bus); -#endif i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE); #endif } diff --git a/common/board_f.c b/common/board_f.c index d9431ee79a8..eed3e7be2a1 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -184,7 +184,7 @@ __weak int dram_init_banksize(void) return 0; } -#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C) +#if defined(CONFIG_SYS_I2C) static int init_func_i2c(void) { puts("I2C: "); @@ -765,7 +765,7 @@ static const init_fnc_t init_sequence_f[] = { misc_init_f, #endif INIT_FUNC_WATCHDOG_RESET -#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C) +#if defined(CONFIG_SYS_I2C) init_func_i2c, #endif #if defined(CONFIG_HARD_SPI) diff --git a/common/stdio.c b/common/stdio.c index 4d300175301..ee4f0bda9ea 100644 --- a/common/stdio.c +++ b/common/stdio.c @@ -21,7 +21,7 @@ #include #endif -#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C) +#if defined(CONFIG_SYS_I2C) #include #endif @@ -346,9 +346,6 @@ int stdio_add_devices(void) #ifdef CONFIG_SYS_I2C i2c_init_all(); #else -#if defined(CONFIG_HARD_I2C) - i2c_init (CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE); -#endif #endif #ifdef CONFIG_DM_VIDEO /* diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index 7646bb68420..da37e49c831 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -1134,7 +1134,6 @@ CONFIG_G_DNL_UMS_VENDOR_NUM CONFIG_H264_FREQ CONFIG_H8300 CONFIG_HALEAKALA -CONFIG_HARD_I2C CONFIG_HARD_SPI CONFIG_HASH_VERIFY CONFIG_HAS_DATAFLASH -- cgit v1.3.1 From b238c9dce5e487092531fb6e61c4d9f334f86686 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 12 May 2017 21:09:57 -0600 Subject: i2c: README: Drop CONFIG_SYS_I2C_INIT_MPC5XXX This option is not used in U-Boot. Drop it. Signed-off-by: Simon Glass --- README | 2 -- 1 file changed, 2 deletions(-) (limited to 'README') diff --git a/README b/README index 11fa84ccc45..9f9265dc6d7 100644 --- a/README +++ b/README @@ -2228,8 +2228,6 @@ The following options need to be configured: eg, MPC823e User's Manual p.16-473). So, set CONFIG_SYS_I2C_SLAVE to 0. - CONFIG_SYS_I2C_INIT_MPC5XXX - When a board is reset during an i2c bus transfer chips might think that the current transfer is still in progress. Reset the slave devices by sending start -- cgit v1.3.1 From b0103f33b45286eef53239d3c80e21d7eafd9cb4 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 12 May 2017 21:09:58 -0600 Subject: i2c: Drop CONFIG_SYS_I2C_BOARD_LATE_INIT This option is not used by any boards. Drop it. Signed-off-by: Simon Glass --- README | 11 ----------- drivers/i2c/fsl_i2c.c | 9 --------- drivers/i2c/fti2c010.c | 9 --------- include/i2c.h | 3 --- scripts/config_whitelist.txt | 1 - 5 files changed, 33 deletions(-) (limited to 'README') diff --git a/README b/README index 9f9265dc6d7..96ce6289ea9 100644 --- a/README +++ b/README @@ -2323,17 +2323,6 @@ The following options need to be configured: custom i2c_init_board() routine in boards/xxx/board.c is run early in the boot sequence. - CONFIG_SYS_I2C_BOARD_LATE_INIT - - An alternative to CONFIG_SYS_I2C_INIT_BOARD. If this option is - defined a custom i2c_board_late_init() routine in - boards/xxx/board.c is run AFTER the operations in i2c_init() - is completed. This callpoint can be used to unreset i2c bus - using CPU i2c controller register accesses for CPUs whose i2c - controller provide such a method. It is called at the end of - i2c_init() to allow i2c_init operations to setup the i2c bus - controller on the CPU (e.g. setting bus speed & slave address). - CONFIG_I2CFAST (PPC405GP|PPC405EP only) This option enables configuration of bi_iic_fast[] flags diff --git a/drivers/i2c/fsl_i2c.c b/drivers/i2c/fsl_i2c.c index a1406baa87b..ff3dc25927a 100644 --- a/drivers/i2c/fsl_i2c.c +++ b/drivers/i2c/fsl_i2c.c @@ -284,15 +284,6 @@ static void __i2c_init(const struct fsl_i2c_base *base, int speed, int break; } - -#ifdef CONFIG_SYS_I2C_BOARD_LATE_INIT - /* Call board specific i2c bus reset routine AFTER the bus has been - * initialized. Use either this callpoint or i2c_init_board; - * which is called before i2c_init operations. - * For details about this problem see doc/I2C_Edge_Conditions. - */ - i2c_board_late_init(); -#endif } static int diff --git a/drivers/i2c/fti2c010.c b/drivers/i2c/fti2c010.c index b35d0d2d9c5..4da959fa537 100644 --- a/drivers/i2c/fti2c010.c +++ b/drivers/i2c/fti2c010.c @@ -146,15 +146,6 @@ static void fti2c010_init(struct i2c_adapter *adap, int speed, int slaveaddr) set_i2c_bus_speed(chip, speed); /* slave init, don't care */ - -#ifdef CONFIG_SYS_I2C_BOARD_LATE_INIT - /* Call board specific i2c bus reset routine AFTER the bus has been - * initialized. Use either this callpoint or i2c_init_board; - * which is called before fti2c010_init operations. - * For details about this problem see doc/I2C_Edge_Conditions. - */ - i2c_board_late_init(); -#endif } /* diff --git a/include/i2c.h b/include/i2c.h index cd7f61e1c1e..a88cc7cddf9 100644 --- a/include/i2c.h +++ b/include/i2c.h @@ -706,9 +706,6 @@ void i2c_early_init_f(void); #endif void i2c_init(int speed, int slaveaddr); void i2c_init_board(void); -#ifdef CONFIG_SYS_I2C_BOARD_LATE_INIT -void i2c_board_late_init(void); -#endif #ifdef CONFIG_SYS_I2C /* diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index da37e49c831..5cdca33f87c 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -4222,7 +4222,6 @@ CONFIG_SYS_I2C_BASE2 CONFIG_SYS_I2C_BASE3 CONFIG_SYS_I2C_BASE4 CONFIG_SYS_I2C_BASE5 -CONFIG_SYS_I2C_BOARD_LATE_INIT CONFIG_SYS_I2C_BOOT_EEPROM_ADDR CONFIG_SYS_I2C_BUSES CONFIG_SYS_I2C_BUS_MAX -- cgit v1.3.1 From 213f27f3f9c89dbf32e38cb031b303193e6e8627 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 12 May 2017 21:09:59 -0600 Subject: Drop CONFIG_I2CFAST This option is not used in U-Boot. Drop it. Signed-off-by: Simon Glass --- README | 6 ------ common/board_r.c | 17 ----------------- scripts/config_whitelist.txt | 1 - 3 files changed, 24 deletions(-) (limited to 'README') diff --git a/README b/README index 96ce6289ea9..71d8de0ba8f 100644 --- a/README +++ b/README @@ -2323,12 +2323,6 @@ The following options need to be configured: custom i2c_init_board() routine in boards/xxx/board.c is run early in the boot sequence. - CONFIG_I2CFAST (PPC405GP|PPC405EP only) - - This option enables configuration of bi_iic_fast[] flags - in u-boot bd_info structure based on u-boot environment - variable "i2cfast". (see also i2cfast) - CONFIG_I2C_MULTI_BUS This option allows the use of multiple I2C buses, each of which diff --git a/common/board_r.c b/common/board_r.c index d69a33c4a3f..dba2102b187 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -485,24 +485,7 @@ static int initr_env(void) /* Initialize from environment */ load_addr = getenv_ulong("loadaddr", 16, load_addr); -#if defined(CONFIG_SYS_EXTBDINFO) -#if defined(CONFIG_405GP) || defined(CONFIG_405EP) -#if defined(CONFIG_I2CFAST) - /* - * set bi_iic_fast for linux taking environment variable - * "i2cfast" into account - */ - { - char *s = getenv("i2cfast"); - if (s && ((*s == 'y') || (*s == 'Y'))) { - gd->bd->bi_iic_fast[0] = 1; - gd->bd->bi_iic_fast[1] = 1; - } - } -#endif /* CONFIG_I2CFAST */ -#endif /* CONFIG_405GP, CONFIG_405EP */ -#endif /* CONFIG_SYS_EXTBDINFO */ return 0; } diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index 5cdca33f87c..7cdfcd0a52c 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -1319,7 +1319,6 @@ CONFIG_HW_ENV_SETTINGS CONFIG_HW_WATCHDOG CONFIG_HW_WATCHDOG_TIMEOUT_MS CONFIG_I2C -CONFIG_I2CFAST CONFIG_I2C_CHIPADDRESS CONFIG_I2C_CMD_TREE CONFIG_I2C_ENV_EEPROM_BUS -- cgit v1.3.1 From ce3b5d69112b1adc878e06586c1bc819414309be Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 12 May 2017 21:10:00 -0600 Subject: Drop use of CONFIG_I2C_SOFT This option is not used in U-Boot. Drop it. Signed-off-by: Simon Glass --- README | 32 +------------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) (limited to 'README') diff --git a/README b/README index 71d8de0ba8f..95251995519 100644 --- a/README +++ b/README @@ -2204,37 +2204,7 @@ The following options need to be configured: If you do not have i2c muxes on your board, omit this define. -----under removal: - -- Legacy I2C Support: CONFIG_SOFT_I2C - - NOTE: It is intended to move drivers to CONFIG_SYS_I2C which - provides the following compelling advantages: - - - more than one i2c adapter is usable - - approved multibus support - - better i2c mux support - - ** CONFIG_SOFT_I2C is now being removed ** - - With CONFIG_SOFT_I2C you will need to define - CONFIG_SYS_I2C_SPEED to be the frequency (in Hz) at which you - wish your i2c bus to run and CONFIG_SYS_I2C_SLAVE to be the - address of this node (ie the CPU's i2c node address). - - Now, the u-boot i2c code for the mpc8xx - (arch/powerpc/cpu/mpc8xx/i2c.c) sets the CPU up as a master node - and so its address should therefore be cleared to 0 (See, - eg, MPC823e User's Manual p.16-473). So, set - CONFIG_SYS_I2C_SLAVE to 0. - - When a board is reset during an i2c bus transfer - chips might think that the current transfer is still - in progress. Reset the slave devices by sending start - commands until the slave device responds. - - That's all that's required for CONFIG_HARD_I2C. - +- Legacy I2C Support: If you use the software i2c interface (CONFIG_SYS_I2C_SOFT) then the following macros need to be defined (examples are from include/configs/lwmon.h): -- cgit v1.3.1