Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DADF9C38A02 for ; Sat, 29 Oct 2022 00:27:23 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E2849850AC; Sat, 29 Oct 2022 02:27:20 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="l17dcAh0"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CBE5B850D6; Sat, 29 Oct 2022 02:27:19 +0200 (CEST) Received: from mail-qk1-x72e.google.com (mail-qk1-x72e.google.com [IPv6:2607:f8b0:4864:20::72e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 3047C84EF0 for ; Sat, 29 Oct 2022 02:27:17 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qk1-x72e.google.com with SMTP id o28so1883697qkl.4 for ; Fri, 28 Oct 2022 17:27:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=TLAnZ/VoYSrz6c8nlldrkBsDZ2uj+mcgy8RNRfNHHEI=; b=l17dcAh0FuGzdXL5K2GFfS+3nk5TXGiMvgt9hQPQarW+Tnw5HWSY1Los1tA+bMKjvH vtgQMPWAMVd8Y5/0EbdvowcrzYDyEK2pTCtGRaeIDQD+d+JLgwmpYnqwbC8uCCthxQtP mklUt25XuccEEm/tYbviynfLaHdjzFg1KAR2U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=TLAnZ/VoYSrz6c8nlldrkBsDZ2uj+mcgy8RNRfNHHEI=; b=3R+wr4+pxzzI1Ef1T7Bi67lP8JjcnMtjvv+grCRcLHZLbw2RlV/Tp4k5MhDjpgPULC TFOEvOVJJn1fJz8/wa7Aze+c6+GhN6cPlgIL5Et1uuEUOrBpmYgcf2PZ0brTU/PCMeiT x1sPWCIAmB4AMFgpd9mfH4HFvAy08BwJzIFYR3FJK6jU0hFxQG1Zutz1pJ4WFIA3F5xU FS7Pvb2wOwzeAf7Tt87L9Vy7ZhCzpnhmWAUIibJIzO+NlAk6KUWmAyFZzZnEq1jBfIp9 0kYXHWaht8dZzxVcuVXEpBqA90u2xBFL62S7AnMkn8Q++Zhqp3SgNyMzkzpAPPTP9RVr lNyA== X-Gm-Message-State: ACrzQf1qMIQF0GghxvsFG1fVTIVUUpjiOlrLhKjvor20Qgc373W954V/ JpqYxAbziMUOUIcyE+sojVnXu//DoqDjNQ== X-Google-Smtp-Source: AMsMyM7o28IRBi8oL2nB10ZwAZCL4zlNBB8jtlbgXw/OPLEv8PJ2TUs/qCNkK6oGZw1hMqvGHXTOSQ== X-Received: by 2002:a37:f61d:0:b0:6ec:cafa:4741 with SMTP id y29-20020a37f61d000000b006eccafa4741mr1462456qkj.761.1667003235706; Fri, 28 Oct 2022 17:27:15 -0700 (PDT) Received: from bill-the-cat.lan (2603-6081-7b00-6400-21a2-cb17-4547-06d4.res6.spectrum.com. [2603:6081:7b00:6400:21a2:cb17:4547:6d4]) by smtp.gmail.com with ESMTPSA id v7-20020a05622a144700b00398313f286dsm65130qtx.40.2022.10.28.17.27.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Oct 2022 17:27:15 -0700 (PDT) From: Tom Rini To: u-boot@lists.denx.de Subject: [PATCH 01/21] Convert CONFIG_SYS_I2C_INIT_BOARD to Kconfig Date: Fri, 28 Oct 2022 20:26:54 -0400 Message-Id: <20221029002714.1598153-1-trini@konsulko.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean This converts the following to Kconfig: CONFIG_SYS_I2C_INIT_BOARD Signed-off-by: Tom Rini --- README | 11 ----------- board/keymile/Kconfig | 3 +++ board/samsung/common/board.c | 4 ---- board/samsung/goni/goni.c | 10 ---------- drivers/i2c/fsl_i2c.c | 7 ------- drivers/i2c/mv_i2c.c | 24 ------------------------ include/configs/km/pg-wcom-ls102xa.h | 1 - 7 files changed, 3 insertions(+), 57 deletions(-) diff --git a/README b/README index 186f1f9a5ffb..92ad191ae76d 100644 --- a/README +++ b/README @@ -1126,17 +1126,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 diff --git a/board/keymile/Kconfig b/board/keymile/Kconfig index 9f784430b1d5..b8f0578a286f 100644 --- a/board/keymile/Kconfig +++ b/board/keymile/Kconfig @@ -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 diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c index ff178b7fe677..e476400ecdc8 100644 --- a/board/samsung/common/board.c +++ b/board/samsung/common/board.c @@ -177,10 +177,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 diff --git a/board/samsung/goni/goni.c b/board/samsung/goni/goni.c index ba25ba27b863..535f8e1e0129 100644 --- a/board/samsung/goni/goni.c +++ b/board/samsung/goni/goni.c @@ -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 + diff --git a/drivers/i2c/fsl_i2c.c b/drivers/i2c/fsl_i2c.c index 9a3c8241bc64..edbcd83b6469 100644 --- a/drivers/i2c/fsl_i2c.c +++ b/drivers/i2c/fsl_i2c.c @@ -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); diff --git a/drivers/i2c/mv_i2c.c b/drivers/i2c/mv_i2c.c index 0eff3531618c..8ee17f0a4501 100644 --- a/drivers/i2c/mv_i2c.c +++ b/drivers/i2c/mv_i2c.c @@ -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) diff --git a/include/configs/km/pg-wcom-ls102xa.h b/include/configs/km/pg-wcom-ls102xa.h index 43471e08d604..9565cea083e0 100644 --- a/include/configs/km/pg-wcom-ls102xa.h +++ b/include/configs/km/pg-wcom-ls102xa.h @@ -155,7 +155,6 @@ /* * I2C */ -#define CONFIG_SYS_I2C_INIT_BOARD #define CONFIG_I2C_MULTI_BUS #define CONFIG_SYS_I2C_MAX_HOPS 1 -- 2.25.1