arm_board_use_weak.patch 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. From 8590c800ee60e46f15d6085e3c1fed0d6881fc62 Mon Sep 17 00:00:00 2001
  2. From: Jeroen Hofstee <jeroen@myspectrum.nl>
  3. Date: Wed, 8 Oct 2014 22:57:21 +0200
  4. Subject: [PATCH] arm: board: use __weak
  5. Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
  6. Acked-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
  7. ---
  8. arch/arm/lib/board.c | 40 ++++++++++++----------------------------
  9. 1 file changed, 12 insertions(+), 28 deletions(-)
  10. diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
  11. index 76adaf3..98782ca 100644
  12. --- a/arch/arm/lib/board.c
  13. +++ b/arch/arm/lib/board.c
  14. @@ -63,25 +63,15 @@ extern void dataflash_print_info(void);
  15. ************************************************************************
  16. * May be supplied by boards if desired
  17. */
  18. -inline void __coloured_LED_init(void) {}
  19. -void coloured_LED_init(void)
  20. - __attribute__((weak, alias("__coloured_LED_init")));
  21. -inline void __red_led_on(void) {}
  22. -void red_led_on(void) __attribute__((weak, alias("__red_led_on")));
  23. -inline void __red_led_off(void) {}
  24. -void red_led_off(void) __attribute__((weak, alias("__red_led_off")));
  25. -inline void __green_led_on(void) {}
  26. -void green_led_on(void) __attribute__((weak, alias("__green_led_on")));
  27. -inline void __green_led_off(void) {}
  28. -void green_led_off(void) __attribute__((weak, alias("__green_led_off")));
  29. -inline void __yellow_led_on(void) {}
  30. -void yellow_led_on(void) __attribute__((weak, alias("__yellow_led_on")));
  31. -inline void __yellow_led_off(void) {}
  32. -void yellow_led_off(void) __attribute__((weak, alias("__yellow_led_off")));
  33. -inline void __blue_led_on(void) {}
  34. -void blue_led_on(void) __attribute__((weak, alias("__blue_led_on")));
  35. -inline void __blue_led_off(void) {}
  36. -void blue_led_off(void) __attribute__((weak, alias("__blue_led_off")));
  37. +__weak void coloured_LED_init(void) {}
  38. +__weak void red_led_on(void) {}
  39. +__weak void red_led_off(void) {}
  40. +__weak void green_led_on(void) {}
  41. +__weak void green_led_off(void) {}
  42. +__weak void yellow_led_on(void) {}
  43. +__weak void yellow_led_off(void) {}
  44. +__weak void blue_led_on(void) {}
  45. +__weak void blue_led_off(void) {}
  46. /*
  47. ************************************************************************
  48. @@ -198,27 +188,21 @@ static int arm_pci_init(void)
  49. */
  50. typedef int (init_fnc_t) (void);
  51. -void __dram_init_banksize(void)
  52. +__weak void dram_init_banksize(void)
  53. {
  54. gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
  55. gd->bd->bi_dram[0].size = gd->ram_size;
  56. }
  57. -void dram_init_banksize(void)
  58. - __attribute__((weak, alias("__dram_init_banksize")));
  59. -int __arch_cpu_init(void)
  60. +__weak int arch_cpu_init(void)
  61. {
  62. return 0;
  63. }
  64. -int arch_cpu_init(void)
  65. - __attribute__((weak, alias("__arch_cpu_init")));
  66. -int __power_init_board(void)
  67. +__weak int power_init_board(void)
  68. {
  69. return 0;
  70. }
  71. -int power_init_board(void)
  72. - __attribute__((weak, alias("__power_init_board")));
  73. /* Record the board_init_f() bootstage (after arch_cpu_init()) */
  74. static int mark_bootstage(void)