From mboxrd@z Thu Jan 1 00:00:00 1970 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT 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 7F18AC11F65 for ; Wed, 30 Jun 2021 18:50:32 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F10EE61432 for ; Wed, 30 Jun 2021 18:50:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F10EE61432 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7F9DA831BE; Wed, 30 Jun 2021 20:49:35 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="jypQQse1"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A24C582C60; Wed, 30 Jun 2021 18:40:13 +0200 (CEST) Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1598782BD7 for ; Wed, 30 Jun 2021 18:40:11 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jbx6244@gmail.com Received: by mail-ej1-x631.google.com with SMTP id gt10so3905050ejc.5 for ; Wed, 30 Jun 2021 09:40:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=+myjF9TM7b93D5uuc/xTjGlPtt7mbLVPCDEiU0foORw=; b=jypQQse1abxkHtbcUx9jhCMKYNRFfqBvkoOe0Tfpjyo6qXrL+qS/HHwyIAZcC+jrrd Sm5Lbn+PuPUrBdbihYgTA49lSD0sAkZvvZZpJwOol3QfrE5oACfnA9qGEV/SH65W0vp1 KvFDQ/kKhSyhQoP6sAJFjJqF6ozvkymI9MZB4bHxrimOVLfveeY7lCYVX8WTUx+96LNB NTYETwIv2cogkX1wf0NXYAcYMsJxbClXrOdWhp55MKjqjKQgVB34DBtTP5TKenrtVa1T 09opCd+adv6DkK21vA6JaXDZ2/zSLFk8Rn0F60sg1iOa8g+EjzACeMsgGF109YhwPNOA BfGg== 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; bh=+myjF9TM7b93D5uuc/xTjGlPtt7mbLVPCDEiU0foORw=; b=g/Kq0lIrFDBcaVhYghYAhjg6Nw60L8ELlsvKrSWYbal8gQzVNcdKDvsK0pIzCsmxFz xlG+0tCWI/lpmGsoCbNW7Uoms7UAdd1vq5v+QtOlM9jiFZUqnu+W7kIiLfpG8ojQeA7W zbiQzukMNQK6zqjeOeczAxYEApCcQgKP/AH4KkI/aga03xja9Ffdr2yAjLf046qsoaXM iPBtkyQ4GHXoyxsDErotP2h4MbuC1NvZOvgKyxOORL4Lkcn/v/JYMGR5NRz+tzE4gf0g QzLyyq1AJiYM8JyBN83ctSb30E5mdhBmG0NnCKdg1PdweENrx6uqPkg60hOcdFRjhI1p v3SA== X-Gm-Message-State: AOAM5327P6qVRYrRvLfojhxE16b4g3a66PvECm/jhmttmtS37AmM9QlL bxsCSK1FT4o01cxowsAjtxk= X-Google-Smtp-Source: ABdhPJwdEoeMa3yHfaErhKhBxDZpRl57dt8Z6sGvWf81eCLBEdvIHdaL54XgMjoEJkpB1h1P4WESrw== X-Received: by 2002:a17:906:2dd5:: with SMTP id h21mr36877640eji.522.1625071210762; Wed, 30 Jun 2021 09:40:10 -0700 (PDT) Received: from debian.home (81-204-249-205.fixed.kpn.net. [81.204.249.205]) by smtp.gmail.com with ESMTPSA id d23sm12988412edv.14.2021.06.30.09.40.09 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Jun 2021 09:40:10 -0700 (PDT) From: Johan Jonker To: kever.yang@rock-chips.com Cc: sjg@chromium.org, philipp.tomsich@vrull.eu, heiko@sntech.de, mail@david-bauer.net, ldevulder@suse.com, wens@csie.org, banglang.huang@foxmail.com, matwey.kornilov@gmail.com, u-boot@lists.denx.de Subject: [RFC PATCH v1] phy: rockchip: add basic rk3328 support to phy-rockchip-inno-usb2.c Date: Wed, 30 Jun 2021 18:40:00 +0200 Message-Id: <20210630164000.7843-1-jbx6244@gmail.com> X-Mailer: git-send-email 2.11.0 X-Mailman-Approved-At: Wed, 30 Jun 2021 20:49:16 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean The rk3328 uses a usb phy simulair to rk3399 with only 1 instead of 2 usb ports. Reuse existing U-boot driver and add basic rk3328 support to phy-rockchip-inno-usb2.c Signed-off-by: Johan Jonker --- drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 29 +++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c index 62b8ba3a4a..bfb531d3cd 100644 --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c @@ -243,6 +243,31 @@ static int rockchip_usb2phy_bind(struct udevice *dev) return ret; } +static const struct rockchip_usb2phy_cfg rk3328_usb2phy_cfgs[] = { + { + .reg = 0x100, + .port_cfgs = { + [USB2PHY_PORT_OTG] = { + .phy_sus = { 0x0100, 8, 0, 0, 0x1d1 }, + .bvalid_det_en = { 0x0110, 2, 2, 0, 1 }, + .bvalid_det_st = { 0x0114, 2, 2, 0, 1 }, + .bvalid_det_clr = { 0x0118, 2, 2, 0, 1 }, + .utmi_avalid = { 0x0120, 10, 10, 0, 1 }, + .utmi_bvalid = { 0x0120, 9, 9, 0, 1 }, + }, + [USB2PHY_PORT_HOST] = { + .phy_sus = { 0x104, 8, 0, 0, 0x1d1 }, + .ls_det_en = { 0x110, 1, 1, 0, 1 }, + .ls_det_st = { 0x114, 1, 1, 0, 1 }, + .ls_det_clr = { 0x118, 1, 1, 0, 1 }, + .utmi_ls = { 0x120, 17, 16, 0, 1 }, + .utmi_hstdet = { 0x120, 19, 19, 0, 1 } + } + }, + }, + { /* sentinel */ } +}; + static const struct rockchip_usb2phy_cfg rk3399_usb2phy_cfgs[] = { { .reg = 0xe450, @@ -291,6 +316,10 @@ static const struct rockchip_usb2phy_cfg rk3399_usb2phy_cfgs[] = { static const struct udevice_id rockchip_usb2phy_ids[] = { { + .compatible = "rockchip,rk3328-usb2phy", + .data = (ulong)&rk3328_usb2phy_cfgs + }, + { .compatible = "rockchip,rk3399-usb2phy", .data = (ulong)&rk3399_usb2phy_cfgs, }, -- 2.11.0