Coldfire M5271: Activate u-boot system timer interrupt.
[oweals/u-boot.git] / include / common.h
index 2516bfd30c0dc52234c4c9bc9b17ac7e2467efad..30fff7d65ee29d4bb723c51a583c72ad5b89ec50 100644 (file)
@@ -177,6 +177,9 @@ typedef void (interrupt_handler_t)(void *);
        ({ typeof (X) __x = (X), __y = (Y);     \
                (__x > __y) ? __x : __y; })
 
+#define MIN(x, y)  min(x, y)
+#define MAX(x, y)  max(x, y)
+
 
 /**
  * container_of - cast a member of a structure out to the containing structure
@@ -231,11 +234,14 @@ int mac_read_from_eeprom(void);
 /* common/flash.c */
 void flash_perror (int);
 
-/* common/cmd_autoscript.c */
-int    autoscript (ulong addr, const char *fit_uname);
+/* common/cmd_source.c */
+int    source (ulong addr, const char *fit_uname);
 
 extern ulong load_addr;                /* Default Load Address */
 
+/* common/cmd_doc.c */
+void   doc_probe(unsigned long physadr);
+
 /* common/cmd_nvedit.c */
 int    env_init     (void);
 void   env_relocate (void);
@@ -263,6 +269,7 @@ void        forceenv     (char *, char *);
 #ifdef CONFIG_AUTO_COMPLETE
 int env_complete(char *var, int maxv, char *cmdv[], int maxsz, char *buf);
 #endif
+int get_env_id (void);
 
 void   pci_init      (void);
 void   pci_init_board(void);
@@ -273,10 +280,10 @@ void      pciinfo       (int, int);
 #endif
 
 #if defined(CONFIG_PCI) && (defined(CONFIG_440) || defined(CONFIG_405EX))
-#   if defined(CFG_PCI_TARGET_INIT)
+#   if defined(CONFIG_SYS_PCI_TARGET_INIT)
        void    pci_target_init      (struct pci_controller *);
 #   endif
-#   if defined(CFG_PCI_MASTER_INIT)
+#   if defined(CONFIG_SYS_PCI_MASTER_INIT)
        void    pci_master_init      (struct pci_controller *);
 #   endif
     int            is_pci_host         (struct pci_controller *);
@@ -287,27 +294,6 @@ void       pciinfo       (int, int);
 #endif
 #endif
 
-/*
- * Prototypes
- */
-#if defined(CONFIG_SDRAM_PPC4xx_IBM_DDR2)
-void blank_string(int);
-inline void ppc4xx_ibm_ddr2_register_dump(void);
-#if defined(CONFIG_440)
-u32 mfdcr_any(u32);
-void mtdcr_any(u32, u32);
-#endif
-#if defined(CONFIG_SPD_EEPROM)
-u32 ddr_wrdtr(u32);
-u32 ddr_clktr(u32);
-void spd_ddr_init_hang(void);
-#endif
-#endif /* defined(CONFIG_SDRAM_PPC4xx_IBM_DDR2) */
-
-#if defined(CONFIG_PPC4xx_DDR_AUTOCALIBRATION)
-u32 DQS_autocalibration(void);
-#endif /* CONFIG_PPC4xx_DDR_AUTOCALIBRATION */
-
 int    misc_init_f   (void);
 int    misc_init_r   (void);
 
@@ -340,11 +326,11 @@ extern void  pic_write (uchar reg, uchar val);
  * Set this up regardless of board
  * type, to prevent errors.
  */
-#if defined(CONFIG_SPI) || !defined(CFG_I2C_EEPROM_ADDR)
-# define CFG_DEF_EEPROM_ADDR 0
+#if defined(CONFIG_SPI) || !defined(CONFIG_SYS_I2C_EEPROM_ADDR)
+# define CONFIG_SYS_DEF_EEPROM_ADDR 0
 #else
