From patchwork Tue Dec 5 20:05:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 13480687 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.net header.i=wahrenst@gmx.net header.b="F91h6paz" Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95164194; Tue, 5 Dec 2023 12:06:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=s31663417; t=1701806763; x=1702411563; i=wahrenst@gmx.net; bh=sHZB3gt1cJ2iNutQMvwwC4/pfSexz1q7EQBrxnjvhz8=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To: References; b=F91h6paznK1HzvIAwkwOlqO8cgiciTQRzoHZZRV+86U0Y88DfVlsjXNFztbt5aNy +s7pIBdSqT528Zs3mLzdLvyBTFlNdgEzH/eJ1jvCVJa4Jku3C39mdOt1p7PuShINv 2bfKYKVnhrdvvUdBkCKR0bebEDFwtBvvTB2GicfhUGN80iVH/VvKTLmQDGipuYVcR h153cMMqdQbDMv+bf3gtwcE3tqRErQGAj5FkO8KKZ3jm7dLlRLrQGI40hS8l4Q4hw SQM+Qlemj6wIOK5hjouq7W1QwQxWJVUvk31/5uDIQVF4reaR7FpF+iNDW4X1+g2tJ SrCQnGzDH9YqNcLdfg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MLi8m-1qt4pP20sy-00HfYH; Tue, 05 Dec 2023 21:06:03 +0100 From: Stefan Wahren To: Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Florian Fainelli , Mathias Nyman Cc: bcm-kernel-feedback-list@broadcom.com, Cyril Brulebois , linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Stefan Wahren , Conor Dooley Subject: [PATCH V4 1/3] dt-bindings: usb: xhci: Add support for BCM2711 Date: Tue, 5 Dec 2023 21:05:29 +0100 Message-Id: <20231205200531.8232-2-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231205200531.8232-1-wahrenst@gmx.net> References: <20231205200531.8232-1-wahrenst@gmx.net> Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Provags-ID: V03:K1:M/FBh/U+w4JvaljMqyNW6OWptCyc8BIPABF/ynqsHQVmNwwJ45B RNz6e/k50d9l2uGbes9MHD0QWG9QJkKXYKkhcMiKNpJtpP6W+QRRYKpNQoFz6cWuxXsjCz5 PI27JTzuuqb4ju8kY9DAPhq0dyaPYxEsEdsZlcekPoGnSTUKhYUtXNY5dPdlCksjd41Wez3 eWumZ4/lCVMtMzdm2yjmQ== UI-OutboundReport: notjunk:1;M01:P0:breIgNV51t8=;BUZbIZmjjmgmrk7TUmApci4zrvc 3hotQes/pAgADtlmJCbosOXLIjlp1aTNiU/bMvTxnVgW7lbFuuDy3mYjHlJStl8H3r8+pylV0 53HGlM2HT2By95m7VVQBKLQl351NNms7Ah0ocGVyh6J+nMkcsP3r6mK6MP8GqN+TGAhsdetI0 peU9y+jeEUtxoD2a6q4KgOWZmZefudMKxr4QQM/M5h/L9YiG0J8a/z6p4fMfcGyfQfgBnKr39 VBC7jzNjkE9PCPIhLTFeCZUEI1LAJdwb8DRh85SbHmP47oFUkCKRM70vtXpkVrNilYQB5Jb+l ceSjECOEk/BC8AAONgdOMCv9IHpqU2PzFKsJF9M7UBW+D1K8ZnPGXwhvmLAif1K7YNbjtzgpC aVxlbvMnq76mq4tt+KJZqAZLGZny7ItNRdaanfHR8uG3TLR/jEpLoAVlaM6uHVJeOItRyfXGU JAhTXe+0dWYOoJoN9sD2g36MU9ZXz36GTDI/8KjtIhgc+gtjHKaFFSN1JCZ0lQ0LUxFFv8eJd d+RRPLm6Iosh4yVSsoUVJdaqU99h/MuOfz4pSnoMAsDihRA6capb1/jzz3dMQsHsxWvkSx7wC REyH0qvCMbPSpTk/GCzlLGczO58QySMxsfbJkCfJC7MQL0thuKo4VrVmluqvnll3GKXPXGsjY l411YTnlQ3KMcuzlytp3KOWAiQ6fcbha7nmbK4z0n8EIfxWTg9PqiiYtSefJcsBh6FH/5PMWT ivqfSug2HimGFSc78t+uy8KelZtljg+vbeYlzsnT4klGODuAmC7gbAGgwq5I9xCpkwBlwTL2F Vp4RZvhvn3mjof/N7eTcg0xuv5Hmd4tMzhO7QH+u8LXm9St6JMtKkR+oExmCxJHZJYGu1NcTb 7PTyVK3fU2KQfEp4M8QVvYgoDKGPQKH29sa61JCSZCWneLoALl56m5n5XYhIuBxQttv1qFPtH sKE/bSpoNTCMxPKpHugUL3JuD7E= The xHCI IP on the BCM2711 SoC is compatible to "brcm,xhci-brcm-v2", but also requires a power domain. So introduce a new compatible and the specific constraints. Since the key allOf can only occur once, merge the reference below. Signed-off-by: Stefan Wahren Reviewed-by: Conor Dooley Reviewed-by: Florian Fainelli --- .../devicetree/bindings/usb/generic-xhci.yaml | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) -- 2.34.1 diff --git a/Documentation/devicetree/bindings/usb/generic-xhci.yaml b/Documentation/devicetree/bindings/usb/generic-xhci.yaml index 594ebb3ee432..6ceafa4af292 100644 --- a/Documentation/devicetree/bindings/usb/generic-xhci.yaml +++ b/Documentation/devicetree/bindings/usb/generic-xhci.yaml @@ -9,9 +9,6 @@ title: USB xHCI Controller maintainers: - Mathias Nyman -allOf: - - $ref: usb-xhci.yaml# - properties: compatible: oneOf: @@ -25,6 +22,11 @@ properties: - marvell,armada-380-xhci - marvell,armada-8k-xhci - const: generic-xhci + - description: Broadcom SoCs with power domains + items: + - enum: + - brcm,bcm2711-xhci + - const: brcm,xhci-brcm-v2 - description: Broadcom STB SoCs with xHCI enum: - brcm,xhci-brcm-v2 @@ -49,6 +51,9 @@ properties: - const: core - const: reg + power-domains: + maxItems: 1 + unevaluatedProperties: false required: @@ -56,6 +61,20 @@ required: - reg - interrupts +allOf: + - $ref: usb-xhci.yaml# + - if: + properties: + compatible: + contains: + const: brcm,bcm2711-xhci + then: + required: + - power-domains + else: + properties: + power-domains: false + examples: - | usb@f0931000 { From patchwork Tue Dec 5 20:05:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 13480684 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.net header.i=wahrenst@gmx.net header.b="i02+k13U" Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CA60188; Tue, 5 Dec 2023 12:06:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=s31663417; t=1701806764; x=1702411564; i=wahrenst@gmx.net; bh=LHPm3I7nooBOlcBz8F69INMnOtFEIJsNvnQM9Izw8DU=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To: References; b=i02+k13UtU7a0JHg5v+AD5moQwYjvQYphhOS6/AwRz8xyreW437vBeMjdrLOXRwP T9B9NvIhopdLghJ6bbLBZIAU9BgHQbrxxtQFFXqNTMMMxFA3TJgIoEBX0J1EutLTq FHQ3I2hQXrEW1b8AwxaNAixZTgyHfiZF3YmafdnYUDbJHIpBbWbeQJeiCcZ8MthGQ VIdpwgHN3jrL/h8AHcIcqOYJMgScmeMGtcTFzlxJDpaQOcTQmWVvVmKyZF5e5wuyl Tjk93SDCTEYRdGvDGnofem0XtPHv/Q2IBKMwlVWBTKZXrjFc8zlHZ+gAin+AH0+me HIV7548YWWohEr3qVQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MWAOQ-1qlz973nBa-00Xfyl; Tue, 05 Dec 2023 21:06:04 +0100 From: Stefan Wahren To: Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Florian Fainelli , Mathias Nyman Cc: bcm-kernel-feedback-list@broadcom.com, Cyril Brulebois , linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Stefan Wahren Subject: [PATCH V4 2/3] usb: xhci: xhci-plat: Add support for BCM2711 Date: Tue, 5 Dec 2023 21:05:30 +0100 Message-Id: <20231205200531.8232-3-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231205200531.8232-1-wahrenst@gmx.net> References: <20231205200531.8232-1-wahrenst@gmx.net> Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Provags-ID: V03:K1:420IXGJA06Rwq+/YHyemwyWUyz+qWC9Im4mIVa8Z6lH5tMoyb0y LMFq9pmobXtyh21DasfvyvboZzzuowkB7xAuZLfSRQxd1PNovnq2p+2nXtpXZDw0XXY7vYz 985I502A7J+I6BnJrSckgZnFAdeEjL0i6ZxIAtz44r4zFaE8UPsHw98A1pHD8meDPlxG/n5 1P3NhyjI/RsA/et68HA2Q== UI-OutboundReport: notjunk:1;M01:P0:p4MNwTApCds=;gjizWBuFKvcwqPTnqFsiloE4hba IhwEQiUXi2iW3G8K4H0Qe3T9stZ3jVtVRXqyL/ZhFyTpO+dvDkDp4K19Kc3i9GnPjcSuUDk+U 6I9iZk/VQnQ6+4vojEWEPFzybUxYm9Dh76PFaap42KJpZIj90uiWCnYqFFjFPz8zcE9A0dCwH gz86Z/hJllYuevBDACAxQO/xmSW5XMMIVrBbaz5tuEdKKntd39aauG7S3RAjIHHDVaY4wn7Ep 15Sw0cKKDQRPBHspoEIL2UBvMujlTR2PN2g9S3Ay6D1SUz+jQVKm6/KbtBGhn9bIuaY0ZUg9O 0AarD9ibEvBvhSRCURraIgtXXVQsvtwQbhpEf9uWJWEjEvtRrr68PJpW+Wfdoa1Dn2KWcY4MV 4NdzcfH7TRFi4R7qsjeyn+WmPBXB3G7wUoA7UqqWZnSLtGiSnFiG5Y++EzHQzw9fwz9LrH7jw qUcgWaLxPQpAYzO/AgytN9+a769kt9CUafy5au36+nWpTB6nENjJMTkfjlQzEjIqcYamUPy33 DviJYbWkztF8EtYgci4WaFU549zuv2eBaUaQOici7pamQdaiaS3eCwJY0U/8vzK2UtzFpL+dp jCBHVLNdHzEoZ6XW2nWe0ea8igGCxhFv2HWUtI+J9BmgeLwp5J/aBf7Dir76kexIG/9SvOV8M 6ON91YD/PxKEDyEtzhS0g6Sb0KM5JcRCUoI2STElIwhWzGqegANEUhyZ+G/gOgsHkL5uGKgxj r154V7x0FlUNxTqdJEW5UiIx2/PItJAZyLvqNbE5FHz59AOe7zHOyOiVFsORWONKQfYHQYGkQ gLz00vByNGpwCkPwqj/9d1g/q1DSYVoD2cp67ANiW2WLBok3adiuTjrOVnoZIGgOmFr4adoZp liOcePfB3wKF+JM+ktDwXiYvvSnXbKCBF5tfqaZuW7dDFhi/TPlDb4dNTTzjSXkUCB7hGe1yY mxiOCcjk8TjATrfABNZVqW8rDH4= With the introduction of a BCM2711 specific compatible, this also needs to be added to the xHCI driver. Signed-off-by: Stefan Wahren Tested-by: Florian Fainelli Reviewed-by: Florian Fainelli --- drivers/usb/host/xhci-plat.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.34.1 diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c index b93161374293..bc5e8f4cdadf 100644 --- a/drivers/usb/host/xhci-plat.c +++ b/drivers/usb/host/xhci-plat.c @@ -129,6 +129,9 @@ static const struct of_device_id usb_xhci_of_match[] = { }, { .compatible = "brcm,xhci-brcm-v2", .data = &xhci_plat_brcm, + }, { + .compatible = "brcm,bcm2711-xhci", + .data = &xhci_plat_brcm, }, { .compatible = "brcm,bcm7445-xhci", .data = &xhci_plat_brcm, From patchwork Tue Dec 5 20:05:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 13480685 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.net header.i=wahrenst@gmx.net header.b="NH6VoiTD" Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A04D71A4; Tue, 5 Dec 2023 12:06:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=s31663417; t=1701806764; x=1702411564; i=wahrenst@gmx.net; bh=51jUPbm6/S373S1XdgCs7OEHNtM2V5AN/Pt7BeLnFo4=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To: References; b=NH6VoiTDilABNRMCQrY2M7Fw9zElE4h2FYWKSjqos73gypCG4tT/BxqBr4qecyCY PtFT4Nt08dXfFaB0LYsb5aHvYCORX1rf7p02CHm1UjYQowqKrfPt/8OsYNPdSMGZO x/Tazd5PXzdtHIwVdUwpNEiwyFkTYnRNaLpvo4osUJoTcnzf2dMJ0rD98J6+TUipg W06IGW8T98mfjW/i05475Ie1yIHJ+0VFkzTqmnno0oJ4dKOw9kvSAWYXK9HKK4BI2 9B7wQH9hMKdnQJAkHdbPqXutA0t8uLRgISkXJf3jgdBJtuoG0a2sz6qLMJ2/UNtQW rZ9AJJwZ0rpfXTB2jg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MQ5rU-1qxUgG1Ymm-00M5P7; Tue, 05 Dec 2023 21:06:04 +0100 From: Stefan Wahren To: Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Florian Fainelli , Mathias Nyman Cc: bcm-kernel-feedback-list@broadcom.com, Cyril Brulebois , linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Stefan Wahren Subject: [PATCH V4 3/3] ARM: dts: bcm2711: Add BCM2711 xHCI support Date: Tue, 5 Dec 2023 21:05:31 +0100 Message-Id: <20231205200531.8232-4-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231205200531.8232-1-wahrenst@gmx.net> References: <20231205200531.8232-1-wahrenst@gmx.net> Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Provags-ID: V03:K1:KgWSquO6kpuFUC6BnC7EI87vl7h/1oyUbpH2rECpuOK4nyJh1fj ubTjyLgrZ6KdIhfCtTECBTeSe7WZczrJWBFfyYJvH2gexaW/HlXREckdHaKuMc/uNNY3dMe etUaFNSmv2ug+n7+oxCAAiT18mwj1nSj2OS49zmSxJ+iQMA8JGtybhS5a7XbWuZtIFtl9Ce KgWrgiQrKekhvfVTNAjIA== UI-OutboundReport: notjunk:1;M01:P0:iqIneQT7tew=;idYTigGNSaoYLI75HsETsYdzC7c OHOlh0l2sg8Lha1gjRDP3Qt8/RRm/KmajB3gXTeUGqbocJ8ulC/EvmpJxT3WQPrBs8SxFbCN0 tVJZ3pDCQ/15M3AFhyH3DLx5ZwaoYUJUhUr5uB2nf7M6iq6xf5MDGyvgQkVlg8HBWe3NAw/k0 /ncZRrXwSnC4zL5ksWlXjUPA4Ta06/z+eMCe+WMIRj+i6qa6YM2xCkXaFmavr9hobb9skUhaM CPa/JGAaqDQBmA+PXXR56TnhA5u8c4Gj+qK/AEZI0X/9JjPEYlZWZNguR8jm8JllNUNMe52Vj kwyULuxTL8m3vN2tcdb5qPwccxLmcs/SHH5/XMwKaPRexE+KOf5PYkm5dUyOieexXpP8ovni4 bHVJSjOnW7f6PEt9bWFJM3RhnJkX8QHUDr9dGtHivgaDqpwBeB9vY2RhAP8gmGaFsqI3MMwXI gn8SzeB2GA+XGF5ybEzYXIBp+CH5IoeQBtZHjsyonHd6XymLfVgK/oNVhdzAYAYYsqOxs1IVx z1e+CbOHYcFbqpFdTcJfsz9/ozX70XrEMeIqgcB8+cx0ZlCTwQqttr1Vbn+JoKSua/SmfU3qZ WXCpXpEWWyWuso/UEvfYVbv0nvWQCakna02TSK7S48+5SOjKvZeD19r1SRzxhQUSz+bEhQW/b +xD7JRF56hgk4fIoC2zyYuvYq7Rm24mCkTTyFRsGMj7xLI7NgwB6O/EmvqEMMVTmfHtqBn2nm SKtvFSRR+Rk7MIbFTk0curc1VFx4HkuGQpyPX3iVvSKu7aVPfXWEvaKAZ2jQeRfm+UPdJYif6 0jLAPNzCVD9Yzp5D2uAdcPbO2x7adLlkHn/TxjUJzClcem5atOrO775NALG4D1qtkzemZiiIJ mQgvLiHHsFX7pzHvlqWEdmSThGYWiil975QnpYkU62+1Z2hSgpu+DsND50kDJif1k8Jx/59Gd GLdzlA== The BCM2711 SoC also has a mostly generic xHCI. The USB port is currently only usable on the Compute Module 4 (e.g. via IO board). Because DWC2 and xHCI share the same PHY, we let the bootloader enable it on demand. Signed-off-by: Stefan Wahren Tested-by: Florian Fainelli Reviewed-by: Florian Fainelli --- arch/arm/boot/dts/broadcom/bcm2711-rpi.dtsi | 5 +++++ arch/arm/boot/dts/broadcom/bcm2711.dtsi | 14 ++++++++++++++ 2 files changed, 19 insertions(+) -- 2.34.1 diff --git a/arch/arm/boot/dts/broadcom/bcm2711-rpi.dtsi b/arch/arm/boot/dts/broadcom/bcm2711-rpi.dtsi index 98817a6675b9..d233a191c139 100644 --- a/arch/arm/boot/dts/broadcom/bcm2711-rpi.dtsi +++ b/arch/arm/boot/dts/broadcom/bcm2711-rpi.dtsi @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 #include "bcm2835-rpi.dtsi" +#include #include / { @@ -76,3 +77,7 @@ &v3d { &vchiq { interrupts = ; }; + +&xhci { + power-domains = <&power RPI_POWER_DOMAIN_USB>; +}; diff --git a/arch/arm/boot/dts/broadcom/bcm2711.dtsi b/arch/arm/boot/dts/broadcom/bcm2711.dtsi index 4a379a14966d..22c7f1561344 100644 --- a/arch/arm/boot/dts/broadcom/bcm2711.dtsi +++ b/arch/arm/boot/dts/broadcom/bcm2711.dtsi @@ -604,6 +604,20 @@ genet_mdio: mdio@e14 { }; }; + xhci: usb@7e9c0000 { + compatible = "brcm,bcm2711-xhci", "brcm,xhci-brcm-v2"; + reg = <0x0 0x7e9c0000 0x100000>; + #address-cells = <1>; + #size-cells = <0>; + interrupts = ; + /* DWC2 and this IP block share the same USB PHY, + * enabling both at the same time results in lockups. + * So keep this node disabled and let the bootloader + * decide which interface should be enabled. + */ + status = "disabled"; + }; + v3d: gpu@7ec00000 { compatible = "brcm,2711-v3d"; reg = <0x0 0x7ec00000 0x4000>,