Merge branch 'rmobile' of git://git.denx.de/u-boot-sh
[platform/kernel/u-boot.git] / include / common.h
index cc74633..ecf7fca 100644 (file)
@@ -28,16 +28,11 @@ typedef volatile unsigned char      vu_char;
 #endif
 #if defined(CONFIG_8xx)
 #include <asm/8xx_immap.h>
-#if defined(CONFIG_MPC852)     || defined(CONFIG_MPC852T)      || \
-    defined(CONFIG_MPC859)     || defined(CONFIG_MPC859T)      || \
-    defined(CONFIG_MPC859DSL)  || \
-    defined(CONFIG_MPC866)     || defined(CONFIG_MPC866T)      || \
+#if defined(CONFIG_MPC859)     || defined(CONFIG_MPC859T)      || \
+    defined(CONFIG_MPC866)     || \
     defined(CONFIG_MPC866P)
 # define CONFIG_MPC866_FAMILY 1
-#elif defined(CONFIG_MPC870) \
-   || defined(CONFIG_MPC875) \
-   || defined(CONFIG_MPC880) \
-   || defined(CONFIG_MPC885)
+#elif defined(CONFIG_MPC885)
 # define CONFIG_MPC885_FAMILY   1
 #endif
 #if   defined(CONFIG_MPC860)      \
@@ -74,9 +69,6 @@ typedef volatile unsigned char        vu_char;
 #ifdef CONFIG_4xx
 #include <asm/ppc4xx.h>
 #endif
-#ifdef CONFIG_HYMOD
-#include <board/hymod/hymod.h>
-#endif
 #ifdef CONFIG_ARM
 #define asmlinkage     /* nothing */
 #endif
@@ -91,6 +83,9 @@ typedef volatile unsigned char        vu_char;
 #include <flash.h>
 #include <image.h>
 
+/* Bring in printf format macros if inttypes.h is included */
+#define __STDC_FORMAT_MACROS
+
 #ifdef __LP64__
 #define CONFIG_SYS_SUPPORT_64BIT_DATA
 #endif
@@ -186,9 +181,6 @@ typedef void (interrupt_handler_t)(void *);
                typeof(Y) __y = (Y);            \
                (__x > __y) ? __x : __y; })
 
-#define MIN(x, y)  min(x, y)
-#define MAX(x, y)  max(x, y)
-
 #define min3(X, Y, Z)                          \
        ({ typeof(X) __x = (X);                 \
                typeof(Y) __y = (Y);            \
@@ -203,9 +195,6 @@ typedef void (interrupt_handler_t)(void *);
                __x > __y ? (__x > __z ? __x : __z) :   \
                (__y > __z ? __y : __z); })
 
-#define MIN3(x, y, z)  min3(x, y, z)
-#define MAX3(x, y, z)  max3(x, y, z)
-
 /*
  * Return the absolute value of a number.
  *
@@ -264,7 +253,19 @@ int        cpu_init(void);
 /* */
 phys_size_t initdram (int);
 int    display_options (void);
-void   print_size(unsigned long long, const char *);
+
+/**
+ * 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);
 
@@ -320,14 +321,14 @@ int arch_early_init_r(void);
 void board_show_dram(ulong size);
 
 /**
- * arch_fixup_memory_node() - Write arch-specific memory information to fdt
+ * arch_fixup_fdt() - Write arch-specific information to fdt
  *
- * Defined in arch/$(ARCH)/lib/bootm.c
+ * Defined in arch/$(ARCH)/lib/bootm-fdt.c
  *
  * @blob:      FDT blob to write to
  * @return 0 if ok, or -ve FDT_ERR_... on failure
  */
-int arch_fixup_memory_node(void *blob);
+int arch_fixup_fdt(void *blob);
 
 /* common/flash.c */
 void flash_perror (int);
@@ -499,8 +500,6 @@ extern ssize_t spi_read      (uchar *, int, uchar *, int);
 extern ssize_t spi_write (uchar *, int, uchar *, int);
 #endif
 
-void rpxlite_init (void);
-
 #ifdef CONFIG_HERMES
 /* $(BOARD)/hermes.c */
 void hermes_start_lxt980 (int speed);
@@ -623,6 +622,7 @@ int checkicache   (void);
 int    checkdcache   (void);
 void   upmconfig     (unsigned int, unsigned int *, unsigned int);
 ulong  get_tbclk     (void);
+void   reset_misc    (void);
 void   reset_cpu     (ulong addr);
 #if defined (CONFIG_OF_LIBFDT) && defined (CONFIG_OF_BOARD_SETUP)
 void ft_cpu_setup(void *blob, bd_t *bd);
@@ -643,12 +643,10 @@ void      serial_puts   (const char *);
 int    serial_getc   (void);
 int    serial_tstc   (void);
 
-void   _serial_setbrg (const int);
-void   _serial_putc   (const char, const int);
-void   _serial_putc_raw(const char, const int);
-void   _serial_puts   (const char *, const int);
-int    _serial_getc   (const int);
-int    _serial_tstc   (const int);
+/* These versions take a stdio_dev pointer */
+struct stdio_dev;
+int serial_stub_getc(struct stdio_dev *sdev);
+int serial_stub_tstc(struct stdio_dev *sdev);
 
 /* $(CPU)/speed.c */
 int    get_clocks (void);
@@ -687,9 +685,6 @@ ulong get_PERCLK3(void);
 ulong  get_bus_freq  (ulong);
 int get_serial_clock(void);
 
-#if defined(CONFIG_MPC83xx) || defined(CONFIG_MPC85xx)
-ulong get_ddr_freq(ulong);
-#endif
 #if defined(CONFIG_MPC85xx)
 typedef MPC85xx_SYS_INFO sys_info_t;
 void   get_sys_info  ( sys_info_t * );
@@ -705,6 +700,8 @@ static inline ulong get_ddr_freq(ulong dummy)
 {
        return get_bus_freq(dummy);
 }
+#else
+ulong get_ddr_freq(ulong);
 #endif
 
 #if defined(CONFIG_4xx)
@@ -781,7 +778,7 @@ void        invalidate_dcache_all(void);
 void   invalidate_icache_all(void);
 
 /* arch/$(ARCH)/lib/ticks.S */
-unsigned long long get_ticks(void);
+uint64_t get_ticks(void);
 void   wait_ticks    (unsigned long);
 
 /* arch/$(ARCH)/lib/time.c */