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=-7.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 17DDFC4338F for ; Wed, 18 Aug 2021 13:31:27 +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 477B260F4C for ; Wed, 18 Aug 2021 13:31:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 477B260F4C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=konsulko.com 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 8FB1082DB0; Wed, 18 Aug 2021 15:31:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (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="bqKLaQRy"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C5CBC82DB2; Wed, 18 Aug 2021 15:31:22 +0200 (CEST) Received: from mail-qv1-xf2b.google.com (mail-qv1-xf2b.google.com [IPv6:2607:f8b0:4864:20::f2b]) (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 8ABFD807F3 for ; Wed, 18 Aug 2021 15:31:18 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qv1-xf2b.google.com with SMTP id v1so1632078qva.7 for ; Wed, 18 Aug 2021 06:31:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=FBHUyCu0szQY/idIHQZJn4kWXtZI0YSm/acrN1Bthtc=; b=bqKLaQRyXdmybp5ytEJ4KQ6J3Wqgs39v8vuiIdzrsTod48mqioxGNFyBHPbWELlC/M gSChKC2b3PMpE/2xr3UW0+MChd9DO3qB+VInozvBPbkgkvZuirQnUstu6kTvk+29NFGx 9+2vJFlfpJahmOF+gXLCXBhJcVtiTHWTKA84A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=FBHUyCu0szQY/idIHQZJn4kWXtZI0YSm/acrN1Bthtc=; b=qPIf6R5cllbEamNRoNxIlfsSglYgsniZEwkk8JYqq5MstHHNYGHaelpf5lrdPnn4rQ vhBvjNX3PQ38X61ooTvSXYDb0UyYSslpCbevYoFlRcvHaKqIwDPQ7pa4REp24upijqyz MInoBv7WgyD9EJwR9Cn78T2Cs41uSlfQLQ0ODDitrh19rXzaR+2/19kAKiWiffGj9fDE 7+bjUTB0iCEIhMEG7sE1FQLCaeuVR6qIl5RkEOBDQHAZqmtReVqvt4oUxOin6ocj0r4X ohWj1JMzciArBLaH7uzKoLadeaNwm32mN8SFuWuqtUBbSsEOmVhNClPFYQ9Lt3x3sNiL tB6A== X-Gm-Message-State: AOAM530UTsco9OUAtW9fu8rYvapUXmzNDdlFlVC5RJqDcrZsZ0mGeFnq MYIGsbLDDq1NbUNxE+2NGFwuMA== X-Google-Smtp-Source: ABdhPJwO202Z0lJoMOSMKPpYM7kMYxoKLVkdOaZhH8s6trJYMOPjUWpw909x2WW3PrqCSjKUubyqIQ== X-Received: by 2002:a0c:e6a4:: with SMTP id j4mr8936157qvn.16.1629293477254; Wed, 18 Aug 2021 06:31:17 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b01-cbda-f93a-0b29-d1e6-92fc.res6.spectrum.com. [2603:6081:7b01:cbda:f93a:b29:d1e6:92fc]) by smtp.gmail.com with ESMTPSA id c2sm3533445qkd.57.2021.08.18.06.31.16 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Aug 2021 06:31:16 -0700 (PDT) Date: Wed, 18 Aug 2021 09:31:14 -0400 From: Tom Rini To: Samuel Holland Cc: Andre Przywara , u-boot@lists.denx.de, Jagan Teki , Jernej =?utf-8?Q?=C5=A0krabec?= Subject: Re: U-Boot sunxi DM_I2C migration? Message-ID: <20210818133114.GP858@bill-the-cat> References: <20210812174930.GZ858@bill-the-cat> <20210812222207.02126e3c@slackpad.fritz.box> <20210812214034.GA858@bill-the-cat> <20210817192353.GN858@bill-the-cat> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="wLa476zhX2De+KXO" Content-Disposition: inline In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.9.4 (2018-02-28) 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 --wLa476zhX2De+KXO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Aug 18, 2021 at 12:20:10AM -0500, Samuel Holland wrote: > Hi all, >=20 > 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 t= hat > >>>> 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. > >=20 > > 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 >=20 > I am aware of three places where sunxi boards use legacy I2C in U-Boot pr= oper: > - 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) >=20 > 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. >=20 > I will rebase this on top of the Kconfig series before sending it. Great, thanks! --=20 Tom --wLa476zhX2De+KXO Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmEdC54ACgkQFHw5/5Y0 tyzEmwv/QwC5jHUR//2mbhQkPmGLRlvyqssgvvTtKiNY1aOsC5Mryww/wCrZISlC GSABBfY/q3hyyc5G1s2SJ3o0Pe14BbWknmGAseFCzzCg6akMLCPI7jNZYXZIIn45 vLm97cb2h6B03H9GQZWeNmcsMvr1cXZsKGriCxI/cgkSzEfqCNVMNn444OwFySbm Vlw/LU3vsL9soyCDkzMMvcQRuERwpZeQwQaD7RsIkAlaFQgQK6seswwTF49JVLgR y5zYU1bc465EeEZnNHTkhIO3lvqXbuh/X5sYMsYQzwpq+PE4GKW6drwNFVgyV86J Jl4Gpvt/qPyfViNZw39xJw4UkUyBsYqqiEza8cYIUGATv2+ugoKjCybrsT1R3r4m rGVBz9H1io7/A4z+4RtHCu5cjBk+pTYchn69nOg9ODr73JyhfozjxnoNTLi7ALWU RylvVdv3f0tiog/FkUCi1mUM+ZntdUtV0POFBH/ldopj3EFaGl1kWPS1ceHSrbb1 sycn6p7P =M9mR -----END PGP SIGNATURE----- --wLa476zhX2De+KXO--