mmc: fsl_esdhc: Fix SDR104 and HS200 support
[oweals/u-boot.git] / include / init.h
index a58d7a6917f23625d59e24200d7448a90c56a03d..b5a167b6edb0194a08b1de235d3f970a5bb4e013 100644 (file)
 #ifndef __INIT_H_
 #define __INIT_H_      1
 
+#include <linux/types.h>
+
+struct global_data;
+
 #ifndef __ASSEMBLY__           /* put C only stuff in this section */
 
+/* Avoid using CONFIG_EFI_STUB directly as we may boot from other loaders */
+#ifdef CONFIG_EFI_STUB
+#define ll_boot_init() false
+#else
+#define ll_boot_init() (!(gd->flags & GD_FLG_SKIP_LL_INIT))
+#endif
+
 /*
  * Function Prototypes
  */
@@ -65,6 +76,17 @@ int mach_cpu_init(void);
  */
 int arch_fsp_init(void);
 
+/**
+ * arch_fsp_init() - perform post-relocation firmware support package init
+ *
+ * Where U-Boot relies on binary blobs to handle part of the system init, this
+ * function can be used to set up the blobs. This is used on some Intel
+ * platforms.
+ *
+ * Return: 0
+ */
+int arch_fsp_init_r(void);
+
 int dram_init(void);
 
 /**
@@ -84,6 +106,11 @@ int dram_init(void);
  */
 int dram_init_banksize(void);
 
+long get_ram_size(long *base, long size);
+phys_size_t get_effective_memsize(void);
+
+int testdram(void);
+
 /**
  * arch_reserve_stacks() - Reserve all necessary stacks
  *
@@ -102,6 +129,18 @@ int dram_init_banksize(void);
  */
 int arch_reserve_stacks(void);
 
+/**
+ * arch_reserve_mmu() - Reserve memory for MMU TLB table
+ *
+ * Architecture-specific routine for reserving memory for the MMU TLB table.
+ * This is used in generic board init sequence in common/board_f.c.
+ *
+ * If an implementation is not provided, it will just be a nop stub.
+ *
+ * Return: 0 if OK
+ */
+int arch_reserve_mmu(void);
+
 /**
  * init_cache_f_r() - Turn on the cache in preparation for relocation
  *
@@ -109,9 +148,15 @@ int arch_reserve_stacks(void);
  */
 int init_cache_f_r(void);
 
+#if !CONFIG_IS_ENABLED(CPU)
+/**
+ * print_cpuinfo() - Display information about the CPU
+ *
+ * Return: 0 if OK, -ve on error
+ */
 int print_cpuinfo(void);
+#endif
 int timer_init(void);
-int reserve_mmu(void);
 int misc_init_f(void);
 
 #if defined(CONFIG_DTB_RESELECT)
@@ -142,6 +187,8 @@ ulong board_init_f_alloc_reserve(ulong top);
  */
 void board_init_f_init_reserve(ulong base);
 
+struct global_data;
+
 /**
  * arch_setup_gd() - Set up the global_data pointer
  * @gd_ptr: Pointer to global data
@@ -153,10 +200,11 @@ void board_init_f_init_reserve(ulong base);
  *
  *    gd = gd_ptr;
  */
-void arch_setup_gd(gd_t *gd_ptr);
+void arch_setup_gd(struct global_data *gd_ptr);
 
 /* common/board_r.c */
-void board_init_r(gd_t *id, ulong dest_addr) __attribute__ ((noreturn));
+void board_init_r(struct global_data *id, ulong dest_addr)
+       __attribute__ ((noreturn));
 
 int cpu_init_r(void);
 int last_stage_init(void);
@@ -174,6 +222,45 @@ int init_func_vid(void);
 int checkboard(void);
 int show_board_info(void);
 
+/**
+ * Get the uppermost pointer that is valid to access
+ *
+ * Some systems may not map all of their address space. This function allows
+ * boards to indicate what their highest support pointer value is for DRAM
+ * access.
+ *
+ * @param total_size   Size of U-Boot (unused?)
+ */
+ulong board_get_usable_ram_top(ulong total_size);
+
+int board_early_init_f(void);
+
+/* manipulate the U-Boot fdt before its relocation */
+int board_fix_fdt(void *rw_fdt_blob);
+int board_late_init(void);
+int board_postclk_init(void); /* after clocks/timebase, before env/serial */
+int board_early_init_r(void);
+
+/* TODO(sjg@chromium.org): Drop this when DM_PCI migration is completed */
+void pci_init_board(void);
+
+void trap_init(unsigned long reloc_addr);
+
+/**
+ * main_loop() - Enter the main loop of U-Boot
+ *
+ * This normally runs the command line.
+ */
+void main_loop(void);
+
+#if defined(CONFIG_ARM)
+void relocate_code(ulong addr_moni);
+#else
+void relocate_code(ulong start_addr_sp, struct global_data *new_gd,
+                  ulong relocaddr)
+       __attribute__ ((noreturn));
+#endif
+
 #endif /* __ASSEMBLY__ */
 /* Put only stuff here that the assembler can digest */