Received: by 2002:a05:6a10:144:0:0:0:0 with SMTP id 4csp659938pxw; Fri, 8 Apr 2022 18:28:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzDH6UFw3NnBRi6dFrANKs0i+vjJSChUykVdrpFJJd71GqyauDwhE8Q3Ra6xqYx7A2InYPo X-Received: by 2002:a17:907:1b09:b0:6d8:faa8:4a06 with SMTP id mp9-20020a1709071b0900b006d8faa84a06mr20693618ejc.701.1649467731276; Fri, 08 Apr 2022 18:28:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649467731; cv=none; d=google.com; s=arc-20160816; b=gVCPuBa4A3Kwd0ig8xwSuUtdg/QVwIc+J2jVgguoc95i925AbZ4z/FgHFFko9MaIWN Ehv/npuhngzuVO10D7KbxGDhAjTbZWbXpHegU6MK3eRHGItL9Hi15wjvWVsXzll3TAnM cMCW6XozTMBPrmXvSAxBF0Ys1Jyxrc31aU/UhBtIdO5PuiwGDQLXQ66wY8fi4MnHxc7n Sa3MW+fsRLrsjIMVlPYxCSmeAnDeuOsrRZjmu31kDfOHUF9UBwwtsBjWQa78HmY+yCWz jeoj6UjWxvbtDO2oMtKORSiDnKfUmSbaINLYMOP5C3JXfs938fS2nljetAD+MX6ofPGm QI6Q== 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=WBFnDVsDLjId5Fj0PoZdyIDzK3g+Zip9twvAd8wgGWqQaRoR8CkCOXxC0T2sGzwKFX 6RuBU4cUSivcmr7L8w0D0eqCMoiNm1ymvsSDxxVflOoIDgDeGfbNoddToQ0b9Mr43rbf 1n8KDbNsFzkFMC60dh4MRPHlYgm1RjwYM/tvg9qIraSLtXgxW49wmXyEz8iYzZXp23Bc CTCNUmyXI8Bgrzo0qh07SiCwkYfSps7+YhYKK/S4oDpFI//qTlEa57h9qqz0js7aXlDO 46jJA6iJB9e+jT76bhdqZSQBKj4Hq5Ze3ilUqNN5fu4kQj07YQL7c/o+zVOffJAkd9dv WPzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=gUyAAC9v; 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 r17-20020a1709061bb100b006e82edb8dc9si2206177ejg.986.2022.04.08.18.28.22; Fri, 08 Apr 2022 18:28:51 -0700 (PDT) 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=gUyAAC9v; 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 S235452AbiDHPOy (ORCPT + 99 others); Fri, 8 Apr 2022 11:14:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237422AbiDHPOr (ORCPT ); Fri, 8 Apr 2022 11:14:47 -0400 Received: from mail-qk1-x72f.google.com (mail-qk1-x72f.google.com [IPv6:2607:f8b0:4864:20::72f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CE2F100E29 for ; Fri, 8 Apr 2022 08:12:44 -0700 (PDT) Received: by mail-qk1-x72f.google.com with SMTP id 75so2197354qkk.8 for ; Fri, 08 Apr 2022 08:12:44 -0700 (PDT) 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=gUyAAC9v3ERVIgec02ALPphf34Xi2rpE30HcoIEAl12wO4+4DmF+INCjvNlfP6//bX LwNdSlQN0FMAj17eSK4o8Y4ekWNq0q3JwACdWjTpuD3oUxuhKo+Kd0S7QgbS/V5iNtdN EHH9p8BbZFmm8y8aHyfORhDOffQAIrbvlpYeueXZzHn40gmwlQ7V8qyv+6PgjsmKPr3R 1bjdeg3X4XsKH+97mtRF5tllilSgjXurlrXajiLamwAmN+bqGr9E8VfF2lZlYvNjua75 GPNcU0jkdtcKoBIgMDTYcgSjlkRrtGT/y6H15NVDAkfe/1i/s8WERY/cg4xcGay2LtUB E5Hw== 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=2rJZSGQAeIwfA53pmg/S07SVl9X+/UsCsBTQORiBYy+heYcko8DN1wGRuKY+SrCs9J RVAcG1nJYPJrv73lCqMFDFW2kyGX+8L+6Z8WJv/13pUUIMy2RllNY6p+28p7zPB17Lau CkpxlN+c1an2/WvlKCtDZGD5oaDNQ7diwUGouLlIilJXxEsAMeK/ParR/HbPW6grjMWq Iy2eHSeAr06qny/u3aOlTv5r9BN7peWlq4BBN3z/4YJMQLihp2y9QGu8BA7Ktep7lL/t mz4e+yaxTQ5blZ4x2g0eD0jcWT0ce3yQm+lYx6pwPq4eOMq4QI9w3zV67EMk3QaIgWzN w3KQ== X-Gm-Message-State: AOAM530mBjpHiv9Z9LUnra8o8Xf0Kl5QBdA4f5SkgyWARUuKPx8kEPSP a/oqB2dmrVuHP+g5TiqAmZouFfAz8rX7gA== X-Received: by 2002:a05:620a:228f:b0:67a:f432:af72 with SMTP id o15-20020a05620a228f00b0067af432af72mr13360897qkh.603.1649430763374; Fri, 08 Apr 2022 08:12:43 -0700 (PDT) Received: from master-x64.sparksnet ([2601:153:980:85b1::10]) by smtp.gmail.com with ESMTPSA id 191-20020a3707c8000000b0069a13545fcfsm2266052qkh.123.2022.04.08.08.12.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Apr 2022 08:12:43 -0700 (PDT) From: Peter Geis To: Heiko Stuebner Cc: linux-rockchip@lists.infradead.org, Peter Geis , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 2/5] soc: rockchip: set dwc3 clock for rk3566 Date: Fri, 8 Apr 2022 11:12:34 -0400 Message-Id: <20220408151237.3165046-3-pgwipeout@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220408151237.3165046-1-pgwipeout@gmail.com> References: <20220408151237.3165046-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