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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 11B49C433F5 for ; Tue, 17 May 2022 15:52:25 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 84ECF83AAD; Tue, 17 May 2022 17:52:23 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1652802743; bh=/BKK9pbvSa+GgpAVeEuSH0kbZBL4mQDx0z9EeLtworo=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=xgPKI8WxrPR6jzEkbz7ceZoC4kaHn+GEnzep+zVUxg7rnHsWl9dz5c+a4om4RKvBs 6BajNI0OvU4tBb+XswkrabH3szcNlzlndQFuw06KIhn2u3BDftIJ6Xs+8VsAeRr532 lwdmriEmZQXnR/ak6XXi6txkIAZ9xWp9IWW543mDMykcn8ZyxmLIL2Kgo3K7k5RsEn 32YhllMXvY+PDE9b5AF121rgeINsQaoFso5B+TSBjOeNNPNd1xawGQdDasG7ax5/+3 ESLRtlBepGRUkTaKzLmP01B2A+G+M874vO1KgXhPaO+V8Wk2vOGX6COT2wDUai5DYa aFvlKJhPHoU5A== Received: from [127.0.0.1] (p578adb1c.dip0.t-ipconnect.de [87.138.219.28]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id EBE8483C2B; Tue, 17 May 2022 17:52:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1652802741; bh=/BKK9pbvSa+GgpAVeEuSH0kbZBL4mQDx0z9EeLtworo=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=Gysj/kc9tV9DjgF93vYoHw+kpdfxMOWeMXquGTz1A80mnWsJnf1MyZBtcygO9lwny Z7p04eSsX7gTQ/PglJApLhnTWA5WO/5eyT+4KENKVRvw/sx5zKZPcklnZo71VqwazK Rxp4Xb13fLHq+PMJX10K6GPfyUpct3v2HLlLmvdVPFoABlMnRSrQU6Btx+W87789iy 6ttjN7pvY2HB3sMPlB5JAPQa0LwzRxhK+oXBP/hyShoMpz+geakmrWhMFVJWGRvF7s yudEZ+6NhgeIhZeHtmvizvM4aqv9TJiPJufqnr3NK9sqQ/sQ1ZhxWodc36NXK+P7nh oKhkLIUE1k0sA== Message-ID: <4276003b-7159-db81-b6c6-afc19ad0e879@denx.de> Date: Tue, 17 May 2022 17:52:20 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [PATCH] ARM: dts: stm32: Configure Buck3 voltage per PMIC NVM on Avenger96 Content-Language: en-US To: Patrick DELAUNAY , u-boot@lists.denx.de Cc: Patrice Chotard References: <20220511210933.191998-1-marex@denx.de> <7ee99fd1-b7ae-582d-9f38-91c26619a216@foss.st.com> <2c087855-c4a7-a66d-c504-d6f91f4afbbf@denx.de> <9cd020e4-b5e8-cf1a-180d-6ee556dad878@foss.st.com> From: Marek Vasut In-Reply-To: <9cd020e4-b5e8-cf1a-180d-6ee556dad878@foss.st.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.5 at phobos.denx.de X-Virus-Status: Clean On 5/17/22 17:32, Patrick DELAUNAY wrote: Hi, >>>>>> +static int board_get_regulator_buck3_nvm_uv_av96(int *uv) >>>>>> +{ >>>>>> +    const void *fdt = gd->fdt_blob; >>>>>> +    struct udevice *dev; >>>>>> +    u8 bucks_vout = 0; >>>>>> +    const char *prop; >>>>>> +    int len, ret; >>>>>> + >>>>>> +    /* Check whether this is Avenger96 board. */ >>>>>> +    prop = fdt_getprop(fdt, 0, "compatible", &len); >>>>> >>>>> >>>>> This API is not compatible with CONFIG_OF_LIVE >>>>> >>>>> consider replacement with ofnode_read_prop or with >>>>> of_machine_is_compatible, for example >>>>> >>>>> if (!of_machine_is_compatible(prop, "arrow,stm32mp15xx-avenger96")) >>>>>      return -EINVAL; >>>> >>>> I explicitly don't want to use of_machine_is_compatible, I need to >>>> search for the avenger96 substring in the machine compatible, since >>>> the stm32mp15xx can be anything (15{1,3,7}{a,d}) and it might not >>>> even have the arrow prefix. >>> >>> >>> Ok, I check on existing DT and I found only on compatible with >>> "avenger96" string. >>> >>> arch/arm/dts/stm32mp15xx-dhcor-avenger96.dts:15: >>> >>>      compatible = "arrow,stm32mp15xx-avenger96", "st,stm32mp15x"; >>> >>> But you can forget my proposal with of_machine_is_compatible, consider: >>> >>>     prop = ofnode_read_prop(ofnode_root(), "compatible", &len); >>> >>> >>> But it is just minor remark. >> >> There are multiple other fdt_getprop() calls in both board/st/ and >> board/dh , maybe if you want to do OF_LIVE enablement (do you?), let's >> convert them all at once ? > > > Ok. It is more a minor remark linked to checkpatch warning for all the > added code: > > "Use the livetree API (dev_read_...)" > > > I let you handle OF_LIVE  for your boards (code & defconfig), > > FYI: it is already enable for STMicroelectronics boards (defconfig and > in driver, mach-stm32mp and board code). But look: c387e626147 ("Merge branch '2022-05-11-Kconfig-cleanups-etc'") with this patch: u-boot$ git grep fdt_getprop.*comp board/dhelectronics/dh_stm32mp1/*c board/st/stm32mp1/*c board/dhelectronics/dh_stm32mp1/board.c: fdt_compat = fdt_getprop(gd->fdt_blob, 0, "compatible", board/dhelectronics/dh_stm32mp1/board.c: compat = fdt_getprop(gd->fdt_blob, 0, "compatible", NULL); board/dhelectronics/dh_stm32mp1/board.c: fdt_compat = fdt_getprop(gd->fdt_blob, 0, "compatible", board/st/stm32mp1/stm32mp1.c: fdt_compat = fdt_getprop(gd->fdt_blob, 0, "compatible", board/st/stm32mp1/stm32mp1.c: fdt_compat = fdt_getprop(gd->fdt_blob, 0, "compatible", Am I missing a patch or something ? >>> Do you expect this patch for next pull-request for v2022.07 or for >>> next ? >> >> Ideally 2022.07. > > > Ok, I plan that. Thank you