summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/powerpc/mbx8xx/README
blob: 7a1c9fe5b2619f4983818588be4b299bb4f9de80 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
This is a README file for the MBX860/MBX821 port of RTEMS 4.5.0

Please send any comments, improvements, or bug reports to:

Darlene A. Stewart
Software Engineering Group
Institute for Information Technology
National Research Council of Canada
Ottawa, ON, K1A 0R6
Canada

Darlene.Stewart@nrc.ca
  


Disclaimer
----------

The National Research Council of Canada is distributing this RTEMS
board support package for the Motorola MBX860 and MBX821 as free
software; you can redistribute it and/or modify it under terms of
the GNU General Public License as published by the Free Software
Foundation; either version 2, or (at your option) any later version.
This software is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details. You should have received a
copy of the GNU General Public License along with RTEMS; see file
COPYING. If not, write to the Free Software Foundation, 675 Mass Ave,
Cambridge, MA 02139, USA.

Under no circumstances will the National Research Council of Canada
nor Her Majesty the Queen in right of Canada assume any liablility
for the use this software, nor any responsibility for its quality or
its support.


Summary
-------

BSP NAME:           mbx8xx
BOARD:              Motorola MBX860 and MBX821 Embedded Controllers
BUS:                No backplane. On-board ISA, PCI, PC/104 and PCMCIA.
CPU FAMILY:         PowerPC
CPU:                PowerPC MPC860 or MPC821
COPROCESSORS:       Built-in Motorola QUICC
MODE:               32 bit mode

DEBUG MONITOR:      EPPC-Bug

PERIPHERALS
===========
TIMERS:             PIT / Timebase
  RESOLUTION:       1 microsecond / frequency = clock-speed / 16
SERIAL PORTS:       2 or 4 SCCs (SCC1 is hardwired for Ethernet)
                    2 SMC
                    1 SIO
REAL-TIME CLOCK:    Many. Look at documentation.
DMA:                Each SCC and SMC.
VIDEO:              None on-board. MPC821 has a built-in LCD panel driver.
SCSI:               None on-board.
NETWORKING:         Ethernet (10 Mbps) on SCC1
		   

DRIVER INFORMATION
==================
CLOCK DRIVER:       yes
CONSOLE DRIVER:     yes
SHMSUPP:            N/A
TIMER DRIVER:       yes
NETWORK DRIVER:	    yes

NOTES
=====
On-chip resources:
	SCC1		network or console
	SCC2		serial port
	SMC1		gdb debug console/application console
	SMC2		application console
	CLK1		network
	CLK2		network
	CLK3
	CLK4
	CLK5
	CLK6
	CLK7
	CLK8
	BRG1		console
	BRG2		console
	BRG3		console
	BRG4		console
	RTC
	PIT		clock
	TB
	DEC
	SWT	
	*CS0		FLASH
	*CS1		DRAM bank (onboard)
	*CS2		DRAM bank 0 (1st half of DIMM)
	*CS3		DRAM bank 1 (2nd half of DIMM)
	*CS4		Battery-Backed SRAM
	*CS5		QSPAN PCI
	*CS6		QSPAN
	*CS7		Boot ROM
	UPMA
	UPMB
	IRQ0
	IRQ1
	IRQ2		
	IRQ3		
	IRQ4		
	IRQ5	
	IRQ6
	IRQ7
	IRQ_LVL0	
	IRQ_LVL1
	IRQ_LVL2
	IRQ_LVL3
	IRQ_LVL4
	IRQ_LVL5
	IRQ_LVL6
	IRQ_LVL7
	

Board description
-----------------
Clock rate:	50MHz Entry level boards, 40 MHz others.
Bus width:	8/32 bit Flash, 32 bit DRAM
FLASH:		2-4MB, 120ns
RAM:		4-16MB EDO, 60ns DRAM DIMM


Installation
------------

All MBX821/MBX860 ports share the same source code base. The MPC821 does
not have SCC3 and SCC4. Instead, it has an LCD panel driver. Otherwise,
the MBX821 and MBX860 boards are essentially identical. Entry level boards
do not have all connectors and peripheral devices present. This has no
impact on the source code base; it merely means that some functionality
is not available on these entry level boards. For the most part, the port
uses the standard build process for powerpc targets. However, you must
specify the EXACT model of MBX board that you are building for as the
argument to the RTEMS_BSP make variable. If you do not, the build process
will build for a MBX860-002. Look at rtems/make/custom/mbx8xx.cfg for the
specific list of boards supported and their corresponding names. An
example build command is:

	make RTEMS_BSP=mbx821_001 all debug

This will build the optimized and debug versions of all RTEMS libraries,
samples and tests (if the latter are enabled).

The Software Engineering Group of the Institute for Information Technology
only owns an MBX821-001 and MBX86-002. The only provided config files are
mbx821_001.cfg and mbx860_002.cfg. A SPECIFIC CONFIG FILE IS REQUIRED. Use
one of the provided files as a template to create a specific config file for
another model.
 
We rely on EPPC-BUG to download to the targets. We use the 'PLH" command.
We enabled a TFTP deamon on our development host.


Port Description
Console driver
---------------

This BSP includes an termios-capable console driver that supports SMC1,
SMC2, SCC2, and SCC3 and SCC4 if present. The RTEMS console is selected
in rtems/make/custom/mbx8xx.cfg with the CONSOLE_MINOR variable. We
normally run with the RTEMS application console on SMC1.

Support is provided for polled and interrupt-driven terminal I/O. Interrupt-
driven I/O is selected by setting the UARTS_USE_INTERRUPTS variable in
rtems/make/custom/mbx8xx.cfg. If the variable is not set, or if it is set
to zero, polled I/O is used. If the EPPCBUG_SMC1 variable is set in
rtems/make/custom/mbx8xx.cfg, SMC1 will be used in polled mode with all
I/O done by EPPC-Bug rather than the supplied device driver. This mode
should be used if the application console is shared with EPPC-Bug. 

