configs/stm32f469_xip_disco: fix kernel bootup

The current configuration fails to boot on the stm32f469-disco board.
Make it bootable again by reverting the DRAM patches.

Also change the kernel load address from 0x8010000 to 0x800C000 to
allocate more space to the kernel, since 32kB for the device tree is
enough.

Also clean up the rootfs a bit with the common stm32-post-build.sh
script.

Signed-off-by: Dario Binacchi <dariobin@libero.it>
Acked-by: Christophe Priouzeau <christophe.priouzeau@foss.st.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
This commit is contained in:
Dario Binacchi 2021-12-12 13:37:50 +01:00 committed by Arnout Vandecappelle (Essensium/Mind)
parent cffac91af5
commit 82c1a43792
6 changed files with 32 additions and 99 deletions

2
board/stmicroelectronics/stm32f469-disco/flash_xip.sh Normal file → Executable file
View File

@ -15,6 +15,6 @@ ${OUTPUT_DIR}/host/bin/openocd -f board/stm32f469discovery.cfg \
-c "flash info 0" \
-c "flash write_image erase ${OUTPUT_DIR}/images/stm32f469i-disco.bin 0x08000000" \
-c "flash write_image erase ${OUTPUT_DIR}/images/stm32f469-disco.dtb 0x08004000" \
-c "flash write_image erase ${OUTPUT_DIR}/images/xipImage 0x08010000" \
-c "flash write_image erase ${OUTPUT_DIR}/images/xipImage 0x0800C000" \
-c "reset run" \
-c "shutdown"

View File

@ -18,7 +18,7 @@ CONFIG_CC_OPTIMIZE_FOR_SIZE=y
# CONFIG_MULTIUSER is not set
# CONFIG_SYSFS_SYSCALL is not set
# CONFIG_FHANDLE is not set
# CONFIG_POSIX_TIMERS is not set
CONFIG_POSIX_TIMERS=y
# CONFIG_BUG is not set
# CONFIG_BASE_FULL is not set
# CONFIG_FUTEX is not set
@ -47,12 +47,12 @@ CONFIG_ARCH_STM32=y
CONFIG_CPU_V7M_NUM_IRQ=240
# CONFIG_ARM_DMA_MEM_BUFFERABLE is not set
CONFIG_SET_MEM_PARAM=y
CONFIG_DRAM_BASE=0xc0000000
CONFIG_DRAM_SIZE=0x01000000
CONFIG_DRAM_BASE=0x00000000
CONFIG_DRAM_SIZE=0x00800000
CONFIG_HZ_1000=y
# CONFIG_ATAGS is not set
CONFIG_XIP_KERNEL=y
CONFIG_XIP_PHYS_ADDR=0x08010000
CONFIG_XIP_PHYS_ADDR=0x0800C000
CONFIG_XIP_DEFLATED_DATA=y
# CONFIG_SUSPEND is not set
# CONFIG_STACKPROTECTOR is not set

View File

