Changeset 996a9cb4 in rtems for c/src/lib/libbsp/m68k
- Timestamp:
- 05/01/96 15:25:33 (27 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- bf6661e
- Parents:
- dce1c1a1
- Location:
- c/src/lib/libbsp/m68k/gen68360
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/lib/libbsp/m68k/gen68360/README
rdce1c1a1 r996a9cb4 5 5 # 6 6 # This package requires a version of GCC that has been modified 7 # to support the `-m68360' argument. I have submitted the required changes 8 # to the GCC maintainers. Should they choose to use a different argument 9 # (-mcpu32 perhaps) this board support package will have to be changed. 7 # to support the `-mcpu32' argument. I have submitted the required 8 # changes to the GCC maintainers. 10 9 # 11 10 -
c/src/lib/libbsp/m68k/gen68360/include/bsp.h
rdce1c1a1 r996a9cb4 119 119 void bsp_cleanup( void ); 120 120 121 void M360ExecuteRISC( rtems_unsigned16 command ); 122 121 123 m68k_isr_entry set_vector( 122 124 rtems_isr_entry handler, -
c/src/lib/libbsp/m68k/gen68360/start/start360.s
rdce1c1a1 r996a9cb4 299 299 300 300 /* 301 * Place the low-order 3 octets of the board's 302 * ethernet address at a `well-known' location.301 * Place the low-order 3 octets of the board's ethernet address at 302 * a `well-known' fixed location relative to the beginning of ROM. 303 303 */ 304 304 .align 2 305 | .long ETHERNET_ADDRESS | 08: Low-order 3 octets305 .long ETHERNET_ADDRESS | Low-order 3 octets of ethernet address 306 306 307 307 /* … … 348 348 jmp SYM(_Init68360) | Start C code (which never returns) 349 349 350 351 350 /* 352 * Clear BSS, set up real stack, initialize heap, start C program 353 * Assume that BSS size is a multiple of 4. 354 * FIXME: The zero-loop should be changed to put the CPU into loop-mode. 355 * FIXME: PROM-based systems will have to copy data segment to RAM here 351 * Copy DATA segment, clear BSS segment, set up real stack, 352 * initialize heap, start C program. 353 * Assume that DATA and BSS sizes are multiples of 4. 356 354 */ 357 PUBLIC (_ClearBSSAndStart) 358 SYM(_ClearBSSAndStart): 359 movel #clear_start,a0 360 movel #clear_end,a1 361 clrl d0 362 bras ZEROLOOPTEST 355 PUBLIC (_CopyDataClearBSSAndStart) 356 SYM(_CopyDataClearBSSAndStart): 357 lea copy_start,a0 | Get start of DATA in RAM 358 lea SYM(etext),a2 | Get start of DATA in ROM 359 cmpl a0,a2 | Are they the same? 360 beq.s NOCOPY | Yes, no copy necessary 361 lea copy_end,a1 | Get end of DATA in RAM 362 bra.s COPYLOOPTEST | Branch into copy loop 363 COPYLOOP: 364 movel a2@+,a0@+ | Copy word from ROM to RAM 365 COPYLOOPTEST: 366 cmpl a1,a0 | Done? 367 bcs.s COPYLOOP | No, skip 368 NOCOPY: 369 370 lea clear_start,a0 | Get start of BSS 371 lea clear_end,a1 | Get end of BSS 372 clrl d0 | Value to set 373 bra.s ZEROLOOPTEST | Branch into clear loop 363 374 ZEROLOOP: 364 movel d0,a0@+ 375 movel d0,a0@+ | Clear a word 365 376 ZEROLOOPTEST: 366 cmpl a1,a0 367 bcs ZEROLOOP 377 cmpl a1,a0 | Done? 378 bcs.s ZEROLOOP | No, skip 379 368 380 movel #stack_init,a7 | set master stack pointer 369 381 movel d0,a7@- | environp -
c/src/lib/libbsp/m68k/gen68360/start360/start360.s
rdce1c1a1 r996a9cb4 299 299 300 300 /* 301 * Place the low-order 3 octets of the board's 302 * ethernet address at a `well-known' location.301 * Place the low-order 3 octets of the board's ethernet address at 302 * a `well-known' fixed location relative to the beginning of ROM. 303 303 */ 304 304 .align 2 305 | .long ETHERNET_ADDRESS | 08: Low-order 3 octets305 .long ETHERNET_ADDRESS | Low-order 3 octets of ethernet address 306 306 307 307 /* … … 348 348 jmp SYM(_Init68360) | Start C code (which never returns) 349 349 350 351 350 /* 352 * Clear BSS, set up real stack, initialize heap, start C program 353 * Assume that BSS size is a multiple of 4. 354 * FIXME: The zero-loop should be changed to put the CPU into loop-mode. 355 * FIXME: PROM-based systems will have to copy data segment to RAM here 351 * Copy DATA segment, clear BSS segment, set up real stack, 352 * initialize heap, start C program. 353 * Assume that DATA and BSS sizes are multiples of 4. 356 354 */ 357 PUBLIC (_ClearBSSAndStart) 358 SYM(_ClearBSSAndStart): 359 movel #clear_start,a0 360 movel #clear_end,a1 361 clrl d0 362 bras ZEROLOOPTEST 355 PUBLIC (_CopyDataClearBSSAndStart) 356 SYM(_CopyDataClearBSSAndStart): 357 lea copy_start,a0 | Get start of DATA in RAM 358 lea SYM(etext),a2 | Get start of DATA in ROM 359 cmpl a0,a2 | Are they the same? 360 beq.s NOCOPY | Yes, no copy necessary 361 lea copy_end,a1 | Get end of DATA in RAM 362 bra.s COPYLOOPTEST | Branch into copy loop 363 COPYLOOP: 364 movel a2@+,a0@+ | Copy word from ROM to RAM 365 COPYLOOPTEST: 366 cmpl a1,a0 | Done? 367 bcs.s COPYLOOP | No, skip 368 NOCOPY: 369 370 lea clear_start,a0 | Get start of BSS 371 lea clear_end,a1 | Get end of BSS 372 clrl d0 | Value to set 373 bra.s ZEROLOOPTEST | Branch into clear loop 363 374 ZEROLOOP: 364 movel d0,a0@+ 375 movel d0,a0@+ | Clear a word 365 376 ZEROLOOPTEST: 366 cmpl a1,a0 367 bcs ZEROLOOP 377 cmpl a1,a0 | Done? 378 bcs.s ZEROLOOP | No, skip 379 368 380 movel #stack_init,a7 | set master stack pointer 369 381 movel d0,a7@- | environp -
c/src/lib/libbsp/m68k/gen68360/startup/init68360.c
rdce1c1a1 r996a9cb4 1 1 /* 2 * Initialize 68360 hardware2 * MC68360 support routines 3 3 * 4 4 * W. Eric Norum … … 13 13 #include <rtems.h> 14 14 #include <bsp.h> 15 #include "m68360.h"15 #include <m68360.h> 16 16 17 void 18 _Init68360 (void) 17 /* 18 * Send a command to the CPM RISC processer 19 */ 20 21 void M360ExecuteRISC(rtems_unsigned16 command) 22 { 23 rtems_unsigned16 sr; 24 25 m68k_disable_interrupts (sr); 26 while (m360.cr & M360_CR_FLG) 27 continue; 28 m360.cr = command | M360_CR_FLG; 29 m68k_enable_interrupts (sr); 30 } 31 32 /* 33 * Initialize MC68360 34 */ 35 36 void _Init68360 (void) 19 37 { 20 38 int i; 21 39 extern void *_RomBase, *_RamBase; 22 40 m68k_isr_entry *vbr; 23 extern void _C learBSSAndStart (void);41 extern void _CopyDataClearBSSAndStart (void); 24 42 25 43 /* … … 65 83 *((long *)((char *)&m360 + 0xF00 + i)) = 0; 66 84 } 67 m360.cr = M360_CR_RST | M360_CR_FLG;85 M360ExecuteRISC (M360_CR_RST); 68 86 69 87 /* … … 130 148 * Step 13: Copy the exception vector table to system RAM 131 149 */ 132 133 m68k_get_vbr( vbr ); 150 m68k_get_vbr (vbr); 134 151 for (i = 0; i < 256; ++i) 135 152 M68Kvec[i] = vbr[i]; 136 m68k_set_vbr( M68Kvec);153 m68k_set_vbr (M68Kvec); 137 154 138 155 /* … … 168 185 169 186 /* 170 * C lear BSS, switch stacks and call main()187 * Copy data, clear BSS, switch stacks and call main() 171 188 */ 172 _C learBSSAndStart ();189 _CopyDataClearBSSAndStart (); 173 190 } -
c/src/lib/libbsp/m68k/gen68360/startup/linkcmds
rdce1c1a1 r996a9cb4 14 14 */ 15 15 MEMORY { 16 17 18 16 ram : ORIGIN = 0x00000000, LENGTH = 4M 17 rom : ORIGIN = 0xFF000000, LENGTH = 1M 18 dpram : ORIGIN = 0xFE000000, LENGTH = 8k 19 19 } 20 20 21 21 /* 22 22 * Declare some sizes 23 * XXX: The assignment of ". += XyzSize;" fails in older gld's if the 24 * number used there is not constant. If this happens to you, edit 25 * the lines marked below to use a constant value. 23 26 */ 27 HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000; 28 StackSize = DEFINED(StackSize) ? StackSize : 0x1000; 24 29 25 30 /* 26 * XXX: The assignment of ". += XyzSize;" fails in older gld's if the 27 * number used there is not constant so the calculated sizes are 28 * ignored below and the default number is used instead. 31 * Declare low-order three octets of Ethernet address 29 32 */ 30 31 HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000; 32 StackSize = DEFINED(StackSize) ? StackSize : 0x1000; 33 ETHERNET_ADDRESS = DEFINED(ETHERNET_ADDRESS) ? ETHERNET_ADDRESS : 0xDEAD12; 33 34 34 35 /* … … 36 37 */ 37 38 SECTIONS { 39 /* 40 * Boot PROM 41 */ 42 rom : { 43 _RomBase = .; 44 __RomBase = .; 45 } >rom 46 47 /* 48 * Dynamic RAM 49 */ 50 ram : { 51 _RamBase = .; 52 __RamBase = .; 53 } >ram 54 55 /* 56 * Text, data and bss segments 57 */ 38 58 .text : { 39 _RamBase = .; 40 __RamBase = .; 41 CREATE_OBJECT_SYMBOLS 42 *(.text) 43 . = ALIGN (16); 44 _etext = .; 59 CREATE_OBJECT_SYMBOLS 60 *(.text) 61 . = ALIGN (16); 62 etext = .; 63 _etext = .; 45 64 } >ram 46 65 .data : { 47 *(.data) 48 . = ALIGN (16); 49 _edata = .; 66 copy_start = .; 67 *(.data) 68 . = ALIGN (16); 69 _edata = .; 70 copy_end = .; 50 71 } >ram 51 72 .bss : { 52 53 54 55 56 57 58 59 73 M68Kvec = .; 74 _M68Kvec = .; 75 . += (256 * 4); 76 clear_start = .; 77 *(.bss) 78 *(COMMON) 79 . = ALIGN (16); 80 _end = .; 60 81 61 62 63 /* XXX: Temporary to get around a gld bug 64 * 65 * . += HeapSize; 66 * . += StackSize; 67 */ 68 . += 0x10000; /* XXX */ 69 . += 0x1000; /* XXX */ 82 _HeapStart = .; 83 __HeapStart = .; 84 /* . += HeapSize; */ /* XXX -- Old gld can't handle this */ 85 /* . += StackSize; */ /* XXX -- Old gld can't handle this */ 86 . += 0x10000; /* HeapSize for old gld */ 87 . += 0x1000; /* StackSize for old gld */ 88 . = ALIGN (16); 89 stack_init = .; 90 clear_end = .; 70 91 71 . = ALIGN (16);72 stack_init= .;73 clear_end = .; 92 _WorkspaceBase = .; 93 __WorkspaceBase = .; 94 } >ram 74 95 75 _WorkspaceBase = .; 76 __WorkspaceBase = .; 77 } >ram 96 /* 97 * On-chip memory/peripherals 98 */ 99 dpram : { 100 m360 = .; 101 _m360 = .; 102 . += (8 * 1024); 78 103 79 /* 80 * On-chip memory/peripherals 81 */ 82 dpram : { 83 m360 = .; 84 _m360 = .; 85 . += (8 * 1024); 86 87 } >dpram 88 89 /* 90 * Boot PROM 91 */ 92 rom : { 93 _RomBase = .; 94 __RomBase = .; 95 } >rom 104 } >dpram 96 105 }
Note: See TracChangeset
for help on using the changeset viewer.