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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AA0ECC433F5 for ; Fri, 15 Oct 2021 01:10:40 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C855461164 for ; Fri, 15 Oct 2021 01:10:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C855461164 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1D2CE837B5; Fri, 15 Oct 2021 03:10:36 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="clPduiPy"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 79A57837A2; Fri, 15 Oct 2021 03:10:33 +0200 (CEST) Received: from mail-qt1-x833.google.com (mail-qt1-x833.google.com [IPv6:2607:f8b0:4864:20::833]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C91AA837A2 for ; Fri, 15 Oct 2021 03:10:28 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=seanga2@gmail.com Received: by mail-qt1-x833.google.com with SMTP id v17so7489273qtp.1 for ; Thu, 14 Oct 2021 18:10:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:subject:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=eIC0WQLtO7WDFhD36sMqTGOaL3B2ZiJVqPUpvhbS6Fw=; b=clPduiPyp8NqQlhc+/WQrNdQewyEAlehdYpbpNntXkselmgBq5ppL3d9t3r/ZINpHo 7Ty5CdMMpajov4JrIlbK1T+QKhigx/TMVlDbTZ0j6pD9Ny6lZWRZ/A/hUuY9VxWn36R8 K3dnwK16D2vY1bba/Wo/vMQ8/dXOr+nxSxg9JMl38xstN+52PA1bVqDBpNQQ+AGO+nMy nYR4u5ZcLNXVZDBXQnIsJwO8HSAAwtGgRH1Czi7VcnC0dYt19h17oQJvelZTbux7nXcg osT89gihyGr6STGBp8k2GZWm0upDSFd4uG1T7avCvZNZ17/p2vL/nEGXU+U3wiTXzbid t1Og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:subject:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=eIC0WQLtO7WDFhD36sMqTGOaL3B2ZiJVqPUpvhbS6Fw=; b=o/WRZL6eLR/zLToDFuDo0BxD1ZtB7pYcbMXdsaiGl0f1W1b9lkXjlqwhOuX+slDf5/ WdyU3GJtq5LiH2aCYgElqc/jOqHlPiTJRKzj6Bhemi8URFMQNZmMc3zRW+rE0ma62QwM +177kUesRL06pfBG3Vf8AkqXU3u1WlzBkqChDMJoWHDhiKf1JD+Q5epSaGCWzzVA1EuC 7ZUaWRBxPrV9zXsuKWVVXXgaGVAPWY8UvBGnNjCahgE+Z+yrOqpxmcPkSsVTlo7cSpUr u2fYTfDo3Yg03O7mRizWe4F+ZcnwH7WvF2BF+3lmnhwHmTWG+lNQ/LnUBTu+osW8jcR1 Quwg== X-Gm-Message-State: AOAM5303fnfTPXIcNGY9RrMQ7YAkjsl2/vbnxmu9BL6g5ds9IfQS9Hw3 1SZd/+/sWMcvB2TLQqYb5m8= X-Google-Smtp-Source: ABdhPJxlTfR7Q5XGKz1e85gGl43jMIaQ2Ao8JCZogViRNWLQ5T2tnWWfxLMQRKsjO2lukRr26alF9w== X-Received: by 2002:ac8:183:: with SMTP id x3mr10419282qtf.279.1634260227605; Thu, 14 Oct 2021 18:10:27 -0700 (PDT) Received: from [192.168.1.201] (pool-108-45-127-224.washdc.fios.verizon.net. [108.45.127.224]) by smtp.googlemail.com with ESMTPSA id o187sm2039141qkf.135.2021.10.14.18.10.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 14 Oct 2021 18:10:27 -0700 (PDT) From: Sean Anderson Subject: Re: [PATCH] clk: introduce u-boot,ignore-clk-defaults To: "Peng Fan (OSS)" , lukma@denx.de, sjg@chromium.org, trini@konsulko.com Cc: u-boot@lists.denx.de, Peng Fan References: <20211013093702.15938-1-peng.fan@oss.nxp.com> Message-ID: <4b931477-50d7-c307-0891-f3a85eaf56cd@gmail.com> Date: Thu, 14 Oct 2021 21:10:26 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20211013093702.15938-1-peng.fan@oss.nxp.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean On 10/13/21 5:37 AM, Peng Fan (OSS) wrote: > From: Peng Fan > > Current code has a force clk_set_defaults in multiple stages, > U-Boot reuse the same device tree and Linux Kernel device tree, > but we not register all the clks as Linux Kernel, so clk_set_defaults > will fail and cause the clk provider registeration fail. > > So introduce a new property to ignore the default settings which could > be used by any node that wanna ignore default settings. > > Signed-off-by: Peng Fan > --- > doc/device-tree-bindings/device.txt | 3 +++ > drivers/clk/clk-uclass.c | 3 +++ > 2 files changed, 6 insertions(+) > > diff --git a/doc/device-tree-bindings/device.txt b/doc/device-tree-bindings/device.txt > index 73ce2a3b5b..fe34ced268 100644 > --- a/doc/device-tree-bindings/device.txt > +++ b/doc/device-tree-bindings/device.txt > @@ -28,6 +28,9 @@ the acpi,compatible property. > Linux will only load the driver if the device can be detected (e.g. on I2C > bus). Note that this is an out-of-tree Linux feature. > > +Common device bindings that could be shared listed below: > + - u-boot,ignore-clk-defaults : ignore the assigned-clock-parents > + and assigned-clock-rates for a device that has the property. > > Example > ------- > diff --git a/drivers/clk/clk-uclass.c b/drivers/clk/clk-uclass.c > index 493018b33e..6bf3179e7b 100644 > --- a/drivers/clk/clk-uclass.c > +++ b/drivers/clk/clk-uclass.c > @@ -376,6 +376,9 @@ int clk_set_defaults(struct udevice *dev, enum clk_defaults_stage stage) > if (!dev_has_ofnode(dev)) > return 0; > > + if (ofnode_get_property(dev_ofnode(dev), "u-boot,ignore-clk-defaults", NULL)) > + return 0; > + > /* > * To avoid setting defaults twice, don't set them before relocation. > * However, still set them for SPL. And still set them if explicitly > Why not just have the property ignore errors? In the long term, it may be better to standardize that e.g. ENOENT means that the clock doesn't exist. That way we can skip setting the defaults. ENOSYS should probably be treated the same way (warn, but don't fail). --Sean