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