]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - lib_arm/board.c
Fix implicit declaration build warnings
[karo-tx-uboot.git] / lib_arm / board.c
index d28afc52f9f492ec2a5c3f8de193fedfec5614fe..67506b35e1ec6fbac0d00ee000341dc97c345414 100644 (file)
 #include <devices.h>
 #include <version.h>
 #include <net.h>
+#include <serial.h>
 
 #ifdef CONFIG_DRIVER_SMC91111
-#include "../drivers/smc91111.h"
+#include "../drivers/net/smc91111.h"
 #endif
 #ifdef CONFIG_DRIVER_LAN91C96
-#include "../drivers/lan91c96.h"
+#include "../drivers/net/lan91c96.h"
 #endif
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -58,6 +59,10 @@ DECLARE_GLOBAL_DATA_PTR;
 void nand_init (void);
 #endif
 
+#if defined(CONFIG_CMD_ONENAND)
+void onenand_init(void);
+#endif
+
 ulong monitor_flash_len;
 
 #ifdef CONFIG_HAS_DATAFLASH
@@ -80,6 +85,11 @@ extern void cs8900_get_enetaddr (uchar * addr);
 extern void rtl8019_get_enetaddr (uchar * addr);
 #endif
 
+#if defined(CONFIG_HARD_I2C) || \
+    defined(CONFIG_SOFT_I2C)
+#include <i2c.h>
+#endif
+
 /*
  * Begin and End of memory area for malloc(), and current "brk"
  */
@@ -111,6 +121,26 @@ void *sbrk (ptrdiff_t increment)
        return ((void *) old);
 }
 
+/************************************************************************
+ * Coloured LED functionality
+ ************************************************************************
+ * May be supplied by boards if desired
+ */
+void inline __coloured_LED_init (void) {}
+void inline coloured_LED_init (void) __attribute__((weak, alias("__coloured_LED_init")));
+void inline __red_LED_on (void) {}
+void inline red_LED_on (void) __attribute__((weak, alias("__red_LED_on")));
+void inline __red_LED_off(void) {}
+void inline red_LED_off(void)       __attribute__((weak, alias("__red_LED_off")));
+void inline __green_LED_on(void) {}
+void inline green_LED_on(void) __attribute__((weak, alias("__green_LED_on")));
+void inline __green_LED_off(void) {}
+void inline green_LED_off(void)__attribute__((weak, alias("__green_LED_off")));
+void inline __yellow_LED_on(void) {}
+void inline yellow_LED_on(void)__attribute__((weak, alias("__yellow_LED_on")));
+void inline __yellow_LED_off(void) {}
+void inline yellow_LED_off(void)__attribute__((weak, alias("__yellow_LED_off")));
+
 /************************************************************************
  * Init Utilities                                                      *
  ************************************************************************
@@ -185,6 +215,15 @@ static void display_flash_config (ulong size)
 }
 #endif /* CFG_NO_FLASH */
 
+#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
+static int init_func_i2c (void)
+{
+       puts ("I2C:   ");
+       i2c_init (CFG_I2C_SPEED, CFG_I2C_SLAVE);
+       puts ("ready\n");
+       return (0);
+}
+#endif
 
 /*
  * Breathe some life into the board...
@@ -227,6 +266,9 @@ init_fnc_t *init_sequence[] = {
 #endif
 #if defined(CONFIG_DISPLAY_BOARDINFO)
        checkboard,             /* display board info */
+#endif
+#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
+       init_func_i2c,
 #endif
        dram_init,              /* configure available RAM banks */
        display_dram_config,
@@ -301,6 +343,10 @@ void start_armboot (void)
        nand_init();            /* go init the NAND */
 #endif
 
+#if defined(CONFIG_CMD_ONENAND)
+       onenand_init();
+#endif
+
 #ifdef CONFIG_HAS_DATAFLASH
        AT91F_DataflashInit();
        dataflash_print_info();
@@ -403,6 +449,10 @@ extern void dm644x_eth_set_mac_addr (const u_int8_t *addr);
        puts ("Net:   ");
 #endif
        eth_initialize(gd->bd);
+#if defined(CONFIG_RESET_PHY_R)
+       debug ("Reset Ethernet PHY\n");
+       reset_phy();
+#endif
 #endif
        /* main_loop() can return to retry autoboot, if so just run it again. */
        for (;;) {