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 17A81C5B552 for ; Mon, 9 Jun 2025 09:29:44 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 95B5B82998; Mon, 9 Jun 2025 11:29:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (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=1749461383; bh=S1po6MPhmwEQ4ZTPz8wgf4mb/OJo6VWM9nZRI8GkTbc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=SbiPY7yRlyufRw/53PzMhUNUO1b65HOO1PyHtOIj2p4mEudU3We90EJLUxzaCQvJO dZk2+LINqKXk6Ve/7WnfSLbxt92Quh8gJIGaesCbe22xpv/dxaIQMAHRrujbk3v9tE s0p3CSh+SNyebSkAuAvZ5abtJzHKNKDjfkXi042Tq0gjDH3eEIzlYAYsd6C6BqJW4e uWZqlML3xjfgvNi4ejQKc7Q4SXBNGmswlOA+f3nb7jVdfenRVJ/p53dTQLwYr3Ry88 kXBc29gWPJgIhk8ZzlGw7mZ0KREQOapGBWvA9InhaMrUf/dYenEORbA0gl1TLFAKQF N+kS5nDK++soQ== Received: by phobos.denx.de (Postfix, from userid 109) id 5EC4B82A36; Mon, 9 Jun 2025 11:29:42 +0200 (CEST) Received: from mx.denx.de (mx.denx.de [IPv6:2a03:4000:64:cc:545d:19ff:fe05:8172]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E54FA811AC for ; Mon, 9 Jun 2025 11:29:39 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=lukma@denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=denx.de header.i=@denx.de header.b="KuNMyv+0"; dkim-atps=neutral Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 8BD4A10397298; Mon, 9 Jun 2025 11:29:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=mx-20241105; t=1749461378; h=from:subject:date:message-id:to:cc:mime-version:content-type: in-reply-to:references; bh=S1po6MPhmwEQ4ZTPz8wgf4mb/OJo6VWM9nZRI8GkTbc=; b=KuNMyv+04LGSVo8eMSPVk57O9/sjQKkd6mAaNVoZGfkBwAix4ZFuqo9QEiwGWIEBd6uC8i Nyhv4y0lbXFHCZJWW5QE5UZU1tG5H13PecykiDEBaf7uZX1Jr+q4PYUWkw6HDFeEi/3to0 Qdec7+5Lh9FiOe0rCwQD+G77OUXDd26BBoFtdSA4JoBzzbK/hMIc/qJYCWq0jGOjPueDv9 lSFxvzchaSTm50Od5xScoKuGFusOPWGVZ/L/WrZMA0aLVUIBcGMYLEK2VtGPj+SO9Uu9Q/ pCOcVqBoNH53wX5sjjFYFecOe2zJ273KHL8dUyDzyiTHTz3dIXaCA2VsLUjykQ== Date: Mon, 9 Jun 2025 11:29:34 +0200 From: Lukasz Majewski To: Patrice CHOTARD Cc: Dario Binacchi , , , Ilias Apalodimas , Jerome Forissier , Patrick Delaunay , Rasmus Villemoes , Sean Anderson , Tom Rini , Subject: Re: [PATCH 9/9] board: stm32: add stm32h747-discovery board support Message-ID: <20250609112934.4c32c56d@wsk> In-Reply-To: <830e3e26-1936-45c0-9768-82d65757fcdc@foss.st.com> References: <20250607093730.2249536-1-dario.binacchi@amarulasolutions.com> <20250607093730.2249536-10-dario.binacchi@amarulasolutions.com> <316dd0c7-c7b8-407d-b34a-b5b90f056b94@foss.st.com> <20250609100727.56d7de7b@wsk> <830e3e26-1936-45c0-9768-82d65757fcdc@foss.st.com> Organization: denx.de X-Mailer: Claws Mail 3.19.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/=VQzhuqZA=qUMPRj=YVPx73"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Last-TLS-Session-Version: TLSv1.3 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.8 at phobos.denx.de X-Virus-Status: Clean --Sig_/=VQzhuqZA=qUMPRj=YVPx73 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Mon, 9 Jun 2025 10:34:39 +0200 Patrice CHOTARD wrote: > On 6/9/25 10:07, Lukasz Majewski wrote: > > Hi Patrice, > > =20 > >> On 6/7/25 11:37, Dario Binacchi wrote: =20 > >>> The board includes an STM32H747XI SoC with the following > >>> resources: > >>> - 2 Mbytes Flash > >>> - 1 Mbyte SRAM > >>> - LCD-TFT controller > >>> - MIPI-DSI interface > >>> - FD-CAN > >>> - USB 2.0 high-speed/full-speed > >>> - Ethernet MAC > >>> - camera interface > >>> > >>> Detailed information can be found at: > >>> https://www.st.com/en/evaluation-tools/stm32h747i-disco.html > >>> > >>> Signed-off-by: Dario Binacchi > >>> > >>> > >>> --- > >>> > >>> arch/arm/mach-stm32/stm32h7/Kconfig | 4 +++ > >>> board/st/stm32h747-disco/Kconfig | 15 ++++++++ > >>> board/st/stm32h747-disco/MAINTAINERS | 7 ++++ > >>> board/st/stm32h747-disco/Makefile | 6 ++++ > >>> board/st/stm32h747-disco/stm32h747-disco.c | 42 > >>> ++++++++++++++++++++++ configs/stm32h747-disco_defconfig > >>> | 35 ++++++++++++++++++ drivers/clk/stm32/clk-stm32h7.c > >>> | 5 +++ include/configs/stm32h747-disco.h | 32 > >>> +++++++++++++++++ 8 files changed, 146 insertions(+) > >>> create mode 100644 board/st/stm32h747-disco/Kconfig > >>> create mode 100644 board/st/stm32h747-disco/MAINTAINERS > >>> create mode 100644 board/st/stm32h747-disco/Makefile > >>> create mode 100644 board/st/stm32h747-disco/stm32h747-disco.c > >>> create mode 100644 configs/stm32h747-disco_defconfig > >>> create mode 100644 include/configs/stm32h747-disco.h > >>> > >>> diff --git a/arch/arm/mach-stm32/stm32h7/Kconfig > >>> b/arch/arm/mach-stm32/stm32h7/Kconfig index > >>> 70233a4b23cd..72f20c477d04 100644 --- > >>> a/arch/arm/mach-stm32/stm32h7/Kconfig +++ > >>> b/arch/arm/mach-stm32/stm32h7/Kconfig @@ -6,11 +6,15 @@ config > >>> TARGET_STM32H743_DISCO config TARGET_STM32H743_EVAL > >>> bool "STM32H743 Evaluation board" > >>> =20 > >>> +config TARGET_STM32H747_DISCO > >>> + bool "STM32H747 Discovery board" > >>> + > >>> config TARGET_STM32H750_ART_PI > >>> bool "STM32H750 ART Pi board" > >>> =20 > >>> source "board/st/stm32h743-eval/Kconfig" > >>> source "board/st/stm32h743-disco/Kconfig" > >>> +source "board/st/stm32h747-disco/Kconfig" > >>> source "board/st/stm32h750-art-pi/Kconfig" > >>> =20 > >>> endif > >>> diff --git a/board/st/stm32h747-disco/Kconfig > >>> b/board/st/stm32h747-disco/Kconfig new file mode 100644 > >>> index 000000000000..a7b2c09a327f > >>> --- /dev/null > >>> +++ b/board/st/stm32h747-disco/Kconfig > >>> @@ -0,0 +1,15 @@ > >>> +if TARGET_STM32H747_DISCO > >>> + > >>> +config SYS_BOARD > >>> + default "stm32h747-disco" > >>> + > >>> +config SYS_VENDOR > >>> + default "st" > >>> + > >>> +config SYS_SOC > >>> + default "stm32h7" > >>> + > >>> +config SYS_CONFIG_NAME > >>> + default "stm32h747-disco" > >>> + > >>> +endif > >>> diff --git a/board/st/stm32h747-disco/MAINTAINERS > >>> b/board/st/stm32h747-disco/MAINTAINERS new file mode 100644 > >>> index 000000000000..d48649f773f3 > >>> --- /dev/null > >>> +++ b/board/st/stm32h747-disco/MAINTAINERS > >>> @@ -0,0 +1,7 @@ > >>> +STM32H747 DISCOVERY BOARD > >>> +M: Dario Binacchi > >>> +S: Maintained > >>> +F: board/st/stm32h747-disco > >>> +F: include/configs/stm32h747-disco.h > >>> +F: configs/stm32h747-disco_defconfig > >>> +F: arch/arm/dts/stm32h747* > >>> diff --git a/board/st/stm32h747-disco/Makefile > >>> b/board/st/stm32h747-disco/Makefile new file mode 100644 > >>> index 000000000000..e11f052cc88f > >>> --- /dev/null > >>> +++ b/board/st/stm32h747-disco/Makefile > >>> @@ -0,0 +1,6 @@ > >>> +# SPDX-License-Identifier: GPL-2.0+ > >>> +# > >>> +# Copyright (c) 2025 Dario Binacchi > >>> +# > >>> + > >>> +obj-y :=3D stm32h747-disco.o > >>> diff --git a/board/st/stm32h747-disco/stm32h747-disco.c > >>> b/board/st/stm32h747-disco/stm32h747-disco.c new file mode 100644 > >>> index 000000000000..be0884bdeb4d > >>> --- /dev/null > >>> +++ b/board/st/stm32h747-disco/stm32h747-disco.c > >>> @@ -0,0 +1,42 @@ > >>> +// SPDX-License-Identifier: GPL-2.0+ > >>> +/* > >>> + * stm32h747i-disco support > >>> + * > >>> + * Copyright (C) 2025 Dario Binacchi > >>> > >>> + */ > >>> + > >>> +#include > >>> +#include > >>> +#include > >>> +#include > >>> + > >>> +DECLARE_GLOBAL_DATA_PTR; > >>> + > >>> +int dram_init(void) > >>> +{ > >>> + struct udevice *dev; > >>> + int ret; > >>> + > >>> + ret =3D uclass_get_device(UCLASS_RAM, 0, &dev); > >>> + if (ret) { > >>> + debug("DRAM init failed: %d\n", ret); > >>> + return ret; > >>> + } > >>> + > >>> + if (fdtdec_setup_mem_size_base() !=3D 0) > >>> + ret =3D -EINVAL; > >>> + > >>> + return ret; > >>> +} > >>> + > >>> +int dram_init_banksize(void) > >>> +{ > >>> + fdtdec_setup_memory_banksize(); > >>> + > >>> + return 0; > >>> +} > >>> + > >>> +int board_init(void) > >>> +{ > >>> + return 0; > >>> +} > >>> diff --git a/configs/stm32h747-disco_defconfig > >>> b/configs/stm32h747-disco_defconfig new file mode 100644 > >>> index 000000000000..8a0c72450d1e > >>> --- /dev/null > >>> +++ b/configs/stm32h747-disco_defconfig > >>> @@ -0,0 +1,35 @@ > >>> +CONFIG_ARM=3Dy > >>> +CONFIG_ARCH_STM32=3Dy > >>> +CONFIG_TEXT_BASE=3D0x08000000 > >>> +CONFIG_SYS_MALLOC_LEN=3D0x100000 > >>> +CONFIG_NR_DRAM_BANKS=3D1 > >>> +CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=3Dy > >>> +CONFIG_CUSTOM_SYS_INIT_SP_ADDR=3D0x24040000 > >>> +CONFIG_ENV_SIZE=3D0x2000 > >>> +CONFIG_DEFAULT_DEVICE_TREE=3D"st/stm32h747i-disco" > >>> +CONFIG_OF_LIBFDT_OVERLAY=3Dy > >>> +CONFIG_SYS_LOAD_ADDR=3D0xd0400000 > >>> +CONFIG_STM32H7=3Dy > >>> +CONFIG_TARGET_STM32H747_DISCO=3Dy > >>> +CONFIG_DISTRO_DEFAULTS=3Dy =20 > >=20 > > I'm just wondering if there is any plan to move forward to use the > > new approach? > >=20 > > As fair as I remember this is the "deprecated" option... =20 >=20 > Hi Lukasz >=20 > I was not aware of deprecation of CONFIG_DISTRO_DEFAULTS . > Can you point to me the other alternative ? >=20 I think it is: CONFIG_BOOTSTD The bootstd command and friends (I did some research on STM32MP157C board and it can be enabled ... ). > Thanks > Patrice >=20 > > =20 > >>> +CONFIG_BOOTDELAY=3D3 > >>> +CONFIG_AUTOBOOT_KEYED=3Dy > >>> +CONFIG_AUTOBOOT_PROMPT=3D"Hit SPACE in %d seconds to stop > >>> autoboot.\n" +CONFIG_AUTOBOOT_STOP_STR=3D" " > >>> +CONFIG_DEFAULT_FDT_FILE=3D"stm32h747i-disco" > >>> +CONFIG_SYS_CBSIZE=3D256 > >>> +CONFIG_SYS_PBSIZE=3D282 > >>> +# CONFIG_DISPLAY_CPUINFO is not set > >>> +CONFIG_SYS_PROMPT=3D"U-Boot > " > >>> +CONFIG_CMD_GPT=3Dy > >>> +CONFIG_CMD_MMC=3Dy > >>> +# CONFIG_CMD_SETEXPR is not set > >>> +CONFIG_CMD_CACHE=3Dy > >>> +CONFIG_CMD_TIMER=3Dy > >>> +CONFIG_CMD_EXT4_WRITE=3Dy > >>> +# CONFIG_ISO_PARTITION is not set > >>> +CONFIG_OF_CONTROL=3Dy > >>> +CONFIG_SYS_RELOC_GD_ENV_ADDR=3Dy > >>> +CONFIG_NO_NET=3Dy > >>> +CONFIG_STM32_SDMMC2=3Dy > >>> +# CONFIG_PINCTRL_FULL is not set > >>> diff --git a/drivers/clk/stm32/clk-stm32h7.c > >>> b/drivers/clk/stm32/clk-stm32h7.c index 6acf2ff0a8fb..aa3be414a29f > >>> 100644 --- a/drivers/clk/stm32/clk-stm32h7.c > >>> +++ b/drivers/clk/stm32/clk-stm32h7.c > >>> @@ -114,6 +114,7 @@ > >>> #define QSPISRC_PER_CK 3 > >>> =20 > >>> #define PWR_CR3 0x0c > >>> +#define PWR_CR3_LDOEN BIT(1) > >>> #define PWR_CR3_SCUEN BIT(2) > >>> #define PWR_D3CR 0x18 > >>> #define PWR_D3CR_VOS_MASK GENMASK(15, 14) > >>> @@ -375,7 +376,11 @@ int configure_clocks(struct udevice *dev) > >>> clrsetbits_le32(pwr_base + PWR_D3CR, PWR_D3CR_VOS_MASK, > >>> VOS_SCALE_1 << PWR_D3CR_VOS_SHIFT); > >>> /* Lock supply configuration update */ > >>> +#if IS_ENABLED(CONFIG_TARGET_STM32H747_DISCO) > >>> + clrbits_le32(pwr_base + PWR_CR3, PWR_CR3_LDOEN); > >>> +#else > >>> clrbits_le32(pwr_base + PWR_CR3, PWR_CR3_SCUEN); > >>> +#endif > >>> while (!(readl(pwr_base + PWR_D3CR) & PWR_D3CR_VOSREADY)) > >>> ; > >>> =20 > >>> diff --git a/include/configs/stm32h747-disco.h > >>> b/include/configs/stm32h747-disco.h new file mode 100644 > >>> index 000000000000..393445a8ae1f > >>> --- /dev/null > >>> +++ b/include/configs/stm32h747-disco.h > >>> @@ -0,0 +1,32 @@ > >>> +/* SPDX-License-Identifier: GPL-2.0+ */ > >>> +/* > >>> + * Copyright (C) 2025 Dario Binacchi > >>> > >>> + */ > >>> + > >>> +#ifndef __CONFIG_H > >>> +#define __CONFIG_H > >>> + > >>> +#include > >>> +#include > >>> + > >>> +/* For booting Linux, use the first 16MB of memory */ > >>> +#define CFG_SYS_BOOTMAPSZ SZ_16M > >>> + > >>> +#define CFG_SYS_FLASH_BASE 0x08000000 > >>> + > >>> +#define CFG_SYS_HZ_CLOCK 1000000 > >>> + > >>> +#define BOOT_TARGET_DEVICES(func) \ > >>> + func(MMC, mmc, 0) > >>> + > >>> +#include > >>> +#define CFG_EXTRA_ENV_SETTINGS \ > >>> + "kernel_addr_r=3D0xD0008000\0" > >>> \ > >>> + "fdtfile=3Dstm32h747i-disco.dtb\0" \ > >>> + "fdt_addr_r=3D0xD0408000\0" > >>> \ > >>> + "scriptaddr=3D0xD0418000\0" > >>> \ > >>> + "pxefile_addr_r=3D0xD0428000\0" \ > >>> + "ramdisk_addr_r=3D0xD0438000\0" > >>> \ > >>> + BOOTENV > >>> + > >>> +#endif /* __CONFIG_H */ =20 > >> Reviewed-by: Patrice Chotard > >> > >> Thanks > >> Patrice =20 > >=20 > >=20 > >=20 > >=20 > > Best regards, > >=20 > > Lukasz Majewski > >=20 > > -- > >=20 > > DENX Software Engineering GmbH, Managing Director: Erika Unter > > HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, > > Germany Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: > > lukma@denx.de =20 Best regards, Lukasz Majewski -- DENX Software Engineering GmbH, Managing Director: Erika Unter HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de --Sig_/=VQzhuqZA=qUMPRj=YVPx73 Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEgAyFJ+N6uu6+XupJAR8vZIA0zr0FAmhGqX4ACgkQAR8vZIA0 zr2p/wgAw0ME9IMl2Fz3ToHItW9uYJu4ddqSBx8PVB7IsgbNy2fhhwH3V2cspDA+ ShONTyaDqpiYVw4eaB3nTy3ajpb/OG/IF4ZKvUUa2eKKDEmMM/RxudTQHuvGFz5Y pGyDNDTTB+ixwpE1nfBQj+UnvHQAvyxj8qZFI5JejIN70mw6O8QT0wY2YXrxnKW1 W7mZdq9ulFyXg58CO3AVaxcr5BGaVK5aE+vBC7A0bbJ9x6ZajfW1F6/y+v1G9IOp MhVlnFsKpuYYJOYMjYpMhv52aUT4JdcpDe3co8hC7EbQgm4zBNJ8VzGxMvCGNTjt aEYTuPZR/lsECfaylnAhs9KHLh1OwQ== =xkth -----END PGP SIGNATURE----- --Sig_/=VQzhuqZA=qUMPRj=YVPx73--