From patchwork Mon Jul 20 18:51:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1522 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id A987B3F080 for ; Mon, 20 Jul 2020 20:52:29 +0200 (CEST) Received: by mail-pl1-f199.google.com with SMTP id c15sf10967047plz.15 for ; Mon, 20 Jul 2020 11:52:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1595271148; cv=pass; d=google.com; s=arc-20160816; b=Sr9kib5rVpKx3varsCJGEbW3LdNyOapTvI77PYzP8Qkr1kl12Uo7SHmrNkGLioAQFK RNBQ/0E0b0M+bMzKJH4CN1e6aDKFxcfk5EKzb8Sn1H4Fhs2CDFtMNagtfMZGjh/A4ibc 0nHugswwcPt5gspWfny7z+9rS0TNXPO2f5gtPj/0P8VcuOkSuMdvzGeQ+A+2KRlHHveX 1N97+8vVQ4h0xLh5Zg6wvZj3W8RZASHyYpoP4RltPkqqcLP7MkmCQ5zoq1cqe6kF/ou9 LSzKtVNdeiwxFQG7xWV3xKzvnJkFLbhKf4HGwhcDNGNuabfmrMJ94MuusBcT16v3mV4j pUJg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=31d5hSidliw6xwlrEi9HuZzxsxa9we8LElh71Z1YMlc=; b=SXPumbjpjc+VA9r7MI5REUPv7dHIUkRBo6qmL+cR3osOtSc4iz0uaWCH/PyJg9CDVj Yps5FSiTyh3UJXT8wuZ+W6diKSUCz0gBlLeDyLuBHhZpelGHo2QdgDbVKSW5TA9PEgLD DlvyzARxikRbq3ifRvQO5wDgtdRCURdcn3pAgekm5//+rlWOliAr/JIAtBH3H9zfi2CP 38G+KgfcdpUzX377mVYn66KgJYDlPPUkP8WT85jWzSofKA+kLMtar14hbc2wvlED5pmE IxLIDAkSLgH7wonyeeRwgzK+J1aXrLQ6RhO62nOPCmMNE3wReDMH9qiofdb0VFc0FM+F fyAQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=p9VbagpC; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=31d5hSidliw6xwlrEi9HuZzxsxa9we8LElh71Z1YMlc=; b=HtXsH53S6fK3yMwJtHRDxXbuF6fq6i46jwwRROZ7sIQx+AZV8UdWLFyDowHL6YPKoh j8UndmrcAIHoI9afQ9ZSq1+VY6jdC1Gbk2wh5dFvlX0cqxfRo4YV+T6FIkzUvFFnepEV wLud8Nj/yee3NyUcnXL3LHbgACS8KC9fUZCog= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=31d5hSidliw6xwlrEi9HuZzxsxa9we8LElh71Z1YMlc=; b=cEa+zi4S2NycVQTraGhPOxQBtYtCuoc7D95NKvk88wFiCrgmV/8e0XmicI5j+KjC+9 j+/ZEtzxayWKQ5YHY4GjWNeWFVtt7Ut36JRXJgrVGfwTR8yFA26O9lYIbUweyN5XsmQk lPWxnq/E55ye2u4cJXNMYj7216NOR2X+ooeo0SROJak1kSJF4OfXurT0UWI9uU9/xis1 pUzj9BZOhjk425Hw4m3l+y+gfUjFl2KAmyVdrRitVXNXEL7nDAfwDToOMJHvYSSnpZCJ vQviUd5A73+4H6GO8h+C67ZqW6s7Tj5j4RJJC20t8QtN7GsD3UqARXe+0nEysEyf+pns oikg== X-Gm-Message-State: AOAM53173fye13IhGKsScbbOzoGu5Itta+w8N9NC5HXCsbPnCBaAopPu TIdby/DRv9pTsSiO3aB+lx0wKBLh X-Google-Smtp-Source: ABdhPJx6+vq9cuDfVweVBdGUNbyBkBen4pFFC/Wh6INy9MKbLtq21FsGWtB2m/c95rv5LnZpAlCU5g== X-Received: by 2002:a17:90a:c68e:: with SMTP id n14mr771196pjt.182.1595271148350; Mon, 20 Jul 2020 11:52:28 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a63:525b:: with SMTP id s27ls2088609pgl.11.gmail; Mon, 20 Jul 2020 11:52:28 -0700 (PDT) X-Received: by 2002:aa7:87c7:: with SMTP id i7mr20893012pfo.174.1595271147851; Mon, 20 Jul 2020 11:52:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595271147; cv=none; d=google.com; s=arc-20160816; b=hAmUQig0LACF15rGyJYgF9udc2omRXjEWbRQnOvwlw8GwAw0YRbhCcSP2Ou1xHE5p6 BwIeMWE8nmH0MEXm0EDljUxv84MsbX49KHpLoNNute13njt3LApMZAxHyFScUIKr0RFO JlUOZkIEprev44cMgpeHC/txuj3F4go/w9N/RN5HWqLZXTJAbYvWUaXX1GSYU8Pr17BK 9Y5ZnXhoNorK/FEMS55/uOlYcjXqyfCxKRzobii/0CcW98rE6KtTf1OvIInIi6YTN/Zq uYxSb1bzqPJJT3Y1fnYMcBveNF2tBstCYp+UlgLKD+akIjI81/sEPZo4VG3SABlmCJZ1 +J6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=JbtJJMPgoB6j63CRE61wXPJk6E6voEAVjADjkplQs8Q=; b=ZLHFH6GqwVEbg07s8IRwvv6uhyy49qXRIZz9wXpAsfbF53uxpbEd0V43XXRPPSHJib RIjmLoXJVyFElmDwJCvpu6Ku0P3uw7ZA3sNa55IPXp8hlfTvWkmkrOcbieRfFMnEdBYn Yh+E8SN7ClvtAsdmFjKSs9FChag7Jfu7cesgc8iX8H+yI+gZw3J06bWUTBXnUAjNUf97 Zw0bdv3BbXLh2ecmiAZUX5AW0R/o/8C9M8AjEjEVUmtR9B1T0uYU7F5QSTv1CS/7ICeS 6zDGDzsBtwmuJjO+Ec3PeZA5S57kHRBuwcP49mvBk9SI+lrWHlcQsRJhv27ky/NynIXz MO8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=p9VbagpC; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id my14sor585077pjb.1.2020.07.20.11.52.27 for (Google Transport Security); Mon, 20 Jul 2020 11:52:27 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a17:90a:3567:: with SMTP id q94mr811994pjb.226.1595271147533; Mon, 20 Jul 2020 11:52:27 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:8c21:db7b:4558:fba3]) by smtp.gmail.com with ESMTPSA id m9sm306649pjs.18.2020.07.20.11.52.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jul 2020 11:52:26 -0700 (PDT) From: Jagan Teki To: Kever Yang , Philipp Tomsich , Simon Glass Cc: Suniel Mahesh , U-Boot-Denx , linux-rockchip@lists.infradead.org, linux-amarula , Jagan Teki Subject: [PATCH 04/16] ARM: dts: rockchip: Add USB for RockPI N8/N10 Date: Tue, 21 Jul 2020 00:21:08 +0530 Message-Id: <20200720185120.671064-5-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200720185120.671064-1-jagan@amarulasolutions.com> References: <20200720185120.671064-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=p9VbagpC; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Radxa dalang carrier board has 2x USB 2.0 and 1x USB 3.0 ports. This patch adds support to enable all these USB ports for N10 and N8 combinations SBCs. Note that the USB 3.0 port on RockPI N8 combination works as USB 2.0 OTG since it is driven from RK3288. Signed-off-by: Jagan Teki --- arch/arm/dts/rk3288-vmarc-som.dtsi | 42 ++++++++++ arch/arm/dts/rk3399pro-vmarc-som.dtsi | 78 +++++++++++++++++++ .../dts/rockchip-radxa-dalang-carrier.dtsi | 18 +++++ 3 files changed, 138 insertions(+) diff --git a/arch/arm/dts/rk3288-vmarc-som.dtsi b/arch/arm/dts/rk3288-vmarc-som.dtsi index 7a9fd40e5b..72a503e50d 100644 --- a/arch/arm/dts/rk3288-vmarc-som.dtsi +++ b/arch/arm/dts/rk3288-vmarc-som.dtsi @@ -258,4 +258,46 @@ rockchip,pins = <6 RK_PC5 1 &pcfg_pull_up_drv_8ma>; }; }; + + vbus_host { + usb1_en_oc: usb1-en-oc { + rockchip,pins = <0 RK_PC1 RK_FUNC_GPIO &pcfg_pull_up>; + }; + }; + + vbus_typec { + usb0_en_oc: usb0-en-oc { + rockchip,pins = <0 RK_PB5 RK_FUNC_GPIO &pcfg_pull_up>; + }; + }; +}; + +&usbphy { + status = "okay"; +}; + +&usb_host0_ehci { + status = "okay"; +}; + +&usb_host0_ohci { + status = "okay"; +}; + +&usb_host1 { + status = "okay"; +}; + +&usb_otg { + status = "okay"; +}; + +&vbus_host { + enable-active-high; + gpio = <&gpio0 RK_PC1 GPIO_ACTIVE_HIGH>; /* USB1_EN_OC# */ +}; + +&vbus_typec { + enable-active-high; + gpio = <&gpio0 RK_PB5 GPIO_ACTIVE_HIGH>; /* USB0_EN_OC# */ }; diff --git a/arch/arm/dts/rk3399pro-vmarc-som.dtsi b/arch/arm/dts/rk3399pro-vmarc-som.dtsi index 37ed95d5f7..111d6cf9a4 100644 --- a/arch/arm/dts/rk3399pro-vmarc-som.dtsi +++ b/arch/arm/dts/rk3399pro-vmarc-som.dtsi @@ -304,6 +304,18 @@ rockchip,pins = <1 RK_PC2 0 &pcfg_pull_up>; }; }; + + vbus_host { + usb1_en_oc: usb1-en-oc { + rockchip,pins = <4 RK_PD1 RK_FUNC_GPIO &pcfg_pull_up>; + }; + }; + + vbus_typec { + usb0_en_oc: usb0-en-oc { + rockchip,pins = <4 RK_PD2 RK_FUNC_GPIO &pcfg_pull_up>; + }; + }; }; &pmu_io_domains { @@ -324,8 +336,74 @@ max-frequency = <150000000>; }; +&tcphy0 { + status = "okay"; +}; + &tsadc { rockchip,hw-tshut-mode = <1>; rockchip,hw-tshut-polarity = <1>; status = "okay"; }; + +&u2phy0 { + status = "okay"; + + u2phy0_otg: otg-port { + phy-supply = <&vbus_typec>; + status = "okay"; + }; + + u2phy0_host: host-port { + phy-supply = <&vbus_host>; + status = "okay"; + }; +}; + + +&u2phy1 { + status = "okay"; + + u2phy1_host: host-port { + phy-supply = <&vbus_host>; + status = "okay"; + }; +}; + +&usb_host0_ehci { + status = "okay"; +}; + +&usb_host0_ohci { + status = "okay"; +}; + +&usb_host1_ehci { + status = "okay"; +}; + +&usb_host1_ohci { + status = "okay"; +}; + +&usbdrd3_0 { + status = "okay"; +}; + +&usbdrd_dwc3_0 { + status = "okay"; +}; + +&vbus_host { + enable-active-high; + gpio = <&gpio4 RK_PD1 GPIO_ACTIVE_HIGH>; /* USB1_EN_OC# */ + pinctrl-names = "default"; + pinctrl-0 = <&usb1_en_oc>; +}; + +&vbus_typec { + enable-active-high; + gpio = <&gpio4 RK_PD2 GPIO_ACTIVE_HIGH>; /* USB0_EN_OC# */ + pinctrl-names = "default"; + pinctrl-0 = <&usb0_en_oc>; +}; diff --git a/arch/arm/dts/rockchip-radxa-dalang-carrier.dtsi b/arch/arm/dts/rockchip-radxa-dalang-carrier.dtsi index 450e5bb5af..d2b6ead148 100644 --- a/arch/arm/dts/rockchip-radxa-dalang-carrier.dtsi +++ b/arch/arm/dts/rockchip-radxa-dalang-carrier.dtsi @@ -33,6 +33,24 @@ regulator-max-microvolt = <5000000>; vin-supply = <&vcc12v_dcin>; }; + + vbus_host: vbus-host { + compatible = "regulator-fixed"; + pinctrl-names = "default"; + pinctrl-0 = <&usb1_en_oc>; + regulator-name = "vbus_host"; /* HOST-5V */ + regulator-always-on; + vin-supply = <&vcc5v0_sys>; + }; + + vbus_typec: vbus-typec { + compatible = "regulator-fixed"; + pinctrl-names = "default"; + pinctrl-0 = <&usb0_en_oc>; + regulator-name = "vbus_typec"; + regulator-always-on; + vin-supply = <&vcc5v0_sys>; + }; }; &gmac {