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 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 E2122EB64D8 for ; Sun, 18 Jun 2023 19:01:45 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id F386A84768; Sun, 18 Jun 2023 21:01:41 +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="SroXXxr2"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id EE33B8556F; Sun, 18 Jun 2023 21:01:39 +0200 (CEST) Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) (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 4ABAB8474B for ; Sun, 18 Jun 2023 21:01:36 +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-xd2f.google.com with SMTP id ca18e2360f4ac-77e35504c1bso57804339f.1 for ; Sun, 18 Jun 2023 12:01:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687114895; x=1689706895; 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=LSOh6v2WGXjVmmyYqrtsTlujmQbCmdFeKXdlMUtzOek=; b=SroXXxr2+Dy7ngCZqR1luu/9ZCTdnYGmCdPOgGiRZz9V5rOpuVBa/7XoFwVz8dD7+I 8G+UkQkAuwtBCv0/MonjGQJCq9cUDNXUSK4ZmDV7lMnvdG3zp2AIasUY38u+XkPNU3NU Sck5DqS5vbEm1hWWFYk11TLbiEi+KnEeGjxQnxY9FV14usvcFEKFvRzCfWXZAGP0I4iq v0SPu6P+s1yU6Fx1gfeczvOXDgy8d9Dn12hhtcicoXYJOAFeePNN8VyOawEMYur0hTsJ iEpTYWoZwD3CLeVVIwUq9nfbzgBpllVB2SncGCXK85yDRoJn2tl3rrKHEXRWIg+HxsHy KThQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687114895; x=1689706895; 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=LSOh6v2WGXjVmmyYqrtsTlujmQbCmdFeKXdlMUtzOek=; b=iiUKrgo7vrP3DvBU/GbCZbLLHuqSMpAI7vaeJjQu0GlUDFz1ixRqFS0QaoJD/ea2kG usr3V2kfYh3GOHF+lDRwRx6AiRUAHfxEwjPa6hhDfpm0NokBBtwfyO7IBavNIbnQVuWX Ybh4nWG/ZBrA3kWh77kDYbrrn+BJPgF6qunGfhZSlQqwWWMR0/kL62xHgbYwiLS57Oae Nja95JQ5GUACahWyeRGo7qFnCn3R+iqwQSucjqY+GbN20V5ar7wiQUOBqGO6INQ0lVFi /Y5Fc/R2NBzVhyIFl2ZZhHGFzIqB6eINY3DCWDdEPVgWNDuz3OgSBVUxDD6QMdWx+9OQ m7lQ== X-Gm-Message-State: AC+VfDzFwCibL0VrlveGkvI2KvC0Ag0dSQH7mj4l2OjYHYsY2scJDUMq HBaEufQZOmosvz2jB4i3ios= X-Google-Smtp-Source: ACHHUZ6rFznF/PzA5Nf0wlTgnXm8E4Gyx6ZpLY4tXyd31mTwa+js7Mcv8YIG3zPctEuaZTKRnreO5Q== X-Received: by 2002:a5d:8f95:0:b0:766:48cf:6ca9 with SMTP id l21-20020a5d8f95000000b0076648cf6ca9mr7764801iol.12.1687114894633; Sun, 18 Jun 2023 12:01:34 -0700 (PDT) Received: from ?IPV6:2001:470:42c4:101:dcc3:8835:ea36:687? ([2001:470:42c4:101:dcc3:8835:ea36:687]) by smtp.gmail.com with ESMTPSA id g20-20020a0566380c5400b0041f5a0b7fa1sm7710226jal.144.2023.06.18.12.01.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 18 Jun 2023 12:01:34 -0700 (PDT) Message-ID: <71369065-8727-c011-0f29-fa33e0eb785c@gmail.com> Date: Sun, 18 Jun 2023 13:01:33 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.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> <20230615010754.503f4912@slackpad.lan> From: Sam Edwards In-Reply-To: <20230615010754.503f4912@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 Hi Andre, On 6/14/23 18:07, Andre Przywara wrote: > So I finally found some time to address some issues in the series, > especially in the first patches (pinctrl rework and preparation). > I pushed a branch to https://github.com/apritzel/u-boot/commits/r528-rc > I need to do more testing, most importantly regression testing on other > SoCs, and will only be able to post something next week, I guess. > > If you could briefly list the things that are still missing, I could > try to pick some low hanging fruits. Rebasing onto this branch ended up eliminating a good chunk of my local hack commits. I've verified that everything is still working (but have not yet retested NAND SPL). The remaining local changes I have are two additions to cpu_sunxi_ncat2.h: +#define SUNXI_R_CPUCFG_BASE 0x07000400 /* for PSCI */ +#define SUNXI_RTC_BASE 0x07090000 /* for FEL */ The former can probably be brought into my PSCI series somehow (unless we expect more chips with CPUX blocks which might move those soft entry registers around, then it should be defined in cpu_sunxi_*.h). The latter is to support a reimplementation of Allwinner's `efex` command that I'm using for development (it pokes the magic number 0x5AA5A55A into RTC's GP_DATA_REG[2] and then resets; SPL clears that magic number and then does an early branch to BROM+0x0020 -- exactly what Allwinner's fork does). I've also noticed exactly(!) one formatting difference in our clk_d1.c: - .num_gates = ARRAY_SIZE(d1_gates), + .num_gates = ARRAY_SIZE(d1_gates), Up to you if you prefer to align the = or not, but it does look inconsistent when .gates and .resets are aligned and .num_* aren't - might be a nitpick that comes up in patch review. > Interesting, indeed this is left at 0, which I think will result in 288 > MHz. Correct, at least that's what I was seeing. > What is that frequency in your case? Do you know what the BSP > programs? 1008 MHz, both. > Traditionally we used something conservative that works > without cooling and with the default voltage, but I don't know that > value for the T113s. For what it's worth, this board has a bare T113-s3 and the current OS does not reclock from 1008 MHz at all, and I don't know of any users of the board having stability issues. In my own case, it idles at that clock at around ~35°C. > I think CLK_SUN20I_D1 should be set by default now, so can you check > that this is fixed? It is now gone from my defconfig and still working, so indeed this is fixed. > Why would we need H6 PSCI support? On the ARMv8 parts we use Trusted > Firmware-A (TF-A) to provide PSCI services, which has a much more mature > implementation. It's not about the H6 and more about me being unsure whether R528/T113 is the first ARMv7-based SoC to use the new CPU management registers. If it's not, and there's another such chip supported in U-Boot that just lacks PSCI, it would make more sense for me to land my PSCI series independently of our work here, and then you can add the R528 case later. It sounds like R528/T113 may be the first such chip needing this new code, though, so this may have to wait until the R528 series lands. > How would this conflict, exactly? I don't see any other I2C2 > definition? Well, no, the other definitions haven't landed in U-Boot yet. But they do exist in the kernel, datasheets, and physical chips themselves: PB0/PB1/PB8/PB9/PE4/PE5: i2c2 defined as muxval 4 PC0/PC1/PD20/PD21/PG6/PG7/PG14/PG15: i2c2 defined as muxval 3 PE12/PE13: i2c2 defined as muxval 2 Defining i2c2=2 universally would mean that the pins for i2c2 cannot be changed, since it would conflict with every other definition. > And what do you need I2C2 for, exactly? Pins PE12/PE13 host an I²C bus with the board ID EEPROM and an Ethernet switch that should be reset (and have a few registers set to configure proper port isolation) very shortly after power-on. > Well, there are shortcuts. I sketched some simpler idea in the comment > at the top of pinctrl-sunxi.c. My shortcut for the time being will probably be, "downstream patch." >> At this time I have no interest in upstreaming the DT. > > Why not? > >> That might change >> in the future, but for now it's very much meant to be out-of-tree. > > Why is this? This only increases your update burden, and we might break > something and not realise that, if your DT is not in the tree. > The question to ask should be rather: why *not* to upstream the DT? > Please keep in mind that this would block U-Boot support, since we need > the DT approved in the kernel before we could merge it into U-Boot. Currently, downstream is still fairly dependent on the Tina Linux kernel, not mainline. This is a situation I'd like to change, but it's a push for another day -- my focus right now is only on improving the bootloader situation. This means that there are actually two DTs: one for the kernel, using the Tina Linux binding values, and one for U-Boot's control FDT, which can only support U-Boot right now (and cannot yet be tested on a real kernel). So neither DT is acceptable upstream: the former uses incompatible values/includes, and the latter isn't meant for Linux. Even after(/if) this situation is resolved, the unified DT will probably remain in a state of flux for a while, until some drivers can be updated upstream (there's a slight mess with the I²C driver that needs to be cleaned up and we have to use GPIO-bitbanged I²C until then, for example) so it'll take more work before we have a "final" DT. At *that* time, upstreaming would be a good idea... ...but for now it's very much meant to be out-of-tree. :) (I also do not work for the company that produced this board -- I'm just a contributor to the firmware project. Whether the project would even use the mainline version of its DT in the first place is, though likely, ultimately not my call.) > Cheers, > Andre Likewise, Sam