init.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. /*
  2. * (C) Copyright 2000-2009
  3. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  4. *
  5. * Copy the startup prototype, previously defined in common.h
  6. * Copyright (C) 2018, STMicroelectronics - All Rights Reserved
  7. *
  8. * SPDX-License-Identifier: GPL-2.0+
  9. */
  10. #ifndef __INIT_H_
  11. #define __INIT_H_ 1
  12. #ifndef __ASSEMBLY__ /* put C only stuff in this section */
  13. /*
  14. * Function Prototypes
  15. */
  16. /* common/board_f.c */
  17. void board_init_f(ulong dummy);
  18. /**
  19. * arch_cpu_init() - basic cpu-dependent setup for an architecture
  20. *
  21. * This is called after early malloc is available. It should handle any
  22. * CPU- or SoC- specific init needed to continue the init sequence. See
  23. * board_f.c for where it is called. If this is not provided, a default
  24. * version (which does nothing) will be used.
  25. *
  26. * @return: 0 on success, otherwise error
  27. */
  28. int arch_cpu_init(void);
  29. /**
  30. * arch_cpu_init_dm() - init CPU after driver model is available
  31. *
  32. * This is called immediately after driver model is available before
  33. * relocation. This is similar to arch_cpu_init() but is able to reference
  34. * devices
  35. *
  36. * @return 0 if OK, -ve on error
  37. */
  38. int arch_cpu_init_dm(void);
  39. /**
  40. * mach_cpu_init() - SoC/machine dependent CPU setup
  41. *
  42. * This is called after arch_cpu_init(). It should handle any
  43. * SoC or machine specific init needed to continue the init sequence. See
  44. * board_f.c for where it is called. If this is not provided, a default
  45. * version (which does nothing) will be used.
  46. *
  47. * @return: 0 on success, otherwise error
  48. */
  49. int mach_cpu_init(void);
  50. /**
  51. * arch_fsp_init() - perform firmware support package init
  52. *
  53. * Where U-Boot relies on binary blobs to handle part of the system init, this
  54. * function can be used to set up the blobs. This is used on some Intel
  55. * platforms.
  56. */
  57. int arch_fsp_init(void);
  58. int dram_init(void);
  59. /**
  60. * dram_init_banksize() - Set up DRAM bank sizes
  61. *
  62. * This can be implemented by boards to set up the DRAM bank information in
  63. * gd->bd->bi_dram(). It is called just before relocation, after dram_init()
  64. * is called.
  65. *
  66. * If this is not provided, a default implementation will try to set up a
  67. * single bank. It will do this if CONFIG_NR_DRAM_BANKS and
  68. * CONFIG_SYS_SDRAM_BASE are set. The bank will have a start address of
  69. * CONFIG_SYS_SDRAM_BASE and the size will be determined by a call to
  70. * get_effective_memsize().
  71. *
  72. * @return 0 if OK, -ve on error
  73. */
  74. int dram_init_banksize(void);
  75. /**
  76. * Reserve all necessary stacks
  77. *
  78. * This is used in generic board init sequence in common/board_f.c. Each
  79. * architecture could provide this function to tailor the required stacks.
  80. *
  81. * On entry gd->start_addr_sp is pointing to the suggested top of the stack.
  82. * The callee ensures gd->start_add_sp is 16-byte aligned, so architectures
  83. * require only this can leave it untouched.
  84. *
  85. * On exit gd->start_addr_sp and gd->irq_sp should be set to the respective
  86. * positions of the stack. The stack pointer(s) will be set to this later.
  87. * gd->irq_sp is only required, if the architecture needs it.
  88. *
  89. * @return 0 if no error
  90. */
  91. int arch_reserve_stacks(void);
  92. int print_cpuinfo(void);
  93. int timer_init(void);
  94. int reserve_mmu(void);
  95. int misc_init_f(void);
  96. #if defined(CONFIG_DTB_RESELECT)
  97. int embedded_dtb_select(void);
  98. #endif
  99. /* common/board_r.c */
  100. #endif /* __ASSEMBLY__ */
  101. /* Put only stuff here that the assembler can digest */
  102. #endif /* __INIT_H_ */