From patchwork Tue Feb 9 11:52:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Opaniuk X-Patchwork-Id: 1438313 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=foundries.io header.i=@foundries.io header.a=rsa-sha256 header.s=google header.b=Og2pvE1H; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DZhbq2Qxcz9s1l for ; Tue, 9 Feb 2021 23:12:38 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7929482A2F; Tue, 9 Feb 2021 13:11:49 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=foundries.io Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=foundries.io header.i=@foundries.io header.b="Og2pvE1H"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DF6E382A13; Tue, 9 Feb 2021 12:52:54 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) (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 317B4829C0 for ; Tue, 9 Feb 2021 12:52:50 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=foundries.io Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=igor.opaniuk@foundries.io Received: by mail-lj1-x236.google.com with SMTP id q14so12205271ljp.4 for ; Tue, 09 Feb 2021 03:52:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foundries.io; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=fFPsXqt2UlzjHyn2nfgpv9uTLpDy/3dt6eNMD0VkUnI=; b=Og2pvE1Hq5iOyVPiOsWP1ws3k+AKqLm66g/y1OO7PKpIXfR5yzYGHYjyNvHgXuqp7l nAKUqRHYglTzQcTjld5vvd1E8YSsI4sBIIVGmJ2kfCB0b//KijFK+EYixTp/2smxPRFL Ih3cAACkaa+C87l5HVuLvRwtbu4YefAWItRqG8J3SvnBefuCGQ5NuYuaN3m/DcdujdyB lJ/vC3g89qWfkrp/YgcUEwavKrtkSLtos8bG/1W9Kf2n+nO59fFObeDda9s4xaTVRaXA wTTniWs4ocEfncV6o+z15xrFuV3/JbWjC6IZwwkco9D/MUiQhqYkF0qRJun5EOLJHLvn lCtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=fFPsXqt2UlzjHyn2nfgpv9uTLpDy/3dt6eNMD0VkUnI=; b=XBzYgwdmDzvyyEI8NnVmooEv9qPuyKdw5bJfrXDU9hbCctP9i5agOZrMOB4q/jfB9c wsX5PVjPQvNlzRpkKH1TXmAyWzhBvn+xpvrzshUO+Z5XV3q8eoAHXBxppAMgqUvKXhVy aQ8TVktjVN3J0MXjf9dRmhEWaXZlWMonbEF4ozT83YJ4/Cv2UnTdk39JU95URAFtjUKn N9ZLcSLOuFVNk7H64iVmWXt38bPKrEYuW7q1niUmFXY3OVxuhi+4nCGk0teR2gA/rP8E 8bcmO4LSuh/4GCyZV9Y1oZ+Z/hRy60cA4nbLREP/wwkRG+5pPMpNd5bGlEHImL5Zw2mn jPyQ== X-Gm-Message-State: AOAM531iSDPE6RQD+pVgRnYssYyGEqLA5ybudJWKAS2NAUz2NGEZu7d0 pMRuXpavzFWSuhzEsk7EmgekkXxzpIl5mT/P X-Google-Smtp-Source: ABdhPJx29cbFVuRoya6xftnZQxpzgQNqMlw6rin28fnhCLr4UdBHT+023Pt1mGhw4hADjHAUB44zvw== X-Received: by 2002:a05:651c:212:: with SMTP id y18mr10058503ljn.41.1612871568567; Tue, 09 Feb 2021 03:52:48 -0800 (PST) Received: from localhost ([109.108.76.111]) by smtp.gmail.com with ESMTPSA id t15sm1152278lft.239.2021.02.09.03.52.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Feb 2021 03:52:47 -0800 (PST) From: Igor Opaniuk X-Google-Original-From: Igor Opaniuk To: u-boot@lists.denx.de Cc: ricardo@foundries.io, mike@foundries.io, jorge@foundries.io, sjg@chromium.org, trini@konsulko.com, Igor Opaniuk , Adam Ford , Alison Wang , Andre Przywara , Ashish Kumar , Ashok Reddy Soma , Bhaskar Upadhaya , Bin Meng , Biwen Li , Fabio Estevam , Faiz Abbas , Feng Li , Frieder Schrempf , Hans de Goede , Heiko Schocher , Heinrich Schuchardt , Holger Brunck , Hou Zhiqiang , Jaehoon Chung , Jagan Teki , Jernej Skrabec , Jonas Smedegaard , Kuldeep Singh , Lokesh Vutla , Lukasz Majewski , Madalin Bucur , Manish Tomar , Marek Szyprowski , Marek Vasut , Masahiro Yamada , Meenakshi Aggarwal , Michael Walle , Michal Simek , Mingkai Hu , "NXP i.MX U-Boot Team" , Neil Armstrong , Niel Fourie , Ovidiu Panait , =?utf-8?q?Pali_Roh=C3=A1r?= , Peng Fan , Prabhakar Kushwaha , Pragnesh Patel , Pramod Kumar , Priyanka Jain , Priyanka Singh , Qiang Zhao , Rai Harninder , Rajesh Bhagat , Ruchika Gupta , Shengzhou Liu , Stefan Bosch , Stefan Roese , Stefano Babic , Sudhanshu Gupta , Suman Anna , Sumit Garg , Tang Yuantian , Teresa Remmet , Tero Kristo , Udit Agarwal , Vitaly Andrianov , Vladimir Oltean , Wasim Khan , Wolfgang Denk Subject: [PATCH v3 0/3] Allow disabling driver model for I2C in SPL Date: Tue, 9 Feb 2021 13:52:42 +0200 Message-Id: <20210209115245.47288-1-igor.opaniuk@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Mailman-Approved-At: Tue, 09 Feb 2021 13:11:16 +0100 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.102.3 at phobos.denx.de X-Virus-Status: Clean From: Igor Opaniuk At present if U-Boot proper uses driver model for I2C, then SPL has to also. While this is desirable, it places a significant barrier to moving to driver model in some cases. For example, with a space-constrained SPL it may be necessary to enable CONFIG_SPL_OF_PLATDATA which involves adjusting some drivers. This patch introduces a separate Kconfig symbols for enabling DM_I2C and DM_I2C_GPIO support in SPL. This will also help to get away from dirty workarounds to achieve non-DM I2C support for SPL, which is currently used in some board header files like: ifdef CONFIG_SPL_BUILD undef CONFIG_DM_I2C endif All occurences were replaced automatically using these bash cmds: $ find . -type f -exec sed -i 's/ifndef CONFIG_DM_I2C/if !CONFIG_IS_ENABLED(DM_I2C)/g' {} + $ find . -type f -exec sed -i 's/ifdef CONFIG_DM_I2C/if CONFIG_IS_ENABLED(DM_I2C)/g' {} + $ find . -type f -exec sed -i 's/defined(CONFIG_DM_I2C)/CONFIG_IS_ENABLED(DM_I2C)/g' {} + $ find . -type f -exec sed -i 's/ifndef CONFIG_DM_I2C_GPIO/if !CONFIG_IS_ENABLED(DM_I2C_GPIO)/g' {} + $ find . -type f -exec sed -i 's/ifdef CONFIG_DM_I2C_GPIO/if CONFIG_IS_ENABLED(DM_I2C_GPIO)/g' {} + $ find . -type f -exec sed -i 's/defined(CONFIG_DM_I2C_GPIO)/CONFIG_IS_ENABLED(DM_I2C_GPIO)/g' {} + Azure CI results: https://dev.azure.com/igoropaniuk/u-boot/_build/results?buildId=6&view=results Changes in v3: - Drop undefs for CONFIG_DM_I2C and moved that to board defconfigs - Rebased on the latest master Changes in v2: - Applied R-b tags from Simon and Heiko - Added additional patches that replace CONFIG_DM_I2C undefs with CONFIG_SPL_DM_I2C for SPL build case (this should be moved to board defconfigs by board maintainers) Igor Opaniuk (3): dm: i2c: allow disabling driver model in SPL board: freescale: drop CONFIG_DM_I2C undefs dm: i2c: use CONFIG_IS_ENABLED macro for DM_I2C/DM_I2C_GPIO .../include/asm/arch-fsl-layerscape/config.h | 2 +- arch/arm/include/asm/arch-lpc32xx/i2c.h | 2 +- arch/arm/include/asm/mach-imx/mxc_i2c.h | 2 +- arch/arm/include/asm/omap_i2c.h | 2 +- arch/arm/mach-imx/i2c-mxv7.c | 2 +- arch/arm/mach-keystone/ddr3_spd.c | 2 +- arch/arm/mach-kirkwood/include/mach/config.h | 2 +- arch/arm/mach-omap2/am33xx/board.c | 2 +- arch/arm/mach-omap2/am33xx/clk_synthesizer.c | 6 +- arch/arm/mach-omap2/boot-common.c | 2 +- arch/arm/mach-omap2/clocks-common.c | 2 +- arch/arm/mach-sunxi/board.c | 2 +- arch/powerpc/include/asm/fsl_i2c.h | 2 +- board/freescale/common/dcu_sii9022a.c | 2 +- board/freescale/common/diu_ch7301.c | 2 +- board/freescale/common/emc2305.c | 4 +- board/freescale/common/qixis.c | 4 +- board/freescale/common/sys_eeprom.c | 20 ++-- board/freescale/common/vid.c | 24 ++--- board/freescale/common/vsc3316_3308.c | 10 +- board/freescale/ls1012aqds/ls1012aqds.c | 2 +- board/freescale/ls1012ardb/eth.c | 2 +- board/freescale/ls1012ardb/ls1012ardb.c | 12 +-- board/freescale/ls1021aqds/dcu.c | 6 +- board/freescale/ls1021aqds/ls1021aqds.c | 2 +- board/freescale/ls1021atwr/ls1021atwr.c | 2 +- board/freescale/ls1028a/ls1028a.c | 2 +- board/freescale/ls1043aqds/ls1043aqds.c | 4 +- board/freescale/ls1046afrwy/ls1046afrwy.c | 2 +- board/freescale/ls1046aqds/ls1046aqds.c | 2 +- board/freescale/ls1088a/eth_ls1088aqds.c | 16 +-- board/freescale/ls1088a/ls1088a.c | 60 ++++++------ board/freescale/ls2080aqds/eth.c | 14 +-- board/freescale/ls2080aqds/ls2080aqds.c | 4 +- board/freescale/ls2080ardb/ls2080ardb.c | 2 +- board/freescale/lx2160a/lx2160a.c | 2 +- board/freescale/p1010rdb/p1010rdb.c | 8 +- board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c | 2 +- board/freescale/t102xrdb/t102xrdb.c | 2 +- board/freescale/t208xqds/t208xqds.c | 2 +- board/friendlyarm/nanopi2/onewire.c | 6 +- board/keymile/common/ivm.c | 2 +- board/samsung/common/misc.c | 2 +- board/samsung/trats/trats.c | 10 +- board/samsung/trats2/trats2.c | 10 +- board/sunxi/board.c | 2 +- board/ti/am335x/board.c | 8 +- board/ti/am335x/mux.c | 2 +- board/ti/am43xx/board.c | 12 +-- board/ti/common/board_detect.c | 4 +- board/ti/ks2_evm/board_k2g.c | 2 +- board/wandboard/wandboard.c | 4 +- cmd/eeprom.c | 6 +- cmd/i2c.c | 98 +++++++++---------- configs/imx8mp_evk_defconfig | 1 + ...s1021atwr_sdcard_ifc_SECURE_BOOT_defconfig | 1 + .../ls1046ardb_sdcard_SECURE_BOOT_defconfig | 1 + configs/phycore-imx8mp_defconfig | 1 + doc/driver-model/i2c-howto.rst | 2 +- drivers/ddr/fsl/main.c | 8 +- drivers/i2c/Kconfig | 21 ++++ drivers/i2c/Makefile | 4 +- drivers/i2c/davinci_i2c.c | 4 +- drivers/i2c/designware_i2c.c | 4 +- drivers/i2c/fsl_i2c.c | 6 +- drivers/i2c/ihs_i2c.c | 42 ++++---- drivers/i2c/lpc32xx_i2c.c | 4 +- drivers/i2c/mv_i2c.c | 2 +- drivers/i2c/mvtwsi.c | 16 +-- drivers/i2c/mxc_i2c.c | 4 +- drivers/i2c/omap24xx_i2c.c | 2 +- drivers/misc/Makefile | 2 +- drivers/power/palmas.c | 2 +- drivers/power/pmic/pmic_tps62362.c | 6 +- drivers/power/pmic/pmic_tps65217.c | 14 +-- drivers/power/pmic/pmic_tps65218.c | 4 +- drivers/power/pmic/pmic_tps65910.c | 6 +- drivers/power/twl4030.c | 2 +- drivers/power/twl6030.c | 2 +- drivers/tpm/tpm_atmel_twi.c | 6 +- drivers/usb/host/ohci-lpc32xx.c | 8 +- include/_exports.h | 2 +- include/config_fallbacks.h | 2 +- include/configs/MPC8548CDS.h | 2 +- include/configs/P1010RDB.h | 2 +- include/configs/P2041RDB.h | 2 +- include/configs/T102xRDB.h | 2 +- include/configs/T104xRDB.h | 3 +- include/configs/T208xQDS.h | 2 +- include/configs/T208xRDB.h | 2 +- include/configs/T4240RDB.h | 2 +- include/configs/am43xx_evm.h | 2 +- include/configs/corenet_ds.h | 2 +- include/configs/imx8mp_evk.h | 1 - include/configs/ls1012a_common.h | 2 +- include/configs/ls1021aiot.h | 2 +- include/configs/ls1021aqds.h | 2 +- include/configs/ls1021atsn.h | 2 +- include/configs/ls1021atwr.h | 3 +- include/configs/ls1028a_common.h | 2 +- include/configs/ls1043a_common.h | 2 +- include/configs/ls1046a_common.h | 3 +- include/configs/ls1088a_common.h | 2 +- include/configs/ls1088aqds.h | 2 +- include/configs/ls2080a_common.h | 2 +- include/configs/ls2080aqds.h | 2 +- include/configs/ls2080ardb.h | 2 +- include/configs/p1_p2_rdb_pc.h | 2 +- include/configs/phycore_imx8mp.h | 1 - include/configs/sunxi-common.h | 2 +- include/configs/ti_armv7_common.h | 2 +- include/exports.h | 2 +- include/i2c.h | 2 +- include/palmas.h | 2 +- include/twl4030.h | 2 +- include/twl6030.h | 2 +- 116 files changed, 339 insertions(+), 319 deletions(-)