[f610e83f] | 1 | /*===============================================================*\ |
---|
| 2 | | Project: RTEMS generic MPC83xx BSP | |
---|
| 3 | +-----------------------------------------------------------------+ |
---|
| 4 | | Copyright (c) 2007 | |
---|
| 5 | | Embedded Brains GmbH | |
---|
| 6 | | Obere Lagerstr. 30 | |
---|
| 7 | | D-82178 Puchheim | |
---|
| 8 | | Germany | |
---|
| 9 | | rtems@embedded-brains.de | |
---|
| 10 | +-----------------------------------------------------------------+ |
---|
| 11 | | The license and distribution terms for this file may be | |
---|
| 12 | | found in the file LICENSE in this distribution or at | |
---|
| 13 | | | |
---|
| 14 | | http://www.rtems.com/license/LICENSE. | |
---|
| 15 | | | |
---|
| 16 | +-----------------------------------------------------------------+ |
---|
| 17 | | this file contains board specific definitions | |
---|
| 18 | \*===============================================================*/ |
---|
| 19 | |
---|
| 20 | #ifndef __GEN83xx_BSP_h |
---|
| 21 | #define __GEN83xx_BSP_h |
---|
| 22 | |
---|
[574fb67] | 23 | /* |
---|
| 24 | * MPC8313E Reference Design Board |
---|
| 25 | */ |
---|
| 26 | |
---|
| 27 | #ifdef MPC8313ERDB |
---|
| 28 | |
---|
| 29 | #define HAS_UBOOT |
---|
| 30 | |
---|
| 31 | /* For U-Boot */ |
---|
| 32 | #define CONFIG_MPC83XX |
---|
| 33 | #define CONFIG_HAS_ETH1 |
---|
| 34 | |
---|
[d9be8024] | 35 | /* We want to prompt for a reset and then reset the board */ |
---|
| 36 | #define BSP_PRESS_KEY_FOR_RESET 1 |
---|
| 37 | #define BSP_RESET_BOARD_AT_EXIT 1 |
---|
| 38 | |
---|
[574fb67] | 39 | #endif /* MPC8313ERDB */ |
---|
| 40 | |
---|
| 41 | #include <libcpu/powerpc-utility.h> |
---|
| 42 | |
---|
[42bf1b9] | 43 | #include <bsp/hwreg_vals.h> |
---|
[f610e83f] | 44 | |
---|
[574fb67] | 45 | /* |
---|
| 46 | * Some symbols defined in the linker command file. |
---|
| 47 | */ |
---|
| 48 | |
---|
[d9be8024] | 49 | LINKER_SYMBOL(bsp_ram_start); |
---|
| 50 | LINKER_SYMBOL(bsp_ram_end); |
---|
| 51 | LINKER_SYMBOL(bsp_ram_size); |
---|
[574fb67] | 52 | |
---|
[d9be8024] | 53 | LINKER_SYMBOL(bsp_rom_start); |
---|
| 54 | LINKER_SYMBOL(bsp_rom_end); |
---|
| 55 | LINKER_SYMBOL(bsp_rom_size); |
---|
[574fb67] | 56 | |
---|
[d9be8024] | 57 | LINKER_SYMBOL(bsp_section_text_start); |
---|
| 58 | LINKER_SYMBOL(bsp_section_text_end); |
---|
| 59 | LINKER_SYMBOL(bsp_section_text_size); |
---|
[574fb67] | 60 | |
---|
[d9be8024] | 61 | LINKER_SYMBOL(bsp_section_data_start); |
---|
| 62 | LINKER_SYMBOL(bsp_section_data_end); |
---|
| 63 | LINKER_SYMBOL(bsp_section_data_size); |
---|
[574fb67] | 64 | |
---|
[d9be8024] | 65 | LINKER_SYMBOL(bsp_section_bss_start); |
---|
| 66 | LINKER_SYMBOL(bsp_section_bss_end); |
---|
| 67 | LINKER_SYMBOL(bsp_section_bss_size); |
---|
[574fb67] | 68 | |
---|
[d9be8024] | 69 | LINKER_SYMBOL(bsp_interrupt_stack_start); |
---|
| 70 | LINKER_SYMBOL(bsp_interrupt_stack_end); |
---|
| 71 | LINKER_SYMBOL(bsp_interrupt_stack_size); |
---|
[574fb67] | 72 | |
---|
[d9be8024] | 73 | LINKER_SYMBOL(bsp_work_area_start); |
---|
[574fb67] | 74 | |
---|
[d9be8024] | 75 | LINKER_SYMBOL(IMMRBAR); |
---|
[574fb67] | 76 | |
---|
[f610e83f] | 77 | #ifndef ASM |
---|
| 78 | |
---|
| 79 | #ifdef __cplusplus |
---|
| 80 | extern "C" { |
---|
| 81 | #endif |
---|
| 82 | |
---|
| 83 | #include "bspopts.h" |
---|
| 84 | |
---|
| 85 | #include <rtems.h> |
---|
| 86 | #include <rtems/console.h> |
---|
| 87 | #include <rtems/clockdrv.h> |
---|
| 88 | #include <bsp/irq.h> |
---|
| 89 | #include <bsp/vectors.h> |
---|
[574fb67] | 90 | #include <bsp/tictac.h> |
---|
| 91 | |
---|
| 92 | #ifdef HAS_UBOOT |
---|
| 93 | |
---|
| 94 | #include <bsp/u-boot.h> |
---|
| 95 | |
---|
| 96 | extern bd_t mpc83xx_uboot_board_info; |
---|
| 97 | |
---|
| 98 | extern const size_t mpc83xx_uboot_board_info_size; |
---|
| 99 | |
---|
| 100 | #endif /* HAS_UBOOT */ |
---|
[f610e83f] | 101 | |
---|
| 102 | /* miscellaneous stuff assumed to exist */ |
---|
| 103 | |
---|
| 104 | /* |
---|
| 105 | * We need to decide how much memory will be non-cacheable. This |
---|
| 106 | * will mainly be memory that will be used in DMA (network and serial |
---|
| 107 | * buffers). |
---|
| 108 | */ |
---|
| 109 | /* |
---|
| 110 | * Stuff for Time Test 27 |
---|
| 111 | */ |
---|
| 112 | #define MUST_WAIT_FOR_INTERRUPT 0 |
---|
| 113 | |
---|
| 114 | /* |
---|
| 115 | * Device Driver Table Entries |
---|
| 116 | */ |
---|
| 117 | |
---|
| 118 | /* |
---|
| 119 | * NOTE: Use the standard Console driver entry |
---|
| 120 | */ |
---|
| 121 | #define BSP_UART1_MINOR 0 |
---|
| 122 | #define BSP_UART2_MINOR 1 |
---|
| 123 | |
---|
| 124 | /* |
---|
| 125 | * NOTE: Use the standard Clock driver entry |
---|
| 126 | */ |
---|
| 127 | |
---|
| 128 | /* |
---|
| 129 | * indicate, that BSP has no IDE driver |
---|
| 130 | */ |
---|
| 131 | #undef RTEMS_BSP_HAS_IDE_DRIVER |
---|
| 132 | |
---|
| 133 | /* |
---|
| 134 | * How many libio files we want |
---|
| 135 | */ |
---|
| 136 | #define BSP_LIBIO_MAX_FDS 20 |
---|
| 137 | |
---|
| 138 | /* misc macros */ |
---|
| 139 | #define BSP_ARRAY_CNT(arr) (sizeof(arr)/sizeof(arr[0])) |
---|
| 140 | |
---|
| 141 | /* functions */ |
---|
| 142 | |
---|
| 143 | void bsp_cleanup(void); |
---|
[e35c696] | 144 | rtems_status_code bsp_register_i2c(void); |
---|
[55a685b] | 145 | rtems_status_code bsp_register_spi(void); |
---|
[f610e83f] | 146 | |
---|
| 147 | /* console modes (only termios) */ |
---|
| 148 | #ifdef PRINTK_MINOR |
---|
| 149 | #undef PRINTK_MINOR |
---|
| 150 | #endif |
---|
| 151 | #define PRINTK_MINOR BSP_UART1_MINOR |
---|
| 152 | |
---|
[42bf1b9] | 153 | #if defined(MPC8249EAMDS) |
---|
| 154 | #define BSP_USE_UART2 TRUE |
---|
| 155 | #else |
---|
| 156 | #define BSP_USE_UART2 FALSE |
---|
| 157 | #endif |
---|
| 158 | |
---|
[f610e83f] | 159 | #define SINGLE_CHAR_MODE |
---|
| 160 | #define UARTS_USE_TERMIOS_INT 1 |
---|
| 161 | |
---|
| 162 | /* |
---|
| 163 | * Network driver configuration |
---|
| 164 | */ |
---|
| 165 | struct rtems_bsdnet_ifconfig; |
---|
| 166 | extern int BSP_tsec_attach(struct rtems_bsdnet_ifconfig *config,int attaching); |
---|
| 167 | #define RTEMS_BSP_NETWORK_DRIVER_ATTACH BSP_tsec_attach |
---|
| 168 | |
---|
[574fb67] | 169 | #ifdef MPC8313ERDB |
---|
| 170 | |
---|
| 171 | #define RTEMS_BSP_NETWORK_DRIVER_NAME "tsec2" |
---|
| 172 | #define RTEMS_BSP_NETWORK_DRIVER_NAME2 "tsec1" |
---|
| 173 | |
---|
| 174 | #else /* MPC8313ERDB */ |
---|
| 175 | |
---|
| 176 | #define RTEMS_BSP_NETWORK_DRIVER_NAME "tsec1" |
---|
[f610e83f] | 177 | #define RTEMS_BSP_NETWORK_DRIVER_NAME2 "tsec2" |
---|
| 178 | |
---|
[574fb67] | 179 | #endif /* MPC8313ERDB */ |
---|
| 180 | |
---|
[42bf1b9] | 181 | #if defined(MPC8349EAMDS) |
---|
[e35c696] | 182 | /* |
---|
| 183 | * i2c EEPROM device name |
---|
| 184 | */ |
---|
| 185 | #define RTEMS_BSP_I2C_EEPROM_DEVICE_NAME "eeprom" |
---|
| 186 | #define RTEMS_BSP_I2C_EEPROM_DEVICE_PATH "/dev/i2c1.eeprom" |
---|
| 187 | |
---|
[55a685b] | 188 | /* |
---|
| 189 | * SPI Flash device name |
---|
| 190 | */ |
---|
| 191 | #define RTEMS_BSP_SPI_FLASH_DEVICE_NAME "flash" |
---|
| 192 | #define RTEMS_BSP_SPI_FLASH_DEVICE_PATH "/dev/spi.flash" |
---|
[42bf1b9] | 193 | #endif /* defined(MPC8349EAMDS) */ |
---|
| 194 | |
---|
| 195 | #if defined(HSC_CM01) |
---|
| 196 | /* |
---|
| 197 | * i2c EEPROM device name |
---|
| 198 | */ |
---|
| 199 | #define RTEMS_BSP_I2C_EEPROM_DEVICE_NAME "eeprom" |
---|
| 200 | #define RTEMS_BSP_I2C_EEPROM_DEVICE_PATH "/dev/i2c1.eeprom" |
---|
| 201 | |
---|
| 202 | /* |
---|
| 203 | * SPI FRAM device name |
---|
| 204 | */ |
---|
| 205 | #define RTEMS_BSP_SPI_FRAM_DEVICE_NAME "fram" |
---|
| 206 | #define RTEMS_BSP_SPI_FRAM_DEVICE_PATH "/dev/spi.fram" |
---|
| 207 | #endif /* defined(HSC_CM01) */ |
---|
[55a685b] | 208 | |
---|
[574fb67] | 209 | extern unsigned int BSP_bus_frequency; |
---|
| 210 | |
---|
| 211 | extern uint32_t bsp_clicks_per_usec; |
---|
| 212 | |
---|
| 213 | /* |
---|
| 214 | * Convert decrementer value to tenths of microseconds (used by shared timer |
---|
| 215 | * driver). |
---|
| 216 | */ |
---|
| 217 | #define BSP_Convert_decrementer( _value ) \ |
---|
| 218 | ((int) (((_value) * 10) / bsp_clicks_per_usec)) |
---|
| 219 | |
---|
| 220 | void mpc83xx_zero_4( void *dest, size_t n); |
---|
| 221 | |
---|
[699c2be] | 222 | void cpu_init( void); |
---|
| 223 | |
---|
[f610e83f] | 224 | #ifdef __cplusplus |
---|
| 225 | } |
---|
| 226 | #endif |
---|
| 227 | |
---|
| 228 | #endif /* ASM */ |
---|
| 229 | |
---|
| 230 | #endif /* GEN83xx */ |
---|