Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp358264rdd; Tue, 9 Jan 2024 06:28:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IEkwXfeW8ziaKRLGi3VQagYzAt+OLbBbfp6iQanK8ODbRPLTP7Ly5ekvobfR1YSDp3FDxc1 X-Received: by 2002:aa7:93ae:0:b0:6d9:acf0:3a38 with SMTP id x14-20020aa793ae000000b006d9acf03a38mr2355509pff.57.1704810522034; Tue, 09 Jan 2024 06:28:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704810522; cv=none; d=google.com; s=arc-20160816; b=HgKCq7u7eGIbL4bkqDZZ2DJ9crP0+i4I+7MHIIK+6T27sIlWfSQh10BX7B+7r7EsgQ nvYNQ3mKE5Gcj46Wr34Z1d9QFjslMeEM7911wGFF7cmx5Qi2Pg0UIloAdsdz7ll71Kh3 n2V4iXIhwrwdG3UNd14leTH89KgQkzpu1K7FHFt5PG6tD40Iacf1uitAW1adeNVqDytY bLPnj1E/rNuoVvArI/fr6XRIfQ/14n8BdJO9M04RlY2BynzuhLj8cpU3lZ11SNCIQPAS pkCJHIe2OICbKnWYoJb+bPbk5xZu8R540ExHM/LO1kekIjdTfL/BbUvWgaEUrYFBi7yL POGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:from :dkim-signature; bh=H46EXvdjyBOKeFgyWr6G7nw/iea+GVPfzJMh//6f0l8=; fh=bxT0+XjdBnKbhNlnkCSGIRFsShjcHhEFAtDdZ9z51cY=; b=ZUoMsnvACeeOumbe2o/sjdxWBgiUdDN6RoIG8oGUYEHHjpCtj4vGCMuJBOt/GxOdsk uYNtDC7v3Ka8RqXsdcRg8WY7sl7tcrQLVqzPj9V2ngeKeww/eB54gxKuyDCbnI9S4zVz TSh56IRspIZZbew1Khe9SFwGPaKEU+x1hfN96AeDFR3ggj+AvBwGVPY+tmpwRxwtcG4P gz3rM9ond/kx4n1hygIqb88nSPnYl39wQJu+HTkRoljWXSmuD5OzINHgdn0GB7fd2LsN zdTIaSyTmaGe0jQcxgFjpa0aTxDQUUIsguvCNC+MRKY4VIszczGW3j+O5P3orrmxqk6L eWew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=wYw0VBic; spf=pass (google.com: domain of linux-kernel+bounces-20980-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20980-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id fa22-20020a056a002d1600b006d9a743434csi1525989pfb.161.2024.01.09.06.28.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 06:28:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-20980-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=wYw0VBic; spf=pass (google.com: domain of linux-kernel+bounces-20980-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20980-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id A7781286CCA for ; Tue, 9 Jan 2024 14:28:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9037D39AD6; Tue, 9 Jan 2024 14:28:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=canonical.com header.i=@canonical.com header.b="wYw0VBic" Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A680439AC6 for ; Tue, 9 Jan 2024 14:28:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=canonical.com Received: from mail-ot1-f72.google.com (mail-ot1-f72.google.com [209.85.210.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 6E5B43F737 for ; Tue, 9 Jan 2024 14:28:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1704810501; bh=H46EXvdjyBOKeFgyWr6G7nw/iea+GVPfzJMh//6f0l8=; h=From:In-Reply-To:References:Mime-Version:Date:Message-ID:Subject: To:Cc:Content-Type; b=wYw0VBicWVEY80nMARto7s3zWLgiE7jqx06jsZhkwTo6yxLtRXA2u6waqR8CGnPfg w3t4jM9BBDPOkJxZLg2phYbF4w2nqcGLrCqNF2B1CedBdto8FiKGpyYOzsc1e4Skta +j/dtjDcM0H7A7om6jRJPtcVZYHx2nmWoc9QWkk5jUb1Ulu9hdThla72cj+htJDZya xPM6SqgHe+BxKnhpNftvIkAAa6My7qvGkYvXGhKtI5dvsXfwU5kEpSEKec3T/2lQkz 4eUBcu1d0cTPUJlzZDvbJwW2PTeQpCXh0Vnawzxo3GPUHjvIMIqOURsabYDnWTd3WY 9b63TRat0GVPA== Received: by mail-ot1-f72.google.com with SMTP id 46e09a7af769-6ddec7b52e7so141211a34.1 for ; Tue, 09 Jan 2024 06:28:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704810500; x=1705415300; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=H46EXvdjyBOKeFgyWr6G7nw/iea+GVPfzJMh//6f0l8=; b=aSSmoD65e80YItkLw4MzdMJ7F+kdennuv1Uq8Yny5ISVA0YyjeMzsgYQfimpT8Wm/d wvlmqRaeFoD7ucpfI0D9m7SsNKvjRGharmvzP4qOFUL+pHcCHX5fEiq2bMv+uLIZsp7N +wApvofe/W1cungSl5wzuIKlYm5BMdmyhzFxZ1QNuwU+2yJRixU+F4uN63Li7/YzJZuh yIBuPobxIwDL9ltB8oCh5BOGCT7EhIBDbxAeQKO2vWVuILBzQ5vsXEehsamuyiIuxlY4 nClPVmXPoM9242Ex2JEGBeyLHkPFQDpVGjfsHfSqHJ8JeT3g9KPrsQjQjt0jmKOC5TKg Tomg== X-Gm-Message-State: AOJu0YxuvlBkogvNk0V+RsUEtd7HzTqfb50WA0TlTOcNThCpRLEjUzEh L3OewqZZ9EK0jG/psi2+n63Gz+ahSNluHCC4YK1VubFg/1azi5/6KkAk6ayr71vZKV16CA3vP73 306xY80IXiBx4N3I+RIz7VFQv41lipIwxrcQ5Hkask53c5zeqvAU+p/aU7pGBiUYA X-Received: by 2002:a05:6358:418b:b0:174:ec56:4220 with SMTP id w11-20020a056358418b00b00174ec564220mr3565156rwc.21.1704810500016; Tue, 09 Jan 2024 06:28:20 -0800 (PST) X-Received: by 2002:a05:6358:418b:b0:174:ec56:4220 with SMTP id w11-20020a056358418b00b00174ec564220mr3565129rwc.21.1704810499691; Tue, 09 Jan 2024 06:28:19 -0800 (PST) Received: from 348282803490 named unknown by gmailapi.google.com with HTTPREST; Tue, 9 Jan 2024 06:28:19 -0800 From: Emil Renner Berthing In-Reply-To: <20240109-tiptoeing-twirl-ebb943e17a29@wendy> References: <20240103132852.298964-1-emil.renner.berthing@canonical.com> <20240103132852.298964-4-emil.renner.berthing@canonical.com> <20240108-majorette-overtly-4ec65d0a15e9@spud> <20240109-tiptoeing-twirl-ebb943e17a29@wendy> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Date: Tue, 9 Jan 2024 06:28:19 -0800 Message-ID: Subject: Re: [PATCH v2 3/8] riscv: dts: thead: Add TH1520 pin control nodes To: Conor Dooley , Emil Renner Berthing Cc: Conor Dooley , linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, Linus Walleij , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jisheng Zhang , Guo Ren , Fu Wei , Paul Walmsley , Palmer Dabbelt , Drew Fustini Content-Type: text/plain; charset="UTF-8" Conor Dooley wrote: > On Tue, Jan 09, 2024 at 04:02:01AM -0800, Emil Renner Berthing wrote: > > Conor Dooley wrote: > > > On Wed, Jan 03, 2024 at 02:28:40PM +0100, Emil Renner Berthing wrote: > > > > Add nodes for pin controllers on the T-Head TH1520 RISC-V SoC. > > > > > > > > Signed-off-by: Emil Renner Berthing > > > > --- > > > > .../boot/dts/thead/th1520-beaglev-ahead.dts | 4 ++++ > > > > .../dts/thead/th1520-lichee-module-4a.dtsi | 4 ++++ > > > > arch/riscv/boot/dts/thead/th1520.dtsi | 24 +++++++++++++++++++ > > > > 3 files changed, 32 insertions(+) > > > > > > > > diff --git a/arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts b/arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts > > > > index 70e8042c8304..6c56318a8705 100644 > > > > --- a/arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts > > > > +++ b/arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts > > > > @@ -44,6 +44,10 @@ &osc_32k { > > > > clock-frequency = <32768>; > > > > }; > > > > > > > > +&aonsys_clk { > > > > + clock-frequency = <73728000>; > > > > +}; > > > > + > > > > &apb_clk { > > > > clock-frequency = <62500000>; > > > > }; > > > > diff --git a/arch/riscv/boot/dts/thead/th1520-lichee-module-4a.dtsi b/arch/riscv/boot/dts/thead/th1520-lichee-module-4a.dtsi > > > > index a802ab110429..9865925be372 100644 > > > > --- a/arch/riscv/boot/dts/thead/th1520-lichee-module-4a.dtsi > > > > +++ b/arch/riscv/boot/dts/thead/th1520-lichee-module-4a.dtsi > > > > @@ -25,6 +25,10 @@ &osc_32k { > > > > clock-frequency = <32768>; > > > > }; > > > > > > > > +&aonsys_clk { > > > > + clock-frequency = <73728000>; > > > > +}; > > > > + > > > > &apb_clk { > > > > clock-frequency = <62500000>; > > > > }; > > > > diff --git a/arch/riscv/boot/dts/thead/th1520.dtsi b/arch/riscv/boot/dts/thead/th1520.dtsi > > > > index ba4d2c673ac8..e65a306ff575 100644 > > > > --- a/arch/riscv/boot/dts/thead/th1520.dtsi > > > > +++ b/arch/riscv/boot/dts/thead/th1520.dtsi > > > > @@ -134,6 +134,12 @@ osc_32k: 32k-oscillator { > > > > #clock-cells = <0>; > > > > }; > > > > > > > > + aonsys_clk: aonsys-clk { > > > > + compatible = "fixed-clock"; > > > > + clock-output-names = "aonsys_clk"; > > > > + #clock-cells = <0>; > > > > + }; > > > > > > Did this stuff sneak into this commit accidentally? > > > > Not really by accident no. It turns out the clock tree has gates for the bus > > clock of each pinctrl block and I think it's better to add this clock > > dependency to the bindings and driver up front. > > Maybe if I had looked a wee bit more deeply I would've noticed that it > was used there, but it's always good to mention the rationale in the > commit message so that it's more obvious why you're doin it. You absolutely right. I forgot to update the commit message. > > Since there is not yet any clock driver the initial device tree for the TH1520 > > included the dummy apb_clk that two of the pinctrl blocks derive their clock > > from, but not the "aonsys" clock needed by the "always-on" pinctrl. I thought > > it was better to add this dummy clock with the only (so far) user of it, but if > > you have a better idea, let me know. > > No, that's fine. I was just wondering why there was an unmentioned set > of clocks being added. If they're stubbed fixed clocks I dunno if it > makes sense to add them to the board.dts/module.dtsi files though. Where > do the initial values come from for the rates? Out of reset values or > set by firmware that may vary from board to board? The vendor u-boot sets the PLLs different from the reset values. For now I think it's the same code for every board using the Lichee Pi 4A module (and probably also for the BeagleV Ahead), but it might still make sense to move the freqency to the board instead of the module device tree. /Emil