Changeset f05b2ac in rtems
- Timestamp:
-
04/21/04 16:01:48
(20 years ago)
- Author:
- Ralf Corsepius <ralf.corsepius@…>
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- 7dd6e8d
- Parents:
- 6128a4a
- Message:
-
Remove duplicate white lines.
- Location:
- c/src/lib
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
-
r6128a4a
|
rf05b2ac
|
|
15 | 15 | do { _old = 0; } while(0) |
16 | 16 | |
17 | | |
18 | 17 | #define Clock_driver_support_initialize_hardware() |
19 | 18 | |
-
r6128a4a
|
rf05b2ac
|
|
14 | 14 | | $Id$ |
15 | 15 | +--------------------------------------------------------------------------*/ |
16 | | |
17 | 16 | |
18 | 17 | #ifndef __BSP_H_ |
-
r6128a4a
|
rf05b2ac
|
|
11 | 11 | */ |
12 | 12 | |
13 | | |
14 | 13 | #ifndef __REGS_H__ |
15 | 14 | #define __REGS_H__ |
… |
… |
|
23 | 22 | #endif |
24 | 23 | |
25 | | |
26 | | |
27 | 24 | /* |
28 | 25 | * Here must be "defined" each register, to use with Regs as |
… |
… |
|
32 | 29 | #define REGISTER1 1 |
33 | 30 | #define REGISTER2 2 |
34 | | |
35 | 31 | |
36 | 32 | /* |
-
r6128a4a
|
rf05b2ac
|
|
17 | 17 | #include <registers.h> |
18 | 18 | |
19 | | |
20 | 19 | void BSP_rtems_irq_mngt_init() { |
21 | 20 | |
-
r6128a4a
|
rf05b2ac
|
|
13 | 13 | */ |
14 | 14 | |
15 | | |
16 | 15 | #include <bsp.h> |
17 | 16 | #include <irq.h> |
… |
… |
|
19 | 18 | #include <rtems/score/thread.h> |
20 | 19 | #include <rtems/score/apiext.h> |
21 | | |
22 | 20 | |
23 | 21 | /* |
… |
… |
|
104 | 102 | } |
105 | 103 | |
106 | | |
107 | | |
108 | 104 | void _ThreadProcessSignalsFromIrq (CPU_Exception_frame* ctx) |
109 | 105 | { |
-
r6128a4a
|
rf05b2ac
|
|
111 | 111 | void BSP_rtems_irq_mngt_init(); |
112 | 112 | |
113 | | |
114 | 113 | /* |
115 | 114 | * function to connect a particular irq handler. This hanlder will NOT be called |
… |
… |
|
160 | 159 | int BSP_remove_rtems_irq_handler (const rtems_irq_connect_data*); |
161 | 160 | |
162 | | |
163 | 161 | #ifdef __cplusplus |
164 | 162 | } |
-
r6128a4a
|
rf05b2ac
|
|
30 | 30 | .equ F_Bit, 0x40 |
31 | 31 | |
32 | | |
33 | 32 | .text |
34 | 33 | .globl _start |
35 | | |
36 | 34 | |
37 | 35 | _start: |
… |
… |
|
40 | 38 | * Here is the code to initialize the low-level BSP environment |
41 | 39 | * (Chip Select, PLL, ....?) |
42 | | |
43 | 40 | |
44 | 41 | /* Copy data from FLASH to RAM */ |
… |
… |
|
61 | 58 | STRLOT r2, [r0], #4 |
62 | 59 | BLO zi_init |
63 | | |
64 | 60 | |
65 | 61 | /* Load basic ARM7 interrupt table */ |
-
r6128a4a
|
rf05b2ac
|
|
13 | 13 | | |
14 | 14 | +--------------------------------------------------------------------------*/ |
15 | | |
16 | 15 | |
17 | 16 | #include <bsp.h> |
… |
… |
|
82 | 81 | rtemsFreeMemStart += _heap_size; /* HEAP_SIZE in KBytes */ |
83 | 82 | |
84 | | |
85 | 83 | #ifdef RTEMS_DEBUG |
86 | 84 | |
… |
… |
|
90 | 88 | |
91 | 89 | } /* bsp_pretasking_hook */ |
92 | | |
93 | 90 | |
94 | 91 | /*-------------------------------------------------------------------------+ |
-
r6128a4a
|
rf05b2ac
|
|
13 | 13 | | |
14 | 14 | +--------------------------------------------------------------------------*/ |
15 | | |
16 | 15 | |
17 | 16 | #include <stdio.h> |
-
r6128a4a
|
rf05b2ac
|
|
15 | 15 | do { _old = 0; } while(0) |
16 | 16 | |
17 | | |
18 | 17 | #define Clock_driver_support_initialize_hardware() |
19 | 18 | |
-
r6128a4a
|
rf05b2ac
|
|
11 | 11 | #define ENTRY(name) \ |
12 | 12 | _ENTRY(_C_LABEL(name)) |
13 | | |
14 | | |
15 | 13 | |
16 | 14 | ENTRY(_sys_exit) |
-
r6128a4a
|
rf05b2ac
|
|
64 | 64 | ldr a3, .LC2 |
65 | 65 | sub a3, a3, a1 /* Third arg: length of block */ |
66 | | |
67 | 66 | |
68 | 67 | #ifdef __thumb__ /* Enter Thumb mode.... */ |
-
r6128a4a
|
rf05b2ac
|
|
26 | 26 | #endif /* ARM_RDI_MONITOR */ |
27 | 27 | |
28 | | |
29 | 28 | void |
30 | 29 | abort_program (void) |
-
r6128a4a
|
rf05b2ac
|
|
30 | 30 | #define SWI_InstallHandler 0x70 |
31 | 31 | #define SWI_GenerateError 0x71 |
32 | | |
33 | 32 | |
34 | 33 | /* Now the SWI numbers and reason codes for RDI (Angel) monitors */ |
-
r6128a4a
|
rf05b2ac
|
|
16 | 16 | #include <bsp.h> |
17 | 17 | #include <irq.h> |
18 | | |
19 | 18 | |
20 | 19 | rtems_isr clock_isr(rtems_vector_number vector); |
… |
… |
|
43 | 42 | BSP_install_rtems_irq_handler(&clock_isr_data); \ |
44 | 43 | } while(0) |
45 | | |
46 | 44 | |
47 | 45 | /* |
… |
… |
|
75 | 73 | } |
76 | 74 | |
77 | | |
78 | 75 | #include "../../../shared/clockdrv_shell.c" |
-
r6128a4a
|
rf05b2ac
|
|
101 | 101 | } |
102 | 102 | |
103 | | |
104 | | |
105 | 103 | err = *data_reg; |
106 | 104 | c = err & 0xff; |
… |
… |
|
158 | 156 | 0x17); /* 9600 baud */ |
159 | 157 | |
160 | | |
161 | 158 | } |
-
r6128a4a
|
rf05b2ac
|
|
51 | 51 | #define Lower_tm27_intr() |
52 | 52 | |
53 | | |
54 | | |
55 | 53 | /* |
56 | 54 | * Network driver configuration |
… |
… |
|
59 | 57 | #define RTEMS_BSP_NETWORK_DRIVER_ATTACH cs8900_driver_attach |
60 | 58 | |
61 | | |
62 | | |
63 | | |
64 | 59 | #ifdef __cplusplus |
65 | 60 | } |
-
r6128a4a
|
rf05b2ac
|
|
68 | 68 | } rtems_irq_symbolic_name; |
69 | 69 | |
70 | | |
71 | | |
72 | 70 | /* |
73 | 71 | * Type definition for RTEMS managed interrupts |
… |
… |
|
138 | 136 | void BSP_rtems_irq_mngt_init(); |
139 | 137 | |
140 | | |
141 | 138 | /* |
142 | 139 | * function to connect a particular irq handler. This hanlder will NOT be called |
-
r6128a4a
|
rf05b2ac
|
|
15 | 15 | */ |
16 | 16 | |
17 | | |
18 | 17 | /* Some standard definitions...*/ |
19 | 18 | |
… |
… |
|
30 | 29 | .equ F_Bit, 0x40 |
31 | 30 | |
32 | | |
33 | 31 | .text |
34 | 32 | .globl _start |
35 | | |
36 | 33 | |
37 | 34 | _start: |
-
r6128a4a
|
rf05b2ac
|
|
79 | 79 | uint32_t heap_size; |
80 | 80 | |
81 | | |
82 | 81 | /* |
83 | 82 | * Set up the heap. It uses all free SDRAM except that reserved |
… |
… |
|
98 | 97 | |
99 | 98 | } /* bsp_pretasking_hook */ |
100 | | |
101 | 99 | |
102 | 100 | /**************************************************************************/ |
… |
… |
|
153 | 151 | rtems_irq_mngt_init(); |
154 | 152 | |
155 | | |
156 | 153 | /* |
157 | 154 | * The following information is very useful when debugging. |
… |
… |
|
176 | 173 | } /* bsp_start */ |
177 | 174 | |
178 | | |
179 | | |
180 | | |
181 | 175 | /* |
182 | 176 | * By making this a weak alias for bsp_start_default, a brave soul |
-
r6128a4a
|
rf05b2ac
|
|
48 | 48 | int BSPBaseBaud = 115200; |
49 | 49 | |
50 | | |
51 | 50 | /*-------------------------------------------------------------------------+ |
52 | 51 | | External Prototypes |
… |
… |
|
70 | 69 | BSP_polling_getchar_function_type BSP_poll_char = |
71 | 70 | (BSP_polling_getchar_function_type) BSP_poll_char_via_serial; |
72 | | |
73 | 71 | |
74 | 72 | static rtems_irq_connect_data console_isr_data = {BSP_UART, |
… |
… |
|
126 | 124 | } |
127 | 125 | |
128 | | |
129 | 126 | /*-------------------------------------------------------------------------+ |
130 | 127 | | Console device driver INITIALIZE entry point. |
… |
… |
|
150 | 147 | /* 38400-8-N-1 */ |
151 | 148 | BSP_uart_init(BSPConsolePort, 38400, 0); |
152 | | |
153 | 149 | |
154 | 150 | /* Set interrupt handler */ |
… |
… |
|
179 | 175 | return RTEMS_SUCCESSFUL; |
180 | 176 | } /* console_initialize */ |
181 | | |
182 | 177 | |
183 | 178 | static int console_last_close(int major, int minor, void *arg) |
… |
… |
|
244 | 239 | } /* console_close */ |
245 | 240 | |
246 | | |
247 | 241 | /*-------------------------------------------------------------------------+ |
248 | 242 | | Console device driver READ entry point. |
… |
… |
|
260 | 254 | } /* console_read */ |
261 | 255 | |
262 | | |
263 | 256 | /*-------------------------------------------------------------------------+ |
264 | 257 | | Console device driver WRITE entry point. |
… |
… |
|
275 | 268 | |
276 | 269 | } /* console_write */ |
277 | | |
278 | | |
279 | 270 | |
280 | 271 | /* |
-
r6128a4a
|
rf05b2ac
|
|
223 | 223 | } |
224 | 224 | |
225 | | |
226 | 225 | /* |
227 | 226 | * Status function, -1 if error |
… |
… |
|
270 | 269 | } |
271 | 270 | |
272 | | |
273 | 271 | /* |
274 | 272 | * Polled mode write function |
… |
… |
|
330 | 328 | return BSP_uart_polled_read(BSPConsolePort); |
331 | 329 | } |
332 | | |
333 | 330 | |
334 | 331 | /* ================ Termios support =================*/ |
… |
… |
|
423 | 420 | } |
424 | 421 | |
425 | | |
426 | 422 | /* If there TX buffer is busy - something is royally screwed up */ |
427 | 423 | assert((uread(BSP_UART_COM2, LSR) & THRE) != 0); |
… |
… |
|
453 | 449 | return 0; |
454 | 450 | } |
455 | | |
456 | 451 | |
457 | 452 | void |
-
r6128a4a
|
rf05b2ac
|
|
26 | 26 | stmdb sp!, {r0, r1, r2, r3, r12} /* save regs on INT stack */ |
27 | 27 | stmdb sp!, {lr} /* now safe to call C funcs */ |
28 | | |
29 | 28 | |
30 | 29 | /* one nest level deeper */ |
… |
… |
|
112 | 111 | stmdb sp!, {lr} /* in with the new (lr) */ |
113 | 112 | |
114 | | |
115 | 113 | orr r0, r0, #0xc0 |
116 | 114 | msr spsr, r0 |
… |
… |
|
120 | 118 | ldmia sp!, {r0, r1, r2, r3, r12} /* restore regs from INT stack */ |
121 | 119 | subs pc, lr, #4 /* return */ |
122 | | |
123 | | |
124 | 120 | |
125 | 121 | /* on entry to _ISR_Dispatch, we're in SVC mode */ |
-
r6128a4a
|
rf05b2ac
|
|
15 | 15 | do { _old = 0; } while(0) |
16 | 16 | |
17 | | |
18 | 17 | #define Clock_driver_support_initialize_hardware() |
19 | 18 | |
-
r6128a4a
|
rf05b2ac
|
|
14 | 14 | | $Id$ |
15 | 15 | +--------------------------------------------------------------------------*/ |
16 | | |
17 | 16 | |
18 | 17 | #ifndef __BSP_H_ |
-
r6128a4a
|
rf05b2ac
|
|
11 | 11 | */ |
12 | 12 | |
13 | | |
14 | 13 | #ifndef __LMREGS_H__ |
15 | 14 | #define __LMREGS_H__ |
… |
… |
|
28 | 27 | extern volatile unsigned long *Regs; /* Chip registers */ |
29 | 28 | #endif |
30 | | |
31 | | |
32 | 29 | |
33 | 30 | /****************************************************************************** |
… |
… |
|
72 | 69 | #define SYNTIOCNTL ((RC_BASE+0x80)/4) /* added 30/08/99 */ |
73 | 70 | |
74 | | |
75 | 71 | /* modified 30/08/99 by LHT */ |
76 | 72 | #define SHAPE0 ((RC_BASE+0x100)/4) /* previously 0x80 */ |
… |
… |
|
121 | 117 | #define TSTRXD ((PLP_BASE+0x78)/4) |
122 | 118 | #define PLPID ((PLP_BASE+0x7C)/4) |
123 | | |
124 | 119 | |
125 | 120 | /** ENCRYPTION ENGINE 0x1800 - 0x1BFF */ |
… |
… |
|
251 | 246 | /*PRODUCT_VERSION*/ |
252 | 247 | |
253 | | |
254 | 248 | /** THUMB and INTERFACES BLOCK 0x3400 - 0x4FFF */ |
255 | 249 | |
… |
… |
|
334 | 328 | #define SLEEPCNTL ((TI_BASE+0x208)/4) |
335 | 329 | |
336 | | |
337 | | |
338 | 330 | /****************************************************************************** |
339 | 331 | * BIT MASKS for Chip registers |
… |
… |
|
358 | 350 | #define MSK_TADCMD 0x0F /* Mask on TADCMD */ |
359 | 351 | #define CONTINUE 0x10 |
360 | | |
361 | | |
362 | 352 | |
363 | 353 | /** RADIO CONTROLER BLOCK (RC3) */ |
… |
… |
|
462 | 452 | #define RCCNTL_ENABLE 0x80 |
463 | 453 | |
464 | | |
465 | 454 | /* ADCCNTL1 register */ |
466 | 455 | #define ADCSTART 0x80 |
… |
… |
|
474 | 463 | #define ADCDWN1 0x04 |
475 | 464 | #define ADCDWN2 0x08 |
476 | | |
477 | | |
478 | 465 | |
479 | 466 | /** PLP BLOCK */ |
… |
… |
|
512 | 499 | #define MSK_PRES 0x0F /* mask on PRES field */ |
513 | 500 | |
514 | | |
515 | 501 | /* PLPALIN register */ |
516 | 502 | #define SYNM 0x08 |
… |
… |
|
537 | 523 | /* Bit ENABLE already defined */ |
538 | 524 | #define EECNTL_ENABLE 0x80 |
539 | | |
540 | 525 | |
541 | 526 | /** PAINT+ BLOCK */ |
… |
… |
|
555 | 540 | #define FORCE13 0x4000 |
556 | 541 | #define PAINTENB 0x8000 |
557 | | |
558 | 542 | |
559 | 543 | /* PAINTPLLCNTL register */ |
… |
… |
|
650 | 634 | #define G726ENB1 0x0003 |
651 | 635 | |
652 | | |
653 | 636 | /** GENERAL REGISTERS BLOCK */ |
654 | 637 | |
… |
… |
|
731 | 714 | #define MIRROR 0x10 |
732 | 715 | |
733 | | |
734 | 716 | /* LCDEECNTL1 register */ |
735 | 717 | /* Bit ENABLE already defined */ |
… |
… |
|
788 | 770 | #define CSMODE_16_WHWL 0x0002 |
789 | 771 | #define CSMODE_16_BHBL 0x0003 |
790 | | |
791 | 772 | |
792 | 773 | /* MUXADCNTL register */ |
… |
… |
|
816 | 797 | #define ADDRESS_2M 0x4000 |
817 | 798 | |
818 | | |
819 | 799 | /* CSGCNTL register */ |
820 | 800 | #define CSSWITCH 0x0040 |
821 | | |
822 | 801 | |
823 | 802 | /* SLEEPCNTL register */ |
… |
… |
|
829 | 808 | #define WDFLAG 0x80 /* same bit */ |
830 | 809 | |
831 | | |
832 | 810 | /* DCC register */ |
833 | 811 | /* bit ENABLE=0x80 already defined */ |
834 | 812 | #define DCC_ENABLE 0x80 |
835 | | |
836 | 813 | |
837 | 814 | /* TIMERCNTL[0:1] register */ |
… |
… |
|
844 | 821 | #define TIMER_216kHz 0x0001 |
845 | 822 | #define TIMER_27kHz 0x0000 |
846 | | |
847 | 823 | |
848 | 824 | /* INTMASKALL register */ |
… |
… |
|
881 | 857 | #define AUTOACK 0x0080 |
882 | 858 | |
883 | | |
884 | 859 | /****************************************************************************** |
885 | 860 | * Memory Mapping definition |
… |
… |
|
899 | 874 | #define REGS_BASE_ADR 0x000F0000 /* Base Address of registers */ |
900 | 875 | #define RADRAM_BASE_ADR 0x000F0000 /* Base Address of registers */ |
901 | | |
902 | 876 | |
903 | 877 | /****************************************************************************** |
… |
… |
|
1068 | 1042 | #define MSK_WINSZ 0x3F |
1069 | 1043 | |
1070 | | |
1071 | | |
1072 | | |
1073 | | |
1074 | 1044 | /* |
1075 | 1045 | * Some macros to mask the VEGA+ interrupt sources |
… |
… |
|
1085 | 1055 | #define LM_MaskSTX() (LM_Regs[RSIER] &= ~TX_INT_ENABLE) |
1086 | 1056 | #define LM_MaskUARTStatus() (LM_Regs[RSIER] &= ~LINE_STATUS_ENABLE) |
1087 | | |
1088 | 1057 | |
1089 | 1058 | #define LM_MaskTMR0() (LM_Regs[INTMASK] |= TMR0) |
-
r6128a4a
|
rf05b2ac
|
|
16 | 16 | #include <bsp.h> |
17 | 17 | #include <registers.h> |
18 | | |
19 | 18 | |
20 | 19 | void BSP_rtems_irq_mngt_init() { |
-
r6128a4a
|
rf05b2ac
|
|
13 | 13 | */ |
14 | 14 | |
15 | | |
16 | 15 | #include <bsp.h> |
17 | 16 | #include <irq.h> |
… |
… |
|
19 | 18 | #include <rtems/score/thread.h> |
20 | 19 | #include <rtems/score/apiext.h> |
21 | | |
22 | 20 | |
23 | 21 | /* |
… |
… |
|
122 | 120 | } |
123 | 121 | |
124 | | |
125 | | |
126 | 122 | void _ThreadProcessSignalsFromIrq (CPU_Exception_frame* ctx) |
127 | 123 | { |
-
r6128a4a
|
rf05b2ac
|
|
136 | 136 | void BSP_rtems_irq_mngt_init(); |
137 | 137 | |
138 | | |
139 | 138 | /* |
140 | 139 | * function to connect a particular irq handler. This hanlder will NOT be called |
… |
… |
|
185 | 184 | int BSP_remove_rtems_irq_handler (const rtems_irq_connect_data*); |
186 | 185 | |
187 | | |
188 | 186 | #ifdef __cplusplus |
189 | 187 | } |
-
r6128a4a
|
rf05b2ac
|
|
41 | 41 | .equ F_Bit, 0x40 |
42 | 42 | |
43 | | |
44 | 43 | .equ Mode_SVC_MIRQ, Mode_SVC | I_Bit | F_Bit |
45 | 44 | .equ Mode_SVC_UIRQ, Mode_SVC |
46 | 45 | .equ Mode_IRQ_MIRQ, Mode_SVC | I_Bit | F_Bit |
47 | | |
48 | 46 | |
49 | 47 | .equ MARK_STACK, 0 /*Fill every stack with a pattern for debug (0 or 1)*/ |
… |
… |
|
130 | 128 | STR r1, [r0,#CSCNTL1_2] |
131 | 129 | |
132 | | |
133 | 130 | MOV r0,#CNTL_CLK_ADR |
134 | 131 | /* Load clock mode 55 MHz */ |
… |
… |
|
155 | 152 | STRLOT r2, [r0], #4 |
156 | 153 | BLO zi_init |
157 | | |
158 | 154 | |
159 | 155 | /* Load basic ARM7 interrupt table */ |
-
r6128a4a
|
rf05b2ac
|
|
13 | 13 | | |
14 | 14 | +--------------------------------------------------------------------------*/ |
15 | | |
16 | 15 | |
17 | 16 | #include <bsp.h> |
… |
… |
|
78 | 77 | rtemsFreeMemStart += _heap_size; /* HEAP_SIZE in KBytes */ |
79 | 78 | |
80 | | |
81 | 79 | #ifdef RTEMS_DEBUG |
82 | 80 | |
… |
… |
|
86 | 84 | |
87 | 85 | } /* bsp_pretasking_hook */ |
88 | | |
89 | 86 | |
90 | 87 | /*-------------------------------------------------------------------------+ |
-
r6128a4a
|
rf05b2ac
|
|
13 | 13 | | |
14 | 14 | +--------------------------------------------------------------------------*/ |
15 | | |
16 | 15 | |
17 | 16 | #include <stdio.h> |
-
-
r6128a4a
|
rf05b2ac
|
|
108 | 108 | }; |
109 | 109 | |
110 | | |
111 | 110 | assert( minor <= 1 ); |
112 | 111 | if ( minor > 2 ) |
-
r6128a4a
|
rf05b2ac
|
|
31 | 31 | #include <rtems/iosupp.h> |
32 | 32 | |
33 | | |
34 | 33 | /* |
35 | 34 | * Define the time limits for RTEMS Test Suite test durations. |
… |
… |
|
42 | 41 | #define MAX_LONG_TEST_DURATION 300 /* 5 minutes = 300 seconds */ |
43 | 42 | #define MAX_SHORT_TEST_DURATION 3 /* 3 seconds */ |
44 | | |
45 | 43 | |
46 | 44 | /* |
… |
… |
|
84 | 82 | */ |
85 | 83 | |
86 | | |
87 | 84 | /* |
88 | 85 | * Information placed in the linkcmds file. |
-
r6128a4a
|
rf05b2ac
|
|
35 | 35 | * implemenations of timer but .... |
36 | 36 | */ |
37 | | |
38 | 37 | |
39 | 38 | c4x_timer_stop(C4X_TIMER_0); |
-
r6128a4a
|
rf05b2ac
|
|
82 | 82 | ClockOff, |
83 | 83 | ClockIsOn}; |
84 | | |
85 | 84 | |
86 | 85 | rtems_device_driver Clock_initialize( |
-
r6128a4a
|
rf05b2ac
|
|
117 | 117 | BSP_uart_init(BSPConsolePort, 9600, CHR_8_BITS, 0, 0, 0); |
118 | 118 | |
119 | | |
120 | 119 | /* Set interrupt handler */ |
121 | 120 | if(BSPConsolePort == BSP_UART_COM1) |
… |
… |
|
159 | 158 | return RTEMS_SUCCESSFUL; |
160 | 159 | } /* console_initialize */ |
161 | | |
162 | 160 | |
163 | 161 | static int console_last_close(int major, int minor, void *arg) |
… |
… |
|
227 | 225 | } /* console_close */ |
228 | 226 | |
229 | | |
230 | 227 | /*-------------------------------------------------------------------------+ |
231 | 228 | | Console device driver READ entry point. |
… |
… |
|
250 | 247 | } /* console_read */ |
251 | 248 | |
252 | | |
253 | 249 | /*-------------------------------------------------------------------------+ |
254 | 250 | | Console device driver WRITE entry point. |
… |
… |
|
264 | 260 | |
265 | 261 | } /* console_write */ |
266 | | |
267 | | |
268 | 262 | |
269 | 263 | /* |
-
r6128a4a
|
rf05b2ac
|
|
57 | 57 | #define MUST_WAIT_FOR_INTERRUTPT 0 |
58 | 58 | |
59 | | |
60 | 59 | #define Install_tm27_vector(handler) \ |
61 | 60 | { \ |
… |
… |
|
104 | 103 | |
105 | 104 | #define Is_tx_ready( _status ) ( (_status) & 0x40 ) |
106 | | |
107 | 105 | |
108 | 106 | #define Is_rx_ready( _status ) ( (_status) & 0x01 ) |
-
r6128a4a
|
rf05b2ac
|
|
14 | 14 | |
15 | 15 | #define KERNEL |
16 | | |
17 | 16 | |
18 | 17 | /* |
… |
… |
|
63 | 62 | #include <string.h> |
64 | 63 | |
65 | | |
66 | 64 | /* #include "../misc/utils.h" */ |
67 | 65 | |
68 | 66 | static struct uti596_softc uti596_softc; |
69 | | |
70 | 67 | |
71 | 68 | static int scbStatus; |
… |
… |
|
104 | 101 | #define RBUF_SIZE 1520 |
105 | 102 | |
106 | | |
107 | 103 | /* |
108 | 104 | * Local Routines |
… |
… |
|
178 | 174 | } |
179 | 175 | |
180 | | |
181 | | |
182 | 176 | static void uti596_maskOn(const rtems_irq_connect_data* irq) |
183 | 177 | { |
… |
… |
|
203 | 197 | } |
204 | 198 | |
205 | | |
206 | 199 | /*********************************************************************** |
207 | 200 | * Function: uti596initRFA(int num) ( New ) |
… |
… |
|
214 | 207 | * |
215 | 208 | ***********************************************************************/ |
216 | | |
217 | 209 | |
218 | 210 | int uti596_initRFA(int num) |
… |
… |
|
220 | 212 | struct i596_rfd *pRfd; |
221 | 213 | int i = 0; |
222 | | |
223 | 214 | |
224 | 215 | #ifdef DBG_596 |
… |
… |
|
286 | 277 | #endif |
287 | 278 | |
288 | | |
289 | 279 | uti596_softc.pSavedRfdQueue = |
290 | 280 | uti596_softc.pEndSavedQueue = I596_NULL; /* initially empty */ |
… |
… |
|
309 | 299 | { |
310 | 300 | struct i596_rfd *pLastRfd; |
311 | | |
312 | 301 | |
313 | 302 | UTI_596_ASSERT(pRfd != I596_NULL, "Supplying NULL RFD!\n"); |
… |
… |
|
407 | 396 | uti596_softc.savedCount++; |
408 | 397 | |
409 | | |
410 | 398 | return; |
411 | 399 | } |
… |
… |
|
522 | 510 | struct i596_cmd *pCmd; |
523 | 511 | |
524 | | |
525 | 512 | printf("uti596_reset_hardware\n"); |
526 | 513 | pCmd = sc->pCmdHead; /* This is a tx command for sure (99.99999%) */ |
… |
… |
|
544 | 531 | printf("reset_hardware:change scp address to : %p\n",sc->pScp); |
545 | 532 | #endif |
546 | | |
547 | 533 | |
548 | 534 | /* change the scp address */ |
… |
… |
|
628 | 614 | ***********************************************************************/ |
629 | 615 | |
630 | | |
631 | 616 | void |
632 | 617 | uti596_initMem(struct uti596_softc * sc) |
… |
… |
|
741 | 726 | |
742 | 727 | |
743 | | |
744 | 728 | /*********************************************************************** |
745 | 729 | * Function: uti596dump |
… |
… |
|
754 | 738 | struct i596_dump dumpCmd; |
755 | 739 | int boguscnt = 25000000; /* over a second! */ |
756 | | |
757 | 740 | |
758 | 741 | #ifdef DBG_596 |
… |
… |
|
775 | 758 | } |
776 | 759 | |
777 | | |
778 | 760 | } |
779 | 761 | |
… |
… |
|
856 | 838 | #endif |
857 | 839 | frames++; |
858 | | |
859 | 840 | |
860 | 841 | /* |
… |
… |
|
1048 | 1029 | |
1049 | 1030 | #endif |
1050 | | |
1051 | 1031 | |
1052 | 1032 | /* restore the RFA */ |
… |
… |
|
1155 | 1135 | #endif |
1156 | 1136 | |
1157 | | |
1158 | | |
1159 | 1137 | pCmd->status = 0; |
1160 | 1138 | pCmd->command |= (CMD_EOL | CMD_INTR ); /* all commands last in list & return an interrupt */ |
… |
… |
|
1186 | 1164 | _ISR_Enable(level); |
1187 | 1165 | } |
1188 | | |
1189 | 1166 | |
1190 | 1167 | #ifdef DBG_596 |
… |
… |
|
1407 | 1384 | } while( m != NULL && ++bd_count < 16 ); |
1408 | 1385 | |
1409 | | |
1410 | 1386 | /* This should never happen */ |
1411 | 1387 | if ( bd_count == 16 ) { |
… |
… |
|
1413 | 1389 | printf("Must coalesce!\n"); |
1414 | 1390 | } |
1415 | | |
1416 | 1391 | |
1417 | 1392 | if ( length < UTI_596_ETH_MIN_SIZE ) { |
… |
… |
|
1440 | 1415 | if (pTbd->size <= 0) return ; |
1441 | 1416 | |
1442 | | |
1443 | 1417 | #ifdef DEBUG_INIT_2 |
1444 | 1418 | printf("\nTransmitter adds packet\n"); |
… |
… |
|
1450 | 1424 | BREAKPOINT(); |
1451 | 1425 | #endif |
1452 | | |
1453 | 1426 | |
1454 | 1427 | /* add the command to the output command queue */ |
… |
… |
|
1511 | 1484 | } |
1512 | 1485 | |
1513 | | |
1514 | 1486 | } |
1515 | 1487 | |
… |
… |
|
1618 | 1590 | } |
1619 | 1591 | |
1620 | | |
1621 | 1592 | } |
1622 | 1593 | #ifdef DEBUG_INIT |
… |
… |
|
1656 | 1627 | |
1657 | 1628 | printf ("frame type %2.2X%2.2X\n", add[12], add[13]); |
1658 | | |
1659 | 1629 | |
1660 | 1630 | } |
… |
… |
|
1745 | 1715 | } |
1746 | 1716 | |
1747 | | |
1748 | 1717 | } |
1749 | 1718 | /*********************************************************************** |
… |
… |
|
1838 | 1807 | ***********************************************************************/ |
1839 | 1808 | |
1840 | | |
1841 | 1809 | int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig ) |
1842 | 1810 | { |
… |
… |
|
1848 | 1816 | printf("attach"); |
1849 | 1817 | #endif |
1850 | | |
1851 | 1818 | |
1852 | 1819 | sc->started = 0; /* The NIC is not started yet */ |
… |
… |
|
1905 | 1872 | sc->started = 1; |
1906 | 1873 | sc->pInboundFrameQueue = I596_NULL; |
1907 | | |
1908 | 1874 | |
1909 | 1875 | ifp->if_ioctl = uti596_ioctl; |
… |
… |
|
2232 | 2198 | } |
2233 | 2199 | } /* end if command complete */ |
2234 | | |
2235 | 2200 | |
2236 | 2201 | /* if the receiver has stopped, |
… |
… |
|
2331 | 2296 | uti596_softc.savedCount = 0; |
2332 | 2297 | } |
2333 | | |
2334 | 2298 | |
2335 | 2299 | #ifdef DBG_596_RFD |
… |
… |
|
2375 | 2339 | pISR_Rfd, pISR_Rfd->stat, pISR_Rfd->cmd); |
2376 | 2340 | |
2377 | | |
2378 | 2341 | printk("\nSaved: \n"); |
2379 | 2342 | for ( pISR_Rfd = uti596_softc.pSavedRfdQueue; |
… |
… |
|
2408 | 2371 | } |
2409 | 2372 | |
2410 | | |
2411 | 2373 | /*********************************************************************** |
2412 | 2374 | * Function: void uti596dequeue |
… |
… |
|
2435 | 2397 | *ppQ = pRfd->next; /* advance the queue pointer */ |
2436 | 2398 | pRfd->next = I596_NULL; /* unlink the rfd being returned */ |
2437 | | |
2438 | 2399 | |
2439 | 2400 | _ISR_Enable(level); |
… |
… |
|
2498 | 2459 | ***********************************************************************/ |
2499 | 2460 | |
2500 | | |
2501 | 2461 | /* static */ |
2502 | 2462 | void uti596_stop(struct uti596_softc *sc) |
… |
… |
|
2514 | 2474 | |
2515 | 2475 | } |
2516 | | |
2517 | 2476 | |
2518 | 2477 | static int |
… |
… |
|
2583 | 2542 | * |
2584 | 2543 | ***********************************************************************/ |
2585 | | |
2586 | 2544 | |
2587 | 2545 | void |
… |
… |
|
2683 | 2641 | pRfd, pRfd->stat, pRfd->cmd); |
2684 | 2642 | |
2685 | | |
2686 | 2643 | printf("\nSaved: \n"); |
2687 | 2644 | for ( pRfd = uti596_softc.pSavedRfdQueue; |
… |
… |
|
2697 | 2654 | struct i596_rfd *pRfd; |
2698 | 2655 | |
2699 | | |
2700 | 2656 | printf("CMD: 0x%x, Status: 0x%x\n", |
2701 | 2657 | uti596_softc.scb.command, |
… |
… |
|
2721 | 2677 | } |
2722 | 2678 | |
2723 | | |
2724 | 2679 | void uti596_init(void * arg){ |
2725 | 2680 | |
2726 | 2681 | struct uti596_softc *sc = arg; |
2727 | 2682 | struct ifnet *ifp = &sc->arpcom.ac_if; |
2728 | | |
2729 | 2683 | |
2730 | 2684 | if (sc->txDaemonTid == 0) { |
… |
… |
|
2740 | 2694 | sc->resetDaemonTid = rtems_bsdnet_newproc ("UTrt", 2*4096, |
2741 | 2695 | uti596_resetDaemon, sc); |
2742 | | |
2743 | 2696 | |
2744 | 2697 | #ifdef DBG_INIT |
-
r6128a4a
|
rf05b2ac
|
|
56 | 56 | }; |
57 | 57 | |
58 | | |
59 | | |
60 | 58 | enum commands { |
61 | 59 | CmdNOp = 0, |
… |
… |
|
69 | 67 | }; |
70 | 68 | |
71 | | |
72 | 69 | #define UTI596_MUTEX 1 |
73 | | |
74 | 70 | |
75 | 71 | #define CMD_EOL 0x8000 /* The last command of the list, stop. */ |
… |
… |
|
86 | 82 | #define SCB_CUS_SUSPENDED 0x0100 |
87 | 83 | #define SCB_CUS_ACTIVE 0x0200 |
88 | | |
89 | 84 | |
90 | 85 | #define STAT_C 0x8000 /* Set to 1 after execution */ |
… |
… |
|
102 | 97 | #define STAT_MAX_COLLS 0x000F |
103 | 98 | |
104 | | |
105 | 99 | #define RBD_STAT_P 0x4000 /* prefetch */ |
106 | 100 | #define RBD_STAT_F 0x4000 /* used */ |
… |
… |
|
119 | 113 | #define RU_READY 0x0040 |
120 | 114 | |
121 | | |
122 | 115 | #define IO_ADDR 0x360 |
123 | 116 | #define PORT_ADDR IO_ADDR |
… |
… |
|
168 | 161 | unsigned short pad; |
169 | 162 | } ; |
170 | | |
171 | 163 | |
172 | 164 | /* |
… |
… |
|
182 | 174 | char data [1532 ]; |
183 | 175 | } ; |
184 | | |
185 | 176 | |
186 | 177 | struct i596_dump { |
… |
… |
|
227 | 218 | volatile unsigned short t_off; |
228 | 219 | }; |
229 | | |
230 | 220 | |
231 | 221 | /* |
-
r6128a4a
|
rf05b2ac
|
|
48 | 48 | #define OCW3SDOS 0x00A0 |
49 | 49 | |
50 | | |
51 | 50 | /* CONFIGURATION Registers */ |
52 | 51 | #define DMACFG 0xF830 |
-
r6128a4a
|
rf05b2ac
|
|
29 | 29 | * $Id$ |
30 | 30 | |
31 | | |
32 | 31 | changes: |
33 | 32 | SetExRegByte(ICW3S , 0x02 ) # MUST be 0x02 according to intel |
… |
… |
|
36 | 35 | */ |
37 | 36 | |
38 | | |
39 | 37 | #include <rtems/asm.h> |
40 | 38 | #include "macros.inc" |
41 | 39 | #include "80386ex.inc" |
42 | | |
43 | 40 | |
44 | 41 | /* |
… |
… |
|
76 | 73 | |
77 | 74 | END_DATA |
78 | | |
79 | 75 | |
80 | 76 | /* This section is the section that is used by the interrupt |
… |
… |
|
131 | 127 | orb $0x02 , al # Bit 1 Fast A20 = 0 (always 0) else enabled. |
132 | 128 | outb al , dx |
133 | | |
134 | 129 | |
135 | 130 | SYM(Watchdog): |
… |
… |
|
285 | 280 | SetExRegByte(TMR0 , 0x00 ) # sfa |
286 | 281 | |
287 | | |
288 | 282 | SetExRegByte(TMRCON , 0x70 ) # mode 0 disables on Gate= Vcc |
289 | 283 | SetExRegByte(TMR1 , 0x00 ) # sfa |
… |
… |
|
343 | 337 | SetExRegByte(INTCFG , 0x00 ) |
344 | 338 | |
345 | | |
346 | 339 | SYM(SetCS4): |
347 | 340 | SetExRegWord(CS4ADL , 0x702) #Configure chip select 4 |
… |
… |
|
383 | 376 | lgdt SYM(GDTR) # location of GDT |
384 | 377 | #endif |
385 | | |
386 | 378 | |
387 | 379 | SYM(SetUCS): |
… |
… |
|
473 | 465 | stosl # clear a long in the bss |
474 | 466 | |
475 | | |
476 | 467 | /* |
477 | 468 | * Transfer control to User's Board Support Package |
-
r6128a4a
|
rf05b2ac
|
|
81 | 81 | bsp_libc_init((void *) heap_start, heap_size, 0); |
82 | 82 | |
83 | | |
84 | 83 | #ifdef RTEMS_DEBUG |
85 | 84 | rtems_debug_enable( RTEMS_DEBUG_ALL_MASK ); |
-
-
r6128a4a
|
rf05b2ac
|
|
59 | 59 | * MODIFICATION/HISTORY: |
60 | 60 | * $Log$ |
| 61 | * Revision 1.3 2004/04/21 10:42:43 ralf |
| 62 | * Remove stray white spaces. |
| 63 | * |
61 | 64 | * Revision 1.2 1999/12/13 21:21:31 joel |
62 | 65 | * Warning removal patch from Philip A. Prindeville <philipp@zembu.com>. |
… |
… |
|
152 | 155 | }; |
153 | 156 | |
154 | | |
155 | 157 | struct ep_board |
156 | 158 | { |
… |
… |
|
162 | 164 | u_short res_cfg; /* resource configuration */ |
163 | 165 | }; |
164 | | |
165 | 166 | |
166 | 167 | /* |
… |
… |
|
193 | 194 | }; |
194 | 195 | |
195 | | |
196 | 196 | /* static unsigned long loopc; */ |
197 | 197 | static volatile unsigned long overrun; |
… |
… |
|
216 | 216 | #define ep_fset(f) (sc->stat|=(f)) |
217 | 217 | #define ep_frst(f) (sc->stat&=~(f)) |
218 | | |
219 | 218 | |
220 | 219 | /* forward declarations for functions */ |
… |
… |
|
232 | 231 | extern void Wait_X_ms( unsigned int timeToWait ); /* timer.c ??? */ |
233 | 232 | |
234 | | |
235 | 233 | /********************************************************************************** |
236 | 234 | * |
… |
… |
|
286 | 284 | } |
287 | 285 | |
288 | | |
289 | 286 | /********************************************************************************** |
290 | 287 | * |
… |
… |
|
339 | 336 | } |
340 | 337 | |
341 | | |
342 | 338 | /********************************************************************************** |
343 | 339 | * |
… |
… |
|
355 | 351 | } |
356 | 352 | |
357 | | |
358 | 353 | /********************************************************************************** |
359 | 354 | * |
… |
… |
|
395 | 390 | return in_data; |
396 | 391 | } |
397 | | |
398 | 392 | |
399 | 393 | /********************************************************************************** |
… |
… |
|
424 | 418 | } |
425 | 419 | |
426 | | |
427 | 420 | /********************************************************************************** |
428 | 421 | * |
… |
… |
|
465 | 458 | } |
466 | 459 | |
467 | | |
468 | 460 | /********************************************************************************** |
469 | 461 | * |
… |
… |
|
486 | 478 | } |
487 | 479 | |
488 | | |
489 | 480 | /********************************************************************************** |
490 | 481 | * |
… |
… |
|
510 | 501 | return BSP_irq_enabled_at_i8259s (irq->name); |
511 | 502 | } |
512 | | |
513 | 503 | |
514 | 504 | /********************************************************************************** |
… |
… |
|
568 | 558 | printf ("3C509: RX Daemon is finishing.\n"); |
569 | 559 | } |
570 | | |
571 | 560 | |
572 | 561 | /********************************************************************************** |
… |
… |
|
602 | 591 | } |
603 | 592 | |
604 | | |
605 | 593 | /********************************************************************************** |
606 | 594 | * |
… |
… |
|
680 | 668 | outw(BASE + EP_COMMAND, SET_RX_FILTER); |
681 | 669 | } |
682 | | |
683 | 670 | |
684 | 671 | /********************************************************************************** |
… |
… |
|
858 | 845 | } |
859 | 846 | |
860 | | |
861 | 847 | /********************************************************************************** |
862 | 848 | * |
… |
… |
|
972 | 958 | } |
973 | 959 | |
974 | | |
975 | | |
976 | 960 | /********************************************************************************** |
977 | 961 | * |
… |
… |
|
1040 | 1024 | } |
1041 | 1025 | |
1042 | | |
1043 | | |
1044 | 1026 | /********************************************************************************** |
1045 | 1027 | * |
… |
… |
|
1127 | 1109 | return 0; |
1128 | 1110 | } |
1129 | | |
1130 | 1111 | |
1131 | 1112 | /********************************************************************************** |
… |
… |
|
1256 | 1237 | ifp->if_flags &= ~IFF_OACTIVE; /* just in case */ |
1257 | 1238 | |
1258 | | |
1259 | 1239 | sc->rx_no_first = sc->rx_no_mbuf = |
1260 | 1240 | sc->rx_bpf_disc = sc->rx_overrunf = sc->rx_overrunl = |
… |
… |
|
1278 | 1258 | GO_WINDOW(1); |
1279 | 1259 | } |
1280 | | |
1281 | 1260 | |
1282 | 1261 | static const char padmap[] = {0, 3, 2, 1}; |
… |
… |
|
1386 | 1365 | goto startagain; |
1387 | 1366 | } |
1388 | | |
1389 | | |
1390 | 1367 | |
1391 | 1368 | /********************************************************************************** |
… |
… |
|
1530 | 1507 | outw(BASE + EP_COMMAND, SET_RX_EARLY_THRESH | RX_INIT_EARLY_THRESH); |
1531 | 1508 | } |
1532 | | |
1533 | | |
1534 | 1509 | |
1535 | 1510 | /********************************************************************************** |
-
r6128a4a
|
rf05b2ac
|
|
38 | 38 | #include "elink.h" |
39 | 39 | |
40 | | |
41 | 40 | extern void outb( unsigned short io_addr, unsigned char out_data ); |
42 | 41 | |
-
r6128a4a
|
rf05b2ac
|
|
31 | 31 | +--------------------------------------------------------------------------*/ |
32 | 32 | |
33 | | |
34 | 33 | #include <stdlib.h> |
35 | 34 | |
… |
… |
|
110 | 109 | } /* Clock_exit */ |
111 | 110 | |
112 | | |
113 | 111 | /*-------------------------------------------------------------------------+ |
114 | 112 | | Function: Install_clock |
… |
… |
|
178 | 176 | clockIsOn}; |
179 | 177 | |
180 | | |
181 | | |
182 | 178 | /*-------------------------------------------------------------------------+ |
183 | 179 | | Clock device driver INITIALIZE entry point. |
… |
… |
|
202 | 198 | return RTEMS_SUCCESSFUL; |
203 | 199 | } /* Clock_initialize */ |
204 | | |
205 | 200 | |
206 | 201 | /*-------------------------------------------------------------------------+ |
… |
… |
|
246 | 241 | +--------------------------------------------------------------------------*/ |
247 | 242 | |
248 | | |
249 | 243 | #if 0 && defined(pentium) |
250 | 244 | |
-
r6128a4a
|
rf05b2ac
|
|
31 | 31 | | $Id$ |
32 | 32 | +--------------------------------------------------------------------------*/ |
33 | | |
34 | 33 | |
35 | 34 | #include <string.h> |
… |
… |
|
71 | 70 | #define RTC_CENTURY 0x32 /* current century - increment in Dec99 */ |
72 | 71 | |
73 | | |
74 | 72 | /*-------------------------------------------------------------------------+ |
75 | 73 | | Auxiliary Functions |
… |
… |
|
108 | 106 | } /* ytos */ |
109 | 107 | |
110 | | |
111 | 108 | /*-------------------------------------------------------------------------+ |
112 | 109 | | Function: mtos |
… |
… |
|
144 | 141 | return r; |
145 | 142 | } /* rtcin */ |
146 | | |
147 | 143 | |
148 | 144 | /*-------------------------------------------------------------------------+ |
… |
… |
|
175 | 171 | printf("RTC BIOS diagnostic error %b\n", s, RTCDG_BITS); */ |
176 | 172 | } /* init_rtc */ |
177 | | |
178 | 173 | |
179 | 174 | /*-------------------------------------------------------------------------+ |
-
r6128a4a
|
rf05b2ac
|
|
126 | 126 | } |
127 | 127 | |
128 | | |
129 | 128 | int kbd_poll_read( int minor ) |
130 | 129 | { |
… |
… |
|
175 | 174 | } |
176 | 175 | |
177 | | |
178 | 176 | /*-------------------------------------------------------------------------+ |
179 | 177 | | Console device driver INITIALIZE entry point. |
… |
… |
|
187 | 185 | { |
188 | 186 | rtems_status_code status; |
189 | | |
190 | 187 | |
191 | 188 | /* Initialize the KBD interface */ |
… |
… |
|
241 | 238 | /* 9600-8-N-1 */ |
242 | 239 | BSP_uart_init(BSPConsolePort, 9600, CHR_8_BITS, 0, 0, 0); |
243 | | |
244 | 240 | |
245 | 241 | /* Set interrupt handler */ |
… |
… |
|
304 | 300 | } /* console_initialize */ |
305 | 301 | |
306 | | |
307 | 302 | static int console_open_count = 0; |
308 | 303 | |
… |
… |
|
392 | 387 | } /* console_close */ |
393 | 388 | |
394 | | |
395 | 389 | /*-------------------------------------------------------------------------+ |
396 | 390 | | Console device driver READ entry point. |
… |
… |
|
405 | 399 | return rtems_termios_read( arg ); |
406 | 400 | } /* console_read */ |
407 | | |
408 | 401 | |
409 | 402 | /*-------------------------------------------------------------------------+ |
… |
… |
|
431 | 424 | return RTEMS_SUCCESSFUL; |
432 | 425 | } /* console_write */ |
433 | | |
434 | 426 | |
435 | 427 | extern int vt_ioctl( unsigned int cmd, unsigned long arg); |
-
r6128a4a
|
rf05b2ac
|
|
12 | 12 | // |
13 | 13 | // $Log$ |
| 14 | // Revision 1.2 2004/04/21 10:42:44 ralf |
| 15 | // Remove stray white spaces. |
| 16 | // |
14 | 17 | // Revision 1.1 2000/08/30 08:15:30 joel |
15 | 18 | // 2000-08-26 Rosimildo da Silva <rdasilva@connecttel.com> |
… |
… |
|
67 | 70 | extern void ega_hwterm( void ); |
68 | 71 | |
69 | | |
70 | 72 | /* screen information for the VGA driver */ |
71 | 73 | static struct fb_screeninfo fb_info = |
… |
… |
|
79 | 81 | FB_VISUAL_PSEUDOCOLOR /* color scheme used */ |
80 | 82 | }; |
81 | | |
82 | 83 | |
83 | 84 | static __u16 red16[] = { |
… |
… |
|
117 | 118 | } |
118 | 119 | |
119 | | |
120 | 120 | /* |
121 | 121 | * fbvga device driver OPEN entry point |
… |
… |
|
143 | 143 | } |
144 | 144 | |
145 | | |
146 | 145 | /* |
147 | 146 | * fbvga device driver READ entry point. |
… |
… |
|
159 | 158 | } |
160 | 159 | |
161 | | |
162 | 160 | /* |
163 | 161 | * fbvga device driver WRITE entry point. |
… |
… |
|
175 | 173 | } |
176 | 174 | |
177 | | |
178 | 175 | static int get_screen_info( struct fb_screeninfo *info ) |
179 | 176 | { |
… |
… |
|
181 | 178 | return 0; |
182 | 179 | } |
183 | | |
184 | 180 | |
185 | 181 | static int get_palette( struct fb_cmap *cmap ) |
… |
… |
|
199 | 195 | } |
200 | 196 | |
201 | | |
202 | 197 | static int set_palette( struct fb_cmap *cmap ) |
203 | 198 | { |
… |
… |
|
215 | 210 | return 0; |
216 | 211 | } |
217 | | |
218 | 212 | |
219 | 213 | /* |
-
r6128a4a
|
rf05b2ac
|
|
17 | 17 | * |
18 | 18 | * $Log$ |
| 19 | * Revision 1.3 2004/04/21 10:42:44 ralf |
| 20 | * Remove stray white spaces. |
| 21 | * |
19 | 22 | * Revision 1.2 2004/04/15 13:26:12 ralf |
20 | 23 | * Remove stray white spaces. |
… |
… |
|
85 | 88 | ); |
86 | 89 | |
87 | | |
88 | 90 | rtems_device_driver fbvga_read( |
89 | 91 | rtems_device_major_number, |
-
r6128a4a
|
rf05b2ac
|
|
59 | 59 | #define aux_free_irq(dev_id) /* free_irq(AUX_IRQ, dev_id) */ |
60 | 60 | |
61 | | |
62 | | |
63 | 61 | /* |
64 | 62 | * include/linux/pc_keyb.h |
… |
… |
|
78 | 76 | #undef KBD_IS_FOCUS_9000 /* We have the brain-damaged FOCUS-9000 keyboard */ |
79 | 77 | #undef INITIALIZE_MOUSE /* Define if your PS/2 mouse needs initialization. */ |
80 | | |
81 | | |
82 | 78 | |
83 | 79 | #define KBD_INIT_TIMEOUT 1000 /* Timeout in ms for initializing the keyboard */ |
-
r6128a4a
|
rf05b2ac
|
|
67 | 67 | }; /* Keyboard scancode -> character map with SHIFT key modifier. */ |
68 | 68 | |
69 | | |
70 | 69 | static unsigned short kbd_buffer[KBD_BUF_SIZE]; |
71 | 70 | static uint16_t kbd_first = 0; |
… |
… |
|
85 | 84 | outport_byte(0x64, 0xFE); /* use keyboard controler to do the job... */ |
86 | 85 | } /* rtemsReboot */ |
87 | | |
88 | 86 | |
89 | 87 | /*-------------------------------------------------------------------------+ |
… |
… |
|
239 | 237 | } /* _IBMPC_chrdy */ |
240 | 238 | |
241 | | |
242 | 239 | /*-------------------------------------------------------------------------+ |
243 | 240 | | Function: _IBMPC_inch |
… |
… |
|
256 | 253 | return c; |
257 | 254 | } /* _IBMPC_inch */ |
258 | | |
259 | 255 | |
260 | 256 | /* |
-
r6128a4a
|
rf05b2ac
|
|
11 | 11 | // MODIFICATION/HISTORY: |
12 | 12 | // $Log$ |
| 13 | // Revision 1.2 2004/04/21 10:42:44 ralf |
| 14 | // Remove stray white spaces. |
| 15 | // |
13 | 16 | // Revision 1.1 2000/08/30 08:15:30 joel |
14 | 17 | // 2000-08-26 Rosimildo da Silva <rdasilva@connecttel.com> |
… |
… |
|
111 | 114 | }; |
112 | 115 | |
113 | | |
114 | 116 | struct kbdiacr { |
115 | 117 | unsigned char diacr, base, result; |
-
r6128a4a
|
rf05b2ac
|
|
57 | 57 | extern void rtemsReboot( void ); |
58 | 58 | |
59 | | |
60 | | |
61 | 59 | int set_bit(int nr, unsigned long * addr) |
62 | 60 | { |
… |
… |
|
97 | 95 | #define test_and_clear_bit(x,y) clear_bit(x,y) |
98 | 96 | |
99 | | |
100 | 97 | /* |
101 | 98 | * global state includes the following, and various static variables |
… |
… |
|
123 | 120 | /* default console for RTEMS */ |
124 | 121 | static int fg_console = 0; |
125 | | |
126 | 122 | |
127 | 123 | struct kbd_struct kbd_table[MAX_NR_CONSOLES]; |
… |
… |
|
150 | 146 | typedef void (*void_fnp)(void); |
151 | 147 | typedef void (void_fn)(void); |
152 | | |
153 | 148 | |
154 | 149 | static void show_mem(void) |
… |
… |
|
212 | 207 | } |
213 | 208 | |
214 | | |
215 | 209 | /* |
216 | 210 | * Translation of escaped scancodes to keycodes. |
… |
… |
|
278 | 272 | rep = test_and_set_bit(keycode, key_down); |
279 | 273 | |
280 | | |
281 | 274 | #ifdef CONFIG_MAGIC_SYSRQ /* Handle the SysRq Hack */ |
282 | 275 | if (keycode == SYSRQ_KEY) { |
… |
… |
|
289 | 282 | } |
290 | 283 | #endif |
291 | | |
292 | 284 | |
293 | 285 | if (kbd->kbdmode == VC_MEDIUMRAW) { |
… |
… |
|
320 | 312 | int shift_final = shift_state ^ kbd->lockstate ^ kbd->slockstate; |
321 | 313 | ushort *key_map = key_maps[shift_final]; |
322 | | |
323 | 314 | |
324 | 315 | if (key_map != NULL) { |
… |
… |
|
384 | 375 | } |
385 | 376 | |
386 | | |
387 | 377 | static void puts_queue(char *cp) |
388 | 378 | { |
… |
… |
|
578 | 568 | diacr = (diacr ? handle_diacr(value) : value); |
579 | 569 | } |
580 | | |
581 | 570 | |
582 | 571 | /* |
… |
… |
|
847 | 836 | static inline unsigned char getleds(void){ |
848 | 837 | |
849 | | |
850 | 838 | struct kbd_struct *kbd = kbd_table + fg_console; |
851 | 839 | |
… |
… |
|
900 | 888 | } |
901 | 889 | |
902 | | |
903 | 890 | void set_leds(void) |
904 | 891 | { |
905 | 892 | kbd_bh(); |
906 | 893 | } |
907 | | |
908 | 894 | |
909 | 895 | int kbd_init(void) |
-
r6128a4a
|
rf05b2ac
|
|
11 | 11 | // MODIFICATION/HISTORY: |
12 | 12 | // $Log$ |
| 13 | // Revision 1.3 2004/04/21 10:42:44 ralf |
| 14 | // Remove stray white spaces. |
| 15 | // |
13 | 16 | // Revision 1.2 2000/08/30 17:06:23 joel |
14 | 17 | // 2000-08-30 Joel Sherrill <joel@OARcorp.com> |
… |
… |
|
82 | 85 | #define MAX_NR_FUNC 256 /* max nr of strings assigned to keys */ |
83 | 86 | #define MAX_NR_CONSOLES 1 |
84 | | |
85 | 87 | |
86 | 88 | extern char *func_table[MAX_NR_FUNC]; |
… |
… |
|
361 | 363 | #define K_UNDO K(KT_FN,255) |
362 | 364 | |
363 | | |
364 | 365 | #define K_HOLE K(KT_SPEC,0) |
365 | 366 | #define K_ENTER K(KT_SPEC,1) |
… |
… |
|
624 | 625 | extern unsigned int keymap_count; |
625 | 626 | |
626 | | |
627 | 627 | #endif |
-
r6128a4a
|
rf05b2ac
|
|
30 | 30 | #include "mouse_parser.h" |
31 | 31 | #include "serial_mouse.h" |
32 | | |
33 | 32 | |
34 | 33 | /* NOTE NOTE NOTE NOTE: |
… |
… |
|
226 | 225 | } |
227 | 226 | |
228 | | |
229 | 227 | /* |
230 | 228 | * Input routine for Microsoft mouse. |
… |
… |
|
395 | 393 | } |
396 | 394 | |
397 | | |
398 | 395 | void unregister_kbd_msg_queue( int port ) |
399 | 396 | { |
-
-
r6128a4a
|
rf05b2ac
|
|
17 | 17 | * $Id$ |
18 | 18 | */ |
19 | | |
20 | 19 | |
21 | 20 | #include <bsp.h> |
… |
… |
|
77 | 76 | } |
78 | 77 | |
79 | | |
80 | 78 | int (*videoHook)(char, int *)=0; |
81 | 79 | |
… |
… |
|
101 | 99 | /* erase current location without moving the cursor */ |
102 | 100 | #define BLANK ((char)0x7f) |
103 | | |
104 | 101 | |
105 | 102 | static void |
… |
… |
|
274 | 271 | } /* _IBMPC_outch */ |
275 | 272 | |
276 | | |
277 | 273 | /*-------------------------------------------------------------------------+ |
278 | 274 | | Function: _IBMPC_initVideo |
… |
… |
|
310 | 306 | } /* _IBMPC_initVideo */ |
311 | 307 | |
312 | | |
313 | 308 | /* for old DOS compatibility n-curses type of applications */ |
314 | 309 | void gotoxy( int x, int y ) |
… |
… |
|
317 | 312 | } |
318 | 313 | |
319 | | |
320 | 314 | int whereX( void ) |
321 | 315 | { |
-
r6128a4a
|
rf05b2ac
|
|
165 | 165 | 0, 0, 0, 0, 0, 0, 0, 0 /* 0x78-0x7f */ |
166 | 166 | }; |
167 | | |
168 | 167 | |
169 | 168 | static void mdelay( unsigned long t ) |
… |
… |
|
218 | 217 | { |
219 | 218 | static int prev_scancode = 0; |
220 | | |
221 | 219 | |
222 | 220 | /* special prefix scancodes.. */ |
… |
… |
|
319 | 317 | } |
320 | 318 | |
321 | | |
322 | | |
323 | 319 | static void kb_wait(void) |
324 | 320 | { |
… |
… |
|
341 | 337 | #endif |
342 | 338 | } |
343 | | |
344 | 339 | |
345 | 340 | /* |
… |
… |
|
389 | 384 | return status; |
390 | 385 | } |
391 | | |
392 | 386 | |
393 | 387 | void keyboard_interrupt( void ) |
… |
… |
|
596 | 590 | } |
597 | 591 | |
598 | | |
599 | 592 | kbd_write_output_w(KBD_CMD_ENABLE); |
600 | 593 | if (kbd_wait_for_input() != KBD_REPLY_ACK) |
… |
… |
|
612 | 605 | } |
613 | 606 | |
614 | | |
615 | 607 | void pckbd_init_hw(void) |
616 | 608 | { |
-
r6128a4a
|
rf05b2ac
|
|
16 | 16 | * |
17 | 17 | * $Log$ |
| 18 | * Revision 1.3 2004/04/21 10:42:44 ralf |
| 19 | * Remove stray white spaces. |
| 20 | * |
18 | 21 | * Revision 1.2 2004/04/15 13:26:12 ralf |
19 | 22 | * Remove stray white spaces. |
… |
… |
|
84 | 87 | ); |
85 | 88 | |
86 | | |
87 | 89 | rtems_device_driver paux_read( |
88 | 90 | rtems_device_major_number, |
-
r6128a4a
|
rf05b2ac
|
|
75 | 75 | } |
76 | 76 | |
77 | | |
78 | 77 | static void* termios_ttyp_paux = NULL; |
79 | 78 | |
… |
… |
|
95 | 94 | } |
96 | 95 | |
97 | | |
98 | 96 | static rtems_irq_connect_data ps2_isr_data = { AUX_IRQ, |
99 | 97 | ps2_mouse_interrupt, isr_on, isr_off, isr_is_on }; |
100 | | |
101 | 98 | |
102 | 99 | /* |
… |
… |
|
162 | 159 | } |
163 | 160 | |
164 | | |
165 | 161 | static inline void handle_mouse_event(unsigned char scancode) |
166 | 162 | { |
… |
… |
|
228 | 224 | return status; |
229 | 225 | } |
230 | | |
231 | 226 | |
232 | 227 | static void ps2_mouse_interrupt() |
… |
… |
|
405 | 400 | } |
406 | 401 | |
407 | | |
408 | 402 | static int queue_empty(void) |
409 | 403 | { |
… |
… |
|
439 | 433 | } |
440 | 434 | queue->head = queue->tail = 0; /* Flush input queue */ |
441 | | |
442 | 435 | |
443 | 436 | status = BSP_install_rtems_irq_handler( &ps2_isr_data ); |
… |
… |
|
579 | 572 | } /* tty_initialize */ |
580 | 573 | |
581 | | |
582 | 574 | static int paux_last_close(int major, int minor, void *arg) |
583 | 575 | { |
… |
… |
|
595 | 587 | return 0; |
596 | 588 | } |
597 | | |
598 | 589 | |
599 | 590 | /* |
… |
… |
|
607 | 598 | return RTEMS_SUCCESSFUL; |
608 | 599 | } |
609 | | |
610 | 600 | |
611 | 601 | /* |
… |
… |
|
646 | 636 | } |
647 | 637 | |
648 | | |
649 | 638 | /* |
650 | 639 | * paux device driver READ entry point. |
… |
… |
|
658 | 647 | return rtems_termios_read (arg); |
659 | 648 | } /* tty_read */ |
660 | | |
661 | 649 | |
662 | 650 | /* |
… |
… |
|
676 | 664 | } /* tty_write */ |
677 | 665 | |
678 | | |
679 | 666 | /* |
680 | 667 | * Handle ioctl request. |
-
r6128a4a
|
rf05b2ac
|
|
19 | 19 | #undef KBD_IS_FOCUS_9000 /* We have the brain-damaged FOCUS-9000 keyboard */ |
20 | 20 | #undef INITIALIZE_MOUSE /* Define if your PS/2 mouse needs initialization. */ |
21 | | |
22 | | |
23 | 21 | |
24 | 22 | #define KBD_INIT_TIMEOUT 1000 /* Timeout in ms for initializing the keyboard */ |
-
r6128a4a
|
rf05b2ac
|
|
19 | 19 | * |
20 | 20 | * $Log$ |
| 21 | * Revision 1.6 2004/04/21 10:42:44 ralf |
| 22 | * Remove stray white spaces. |
| 23 | * |
21 | 24 | * Revision 1.5 2000/12/05 16:37:38 joel |
22 | 25 | * 2000-12-01 Joel Sherrill <joel@OARcorp.com> |
… |
… |
|
59 | 62 | static void isr_off(const rtems_irq_connect_data *); |
60 | 63 | static int isr_is_on(const rtems_irq_connect_data *); |
61 | | |
62 | 64 | |
63 | 65 | extern BSP_polling_getchar_function_type BSP_poll_char; |
… |
… |
|
162 | 164 | return RTEMS_SUCCESSFUL; |
163 | 165 | } /* tty_initialize */ |
164 | | |
165 | 166 | |
166 | 167 | static int serial_mouse_last_close(int major, int minor, void *arg) |
… |
… |
|
221 | 222 | } /* tty_close */ |
222 | 223 | |
223 | | |
224 | 224 | /* |
225 | 225 | * TTY device driver READ entry point. |
… |
… |
|
233 | 233 | return rtems_termios_read (arg); |
234 | 234 | } /* tty_read */ |
235 | | |
236 | 235 | |
237 | 236 | /* |
… |
… |
|
286 | 285 | return serial_mouse_control_internal( BSP_UART_PORT, arg ); |
287 | 286 | } |
288 | | |
289 | | |
290 | 287 | |
291 | 288 | static int |
-
r6128a4a
|
rf05b2ac
|
|
16 | 16 | * |
17 | 17 | * $Log$ |
| 18 | * Revision 1.3 2004/04/21 10:42:44 ralf |
| 19 | * Remove stray white spaces. |
| 20 | * |
18 | 21 | * Revision 1.2 2004/04/15 13:26:12 ralf |
19 | 22 | * Remove stray white spaces. |
… |
… |
|
59 | 62 | #endif |
60 | 63 | |
61 | | |
62 | 64 | /* ttyS1 entry points */ |
63 | 65 | rtems_device_driver serial_mouse_initialize( |
… |
… |
|
79 | 81 | ); |
80 | 82 | |
81 | | |
82 | 83 | /* serial_mouse entry points */ |
83 | 84 | rtems_device_driver serial_mouse_close( |
… |
… |
|
86 | 87 | void * |
87 | 88 | ); |
88 | | |
89 | 89 | |
90 | 90 | rtems_device_driver serial_mouse_read( |
… |
… |
|
100 | 100 | ); |
101 | 101 | |
102 | | |
103 | 102 | /* Select the mouse type: "ms","pc","ps2" */ |
104 | 103 | #define MOUSE_TYPE "ms" |
… |
… |
|
107 | 106 | #define SERIAL_MOUSE_COM1 1 |
108 | 107 | /* #define SERIAL_MOUSE_COM2 1 */ |
109 | | |
110 | 108 | |
111 | 109 | #define SERIAL_MOUSE_DRIVER_TABLE_ENTRY \ |
-
r6128a4a
|
rf05b2ac
|
|
22 | 22 | #define MODE_MAX 3 |
23 | 23 | typedef int MODE; /* drawing mode*/ |
24 | | |
25 | 24 | |
26 | 25 | /* Define one and only one of the following to be nonzero*/ |
… |
… |
|
151 | 150 | } |
152 | 151 | |
153 | | |
154 | 152 | /* Values for the data rotate register to implement drawing modes. */ |
155 | 153 | static unsigned char mode_table[MODE_MAX + 1] = { |
… |
… |
|
168 | 166 | outp(GRVAL, mode_table[mode]); |
169 | 167 | } |
170 | | |
171 | 168 | |
172 | 169 | #if VGA_ET4000 |
… |
… |
|
269 | 266 | }; |
270 | 267 | |
271 | | |
272 | 268 | /* VGA 80x25 text (BIOS mode 3). |
273 | 269 | */ |
… |
… |
|
369 | 365 | #endif |
370 | 366 | |
371 | | |
372 | 367 | #if VGA_STANDARD |
373 | 368 | |
… |
… |
|
469 | 464 | }; |
470 | 465 | |
471 | | |
472 | 466 | /* VGA 80x25 text (BIOS mode 3). |
473 | 467 | */ |
… |
… |
|
569 | 563 | #endif |
570 | 564 | |
571 | | |
572 | 565 | #if EGA_STANDARD |
573 | 566 | |
… |
… |
|
669 | 662 | }; |
670 | 663 | |
671 | | |
672 | 664 | /* EGA 80x25 text (BIOS mode 3). |
673 | 665 | */ |
-
r6128a4a
|
rf05b2ac
|
|
110 | 110 | void (*kd_mksound)(unsigned int hz, unsigned int ticks) = _kd_mksound; |
111 | 111 | |
112 | | |
113 | 112 | #define i (tmp.kb_index) |
114 | 113 | #define s (tmp.kb_table) |
… |
… |
|
145 | 144 | #undef v |
146 | 145 | |
147 | | |
148 | 146 | #define HZ 100 |
149 | 147 | |
-
r6128a4a
|
rf05b2ac
|
|
23 | 23 | #include <libchip/ide_ctrl_cfg.h> |
24 | 24 | #include <libchip/ide_ctrl_io.h> |
25 | | |
26 | 25 | |
27 | 26 | /* |
-
r6128a4a
|
rf05b2ac
|
|
38 | 38 | | $Id$ |
39 | 39 | +--------------------------------------------------------------------------*/ |
40 | | |
41 | 40 | |
42 | 41 | #ifndef __BSP_H_ |
… |
… |
|
212 | 211 | void Wait_X_ms(unsigned int timeToWait); /* from 'timer.c' */ |
213 | 212 | |
214 | | |
215 | 213 | /* Definitions for BSPConsolePort */ |
216 | 214 | #define BSP_CONSOLE_PORT_CONSOLE (-1) |
-
r6128a4a
|
rf05b2ac
|
|
25 | 25 | /* In color */ |
26 | 26 | #define V_COLOR 0xb8000 |
27 | | |
28 | 27 | |
29 | 28 | /* |
… |
… |
|
73 | 72 | #define ON 1 |
74 | 73 | |
75 | | |
76 | 74 | /* |
77 | 75 | * CRT Controller register offset definitions |
-
r6128a4a
|
rf05b2ac
|
|
64 | 64 | EXTERN (debugPollingGetChar) |
65 | 65 | EXTERN (checkCPUtypeSetCr0) |
66 | | |
67 | 66 | |
68 | 67 | /* |
-
r6128a4a
|
rf05b2ac
|
|
31 | 31 | +--------------------------------------------------------------------------*/ |
32 | 32 | |
33 | | |
34 | 33 | #include <bsp.h> |
35 | 34 | #include <rtems/libio.h> |
… |
… |
|
84 | 83 | uint32_t topAddr, val; |
85 | 84 | int i; |
86 | | |
87 | 85 | |
88 | 86 | if (rtemsFreeMemStart & (CPU_ALIGNMENT - 1)) /* not aligned => align it */ |
… |
… |
|
120 | 118 | rtemsFreeMemStart += _heap_size; /* HEAP_SIZE in KBytes */ |
121 | 119 | |
122 | | |
123 | 120 | #ifdef RTEMS_DEBUG |
124 | 121 | |
… |
… |
|
127 | 124 | #endif /* RTEMS_DEBUG */ |
128 | 125 | } /* bsp_pretasking_hook */ |
129 | | |
130 | 126 | |
131 | 127 | /*-------------------------------------------------------------------------+ |
-
r6128a4a
|
rf05b2ac
|
|
31 | 31 | +--------------------------------------------------------------------------*/ |
32 | 32 | |
33 | | |
34 | 33 | #include <stdio.h> |
35 | 34 | #include <bsp.h> |
-
r6128a4a
|
rf05b2ac
|
|
205 | 205 | .byte 0, 0x92, 0xcf, 0 |
206 | 206 | |
207 | | |
208 | 207 | /*---------------------------------------------------------------------------+ |
209 | 208 | | Descriptor of GDT |
… |
… |
|
212 | 211 | .word (3*8 - 1) |
213 | 212 | .long SYM (_Global_descriptor_table) |
214 | | |
215 | 213 | |
216 | 214 | /*---------------------------------------------------------------------------+ |
-
r6128a4a
|
rf05b2ac
|
|
39 | 39 | +--------------------------------------------------------------------------*/ |
40 | 40 | |
41 | | |
42 | 41 | #include <stdlib.h> |
43 | 42 | |
… |
… |
|
91 | 90 | } /* rdtsc */ |
92 | 91 | |
93 | | |
94 | 92 | /*-------------------------------------------------------------------------+ |
95 | 93 | | Function: Timer_exit |
… |
… |
|
105 | 103 | } /* Timer_exit */ |
106 | 104 | |
107 | | |
108 | 105 | /*-------------------------------------------------------------------------+ |
109 | 106 | | Function: Timer_initialize |
… |
… |
|
126 | 123 | Ttimer_val = rdtsc(); /* read starting time */ |
127 | 124 | } /* Timer_initialize */ |
128 | | |
129 | 125 | |
130 | 126 | /*-------------------------------------------------------------------------+ |
… |
… |
|
156 | 152 | +--------------------------------------------------------------------------*/ |
157 | 153 | #define US_PER_ISR 250 /* Number of micro-seconds per timer interruption */ |
158 | | |
159 | 154 | |
160 | 155 | /*-------------------------------------------------------------------------+ |
… |
… |
|
179 | 174 | } /* Timer_exit */ |
180 | 175 | |
181 | | |
182 | 176 | static void |
183 | 177 | timerOn(const rtems_raw_irq_connect_data* used) |
… |
… |
|
249 | 243 | } /* Timer_initialize */ |
250 | 244 | |
251 | | |
252 | 245 | /*-------------------------------------------------------------------------+ |
253 | 246 | | Function: Read_timer |
… |
… |
|
279 | 272 | #endif /* pentium */ |
280 | 273 | |
281 | | |
282 | 274 | /*-------------------------------------------------------------------------+ |
283 | 275 | | Function: Empty_function |
… |
… |
|
291 | 283 | return RTEMS_SUCCESSFUL; |
292 | 284 | } /* Empty function */ |
293 | | |
294 | 285 | |
295 | 286 | /*-------------------------------------------------------------------------+ |
… |
… |
|
319 | 310 | outport_byte(TIMER_CNTR0, (loadedValue >> 8) & 0xff); |
320 | 311 | } |
321 | | |
322 | 312 | |
323 | 313 | /*-------------------------------------------------------------------------+ |
-
r6128a4a
|
rf05b2ac
|
|
31 | 31 | +--------------------------------------------------------------------------*/ |
32 | 32 | |
33 | | |
34 | 33 | #include <rtems/asm.h> |
35 | 34 | |
-
r6128a4a
|
rf05b2ac
|
|
33 | 33 | } |
34 | 34 | |
35 | | |
36 | 35 | int main(int argc, char* argv[]) |
37 | 36 | { |
… |
… |
|
131 | 130 | } |
132 | 131 | |
133 | | |
134 | 132 | /* Copy first image out and remember its length */ |
135 | 133 | cnt = 0; |
… |
… |
|
178 | 176 | } |
179 | 177 | |
180 | | |
181 | 178 | /* Let us check agains overlapping */ |
182 | 179 | if(!(addr1 >= (headerAddr + sizeof(buf)) || (headerAddr >= addr1+size1))) |
… |
… |
|
199 | 196 | return 1; |
200 | 197 | } |
201 | | |
202 | 198 | |
203 | 199 | if(optind == (argc - 1)) |
… |
… |
|
365 | 361 | buf[0x23] = 4; |
366 | 362 | |
367 | | |
368 | 363 | /* Load address */ |
369 | 364 | buf[0x24] = addr2 & 0xff; |
-
r6128a4a
|
rf05b2ac
|
|
288 | 288 | for (;;){ |
289 | 289 | |
290 | | |
291 | 290 | rtems_bsdnet_event_receive (INTERRUPT_EVENT, |
292 | 291 | RTEMS_WAIT|RTEMS_EVENT_ANY, |
… |
… |
|
491 | 490 | } |
492 | 491 | |
493 | | |
494 | 492 | /* |
495 | 493 | * Show interface statistics |
… |
… |
|
606 | 604 | else |
607 | 605 | mtu = ETHERMTU; |
608 | | |
609 | 606 | |
610 | 607 | if (config->irno) |
-
r6128a4a
|
rf05b2ac
|
|
46 | 46 | set_debug_traps(); |
47 | 47 | |
48 | | |
49 | 48 | printf( "Remote GDB: waiting remote connection....\n" ); |
50 | 49 | |
-
r6128a4a
|
rf05b2ac
|
|
14 | 14 | #include <uart.h> |
15 | 15 | #include <assert.h> |
16 | | |
17 | 16 | |
18 | 17 | int putDebugChar(int ch); /* write a single character */ |
… |
… |
|
55 | 54 | return BSP_irq_enabled_at_i8259s(used->idtIndex - BSP_IRQ_VECTOR_BASE); |
56 | 55 | } |
57 | | |
58 | 56 | |
59 | 57 | /* |
… |
… |
|
116 | 114 | } |
117 | 115 | |
118 | | |
119 | 116 | int |
120 | 117 | putDebugChar(int ch) |
-
r6128a4a
|
rf05b2ac
|
|
465 | 465 | } |
466 | 466 | |
467 | | |
468 | 467 | /* scan for the sequence $<data>#<checksum> */ |
469 | 468 | void |
… |
… |
|
530 | 529 | |
531 | 530 | /* send the packet in buffer. */ |
532 | | |
533 | 531 | |
534 | 532 | void |
-
r6128a4a
|
rf05b2ac
|
|
19 | 19 | * |
20 | 20 | * $Log$ |
| 21 | * Revision 1.6 2004/04/21 10:42:44 ralf |
| 22 | * Remove stray white spaces. |
| 23 | * |
21 | 24 | * Revision 1.5 2001/08/16 20:52:05 joel |
22 | 25 | * 2001-08-16 Mike Siers <mikes@poliac.com> |
… |
… |
|
85 | 88 | static int isr_is_on(const rtems_irq_connect_data *); |
86 | 89 | |
87 | | |
88 | 90 | extern BSP_polling_getchar_function_type BSP_poll_char; |
89 | 91 | extern int BSPConsolePort; |
90 | 92 | extern void rtems_set_waiting_id_comx( int port, rtems_id id, rtems_event_set event ); |
91 | | |
92 | 93 | |
93 | 94 | /* |
… |
… |
|
183 | 184 | return RTEMS_SUCCESSFUL; |
184 | 185 | } /* tty_initialize */ |
185 | | |
186 | 186 | |
187 | 187 | static int tty1_last_close(int major, int minor, void *arg) |
… |
… |
|
256 | 256 | } /* tty_close */ |
257 | 257 | |
258 | | |
259 | 258 | /* |
260 | 259 | * TTY device driver READ entry point. |
… |
… |
|
268 | 267 | return rtems_termios_read (arg); |
269 | 268 | } /* tty_read */ |
270 | | |
271 | 269 | |
272 | 270 | /* |
… |
… |
|
300 | 298 | } |
301 | 299 | |
302 | | |
303 | | |
304 | 300 | /* |
305 | 301 | * Handle ioctl request for ttyS1. |
… |
… |
|
313 | 309 | return tty_control( BSP_UART_COM1, arg ); |
314 | 310 | } |
315 | | |
316 | 311 | |
317 | 312 | static int |
… |
… |
|
425 | 420 | } |
426 | 421 | |
427 | | |
428 | | |
429 | 422 | /* |
430 | 423 | * TTY2 device driver INITIALIZE entry point. |
… |
… |
|
473 | 466 | return RTEMS_SUCCESSFUL; |
474 | 467 | } /* tty_initialize */ |
475 | | |
476 | 468 | |
477 | 469 | static int tty2_last_close(int major, int minor, void *arg) |
-
r6128a4a
|
rf05b2ac
|
|
16 | 16 | * |
17 | 17 | * $Log$ |
| 18 | * Revision 1.3 2004/04/21 10:42:44 ralf |
| 19 | * Remove stray white spaces. |
| 20 | * |
18 | 21 | * Revision 1.2 2004/04/15 13:26:12 ralf |
19 | 22 | * Remove stray white spaces. |
… |
… |
|
39 | 42 | #endif |
40 | 43 | |
41 | | |
42 | 44 | /* ttyS1 entry points */ |
43 | 45 | rtems_device_driver tty1_initialize( |
… |
… |
|
59 | 61 | ); |
60 | 62 | |
61 | | |
62 | 63 | /* tty1 & tty2 shared entry points */ |
63 | 64 | rtems_device_driver tty_close( |
… |
… |
|
66 | 67 | void * |
67 | 68 | ); |
68 | | |
69 | 69 | |
70 | 70 | rtems_device_driver tty_read( |
… |
… |
|
79 | 79 | void * |
80 | 80 | ); |
81 | | |
82 | | |
83 | 81 | |
84 | 82 | /* tty2 entry points */ |
… |
… |
|
101 | 99 | ); |
102 | 100 | |
103 | | |
104 | | |
105 | 101 | #define TTY1_DRIVER_TABLE_ENTRY \ |
106 | 102 | { tty1_initialize, tty1_open, tty_close, \ |
107 | 103 | tty_read, tty_write, tty1_control } |
108 | 104 | |
109 | | |
110 | 105 | #define TTY2_DRIVER_TABLE_ENTRY \ |
111 | 106 | { tty2_initialize, tty2_open, tty_close, \ |
112 | 107 | tty_read, tty_write, tty2_control } |
113 | | |
114 | | |
115 | 108 | |
116 | 109 | #ifdef __cplusplus |
-
r6128a4a
|
rf05b2ac
|
|
147 | 147 | uwrite(uart, LCR, databits | parity | stopbits); |
148 | 148 | |
149 | | |
150 | 149 | /* Set DTR, RTS and OUT2 high */ |
151 | 150 | uwrite(uart, MCR, DTR | RTS | OUT_2); |
… |
… |
|
355 | 354 | } |
356 | 355 | |
357 | | |
358 | 356 | /* |
359 | 357 | * Polled mode write function |
… |
… |
|
443 | 441 | } |
444 | 442 | |
445 | | |
446 | 443 | /* ================ Termios support =================*/ |
447 | 444 | |
… |
… |
|
478 | 475 | } |
479 | 476 | } |
480 | | |
481 | 477 | |
482 | 478 | /* |
… |
… |
|
620 | 616 | } |
621 | 617 | |
622 | | |
623 | 618 | /* If there TX buffer is busy - something is royally screwed up */ |
624 | 619 | assert((uread(BSP_UART_COM2, LSR) & THRE) != 0); |
… |
… |
|
644 | 639 | return 0; |
645 | 640 | } |
646 | | |
647 | 641 | |
648 | 642 | void |
… |
… |
|
837 | 831 | } |
838 | 832 | |
839 | | |
840 | 833 | /* ================= GDB support ===================*/ |
841 | 834 | static int sav[4] __attribute__ ((unused)); |
… |
… |
|
919 | 912 | asm (" iret"); /* Done */ |
920 | 913 | |
921 | | |
922 | 914 | /* |
923 | 915 | * Interrupt service routine for COM2 - all, |
-
-
r6128a4a
|
rf05b2ac
|
|
64 | 64 | unsigned limit; |
65 | 65 | unsigned int level; |
66 | | |
67 | 66 | |
68 | 67 | i386_get_info_from_IDTR (&idt_entry_tbl, &limit); |
… |
… |
|
242 | 241 | segment_descriptors* gdt_entry_tbl; |
243 | 242 | |
244 | | |
245 | 243 | i386_get_info_from_GDTR (&gdt_entry_tbl, &gdt_limit); |
246 | 244 | |
-
r6128a4a
|
rf05b2ac
|
|
12 | 12 | */ |
13 | 13 | |
14 | | |
15 | 14 | #include <bsp.h> |
16 | 15 | #include <irq.h> |
… |
… |
|
138 | 137 | return (~(i8259s_cache & mask)); |
139 | 138 | } |
140 | | |
141 | 139 | |
142 | 140 | /*-------------------------------------------------------------------------+ |
… |
… |
|
205 | 203 | } |
206 | 204 | |
207 | | |
208 | 205 | /* |
209 | 206 | * This function check that the value given for the irq line |
… |
… |
|
263 | 260 | return 1; |
264 | 261 | } |
265 | | |
266 | 262 | |
267 | 263 | int BSP_get_current_rtems_irq_handler (rtems_irq_connect_data* irq) |
-
r6128a4a
|
rf05b2ac
|
|
61 | 61 | } rtems_irq_symbolic_name; |
62 | 62 | |
63 | | |
64 | | |
65 | | |
66 | 63 | /* |
67 | 64 | * Type definition for RTEMS managed interrupts |
… |
… |
|
140 | 137 | rtems_irq_prio* irqPrioTbl; |
141 | 138 | }rtems_irq_global_settings; |
142 | | |
143 | | |
144 | | |
145 | 139 | |
146 | 140 | /*-------------------------------------------------------------------------+ |
-
r6128a4a
|
rf05b2ac
|
|
131 | 131 | outb $PIC_SLAVE_IMR_IO_PORT |
132 | 132 | |
133 | | |
134 | 133 | decl SYM (_ISR_Nest_level) /* one less ISR nest level */ |
135 | 134 | /* If interrupts are nested, */ |
… |
… |
|
149 | 148 | /* while in interrupt handler? */ |
150 | 149 | je .exit /* No, exit */ |
151 | | |
152 | 150 | |
153 | 151 | .bframe: |
… |
… |
|
203 | 201 | popl eax |
204 | 202 | iret |
205 | | |
206 | 203 | |
207 | 204 | #define DISTINCT_INTERRUPT_ENTRY(_vector) \ |
-
r6128a4a
|
rf05b2ac
|
|
27 | 27 | #define PIC_EOI 0x20 /* Generic End of Interrupt (EOI) */ |
28 | 28 | |
29 | | |
30 | 29 | #endif |
-
r6128a4a
|
rf05b2ac
|
|
49 | 49 | */ |
50 | 50 | static int not_connected() {return 0;} |
51 | | |
52 | 51 | |
53 | 52 | static rtems_raw_irq_connect_data idtHdl[IDT_SIZE]; |
… |
… |
|
101 | 100 | }; |
102 | 101 | |
103 | | |
104 | | |
105 | 102 | static interrupt_gate_descriptor idtEntry; |
106 | 103 | |
… |
… |
|
130 | 127 | } |
131 | 128 | |
132 | | |
133 | 129 | _CPU_ISR_Disable(level); |
134 | 130 | |
-
r6128a4a
|
rf05b2ac
|
|
18 | 18 | * is flat and that stack is big enough |
19 | 19 | */ |
20 | | |
21 | 20 | |
22 | 21 | static int pcibInitialized = 0; |
… |
… |
|
212 | 211 | } |
213 | 212 | |
214 | | |
215 | | |
216 | | |
217 | 213 | #define PCI_MULTI_FUNCTION 0x80 |
218 | 214 | #define PCI_MAX_DEVICES 16 |
219 | 215 | #define PCI_MAX_FUNCTIONS 8 |
220 | | |
221 | 216 | |
222 | 217 | int |
… |
… |
|
274 | 269 | } |
275 | 270 | |
276 | | |
277 | | |
278 | | |
279 | 271 | /* |
280 | 272 | * Generate Special Cycle |
… |
… |
|
307 | 299 | } |
308 | 300 | |
309 | | |
310 | 301 | /* |
311 | 302 | * Read byte from config space |
… |
… |
|
345 | 336 | } |
346 | 337 | |
347 | | |
348 | 338 | /* |
349 | 339 | * Read word from config space |
… |
… |
|
383 | 373 | } |
384 | 374 | |
385 | | |
386 | 375 | /* |
387 | 376 | * Read dword from config space |
… |
… |
|
420 | 409 | return PCIB_ERR_SUCCESS; |
421 | 410 | } |
422 | | |
423 | 411 | |
424 | 412 | /* |
… |
… |
|
484 | 472 | } |
485 | 473 | |
486 | | |
487 | | |
488 | 474 | /* |
489 | 475 | * Write dword into config space |
… |
… |
|
516 | 502 | return pcib_convert_err((pcibExchg[0] >> 8) & 0xff); |
517 | 503 | } |
518 | | |
519 | 504 | |
520 | 505 | static int |
-
r6128a4a
|
rf05b2ac
|
|
77 | 77 | ClockOff, |
78 | 78 | ClockIsOn}; |
79 | | |
80 | 79 | |
81 | 80 | rtems_device_driver Clock_initialize( |
-
r6128a4a
|
rf05b2ac
|
|
31 | 31 | | $Id$ |
32 | 32 | +--------------------------------------------------------------------------*/ |
33 | | |
34 | 33 | |
35 | 34 | #include <string.h> |
… |
… |
|
71 | 70 | #define RTC_CENTURY 0x32 /* current century - increment in Dec99 */ |
72 | 71 | |
73 | | |
74 | 72 | /*-------------------------------------------------------------------------+ |
75 | 73 | | Auxiliary Functions |
… |
… |
|
108 | 106 | } /* ytos */ |
109 | 107 | |
110 | | |
111 | 108 | /*-------------------------------------------------------------------------+ |
112 | 109 | | Function: mtos |
… |
… |
|
144 | 141 | return r; |
145 | 142 | } /* rtcin */ |
146 | | |
147 | 143 | |
148 | 144 | /*-------------------------------------------------------------------------+ |
… |
… |
|
175 | 171 | printf("RTC BIOS diagnostic error %b\n", s, RTCDG_BITS); */ |
176 | 172 | } /* init_rtc */ |
177 | | |
178 | 173 | |
179 | 174 | /*-------------------------------------------------------------------------+ |
-
r6128a4a
|
rf05b2ac
|
|
159 | 159 | } /* console_initialize */ |
160 | 160 | |
161 | | |
162 | 161 | static int console_last_close(int major, int minor, void *arg) |
163 | 162 | { |
… |
… |
|
226 | 225 | } /* console_close */ |
227 | 226 | |
228 | | |
229 | 227 | /*-------------------------------------------------------------------------+ |
230 | 228 | | Console device driver READ entry point. |
… |
… |
|
248 | 246 | } /* console_read */ |
249 | 247 | |
250 | | |
251 | 248 | /*-------------------------------------------------------------------------+ |
252 | 249 | | Console device driver WRITE entry point. |
… |
… |
|
262 | 259 | |
263 | 260 | } /* console_write */ |
264 | | |
265 | | |
266 | 261 | |
267 | 262 | /* |
-
r6128a4a
|
rf05b2ac
|
|
11 | 11 | * $Id$ |
12 | 12 | */ |
13 | | |
14 | 13 | |
15 | 14 | #ifndef __TS386_h |
… |
… |
|
100 | 99 | #define MUST_WAIT_FOR_INTERRUTPT 0 |
101 | 100 | |
102 | | |
103 | 101 | #define Install_tm27_vector(handler) \ |
104 | 102 | { \ |
… |
… |
|
147 | 145 | |
148 | 146 | #define Is_tx_ready( _status ) ( (_status) & 0x40 ) |
149 | | |
150 | 147 | |
151 | 148 | #define Is_rx_ready( _status ) ( (_status) & 0x01 ) |
-
r6128a4a
|
rf05b2ac
|
|
48 | 48 | #define OCW3SDOS 0x00A0 |
49 | 49 | |
50 | | |
51 | 50 | /* CONFIGURATION Registers */ |
52 | 51 | #define DMACFG 0xF830 |
-
r6128a4a
|
rf05b2ac
|
|
49 | 49 | |
50 | 50 | PUBLIC( SYM(_init_i386ex) ) |
51 | | |
52 | 51 | |
53 | 52 | .section .initial, "ax" |
… |
… |
|
273 | 272 | SetExRegByte(TMR0 , 0x00 ) # sfa |
274 | 273 | SetExRegByte(TMR0 , 0x00 ) # sfa |
275 | | |
276 | 274 | |
277 | 275 | SetExRegByte(TMRCON , 0x70 ) # mode 0 disables on Gate= Vcc |
… |
… |
|
479 | 477 | hlt # shutdown |
480 | 478 | |
481 | | |
482 | 479 | .balign 4 # align tables to 4 byte boundary |
483 | 480 | |
… |
… |
|
488 | 485 | .word 0,0,0,0 |
489 | 486 | .endr |
490 | | |
491 | 487 | |
492 | 488 | /* |
-
r6128a4a
|
rf05b2ac
|
|
79 | 79 | bsp_libc_init((void *) heap_start, heap_size, 0); |
80 | 80 | |
81 | | |
82 | 81 | #ifdef RTEMS_DEBUG |
83 | 82 | rtems_debug_enable( RTEMS_DEBUG_ALL_MASK ); |
-
r6128a4a
|
rf05b2ac
|
|
23 | 23 | * $Id$ |
24 | 24 | */ |
25 | | |
26 | 25 | |
27 | 26 | #include <rtems.h> |
… |
… |
|
131 | 130 | } |
132 | 131 | |
133 | | |
134 | 132 | #define AVG_OVERHEAD 3 /* It typically takes 3.0 microseconds */ |
135 | 133 | /* (3 ticks) to start/stop the timer. */ |
-
r6128a4a
|
rf05b2ac
|
|
21 | 21 | void i386_stub_glue_init_breakin(void); |
22 | 22 | void set_debug_traps(void); |
23 | | |
24 | 23 | |
25 | 24 | /* Init GDB glue */ |
… |
… |
|
49 | 48 | set_debug_traps(); |
50 | 49 | |
51 | | |
52 | 50 | printk( "Remote GDB: waiting for remote connection...\n" ); |
53 | 51 | |
-
r6128a4a
|
rf05b2ac
|
|
38 | 38 | rtems_device_major_number rtems_clock_major = ~0; |
39 | 39 | rtems_device_minor_number rtems_clock_minor; |
40 | | |
41 | 40 | |
42 | 41 | /* this is later in the file to avoid it being inlined */ |
-
-
r6128a4a
|
rf05b2ac
|
|
51 | 51 | #define POLLING 0 /* polling and interrupt modes */ |
52 | 52 | |
53 | | |
54 | 53 | shm_config_table BSP_shm_cfgtbl; |
55 | 54 | |
-
-
r6128a4a
|
rf05b2ac
|
|
15 | 15 | do { _old = 0; } while(0) |
16 | 16 | |
17 | | |
18 | 17 | #define Clock_driver_support_initialize_hardware() |
19 | 18 | |
-
r6128a4a
|
rf05b2ac
|
|
11 | 11 | #define ENTRY(name) \ |
12 | 12 | _ENTRY(_C_LABEL(name)) |
13 | | |
14 | | |
15 | 13 | |
16 | 14 | ENTRY(_sys_exit) |
-
r6128a4a
|
rf05b2ac
|
|
33 | 33 | __asm__ volatile ("mov %0,fp" : : "d" (ptr)); |
34 | 34 | |
35 | | |
36 | 35 | init_Cregs(); |
37 | 36 | boot_card(); |
-
r6128a4a
|
rf05b2ac
|
|
58 | 58 | volatile unsigned int *imsk = (unsigned int *) IMSK_ADDR; |
59 | 59 | void clockHandler(); |
60 | | |
61 | 60 | |
62 | 61 | Clock_driver_ticks = 0; |
-
r6128a4a
|
rf05b2ac
|
|
42 | 42 | if ( console_pmr_init(*(uint32_t*)arg) ) |
43 | 43 | return RTEMS_INVALID_NUMBER; |
44 | | |
45 | 44 | |
46 | 45 | status = rtems_io_register_name( |
… |
… |
|
56 | 55 | } |
57 | 56 | |
58 | | |
59 | 57 | /* is_character_ready |
60 | 58 | * |
… |
… |
|
120 | 118 | outbyte( minor, '\r' ); |
121 | 119 | } |
122 | | |
123 | 120 | |
124 | 121 | /* |
-
r6128a4a
|
rf05b2ac
|
|
5 | 5 | #include "serial.h" |
6 | 6 | #include "rtems.h" |
7 | | |
8 | 7 | |
9 | 8 | typedef unsigned char uchar ; /* Abbreviations */ |
… |
… |
|
23 | 22 | }cons_input[MAX_CONSOLE]; |
24 | 23 | |
25 | | |
26 | | |
27 | 24 | /* This uses the message out and in buffers as serial emulator. |
28 | 25 | Pretty stupid eh? |
… |
… |
|
36 | 33 | static volatile unsigned int * uart_rx = { uart1_rx }; |
37 | 34 | |
38 | | |
39 | 35 | extern void display_msg(void); |
40 | 36 | /*extern int sprintf();*/ |
41 | | |
42 | | |
43 | 37 | |
44 | 38 | int |
… |
… |
|
51 | 45 | return(0); |
52 | 46 | } |
53 | | |
54 | 47 | |
55 | 48 | /* Introduce a new console channel */ |
… |
… |
|
72 | 65 | #endif |
73 | 66 | } |
74 | | |
75 | | |
76 | 67 | |
77 | 68 | /*********************************************************************** |
… |
… |
|
127 | 118 | |
128 | 119 | } |
129 | | |
130 | 120 | |
131 | 121 | /* |
… |
… |
|
306 | 296 | } |
307 | 297 | |
308 | | |
309 | 298 | void cons_isr() |
310 | 299 | { |
-
r6128a4a
|
rf05b2ac
|
|
109 | 109 | b _romExit |
110 | 110 | |
111 | | |
112 | | |
113 | 111 | SYM(led_array): |
114 | 112 | .byte 99 |
… |
… |
|
125 | 123 | .byte 0xb |
126 | 124 | .byte 0xc |
127 | | |
128 | 125 | |
129 | 126 | /* just to compile and link application XXX JOEL */ |
-
r6128a4a
|
rf05b2ac
|
|
86 | 86 | ret |
87 | 87 | |
88 | | |
89 | 88 | ######################################################################## |
90 | 89 | # |
-
r6128a4a
|
rf05b2ac
|
|
78 | 78 | bsp_libc_init((void *) heap_start, 64 * 1024, 0); |
79 | 79 | |
80 | | |
81 | 80 | #ifdef RTEMS_DEBUG |
82 | 81 | rtems_debug_enable( RTEMS_DEBUG_ALL_MASK ); |
… |
… |
|
84 | 83 | *(unsigned char *)(0x120f) = 0xf; |
85 | 84 | } |
86 | | |
87 | 85 | |
88 | 86 | /* we need to have the top of memory remembered later to start libc_init with |
… |
… |
|
133 | 131 | top_of_used_memory += (BSP_Configuration.work_space_size + 0x1000); |
134 | 132 | |
135 | | |
136 | 133 | *(unsigned char *)(0x120f) = 0x0a; |
137 | 134 | |
-
r6128a4a
|
rf05b2ac
|
|
18 | 18 | #define IMAP2 0xA90000 |
19 | 19 | #define ICON (VECTOR_CACHE | MSK_UNCHNG | I_ENABLE) |
20 | | |
21 | 20 | |
22 | 21 | /* Bus configuration */ |
… |
… |
|
44 | 43 | /*Bus Control Initial value */ |
45 | 44 | #define BCON CONF_TBL_VALID |
46 | | |
47 | | |
48 | 45 | |
49 | 46 | ControlTblEntry controlTbl[] = { |
-
r6128a4a
|
rf05b2ac
|
|
33 | 33 | #define VECTOR_CACHE (0x1<<13) |
34 | 34 | |
35 | | |
36 | | |
37 | 35 | /* BreakPoint Control Register Initial. |
38 | 36 | */ |
… |
… |
|
44 | 42 | #define PROTECT_RAM_SUP 0x4 |
45 | 43 | |
46 | | |
47 | | |
48 | 44 | #endif |
49 | 45 | /*-------------*/ |
-
r6128a4a
|
rf05b2ac
|
|
10 | 10 | #include "intrtbl.h" |
11 | 11 | /*-------------------------------------*/ |
12 | | |
13 | 12 | |
14 | 13 | /* Interrupt Table. Dedicated Interrupts are cached. |
-
r6128a4a
|
rf05b2ac
|
|
39 | 39 | #define REG_CACHE_CONFIG 0x000 |
40 | 40 | |
41 | | |
42 | 41 | struct PRCB ram_prcb = { |
43 | 42 | & faultTbl[0], /* Fault Table Base */ |
-
r6128a4a
|
rf05b2ac
|
|
18 | 18 | #define IMAP2 0xA90000 |
19 | 19 | #define ICON (VECTOR_CACHE | MSK_UNCHNG | I_ENABLE) |
20 | | |
21 | 20 | |
22 | 21 | /* Bus configuration */ |
… |
… |
|
44 | 43 | /*Bus Control Initial value */ |
45 | 44 | #define BCON CONF_TBL_VALID |
46 | | |
47 | | |
48 | 45 | |
49 | 46 | ControlTblEntry rom_controlTbl[] = { |
-
r6128a4a
|
rf05b2ac
|
|
14 | 14 | /*-------------------------------------*/ |
15 | 15 | extern void romStart(void); |
16 | | |
17 | 16 | |
18 | 17 | struct IBR rom_ibr = { |
-
r6128a4a
|
rf05b2ac
|
|
40 | 40 | #define REG_CACHE_CONFIG 0x200 |
41 | 41 | |
42 | | |
43 | 42 | struct PRCB rom_prcb = { |
44 | 43 | & faultTbl[0], /* Fault Table Base */ |
-
r6128a4a
|
rf05b2ac
|
|
112 | 112 | volatile unsigned int *imsk = (unsigned int *) IMSK_ADDR; |
113 | 113 | |
114 | | |
115 | 114 | cached_intr_tbl = (i960_isr_entry *) 0; |
116 | 115 | intr_tbl = (i960_isr_entry *) Prcb->intr_tbl; |
-
r6128a4a
|
rf05b2ac
|
|
26 | 26 | */ |
27 | 27 | |
28 | | |
29 | 28 | #include <bsp.h> |
30 | 29 | #include <stdlib.h> |
31 | 30 | #include <rtems/libio.h> |
32 | | |
33 | 31 | |
34 | 32 | #define TIMER_VECTOR 34 |
… |
… |
|
59 | 57 | *icon = 0x6000; |
60 | 58 | |
61 | | |
62 | 59 | set_vector( (((unsigned int) timerisr) | 0x2), TIMER_VECTOR, 1 ); |
63 | 60 | |
… |
… |
|
76 | 73 | |
77 | 74 | } |
78 | | |
79 | | |
80 | 75 | |
81 | 76 | rtems_isr timerisr( |
-
r6128a4a
|
rf05b2ac
|
|
24 | 24 | [set to 1 to indicate this serial port to be used as RTEMS_CONSOLE]) |
25 | 25 | |
26 | | |
27 | 26 | # Explicitly list all Makefiles here |
28 | 27 | AC_CONFIG_FILES([Makefile]) |
-
r6128a4a
|
rf05b2ac
|
|
111 | 111 | /* should enable interrupts here */ |
112 | 112 | } |
113 | | |
114 | 113 | |
115 | 114 | /* |
-
-
r6128a4a
|
rf05b2ac
|
|
123 | 123 | } |
124 | 124 | |
125 | | |
126 | 125 | /* inbyte |
127 | 126 | * |
… |
… |
|
155 | 154 | return ch; |
156 | 155 | } |
157 | | |
158 | 156 | |
159 | 157 | /* outbyte |
-
r6128a4a
|
rf05b2ac
|
|
43 | 43 | #define EDMA_BLIM_MASK 0x0007 |
44 | 44 | #define EDMA_BLIM_8ACCESS 0x0003 |
45 | | |
46 | 45 | |
47 | 46 | /* Ethernet Maximum Receive Buffer Length EMRBLR */ |
… |
… |
|
104 | 103 | |
105 | 104 | #define AR_CNTRL_MULTI_MASK (AR_CNTRL_BIT_MULTI0 | AR_CNTRL_BIT_MULTI1) |
106 | | |
107 | 105 | |
108 | 106 | /* Ethernet buffer Status TX */ |
… |
… |
|
120 | 118 | #define BUF_STAT_TO 0x4000 |
121 | 119 | #define BUF_STAT_READY 0x8000 |
122 | | |
123 | 120 | |
124 | 121 | /* Ethernet buffer Status RX */ |
… |
… |
|
281 | 278 | uchar reserved_3[0x74A]; |
282 | 279 | |
283 | | |
284 | | |
285 | 280 | /****************** 68 EN 302 specific registers **********************/ |
286 | 281 | /** only available here if |
… |
… |
|
303 | 298 | |
304 | 299 | uchar dram_reserved[0x7E8]; |
305 | | |
306 | 300 | |
307 | 301 | /* Ethernet Controller Registers */ |
… |
… |
|
388 | 382 | #define M68302imp_sccs(i) (M68302imp_ scc_regs[i].sccs) |
389 | 383 | |
390 | | |
391 | 384 | /*----------------------------------------------------------------------------*/ |
392 | 385 | |
… |
… |
|
399 | 392 | #define M68en302imp_drfrsh (M68302imp_ drfrsh) |
400 | 393 | #define M68en302imp_dba(i) (M68302imp_ dba[i]) |
401 | | |
402 | 394 | |
403 | 395 | #define M68en302imp_ecntrl (M68302imp_ ecntrl) |
… |
… |
|
518 | 510 | #define M68302_CS_READ_AND_WRITE 0x00 /* read and write memory access */ |
519 | 511 | |
520 | | |
521 | 512 | #define M68302_cs_install(cs_nb,base_add,range,nb_wait_state,read_write) \ |
522 | 513 | do { \ |
-
r6128a4a
|
rf05b2ac
|
|
159 | 159 | #define FDE 0x0020 |
160 | 160 | |
161 | | |
162 | | |
163 | 161 | /* |
164 | 162 | * standard loopback |
… |
… |
|
166 | 164 | M68302imp_port_data (1) &= ~(LBK); |
167 | 165 | M68302imp_port_data (1) |= (FDE); |
168 | | |
169 | 166 | |
170 | 167 | M68en302imp_ecntrl=0x0001; |
… |
… |
|
189 | 186 | */ |
190 | 187 | M68en302imp_intr_vect = M302_ETHER_IVECTOR; |
191 | | |
192 | 188 | |
193 | 189 | M68en302imp_intr_mask=0x0; |
… |
… |
|
233 | 229 | cam[6] = (hwaddr[4] << 8) | hwaddr[5]; |
234 | 230 | |
235 | | |
236 | 231 | /* |
237 | 232 | * Set receiver and transmitter buffer descriptor bases |
238 | 233 | */ |
239 | 234 | a_bd = M68302imp_a_eth_bd (0); /* point to first BD */ |
240 | | |
241 | 235 | |
242 | 236 | for (i=0;i<128;i++){ |
… |
… |
|
246 | 240 | M68302_scc_bd_p_buffer (a_bd + i) = NULL; |
247 | 241 | } |
248 | | |
249 | 242 | |
250 | 243 | sc->txBdBase = M68302imp_a_eth_bd ( 0 ); /* point to first BD */ |
… |
… |
|
306 | 299 | BUF_STAT_UNDERRUN)) { |
307 | 300 | int j; |
308 | | |
309 | 301 | |
310 | 302 | if (status & BUF_STAT_LATE_COLLISION) |
… |
… |
|
404 | 396 | rxBd->p_buffer = mtod (m, void *); |
405 | 397 | |
406 | | |
407 | 398 | if (++rxBdIndex == sc->rxBdCount) { |
408 | 399 | rxBd->stat_ctrl = BUF_STAT_EMPTY | BUF_STAT_INTERRUPT | BUF_STAT_WRAP; |
… |
… |
|
452 | 443 | } |
453 | 444 | } |
454 | | |
455 | 445 | |
456 | 446 | /* |
… |
… |
|
778 | 768 | m302Enet_initialize_hardware (sc); |
779 | 769 | |
780 | | |
781 | 770 | sc->txDaemonTid = rtems_bsdnet_newproc ("SCtx", 4096, scc_txDaemon, sc); |
782 | 771 | sc->rxDaemonTid = rtems_bsdnet_newproc ("SCrx", 4096, scc_rxDaemon, sc); |
… |
… |
|
821 | 810 | |
822 | 811 | } |
823 | | |
824 | 812 | |
825 | 813 | /* |
… |
… |
|
904 | 892 | } |
905 | 893 | |
906 | | |
907 | 894 | /* |
908 | 895 | * Attach an SCC driver to the system |
-
r6128a4a
|
rf05b2ac
|
|
41 | 41 | .set FLASH_BASE, 0xc00000 | start of FLASH''s normal location |
42 | 42 | |
43 | | |
44 | 43 | BEGIN_CODE |
45 | 44 | PUBLIC (M68Kvec) | Vector Table |
… |
… |
|
233 | 232 | END_CODE |
234 | 233 | |
235 | | |
236 | 234 | BEGIN_DATA |
237 | 235 | |
… |
… |
|
258 | 256 | .set SYM (stack_size),0x1000 |
259 | 257 | |
260 | | |
261 | 258 | END_DATA |
262 | 259 | END |
-
r6128a4a
|
rf05b2ac
|
|
20 | 20 | */ |
21 | 21 | |
22 | | |
23 | 22 | #include <rtems.h> |
24 | 23 | #include <bsp.h> |
25 | 24 | #include <rtems/m68k/m68302.h> |
26 | | |
27 | 25 | |
28 | 26 | #define TMR2_VAL 0x071b /* Timer mode register |
… |
… |
|
111 | 109 | } |
112 | 110 | |
113 | | |
114 | 111 | /* |
115 | 112 | * Empty function call used in loops to measure basic cost of looping |
-
r6128a4a
|
rf05b2ac
|
|
15 | 15 | * $Id$ |
16 | 16 | */ |
17 | | |
18 | 17 | |
19 | 18 | #include <rtems/asm.h> |
… |
… |
|
76 | 75 | movew a7@(SAVED+FVO_OFFSET),d0 | d0 = F/VO |
77 | 76 | andl #0x0fff,d0 | d0 = vector offset in vbr |
78 | | |
79 | 77 | |
80 | 78 | #if ( CPU_HAS_SOFTWARE_INTERRUPT_STACK == 1 ) |
… |
… |
|
148 | 146 | beq Debug_exit | No, then Debug_exit |
149 | 147 | |
150 | | |
151 | 148 | bframe: clrl SYM (_ISR_Signals_to_thread_executing) |
152 | 149 | | If sent, will be processed |
-
-
r6128a4a
|
rf05b2ac
|
|
623 | 623 | /* move.b #0x3F,crt0_pdcs pour test */ |
624 | 624 | |
625 | | |
626 | 625 | /*---------------------------------------*/ |
627 | 626 | /* -- EPLD chip-select initialization -- */ |
… |
… |
|
720 | 719 | move.l #68349,crt0_cpu_type |
721 | 720 | |
722 | | |
723 | 721 | /* -- jump back to PROM -- */ |
724 | 722 | |
… |
… |
|
762 | 760 | move.b #0,crt0_csswitch | CPU |
763 | 761 | move.b #1,crt0_buswidth | 16 bits |
764 | | |
765 | 762 | |
766 | 763 | /*------------------------------------------------- |
-
r6128a4a
|
rf05b2ac
|
|
336 | 336 | _crt0_init_stktop: |
337 | 337 | |
338 | | |
339 | 338 | BEGIN_CODE |
340 | 339 | dc.l _crt0_init_stktop /* reset SP */ |
-
r6128a4a
|
rf05b2ac
|
|
859 | 859 | } |
860 | 860 | |
861 | | |
862 | 861 | /* |
863 | 862 | * Show interface statistics |
-
r6128a4a
|
rf05b2ac
|
|
59 | 59 | */ |
60 | 60 | |
61 | | |
62 | 61 | /* |
63 | 62 | * Allocate the memory for the RTEMS Work Space. This can come from |
-
r6128a4a
|
rf05b2ac
|
|
48 | 48 | rtems_device_major_number rtems_clock_major = ~0; |
49 | 49 | rtems_device_minor_number rtems_clock_minor; |
50 | | |
51 | 50 | |
52 | 51 | /* |
-
r6128a4a
|
rf05b2ac
|
|
75 | 75 | } |
76 | 76 | |
77 | | |
78 | 77 | /* is_character_ready |
79 | 78 | * |
… |
… |
|
146 | 145 | return tmp_char; |
147 | 146 | } |
148 | | |
149 | 147 | |
150 | 148 | /* outbyte |
-
r6128a4a
|
rf05b2ac
|
|
153 | 153 | MC68681_WRITE(DUART_ADDR, MC68681_CLOCK_SELECT_REG_B, MC68681_BAUD_RATE_MASK_9600); |
154 | 154 | |
155 | | |
156 | 155 | #define EIGHT_BITS_NO_PARITY |
157 | 156 | #ifdef EIGHT_BITS_NO_PARITY |
… |
… |
|
168 | 167 | (MC68681_WITH_PARITY | MC68681_7BIT_CHARS) ); |
169 | 168 | #endif |
170 | | |
171 | 169 | |
172 | 170 | /* |
… |
… |
|
247 | 245 | } |
248 | 246 | |
249 | | |
250 | 247 | /*##################################################################### |
251 | 248 | # This is the routine that actually transmits a character one at a time |
-
r6128a4a
|
rf05b2ac
|
|
79 | 79 | M68Kvec[ index ] = monitors_vector_table[ 32 ]; |
80 | 80 | |
81 | | |
82 | 81 | M68Kvec[ 2 ] = monitors_vector_table[ 2 ]; /* bus error vector */ |
83 | 82 | M68Kvec[ 4 ] = monitors_vector_table[ 4 ]; /* breakpoints vector */ |
-
-
r6128a4a
|
rf05b2ac
|
|
21 | 21 | #include "mcf5206/mcf5206e.h" |
22 | 22 | #include "mcf5206/mcfuart.h" |
23 | | |
24 | 23 | |
25 | 24 | /* Descriptor structures for two on-chip UART channels */ |
-
r6128a4a
|
rf05b2ac
|
|
156 | 156 | } |
157 | 157 | |
158 | | |
159 | 158 | /* i2c_write -- |
160 | 159 | * Send single message over specified I2C bus to addressed device and |
-
r6128a4a
|
rf05b2ac
|
|
79 | 79 | /* Forward function declaration */ |
80 | 80 | static void i2cdrv_unload(void); |
81 | | |
82 | 81 | |
83 | 82 | /* i2cdrv_done -- |
… |
… |
|
190 | 189 | } |
191 | 190 | |
192 | | |
193 | 191 | /* i2cdrv_initialize -- |
194 | 192 | * I2C driver initialization (rtems I/O driver primitive) |
… |
… |
|
250 | 248 | } |
251 | 249 | |
252 | | |
253 | 250 | /* i2c_poll -- |
254 | 251 | * Poll I2C bus controller for events and hanle it. This function is |
-
-
r6128a4a
|
rf05b2ac
|
|
25 | 25 | #include <i2c.h> |
26 | 26 | #include <ds1307.h> |
27 | | |
28 | 27 | |
29 | 28 | /* nvram_driver_initialize -- |
-
-
r6128a4a
|
rf05b2ac
|
|
60 | 60 | #define mcf5206e_enable_cache() \ |
61 | 61 | m68k_set_cacr( MCF5206E_CACR_CENB ) |
62 | | |
63 | 62 | |
64 | 63 | #define mcf5206e_disable_cache() \ |
-
r6128a4a
|
rf05b2ac
|
|
139 | 139 | rtems_termios_initialize(); |
140 | 140 | |
141 | | |
142 | 141 | /* |
143 | 142 | * register the SCI device name for termios |
… |
… |
|
151 | 150 | rtems_fatal_error_occurred(status); |
152 | 151 | } |
153 | | |
154 | 152 | |
155 | 153 | /* |
-
r6128a4a
|
rf05b2ac
|
|
37 | 37 | * |
38 | 38 | * $Log$ |
| 39 | * Revision 1.7 2004/04/21 10:42:52 ralf |
| 40 | * Remove stray white spaces. |
| 41 | * |
39 | 42 | * Revision 1.6 2004/04/15 13:26:13 ralf |
40 | 43 | * Remove stray white spaces. |
… |
… |
|
167 | 170 | #define SCI_MINOR 0 // minor device number |
168 | 171 | |
169 | | |
170 | 172 | // IMPORTANT - if the device driver api is opened, it means the sci is being |
171 | 173 | // used for direct hardware access, so other users (like termios) get ignored |
… |
… |
|
173 | 175 | #define DRIVER_CLOSED 0 // the device driver api is closed |
174 | 176 | #define DRIVER_OPENED 1 // the device driver api is opened |
175 | | |
176 | 177 | |
177 | 178 | // system clock definitions, i dont have documentation on this... |
… |
… |
|
197 | 198 | |
198 | 199 | |
199 | | |
200 | 200 | /***************************************************************************** |
201 | 201 | Section D - External Functions |
… |
… |
|
275 | 275 | static struct rtems_termios_tty *SciTermioTty; |
276 | 276 | |
277 | | |
278 | 277 | static uint8_t SciInited = 0; // has the driver been inited |
279 | 278 | |
… |
… |
|
300 | 299 | |
301 | 300 | #endif |
302 | | |
303 | 301 | |
304 | 302 | // cvs id string so you can use the unix ident command on the object |
… |
… |
|
349 | 347 | }; |
350 | 348 | |
351 | | |
352 | 349 | /***************************************************************************** |
353 | 350 | Section I - RTEMS termios callbacks for the polled version of the driver |
… |
… |
|
375 | 372 | ///////////////////////////////////////////////////////////////////////////// |
376 | 373 | |
377 | | |
378 | 374 | /**************************************************************************** |
379 | 375 | * Func: SCI_output_char |
… |
… |
|
433 | 429 | uint8_t ch; |
434 | 430 | |
435 | | |
436 | 431 | if ( (*SCSR) & SCI_ERROR_PARITY ) SciErrorsParity ++; |
437 | 432 | if ( (*SCSR) & SCI_ERROR_FRAMING ) SciErrorsFraming ++; |
438 | 433 | if ( (*SCSR) & SCI_ERROR_NOISE ) SciErrorsNoise ++; |
439 | 434 | if ( (*SCSR) & SCI_ERROR_OVERRUN ) SciErrorsOverrun ++; |
440 | | |
441 | 435 | |
442 | 436 | // see if it was a transmit interrupt |
… |
… |
|
489 | 483 | ///////////////////////////////////////////////////////////////////////////// |
490 | 484 | |
491 | | |
492 | 485 | /**************************************************************************** |
493 | 486 | * Func: SciRcvBufGetChar |
… |
… |
|
524 | 517 | return ch; // return the char |
525 | 518 | } |
526 | | |
527 | 519 | |
528 | 520 | |
… |
… |
|
601 | 593 | // |
602 | 594 | ///////////////////////////////////////////////////////////////////////////// |
603 | | |
604 | 595 | |
605 | 596 | /**************************************************************************** |
… |
… |
|
653 | 644 | SciSetDataBits(SCI_8_DATA_BITS); // set data bits to 8 |
654 | 645 | |
655 | | |
656 | 646 | // Install our interrupt handler into RTEMS, where does 66 come from? |
657 | 647 | |
… |
… |
|
799 | 789 | } |
800 | 790 | |
801 | | |
802 | 791 | // set the number of data bits, 8 is most common |
803 | 792 | |
… |
… |
|
815 | 804 | } |
816 | 805 | |
817 | | |
818 | 806 | // the number of stop bits; always 1 for SCI |
819 | 807 | |
… |
… |
|
823 | 811 | } |
824 | 812 | |
825 | | |
826 | 813 | // setup the hardware with these serial port parameters |
827 | 814 | |
… |
… |
|
831 | 818 | |
832 | 819 | SciSetDataBits(sci_databits); // set the data bits |
833 | | |
834 | 820 | |
835 | 821 | return RTEMS_SUCCESSFUL; |
… |
… |
|
1003 | 989 | // |
1004 | 990 | ///////////////////////////////////////////////////////////////////////////// |
1005 | | |
1006 | 991 | |
1007 | 992 | /**************************************************************************** |
… |
… |
|
1026 | 1011 | //printk("%s\r\n", __FUNCTION__); |
1027 | 1012 | |
1028 | | |
1029 | 1013 | // register the SCI device name for termios console i/o |
1030 | 1014 | // this is done over in console.c which doesn't seem exactly right |
… |
… |
|
1036 | 1020 | // rtems_fatal_error_occurred(status); |
1037 | 1021 | |
1038 | | |
1039 | 1022 | SciMajor = major; // save the rtems major number |
1040 | 1023 | |
1041 | 1024 | SciOpened = DRIVER_CLOSED; // initial state is closed |
1042 | 1025 | |
1043 | | |
1044 | 1026 | // if you have an interrupt handler, install it here |
1045 | | |
1046 | 1027 | |
1047 | 1028 | SciInited = 1; // set the inited flag |
… |
… |
|
1158 | 1139 | rw_args = (rtems_libio_rw_args_t *) arg; // arguments to read() |
1159 | 1140 | |
1160 | | |
1161 | 1141 | if (minor != SCI_MINOR) |
1162 | 1142 | { |
… |
… |
|
1313 | 1293 | ///////////////////////////////////////////////////////////////////////////// |
1314 | 1294 | |
1315 | | |
1316 | 1295 | /**************************************************************************** |
1317 | 1296 | * Func: SciSetBaud |
… |
… |
|
1330 | 1309 | // when you open the console you need to set the termio struct baud rate |
1331 | 1310 | // it has a default value of 9600, when someone calls tcsetattr it reverts! |
1332 | | |
1333 | 1311 | |
1334 | 1312 | SciBaud = rate; // save the rate |
… |
… |
|
1536 | 1514 | } |
1537 | 1515 | |
1538 | | |
1539 | 1516 | /**************************************************************************** |
1540 | 1517 | * Func: SciWriteCharNoWait |
… |
… |
|
1592 | 1569 | } |
1593 | 1570 | |
1594 | | |
1595 | 1571 | /**************************************************************************** |
1596 | 1572 | * Func: SciReadCharNoWait |
… |
… |
|
1615 | 1591 | return ch; // return the char |
1616 | 1592 | } |
1617 | | |
1618 | 1593 | |
1619 | 1594 | |
… |
… |
|
1669 | 1644 | ///////////////////////////////////////////////////////////////////////////// |
1670 | 1645 | |
1671 | | |
1672 | 1646 | /**************************************************************************** |
1673 | 1647 | * Func: SciUnitTest |
… |
… |
|
1687 | 1661 | uint16_t result; // result of ioctl |
1688 | 1662 | |
1689 | | |
1690 | 1663 | fd = open("/dev/sci",O_RDWR); // open the device |
1691 | 1664 | |
1692 | 1665 | printk("SCI open fd=%d\r\n",fd); |
1693 | 1666 | |
1694 | | |
1695 | 1667 | result = write(fd, "abcd\r\n", 6); // send a string |
1696 | 1668 | |
1697 | 1669 | printk("SCI write result=%d\r\n",result); |
1698 | | |
1699 | 1670 | |
1700 | 1671 | result = read(fd, &byte, 1); // read a byte |
-