From patchwork Fri Jun 2 15:26:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2898 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 78E4F3F076 for ; Fri, 2 Jun 2023 17:27:20 +0200 (CEST) Received: by mail-pg1-f200.google.com with SMTP id 41be03b00d2f7-53fa457686esf2034786a12.0 for ; Fri, 02 Jun 2023 08:27:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1685719639; cv=pass; d=google.com; s=arc-20160816; b=wWGVQwohoLYKwR1kKXXabLPxNvv/DazwfhZyUHpdZUpTY/6WlJCn93S2mRJKuNrDI0 +d/NMGmcT4GezMMPYFN1hHsuWL/+QMHANIdvFhPPXyiZqlJRSIaq1fgc1i7WMuVgmwuD Ll2hjCH4orltdpvrjzS+iw+J/Uk0amNOuB6OjfZXsyybiym8Izr7dCFpMz1B7qYQs+dn c1hZtLc9vliDp9FUEdJdZhY91RfAI+Pytn2SkPIWfqqua/dhKTwWDSH49E/xNwAyZ093 bNMGoBoLvYHL64X9H77rOQY0PwOZeJPpc1l6GtiiZa3ZSmP1X4qjCN8YcKOWtVeykMvw GyXQ== 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=JsWfGWcElhKQkpDzYc7DAD7/szmfCsuV9uzJflH3xxg=; b=Uzk+xZO5yHZDKPpVyiFSgtJECQUOE4oZJwaTJQMt8x/RjWsUoymN8W4fonh5I56vZE 9fXSrTxCiq+YrD5GiBNeuE6xP/8FyKhQs2KQ1Tu7Zq/EXfqmAgCLG5sb7RcqaLlALo1i 7mpZj0NY257zhPKHNlxUg6rAspowEAKmnQjslmN8iPmJhU9kdVtTkCzjjmgEkSKR4YyJ /9aMW54lGcCKXfqPGYVA5nHgYgne4taw3M7ikEErPQoz+w9FVYOYT5+qoD7yOSu4aKTH NGvCmDwcFN1GDX8pMd2TMLdp/fhwHkSFlQ4UMamXv7oCg5ftr09+SFEnxuEFfkrEjy+p TP3g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=UejAV7JV; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1685719639; x=1688311639; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=JsWfGWcElhKQkpDzYc7DAD7/szmfCsuV9uzJflH3xxg=; b=Rya+cYPmXLkM4skMV+Kk4YjTYoM6qeJiWXyOqdZuxrQO2jp856jmv2EgsSteivH15x cq8Y8siyG2r2XtD0BZBRa187w6B0pYBpLiDI7uuFiFPM8UfmecjSZfuF9ndIPWhY4VQL +NlpGtNVi7qD9krwuutrf3sUFeMecPwpkKfNM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685719639; x=1688311639; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-beenthere:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=JsWfGWcElhKQkpDzYc7DAD7/szmfCsuV9uzJflH3xxg=; b=BcunosJ9YJNx5FS+O74FwNkuqjp2e0TZ+cjv9g8jQF2cVzz/hzHCkfQ5qpTilBIINP 7BYGTk/jhItcFchVBsjzQF3eG1O6DwfHa9n1Fj/ZVMpKdkc33BRGab17wu2TdtBqSWD7 gRtTmLvahhD98E3mVpoBjazNXdjQ0QAygHzUCeYxRgowMQqFtjQ2Osvb5XCXOEjIKGxP DFd5DJGrulhT67BOQmZOjevVwV+FRG5wG4AGRdgHr9WB5RU/2rzRA5TiWYbB/Q8DIOhv +Q14pNfAcFE9n4z9wff8CNSdXiKwZj0yFU4y5kTn+J7yPtSxST8KMNi4wi2WEPqRANUV ejBQ== X-Gm-Message-State: AC+VfDz+ip3fvX8aHwHeajbM9rendrHpMt6BBrxc+Z0oYAotMUFDMEHB RDAlYWMkKhm5l6ggw/4+4f5Z7MKc X-Google-Smtp-Source: ACHHUZ6aqib27jTQw1Ek1pQ1lwdTn/1iJYCmgjOXjqpAHb3X4UgK7/ZJfrGa2/l1iUCMEIg57Ubobg== X-Received: by 2002:a05:6a20:2588:b0:110:f66c:a0e1 with SMTP id k8-20020a056a20258800b00110f66ca0e1mr6003008pzd.14.1685719638981; Fri, 02 Jun 2023 08:27:18 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a62:87c5:0:b0:650:7fac:ea0c with SMTP id i188-20020a6287c5000000b006507facea0cls10898pfe.1.-pod-prod-00-us; Fri, 02 Jun 2023 08:27:18 -0700 (PDT) X-Received: by 2002:a05:6a20:1456:b0:106:9266:4448 with SMTP id a22-20020a056a20145600b0010692664448mr5571786pzi.16.1685719637986; Fri, 02 Jun 2023 08:27:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685719637; cv=none; d=google.com; s=arc-20160816; b=IgiY/Dum3DQxCLkQftCLiOwapQ8JiPzxvoMf42qM4+2gNEHL96Cm27PgwLt7kkWT56 UaX2azbUG0sRrc2cncMddqVnGMA4CSPwxBCbrx1KjSK+YXj8Y14ZnQJuljCCR5asTFgE NKs5TpvisPEPN0ldOKgHw/6kcBKPoIRG8EntAaJLYyQb0M7LZyRuOO0btT8cltp8w+bZ Li/mh3T6tEA4QH5kDriNBT2q1HalA7wQfSLG+m272YgUyU8zW74784HOQEcvc8B9NpFU X/rMN8MOkjCs30d+aw3KediWjNzbHX6ko9Utx2Fsd7+2xAu1t0u1tzJyH95sEUssB0KN VySg== 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=TVddlRPNKzeLN6Ey4m9q5qhWx/T79IM3mz6a11IPSM0=; b=OVEd+a+WztpaPoHVk+URhazt9HjVtSRCQjt0uxxMVyrYt0pw/bQtlLXYIl0nrXN2XC DcmV13dJjje6uVJFeai0GAy1bnMXJvCHZWCWRisIcBDSfhgqszBMgnWKvkSu5A2Ykx2i R22Ki83whFIvUZsmFYNUqmtm3pNKbrnfnr9tFw5eaKHYy519ujxdy1creF1tNQe5kQEA JPt8c354jYPQLylM1TnauUTACY0qdI+eQM6E5iUHHfsOlRv+R3hvXQltm8z1JKmb5RTj OLOQZR0Eq0k5OMN9SDHUDWa7YgUg3ljvgVq5wYe5cckUOJ4fxxxWbQRKVctX7j/Zti0X EuMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=UejAV7JV; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id g62-20020a625241000000b0064353c92d1csor338839pfb.2.2023.06.02.08.27.17 for (Google Transport Security); Fri, 02 Jun 2023 08:27:17 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a05:6a00:a96:b0:63b:54e4:871b with SMTP id b22-20020a056a000a9600b0063b54e4871bmr6403667pfl.8.1685719637620; Fri, 02 Jun 2023 08:27:17 -0700 (PDT) Received: from localhost.localdomain ([2401:4900:2003:4e14:c7e6:b770:ced9:e760]) by smtp.gmail.com with ESMTPSA id l3-20020a62be03000000b0063afb08afeesm1154124pff.67.2023.06.02.08.27.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Jun 2023 08:27:17 -0700 (PDT) From: Jagan Teki To: Kever Yang , Simon Glass , Philipp Tomsich Cc: Jonas Karlman , u-boot@lists.denx.de, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH 5/7] phy: rockchip-inno-usb2: Add USB2 PHY for RK3328 Date: Fri, 2 Jun 2023 20:56:29 +0530 Message-Id: <20230602152631.106887-6-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230602152631.106887-1-jagan@amarulasolutions.com> References: <20230602152631.106887-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=UejAV7JV; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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: , USB2.0 Host and OTG controllers in RK3328 are using USB2PHY. Add support for it. Signed-off-by: Jagan Teki --- drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c index 8986a5543c..75aea2298f 100644 --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c @@ -267,6 +267,35 @@ 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, 15, 0, 0, 0x1d1 }, + .bvalid_det_en = { 0x0110, 3, 2, 0, 3 }, + .bvalid_det_st = { 0x0114, 3, 2, 0, 3 }, + .bvalid_det_clr = { 0x0118, 3, 2, 0, 3 }, + .ls_det_en = { 0x0110, 0, 0, 0, 1 }, + .ls_det_st = { 0x0114, 0, 0, 0, 1 }, + .ls_det_clr = { 0x0118, 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 = { 0x104, 15, 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, @@ -416,6 +445,10 @@ static const struct rockchip_usb2phy_cfg rk3588_phy_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,