From patchwork Sun Nov 19 12:13:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13460430 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9D9A5C5AD4C for ; Sun, 19 Nov 2023 12:14:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; 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=gv35OkCpgvE3bC9cJhEmHfh08nUYamWKNDXjem6R960=; b=SRdFdPLF95vtkn Ot5z6iezu8FyqZoBlAGTmvQDAr9Ck1sj0lCjBblEqwJ7Oeb9Pl4+TGiVb2tDZVOLwUiX+jt+5BIlP PBGbXPhimmXRR2DZWiGyk7HJniJghsSWbb/9qcalQjj6B8OzQdK3nkDvH0M5jaKJjfLPr4W55rsnE TKMTn5npp2sul7KEcG/QcFcdgu1m88GGTOyk/JTkUn1qw3sUvJV17cO7nObAj5YYmkQE6NDnEcohM Ifm/Z+HzpGgcewQRjHpZV9wFhUW8LFkdQx7Z+2UjEpAs8dtmwqC2aSBsePrtiC0rzsBLwLfttdC2+ LfV0fKsHP4Gx5YkIZXgg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r4ggU-00A9BW-1J; Sun, 19 Nov 2023 12:13:54 +0000 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r4ggL-00A97G-2H; Sun, 19 Nov 2023 12:13:50 +0000 Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-5484ef5e3d2so2720384a12.3; Sun, 19 Nov 2023 04:13:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700396024; x=1701000824; darn=lists.infradead.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=YVr7goYhFLlmDZmc5xEl9s20CmZbe4+FAt3N2E9piDg=; b=iDgXrT+E4kEZQYbrEXZlQt+CGp2ydTgoMXISX/V8D0+PDP2t+/lM/JRG/ITIToN5NY IkQEILIKBnhTDGlYE5JR/w5r7jO2gxsbjTr9uQUXEJkpuGIbXs36gP6JgxSxsqwzwnZx 78CeA4IiNfJceG45Jm7RXutt2hFYKWSLCNPp4TJv0U2obWVaz51TdJ//z6qvTal+Hb2O +xGyFsd+71Fz/Fg6GxcRXaFWnDDd571hqN0uoEEE9oqvWDqIW+Sqt/nc2joOqOUlidBo USHAYKfJeJeoHJJzxyWT4g/rHkZdPeUJWK8RVwtQnB3pE/DH4fDHLMp7g7KPucAKlvKy Bt0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700396024; x=1701000824; 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=YVr7goYhFLlmDZmc5xEl9s20CmZbe4+FAt3N2E9piDg=; b=eqT3k22ilWbZigtM9SSaiprXE/sh/PD4U8lZhAfZAn3qZJEZ7u7bzIlsiWfqUOd1sS BUtpnxeDYgfF7j3A4b1F0Pbw7CAQ+AiYHypJppOIMl0FnAg7JJd2BqWf5mUwAqu2/SK4 yivkOEgvatUuYMChnCOzX4QBwpTZpv2TYtkHCzUGyIzrGY3Wg+jPuoFT9UFhzCSc2UMz fRP/ko29J64TRTc1bQnskh8hjlLZMCaaLl43agrs+kJS82AyAKAXdQPMZ4by2fTz6Q4D qRi8iBGTOZt0l0wsvcS6vu77LHBlwUNrbga/MXPTsJ4fjummPjVGgI/RmREYYtHwBv2i mNfA== X-Gm-Message-State: AOJu0YzuiVgV+h6a9M8IAaS1vYjrtAnV8jPePjG33x+1Xza0CKf39iol V+mGw6akKF7YOKE3iWKWOg== X-Google-Smtp-Source: AGHT+IHBJU9wdIXPTCBk407dwoGGEi1XpoVY+fEgUXOjjM0NXJSTbbLeARn5Up3BUus6sIH24XikDw== X-Received: by 2002:a05:6402:64f:b0:548:4dd2:aa58 with SMTP id u15-20020a056402064f00b005484dd2aa58mr3510536edx.28.1700396023758; Sun, 19 Nov 2023 04:13:43 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7017:f42c:e243:8c57]) by smtp.gmail.com with ESMTPSA id r5-20020a056402018500b0053dec545c8fsm2523634edv.3.2023.11.19.04.13.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Nov 2023 04:13:43 -0800 (PST) From: Alex Bee To: Vinod Koul , Kishon Vijay Abraham I , Heiko Stuebner , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, Alex Bee Subject: [PATCH v3 1/5] phy: rockchip-inno-usb2: Split ID interrupt phy registers Date: Sun, 19 Nov 2023 13:13:36 +0100 Message-ID: <20231119121340.109025-2-knaerzche@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231119121340.109025-1-knaerzche@gmail.com> References: <20231119121340.109025-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231119_041345_773490_DDC3D79B X-CRM114-Status: GOOD ( 18.83 ) 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 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 Reviewed-by: Heiko Stuebner --- Changes in v3: - rebased on linux-next 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 a24d2af154df..b5a1d30df83a 100644 --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c @@ -123,9 +123,12 @@ struct rockchip_chg_det_reg { * @disrise_en: host disconnect rise edge detection enable. * @disrise_st: host disconnect rise edge detection state. * @disrise_clr: host disconnect rise edge detection clear. - * @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. @@ -146,9 +149,12 @@ struct rockchip_usb2phy_port_cfg { struct usb2phy_reg disrise_en; struct usb2phy_reg disrise_st; struct usb2phy_reg disrise_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; @@ -488,15 +494,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; @@ -1030,11 +1048,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); @@ -1524,9 +1547,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 }, @@ -1587,9 +1613,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 }, @@ -1634,9 +1663,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 }, @@ -1700,9 +1732,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 }, @@ -1739,9 +1774,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 }, @@ -1770,9 +1808,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 Sun Nov 19 12:13:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13460431 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AC41CC5AE5B for ; Sun, 19 Nov 2023 12:14:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; 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=4Jy5AGToFeNVW2UIL0jqOuKDyvl5knCmPRAhpmMoTH4=; b=NJsOiM+q/MAr/N ebbQBKqAqJHMf4nf2T89IAi6IPjqi9o4dmBVSQSDBbLBJIruwcyeIhl9SYa3axVVVU0vSaW5YF3yR CoVt8lRycl5XzmvMEts9Sb2vmujk1xY6tSK5LjJHpSHtNpOsd1CJ8ix3ul84lQhxDfVAW/lBq65Uc smJ3dWrtefoP2W/neujf1k/wpwxLxS4LZoZaZr2lzgc3foNJWTHjOOZQDEWWySLFqyfq0tgrolYy0 2ayNhmur1ZFFUo7qE5bA/z3fbLVDA7WbNLqBwUJ2jZl6ptF2dThm6isKKvg2X8KmkWILV36PWkI8F 9eey6ONY0TmpPZK8zCuA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r4ggo-00A9Nb-2l; Sun, 19 Nov 2023 12:14:14 +0000 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r4ggR-00A97H-1n; Sun, 19 Nov 2023 12:13:53 +0000 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-9df8d0c2505so660414666b.0; Sun, 19 Nov 2023 04:13:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700396024; x=1701000824; darn=lists.infradead.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=no0ZEH8MGlw8tJ6htWoDUR170bNw3QI+/YlLRVV4UwA=; b=WJe/+inEQJtjUjgqwP7aLXEVXSos11yWtdzNN4RdZciI35NgdipWAZTs3b1zK3EUcA 6vKNQH44V37HSrHJcLWX9A5j4GQllvkJ7l+bXTIaVLMNSjhXUetE/Oda856Gk1Lkv+ub mmFNiiwgw6192iRxWIb6DF7kGjjlRNCVk5rDxpghzY0/f2QJtiYb9C/K5swToKTQRCf2 bMfA1dAxvDbBHYF2SMpf6opbyCxwUHHM2SBE/04EXsZVB/9rKtIpb3+lBR3ObCJoFkOz qQXcmpQCiA0+zHiKtd7PiI3Oe+Mx+bnt108UDFdPnRAKpQkiweDzrUmTdtPy/4n6aAKb 6rRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700396024; x=1701000824; 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=no0ZEH8MGlw8tJ6htWoDUR170bNw3QI+/YlLRVV4UwA=; b=jvjmpQczKOoAPEbqUTRM8GrMuz0aCAqHpiFFRYkOx20fzZOGiwPViImE2KEwhvVSVk e4YxT0Avum1aap0hwSHm6Y/u8mbjd9Vwxcu82AXeWOZVQnyTPKWKWDMY9zIeZL57Jc+P SlCZkNi63K5zSn2u26SYp29DaFQCNrwhXVgX7MY6QJp7AXtBmv0GV3ktsl0YQKY4bw8q gj+yroFK1YrvzpoBwjAvOY0yERnYqkw2Bufrz5c3tezjck44xAW63kkm8iphEwVzlIG6 jEQLh1pJSC8zzhozLJBvUkjh9y1jOOkKxc3mjqKNLHq0pUtfBj8JlazAFySnP3B97BwA FgMg== X-Gm-Message-State: AOJu0YwEz0zGfFxvnTHRvTE/30PgefC/bciX2PccwAu1jxuU8IZOxDIB +bSZ9yfOgV3tBY4dQf6GVg== X-Google-Smtp-Source: AGHT+IE5Dvqdr2Ny9LGLGrJSKCUknctB4NV8cQ67rYxxrcFo45ijhkxFmGxHdUJx/gNi5Y0mq0frIg== X-Received: by 2002:a17:906:f1c8:b0:9e2:b1a5:1d2 with SMTP id gx8-20020a170906f1c800b009e2b1a501d2mr9817275ejb.27.1700396024531; Sun, 19 Nov 2023 04:13:44 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7017:f42c:e243:8c57]) by smtp.gmail.com with ESMTPSA id r5-20020a056402018500b0053dec545c8fsm2523634edv.3.2023.11.19.04.13.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Nov 2023 04:13:44 -0800 (PST) From: Alex Bee To: Vinod Koul , Kishon Vijay Abraham I , Heiko Stuebner , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, Alex Bee Subject: [PATCH v3 2/5] phy: phy-rockchip-inno-usb2: Add RK3128 support Date: Sun, 19 Nov 2023 13:13:37 +0100 Message-ID: <20231119121340.109025-3-knaerzche@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231119121340.109025-1-knaerzche@gmail.com> References: <20231119121340.109025-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231119_041351_593109_78F11E9F X-CRM114-Status: GOOD ( 13.99 ) 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 Add registers to support the 2-port usb2 phy found in RK312x SoC familiy. Signed-off-by: Alex Bee Reviewed-by: Heiko Stuebner --- Changes in v3: - added phy_tuning-callback for RK3128 drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c index b5a1d30df83a..4f71373ae6e1 100644 --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c @@ -1487,6 +1487,14 @@ static int rockchip_usb2phy_probe(struct platform_device *pdev) return ret; } +static int rk3128_usb2phy_tuning(struct rockchip_usb2phy *rphy) +{ + /* Turn off differential receiver in suspend mode */ + return regmap_write_bits(rphy->grf, 0x298, + BIT(2) << BIT_WRITEABLE_SHIFT | BIT(2), + BIT(2) << BIT_WRITEABLE_SHIFT | 0); +} + static int rk3588_usb2phy_tuning(struct rockchip_usb2phy *rphy) { int ret; @@ -1536,6 +1544,54 @@ static int rk3588_usb2phy_tuning(struct rockchip_usb2phy *rphy) return ret; } +static const struct rockchip_usb2phy_cfg rk3128_phy_cfgs[] = { + { + .reg = 0x17c, + .num_ports = 2, + .phy_tuning = rk3128_usb2phy_tuning, + .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, @@ -2031,6 +2087,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 Sun Nov 19 12:13:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13460427 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E44EBC5AD4C for ; Sun, 19 Nov 2023 12:14:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; 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=fMfyb69xL9CAp/5ef+M0P/z8vTFwLfCkOb9V8/cYIP0=; b=mWYvMEDrSimriV vmQmPIr9MDvWLE7tAEbYqNEAEOgERS9f0U0RkwmZD1oOSdBKANPX/aVm15bYAGOBrewAlB/Tnv0uV Qh3Ir42gHH9EeK19/l4mpYomwHS5pbwgC3KHvkLFRaCVttQ2nowktSnIGFwH+8Kn1MlcCusTNs6C+ 345Z/R10k+eD7CGmgtbuwCTCe4NqwZI1XjN1BaTIHuQbFW8zviXAkjOfy5tgO4DD0ejo7v45uihP4 O93b22sN5zgk6zZoaD2s+hSaUr6bI9/I773K9m5LgdZg1T+KsnhMQMjei8mp99/+Bu/q0tWwsMa8l jMRUO4xbL8SkI9M6kiZw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r4ggh-00A9JE-2s; Sun, 19 Nov 2023 12:14:08 +0000 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r4ggR-00A97j-0g; Sun, 19 Nov 2023 12:13:52 +0000 Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-543923af573so4971447a12.0; Sun, 19 Nov 2023 04:13:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700396025; x=1701000825; darn=lists.infradead.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=aEqOCitfx46o35f4La6fYRBqER5a58teuJqwLm78l4E=; b=PEfOZWu+ZQJHCE2yjKAdQIP2Eft0VZihx/3NH63P5SKR/6hjVCF6Q5XrKki7pAC4BU YyDECBn+fSf0OR8tLfAfm6PmcinLdO/TebaZ+wraIu46MSZ86frZ3R4HS7XleB1hdjn3 oLklUkWkbfRe49nWFP8Y3Slo/4B9gKqjqpwwf6AURLp/wbKvgboKGOQf6RxdRr9fNpba REbVWpL1Xud+Yhnljt2tA4T4vgmk0achTPHMJGiNINFtcYYPe+XytVk7U8JTYk480Eaf TFaYLOqumRm/AUWwpvLSXb+gLpCWbj88YJNToLK7NytC4IHFm8k9IHTHElgtFO/j0rPf 1o2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700396025; x=1701000825; 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=aEqOCitfx46o35f4La6fYRBqER5a58teuJqwLm78l4E=; b=NuKx6cBRjaeUd6K6ilSq8Cp/nSjtr1Y5RwkouiGxrVgdbZ5XN5vo/iFS/xKa0ALqgC z3VxsGTWClmlPwuQuMY8qbqwls6ydh0IyAf8QpuMfjdr3cVwydKf4p2ZrByNLule1PLN JZS1lZU5d7W/D0DEoVnWV+kyuNtGv+lH74hHYfdxCqZywjiviM1EMthvTNI7yE9zzGvL eXodEWoumbaMtsvPAJu7c6pAi63EK/m26VWquurz2kLJ7q61vNKMohk8XYK8V+jniUrJ ZIvoX11MKfoEEMJTqa4USkUNdcy5HuUId3CYGrNHOwoJgh0D3UIOWx4nCZKciWidCbPJ 1gWQ== X-Gm-Message-State: AOJu0YwWkxlwFlv+mI/T3V3R8pyFIVFXZYogIiUlLox4UxagOFeCic/J zJLk1d80lzYqIiuxv7uoIjw/hBdoTg== X-Google-Smtp-Source: AGHT+IFlSgIwDq7pKQOyz5sqgYMr4kVrxaOq+u+B+t7rw7Vxi00MfzF/rP1xykPMY0b2AkHnswT3Kw== X-Received: by 2002:a05:6402:3d1:b0:543:5f3:c92 with SMTP id t17-20020a05640203d100b0054305f30c92mr3924725edw.36.1700396025339; Sun, 19 Nov 2023 04:13:45 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7017:f42c:e243:8c57]) by smtp.gmail.com with ESMTPSA id r5-20020a056402018500b0053dec545c8fsm2523634edv.3.2023.11.19.04.13.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Nov 2023 04:13:45 -0800 (PST) From: Alex Bee To: Vinod Koul , Kishon Vijay Abraham I , Heiko Stuebner , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, Alex Bee Subject: [PATCH v3 3/5] ARM: dts: rockchip: Add USB host clocks for RK3128 Date: Sun, 19 Nov 2023 13:13:38 +0100 Message-ID: <20231119121340.109025-4-knaerzche@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231119121340.109025-1-knaerzche@gmail.com> References: <20231119121340.109025-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231119_041351_305938_3BAFED95 X-CRM114-Status: GOOD ( 10.44 ) 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 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 7bf557c99561..074dffa377cc 100644 --- a/arch/arm/boot/dts/rockchip/rk3128.dtsi +++ b/arch/arm/boot/dts/rockchip/rk3128.dtsi @@ -163,6 +163,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"; @@ -172,6 +173,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 Sun Nov 19 12:13:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13460428 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EE003C5AE5B for ; Sun, 19 Nov 2023 12:14:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; 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=qnxoQwcqUGCoQ+T2IWdvaMNV2hMRUn7K5lkEjWs8vXE=; b=WB0XBIwUlNWbJA hTLsiXVRr7gYt+Dw5+AvZpBM/Hl3pS791jUGlg/V8J06Tu8/jeaY7IzftbElCnzew3NapgYvkgdoJ bTDlx+MBmJPPO5OfzMsk78XZcpJqZYUmAZ2Aet82Fg1n5KBY/63KqKeG94PHCrzx9qnIQaItTdO2B L4lXW3EC6gA+XjT/r+pVl1185X3LJoyDXeMCoF6lzvd8kFLZkV999Eo+c81OdSih6kJ81NkRGW4KU 6m8znAkBX9jNuznAQYdhy5xWt98K1NtJ0+N3M31NB1utYegLzcvTdLF8fjGFMOeKBF1GE3d1OX28J 6l6MbS9ish1XbbL6OEbg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r4ggb-00A9Fv-0R; Sun, 19 Nov 2023 12:14:01 +0000 Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r4ggN-00A97k-2C; Sun, 19 Nov 2023 12:13:51 +0000 Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-5437d60fb7aso5072522a12.3; Sun, 19 Nov 2023 04:13:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700396026; x=1701000826; darn=lists.infradead.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=wFwnZSi+N4JIV79XXnkhp+/hoZIyLal8XhxbYAVRQ04=; b=d7KZxIOuGhotrrE4PkT63cof5I9Wxf5DuL6vUCTK4HAB7aDnxQEPkVe+ShS/MNIvbe YT+L3b9G97Unxu15c2z9YWPQlLstzG0YqfKSdLJLQB7TjUlDHD0oY0taJpTSknobU01a zqQxnab9VEcDuVI5sXliFNXX4H25c1XH/pEp7v15Bw61ho8+k/BJKFYeE5AehIMXEHfK 5XQZWqKqej/hYMq0f7F7VDnkcSJCHv60TUFgcMDrORL8qXYKMIGrL6mazfe/824LTN4Q phSjqbiJA8HkaXCiFLCpikPJM4OxCgckVHILE+FqjBs7R1S12fkQ7cq886I7A5GlPR7B Z1Lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700396026; x=1701000826; 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=wFwnZSi+N4JIV79XXnkhp+/hoZIyLal8XhxbYAVRQ04=; b=WT43HXMD7OnM0AygN5hAbKZatD/qYF46HVDeq12beQBopVimM4yh536hVEEjmYD1Ot +IjPg5yEWXY2Dg2Z9+AdhtOnwWOaVTGvoKN9AFIlI6Gw1TYmOjx3QjSTbbFVhwysj8L9 5Bn9IXwVaiErbvXv/fkvEBSXJ7Avs57PaFJwOpvYEzeQ/ws213ZuLrzuU+dheuplagMB 3Qiut4+6Hzve4JDuMl0kVnF/PbF76HhjsQm75mbMpmzMkJPyZeKGlB8CTXqojZB347/d bsNnfwkJt1YDu7153r3EIAO0CmAwV/Cb08vzrgP+56CnqR3X+Whis/KhgczADtyWTLTm dmZw== X-Gm-Message-State: AOJu0Yzu//WHTGrc6GuhBgfSYZaS4vIp//qja/bAGbjOjNcpMXcu6zJe cQtmbZCzzrvzKngyF8SIzA== X-Google-Smtp-Source: AGHT+IFa1MdSQwDpFizg9mjE0jro6ti3S0NsdG4dJFDLIacwN3M11znKrlgdju1QRwUDDleLY9D5uA== X-Received: by 2002:aa7:c0cd:0:b0:53d:f072:7b0a with SMTP id j13-20020aa7c0cd000000b0053df0727b0amr3531026edp.39.1700396026174; Sun, 19 Nov 2023 04:13:46 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7017:f42c:e243:8c57]) by smtp.gmail.com with ESMTPSA id r5-20020a056402018500b0053dec545c8fsm2523634edv.3.2023.11.19.04.13.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Nov 2023 04:13:45 -0800 (PST) From: Alex Bee To: Vinod Koul , Kishon Vijay Abraham I , Heiko Stuebner , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, Alex Bee Subject: [PATCH v3 4/5] ARM: dts: rockchip: Add dwc2 otg fifo siztes for RK3128 Date: Sun, 19 Nov 2023 13:13:39 +0100 Message-ID: <20231119121340.109025-5-knaerzche@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231119121340.109025-1-knaerzche@gmail.com> References: <20231119121340.109025-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231119_041347_722349_0BB8A6B9 X-CRM114-Status: GOOD ( 10.75 ) 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 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 074dffa377cc..c8844e0024dc 100644 --- a/arch/arm/boot/dts/rockchip/rk3128.dtsi +++ b/arch/arm/boot/dts/rockchip/rk3128.dtsi @@ -154,6 +154,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 Sun Nov 19 12:13:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13460429 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5B578C072A2 for ; Sun, 19 Nov 2023 12:14:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; 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=PUKIIKN2BgJBMK40KqmjfDIZHS3bR1c024T12laY8CQ=; b=isS6gNjDp8QLWC 9yHpoXMUq+NJbKjVvsXex0X6SNIeeqZrywPQMu8+dKv/UXKDTuBLi+E4qmGziODcQZ87bOUjeuxo/ J5QboGzseZ3XPxO7viK7BEE834HXvSx7JWqrU46MF96w2/pUPhCGsXKfqKpqHyg1ZKj4CFDv3OCAy fFgLdRlcwC+pY1g8PjHKScYbsVwgxDBNWiwsQS32d/TeDOJBAHB1y/PV2OWQFMSLXBtMqE4dqpCEv OgDrj5w0YIun4IcKFyfFdxx7M9GvKpbYEzkQJ+wGFIbkymu4hN+xMtAGJigHVE5bWOatPvyrTKcnR fkKzpVn3Nnpx4zf8BNog==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r4ggi-00A9JX-1q; Sun, 19 Nov 2023 12:14:08 +0000 Received: from mail-lf1-x135.google.com ([2a00:1450:4864:20::135]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r4ggR-00A97v-0h; Sun, 19 Nov 2023 12:13:52 +0000 Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-50aaaf6e58fso597818e87.2; Sun, 19 Nov 2023 04:13:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700396027; x=1701000827; darn=lists.infradead.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=IRvQu7v2aw6b3c6XSPxt/GFQ2vthRnfEbysoDl+IjOE=; b=muQ1boiCbbm2DJQgszfdiI7gJ8yRZPRLCMweKAebvTdz2D+clhXDZ06RyEif83cuLg biRj1ixtjqA9neNWFaJ6Z+KWRinS+O7mUVOMa8Dhbb5hLIetA8WRcG3e/cnd7PjwQT83 8nAeiKj2gXe+JffjXBhFUBiLacVZKlVouCn0dNdh3OGgQwLWFZYFtOcLbtQ/oFvjUI0C Lqp7EJBtcaHuP/61ncPivi14CA4OkxhU4Py055hy73LxVUYoxRKL+4zYgKXxb5zG7O6Q WxrTC9m7bby79TNind/yNvoqgpK/gY4XsfkM+CyT7qNZGf1V38RGhAgHVosRckmmxBVA PsLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700396027; x=1701000827; 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=IRvQu7v2aw6b3c6XSPxt/GFQ2vthRnfEbysoDl+IjOE=; b=bF5xkqpX+Ptgk4jzRPfHIxtf9dNbyWtvGE5NtDDZ8M1jYWFQyV3fo7YxyhDXjhT3dz Fhxj6JDQ4zqaONfxG/kK848S3sPvXM4GM9uzywTyam0YbE7+lZkDwU6TMjmGhZBOUr1u NTjFBAOPt6uX1hSRh22ypf3EDuPdjtOqJrnzbXvR3RTCuSCr5cceLdeC8xECVksQgSLj qCZG/uJ2QaswH4LNZhTTYKCJsJloOEmxiNdn7ntMiivA7mcLzIL2hIBxvuNrxP/7QxDB iCJFoDDniGBMp5ONX9GZWKa8LR1o7CqMuJlE/2EmRZr2PwFW7loTkd3q3mf3/U3YIXOH vv1A== X-Gm-Message-State: AOJu0YwA8ap1UAw0ENq2zFmGlqBlOyE2Fqpj028dY3u/PJ2GWuH+KID4 UspbvHP65sdnMGMGcZP+H+n2/Us/aA== X-Google-Smtp-Source: AGHT+IFclIkGd4gUltycd20mO39V01aWQkCtlOGJQGc8SY39GQWh+136ifIDd6KIpOUu229lqj1sxw== X-Received: by 2002:a05:6512:485b:b0:4fe:1681:9377 with SMTP id ep27-20020a056512485b00b004fe16819377mr3313345lfb.44.1700396026949; Sun, 19 Nov 2023 04:13:46 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7017:f42c:e243:8c57]) by smtp.gmail.com with ESMTPSA id r5-20020a056402018500b0053dec545c8fsm2523634edv.3.2023.11.19.04.13.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Nov 2023 04:13:46 -0800 (PST) From: Alex Bee To: Vinod Koul , Kishon Vijay Abraham I , Heiko Stuebner , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, Alex Bee Subject: [PATCH v3 5/5] ARM: dts: rockchip: Make usbphy the parent of SCLK_USB480M for RK3128 Date: Sun, 19 Nov 2023 13:13:40 +0100 Message-ID: <20231119121340.109025-6-knaerzche@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231119121340.109025-1-knaerzche@gmail.com> References: <20231119121340.109025-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231119_041351_305954_4C64C67B X-CRM114-Status: GOOD ( 12.27 ) 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 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), but they will never chose it, since it is currently always running at OSC frequency which is to slow for their needs. This sets the usb2 phy's output as SCLK_USB480M's parent and it's users can chose it if desired. Signed-off-by: Alex Bee --- Changes in v3: - moved parent assignment to the phy node 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 c8844e0024dc..61b292c7c4c3 100644 --- a/arch/arm/boot/dts/rockchip/rk3128.dtsi +++ b/arch/arm/boot/dts/rockchip/rk3128.dtsi @@ -266,6 +266,8 @@ usb2phy: usb2phy@17c { clocks = <&cru SCLK_OTGPHY0>; clock-names = "phyclk"; clock-output-names = "usb480m_phy"; + assigned-clocks = <&cru SCLK_USB480M>; + assigned-clock-parents = <&usb2phy>; #clock-cells = <0>; status = "disabled";