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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id AFBF3C7EE24 for ; Tue, 6 Jun 2023 17:10:58 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 984B885F9F; Tue, 6 Jun 2023 19:10:13 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="YX0RPVkm"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2866785F89; Tue, 6 Jun 2023 19:10:09 +0200 (CEST) Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) (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 BEE3185EAD for ; Tue, 6 Jun 2023 19:10:03 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jagan@amarulasolutions.com Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-1b246dd32deso2130715ad.2 for ; Tue, 06 Jun 2023 10:10:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1686071401; x=1688663401; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sr1K9l80upKXGWVzSR8+pyCAPneB1GI2wk0Q6eotpK8=; b=YX0RPVkm3UoZPwTH+x4+9gSBjRy2tuPpHOs/6oQvGdPnkszAwjEFoIxNNiwm4iC9QN f8V5K+jHtHYcQhbCA0ovvJQvAqnH2IVHg1MRJViAzzmb+/zs9KMqbwFzIbI32Kvx+nh2 SbcbCzABNwfUVqof1Talnfeaxjp72uTIJJdL0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686071401; x=1688663401; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sr1K9l80upKXGWVzSR8+pyCAPneB1GI2wk0Q6eotpK8=; b=HCpEmrt5HPKfbQVB8YQ6elm+GmECviU8+IpjiogBAG76aGLvLmOXHOoxPrJbcfB7VP BQNH5z5gsJzBrFLtgg7/CKaEMU+ak53mXhRRUgmfi6nqtjqcCSskqSxpZQiPisnPZmpx NwhgQfzTfuu72RbkaUn2Bu+MmQl0UKRKQmjmokQdcUwyTTH5c1dszVSaY7lBpZPWRqdH f+xvYSX/qssiKf+xjgzBysXUoODHNh7mlsvV+qeeiZDYDYB7k875xW6SmXxb8RNGVSRY 4P9GUPdLNUwBu9s9HGIyR0qbYZel+pc0HOehknffJCewNHJA8QU96TUVRY6EbbxJogLt jZuQ== X-Gm-Message-State: AC+VfDwogim/uyfJBQUvCXoPoarEMREAiYyxULzuvyXLmRkmdGQ5SJYd j15OsW0JlT5ZWCr01xASMu90Qg== X-Google-Smtp-Source: ACHHUZ6/5bkJGRZXCLEGsQIvL0sy2xMlgYO2PNW9uPjD4sI6PYFvvkzkZ4e0eiFNCcTEWr8e6L0q1Q== X-Received: by 2002:a17:902:d34b:b0:1ac:6d4c:c26a with SMTP id l11-20020a170902d34b00b001ac6d4cc26amr1658742plk.14.1686071401261; Tue, 06 Jun 2023 10:10:01 -0700 (PDT) Received: from localhost.localdomain ([2401:4900:2001:f7d3:5b78:1d82:fb5f:608c]) by smtp.gmail.com with ESMTPSA id bc8-20020a170902930800b001ab0159b9edsm8695129plb.250.2023.06.06.10.09.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jun 2023 10:10:00 -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 v2 5/7] phy: rockchip-inno-usb2: Add USB2 PHY for RK3328 Date: Tue, 6 Jun 2023 22:39:16 +0530 Message-Id: <20230606170918.45581-6-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230606170918.45581-1-jagan@amarulasolutions.com> References: <20230606170918.45581-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.8 at phobos.denx.de X-Virus-Status: Clean USB2.0 Host and OTG controllers in RK3328 are using USB2PHY. Add support for it. Signed-off-by: Jagan Teki --- Changes for v2: - add clkout_ctl drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c index e43a5ba9b5..d8738f891d 100644 --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c @@ -345,6 +345,36 @@ bind_fail: return ret; } +static const struct rockchip_usb2phy_cfg rk3328_usb2phy_cfgs[] = { + { + .reg = 0x100, + .clkout_ctl = { 0x108, 4, 4, 1, 0 }, + .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, @@ -498,6 +528,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, -- 2.25.1