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 | * |
| 5 | * Configuration settings for the STMicroelectonics STM32MP15x boards |
| 6 | */ |
| 7 | |
| 8 | #ifndef __CONFIG_STM32MP15_ST_COMMON_H__ |
| 9 | #define __CONFIG_STM32MP15_ST_COMMON_H__ |
| 10 | |
| 11 | #include <configs/stm32mp15_common.h> |
| 12 | |
| 13 | #ifdef CONFIG_EXTRA_ENV_SETTINGS |
| 14 | /* |
| 15 | * default bootcmd for stm32mp1 STMicroelectronics boards: |
| 16 | * for serial/usb: execute the stm32prog command |
| 17 | * for mmc boot (eMMC, SD card), distro boot on the same mmc device |
| 18 | * for nand or spi-nand boot, distro boot with ubifs on UBI partition |
| 19 | * for nor boot, distro boot on SD card = mmc0 ONLY ! |
| 20 | */ |
| 21 | #define ST_STM32MP1_BOOTCMD "bootcmd_stm32mp=" \ |
| 22 | "echo \"Boot over ${boot_device}${boot_instance}!\";" \ |
| 23 | "if test ${boot_device} = serial || test ${boot_device} = usb;" \ |
| 24 | "then stm32prog ${boot_device} ${boot_instance}; " \ |
| 25 | "else " \ |
| 26 | "run env_check;" \ |
| 27 | "if test ${boot_device} = mmc;" \ |
| 28 | "then env set boot_targets \"mmc${boot_instance}\"; fi;" \ |
| 29 | "if test ${boot_device} = nand ||" \ |
| 30 | " test ${boot_device} = spi-nand ;" \ |
| 31 | "then env set boot_targets ubifs0; fi;" \ |
| 32 | "if test ${boot_device} = nor;" \ |
| 33 | "then env set boot_targets mmc0; fi;" \ |
| 34 | "run distro_bootcmd;" \ |
| 35 | "fi;\0" |
| 36 | |
| 37 | #undef CONFIG_EXTRA_ENV_SETTINGS |
| 38 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 39 | STM32MP_MEM_LAYOUT \ |
| 40 | ST_STM32MP1_BOOTCMD \ |
| 41 | STM32MP_PARTS_DEFAULT \ |
| 42 | BOOTENV \ |
| 43 | STM32MP_EXTRA |
| 44 | |
| 45 | #endif |
| 46 | #endif |