Changeset cc7c922 in rtems
- Timestamp:
- 10/09/14 18:38:59 (9 years ago)
- Branches:
- 4.11, 5, master
- Children:
- e160e41
- Parents:
- 20cb691
- git-author:
- Joel Sherrill <joel.sherrill@…> (10/09/14 18:38:59)
- git-committer:
- Joel Sherrill <joel.sherrill@…> (10/10/14 15:17:17)
- Location:
- c/src/lib/libbsp/powerpc/ep1a
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/lib/libbsp/powerpc/ep1a/console/alloc360.c
r20cb691 rcc7c922 26 26 #define DEBUG_PRINT 1 27 27 28 void M360SetupMemory( M68360_t ptr ){ 28 void M360SetupMemory( M68360_t ptr ) 29 { 29 30 volatile m360_t *m360; 30 31 … … 35 36 (unsigned int)&(m360->mcr), ((unsigned int)m360+Q1_360_SIM_MCR)); 36 37 #endif 37 ptr->bdregions[0].base = (char *)&m360->dpram1[0];38 ptr->bdregions[0].base = &m360->dpram1[0]; 38 39 ptr->bdregions[0].size = sizeof m360->dpram1; 39 40 ptr->bdregions[0].used = 0; 40 41 41 ptr->bdregions[1].base = (char *)&m360->dpram3[0];42 ptr->bdregions[1].base = &m360->dpram3[0]; 42 43 ptr->bdregions[1].size = sizeof m360->dpram3; 43 44 ptr->bdregions[1].used = 0; 44 45 45 ptr->bdregions[2].base = (char *)&m360->dpram0[0];46 ptr->bdregions[2].base = &m360->dpram0[0]; 46 47 ptr->bdregions[2].size = sizeof m360->dpram0; 47 48 ptr->bdregions[2].used = 0; 48 49 49 ptr->bdregions[3].base = (char *)&m360->dpram2[0];50 ptr->bdregions[3].base = &m360->dpram2[0]; 50 51 ptr->bdregions[3].size = sizeof m360->dpram2; 51 52 ptr->bdregions[3].used = 0; … … 60 61 { 61 62 unsigned int i; 62 ISR_Levellevel;63 vo id*bdp = NULL;64 unsigned int want = count * sizeof(m360BufferDescriptor_t);65 int have;63 rtems_interrupt_level level; 64 volatile unsigned char *bdp = NULL; 65 unsigned int want = count * sizeof(m360BufferDescriptor_t); 66 int have; 66 67 67 68 /* … … 70 71 * initialization sequence so the effect shouldn't be too severe. 71 72 */ 72 _ISR_Disable(level);73 rtems_interrupt_disable(level); 73 74 74 75 for (i = 0 ; i < M360_NUM_DPRAM_REAGONS ; i++) { … … 101 102 } 102 103 } 103 _ISR_Enable(level);104 rtems_interrupt_enable(level); 104 105 if (bdp == NULL){ 105 106 printk("rtems_panic can't allocate %d buffer descriptor(s).\n"); 106 107 rtems_panic ("Can't allocate %d buffer descriptor(s).\n", count); 107 108 } 108 return bdp;109 return (void *)bdp; 109 110 } -
c/src/lib/libbsp/powerpc/ep1a/console/m68360.h
r20cb691 rcc7c922 934 934 935 935 struct bdregions_t { 936 char*base;937 unsigned int size;938 unsigned int used;936 volatile unsigned char *base; 937 unsigned int size; 938 unsigned int used; 939 939 }; 940 940 -
c/src/lib/libbsp/powerpc/ep1a/console/mc68360_scc.c
r20cb691 rcc7c922 1 1 /* This file contains the termios TTY driver for the 2 2 * Motorola MC68360 SCC ports. 3 * 3 */ 4 5 /* 4 6 * COPYRIGHT (c) 1989-2008. 5 7 * On-Line Applications Research Corporation (OAR). … … 35 37 int mc68360_length_count=0; 36 38 37 void mc68360_Show_length_array(void) { 39 #if 0 40 /* 41 * This is a debug method which is not currently used. 42 */ 43 static void mc68360_Show_length_array(void) 44 { 38 45 int i; 39 46 for (i=0; i<MC68360_LENGTH_SIZE; i++) … … 42 49 } 43 50 #endif 51 #endif 44 52 45 53 … … 47 55 48 56 #define SYNC eieio 49 #define mc68360_scc_Is_422( _minor ) (Console_Port_Tbl[minor]->sDeviceName[7] == '4' ) 50 51 52 void mc68360_scc_nullFunc(void) {} 53 54 uint8_t scc_read8( 57 #define mc68360_scc_Is_422( _minor ) \ 58 (Console_Port_Tbl[minor]->sDeviceName[7] == '4' ) 59 60 #if 0 61 /* 62 * This method is included for completeness but not currently used. 63 */ 64 static uint8_t scc_read8( 55 65 const char *name, 56 66 volatile uint8_t *address … … 69 79 return value; 70 80 } 71 72 void scc_write8( 81 #endif 82 83 static void scc_write8( 73 84 const char *name, 74 85 volatile uint8_t *address, … … 82 93 } 83 94 84 85 uint16_t scc_read16( 95 static uint16_t scc_read16( 86 96 const char *name, 87 97 volatile uint16_t *address … … 101 111 } 102 112 103 void scc_write16(113 static void scc_write16( 104 114 const char *name, 105 115 volatile uint16_t *address, … … 113 123 } 114 124 115 116 uint32_t scc_read32( 125 static uint32_t scc_read32( 117 126 const char *name, 118 127 volatile uint32_t *address … … 132 141 } 133 142 134 void scc_write32(143 static void scc_write32( 135 144 const char *name, 136 145 volatile uint32_t *address, … … 144 153 } 145 154 146 void mc68360_sccShow_Regs(int minor){ 155 #if 0 156 /* 157 * This is a debug method which is not currently used. 158 */ 159 static void mc68360_sccShow_Regs(int minor) 160 { 147 161 M68360_serial_ports_t ptr; 148 162 ptr = Console_Port_Tbl[minor]->pDeviceParams; … … 152 166 153 167 } 168 #endif 154 169 155 170 #define TX_BUFFER_ADDRESS( _ptr ) \ … … 326 341 * Default state is 9600 baud, 8 bits, No parity, and 1 stop bit. 327 342 */ 328 329 int mc68360_scc_open( 343 static int mc68360_scc_open( 330 344 int major, 331 345 int minor, … … 654 668 */ 655 669 656 int mc68360_scc_write_support_int(670 ssize_t mc68360_scc_write_support_int( 657 671 int minor, 658 672 const char *buf, 659 intlen673 size_t len 660 674 ) 661 675 { … … 954 968 chip->board_data->funcNo, 955 969 &mc68360_sccInterruptHandler, 956 chip970 (uintptr_t) chip 957 971 ); 958 972 -
c/src/lib/libbsp/powerpc/ep1a/console/ns16550cfg.c
r20cb691 rcc7c922 1 1 /* 2 * This include file contains all console driver definations for the nc16550 3 * 2 * This include file contains all console driver definitions for the ns16550. 3 */ 4 5 /* 4 6 * COPYRIGHT (c) 1989-2008. 5 7 * On-Line Applications Research Corporation (OAR). … … 10 12 */ 11 13 12 #include < rtems.h>14 #include <bsp.h> 13 15 #include <libchip/serial.h> 14 16 #include <libchip/ns16550.h> 15 #include <bsp.h> 17 18 #include "ns16550cfg.h" 16 19 17 20 typedef struct uart_reg … … 22 25 23 26 uint8_t Read_ns16550_register( 24 uint 32_t ulCtrlPort,25 uint8_t ucRegNum27 uintptr_t ulCtrlPort, 28 uint8_t ucRegNum 26 29 ) 27 30 { 28 volatile struct uart_reg *p = (volatile struct uart_reg *)ulCtrlPort;31 volatile struct uart_reg *p = (volatile struct uart_reg *)ulCtrlPort; 29 32 uint8_t ucData; 33 30 34 ucData = p[ucRegNum].reg; 31 35 __asm__ volatile("sync"); … … 34 38 35 39 void Write_ns16550_register( 36 uint 32_t ulCtrlPort,37 uint8_t ucRegNum,38 uint8_t ucData40 uintptr_t ulCtrlPort, 41 uint8_t ucRegNum, 42 uint8_t ucData 39 43 ) 40 44 { -
c/src/lib/libbsp/powerpc/ep1a/console/ns16550cfg.h
r20cb691 rcc7c922 1 1 /* 2 * This include file contains all console driver definations for the nc16550 3 * 2 * This include file contains all console driver definitions for the ns16550. 3 */ 4 5 /* 4 6 * COPYRIGHT (c) 1989-2008. 5 7 * On-Line Applications Research Corporation (OAR). … … 22 24 23 25 uint8_t Read_ns16550_register( 24 uint 32_t ulCtrlPort,25 uint8_t ucRegNum26 uintptr_t ulCtrlPort, 27 uint8_t ucRegNum 26 28 ); 27 29 28 30 void Write_ns16550_register( 29 uint 32_t ulCtrlPort,30 uint8_t ucRegNum,31 uint8_t ucData31 uintptr_t ulCtrlPort, 32 uint8_t ucRegNum, 33 uint8_t ucData 32 34 ); 33 35 -
c/src/lib/libbsp/powerpc/ep1a/console/rsPMCQ1.c
r20cb691 rcc7c922 53 53 /* forward declarations */ 54 54 55 #if 0 55 56 /* local Qspan II serial eeprom table */ 56 57 static unsigned char rsPMCQ1eeprom[] = … … 80 81 0x00 /* Byte 22 - PCI_BST */ 81 82 }; 82 83 void MsDelay(void) 83 #endif 84 85 static void MsDelay(void) 84 86 { 85 87 printk("."); 86 88 } 87 89 88 void write8( int addr, int data ){90 static void write8( int addr, int data ){ 89 91 out_8((void *)addr, (unsigned char)data); 90 92 } 91 93 92 void write16( int addr, int data ) {94 static void write16( int addr, int data ) { 93 95 out_be16((void *)addr, (short)data ); 94 96 } 95 97 96 void write32( int addr, int data ) {98 static void write32( int addr, int data ) { 97 99 out_be32((unsigned int *)addr, data ); 98 100 } 99 101 100 int read32( int addr){ 102 #if 0 103 static int read32( int addr){ 101 104 return in_be32((unsigned int *)addr); 102 105 } 103 104 105 void rsPMCQ1_scc_nullFunc(void) {} 106 #endif 107 108 109 static void rsPMCQ1_scc_nullFunc(void) {} 106 110 107 111 /******************************************************************************* … … 114 118 */ 115 119 116 void rsPMCQ1Int( void *ptr )120 static void rsPMCQ1Int( void *ptr ) 117 121 { 118 122 unsigned long status; … … 157 161 /* read back the status register to ensure that the pci write has completed */ 158 162 status1 = *(volatile unsigned long *)(boardData->bridgeaddr + 0x600); 163 (void) status1; /* avoid set but not used warning */ 159 164 RTEMS_COMPILER_MEMORY_BARRIER(); 160 165 … … 176 181 unsigned long slotNo, /* Pci Slot number of PMCQ1 */ 177 182 unsigned long funcNo, /* Pci Function number of PMCQ1 */ 178 FUNC ION_PTR routine,/* interrupt routine */179 int arg /* argument to pass to interrupt routine */183 FUNCTION_PTR routine,/* interrupt routine */ 184 uintptr_t arg /* argument to pass to interrupt routine */ 180 185 ) 181 186 { … … 208 213 } 209 214 215 #if 0 216 /* This method is apparently unused. --joel 9 Oct 2014 */ 210 217 /******************************************************************************* 211 218 * … … 217 224 * RETURNS: OK if PMCQ1 found, ERROR if not. 218 225 */ 219 220 unsigned int rsPMCQ1MaIntDisconnect( 226 static unsigned int rsPMCQ1MaIntDisconnect( 221 227 unsigned long busNo, /* Pci Bus number of PMCQ1 */ 222 228 unsigned long slotNo, /* Pci Slot number of PMCQ1 */ … … 240 246 return (status); 241 247 } 248 #endif 242 249 243 250 /******************************************************************************* … … 250 257 * RETURNS: OK if PMCQ1 found, ERROR if not. 251 258 */ 252 253 259 unsigned int rsPMCQ1QuiccIntConnect( 254 260 unsigned long busNo, /* Pci Bus number of PMCQ1 */ 255 261 unsigned long slotNo, /* Pci Slot number of PMCQ1 */ 256 262 unsigned long funcNo, /* Pci Function number of PMCQ1 */ 257 FUNC ION_PTR routine,/* interrupt routine */258 int arg /* argument to pass to interrupt routine */263 FUNCTION_PTR routine,/* interrupt routine */ 264 uintptr_t arg /* argument to pass to interrupt routine */ 259 265 ) 260 266 { … … 276 282 } 277 283 284 #if 0 285 /* This method is apparently unused. --joel 9 Oct 2014 */ 278 286 /******************************************************************************* 279 287 * … … 285 293 * RETURNS: OK if PMCQ1 found, ERROR if not. 286 294 */ 287 288 unsigned int rsPMCQ1QuiccIntDisconnect( 295 static unsigned int rsPMCQ1QuiccIntDisconnect( 289 296 unsigned long busNo, /* Pci Bus number of PMCQ1 */ 290 297 unsigned long slotNo, /* Pci Slot number of PMCQ1 */ … … 309 316 return (status); 310 317 } 318 #endif 319 /* This method is apparently unused. --joel 9 Oct 2014 */ 311 320 312 321 … … 324 333 int busNo; 325 334 int slotNo; 326 u nsigned int baseaddr = 0;327 u nsigned int bridgeaddr = 0;335 uint32_t baseaddr = 0; 336 uint32_t bridgeaddr = 0; 328 337 unsigned long pbti0_ctl; 329 338 int i; 330 339 unsigned char int_vector; 331 340 int fun; 332 int temp;341 uint32_t temp; 333 342 PPMCQ1BoardData boardData; 334 rtems_irq_connect_data IrqData = {0, 335 rsPMCQ1Int, 336 rsPMCQ1_scc_nullFunc, 337 rsPMCQ1_scc_nullFunc, 338 rsPMCQ1_scc_nullFunc, 339 NULL}; 343 rtems_irq_connect_data IrqData = { 344 .name = 0, 345 .hdl = rsPMCQ1Int, 346 .handle = NULL, 347 .on = (rtems_irq_enable) rsPMCQ1_scc_nullFunc, 348 .off = (rtems_irq_disable) rsPMCQ1_scc_nullFunc, 349 .isOn = (rtems_irq_is_enabled) rsPMCQ1_scc_nullFunc, 350 }; 340 351 341 352 if (rsPMCQ1Initialized) … … 481 492 } 482 493 494 #if 0 495 /* This method is apparently unused. --joel 9 Oct 2014 */ 483 496 /******************************************************************************* 484 497 * … … 490 503 * EEPROM modifications to be performed). 491 504 */ 492 493 unsigned int rsPMCQ1Commission( unsigned long busNo, unsigned long slotNo ) 505 static unsigned int rsPMCQ1Commission( 506 unsigned long busNo, 507 unsigned long slotNo 508 ) 494 509 { 495 510 unsigned int status = RTEMS_IO_ERROR; … … 556 571 return(status); 557 572 } 573 #endif 558 574 559 575 uint32_t PMCQ1_Read_EPLD( uint32_t base, uint32_t reg ) -
c/src/lib/libbsp/powerpc/ep1a/console/rsPMCQ1.h
r20cb691 rcc7c922 109 109 #define QSPAN2_INT_STATUS 0x00000600 110 110 111 typedef void (*FUNC ION_PTR) (int);111 typedef void (*FUNCTION_PTR) (int); 112 112 113 113 #define PCI_ID(v, d) ((d << 16) | v) … … 132 132 unsigned long baseaddr; 133 133 unsigned long bridgeaddr; 134 FUNC ION_PTRquiccInt;135 intquiccArg;136 FUNC ION_PTRmaInt;137 intmaArg;134 FUNCTION_PTR quiccInt; 135 uintptr_t quiccArg; 136 FUNCTION_PTR maInt; 137 uintptr_t maArg; 138 138 } PMCQ1BoardData, *PPMCQ1BoardData; 139 139 … … 147 147 unsigned long slotNo, 148 148 unsigned long funcNo, 149 FUNC ION_PTRroutine,150 intarg149 FUNCTION_PTR routine, 150 uintptr_t arg 151 151 ); 152 152 153 unsigned int rsPMCQ1Init(void); 154 153 155 unsigned int rsPMCQ1MaIntConnect ( 154 156 unsigned long busNo, /* Pci Bus number of PMCQ1 */ 155 157 unsigned long slotNo, /* Pci Slot number of PMCQ1 */ 156 158 unsigned long funcNo, /* Pci Function number of PMCQ1 */ 157 FUNC ION_PTRroutine,/* interrupt routine */158 intarg /* argument to pass to interrupt routine */159 FUNCTION_PTR routine,/* interrupt routine */ 160 uintptr_t arg /* argument to pass to interrupt routine */ 159 161 ); 160 162 -
c/src/lib/libbsp/powerpc/ep1a/startup/bspstart.c
r20cb691 rcc7c922 4 4 5 5 /* 6 * COPYRIGHT (c) 1989-20 07.6 * COPYRIGHT (c) 1989-2014. 7 7 * On-Line Applications Research Corporation (OAR). 8 8 * … … 52 52 unsigned int BSP_mem_size = (unsigned int)&RAM_END; 53 53 54 void BSP_Increment_Light(void){ 54 static void BSP_Increment_Light(void) 55 { 55 56 uint8_t data; 57 56 58 data = *GENERAL_REGISTER1; 57 59 data &= 0xf0; … … 60 62 } 61 63 62 void BSP_Fatal_Fault_Light(void) { 64 #if 0 65 static void BSP_Fatal_Fault_Light(void) 66 { 63 67 uint8_t data; 68 64 69 data = *GENERAL_REGISTER1; 65 70 data &= 0xf0; … … 68 73 *GENERAL_REGISTER1 = data; 69 74 } 70 71 void write_to_Q2ram(int offset, unsigned int data ) 72 { 73 printk("0x%x ==> %d\n", offset, data ); 74 #if 0 75 unsigned int *ptr = 0x82000000; 76 ptr += offset; 77 *ptr = data; 78 #endif 79 } 75 #endif 80 76 81 77 /* 82 78 * Vital Board data Start using DATA RESIDUAL 83 79 */ 84 85 80 uint32_t VME_Slot1 = FALSE; 86 81 … … 161 156 } 162 157 163 void zero_bss(void)164 {165 memset(__SBSS_START__, 0, ((unsigned) __SBSS_END__) - ((unsigned)__SBSS_START__));166 memset(__SBSS2_START__, 0, ((unsigned) __SBSS2_END__) - ((unsigned)__SBSS2_START__));167 memset(__bss_start, 0, ((unsigned) __rtems_end) - ((unsigned)__bss_start));168 }169 170 char * save_boot_params(RESIDUAL* r3, void *r4, void* r5, char *additional_boot_options)171 {172 #if 0173 residualCopy = *r3;174 strncpy(loaderParam, additional_boot_options, MAX_LOADER_ADD_PARM);175 loaderParam[MAX_LOADER_ADD_PARM - 1] ='\0';176 return loaderParam;177 #endif178 return 0;179 }180 181 158 unsigned int EUMBBAR; 182 159 183 unsigned int get_eumbbar(void) { 160 static unsigned int get_eumbbar(void) 161 { 184 162 register int a, e; 185 163 … … 199 177 } 200 178 201 void Read_ep1a_config_registers( ppc_cpu_id_t myCpu ) {179 static void Read_ep1a_config_registers( ppc_cpu_id_t myCpu ) { 202 180 unsigned char value; 203 181 … … 274 252 * This routine does the bulk of the system initialization. 275 253 */ 276 277 254 void bsp_start( void ) 278 255 { … … 291 268 myCpu = get_ppc_cpu_type(); 292 269 myCpuRevision = get_ppc_cpu_revision(); 270 (void) myCpuRevision; /* avoid set but not used warning */ 293 271 294 272 EUMBBAR = get_eumbbar();
Note: See TracChangeset
for help on using the changeset viewer.