aboutsummaryrefslogtreecommitdiff
path: root/board/st
AgeCommit message (Collapse)Author
2020-07-28board: update test on misc_read result in board_late_initPatrick Delaunay
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 Delaunay
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 Delaunay
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 Yamada
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 Delaunay
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 Delaunay
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 Delaunay
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 Delaunay
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 Delaunay
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 Delaunay
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 Delaunay
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-18common: Drop linux/bitops.h from common headerSimon Glass
Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18common: Drop linux/delay.h from common headerSimon Glass
Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18common: Drop log.h from common headerSimon Glass
Move this header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18command: Remove the cmd_tbl_t typedefSimon Glass
We should not use typedefs in U-Boot. They cannot be used as forward declarations which means that header files must include the full header to access them. Drop the typedef and rename the struct to remove the _s suffix which is now not useful. This requires quite a few header-file additions. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18common: Drop init.h from common headerSimon Glass
Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18common: Drop image.h from common headerSimon Glass
Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18common: Drop bootstage.h from common headerSimon Glass
Move this fairly uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18part: Drop disk_partition_t typedefSimon Glass
We should not be using typedefs and these make it harder to use forward declarations (to reduce header file inclusions). Drop the typedef. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18common: Drop net.h from common headerSimon Glass
Move this header out of the common header. Network support is used in quite a few places but it still does not warrant blanket inclusion. Note that this net.h header itself has quite a lot in it. It could be split into the driver-mode support, functions, structures, checksumming, etc. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-14stm32mp1: Fix warning display when 1.5A power supply is usedPatrice Chotard
On DK1/2 board, when a 1.5A power supply is detected, a warning message is displayed. In this message, "1.5mA" is displayed instead of "1.5A". Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com>
2020-05-14board: stm32mp1: add timeout for I/O compensation readyPatrick Delaunay
This patch avoids infinite loop when I/O compensation failed, it adds a 1s timeout to detect error. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2020-05-14board: stm32mp1: remove bootdelay configuration for usb or serial bootPatrick Delaunay
It is not allowed to change the user setting of bootdelay, so remove the check of the boot-source to disable it dynamically in board_late_init() Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2020-05-14board: stm32mp1: set environment variable fdtfilePatrick Delaunay
For booting Linux in the generic distro mechanism and support of FDTDIR in extlinux.conf , cmd/pxe.c retrieves the FDT file name from "fdtfile" environment variable. Dynamically build this variable with compatible of STMicroelectronics boards. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2020-05-14board: stm32mp1: gt9147 IRQ before reset on EV1Patrick Delaunay
Software workaround for I2C issue on EV1 board, configure the IRQ line for touchscreen before LCD reset to fix the used I2C address. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2020-05-14board: stm32mp1: update management of boot-ledPatrick Delaunay
Force boot-led ON and no more rely on default-state. This patch avoid device-tree modification for U-Boot. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2020-05-14board: stm32mp1: Keep error led ON in case of low power detectionPatrice Chotard
Since commit commit dd2810851eb1 ("stm32mp1: board: support of error led on ed1/ev1 board") the attended behavior was no more respected in case of low power source detection on DK2. The expected behavior is either the error LED keeps blinking for ever, or blinks 2 or 3 times and must stay ON. Reviewed-by: Patrice Chotard <patrice.chotard@st.com> Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2020-05-14stm32mp: stm32prog: adapt the MTD partitionsPatrick Delaunay
Dynamically adapt the MTD partitions in NOR/NAND/SPI-NAND when stm32prog command detects in the parsed flash layout files: - a fsbl partition in NOR. - a tee partition in NOR/NAND/SPI-NAND Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2020-05-14stm32mp: add the command stm32progPatrick Delaunay
Add a specific command stm32prog for STM32MP soc family witch allows to program the boot devices with the tool STM32CubeProgrammer (http://www.st.com/STM32CubeProg). This command uses the same UART STM32 protocol than MCU STM32 with or USB with DFU protocol v1.1 (ithe MCU ST extension are no supported). The executed actions are based on a tab separated value file with a stm32 header, the FlashLayout file (https://wiki.st.com/stm32mpu/wiki/STM32CubeProgrammer_flashlayout). This file is parsed by the U-Boot command to: - initialize the devices - create the partition table on each device - initialize the DFU backend to access to not volatile memory (NOR/NAND/SD/eMMC) or to virtual device (OTP/PMIC) Up to STM32PROG_MAX_DEV (5) devices can be updated with a FlashLayout. The communication between U-Boot and STM32CubeProgrammer is done with the specific alternate configuration (see "AN5275: USB DFU/USART protocols used in STM32MP1 Series bootloaders" for details). The command stm32prog is executed when a boot from USB is detected (selected with bootpins) and we can program the boot devices with a simple command (on Windows or Linux): PC $> STM32_Programmer_CLI -c port=usb1 -w flaslayout.tsv 1/ the ROM code loads TF-A in embedded RAM (DFU or uart) 2/ TF-A loads flashlayout file and U-Boot in DDR (DFU or uart) 3/ U-Boot executes the stm32prog command (DFU or uart) 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-05-14board: stm32mp1: adapt MTD partition for BOOT from NOR or NANDPatrick Delaunay
Dynamically adapt the MTD partitions in NAND and SPI-NAND when boot from NOR or NAND/SPI-NAND is detected. This patch avoids to define the save MTD partition name for NOR and NAND devices and issue with latest kernel: only the needed MTD partitions are defined. For boot from NOR 1/ bootloader (TF-A, U-Boot and OP-TE) in NOR 2/ one large UBI partition in NAND For boot from NAND 1/ bootloader (TF-A, U-Boot and OP-TE) in MTD raw partition 2/ one large UBI partition Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2020-05-14board: stm32mp1: support boot from spi-nandPatrick Delaunay
Manage BOOT_FLASH_SPINAND, with boot_device="spi-nand" and treat this value in bootcmd_stm32mp. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2020-05-14configs: stm32mp1: remove optee defconfigPatrick Delaunay
As the op-tee presence is detected by U-boot, the stm32mp15_optee_defconfig is identical to stm32mp15_trusted_defconfig and can be removed. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2020-05-14stm32mp1: dynamically detect op-tee presencePatrick Delaunay
Activate OP-TEE driver for trusted and optee defconfig. This driver allows detection of TEE presence for boot from flash; CONFIG_STM32MP1_OPTEE is also removed. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2020-05-14stm32mp1: move MTDPART configuration in KconfigPatrick Delaunay
This patch reduces the stm32mp1 environment size and builds dynamically the MTD partitions with information from defconfig (CONFIG_MTDPARTS_...). Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2020-05-14stm32mp1: dynamically build DFU_ALT_INFOPatrick Delaunay
This patch reduces the stm32mp1 environment size and builds dynamically the DFU board configuration with gpt and mtd partitions and information from defconfig (CONFIG_DFU_ALT_RAM0). Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2020-05-14board: stm32mp1: move set_dfu_alt_info in st common directoryPatrick Delaunay
Move the stm32mp1 common code set_dfu_alt_info() in common directory, this patch reduce the maintenance effort on this generic part (not board dependent). Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2020-05-14board: stm32mp1: move board_get_mtdparts in st common directoryPatrick Delaunay
Move the stm32mp1 common code board_get_mtdparts() in common directory, this patch reduce the maintenance effort on this generic part (not board dependent). Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2020-04-15board: stm32mp1: correct CONFIG_IS_ENABLED usage for LEDPatrick Delaunay
Use the correct macro to test presence CONFIG_LED: replace CONFIG_IS_ENABLED(CONFIG_LED) by CONFIG_IS_ENABLED(LED) Issue see during review unrelated patch "board: stm32mp1: update management of boot-led" http://patchwork.ozlabs.org/patch/1264823/ Cc: Marek Vasut <marex@denx.de> Cc: Patrice Chotard <patrice.chotard@st.com> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Marek Vasut <marex@denx.de> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2020-04-15configs: stm32mp1: replace STM32MP1_TRUSTED by TFABOOTPatrick Delaunay
Activate ARCH_SUPPORT_TFABOOT and replace the arch stm32mp specific config CONFIG_STM32MP1_TRUSTED by the generic CONFIG_TFABOOT introduced by the commit 535d76a12150 ("armv8: layerscape: Add TFABOOT support"). This config CONFIG_TFABOOT is activated for the trusted boot chain, when U-Boot is loaded by TF-A. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2020-03-24ram: stm32mp1: increase vdd2_ddr: buck2 for 32bits LPDDRPatrick Delaunay
Need to increase the LPDDR2/LPDDR3 the voltage vdd2_ddr: buck2 form 1.2V to 1.25V for 32bits configuration. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Acked-by: Patrice Chotard <patrice.chotard@st.com>
2020-03-24board: stm32mp1: display reference only for STMicroelectronics boardPatrick Delaunay
Display the reference MBxxxx found in OTP49 only for STMicroelectronics boards when CONFIG_CMD_STBOARD is activated. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Acked-by: Patrice Chotard <patrice.chotard@st.com> # Conflicts: # board/st/stm32mp1/stm32mp1.c
2020-03-24board: stm32mp1: add finished good in board identifier OTPPatrick Delaunay
Update the command stboard to support the updated coding of OTP 59 with finished good. The ST product codification have several element - "Commercial Product Name" (CPN): type of product board (DKX, EVX) associated to the board ID "MBxxxx" - "Finished Good" or "Finish Good" (FG): effective content of the product without chip STM32MP1 (LCD, Wifi, …) - BOM: cost variant for same FG (for example, several provider of the same component) For example - commercial product = STM32MP157C-EV1 - Finished Good = EVA32MP157A1$AU1 Booth information are written on board and these information is also saved in OTP59: bit [31:16] (hex) => Board id, MBxxxx bit [15:12] (dec) => Variant CPN (1....15) bit [11:8] (dec) => Revision board (index with A = 1, Z = 26) bit [7:4] (dec) => Variant FG : finished good (NEW) bit [3:0] (dec) => BOM (01, .... 255) The updated command is: stboard [-y] <Board> <VarCPN> <Revision> <VarFG> <BOM> And the displayed STMicroelectronics board identification is: Board: MB<Board> Var<VarCPN>.<VarFG> Rev.<Revision>-<BOM> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2020-03-24board: stm32mp1: stboard: lock the OTP after programmingPatrick Delaunay
Lock the OTP used for board identification for the ST boards after programming. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Acked-by: Patrice Chotard <patrice.chotard@st.com>
2020-03-24board: stm32mp1: read OTP in command stboardPatrick Delaunay
Read the value directly from the OTP and no more of the shadows to avoid the need of reboot after stboard command to have correct value. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Acked-by: Patrice Chotard <patrice.chotard@st.com>
2020-03-24board: stm32mp1: update command stboard on misc_write resultPatrick Delaunay
Update management of misc_write, which now return length of data after the commit 8729b1ae2cbd ("misc: Update read() and write() methods to return bytes xfered") Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Acked-by: Patrice Chotard <patrice.chotard@st.com>
2020-03-02doc: add board documentation for stm32mp1Patrick Delaunay
Change plain test README to rst format and move this file in documentation directory. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2020-02-13board: stm32mp1: change dfu function to staticPatrick Delaunay
Change the dfu functions dfu_otp_read and dfu_pmic_read to static, this patch avoids warning when compiling with W=1. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2020-02-13board: stm32mp1: board: add include for dfuPatrick Delaunay
Add include for dfu, add prototype for set_dfu_alt_info and avoid warning when compiling with W=1. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2020-02-13board: stm32mp1: update readmePatrick Delaunay
Update readme: - list the supported SOC and change family to STM32MP15x - add warning on OTP write and prerequisite: check if MAC address is not yet provisioned. - Use filesize for mmc write command (avoid to write all partition with ${partsize}). ${filesize} and ${partsize} are set by previous load command. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2020-02-05dm: core: Create a new header file for 'compat' featuresSimon Glass
At present dm/device.h includes the linux-compatible features. This requires including linux/compat.h which in turn includes a lot of headers. One of these is malloc.h which we thus end up including in every file in U-Boot. Apart from the inefficiency of this, it is problematic for sandbox which needs to use the system malloc() in some files. Move the compatibility features into a separate header file. Signed-off-by: Simon Glass <sjg@chromium.org>