From patchwork Fri May 14 15:00:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Schramm X-Patchwork-Id: 12258013 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EFCDBC433ED for ; Fri, 14 May 2021 15:00:12 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6883F61166 for ; Fri, 14 May 2021 15:00:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6883F61166 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=manjaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=DCakv/uqjt5YV9h7eZABWwcEP02uVAq1FgbKE7IlPvo=; b=cfz59McqRq/Jnzyxs5ZqfL/9B ZvjT8LZIXtQQiwyyVh65ypIQlx1LelyLQL5upreT7dJDY/G6w9B3O4tMwjzK7zJInXhEgc89pz/Ml GFRBBROOacaFjd6HDzweKMSPRGgEGYxOIYoWgZTlVjDUkDqQV+mbxxOV8GLlhksuTNvzXvlsByjcR wl8NUOSlLTpxNkG25SKDYNyiGAMx5me0bV0op4kQOzn6TAia6wwqsZoyV1XHwqGgCH7mxM/Ag5jTI tC3JcTreh0fUVgzylzbY14Ej8fnCme2xdxOED3Z/frr1sO5ejm10kvBGxwHv9Ie1Yfd0r8OfZyVU0 nW+rz8ZIA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lhZIK-008M3K-Ng; Fri, 14 May 2021 15:00:04 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lhZHv-008Lyx-4x; Fri, 14 May 2021 14:59:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=4AIjOIjK8U6rD3QXZW3Vzh+OKNjFkX209TXootJ4H/o=; b=k8wBGb7ivhotEn4qllywVH1NCp FHClFF+CFfkUgL8MKa7j0u7uBTnmTaRIn1RbpjsFTpBCZphw2DHuUsIwul1IDyFVvv2ZnQL6rRL1N vUMMmTSHyAatNQPL/y9F2SnccrYQtY+12DTkYvyy/U5CjtaDvENvXW4QprgGLb5PpmLe8gWEY6SZw LDSQabRQ/qFQby/10mntxNH2K159B35AnY5sSWGUxoWK3qoIvLmb88+pXYWIqggP5EHFtA+5meTKD h9lCEPcO0/a6PSmCjnALAa8GnJcQk731m1wExdCMexJ7HAUWIfSCKpfCw1LKoNhQwHjkqK6gdGwIG r2TX+U7A==; Received: from mail.manjaro.org ([2a01:4f8:150:448b::1]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lhZHs-00C43p-II; Fri, 14 May 2021 14:59:37 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.manjaro.org (Postfix) with ESMTP id 6DCE1222575; Fri, 14 May 2021 16:59:34 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at manjaro.org Received: from mail.manjaro.org ([127.0.0.1]) by localhost (manjaro.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mfS1E6guK9J1; Fri, 14 May 2021 16:59:30 +0200 (CEST) From: Tobias Schramm To: linux-usb@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-phy@lists.infradead.org, devicetree@vger.kernel.org Cc: Johan Jonker , Rob Herring , Heiko Stuebner , Kishon Vijay Abraham I , Vinod Koul , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Tobias Schramm Subject: [PATCH v2 1/5] dt-bindings: phy: rockchip-inno-usb2: add compatible for rk3308 USB phy Date: Fri, 14 May 2021 17:00:40 +0200 Message-Id: <20210514150044.2099298-2-t.schramm@manjaro.org> In-Reply-To: <20210514150044.2099298-1-t.schramm@manjaro.org> References: <20210514150044.2099298-1-t.schramm@manjaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210514_075936_794764_E926978B X-CRM114-Status: UNSURE ( 7.83 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org The RK3308 features a slightly different USB phy than other Rockchip SoCs. This patch adds a compatible string for it. Signed-off-by: Tobias Schramm Acked-by: Rob Herring --- .../devicetree/bindings/phy/phy-rockchip-inno-usb2.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.yaml b/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.yaml index fb29ad807b68..a5b027a6e70f 100644 --- a/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.yaml +++ b/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.yaml @@ -14,6 +14,7 @@ properties: enum: - rockchip,px30-usb2phy - rockchip,rk3228-usb2phy + - rockchip,rk3308-usb2phy - rockchip,rk3328-usb2phy - rockchip,rk3366-usb2phy - rockchip,rk3399-usb2phy From patchwork Fri May 14 15:00:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Schramm X-Patchwork-Id: 12258017 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 785AAC43461 for ; Fri, 14 May 2021 15:00:50 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DE58B6144C for ; Fri, 14 May 2021 15:00:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DE58B6144C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=manjaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=5Uxlpf5M0Mc7/pzf/gcQ+4Ss84sXss64UCSEqWF9BFM=; b=K4RWZWRHZmkaL5Lj0LkC18Uj0 ZDRuDO84jZVE+9qAVhY4QwzRKajmuyd6TJyLyUgrJoMtI/gPpoBqQbfzZQ8EpY72H8Geo++dz92Md TosrZGw1iA+7KIrJP58XA75PybEovOReEhEOBpi8RgcenVx9tEb5MM1hA1T/Du5P6tHF5j7iYamA0 CSI77ds5hI0wB1qjveJlP97by4TBto3PvnDZz+0HfdDt1kF/LSCr4WzvshxJ7uWGLR71nU/rb8qWN UkkUQzEAvflXVr/KB2pbxfhy/HHV2nmmmNq1ETiHMNh4hJTWYUCNX4uWoraVdx2IfiBMmaV8V+gSe EmaCfmb7A==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lhZIx-008MCj-KK; Fri, 14 May 2021 15:00:43 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lhZHw-008LzD-Ap; Fri, 14 May 2021 14:59:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=9qosxxRkbPLtQiOVsNhwEK6fg8bGFYtMyBg7cyxHEfs=; b=hsPXvcSXBG/05zHWk5sIIEkjkN b1iuUXzX66CvqF/7QOes6dVmL4AoGZenRiT6JaQ4tUZLOVrY5wZvf5vAGClygC/T9GM12DMaPhc2g K9vQTaKBpC1ZzCQC0V9rdx+xyhoAYAqnFcZU+Ap9WjHVU1tA+WmtBOrIaa+TkCLlUItoaaih1IS5Q PJqJXQh2ZQ3UUrf+x5hAxshEmd+SfRmOSQVR9ZRawrH34KtF0LV21RzZ3Cg13o9qOIhCVtZUYd+MC 7DX3OY6Znpee/kMlCdD2ETkFftqG75aZsn5Ge3xqlOOcJywqh47LNbPbmPIfVmz3fp0yKnq9SpJ7d FZ/jMaPQ==; Received: from mail.manjaro.org ([2a01:4f8:150:448b::1]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lhZHs-00C43n-IH; Fri, 14 May 2021 14:59:39 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.manjaro.org (Postfix) with ESMTP id B11A2220901; Fri, 14 May 2021 16:59:33 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at manjaro.org Received: from mail.manjaro.org ([127.0.0.1]) by localhost (manjaro.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3-ZMU6Ofhnkw; Fri, 14 May 2021 16:59:31 +0200 (CEST) From: Tobias Schramm To: linux-usb@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-phy@lists.infradead.org, devicetree@vger.kernel.org Cc: Johan Jonker , Rob Herring , Heiko Stuebner , Kishon Vijay Abraham I , Vinod Koul , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Tobias Schramm Subject: [PATCH v2 2/5] phy: phy-rockchip-inno-usb2: add support for RK3308 USB phy Date: Fri, 14 May 2021 17:00:41 +0200 Message-Id: <20210514150044.2099298-3-t.schramm@manjaro.org> In-Reply-To: <20210514150044.2099298-1-t.schramm@manjaro.org> References: <20210514150044.2099298-1-t.schramm@manjaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210514_075936_789872_2BB5E33C X-CRM114-Status: GOOD ( 10.77 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org The RK3308 SoC uses a slightly different USB phy than other Rockchip parts. This commit adds support for that phy. Signed-off-by: Tobias Schramm --- drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c index 46ebdb1460a3..beacac1dd253 100644 --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c @@ -1256,6 +1256,49 @@ static const struct rockchip_usb2phy_cfg rk3228_phy_cfgs[] = { { /* sentinel */ } }; +static const struct rockchip_usb2phy_cfg rk3308_phy_cfgs[] = { + { + .reg = 0x100, + .num_ports = 2, + .clkout_ctl = { 0x108, 4, 4, 1, 0 }, + .port_cfgs = { + [USB2PHY_PORT_OTG] = { + .phy_sus = { 0x0100, 8, 0, 0, 0x1d1 }, + .bvalid_det_en = { 0x3020, 2, 2, 0, 1 }, + .bvalid_det_st = { 0x3024, 2, 2, 0, 1 }, + .bvalid_det_clr = { 0x3028, 2, 2, 0, 1 }, + .ls_det_en = { 0x3020, 0, 0, 0, 1 }, + .ls_det_st = { 0x3024, 0, 0, 0, 1 }, + .ls_det_clr = { 0x3028, 0, 0, 0, 1 }, + .utmi_avalid = { 0x0120, 10, 10, 0, 1 }, + .utmi_bvalid = { 0x0120, 9, 9, 0, 1 }, + .utmi_ls = { 0x0120, 5, 4, 0, 1 }, + }, + [USB2PHY_PORT_HOST] = { + .phy_sus = { 0x0104, 8, 0, 0, 0x1d1 }, + .ls_det_en = { 0x3020, 1, 1, 0, 1 }, + .ls_det_st = { 0x3024, 1, 1, 0, 1 }, + .ls_det_clr = { 0x3028, 1, 1, 0, 1 }, + .utmi_ls = { 0x0120, 17, 16, 0, 1 }, + .utmi_hstdet = { 0x0120, 19, 19, 0, 1 } + } + }, + .chg_det = { + .opmode = { 0x0100, 3, 0, 5, 1 }, + .cp_det = { 0x0120, 24, 24, 0, 1 }, + .dcp_det = { 0x0120, 23, 23, 0, 1 }, + .dp_det = { 0x0120, 25, 25, 0, 1 }, + .idm_sink_en = { 0x0108, 8, 8, 0, 1 }, + .idp_sink_en = { 0x0108, 7, 7, 0, 1 }, + .idp_src_en = { 0x0108, 9, 9, 0, 1 }, + .rdm_pdwn_en = { 0x0108, 10, 10, 0, 1 }, + .vdm_src_en = { 0x0108, 12, 12, 0, 1 }, + .vdp_src_en = { 0x0108, 11, 11, 0, 1 }, + }, + }, + { /* sentinel */ } +}; + static const struct rockchip_usb2phy_cfg rk3328_phy_cfgs[] = { { .reg = 0x100, @@ -1425,6 +1468,7 @@ static const struct rockchip_usb2phy_cfg rv1108_phy_cfgs[] = { static const struct of_device_id rockchip_usb2phy_dt_match[] = { { .compatible = "rockchip,px30-usb2phy", .data = &rk3328_phy_cfgs }, { .compatible = "rockchip,rk3228-usb2phy", .data = &rk3228_phy_cfgs }, + { .compatible = "rockchip,rk3308-usb2phy", .data = &rk3308_phy_cfgs }, { .compatible = "rockchip,rk3328-usb2phy", .data = &rk3328_phy_cfgs }, { .compatible = "rockchip,rk3366-usb2phy", .data = &rk3366_phy_cfgs }, { .compatible = "rockchip,rk3399-usb2phy", .data = &rk3399_phy_cfgs }, From patchwork Fri May 14 15:00:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Schramm X-Patchwork-Id: 12258011 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 14B12C433B4 for ; Fri, 14 May 2021 15:00:10 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BBB4F61166 for ; Fri, 14 May 2021 15:00:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BBB4F61166 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=manjaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=7PsRfazMOA9q5cyZvNZoRVkGg+L3Ww5XcaZT5Y586fw=; b=pWA9M/rwxTbUVjUTg7OBboAXE eBZUzMriy/R3h7OoVwfOc3XOYQ05cCgXToXqxacAeFKjAsW15Gyt4kyqfWuE48AWQitDsYmbqRAgD S8VbzV7qjFTLPhB/6ZTx6MIo2JMjDC8Uwswnuua7ENRmOgq7pUvRqGSHYJORLsbqPLWnmQhrW5elb 7h3ITLWwODAl6A9Pj1IxON/Jcda25UF7y9vXz8UU5DBO4Qst7QctyiVzXJLHAWnRyLZ4xEHuI8Wx9 wfAAcnGdHfR/oy+Zg1ZbwZrhq77BuRHFlzikPIcEx5sd98yndT1b6xp9CmCeMdTlzFXdS1/KMUUC3 AyXpKSANw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lhZIL-008M3e-Vo; Fri, 14 May 2021 15:00:06 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lhZHv-008Lyy-4p; Fri, 14 May 2021 14:59:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=Cs41mioYQ+sZovsJ0UMQOqMg8rdBg3GqSgyqpD4kATE=; b=vWIxwFk9SKS2wCKSm92WbyUmF4 tz1yCsoBGIahkm1lFtk2g5GK/BSPNY5X2Rv88In/FuZNFYI6BVpAHyuZvsKUh93DNWP25TBJTnj6V od8FE/v6eKqymn1I4ZeXPuta+DotAhTbYZkbKXfnDkbnTs7CpQ6A/7CUgv4Q8rdxWHT/v8kfUh6P4 kaW/hZ4OykQqNBFIusKHzURtU86uaXZgPqe0LNuc7OCA0b1V7jYv6GyZkLMITwREXkBp3ap7tumUz q9uQ0wjzGoYmP1AlZaimA8Qx1PeT37nV5BMYUx1fTgYiQ4bVCz34fBfwYsrbGvqLfFiuB+DqvaX4D k4X1tPMw==; Received: from mail.manjaro.org ([2a01:4f8:150:448b::1]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lhZHs-00C43q-ID; Fri, 14 May 2021 14:59:37 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.manjaro.org (Postfix) with ESMTP id 1A83E222572; Fri, 14 May 2021 16:59:35 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at manjaro.org Received: from mail.manjaro.org ([127.0.0.1]) by localhost (manjaro.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yRjHlQv2R6Os; Fri, 14 May 2021 16:59:32 +0200 (CEST) From: Tobias Schramm To: linux-usb@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-phy@lists.infradead.org, devicetree@vger.kernel.org Cc: Johan Jonker , Rob Herring , Heiko Stuebner , Kishon Vijay Abraham I , Vinod Koul , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Tobias Schramm Subject: [PATCH v2 3/5] dt-bindings: usb: dwc2: add compatible for RK3308 USB controller Date: Fri, 14 May 2021 17:00:42 +0200 Message-Id: <20210514150044.2099298-4-t.schramm@manjaro.org> In-Reply-To: <20210514150044.2099298-1-t.schramm@manjaro.org> References: <20210514150044.2099298-1-t.schramm@manjaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210514_075936_788290_0642039B X-CRM114-Status: UNSURE ( 8.17 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org The USB controller in the RK3308 is compatible with the RK3066 USB controller. This patch adds a compatible string for it. Signed-off-by: Tobias Schramm Acked-by: Rob Herring --- Documentation/devicetree/bindings/usb/dwc2.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/usb/dwc2.yaml b/Documentation/devicetree/bindings/usb/dwc2.yaml index e5ee51b7b470..10c7d9b6cc53 100644 --- a/Documentation/devicetree/bindings/usb/dwc2.yaml +++ b/Documentation/devicetree/bindings/usb/dwc2.yaml @@ -24,6 +24,7 @@ properties: - rockchip,rk3188-usb - rockchip,rk3228-usb - rockchip,rk3288-usb + - rockchip,rk3308-usb - rockchip,rk3328-usb - rockchip,rk3368-usb - rockchip,rv1108-usb From patchwork Fri May 14 15:00:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Schramm X-Patchwork-Id: 12258015 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 99A48C433ED for ; Fri, 14 May 2021 15:00:48 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4CE3661166 for ; Fri, 14 May 2021 15:00:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4CE3661166 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=manjaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=2OksFP/8nAa9miJU/jViobAIG0Kj626Zz+zuRAi3vMk=; b=mSzAIyfFeftjdSb0bXWRGLjZY ixtajUhrn4huNK3FrmRu456X5sYJ2Gkm3DpYBlwYiwDdd8ktEI/5Gc4UNCgSlW7zBpJDDmFMSxdEz UZtz+HIUois0MXcig3CI/pNUZK4bJc5pDQIn8fHi8k8+IejseRtuJDbWyjtOMDL9YDC0PQjvInuW+ O/YODrOkbTSd4uCwcKPdI0naHYZecn95mxqwc+9EcDhRIKRDCnpc/52Bsw+yywo5CLaHL4bxbPMfg 1Nk62RzZ16PfLRVru92M0B0mYRYTXfJHdiAlt2cYIySCWKjlDNh7T2edzlNZT+DuimSlpbZavbyE9 qKFuLY81Q==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lhZIy-008MD4-Ig; Fri, 14 May 2021 15:00:44 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lhZHw-008LzC-AL; Fri, 14 May 2021 14:59:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=lA6QdZEIcYfr7WkNSP1q7t4iJ00C09HPF4/k1bFql0w=; b=bTl+t00S7w74gLk2HAQxYG/i1z B1MHkypr4rZIk7D1WKi1vKb3ckAInsdgvxYEf93pVI5l8IgbC79P8t6ghdTd0jEJpMx5BOPFJ4SHa BQR6O6uQTtflK2eiaN+P80jwyKqf3GPDK/qcTNHVXTqfveghW0N86za8Y67MvKxaaG5nmj6C91gUo ys2mWEBOYFYC8E7IIqiZQgheejIBY98IPE49p/0ZpnbIVLDNLhCc2oDeaXwUQFqWJVBdOHGvlzTd8 H6FbptM/3O25o9d2Ma4dj6xCnSrW7+ny6Az+xo8TrTEdpuWEI3hDda8H8Qx1UngbLrnZ9TyptB9LA dW/iJxnQ==; Received: from mail.manjaro.org ([176.9.38.148]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lhZHt-00C43z-9p; Fri, 14 May 2021 14:59:39 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.manjaro.org (Postfix) with ESMTP id 04F56222574; Fri, 14 May 2021 16:59:36 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at manjaro.org Received: from mail.manjaro.org ([127.0.0.1]) by localhost (manjaro.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RVUCmKNzUL1i; Fri, 14 May 2021 16:59:33 +0200 (CEST) From: Tobias Schramm To: linux-usb@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-phy@lists.infradead.org, devicetree@vger.kernel.org Cc: Johan Jonker , Rob Herring , Heiko Stuebner , Kishon Vijay Abraham I , Vinod Koul , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Tobias Schramm Subject: [PATCH v2 4/5] dt-bindings: soc: rockchip: grf: add compatible for RK3308 USB grf Date: Fri, 14 May 2021 17:00:43 +0200 Message-Id: <20210514150044.2099298-5-t.schramm@manjaro.org> In-Reply-To: <20210514150044.2099298-1-t.schramm@manjaro.org> References: <20210514150044.2099298-1-t.schramm@manjaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210514_075937_507042_68C7E141 X-CRM114-Status: UNSURE ( 7.75 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org The RK3308 has a USB GRF. This patch adds a compatible string for it. Signed-off-by: Tobias Schramm --- Documentation/devicetree/bindings/soc/rockchip/grf.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/soc/rockchip/grf.yaml b/Documentation/devicetree/bindings/soc/rockchip/grf.yaml index 84bdaf88d5a6..df77bd2e6752 100644 --- a/Documentation/devicetree/bindings/soc/rockchip/grf.yaml +++ b/Documentation/devicetree/bindings/soc/rockchip/grf.yaml @@ -30,6 +30,7 @@ properties: - rockchip,rk3288-grf - rockchip,rk3308-core-grf - rockchip,rk3308-detect-grf + - rockchip,rk3308-usb2phy-grf - rockchip,rk3308-grf - rockchip,rk3328-grf - rockchip,rk3328-usb2phy-grf From patchwork Fri May 14 15:00:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Schramm X-Patchwork-Id: 12258021 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 31C08C433ED for ; Fri, 14 May 2021 15:01:06 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 861BC6144F for ; Fri, 14 May 2021 15:01:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 861BC6144F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=manjaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=3wkmlPww1ZsHfzNDUFgudmrOoUb8NoTIwZBwecE7h24=; b=JesTHCCPaEUIAlebFQl9VqpVR I8++cOXN5U30Pk0h0ZRaQrAAPZBnekavtJnarWYwyqZ7gdKVZWz2n0GX+DsnJ8vEyBeg1gGepUamo eLsdh2BrFt3HFZ8Xl3gxLayKG5bJplW8gsMcGhvDHoLqPhAjSciCv4fp9Wg43Tw/IEVxyZghCtNGr mnxgG43v3Tev6MXB5SBdds4XnBgwxC+RzoyY66sbbxRsXlRYwIJEmzMKtNrS2unvFCYn98RtZ+41z mXJAfnkQtTZVoJ/pfj/yXy9Wa+EIiNMbCrLAoaRZ5gDaE0QBO2ue3dO3IyIZv2/gDR2YmvNiQrMNn pj6WnNtlA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lhZJE-008MJw-1x; Fri, 14 May 2021 15:01:00 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lhZHx-008Lzq-R1; Fri, 14 May 2021 14:59:42 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=pbLfBDzmCHZgiDRRj4nFY96ZtAQqgQOqhiyHaxVjQXQ=; b=17grr3luAEVx+EdMxEkmockvp1 SRbfoeTaigXn36URSb1Ig4zxVqp9qNMZmY9uWI7zx3LNmPUWUbXl9ZwB/EN7y6Ogp+QkBhmFKDIwj zoGVBqiwXLLum0u0FUw3QSJCN5buvA2lKaqcta5uCz0go9m8T2GXKN5WgKF4vARO1dwf+TLacKiDC XwiDLDcobhRJRvvf5AS/vCH2vilTaBWrzVcWVjZ0+M/71qw5UnoPrehdQ0wUYGEiH/fePWHIW/QDG 8QdZ0XzWyQBTnX50qGFtoe4LKUvpaO70y3S0Umo7qN5nSXCMby7vVmxV0p9UrQ/j9X22ZpYU2IC79 zk/OAHYA==; Received: from mail.manjaro.org ([176.9.38.148]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lhZHv-00C454-6P; Fri, 14 May 2021 14:59:40 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.manjaro.org (Postfix) with ESMTP id E9ECB222579; Fri, 14 May 2021 16:59:36 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at manjaro.org Received: from mail.manjaro.org ([127.0.0.1]) by localhost (manjaro.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LKbtEON92Hkg; Fri, 14 May 2021 16:59:34 +0200 (CEST) From: Tobias Schramm To: linux-usb@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-phy@lists.infradead.org, devicetree@vger.kernel.org Cc: Johan Jonker , Rob Herring , Heiko Stuebner , Kishon Vijay Abraham I , Vinod Koul , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Tobias Schramm Subject: [PATCH v2 5/5] arm64: dts: rockchip: add USB support to RK3308 dts Date: Fri, 14 May 2021 17:00:44 +0200 Message-Id: <20210514150044.2099298-6-t.schramm@manjaro.org> In-Reply-To: <20210514150044.2099298-1-t.schramm@manjaro.org> References: <20210514150044.2099298-1-t.schramm@manjaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210514_075939_405598_1076D245 X-CRM114-Status: UNSURE ( 9.49 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org The Rockchip RK3308 features an integrated USB 2.0 phy, an USB OTG controller and OHCI/EHCI interfaces. This patch adds all of those to the RK3308 dtsi and thereby enables USB support on the RK3308. Signed-off-by: Tobias Schramm --- arch/arm64/boot/dts/rockchip/rk3308.dtsi | 73 ++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3308.dtsi b/arch/arm64/boot/dts/rockchip/rk3308.dtsi index 0c5fa9801e6f..4f55477d70f1 100644 --- a/arch/arm64/boot/dts/rockchip/rk3308.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3308.dtsi @@ -177,6 +177,43 @@ reboot-mode { }; }; + usb2phy_grf: syscon@ff008000 { + compatible = "rockchip,rk3308-usb2phy-grf", "syscon", + "simple-mfd"; + reg = <0x0 0xff008000 0x0 0x4000>; + #address-cells = <1>; + #size-cells = <1>; + + u2phy: usb2-phy@100 { + compatible = "rockchip,rk3308-usb2phy"; + reg = <0x100 0x10>; + clocks = <&cru SCLK_USBPHY_REF>; + clock-names = "phyclk"; + clock-output-names = "usb480m_phy"; + #clock-cells = <0>; + assigned-clocks = <&cru USB480M>; + assigned-clock-parents = <&u2phy>; + status = "disabled"; + + u2phy_otg: otg-port { + #phy-cells = <0>; + interrupts = , + , + ; + interrupt-names = "otg-bvalid", "otg-id", + "linestate"; + status = "disabled"; + }; + + u2phy_host: host-port { + #phy-cells = <0>; + interrupts = ; + interrupt-names = "linestate"; + status = "disabled"; + }; + }; + }; + detect_grf: syscon@ff00b000 { compatible = "rockchip,rk3308-detect-grf", "syscon", "simple-mfd"; reg = <0x0 0xff00b000 0x0 0x1000>; @@ -579,6 +616,42 @@ spdif_tx: spdif-tx@ff3a0000 { status = "disabled"; }; + usb20_otg: usb@ff400000 { + compatible = "rockchip,rk3308-usb", "rockchip,rk3066-usb", + "snps,dwc2"; + reg = <0x0 0xff400000 0x0 0x40000>; + interrupts = ; + clocks = <&cru HCLK_OTG>; + clock-names = "otg"; + dr_mode = "otg"; + g-np-tx-fifo-size = <16>; + g-rx-fifo-size = <280>; + g-tx-fifo-size = <256 128 128 64 32 16>; + phys = <&u2phy_otg>; + phy-names = "usb2-phy"; + status = "disabled"; + }; + + usb_host_ehci: usb@ff440000 { + compatible = "generic-ehci"; + reg = <0x0 0xff440000 0x0 0x10000>; + interrupts = ; + clocks = <&cru HCLK_HOST>, <&cru HCLK_HOST_ARB>, <&u2phy>; + phys = <&u2phy_host>; + phy-names = "usb"; + status = "disabled"; + }; + + usb_host_ohci: usb@ff450000 { + compatible = "generic-ohci"; + reg = <0x0 0xff450000 0x0 0x10000>; + interrupts = ; + clocks = <&cru HCLK_HOST>, <&cru HCLK_HOST_ARB>, <&u2phy>; + phys = <&u2phy_host>; + phy-names = "usb"; + status = "disabled"; + }; + sdmmc: mmc@ff480000 { compatible = "rockchip,rk3308-dw-mshc", "rockchip,rk3288-dw-mshc"; reg = <0x0 0xff480000 0x0 0x4000>;