Changeset 090de1ad in rtems
- Timestamp:
- 04/11/01 14:07:22 (22 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- 3491e9e
- Parents:
- d96374f
- Location:
- c/src/lib/libbsp/powerpc/eth_comm
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/lib/libbsp/powerpc/eth_comm/ChangeLog
rd96374f r090de1ad 1 2001-04-11 Eric Valette <valette@crf.canon.fr> 2 3 * Makefile.am, configure.in, console/console.c, 4 include/Makefile.am, include/bsp.h, network/network.c, 5 startup/Makefile.am, startup/bspstart.c, startup/linkcmds, 6 wrapup/Makefile.am: Switch the eth_comm BSP to use the 7 "new exception processing model." 8 1 9 2000-11-09 Ralf Corsepius <corsepiu@faw.uni-ulm.de> 2 10 -
c/src/lib/libbsp/powerpc/eth_comm/Makefile.am
rd96374f r090de1ad 8 8 # wrapup is the one that actually builds and installs the library 9 9 # from the individual .rel files built in other directories 10 SUBDIRS = include startup start canbus console networkwrapup10 SUBDIRS = clock include startup start canbus console irq network vectors wrapup 11 11 12 12 include $(top_srcdir)/../../bsp.am -
c/src/lib/libbsp/powerpc/eth_comm/configure.in
rd96374f r090de1ad 29 29 AC_OUTPUT( 30 30 Makefile 31 clock/Makefile 31 32 canbus/Makefile 32 33 console/Makefile 33 34 include/Makefile 35 irq/Makefile 34 36 network/Makefile 35 37 start/Makefile 36 38 startup/Makefile 39 vectors/Makefile 37 40 wrapup/Makefile) -
c/src/lib/libbsp/powerpc/eth_comm/console/console.c
rd96374f r090de1ad 31 31 #include <rtems/libio.h> 32 32 #include <termios.h> 33 #include <bspIo.h> 34 35 static void _BSP_null_char( char c ) {return;} 36 BSP_output_char_function_type BSP_output_char = _BSP_null_char; 33 37 34 38 rtems_device_driver console_initialize(rtems_device_major_number major, … … 59 63 m8xx_uart_scc_initialize(SCC4_MINOR); /* /dev/tty4 */ 60 64 61 /*62 * Set up interrupts63 */64 m8xx_uart_interrupts_initialize();65 66 65 /* 67 66 * Register the devices … … 109 108 case 0: 110 109 m8xx.smc1.smcm = 1; /* Enable SMC1 RX interrupts */ 111 m8xx.cimr |= 1UL << 4; /* Enable SMC1 interrupts */112 110 break; 113 111 case 1: 114 112 m8xx.smc2.smcm = 1; /* Enable SMC2 RX interrupts */ 115 m8xx.cimr |= 1UL << 3; /* Enable SMC2 interrupts */116 113 break; 117 114 case 2: 118 m8xx.cimr |= 1UL << 30; /* Enable SCC1 interrupts */119 115 sccregs = &m8xx.scc1; 120 116 break; 121 117 case 3: 122 #ifndef I_WANT_TERMIOS123 m8xx.cimr |= 1UL << 29; /* Enable SCC2 interrupts */124 #endif /* I_WANT_TERMIOS */125 118 sccregs = &m8xx.scc2; 126 119 break; 127 120 case 4: 128 m8xx.cimr |= 1UL << 28; /* Enable SCC3 interrupts */129 121 sccregs = &m8xx.scc3; 130 122 break; 131 123 case 5: 132 m8xx.cimr |= 1UL << 27; /* Enable SCC4 interrupts */133 124 sccregs = &m8xx.scc4; 134 125 break; -
c/src/lib/libbsp/powerpc/eth_comm/include/Makefile.am
rd96374f r090de1ad 7 7 H_FILES = bsp.h coverhd.h canbus.h info.h 8 8 9 BSP_H_FILES = commproc.h 8xx_immap.h 10 9 11 $(PROJECT_INCLUDE): 12 $(mkinstalldirs) $@ 13 14 $(PROJECT_INCLUDE)/bsp: 10 15 $(mkinstalldirs) $@ 11 16 … … 22 27 $(INSTALL_DATA) $< $@ 23 28 24 TMPINSTALL_FILES += $(PROJECT_INCLUDE) $(PROJECT_INCLUDE)/bsp.h \ 25 $(PROJECT_INCLUDE)/coverhd.h $(PROJECT_INCLUDE)/canbus.h \ 26 $(PROJECT_INCLUDE)/info.h 29 $(PROJECT_INCLUDE)/bsp/commproc.h : commproc.h 30 $(INSTALL_DATA) $< $@ 27 31 28 all-local: $(TMPINSTALL_FILES) 32 $(PROJECT_INCLUDE)/bsp/8xx_immap.h : 8xx_immap.h 33 $(INSTALL_DATA) $< $@ 34 35 PREINSTALL_FILES += $(PROJECT_INCLUDE) $(PROJECT_INCLUDE)/bsp \ 36 $(PROJECT_INCLUDE)/bsp.h $(PROJECT_INCLUDE)/info.h \ 37 $(PROJECT_INCLUDE)/coverhd.h $(PROJECT_INCLUDE)/canbus.h \ 38 $(PROJECT_INCLUDE)/bsp/commproc.h $(PROJECT_INCLUDE)/bsp/8xx_immap.h 39 40 all-local: $(PREINSTALL_FILES) 29 41 30 42 EXTRA_DIST = bsp.h canbus.h coverhd.h info.h -
c/src/lib/libbsp/powerpc/eth_comm/include/bsp.h
rd96374f r090de1ad 83 83 #define RAM_START 0 84 84 #define RAM_END 0x100000 85 85 #define IMAP_ADDR ((unsigned int)0xff000000) 86 #define IMAP_SIZE ((unsigned int)(16 * 1024)) 86 87 /* miscellaneous stuff assumed to exist */ 87 88 -
c/src/lib/libbsp/powerpc/eth_comm/network/network.c
rd96374f r090de1ad 31 31 #include <netinet/in.h> 32 32 #include <netinet/if_ether.h> 33 #include <bsp/irq.h> 33 34 34 35 /* … … 45 46 #define TX_BUF_COUNT 8 46 47 #define TX_BD_PER_BUF 4 48 49 #define INET_ADDR_MAX_BUF_SIZE (sizeof "255.255.255.255") 47 50 48 51 /* … … 109 112 static struct m860_enet_struct enet_driver[NIFACES]; 110 113 114 static void m8xx_scc1_ethernet_on(const rtems_irq_connect_data* ptr) 115 { 116 /* 117 * Please put relevant code there 118 */ 119 } 120 121 static void m8xx_scc1_ethernet_off(const rtems_irq_connect_data* ptr) 122 { 123 /* 124 * Please put relevant code there 125 */ 126 } 127 128 static void m8xx_scc1_ethernet_isOn(const rtems_irq_connect_data* ptr) 129 { 130 return BSP_irq_enabled_at_cpm (ptr->name); 131 } 132 111 133 /* 112 134 * SCC1 interrupt handler 113 135 */ 114 static rtems_isr 115 m860_scc1_interrupt_handler (rtems_vector_number v) 136 static void m860_scc1_interrupt_handler () 116 137 { 117 138 /* … … 140 161 rtems_event_send (enet_driver[0].txDaemonTid, INTERRUPT_EVENT); 141 162 } 142 m8xx.cisr = 1UL << 30; /* Clear SCC1 interrupt-in-service bit */143 163 } 144 164 … … 146 166 * FEC interrupt handler 147 167 */ 148 static rtems_isr 149 m860_fec_interrupt_handler (rtems_vector_number v) 168 static void m860_fec_interrupt_handler () 150 169 { 151 170 /* … … 167 186 } 168 187 } 188 static rtems_irq_connect_data ethernetSCC1IrqData = { 189 BSP_CPM_IRQ_SCC1, 190 (rtems_irq_hdl) m860_scc1_interrupt_handler, 191 (rtems_irq_enable) m8xx_scc1_ethernet_on, 192 (rtems_irq_disable) m8xx_scc1_ethernet_off, 193 (rtems_irq_is_enabled)m8xx_scc1_ethernet_isOn 194 }; 169 195 170 196 /* … … 335 361 * Set up interrupts 336 362 */ 337 status = rtems_interrupt_catch (m860_scc1_interrupt_handler, 338 PPC_IRQ_CPM_SCC1, 339 &old_handler); 363 status = BSP_install_rtems_irq_handler (ðernetSCC1IrqData); 340 364 if (status != RTEMS_SUCCESSFUL) { 341 rtems_panic ("Can't attach M8 60SCC1 interrupt handler: %s\n",365 rtems_panic ("Can't attach M8xx SCC1 interrupt handler: %s\n", 342 366 rtems_status_text (status)); 343 367 } 344 368 m8xx.scc1.sccm = 0; /* No interrupts unmasked till necessary */ 345 m8xx.cimr |= (1UL << 30); /* Enable SCC1 interrupt */346 369 347 370 /* … … 382 405 m8xx.pcdir &= ~0x1; 383 406 384 385 /*386 * Set up interrupts387 * FIXME: DANGER: WARNING:388 * CICR and SIMASK must be set in any module that uses389 * the CPM. Currently those are console-generic.c and390 * network.c. If the registers are not set the same391 * in both places, strange things may happen.392 * If they are only set in one place, then an application393 * that used the other module won't work correctly.394 * Put this comment in each module that sets these 2 registers395 */396 m8xx.cicr = 0x00e43e80; /* SCaP=SCC1, SCbP=SCC2, SCcP=SCC3,397 SCdP=SCC4, IRL=1, HP=SCC1, IEN=1 */398 m8xx.simask |= M8xx_SIMASK_LVM1;399 400 407 /* 401 408 * Enable receiver and transmitter … … 403 410 m8xx.scc1.gsmr_l = 0x1088003c; 404 411 } 412 static void m8xx_fec_ethernet_on(){}; 413 static void m8xx_fec_ethernet_off(){}; 414 static int m8xx_fec_ethernet_isOn (const rtems_irq_connect_data* ptr) 415 { 416 return BSP_irq_enabled_at_siu (ptr->name); 417 } 418 419 static rtems_irq_connect_data ethernetFECIrqData = { 420 BSP_FAST_ETHERNET_CTRL, 421 (rtems_irq_hdl) m860_fec_interrupt_handler, 422 (rtems_irq_enable) m8xx_fec_ethernet_on, 423 (rtems_irq_disable) m8xx_fec_ethernet_off, 424 (rtems_irq_is_enabled)m8xx_fec_ethernet_isOn 425 }; 405 426 406 427 static void … … 438 459 * 439 460 */ 440 m8xx.fec.ivec = 0x02 << 29;461 m8xx.fec.ivec = ((((unsigned) BSP_FAST_ETHERNET_CTRL)/2) << 29); 441 462 442 463 /* … … 552 573 * Set up interrupts 553 574 */ 554 status = rtems_interrupt_catch (m860_fec_interrupt_handler, 555 PPC_IRQ_LVL2, 556 &old_handler); 575 status = BSP_install_rtems_irq_handler (ðernetFECIrqData); 557 576 if (status != RTEMS_SUCCESSFUL) 558 577 rtems_panic ("Can't attach M860 FEC interrupt handler: %s\n", 559 578 rtems_status_text (status)); 560 561 m8xx.simask |= M8xx_SIMASK_LVM2;562 579 563 580 } -
c/src/lib/libbsp/powerpc/eth_comm/startup/Makefile.am
rd96374f r090de1ad 10 10 11 11 C_FILES = bspclean.c bsplibc.c bsppost.c bspstart.c bootcard.c cpuinit.c \ 12 main.c mmutlbtab.c sbrk.c setvec.cgnatinstallhandler.c12 main.c mmutlbtab.c sbrk.c gnatinstallhandler.c 13 13 C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.o) 14 14 … … 36 36 .PRECIOUS: $(PGM) 37 37 38 EXTRA_DIST = bspstart.c linkcmds setvec.c38 EXTRA_DIST = bspstart.c linkcmds 39 39 40 40 include $(top_srcdir)/../../../../../../automake/local.am -
c/src/lib/libbsp/powerpc/eth_comm/startup/bspstart.c
rd96374f r090de1ad 32 32 */ 33 33 extern rtems_configuration_table Configuration; 34 34 extern unsigned long intrStackPtr; 35 35 rtems_configuration_table BSP_Configuration; 36 36 … … 44 44 void bsp_postdriver_hook(void); 45 45 void bsp_libc_init( void *, unsigned32, int ); 46 47 void BSP_panic(char *s) 48 { 49 printk("%s PANIC %s\n",_RTEMS_version, s); 50 __asm__ __volatile ("sc"); 51 } 52 53 void _BSP_Fatal_error(unsigned int v) 54 { 55 printk("%s PANIC ERROR %x\n",_RTEMS_version, v); 56 __asm__ __volatile ("sc"); 57 } 46 58 47 59 /* … … 100 112 rtems_unsigned32 heap_start; 101 113 rtems_unsigned32 ws_start; 114 ppc_cpu_id_t myCpu; 115 ppc_cpu_revision_t myCpuRevision; 116 register unsigned char* intrStack; 117 register unsigned int intrNestingLevel = 0; 118 119 /* 120 * Get CPU identification dynamically. Note that the get_ppc_cpu_type() function 121 * store the result in global variables so that it can be used latter... 122 */ 123 myCpu = get_ppc_cpu_type(); 124 myCpuRevision = get_ppc_cpu_revision(); 102 125 103 126 cpu_init(); 104 127 mmu_init(); 105 128 /* 129 * Initialize some SPRG registers related to irq handling 130 */ 131 132 intrStack = (((unsigned char*)&intrStackPtr) - CPU_MINIMUM_STACK_FRAME_SIZE); 133 asm volatile ("mtspr 273, %0" : "=r" (intrStack) : "0" (intrStack)); 134 asm volatile ("mtspr 272, %0" : "=r" (intrNestingLevel) : "0" (intrNestingLevel)); 135 136 /* 137 * Install our own set of exception vectors 138 */ 139 initialize_exceptions(); 140 106 141 /* 107 142 * Allocate the memory for the RTEMS Work Space. This can come from … … 163 198 m8xx.scc2p.tbase=0; 164 199 m8xx_cp_execute_cmd( M8xx_CR_OP_STOP_TX | M8xx_CR_CHAN_SCC2 ); 165 } 166 167 200 /* 201 * Initalize RTEMS IRQ system 202 */ 203 BSP_rtems_irq_mng_init(0); 204 #ifdef SHOW_MORE_INIT_SETTINGS 205 printk("Exit from bspstart\n"); 206 #endif 207 208 } 209 210 -
c/src/lib/libbsp/powerpc/eth_comm/startup/linkcmds
rd96374f r090de1ad 126 126 text.size = text.end - text.start; 127 127 PROVIDE(_end = bss.end); 128 128 /* 129 * Interrupt stack setup 130 */ 131 132 IntrStack_start = ALIGN(0x10); 133 . += 0x4000; 134 intrStack = .; 135 PROVIDE(intrStackPtr = intrStack); 136 129 137 dpram : 130 138 { -
c/src/lib/libbsp/powerpc/eth_comm/wrapup/Makefile.am
rd96374f r090de1ad 10 10 endif 11 11 12 BSP_PIECES = startup start canbus console $(NETWORKING)12 BSP_PIECES = clock irq startup start canbus vectors console $(NETWORKING) 13 13 # pieces to pick up out of libcpu/ppc 14 14 # CPU_PIECES = mpc860/clock mpc860/timer mpc860/console-generic \ … … 18 18 OBJS = $(foreach piece, $(BSP_PIECES), $(wildcard ../$(piece)/$(ARCH)/*.o)) \ 19 19 $(wildcard ../../../../libcpu/$(RTEMS_CPU)/shared/*/$(ARCH)/*.o) \ 20 $(wildcard ../../../../libcpu/powerpc/ old_exception_processing/$(ARCH)/*.rel) \20 $(wildcard ../../../../libcpu/powerpc/new_exception_processing/$(ARCH)/*.rel) \ 21 21 $(wildcard ../../../../libcpu/$(RTEMS_CPU)/$(RTEMS_CPU_MODEL)/*/$(ARCH)/*.o) 22 22 LIB = $(ARCH)/libbsp.a
Note: See TracChangeset
for help on using the changeset viewer.