]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - include/common.h
Merge branch 'u-boot-ti/master' into 'u-boot-arm/master'
[karo-tx-uboot.git] / include / common.h
index 7205677b8db76971ddf1c0a0e45788fcefc3b068..0cfa6a837081cfe87118fcf44795a60ce126e77d 100644 (file)
@@ -42,7 +42,7 @@ typedef volatile unsigned char        vu_char;
 #include <linux/stringify.h>
 #include <asm/ptrace.h>
 #include <stdarg.h>
-#if defined(CONFIG_PCI) && (defined(CONFIG_4xx) && !defined(CONFIG_AP1000))
+#if defined(CONFIG_PCI) && defined(CONFIG_4xx)
 #include <pci.h>
 #endif
 #if defined(CONFIG_8xx)
@@ -270,7 +270,8 @@ int cpu_init(void);
 phys_size_t initdram (int);
 int    display_options (void);
 void   print_size(unsigned long long, const char *);
-int    print_buffer (ulong addr, void* data, uint width, uint count, uint linelen);
+int print_buffer(ulong addr, const void *data, uint width, uint count,
+                uint linelen);
 
 /* common/main.c */
 void   main_loop       (void);
@@ -300,7 +301,7 @@ int abortboot(int bootdelay);
 extern char console_buffer[];
 
 /* arch/$(ARCH)/lib/board.c */
-void   board_init_f  (ulong) __attribute__ ((noreturn));
+void   board_init_f(ulong);
 void   board_init_r  (gd_t *, ulong) __attribute__ ((noreturn));
 int    checkboard    (void);
 int    checkflash    (void);
@@ -310,6 +311,17 @@ extern ulong monitor_flash_len;
 int mac_read_from_eeprom(void);
 extern u8 _binary_dt_dtb_start[];      /* embedded device tree blob */
 int set_cpu_clk_info(void);
+int print_cpuinfo(void);
+int update_flash_size(int flash_size);
+
+/**
+ * Show the DRAM size in a board-specific way
+ *
+ * This is used by boards to display DRAM information in their own way.
+ *
+ * @param size Size of DRAM (which should be displayed along with other info)
+ */
+void board_show_dram(ulong size);
 
 /* common/flash.c */
 void flash_perror (int);
@@ -340,14 +352,27 @@ int       envmatch     (uchar *, int);
 char   *getenv      (const char *);
 int    getenv_f     (const char *name, char *buf, unsigned len);
 ulong getenv_ulong(const char *name, int base, ulong default_val);
+/*
+ * Read an environment variable as a boolean
+ * Return -1 if variable does not exist (default to true)
+ */
+int getenv_yesno(const char *var);
 int    saveenv      (void);
-#ifdef CONFIG_PPC              /* ARM version to be fixed! */
-int inline setenv    (const char *, const char *);
-#else
 int    setenv       (const char *, const char *);
 int setenv_ulong(const char *varname, ulong value);
-int setenv_addr(const char *varname, const void *addr);
-#endif /* CONFIG_PPC */
+int setenv_hex(const char *varname, ulong value);
+/**
+ * setenv_addr - Set an environment variable to an address in hex
+ *
+ * @varname:   Environmet variable to set
+ * @addr:      Value to set it to
+ * @return 0 if ok, 1 on error
+ */
+static inline int setenv_addr(const char *varname, const void *addr)
+{
+       return setenv_hex(varname, (ulong)addr);
+}
+
 #ifdef CONFIG_ARM
 # include <asm/mach-types.h>
 # include <asm/setup.h>
@@ -376,7 +401,7 @@ void        pci_init      (void);
 void   pci_init_board(void);
 void   pciinfo       (int, int);
 
-#if defined(CONFIG_PCI) && (defined(CONFIG_4xx) && !defined(CONFIG_AP1000))
+#if defined(CONFIG_PCI) && defined(CONFIG_4xx)
     int           pci_pre_init        (struct pci_controller *);
     int           is_pci_host         (struct pci_controller *);
 #endif
@@ -505,7 +530,11 @@ int        dcache_status (void);
 void   dcache_enable (void);
 void   dcache_disable(void);
 void   mmu_disable(void);
-void   relocate_code (ulong, gd_t *, ulong) __attribute__ ((noreturn));
+#if defined(CONFIG_ARM)
+void   relocate_code(ulong);
+#else
+void   relocate_code(ulong, gd_t *, ulong) __attribute__ ((noreturn));
+#endif
 ulong  get_endaddr   (void);
 void   trap_init     (ulong);
 #if defined (CONFIG_4xx)       || \
@@ -618,7 +647,6 @@ ulong       get_PCI_freq (void);
 #endif
 #if defined(CONFIG_S3C24X0) || \
     defined(CONFIG_LH7A40X) || \
-    defined(CONFIG_S3C6400) || \
     defined(CONFIG_EP93XX)
 ulong  get_FCLK (void);
 ulong  get_HCLK (void);
@@ -659,7 +687,7 @@ static inline ulong get_ddr_freq(ulong dummy)
 }
 #endif
 
-#if defined(CONFIG_4xx) || defined(CONFIG_IOP480)
+#if defined(CONFIG_4xx)
 #  if defined(CONFIG_440)
 #      if defined(CONFIG_440SPE)
         unsigned long determine_sysper(void);
@@ -859,6 +887,18 @@ int cpu_disable(int nr);
 int cpu_release(int nr, int argc, char * const argv[]);
 #endif
 
+/* Define a null map_sysmem() if the architecture doesn't use it */
+# ifndef CONFIG_ARCH_MAP_SYSMEM
+static inline void *map_sysmem(phys_addr_t paddr, unsigned long len)
+{
+       return (void *)(uintptr_t)paddr;
+}
+
+static inline void unmap_sysmem(const void *vaddr)
+{
+}
+# endif
+
 #endif /* __ASSEMBLY__ */
 
 #ifdef CONFIG_PPC