Patrick Delaunay | c67ca25 | 2021-10-22 10:19:25 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause */ |
| 2 | /* |
| 3 | * Copyright (C) 2021, STMicroelectronics - All Rights Reserved |
| 4 | * |
Patrick Delaunay | eae488b | 2022-05-20 18:38:10 +0200 | [diff] [blame] | 5 | * Configuration settings for the STMicroelectronics STM32MP15x boards |
Patrick Delaunay | c67ca25 | 2021-10-22 10:19:25 +0200 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #ifndef __CONFIG_STM32MP15_ST_COMMON_H__ |
| 9 | #define __CONFIG_STM32MP15_ST_COMMON_H__ |
| 10 | |
Patrick Delaunay | 806c4dd | 2022-04-15 14:31:54 +0200 | [diff] [blame] | 11 | #define STM32MP_BOARD_EXTRA_ENV \ |
Patrice Chotard | 7950b1d | 2023-03-16 08:03:42 +0100 | [diff] [blame] | 12 | "usb_pgood_delay=2000\0" \ |
Patrick Delaunay | 284b08f | 2023-07-10 13:30:59 +0200 | [diff] [blame] | 13 | "console=ttySTM0\0" \ |
| 14 | "splashimage=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \ |
| 15 | "splashpos=m,m\0" |
Patrick Delaunay | 806c4dd | 2022-04-15 14:31:54 +0200 | [diff] [blame] | 16 | |
Patrick Delaunay | c67ca25 | 2021-10-22 10:19:25 +0200 | [diff] [blame] | 17 | #include <configs/stm32mp15_common.h> |
| 18 | |
Patrick Delaunay | 5367b67 | 2022-04-15 14:31:55 +0200 | [diff] [blame] | 19 | /* uart with on-board st-link */ |
Tom Rini | 65cc0e2 | 2022-11-16 13:10:41 -0500 | [diff] [blame] | 20 | #define CFG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, \ |
Patrick Delaunay | 5367b67 | 2022-04-15 14:31:55 +0200 | [diff] [blame] | 21 | 230400, 460800, 921600, \ |
| 22 | 1000000, 2000000 } |
| 23 | |
Tom Rini | 0613c36 | 2022-12-04 10:03:50 -0500 | [diff] [blame] | 24 | #ifdef CFG_EXTRA_ENV_SETTINGS |
Patrick Delaunay | c67ca25 | 2021-10-22 10:19:25 +0200 | [diff] [blame] | 25 | /* |
| 26 | * default bootcmd for stm32mp1 STMicroelectronics boards: |
| 27 | * for serial/usb: execute the stm32prog command |
| 28 | * for mmc boot (eMMC, SD card), distro boot on the same mmc device |
| 29 | * for nand or spi-nand boot, distro boot with ubifs on UBI partition |
| 30 | * for nor boot, distro boot on SD card = mmc0 ONLY ! |
| 31 | */ |
| 32 | #define ST_STM32MP1_BOOTCMD "bootcmd_stm32mp=" \ |
| 33 | "echo \"Boot over ${boot_device}${boot_instance}!\";" \ |
| 34 | "if test ${boot_device} = serial || test ${boot_device} = usb;" \ |
| 35 | "then stm32prog ${boot_device} ${boot_instance}; " \ |
| 36 | "else " \ |
| 37 | "run env_check;" \ |
| 38 | "if test ${boot_device} = mmc;" \ |
| 39 | "then env set boot_targets \"mmc${boot_instance}\"; fi;" \ |
| 40 | "if test ${boot_device} = nand ||" \ |
| 41 | " test ${boot_device} = spi-nand ;" \ |
| 42 | "then env set boot_targets ubifs0; fi;" \ |
| 43 | "if test ${boot_device} = nor;" \ |
| 44 | "then env set boot_targets mmc0; fi;" \ |
| 45 | "run distro_bootcmd;" \ |
| 46 | "fi;\0" |
| 47 | |
Tom Rini | 0613c36 | 2022-12-04 10:03:50 -0500 | [diff] [blame] | 48 | #undef CFG_EXTRA_ENV_SETTINGS |
| 49 | #define CFG_EXTRA_ENV_SETTINGS \ |
Patrick Delaunay | c67ca25 | 2021-10-22 10:19:25 +0200 | [diff] [blame] | 50 | STM32MP_MEM_LAYOUT \ |
| 51 | ST_STM32MP1_BOOTCMD \ |
Patrick Delaunay | c67ca25 | 2021-10-22 10:19:25 +0200 | [diff] [blame] | 52 | BOOTENV \ |
Patrick Delaunay | 6500c57 | 2022-07-11 19:45:50 +0200 | [diff] [blame] | 53 | STM32MP_EXTRA \ |
| 54 | STM32MP_BOARD_EXTRA_ENV |
Patrick Delaunay | c67ca25 | 2021-10-22 10:19:25 +0200 | [diff] [blame] | 55 | |
| 56 | #endif |
| 57 | #endif |