From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B99C9EB64D9 for ; Sat, 17 Jun 2023 14:43:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232091AbjFQOnQ (ORCPT ); Sat, 17 Jun 2023 10:43:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229745AbjFQOnP (ORCPT ); Sat, 17 Jun 2023 10:43:15 -0400 Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BB8E1BF8 for ; Sat, 17 Jun 2023 07:43:14 -0700 (PDT) Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-982a99fda0dso250875666b.1 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=DHuTEqt0nhV57AdCCq8QZBbrxOBf7kINPmCAWjP5KEt3zpnJSOtd/yQyn6IE7EcJjx YsMhMHoxqa3EYgX3YqtoxosW5msY4h9aTh3P/1g1cpOtD7kbsheA8AaJJ3rO9SmLDPpw e4HR4D1szryPJ33fYo83f8gcWFs48zKMYNAppx89MOekXVYDYWNnE4Z9T5H3c1vr8qgM afkCa0PS4rLZaGyE2tBwNWDfB17XDrhTDvlFa3htW2ReZBMG1B/bvsxQKoWu6w1BQWLd twkdnh0Gdjun0WhMbsOSGdaQNMXodFLOboTnSEfYQ/U0M7FhDBpLfmRr8Phs+/s3bedZ Nz7Q== X-Gm-Message-State: AC+VfDzBWELPqsYa7pVvKAh3/R7wz2jYWGi5ua2NnIvT7CFV/FPDOc8k uA5EMCB1W9zqWgD+PYQV93Ih6g== X-Google-Smtp-Source: ACHHUZ44aQAgx90PnJ1fhu41Pp+l7HVQRihaNMQVx42ZOKPZxYWQZVbgtSl62M7dCXYwOR5WTJmUXQ== 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 Precedence: bulk List-ID: X-Mailing-List: devicetree@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