[997f223] | 1 | /** |
---|
| 2 | * @file |
---|
| 3 | * @ingroup bfin_ezkit533 |
---|
| 4 | * @brief Global BSP definitions. |
---|
| 5 | */ |
---|
| 6 | |
---|
[8d41236] | 7 | /* bsp.h |
---|
[3495c57] | 8 | * |
---|
[8d41236] | 9 | * This include file contains all board IO definitions for eZKit533. |
---|
| 10 | * |
---|
| 11 | * Copyright (c) 2006 by Atos Automacao Industrial Ltda. |
---|
| 12 | * written by Alain Schaefer <alain.schaefer@easc.ch> |
---|
| 13 | * and Antonio Giovanini <antonio@atos.com.br> |
---|
| 14 | * |
---|
| 15 | * The license and distribution terms for this file may be |
---|
| 16 | * found in the file LICENSE in this distribution or at |
---|
[c499856] | 17 | * http://www.rtems.org/license/LICENSE. |
---|
[8d41236] | 18 | */ |
---|
[3495c57] | 19 | |
---|
[8d41236] | 20 | |
---|
[9cff822a] | 21 | #ifndef LIBBSP_BFIN_EZKIT533_BSP_H |
---|
| 22 | #define LIBBSP_BFIN_EZKIT533_BSP_H |
---|
[8d41236] | 23 | |
---|
[ed6365a] | 24 | #ifndef ASM |
---|
| 25 | |
---|
[8f45d1d] | 26 | #include <libcpu/bf533.h> |
---|
| 27 | |
---|
[8d41236] | 28 | #include <bspopts.h> |
---|
[a052181] | 29 | #include <bsp/default-initial-extension.h> |
---|
[8d41236] | 30 | |
---|
| 31 | #include <rtems.h> |
---|
[1e28c89c] | 32 | #include <rtems/score/bfin.h> |
---|
[3495c57] | 33 | #include <rtems/bfin/bf533.h> |
---|
[8d41236] | 34 | |
---|
[46dde0fc] | 35 | #ifdef __cplusplus |
---|
| 36 | extern "C" { |
---|
| 37 | #endif |
---|
| 38 | |
---|
[997f223] | 39 | /** |
---|
| 40 | * @defgroup bfin_ezkit533 eZKit533 Support |
---|
| 41 | * @ingroup bsp_bfin |
---|
| 42 | * @brief eZKit533 Board Support Package |
---|
| 43 | * @{ |
---|
[8d41236] | 44 | */ |
---|
| 45 | |
---|
[997f223] | 46 | /** |
---|
| 47 | * @name PLL and clock setup values: |
---|
| 48 | * @brief PLL configuration for ezkit533 |
---|
[8d41236] | 49 | * |
---|
| 50 | * XTL = 27 MHz |
---|
| 51 | * CLKIN = 13 MHz |
---|
| 52 | * VCO = 391 MHz |
---|
| 53 | * CCLK = 391 MHz |
---|
| 54 | * SCLK = 130 MHz |
---|
[997f223] | 55 | * |
---|
| 56 | * @{ |
---|
| 57 | * |
---|
[8d41236] | 58 | */ |
---|
| 59 | |
---|
[997f223] | 60 | #define PLL_CSEL 0x0000 ///< @brief CCLK = VCO */ |
---|
| 61 | #define PLL_SSEL 0x0003 ///< @brief SCLK = CCLK/3 */ |
---|
| 62 | #define PLL_MSEL 0x3A00 ///< @brief VCO = 29xCLKIN */ |
---|
| 63 | #define PLL_DF 0x0001 ///< @brief CLKIN = XTL/2 */ |
---|
[8d41236] | 64 | |
---|
[997f223] | 65 | #define CCLK 391000000 ///< @brief CORE CLOCK */ |
---|
| 66 | #define SCLK 130000000 ///< @brief SYSTEM CLOCK */ |
---|
[8d41236] | 67 | |
---|
[997f223] | 68 | /** @} */ |
---|
| 69 | |
---|
| 70 | /** |
---|
| 71 | * @name UART setup values |
---|
| 72 | * @{ |
---|
[8d41236] | 73 | */ |
---|
[997f223] | 74 | |
---|
| 75 | #define BAUDRATE 57600 ///< @brief Console Baudrate */ |
---|
| 76 | #define WORD_5BITS 0x00 ///< @brief 5 bits word */ |
---|
| 77 | #define WORD_6BITS 0x01 ///< @brief 6 bits word */ |
---|
| 78 | #define WORD_7BITS 0x02 ///< @brief 7 bits word */ |
---|
| 79 | #define WORD_8BITS 0x03 ///< @brief 8 bits word */ |
---|
| 80 | #define EVEN_PARITY 0x18 ///< @brief Enable EVEN parity */ |
---|
| 81 | #define ODD_PARITY 0x08 ///< @brief Enable ODD parity */ |
---|
| 82 | #define TWO_STP_BIT 0x04 ///< @brief 2 stop bits */ |
---|
| 83 | |
---|
| 84 | /** @} */ |
---|
| 85 | |
---|
| 86 | /** |
---|
| 87 | * @name Ezkit flash ports |
---|
| 88 | * @{ |
---|
[8d41236] | 89 | */ |
---|
[997f223] | 90 | |
---|
[1964b69a] | 91 | #define FlashA_PortB_Dir 0x20270007L |
---|
| 92 | #define FlashA_PortB_Data 0x20270005L |
---|
[8d41236] | 93 | |
---|
[997f223] | 94 | /** @} */ |
---|
| 95 | |
---|
| 96 | /** |
---|
| 97 | * @brief Blackfin environment memory map |
---|
[263d3fc] | 98 | */ |
---|
[1964b69a] | 99 | #define L1_DATA_SRAM_A 0xff800000L |
---|
[8d41236] | 100 | |
---|
| 101 | #define FIFOLENGTH 0x100 |
---|
| 102 | |
---|
[997f223] | 103 | /** |
---|
| 104 | * @name Constants |
---|
| 105 | * @{ |
---|
| 106 | */ |
---|
[8d41236] | 107 | |
---|
| 108 | #define RAM_START 0 |
---|
| 109 | #define RAM_END 0x100000 |
---|
| 110 | |
---|
[997f223] | 111 | /** @} */ |
---|
[8d41236] | 112 | |
---|
[997f223] | 113 | /** |
---|
| 114 | * @name functions |
---|
| 115 | * @{ |
---|
| 116 | */ |
---|
| 117 | |
---|
| 118 | /** |
---|
| 119 | * @brief Helper Function to use the EzKits LEDS. |
---|
[8d41236] | 120 | * Can be used by the Application. |
---|
| 121 | */ |
---|
[1964b69a] | 122 | void setLED (uint8_t value); |
---|
[8d41236] | 123 | |
---|
[997f223] | 124 | /** |
---|
| 125 | * @brief Helper Function to use the EzKits LEDS |
---|
[8d41236] | 126 | */ |
---|
[1964b69a] | 127 | uint8_t getLED (void); |
---|
[8d41236] | 128 | |
---|
[ed6365a] | 129 | /** |
---|
| 130 | * @brief Install an interrupt handler |
---|
| 131 | * |
---|
| 132 | * This method installs an interrupt handle. |
---|
| 133 | * |
---|
| 134 | * @param[in] handler is the isr routine |
---|
| 135 | * @param[in] vector is the vector number |
---|
| 136 | * @param[in] type indicates whether RTEMS or RAW intr |
---|
| 137 | * |
---|
| 138 | * @return returns old vector |
---|
| 139 | */ |
---|
| 140 | rtems_isr_entry set_vector( |
---|
| 141 | rtems_isr_entry handler, |
---|
| 142 | rtems_vector_number vector, |
---|
| 143 | int type |
---|
[8d41236] | 144 | ); |
---|
| 145 | |
---|
[ed6365a] | 146 | /* |
---|
| 147 | * Internal BSP methods that are used across file boundaries |
---|
| 148 | */ |
---|
| 149 | void Init_RTC(void); |
---|
| 150 | |
---|
| 151 | /* |
---|
| 152 | * Prototype for methods in .S files that are referenced from C. |
---|
| 153 | */ |
---|
| 154 | void bfin_null_isr(void); |
---|
| 155 | |
---|
[997f223] | 156 | /** @} */ |
---|
| 157 | |
---|
| 158 | /** @} */ |
---|
| 159 | |
---|
[8d41236] | 160 | #ifdef __cplusplus |
---|
| 161 | } |
---|
| 162 | #endif |
---|
| 163 | |
---|
[ed6365a] | 164 | #endif /* !ASM */ |
---|
| 165 | |
---|
[8d41236] | 166 | #endif |
---|