Polled I/O must be used when running the timing tests. It must also be used
to run some other tests and some samples, such as the cdtest. Applications
would normally use interrupt-driven I/O.


EPPC-Bug and I/O
----------------

Be warned that when EPPC-Bug does I/O through a serial port, all interrupts
get turned off in the SIMASK register! This is a definite bug in release 1.1
of the firmware. It may have been fixed in later releases.

To solve this problem that occurs when GDB communicates with EPPC-Bug, 
whenever the BSP manipulates the SIMASK, it makes copy of the written
in a global variable called 'simask_copy'. That value must be restored by
GDB before execution resumes. The following commands placed in the .gdbinit
file takes care of this:

# GDB Initialization file for EPPCBug.

define hook-stepi
set language c
set *(int *)0xFA200014=simask_copy
set language auto
end

define hook-step
set language c
set *(int *)0xFA200014=simask_copy
set language auto
end

define hook-continue
set language c
set *(int *)0xFA200014=simask_copy
set language auto
end

define hook-nexti
set language c
set *(int *)0xFA200014=simask_copy
set language auto
end

define hook-next
set language c
set *(int *)0xFA200014=simask_copy
set language auto
end

define hook-finish
set language c
set *(int *)0xFA200014=simask_copy
set language auto
end


Floating-point
--------------

The MPC860 and MPC821 do not have floating-point units. All code should
get compiled with the appropriate -mcpu flag. The nof variants of the gcc
runtime libraries should be used for linking.


Miscellaneous
-------------

All development was based on the eth_comm port.


Host System
-----------

12345678901234567890123456789012345678901234567890123456789012345678901234567890
The port was developed on Pentiums II and III running RedHat Linux 6.0 and
6.1. The following tools were used:

    - GNU gcc snapshot dated 19991208 configured for powerpc-rtems;
    - GNU binutils 2.9.1 configured for powerpc-rtems;

Gcc 2.95.2 also worked. Gcc 2.95.1 will not compile the console driver with
-O4 or -O3. Compile it manually with -O2.


Known Problems
--------------

The cdtest will not run with interrupt-driven I/O. The reason is that the
constructors for the static objects are called at boot time when the
interrupts are still disabled. The output buffer fills up, but never empties,
and the application goes into an infinite loop waiting for buffer space. This
should have been documented in the rtems/c/src/tests/PROBLEMS file. The moral
of this story is: do not do I/O from the constructors or destructors of static
objects.

The cpuuse and malloctest tests do not work properly, either with polled I/O
or interrupt-driven I/O. They are known not to work with interrupt-driven I/O,
but should work with polled I/O?

Output stops prematurely in the termios test when the console is operating in
interrupt-driven mode because the serial port is re-initialized before all
characters in the last raw output buffer are sent. Adding calls to tcdrain()
in the test task helps, but it does not solve the problem. What happens is
that the CD2401 raises a transmit interrupt when the last character in the
DMA buffer is written into the transmit FIFO, not when the last character
has been transmitted. When tcdrain() returns, there might be up to 16
characters in the output FIFO. The call to tcsetattr() causes the serial port
to re-initialize, at which point the output FIFO is cleared. We could not find
a way to detect whether characters are still in the FIFO and to wait for them
to be transmitted.

The first raw buffer to be transmitted after the console is re-initialized
with tcsetattr() is garbled. At this time, it does not seem worth while to
track this problem down.

In the stackchk test, an access fault exception is raised after the stack is
blown. This is one case were overwritting the first or last 16 bytes of the
stack does cause problems (but hey, an exception occurred, which is better
than propagating the error).

In the stackchk test, an access fault exception is raised after the stack is
blown. This is one case were overwritting the first or last 16 bytes of the
stack does cause problems (but hey, an exception occurred, which is better
than propagating the error).

When using interrupt-driven I/O, psx08 produces all the expected output, but
it does not return control to 167Bug. Is this test supposed to work with
interrupt-driven console I/O?


What's new
----------

All known problems with use of the caches on the MBX860-002 and MBX821-001
have been resolved.


Thanks
------

- to Jay Monkman (jmonkman@frasca.com) of Frasca International, Inc.
  for his eth_comm port.
  
- to On-Line Applications Research Corporation (OAR) for developing
  RTEMS and making it available on a Technology Transfer basis;

- to the FSF and to Cygnus Support for great free software;


Test Configuration
------------------

Board:                MBX821-001, MBX860-002
CPU:                  Motorola MPC821, MPC860
Clock Speed:          50 MHz, 40 MHz
RAM:                  4 MBytes of 32-bit DRAM
Cache Configuration:  Instruction cache on; data cache on, copyback mode.
Times Reported in:    clock ticks: TMBCLK = system clock / 16.
Timer Source:         Timebase clock
GCC Flags:            -O4 -fno-keep-inline-functions -mcpu=(821/860) 
Console:              Operates in polled mode on SMC2. No I/O through EPPC-Bug.    


Test Results
------------

Single processor tests:  All tests passed, except the following ones:

  - paranoia required the FPSP and the default variants of libm (and libc and
    libgcc) for us. It may work with the msoft-float variants for you, but it
    does require the FPSP.
  
  - cpuuse and malloctest did not work.
  
  - The stackchk test got an access fault exception before the RTEMS stack
    checker had had a chance to detect the corrupted stack.
                         
                         
Multi-processort tests:  not applicable -- No MPCI layer yet.


Timing tests:
	See the times-mbx821 and times-860 files for the results of the
	timing tests.


Network tests:
       Network driver is being implemented.