]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - include/common.h
configs: ti_armv7_keystone2: increase size reserved for initrd
[karo-tx-uboot.git] / include / common.h
index fb5c4845992a302fcaaba5d0d8234b696bfd758c..5c076d6ce184dd7d7cc1d4dfd447a613db3c47aa 100644 (file)
@@ -192,22 +192,8 @@ int        cpu_init(void);
 
 /* */
 phys_size_t initdram (int);
-int    display_options (void);
 
-/**
- * print_size() - Print a size with a suffic
- *
- * print sizes as "xxx KiB", "xxx.y KiB", "xxx MiB", "xxx.y MiB",
- * xxx GiB, xxx.y GiB, etc as needed; allow for optional trailing string
- * (like "\n")
- *
- * @size:      Size to print
- * @suffix     String to print after the size
- */
-void print_size(uint64_t size, const char *suffix);
-
-int print_buffer(ulong addr, const void *data, uint width, uint count,
-                uint linelen);
+#include <display_options.h>
 
 /* common/main.c */
 void   main_loop       (void);
@@ -288,7 +274,7 @@ __weak int arch_reserve_stacks(void);
  *
  * @param size Size of DRAM (which should be displayed along with other info)
  */
-void board_show_dram(ulong size);
+void board_show_dram(phys_size_t size);
 
 /**
  * arch_fixup_fdt() - Write arch-specific information to fdt
@@ -482,7 +468,6 @@ int testdram(void);
     defined(CONFIG_8xx)
 uint   get_immr      (uint);
 #endif
-uint   get_pir       (void);
 #if defined(CONFIG_MPC5xxx)
 uint   get_svr       (void);
 #endif
@@ -729,6 +714,21 @@ void       invalidate_dcache_range(unsigned long start, unsigned long stop);
 void   invalidate_dcache_all(void);
 void   invalidate_icache_all(void);
 
+enum {
+       /* Disable caches (else flush caches but leave them active) */
+       CBL_DISABLE_CACHES              = 1 << 0,
+       CBL_SHOW_BOOTSTAGE_REPORT       = 1 << 1,
+
+       CBL_ALL                         = 3,
+};
+
+/**
+ * Clean up ready for linux
+ *
+ * @param flags                Flags to control what is done
+ */
+int cleanup_before_linux_select(int flags);
+
 /* arch/$(ARCH)/lib/ticks.S */
 uint64_t get_ticks(void);
 void   wait_ticks    (unsigned long);
@@ -830,11 +830,18 @@ int       getc(void);
 int    tstc(void);
 
 /* stdout */
+#if defined(CONFIG_SPL_BUILD) && !defined(CONFIG_SPL_SERIAL_SUPPORT)
+#define        putc(...) do { } while (0)
+#define puts(...) do { } while (0)
+#define printf(...) do { } while (0)
+#define vprintf(...) do { } while (0)
+#else
 void   putc(const char c);
 void   puts(const char *s);
 int    printf(const char *fmt, ...)
                __attribute__ ((format (__printf__, 1, 2)));
 int    vprintf(const char *fmt, va_list args);
+#endif
 
 /* stderr */
 #define eputc(c)               fputc(stderr, c)
@@ -865,7 +872,7 @@ int zzip(void *dst, unsigned long *lenp, unsigned char *src,
 
 /* lib/net_utils.c */
 #include <net.h>
-static inline IPaddr_t getenv_IPaddr(char *var)
+static inline struct in_addr getenv_ip(char *var)
 {
        return string_to_ip(getenv(var));
 }
@@ -1010,6 +1017,24 @@ int cpu_release(int nr, int argc, char * const argv[]);
 #define DEFINE_CACHE_ALIGN_BUFFER(type, name, size)                    \
        DEFINE_ALIGN_BUFFER(type, name, size, ARCH_DMA_MINALIGN)
 
+/*
+ * check_member() - Check the offset of a structure member
+ *
+ * @structure: Name of structure (e.g. global_data)
+ * @member:    Name of member (e.g. baudrate)
+ * @offset:    Expected offset in bytes
+ */
+#define check_member(structure, member, offset) _Static_assert( \
+       offsetof(struct structure, member) == offset, \
+       "`struct " #structure "` offset for `" #member "` is not " #offset)
+
+/* 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() true
+#endif
+
 /* Pull in stuff for the build system */
 #ifdef DO_DEPS_ONLY
 # include <environment.h>