Commit d6f8771239b15e8a68b38fcde96977db212887bd

Authored by Patrick Delaunay
Committed by Tom Rini
1 parent 71b7564479

common: move board_f.c prototypes in init.h

Move prototypes for function used in common/board_f.c
from common.h to init.h
Remove weak for arch_reserve_stacks in prototype
(checkpatch issue)

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

Showing 3 changed files with 71 additions and 68 deletions Side-by-side Diff

... ... @@ -489,7 +489,7 @@
489 489 return 0;
490 490 }
491 491  
492   -int arch_reserve_stacks(void)
  492 +__weak int arch_reserve_stacks(void)
493 493 {
494 494 return 0;
495 495 }
... ... @@ -62,34 +62,16 @@
62 62 #define TOTAL_MALLOC_LEN CONFIG_SYS_MALLOC_LEN
63 63 #endif
64 64  
65   -/* startup functions */
  65 +/* startup functions, used in:
  66 + * common/board_f.c
  67 + */
66 68 #include <init.h>
67 69  
68 70 /*
69 71 * Function Prototypes
70 72 */
71   -int dram_init(void);
72   -
73   -/**
74   - * dram_init_banksize() - Set up DRAM bank sizes
75   - *
76   - * This can be implemented by boards to set up the DRAM bank information in
77   - * gd->bd->bi_dram(). It is called just before relocation, after dram_init()
78   - * is called.
79   - *
80   - * If this is not provided, a default implementation will try to set up a
81   - * single bank. It will do this if CONFIG_NR_DRAM_BANKS and
82   - * CONFIG_SYS_SDRAM_BASE are set. The bank will have a start address of
83   - * CONFIG_SYS_SDRAM_BASE and the size will be determined by a call to
84   - * get_effective_memsize().
85   - *
86   - * @return 0 if OK, -ve on error
87   - */
88   -int dram_init_banksize(void);
89   -
90 73 void hang (void) __attribute__ ((noreturn));
91 74  
92   -int timer_init(void);
93 75 int cpu_init(void);
94 76  
95 77 #include <display_options.h>
... ... @@ -113,7 +95,6 @@
113 95 int run_command_list(const char *cmd, int len, int flag);
114 96  
115 97 /* arch/$(ARCH)/lib/board.c */
116   -void board_init_f(ulong);
117 98 void board_init_r(gd_t *, ulong) __attribute__ ((noreturn));
118 99  
119 100 /**
120 101  
... ... @@ -160,49 +141,11 @@
160 141 extern u8 __dtb_dt_begin[]; /* embedded device tree blob */
161 142 extern u8 __dtb_dt_spl_begin[]; /* embedded device tree blob for SPL/TPL */
162 143 int set_cpu_clk_info(void);
163   -int print_cpuinfo(void);
  144 +int mdm_init(void);
164 145 int update_flash_size(int flash_size);
165 146 int arch_early_init_r(void);
166 147  
167 148 /**
168   - * arch_fsp_init() - perform firmware support package init
169   - *
170   - * Where U-Boot relies on binary blobs to handle part of the system init, this
171   - * function can be used to set up the blobs. This is used on some Intel
172   - * platforms.
173   - */
174   -int arch_fsp_init(void);
175   -
176   -/**
177   - * arch_cpu_init_dm() - init CPU after driver model is available
178   - *
179   - * This is called immediately after driver model is available before
180   - * relocation. This is similar to arch_cpu_init() but is able to reference
181   - * devices
182   - *
183   - * @return 0 if OK, -ve on error
184   - */
185   -int arch_cpu_init_dm(void);
186   -
187   -/**
188   - * Reserve all necessary stacks
189   - *
190   - * This is used in generic board init sequence in common/board_f.c. Each
191   - * architecture could provide this function to tailor the required stacks.
192   - *
193   - * On entry gd->start_addr_sp is pointing to the suggested top of the stack.
194   - * The callee ensures gd->start_add_sp is 16-byte aligned, so architectures
195   - * require only this can leave it untouched.
196   - *
197   - * On exit gd->start_addr_sp and gd->irq_sp should be set to the respective
198   - * positions of the stack. The stack pointer(s) will be set to this later.
199   - * gd->irq_sp is only required, if the architecture needs it.
200   - *
201   - * @return 0 if no error
202   - */
203   -__weak int arch_reserve_stacks(void);
204   -
205   -/**
206 149 * Show the DRAM size in a board-specific way
207 150 *
208 151 * This is used by boards to display DRAM information in their own way.
... ... @@ -221,7 +164,6 @@
221 164 */
222 165 int arch_fixup_fdt(void *blob);
223 166  
224   -int reserve_mmu(void);
225 167 /* common/flash.c */
226 168 void flash_perror (int);
227 169  
... ... @@ -351,11 +293,6 @@
351 293 void pci_init (void);
352 294 void pci_init_board(void);
353 295  
354   -#if defined(CONFIG_DTB_RESELECT)
355   -int embedded_dtb_select(void);
356   -#endif
357   -
358   -int misc_init_f (void);
359 296 int misc_init_r (void);
360 297 #if defined(CONFIG_VID)
361 298 int init_func_vid(void);
... ... @@ -18,6 +18,7 @@
18 18 */
19 19  
20 20 /* common/board_f.c */
  21 +void board_init_f(ulong dummy);
