aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2023-11-10 09:43:01 -0500
committerTom Rini <trini@konsulko.com>2023-11-10 11:01:51 -0500
commit3b913c148249a2b9d12ff25517ec311646e83bee (patch)
treec3e3edf0b35ad883727af812de221f6d781db4f1
parentbb7121f6aa644b72115a24f63d3ee6e52629cc99 (diff)
parentc205fe979ebc1961cf28555c00e24a9004761366 (diff)
downloadu-boot-3b913c148249a2b9d12ff25517ec311646e83bee.zip
u-boot-3b913c148249a2b9d12ff25517ec311646e83bee.tar.gz
u-boot-3b913c148249a2b9d12ff25517ec311646e83bee.tar.bz2
Merge tag 'u-boot-stm32-20231110' of https://source.denx.de/u-boot/custodians/u-boot-stm
_ Fix compilation issue when SYS_DCACHE_OFF and/or SYS_DCACHE_SYS are enabled _ Fix issue following DT sync with kernel 6.3 for stm32mp15xx-ev1 and DHSOM SoM _ Enable TCP, IPv6, wget on DH STM32MP15 DHSOM _ Limit u-boot.itb size to 0x160000 bytes on DH STM32MP15 DHSOM _ Read auth stats and boot_partition from tamp
-rw-r--r--arch/arm/dts/stm32mp157c-ev1-u-boot.dtsi16
-rw-r--r--arch/arm/dts/stm32mp15xx-dhcom-u-boot.dtsi12
-rw-r--r--arch/arm/dts/stm32mp15xx-dhcor-u-boot.dtsi8
-rw-r--r--arch/arm/mach-stm32mp/cpu.c27
-rw-r--r--arch/arm/mach-stm32mp/include/mach/stm32.h4
-rw-r--r--arch/arm/mach-stm32mp/include/mach/sys_proto.h3
-rw-r--r--configs/stm32mp15_dhcom_basic_defconfig7
-rw-r--r--configs/stm32mp15_dhcor_basic_defconfig7
8 files changed, 67 insertions, 17 deletions
diff --git a/arch/arm/dts/stm32mp157c-ev1-u-boot.dtsi b/arch/arm/dts/stm32mp157c-ev1-u-boot.dtsi
index 1f7fdbc..eb283ca 100644
--- a/arch/arm/dts/stm32mp157c-ev1-u-boot.dtsi
+++ b/arch/arm/dts/stm32mp157c-ev1-u-boot.dtsi
@@ -135,20 +135,28 @@
&qspi_bk1_pins_a {
bootph-pre-ram;
- pins1 {
+ pins {
bootph-pre-ram;
};
- pins2 {
+};
+
+&qspi_cs1_pins_a {
+ bootph-pre-ram;
+ pins {
bootph-pre-ram;
};
};
&qspi_bk2_pins_a {
bootph-pre-ram;
- pins1 {
+ pins {
bootph-pre-ram;
};
- pins2 {
+};
+
+&qspi_cs2_pins_a {
+ bootph-pre-ram;
+ pins {
bootph-pre-ram;
};
};
diff --git a/arch/arm/dts/stm32mp15xx-dhcom-u-boot.dtsi b/arch/arm/dts/stm32mp15xx-dhcom-u-boot.dtsi
index f12941b..2f70b06 100644
--- a/arch/arm/dts/stm32mp15xx-dhcom-u-boot.dtsi
+++ b/arch/arm/dts/stm32mp15xx-dhcom-u-boot.dtsi
@@ -134,20 +134,14 @@
&qspi_bk1_pins_a {
bootph-pre-ram;
- pins1 {
- bootph-pre-ram;
- };
- pins2 {
+ pins {
bootph-pre-ram;
};
};
-&qspi_bk2_pins_a {
+&qspi_cs1_pins_a {
bootph-pre-ram;
- pins1 {
- bootph-pre-ram;
- };
- pins2 {
+ pins {
bootph-pre-ram;
};
};
diff --git a/arch/arm/dts/stm32mp15xx-dhcor-u-boot.dtsi b/arch/arm/dts/stm32mp15xx-dhcor-u-boot.dtsi
index eb905ad..552b35d 100644
--- a/arch/arm/dts/stm32mp15xx-dhcor-u-boot.dtsi
+++ b/arch/arm/dts/stm32mp15xx-dhcor-u-boot.dtsi
@@ -98,10 +98,14 @@
&qspi_bk1_pins_a {
bootph-pre-ram;
- pins1 {
+ pins {
bootph-pre-ram;
};
- pins2 {
+};
+
+&qspi_cs1_pins_a {
+ bootph-pre-ram;
+ pins {
bootph-pre-ram;
};
};
diff --git a/arch/arm/mach-stm32mp/cpu.c b/arch/arm/mach-stm32mp/cpu.c
index e07abbe..55574fd 100644
--- a/arch/arm/mach-stm32mp/cpu.c
+++ b/arch/arm/mach-stm32mp/cpu.c
@@ -40,6 +40,13 @@ u32 get_bootmode(void)
TAMP_BOOT_MODE_SHIFT;
}
+u32 get_bootauth(void)
+{
+ /* read boot auth status and partition from TAMP backup register */
+ return (readl(TAMP_BOOT_CONTEXT) & TAMP_BOOT_AUTH_MASK) >>
+ TAMP_BOOT_AUTH_SHIFT;
+}
+
/*
* weak function overidde: set the DDR/SYSRAM executable before to enable the
* MMU and configure DACR, for early early_enable_caches (SPL or pre-reloc)
@@ -91,10 +98,10 @@ static void early_enable_caches(void)
if (CONFIG_IS_ENABLED(SYS_DCACHE_OFF))
return;
- if (!(CONFIG_IS_ENABLED(SYS_ICACHE_OFF) && CONFIG_IS_ENABLED(SYS_DCACHE_OFF))) {
+#if !(CONFIG_IS_ENABLED(SYS_ICACHE_OFF) && CONFIG_IS_ENABLED(SYS_DCACHE_OFF))
gd->arch.tlb_size = PGTABLE_SIZE;
gd->arch.tlb_addr = (unsigned long)&early_tlb;
- }
+#endif
/* enable MMU (default configuration) */
dcache_enable();
@@ -371,8 +378,24 @@ __weak void stm32mp_misc_init(void)
{
}
+static int setup_boot_auth_info(void)
+{
+ char buf[10];
+ u32 bootauth = get_bootauth();
+
+ snprintf(buf, sizeof(buf), "%d", bootauth >> 4);
+ env_set("boot_auth", buf);
+
+ snprintf(buf, sizeof(buf), "%d", bootauth &
+ (u32)TAMP_BOOT_PARTITION_MASK);
+ env_set("boot_part", buf);
+
+ return 0;
+}
+
int arch_misc_init(void)
{
+ setup_boot_auth_info();
setup_boot_mode();
setup_mac_address();
setup_serial_number();
diff --git a/arch/arm/mach-stm32mp/include/mach/stm32.h b/arch/arm/mach-stm32mp/include/mach/stm32.h
index 1cdc5e3..ac0dece 100644
--- a/arch/arm/mach-stm32mp/include/mach/stm32.h
+++ b/arch/arm/mach-stm32mp/include/mach/stm32.h
@@ -139,8 +139,12 @@ enum boot_device {
#define TAMP_BOOT_MODE_MASK GENMASK(15, 8)
#define TAMP_BOOT_MODE_SHIFT 8
+#define TAMP_BOOT_AUTH_MASK GENMASK(23, 16)
+#define TAMP_BOOT_AUTH_SHIFT 16
#define TAMP_BOOT_DEVICE_MASK GENMASK(7, 4)
#define TAMP_BOOT_INSTANCE_MASK GENMASK(3, 0)
+#define TAMP_BOOT_AUTH_ST_MASK GENMASK(7, 4)
+#define TAMP_BOOT_PARTITION_MASK GENMASK(3, 0)
#define TAMP_BOOT_FORCED_MASK GENMASK(7, 0)
enum forced_boot_mode {
diff --git a/arch/arm/mach-stm32mp/include/mach/sys_proto.h b/arch/arm/mach-stm32mp/include/mach/sys_proto.h
index 83fb32a..52aca1e 100644
--- a/arch/arm/mach-stm32mp/include/mach/sys_proto.h
+++ b/arch/arm/mach-stm32mp/include/mach/sys_proto.h
@@ -66,6 +66,9 @@ void get_soc_name(char name[SOC_NAME_SIZE]);
/* return boot mode */
u32 get_bootmode(void);
+/* return auth status and partition */
+u32 get_bootauth(void);
+
int get_eth_nb(void);
int setup_mac_address(void);
diff --git a/configs/stm32mp15_dhcom_basic_defconfig b/configs/stm32mp15_dhcom_basic_defconfig
index b6cd0a4..1d24152 100644
--- a/configs/stm32mp15_dhcom_basic_defconfig
+++ b/configs/stm32mp15_dhcom_basic_defconfig
@@ -25,6 +25,8 @@ CONFIG_SPL_SPI=y
CONFIG_SYS_LOAD_ADDR=0xc2000000
CONFIG_SYS_MEMTEST_START=0xc0000000
CONFIG_SYS_MEMTEST_END=0xc4000000
+CONFIG_HAS_BOARD_SIZE_LIMIT=y
+CONFIG_BOARD_SIZE_LIMIT=1441792
CONFIG_FIT=y
CONFIG_SPL_LOAD_FIT=y
CONFIG_SPL_LOAD_FIT_ADDRESS=0xc1000000
@@ -76,7 +78,10 @@ CONFIG_CMD_REMOTEPROC=y
CONFIG_CMD_SPI=y
CONFIG_CMD_USB=y
CONFIG_CMD_USB_MASS_STORAGE=y
+CONFIG_CMD_DHCP6=y
+CONFIG_CMD_TFTPPUT=y
CONFIG_SYS_DISABLE_AUTOLOAD=y
+CONFIG_CMD_WGET=y
CONFIG_CMD_BOOTCOUNT=y
CONFIG_CMD_CACHE=y
CONFIG_CMD_TIME=y
@@ -101,6 +106,8 @@ CONFIG_IP_DEFRAG=y
CONFIG_TFTP_TSIZE=y
CONFIG_USE_SERVERIP=y
CONFIG_SERVERIP="192.168.1.1"
+CONFIG_PROT_TCP_SACK=y
+CONFIG_IPV6=y
CONFIG_STM32_ADC=y
CONFIG_SPL_BLOCK_CACHE=y
CONFIG_BOOTCOUNT_LIMIT=y
diff --git a/configs/stm32mp15_dhcor_basic_defconfig b/configs/stm32mp15_dhcor_basic_defconfig
index d1acf9c..6e0c4a8 100644
--- a/configs/stm32mp15_dhcor_basic_defconfig
+++ b/configs/stm32mp15_dhcor_basic_defconfig
@@ -23,6 +23,8 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y
CONFIG_SPL_SPI=y
# CONFIG_ARMV7_VIRT is not set
CONFIG_SYS_LOAD_ADDR=0xc2000000
+CONFIG_HAS_BOARD_SIZE_LIMIT=y
+CONFIG_BOARD_SIZE_LIMIT=1441792
CONFIG_FIT=y
CONFIG_SPL_LOAD_FIT=y
CONFIG_SPL_LOAD_FIT_ADDRESS=0xc1000000
@@ -74,7 +76,10 @@ CONFIG_CMD_REMOTEPROC=y
CONFIG_CMD_SPI=y
CONFIG_CMD_USB=y
CONFIG_CMD_USB_MASS_STORAGE=y
+CONFIG_CMD_DHCP6=y
+CONFIG_CMD_TFTPPUT=y
CONFIG_SYS_DISABLE_AUTOLOAD=y
+CONFIG_CMD_WGET=y
CONFIG_CMD_BOOTCOUNT=y
CONFIG_CMD_CACHE=y
CONFIG_CMD_TIME=y
@@ -99,6 +104,8 @@ CONFIG_IP_DEFRAG=y
CONFIG_TFTP_TSIZE=y
CONFIG_USE_SERVERIP=y
CONFIG_SERVERIP="192.168.1.1"
+CONFIG_PROT_TCP_SACK=y
+CONFIG_IPV6=y
CONFIG_STM32_ADC=y
CONFIG_SPL_BLOCK_CACHE=y
CONFIG_BOOTCOUNT_LIMIT=y