From patchwork Wed Aug 30 13:36:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 718699 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D2C02C83F1B for ; Wed, 30 Aug 2023 18:36:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233445AbjH3SgG (ORCPT ); Wed, 30 Aug 2023 14:36:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244647AbjH3Nid (ORCPT ); Wed, 30 Aug 2023 09:38:33 -0400 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FA2E1B0; Wed, 30 Aug 2023 06:38:29 -0700 (PDT) Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-401ceda85cdso27415555e9.1; Wed, 30 Aug 2023 06:38:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693402708; x=1694007508; darn=vger.kernel.org; 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=G5g221ge6JqMTWTGX03yPTFswnlhrFAyzkz/jRpc4xU=; b=UvSnINdAFhtS4PyTeeYYHb1/X2XFuX7W2Nu7la80pK4Pgv3EiyfP9x6fFO32XjqnSO +Qh08ewAhaSJ4xosYS7xTN7/9+Xo5CFmUzfHRZHIgts/QvQfUoU3RDg8MsxD6KukeGJZ zqOPNoreGq4MHX64MeHWcrTIaqeB94eF+ytl2wbhTQagA9LpnczMXUPf75hwaZ4Lz/gY TNgyIUi4v+/TPpYyXW6wimvuU8DWQISvYjRKJzmwv1wUEQ+7kANx7RHul1iUloXWO3mZ qHdKDdOxIeN1W1Bp3q2yRudPnwb/ne5SgiUh79uQsYPWS4wSOUYluiXY5q3H83xLv6AD DqSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693402708; x=1694007508; 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=G5g221ge6JqMTWTGX03yPTFswnlhrFAyzkz/jRpc4xU=; b=IaSq+BnKsWCaIob+A/pF1RbKPqyIO/PBfaJ+f7juYUvlb2y9jSBbjWjEOjOhr43D9D kPxvHryIdRv2oc03ru3ZnXl8xaIwnUIR8i3b3wU8N40T6EoeSczJuwllU0XIUMq6wOs6 vEb/TGwwUtww3MXUxT8sG3nmCe9TO9OcGdEa26Rg145GlJ4Eg59HYfZmNH0U7CPhM2Hs RirfSMhim2qohgLXwCCl6iTaCzN/e3zXJCcfDRCcEl31/2rKaDLsbzrEE+nnbFRgEbm0 wC9nN/4lNa9bbLTXnvrT/jJeOZ9foDpiNsZR8cOaZBYD4IywPZxqJ+1Jpyb4QdVIWOiZ rgNA== X-Gm-Message-State: AOJu0YzQEX1Rpc6jBqlinRvfYTLoPERQEoegPFSJbztv8gNw+oVAh2wY X5XN+zlfoD2LtCQHJyALTw== X-Google-Smtp-Source: AGHT+IEz+WHucNwiMNPJ9Xjok1GP87HrpJlu0CzCUEiQhDrNO2Zdq1zsySrNspwd/7GvBifanEnygw== X-Received: by 2002:a05:600c:2041:b0:401:d803:6250 with SMTP id p1-20020a05600c204100b00401d8036250mr1753064wmg.5.1693402707395; Wed, 30 Aug 2023 06:38:27 -0700 (PDT) Received: from U4.lan ([2001:9e8:b963:7410:17bb:6f65:50d0:b82b]) by smtp.gmail.com with ESMTPSA id x14-20020a05600c2a4e00b003fed70fb09dsm2326343wme.26.2023.08.30.06.38.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Aug 2023 06:38:27 -0700 (PDT) From: Alex Bee To: Kishon Vijay Abraham I , Vinod Koul , Heiko Stuebner , Conor Dooley , Krzysztof Kozlowski , Rob Herring Cc: linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Alex Bee Subject: [PATCH v2 1/5] phy: rockchip-inno-usb2: Split ID interrupt phy registers Date: Wed, 30 Aug 2023 15:36:21 +0200 Message-ID: <20230830133623.83075-4-knaerzche@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230830133623.83075-2-knaerzche@gmail.com> References: <20230830133623.83075-2-knaerzche@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Commit 51a9b2c03dd3 ("phy: rockchip-inno-usb2: Handle ID IRQ") added ID detection interrupt registers. However the current implementation assumes that falling and rising edge interrupt are always enabled in registers spanning over subsequent bits. That is not the case for RK3128's version of the phy and this implementation can't be used as-is, since there are bits with different purpose in between. This splits up the register definitions for id_det_en, id_det_en and id_det_clr registers in rising and falling edge variants. It's required as preparation to support RK3128's Innosilicon usb2 phy as well in this driver and matches pretty much to what the vendor does, so I'm not expecting issues for other SoCs with that change. Signed-off-by: Alex Bee --- drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 99 +++++++++++++------ 1 file changed, 70 insertions(+), 29 deletions(-) diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c index a0bc10aa7961..a4a1716e67bd 100644 --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c @@ -116,9 +116,12 @@ struct rockchip_chg_det_reg { * @bvalid_det_en: vbus valid rise detection enable register. * @bvalid_det_st: vbus valid rise detection status register. * @bvalid_det_clr: vbus valid rise detection clear register. - * @id_det_en: id detection enable register. - * @id_det_st: id detection state register. - * @id_det_clr: id detection clear register. + * @idfall_det_en: id detection enable register, falling edge + * @idfall_det_st: id detection state register, falling edge + * @idfall_det_clr: id detection clear register, falling edge + * @idrise_det_en: id detection enable register, rising edge + * @idrise_det_st: id detection state register, rising edge + * @idrise_det_clr: id detection clear register, rising edge * @ls_det_en: linestate detection enable register. * @ls_det_st: linestate detection state register. * @ls_det_clr: linestate detection clear register. @@ -133,9 +136,12 @@ struct rockchip_usb2phy_port_cfg { struct usb2phy_reg bvalid_det_en; struct usb2phy_reg bvalid_det_st; struct usb2phy_reg bvalid_det_clr; - struct usb2phy_reg id_det_en; - struct usb2phy_reg id_det_st; - struct usb2phy_reg id_det_clr; + struct usb2phy_reg idfall_det_en; + struct usb2phy_reg idfall_det_st; + struct usb2phy_reg idfall_det_clr; + struct usb2phy_reg idrise_det_en; + struct usb2phy_reg idrise_det_st; + struct usb2phy_reg idrise_det_clr; struct usb2phy_reg ls_det_en; struct usb2phy_reg ls_det_st; struct usb2phy_reg ls_det_clr; @@ -429,15 +435,27 @@ static int rockchip_usb2phy_init(struct phy *phy) if (ret) goto out; - /* clear id status and enable id detect irq */ + /* clear id status and enable id detect irqs */ ret = property_enable(rphy->grf, - &rport->port_cfg->id_det_clr, + &rport->port_cfg->idfall_det_clr, true); if (ret) goto out; ret = property_enable(rphy->grf, - &rport->port_cfg->id_det_en, + &rport->port_cfg->idrise_det_clr, + true); + if (ret) + goto out; + + ret = property_enable(rphy->grf, + &rport->port_cfg->idfall_det_en, + true); + if (ret) + goto out; + + ret = property_enable(rphy->grf, + &rport->port_cfg->idrise_det_en, true); if (ret) goto out; @@ -944,11 +962,16 @@ static irqreturn_t rockchip_usb2phy_id_irq(int irq, void *data) struct rockchip_usb2phy *rphy = dev_get_drvdata(rport->phy->dev.parent); bool id; - if (!property_enabled(rphy->grf, &rport->port_cfg->id_det_st)) + if (!property_enabled(rphy->grf, &rport->port_cfg->idfall_det_st) && + !property_enabled(rphy->grf, &rport->port_cfg->idrise_det_st)) return IRQ_NONE; /* clear id detect irq pending status */ - property_enable(rphy->grf, &rport->port_cfg->id_det_clr, true); + if (property_enabled(rphy->grf, &rport->port_cfg->idfall_det_st)) + property_enable(rphy->grf, &rport->port_cfg->idfall_det_clr, true); + + if (property_enabled(rphy->grf, &rport->port_cfg->idrise_det_st)) + property_enable(rphy->grf, &rport->port_cfg->idrise_det_clr, true); id = property_enabled(rphy->grf, &rport->port_cfg->utmi_id); extcon_set_state_sync(rphy->edev, EXTCON_USB_HOST, !id); @@ -1362,9 +1385,12 @@ static const struct rockchip_usb2phy_cfg rk3228_phy_cfgs[] = { .bvalid_det_en = { 0x0680, 3, 3, 0, 1 }, .bvalid_det_st = { 0x0690, 3, 3, 0, 1 }, .bvalid_det_clr = { 0x06a0, 3, 3, 0, 1 }, - .id_det_en = { 0x0680, 6, 5, 0, 3 }, - .id_det_st = { 0x0690, 6, 5, 0, 3 }, - .id_det_clr = { 0x06a0, 6, 5, 0, 3 }, + .idfall_det_en = { 0x0680, 6, 6, 0, 1 }, + .idfall_det_st = { 0x0690, 6, 6, 0, 1 }, + .idfall_det_clr = { 0x06a0, 6, 6, 0, 1 }, + .idrise_det_en = { 0x0680, 5, 5, 0, 1 }, + .idrise_det_st = { 0x0690, 5, 5, 0, 1 }, + .idrise_det_clr = { 0x06a0, 5, 5, 0, 1 }, .ls_det_en = { 0x0680, 2, 2, 0, 1 }, .ls_det_st = { 0x0690, 2, 2, 0, 1 }, .ls_det_clr = { 0x06a0, 2, 2, 0, 1 }, @@ -1425,9 +1451,12 @@ static const struct rockchip_usb2phy_cfg rk3308_phy_cfgs[] = { .bvalid_det_en = { 0x3020, 3, 2, 0, 3 }, .bvalid_det_st = { 0x3024, 3, 2, 0, 3 }, .bvalid_det_clr = { 0x3028, 3, 2, 0, 3 }, - .id_det_en = { 0x3020, 5, 4, 0, 3 }, - .id_det_st = { 0x3024, 5, 4, 0, 3 }, - .id_det_clr = { 0x3028, 5, 4, 0, 3 }, + .idfall_det_en = { 0x3020, 5, 5, 0, 1 }, + .idfall_det_st = { 0x3024, 5, 5, 0, 1 }, + .idfall_det_clr = { 0x3028, 5, 5, 0, 1 }, + .idrise_det_en = { 0x3020, 4, 4, 0, 1 }, + .idrise_det_st = { 0x3024, 4, 4, 0, 1 }, + .idrise_det_clr = { 0x3028, 4, 4, 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 }, @@ -1472,9 +1501,12 @@ static const struct rockchip_usb2phy_cfg rk3328_phy_cfgs[] = { .bvalid_det_en = { 0x0110, 3, 2, 0, 3 }, .bvalid_det_st = { 0x0114, 3, 2, 0, 3 }, .bvalid_det_clr = { 0x0118, 3, 2, 0, 3 }, - .id_det_en = { 0x0110, 5, 4, 0, 3 }, - .id_det_st = { 0x0114, 5, 4, 0, 3 }, - .id_det_clr = { 0x0118, 5, 4, 0, 3 }, + .idfall_det_en = { 0x0110, 5, 5, 0, 1 }, + .idfall_det_st = { 0x0114, 5, 5, 0, 1 }, + .idfall_det_clr = { 0x0118, 5, 5, 0, 1 }, + .idrise_det_en = { 0x0110, 4, 4, 0, 1 }, + .idrise_det_st = { 0x0114, 4, 4, 0, 1 }, + .idrise_det_clr = { 0x0118, 4, 4, 0, 1 }, .ls_det_en = { 0x0110, 0, 0, 0, 1 }, .ls_det_st = { 0x0114, 0, 0, 0, 1 }, .ls_det_clr = { 0x0118, 0, 0, 0, 1 }, @@ -1538,9 +1570,12 @@ static const struct rockchip_usb2phy_cfg rk3399_phy_cfgs[] = { .bvalid_det_en = { 0xe3c0, 3, 3, 0, 1 }, .bvalid_det_st = { 0xe3e0, 3, 3, 0, 1 }, .bvalid_det_clr = { 0xe3d0, 3, 3, 0, 1 }, - .id_det_en = { 0xe3c0, 5, 4, 0, 3 }, - .id_det_st = { 0xe3e0, 5, 4, 0, 3 }, - .id_det_clr = { 0xe3d0, 5, 4, 0, 3 }, + .idfall_det_en = { 0xe3c0, 5, 5, 0, 1 }, + .idfall_det_st = { 0xe3e0, 5, 5, 0, 1 }, + .idfall_det_clr = { 0xe3d0, 5, 5, 0, 1 }, + .idrise_det_en = { 0xe3c0, 4, 4, 0, 1 }, + .idrise_det_st = { 0xe3e0, 4, 4, 0, 1 }, + .idrise_det_clr = { 0xe3d0, 4, 4, 0, 1 }, .utmi_avalid = { 0xe2ac, 7, 7, 0, 1 }, .utmi_bvalid = { 0xe2ac, 12, 12, 0, 1 }, .utmi_id = { 0xe2ac, 8, 8, 0, 1 }, @@ -1577,9 +1612,12 @@ static const struct rockchip_usb2phy_cfg rk3399_phy_cfgs[] = { .bvalid_det_en = { 0xe3c0, 8, 8, 0, 1 }, .bvalid_det_st = { 0xe3e0, 8, 8, 0, 1 }, .bvalid_det_clr = { 0xe3d0, 8, 8, 0, 1 }, - .id_det_en = { 0xe3c0, 10, 9, 0, 3 }, - .id_det_st = { 0xe3e0, 10, 9, 0, 3 }, - .id_det_clr = { 0xe3d0, 10, 9, 0, 3 }, + .idfall_det_en = { 0xe3c0, 10, 10, 0, 1 }, + .idfall_det_st = { 0xe3e0, 10, 10, 0, 1 }, + .idfall_det_clr = { 0xe3d0, 10, 10, 0, 1 }, + .idrise_det_en = { 0xe3c0, 9, 9, 0, 1 }, + .idrise_det_st = { 0xe3e0, 9, 9, 0, 1 }, + .idrise_det_clr = { 0xe3d0, 9, 9, 0, 1 }, .utmi_avalid = { 0xe2ac, 10, 10, 0, 1 }, .utmi_bvalid = { 0xe2ac, 16, 16, 0, 1 }, .utmi_id = { 0xe2ac, 11, 11, 0, 1 }, @@ -1608,9 +1646,12 @@ static const struct rockchip_usb2phy_cfg rk3568_phy_cfgs[] = { .bvalid_det_en = { 0x0080, 3, 2, 0, 3 }, .bvalid_det_st = { 0x0084, 3, 2, 0, 3 }, .bvalid_det_clr = { 0x0088, 3, 2, 0, 3 }, - .id_det_en = { 0x0080, 5, 4, 0, 3 }, - .id_det_st = { 0x0084, 5, 4, 0, 3 }, - .id_det_clr = { 0x0088, 5, 4, 0, 3 }, + .idfall_det_en = { 0x0080, 5, 5, 0, 1 }, + .idfall_det_st = { 0x0084, 5, 5, 0, 1 }, + .idfall_det_clr = { 0x0088, 5, 5, 0, 1 }, + .idrise_det_en = { 0x0080, 4, 4, 0, 1 }, + .idrise_det_st = { 0x0084, 4, 4, 0, 1 }, + .idrise_det_clr = { 0x0088, 4, 4, 0, 1 }, .utmi_avalid = { 0x00c0, 10, 10, 0, 1 }, .utmi_bvalid = { 0x00c0, 9, 9, 0, 1 }, .utmi_id = { 0x00c0, 6, 6, 0, 1 }, From patchwork Wed Aug 30 13:36:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 719275 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F3DD1C83F1D for ; Wed, 30 Aug 2023 18:31:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236114AbjH3Sbg (ORCPT ); Wed, 30 Aug 2023 14:31:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244648AbjH3Nis (ORCPT ); Wed, 30 Aug 2023 09:38:48 -0400 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 815741B1; Wed, 30 Aug 2023 06:38:44 -0700 (PDT) Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-401b393df02so55079695e9.1; Wed, 30 Aug 2023 06:38:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693402723; x=1694007523; darn=vger.kernel.org; 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=MBe21p78bEGeinGOeEZ5dbYwb28pfpjkSo3Y7gdPnoA=; b=S97wPEASr2Xy94umC548KggN8JMp/Wx8RBV2dCr552Ic4zvqT2/4+Ia5o8cNtLaIsF X+3YSlUx8QCLt0ThrAqxPYlemxx+lY4TQHPL9yIgNqQvwtJkPPeMnO7/tbbgMKo2PDIW +hjjGxNdA4cQD4j1m4eaZVDSfobL1TUKVJ06e8FiuG4W8Xryf4xiq6PjLv/dQcOLtXIy /kbYLUQv4g9ZQSBbMgbuxeEA8uOa/haUIDmtoZ95akymILgp5hc6fih1cIo/QQxQej1u k1RPvOLBaX8sdoZn681KxMmTB8WDFpFn49eCNAiVF6ZkJUbuTf7egRpBQMYNP6yGLRzN 0uVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693402723; x=1694007523; 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=MBe21p78bEGeinGOeEZ5dbYwb28pfpjkSo3Y7gdPnoA=; b=JXZmO6Hq8/3GzLsFioqr9FYJ6MRzizTEOqTDWwqrJ7WGiAN5Bv+n0OoOZeosNPmSWl xBr8YmWZa2Mu1RhE3fYjwa/3FhGDWcWteGWcMKPxwsRTrAeqU2CFQDN8d3Tq03UP/YaV rhxXaatBHOsg20+qj50AVv1Ik36h87QluDHH7r9MjMH4EyVKclAX84n70Dyw75cQcdn1 D06DFnfIguOIrWSUymEd7LmbHZih9XTMr1NDiHLgoGtYPRR8pf2BulxOLzCzLhlioGIr O4OqPUBRy8enQj+k83ytLNXIUQpVL2XQ2fEGpJCA5bC52NA0cVr/5EfY1Tqv54IX1QcE mQlQ== X-Gm-Message-State: AOJu0Ywu7dHn8Y6QKl/khyfudk+vo20vpi0vSxXHsKB7oEVxlum+DIeW zdgY1qOX20KsI3C0ZI0V6A== X-Google-Smtp-Source: AGHT+IEpDe6p2bk26/qpet9gXv/RWnuOE+JScc/Osk+9IK0/HLUMMbVMFqo56cM5drEZGpVyQ+6BZQ== X-Received: by 2002:a05:600c:21c5:b0:3f8:f382:8e1f with SMTP id x5-20020a05600c21c500b003f8f3828e1fmr2026172wmj.24.1693402722599; Wed, 30 Aug 2023 06:38:42 -0700 (PDT) Received: from U4.lan ([2001:9e8:b963:7410:17bb:6f65:50d0:b82b]) by smtp.gmail.com with ESMTPSA id x14-20020a05600c2a4e00b003fed70fb09dsm2326343wme.26.2023.08.30.06.38.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Aug 2023 06:38:42 -0700 (PDT) From: Alex Bee To: Kishon Vijay Abraham I , Vinod Koul , Heiko Stuebner , Conor Dooley , Krzysztof Kozlowski , Rob Herring Cc: linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Alex Bee Subject: [PATCH v2 2/5] phy: phy-rockchip-inno-usb2: Add RK3128 support Date: Wed, 30 Aug 2023 15:36:23 +0200 Message-ID: <20230830133623.83075-6-knaerzche@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230830133623.83075-2-knaerzche@gmail.com> References: <20230830133623.83075-2-knaerzche@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add registers to support the 2-port usb2 phy found in RK312x SoC familiy. Signed-off-by: Alex Bee --- drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c index a4a1716e67bd..9ea08be533cc 100644 --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c @@ -1374,6 +1374,53 @@ static int rockchip_usb2phy_probe(struct platform_device *pdev) return ret; } +static const struct rockchip_usb2phy_cfg rk3128_phy_cfgs[] = { + { + .reg = 0x17c, + .num_ports = 2, + .clkout_ctl = { 0x0190, 15, 15, 1, 0 }, + .port_cfgs = { + [USB2PHY_PORT_OTG] = { + .phy_sus = { 0x017c, 8, 0, 0, 0x1d1 }, + .bvalid_det_en = { 0x017c, 14, 14, 0, 1 }, + .bvalid_det_st = { 0x017c, 15, 15, 0, 1 }, + .bvalid_det_clr = { 0x017c, 15, 15, 0, 1 }, + .idfall_det_en = { 0x01a0, 2, 2, 0, 1 }, + .idfall_det_st = { 0x01a0, 3, 3, 0, 1 }, + .idfall_det_clr = { 0x01a0, 3, 3, 0, 1 }, + .idrise_det_en = { 0x01a0, 0, 0, 0, 1 }, + .idrise_det_st = { 0x01a0, 1, 1, 0, 1 }, + .idrise_det_clr = { 0x01a0, 1, 1, 0, 1 }, + .ls_det_en = { 0x017c, 12, 12, 0, 1 }, + .ls_det_st = { 0x017c, 13, 13, 0, 1 }, + .ls_det_clr = { 0x017c, 13, 13, 0, 1 }, + .utmi_bvalid = { 0x014c, 5, 5, 0, 1 }, + .utmi_id = { 0x014c, 8, 8, 0, 1 }, + .utmi_ls = { 0x014c, 7, 6, 0, 1 }, + }, + [USB2PHY_PORT_HOST] = { + .phy_sus = { 0x0194, 8, 0, 0, 0x1d1 }, + .ls_det_en = { 0x0194, 14, 14, 0, 1 }, + .ls_det_st = { 0x0194, 15, 15, 0, 1 }, + .ls_det_clr = { 0x0194, 15, 15, 0, 1 } + } + }, + .chg_det = { + .opmode = { 0x017c, 3, 0, 5, 1 }, + .cp_det = { 0x02c0, 6, 6, 0, 1 }, + .dcp_det = { 0x02c0, 5, 5, 0, 1 }, + .dp_det = { 0x02c0, 7, 7, 0, 1 }, + .idm_sink_en = { 0x0184, 8, 8, 0, 1 }, + .idp_sink_en = { 0x0184, 7, 7, 0, 1 }, + .idp_src_en = { 0x0184, 9, 9, 0, 1 }, + .rdm_pdwn_en = { 0x0184, 10, 10, 0, 1 }, + .vdm_src_en = { 0x0184, 12, 12, 0, 1 }, + .vdp_src_en = { 0x0184, 11, 11, 0, 1 }, + }, + }, + { /* sentinel */ } +}; + static const struct rockchip_usb2phy_cfg rk3228_phy_cfgs[] = { { .reg = 0x760, @@ -1749,6 +1796,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,rk3128-usb2phy", .data = &rk3128_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 }, From patchwork Wed Aug 30 13:36:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 718734 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7856BC83F1C for ; Wed, 30 Aug 2023 18:32:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229572AbjH3ScL (ORCPT ); Wed, 30 Aug 2023 14:32:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244649AbjH3Ni6 (ORCPT ); Wed, 30 Aug 2023 09:38:58 -0400 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4ADA1B0; Wed, 30 Aug 2023 06:38:55 -0700 (PDT) Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-401d80f4ef8so17034245e9.1; Wed, 30 Aug 2023 06:38:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693402734; x=1694007534; darn=vger.kernel.org; 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=keE4f6mexSCLXM3y1/CVIDHktCoAT49bvVYyDIq2rlk=; b=lcBYyHO36eHVvlPS7rreWF9KHs4XhmDbZZVqpuPnDBnj+QkjJtA1jq0TIAfYH0+WG/ 0lW4vnCqngd4l/d8D6kjXTNccTo0N52jdJNJfKddO1GEv0br2hCOBnzdLu3R76xf9y/X zsqkevGnt+U2fh++S/KUYBb+IVTxsjizjvB+DqJ/cMHoAGr+71oaYQyOrN1Rl1A/1qrp vHsoccjtA5zAp7GLIRfZKK5UH5eEGvcxgUEllmaisFUFGWuzvMhac010B9eqO2vqEL3a /Ba9n9WB1iU7a4kb2REDNPgnWqwt7RQRiFe11/kPyUl0A/UeVnAxp3zPATQn3iY6nFfX Cx9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693402734; x=1694007534; 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=keE4f6mexSCLXM3y1/CVIDHktCoAT49bvVYyDIq2rlk=; b=e3VA5wxvvuwdqxYqj+lAwv/jQW6l5dpxa8pvxaCfutzPGRUF9XA9+iDIBlegbpV4RP mlIDLmaWJXijihPgv2la5aZE5bQRSqB1qW63cuvWQkwHvwq8AOAouiDN6loF18uUQRIa ZCvSY4olHSxrQ+OClldfla2W9kzjGqMiJ7+gXfBaQn0K2DmFwvj4dHgE6DZimKToubE+ atXDPlg2EJVinCD8Sxkro+2S9PgMTOBb4jh7j8XcnjZDRi8UO2p6NWcUWBMnE8qUp1mW N+oKqSPN2LJhcE4dv0lcy/BRiZ7H/uysB8hBkX7gQTez1/KuKD+u7RfyioXN391iyVo6 N2pg== X-Gm-Message-State: AOJu0YwAILQ8Gn6Q989FxxiE1fNQfUIBz6d01lu9brXzfLw/v7qTxpJd A5oc8NJw9tkuKHpQ98x5xw== X-Google-Smtp-Source: AGHT+IG+zDL2Fad/PcYWzK8AWbmBY6SajXktKNR9JFgpXu9PXUdpkMssQC419M+Fo44nVjAKZAIyug== X-Received: by 2002:a05:600c:446:b0:401:bbeb:97c4 with SMTP id s6-20020a05600c044600b00401bbeb97c4mr2026162wmb.37.1693402733905; Wed, 30 Aug 2023 06:38:53 -0700 (PDT) Received: from U4.lan ([2001:9e8:b963:7410:17bb:6f65:50d0:b82b]) by smtp.gmail.com with ESMTPSA id x14-20020a05600c2a4e00b003fed70fb09dsm2326343wme.26.2023.08.30.06.38.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Aug 2023 06:38:53 -0700 (PDT) From: Alex Bee To: Kishon Vijay Abraham I , Vinod Koul , Heiko Stuebner , Conor Dooley , Krzysztof Kozlowski , Rob Herring Cc: linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Alex Bee Subject: [PATCH v2 3/5] ARM: dts: rockchip: Add USB host clocks for RK3128 Date: Wed, 30 Aug 2023 15:36:25 +0200 Message-ID: <20230830133623.83075-8-knaerzche@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230830133623.83075-2-knaerzche@gmail.com> References: <20230830133623.83075-2-knaerzche@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add the required AHB clocks for both the ehci and ohci controller. Signed-off-by: Alex Bee --- arch/arm/boot/dts/rockchip/rk3128.dtsi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/boot/dts/rockchip/rk3128.dtsi b/arch/arm/boot/dts/rockchip/rk3128.dtsi index b63bd4ad3143..ffe99db0eeb7 100644 --- a/arch/arm/boot/dts/rockchip/rk3128.dtsi +++ b/arch/arm/boot/dts/rockchip/rk3128.dtsi @@ -109,6 +109,7 @@ usb_host_ehci: usb@101c0000 { compatible = "generic-ehci"; reg = <0x101c0000 0x20000>; interrupts = ; + clocks = <&cru HCLK_HOST2>; phys = <&usb2phy_host>; phy-names = "usb"; status = "disabled"; @@ -118,6 +119,7 @@ usb_host_ohci: usb@101e0000 { compatible = "generic-ohci"; reg = <0x101e0000 0x20000>; interrupts = ; + clocks = <&cru HCLK_HOST2>; phys = <&usb2phy_host>; phy-names = "usb"; status = "disabled"; From patchwork Wed Aug 30 13:36:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 718696 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7CD77C83F30 for ; Wed, 30 Aug 2023 18:46:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235834AbjH3Sb1 (ORCPT ); Wed, 30 Aug 2023 14:31:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244650AbjH3NjK (ORCPT ); Wed, 30 Aug 2023 09:39:10 -0400 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1207B1B0; Wed, 30 Aug 2023 06:39:08 -0700 (PDT) Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-401da71b7faso15774595e9.2; Wed, 30 Aug 2023 06:39:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693402746; x=1694007546; darn=vger.kernel.org; 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=jpHx+qT44al35s/p87ISMBhXkrOuDfFp8hT6ok2goWA=; b=pXyjkbepxllaHGGOJFRD+wAJyoXKcRoiCk9L87dcryAv+mIBybv7x3qNq2dTICE84q G1zRfyiqMWavkXZO6GDs6r0XKTaLnMWLCNM1W6PZ+pXPEmoh5ZPq3FQCE6O0ReBmS74d jQ05CIFrx24Sh5rNo0AcKDNbztbZX+vZH9NHRJvebhzGPZ8gTwKtMZvY3y0BhifcBO1N +o81xuAdKnRTopevqzlW4ByWOoCuU363XFCLQRQL1WYGttOyjGC38vgeFEWaDzehSGq+ Niyqh3kWxTpSaVtCCFqjg89AFqph8klGiJE8DSbB6mfmBh40JiJSE4JFgZt7tiqKMS3Y xnag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693402746; x=1694007546; 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=jpHx+qT44al35s/p87ISMBhXkrOuDfFp8hT6ok2goWA=; b=EK8A+0R7sLvJqHTii9RUyWJRkmKLHQq0eUXeUhfCVARLZurp2TlVElGIToc+gyVxF1 0WN7FM9z6p83U2uqGhQIUv53ROi+pzQwduyxTojlSz57pRVF+lebja0dN2SMiw4Gr93X tDKq0yFFoR0K+s9ZfV4gN7vSCT6FqhmeJZMKG9BfVGH0zHp5X7YOgCBfqOCrf5SGlvGf 8Ar/guAO+MUeWVUnc1X2klORVQUw/swE5DbBf8lGEwryXwuZ0rIOBq3GM7fx7z7dnzcQ u7j7bhtfMvcnXJhLKod+0dsMHAszlMtVMGjwrUFV+VJAGxz8Hwx0SXRuoUMZApq+bBlx M/YA== X-Gm-Message-State: AOJu0YwKZnTtnXcxCIa2CxOsO36eZOoFXIeJQ03sG8bTgsfGXKVhOY8i pPsEV5diFjs3jG8Edp4w6DV0pcZFHw== X-Google-Smtp-Source: AGHT+IHlbgEqDyyYbfZ8/HjulLf6EuL2Xg3HoOLu/KNL1vlY6Ux5XdymCeYFIwfur9uJlNX+2El4AA== X-Received: by 2002:a05:600c:3651:b0:401:b1c6:97d8 with SMTP id y17-20020a05600c365100b00401b1c697d8mr1981597wmq.35.1693402746347; Wed, 30 Aug 2023 06:39:06 -0700 (PDT) Received: from U4.lan ([2001:9e8:b963:7410:17bb:6f65:50d0:b82b]) by smtp.gmail.com with ESMTPSA id x14-20020a05600c2a4e00b003fed70fb09dsm2326343wme.26.2023.08.30.06.39.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Aug 2023 06:39:05 -0700 (PDT) From: Alex Bee To: Kishon Vijay Abraham I , Vinod Koul , Heiko Stuebner , Conor Dooley , Krzysztof Kozlowski , Rob Herring Cc: linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Alex Bee Subject: [PATCH v2 4/5] ARM: dts: rockchip: Add dwc2 otg fifo siztes for RK3128 Date: Wed, 30 Aug 2023 15:36:27 +0200 Message-ID: <20230830133623.83075-10-knaerzche@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230830133623.83075-2-knaerzche@gmail.com> References: <20230830133623.83075-2-knaerzche@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The driver currently won't probe correctly if those values are missing. They have been taken from dowstream kernel and match those of other Rockchip SoCs. Signed-off-by: Alex Bee --- arch/arm/boot/dts/rockchip/rk3128.dtsi | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm/boot/dts/rockchip/rk3128.dtsi b/arch/arm/boot/dts/rockchip/rk3128.dtsi index ffe99db0eeb7..119e89fef2a2 100644 --- a/arch/arm/boot/dts/rockchip/rk3128.dtsi +++ b/arch/arm/boot/dts/rockchip/rk3128.dtsi @@ -100,6 +100,9 @@ usb_otg: usb@10180000 { 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 = <&usb2phy_otg>; phy-names = "usb2-phy"; status = "disabled"; From patchwork Wed Aug 30 13:36:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 719267 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 24B94C83F2A for ; Wed, 30 Aug 2023 18:32:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235023AbjH3Sco (ORCPT ); Wed, 30 Aug 2023 14:32:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244651AbjH3Njn (ORCPT ); Wed, 30 Aug 2023 09:39:43 -0400 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F2D01B0; Wed, 30 Aug 2023 06:39:40 -0700 (PDT) Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-3fee5ddc23eso52508305e9.1; Wed, 30 Aug 2023 06:39:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693402779; x=1694007579; darn=vger.kernel.org; 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=pL4AHGqRwUAH2UbRxdk/07qkcSparuw8rJPg7HDVZLk=; b=fiPKj1qHsPPAn3Hnz19vDw+kMjhjPoxYh69l4pIL41vMR3q5GjZOTOAyPi9oUFN0ce 8u7xT8cylnF619LcYbP39H5KkBEvX09TkuwK7BbGxVlj55Ld6lOy5kvMRfg02PZLT+Gs 75Av1YNleEDKtQVKX6gz8boDP0iyL2kv08vMwPkz2eXovVa/FmF9ejcx2GZ1WJkYP9wM sTlnjO2Cvgi/O55+Hzz4lcjOU7nE8wMSrVhVxzkq9eC/ekoZ47hOztAWaDhOpbO4up85 E9aJSDWCzet8V4D54JM9Tt6vuGFqTUScLIwtoDAwnR1hCvRhl6yfXt3pzWNIyYbC3sMy d3mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693402779; x=1694007579; 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=pL4AHGqRwUAH2UbRxdk/07qkcSparuw8rJPg7HDVZLk=; b=CGx7Mdvs+YIVUbK4jrNr1Dp4s7yLmJB4OWSm4LhbK8JTzPm23dHYl6gF2+VkgFIvTK CLsp1ScRdlgfkOKm3de87gehk3/370tWA8fwxmymbzYW7WDuqy9pZDG6PF8+yKoGLneC cmKPOeWFY4Ahdn5Eh7SXmVjfx/LUjhvadqx/3Fv1NnRduNnHq0bhcipMPGkIIgZe7mTl ku5WfdepepAUkeJkeJPNf0pMWfg7g6EtLqCgasGHZT06mcWGx0b25TVBki+7hlprsxeQ rOYSO/7KWmy1GbFSHgTEC4yWFVb/ye8FxngzL5mZL0k/gakSm+xqadT8TwMQbfFH9CAa iZsA== X-Gm-Message-State: AOJu0Yycq5pnpFbJZgylCvZ4ZCy/HFFspui0Nrym7Lqi2i29ko+hiUXD q3O7cgc2KE+gVFsLf8FfZsfH+5+UFA== X-Google-Smtp-Source: AGHT+IFmTJWYc2nF+k9N43mdYv3DixoSSezT3uaOMI8tivzPwvZJqspYDXCwnJy0/2KKR2+BqsD65w== X-Received: by 2002:a1c:7307:0:b0:3fc:9e:eead with SMTP id d7-20020a1c7307000000b003fc009eeeadmr1931954wmb.20.1693402779110; Wed, 30 Aug 2023 06:39:39 -0700 (PDT) Received: from U4.lan ([2001:9e8:b963:7410:17bb:6f65:50d0:b82b]) by smtp.gmail.com with ESMTPSA id x14-20020a05600c2a4e00b003fed70fb09dsm2326343wme.26.2023.08.30.06.39.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Aug 2023 06:39:38 -0700 (PDT) From: Alex Bee To: Kishon Vijay Abraham I , Vinod Koul , Heiko Stuebner , Conor Dooley , Krzysztof Kozlowski , Rob Herring Cc: linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Alex Bee Subject: [PATCH v2 5/5] ARM: dts: rockchip: Make usbphy the parent of SCLK_USB480M for RK3128 Date: Wed, 30 Aug 2023 15:36:29 +0200 Message-ID: <20230830133623.83075-12-knaerzche@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230830133623.83075-2-knaerzche@gmail.com> References: <20230830133623.83075-2-knaerzche@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Without setting the parent for SCLK_USB480M the clock will use xin24m as it's default parent. While this is generally not an issue for the usb blocks to work, it becomes an issue for RK3128 since SCLK_USB480M can be a parent for other HW blocks (GPU, VPU, VIO). They never will choose this clock as their parent, because it currently always runs at OSC frequency. This sets usb480m_phy as SCLK_USB480M's parent, which now runs and outputs the expected frequency of 480 MHz and the other blocks can choose SCLK_USB480M as their parent if needed. Signed-off-by: Alex Bee --- arch/arm/boot/dts/rockchip/rk3128.dtsi | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm/boot/dts/rockchip/rk3128.dtsi b/arch/arm/boot/dts/rockchip/rk3128.dtsi index 119e89fef2a2..5590af6f42ad 100644 --- a/arch/arm/boot/dts/rockchip/rk3128.dtsi +++ b/arch/arm/boot/dts/rockchip/rk3128.dtsi @@ -113,6 +113,8 @@ usb_host_ehci: usb@101c0000 { reg = <0x101c0000 0x20000>; interrupts = ; clocks = <&cru HCLK_HOST2>; + assigned-clocks = <&cru SCLK_USB480M>; + assigned-clock-parents = <&usb2phy>; phys = <&usb2phy_host>; phy-names = "usb"; status = "disabled"; @@ -123,6 +125,8 @@ usb_host_ohci: usb@101e0000 { reg = <0x101e0000 0x20000>; interrupts = ; clocks = <&cru HCLK_HOST2>; + assigned-clocks = <&cru SCLK_USB480M>; + assigned-clock-parents = <&usb2phy>; phys = <&usb2phy_host>; phy-names = "usb"; status = "disabled";