]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - keystone-rtos/ibl.git/blobdiff - src/main/iblmain.c
Corrected merge for 6657 ibl
[keystone-rtos/ibl.git] / src / main / iblmain.c
index cbbcad73c610b897bd8a96300a056200107fefd8..bd1ac4fdab5ecdf665e63d8c333887e58b48d2b9 100755 (executable)
@@ -65,6 +65,7 @@
 #include "spi_api.h"
 #include "ibl_elf.h"
 #include <string.h>
+#include "uart.h"
 
 extern cregister unsigned int IER;
 
@@ -192,8 +193,11 @@ void iblPmemCfg (int32 interface, int32 port, bool enableNand)
                         iblStatus.iblFail = ibl_FAIL_CODE_NO_EMIF_CFG;
                         return;
                     }
-
+#ifdef C665x
+                                       ret = devicePowerPeriph (TARGET_PWR_EMIF_C6657);
+#else
                     ret = devicePowerPeriph (TARGET_PWR_EMIF);
+#endif
                     if (ret != 0)
                         break;
 
@@ -244,6 +248,10 @@ void main (void)
     iblStatus.iblMagic   = ibl_MAGIC_VALUE;
     iblStatus.iblVersion = ibl_VERSION;
 
+    /* Init UART */
+    uart_init();
+    uart_write_string("", 0);
+    uart_write_string("IBL version: "ibl_VERSION_STR, 0);
 
     /* Power up the timer */
     devicePowerPeriph (TARGET_PWR_TIMER_0);
@@ -274,7 +282,8 @@ void main (void)
         v &= DEVICE_JTAG_ID_MASK;
         if (
             (v == DEVICE_C6678_JTAG_ID_VAL)         || 
-            (v == DEVICE_C6670_JTAG_ID_VAL)
+            (v == DEVICE_C6670_JTAG_ID_VAL)        ||
+           (v == DEVICE_C6657_JTAG_ID_VAL)     
            )
         {
             IER = 0;
@@ -319,6 +328,8 @@ void main (void)
 #ifndef EXCLUDE_ETH
             case ibl_BOOT_MODE_TFTP:
                 iblStatus.activeDevice = ibl_ACTIVE_DEVICE_ETH;
+                /*Print something to UART, max len=80, if len is pased as 0 UART prints entire string upto '\n' or max len */
+                uart_write_string("IBL: Booting from ethernet",0);
                 iblMemcpy (&iblStatus.ethParams, &ibl.bootModes[boot_mode_idx].u.ethBoot.ethInfo, sizeof(iblEthBootInfo_t));
                 iblEthBoot (boot_mode_idx);
                 break;
@@ -328,6 +339,8 @@ void main (void)
             case ibl_BOOT_MODE_NAND:
                 iblPmemCfg (ibl.bootModes[boot_mode_idx].u.nandBoot.interface, ibl.bootModes[boot_mode_idx].port, TRUE);
                 memset ((void *)0x80000000, 0, 0x20000000);
+                /*Print something to UART, max len=80, if len is pased as 0 UART prints entire string upto '\n' or max len */
+                uart_write_string("IBL: Booting from NAND",0);
                 iblNandBoot (boot_mode_idx);
                 break;
 #endif
@@ -335,6 +348,8 @@ void main (void)
 #if (!defined(EXCLUDE_NOR_EMIF) && !defined(EXCLUDE_NOR_SPI))
             case ibl_BOOT_MODE_NOR:
                 iblPmemCfg (ibl.bootModes[boot_mode_idx].u.norBoot.interface, ibl.bootModes[boot_mode_idx].port, TRUE);
+                /*Print something to UART, max len=80, if len is pased as 0 UART prints entire string upto '\n' or max len */
+                uart_write_string("IBL: Booting from NOR",0);
                 iblNorBoot (boot_mode_idx);
                 break;
 #endif
@@ -357,6 +372,8 @@ void main (void)
                 case ibl_BOOT_MODE_TFTP:
                         iblStatus.activeDevice = ibl_ACTIVE_DEVICE_ETH;
                         iblMemcpy (&iblStatus.ethParams, &ibl.bootModes[boot_mode_idx].u.ethBoot.ethInfo, sizeof(iblEthBootInfo_t));
+                        /*Print something to UART, max len=80, if len is pased as 0 UART prints entire string upto '\n' or max len */
+                        uart_write_string("IBL: Booting from Ethernet",0);
                         iblEthBoot (boot_mode_idx);
                         break;
 #endif
@@ -364,6 +381,8 @@ void main (void)
 #if ((!defined(EXCLUDE_NAND_EMIF)) || (!defined(EXCLUDE_NAND_GPIO)))
                case ibl_BOOT_MODE_NAND:
                         iblPmemCfg (ibl.bootModes[boot_mode_idx].u.nandBoot.interface, ibl.bootModes[boot_mode_idx].port, TRUE);
+                        /*Print something to UART, max len=80, if len is pased as 0 UART prints entire string upto '\n' or max len */
+                        uart_write_string("IBL: Booting from NAND",0);
                         iblNandBoot (boot_mode_idx);
                         break;
 #endif