]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
Convert CONFIG_SYS_I2C_INIT_BOARD to Kconfig
authorTom Rini <trini@konsulko.com>
Sat, 29 Oct 2022 00:26:54 +0000 (20:26 -0400)
committerTom Rini <trini@konsulko.com>
Thu, 10 Nov 2022 14:45:53 +0000 (09:45 -0500)
This converts the following to Kconfig:
   CONFIG_SYS_I2C_INIT_BOARD

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
README
board/keymile/Kconfig
board/samsung/common/board.c
board/samsung/goni/goni.c
drivers/i2c/fsl_i2c.c
drivers/i2c/mv_i2c.c
include/configs/km/pg-wcom-ls102xa.h

diff --git a/README b/README
index ec1b50c30551bd959fe2e374770973a55e37ccbe..737492893a0a6bce34f866b708f535dbea448e76 100644 (file)
--- a/README
+++ b/README
@@ -1052,17 +1052,6 @@ The following options need to be configured:
                You should define these to the GPIO value as given directly to
                the generic GPIO functions.
 
-               CONFIG_SYS_I2C_INIT_BOARD
-
-               When a board is reset during an i2c bus transfer
-               chips might think that the current transfer is still
-               in progress. On some boards it is possible to access
-               the i2c SCLK line directly, either by using the
-               processor pin as a GPIO or by having a second pin
-               connected to the bus. If this option is defined a
-               custom i2c_init_board() routine in boards/xxx/board.c
-               is run early in the boot sequence.
-
                CONFIG_I2C_MULTI_BUS
 
                This option allows the use of multiple I2C buses, each of which
index 9f784430b1d510aa4ccbff81ef00109537c0ceb7..b8f0578a286f9608430d3ae8c4dcecaaef2498c0 100644 (file)
@@ -11,6 +11,9 @@ if VENDOR_KM
 
 menu "KM Board Setup"
 
+config SYS_I2C_INIT_BOARD
+       def_bool y if ARM
+
 config HUSH_INIT_VAR
        def_bool y
 
index 49d40244644f56bc5fcbd3c31554de91a3b29631..943b498293b938ad5dd096901beb861838726034 100644 (file)
@@ -176,10 +176,6 @@ int board_early_init_f(void)
                return err;
        }
 
-#ifdef CONFIG_SYS_I2C_INIT_BOARD
-       board_i2c_init(gd->fdt_blob);
-#endif
-
        return exynos_early_init_f();
 }
 #endif
index ba25ba27b8630a830c4f6a593d95e333eae8c63d..535f8e1e0129d459e3e5461dc02c75a3e191fa06 100644 (file)
@@ -33,16 +33,6 @@ int board_init(void)
        return 0;
 }
 
-#ifdef CONFIG_SYS_I2C_INIT_BOARD
-void i2c_init_board(void)
-{
-       gpio_request(S5PC110_GPIO_J43, "i2c_clk");
-       gpio_request(S5PC110_GPIO_J40, "i2c_data");
-       gpio_direction_output(S5PC110_GPIO_J43, 1);
-       gpio_direction_output(S5PC110_GPIO_J40, 1);
-}
-#endif
-
 int dram_init(void)
 {
        gd->ram_size = PHYS_SDRAM_1_SIZE + PHYS_SDRAM_2_SIZE +
index 9a3c8241bc64f01550f4d75e846accff191881f4..edbcd83b64695b22de0cef11f8ba74247c7ceef6 100644 (file)
@@ -271,13 +271,6 @@ static void __i2c_init(const struct fsl_i2c_base *base, int speed, int
        const unsigned long long timeout = usec2ticks(CONFIG_I2C_MBB_TIMEOUT);
        unsigned long long timeval;
 
-#ifdef CONFIG_SYS_I2C_INIT_BOARD
-       /* Call board specific i2c bus reset routine before accessing the
-        * environment, which might be in a chip on that bus. For details
-        * about this problem see doc/I2C_Edge_Conditions.
-        */
-       i2c_init_board();
-#endif
        writeb(0, &base->cr);           /* stop I2C controller */
        udelay(5);                      /* let it shutdown in peace */
        set_i2c_bus_speed(base, i2c_clk, speed);
index 0eff3531618cdf48c6fee61be32828789fc97db9..8ee17f0a45014a765d9bc8f2c0da051152d64f31 100644 (file)
@@ -374,27 +374,6 @@ static int __i2c_write(struct mv_i2c *base, uchar chip, u8 *addr, int alen,
 
 static struct mv_i2c *base_glob;
 
-static void i2c_board_init(struct mv_i2c *base)
-{
-#ifdef CONFIG_SYS_I2C_INIT_BOARD
-       u32 icr;
-       /*
-        * call board specific i2c bus reset routine before accessing the
-        * environment, which might be in a chip on that bus. For details
-        * about this problem see doc/I2C_Edge_Conditions.
-        *
-        * disable I2C controller first, otherwhise it thinks we want to
-        * talk to the slave port...
-        */
-       icr = readl(&base->icr);
-       writel(readl(&base->icr) & ~(ICR_SCLE | ICR_IUE), &base->icr);
-
-       i2c_init_board();
-
-       writel(icr, &base->icr);
-#endif
-}
-
 #ifdef CONFIG_I2C_MULTI_BUS
 static unsigned long i2c_regs[CONFIG_MV_I2C_NUM] = CONFIG_MV_I2C_REG;
 static unsigned int bus_initialized[CONFIG_MV_I2C_NUM];
@@ -411,7 +390,6 @@ int i2c_set_bus_num(unsigned int bus)
        current_bus = bus;
 
        if (!bus_initialized[current_bus]) {
-               i2c_board_init(base_glob);
                bus_initialized[current_bus] = 1;
        }
 
@@ -441,8 +419,6 @@ void i2c_init(int speed, int slaveaddr)
        else
                val = ICR_SM;
        clrsetbits_le32(&base_glob->icr, ICR_MODE_MASK, val);
-
-       i2c_board_init(base_glob);
 }
 
 static int __i2c_probe_chip(struct mv_i2c *base, uchar chip)
index 43471e08d604f2bb0a31153f74e03e628528bf3c..9565cea083e083537d73891e4a15c6cfe8800338 100644 (file)
 /*
  * I2C
  */
-#define CONFIG_SYS_I2C_INIT_BOARD
 
 #define CONFIG_I2C_MULTI_BUS
 #define CONFIG_SYS_I2C_MAX_HOPS                1