21 22  
22 23 /**
23 24 * arch_cpu_init() - basic cpu-dependent setup for an architecture
... ... @@ -32,6 +33,17 @@
32 33 int arch_cpu_init(void);
33 34  
34 35 /**
  36 + * arch_cpu_init_dm() - init CPU after driver model is available
  37 + *
  38 + * This is called immediately after driver model is available before
  39 + * relocation. This is similar to arch_cpu_init() but is able to reference
  40 + * devices
  41 + *
  42 + * @return 0 if OK, -ve on error
  43 + */
  44 +int arch_cpu_init_dm(void);
  45 +
  46 +/**
35 47 * mach_cpu_init() - SoC/machine dependent CPU setup
36 48 *
37 49 * This is called after arch_cpu_init(). It should handle any
... ... @@ -42,6 +54,60 @@
42 54 * @return: 0 on success, otherwise error
43 55 */
44 56 int mach_cpu_init(void);
  57 +
  58 +/**
  59 + * arch_fsp_init() - perform firmware support package init
  60 + *
  61 + * Where U-Boot relies on binary blobs to handle part of the system init, this
  62 + * function can be used to set up the blobs. This is used on some Intel
  63 + * platforms.
  64 + */
  65 +int arch_fsp_init(void);
  66 +
  67 +int dram_init(void);
  68 +
  69 +/**
  70 + * dram_init_banksize() - Set up DRAM bank sizes
  71 + *
  72 + * This can be implemented by boards to set up the DRAM bank information in
  73 + * gd->bd->bi_dram(). It is called just before relocation, after dram_init()
  74 + * is called.
  75 + *
  76 + * If this is not provided, a default implementation will try to set up a
  77 + * single bank. It will do this if CONFIG_NR_DRAM_BANKS and
  78 + * CONFIG_SYS_SDRAM_BASE are set. The bank will have a start address of
  79 + * CONFIG_SYS_SDRAM_BASE and the size will be determined by a call to
  80 + * get_effective_memsize().
  81 + *
  82 + * @return 0 if OK, -ve on error
  83 + */
  84 +int dram_init_banksize(void);
  85 +
  86 +/**
  87 + * Reserve all necessary stacks
  88 + *
  89 + * This is used in generic board init sequence in common/board_f.c. Each
  90 + * architecture could provide this function to tailor the required stacks.
  91 + *
  92 + * On entry gd->start_addr_sp is pointing to the suggested top of the stack.
  93 + * The callee ensures gd->start_add_sp is 16-byte aligned, so architectures
  94 + * require only this can leave it untouched.
  95 + *
  96 + * On exit gd->start_addr_sp and gd->irq_sp should be set to the respective
  97 + * positions of the stack. The stack pointer(s) will be set to this later.
  98 + * gd->irq_sp is only required, if the architecture needs it.
  99 + *
  100 + * @return 0 if no error
  101 + */
  102 +int arch_reserve_stacks(void);
  103 +
  104 +int print_cpuinfo(void);
  105 +int timer_init(void);
  106 +int reserve_mmu(void);
  107 +int misc_init_f(void);
  108 +#if defined(CONFIG_DTB_RESELECT)
  109 +int embedded_dtb_select(void);
  110 +#endif
45 111  
46 112 /* common/board_r.c */
47 113