1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * (C) Copyright 2000-2009
4 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
6 * Copy the startup prototype, previously defined in common.h
7 * Copyright (C) 2018, STMicroelectronics - All Rights Reserved
13 #include <linux/types.h>
15 #ifndef __ASSEMBLY__ /* put C only stuff in this section */
21 /* common/board_f.c */
22 void board_init_f(ulong dummy);
25 * arch_cpu_init() - basic cpu-dependent setup for an architecture
27 * This is called after early malloc is available. It should handle any
28 * CPU- or SoC- specific init needed to continue the init sequence. See
29 * board_f.c for where it is called. If this is not provided, a default
30 * version (which does nothing) will be used.
32 * Return: 0 on success, otherwise error
34 int arch_cpu_init(void);
37 * arch_cpu_init_dm() - init CPU after driver model is available
39 * This is called immediately after driver model is available before
40 * relocation. This is similar to arch_cpu_init() but is able to reference
43 * Return: 0 if OK, -ve on error
45 int arch_cpu_init_dm(void);
48 * mach_cpu_init() - SoC/machine dependent CPU setup
50 * This is called after arch_cpu_init(). It should handle any
51 * SoC or machine specific init needed to continue the init sequence. See
52 * board_f.c for where it is called. If this is not provided, a default
53 * version (which does nothing) will be used.
55 * Return: 0 on success, otherwise error
57 int mach_cpu_init(void);
60 * arch_fsp_init() - perform firmware support package init
62 * Where U-Boot relies on binary blobs to handle part of the system init, this
63 * function can be used to set up the blobs. This is used on some Intel
68 int arch_fsp_init(void);
73 * dram_init_banksize() - Set up DRAM bank sizes
75 * This can be implemented by boards to set up the DRAM bank information in
76 * gd->bd->bi_dram(). It is called just before relocation, after dram_init()
79 * If this is not provided, a default implementation will try to set up a
80 * single bank. It will do this if CONFIG_NR_DRAM_BANKS and
81 * CONFIG_SYS_SDRAM_BASE are set. The bank will have a start address of
82 * CONFIG_SYS_SDRAM_BASE and the size will be determined by a call to
83 * get_effective_memsize().
85 * Return: 0 if OK, -ve on error
87 int dram_init_banksize(void);
90 * arch_reserve_stacks() - Reserve all necessary stacks
92 * This is used in generic board init sequence in common/board_f.c. Each
93 * architecture could provide this function to tailor the required stacks.
95 * On entry gd->start_addr_sp is pointing to the suggested top of the stack.
96 * The callee ensures gd->start_add_sp is 16-byte aligned, so architectures
97 * require only this can leave it untouched.
99 * On exit gd->start_addr_sp and gd->irq_sp should be set to the respective
100 * positions of the stack. The stack pointer(s) will be set to this later.
101 * gd->irq_sp is only required, if the architecture needs it.
103 * Return: 0 if no error
105 int arch_reserve_stacks(void);
108 * init_cache_f_r() - Turn on the cache in preparation for relocation
110 * Return: 0 if OK, -ve on error
112 int init_cache_f_r(void);
114 #if !CONFIG_IS_ENABLED(CPU)
116 * print_cpuinfo() - Display information about the CPU
118 * Return: 0 if OK, -ve on error
120 int print_cpuinfo(void);
122 int timer_init(void);
123 int reserve_mmu(void);
124 int misc_init_f(void);
126 #if defined(CONFIG_DTB_RESELECT)
127 int embedded_dtb_select(void);
130 /* common/init/board_init.c */
131 extern ulong monitor_flash_len;
134 * ulong board_init_f_alloc_reserve - allocate reserved area
135 * @top: top of the reserve area, growing down.
137 * This function is called by each architecture very early in the start-up
138 * code to allow the C runtime to reserve space on the stack for writable
139 * 'globals' such as GD and the malloc arena.
141 * Return: bottom of reserved area
143 ulong board_init_f_alloc_reserve(ulong top);
146 * board_init_f_init_reserve - initialize the reserved area(s)
147 * @base: top from which reservation was done
149 * This function is called once the C runtime has allocated the reserved
150 * area on the stack. It must initialize the GD at the base of that area.
152 void board_init_f_init_reserve(ulong base);
157 * arch_setup_gd() - Set up the global_data pointer
158 * @gd_ptr: Pointer to global data
160 * This pointer is special in some architectures and cannot easily be assigned
161 * to. For example on x86 it is implemented by adding a specific record to its
162 * Global Descriptor Table! So we we provide a function to carry out this task.
163 * For most architectures this can simply be:
167 void arch_setup_gd(struct global_data *gd_ptr);
169 /* common/board_r.c */
170 void board_init_r(struct global_data *id, ulong dest_addr)
171 __attribute__ ((noreturn));
173 int cpu_init_r(void);
174 int last_stage_init(void);
175 int mac_read_from_eeprom(void);
176 int set_cpu_clk_info(void);
177 int update_flash_size(int flash_size);
178 int arch_early_init_r(void);
180 int misc_init_r(void);
181 #if defined(CONFIG_VID)
182 int init_func_vid(void);
185 /* common/board_info.c */
186 int checkboard(void);
187 int show_board_info(void);
190 * Get the uppermost pointer that is valid to access
192 * Some systems may not map all of their address space. This function allows
193 * boards to indicate what their highest support pointer value is for DRAM
196 * @param total_size Size of U-Boot (unused?)
198 ulong board_get_usable_ram_top(ulong total_size);
200 int board_early_init_f(void);
202 /* manipulate the U-Boot fdt before its relocation */
203 int board_fix_fdt(void *rw_fdt_blob);
204 int board_late_init(void);
205 int board_postclk_init(void); /* after clocks/timebase, before env/serial */
206 int board_early_init_r(void);
208 #endif /* __ASSEMBLY__ */
209 /* Put only stuff here that the assembler can digest */
211 #endif /* __INIT_H_ */