summaryrefslogtreecommitdiff
path: root/include/init.h
AgeCommit message (Collapse)Author
2021-11-15image: Explicitly declare do_bdinfo()Andy Shevchenko
Compiler is not happy: common/image-board.c: In function ‘boot_get_kbd’: common/image-board.c:902:17: warning: implicit declaration of function ‘do_bdinfo’ [-Wimplicit-function-declaration] 902 | do_bdinfo(NULL, 0, 0, NULL); | ^~~~~~~~~ Move the forward declaration to a header. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-08-06pci: Drop pci_init_board()Simon Glass
With the conversion to driver model, this is not needed now. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-02-15Merge branch '2021-02-02-drop-asm_global_data-when-unused'Tom Rini
- Merge the patch to take <asm/global_data.h> out of <common.h>
2021-02-03bdinfo: Rename function names to be clearerBin Meng
At present we have bdinfo_print_num() to print unsigned long numbers. We also have print_phys_addr() which accept numbers that might be 64-bit on a 32-bit platform. Rename these 2 functions to be clearer: bdinfo_print_num() => bdinfo_print_num_l() print_phys_addr() => bdinfo_print_num_ll() While we are here, make bdinfo_print_num_ll() public so that it can be used outside cmd/bdinfo.c in the future. Signed-off-by: Bin Meng <bin.meng@windriver.com>
2021-02-02common: Drop asm/global_data.h from common headerSimon Glass
Move this out of the common header and include it only where needed. In a number of cases this requires adding "struct udevice;" to avoid adding another large header or in other cases replacing / adding missing header files that had been pulled in, very indirectly. Finally, we have a few cases where we did not need to include <asm/global_data.h> at all, so remove that include. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@konsulko.com>
2021-01-15common: board_r: Drop arch-specific ifdefs around initr_trapOvidiu Panait
In order to remove the arch-specific ifdefs around initr_trap, introduce arch_initr_trap weak initcall. Implementations for ppc/m68k/mips have been moved to arch/<arch>/lib/traps.c Default implementation is a nop stub. Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
2021-01-15common: board_r: Drop initr_pci wrapperOvidiu Panait
Add a return value to pci_init and use it directly in the post-relocation init sequence, rather than using a wrapper stub. Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-01-15common: board_r: Drop initr_pci_ep wrapperOvidiu Panait
Add a return value to pci_ep_init and use it directly in the post-relocation init sequence, rather than using a wrapper stub. Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-01-15common: board_r: Drop initr_secondary_cpu wrapperOvidiu Panait
Add a return value to cpu_secondary_init_r and use it directly in the post-relocation init sequence, rather than using a wrapper stub. Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-08-06board_f: Introduce arch_setup_bdinfo initcallOvidiu Panait
Certain architectures (ppc, mips, sh, m68k) use setup board_part1 and setup_board_part2 calls during pre-relocation init to populate gd->bd boardinfo fields. This makes the generic init sequence cluttered with arch-specific ifdefs. In order to clean these arch-specific sequences from generic init, introduce arch_setup_bdinfo weak initcall so that everyone can define their own bdinfo setup routines. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
2020-08-06board_f: Introduce setup_bdinfo initcallOvidiu Panait
Introduce setup_bdinfo initcall as a generic routine to populate bdinfo fields. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
2020-07-27pci_ep: Add the init functionXiaowei Bao
Some EP deivces need to initialize before RC scan it, e.g. NXP layerscape platform, so add the init function in pci_ep uclass. Signed-off-by: Xiaowei Bao <xiaowei.bao@nxp.com> Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com> Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2020-06-25bdinfo: arm: Move ARM-specific info into its own fileSimon Glass
We don't really want to have ARM-specific code in a generic file. Create a new arch-specific function to hold it, and move it into that. Make the function weak so that any arch can implement it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-06-25bdinfo: Export some basic printing functionsSimon Glass
At present the functions to print a number and a frequency are static. We want to move some of the code in here to an arch-specific file. For consistency that code should use these same functions. So export them with an appropriate name. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-04-30board: Add a gd flag for chain loadingSimon Glass
When U-Boot is run from another boot loader, much of the low-level init needs to be skipped. Add a flag for this and adjust ll_boot_init() to use it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-04-24common/board_f: Make reserve_mmu genericOvidiu Panait
Introduce arch_reserve_mmu to allow for architecture-specific reserve_mmu routines. Also, define a weak nop stub for it. Signed-off-by: Ovidiu Panait <ovpanait@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-01-17common: Move testdram() into init.hSimon Glass
This function is called during init so move it to the init header file. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-01-17common: Move RAM-sizing functions to init.hSimon Glass
These functions relate to memory init so move them into the init header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-01-17common: Move ll_boot_init() to init.hSimon Glass
This is an init-related function so belongs in that file. Move it. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-01-17common: Move relocate_code() to init.hSimon Glass
This is an init function so move it out of the common header. Avoid using the typedef so that we don't have to include the global_data header file. Also tidy up the function style in comments while we are here. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-01-17common: Move main_loop() to init.hSimon Glass
Move this function out of common.h and into a better place. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
2019-12-15x86: fsp: Add a new arch_fsp_init_r() hookSimon Glass
With FSP2 we need to run silicon init early after relocation. Add a new hook for this. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2019-12-02common: Move trap_init() out of common.hSimon Glass
Move this function into the init.h header file. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
2019-12-02common: Move pci_init_board() out of common.hSimon Glass
This function can be dropped when all boards use driver model for PCI. For now, move it into init.h with a comment. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2019-12-02common: Move some board functions out of common.hSimon Glass
A number of board function belong in init.h with the others. Move them. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2019-12-02common: Move board_get_usable_ram_top() out of common.hSimon Glass
Move this function into init.h which seems to be designed for this sort of thing. Also update the header to declare struct global_data so that it can be included without global_data.h being needed. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2018-11-14board_f: Use static print_cpuinfo if CONFIG_CPU is activeMario Six
When the DM CPU drivers are active, printing information about a CPU should be delegated to a matching driver. Hence, add a static print_cpuinfo that implements this delegation when DM CPU drivers are active. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Mario Six <mario.six@gdsys.cc> Changed condition to CONFIG_IS_ENABLED(CPU): Signed-off-by: Simon Glass <sjg@chromium.org>
2018-11-07Revert "board_f: Use static print_cpuinfo if CONFIG_CPU is active"Bin Meng
This reverts commit c0434407b595f785fc7401237896c48c791b45fd. It turns out commit c0434407b595 broke some boards which have DM CPU driver with CONFIG_DISPLAY_CPUINFO option on. These boards just fail to boot when print_cpuinfo() is called during boot. Fixes are already sent to ML and in u-boot-dm/next, however since we are getting close to the v2018.11 release, it's safer we revert the original commit. This commit should be reverted after v2018.11 release. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-09-18board_f: Use static print_cpuinfo if CONFIG_CPU is activeMario Six
When the DM CPU drivers are active, printing information about a CPU should be delegated to a matching driver. Hence, add a static print_cpuinfo that implements this delegation when DM CPU drivers are active. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Mario Six <mario.six@gdsys.cc> Changed condition to CONFIG_IS_ENABLED(CPU): Signed-off-by: Simon Glass <sjg@chromium.org>
2018-09-18init: Fix documentationMario Six
The documentation in init.h is not in kernel-doc format. Fix this. Signed-off-by: Mario Six <mario.six@gdsys.cc>
2018-05-07SPDX: Convert all of our single license tags to Linux Kernel styleTom Rini
When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: Tom Rini <trini@konsulko.com>
2018-03-16common: move init_helpers.h prototypes in init.hPatrick Delaunay
Merge init_helpers.h in the new file init.h with only prototypes for init_cache_f_r used in common/board_f.c Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2018-03-16common: move board_info.c prototypes in init.hPatrick Delaunay
Move function prototype for common/init/board_init.c from common.h to init.h Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2018-03-16common: move board_r.c prototypes in init.hPatrick Delaunay
Move function prototypes used in common/board_r.c from common.h to init.h Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2018-03-16common: move board_init.c prototypes in init.hPatrick Delaunay
Move function prototypes for common/init/board_init.c from common.h to init.h Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2018-03-16common: move board_f.c prototypes in init.hPatrick Delaunay
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>
2018-03-16common: add a prototype for mach_cpu_init()Patrick Delaunay
Add a new file init.h with the prototype for arch_cpu_init Add a prototype for mach_cpu_init() to avoid a warning: no previous prototype for ‘mach_cpu_init’ It is a first step to move all the functions prototype used during U-Boot initialization (board_f.c / board_r.c) from common.h to init.h Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>