Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1184952rwi; Wed, 19 Oct 2022 07:39:02 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6SThoTC/DeasCFsNbebRQGeJW3kGZ2C/Y55oE8BWbeubzaf9PZtJOnrxrmxl7TDZXj2+Kp X-Received: by 2002:a17:902:dad1:b0:183:243c:d0d0 with SMTP id q17-20020a170902dad100b00183243cd0d0mr8845034plx.157.1666190332456; Wed, 19 Oct 2022 07:38:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666190332; cv=none; d=google.com; s=arc-20160816; b=SbLhnAVAq7fdCDgv9LcER+g6LSFkn4hHIAPILFWZ3s4Ny+M7BySdXHAslU6rOpzkSx sL4k/66Rh/s2mEUzDkSvkIU3o9DQQSKSNoxInWfBv189l/4sJxSfBJ50qZfuW0IaJvIR igT5ZC0/dhIuKLQ7LkbXKA4whXZrYqGFlRyVfRSNSRvgCIvEp6NNjK/h7XFdWT5+nNUY NKpdJu7YJs8+8Z7WxrjiHZIUtR8JY8puKvr6hVyE13C0m4p2OnHFC4hKRry8vpRNLPUc eDKlCWZqwE11irAqUM1ItoTh7CsRlo8s0ShJYdQSTLMVVjzqXQX6CRmqduE9rCULBnIL qcXQ== 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 :message-id:references:in-reply-to:user-agent:subject:cc:to:from :date:dkim-signature; bh=mVNYk8Vdw4aAhhCQKszm0+c9Pkl9JnTakpEnR19atF8=; b=Rmcb7U4mOsVCHf0rZ1Q+80eszudexA/A+k5iq62lGO6iM3kF/ypwRdZVgITk74HaVA AQ1Ii6mpXLurd2nhX9fJQwtIqc+XmCibmy2SkiTZXgF4SfhCDEtZCLXlCovlhESRw7vj BPEO+Lpinzl2Ivyj5SuYTKkJroqwQpVufvsa9KuFhRbcEqzye8wQ1PpCl6QQN+DTE/At kGCxQSlVggOBAXTYyjccrceUK49BiZEcL3DtSnFwlxbekDkzKgeLiZ5kMufK9CE/+wMM lYCo5WYj52pa3f7ELlw4+nul+7lEqPggmPnBAMdn8BPTIs7I8XpyFutye2pswyEHXllx +w2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mailerdienst.de header.s=20200217 header.b=JXVqYusB; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u11-20020a655c0b000000b0043a93738a14si18098367pgr.167.2022.10.19.07.38.39; Wed, 19 Oct 2022 07:38:52 -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=@mailerdienst.de header.s=20200217 header.b=JXVqYusB; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230394AbiJSN3r (ORCPT + 99 others); Wed, 19 Oct 2022 09:29:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232864AbiJSN3P (ORCPT ); Wed, 19 Oct 2022 09:29:15 -0400 Received: from mxout3.routing.net (mxout3.routing.net [IPv6:2a03:2900:1:a::8]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A508F1DEC30; Wed, 19 Oct 2022 06:16:25 -0700 (PDT) Received: from mxbox2.masterlogin.de (unknown [192.168.10.89]) by mxout3.routing.net (Postfix) with ESMTP id 52353604B1; Wed, 19 Oct 2022 09:36:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailerdienst.de; s=20200217; t=1666172173; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mVNYk8Vdw4aAhhCQKszm0+c9Pkl9JnTakpEnR19atF8=; b=JXVqYusBRIyNB+wKF2YAh7PaC83HGvBJkSUpOLsltS11pvKdYAc8mDtWi03eVHaqM5F5mc XvQ5dxvKBHbJOAjFuZjrBi7YhD1ELw7RKRU23AGdldqn4Izq/dIgHm24PMgWY+WuC5b0MJ 3tdDOMqeuhmcRZsiD2Xb1XNGDT+5jjI= Received: from [127.0.0.1] (tmo-105-196.customers.d1-online.com [80.187.105.196]) by mxbox2.masterlogin.de (Postfix) with ESMTPSA id 42E10100352; Wed, 19 Oct 2022 09:36:12 +0000 (UTC) Date: Wed, 19 Oct 2022 11:36:07 +0200 From: Frank Wunderlich To: AngeloGioacchino Del Regno , linux-mediatek@lists.infradead.org CC: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Rob Herring , Krzysztof Kozlowski , Matthias Brugger , linux-arm-kernel@lists.infradead.org Subject: =?US-ASCII?Q?Re=3A_=5BRFC_v1_02/12=5D_dt-bindings=3A_PCI=3A_?= =?US-ASCII?Q?mediatek-gen3=3A_add_support_for_mt7986?= User-Agent: K-9 Mail for Android In-Reply-To: <97916360-a24b-0e7d-cc86-9b801fadf869@collabora.com> References: <20221017104141.7338-1-linux@fw-web.de> <20221017104141.7338-3-linux@fw-web.de> <97916360-a24b-0e7d-cc86-9b801fadf869@collabora.com> Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Mail-ID: 8bc0a8f8-5856-4d54-aa98-5d53cb6e65c2 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 Am 19=2E Oktober 2022 10:28:59 MESZ schrieb AngeloGioacchino Del Regno : >Il 17/10/22 12:41, Frank Wunderlich ha scritto: >If this SoC has a different clock tree=2E=2E=2E then you should add bindi= ngs for this >kind of clock tree=2E > >CLK_INFRA_IPCIER_CK is *not* a peri clock: "peri" means PERICFG, which do= es not >seem to be present in this SoC=2E=2E=2E so no, you can't assign it to "pe= ri_26m", nor >you can assign it to tl_32k, as that's not a 32KHz clock=2E > >CLK_INFRA_PCIEB_CK can be a "top_133m" clock=2E=2E=2E as it is gating "sy= saxi_sel", >which is a topckgen clock=2E > >CLK_INFRA_IPCIE_CK is your "tl_(something)" clock, as that's effectively = gating >"pextp_tl_ck_sel" (which is the PCIe Transaction Layer clock mux)=2E > >CLK_INFRA_IPCIE_PIPE_CK seems to be parented to "top_xtal", frequency =3D= 40MHz, >so I don't see how can this be a pl_250m? Looks like being a 40m clock an= d I >wish we didn't have clock frequencies specified in the names, as "pl" wou= ld fit, >but "pl_250m" does not=2E >I wonder if we can change the clock names and reflect the changes to the = mt8192 >devicetree (mt8195 does not have any pcie node yet), and if that would be= a good >idea right now=2E > >=2E=2E=2Eand I've left the first for last, because=2E=2E=2E > >CLK_INFRA_PCIE_SEL: I have no datasheet for this SoC, but if you're sure = that >this clock is selecting the source clock to CLK_INFRA_IPCIE_CK, then the = clock >driver is wrong=2E=2E=2E > >Right now, I see the following: > >static const char *const infra_pcie_parents[] __initconst =3D { > "top_rtc_32p7k", "csw_f26m_sel", "top_xtal", "pextp_tl_ck_sel" >}; > >GATE_INFRA2(CLK_INFRA_IPCIE_CK, "infra_ipcie", "pextp_tl_ck_sel", 12), > >MUX_GATE_CLR_SET_UPD(CLK_INFRA_PCIE_SEL, "infra_pcie_sel", > infra_pcie_parents, 0x0028, 0x0020, 0x0024, 0, 2, > -1, -1, -1), > >=2E=2E=2E=2Eso if you're right, we should instead have: > >GATE_INFRA2(CLK_INFRA_IPCIE_CK, "infra_ipcie", "infra_pcie_sel", 12), > >=2E=2E=2E=2Ewith this meaning that adding CLK_INFRA_PCIE_SEL in devicetre= e is useless=2E > >This clock tree looks a bit unclear (because again, there's no datasheet = around), >but that's what I understand with a rather fast look in the clock drivers= and >with some experience on other MTK SoCs=2E > >Then again, if this tree is effectively incompatible with the one from MT= 8192 and >MT8195, you should have different clock names=2E=2E=2E and just as a fast= idea: > >clock-names =3D "axi", "tl", "pl", "top"; > >with clocks, in order: >CLK_INFRA_PCIEB_CK, CLK_INFRA_IPCIE_CK, >CLK_INFRA_IPCIE_PIPE_CK, CLK_INFRA_IPCIER_CK=2E > >=2E=2E=2Ebut feel free to reiterate that :-) >Hope that was helpful=2E > >Cheers, >Angelo Hi, thanks for digging into the clock-driver=2E Currently i have mapped it= like this (see comment to part7) clocks =3D <&infracfg CLK_INFRA_IPCIE_PIPE_CK>, <&infracfg CLK_INFRA_IPCIE_CK>, <&clk40m>, <&clk40m>, <&infracfg CLK_INFRA_IPCIER_CK>, <&infracfg CLK_INFRA_IPCIEB_CK>; clock-names =3D "pl_250m", "tl_26m", "tl_96m", "tl_32k", "peri_26m", "top_133m"; Mtk says it has same IP block and except missing clocks it is compatible w= ith mt8xxx gen3 pcie driver/binding=2E Pcie driver only enables the clocks = in bulk without names,but binding requires the names property so mapping ne= eds to be correct=2E regards Frank