Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1975450pxm; Sun, 27 Feb 2022 07:58:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJwrMI2jDi7rc7Ch9Dj7GwjvdfwuUBgLnf+VwmeHIsiga/E+3dl6UFJGS43suLFqPIO0Q/Ou X-Received: by 2002:a17:906:a2d7:b0:6d3:45dd:bdf0 with SMTP id by23-20020a170906a2d700b006d345ddbdf0mr12826808ejb.104.1645977498695; Sun, 27 Feb 2022 07:58:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645977498; cv=none; d=google.com; s=arc-20160816; b=gYECpVNdWTEkLN4sqTC+rsNur8pLK5arqAq3Vq7Ao5Q+jtBzjpUwQ3b1fqEw06L0Nr ZQzG+Sbx2puIsI3C/wu0MBHV5RWLQpoCW68vc7JSvatxT9pmAnPnjIrqRdKqBQJFUtH5 TnYDv/1GUJTw8cwizOR3PeTT2gVBkyNAJpsBRwXLlGJyUtLF+kLzgGXSik+Hj2HUDUTK Q1iQ+/fBSVfPAz68tGo2dU0DQVuoS6vkmS9j/KSpfj3EtM6Xs1j3RayAVvmGDK90kPZW NBk2jmSWjR2572duPmamJX05d+GmkSlwCAkJxMH4rqy9yJg6toHMbZDRhaDTVotNWvpB flQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ZtUJySmbIWUCXkZt6OYhMWHmPcZgwTz+ISBAU3SmGDQ=; b=kZqzBhxEKzWwBrr58/WLa15x1Zz4Rm9SznEEe9eSSNCdWHrtWNFadQYFm/Pl4rpow4 0Rm2yytoLlualDar+MO4O0zJqNauvCdd6BOgFJKHjjIZmcJdCtLCXfq9AEmErhi/OMh/ 6Tp9TEI6iEFv/3PFL85giouYd++7E+qc12mpfp7hvS/CrNQzaIqf2bqSHvK3Qydf+mrr XdsHk7BLa/HvhG4hINHIZ2wPPukWFaHezFdr3E5WJ75Hvvw4OoWZVr33xl2FaOhwWxk9 TiEFIkD1iOr4zeaUrSCoX9tBIhoH8gkUFkmnFen5XrZUflYdPKPPVbKUQD8VpdcyyAGj Az8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="N/u0A+od"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d11-20020a50fe8b000000b00412c5f554b9si5024275edt.327.2022.02.27.07.57.56; Sun, 27 Feb 2022 07:58:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="N/u0A+od"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231478AbiB0PbD (ORCPT + 99 others); Sun, 27 Feb 2022 10:31:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231462AbiB0Pa7 (ORCPT ); Sun, 27 Feb 2022 10:30:59 -0500 Received: from mail-qv1-xf29.google.com (mail-qv1-xf29.google.com [IPv6:2607:f8b0:4864:20::f29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2B003FBEB for ; Sun, 27 Feb 2022 07:30:22 -0800 (PST) Received: by mail-qv1-xf29.google.com with SMTP id a1so10583377qvl.6 for ; Sun, 27 Feb 2022 07:30:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ZtUJySmbIWUCXkZt6OYhMWHmPcZgwTz+ISBAU3SmGDQ=; b=N/u0A+od7mnhmo0ttIWI5u7uH+VOP2c9hsLk6Rwvuq64MmCYpSUikT2vIoUFHRLRqZ r/nNbb8nJEuaxvG+lwFVbHdMAaQl/aHXMKgUdPnrkmU+p6mF368niIveTyT44NZgNbiD tcgSoRjSqUIzc7UVGKPrdhLRbYZTSwbLWPtMMg5jip9EVZcXGFzbq73HndfBS/zzneLB gYg25f3GfePVUS7hxy422+gIp8HxHACeAQnlOrvGgMawRq8Fs3+WI5Cu7O1z+qe3xFDn wZFVVRZFXTDRH8kl3hBXtCXDrMjskt7w1Spo7ZR1FzxXqr8G/gWpntJNbmCr36MltT2t ARKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ZtUJySmbIWUCXkZt6OYhMWHmPcZgwTz+ISBAU3SmGDQ=; b=EOzB6IF/7k6imGcnZN1T6F9ctDs6QTqjH/qDtQtZtehuoZxvnWwJSiLEEK/SkIoLp8 FEIgkwhs1cwaWoHVHkU/VGAbFoen7MBGmLUfKBcXeFRu/OkwafdGGVk/9CrkrsD1Z7bP 9rB9WofAq63CVfXaAj0c3J71waJdY4VB8eZBHWnC8/qE4Rzohh5YMg7Yq8geOMwPFY9C 3rLmstuzy/4ENPQVulAiUvOMkQ7YZ0QZlWDkrZn0qhnOwJc7Gq/c9f3a4U3rWoG3mnu5 il41LE10TfOAnNSUQwWaMXCkM5l/YzYbZRiyqk59ZvHz90dw5ryBXSwLgwzOryfG8Ot/ gQwg== X-Gm-Message-State: AOAM533L/ZJzLZjEIPtMqs6LGd5FzGYzpXTUfjQPu6MGH1XQhevFS/3a PnzFcEwsc4+wrWeKcUjMZxuaJoowRjbvmA== X-Received: by 2002:ad4:5b89:0:b0:432:e725:2594 with SMTP id 9-20020ad45b89000000b00432e7252594mr5004735qvp.84.1645975821762; Sun, 27 Feb 2022 07:30:21 -0800 (PST) Received: from master-x64.sparksnet ([2601:153:980:85b1::10]) by smtp.gmail.com with ESMTPSA id s10-20020a05620a080a00b0062ce6f3f5d7sm3845767qks.16.2022.02.27.07.30.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Feb 2022 07:30:21 -0800 (PST) From: Peter Geis To: Heiko Stuebner Cc: linux-rockchip@lists.infradead.org, michael.riesch@wolfvision.net, jbx6244@gmail.com, Peter Geis , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 3/7] soc: rockchip: set dwc3 clock for rk3566 Date: Sun, 27 Feb 2022 10:30:12 -0500 Message-Id: <20220227153016.950473-4-pgwipeout@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220227153016.950473-1-pgwipeout@gmail.com> References: <20220227153016.950473-1-pgwipeout@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The rk3566 dwc3 otg port clock is unavailable at boot, as it defaults to the combophy as the clock source. As combophy0 doesn't exist on rk3566, we need to set the clock source to the usb2 phy instead. Add handling to the grf driver to handle this on boot. Signed-off-by: Peter Geis --- drivers/soc/rockchip/grf.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/soc/rockchip/grf.c b/drivers/soc/rockchip/grf.c index 494cf2b5bf7b..384461b70684 100644 --- a/drivers/soc/rockchip/grf.c +++ b/drivers/soc/rockchip/grf.c @@ -108,6 +108,20 @@ static const struct rockchip_grf_info rk3399_grf __initconst = { .num_values = ARRAY_SIZE(rk3399_defaults), }; +#define RK3566_GRF_USB3OTG0_CON1 0x0104 + +static const struct rockchip_grf_value rk3566_defaults[] __initconst = { + { "usb3otg port switch", RK3566_GRF_USB3OTG0_CON1, HIWORD_UPDATE(0, 1, 12) }, + { "usb3otg clock switch", RK3566_GRF_USB3OTG0_CON1, HIWORD_UPDATE(1, 1, 7) }, + { "usb3otg disable usb3", RK3566_GRF_USB3OTG0_CON1, HIWORD_UPDATE(1, 1, 0) }, +}; + +static const struct rockchip_grf_info rk3566_pipegrf __initconst = { + .values = rk3566_defaults, + .num_values = ARRAY_SIZE(rk3566_defaults), +}; + + static const struct of_device_id rockchip_grf_dt_match[] __initconst = { { .compatible = "rockchip,rk3036-grf", @@ -130,6 +144,9 @@ static const struct of_device_id rockchip_grf_dt_match[] __initconst = { }, { .compatible = "rockchip,rk3399-grf", .data = (void *)&rk3399_grf, + }, { + .compatible = "rockchip,rk3566-pipe-grf", + .data = (void *)&rk3566_pipegrf, }, { /* sentinel */ }, }; -- 2.25.1