-# define CFG_DEF_EEPROM_ADDR CFG_I2C_EEPROM_ADDR
-#endif /* CONFIG_SPI || !defined(CFG_I2C_EEPROM_ADDR) */
+# define CONFIG_SYS_DEF_EEPROM_ADDR CONFIG_SYS_I2C_EEPROM_ADDR
+#endif /* CONFIG_SPI || !defined(CONFIG_SYS_I2C_EEPROM_ADDR) */
 
 #if defined(CONFIG_SPI)
 extern void spi_init_f (void);
@@ -366,13 +352,6 @@ void       board_serial_init (void);
 void   board_ether_init (void);
 #endif
 
-#if defined(CONFIG_RPXCLASSIC) || defined(CONFIG_MBX) || \
-    defined(CONFIG_IAD210)     || defined(CONFIG_XPEDITE1K) || \
-    defined(CONFIG_METROBOX)    || defined(CONFIG_KAREF) || \
-    defined(CONFIG_V38B)
-void   board_get_enetaddr (uchar *addr);
-#endif
-
 #ifdef CONFIG_HERMES
 /* $(BOARD)/hermes.c */
 void hermes_start_lxt980 (int speed);
@@ -385,8 +364,6 @@ void  display_mem_map(void);
 void  perform_soft_reset(void);
 #endif
 
-void   load_sernum_ethaddr (void);
-
 /* $(BOARD)/$(BOARD).c */
 int board_early_init_f (void);
 int board_late_init (void);
@@ -394,9 +371,9 @@ int board_postclk_init (void); /* after clocks/timebase, before env/serial */
 int board_early_init_r (void);
 void board_poweroff (void);
 
-#if defined(CFG_DRAM_TEST)
+#if defined(CONFIG_SYS_DRAM_TEST)
 int testdram(void);
-#endif /* CFG_DRAM_TEST */
+#endif /* CONFIG_SYS_DRAM_TEST */
 
 /* $(CPU)/start.S */
 #if defined(CONFIG_5xx) || \
@@ -476,6 +453,7 @@ void ft_pci_setup(void *blob, bd_t *bd);
 
 /* $(CPU)/serial.c */
 int    serial_init   (void);
+void   serial_exit   (void);
 void   serial_addr   (unsigned int);
 void   serial_setbrg (void);
 void   serial_putc   (const char);
@@ -612,6 +590,8 @@ ulong       video_setmem (ulong);
 
 /* lib_$(ARCH)/cache.c */
 void   flush_cache   (unsigned long, unsigned long);
+void   flush_dcache_range(unsigned long start, unsigned long stop);
+void   invalidate_dcache_range(unsigned long start, unsigned long stop);
 
 
 /* lib_$(ARCH)/ticks.S */
@@ -626,7 +606,7 @@ int init_timebase (void);
 
 /* lib_generic/vsprintf.c */
 ulong  simple_strtoul(const char *cp,char **endp,unsigned int base);
-#ifdef CFG_64BIT_VSPRINTF
+#ifdef CONFIG_SYS_64BIT_VSPRINTF
 unsigned long long     simple_strtoull(const char *cp,char **endp,unsigned int base);
 #endif
 long   simple_strtol(const char *cp,char **endp,unsigned int base);
@@ -693,6 +673,13 @@ void       fputc(int file, const char c);
 int    ftstc(int file);
 int    fgetc(int file);
 
+/*
+ * CONSOLE multiplexing.
+ */
+#ifdef CONFIG_CONSOLE_MUX
+#include <iomux.h>
+#endif
+
 int    pcmcia_init (void);
 
 #ifdef CONFIG_STATUS_LED
@@ -710,8 +697,9 @@ void __attribute__((weak)) show_boot_progress (int val);
 
 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
 
-#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
-#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
+#define DIV_ROUND(n,d)         (((n) + ((d)/2)) / (d))
+#define DIV_ROUND_UP(n,d)      (((n) + (d) - 1) / (d))
+#define roundup(x, y)          ((((x) + ((y) - 1)) / (y)) * (y))
 
 #define ALIGN(x,a)             __ALIGN_MASK((x),(typeof(x))(a)-1)
 #define __ALIGN_MASK(x,mask)   (((x)+(mask))&~(mask))