Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp7121988rdb; Wed, 3 Jan 2024 05:30:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IEI9pxSoRKSODy5blu2A3KvOjIndjht2ijW8wJlfr3xNedC6n1NbcRPHYQdwcgZKrkQXBC2 X-Received: by 2002:a50:c34d:0:b0:556:d08d:aef8 with SMTP id q13-20020a50c34d000000b00556d08daef8mr689863edb.12.1704288624231; Wed, 03 Jan 2024 05:30:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704288624; cv=none; d=google.com; s=arc-20160816; b=E22QuNWUSuGUsTkTDZw3Fk61lMYgnodNTDxl8ty5pOAdca/E3voz6aWe7X+fjPjWWP qDOPvyEHiCRBV6bc32j+ejmY+eqLfpH0SfRJehoNcUp5ngQHs4eBaZ39c+MZu8sQsxW8 yUtulgof+bbE7OKUpPZ3WG6hPBF1xi/iT4970Ro59IsR3pTMvPmu1odYrhDdXSOcr3X4 CfV5X2DaY1jieQM2e9rFQ1jODcXKF2KmS9TVb8ua3CpKMehWrhbvl3cV5dJh4mZaAwfj S3GT+wd5hA3Atr9w0s055d+bTcHHAD3v0PM18a6XbglJdj/O5NAqRCQL8UG+jCeMacL9 6pdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=0q4qVCL28lgyouuyHQW1jAXVMv496RwqdrhrVphRrLU=; fh=v+Tej7Da5neO4ppxb9KCbYb3QrHrU+S9AJJBYfP4W+0=; b=rFRAxQBI+DUy+jFqDn3zhKreW2ZG2b5N0UG9zsdp8CDSTLls+qF+sXM3GOjjlouNPn jKxtNz5gucboCtWWDS40JvTiQG/qb9XTVnsZ0dEDhgtUMz6IO7LAo+hu58gesh+5RSjI 0lIHbMK+lGsFoH4KOiQBYQWUTBFg0H/VyDkW/4VjdPU72hv7YdjFitIlcOF9dKhvDTFW BIBqYzFpq8uL7r6b4f67qEFG8a9XBx7Z4ZPF4ZBMBR4bYZBcZzq/HwhaC1KDf1yF9L4l fT1TEYNq+fSaJ82Txalhxole/XrOm2QL488WpoQ+kVj+QBlrRx/oxn3kPMh87GTLgmrk klaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=b2EV8F3h; spf=pass (google.com: domain of linux-kernel+bounces-15573-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15573-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id u20-20020a509514000000b005534721633esi12047560eda.154.2024.01.03.05.30.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 05:30:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-15573-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=@canonical.com header.s=20210705 header.b=b2EV8F3h; spf=pass (google.com: domain of linux-kernel+bounces-15573-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15573-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 am.mirrors.kernel.org (Postfix) with ESMTPS id C56EF1F2448F for ; Wed, 3 Jan 2024 13:30:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 87F561A5B8; Wed, 3 Jan 2024 13:29:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=canonical.com header.i=@canonical.com header.b="b2EV8F3h" X-Original-To: linux-kernel@vger.kernel.org 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 61695199BD for ; Wed, 3 Jan 2024 13:29:27 +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-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.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 6F18E3F802 for ; Wed, 3 Jan 2024 13:29:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1704288542; bh=0q4qVCL28lgyouuyHQW1jAXVMv496RwqdrhrVphRrLU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=b2EV8F3hYzJt6VAYCRYBs/yCgxuPMWhEfv/+hQzIStUe/dR55e51TORX0w75YT8a5 T1EXtAUQl9kKm3qjAFLcTqmezjIeP5Ge5bqtmHP/zubz/rpvwsM04eBa2JnlDPRaRf SReQvOoOIaQ365ScLQ/Py76dDzKn8cOjS3L4+f7FGBY677y5DS8o3W5pqee0Obg7KF obt/+1b76NYFjmTjYXrDWAZkRL1hg7JqU1sr1zY66ARSQv8ZgMtOeOHbyKpAhlbCx8 CTQH1iujT2JHD0geoE1UADzUYGPZBnVV6uKg7mJRsQ7dC+cTxteqLUogfgl0XMoOrB K98spyNAfQZvA== Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-9fd0a58549bso49996866b.0 for ; Wed, 03 Jan 2024 05:29:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704288537; x=1704893337; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0q4qVCL28lgyouuyHQW1jAXVMv496RwqdrhrVphRrLU=; b=kNglPDStwEeLOTmEw3ExZmgULKEMH9EguVLvskaIF/5PpQ59AvqUT85IiBKEdx9Q3k eA3t0lxeT/7SQLrYufski+a+Yprze4R47jvrQHQHJ0eVqNnUOMWXtjYmmd6Q1Qm9ekUj YQM8J4IjNfkHozkIEetYnbAApchANIwsMzccy4HhUsqsNFmUvsgEjuo2KjPMXxZ8YwnX 64bwSipYIsMK+St/0HWounGDCeVhnxrU2qk5JSZo9ogK0+Gc2F0tQIQ4zCKL04UE4iqB wTBVlgxUfcJqJ82j4znKPLPJplRc+oBZcJHm56q2isTB1t8XybwKS9tosg6wbc7FSW8g S0RA== X-Gm-Message-State: AOJu0YyRKV3Nms9hafCkIyRb0DCViOW9uod6cyh1/1YAt8+RZCjf7+IW l5Bd4E7l0eESWGiY8G6BSyIfzLIj41vL+Yh1hRNQ+pd8FU7ehzdDT8okTO5cXnIQRozJlZDIrlL 4y9y3qnwEeXyBDVI2Ay7Lvik1coTrGnSp56flAiCiv7hv8pGgNkNx0mdS X-Received: by 2002:a17:906:3148:b0:a28:7191:b45c with SMTP id e8-20020a170906314800b00a287191b45cmr913108eje.37.1704288537609; Wed, 03 Jan 2024 05:28:57 -0800 (PST) X-Received: by 2002:a17:906:3148:b0:a28:7191:b45c with SMTP id e8-20020a170906314800b00a287191b45cmr913089eje.37.1704288537400; Wed, 03 Jan 2024 05:28:57 -0800 (PST) Received: from stitch.. ([2a01:4262:1ab:c:5af0:999b:bb78:7614]) by smtp.gmail.com with ESMTPSA id eu18-20020a170907299200b00a26e53be089sm9549873ejc.44.2024.01.03.05.28.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 05:28:56 -0800 (PST) From: Emil Renner Berthing To: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-riscv@lists.infradead.org Cc: Linus Walleij , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jisheng Zhang , Guo Ren , Fu Wei , Paul Walmsley , Palmer Dabbelt , Drew Fustini Subject: [PATCH v2 4/8] riscv: dts: thead: Add TH1520 GPIO ranges Date: Wed, 3 Jan 2024 14:28:41 +0100 Message-ID: <20240103132852.298964-5-emil.renner.berthing@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240103132852.298964-1-emil.renner.berthing@canonical.com> References: <20240103132852.298964-1-emil.renner.berthing@canonical.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Add gpio-ranges properties to the TH1520 device tree, so user space can change basic pinconf settings for GPIOs and are not allowed to use pads already used by other functions. Adjust number of GPIOs available for the different controllers. Signed-off-by: Emil Renner Berthing --- arch/riscv/boot/dts/thead/th1520.dtsi | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/arch/riscv/boot/dts/thead/th1520.dtsi b/arch/riscv/boot/dts/thead/th1520.dtsi index e65a306ff575..5eb841ba5124 100644 --- a/arch/riscv/boot/dts/thead/th1520.dtsi +++ b/arch/riscv/boot/dts/thead/th1520.dtsi @@ -223,6 +223,7 @@ portc: gpio-controller@0 { gpio-controller; #gpio-cells = <2>; ngpios = <32>; + gpio-ranges = <&padctrl0_apsys 0 0 32>; reg = <0>; interrupt-controller; #interrupt-cells = <2>; @@ -240,7 +241,8 @@ portd: gpio-controller@0 { compatible = "snps,dw-apb-gpio-port"; gpio-controller; #gpio-cells = <2>; - ngpios = <32>; + ngpios = <23>; + gpio-ranges = <&padctrl0_apsys 0 32 23>; reg = <0>; interrupt-controller; #interrupt-cells = <2>; @@ -265,6 +267,7 @@ porta: gpio-controller@0 { gpio-controller; #gpio-cells = <2>; ngpios = <32>; + gpio-ranges = <&padctrl1_apsys 0 0 32>; reg = <0>; interrupt-controller; #interrupt-cells = <2>; @@ -282,7 +285,8 @@ portb: gpio-controller@0 { compatible = "snps,dw-apb-gpio-port"; gpio-controller; #gpio-cells = <2>; - ngpios = <32>; + ngpios = <31>; + gpio-ranges = <&padctrl1_apsys 0 32 31>; reg = <0>; interrupt-controller; #interrupt-cells = <2>; @@ -424,7 +428,8 @@ porte: gpio-controller@0 { compatible = "snps,dw-apb-gpio-port"; gpio-controller; #gpio-cells = <2>; - ngpios = <32>; + ngpios = <16>; + gpio-ranges = <&padctrl_aosys 0 9 16>; reg = <0>; interrupt-controller; #interrupt-cells = <2>; @@ -448,7 +453,8 @@ portf: gpio-controller@0 { compatible = "snps,dw-apb-gpio-port"; gpio-controller; #gpio-cells = <2>; - ngpios = <32>; + ngpios = <23>; + gpio-ranges = <&padctrl_aosys 0 25 22>, <&padctrl_aosys 22 7 1>; reg = <0>; interrupt-controller; #interrupt-cells = <2>; -- 2.43.0