@ -1,56 +0,0 @@
From fe5f3a86d07e378baeeddc1dfecd0686d83aa42f Mon Sep 17 00:00:00 2001
From: Yauheni Saldatsenka <eugentoo@gmail.com>
Date: Sat, 14 Aug 2021 18:54:51 +0300
Subject: [PATCH] stm32f469-i: Update kernel start address
As of GNU/Linux v5.12 kernel device tree binary grows above 0x08008000
and overwrites kernel binary
Therefore this commit moves kernel to the next flash bank
Signed-off-by: Yauheni Saldatsenka <eugentoo@gmail.com>
---
stm32f469i-disco.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/stm32f469i-disco.c b/stm32f469i-disco.c
index 2da1f4b..46fc06a 100644
--- a/stm32f469i-disco.c
+++ b/stm32f469i-disco.c
@@ -6,6 +6,7 @@
#include "gpio.h"
#include "mpu.h"
+#define KERNEL_ADDR 0x08010000
#define CONFIG_HSE_HZ 8000000
#define CONFIG_PLL_M 8
#define CONFIG_PLL_N 360
@@ -85,7 +86,7 @@ static void fmc_wait_busy(void)
void start_kernel(void)
{
- void (*kernel)(uint32_t reserved, uint32_t mach, uint32_t dt) = (void (*)(uint32_t, uint32_t, uint32_t))(0x08008000 | 1);
+ void (*kernel)(uint32_t reserved, uint32_t mach, uint32_t dt) = (void (*)(uint32_t, uint32_t, uint32_t))(KERNEL_ADDR | 1);
kernel(0, ~0UL, 0x08004000);
}
@@ -102,7 +103,7 @@ int main(void)
volatile uint32_t *SYSCFG_MEMRMP = (void *)(SYSCFG_BASE + 0x00);
int i;
- mpu_config(0x0);
+ mpu_config(0xc0000000);
if (*FLASH_CR & FLASH_CR_LOCK) {
*FLASH_KEYR = 0x45670123;
@@ -195,8 +196,6 @@ int main(void)
usart_setup(usart_base, 45000000);
usart_putch(usart_base, '.');
- *SYSCFG_MEMRMP = 0x4;
-
start_kernel();
return 0;
--
2.32.0

View File

@ -0,0 +1,26 @@
From d87969f72671cab5a88ba6e2418e43d0fa267d6f Mon Sep 17 00:00:00 2001
From: Dario Binacchi <dariobin@libero.it>
Date: Sat, 13 Nov 2021 15:46:32 +0100
Subject: [PATCH] stm32f469i-disco: change kernel load address
Signed-off-by: Dario Binacchi <dariobin@libero.it>
---
stm32f469i-disco.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/stm32f469i-disco.c b/stm32f469i-disco.c
index 2da1f4b..3aacb12 100644
--- a/stm32f469i-disco.c
+++ b/stm32f469i-disco.c
@@ -85,7 +85,7 @@ static void fmc_wait_busy(void)
void start_kernel(void)
{
- void (*kernel)(uint32_t reserved, uint32_t mach, uint32_t dt) = (void (*)(uint32_t, uint32_t, uint32_t))(0x08008000 | 1);
+ void (*kernel)(uint32_t reserved, uint32_t mach, uint32_t dt) = (void (*)(uint32_t, uint32_t, uint32_t))(0x0800C000 | 1);
kernel(0, ~0UL, 0x08004000);
}
--
2.17.1

View File

@ -1,38 +0,0 @@
From 8ccf9f625d00138d86fb7d70f3efd58a8fb4d7ff Mon Sep 17 00:00:00 2001
From: Yauheni Saldatsenka <eugentoo@gmail.com>
Date: Mon, 23 Aug 2021 02:54:22 +0300
Subject: [PATCH] Use default dram address without remapping
Signed-off-by: Yauheni Saldatsenka <eugentoo@gmail.com>
---
arch/arm/boot/dts/stm32f469-disco.dts | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/arm/boot/dts/stm32f469-disco.dts b/arch/arm/boot/dts/stm32f469-disco.dts
index 2e1b3bbbe4b5..06845614a19a 100644
--- a/arch/arm/boot/dts/stm32f469-disco.dts
+++ b/arch/arm/boot/dts/stm32f469-disco.dts
@@ -60,9 +60,9 @@ chosen {
stdout-path = "serial0:115200n8";
};
- memory@00000000 {
+ memory@c0000000 {
device_type = "memory";
- reg = <0x00000000 0x1000000>;
+ reg = <0xc0000000 0x1000000>;
};
aliases {
@@ -84,7 +84,7 @@ vdd_dsi: vdd-dsi {
};
soc {
- dma-ranges = <0xc0000000 0x0 0x10000000>;
+ dma-ranges = <0xc0000000 0xc0000000 0x10000000>;
};
leds {
--
2.32.0

View File

@ -3,6 +3,7 @@ BR2_cortex_m4=y
BR2_GLOBAL_PATCH_DIR="board/stmicroelectronics/stm32f469-disco/patches"
# BR2_UCLIBC_INSTALL_UTILS is not set
BR2_GCC_ENABLE_LTO=y
BR2_ROOTFS_POST_BUILD_SCRIPT="board/stmicroelectronics/common/stm32f4xx/stm32-post-build.sh"
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/stmicroelectronics/stm32f469-disco/linux-xip.config"