2
1
Эх сурвалжийг харах

boot/afboot-stm32: upgrade version

Newer versions of the kernel generate device trees that are not
storable in a single 16kB sector. In these cases the kernel load address
must be changed.
The commit 2e499dcff3ef ("Add possibility to use custom kernel load address")
adds the possibility to override the default (0x08008000) kernel load
address.

This also required changes to the stm32f429_disco_defconfig and
stm32f469_disco_xip_defconfig configurations. Patching is no longer
needed.

Also update whitespaces in hash file (2 spaces).

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>
Dario Binacchi 3 жил өмнө
parent
commit
b235a2cffc

+ 0 - 26
board/stmicroelectronics/stm32f469-disco/patches/afboot-stm32/0001-stm32f469i-disco-change-kernel-load-address.patch

@@ -1,26 +0,0 @@
-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
-

+ 20 - 0
boot/afboot-stm32/Config.in

@@ -5,3 +5,23 @@ config BR2_TARGET_AFBOOT_STM32
 	  afboot-stm32 is a very small bootloader for STM32 platforms
 
 	  https://github.com/mcoquelin-stm32/afboot-stm32
+
+if BR2_TARGET_AFBOOT_STM32
+
+config BR2_TARGET_AFBOOT_STM32_KERNEL_ADDR
+	hex "Kernel load address"
+	default "0x08008000"
+	help
+	  This is the physical address in your flash memory the kernel
+	  will be linked for and stored to. This address is dependent on
+	  your own flash usage.
+
+config BR2_TARGET_AFBOOT_STM32_DTB_ADDR
+	hex "Device-tree load address"
+	default "0x08004000"
+	help
+	  This is the physical address in your flash memory the
+	  device-tree will be stored to. This address is dependent on
+	  your own flash usage.
+
+endif

+ 1 - 1
boot/afboot-stm32/afboot-stm32.hash

@@ -1,2 +1,2 @@
 # Locally calculated
-sha256 9b37b661bd3091ceb5d8dc5a56a2dfc02ae9ebc0c63dad3c4289c9d6b3d3ec89  afboot-stm32-0.2.tar.gz
+sha256  2caacd302ab3ed5b70b3b93a6aef04162abf779c758a5be547be3ab01b68ca10  afboot-stm32-3566acd582e5536fb60864281788a30f5527df2d.tar.gz

+ 5 - 3
boot/afboot-stm32/afboot-stm32.mk

@@ -4,13 +4,15 @@
 #
 ################################################################################
 
-AFBOOT_STM32_VERSION = 0.2
-AFBOOT_STM32_SITE = $(call github,mcoquelin-stm32,afboot-stm32,v$(AFBOOT_STM32_VERSION))
+AFBOOT_STM32_VERSION = 3566acd582e5536fb60864281788a30f5527df2d
+AFBOOT_STM32_SITE = $(call github,mcoquelin-stm32,afboot-stm32,$(AFBOOT_STM32_VERSION))
 AFBOOT_STM32_INSTALL_IMAGES = YES
 AFBOOT_STM32_INSTALL_TARGET = NO
 
 define AFBOOT_STM32_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) CROSS_COMPILE=$(TARGET_CROSS) all
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) CROSS_COMPILE=$(TARGET_CROSS) all \
+		KERNEL_ADDR=$(BR2_TARGET_AFBOOT_STM32_KERNEL_ADDR) \
+		DTB_ADDR=$(BR2_TARGET_AFBOOT_STM32_DTB_ADDR)
 endef
 
 define AFBOOT_STM32_INSTALL_IMAGES_CMDS

+ 1 - 0
configs/stm32f429_disco_defconfig

@@ -15,4 +15,5 @@ BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox-minimal.config"
 BR2_TARGET_ROOTFS_INITRAMFS=y
 # BR2_TARGET_ROOTFS_TAR is not set
 BR2_TARGET_AFBOOT_STM32=y
+BR2_TARGET_AFBOOT_STM32_KERNEL_ADDR=0x0800C000
 BR2_PACKAGE_HOST_OPENOCD=y

+ 1 - 1
configs/stm32f469_disco_xip_defconfig

@@ -1,6 +1,5 @@
 BR2_arm=y
 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"
@@ -16,4 +15,5 @@ BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox-minimal.config"
 BR2_TARGET_ROOTFS_INITRAMFS=y
 # BR2_TARGET_ROOTFS_TAR is not set
 BR2_TARGET_AFBOOT_STM32=y
+BR2_TARGET_AFBOOT_STM32_KERNEL_ADDR=0x0800C000
 BR2_PACKAGE_HOST_OPENOCD=y