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 A6924C433F5 for ; Tue, 15 Mar 2022 07:48:57 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 799FC839C6; Tue, 15 Mar 2022 08:48:55 +0100 (CET) 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="BSv+o782"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2B0A68399B; Tue, 15 Mar 2022 08:48:54 +0100 (CET) Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [185.132.182.106]) (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 DF09B83B90 for ; Tue, 15 Mar 2022 08:48:47 +0100 (CET) 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=90733073ad=patrice.chotard@foss.st.com Received: from pps.filterd (m0241204.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 22F4JpIF013528; Tue, 15 Mar 2022 08:48:46 +0100 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=y4YhAjmS/ZlV+ovTvMMcDVf12bL9D/0W90ECjjIOHLA=; b=BSv+o7827ZpNLRUhFr3fg5vIpPhrbijsJaLtzkOL6JhiqO6VH2AADWoe/355zj0SDD9i iArf8GaRVxWiyUhKE4+gh3cRXT37aHoJP+EK5nBNie1oEbFNGgJJMLRCFguwkBxW+iuC 5701mpTASquyfCMqx85tCNoAmQ7i2n3NJXmhp+bbFLbxkhX5qENG775RCMZJVRzngJ8a S3IPeilQxU224733rmoE+lLrXQlyJtvNAsDcNMkDzyImAAU1e0JoqOW4P+/muuH5ZWPp YxWffTtkgWsy8yqx9K+GwNGwfriopw8RnOyl3JoTv/TVLpuBH8VAy2GXxGwKiDywWqCU kw== 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 3et63h4ngm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 15 Mar 2022 08:48:46 +0100 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id A6ECF100048; Tue, 15 Mar 2022 08:48:45 +0100 (CET) Received: from Webmail-eu.st.com (shfdag1node1.st.com [10.75.129.69]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 4ECF92128AB; Tue, 15 Mar 2022 08:48:42 +0100 (CET) Received: from [10.201.21.201] (10.75.127.47) 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; Tue, 15 Mar 2022 08:48:41 +0100 Message-ID: Date: Tue, 15 Mar 2022 08:48:40 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH] ARM: dts: stm32: Add DFU support for DHCOM recovery Content-Language: en-US To: Marek Vasut , CC: Patrick Delaunay References: <20220314123554.23904-1-marex@denx.de> From: Patrice CHOTARD In-Reply-To: <20220314123554.23904-1-marex@denx.de> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.75.127.47] X-ClientProxiedBy: SFHDAG2NODE2.st.com (10.75.127.5) To SHFDAG1NODE1.st.com (10.75.129.69) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.850,Hydra:6.0.425,FMLib:17.11.64.514 definitions=2022-03-14_14,2022-03-14_02,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 Marek On 3/14/22 13:35, Marek Vasut wrote: > This patch configures U-Boot SPL for DHCOM SoM to permit DFU upload of > SPL and subsequent u-boot.itb for recovery or commissioning purposes. > > The DFU usage procedure is identical to STM32MP1 DHCOR SoM, see commit > 3919aa1722a ("ARM: dts: stm32: Add DFU support for DHCOR recovery") , > except for switching the SoM into DFU mode. By default, the DHCOM SoM > has no dedicated mechanism for setting BOOTn straps into UART/USB mode, > therefore to enter DFU mode, the SoC must fail to boot from boot media > which can be selected by the BOOTn strap override mechanism first and > then fall back to DFU mode. > > In case of a SoM with pre-populated BOOTn strap override button, power > the system off, remove microSD card (if applicable), hold down the BOOTn > strap override button located between eMMC and SoM edge connector, power > on the SoM. The SoC will fail to boot from SD card and fall back into > DFU mode. > > Signed-off-by: Marek Vasut > Cc: Patrice Chotard > Cc: Patrick Delaunay > --- > arch/arm/dts/stm32mp15xx-dhcom-u-boot.dtsi | 42 ++++++++++++++++++++++ > configs/stm32mp15_dhcom_basic_defconfig | 15 ++++++-- > 2 files changed, 54 insertions(+), 3 deletions(-) > > diff --git a/arch/arm/dts/stm32mp15xx-dhcom-u-boot.dtsi b/arch/arm/dts/stm32mp15xx-dhcom-u-boot.dtsi > index f09f4290f62..d73967ac1b5 100644 > --- a/arch/arm/dts/stm32mp15xx-dhcom-u-boot.dtsi > +++ b/arch/arm/dts/stm32mp15xx-dhcom-u-boot.dtsi > @@ -58,6 +58,7 @@ > > &i2c4 { > u-boot,dm-pre-reloc; > + u-boot,dm-spl; > > eeprom0: eeprom@50 { > }; > @@ -98,6 +99,11 @@ > > &pmic { > u-boot,dm-pre-reloc; > + u-boot,dm-spl; > + > + regulators { > + u-boot,dm-spl; > + }; > }; > > &flash0 { > @@ -288,3 +294,39 @@ > bias-pull-up; > }; > }; > + > +®11 { > + u-boot,dm-spl; > +}; > + > +®18 { > + u-boot,dm-spl; > +}; > + > +&usb33 { > + u-boot,dm-spl; > +}; > + > +&usbotg_hs_pins_a { > + u-boot,dm-spl; > +}; > + > +&usbotg_hs { > + u-boot,dm-spl; > +}; > + > +&usbphyc { > + u-boot,dm-spl; > +}; > + > +&usbphyc_port0 { > + u-boot,dm-spl; > +}; > + > +&usbphyc_port1 { > + u-boot,dm-spl; > +}; > + > +&vdd_usb { > + u-boot,dm-spl; > +}; > diff --git a/configs/stm32mp15_dhcom_basic_defconfig b/configs/stm32mp15_dhcom_basic_defconfig > index c422c47775e..438bba37dee 100644 > --- a/configs/stm32mp15_dhcom_basic_defconfig > +++ b/configs/stm32mp15_dhcom_basic_defconfig > @@ -18,6 +18,7 @@ CONFIG_DISTRO_DEFAULTS=y > CONFIG_SYS_LOAD_ADDR=0xc2000000 > CONFIG_FIT=y > CONFIG_SPL_LOAD_FIT=y > +CONFIG_SPL_LOAD_FIT_ADDRESS=0xc1000000 > CONFIG_SPL_FIT_SOURCE="board/dhelectronics/dh_stm32mp1/u-boot-dhcom.its" > # CONFIG_USE_SPL_FIT_GENERATOR is not set > CONFIG_BOOTDELAY=1 > @@ -27,12 +28,17 @@ CONFIG_BOARD_EARLY_INIT_F=y > CONFIG_SPL_LEGACY_IMAGE_SUPPORT=y > CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION=y > CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION=3 > +CONFIG_SPL_ENV_SUPPORT=y > CONFIG_SPL_I2C=y > CONFIG_SPL_MTD_SUPPORT=y > CONFIG_SPL_DM_SPI_FLASH=y > CONFIG_SPL_POWER=y > +CONFIG_SPL_RAM_SUPPORT=y > +CONFIG_SPL_RAM_DEVICE=y > CONFIG_SPL_SPI_FLASH_MTD=y > CONFIG_SYS_SPI_U_BOOT_OFFS=0x80000 > +CONFIG_SPL_USB_GADGET=y > +CONFIG_SPL_DFU=y > CONFIG_SYS_PROMPT="STM32MP> " > # CONFIG_CMD_ELF is not set > # CONFIG_CMD_EXPORTENV is not set > @@ -71,6 +77,7 @@ CONFIG_OF_SPL_REMOVE_PROPS="interrupts interrupt-names interrupts-extended inter > CONFIG_ENV_IS_IN_SPI_FLASH=y > CONFIG_SYS_REDUNDAND_ENVIRONMENT=y > CONFIG_SYS_RELOC_GD_ENV_ADDR=y > +CONFIG_SPL_ENV_IS_NOWHERE=y > CONFIG_NET_RANDOM_ETHADDR=y > CONFIG_IP_DEFRAG=y > CONFIG_TFTP_BLOCKSIZE=1536 > @@ -79,8 +86,6 @@ CONFIG_SPL_BLOCK_CACHE=y > CONFIG_DFU_MMC=y > CONFIG_DFU_MTD=y > CONFIG_DFU_RAM=y > -CONFIG_DFU_VIRT=y > -CONFIG_SET_DFU_ALT_INFO=y > CONFIG_GPIO_HOG=y > CONFIG_DM_HWSPINLOCK=y > CONFIG_HWSPINLOCK_STM32=y > @@ -106,18 +111,20 @@ CONFIG_DM_ETH=y > CONFIG_DWC_ETH_QOS=y > CONFIG_KS8851_MLL=y > CONFIG_PHY=y > +CONFIG_SPL_PHY=y > CONFIG_PHY_STM32_USBPHYC=y > CONFIG_PINCONF=y > # CONFIG_SPL_PINCTRL_FULL is not set > CONFIG_PINCTRL_STMFX=y > CONFIG_DM_PMIC=y > -# CONFIG_SPL_PMIC_CHILDREN is not set > CONFIG_PMIC_STPMIC1=y > CONFIG_DM_REGULATOR=y > +CONFIG_SPL_DM_REGULATOR=y > CONFIG_DM_REGULATOR_FIXED=y > CONFIG_DM_REGULATOR_GPIO=y > CONFIG_DM_REGULATOR_STM32_VREFBUF=y > CONFIG_DM_REGULATOR_STPMIC1=y > +CONFIG_SPL_DM_REGULATOR_STPMIC1=y > CONFIG_REMOTEPROC_STM32_COPRO=y > CONFIG_DM_RTC=y > CONFIG_RTC_STM32=y > @@ -129,8 +136,10 @@ CONFIG_STM32_SPI=y > CONFIG_SYSRESET_SYSCON=y > CONFIG_USB=y > CONFIG_DM_USB_GADGET=y > +CONFIG_SPL_DM_USB_GADGET=y > CONFIG_USB_EHCI_HCD=y > CONFIG_USB_EHCI_GENERIC=y > +CONFIG_USB_DWC2=y > CONFIG_USB_HOST_ETHER=y > CONFIG_USB_ETHER_ASIX=y > CONFIG_USB_GADGET=y Reviewed-by: Patrice Chotard Thanks Patrice