1 | This is a README file for the MBX860/MBX821 port of RTEMS 4.5.0 |
---|
2 | |
---|
3 | Please send any comments, improvements, or bug reports to: |
---|
4 | |
---|
5 | Darlene A. Stewart |
---|
6 | Software Engineering Group |
---|
7 | Institute for Information Technology |
---|
8 | National Research Council of Canada |
---|
9 | Ottawa, ON, K1A 0R6 |
---|
10 | Canada |
---|
11 | |
---|
12 | Darlene.Stewart@nrc.ca |
---|
13 | |
---|
14 | |
---|
15 | |
---|
16 | Disclaimer |
---|
17 | ---------- |
---|
18 | |
---|
19 | The National Research Council of Canada is distributing this RTEMS |
---|
20 | board support package for the Motorola MBX860 and MBX821 as free |
---|
21 | software; you can redistribute it and/or modify it under terms of |
---|
22 | the GNU General Public License as published by the Free Software |
---|
23 | Foundation; either version 2, or (at your option) any later version. |
---|
24 | This software is distributed in the hope that it will be useful, but |
---|
25 | WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
26 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
27 | General Public License for more details. You should have received a |
---|
28 | copy of the GNU General Public License along with RTEMS; see file |
---|
29 | COPYING. If not, write to the Free Software Foundation, 675 Mass Ave, |
---|
30 | Cambridge, MA 02139, USA. |
---|
31 | |
---|
32 | Under no circumstances will the National Research Council of Canada |
---|
33 | nor Her Majesty the Queen in right of Canada assume any liablility |
---|
34 | for the use this software, nor any responsibility for its quality or |
---|
35 | its support. |
---|
36 | |
---|
37 | |
---|
38 | Summary |
---|
39 | ------- |
---|
40 | |
---|
41 | BSP NAME: mbx8xx |
---|
42 | BOARD: Motorola MBX860 and MBX821 Embedded Controllers |
---|
43 | BUS: No backplane. On-board ISA, PCI, PC/104 and PCMCIA. |
---|
44 | CPU FAMILY: PowerPC |
---|
45 | CPU: PowerPC MPC860 or MPC821 |
---|
46 | COPROCESSORS: Built-in Motorola QUICC |
---|
47 | MODE: 32 bit mode |
---|
48 | |
---|
49 | DEBUG MONITOR: EPPC-Bug |
---|
50 | |
---|
51 | PERIPHERALS |
---|
52 | =========== |
---|
53 | TIMERS: PIT / Timebase |
---|
54 | RESOLUTION: 1 microsecond / frequency = clock-speed / 16 |
---|
55 | SERIAL PORTS: 2 or 4 SCCs (SCC1 is hardwired for Ethernet) |
---|
56 | 2 SMC |
---|
57 | 1 SIO |
---|
58 | REAL-TIME CLOCK: Many. Look at documentation. |
---|
59 | DMA: Each SCC and SMC. |
---|
60 | VIDEO: None on-board. MPC821 has a built-in LCD panel driver. |
---|
61 | SCSI: None on-board. |
---|
62 | NETWORKING: Ethernet (10 Mbps) on SCC1 |
---|
63 | |
---|
64 | |
---|
65 | DRIVER INFORMATION |
---|
66 | ================== |
---|
67 | CLOCK DRIVER: yes |
---|
68 | CONSOLE DRIVER: yes |
---|
69 | SHMSUPP: N/A |
---|
70 | TIMER DRIVER: yes |
---|
71 | NETWORK DRIVER: yes |
---|
72 | |
---|
73 | NOTES |
---|
74 | ===== |
---|
75 | On-chip resources: |
---|
76 | SCC1 network or console |
---|
77 | SCC2 serial port |
---|
78 | SMC1 gdb debug console/application console |
---|
79 | SMC2 application console |
---|
80 | CLK1 network |
---|
81 | CLK2 network |
---|
82 | CLK3 |
---|
83 | CLK4 |
---|
84 | CLK5 |
---|
85 | CLK6 |
---|
86 | CLK7 |
---|
87 | CLK8 |
---|
88 | BRG1 console |
---|
89 | BRG2 console |
---|
90 | BRG3 console |
---|
91 | BRG4 console |
---|
92 | RTC |
---|
93 | PIT clock |
---|
94 | TB |
---|
95 | DEC |
---|
96 | SWT |
---|
97 | *CS0 FLASH |
---|
98 | *CS1 DRAM bank (onboard) |
---|
99 | *CS2 DRAM bank 0 (1st half of DIMM) |
---|
100 | *CS3 DRAM bank 1 (2nd half of DIMM) |
---|
101 | *CS4 Battery-Backed SRAM |
---|
102 | *CS5 QSPAN PCI |
---|
103 | *CS6 QSPAN |
---|
104 | *CS7 Boot ROM |
---|
105 | UPMA |
---|
106 | UPMB |
---|
107 | IRQ0 |
---|
108 | IRQ1 |
---|
109 | IRQ2 |
---|
110 | IRQ3 |
---|
111 | IRQ4 |
---|
112 | IRQ5 |
---|
113 | IRQ6 |
---|
114 | IRQ7 |
---|
115 | IRQ_LVL0 |
---|
116 | IRQ_LVL1 |
---|
117 | IRQ_LVL2 |
---|
118 | IRQ_LVL3 |
---|
119 | IRQ_LVL4 |
---|
120 | IRQ_LVL5 |
---|
121 | IRQ_LVL6 |
---|
122 | IRQ_LVL7 |
---|
123 | |
---|
124 | |
---|
125 | Board description |
---|
126 | ----------------- |
---|
127 | Clock rate: 50MHz Entry level boards, 40 MHz others. |
---|
128 | Bus width: 8/32 bit Flash, 32 bit DRAM |
---|
129 | FLASH: 2-4MB, 120ns |
---|
130 | RAM: 4-16MB EDO, 60ns DRAM DIMM |
---|
131 | |
---|
132 | |
---|
133 | Installation |
---|
134 | ------------ |
---|
135 | |
---|
136 | All MBX821/MBX860 ports share the same source code base. The MPC821 does |
---|
137 | not have SCC3 and SCC4. Instead, it has an LCD panel driver. Otherwise, |
---|
138 | the MBX821 and MBX860 boards are essentially identical. Entry level boards |
---|
139 | do not have all connectors and peripheral devices present. This has no |
---|
140 | impact on the source code base; it merely means that some functionality |
---|
141 | is not available on these entry level boards. For the most part, the port |
---|
142 | uses the standard build process for powerpc targets. However, you must |
---|
143 | specify the EXACT model of MBX board that you are building for as the |
---|
144 | argument to the RTEMS_BSP make variable. If you do not, the build process |
---|
145 | will build for a MBX860-002. Look at rtems/make/custom/mbx8xx.cfg for the |
---|
146 | specific list of boards supported and their corresponding names. An |
---|
147 | example build command is: |
---|
148 | |
---|
149 | make RTEMS_BSP=mbx821_001 all debug |
---|
150 | |
---|
151 | This will build the optimized and debug versions of all RTEMS libraries, |
---|
152 | samples and tests (if the latter are enabled). |
---|
153 | |
---|
154 | The Software Engineering Group of the Institute for Information Technology |
---|
155 | only owns an MBX821-001 and MBX86-002. The only provided config files are |
---|
156 | mbx821_001.cfg and mbx860_002.cfg. A SPECIFIC CONFIG FILE IS REQUIRED. Use |
---|
157 | one of the provided files as a template to create a specific config file for |
---|
158 | another model. |
---|
159 | |
---|
160 | We rely on EPPC-BUG to download to the targets. We use the 'PLH" command. |
---|
161 | We enabled a TFTP deamon on our development host. |
---|
162 | |
---|
163 | |
---|
164 | Port Description |
---|
165 | Console driver |
---|
166 | --------------- |
---|
167 | |
---|
168 | This BSP includes an termios-capable console driver that supports SMC1, |
---|
169 | SMC2, SCC2, and SCC3 and SCC4 if present. The RTEMS console is selected |
---|
170 | in rtems/make/custom/mbx8xx.cfg with the CONSOLE_MINOR variable. We |
---|
171 | normally run with the RTEMS application console on SMC1. |
---|
172 | |
---|
173 | Support is provided for polled and interrupt-driven terminal I/O. Interrupt- |
---|
174 | driven I/O is selected by setting the UARTS_USE_INTERRUPTS variable in |
---|
175 | rtems/make/custom/mbx8xx.cfg. If the variable is not set, or if it is set |
---|
176 | to zero, polled I/O is used. If the EPPCBUG_SMC1 variable is set in |
---|
177 | rtems/make/custom/mbx8xx.cfg, SMC1 will be used in polled mode with all |
---|
178 | I/O done by EPPC-Bug rather than the supplied device driver. This mode |
---|
179 | should be used if the application console is shared with EPPC-Bug. |
---|
180 | |
---|
181 | Polled I/O must be used when running the timing tests. It must also be used |
---|
182 | to run some other tests and some samples, such as the cdtest. Applications |
---|
183 | would normally use interrupt-driven I/O. |
---|
184 | |
---|
185 | |
---|
186 | EPPC-Bug and I/O |
---|
187 | ---------------- |
---|
188 | |
---|
189 | Be warned that when EPPC-Bug does I/O through a serial port, all interrupts |
---|
190 | get turned off in the SIMASK register! This is a definite bug in release 1.1 |
---|
191 | of the firmware. It may have been fixed in later releases. |
---|
192 | |
---|
193 | To solve this problem that occurs when GDB communicates with EPPC-Bug, |
---|
194 | whenever the BSP manipulates the SIMASK, it makes copy of the written |
---|
195 | in a global variable called 'simask_copy'. That value must be restored by |
---|
196 | GDB before execution resumes. The following commands placed in the .gdbinit |
---|
197 | file takes care of this: |
---|
198 | |
---|
199 | # GDB Initialization file for EPPCBug. |
---|
200 | |
---|
201 | define hook-stepi |
---|
202 | set language c |
---|
203 | set *(int *)0xFA200014=simask_copy |
---|
204 | set language auto |
---|
205 | end |
---|
206 | |
---|
207 | define hook-step |
---|
208 | set language c |
---|
209 | set *(int *)0xFA200014=simask_copy |
---|
210 | set language auto |
---|
211 | end |
---|
212 | |
---|
213 | define hook-continue |
---|
214 | set language c |
---|
215 | set *(int *)0xFA200014=simask_copy |
---|
216 | set language auto |
---|
217 | end |
---|
218 | |
---|
219 | define hook-nexti |
---|
220 | set language c |
---|
221 | set *(int *)0xFA200014=simask_copy |
---|
222 | set language auto |
---|
223 | end |
---|
224 | |
---|
225 | define hook-next |
---|
226 | set language c |
---|
227 | set *(int *)0xFA200014=simask_copy |
---|
228 | set language auto |
---|
229 | end |
---|
230 | |
---|
231 | define hook-finish |
---|
232 | set language c |
---|
233 | set *(int *)0xFA200014=simask_copy |
---|
234 | set language auto |
---|
235 | end |
---|
236 | |
---|
237 | |
---|
238 | Floating-point |
---|
239 | -------------- |
---|
240 | |
---|
241 | The MPC860 and MPC821 do not have floating-point units. All code should |
---|
242 | get compiled with the appropriate -mcpu flag. The nof variants of the gcc |
---|
243 | runtime libraries should be used for linking. |
---|
244 | |
---|
245 | |
---|
246 | Miscellaneous |
---|
247 | ------------- |
---|
248 | |
---|
249 | All development was based on the eth_comm port. |
---|
250 | |
---|
251 | |
---|
252 | Host System |
---|
253 | ----------- |
---|
254 | |
---|
255 | 12345678901234567890123456789012345678901234567890123456789012345678901234567890 |
---|
256 | The port was developed on Pentiums II and III running RedHat Linux 6.0 and |
---|
257 | 6.1. The following tools were used: |
---|
258 | |
---|
259 | - GNU gcc snapshot dated 19991208 configured for powerpc-rtems; |
---|
260 | - GNU binutils 2.9.1 configured for powerpc-rtems; |
---|
261 | |
---|
262 | Gcc 2.95.2 also worked. Gcc 2.95.1 will not compile the console driver with |
---|
263 | -O4 or -O3. Compile it manually with -O2. |
---|
264 | |
---|
265 | |
---|
266 | Known Problems |
---|
267 | -------------- |
---|
268 | |
---|
269 | The cdtest will not run with interrupt-driven I/O. The reason is that the |
---|
270 | constructors for the static objects are called at boot time when the |
---|
271 | interrupts are still disabled. The output buffer fills up, but never empties, |
---|
272 | and the application goes into an infinite loop waiting for buffer space. This |
---|
273 | should have been documented in the rtems/c/src/tests/PROBLEMS file. The moral |
---|
274 | of this story is: do not do I/O from the constructors or destructors of static |
---|
275 | objects. |
---|
276 | |
---|
277 | The cpuuse and malloctest tests do not work properly, either with polled I/O |
---|
278 | or interrupt-driven I/O. They are known not to work with interrupt-driven I/O, |
---|
279 | but should work with polled I/O? |
---|
280 | |
---|
281 | Output stops prematurely in the termios test when the console is operating in |
---|
282 | interrupt-driven mode because the serial port is re-initialized before all |
---|
283 | characters in the last raw output buffer are sent. Adding calls to tcdrain() |
---|
284 | in the test task helps, but it does not solve the problem. What happens is |
---|
285 | that the CD2401 raises a transmit interrupt when the last character in the |
---|
286 | DMA buffer is written into the transmit FIFO, not when the last character |
---|
287 | has been transmitted. When tcdrain() returns, there might be up to 16 |
---|
288 | characters in the output FIFO. The call to tcsetattr() causes the serial port |
---|
289 | to re-initialize, at which point the output FIFO is cleared. We could not find |
---|
290 | a way to detect whether characters are still in the FIFO and to wait for them |
---|
291 | to be transmitted. |
---|
292 | |
---|
293 | The first raw buffer to be transmitted after the console is re-initialized |
---|
294 | with tcsetattr() is garbled. At this time, it does not seem worth while to |
---|
295 | track this problem down. |
---|
296 | |
---|
297 | In the stackchk test, an access fault exception is raised after the stack is |
---|
298 | blown. This is one case were overwritting the first or last 16 bytes of the |
---|
299 | stack does cause problems (but hey, an exception occurred, which is better |
---|
300 | than propagating the error). |
---|
301 | |
---|
302 | In the stackchk test, an access fault exception is raised after the stack is |
---|
303 | blown. This is one case were overwritting the first or last 16 bytes of the |
---|
304 | stack does cause problems (but hey, an exception occurred, which is better |
---|
305 | than propagating the error). |
---|
306 | |
---|
307 | When using interrupt-driven I/O, psx08 produces all the expected output, but |
---|
308 | it does not return control to 167Bug. Is this test supposed to work with |
---|
309 | interrupt-driven console I/O? |
---|
310 | |
---|
311 | |
---|
312 | What's new |
---|
313 | ---------- |
---|
314 | |
---|
315 | All known problems with use of the caches on the MBX860-002 and MBX821-001 |
---|
316 | have been resolved. |
---|
317 | |
---|
318 | |
---|
319 | Thanks |
---|
320 | ------ |
---|
321 | |
---|
322 | - to Jay Monkman (jmonkman@frasca.com) of Frasca International, Inc. |
---|
323 | for his eth_comm port. |
---|
324 | |
---|
325 | - to On-Line Applications Research Corporation (OAR) for developing |
---|
326 | RTEMS and making it available on a Technology Transfer basis; |
---|
327 | |
---|
328 | - to the FSF and to Cygnus Support for great free software; |
---|
329 | |
---|
330 | |
---|
331 | Test Configuration |
---|
332 | ------------------ |
---|
333 | |
---|
334 | Board: MBX821-001, MBX860-002 |
---|
335 | CPU: Motorola MPC821, MPC860 |
---|
336 | Clock Speed: 50 MHz, 40 MHz |
---|
337 | RAM: 4 MBytes of 32-bit DRAM |
---|
338 | Cache Configuration: Instruction cache on; data cache on, copyback mode. |
---|
339 | Times Reported in: clock ticks: TMBCLK = system clock / 16. |
---|
340 | Timer Source: Timebase clock |
---|
341 | GCC Flags: -O4 -fno-keep-inline-functions -mcpu=(821/860) |
---|
342 | Console: Operates in polled mode on SMC2. No I/O through EPPC-Bug. |
---|
343 | |
---|
344 | |
---|
345 | Test Results |
---|
346 | ------------ |
---|
347 | |
---|
348 | Single processor tests: All tests passed, except the following ones: |
---|
349 | |
---|
350 | - paranoia required the FPSP and the default variants of libm (and libc and |
---|
351 | libgcc) for us. It may work with the msoft-float variants for you, but it |
---|
352 | does require the FPSP. |
---|
353 | |
---|
354 | - cpuuse and malloctest did not work. |
---|
355 | |
---|
356 | - The stackchk test got an access fault exception before the RTEMS stack |
---|
357 | checker had had a chance to detect the corrupted stack. |
---|
358 | |
---|
359 | |
---|
360 | Multi-processort tests: not applicable -- No MPCI layer yet. |
---|
361 | |
---|
362 | |
---|
363 | Timing tests: |
---|
364 | See the times-mbx821 and times-860 files for the results of the |
---|
365 | timing tests. |
---|
366 | |
---|
367 | |
---|
368 | Network tests: |
---|
369 | Network driver is being implemented. |
---|
370 | |
---|
371 | |
---|
372 | |
---|