From nobody Sun Feb 8 18:43:42 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BCCCB12EBFB; Fri, 16 Feb 2024 15:21:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708096887; cv=none; b=nZgfqsua1Qa+OPJPxMAIo4XgOXL0r76a+1AyAgOYxPXwbU79vBf0+ILY0pVt/yVCsGPGejaA1j3yLwnHQLeZ2zScZxZzFWxmsKwyB1PeFwJwIqFPXmthIFC5VK93oDW6hOtuwOhVRMAhtmelGjiHKSJrCXxB24LcYMjLltzhVfo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708096887; c=relaxed/simple; bh=TRmVZH+PZ59+C0TEtARg738Y2o6iYiZC8Ky45LjLJSY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PNiPZUm5XRPNQK3wSfmHSw7X9aErZW/oK3yYTzdILhT+IJZcTYBkkp1ybsH7c+92mD6RvK9898Fvm5mcNmCq3T8HYQJLqf5/2xnGe7WJ7WxE9L7sbPqBSduXMkHcAWUbhjGrt/7e9me566OEGPxQJM/wv104/4Ze2R8G26IViA4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YBxiFFNi; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="YBxiFFNi" Received: by smtp.kernel.org (Postfix) with ESMTPS id 4F17EC433F1; Fri, 16 Feb 2024 15:21:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708096887; bh=TRmVZH+PZ59+C0TEtARg738Y2o6iYiZC8Ky45LjLJSY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=YBxiFFNiiyfTYhqoomzmP4UeXXGkxJuZ70x7AUZk/HagzZt57oafcUglg3Sl7nTcz Gg/f7/HUpv2faOooIdsFcKsJFgVSHxVqtTbya/w0/G/1ZEkW05WDzUTpG8cw3qVLjv btrcY90qgNuTJ5htK3OcayNa5WoB4C8HlGf8bLYVnup3EoktiWNZZ7b+wW9nUsiQTZ ecN1Hxj7TfOVFcgmRrF5zZoucWSWLH1oyEjsQcpjDKIPjMnI8c9cILFwQ6keC3G3YB PI0EzZVf0tXOXiYjpeX4m+Ra2pwGCNOSfRThJ/3YHiENQwLOA9+7VS+IpK8jxqRFDK r3sI2hhe/8Uyw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3944BC48BC4; Fri, 16 Feb 2024 15:21:27 +0000 (UTC) From: Yang Xiwen via B4 Relay Date: Fri, 16 Feb 2024 23:21:01 +0800 Subject: [PATCH RFC 1/4] dt-binding: phy: hisi-inno-usb2: convert to YAML Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240216-inno-phy-v1-1-1ab912f0533f@outlook.com> References: <20240216-inno-phy-v1-0-1ab912f0533f@outlook.com> In-Reply-To: <20240216-inno-phy-v1-0-1ab912f0533f@outlook.com> To: Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jiancheng Xue , Pengcheng Li , Shawn Guo Cc: linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Kishon Vijay Abraham I , David Yang , Yang Xiwen X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1708096886; l=5966; i=forbidden405@outlook.com; s=20230724; h=from:subject:message-id; bh=l2ypu5YlW9CWMPkZmrwjgcd2IjIfU7LZ/QhuKeoEs5U=; b=RZhPg7bOXtCnLnhOnPvU31l6XXB2L3mNOEDisGfSglBCTAd29oMaVQfbWq6MOoAXduRzISDbH NW0AULX6Bm2Al+ajA/8kB5/HGXGgfc95jw0ePqdl+PFsRhAFn8QQDTP X-Developer-Key: i=forbidden405@outlook.com; a=ed25519; pk=qOD5jhp891/Xzc+H/PZ8LWVSWE3O/XCQnAg+5vdU2IU= X-Endpoint-Received: by B4 Relay for forbidden405@outlook.com/20230724 with auth_id=67 X-Original-From: Yang Xiwen Reply-To: From: Yang Xiwen Also rename to hisilicon,inno-usb2-phy.yaml and add this name to compatible lists. Signed-off-by: Yang Xiwen --- .../bindings/phy/hisilicon,inno-usb2-phy.yaml | 115 +++++++++++++++++= ++++ .../devicetree/bindings/phy/phy-hisi-inno-usb2.txt | 71 ------------- 2 files changed, 115 insertions(+), 71 deletions(-) diff --git a/Documentation/devicetree/bindings/phy/hisilicon,inno-usb2-phy.= yaml b/Documentation/devicetree/bindings/phy/hisilicon,inno-usb2-phy.yaml new file mode 100644 index 000000000000..73256eee10f9 --- /dev/null +++ b/Documentation/devicetree/bindings/phy/hisilicon,inno-usb2-phy.yaml @@ -0,0 +1,115 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/phy/hisilicon,inno-usb2-phy.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: HiSilicon HiSTB SoCs INNO USB2 PHY device + +maintainers: + - Yang Xiwen + +properties: + compatible: + minItems: 1 + items: + - enum: + - hisilicon,hi3798cv200-usb2-phy + - hisilicon,hi3798mv100-usb2-phy + - const: hisilicon,inno-usb2-phy + + reg: + maxItems: 1 + description: | + Should be the address space for PHY configuration register in periph= eral + controller, e.g. PERI_USB0 for USB 2.0 PHY01 on Hi3798CV200 SoC. + Or direct MMIO address space. + + '#address-cells': + const: 1 + + '#size-cells': + const: 0 + + clocks: + maxItems: 1 + description: reference clock + + resets: + maxItems: 1 + +patternProperties: + 'phy@[0-9a-f]+': + type: object + additionalProperties: false + description: individual ports provided by INNO PHY + + properties: + reg: + maxItems: 1 + + '#phy-cells': + const: 0 + + resets: + maxItems: 1 + + required: [reg, '#phy-cells', resets] + +required: + - compatible + - clocks + - reg + - '#address-cells' + - '#size-cells' + - resets + +additionalProperties: false + +examples: + - | + #include + + peripheral-controller@8a20000 { + compatible =3D "hisilicon,hi3798cv200-perictrl", "syscon", "simple= -mfd"; + reg =3D <0x8a20000 0x1000>; + #address-cells =3D <1>; + #size-cells =3D <1>; + ranges =3D <0x0 0x8a20000 0x1000>; + + usb2-phy@120 { + compatible =3D "hisilicon,hi3798cv200-usb2-phy"; + reg =3D <0x120 0x4>; + clocks =3D <&crg HISTB_USB2_PHY1_REF_CLK>; + resets =3D <&crg 0xbc 4>; + #address-cells =3D <1>; + #size-cells =3D <0>; + + phy@0 { + reg =3D <0>; + #phy-cells =3D <0>; + resets =3D <&crg 0xbc 8>; + }; + + phy@1 { + reg =3D <1>; + #phy-cells =3D <0>; + resets =3D <&crg 0xbc 9>; + }; + }; + + usb2-phy@124 { + compatible =3D "hisilicon,hi3798cv200-usb2-phy"; + reg =3D <0x124 0x4>; + clocks =3D <&crg HISTB_USB2_PHY2_REF_CLK>; + resets =3D <&crg 0xbc 6>; + #address-cells =3D <1>; + #size-cells =3D <0>; + + phy@0 { + reg =3D <0>; + #phy-cells =3D <0>; + resets =3D <&crg 0xbc 10>; + }; + }; + }; diff --git a/Documentation/devicetree/bindings/phy/phy-hisi-inno-usb2.txt b= /Documentation/devicetree/bindings/phy/phy-hisi-inno-usb2.txt deleted file mode 100644 index 104953e849e7..000000000000 --- a/Documentation/devicetree/bindings/phy/phy-hisi-inno-usb2.txt +++ /dev/null @@ -1,71 +0,0 @@ -Device tree bindings for HiSilicon INNO USB2 PHY - -Required properties: -- compatible: Should be one of the following strings: - "hisilicon,inno-usb2-phy", - "hisilicon,hi3798cv200-usb2-phy". -- reg: Should be the address space for PHY configuration register in perip= heral - controller, e.g. PERI_USB0 for USB 2.0 PHY01 on Hi3798CV200 SoC. -- clocks: The phandle and clock specifier pair for INNO USB2 PHY device - reference clock. -- resets: The phandle and reset specifier pair for INNO USB2 PHY device re= set - signal. -- #address-cells: Must be 1. -- #size-cells: Must be 0. - -The INNO USB2 PHY device should be a child node of peripheral controller t= hat -contains the PHY configuration register, and each device supports up to 2 = PHY -ports which are represented as child nodes of INNO USB2 PHY device. - -Required properties for PHY port node: -- reg: The PHY port instance number. -- #phy-cells: Defined by generic PHY bindings. Must be 0. -- resets: The phandle and reset specifier pair for PHY port reset signal. - -Refer to phy/phy-bindings.txt for the generic PHY binding properties - -Example: - -perictrl: peripheral-controller@8a20000 { - compatible =3D "hisilicon,hi3798cv200-perictrl", "simple-mfd"; - reg =3D <0x8a20000 0x1000>; - #address-cells =3D <1>; - #size-cells =3D <1>; - ranges =3D <0x0 0x8a20000 0x1000>; - - usb2_phy1: usb2-phy@120 { - compatible =3D "hisilicon,hi3798cv200-usb2-phy"; - reg =3D <0x120 0x4>; - clocks =3D <&crg HISTB_USB2_PHY1_REF_CLK>; - resets =3D <&crg 0xbc 4>; - #address-cells =3D <1>; - #size-cells =3D <0>; - - usb2_phy1_port0: phy@0 { - reg =3D <0>; - #phy-cells =3D <0>; - resets =3D <&crg 0xbc 8>; - }; - - usb2_phy1_port1: phy@1 { - reg =3D <1>; - #phy-cells =3D <0>; - resets =3D <&crg 0xbc 9>; - }; - }; - - usb2_phy2: usb2-phy@124 { - compatible =3D "hisilicon,hi3798cv200-usb2-phy"; - reg =3D <0x124 0x4>; - clocks =3D <&crg HISTB_USB2_PHY2_REF_CLK>; - resets =3D <&crg 0xbc 6>; - #address-cells =3D <1>; - #size-cells =3D <0>; - - usb2_phy2_port0: phy@0 { - reg =3D <0>; - #phy-cells =3D <0>; - resets =3D <&crg 0xbc 10>; - }; - }; -}; --=20 2.43.0 From nobody Sun Feb 8 18:43:42 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C310712F58A; Fri, 16 Feb 2024 15:21:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708096887; cv=none; b=l7aB08gyjgzYt/iNkLRnKmSdlQvb28P6EjxehXcMJ5uaRW7lP8uenA85a46wZuAAL/oFKw9DeVLB/5m2tHTs8f/J/oY/GkBg5hfbjaqyFmB4rYT+OvwCTHHikWy8wlI8BWnBcGvW0/PwtFfAmR4RXUzQmUwIn1Ppnzy7UQFv0fw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708096887; c=relaxed/simple; bh=esSfqR/EN2uGgQJhZInB3gQ5IgggyIpQkCwvAPI4KIE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=uFZLKt+OhgSGpVuokKlv0NR3wjiUpW4At2WiCfL7DsQB8mHhnfU8lMV5rV7rL8a8/4d1pAP22YGzP++F1vV9O5LQiHq1GQ9IZ32NuT7cKzLz5xEGADToCVXCXYdCyaS+O72JtB5Ui0q7zujmjQPknavwK6tzueXA0MT/Sa6Hzdc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ksU4hZnh; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ksU4hZnh" Received: by smtp.kernel.org (Postfix) with ESMTPS id 5D19AC43390; Fri, 16 Feb 2024 15:21:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708096887; bh=esSfqR/EN2uGgQJhZInB3gQ5IgggyIpQkCwvAPI4KIE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=ksU4hZnhGFY/DpaonfNqIcpv7UidugyR75F1sQOQNhkbyxnTCEOUOW5eq1CVXstPf /bhZwdJThzwPWzyi6uwkEDiuo8SLUwUSDaGJ2x+1xQZcpLGndGox8zoRP6TZCJcmDq oPwaSW5cElsGXj+mrWIuJYSBFBjia+XFr3IUHlSgmF/VezNJKNKiwHbczxKQjeOqKZ /9k2DDFKD0/1W/3DFd/KuF/udubvA+GUrl+f9lMw7xvxZrIaTFU4dlmhjhHzsVGlvM d7KCKu/bnu1VGvn4lu93z2NlumZQyvsRhFxkFv9EiigvME5tVYNu1erdAx4PiQqU9M YL6+KZPvu8mHQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 453B0C48BEF; Fri, 16 Feb 2024 15:21:27 +0000 (UTC) From: Yang Xiwen via B4 Relay Date: Fri, 16 Feb 2024 23:21:02 +0800 Subject: [PATCH RFC 2/4] phy: hisilicon: enable clocks for every ports Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240216-inno-phy-v1-2-1ab912f0533f@outlook.com> References: <20240216-inno-phy-v1-0-1ab912f0533f@outlook.com> In-Reply-To: <20240216-inno-phy-v1-0-1ab912f0533f@outlook.com> To: Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jiancheng Xue , Pengcheng Li , Shawn Guo Cc: linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Kishon Vijay Abraham I , David Yang , Yang Xiwen X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1708096886; l=971; i=forbidden405@outlook.com; s=20230724; h=from:subject:message-id; bh=jGUbESXsyAvU27nkXjLoTOKtwqcjOT068eM8RNJCWfs=; b=ITanD2VY3jqLkr3V4AaluZ6h9nWHCdy3Na9jDZgUch40We/Y5Xqui1gOxijFrPIN7OP9s0KLu y967I7P63k6BFsOonwkTg3pWZVrf4mwUOvGffTMiP+h2VMI1SMATgVs X-Developer-Key: i=forbidden405@outlook.com; a=ed25519; pk=qOD5jhp891/Xzc+H/PZ8LWVSWE3O/XCQnAg+5vdU2IU= X-Endpoint-Received: by B4 Relay for forbidden405@outlook.com/20230724 with auth_id=67 X-Original-From: Yang Xiwen Reply-To: From: Yang Xiwen This is needed for port1 to work. Fixes: ba8b0ee81fbb ("phy: add inno-usb2-phy driver for hi3798cv200 SoC") Signed-off-by: Yang Xiwen --- drivers/phy/hisilicon/phy-hisi-inno-usb2.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/phy/hisilicon/phy-hisi-inno-usb2.c b/drivers/phy/hisil= icon/phy-hisi-inno-usb2.c index c138cd4807d6..b7e740eb4752 100644 --- a/drivers/phy/hisilicon/phy-hisi-inno-usb2.c +++ b/drivers/phy/hisilicon/phy-hisi-inno-usb2.c @@ -86,8 +86,10 @@ static void hisi_inno_phy_write_reg(struct hisi_inno_phy= _priv *priv, =20 static void hisi_inno_phy_setup(struct hisi_inno_phy_priv *priv) { + int i; /* The phy clk is controlled by the port0 register 0x06. */ - hisi_inno_phy_write_reg(priv, 0, 0x06, PHY_CLK_ENABLE); + for (i =3D 0; i < INNO_PHY_PORT_NUM; i++) + hisi_inno_phy_write_reg(priv, i, 0x06, PHY_CLK_ENABLE); msleep(PHY_CLK_STABLE_TIME); } =20 --=20 2.43.0 From nobody Sun Feb 8 18:43:42 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C314512F590; Fri, 16 Feb 2024 15:21:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708096887; cv=none; b=Y/XHDAx2ON+Pe7l39jAeiWygHppEoTWx0k3i9sD7YH1UCY8g9PjXDJYcZJsu4RvIhGxYMItaQW+J1qY+LNa/beikXX++OHrvm7FEwOhrvZnhlv+MevRRtziWAWVuvHSIkCAmCN22xN2sZp36n1OuyX4hmvkQW+6hqv2FQGxkybI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708096887; c=relaxed/simple; bh=VZRY9XMcrLAgmTWhll1wn7de+3/sRUO6L2Lrel3FpI4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=gPqKCXtV40olTZSb5PnjFldVGf5q04UpzVa8Yp0MzjeHs9jRrRa8ejeYGzq4xTKJkktSifLSShtNg20J5digjRqtnTYx+WaHypmv30y3tfU7sHogTPucfPXuK6Abz0HuH5l3XVgHhKZYu0UDjfHyF/2Uy5Q8oYcVjK+YUIQMbhI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=MYUmG14Y; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="MYUmG14Y" Received: by smtp.kernel.org (Postfix) with ESMTPS id 6FAF9C43399; Fri, 16 Feb 2024 15:21:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708096887; bh=VZRY9XMcrLAgmTWhll1wn7de+3/sRUO6L2Lrel3FpI4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=MYUmG14Y6GAR7dXeLLMyO/HceOQZTMXcdhkW2OLPis21rUNEunHY1VX/sfoEyQKGt /GBdMNvLiaomKDwHrA+o6jfiJw4eRVCkY7s9EQ9S/Sp5DVRq6jC8PRbeSwbBBdwZpl MjMvtr5EMjIy8005XVToeJwH/MpFyoQ1tmz5Fn/Dbp2UElV6dfjZBjqEyj1XyGcwqQ HaoOqwkaObYZjBL1rJHLCmPE045/5JUT9XTQ/5Zl/C+btb15kresMHFWFAq3wa+0Bb gMmIU74Ie0gmEdLyNrka4Dv3sWwDn/f0FSJMsX7Ord0u0MiA79XHAhc3FB3GIDc4z6 bg2r6ydx+kupA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4F61FC48BF6; Fri, 16 Feb 2024 15:21:27 +0000 (UTC) From: Yang Xiwen via B4 Relay Date: Fri, 16 Feb 2024 23:21:03 +0800 Subject: [PATCH RFC 3/4] phy: hisi-inno-usb2: add support for direct MMIO Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240216-inno-phy-v1-3-1ab912f0533f@outlook.com> References: <20240216-inno-phy-v1-0-1ab912f0533f@outlook.com> In-Reply-To: <20240216-inno-phy-v1-0-1ab912f0533f@outlook.com> To: Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jiancheng Xue , Pengcheng Li , Shawn Guo Cc: linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Kishon Vijay Abraham I , David Yang , Yang Xiwen X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1708096886; l=3548; i=forbidden405@outlook.com; s=20230724; h=from:subject:message-id; bh=vlXiKqsLZeXsfy+2X2tFbKV08QHZormBiBHhDir/Zg8=; b=PvrXOIVdC8a36f4CWMQWiDK4swW9T8EN05s/5LxcRoeUztInX+RUWn2ky2HoAJtxOFlS6uM64 yd2w5HpwpGgAkRRgHzbqCMWE3hQipcLwTE0595hdjY5aZZupxZNjCY0 X-Developer-Key: i=forbidden405@outlook.com; a=ed25519; pk=qOD5jhp891/Xzc+H/PZ8LWVSWE3O/XCQnAg+5vdU2IU= X-Endpoint-Received: by B4 Relay for forbidden405@outlook.com/20230724 with auth_id=67 X-Original-From: Yang Xiwen Reply-To: From: Yang Xiwen This method of resgiter access is used by Hi3798MV200. For other models, of_iomap() returns 0 due to insufficient length. So they are unaffected. Signed-off-by: Yang Xiwen --- drivers/phy/hisilicon/phy-hisi-inno-usb2.c | 53 +++++++++++++++++++-------= ---- 1 file changed, 33 insertions(+), 20 deletions(-) diff --git a/drivers/phy/hisilicon/phy-hisi-inno-usb2.c b/drivers/phy/hisil= icon/phy-hisi-inno-usb2.c index b7e740eb4752..12a158fb749c 100644 --- a/drivers/phy/hisilicon/phy-hisi-inno-usb2.c +++ b/drivers/phy/hisilicon/phy-hisi-inno-usb2.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -43,6 +44,7 @@ #define PHY_CLK_ENABLE BIT(2) =20 struct hisi_inno_phy_port { + void __iomem *base; struct reset_control *utmi_rst; struct hisi_inno_phy_priv *priv; }; @@ -62,26 +64,31 @@ static void hisi_inno_phy_write_reg(struct hisi_inno_ph= y_priv *priv, u32 val; u32 value; =20 - if (priv->type =3D=3D PHY_TYPE_0) - val =3D (data & PHY_TEST_DATA) | - ((addr << PHY_TEST_ADDR_OFFSET) & PHY0_TEST_ADDR) | - ((port << PHY0_TEST_PORT_OFFSET) & PHY0_TEST_PORT) | - PHY0_TEST_WREN | PHY0_TEST_RST; - else - val =3D (data & PHY_TEST_DATA) | - ((addr << PHY_TEST_ADDR_OFFSET) & PHY1_TEST_ADDR) | - ((port << PHY1_TEST_PORT_OFFSET) & PHY1_TEST_PORT) | - PHY1_TEST_WREN | PHY1_TEST_RST; - writel(val, reg); - - value =3D val; - if (priv->type =3D=3D PHY_TYPE_0) - value |=3D PHY0_TEST_CLK; - else - value |=3D PHY1_TEST_CLK; - writel(value, reg); - - writel(val, reg); + if (priv->ports[port].base) + // stride is 4 + writel(data, (u32 *)priv->ports[port].base + addr); + else { + if (priv->type =3D=3D PHY_TYPE_0) + val =3D (data & PHY_TEST_DATA) | + ((addr << PHY_TEST_ADDR_OFFSET) & PHY0_TEST_ADDR) | + ((port << PHY0_TEST_PORT_OFFSET) & PHY0_TEST_PORT) | + PHY0_TEST_WREN | PHY0_TEST_RST; + else + val =3D (data & PHY_TEST_DATA) | + ((addr << PHY_TEST_ADDR_OFFSET) & PHY1_TEST_ADDR) | + ((port << PHY1_TEST_PORT_OFFSET) & PHY1_TEST_PORT) | + PHY1_TEST_WREN | PHY1_TEST_RST; + writel(val, reg); + + value =3D val; + if (priv->type =3D=3D PHY_TYPE_0) + value |=3D PHY0_TEST_CLK; + else + value |=3D PHY1_TEST_CLK; + writel(value, reg); + + writel(val, reg); + } } =20 static void hisi_inno_phy_setup(struct hisi_inno_phy_priv *priv) @@ -167,6 +174,7 @@ static int hisi_inno_phy_probe(struct platform_device *= pdev) for_each_child_of_node(np, child) { struct reset_control *rst; struct phy *phy; + void __iomem *base; =20 rst =3D of_reset_control_get_exclusive(child, NULL); if (IS_ERR(rst)) { @@ -174,7 +182,10 @@ static int hisi_inno_phy_probe(struct platform_device = *pdev) return PTR_ERR(rst); } =20 + base =3D of_iomap(child, 0); + priv->ports[i].utmi_rst =3D rst; + priv->ports[i].base =3D base; priv->ports[i].priv =3D priv; =20 phy =3D devm_phy_create(dev, child, &hisi_inno_phy_ops); @@ -205,6 +216,8 @@ static const struct of_device_id hisi_inno_phy_of_match= [] =3D { .data =3D (void *) PHY_TYPE_0 }, { .compatible =3D "hisilicon,hi3798mv100-usb2-phy", .data =3D (void *) PHY_TYPE_1 }, + { .compatible =3D "hisilicon,hi3798mv200-usb2-phy", + .data =3D (void *) PHY_TYPE_0 }, { }, }; MODULE_DEVICE_TABLE(of, hisi_inno_phy_of_match); --=20 2.43.0 From nobody Sun Feb 8 18:43:42 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C317B12F5AF; Fri, 16 Feb 2024 15:21:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708096887; cv=none; b=UwRdUTNKSGZOJSZ7Jgs6GsH6Pm/zh/gaY8w9wc2Co0R2PKrp14xpTZdKyu4NuzNGJDaxvyJ3lMNe28BraTrsq1Ny9ZR7vFBOpq5h+lEjhU9G8y+AC8JcXTKdt0i+lhjrCXPrLNKe2T4umUK3866nYhExqqFSoR4O/xYQeJjz2yA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708096887; c=relaxed/simple; bh=TJXbzU7JZHJbMmgN7bpYmAVa1HZD9kd+YoDIdRJkXjw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=m6PZnYbQ1/Wr/5Es+6gtOVjr75yoMw+hd8c9iIHkg8uT+XAVORQsv2uwtjaKK7ShikxUyiezUrV2h6frde8sEtnUxLCgurZpmNeXMfLO88iUsKfnWFcrfp5JjAk9yhQNLPhmKOabRUsmQzi7Szaa/kmU6dlOmNRqY1Y075SyAwg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WCHjbjmK; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WCHjbjmK" Received: by smtp.kernel.org (Postfix) with ESMTPS id 74B98C43330; Fri, 16 Feb 2024 15:21:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708096887; bh=TJXbzU7JZHJbMmgN7bpYmAVa1HZD9kd+YoDIdRJkXjw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=WCHjbjmKO6YpsXPAvIB3jwb70NDs1r6NM0Ewj2I1BTJ2Q7CnZqrkgf0v6TgMJebGJ MUZopDAm7uPE2TaxE63eESFuEB741w59iP4kpGunq/m/dx4E9VFpRQ4FduuhFjLmth oEtqTj3SMp8LIUFHqZwDN55PTsWuuhWH1NOuCRTHDXpkpwE2QtnrZBhDpwdcMIDl6e t74fVs2nVzHdn68cuA5y0+r0+g4+mHeyDjO+tqgZ1kVOGGnd2OIK4u679civO6qpyk 6LJlbaUjlRGsY8tqAXNbcHptBu6lZjYMTWPLX4ZYIcdbkBjK+ywj5rdM24u3AhkGak nkb7j28cF9RFQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59CADC48BF5; Fri, 16 Feb 2024 15:21:27 +0000 (UTC) From: Yang Xiwen via B4 Relay Date: Fri, 16 Feb 2024 23:21:04 +0800 Subject: [PATCH RFC 4/4] dt-binding: phy: hisi-inno-usb2: add compatible of hisilicon,hi3798mv200-usb2-phy Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240216-inno-phy-v1-4-1ab912f0533f@outlook.com> References: <20240216-inno-phy-v1-0-1ab912f0533f@outlook.com> In-Reply-To: <20240216-inno-phy-v1-0-1ab912f0533f@outlook.com> To: Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jiancheng Xue , Pengcheng Li , Shawn Guo Cc: linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Kishon Vijay Abraham I , David Yang , Yang Xiwen X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1708096886; l=1106; i=forbidden405@outlook.com; s=20230724; h=from:subject:message-id; bh=rtHmhLoIl6mBEauH6cAKAA937JKk+tiYVqJ8GZyksSY=; b=CgorBV2nYcl95Vm5KnS8MREH8rEe9KkH0P/N7GKmgaLXjwaD3aDCrLwkQ6JOuju+7zmYqBWr0 3U5xWGbglDxAsFtxFZYVxT810mAEkzarmD0QzBM6T5DwTQUoJwGkI5Y X-Developer-Key: i=forbidden405@outlook.com; a=ed25519; pk=qOD5jhp891/Xzc+H/PZ8LWVSWE3O/XCQnAg+5vdU2IU= X-Endpoint-Received: by B4 Relay for forbidden405@outlook.com/20230724 with auth_id=67 X-Original-From: Yang Xiwen Reply-To: From: Yang Xiwen It is accessed by direct MMIO, making "ranges" property mandatory for it. Signed-off-by: Yang Xiwen --- .../devicetree/bindings/phy/hisilicon,inno-usb2-phy.yaml | 10 ++++++= ++++ 1 file changed, 10 insertions(+) diff --git a/Documentation/devicetree/bindings/phy/hisilicon,inno-usb2-phy.= yaml b/Documentation/devicetree/bindings/phy/hisilicon,inno-usb2-phy.yaml index 73256eee10f9..d702878b8e6e 100644 --- a/Documentation/devicetree/bindings/phy/hisilicon,inno-usb2-phy.yaml +++ b/Documentation/devicetree/bindings/phy/hisilicon,inno-usb2-phy.yaml @@ -16,6 +16,7 @@ properties: - enum: - hisilicon,hi3798cv200-usb2-phy - hisilicon,hi3798mv100-usb2-phy + - hisilicon,hi3798mv200-usb2-phy - const: hisilicon,inno-usb2-phy =20 reg: @@ -64,6 +65,15 @@ required: - '#size-cells' - resets =20 +if: + properties: + compatible: + contains: + const: hisilicon,hi3798mv200-inno-usb2-phy +then: + required: + - ranges + additionalProperties: false =20 examples: --=20 2.43.0