Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4143314rwd; Sat, 17 Jun 2023 08:06:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7KQUi0wmdSXPbID8P5uXimmuHHFzYf8epa+jp1AiNgJgjCyt8YdUpsaqR5wLB0UzT7S7DM X-Received: by 2002:a17:902:ce83:b0:1b5:33fe:389b with SMTP id f3-20020a170902ce8300b001b533fe389bmr5297745plg.55.1687014407915; Sat, 17 Jun 2023 08:06:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687014407; cv=none; d=google.com; s=arc-20160816; b=wDQvqaulX9eu7zEQyb5aBUFNtzHrl8shPYTZx1VxOGS5FwOtnOxjYvbPkh8WqGNJw1 QxX2BOqSHdpotZ1fn/wgYYvGVjJaVjiv0p99IOxdUq/ekYnrT3BfgjuboMbFZS+ISUij KZ8xdHSB73lnaEg/T42wwiF+hM7t8aJgyWJoHMB8AXCy2kQhS6WMEaCtjleNbrvaGfnk xOpWALNiVuM1fh9qlCWTIGyGNcnSToJo7D567Cbc/y5pa/WVj/0ghfg3F14NahUytw5Z 8rSg7StVK6N0vdqUdO/CqBQZVeBUBd9Qv/pJ5TA8S1JuRLcAnSFEkQtBTHbiQeFI+oUy NbQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=DxuDtvFvk+FS5ZxqzBrYoH5vvu57PyuB3yI11PXnNLs=; b=vny6WMc71079Lb29XB0mV1WF+GrjzfgY86GLrvn9tK1HLhhLrc+cG6ADv324zGjP3p FLywDkDuNgZMNO3+CYx2Q+sXTPzw6Lh9EIn+UPoxC3q3pQg03s9HCyZxchEZ7aAqZPhi dndpMq1caTaeKVprgJgmiicsInOQoMvREUJ3aMVppvX8lG5rE8x+Bmaev5DUIl3NXeSa QflsW/L0o0g+l/ghIdA5UMw0BExqS9ZOFN5cebEH2W6SU89kO3ibXxS0MVsvVqkeBdQ3 QzjwNEpFx7L9go3SzulRLvfNsAjYjT75+4vo/pNcRqxKSnyY2ySyaWuoR5OQHbIf+6Cx 5d3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VpOSFnns; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f4-20020a170902ce8400b001ae469d868dsi3168480plg.651.2023.06.17.08.06.33; Sat, 17 Jun 2023 08:06:47 -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=@linaro.org header.s=google header.b=VpOSFnns; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234005AbjFQOnR (ORCPT + 99 others); Sat, 17 Jun 2023 10:43:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231128AbjFQOnP (ORCPT ); Sat, 17 Jun 2023 10:43:15 -0400 Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88DD11BF3 for ; Sat, 17 Jun 2023 07:43:14 -0700 (PDT) Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-983f499fc81so249656966b.3 for ; Sat, 17 Jun 2023 07:43:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687012993; x=1689604993; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=DxuDtvFvk+FS5ZxqzBrYoH5vvu57PyuB3yI11PXnNLs=; b=VpOSFnnsSBvFtLWzWW3aQMyBPDA0SUBhi+66vXg5x3bq2P03ywhAUVQenj0fdDww5w UJTLGQFZyh6/nukfAmckKXbdBeCBg4prgEukCncGgX8oA2XV+4sXOVp8TTW5637YSByV hBxi1sdBBlgWxI6W43c8/v9EDsa9YVCHXNXPRGc7X0sOCnvIlvCChKK8KDP9ukJb6ACa 7un9ojOPgEyCyD6m7ymwhOETljMYpl0qYo2HgSwD0Q0e0Cf2OrHxj5p6UjPJYFsfW+5K 1H2to9WZjXwtiOTkkVwm666j2hSiodWHFrhy0jV/R9LU/LaITa8B91aUsX2YPuqQi5iT tDYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687012993; x=1689604993; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=DxuDtvFvk+FS5ZxqzBrYoH5vvu57PyuB3yI11PXnNLs=; b=WWehT6ChpWAWPVPV6jHSg7F3N2TwmbQ1SiqbM/9w2zWzEzZXMgSYCaLe6pkNNnAFJp +zL/cqdI5EIS2/qaQGdkMlqrcJunin0jdWSbfo1sTZL/pFOitaAidak8mUgeVMbDhpaV gibunH/FArIUa+5EFc1p3ZamsXANczFQ75CGakdD4R8WG4x9fLUxQhK+8LGoAuV+cSU6 953YtKh5zUuyTrwswJb4+DCyY8/nItlrUU/VhQbqJVLl/Me9EwDmPs/GDDfwzHBpuFs8 BB59ubb6+iysnuyNgK00Ae9vj7oBfoIhj38ebfHnu20gAh6Gg4xUIshmnL/ljQXVayj/ 0kPw== X-Gm-Message-State: AC+VfDxHGLUszVNABq88Dbtu5ewSGy6rRcJQnkEVZgwqYl4dFwshiJsL RDizgop3QL2h3qp2LoH7p0Cl9g== X-Received: by 2002:a17:906:974c:b0:974:391f:ed7d with SMTP id o12-20020a170906974c00b00974391fed7dmr4985575ejy.49.1687012993034; Sat, 17 Jun 2023 07:43:13 -0700 (PDT) Received: from [192.168.1.20] ([178.197.219.26]) by smtp.gmail.com with ESMTPSA id m16-20020a170906849000b0098822e05539sm336114ejx.191.2023.06.17.07.43.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 17 Jun 2023 07:43:12 -0700 (PDT) Message-ID: <05e3ff33-ad4e-d2fb-dfd5-7b5265881b74@linaro.org> Date: Sat, 17 Jun 2023 16:43:10 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH v3 2/9] clk: ralink: add clock and reset driver for MTMIPS SoCs Content-Language: en-US To: Sergio Paracuellos Cc: Shiji Yang , arinc.unal@arinc9.com, devicetree@vger.kernel.org, john@phrozen.org, krzysztof.kozlowski+dt@linaro.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, matthias.bgg@gmail.com, mturquette@baylibre.com, p.zabel@pengutronix.de, robh+dt@kernel.org, sboyd@kernel.org, tsbogend@alpha.franken.de References: <20230617052435.359177-3-sergio.paracuellos@gmail.com> From: Krzysztof Kozlowski In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 On 17/06/2023 15:31, Sergio Paracuellos wrote: > Hi Krzysztof, > > On Sat, Jun 17, 2023 at 3:07 PM Krzysztof Kozlowski > wrote: >> >> On 17/06/2023 14:54, Shiji Yang wrote: >>>> void __init plat_time_init(void) >>>> { >>>> + struct of_phandle_args clkspec; >>>> struct clk *clk; >>>> + int cpu_clk_idx; >>>> >>>> ralink_of_remap(); >>>> >>>> - ralink_clk_init(); >>>> - clk = clk_get_sys("cpu", NULL); >>>> + cpu_clk_idx = clk_cpu_index(); >>>> + if (cpu_clk_idx == -1) >>>> + panic("unable to get CPU clock index"); >>>> + >>>> + of_clk_init(NULL); >>>> + clkspec.np = of_find_node_by_name(NULL, "sysc"); >>> >>> The node name should be "syscon" as the example node name in the >>> dt-bindings document is "syscon". >> >> NAK for both. >> >> Node names must not be an ABI, unless you talk about child of some >> device node. I don't think this is the case here. Look by phandle (for a >> device context) or by compatible (looks the case here). > > We need to get the cpu clock to set the initial cpu clock here. Search > by 'sysc' is the only shared in all the dtsi files since it is the > clock provider node. Why is this not correct? Because device node name can change anytime and your entire Linux driver gets broken. Node name is not an ABI. > I don't understand what > you mean with look by phandle for a device context. Your device node should contain phandle to the other node. > The case of > searching for compatible is a mess since as you can see in the > bindings there are tons of compatibles to search for, then (this code > is common to all ralink platforms). Compatible is one of the ways using ABI. Best regards, Krzysztof