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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A3C9CECAAD3 for ; Thu, 1 Sep 2022 20:40:57 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id AC2EE849F3; Thu, 1 Sep 2022 22:40:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=microchip.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=microchip.com header.i=@microchip.com header.b="bajb9wn2"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id EF49484A00; Thu, 1 Sep 2022 16:24:50 +0200 (CEST) Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 5EDA881F69 for ; Thu, 1 Sep 2022 16:24:46 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=microchip.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=Sergiu.Moga@microchip.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1662042286; x=1693578286; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=dUPPJlJX0mUgPhyMSXEOsalxtpzshy18Zg+9K2mYU8c=; b=bajb9wn2CNRUmKuC/NFFg3NOtaLu8zgBehXA8nr6jVPUbFLFRQnL9bLY 5z/8tTBIyWKdOujncyBfvMdV1lS8UL+pSUuWTuo46wxiiUgYDIY6zB7bE z9c9JOPpQv1lUCtqXl0cy7y7nu3jAn0Rck2llquGjiOTOvibAZBT6df9F J9u2PUoaVybWQl/MSlmy63m/fyrAC7J87GXodoADGew7tzI2eWS3J8o92 AVu1VH+gRpXsdXvDwq0kTcKU11jOK7uXNloTtsaXzJIUriEILtZi5PNHc /8Azc4gBHle6LXzma83xTpiMT3e6jPbBdof8RY/L5ItTyhBhBEIZcs4iZ A==; X-IronPort-AV: E=Sophos;i="5.93,281,1654585200"; d="scan'208";a="178779509" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 01 Sep 2022 07:24:42 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Thu, 1 Sep 2022 07:24:41 -0700 Received: from ROB-ULT-M68701.microchip.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2507.12 via Frontend Transport; Thu, 1 Sep 2022 07:24:38 -0700 From: Sergiu Moga To: , , , , , , , , , , CC: Subject: [PATCH 0/4] Align sama5 and sama7 DT's with Linux Date: Thu, 1 Sep 2022 17:22:38 +0300 Message-ID: <20220901142241.18420-1-sergiu.moga@microchip.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Mailman-Approved-At: Thu, 01 Sep 2022 22:40:38 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean This has been done in order to align the DT of U-Boot with the DT of Linux. In Linux, a phandle from a '-gpio' DT property is linked to the pinctrl driver, a single driver that handles both pinctrl settings and offers GPIO API to callers. On the other hand, U-Boot redirects such phandle to a corresponding UCLASS_GPIO driver, because U-Boot offers two different types of drivers in this case: UCLASS_PINCTRL which handles pin functions and UCLASS_GPIO which handles gpio requests as a gpio provider. Due to this, we have two drivers in Uboot, but the Devicetree has a single node. Thus, just one of the drivers can be probed for the DT node during platform initialization, before relocation. Our previous solution in U-Boot was to have a different devicetree: the gpio node has a subnode for the pinctrl driver, which is not compliant with Linux ABI. Furthermore, our documentation for this type of nodes mentions no such gpio compatible. After this patch, we can no longer add nodes with a gpio compatible in the DT. Thus, in order to link the pinctrl driver to the gpio one, a hook to the bind method of the former in U-Boot has been added and the GPIO related compatibles have been removed to avoid conflict when compatibles are enumerated and bound to drivers during platform start before relocation. The bind method will attach the GPIO driver to the pinctrl DT node so that every phandle coming from '-gpio' DT properties will be redirected to a valid driver attached to the pinctrl DT node. Furthermore, this fixes a GPIO request issue existent on sama7g5, which was caused by the fact that there was no UCLASS_GPIO driver bound to the pioA node label. To make the two Devicetrees even more similar (the one from Linux and the one from U-Boot), make the pinctrl driver's node support multiple subnodes for its subnode. Sergiu Moga (4): ARM: dts: at91: sama5: Align with Linux Devicetree ARM: dts: at91: sama7: Align with Linux Devicetree pinctrl: at91-pio4: Bind GPIO driver to the pinctrl DT node pinctrl: at91-pio4: Add support for pinctrl config subnodes arch/arm/dts/at91-sama5d27_giantboard.dts | 59 +++-- arch/arm/dts/at91-sama5d27_som1_ek.dts | 80 +++---- .../dts/at91-sama5d27_wlsom1_ek-u-boot.dtsi | 6 +- arch/arm/dts/at91-sama5d27_wlsom1_ek.dts | 92 ++++---- arch/arm/dts/at91-sama5d2_icp.dts | 134 ++++++------ arch/arm/dts/at91-sama5d2_ptc_ek.dts | 98 ++++----- arch/arm/dts/at91-sama5d2_xplained.dts | 204 +++++++++--------- arch/arm/dts/at91-sama7g5ek-u-boot.dtsi | 2 +- arch/arm/dts/at91-sama7g5ek.dts | 85 +++++--- arch/arm/dts/sama5d2.dtsi | 9 +- arch/arm/dts/sama5d27_som1.dtsi | 94 ++++---- arch/arm/dts/sama5d27_wlsom1.dtsi | 54 +++-- arch/arm/dts/sama7g5.dtsi | 16 +- drivers/gpio/atmel_pio4.c | 2 - drivers/pinctrl/pinctrl-at91-pio4.c | 138 ++++++++++-- 15 files changed, 592 insertions(+), 481 deletions(-) -- 2.25.1