]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - board/omap1610inn/omap1610innovator.c
Align end of bss by 4 bytes
[karo-tx-uboot.git] / board / omap1610inn / omap1610innovator.c
index d737f1b330daee3425365bf8b1c9627597fc8200..2e04ad4bddb024819fe2eaf26483f089e7c6207d 100644 (file)
@@ -10,6 +10,8 @@
  * Texas Instruments, <www.ti.com>
  * Kshitij Gupta <Kshitij@ti.com>
  *
+ * Modified for OMAP 1610 H2 board by Nishant Kamat, Jan 2004
+ *
  * See file CREDITS for list of people who contributed to this
  * project.
  *
 #include <./configs/omap1510.h>
 #endif
 
+DECLARE_GLOBAL_DATA_PTR;
+
+#ifdef CONFIG_CS_AUTOBOOT
+unsigned long omap_flash_base;
+#endif
+
 void flash__init (void);
 void ether__init (void);
 void set_muxconf_regs (void);
@@ -54,11 +62,12 @@ static inline void delay (unsigned long loops)
 
 int board_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
-       /* arch number of OMAP 1510-Board */
-       /* to be changed for OMAP 1610 Board */
-       gd->bd->bi_arch_number = 234;
+       if (machine_is_omap_h2())
+               gd->bd->bi_arch_number = MACH_TYPE_OMAP_H2;
+       else if (machine_is_omap_innovator())
+               gd->bd->bi_arch_number = MACH_TYPE_OMAP_INNOVATOR;
+       else
+               gd->bd->bi_arch_number = MACH_TYPE_OMAP_GENERIC;
 
        /* adress of boot parameters */
        gd->bd->bi_boot_params = 0x10000100;
@@ -93,6 +102,12 @@ void flash__init (void)
 {
 #define EMIFS_GlB_Config_REG 0xfffecc0c
        unsigned int regval;
+
+#ifdef CONFIG_CS_AUTOBOOT
+        /* Check swapping of CS0 and CS3, set flash base accordingly */
+       omap_flash_base = ((*((u32 *)OMAP_EMIFS_CONFIG_REG) & 0x02) == 0) ?
+                                       PHYS_FLASH_1_BM0 : PHYS_FLASH_1_BM1;
+#endif
        regval = *((volatile unsigned int *) EMIFS_GlB_Config_REG);
        /* Turn off write protection for flash devices. */
        regval = regval | 0x0001;
@@ -101,11 +116,32 @@ void flash__init (void)
 /*************************************************************
  Routine:ether__init
  Description: take the Ethernet controller out of reset and wait
-                          for the EEPROM load to complete.
+                          for the EEPROM load to complete.
 *************************************************************/
 void ether__init (void)
 {
-#define ETH_CONTROL_REG 0x0400000b
+#define ETH_CONTROL_REG 0x0400030b
+
+#ifdef CONFIG_H2_OMAP1610
+       #define LAN_RESET_REGISTER 0x0400001c
+
+       /* The debug board on which the lan chip resides may not be powered
+        * ON at the same time as the OMAP chip. So wait in a loop until the
+        * lan reset register (on the debug board) is available (powered on)
+        * and reset the lan chip.
+        */
+
+       *((volatile unsigned short *) LAN_RESET_REGISTER) = 0x0000;
+       do {
+               *((volatile unsigned short *) LAN_RESET_REGISTER) = 0x0001;
+               udelay (3);
+       } while (*((volatile unsigned short *) LAN_RESET_REGISTER) != 0x0001);
+
+       do {
+               *((volatile unsigned short *) LAN_RESET_REGISTER) = 0x0000;
+               udelay (3);
+       } while (*((volatile unsigned short *) LAN_RESET_REGISTER) != 0x0000);
+#endif
 
        *((volatile unsigned char *) ETH_CONTROL_REG) &= ~0x01;
        udelay (3);
@@ -117,8 +153,6 @@ void ether__init (void)
 ******************************/
 int dram_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
        gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
 
@@ -128,7 +162,7 @@ int dram_init (void)
 /******************************************************
  Routine: set_muxconf_regs
  Description: Setting up the configuration Mux registers
-                         specific to the hardware
+                         specific to the hardware
 *******************************************************/
 void set_muxconf_regs (void)
 {