From patchwork Sat Dec 2 23:22:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 749778 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.net header.i=wahrenst@gmx.net header.b="XRTyZn0v" Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1C5511F; Sat, 2 Dec 2023 15:23:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=s31663417; t=1701559376; x=1702164176; i=wahrenst@gmx.net; bh=TbxRik80dLzZG7DIQ9xWqFWVyrcfx693GRjJ1QeCo4o=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To: References; b=XRTyZn0v3J6k8WSkFtnNhfFZEOmA4fBbQGdjrB5KGE7U4XcaseiYRPw6SvYD+vJL x4dkU2awZCyRzOybT4ccySAvB76n54Ml8lRCvNrkm8+rGCsSY9j8XEKKLBqROTAtn MGnXjnRfEyJ40Pe6hP8weRQVv8zHyANxD4igZrFll+aASbAbApv+I563AdWiW6O/7 4vSCJD19HANt9gMeIldTWD969aurixSCMsftUcb1C6MHsxKR+Vv2c7j9HoTzBiHgN ieWCdz6cru0r01hIruRaYYCTy5QH27fekLrq9Qgl3St8DCFMKE446pNJQM5L73Vj+ MPBK0C7fCtPZah3SNA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MhlKs-1rn0nw0oNs-00dp5u; Sun, 03 Dec 2023 00:22:56 +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 V3 1/3] dt-bindings: usb: xhci: add support for BCM2711 Date: Sun, 3 Dec 2023 00:22:15 +0100 Message-Id: <20231202232217.89652-2-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231202232217.89652-1-wahrenst@gmx.net> References: <20231202232217.89652-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:mVHHG7lLDU2toWoVhlnfCV8tio7telUp1Yc0xssnqcRC7o2XUht 4btrZuVRxJAfzs9mhoidiP5ynBJ8sd8a5iItdXcZFRKvlFEM9Ul7yxyKppHPhlD8HUJuFEa mYCBRYEuWcRr+iZNL+Hq7E/JYnhUYUK4DsO6x+TdRnezLgmMghnAf6QafurLCzdV+p367rl gt9eAEBCiuoOpk5tAPEkw== UI-OutboundReport: notjunk:1;M01:P0:ycFP+XFM+cM=;R2TbG7g6ZnUeVAfMTN2+GFWFBKS NQgEWBl5M5DT0KwYwBPYV7hPHJg+nwXf3Kr+Aip70vGVFdamItzFb+PuTvKiW8ojl6bPKhvlE w+XrTa22/kokJWr0fkqlvioGYdrWlnA6p9u1uQ/taZ3gettDayXTELUMa07WQPI8kK0gDtL5U V4/9ezeYA9DQxIPclEM05qwGDosLKLpTZQuVezCD/BNmElKpC5dPfMBip8zDOS4eIwU50Jdtq WPmBSs8TkL7ay3apB0D09wK9HiM5Pzz7/t1XXa+0L1pS9K4f69Pz69v02R4IRDN9/Iirl+hZb UIBq7gIk86xNQeWj1zf51zOlaZ7KwPiVEdptv2r8F8Me8/PCKQhunv4RHpBk0m2EVo1RKnkzg AOA5T//6yywxnzx2nWw27Au76C+MAn5L6sjkqWUITUljKCexE2P8Pk5EaGeoynlMTlbzp7l1o OEJB8VgAbc7prEbg9G0gFAa15N1yckhpjlNiVMJbYvveYB9LmSrpkOXRTFKlYE8nkX10TjJsb uXzWzzEuonTvusNbN+ghxCaty+FjNDww5t/K5aQ7XkLw3lc/pjYTeS93iMI76UX+83lZ1UK3i Tx6orNklRygieFhoMnyOu38nf7WaemMu1lvnJqokOMaE44NK5mZKKN63CA0rqZtHvbPvJRvhm V2cM6Hv4LaLkZFXCSzgW7FNSiVTV10U/g5prfBK7BtlJ/AziPe6YSXggpgBhe9Ctjhbz/N9j9 DBAKcM7ZY8qYomND2G1PaNGOe+zxo60uXvbmvMNg+IdKKsLD2bKVLsKvuX2r5TipbNcBxDRUn h0eJMteGSk8GyzWzmjDCoYKg/ONeuRHKXgq9TGgkU69Ur0MfQcWUrjdw5tPaiwM5Cp2ln9cFH 0IxqoQBxtsL0TddLyRYW/VKYD5qtw42jv4umkICONjuJvHdU6CwMxVs1S3tfY7g92Tlll5xLx KG8zBUW8DGF7WzzLofM4xqP5HJY= 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 --- .../devicetree/bindings/usb/generic-xhci.yaml | 21 ++++++++++++++++--- 1 file changed, 18 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..b6e10b0a3c24 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: @@ -28,6 +25,7 @@ properties: - description: Broadcom STB SoCs with xHCI enum: - brcm,xhci-brcm-v2 + - brcm,bcm2711-xhci - brcm,bcm7445-xhci - description: Generic xHCI device const: xhci-platform @@ -49,6 +47,9 @@ properties: - const: core - const: reg + power-domains: + maxItems: 1 + unevaluatedProperties: false required: @@ -56,6 +57,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 Sat Dec 2 23:22:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 750007 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.net header.i=wahrenst@gmx.net header.b="XtJce6lW" Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED3ECEB; Sat, 2 Dec 2023 15:23:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=s31663417; t=1701559376; x=1702164176; i=wahrenst@gmx.net; bh=LHPm3I7nooBOlcBz8F69INMnOtFEIJsNvnQM9Izw8DU=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To: References; b=XtJce6lWzCvVKTYiPbVMXRWKM1yu3ah7RMzdQVdKXnkWStdvjnmaEPyrbULtVi4C ZwjWvHgC1G5r7zbds5D4rLCZLBnh6T1jcj1TIk7OBGy9fQfdV0HYgg2Nrhhj6Tlfg wqO1AKUFPmAjT0YXKlxFQM6RvZfWQ1Kr4ETSUoXl0qEluJVUG9SavRolqqJMsok7P iJi1PJVV6P21fc9+NOzNohbQSCTQehRGLg+kHU0CT6VuYLRkMbI+TrjmT3B3nqM38 EVWIMr7xuWAvAzVy2I/4fRJ8VR2Xixk/YKjUqTcl9FYIJ92mMaa2SvqwfTQrEMqQm yHXgzSLGwFQDQPBK+Q== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MowKi-1rcWA22qSs-00qW9U; Sun, 03 Dec 2023 00:22:56 +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 V3 2/3] usb: xhci: xhci-plat: Add support for BCM2711 Date: Sun, 3 Dec 2023 00:22:16 +0100 Message-Id: <20231202232217.89652-3-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231202232217.89652-1-wahrenst@gmx.net> References: <20231202232217.89652-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:jkod35pfP6IVT1yPHy/ubfhNbuOWfZ6zrF8jvxn8h1WGUukJjJY vq/WkDTfelW1I6VKTTJWrECtAyZnWCgqYbF2h9p6ZzseuHAO7DSTR26Xhe+BLpAmarmg/u7 S789n7ALXaerBd8jmUqeqbuTYrkrXlWQqRSw1hlIXFr7kxio1q9Lo9qL1ghDnpeAjjz7GEr bUn2YlJ8P++b3o3Vk3PnQ== UI-OutboundReport: notjunk:1;M01:P0:fqSH4xPEJco=;Gtr7IbXbVd8KI02Gb8IvHelltEh uM+CpcK/K/V6VUyupxnebvUXT0k4OONrj48Wfr6VZItTdb7AT+xpLlXA8c9WJIsR4BCQX6Syj peopkFD5eWD9v5TchOkFo4aWbkB9tIdfS+mMAp8yFNpN1oxcxdaWYqxVdWRA8iSPb1YRybXs2 OcPHg3dSfUA7LTDRV3Bj0eaZHMSHM3KHkHRQ6nZZTqX/SmdNRMTP7Rt0dzq/5Ry/Ksiak/vA0 gTL1pSG0K3AWHSWjBNqU0qkhxYEq+oQuRMCmEo+pHNZtWATCAC+nVuF1+LxAh+nHfJ3ePVvYm 3Kkeuv+pfNk8nDldDtzwcrJXTA8DSvd49axfK5+m8csSyNi6YS7OekFt8ktyWL0SHoWfVhUej woHjnQ/QfmZwXj1HfpLd9rbHIAnuyXb7uHsdJW1i6IO7EK988D/snJPKh7AB+HzQp2+9ulBpm vfQvKvTWSYdGBKFkOrOk2Rtriu8sWD2fYlHH4GGmVHnIQQLK81hWkvGqKAUTmQLaH81gr4JNb Q+QU4kZmSMYfTyLlM/s8AvZ6lrUbpfMaqwc0tRuvrAvr6jfpjwKvPsIXHn+cjgiVEfdSWhz8j JcU405pS4OE9PLKXasz2LvKczU1OxqldzIUrNgZnQjv1yIxPsRhDto4G0lLgI8ryj7EAc1nfJ /Q6F1eOoS4bMmFZP9Gdr9kS4Dem5YxaIL3dAtw2BWAUsyrWPiKGTmnvo3I62TovYS7d+Ng7YA 5V/MW9BSkZHOO7oCk7WeBPwDocEPkwS/0qIyUfKcDcrM2T3hdlsBF8ZIsYuEDrFD2zsZqMjw8 JxKUASRpY+jGeNGOQ2LqC8liy0sXhjRzl7kHUKBjhaOJiRZRxdqYsroFTRyEW92ulpQ3AbNGk jogubfreDDxBfpfHuiwi1D176LcrruClt8Sw57ZdvIvXpdyeke4pDPgbVw2d3G7xjZbC3O3V0 qVKNoA== With the introduction of a BCM2711 specific compatible, this also needs to be added to the xHCI driver. Signed-off-by: Stefan Wahren --- 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 Sat Dec 2 23:22:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 749779 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.net header.i=wahrenst@gmx.net header.b="CR58v8pi" Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C31BBFD; Sat, 2 Dec 2023 15:23:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=s31663417; t=1701559377; x=1702164177; i=wahrenst@gmx.net; bh=1yHSNAC8bttHA6etqyuvQwPmI2IH8vcMMN4otfV1ovM=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To: References; b=CR58v8piGKktaHJHTEyfJjzEDVT/Hl6nEuUOU010dXUC9Sc1fuyyMGL8VWzvWijb WjfNzcIaC7fHJuZpoxMZFhk0/pTPMESOISVMKjJ46Flkece5+JG6zhcqqj3MH1Ucm CmNf6LgK5eJ4pCl5U1OMVtLgCUkFdPxs4NTJgsdm4XLqXCn6XtpYRAlyMr3PUhiF+ j95phUHJrBUYjhxZJy2iSA72IwWrTFxeUgLor6RbIbLe+rayMrTmhyXIPNPDcvUGc 6g7E1VKPlIW+FaThs1MFCWa+Ytq8md9Y2IzYI9Hzl6urLg7YHSq6EC2qBSN6gWnHg diC5jdbwLhcCuyODAA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N63Vi-1rKRJJ0l0y-016Obq; Sun, 03 Dec 2023 00:22:57 +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 V3 3/3] ARM: dts: bcm2711: Add BCM2711 xHCI support Date: Sun, 3 Dec 2023 00:22:17 +0100 Message-Id: <20231202232217.89652-4-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231202232217.89652-1-wahrenst@gmx.net> References: <20231202232217.89652-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:oNPvOdjYtiFOilEXE/1leOM7ZjfciiG7DjObmgGpBw4RREIAqhu wCYZ0ZleIUeNr7Cqtc5NKBF2TQEljc6ld9ceaclTubDUDrpBnE3V3V5Gsp75zK5lKRXUeaq F5Ga4Vx8YfRFVjtgXKiTyyBti5dUJP/0suZIWpqTfhnBofokB7WSDnUtJVa6FvguMTeSzL/ Rasr3YY/2Nq8Rv2/u3xpA== UI-OutboundReport: notjunk:1;M01:P0:ybfmQK7mqQc=;v9tWK0EXOv41q04Vz6HWv8Tao3+ YU/cNJsSwPSH2C4EUr4ZdCtwAxgbrB3m8Iuu4u56vmOhkjker+wYvFPAs7ZFNKKJ7iOUgZPul lb2Ft29bYfhQGCyFvUxZl50pKKsyqmZLLpFmRQw9FZbSzvCVF4iIdIPfH7mURvO3tuZQ8WUqa IBwLkQlYcIS25jpKzsFomejd6SaAGGFUYo8X+XA5qlrgSERsOcCJweoMyhqL7gsGBr5r1zcGp P+HYEYcAGLPktEXadcTwhbN6Je7bNHjQ9gpTX+5+2I9dnVXy2kI2EYIgmbZbwXZ6RsF2oEytD CpPFGmaKWu4PK7qgWYarR1I24oL3bs0+0gPLNCS8oDCHdafePRWwvlUahuZ8+Y81dFm0QM5XQ JxbFV/fVqgI8Nijb3pz7lR1nSFjQZbS4GWIDd0/IV/J9e4iSc6GVqKHXF/WWtnulHMtUCfwV5 Hb+ihoxjSvkQApjCeBnBpgjDM5NFsPuzEolpqllQvBJCzlGhMboSTxC2s/s5MJAsLiXgNC/nv XP0ai6Lv8jx/AeVQANhn/gH7tGDlhUpTq98BZzl/9gDExo12xa9xswKBt+b1yJwqUxnNyoydO 5uUUPwShycL24s1ZamwcKp4th0zaRPipZMfxsAJSV2OG8u77ClV+awqf89T5Jn2FX0wCQaEz/ 5JaVk+elzZROf7a+q+nrDLSSfGwrAm4Tn+OlKX4mSRAtXyS/Q4O8a/MqmQAm+Zyrcode2Ra9z iACwWSmQoNPfW9lXhDb3ofCJEurtYAbQsgoK0MHg/Cp4fumLR6G+i2kE9W1gL+1aoV0fqYe8e ELV4qr8l4LwGHOr3tRo6yMQBzjSVWXpeymx7wSkg2eFdHfvdzCkVzsXyXEqKHP4nLcLWFRMks kYE1+jF61K9Q62LzDjwOt4bukRmn5kxSk3arFziseHQ8DwTJwaRmtu2BH+ciRMgF0p3NXk1WL Xrj0gCQx7iTjbqp6YrnAkGAfZik= 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 --- 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..ed5ef36e08ff 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"; + 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>,