/*
 * File:        tower.h
 * Purpose:     Tower board definitions
 *
 * Notes:
 */

#ifndef __TOWER_H__
#define __TOWER_H__

/********************************************************************/

/* Global defines for Tower board */
#define DEBUG_PRINT

/* Define Clock Setup for system */
/* The BootROM by default will modify registers to set the system clock to 264MHz. 
   Clock Setup #1 and #2 assume BootROM has ran and now want to go to higher clock speed
   Clock Setup #3 is a no_init case which leaves the default BootROM values
   Clock Setup #4 is a special debug case if the core was halted immediatly after reset so that the BootROM never ran.
      The setup code for #4 must then do the clock init the BootROM normally does
*/

//#define CLOCK_SETUP 	  0	/* Use 396MHz CA5, 396 MHz DDR, 132MHz CM4, and 66MHz bus, 24MHz XOSC clock source */
#define CLOCK_SETUP       1	/* Use 500MHz CA5, 396 MHz DDR, 167MHz CM4, and 83.5MHz bus, 24MHz XOSC clock source */
//#define CLOCK_SETUP     2	/* Leave BootROM defaults - Uses 264MHz CA5 and 83.5MHz bus, 24MHz XOSC clock source */
//#define CLOCK_SETUP     3	/* Assumes BootROM did not run. Use 396MHz CA5, 396 MHz DDR, 167MHz CM4, and 83.5MHz bus, 24MHz XOSC clock source */


/* Define CPU version on the board */
#if ( (defined(TOWER)) )

#ifdef NO_PLL_INIT
  #define A5_CORE_CLK_KHZ 24000
  #define M4_CORE_CLK_KHZ 12000
  #define BUS_CLK_KHZ     12000
#elif (CLOCK_SETUP == 0)
  #define A5_CORE_CLK_KHZ 396000
  #define M4_CORE_CLK_KHZ 132000
  #define BUS_CLK_KHZ      66000
#elif (CLOCK_SETUP == 1)
  #define A5_CORE_CLK_KHZ 500000
  #define M4_CORE_CLK_KHZ 167000
  #define BUS_CLK_KHZ      83500
#elif (CLOCK_SETUP == 2)
  #define A5_CORE_CLK_KHZ 264000
  #define M4_CORE_CLK_KHZ 132000
  #define BUS_CLK_KHZ      66000
#elif (CLOCK_SETUP == 3)
  #define A5_CORE_CLK_KHZ 396000
  #define M4_CORE_CLK_KHZ 132000
  #define BUS_CLK_KHZ      66000
#endif

  /* Serial Port Info */
  #define UART_PORT           UART1
  //#define UART_PORT           UART2
  #define TERMINAL_BAUD       115200

#else
  #error "No valid board defined"
#endif


#endif /* __TOWER_H__ */
