[572484f] | 1 | /* |
---|
| 2 | * uC5282 BSP header file |
---|
| 3 | */ |
---|
| 4 | |
---|
| 5 | #ifndef __SBC5282_BSP_H |
---|
| 6 | #define __SBC5282_BSP_H |
---|
| 7 | |
---|
| 8 | #ifdef __cplusplus |
---|
| 9 | extern "C" { |
---|
| 10 | #endif |
---|
| 11 | |
---|
| 12 | #include <rtems.h> |
---|
| 13 | #include <rtems/iosupp.h> |
---|
| 14 | #include <rtems/console.h> |
---|
| 15 | #include <rtems/clockdrv.h> |
---|
| 16 | #include <rtems/iosupp.h> |
---|
| 17 | #include <rtems/bspIo.h> |
---|
| 18 | |
---|
| 19 | /***************************************************************************/ |
---|
| 20 | /** Hardware data structure headers **/ |
---|
| 21 | #include <mcf5282/mcf5282.h> /* internal MCF5282 modules */ |
---|
| 22 | |
---|
| 23 | /***************************************************************************/ |
---|
| 24 | /** Network driver configuration **/ |
---|
| 25 | struct rtems_bsdnet_ifconfig; |
---|
| 26 | extern int rtems_fec_driver_attach (struct rtems_bsdnet_ifconfig *config, int attaching ); |
---|
| 27 | #define RTEMS_BSP_NETWORK_DRIVER_NAME "fs1" |
---|
| 28 | #define RTEMS_BSP_NETWORK_DRIVER_ATTACH rtems_fec_driver_attach |
---|
| 29 | |
---|
| 30 | /***************************************************************************/ |
---|
| 31 | /** User Definable configuration **/ |
---|
| 32 | |
---|
| 33 | /* define which port the console should use - all other ports are then defined as general purpose */ |
---|
| 34 | #define CONSOLE_PORT 0 |
---|
| 35 | |
---|
| 36 | |
---|
| 37 | /* |
---|
| 38 | * Define the time limits for RTEMS Test Suite test durations. |
---|
| 39 | * Long test and short test duration limits are provided. These |
---|
| 40 | * values are in seconds and need to be converted to ticks for the |
---|
| 41 | * application. |
---|
| 42 | * |
---|
| 43 | */ |
---|
| 44 | #define MAX_LONG_TEST_DURATION 300 /* 5 minutes = 300 seconds */ |
---|
| 45 | #define MAX_SHORT_TEST_DURATION 3 /* 3 seconds */ |
---|
| 46 | |
---|
| 47 | /* externals */ |
---|
| 48 | |
---|
| 49 | /* constants */ |
---|
| 50 | |
---|
| 51 | /* miscellaneous stuff assumed to exist */ |
---|
| 52 | |
---|
| 53 | extern rtems_configuration_table BSP_Configuration; |
---|
| 54 | |
---|
| 55 | /* |
---|
| 56 | * Device Driver Table Entries |
---|
| 57 | */ |
---|
| 58 | |
---|
| 59 | /* |
---|
| 60 | * NOTE: Use the standard Console driver entry |
---|
| 61 | */ |
---|
| 62 | |
---|
| 63 | /* |
---|
| 64 | * NOTE: Use the standard Clock driver entry |
---|
| 65 | */ |
---|
| 66 | |
---|
| 67 | |
---|
| 68 | /* functions */ |
---|
| 69 | |
---|
[0b2c943] | 70 | uint32_t bsp_get_CPU_clock_speed(void); |
---|
[d75023e] | 71 | rtems_status_code bsp_allocate_interrupt(int level, int priority); |
---|
[7eab0f78] | 72 | unsigned const char *uC5282_gethwaddr(int a); |
---|
[12993b3] | 73 | const char *uC5282_getbenv(const char *a); |
---|
[7eab0f78] | 74 | |
---|
[572484f] | 75 | void bsp_cleanup(void); |
---|
| 76 | |
---|
| 77 | m68k_isr_entry set_vector( |
---|
| 78 | rtems_isr_entry handler, |
---|
| 79 | rtems_vector_number vector, |
---|
| 80 | int type |
---|
| 81 | ); |
---|
| 82 | |
---|
| 83 | /* |
---|
| 84 | * Interrupt assignments |
---|
| 85 | * Highest-priority listed first |
---|
| 86 | */ |
---|
| 87 | #define FEC_IRQ_LEVEL 4 |
---|
| 88 | #define FEC_IRQ_RX_PRIORITY 7 |
---|
| 89 | #define FEC_IRQ_TX_PRIORITY 6 |
---|
| 90 | |
---|
| 91 | #define PIT3_IRQ_LEVEL 4 |
---|
| 92 | #define PIT3_IRQ_PRIORITY 0 |
---|
| 93 | |
---|
| 94 | #define UART0_IRQ_LEVEL 3 |
---|
| 95 | #define UART0_IRQ_PRIORITY 7 |
---|
| 96 | #define UART1_IRQ_LEVEL 3 |
---|
| 97 | #define UART1_IRQ_PRIORITY 6 |
---|
| 98 | #define UART2_IRQ_LEVEL 3 |
---|
| 99 | #define UART2_IRQ_PRIORITY 5 |
---|
| 100 | |
---|
[d75023e] | 101 | /* |
---|
| 102 | * Fake VME support |
---|
| 103 | * This makes it easier to use EPICS driver support on this BSP. |
---|
| 104 | */ |
---|
| 105 | #define VME_AM_STD_SUP_ASCENDING 0x3f |
---|
| 106 | #define VME_AM_STD_SUP_PGM 0x3e |
---|
| 107 | #define VME_AM_STD_USR_ASCENDING 0x3b |
---|
| 108 | #define VME_AM_STD_USR_PGM 0x3a |
---|
| 109 | #define VME_AM_STD_SUP_DATA 0x3d |
---|
| 110 | #define VME_AM_STD_USR_DATA 0x39 |
---|
| 111 | #define VME_AM_EXT_SUP_ASCENDING 0x0f |
---|
| 112 | #define VME_AM_EXT_SUP_PGM 0x0e |
---|
| 113 | #define VME_AM_EXT_USR_ASCENDING 0x0b |
---|
| 114 | #define VME_AM_EXT_USR_PGM 0x0a |
---|
| 115 | #define VME_AM_EXT_SUP_DATA 0x0d |
---|
| 116 | #define VME_AM_EXT_USR_DATA 0x09 |
---|
| 117 | #define VME_AM_SUP_SHORT_IO 0x2d |
---|
| 118 | #define VME_AM_USR_SHORT_IO 0x29 |
---|
| 119 | |
---|
| 120 | /* |
---|
| 121 | * 'Extended' BSP support |
---|
| 122 | */ |
---|
| 123 | rtems_status_code bspExtInit(void); |
---|
| 124 | typedef void (*BSP_VME_ISR_t)(void *usrArg, unsigned long vector); |
---|
| 125 | BSP_VME_ISR_t BSP_getVME_isr(unsigned long vector, void **parg); |
---|
| 126 | int BSP_installVME_isr(unsigned long vector, BSP_VME_ISR_t handler, void *usrArg); |
---|
| 127 | int BSP_removeVME_isr(unsigned long vector, BSP_VME_ISR_t handler, void *usrArg); |
---|
| 128 | int BSP_enableVME_int_lvl(unsigned int level); |
---|
| 129 | int BSP_disableVME_int_lvl(unsigned int level); |
---|
| 130 | int BSP_vme2local_adrs(unsigned am, unsigned long vmeaddr, unsigned long *plocaladdr); |
---|
| 131 | |
---|
| 132 | |
---|
[572484f] | 133 | #ifdef __cplusplus |
---|
| 134 | } |
---|
| 135 | #endif |
---|
| 136 | |
---|
| 137 | #endif |
---|
| 138 | /* end of include file */ |
---|