Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp237972rdb; Thu, 21 Dec 2023 07:53:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IGP+zRJYI03z6kBGlbgbM7k1grZUoUAayja32I1cEgcvFLr4zJOw2Crq06aERZdeIvYMsk9 X-Received: by 2002:a17:906:ae81:b0:a26:8fed:3028 with SMTP id md1-20020a170906ae8100b00a268fed3028mr1037026ejb.11.1703174016008; Thu, 21 Dec 2023 07:53:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703174015; cv=none; d=google.com; s=arc-20160816; b=fRLLdXzirvANoFCx9bbKptyyF6tq/1QdW2RS+a31+01NkQgJQvn4e3EeEY5XL4iZWu WjxmGOosvvekhgAQyaWgGa69BpRfp0/z++x7Ls5C/x8G3N+LksWOet5elNyi8/RvPlgY knPVQ0fHsQS9yc3dKG2OVRyOBvjes9N/RLwfvxcsiSZ6w/Ncta0t0b8V0o3p4grJPvL1 RTSnPap1EegKb7nFZupo8amT/uMM+/AOmd5bvQRta09Lueg2OkPC6sDLWXvxavHJvRSo beW77cUEWPmO8l7oIR7PlZEFCAY0twDYyolCFdO7cmQIYlc/7vuB2CO9KK2vynAl4in+ zGvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=fDrrIdjlKkAVYHhks69AqjX6/crnGDz7sEjm8hq2EtI=; fh=pmh5z7Cu0SeImDhACMsvttgTIRIZrrq6Lll17O59OLo=; b=tpbvhjZv//ldEgCpKiIXTkhm2B5glWuL54T7U7CbXaJeSwPrfCp0YU0JOVaYN1t9Tm o4Bsn5G+ZFNEHmd+JXvdHARmrH+VmayYq0G4RljpCdPxk40gBfMOOs24aJ/On8iIDcpE c7eZkAt/mBw3C87VxE+46Lw/rQdtY9nTSaTqPKOHwqYrEauNepq4hRoP/LN8H0Xty+A+ 64uaxvERfn55CH13793NrXyJhGDv5TAtbdx+hZjeo8T5ns/Kmat6UQnGlGTH1lqkG0Ht uWYiMEHAgRs6FKj6NXDnVSuIG0xJJj5XpJXkNs4LsMBp9hhBVsJSYoUFZtpiRn6gWzNu cE7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=If9nwYPz; spf=pass (google.com: domain of linux-kernel+bounces-8712-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8712-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id k26-20020a170906681a00b00a1af49400a1si921922ejr.386.2023.12.21.07.53.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 07:53:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8712-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=If9nwYPz; spf=pass (google.com: domain of linux-kernel+bounces-8712-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8712-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 9893F1F21A3C for ; Thu, 21 Dec 2023 15:53:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5FD6753A0C; Thu, 21 Dec 2023 15:53:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="If9nwYPz" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com [209.85.208.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ECC2555E63 for ; Thu, 21 Dec 2023 15:53:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-lj1-f181.google.com with SMTP id 38308e7fff4ca-2cc6acf5e3dso10294421fa.1 for ; Thu, 21 Dec 2023 07:53:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703173993; x=1703778793; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=fDrrIdjlKkAVYHhks69AqjX6/crnGDz7sEjm8hq2EtI=; b=If9nwYPzmfT1+o03F2dIpXsPBPZ7LAtQ1eyZFfHvndrAauSMnmNSSTenIXoHFxKU8G zhsD6/u/3EuHFiXzzu/9eGv55c6IEXNkV0cRyu54suIh1lh4del843j0WyVtVnTbDFcC lc1uCYF3GcC4YJMbJwaAZaRCNxUnWFfByq1lCIGTOg3+FaLRmwMMdXLquPllGT8JrJfm srmjEvwRvWito5rwfiM7b2nbQhW1gWPyVEDR8zacHjmSwm5kDDN1uQ0CcEyLjNIlESIj b4XENSZtoHWQP6H85y9PvMZWKTiKPGPRcKBlGjy6xc1Ffs33GYrndPZyw/Fn+2qMWISO 7IKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703173993; x=1703778793; h=content-transfer-encoding:in-reply-to:autocrypt: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=fDrrIdjlKkAVYHhks69AqjX6/crnGDz7sEjm8hq2EtI=; b=EI+zVs0MSXSJGIkFVS1ZptRc1ZzE8VUl1zH4h4+BA9m/M4VQTXGowjpyAxVUcZTxMK uuRftiKbIq8mZepeO5zr1FpJvJrQwtTI2qrUsz1K5N9MiLDmvxtTAz3qCrTFyowoe8Gb 1AEhfcllgQi7WmwV5LSV5MEAXNr2dmbN7fP5GhU7Sc4XRbmKqYDuGifT5RIqg4+WN+KZ bicMU1LEQx6OmXa01tbPxNLYAaKQCBlbFSFruHp9CUJKtF5m2sGOseqI7u3LLfUZSxy2 qb+lWZPwbjnGuJWV3ggTtMQy/eCPPEh9VHev33HFhhmYyl0AJO0/tqVbeVnSVb67ngvA cAiA== X-Gm-Message-State: AOJu0YwwBJpiTv/V1CX2cotNMHxdHjJ8fRrQg2AYCc8gx9TB2DQLElCY eRTO150TI68okUrd2LEf2bo7mw== X-Received: by 2002:a2e:be8b:0:b0:2cc:6bf0:8ea with SMTP id a11-20020a2ebe8b000000b002cc6bf008eamr2429410ljr.34.1703173993094; Thu, 21 Dec 2023 07:53:13 -0800 (PST) Received: from [192.168.0.22] ([78.10.206.178]) by smtp.gmail.com with ESMTPSA id z23-20020aa7c657000000b0054ccac03945sm1319836edr.12.2023.12.21.07.53.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 21 Dec 2023 07:53:12 -0800 (PST) Message-ID: Date: Thu, 21 Dec 2023 16:53:11 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH 6/6] riscv: dts: starfive: jh8100: add pinctrl device tree nodes Content-Language: en-US To: Alex Soo , Linus Walleij , Bartosz Golaszewski , Hal Feng , Ley Foon Tan , Jianlong Huang , Emil Renner Berthing , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Drew Fustini Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, Paul Walmsley , Palmer Dabbelt , Albert Ou References: <20231221083622.3445726-1-yuklin.soo@starfivetech.com> <20231221083622.3445726-7-yuklin.soo@starfivetech.com> From: Krzysztof Kozlowski Autocrypt: addr=krzysztof.kozlowski@linaro.org; keydata= xsFNBFVDQq4BEAC6KeLOfFsAvFMBsrCrJ2bCalhPv5+KQF2PS2+iwZI8BpRZoV+Bd5kWvN79 cFgcqTTuNHjAvxtUG8pQgGTHAObYs6xeYJtjUH0ZX6ndJ33FJYf5V3yXqqjcZ30FgHzJCFUu JMp7PSyMPzpUXfU12yfcRYVEMQrmplNZssmYhiTeVicuOOypWugZKVLGNm0IweVCaZ/DJDIH gNbpvVwjcKYrx85m9cBVEBUGaQP6AT7qlVCkrf50v8bofSIyVa2xmubbAwwFA1oxoOusjPIE J3iadrwpFvsZjF5uHAKS+7wHLoW9hVzOnLbX6ajk5Hf8Pb1m+VH/E8bPBNNYKkfTtypTDUCj NYcd27tjnXfG+SDs/EXNUAIRefCyvaRG7oRYF3Ec+2RgQDRnmmjCjoQNbFrJvJkFHlPeHaeS BosGY+XWKydnmsfY7SSnjAzLUGAFhLd/XDVpb1Een2XucPpKvt9ORF+48gy12FA5GduRLhQU vK4tU7ojoem/G23PcowM1CwPurC8sAVsQb9KmwTGh7rVz3ks3w/zfGBy3+WmLg++C2Wct6nM Pd8/6CBVjEWqD06/RjI2AnjIq5fSEH/BIfXXfC68nMp9BZoy3So4ZsbOlBmtAPvMYX6U8VwD TNeBxJu5Ex0Izf1NV9CzC3nNaFUYOY8KfN01X5SExAoVTr09ewARAQABzTRLcnp5c3p0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V+Ezo71pg3AYvq0a3/oGRG KQ06ztUMRrj8eVtpImjsWCd0bDWRaaR4vqhCHvAG9iWXZu4qh3ipie2Y0oSJygcZT7H3UZxq fyYKiqEmRuqsvv6dcbblD8ZLkz1EVZL6djImH5zc5x8qpVxlA0A0i23v5QvN00m6G9NFF0Le D2GYIS41Kv4Isx2dEFh+/Q== In-Reply-To: <20231221083622.3445726-7-yuklin.soo@starfivetech.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 21/12/2023 09:36, Alex Soo wrote: > Add pinctrl_east/pinctrl_west/pinctrl_gmac/pinctrl_aon device > tree nodes for JH8100 SoC. > > Signed-off-by: Alex Soo > Reviewed-by: Ley Foon Tan I have some doubts about it... > --- > arch/riscv/boot/dts/starfive/jh8100-evb.dts | 5 + > arch/riscv/boot/dts/starfive/jh8100-pinfunc.h | 418 ++++++++++++++++++ > arch/riscv/boot/dts/starfive/jh8100.dtsi | 44 ++ > 3 files changed, 467 insertions(+) > create mode 100644 arch/riscv/boot/dts/starfive/jh8100-pinfunc.h > > diff --git a/arch/riscv/boot/dts/starfive/jh8100-evb.dts b/arch/riscv/boot/dts/starfive/jh8100-evb.dts > index c16bc25d8988..8634e41984f8 100644 > --- a/arch/riscv/boot/dts/starfive/jh8100-evb.dts > +++ b/arch/riscv/boot/dts/starfive/jh8100-evb.dts > @@ -26,3 +26,8 @@ memory@40000000 { > &uart0 { > status = "okay"; > }; > + > +&pinctrl_aon { Wrong order. Nodes do not go to the end. > + wakeup-gpios = <&pinctrl_aon PAD_RGPIO2 GPIO_ACTIVE_HIGH>; > + wakeup-source; None of these were tested. It does not look like you tested the DTS against bindings. Please run `make dtbs_check W=1` (see Documentation/devicetree/bindings/writing-schema.rst or https://www.linaro.org/blog/tips-and-tricks-for-validating-devicetree-sources-with-the-devicetree-schema/ for instructions). > +}; > diff --git a/arch/riscv/boot/dts/starfive/jh8100-pinfunc.h b/arch/riscv/boot/dts/starfive/jh8100-pinfunc.h > new file mode 100644 > index 000000000000..3fb16ef62d90 > --- /dev/null > +++ b/arch/riscv/boot/dts/starfive/jh8100-pinfunc.h > @@ -0,0 +1,418 @@ > +/* SPDX-License-Identifier: GPL-2.0 OR MIT */ > +/* > + * Copyright (C) 2023 StarFive Technology Co., Ltd. > + * Author: Alex Soo > + * > + */ > + > +#ifndef __JH8100_PINFUNC_H__ > +#define __JH8100_PINFUNC_H__ > + > +/* > + * mux bits: > + * | 31 - 24 | 23 - 16 | 15 - 10 | 9 - 8 | 7 - 0 | > + * | din | dout | doen | function | gpio nr | > + * > + * dout: output signal > + * doen: output enable signal > + * din: optional input signal, 0xff = none > + * function: > + * gpio nr: gpio number, 0 - 63 > + */ > +#define GPIOMUX(n, dout, doen, din) ( \ > + (((din) & 0xff) << 24) | \ > + (((dout) & 0xff) << 16) | \ > + (((doen) & 0x3f) << 10) | \ > + ((n) & 0x3f)) > + > +#define PINMUX(n, func) ((1 << 10) | (((func) & 0x3) << 8) | ((n) & 0xff)) > + > +/* sys_iomux_east dout */ > +#define GPOUT_LOW 0 > +#define GPOUT_HIGH 1 Where are these used? > +#define GPOUT_SYS_CAN0_STBY 2 > +#define GPOUT_SYS_CAN0_TST_NEXT_BIT 3 > +#define GPOUT_SYS_CAN0_TST_SAMPLE_POINT 4 > +#define GPOUT_SYS_CAN0_TXD 5 > +#define GPOUT_SYS_I2C0_CLK 6 > +#define GPOUT_SYS_I2C0_DATA 7 > +#define GPOUT_SYS_I2S0_STEREO_RSCKO 8 You add here bunch of constants not used anywhere. No single example of their usage, not a one. Best regards, Krzysztof