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 X-Spam-Level: X-Spam-Status: No, score=-9.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ACAB9C4338F for ; Wed, 18 Aug 2021 05:20:22 +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 00D1D60F39 for ; Wed, 18 Aug 2021 05:20:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 00D1D60F39 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 43D5B81EBD; Wed, 18 Aug 2021 07:20:20 +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="qSxq0/N+"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="eNZ059h+"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 20E2182054; Wed, 18 Aug 2021 07:20:18 +0200 (CEST) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) (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 6EB5480C8A for ; Wed, 18 Aug 2021 07:20:13 +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=samuel@sholland.org Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 4AC055C023D; Wed, 18 Aug 2021 01:20:12 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Wed, 18 Aug 2021 01:20:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm3; bh=M A6j45kTHp5OntG8vqOaLjO+KvNcgT0ahY9hfWsGwU8=; b=qSxq0/N+O0J1y82jk lZ7AQ38Lj7gnj4/xDQ3i5WhJq5kQRkgncOaeTpMDnIarLFDfSrGEINzsuCh9abDB xS5liTDw/37qI00SVfJr5bkAbkTUgQcNvILB/Yvn/9ZahqAtSuF0kjvNweeJuUSS CM0BVvYdQMDtA02WZ7lcn/sbd0tlLoTCyq/J70xKPIJztOKE6bfuLJcmn3q80FDM HDv5KCrrX/ElZFSyh2Oe7tXT35HOWpvcVShYK6dqQC98ikOGQKLGSc04YZWUGNsu 17191W4tg1oZP+x7Q3oGFCv82HU/Zu5+trauKCwirqxUULprhDoek5xMRih5G4gb cPULg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :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=fm3; bh=MA6j45kTHp5OntG8vqOaLjO+KvNcgT0ahY9hfWsGw U8=; b=eNZ059h+OODaZhyFlqGPJZAfGllK5YDmwe8d/niG5FyoKb2Sh9n5/ySkp Wg6WMWb3p3ZXq2eBIOxgEUg8x/Jyd5PaRn7fYdJMksjnihkPp0w1Vt3JgWSOoCJG fjz7809YPGbXNaYmfaqJ9rHJ3lA42nHbXfB/FViFn/4nfka7GMg389syKsklsXEd /9WUhlomvKl7QZDTWkyuwYJVPoz01XXyg3LzoNUQ28xU+quwOmiAbRAP2VlRXd1C aQqqmN/CsBWmI1/UMg3EpfSC0ej28sATgqsF3eRWsjptmPlGAcoKbQst+cq1xz/M 1IrwVhkIQRtJ94FfDugcj2i9DEhbQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrleeggdeludcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefuvfhfhffkffgfgggjtgfgsehtjeertddtfeejnecuhfhrohhmpefurghmuhgv lhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtf frrghtthgvrhhnpefgveffteelheffjeeukedvkedviedtheevgeefkeehueeiieeuteeu gfettdeggeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 18 Aug 2021 01:20:11 -0400 (EDT) Subject: Re: U-Boot sunxi DM_I2C migration? To: Tom Rini , Andre Przywara Cc: u-boot@lists.denx.de, Jagan Teki , =?UTF-8?Q?Jernej_=c5=a0krabec?= References: <20210812174930.GZ858@bill-the-cat> <20210812222207.02126e3c@slackpad.fritz.box> <20210812214034.GA858@bill-the-cat> <20210817192353.GN858@bill-the-cat> From: Samuel Holland Message-ID: Date: Wed, 18 Aug 2021 00:20:10 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20210817192353.GN858@bill-the-cat> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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 Hi all, On 8/17/21 2:23 PM, Tom Rini wrote: > On Thu, Aug 12, 2021 at 05:40:34PM -0400, Tom Rini wrote: >> On Thu, Aug 12, 2021 at 10:22:07PM +0100, Andre Przywara wrote: >>> On Thu, 12 Aug 2021 13:49:30 -0400 >>> Tom Rini wrote: >>> >>> Hi Tom, >>> >>>> As I try and migrate more CONFIG symbols to be Kconfig only, I see that >>>> sunxi is still using the legacy I2C drivers. Is there something >>>> specific holding up migration? Thanks! >>> >>> Do you mean a DM_I2C conversion, or just moving those base address >>> symbols to Kconfig? The latter is rather easy, let me know if I should >>> give it a shot. >>> >>> For DM_I2C, it's the usual sunxi issue: we are using both: DM_I2C and >>> DT based probing for U-Boot proper, and hardcoded CONFIG_ symbols for >>> the SPL. *Some* boards need the set up the PMIC early (for increasing >>> the CPU frequency or setting the proper DRAM voltage), so this needs to >>> be done in the SPL. I don't know how to fix this "properly", >>> but introducing DM (and DT) into the SPL is surely not worth the >>> trouble. Alternatively we could have a separate, cut-down SPL-only >>> driver, like we have for SPI (arch/arm/mach-sunxi/spl_spi_sunxi.c), >>> but not sure that's really better. >>> >>> If there is something in particular that annoys you about the >>> situation, we could try to improve this particular issue instead? >>> Moving the non-DM code into a separate file, maybe? >> >> I'm working on the symbols now (since it gets tricky). The first >> example I pulled out was Hummingbird_A31 which does have legacy I2C and >> does not set DM_I2C, which is what set me down the more worrying path. >> If you can confirm that no, really, it's just SPL that's not using >> DM_I2C that's OK enough for now, we can sort out what the best but >> probably still unideal solution is long term for SPL. > > As I'm converting the symbols to Kconfig now (and adding > SPL_SYS_I2C_LEGACY), what I'm seeing on sunxi is a whole lot of platform > enabling the legacy driver in full U-Boot and not DM_I2C. Now it's > entirely possible the follow up solution really is just to switch to > DM_I2C (and continue SPL_SYS_I2C_LEGACY) and it would be a fairly > trivial switch. But I'm not in a good position to make that change and > test it, so I'm asking you to please, once I've posted this series to > add SPL_SYS_I2C_LEGACY I am aware of three places where sunxi boards use legacy I2C in U-Boot proper: - The i2c_soft usage enabled by CONFIG_VIDEO_LCD_PANEL_I2C - The axp_gpio driver (through pmic_bus_*) - do_poweroff() in drivers/power/axp*.c (through pmic_bus_write) I have a patch series for converting all of these that I will be sending within the next few days. The two tricky parts are: - I have no way to test either board that uses VIDEO_LCD_PANEL_I2C, so I do not want to rely on bus number ordering. - I am trying to arrange changes in an order that never breaks any functionality, so some driver must be temporarily compatible with both legacy and DM I2C. I will rebase this on top of the Kconfig series before sending it. Regards, Samuel