void main( void )
{
  int status;

  // Init memory alloc pointer
  UTIL_setCurrMemPtr(0);

  // System init
  if (DEVICE_init() !=E_PASS)
  {
    exit();
  }

  // Execute the NAND flashing
  status = nandwriter();

  if (status != E_PASS)
  {
    DEBUG_printString("\n\nNAND flashing failed!\r\n");
  }
  else
  {
    DEBUG_printString( "\n\nNAND boot preparation was successful!\r\n" );
  }
}
Example #2
0
void main( void )
{
  Uint32 status;

  // Init memory alloc pointer to start of DDR heap
  UTIL_setCurrMemPtr(0);

  // System init
  if (DEVICE_init() !=E_PASS)
  {
    exit();
  }

  // Execute the NOR flashing
  status = norwriter();

  if (status != E_PASS)
  {
    DEBUG_printString("\tNOR flashing failed!\r\n");
  }
  else
  {
    DEBUG_printString("\tNOR boot preparation was successful!\r\n" );
  }
}
void main( void )
{
  int status;

  // System init
  if (DEVICE_init() != E_PASS)
  {
    return;
  }

  // Set PLL to 27 MHz
//  DEVICE_PLL1Init(1);

  DEVICE_pinmuxControl( 0, DEVICE_PINMUX_EMIF_MASK, DEVICE_PINMUX_EMIF_EN );

	// Execute the NAND flashing
  status = nandreader_ROM();

  if (status != E_PASS)
  {
    DEBUG_printString("\n\nNAND reading failed!\r\n");
  }
  else
  {
    DEBUG_printString( "\n\nNAND reading was successful!\r\n" );
  }
}
Example #4
0
static Uint32 LOCAL_boot(void)
{
  DEVICE_BootMode bootMode;
  
  // Read boot mode 
  bootMode = DEVICE_bootMode();
    
  if (bootMode == DEVICE_BOOTMODE_UART)
  {
    // Wait until the RBL is done using the UART. 
    while((UART0->LSR & 0x40) == 0 );
  }

  // Platform Initialization
  DEVICE_init();

  // Set RAM pointer to beginning of RAM space
  UTIL_setCurrMemPtr(0);

  // Send some information to host
  DEBUG_printString("TI SLT Version: ");
  DEBUG_printString(SLT_VERSION_STRING);
  DEBUG_printString("\r\nBooting Catalog Boot Loader\r\nBootMode = ");
  
  // Select Boot Mode
  switch(bootMode)
  {
    case DEVICE_BOOTMODE_UART:
    {
      //Report Bootmode to host
      DEBUG_printString("UART\r\n");
    }
    default:
    {
      UARTBOOT_copy();
      break;
    }
  }
    
  UART_sendString("   DONE", TRUE);
  
  UTIL_waitLoop(10000);

  DEVICE_TIMER0Stop();

  return E_PASS;    
}
Example #5
0
static Uint32 LOCAL_boot(void)
{
  DEVICE_BootMode bootMode;

  // Read boot mode 
  bootMode = DEVICE_bootMode();
  
  if (bootMode == DEVICE_BOOTMODE_UART)
  {
    // Wait until the RBL is done using the UART. 
    while((UART0->LSR & 0x40) == 0 );
  }

  // Platform Initialization
  if ( DEVICE_init() != E_PASS )
  {
    DEBUG_printString(devString);
    DEBUG_printString(" initialization failed!\r\n");
    asm(" MOV PC, #0");
  }
  else
  {
    DEBUG_printString(devString);
    DEBUG_printString(" initialization passed!\r\n");
  }

  // Set RAM pointer to beginning of RAM space
  UTIL_setCurrMemPtr(0);

  // Send some information to host
  DEBUG_printString("TI SFT Version: ");
  DEBUG_printString(SFT_VERSION_STRING);
  DEBUG_printString("\r\nBooting Catalog Serial Flasher\r\n");
  
  // Perform UART boot (always assume UART boot since this is only used for serial flashing)
  UARTBOOT_copy();
    
  DEBUG_printString("   DONE");
  
  UTIL_waitLoop(10000);

  DEVICE_TIMER0Stop();

  return E_PASS;    
}
Example #6
0
// Main entry point
void main(void)
{
  Uint32 status;

  // Give some time for host to become ready
  UTIL_waitLoop(100000);
  
  // Set RAM pointer to beginning of RAM space
  UTIL_setCurrMemPtr(0);
  
  // Init device PLLs, PSCs, external memory, etc.
  status = DEVICE_init();
  
  // Open UART peripheral for sending out status
  if (status == E_PASS)
  {
    DEVICE_UARTInit(DEVICE_UART_PERIPHNUM);
    hUartInfo = UART_open(DEVICE_UART_PERIPHNUM, hDEVICE_UART_config);
    //DEBUG_printString((String) devString);
    //DEBUG_printString(" initialization passed!\r\n");
  }
  else
  {
    return;
  }
  // Send some information to host
  //DEBUG_printString("TI SFT Version: ");
  //DEBUG_printString(SFT_VERSION_STRING);
  //DEBUG_printString("\r\n");
  
  // Perform UART boot (always assume UART boot since this is only used for serial flashing)
  UARTBOOT_copy();
    
  //DEBUG_printString("   DONE");
  
  //UTIL_waitLoop(10000);

  // FIXME: This should bre replaced with DEVICE_finalize()
  DEVICE_TIMER0Stop();

  // Jump to entry point
  APPEntry = (void (*)(void)) gEntryPoint;
  (*APPEntry)();
}
Example #7
0
void main(void)
{
  Uint8       regValue;

  // Init the memory alloc routines
  UTIL_setCurrMemPtr(0);

  // System init
  if (DEVICE_init() != E_PASS)
  {
    DEBUG_printString("Device initialization failed.\r\n");
    return;
  }

  // Give some time for I2C bus to settle (power-supply issue?)
  UTIL_waitLoop(4000000);

  // Make sure our board and chip can read the NOR via EMIF
  if (I2C_ECP_write(I2C_ECP_VMX_REG,0x20) != E_PASS)
  {
    DEBUG_printString("Write to ECP EMIF/VP control register has failed.\r\n");
    return;
  }
  DEVICE_pinmuxControl( 0, DEVICE_PINMUX_EMIF_MASK, DEVICE_PINMUX_EMIF_EN );


  // Start body of UBL
  DEBUG_printString("Starting UBL - ");
  DEBUG_printString(UBL_FLASH_TYPE); 
  DEBUG_printString(" Flash, v");
  DEBUG_printString( UBL_VERSION_STRING );
  DEBUG_printString("\r\n");

  // Find and copy the application image from the NOR flash
  if (NORBOOT_copy() != E_PASS)
  {
    DEBUG_printString( "\tERROR: Application boot failed.\r\n" );
    return;
  }
  
  // Modify board-level and chip-level settings to prep for application run

  // Set board-level muxes for video ports
  if (I2C_ECP_write(I2C_ECP_VMX_REG,0x44) != E_PASS)
  {
    DEBUG_printString("Write to ECP VP control register appears to have failed.");
    return;
  }

  // Set video port capture clocks for SD capture
  if (I2C_ECP_write(I2C_ECP_CMD_REG,0x08) != E_PASS)
  {
    DEBUG_printString("Write to ECP command register appears to have failed.");
    return;
  }

  // Set board-level muxes for audio codecs(AIC33s)
  if (I2C_ECP_write(I2C_ECP_McASP_MUX_CTRL_REG,0x19) != E_PASS)
  {
    DEBUG_printString("Write to ECP McASP control register appears to have failed.");
    return;
  }

  // Do one read to force the last write to complete
  I2C_ECP_read(I2C_ECP_McASP_MUX_CTRL_REG,&regValue);

  DEBUG_printString("Board-level setup complete.\r\n");


  // Set chip-level pin muxes for audio ports
  DEVICE_pinmuxControl( 0,
                        DEVICE_PINMUX_MCASP_MASK,
                        DEVICE_PINMUX_MCASP_EN );
  // Set chip-level pin muxes for video ports
  DEVICE_pinmuxControl( 0,
                        DEVICE_PINMUX_VP0_MASK  |
                        DEVICE_PINMUX_VP1_MASK  |
                        DEVICE_PINMUX_VP34_MASK |
                        DEVICE_PINMUX_VP2_MASK,
                        DEVICE_PINMUX_VP0_EN  |
                        DEVICE_PINMUX_VP1_EN  |
                        DEVICE_PINMUX_VP34_EN |
                        DEVICE_PINMUX_VP2_EN );

  DEBUG_printString("Chip-level setup complete.\r\n");

  // Pass control to the entry point in RAM
  DEBUG_printString("Passing control to entry point at ");
  DEBUG_printHexInt(gEntryPoint);
  DEBUG_printString(".\r\n");
  bootFunction = (AIS_fxnPtr) gEntryPoint;
  (*bootFunction)();
}