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 624A0C433EF for ; Fri, 17 Jun 2022 09:00:45 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4B127840B6; Fri, 17 Jun 2022 11:00:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=foss.st.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=foss.st.com header.i=@foss.st.com header.b="LWMta8hT"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 36F758439A; Fri, 17 Jun 2022 11:00:42 +0200 (CEST) Received: from mx07-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D838D83EDE for ; Fri, 17 Jun 2022 11:00:39 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=foss.st.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=prvs=216749672a=patrick.delaunay@foss.st.com Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 25H4o1jU008203; Fri, 17 Jun 2022 11:00:39 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=selector1; bh=LbjTQGB1L2gG2gSO0WpuoiKsnsDXmAz3qPH4gW+E7ak=; b=LWMta8hTEBP2GXZuJwDNv7llQSxa/N7qZFUuT2xCqOqP3VlJIw8US+LfdMRydHhNYTFR GmbCOSKWwTg7ScXUWWl2WdswmxFXCwCBd33YyyGT0N5LHIvge6p0WbTz286Qdcz8c9VJ HGtenWVrpwn84DatbbMxFMlLC0Io0xne1Cyq0mL0xZR1R4eTy5iND+bIF4aourlxp2HW 7tVu9DbGFNXrcpGPrDojq8R1k6HZ9CIblJVrumU3D/e3MWC2E4wIdbRs8ZKItzo8opgl X+ezT5FanGu486pfJnjaGdCYnMk9Amn5PaIyQmt7VnlQLGh5WBmRLXLPaaawjqx4Ykix 6A== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3gqeb14sg2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 17 Jun 2022 11:00:39 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 02DAE100034; Fri, 17 Jun 2022 11:00:39 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node1.st.com [10.75.129.69]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id EE8DF21A20E; Fri, 17 Jun 2022 11:00:38 +0200 (CEST) Received: from [10.48.0.213] (10.75.127.119) by SHFDAG1NODE1.st.com (10.75.129.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.20; Fri, 17 Jun 2022 11:00:37 +0200 Message-ID: Date: Fri, 17 Jun 2022 11:00:36 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH 11/16] board: stm32pm1: add stm32mp13 board support Content-Language: en-US To: CC: Patrice Chotard , References: <20220506140624.445542-1-patrick.delaunay@foss.st.com> <20220506160540.11.I35fae2ba5868b79e66ccef249270e1cf1bf3f04b@changeid> From: Patrick DELAUNAY In-Reply-To: <20220506160540.11.I35fae2ba5868b79e66ccef249270e1cf1bf3f04b@changeid> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.75.127.119] X-ClientProxiedBy: GPXDAG2NODE5.st.com (10.75.127.69) To SHFDAG1NODE1.st.com (10.75.129.69) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.64.514 definitions=2022-06-17_08,2022-06-16_01,2022-02-23_01 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 Hi, Accepted with minor modification. On 5/6/22 16:06, Patrick Delaunay wrote: > Add stm32mp15x prefix to all STM32MP15x board specific function, > this patch is a preliminary step for STM32MP13x support. > > This patch also add the RCC probe to avoid circular access with > usbphyc probe as clk provider. > > Signed-off-by: Patrick Delaunay > --- > > board/st/stm32mp1/stm32mp1.c | 27 ++++++++++++++++++--------- > 1 file changed, 18 insertions(+), 9 deletions(-) > > diff --git a/board/st/stm32mp1/stm32mp1.c b/board/st/stm32mp1/stm32mp1.c > index fff1880e5b..4ba7201ffb 100644 > --- a/board/st/stm32mp1/stm32mp1.c > +++ b/board/st/stm32mp1/stm32mp1.c > @@ -547,8 +547,7 @@ static void sysconf_init(void) > clrbits_le32(syscfg + SYSCFG_CMPCR, SYSCFG_CMPCR_SW_CTRL); > } > > -/* Fix to make I2C1 usable on DK2 for touchscreen usage in kernel */ > -static int dk2_i2c1_fix(void) > +static int board_stm32mp15x_dk2_init(void) > { > ofnode node; > struct gpio_desc hdmi, audio; > @@ -557,6 +556,7 @@ static int dk2_i2c1_fix(void) > if (!IS_ENABLED(CONFIG_DM_REGULATOR)) > return -ENODEV; > > + /* Fix to make I2C1 usable on DK2 for touchscreen usage in kernel */ > node = ofnode_path("/soc/i2c@40012000/hdmi-transmitter@39"); > if (!ofnode_valid(node)) { > log_debug("no hdmi-transmitter@39 ?\n"); > @@ -604,7 +604,7 @@ error: > return ret; > } > > -static bool board_is_dk2(void) > +static bool board_is_stm32mp15x_dk2(void) > { > if (CONFIG_IS_ENABLED(TARGET_ST_STM32MP15x) && > of_machine_is_compatible("st,stm32mp157c-dk2")) > @@ -613,7 +613,7 @@ static bool board_is_dk2(void) > return false; > } > > -static bool board_is_ev1(void) > +static bool board_is_stm32mp15x_ev1(void) > { > if (CONFIG_IS_ENABLED(TARGET_ST_STM32MP15x) && > (of_machine_is_compatible("st,stm32mp157a-ev1") || > @@ -637,7 +637,7 @@ U_BOOT_DRIVER(goodix) = { > .of_match = goodix_ids, > }; > > -static void board_ev1_init(void) > +static void board_stm32mp15x_ev1_init(void) > { > struct udevice *dev; > > @@ -648,13 +648,22 @@ static void board_ev1_init(void) > /* board dependent setup after realloc */ > int board_init(void) > { > + struct udevice *dev; > + int ret; > + > + /* probe RCC to avoid circular access with usbphyc probe as clk provider */ > + if (IS_ENABLED(CONFIG_CLK_STM32MP13)) { > + ret = uclass_get_device_by_driver(UCLASS_CLK, DM_DRIVER_GET(stm32mp1_clock), &dev); > + log_debug("Clock init failed: %d\n", ret); > + } > + => this force RCC probed removed to avoid issue when RCC node is not present in       device tree       can be replaced by DM_FLAG_PROBE_AFTER_BIND managed in RCC driver. > board_key_check(); > > - if (board_is_ev1()) > - board_ev1_init(); > + if (board_is_stm32mp15x_ev1()) > + board_stm32mp15x_ev1_init(); > > - if (board_is_dk2()) > - dk2_i2c1_fix(); > + if (board_is_stm32mp15x_dk2()) > + board_stm32mp15x_dk2_init(); > > if (IS_ENABLED(CONFIG_DM_REGULATOR)) > regulators_enable_boot_on(_DEBUG); Applied to u-boot-stm/next, thanks! Regards Patrick