From mboxrd@z Thu Jan 1 00:00:00 1970 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D43AC433EF for ; Fri, 8 Oct 2021 05:19:38 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id CF30461058 for ; Fri, 8 Oct 2021 05:19:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org CF30461058 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sholland.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E749A83598; Fri, 8 Oct 2021 07:18:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sholland.org 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=sholland.org header.i=@sholland.org header.b="pQgm+Xp1"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="TT6FpcIc"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E3F358356E; Fri, 8 Oct 2021 07:18:16 +0200 (CEST) Received: from new2-smtp.messagingengine.com (new2-smtp.messagingengine.com [66.111.4.224]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E6168833B5 for ; Fri, 8 Oct 2021 07:17:38 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sholland.org Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=samuel@sholland.org Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailnew.nyi.internal (Postfix) with ESMTP id 0ACEE580DDA; Fri, 8 Oct 2021 01:17:38 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Fri, 08 Oct 2021 01:17:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=+qCQAsIJ6FBxU 37VwRy6jK6nWuhlKQmYQxQuI9h0NZk=; b=pQgm+Xp1mjyguvUqOlvvGoXHWU8DJ 8Pz2DfAO9eCwqEs6BBC8TzkK3iSXCC2HtoUalYsWWzHY1KnPvLl+SJUW0jXHWaTv r1BIjmBUG0id7fLlkkvNK5y/zI1uYr+nNRZ/5XsIznLrTom8wBqZHiIKM72pz24F 26fIIr4bisImezQ4waRCuULw/dBRc7rp8rAGoGSZl6iyOpO37mcIFNaUOdwsLsEa BbS7DWQLQyuoDo36nUw3u+qB5ROTY1bdyicx9Az0a08z9xBjMteDunBaKIe8uLg+ AVLvw8uR8TpEn0iWoT/MWYh/WWXXTLHvo8cTb98vg9eLGHNS8ujQH660Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=+qCQAsIJ6FBxU37VwRy6jK6nWuhlKQmYQxQuI9h0NZk=; b=TT6FpcIc QK4q3ijpO9nLh5liqAQYzY3z5w2T+TgcPSYovdmZcFu6+RivRqg7vBDQLpmLfAi5 9zndoLVRAugrUiTFZ8LZahk6HvXSATwbYhgEswgKpwpOsgr30zhML86AHzWi5gxF hVjSMuQBlBjminrTXakAeituDoDns1bmphh/wtl/OqZTQAiIUTpdPqykD/bCVik2 QnW5dxOMaV5Rmwi5v+vj23Tnp6kdKApDfAYRtnufpuAFtdOp+CJhKA1VjgsO8UA3 N4s8HHzlZo6SbOT30VEvjKER5hBEZehu5aYqr/qGiQLQ1sORLHvBho5tV6iuSQzW OLk4fgzIMPQGVg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudelledgkeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgv lhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtf frrghtthgvrhhnpeduhfejfedvhffgfeehtefghfeiiefgfeehgfdvvdevfeegjeehjedv gfejheeuieenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmhgrihhlfhhroh hmpehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 8 Oct 2021 01:17:37 -0400 (EDT) From: Samuel Holland To: u-boot@lists.denx.de, Jagan Teki , Andre Przywara Cc: Jaehoon Chung , Heiko Schocher , Samuel Holland , Anatolij Gustschin , Arnaud Ferraris , Bharat Gooty , Igor Opaniuk , Jernej Skrabec , Minkyu Kang , Rayagonda Kokatanur , Simon Glass , Stephan Gerhold , Tim Harvey , Tom Rini Subject: [PATCH v2 04/12] sunxi: Only initialize legacy I2C when enabled Date: Fri, 8 Oct 2021 00:17:17 -0500 Message-Id: <20211008051725.29401-5-samuel@sholland.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211008051725.29401-1-samuel@sholland.org> References: <20211008051725.29401-1-samuel@sholland.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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.103.2 at phobos.denx.de X-Virus-Status: Clean CONFIG_SPL_I2C is the wrong symbol to use here. It is the top-level Kconfig symbol (not specific to either legacy or DM I2C), whereas the i2c_init() function is specific to legacy I2C. This change fixes a build failure when enabling SPL_I2C but not SPL_SYS_I2C_LEGACY. Signed-off-by: Samuel Holland --- Actually, I think this commit raises a larger issue: For some reason, SPL_SYS_I2C_LEGACY does not depend on SPL_I2C. When SPL_SYS_I2C_LEGACY was added in commit 55dabcc8f245 ("Convert CONFIG_SYS_I2C_LEGACY to Kconfig and add CONFIG_[ST]PL_SYS_I2C_LEGACY"), SPL_I2C wasn't added to the board configs. But since commit 537892065ac1 ("Makefile: Move drivers/i2c/ into drivers/Makefile"), drivers/i2c is only compiled if SPL_I2C is enabled. So the combination of these two commits appears to have accidentally removed I2C support from SPL for many boards. The impact here is that checking CONFIG_IS_ENABLED(SYS_I2C_LEGACY) is not always enough, even though it should be. Because if CONFIG_SPL_I2C=n then i2c_init is undefined because drivers/i2c/i2c_core.c is not built. Changes in v2: - New patch to account for I2C Kconfig changes arch/arm/mach-sunxi/board.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-sunxi/board.c b/arch/arm/mach-sunxi/board.c index d9b04f75fc4..b74ad4074df 100644 --- a/arch/arm/mach-sunxi/board.c +++ b/arch/arm/mach-sunxi/board.c @@ -339,7 +339,7 @@ void board_init_f(ulong dummy) spl_init(); preloader_console_init(); -#ifdef CONFIG_SPL_I2C +#if CONFIG_IS_ENABLED(I2C) && CONFIG_IS_ENABLED(SYS_I2C_LEGACY) /* Needed early by sunxi_board_init if PMU is enabled */ i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE); #endif -- 2.32.0