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 AE788C7EE2F for ; Mon, 12 Jun 2023 21:21:06 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id F2AFC861D9; Mon, 12 Jun 2023 23:18:42 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com 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=gmail.com header.i=@gmail.com header.b="UMc4MxKL"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C33CC861C3; Mon, 12 Jun 2023 23:18:23 +0200 (CEST) Received: from mail-io1-xd2b.google.com (mail-io1-xd2b.google.com [IPv6:2607:f8b0:4864:20::d2b]) (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 2A620861E1 for ; Mon, 12 Jun 2023 23:18:20 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=cfsworks@gmail.com Received: by mail-io1-xd2b.google.com with SMTP id ca18e2360f4ac-77ad3bba2a9so299611739f.1 for ; Mon, 12 Jun 2023 14:18:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686604699; x=1689196699; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=It/xvLVun4sBRXAvYZ+Wv4D2Nua8KCPpaKoaYk0Mypk=; b=UMc4MxKLibhUFCoTSgxPzXgBfgE+Z+ybcq5CcrHHm+D72f02K6noMP5NxjNiHMF+rg WxpHF8QDTAw9sfD1Nq5vbU1CBSdwXOvpIMOF0vFa7RE2lwR2PJMRwZUeMGLazAj6AVsH 9ahi6dz9AyDaQP7fjLu28K2Ccmef6doMj0Fx76n2aHXX3exT1CVHWfy9mOdHRiG2hpgh OdnIydZgegNHTd0/0GgJCNhQ2CbPThQzBOtrwMky8SyF/8S6+6LXjLbCboRYLNcO/M/G o4yREhWxigcF6swYMxepd5TXIMHbehfkzeyy6D3xoy/ujCMtUIQx5XrmcHb6Xsw+//EN 10pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686604699; x=1689196699; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=It/xvLVun4sBRXAvYZ+Wv4D2Nua8KCPpaKoaYk0Mypk=; b=RCNlvQkfW4urTek6LChiyAay6ArI8w4l+KbwnZ2coebYIT/Ez2G55oqVJGxsOAX3u4 RYzXmefK6NXUQL+pIIi3ySrnrlKyoPHVMRN07/k+nbDv0Dr72z1lLvP/Lx4eKdWdQySl i5qspRvqWLZZYbJ9v7/n/L7UKTOqUP2Ck/MHfPHGh7eJ3QgxDWphlIEeOI4QBfMPit5G mJvAovGzbZrL1JhqXjZaGgPWu8zNQhQmkWPZmeXTHmUHKw3RespWHvzQIQcCyB0YubpI wUOsAm4A7SpJ335NdRztxvSpx6iX1lABnFM4W1qeAM+0wctFYoGXJBTFwrOxNjGGW60n 56dg== X-Gm-Message-State: AC+VfDy6ZWp2iE8wKHL/2uWfWYLLnzNQm1Qi86Gl5brEBK+AJavlDqoa fAz7x7ajvbf/bEN/g+BmwRsJsrMzJ4Ov4/Ez X-Google-Smtp-Source: ACHHUZ7mdPvywcRiAL9OAA0R/ucn3hZqFG/X248SdurZxouhlptvNuDX4YXDJ4w5bCvlMa6Lz7EYHQ== X-Received: by 2002:a92:d3c2:0:b0:33c:5109:bb07 with SMTP id c2-20020a92d3c2000000b0033c5109bb07mr9294958ilh.1.1686604698631; Mon, 12 Jun 2023 14:18:18 -0700 (PDT) Received: from ?IPV6:2001:470:42c4:101:857:833a:c057:fc99? ([2001:470:42c4:101:857:833a:c057:fc99]) by smtp.gmail.com with ESMTPSA id o14-20020a92d38e000000b00331a5fcd648sm3448289ilo.68.2023.06.12.14.18.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 12 Jun 2023 14:18:18 -0700 (PDT) Message-ID: Date: Mon, 12 Jun 2023 15:18:17 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [RFC PATCH 00/17] sunxi: rework pinctrl and add T113s support Content-Language: en-US To: Andre Przywara Cc: u-boot@lists.denx.de References: <20221206004549.29015-1-andre.przywara@arm.com> <04c52801-a6d0-033b-c7f4-613e0b789d96@gmail.com> <20230612012056.65883683@slackpad.lan> From: Sam Edwards In-Reply-To: <20230612012056.65883683@slackpad.lan> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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 Hey Andre, On 6/11/23 18:20, Andre Przywara wrote: > 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 confirm > or deny: Preeeeetttttyyy much everything I've changed locally has been submitted to the list or discussed in the relevant patchset. Have you updated your 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. >> I have a build of U-Boot for my target, complete with: >> - UART3 initialized correctly > > this is problematic because of the other pinmux used on your board, > which cannot easily be encoded alongside the existing UART3 pinmux? Actually no, my board's UART3 is on PB6/PB7, nice and standard. >> - DRAM coming up correctly >> - SPL sets configured boot clock correctly > > This should work as per github? Yep, everything was working satisfactorily once I figured out I needed to set CONFIG_SYS_CLK_FREQ to get acceptable boot speeds. >> - SPI-NAND support (SPL and U-Boot proper) > > This is with Icenow's series? Any D1 specific changes needed there? 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 0x03. I also needed Maksim's patch series (355747) to support the D1 SPI master. >> - MMC support (SPL and U-Boot proper) >> - SPL boot from FEL > > again worked already in github? Yes and yes. I was just confirming they're good; no local work needed from me here. >> - USB gadget support > > So with the fixed SUNXI_SRAMC_BASE you said it worked? What about the > 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? Yes, with corrected SUNXI_SRAMC_BASE -- though I also needed my patches to make musb-new/sunxi.c use the UDC gadget model in DM (series 358842), as I don't think there's another way to init the controller at runtime. 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. >> - Ethernet MAC+PHY support > > Anything surprising here? Is that using an already supported external > PHY? 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. >> - I²C support * >> - GPIO support (LEDs, buttons, misc. board management) > > again should work out of the box, minus your board specific > configuration? GPIO is completely OotB, yes. I²C is OotB once MVTWSI_CONTROL_CLEAR_IFLG is set correctly. (The pinctrl requirements for it are a little harder, more on that below.) >> - `reset` working (requries CONFIG_SYSRESET unset, WDT key) > > Isn't "CONFIG_SYSRESET unset" a hack? I dimly remember we had this for > some other SoC initially, but later got rid of it? Unsetting it is required for reset_cpu() to be defined. Your patchset updates that function (albeit without adding the WDT key, so the current 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. > For the WDT key: it seems like Linux got a nice patch to integrate this > neatly into the driver without quirking this too much, do you have > something ready for U-Boot as well? Would love to see it on the list > then ;-) I just hacked the correct value into the function; nothing really suitable for the list, sorry. >> - PSCI, nonsec > > ah yeah, owe you some reviews on this one ... It occurs to me that my work *might* support H6 as well (they both use CPUX blocks, right?) so perhaps it would be better if I de-RFC'd my series and instead worked to upstream it chasing H6, for you to come along later and tack on NCAT2 support with your R528 patchset? >> - Able to boot Linux ;) >> >> * Requires nonzero `MVTWSI_CONTROL_CLEAR_IFLG` for NCAT2, and a patch to >> the pinctrl driver to configure the proper mux function for my necessary >> pins. > > Are those pinmuxes straight forward to add to the pinctrl driver? Or > are there conflicts similar to UART3? The conflict is that I'm on i2c2 + muxval 2. I suspect this one's going to be a downstream patch to add the necessary line: { "i2c2", 2 }, /* PE12-PE13 */ ...and since no other assignment for i2c2 uses muxval 2, the only hope for this to be supported upstream would be for the pinctrl driver to include the full pin->muxval LUT. >> I figured I'd share this list as a sort of checklist for your own work, >> too. The remainder of my efforts now will probably be focused on >> mainlining this stuff (let me know how else I can be of help), and then >> I'm afraid I'll have to disappear back downstream to the Turing Pi 2 >> development effort, but maybe our paths will cross again in the kernel >> lists. :) > > Yeah, as you may know, the DT has to go through the kernel list. DT > patches can be tedious to upstream, there is now much attention to > every detail. Running checkpatch and dtbs_check should reveal most > issues beforehand, though. At this time I have no interest in upstreaming the DT. That might change in the future, but for now it's very much meant to be out-of-tree. > Cheers, > Andre Likewise, Sam