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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D756FCE7A96 for ; Thu, 5 Sep 2024 20:26:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=MFqtA/E7v5gQ+W6lQ8y6AL+BzpP0eM4/rxOM2YdHIlk=; b=IsIjP2C5K239TDL5+QV3W72bTO MV8mj0FJFqDjtGPsUTJperV1VAkCKlZKqmSv06LT+x2doWFMVif4TPOTkI33zAZnNaDtKJUJUBPv3 Gc3/apS9k5J80IIwE9mVPzFJHlEk/nxm5YEDuTx0gp1XT4EGRubXkafniIT3WyV68Ry9qLthgnts0 Fw1Qsfl+UiPgSJAjfryJ7JLhjN5tthpAJLBfjGNgLBrsc8sxl2FYHfg7766rL4RhOwcm9YfdvAPBA ie/guu0xDlacw1fqX0/DtRHaQ/iZrP03pOSV4twjFGwAIWbclEIETWjcfsuF+hEkbdIKUJ+shHb4x Pe6Q4FfA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1smJ3H-00000009kUm-2mVW; Thu, 05 Sep 2024 20:25:59 +0000 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1smJ2I-00000009kF4-1a9R for linux-arm-kernel@lists.infradead.org; Thu, 05 Sep 2024 20:24:59 +0000 Received: by mail-pj1-x1036.google.com with SMTP id 98e67ed59e1d1-2d5f5d8cc01so900036a91.0 for ; Thu, 05 Sep 2024 13:24:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beagleboard-org.20230601.gappssmtp.com; s=20230601; t=1725567897; x=1726172697; darn=lists.infradead.org; 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=MFqtA/E7v5gQ+W6lQ8y6AL+BzpP0eM4/rxOM2YdHIlk=; b=Si4isckdg0cCznNzEYPkGRQR5xg+RGjcPpFly5jswMnc+ZYo4w3uCUIY3biZ63HrIU apoZJAcr0cUzJTfY4PiVuJs2w9WoxqLXWEHVEoNdf6daJvawVJfES9vSAPXXODzF9qsP 5l1+VhoZsI8p0MrHBa7t6KTnzxkPzqabMyRqGRMhbS8x1L3E18aZZ9ogOU+CzyIU4o9l XliDEEzTXQG/02quCn8NM2CQS7hpLpcDjLMm70g+REpllTRWOtzoiSsDRuI628mXj8r5 sVI6UNr9PDK4n6f3XjkvPU0A1wTltdjXSqvciZe9Rgy74dTdR/ULhYmQNopeeTkLRMwo wnqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725567897; x=1726172697; 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=MFqtA/E7v5gQ+W6lQ8y6AL+BzpP0eM4/rxOM2YdHIlk=; b=YZfbOqZzS8066ZiFRPX2KdzEdc7EqIGpRdTK6BFFuwbeoC2bLkZxIMFrkqNWACAo+S gxtNUQILrCQRXhzKMKRJJJMNSMRTkjDVialatLG/7BSBuGq1wFXAkK3WMafJpZDesDtD KYUTeT5dH/wSM566myE3XJ31OEhjsdDg0dM3lx2XdlvBdFMAadJ0hZg9nfrcHk1eql7E zJuGiLVaKjRV6NDjqAX2WTR1Xb5/9ZFmd2y/X4Yt5/xNLhhsaUhBlDxfPA3HmiWvff7K g38lnSXHm+V3IM2RYT9CQXG9T8K0ZokST7z34aYVjb/kU1HVGgx2xi6Bvh1tBHI7JNR9 Pi2A== X-Forwarded-Encrypted: i=1; AJvYcCXzuPHBYDERe0VqQ3bkiW7ojLP4ZoSRNwSdjWTSolaNF9ysKytSgPAmlHAV78uifcnKieko46IEEsWc3B6T3DUb@lists.infradead.org X-Gm-Message-State: AOJu0YzPv5PiBJZbOK9nP4w8b1cGl+HuN8NKxIQxWprxtLJKSqoO7YHI Osjl8+3W7oSEJN1igvKctqT/ktUzTvUHW3VTLyuJWprP2gsOfJpAk5AvZkH1TNQTLFzU5ITDAp3 u5Q== X-Google-Smtp-Source: AGHT+IHWsZrJ/0FG7b8hwchFVze0z1FJkzK5dQbSnSTMfUnlfMdkkmNUaojAuy0wmGiazF8Xhwp4mQ== X-Received: by 2002:a17:90b:3cce:b0:2c9:6abd:ca64 with SMTP id 98e67ed59e1d1-2dad506f880mr762344a91.9.1725567896838; Thu, 05 Sep 2024 13:24:56 -0700 (PDT) Received: from [172.16.118.100] ([103.15.228.94]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2d8d38ffff9sm9454416a91.39.2024.09.05.13.24.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 05 Sep 2024 13:24:56 -0700 (PDT) Message-ID: Date: Fri, 6 Sep 2024 01:54:48 +0530 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 1/7] dt-bindings: connector: Add mikrobus-connector Content-Language: en-US To: Rob Herring Cc: Michael Walle , Mark Brown , Vaishnav M A , Krzysztof Kozlowski , Conor Dooley , Derek Kiernan , Dragan Cvetic , Arnd Bergmann , Greg Kroah-Hartman , Nishanth Menon , Vignesh Raghavendra , Tero Kristo , Andrew Lunn , jkridner@beagleboard.org, robertcnelson@beagleboard.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <20240627-mikrobus-scratch-spi-v5-0-9e6c148bf5f0@beagleboard.org> <20240627-mikrobus-scratch-spi-v5-1-9e6c148bf5f0@beagleboard.org> <2d3fd95f-6f4d-49d9-a473-b4c5631a4fee@beagleboard.org> From: Ayush Singh In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240905_132458_585714_A0801557 X-CRM114-Status: GOOD ( 24.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 9/4/24 23:19, Rob Herring wrote: > On Wed, Sep 4, 2024 at 12:09 PM Ayush Singh wrote: >>>> gpio-map is what you are looking for. It's documented in the DT spec. >>>> It was created exactly for this purpose of remapping GPIO lines on a >>>> connector. >>>> >>>> Rob >> >> Hi. I found docs on nexus nodes [1] and tried using it for mikroBUS, but >> it does not seem to be working. Here is my connector: >> >> ``` >> >> mikrobus_gpio0: mikrobus-gpio0 { >> #gpio-cells = <2>; >> gpio-map = >> <0 0 &main_gpio1 11 0>, <1 0 &main_gpio1 9 0>, >> <2 0 &main_gpio1 24 0>, <3 0 &main_gpio1 25 0>, >> <4 0 &main_gpio1 22 0>, <5 0 &main_gpio1 23 0>, >> <6 0 &main_gpio1 7 0>, <7 0 &main_gpio1 8 0>, >> <8 0 &main_gpio1 14 0>, <9 0 &main_gpio1 13 0>, >> <10 0 &main_gpio1 12 0>, <11 0 &main_gpio1 10 0>; >> gpio-map-mask = <0xf 0x0>; >> gpio-map-pass-thru = <0x0 0x1>; >> }; >> >> ... >> >> &main_uart5 { >> status = "okay"; >> pinctrl-names = "default"; >> pinctrl-0 = <&mikrobus_uart_pins_default>; >> >> gnss { >> compatible = "u-blox,neo-8"; >> reset-gpios = <&mikrobus_gpio0 10 GPIO_ACTIVE_LOW>; >> }; >> }; >> >> ``` >> >> >> After some fdtdump, I can see that at least the dtc compiler does not >> seem to do the forwarding at dt compile time. Here is the dump: > dtc knows nothing about it. > >> ``` >> >> mikrobus-gpio0 { >> #gpio-cells = <0x00000002>; >> gpio-map = <0x00000000 0x00000000 0x00000025 0x0000000b >> 0x00000000 0x00000001 0x00000000 0x00000025 0x00000009 0x00000000 >> 0x00000002 0x00000000 0x00000025 0x00000018 0x00000000 0x00000003 >> 0x00000000 0x00000025 0x00000019 0x00000000 0x00000004 0x00000000 >> 0x00000025 0x00000016 0x00000000 0x00000005 0x00000000 0x00000025 >> 0x00000017 0x00000000 0x00000006 0x00000000 0x00000025 0x00000007 >> 0x00000000 0x00000007 0x00000000 0x00000025 0x00000008 0x00000000 >> 0x00000008 0x00000000 0x00000025 0x0000000e 0x00000000 0x00000009 >> 0x00000000 0x00000025 0x0000000d 0x00000000 0x0000000a 0x00000000 >> 0x00000025 0x0000000c 0x00000000 0x0000000b 0x00000000 0x00000025 >> 0x0000000a 0x00000000>; >> gpio-map-mask = <0x0000000f 0x00000000>; >> gpio-map-pass-thru = <0x00000000 0x00000001>; >> phandle = <0x0000000e>; >> }; > You might need "gpio-controller" here. Though if you do, I think > that's a mistake in the kernel. It should work like interrupt-map and > generally you have either interrupt-controller or interrupt-map, but > not both (though that is allowed now too). > >> ... >> >> serial@2850000 { >> compatible = "ti,am64-uart", "ti,am654-uart"; >> reg = <0x00000000 0x02850000 0x00000000 0x00000100>; >> interrupts = <0x00000000 0x000000b7 0x00000004>; >> power-domains = <0x00000003 0x0000009c 0x00000001>; >> clocks = <0x00000002 0x0000009c 0x00000000>; >> clock-names = "fclk"; >> status = "okay"; >> pinctrl-names = "default"; >> pinctrl-0 = <0x0000000d>; >> phandle = <0x00000081>; >> gnss { >> compatible = "u-blox,neo-8"; >> reset-gpios = <0x0000000e 0x0000000a 0x00000001>; >> }; >> }; >> >> ``` >> >> >> So I am a bit unsure. Is the dtc parser in the kernel supposed to do the > No such thing as "dtc parser in the kernel". > >> mapping, or is it supposed to be done by `dtc` at compile time? > No. > >> Maybe we >> do not have support for it in upstream kernel yet? > Yes, there is upstream support. Grep for of_parse_phandle_with_args_map. > > Rob So, after a bit of troubleshooting, it seems that a nexus node should not be present at root level (unless it also has an actual driver). If the nexus node is a root node without an actual driver, anything referring to the node is deferred. I am still a bit unsure if I should make the `mikrobus-connector` itself a nexus node or if I should have a subnode named `mikrobus_gpio`, but at least things seem to be working now. So, thanks for your help. Ayush Singh