2
1

0001-stm32f469-i-Update-kernel-start-address.patch 1.5 KB

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