201-Assume-TPL-support-for-ATF-when-compiling-U-Boot-wit.patch 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <[email protected]>
  2. Date: Fri, 4 Mar 2022 09:23:34 +0100
  3. Subject: [PATCH] Assume TPL support for ATF when compiling U-Boot without TPL
  4. MIME-Version: 1.0
  5. Content-Type: text/plain; charset=UTF-8
  6. Content-Transfer-Encoding: 8bit
  7. Broadcom's U-Boot behaviour depends on compilation time check whether
  8. TPL was compiled with or without ATF support. There is no proper runtime
  9. check.
  10. When compiling just U-Boot (without SPL & TPL) there is no way to tell
  11. if it's going to work with TPL with or without ATF support.
  12. Modify code to blindly assume ATF support in TPL in such cases. It seems
  13. to be always true for Broadcom and we need some assumption as we don't
  14. deal with compiling SPL or TPL.
  15. Signed-off-by: Rafał Miłecki <[email protected]>
  16. ---
  17. arch/arm/mach-bcmbca/bcm4908/cpu.c | 2 +-
  18. arch/arm/mach-bcmbca/bcm4912/cpu.c | 2 +-
  19. board/broadcom/bcmbca/board.c | 4 ++--
  20. 3 files changed, 4 insertions(+), 4 deletions(-)
  21. --- a/arch/arm/mach-bcmbca/bcm4908/cpu.c
  22. +++ b/arch/arm/mach-bcmbca/bcm4908/cpu.c
  23. @@ -138,7 +138,7 @@ int get_nr_cpus()
  24. return nr_cpus;
  25. }
  26. -#if !defined(CONFIG_TPL_ATF)
  27. +#if defined(CONFIG_TPL) && !defined(CONFIG_TPL_ATF)
  28. void boot_secondary_cpu(unsigned long vector)
  29. {
  30. uint32_t cpu, nr_cpus = QUAD_CPUS;
  31. --- a/arch/arm/mach-bcmbca/bcm4912/cpu.c
  32. +++ b/arch/arm/mach-bcmbca/bcm4912/cpu.c
  33. @@ -174,7 +174,7 @@ int bcmbca_get_boot_device(void)
  34. return BOOT_DEVICE_NONE;
  35. }
  36. -#if !defined(CONFIG_TPL_ATF)
  37. +#if defined(CONFIG_TPL) && !defined(CONFIG_TPL_ATF)
  38. void boot_secondary_cpu(unsigned long vector)
  39. {
  40. uint32_t cpu, nr_cpus = 4;
  41. --- a/board/broadcom/bcmbca/board.c
  42. +++ b/board/broadcom/bcmbca/board.c
  43. @@ -103,7 +103,7 @@ void board_spinor_init(void)
  44. int board_init(void)
  45. {
  46. -#if !defined(CONFIG_TPL_ATF)
  47. +#if defined(CONFIG_TPL) && !defined(CONFIG_TPL_ATF)
  48. unsigned long vector;
  49. #endif
  50. board_sdk_init_e();
  51. @@ -121,7 +121,7 @@ int board_init(void)
  52. printf("$Uboot: "BUILD_TAG" $\n");
  53. #endif
  54. -#if !defined(CONFIG_TPL_ATF)
  55. +#if defined(CONFIG_TPL) && !defined(CONFIG_TPL_ATF)
  56. #if defined(CONFIG_ARM64)
  57. vector = (unsigned long)&_start;
  58. #else