mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-02 09:46:37 +03:00
ARM: stm32mp: Add STM32MP21 support
STM32MP21 application processors (STM32 MPUs) based on a single Arm Cortex®-A35 core running up to 1.5 GHz and Cortex®-M33 core running at 300 MHz. It is pin-compatible with the STM32MP2 series in the VFBGA361 10×10 mm package: the STM32MP21 uses a subset of the STM32MP23 pinout, which itself is a subset of the STM32MP25. More details available here : https://www.st.com/en/microcontrollers-microprocessors/stm32mp2-series.html Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
This commit is contained in:
@@ -84,6 +84,32 @@ config STM32MP15X
|
||||
STMicroelectronics MPU with core ARMv7
|
||||
dual core A7 for STM32MP157/3, monocore for STM32MP151
|
||||
|
||||
config STM32MP21X
|
||||
bool "Support STMicroelectronics STM32MP21x Soc"
|
||||
select ARM64
|
||||
select CLK_STM32MP21
|
||||
select OF_BOARD
|
||||
select PINCTRL_STM32
|
||||
select STM32_RCC
|
||||
select STM32_RESET
|
||||
select STM32_SERIAL
|
||||
select STM32MP_TAMP_NVMEM
|
||||
select SYS_ARCH_TIMER
|
||||
select TFABOOT
|
||||
imply CLK_SCMI
|
||||
imply CMD_NVEDIT_INFO
|
||||
imply DM_REGULATOR
|
||||
imply DM_REGULATOR_SCMI
|
||||
imply OF_UPSTREAM
|
||||
imply OPTEE
|
||||
imply RESET_SCMI
|
||||
imply SYSRESET_PSCI
|
||||
imply TEE
|
||||
imply VERSION_VARIABLE
|
||||
help
|
||||
Support of STMicroelectronics SOC STM32MP21X family
|
||||
STMicroelectronics MPU with 1 A35 core and 1 M33 core
|
||||
|
||||
config STM32MP23X
|
||||
bool "Support STMicroelectronics STM32MP23x Soc"
|
||||
select ARM64
|
||||
@@ -195,6 +221,7 @@ config MFD_STM32_TIMERS
|
||||
|
||||
source "arch/arm/mach-stm32mp/Kconfig.13x"
|
||||
source "arch/arm/mach-stm32mp/Kconfig.15x"
|
||||
source "arch/arm/mach-stm32mp/Kconfig.21x"
|
||||
source "arch/arm/mach-stm32mp/Kconfig.23x"
|
||||
source "arch/arm/mach-stm32mp/Kconfig.25x"
|
||||
source "arch/arm/mach-stm32mp/cmd_stm32prog/Kconfig"
|
||||
|
||||
37
arch/arm/mach-stm32mp/Kconfig.21x
Normal file
37
arch/arm/mach-stm32mp/Kconfig.21x
Normal file
@@ -0,0 +1,37 @@
|
||||
if STM32MP21X
|
||||
|
||||
choice
|
||||
prompt "STM32MP21X board select"
|
||||
optional
|
||||
|
||||
config TARGET_ST_STM32MP21X
|
||||
bool "STMicroelectronics STM32MP21X boards"
|
||||
imply BOOTSTAGE
|
||||
imply CMD_BOOTSTAGE
|
||||
help
|
||||
target the STMicroelectronics board with SOC STM32MP21X
|
||||
managed by board/st/stm32mp2
|
||||
The difference between board are managed with devicetree
|
||||
|
||||
endchoice
|
||||
|
||||
config TEXT_BASE
|
||||
default 0x84000000
|
||||
|
||||
config PRE_CON_BUF_ADDR
|
||||
default 0x84800000
|
||||
|
||||
config PRE_CON_BUF_SZ
|
||||
default 4096
|
||||
|
||||
if DEBUG_UART
|
||||
|
||||
# debug on USART2 by default
|
||||
config DEBUG_UART_BASE
|
||||
default 0x400e0000
|
||||
|
||||
endif
|
||||
|
||||
source "board/st/stm32mp2/Kconfig"
|
||||
|
||||
endif
|
||||
@@ -8,8 +8,9 @@ obj-y += syscon.o
|
||||
obj-y += bsec.o
|
||||
obj-y += soc.o
|
||||
|
||||
obj-$(CONFIG_STM32MP15X) += stm32mp1/
|
||||
obj-$(CONFIG_STM32MP13X) += stm32mp1/
|
||||
obj-$(CONFIG_STM32MP15X) += stm32mp1/
|
||||
obj-$(CONFIG_STM32MP21X) += stm32mp2/
|
||||
obj-$(CONFIG_STM32MP23X) += stm32mp2/
|
||||
obj-$(CONFIG_STM32MP25X) += stm32mp2/
|
||||
|
||||
|
||||
@@ -165,16 +165,20 @@ enum forced_boot_mode {
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* CONFIG_STM32MP15X || CONFIG_STM32MP13X */
|
||||
|
||||
#if defined(CONFIG_STM32MP23X) || defined(CONFIG_STM32MP25X)
|
||||
#if defined(CONFIG_STM32MP21X) || defined(CONFIG_STM32MP23X) || defined(CONFIG_STM32MP25X)
|
||||
#define STM32_USART2_BASE 0x400E0000
|
||||
#define STM32_USART3_BASE 0x400F0000
|
||||
#define STM32_UART4_BASE 0x40100000
|
||||
#define STM32_UART5_BASE 0x40110000
|
||||
#define STM32_USART6_BASE 0x40220000
|
||||
#ifdef CONFIG_STM32MP25X
|
||||
#define STM32_UART9_BASE 0x402C0000
|
||||
#endif
|
||||
#define STM32_USART1_BASE 0x40330000
|
||||
#define STM32_UART7_BASE 0x40370000
|
||||
#ifdef CONFIG_STM32MP25X
|
||||
#define STM32_UART8_BASE 0x40380000
|
||||
#endif
|
||||
#define STM32_RCC_BASE 0x44200000
|
||||
#define STM32_TAMP_BASE 0x46010000
|
||||
#define STM32_SDMMC1_BASE 0x48220000
|
||||
@@ -194,7 +198,7 @@ enum forced_boot_mode {
|
||||
|
||||
#define TAMP_FWU_BOOT_IDX_MASK GENMASK(3, 0)
|
||||
#define TAMP_FWU_BOOT_IDX_OFFSET 0
|
||||
#endif /* defined(CONFIG_STM32MP23X) || defined(CONFIG_STM32MP25X) */
|
||||
#endif /* defined(CONFIG_STM32MP21X) || defined(CONFIG_STM32MP23X) || defined(CONFIG_STM32MP25X) */
|
||||
|
||||
/* offset used for BSEC driver: misc_read and misc_write */
|
||||
#define STM32_BSEC_SHADOW_OFFSET 0x0
|
||||
@@ -218,14 +222,14 @@ enum forced_boot_mode {
|
||||
#define BSEC_OTP_MAC 57
|
||||
#define BSEC_OTP_BOARD 60
|
||||
#endif
|
||||
#if defined(CONFIG_STM32MP23X) || defined(CONFIG_STM32MP25X)
|
||||
#if defined(CONFIG_STM32MP21X) || defined(CONFIG_STM32MP23X) || defined(CONFIG_STM32MP25X)
|
||||
#define BSEC_OTP_SERIAL 5
|
||||
#define BSEC_OTP_RPN 9
|
||||
#define BSEC_OTP_REVID 102
|
||||
#define BSEC_OTP_PKG 122
|
||||
#define BSEC_OTP_BOARD 246
|
||||
#define BSEC_OTP_MAC 247
|
||||
#endif /* defined(CONFIG_STM32MP23X) || defined(CONFIG_STM32MP25X) */
|
||||
#endif /* defined(CONFIG_STM32MP21X) || defined(CONFIG_STM32MP23X) || defined(CONFIG_STM32MP25X) */
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
#include <asm/types.h>
|
||||
|
||||
@@ -30,6 +30,20 @@
|
||||
#define CPU_STM32MP131Fxx 0x05010EC8
|
||||
#define CPU_STM32MP131Dxx 0x05010EC9
|
||||
|
||||
/* ID for STM32MP21x = Device Part Number (RPN) (bit31:0) */
|
||||
#define CPU_STM32MP211Axx 0x40073E7D
|
||||
#define CPU_STM32MP211Cxx 0x0007307D
|
||||
#define CPU_STM32MP211Dxx 0xC0073E7D
|
||||
#define CPU_STM32MP211Fxx 0x8007307D
|
||||
#define CPU_STM32MP213Axx 0x40073E1D
|
||||
#define CPU_STM32MP213Cxx 0x0007301D
|
||||
#define CPU_STM32MP213Dxx 0xC0073E1D
|
||||
#define CPU_STM32MP213Fxx 0x8007301D
|
||||
#define CPU_STM32MP215Axx 0x40033E0D
|
||||
#define CPU_STM32MP215Cxx 0x0003300D
|
||||
#define CPU_STM32MP215Dxx 0xC0033E0D
|
||||
#define CPU_STM32MP215Fxx 0x8003300D
|
||||
|
||||
/* ID for STM32MP23x = Device Part Number (RPN) (bit31:0) */
|
||||
#define CPU_STM32MP235Cxx 0x00082182
|
||||
#define CPU_STM32MP233Cxx 0x000B318E
|
||||
@@ -67,6 +81,7 @@ u32 get_cpu_type(void);
|
||||
|
||||
#define CPU_DEV_STM32MP15 0x500
|
||||
#define CPU_DEV_STM32MP13 0x501
|
||||
#define CPU_DEV_STM32MP21 0x503
|
||||
#define CPU_DEV_STM32MP23 0x505
|
||||
#define CPU_DEV_STM32MP25 0x505
|
||||
|
||||
@@ -102,6 +117,13 @@ u32 get_cpu_package(void);
|
||||
#define STM32MP15_PKG_AD_TFBGA257 1
|
||||
#define STM32MP15_PKG_UNKNOWN 0
|
||||
|
||||
/* package used for STM32MP21x */
|
||||
#define STM32MP21_PKG_CUSTOM 0
|
||||
#define STM32MP21_PKG_AL_VFBGA361 1
|
||||
#define STM32MP21_PKG_AN_VFBGA273 3
|
||||
#define STM32MP21_PKG_AO_VFBGA225 4
|
||||
#define STM32MP21_PKG_AM_TFBGA289 5
|
||||
|
||||
/* package used for STM32MP23x */
|
||||
#define STM32MP23_PKG_CUSTOM 0
|
||||
#define STM32MP23_PKG_AL_VFBGA361 1
|
||||
|
||||
@@ -7,5 +7,6 @@ obj-y += cpu.o
|
||||
obj-y += arm64-mmu.o
|
||||
obj-y += rifsc.o
|
||||
obj-$(CONFIG_OF_SYSTEM_SETUP) += fdt.o
|
||||
obj-$(CONFIG_STM32MP21X) += stm32mp21x.o
|
||||
obj-$(CONFIG_STM32MP23X) += stm32mp23x.o
|
||||
obj-$(CONFIG_STM32MP25X) += stm32mp25x.o
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
struct mm_region stm32mp2_mem_map[MP2_MEM_MAP_MAX] = {
|
||||
{
|
||||
#if defined(CONFIG_STM32MP25X)
|
||||
/* PCIe */
|
||||
.virt = 0x10000000UL,
|
||||
.phys = 0x10000000UL,
|
||||
@@ -24,6 +25,7 @@ struct mm_region stm32mp2_mem_map[MP2_MEM_MAP_MAX] = {
|
||||
PTE_BLOCK_NON_SHARE |
|
||||
PTE_BLOCK_PXN | PTE_BLOCK_UXN
|
||||
}, {
|
||||
#endif
|
||||
/* LPSRAMs, VDERAM, RETRAM, SRAMs, SYSRAM: alias1 */
|
||||
.virt = 0x20000000UL,
|
||||
.phys = 0x20000000UL,
|
||||
|
||||
@@ -142,8 +142,10 @@ static void setup_boot_mode(void)
|
||||
STM32_UART5_BASE,
|
||||
STM32_USART6_BASE,
|
||||
STM32_UART7_BASE,
|
||||
#ifdef CONFIG_STM32MP25X
|
||||
STM32_UART8_BASE,
|
||||
STM32_UART9_BASE
|
||||
#endif
|
||||
};
|
||||
const u32 sdmmc_addr[] = {
|
||||
STM32_SDMMC1_BASE,
|
||||
|
||||
@@ -367,6 +367,7 @@ static int stm32_rifsc_remove(struct udevice *bus)
|
||||
}
|
||||
|
||||
static const struct udevice_id stm32_rifsc_ids[] = {
|
||||
{ .compatible = "st,stm32mp21-rifsc" },
|
||||
{ .compatible = "st,stm32mp25-rifsc" },
|
||||
{},
|
||||
};
|
||||
|
||||
192
arch/arm/mach-stm32mp/stm32mp2/stm32mp21x.c
Normal file
192
arch/arm/mach-stm32mp/stm32mp2/stm32mp21x.c
Normal file
@@ -0,0 +1,192 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later OR BSD-3-Clause
|
||||
/*
|
||||
* Copyright (C) 2026, STMicroelectronics - All Rights Reserved
|
||||
*/
|
||||
|
||||
#define LOG_CATEGORY LOGC_ARCH
|
||||
|
||||
#include <log.h>
|
||||
#include <syscon.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/stm32.h>
|
||||
#include <asm/arch/sys_proto.h>
|
||||
|
||||
/* SYSCFG register */
|
||||
#define SYSCFG_DEVICEID_OFFSET 0x6400
|
||||
#define SYSCFG_DEVICEID_DEV_ID_MASK GENMASK(11, 0)
|
||||
#define SYSCFG_DEVICEID_DEV_ID_SHIFT 0
|
||||
|
||||
/* Revision ID = OTP102[5:0] 6 bits : 3 for Major / 3 for Minor*/
|
||||
#define REVID_SHIFT 0
|
||||
#define REVID_MASK GENMASK(5, 0)
|
||||
|
||||
/* Device Part Number (RPN) = OTP9 */
|
||||
#define RPN_SHIFT 0
|
||||
#define RPN_MASK GENMASK(31, 0)
|
||||
|
||||
/* Package = bit 0:2 of OTP122 => STM32MP21_PKG defines
|
||||
* - 000: Custom package
|
||||
* - 001: VFBGA361 => AL = 10x10, 361 balls pith 0.5mm
|
||||
* - 011: VFBGA273 => AN = 11x11, 273 balls pith 0.5mm
|
||||
* - 100: VFBGA225 => AO = 8x8, 225 balls pith 0.5mm
|
||||
* - 101: TFBGA289 => AM = 14x14, 289 balls pith 0.8mm
|
||||
* - others: Reserved
|
||||
*/
|
||||
#define PKG_SHIFT 0
|
||||
#define PKG_MASK GENMASK(2, 0)
|
||||
|
||||
static u32 read_deviceid(void)
|
||||
{
|
||||
void *syscfg = syscon_get_first_range(STM32MP_SYSCON_SYSCFG);
|
||||
|
||||
return readl(syscfg + SYSCFG_DEVICEID_OFFSET);
|
||||
}
|
||||
|
||||
u32 get_cpu_dev(void)
|
||||
{
|
||||
return (read_deviceid() & SYSCFG_DEVICEID_DEV_ID_MASK) >> SYSCFG_DEVICEID_DEV_ID_SHIFT;
|
||||
}
|
||||
|
||||
u32 get_cpu_rev(void)
|
||||
{
|
||||
return get_otp(BSEC_OTP_REVID, REVID_SHIFT, REVID_MASK);
|
||||
}
|
||||
|
||||
/* Get Device Part Number (RPN) from OTP */
|
||||
u32 get_cpu_type(void)
|
||||
{
|
||||
return get_otp(BSEC_OTP_RPN, RPN_SHIFT, RPN_MASK);
|
||||
}
|
||||
|
||||
/* Get Package options from OTP */
|
||||
u32 get_cpu_package(void)
|
||||
{
|
||||
return get_otp(BSEC_OTP_PKG, PKG_SHIFT, PKG_MASK);
|
||||
}
|
||||
|
||||
int get_eth_nb(void)
|
||||
{
|
||||
int nb_eth;
|
||||
|
||||
switch (get_cpu_type()) {
|
||||
case CPU_STM32MP215Axx:
|
||||
fallthrough;
|
||||
case CPU_STM32MP215Cxx:
|
||||
fallthrough;
|
||||
case CPU_STM32MP215Dxx:
|
||||
fallthrough;
|
||||
case CPU_STM32MP215Fxx:
|
||||
fallthrough;
|
||||
case CPU_STM32MP213Axx:
|
||||
fallthrough;
|
||||
case CPU_STM32MP213Cxx:
|
||||
fallthrough;
|
||||
case CPU_STM32MP213Dxx:
|
||||
fallthrough;
|
||||
case CPU_STM32MP213Fxx:
|
||||
nb_eth = 2; /* dual ETH */
|
||||
break;
|
||||
case CPU_STM32MP211Axx:
|
||||
fallthrough;
|
||||
case CPU_STM32MP211Cxx:
|
||||
fallthrough;
|
||||
case CPU_STM32MP211Dxx:
|
||||
fallthrough;
|
||||
case CPU_STM32MP211Fxx:
|
||||
nb_eth = 1; /* single ETH */
|
||||
break;
|
||||
default:
|
||||
nb_eth = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
return nb_eth;
|
||||
}
|
||||
|
||||
void get_soc_name(char name[SOC_NAME_SIZE])
|
||||
{
|
||||
char *cpu_s, *cpu_r, *package;
|
||||
|
||||
cpu_s = "????";
|
||||
cpu_r = "?";
|
||||
package = "??";
|
||||
if (get_cpu_dev() == CPU_DEV_STM32MP21) {
|
||||
switch (get_cpu_type()) {
|
||||
case CPU_STM32MP215Fxx:
|
||||
cpu_s = "215F";
|
||||
break;
|
||||
case CPU_STM32MP215Dxx:
|
||||
cpu_s = "215D";
|
||||
break;
|
||||
case CPU_STM32MP215Cxx:
|
||||
cpu_s = "215C";
|
||||
break;
|
||||
case CPU_STM32MP215Axx:
|
||||
cpu_s = "215A";
|
||||
break;
|
||||
case CPU_STM32MP213Fxx:
|
||||
cpu_s = "213F";
|
||||
break;
|
||||
case CPU_STM32MP213Dxx:
|
||||
cpu_s = "213D";
|
||||
break;
|
||||
case CPU_STM32MP213Cxx:
|
||||
cpu_s = "213C";
|
||||
break;
|
||||
case CPU_STM32MP213Axx:
|
||||
cpu_s = "213A";
|
||||
break;
|
||||
case CPU_STM32MP211Fxx:
|
||||
cpu_s = "211F";
|
||||
break;
|
||||
case CPU_STM32MP211Dxx:
|
||||
cpu_s = "211D";
|
||||
break;
|
||||
case CPU_STM32MP211Cxx:
|
||||
cpu_s = "211C";
|
||||
break;
|
||||
case CPU_STM32MP211Axx:
|
||||
cpu_s = "211A";
|
||||
break;
|
||||
default:
|
||||
cpu_s = "21??";
|
||||
break;
|
||||
}
|
||||
/* REVISION */
|
||||
switch (get_cpu_rev()) {
|
||||
case OTP_REVID_1:
|
||||
cpu_r = "A";
|
||||
break;
|
||||
case OTP_REVID_1_1:
|
||||
cpu_r = "Z";
|
||||
break;
|
||||
case OTP_REVID_2:
|
||||
cpu_r = "B";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
/* PACKAGE */
|
||||
switch (get_cpu_package()) {
|
||||
case STM32MP25_PKG_CUSTOM:
|
||||
package = "XX";
|
||||
break;
|
||||
case STM32MP21_PKG_AL_VFBGA361:
|
||||
package = "AL";
|
||||
break;
|
||||
case STM32MP21_PKG_AN_VFBGA273:
|
||||
package = "AN";
|
||||
break;
|
||||
case STM32MP21_PKG_AO_VFBGA225:
|
||||
package = "AO";
|
||||
break;
|
||||
case STM32MP21_PKG_AM_TFBGA289:
|
||||
package = "AM";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
snprintf(name, SOC_NAME_SIZE, "STM32MP%s%s Rev.%s", cpu_s, package, cpu_r);
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
config CMD_STBOARD
|
||||
bool "stboard - command for OTP board information"
|
||||
depends on ARCH_STM32MP
|
||||
default y if TARGET_ST_STM32MP13X || TARGET_ST_STM32MP15X || TARGET_ST_STM32MP23X || TARGET_ST_STM32MP25X
|
||||
default y if TARGET_ST_STM32MP13X || TARGET_ST_STM32MP15X || TARGET_ST_STM32MP21X || TARGET_ST_STM32MP23X || TARGET_ST_STM32MP25X
|
||||
help
|
||||
This compile the stboard command to
|
||||
read and write the board in the OTP.
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
if TARGET_ST_STM32MP21X
|
||||
|
||||
config SYS_BOARD
|
||||
default "stm32mp2"
|
||||
|
||||
config SYS_VENDOR
|
||||
default "st"
|
||||
|
||||
config SYS_CONFIG_NAME
|
||||
default "stm32mp21_st_common"
|
||||
|
||||
source "board/st/common/Kconfig"
|
||||
endif
|
||||
|
||||
if TARGET_ST_STM32MP23X
|
||||
|
||||
config SYS_BOARD
|
||||
|
||||
78
configs/stm32mp21_defconfig
Normal file
78
configs/stm32mp21_defconfig
Normal file
@@ -0,0 +1,78 @@
|
||||
CONFIG_ARM=y
|
||||
CONFIG_ARCH_STM32MP=y
|
||||
CONFIG_SYS_MALLOC_F_LEN=0x600000
|
||||
CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x90000000
|
||||
CONFIG_ENV_OFFSET=0x900000
|
||||
CONFIG_ENV_SECT_SIZE=0x40000
|
||||
CONFIG_DEFAULT_DEVICE_TREE="st/stm32mp215f-dk"
|
||||
CONFIG_SYS_BOOTM_LEN=0x2000000
|
||||
CONFIG_SYS_LOAD_ADDR=0x84000000
|
||||
CONFIG_STM32MP21X=y
|
||||
CONFIG_DDR_CACHEABLE_SIZE=0x10000000
|
||||
CONFIG_CMD_STM32KEY=y
|
||||
CONFIG_TARGET_ST_STM32MP21X=y
|
||||
CONFIG_SYS_MEMTEST_START=0x84000000
|
||||
CONFIG_SYS_MEMTEST_END=0x88000000
|
||||
CONFIG_API=y
|
||||
CONFIG_SYS_MMC_MAX_DEVICE=3
|
||||
CONFIG_FIT=y
|
||||
CONFIG_DISTRO_DEFAULTS=y
|
||||
CONFIG_BOOTDELAY=1
|
||||
CONFIG_BOOTCOMMAND="run bootcmd_stm32mp"
|
||||
CONFIG_SYS_PROMPT="STM32MP> "
|
||||
# CONFIG_CMD_BDI is not set
|
||||
CONFIG_CMD_BOOTZ=y
|
||||
CONFIG_CMD_ADTIMG=y
|
||||
# CONFIG_CMD_ELF is not set
|
||||
CONFIG_CMD_MEMINFO=y
|
||||
CONFIG_CMD_MEMTEST=y
|
||||
CONFIG_CMD_CLK=y
|
||||
CONFIG_CMD_FUSE=y
|
||||
CONFIG_CMD_GPIO=y
|
||||
# CONFIG_CMD_LOADB is not set
|
||||
CONFIG_CMD_MMC=y
|
||||
CONFIG_CMD_CACHE=y
|
||||
CONFIG_CMD_TIME=y
|
||||
CONFIG_CMD_RNG=y
|
||||
CONFIG_CMD_TIMER=y
|
||||
CONFIG_CMD_REGULATOR=y
|
||||
CONFIG_CMD_LOG=y
|
||||
CONFIG_CMD_UBI=y
|
||||
CONFIG_OF_LIVE=y
|
||||
CONFIG_OF_UPSTREAM_BUILD_VENDOR=y
|
||||
CONFIG_OF_UPSTREAM_VENDOR="st"
|
||||
CONFIG_ENV_IS_NOWHERE=y
|
||||
CONFIG_ENV_IS_IN_MMC=y
|
||||
CONFIG_ENV_IS_IN_SPI_FLASH=y
|
||||
CONFIG_ENV_IS_IN_UBI=y
|
||||
CONFIG_ENV_UBI_PART="UBI"
|
||||
CONFIG_ENV_UBI_VOLUME="uboot_config"
|
||||
CONFIG_NO_NET=y
|
||||
CONFIG_SYS_64BIT_LBA=y
|
||||
CONFIG_BUTTON=y
|
||||
CONFIG_BUTTON_GPIO=y
|
||||
CONFIG_GPIO_HOG=y
|
||||
CONFIG_DM_I2C=y
|
||||
CONFIG_SYS_I2C_STM32F7=y
|
||||
CONFIG_LED=y
|
||||
CONFIG_LED_GPIO=y
|
||||
CONFIG_SUPPORT_EMMC_BOOT=y
|
||||
CONFIG_STM32_SDMMC2=y
|
||||
CONFIG_MTD=y
|
||||
CONFIG_USE_SYS_MAX_FLASH_BANKS=y
|
||||
CONFIG_SPI_FLASH=y
|
||||
CONFIG_PINCONF=y
|
||||
CONFIG_DM_REGULATOR_FIXED=y
|
||||
CONFIG_DM_REGULATOR_GPIO=y
|
||||
CONFIG_RAM=y
|
||||
# CONFIG_STM32MP1_DDR is not set
|
||||
CONFIG_DM_RNG=y
|
||||
CONFIG_SERIAL_RX_BUFFER=y
|
||||
CONFIG_SPI=y
|
||||
CONFIG_DM_SPI=y
|
||||
# CONFIG_OPTEE_TA_AVB is not set
|
||||
CONFIG_WDT=y
|
||||
CONFIG_WDT_STM32MP=y
|
||||
CONFIG_WDT_ARM_SMC=y
|
||||
# CONFIG_UBIFS_SILENCE_DEBUG_DUMP is not set
|
||||
CONFIG_ERRNO_STR=y
|
||||
126
include/configs/stm32mp21_common.h
Normal file
126
include/configs/stm32mp21_common.h
Normal file
@@ -0,0 +1,126 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-or-later OR BSD-3-Clause */
|
||||
/*
|
||||
* Copyright (C) 2026, STMicroelectronics - All Rights Reserved
|
||||
*
|
||||
* Configuration settings for the STM32MP21x CPU
|
||||
*/
|
||||
|
||||
#ifndef __CONFIG_STM32MP21_COMMMON_H
|
||||
#define __CONFIG_STM32MP21_COMMMON_H
|
||||
#include <linux/sizes.h>
|
||||
#include <asm/arch/stm32.h>
|
||||
|
||||
/*
|
||||
* Configuration of the external SRAM memory used by U-Boot
|
||||
*/
|
||||
#define CFG_SYS_SDRAM_BASE STM32_DDR_BASE
|
||||
|
||||
/*
|
||||
* For booting Linux, use the first 256 MB of memory, since this is
|
||||
* the maximum mapped by the Linux kernel during initialization.
|
||||
*/
|
||||
#define CFG_SYS_BOOTMAPSZ SZ_256M
|
||||
|
||||
/*****************************************************************************/
|
||||
#ifdef CONFIG_DISTRO_DEFAULTS
|
||||
/*****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_NET
|
||||
#define BOOT_TARGET_PXE(func) func(PXE, pxe, na)
|
||||
#else
|
||||
#define BOOT_TARGET_PXE(func)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CMD_MMC
|
||||
#define BOOT_TARGET_MMC0(func) func(MMC, mmc, 0)
|
||||
#define BOOT_TARGET_MMC1(func) func(MMC, mmc, 1)
|
||||
#define BOOT_TARGET_MMC2(func) func(MMC, mmc, 2)
|
||||
#else
|
||||
#define BOOT_TARGET_MMC0(func)
|
||||
#define BOOT_TARGET_MMC1(func)
|
||||
#define BOOT_TARGET_MMC2(func)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CMD_UBIFS
|
||||
#define BOOT_TARGET_UBIFS(func) func(UBIFS, ubifs, 0, UBI, boot)
|
||||
#else
|
||||
#define BOOT_TARGET_UBIFS(func)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CMD_USB
|
||||
#define BOOT_TARGET_USB(func) func(USB, usb, 0)
|
||||
#else
|
||||
#define BOOT_TARGET_USB(func)
|
||||
#endif
|
||||
|
||||
#define BOOT_TARGET_DEVICES(func) \
|
||||
BOOT_TARGET_MMC1(func) \
|
||||
BOOT_TARGET_UBIFS(func) \
|
||||
BOOT_TARGET_MMC0(func) \
|
||||
BOOT_TARGET_MMC2(func) \
|
||||
BOOT_TARGET_USB(func) \
|
||||
BOOT_TARGET_PXE(func)
|
||||
|
||||
/*
|
||||
* default bootcmd for stm32mp21:
|
||||
* for serial/usb: execute the stm32prog command
|
||||
* for mmc boot (eMMC, SD card), distro boot on the same mmc device
|
||||
* for NAND or SPI-NAND boot, distro boot with UBIFS on UBI partition
|
||||
* for other boot, use the default distro order in ${boot_targets}
|
||||
*/
|
||||
#define STM32MP_BOOTCMD "bootcmd_stm32mp=" \
|
||||
"echo \"Boot over ${boot_device}${boot_instance}!\";" \
|
||||
"if test ${boot_device} = serial || test ${boot_device} = usb;" \
|
||||
"then stm32prog ${boot_device} ${boot_instance}; " \
|
||||
"else " \
|
||||
"run env_check;" \
|
||||
"if test ${boot_device} = mmc;" \
|
||||
"then env set boot_targets \"mmc${boot_instance}\"; fi;" \
|
||||
"if test ${boot_device} = nand ||" \
|
||||
" test ${boot_device} = spi-nand ;" \
|
||||
"then env set boot_targets ubifs0; fi;" \
|
||||
"run distro_bootcmd;" \
|
||||
"fi;\0"
|
||||
|
||||
#ifndef STM32MP_BOARD_EXTRA_ENV
|
||||
#define STM32MP_BOARD_EXTRA_ENV
|
||||
#endif
|
||||
|
||||
#define STM32MP_EXTRA \
|
||||
"env_check=if env info -p -d -q; then env save; fi\0" \
|
||||
"boot_net_usb_start=true\0"
|
||||
/*
|
||||
* memory layout for 96MB uncompressed/compressed kernel,
|
||||
* 1M fdt, 1M script, 1M pxe and 1M for overlay
|
||||
* and the ramdisk at the end.
|
||||
*/
|
||||
#define __KERNEL_COMP_ADDR_R __stringify(0x84000000)
|
||||
#define __KERNEL_COMP_SIZE_R __stringify(0x04000000)
|
||||
#define __KERNEL_ADDR_R __stringify(0x8a000000)
|
||||
#define __FDT_ADDR_R __stringify(0x90000000)
|
||||
#define __SCRIPT_ADDR_R __stringify(0x90100000)
|
||||
#define __PXEFILE_ADDR_R __stringify(0x90200000)
|
||||
#define __FDTOVERLAY_ADDR_R __stringify(0x90300000)
|
||||
#define __RAMDISK_ADDR_R __stringify(0x90400000)
|
||||
|
||||
#define STM32MP_MEM_LAYOUT \
|
||||
"kernel_addr_r=" __KERNEL_ADDR_R "\0" \
|
||||
"fdt_addr_r=" __FDT_ADDR_R "\0" \
|
||||
"scriptaddr=" __SCRIPT_ADDR_R "\0" \
|
||||
"pxefile_addr_r=" __PXEFILE_ADDR_R "\0" \
|
||||
"fdtoverlay_addr_r=" __FDTOVERLAY_ADDR_R "\0" \
|
||||
"ramdisk_addr_r=" __RAMDISK_ADDR_R "\0" \
|
||||
"kernel_comp_addr_r=" __KERNEL_COMP_ADDR_R "\0" \
|
||||
"kernel_comp_size=" __KERNEL_COMP_SIZE_R "\0"
|
||||
|
||||
#include <config_distro_bootcmd.h>
|
||||
#define CFG_EXTRA_ENV_SETTINGS \
|
||||
STM32MP_MEM_LAYOUT \
|
||||
STM32MP_BOOTCMD \
|
||||
BOOTENV \
|
||||
STM32MP_EXTRA \
|
||||
STM32MP_BOARD_EXTRA_ENV
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* __CONFIG_STM32MP21_COMMMON_H */
|
||||
51
include/configs/stm32mp21_st_common.h
Normal file
51
include/configs/stm32mp21_st_common.h
Normal file
@@ -0,0 +1,51 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-or-later OR BSD-3-Clause */
|
||||
/*
|
||||
* Copyright (C) 2026, STMicroelectronics - All Rights Reserved
|
||||
*
|
||||
* Configuration settings for the STMicroelectonics STM32MP21x boards
|
||||
*/
|
||||
|
||||
#ifndef __CONFIG_STM32MP21_ST_COMMON_H__
|
||||
#define __CONFIG_STM32MP21_ST_COMMON_H__
|
||||
|
||||
#define STM32MP_BOARD_EXTRA_ENV \
|
||||
"usb_pgood_delay=2000\0" \
|
||||
"console=ttySTM0\0"
|
||||
|
||||
#include <configs/stm32mp21_common.h>
|
||||
|
||||
#ifdef CFG_EXTRA_ENV_SETTINGS
|
||||
/*
|
||||
* default bootcmd for stm32mp21 STMicroelectronics boards:
|
||||
* for serial/usb: execute the stm32prog command
|
||||
* for mmc boot (eMMC, SD card), distro boot on the same mmc device
|
||||
* for nand or spi-nand boot, distro boot with ubifs on UBI partition or
|
||||
* sdcard
|
||||
* for nor boot, distro boot on SD card = mmc0 ONLY !
|
||||
*/
|
||||
#define ST_STM32MP21_BOOTCMD "bootcmd_stm32mp=" \
|
||||
"echo \"Boot over ${boot_device}${boot_instance}!\";" \
|
||||
"if test ${boot_device} = serial || test ${boot_device} = usb;" \
|
||||
"then stm32prog ${boot_device} ${boot_instance}; " \
|
||||
"else " \
|
||||
"run env_check;" \
|
||||
"if test ${boot_device} = mmc;" \
|
||||
"then env set boot_targets \"mmc${boot_instance}\"; fi;" \
|
||||
"if test ${boot_device} = nand ||" \
|
||||
" test ${boot_device} = spi-nand ;" \
|
||||
"then env set boot_targets ubifs0 mmc0; fi;" \
|
||||
"if test ${boot_device} = nor;" \
|
||||
"then env set boot_targets mmc0; fi;" \
|
||||
"run distro_bootcmd;" \
|
||||
"fi;\0"
|
||||
|
||||
#undef CFG_EXTRA_ENV_SETTINGS
|
||||
#define CFG_EXTRA_ENV_SETTINGS \
|
||||
STM32MP_MEM_LAYOUT \
|
||||
ST_STM32MP21_BOOTCMD \
|
||||
BOOTENV \
|
||||
STM32MP_EXTRA \
|
||||
STM32MP_BOARD_EXTRA_ENV
|
||||
|
||||
#endif
|
||||
#endif
|
||||
Reference in New Issue
Block a user