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: 13370264 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 AD4B5C83F16 for ; Wed, 30 Aug 2023 13:38:59 +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=1h3awoqSoanKa0hT+kv2kTRNlmZnBbHJ1FTgAxH/Cmg=; b=rTQtKN+K66+n3l qojQ1zvKDKeTzAY6Thd5mXpAk12yAys5vlDuqm1KSf62eArHLORdvDHMKIMDuGPwyan0OeUUv4btI kPua6pdVUepTwhPJy/qBiMbwLidE9MQyfHf1cSy0p6GCbtnFSCvcRpeLinCtD/eVr4ko4841DtQox KVkk6QKgC4TfeTn2A43nzX8rUgDs/nVONmy6Jcq0EfGNGreKY2pDhh/TpyXRE5bBf0hdH/cPsCZ+i /3FhUN67+vvmdkEcse1ONi8dkoMrolIfzWVd7PdgrN4sHSLju8A08gdKXyNYjrdemJ3VRvhG9sTLw UZx+TbANNmn1brz9SUdQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qbLP0-00DaX0-2H; Wed, 30 Aug 2023 13:38:34 +0000 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qbLOw-00DaVK-1r; Wed, 30 Aug 2023 13:38:32 +0000 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-401ec23be82so5797795e9.0; 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=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=G5g221ge6JqMTWTGX03yPTFswnlhrFAyzkz/jRpc4xU=; b=b/Tv1QSzN/guGu4edludMq0RDuniybPNQELEaZTqymDewaHBvzAmHh5VHsqbkquNyt 5sC4/w1s6sbHwNd37MYQM/AArms5IlGOib+TyqcyggEOvxFGzZPTNjfn3hRqmUTEY5LE a4lcK20B2p+aLKsNMucKcF2ZyjHx5JOLRIxjVkTcyxVsS2G/tIr98/yGKe6exBpom1bx v/3PmH70KNI92Qt2sDzmBRhwoC8xdCIUjmNRY0OwUv61KWrTGhkOWxE9ifuyfsbCwDSo dWtudkON5qLK+esfKn2CPpvXTWM37bKdWVsYgkMFp4wvgaxlCH7VTXEyzgTtBz1BdDbp LzEA== 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=HzV/zUNQZjbCU2eDEpv2rZInv674kUkuDKGqDiHPfLIbnKVqBXz2tE7aD5LcyKVBKi ugKUOTZ80KUoE44T7Hmm21wmN+ZLUkIgIVnzWAZxIpJn8al1lPYAxa613K4sB2mPwOAg +W4Djq7GUNWcSl65MwOLEs3KjMPMSHM2Naq/GYtkPcBvoPGB4OFvRuuDQlcHrU7UPPOD PS3422FhTyhgoQW+TDqhy15hmR6+ULpGLH+MgSPn1W+swCrm3HlXgOI8OIKM6AoHpU7I Mhk29hx0+QKYi4AYr0DtWXalISvowBEcEzAfXoNIG0612Mwt/DWzECa3NGL13zOOnRwL 072w== X-Gm-Message-State: AOJu0Yy/qcbq8I0NkZbA3/w6deAVuQa0w0sT+7XLQStLKHGB83arOsfS E/wHlsOk0hWe4MpPCqRfqQ== 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230830_063830_633829_1F948E00 X-CRM114-Status: GOOD ( 18.58 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=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 --- 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: 13370265 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 CF007C83F01 for ; Wed, 30 Aug 2023 13:39:12 +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=Z/VEKtFsydvqECUU9TAlE9EZIvS0LOWMlyNjNBkQVeo=; b=FhMugrutyz8e/B JVAi2TFOADw3BVHLl1dyZWIUEOCSaeBZPhq0m1V9KRqOmBzTT39r9qy26TGMNMVC5UNC3bA0wN0RT onDJFZHhiVa1IR/i5j5zKlkTT0Red9pNTUH6/fo/nHrACSzQXeD93YXmrn6MLJoMuJKkYmZh21Su4 OjxQ6QmK3OLzQNv4JA2tGXbiHvQQ+PAVLNh9DXqTt/tr5XXRdeRjbKXMHVfQfdIaNrJ8iI+EZnW+6 uiCg+xEbW3lY++MwgK968Mzu2DI9V22Tja9cKoTN/h6BPOri8WJKvkj0UVhOIMj9ZYdLQjeWSGZuV 01nHNgXDkfoazffKvMgA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qbLPF-00Dacj-1C; Wed, 30 Aug 2023 13:38:49 +0000 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qbLPB-00DaaZ-2Y; Wed, 30 Aug 2023 13:38:47 +0000 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-3fe4cdb72b9so55385475e9.0; 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=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=MBe21p78bEGeinGOeEZ5dbYwb28pfpjkSo3Y7gdPnoA=; b=bW8l1UdsJ16GQn5VpGXyo1Y0YFnA2Hp+gBCeF0HT4uMHZ66AQQOBIez72D4n63TgDs a4w8sw2UvTAbr/PoYvfiEwIhozEdNAsOalkJgGXC4sJP+jzcbZQZWPj/ByIulSLMpjvN JURBvbq+GJxXVAtWyrvYyV/4giEgKuAuyQcRSB8j9e8LGBZ/OXv0mSa3peA0DvAJEY1S vpvO2dYkuvA//kH/b1GjQJYiWfwb+0c7m7bJ1S2419GBjZHTRQ4xX9YwGrB3FTMITFdl TtV4+rGGkd2dIYYUg7tkFi24LBy5meFcrmEHsW0XAyQGXun2QvhUxaMbiN8yyhba+eTE d3GQ== 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=IPaSOc6I5N09IJ2i/ohqbnfCYsiWo+fbHrdbzfb4j1cXul6QTlIoSA1IO6UU01kaZe danDLUCXe2FKpU3qrX1N8Z2a4PC7bxeIjkgSnvnC4KIpfJ9ZPRQMYJyFDnVzWaCmfdA9 e60vC9N14ZWB2FFlUmptawPKZpnc+H5derclLCZIqUikePdB39EakSmVpiRvZhVY0noh xheiBH9bUaBokYg9E1wLorMnBFbOwZ8r8LkAx848nmFO5HLlFTddACrPowxeSq/Pwiso 74ZHBvRvCI0Tip1rTkvPbzsaM96N9jfpuM6iMigzcufMGQjgfIU5pWhnuCsUh2USr9g2 J41g== X-Gm-Message-State: AOJu0YwqnNdR7QbYfJOJCloENMmxdzakw/9ekr3GL3nfUgFlgOpzjSRj 9mPXDpnb3lgBgRUrt3CEN00QJYASXw== 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230830_063845_830435_AE1D5E41 X-CRM114-Status: GOOD ( 12.67 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=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 --- 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: 13370266 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 4B747C83F01 for ; Wed, 30 Aug 2023 13:39:22 +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=8XOoh1B4NdpmgIcxncKGNt3mO9/+kYhtlqpWdEkSgns=; b=ieNP+sDAjplzs+ X0fe/CilFtb6Lafr0GdOIGMia0+SEA6s/kkWfvCUW+/ZRo/88t3QP/6NKXHIl3O9C3b/5T5MDBdYQ sTdT6E89Hoqi7XgSmb9TDn0gMC7XVcmOjs1BCrt9oStDE5F/ZwUhQlk0QbZ41eWUQ9mHsNkh4lNXb EEpQHVzBJXOqN2jzrtaHgpkMfNEhIw0kGmZfWqMqILXlOIL3sHZGwnOthYHeKhHz5ejlpQovI6NaD /Oes8lt6LiW9ZEFfxJ1CLEFr8Mrg7yvAgRXitOJafjAX+b/fPMMW5BQcKAZL15QZ5KPBorq70SuaV sA9oOozHJ6TcKE8jnMeg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qbLPQ-00DahH-0H; Wed, 30 Aug 2023 13:39:00 +0000 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qbLPL-00Daeq-1f; Wed, 30 Aug 2023 13:38:56 +0000 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-401bdff4cb4so44658795e9.3; 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=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=keE4f6mexSCLXM3y1/CVIDHktCoAT49bvVYyDIq2rlk=; b=jgYOPEtSuxYpskNiio05W2xk+nnMcyXtmoIN7LpgrFWjwmmlQ/Ybvz+NQnRmKkiYGJ oorUlTBH4S2jDD3HfD4yHXhJ4NYirnO4d5igYYqzHvZ301Z9hKBnfeOWsMnGPWZYu2C+ +kRFlVd854Z8wrAkvsDckGRsNqhCtKRQHenSw3fQ4rJEh3bCiasEm0QTiEBXQlIh7m2h nFyO5juxNVUCDKPggR6Vyy2G/95JcTxGn678GGF5YsF4xRBE7FXxp8zfJMY3xSSUqHwY Gw/LLz6TPrgCsf9QVEReHRl75bZjRyyazg+wwPyNdGLTX0O6aZQPxQmQehC1123oIEi4 AGZg== 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=cF8RnIZV8ucIwgcwMO+W7t+p4WFu/AR2LlOdqAljeZaK4oxT2jq1C9ejREJIfPjaMo 6aCB9DCB1SCCpIGdnGcqBjxuMCLOmyyOeOeAtqVjMgl3lJ3j2iNUsMkQYC8fuhe2Ex6W eOR9N4Hs2mB1fkxJGa7J78QA1pwlFMSr6Q5FCWS4KZOYlmWsxizeE8Mo1qIUKFMouSER i7ioMbaqpf5Z7LdOB0Xzh/YNw24vb+tmq/Dql1wRBdI5Mt32zK6i5w5F7K19i6A7HcYO HqTkdtzxulr8jvizmPS9oZMjJFCiR0veI+Una5mEZW3VvwHc6Hw44TL2Dkb4Vm7EId9l idhQ== X-Gm-Message-State: AOJu0YxrBqpAz3ACUGzLQomgM9Z10AFLeG5W4bddvNQxve7/MOqaV+Bt gCYzaAcyFvztvogHNedh2Q== 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230830_063855_557766_F4430514 X-CRM114-Status: GOOD ( 10.34 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=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 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: 13370267 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 B3D18C83F01 for ; Wed, 30 Aug 2023 13:39:33 +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=nDj/UCjhYhvUDnqw1knFSmJWc5xZvEzBTZGKf8/pr80=; b=VklVkOUAUnSylF nP6X4KaN6K0xG/8SNktP6G0tSIw0jpA+ZPC6BwktEkYT+S4Rkhh49jyK7OBrTlfhTXqONSEx3oOpz stJAnelYWyGVR8ZEN+dganNTGbC8ZCDtdjRsqxZ9OImDzSWL7OtWAdkncs5NORP4o9IaZ5np+6+E3 ubQs9SzuNpXr344B7XEQWRx2a3A/epfmac2k96AErKPrO20K578aaN8VpImmAvCFmtQGbHeld1EE5 2DsnFay0W/uS7mZrFfxpiwHUExLAiZqQx+R6gJXFv5yl90gHSzOeTOcHMVQGT/nWJkP3KYnUU0SOr QOeIvaml4LcURYoA4smw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qbLPb-00Damd-37; Wed, 30 Aug 2023 13:39:11 +0000 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qbLPZ-00DakS-19; Wed, 30 Aug 2023 13:39:10 +0000 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-3ff1c397405so54969145e9.3; 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=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=jpHx+qT44al35s/p87ISMBhXkrOuDfFp8hT6ok2goWA=; b=o7Nsp99clx01gzONdxtZZyAiH+q2G5ABBBsvJBaZkb3uodrNTqvZlnJfXjCT3V9OxC u+FqIG1zcThHqFyphKu3T3OtFvVroaRVw2MXgjgzpG5zimUfJ0bqR55LnsYny6mj7ESA d4ydnwVMjVdjzrjsiqsYL/45QrmhNObpNR0ihWpqtIP6QJSHcmZFwIxemjNiFlrzcdWA LtT3N/v1GA3+CzLGdbSnXPPNY0scXrgRdm7xr94yHddgvTV7xHexYZ5pFoo4Q/YV+8K7 XQxigGGmtYO/SUOLVTdKvmxZWcRrzdoCs13Jb2mZfvN6z8lfNZgJUTWBfvq1ewru0ijK 1x+w== 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=YQunG9wEO1aBNuaWp1j1La2JulVJfUq0IMpoEjHxE4Rzpni85HaDsmEr4oAb9+YXtx Xw6CxGXLvERQTcnZaQhdn9m1f5kQNxEZ+NJB2ajqbimcwVmiHO4LbUk5J18KcKXrP3Lx GZV45mtRX/wTSHLGlyI3Q3rM44hexxDXs3IeEFeQLsXAN+G1xuusacfu+FtdDqiGDYWx vXdL2i+eeRon8FyF2LaoMQ3IzDSV21dzfK4RMYnUr66oH8kp9pyK59raTabSoa7GF3t3 QHlGmfqEQhPTZx/zU+TGx+sUS25s+gMBZy1NLw5ccg3vxz3eD/JbhtT9nRlIICgH1ckU 7lmA== X-Gm-Message-State: AOJu0Yxl6KnzF+IH06A3Oi5xEXredMWxz0cqjVqPj5sA76Lw/JHQlDbO KJSUECb7FwxdPMI2E/5S3g== 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230830_063909_398563_CC984DF1 X-CRM114-Status: GOOD ( 10.70 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=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 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: 13370268 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 97C2AC6FA8F for ; Wed, 30 Aug 2023 13:40: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=RIWGyf4Opkuf7U7wNaAUAZza7jaNc/XhKANHzvzW/eA=; b=e3YYt+6DqsXvK4 N5Ag4qmKv91P2+paCmNyevVjXazZ/CwGkD2e1HbYG2Y6U0uCT4IlxfZhdJ1i8NnMldWXFhVIeMqnB b3hdM+pPezevXdxbhwz/h4pw2+Be0OLJA5OtCv6sQQQgSxFf9Bghbm9QWco5Uq6LoL8UHCKxx/KLi ymVQx+5KiNlal+Q9GD9xYfhibWYQuQ8zKLhYT0Rc1eBUtWuB3TRlCODD9AKndQ99hXFwzE/LHf4qL BCDklAaC1lbexyWsy6iF05oCfRd9mT6a9lefPDqlwOWHl1s4mJAAqHaBXjHsTen47vnZkS7SVdQDY PaQAMyotKCPqj1Dpl3Sg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qbLQ9-00Daw1-0o; Wed, 30 Aug 2023 13:39:45 +0000 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qbLQ6-00DauT-00; Wed, 30 Aug 2023 13:39:43 +0000 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-40078c4855fso52421815e9.3; 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=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=pL4AHGqRwUAH2UbRxdk/07qkcSparuw8rJPg7HDVZLk=; b=K06o9T5UXLsJaL7dPOh+4XLbpqPMa/beBxjZY6GWklkw3mGDaC8bjhT2E+GHDSbWkS +uI95cVQ1YBJl5/npSXGJPjS98rhqHHkWvnpB1DJCosOPaL3m5N9OD4Yw6PGjwGobzAy qvrAFs619Bt2IPghYRZzJAfJUiZoHZaq6HtTmhdl1aQhLSZVQpWB5TVPqIpZb33RKPg8 2jY4PhcMw6ti/pnztpTVSsY3fGmxgKIcOQjghxrPeBS/nywaivmJtex66/wfpg62slo1 hBaK51PvaVpkujU/wpwPPIz4OEZEcqj3yoH1wI9iC8+9OC0UDGVh18+ZRD3Sw80+vd6B CLEg== 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=JazShL+YKUGWKduucs9lSMw6JiYesp7NCfeDDBQUshQvTXGcczRTrX99lMBOydll+l 2PP5kCN60Di7WTVpWa0BAKkoYUr5JuZ9U7V/7jloCpOL75G27MBjoC5NZE0cXLoWCkl8 CkoMrMIyb0UvjeWwQKQpP2GQgZZfq5/+mLlSfof/lO0L6yiy2kpP88796IBDCyFAd68g AreDtppqrK7PctQ4CFI/2LglEvtPfug5K9LJvS+EMtGj+PnZtwoKSYHpzRsHj2mvcy/h 6wV7CrdxJXxUena2jpMXRAi6ahjWxDPacHoBhbHLVVCdD8EuLymQVhVxHtH8EtJq5blc 7/2w== X-Gm-Message-State: AOJu0YyTtuH2VOkmiveMaxrX885NdxCKxyo9YNskV3VlD9nFqs3198Tt iPcX2YydTarfwTkytAKR6Q== 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230830_063942_038059_DB9DB094 X-CRM114-Status: GOOD ( 11.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=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). 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";