From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) (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 8C06A1A42C7 for ; Thu, 5 Sep 2024 20:24:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725567899; cv=none; b=IXxE8rX+wc0AvokMdcBzRcqTXywoy0q/KR8jLgfmgZowKm8CxmQBjiFEKhnjFNEw5y/OVeTkxr0S+NuxRU+ybD4yX+irkfOaFv4P2moLZ3QAt3Wo26woIadaMOJo/u/c6ms5vNyWNenIomxuulYuRZwVlpma0rcscmMC5XRAHoQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725567899; c=relaxed/simple; bh=wvJODaIBgD1jUPLAQ4kNOzQaEXZUpgapfSzeNtFOXRo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=mhTjDUFZTnVRV4jnRlSwzWY3BZYqwAZ1+1m+pMuB+2Zk1rs13JVaFiOPnCyi3g86Zq3RfHBU+MwUn3bItGr1nN0aN9pz81Ot64NiPnWK9HzPpk7nypFEDuPv9rXkvOrfYq9w/K/nm4AxRwzyfiq33y6xvhkHipZFZR/BOcoNGHo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=beagleboard.org; spf=fail smtp.mailfrom=beagleboard.org; dkim=pass (2048-bit key) header.d=beagleboard-org.20230601.gappssmtp.com header.i=@beagleboard-org.20230601.gappssmtp.com header.b=FlpHb8kz; arc=none smtp.client-ip=209.85.216.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=beagleboard.org Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=beagleboard.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=beagleboard-org.20230601.gappssmtp.com header.i=@beagleboard-org.20230601.gappssmtp.com header.b="FlpHb8kz" Received: by mail-pj1-f46.google.com with SMTP id 98e67ed59e1d1-2d5f5d8cc01so900035a91.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=vger.kernel.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=FlpHb8kzYDORq0QbPZFkH11NHAZgFVQBw4+9gvAZPatfjnoxjH/5LcJmbMid07hDUg WRFzLMRdxTv9L8MsK8L4EqqnAEC/VtjBF3qILWt5XKnH4qCy5GQoxRMKfFdK5dMZ0i+8 acKxa9ilDb94rEPRa+/OfNeVit0U5Bfk8+13UeBox92eLC4fNq1C/743ZSDPgkolCpb1 CwkTevUn0beRFFvyDvcWAez/PwotWT0ELIz/H+xUSlg8lNXY0ZQ7OOYGPuqerKa1WDfu nUtgj4GiVE3ooXiwGzpYBNZkZ+VWxfnGvUzWVeb1X3kE0xIhCuPvb9zSvqESeJmdJ0F9 uJtw== 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=VBM//B7XK8Yfit7q7e6nm6Ge9ziJ6vR5lZyHCi9zba4Oi6Dlk/GB+q4cAYkGx4WCB2 6qqrOU5+UYuui/RdHQTzxqXS517WWYc284GMdCW0+Y01eOsllcim4GQWcYR081HaWIm8 m9Uclcoz3cXGHWEBxmIUCoQC1xKu6ffTth+XR6x/hBKstmNx5aTwCqchg3I0+sIldGAX cLrSdpvzfOoO62e4ZwmjUStkNp+AynVMUnBLKEJlZf6Kdtz2b6/VGZcEuXoqxaSNvpYd h2HZQCaQYSLHTqvTKJfdPnKO95RAMSPIuoBbqLXUXveop9BkVr5il3gPRXqdbPLMrT/L hwgw== X-Forwarded-Encrypted: i=1; AJvYcCUEgfYvEb+uER/uVcFjEDm26E4EfsnsacdxVIhhzg5E6ArltJMuvMTCTiFqsNInAOnc+UC7DjdbPpuV@vger.kernel.org X-Gm-Message-State: AOJu0YzvAtKM1A3XWYLzw0W6z69HGs2PeLHTrstTevDuykLZghMupKEL bUQTWRdJ8mX4U/nLeyblC1U3lQ3sYcUJQgXBbFZ+W6Qt9OV8PicVI/wYvEfHCw== 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 Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 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