]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - include/common.h
net: cosmetic: Change IPaddr_t to struct in_addr
[karo-tx-uboot.git] / include / common.h
index 4b3e0d3bbd75adb6fe1a78e3ff1710de5df08297..f1dad4b2aae8388c1e162f2c0d14bb77e6d9df7d 100644 (file)
@@ -183,6 +183,7 @@ typedef void (interrupt_handler_t)(void *);
 /*
  * Function Prototypes
  */
+int dram_init(void);
 
 void   hang            (void) __attribute__ ((noreturn));
 
@@ -228,12 +229,13 @@ int run_command_list(const char *cmd, int len, int flag);
 extern char console_buffer[];
 
 /* arch/$(ARCH)/lib/board.c */
-void   board_init_f(ulong);
-void   board_init_r  (gd_t *, ulong) __attribute__ ((noreturn));
-int    checkboard    (void);
-int    checkflash    (void);
-int    checkdram     (void);
-int    last_stage_init(void);
+void board_init_f(ulong);
+void board_init_r(gd_t *, ulong) __attribute__ ((noreturn));
+int checkboard(void);
+int show_board_info(void);
+int checkflash(void);
+int checkdram(void);
+int last_stage_init(void);
 extern ulong monitor_flash_len;
 int mac_read_from_eeprom(void);
 extern u8 __dtb_dt_begin[];    /* embedded device tree blob */
@@ -250,6 +252,35 @@ static inline int print_cpuinfo(void)
 int update_flash_size(int flash_size);
 int arch_early_init_r(void);
 
+/**
+ * arch_cpu_init_dm() - init CPU after driver model is available
+ *
+ * This is called immediately after driver model is available before
+ * relocation. This is similar to arch_cpu_init() but is able to reference
+ * devices
+ *
+ * @return 0 if OK, -ve on error
+ */
+int arch_cpu_init_dm(void);
+
+/**
+ * Reserve all necessary stacks
+ *
+ * This is used in generic board init sequence in common/board_f.c. Each
+ * architecture could provide this function to tailor the required stacks.
+ *
+ * On entry gd->start_addr_sp is pointing to the suggested top of the stack.
+ * The callee ensures gd->start_add_sp is 16-byte aligned, so architectures
+ * require only this can leave it untouched.
+ *
+ * On exit gd->start_addr_sp and gd->irq_sp should be set to the respective
+ * positions of the stack. The stack pointer(s) will be set to this later.
+ * gd->irq_sp is only required, if the architecture needs it.
+ *
+ * @return 0 if no error
+ */
+__weak int arch_reserve_stacks(void);
+
 /**
  * Show the DRAM size in a board-specific way
  *
@@ -533,7 +564,9 @@ static inline int cpumask_next(int cpu, unsigned int mask)
                iter++, cpu = cpumask_next(cpu, mask)) \
 
 int    cpu_numcores  (void);
+int    cpu_num_dspcores(void);
 u32    cpu_mask      (void);
+u32    cpu_dsp_mask(void);
 int    is_core_valid (unsigned int);
 int    probecpu      (void);
 int    checkcpu      (void);
@@ -711,6 +744,45 @@ int gunzip(void *, int, unsigned char *, unsigned long *);
 int zunzip(void *dst, int dstlen, unsigned char *src, unsigned long *lenp,
                                                int stoponerr, int offset);
 
+/**
+ * gzwrite progress indicators: defined weak to allow board-specific
+ * overrides:
+ *
+ *     gzwrite_progress_init called on startup
+ *     gzwrite_progress called during decompress/write loop
+ *     gzwrite_progress_finish called at end of loop to
+ *             indicate success (retcode=0) or failure
+ */
+void gzwrite_progress_init(u64 expected_size);
+
+void gzwrite_progress(int iteration,
+                    u64 bytes_written,
+                    u64 total_bytes);
+
+void gzwrite_progress_finish(int retcode,
+                            u64 totalwritten,
+                            u64 totalsize,
+                            u32 expected_crc,
+                            u32 calculated_crc);
+
+/**
+ * decompress and write gzipped image from memory to block device
+ *
+ * @param      src             compressed image address
+ * @param      len             compressed image length in bytes
+ * @param      dev             block device descriptor
+ * @param      szwritebuf      bytes per write (pad to erase size)
+ * @param      startoffs       offset in bytes of first write
+ * @param      szexpected      expected uncompressed length
+ *                             may be zero to use gzip trailer
+ *                             for files under 4GiB
+ */
+int gzwrite(unsigned char *src, int len,
+           struct block_dev_desc *dev,
+           unsigned long szwritebuf,
+           u64 startoffs,
+           u64 szexpected);
+
 /* lib/qsort.c */
 void qsort(void *base, size_t nmemb, size_t size,
           int(*compar)(const void *, const void *));
@@ -793,7 +865,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));
 }
@@ -825,23 +897,6 @@ 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)
-{
-}
-
-static inline phys_addr_t map_to_sysmem(const void *ptr)
-{
-       return (phys_addr_t)(uintptr_t)ptr;
-}
-# endif
-
 #endif /* __ASSEMBLY__ */
 
 #ifdef CONFIG_PPC