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 383DBEB64D8 for ; Fri, 16 Jun 2023 16:36:56 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A2F9E846B0; Fri, 16 Jun 2023 18:36:54 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id DFF0785F2B; Fri, 16 Jun 2023 18:36:52 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id 7AF66846A7 for ; Fri, 16 Jun 2023 18:36:49 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=andre.przywara@arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id CC4FA1FB; Fri, 16 Jun 2023 09:37:32 -0700 (PDT) Received: from donnerap.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 265013F663; Fri, 16 Jun 2023 09:36:48 -0700 (PDT) Date: Fri, 16 Jun 2023 17:36:45 +0100 From: Andre Przywara To: Maxim Kiselev Cc: Sam Edwards , u-boot@lists.denx.de, Samuel Holland Subject: Re: [RFC PATCH 00/17] sunxi: rework pinctrl and add T113s support Message-ID: <20230616173645.6d5597c4@donnerap.cambridge.arm.com> In-Reply-To: References: <20221206004549.29015-1-andre.przywara@arm.com> <04c52801-a6d0-033b-c7f4-613e0b789d96@gmail.com> <20230612012056.65883683@slackpad.lan> <20230616165902.0b6eea86@donnerap.cambridge.arm.com> Organization: ARM X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.32; aarch64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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.8 at phobos.denx.de X-Virus-Status: Clean On Fri, 16 Jun 2023 19:27:16 +0300 Maxim Kiselev wrote: Hi Maxim, thanks for the reply! If you have anything that is missing or broken in the new version of the patchset I put on github, please let me know. > =D0=BF=D1=82, 16 =D0=B8=D1=8E=D0=BD. 2023=E2=80=AF=D0=B3. =D0=B2 18:59, A= ndre Przywara : > > > > On Mon, 12 Jun 2023 15:18:17 -0600 > > Sam Edwards wrote: > > > > Hi Sam, > > > > something regarding "reset" below ... > > =20 > > > On 6/11/23 18:20, Andre Przywara wrote: =20 > > > > Thanks for the update and the list! Can you confirm where you > > > > still needed code changes compared to say my github branch plus the > > > > changes we already discussed? Trying some guesses below, please con= firm > > > > or deny: =20 > > > > > > Preeeeetttttyyy much everything I've changed locally has been submitt= ed > > > to the list or discussed in the relevant patchset. Have you updated y= our > > > GitHub branch recently (past couple of weeks)? I haven't been watching > > > it but I can pull it again and see which of my local changes are still > > > required. > > > =20 > > > >> I have a build of U-Boot for my target, complete with: > > > >> - UART3 initialized correctly =20 > > > > > > > > this is problematic because of the other pinmux used on your board, > > > > which cannot easily be encoded alongside the existing UART3 pinmux?= =20 > > > > > > Actually no, my board's UART3 is on PB6/PB7, nice and standard. > > > =20 > > > >> - DRAM coming up correctly > > > >> - SPL sets configured boot clock correctly =20 > > > > > > > > This should work as per github? =20 > > > > > > Yep, everything was working satisfactorily once I figured out I needed > > > to set CONFIG_SYS_CLK_FREQ to get acceptable boot speeds. > > > =20 > > > >> - SPI-NAND support (SPL and U-Boot proper) =20 > > > > > > > > This is with Icenow's series? Any D1 specific changes needed there?= =20 > > > > > > Yes, with Icenowy's series (322733). > > > > > > I learned that the BROM sets the boot medium code to 0x04 when it's an > > > SPI-*NAND* (while older chips used 0x03 for "it's either SPI-NOR or > > > SPI-NAND, good luck figuring out which"). Since `env_get_location` > > > assumes BOOT_DEVICE_SPI is NOR (and my target needs to load env from = UBI > > > iff booting from NAND), I'm hoping I can convince Icenowy to separate > > > out the SPI-NAND and SPI-NOR load methods entirely (vs. her current > > > try-NAND-then-NOR approach) with the aid of some disambiguation logic= to > > > probe for an SPI-NAND on the older chips known to report these as 0x0= 3. > > > > > > I also needed Maksim's patch series (355747) to support the D1 SPI ma= ster. > > > =20 > > > >> - MMC support (SPL and U-Boot proper) > > > >> - SPL boot from FEL =20 > > > > > > > > again worked already in github? =20 > > > > > > Yes and yes. I was just confirming they're good; no local work needed > > > from me here. > > > =20 > > > >> - USB gadget support =20 > > > > > > > > So with the fixed SUNXI_SRAMC_BASE you said it worked? What about t= he > > > > USB PHY? That needs at least wiring in the compatible string? If you > > > > have such a patch, can you please rebase it on top of my v2 USB PHY > > > > series and post that? =20 > > > > > > Yes, with corrected SUNXI_SRAMC_BASE -- though I also needed my patch= es > > > to make musb-new/sunxi.c use the UDC gadget model in DM (series 35884= 2), > > > as I don't think there's another way to init the controller at runtim= e. > > > > > > I can't say whether the endpoint limit is correct or that mUSB *host* > > > operation works. > > > > > > The USB PHY only required that CONFIG_PHY_SUN4I_USB be enabled. The > > > correct compatible is already wired up. It does look like your PHY > > > series drops the explicit requirement to set PHY_SUN4I_USB so that's > > > better than what I was doing (adding a `select` directive under R528). > > > > > > I can test your series if you want but I doubt it intersects my work > > > here in any significant way. > > > =20 > > > >> - Ethernet MAC+PHY support =20 > > > > > > > > Anything surprising here? Is that using an already supported extern= al > > > > PHY? =20 > > > > > > The only surprise was this was how I noticed that CONFIG_CLK_SUN20I_D1 > > > was not being implicitly enabled. Enabling that was then how I found > > > that the clock driver wasn't compatible with current upstream (which I > > > already mentioned). > > > > > > The PHY is external and already supported, adding it to my DT required > > > very little work. > > > =20 > > > >> - I=C2=B2C support * > > > >> - GPIO support (LEDs, buttons, misc. board management) =20 > > > > > > > > again should work out of the box, minus your board specific > > > > configuration? =20 > > > > > > GPIO is completely OotB, yes. I=C2=B2C is OotB once MVTWSI_CONTROL_CL= EAR_IFLG > > > is set correctly. (The pinctrl requirements for it are a little harde= r, > > > more on that below.) > > > =20 > > > >> - `reset` working (requries CONFIG_SYSRESET unset, WDT key) =20 > > > > > > > > Isn't "CONFIG_SYSRESET unset" a hack? I dimly remember we had this = for > > > > some other SoC initially, but later got rid of it? =20 > > > > > > Unsetting it is required for reset_cpu() to be defined. Your patchset > > > updates that function (albeit without adding the WDT key, so the curr= ent > > > patch is broken) to support NCAT2 already. U-Boot has no driver for > > > "allwinner,sun20i-d1-wdt-reset", so this is the only way for `reset` = to > > > work. =20 > > > > So I had a look at this, and it's a bit surprising: > > The watchdog driver already supports "allwinner,sun20i-d1-wdt" for a > > while. We don't need to list the "-reset" version, because the normal > > compatible name acts as a fallback string. However the DT node in the b= ase > > .dtsi sets: status =3D "reserved"; for this (and the other) watchdog, so > > U-Boot's DM (correctly!) ignores those devices. Trying to figure out wh= y. > > Adding: > > &wdt { > > status =3D "okay"; > > }; > > to sun8i-t113s.dtsi fixes that for me, now the reset command works. =20 >=20 > I did it the same way for myself. =F0=9F=99=82 But I thought this was the= wrong way and > the watchdog should be managed by a trusted OS or something like that. > (which we don't have in the mainline yet) Well, the name "reserved" suggests so, but I think it's really that those watchdogs don't seem to affect the RISC-V core, that's why there is a separate one (riscv_wdt). To avoid those watchdogs being picked up the any (RISC-V) OS, they are marked as reserved in the *shared* .dtsi. So I think marking the one as "okay" in the ARM specific .dtsi is the way to go, but I will wait for someone confirming the reason behind it. Cheers, Andre