summaryrefslogtreecommitdiff
path: root/board/st
AgeCommit message (Collapse)AuthorFilesLines
2021-04-09stm32mp1: remove the board_check_usb_power function when ADC is not activatedPatrick Delaunay1-5/+4
Simplify the code of the function board_check_usb_power based in CONFIG_ADC and adc_measurement; the function is removed by the linker when the CONFIG_ADC is not activated. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2021-04-09board: Add rt-thread art-pi board supportdillon min4-0/+90
All these files are add for support rt-thread art-pi board - add board/st/stm32h750-art-pi, defconfig, header support for u-boot for more information about art-pi, please goto: https://art-pi.gitee.io/website/ Signed-off-by: dillon min <dillon.minfei@gmail.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2021-04-08board: st: stm32f746-disco: fix console is not enabled while init dramGiulio Benetti1-1/+1
While initializing dram in spl_dram_init(), mdelay() is called that in order calls get_ticks() that verifies if timer exists, if doesn't, it throws a panic(), but since preloader_console_init() has still not been called those panic()s will fail. This doesn't help debugging, so let's setup console before calling spl_dram_init() by moving it after spl_dram_init(). Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
2021-03-12board: st: Remove board_early_init_f and board_late_init callbacks for stm32 ↵Patrice Chotard6-40/+0
boards Remove board_early_init_f() and board_late_init() callbacks for stm32 boards as the corresponding flags (CONFIG_BOARD_LATE_INIT and CONFIG_BOARD_EARLY_INIT_R) are now disabled. Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2021-03-11board: stm32mp1: use CONFIG_SYS_MMC_ENV_DEV when availablePatrick Delaunay1-1/+7
Check whether user has explicitly defined the mmc device to use in mmc_get_env_dev() with CONFIG_SYS_MMC_ENV_DEV. On STMicroelectronics boards the used mmc device for environment is the instance of boot device provided by the ROM code; the mmc instance is configured by alias in device tree. The used partition is defined in device tree with u-boot,mmc-env-partition = "ssbl". This patch allows to override this selection for the support of customer boards without alias; for example when SDMMC1 is not used and ENV in mmc0=SDMMC2, user can force the value: CONFIG_SYS_MMC_ENV_DEV = 0. On STMicroelectronics boards, the current behavior is kept with CONFIG_SYS_MMC_ENV_DEV = -1. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2021-03-11stm32mp: stm32prog: Add CONFIG_CMD_STM32PROG_SERIAL and _USBPatrick Delaunay1-4/+5
Add CONFIG_CMD_STM32PROG_SERIAL and CONFIG_CMD_STM32PROG_USB to independently select the support of UART or USB communication for STM32CubeProgrammer. For serial boot over UART, user can deactivate CONFIG_CMD_STM32PROG_SERIAL to use U-Boot console of binary loaded by UART (for board bring-up for example). Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2021-03-11board: st: remove the nand MTD configuration for NOR boot in stm32mp1 boardPatrick Delaunay1-11/+5
Since commit d5d726d3cc47 ("configs: stm32mp1: only support SD card after NOR in bootcmd_stm32mp"), the stm32mp1 boards only support SD card after NOR boot device, so the MTD partitions for nand0 or spi-nand0 are useless (no need of "UBI" partition in nand0 or spi-nand0). This patch removes these nand MTD update for nor boot and simplify nand0 and spi-nand0 support (remove the mtd_boot variable). Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2021-02-28Correct U-Boot upstream repositoryHeinrich Schuchardt2-2/+2
The U-Boot source moves to https://source.denx.de/u-boot/u-boot.git effective 2021-02-28. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-02-02common: Drop asm/global_data.h from common headerSimon Glass10-0/+10
Move this out of the common header and include it only where needed. In a number of cases this requires adding "struct udevice;" to avoid adding another large header or in other cases replacing / adding missing header files that had been pulled in, very indirectly. Finally, we have a few cases where we did not need to include <asm/global_data.h> at all, so remove that include. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@konsulko.com>
2021-01-13MAINTAINERS: Update STi and STM32 maintainers emails in remaining filesPatrice Chotard12-12/+12
A previous series already update STMicroelectronics emails maintainers but some files have been omitted (Makefile, .dts, .dtsi and .rst files). Update Patrick and my email address with the one dedicated to upstream activities. Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2021-01-13board: stm32pm1: update USB-C power detection algorithm on DK boardsPatrice Chotard1-43/+63
USB-C power supply which are Power Delivery compliant (USB-PD) are able to provide different voltage/current (for example 5V/3A 9V/3A 12V/2.25A...) In this case, the power supply need to negotiate the voltage/current to use with the device using CC1/CC2 USB-C signals. If this negotiation occurs during ADC measurement (done also on CC1/CC2 USB-C signals) some ADC acquisition can be corrupted which cause wrong power supply current detection. To avoid this, the power supply current detection algorithm is updated as following: - perform an ADC measurement, if a 3A current is detected, continue the boot process. - else, wait 20ms (max tPDDebounce duration) to ensure that USB-PD negotiation is done and perform another ADC measurement. Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com>
2021-01-13board: st: common: migrate trace to dev and log macroPatrick Delaunay4-4/+11
Change pr_* to dev_ or log_ macro and define LOG_CATEGORY. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2021-01-13board: st: stm32mp1: migrate trace to dev and log macroPatrick Delaunay1-69/+65
Change pr_* to dev_ or log_ macro and define LOG_CATEGORY. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2021-01-06Merge tag 'dm-pull-5jan21' of git://git.denx.de/u-boot-dm into nextTom Rini6-13/+13
Driver model: make some udevice fields private Driver model: Rename U_BOOT_DEVICE et al. dtoc: Tidy up and add more tests ns16550 code clean-up x86 and sandbox minor fixes for of-platdata dtoc prepration for adding build-time instantiation
2021-01-06Merge tag 'v2021.01-rc5' into nextTom Rini6-5/+16
Prepare v2021.01-rc5 Signed-off-by: Tom Rini <trini@konsulko.com>
2021-01-05dm: Rename DM_GET_DRIVER() to DM_DRIVER_GET()Simon Glass5-12/+12
In the spirit of using the same base name for all of these related macros, rename this to have the operation at the end. This is not widely used so the impact is fairly small. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-01-05dm: Rename U_BOOT_DEVICE() to U_BOOT_DRVINFO()Simon Glass1-1/+1
The current macro is a misnomer since it does not declare a device directly. Instead, it declares driver_info record which U-Boot uses at runtime to create a device. The distinction seems somewhat minor most of the time, but is becomes quite confusing when we actually want to declare a device, with of-platdata. We are left trying to distinguish between a device which isn't actually device, and a device that is (perhaps an 'instance'?) It seems better to rename this macro to describe what it actually is. The macros is not widely used, since boards should use devicetree to declare devices. Rename it to U_BOOT_DRVINFO(), which indicates clearly that this is declaring a new driver_info record, not a device. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-12-14dm: treewide: Rename ..._platdata variables to just ..._platSimon Glass1-2/+2
Try to maintain some consistency between these variables by using _plat as a suffix for them. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-12-14dm: treewide: Rename 'platdata' variables to just 'plat'Simon Glass1-1/+1
We use 'priv' for private data but often use 'platdata' for platform data. We can't really use 'pdata' since that is ambiguous (it could mean private or platform data). Rename some of the latter variables to end with 'plat' for consistency. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-12-09treewide: Update email address Patrick Delaunay and Patrice ChotardPatrice Chotard5-5/+5
Update Patrick and my email address with the one dedicated to upstream activities. Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com> Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com>
2020-12-09add check for ignored CONFIG_ENV_EXT4_DEVICE_AND_PART definitionManuel Reis1-0/+11
Check whether user has explicitly defined device and partition where environment file will be located before using 'auto' i.e. bootable partition Voids the need to set such partition as bootable to work with the 'dev:auto' tuple Signed-off-by: Manuel Reis <mluis.reis@gmail.com> Cc: Patrick Delaunay <patrick.delaunay@st.com> Cc: Patrice Chotard <patrice.chotard@st.com> Tested-by: Michael Opdenacker <michael.opdenacker@bootlin.com> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2020-11-25board: st: stm32mp1: update load address for FIT examplesPatrick Delaunay2-5/+19
Update kernel load address for FIT examples to avoid relocation: - Kernel example uses Image.gz with U-Boot gzip decompression at final kernel location 0x0xC0008000. - Copro example loads zImage at a correct location (0xC4000000), to avoid zImage relocation before decompression by kernel code. An other solution to avoid zImage relocation is to align the kernel load and entry address with the real location in FIT (the relocation of zImage is skipped in U-Boot bootm command for identical address) but it is less flexible because this offset depends on FIT content: For example: ## Loading kernel from FIT Image at c2000000 ... Using 'ev1' configuration Trying 'kernel' kernel subimage Description: Linux kernel Created: 2020-10-22 9:08:32 UTC Type: Kernel Image Compression: uncompressed Data Start: 0xc20000cc The kernel offset in FIT is 0xCC in FIT and zImage is decompressed at 0xC0008000 by kernel code: kernel { description = "Linux kernel"; data = /incbin/("zImage"); type = "kernel"; arch = "arm"; os = "linux"; compression = "none"; load = <0xC20000cc>; entry = <0xC20000cc>; hash-1 { algo = "sha1"; }; }; Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2020-11-25board: stm32mp1: no MTD partitions fixup for serial bootPatrick Delaunay1-3/+8
Remove the update of the MTD partitions in kernel device tree for serial boot (USB / UART), and the kernel will use the MTD partitions define in the loaded DTB because U-Boot can't known the expected flash layout in this case. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2020-10-06dm: add cells_count parameter in *_count_phandle_with_argsPatrick Delaunay1-1/+1
The cell_count argument is required when cells_name is NULL. This patch adds this parameter in live tree API - of_count_phandle_with_args - ofnode_count_phandle_with_args - dev_count_phandle_with_args This parameter solves issue when these API is used to count the number of element of a cell without cell name. This parameter allow to force the size cell. For example: count = dev_count_phandle_with_args(dev, "array", NULL, 3); Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-08-13board: stm32mp1: use const for struct node_infoPatrick Delaunay1-1/+1
Use const for the variable nodes in ft_board_setup, this patch follow fdt_fixup_mtdparts prototype and no more use stack. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2020-08-13board: stm32mp1: remove board.cPatrick Delaunay1-36/+0
Remove the file board/st/stm32mp1/board.c which is not more compiled since commit 156732cc8939 ("board: stm32mp1: move the function board_debug_uart_init in spl.c") Fixes: 4fb46816c7e2 ("board: stm32mp1: move the function board_debug_uart_init in spl.c") Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2020-08-13board: stm32mp1: update fdt fixup partitions tableChristophe Kerello1-0/+1
This patch adds "st,stm32mp1-fmc2-nfc" compatible string in the fdt fixup partitions table. Signed-off-by: Christophe Kerello <christophe.kerello@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2020-08-13board: stm32mp1: use IS_ENABLED to prevent ifdef in ft_board_setupPatrick Delaunay1-3/+3
Use IS_ENABLED to prevent ifdef in ft_board_setup. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2020-08-13board: stm32mp1: use IS_ENABLED to prevent ifdef in env functionsPatrick Delaunay1-19/+17
Use IS_ENABLED to prevent ifdef in env functions: - env_get_location - env_ext4_get_intf - mmc_get_env_dev Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2020-08-13board: stm32mp1: use IS_ENABLED to prevent ifdef in board_late_initPatrick Delaunay1-30/+30
Use IS_ENABLED to prevent ifdef in board_late_init. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2020-08-13board: stm32mp1: use IS_ENABLED to prevent ifdef in dk2_i2c1_fixPatrick Delaunay1-5/+5
Use IS_ENABLED to prevent ifdef in dk2_i2c1_fix. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2020-08-13board: stm32mp1: use IS_ENABLED to prevent ifdef in set_dfu_alt_infPatrick Delaunay1-9/+11
Use CONFIG_IS_ENABLED to prevent ifdef in set_dfu_alt_inf. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2020-08-13board: stm32mp1: use IS_ENABLED to prevent ifdef in sysconf_initPatrick Delaunay1-8/+3
Use IS_ENABLED to prevent ifdef in sysconf_init. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2020-08-13board: stm32mp1: use IS_ENABLED to prevent ifdef in board_check_usb_powerPatrick Delaunay1-4/+4
Use IS_ENABLED to prevent ifdef in board_check_usb_power. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2020-08-13board: stm32mp1: use IS_ENABLED to prevent ifdef in ↵Patrick Delaunay1-6/+9
g_dnl_board_usb_cable_connected Use IS_ENABLED to prevent ifdef in g_dnl_board_usb_cable_connected and in g_dnl_bind_fixup Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2020-08-13board: stm32mp1: use IS_ENABLED to prevent ifdef in board_key_checkPatrick Delaunay1-26/+26
Use IS_ENABLED to prevent ifdef in board_key_check Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2020-08-04sf: Drop dm.h header file from spi_flash.hSimon Glass1-0/+1
This header file should not be included in other header files. Remove it and use a forward declaration instead. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-28board: update test on misc_read result in board_late_initPatrick Delaunay1-1/+1
Update management of misc_read, which now return length of data after the commit 8729b1ae2cbd ("misc: Update read() and write() methods to return bytes xfered") Fixes: 8b8b3d6b55b9 ("stm32mp1: board: add environment variable for board id and board rev") Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2020-07-28configs:stm32mp1: activate env config in SPLPatrick Delaunay1-4/+4
Activate env config in SPL with CONFIG_SPL_ENV_SUPPORT and use CONFIG_IS_ENABLED macro to test the activated CONFIG_$(SPL_)ENV_IS_IN_... in env_get_location. Reviewed-by: Patrice Chotard <patrice.chotard@st.com> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2020-07-28stm32mp1: board: add support of CONFIG_ENV_IS_IN_MMCPatrick Delaunay1-0/+14
Add support of CONFIG_ENV_IS_IN_MMC in env_get_location, used for all mmc device (SD card and eMMC). The 2 configs CONFIG_ENV_IS_IN_MMC and CONFIG_ENV_IS_IN_EXT4 are incompatible. Add the weak function mmc_get_env_dev to select the mmc boot instance. Reviewed-by: Patrice Chotard <patrice.chotard@st.com> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2020-07-17treewide: convert bd_t to struct bd_info by coccinelleMasahiro Yamada2-2/+2
The Linux coding style guide (Documentation/process/coding-style.rst) clearly says: It's a **mistake** to use typedef for structures and pointers. Besides, using typedef for structures is annoying when you try to make headers self-contained. Let's say you have the following function declaration in a header: void foo(bd_t *bd); This is not self-contained since bd_t is not defined. To tell the compiler what 'bd_t' is, you need to include <asm/u-boot.h> #include <asm/u-boot.h> void foo(bd_t *bd); Then, the include direcective pulls in more bloat needlessly. If you use 'struct bd_info' instead, it is enough to put a forward declaration as follows: struct bd_info; void foo(struct bd_info *bd); Right, typedef'ing bd_t is a mistake. I used coccinelle to generate this commit. The semantic patch that makes this change is as follows: <smpl> @@ typedef bd_t; @@ -bd_t +struct bd_info </smpl> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-07-07board: st: move type-c stusb1600 controller code in a driverPatrick Delaunay5-52/+71
Migrate the ST Microelectronics STUSB160X Type-C controller code in a generic I2C driver in st/common, based on Linux one in : drivers/usb/typec/stusb160x.c This patch simplifies the stm32mp1 board code and allows to reuse this STUSB160X driver in other boards. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2020-07-07board: st: stm32mp1: increase teed partitionPatrick Delaunay1-1/+1
With TEE 3.7.0, the partition teed (OP-TEE pageable code and data) need to increase up to 512KB in NOR device. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2020-07-07board: stm32mp1: update the gpio hog supportPatrick Delaunay1-8/+2
This patch updates the current gpio hog implementation and uses the new API gpio_hog_probe_all(), activated with CONFIG_GPIO_HOG. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2020-07-07board: stm32mp1: move the function board_debug_uart_init in spl.cPatrick Delaunay2-2/+28
Move the debug function board_debug_uart_init in spl.c as the debug_uart_init() function is called in arch_cpu_init() only for SPL and remove the board.c file. For TFABOOT, the UART TX pin configuration is done in TF-A. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2020-07-07board: stm32mp1: update vddcore in SPLPatrick Delaunay3-3/+33
For board using STPMIC1, the vddcore is provided by BUCK1 of STPMIC1 and need to be updated for 800MHz support and only after the clock tree initialization. The VDDCORE voltage value is provided by clock driver, saved in global variable opp_voltage_mv and udpated in SPL board_early_init_f(), just after clock tree initialization. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2020-07-07board: st: stpmic1: add function stpmic1_initPatrick Delaunay4-34/+50
Add a function stmpic_init to early initialize the PMIC STPMIC1 - keep vdd on during the reset cycle (to avoid issue when backup battery is absent) - Check if debug is enabled to program PMIC according to the bit This patch allows to remove the compilation of spl.c file from stm32mp1 board in dh_stm32mp1. CONFIG_SPL_BOARD_INIT is removed as the new function is called earlier in SPL, in the function board_early_init_f. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2020-07-07board: st: create common file stpmic1.cPatrick Delaunay3-158/+165
Move function board_ddr_power_init() in a new file stpmic1 in board/st/common to avoid duplicated code in each board using stpmic1 Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2020-05-19common: Drop linux/bitops.h from common headerSimon Glass2-0/+2
Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-19common: Drop linux/delay.h from common headerSimon Glass3-0/+3
Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>