]> rtime.felk.cvut.cz Git - rtems-devel.git/blob - rtems-patches/rtems-update-mrm332-to-mo376.patch
Patches updated to the newer RTEMS version.
[rtems-devel.git] / rtems-patches / rtems-update-mrm332-to-mo376.patch
1 Index: rtems/c/src/lib/libbsp/m68k/mo376/start/start.S
2 ===================================================================
3 --- rtems.orig/c/src/lib/libbsp/m68k/mo376/start/start.S
4 +++ rtems/c/src/lib/libbsp/m68k/mo376/start/start.S
5 @@ -2,7 +2,7 @@
6   *  $Id
7   */
8  
9 -#include "mrm332.h"
10 +#include "mo376.h"
11  #include <rtems/asm.h>
12  #include <rtems/m68k/sim.h>
13  
14 Index: rtems/c/src/lib/libbsp/m68k/mo376/include/bsp.h
15 ===================================================================
16 --- rtems.orig/c/src/lib/libbsp/m68k/mo376/include/bsp.h
17 +++ rtems/c/src/lib/libbsp/m68k/mo376/include/bsp.h
18 @@ -26,7 +26,7 @@ extern "C" {
19  #include <rtems/clockdrv.h>
20  #include <rtems/console.h>
21  #include <rtems/iosupp.h>
22 -#include <mrm332.h>
23 +#include <mo376.h>
24  #include <rtems/m68k/sim.h>
25  #include <rtems/m68k/qsm.h>
26  
27 Index: rtems/c/src/lib/libbsp/m68k/mo376/ChangeLog
28 ===================================================================
29 --- rtems.orig/c/src/lib/libbsp/m68k/mo376/ChangeLog
30 +++ rtems/c/src/lib/libbsp/m68k/mo376/ChangeLog
31 @@ -11,6 +11,11 @@
32  
33         * include/bsp.h: New header guard.
34  
35 +2005-04-08     Pavel Pisa <pisa@cmp.felk.cvut.cz>
36 +
37 +       * MO376 BSP for PiKRON's MO_CPU1/MO_CPU2 board started
38 +       as clone of MRM332 BSP.
39 +
40  2005-01-07     Ralf Corsepius <ralf.corsepius@rtems.org>
41  
42         * Makefile.am: Eliminate CFLAGS_OPTIMIZE_V.
43 Index: rtems/c/src/lib/libbsp/m68k/mo376/clock/ckinit.c
44 ===================================================================
45 --- rtems.orig/c/src/lib/libbsp/m68k/mo376/clock/ckinit.c
46 +++ rtems/c/src/lib/libbsp/m68k/mo376/clock/ckinit.c
47 @@ -20,7 +20,7 @@
48  #include <stdlib.h>
49  #include <bsp.h>
50  #include <rtems/libio.h>
51 -#include <mrm332.h>
52 +#include <mo376.h>
53  
54  #define CLOCK_VECTOR   MRM_PIV
55  
56 Index: rtems/c/src/lib/libbsp/m68k/mo376/configure.ac
57 ===================================================================
58 --- rtems.orig/c/src/lib/libbsp/m68k/mo376/configure.ac
59 +++ rtems/c/src/lib/libbsp/m68k/mo376/configure.ac
60 @@ -3,7 +3,7 @@
61  ## $Id: configure.ac,v 1.14 2004/09/24 06:32:09 ralf Exp $
62  
63  AC_PREREQ(2.59)
64 -AC_INIT([rtems-c-src-lib-libbsp-m68k-mrm332],[_RTEMS_VERSION],[rtems-bugs@rtems.com])
65 +AC_INIT([rtems-c-src-lib-libbsp-m68k-mo376],[_RTEMS_VERSION],[rtems-bugs@rtems.com])
66  AC_CONFIG_SRCDIR([bsp_specs])
67  RTEMS_TOP(../../../../../..)
68  
69 Index: rtems/c/src/lib/libbsp/m68k/mo376/README
70 ===================================================================
71 --- rtems.orig/c/src/lib/libbsp/m68k/mo376/README
72 +++ rtems/c/src/lib/libbsp/m68k/mo376/README
73 @@ -2,23 +2,24 @@
74  #  $Id: README,v 1.1 2001/05/25 16:28:46 joel Exp $
75  #
76  
77 -Description: mrm332
78 +Description: mo376
79  ============
80 -CPU: MC68332 @16 or 25MHz
81 -RAM: 32k or 512k
82 -ROM: 512k flash
83 +CPU: MC68376 @21MHz
84 +RAM: 1MiB or 2MiB
85 +ROM: 1MiB or 2MiB flash
86  
87 -   The Mini RoboMind is a small board based on the 68332 microcontroller
88 -designed and build by Mark Castelluccio.  For details, see:
89 +   The mo376 BSP supports MO_CPU1/MO_CPU2 boards developed by PiKRON company.
90 +The design documentation conforms open-source mind of board authors
91 +and can be found on the company pages
92  
93 -        http://www.robominds.com
94 +        http://www.pikron.com/en/main_frame_mo_cpu1.html
95  
96 -   This BSP was ported from the efi332 BSP by Matt Cross (profesor@gweep.net),
97 -the efi332 BSP was written by John S Gwynne.
98 +  This BSP has been cloned from Mini RoboMind BSP written for small board based
99 +on the 68332 microcontroller designed and build by Mark Castelluccio
100 +
101 +   The mrm332 BSP was ported from the efi332 BSP by Matt Cross (profesor@gweep.net),
102 +the efi332 was written by John S Gwynne.
103  
104  TODO:
105  =====
106 -- integrate the interrupt driven stdin/stdout into RTEMS to (a) reduce
107 -  the interrupt priority and (2) to prevent it from blocking.
108 -- add a timer driver for the tmtest set.
109  
110 Index: rtems/c/src/lib/libbsp/m68k/mo376/Makefile.am
111 ===================================================================
112 --- rtems.orig/c/src/lib/libbsp/m68k/mo376/Makefile.am
113 +++ rtems/c/src/lib/libbsp/m68k/mo376/Makefile.am
114 @@ -16,7 +16,7 @@ nodist_include_HEADERS = include/bspopts
115  DISTCLEANFILES = include/bspopts.h
116  noinst_PROGRAMS =
117  
118 -include_HEADERS += include/mrm332.h
119 +include_HEADERS += include/mo376.h
120  nodist_include_HEADERS += ../../shared/include/coverhd.h
121  
122  EXTRA_DIST = times
123 Index: rtems/c/src/lib/libbsp/m68k/mo376/console/sci.c
124 ===================================================================
125 --- rtems.orig/c/src/lib/libbsp/m68k/mo376/console/sci.c
126 +++ rtems/c/src/lib/libbsp/m68k/mo376/console/sci.c
127 @@ -129,7 +129,7 @@
128  
129  // system clock definitions, i dont have documentation on this...
130  
131 -#if 0 // Not needed, this is provided in mrm332.h
132 +#if 0 // Not needed, this is provided in mo376.h
133  #define XTAL            32768.0                        // crystal frequency in Hz
134  #define NUMB_W          0                              // system clock parameters
135  #define NUMB_X          1
136 @@ -1238,7 +1238,7 @@ static void SciSetBaud(uint32_t   rate)
137  
138      // calculate the register value as a float and convert to an int
139      // set baud rate - you must define the system clock constant
140 -    // see mrm332.h for an example
141 +    // see mo376.h for an example
142  
143      value = ( (uint16_t) ( SYS_CLOCK / rate / 32.0 + 0.5 ) & 0x1fff );
144  
145 Index: rtems/c/src/lib/libbsp/m68k/mo376/startup/start_c.c
146 ===================================================================
147 --- rtems.orig/c/src/lib/libbsp/m68k/mo376/startup/start_c.c
148 +++ rtems/c/src/lib/libbsp/m68k/mo376/startup/start_c.c
149 @@ -2,7 +2,7 @@
150   *  $Id
151   */
152  
153 -#include <mrm332.h>
154 +#include <mo376.h>
155  #include <rtems/m68k/sim.h>
156  #define __START_C__
157  #include "bsp.h"
158 Index: rtems/c/src/lib/libbsp/m68k/mo376/times
159 ===================================================================
160 --- rtems.orig/c/src/lib/libbsp/m68k/mo376/times
161 +++ rtems/c/src/lib/libbsp/m68k/mo376/times
162 @@ -1,5 +1,5 @@
163  #
164 -#  Timing Test Suite Results for the MRM332 BSP
165 +#  Timing Test Suite Results for the MO376 BSP
166  #
167  #  $Id: times,v 1.2 2004/01/07 21:13:50 joel Exp $
168  #
169 @@ -8,9 +8,9 @@ NOTE:  This BSP is user submitted and no
170  
171  TBD: MATT - update this with real times!
172  
173 -Board:                MRM332 
174 +Board:                MO376 
175  CPU:                  68332
176 -Clock Speed:          20 Mhz
177 +Clock Speed:          21 Mhz
178  Memory Configuration: SRAM, DRAM, cache, etc
179  Wait States:          
180  
181 Index: rtems/c/src/lib/libbsp/m68k/mo376/include/mo376.h
182 ===================================================================
183 --- /dev/null
184 +++ rtems/c/src/lib/libbsp/m68k/mo376/include/mo376.h
185 @@ -0,0 +1,70 @@
186 +/*  mo376.h
187 + *
188 + *  $Id: mo376.h,v 1.5 2004/04/21 16:01:35 ralf Exp $
189 + */
190 +
191 +#ifndef _MO376_H_
192 +#define _MO376_H_
193 +
194 +/* SIM_MM (SIM Module Mapping) determines the location of the control
195 +   register block. When MM=0, register addresses range fom 0x7ff000 to
196 +   0x7FFFFF. When MM=1, register addresses range from 0xfff000 to
197 +   0xffffff. */
198 +#define SIM_MM 1
199 +
200 +/* Interrupt related definitions */
201 +#define SIM_IARB 15
202 +#define QSM_IARB 10
203 +
204 +#define MRM_PIV 64
205 +#define ISRL_PIT 4             /* zero disables PIT */
206 +
207 +#define EFI_QIVR 66            /* 66=>SCI and 67=>QSPI interrupt */
208 +#define ISRL_QSPI 0
209 +
210 +#define EFI_SPINT 24           /* spurious interrupt */
211 +#define EFI_INT1 25            /* CTS interrupt */
212 +#define ISRL_SCI 6
213 +
214 +/* System Clock definitions */
215 +#define XTAL 32768.0           /* crystal frequency in Hz */
216 +
217 +#if 0
218 +/* Default MRM clock rate (8.388688 MHz) set by CPU32: */
219 +#define MRM_W 0                        /* system clock parameters */
220 +#define MRM_X 0
221 +#define MRM_Y 0x3f
222 +#endif
223 +
224 +#if 1
225 +/* 16.77722 MHz: */
226 +#define MRM_W 1                        /* system clock parameters */
227 +#define MRM_X 1
228 +#define MRM_Y 0x0f
229 +#endif
230 +
231 +#if 0
232 +/* 25.16582 MHz: */
233 +#define MRM_W 1                        /* system clock parameters */
234 +#define MRM_X 1
235 +#define MRM_Y 0x17
236 +#endif
237 +
238 +#define SYS_CLOCK (XTAL*4.0*(MRM_Y+1)*(1 << (2*MRM_W+MRM_X)))
239 +#define SCI_BAUD 19200         /* RS232 Baud Rate */
240 +
241 +/* macros/functions */
242 +
243 +#ifndef ASM
244 +
245 +/*
246 + *  This prototype really should have the noreturn attribute but
247 + *  that causes a warning. Not sure how to fix that.
248 + */
249 +/*   static void reboot(void) __attribute__ ((noreturn)); */
250 +static void reboot(void);
251 +__inline__ static void reboot() {asm("trap #15; .word 0x0063");}
252 +
253 +#endif /* ASM */
254 +
255 +#endif /* _MRM_H_ */
256 Index: rtems/c/src/lib/libbsp/m68k/mo376/include/mrm332.h
257 ===================================================================
258 --- rtems.orig/c/src/lib/libbsp/m68k/mo376/include/mrm332.h
259 +++ /dev/null
260 @@ -1,70 +0,0 @@
261 -/*  mrm332.h
262 - *
263 - *  $Id: mrm332.h,v 1.5 2004/04/21 16:01:35 ralf Exp $
264 - */
265 -
266 -#ifndef _MRM332_H_
267 -#define _MRM332_H_
268 -
269 -/* SIM_MM (SIM Module Mapping) determines the location of the control
270 -   register block. When MM=0, register addresses range fom 0x7ff000 to
271 -   0x7FFFFF. When MM=1, register addresses range from 0xfff000 to
272 -   0xffffff. */
273 -#define SIM_MM 1
274 -
275 -/* Interrupt related definitions */
276 -#define SIM_IARB 15
277 -#define QSM_IARB 10
278 -
279 -#define MRM_PIV 64
280 -#define ISRL_PIT 4             /* zero disables PIT */
281 -
282 -#define EFI_QIVR 66            /* 66=>SCI and 67=>QSPI interrupt */
283 -#define ISRL_QSPI 0
284 -
285 -#define EFI_SPINT 24           /* spurious interrupt */
286 -#define EFI_INT1 25            /* CTS interrupt */
287 -#define ISRL_SCI 6
288 -
289 -/* System Clock definitions */
290 -#define XTAL 32768.0           /* crystal frequency in Hz */
291 -
292 -#if 0
293 -/* Default MRM clock rate (8.388688 MHz) set by CPU32: */
294 -#define MRM_W 0                        /* system clock parameters */
295 -#define MRM_X 0
296 -#define MRM_Y 0x3f
297 -#endif
298 -
299 -#if 1
300 -/* 16.77722 MHz: */
301 -#define MRM_W 1                        /* system clock parameters */
302 -#define MRM_X 1
303 -#define MRM_Y 0x0f
304 -#endif
305 -
306 -#if 0
307 -/* 25.16582 MHz: */
308 -#define MRM_W 1                        /* system clock parameters */
309 -#define MRM_X 1
310 -#define MRM_Y 0x17
311 -#endif
312 -
313 -#define SYS_CLOCK (XTAL*4.0*(MRM_Y+1)*(1 << (2*MRM_W+MRM_X)))
314 -#define SCI_BAUD 19200         /* RS232 Baud Rate */
315 -
316 -/* macros/functions */
317 -
318 -#ifndef ASM
319 -
320 -/*
321 - *  This prototype really should have the noreturn attribute but
322 - *  that causes a warning. Not sure how to fix that.
323 - */
324 -/*   static void reboot(void) __attribute__ ((noreturn)); */
325 -static void reboot(void);
326 -__inline__ static void reboot() {asm("trap #15; .word 0x0063");}
327 -
328 -#endif /* ASM */
329 -
330 -#endif /* _MRM_H_ */
331 Index: rtems/make/custom/mo376.cfg
332 ===================================================================
333 --- rtems.orig/make/custom/mo376.cfg
334 +++ rtems/make/custom/mo376.cfg
335 @@ -1,7 +1,7 @@
336  #
337 -#  Config file for the mrm332 BSP
338 +#  Config file for the mo376 BSP
339  #
340 -#  $Id: mrm332.cfg,v 1.8 2004/02/04 16:50:30 ralf Exp $
341 +#  $Id: mo376.cfg,v 1.8 2004/02/04 16:50:30 ralf Exp $
342  #
343  
344  include $(RTEMS_ROOT)/make/custom/default.cfg
345 @@ -10,7 +10,7 @@ RTEMS_CPU=m68k
346  RTEMS_CPU_MODEL=m68332
347  
348  # This is the actual bsp directory used during the build process.
349 -RTEMS_BSP_FAMILY=mrm332
350 +RTEMS_BSP_FAMILY=mo376
351  
352  #  This contains the compiler options necessary to select the CPU model
353  #  and (hopefully) optimize for it. 
354 @@ -26,7 +26,7 @@ CFLAGS_OPTIMIZE_V=-O4 -fomit-frame-point
355  ifeq ($(MRM_IN_ROM),yes)
356  # Build a rommable image - move the .data section after the .text section
357  # in the image.
358 -CPU_CFLAGS += -qnolinkcmds -T $(exec_prefix)/mrm332/lib/linkcmds_ROM
359 +CPU_CFLAGS += -qnolinkcmds -T $(exec_prefix)/mo376/lib/linkcmds_ROM
360  
361  #  This is a good way to get debug information.  The output file is large
362  #  though and greatly slows the build process so only do this if needed.
363 Index: rtems/c/src/lib/libbsp/m68k/mo376/preinstall.am
364 ===================================================================
365 --- rtems.orig/c/src/lib/libbsp/m68k/mo376/preinstall.am
366 +++ rtems/c/src/lib/libbsp/m68k/mo376/preinstall.am
367 @@ -44,9 +44,9 @@ $(PROJECT_INCLUDE)/bspopts.h: include/bs
368         $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bspopts.h
369  PREINSTALL_FILES += $(PROJECT_INCLUDE)/bspopts.h
370  
371 -$(PROJECT_INCLUDE)/mrm332.h: include/mrm332.h $(PROJECT_INCLUDE)/$(dirstamp)
372 -       $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/mrm332.h
373 -PREINSTALL_FILES += $(PROJECT_INCLUDE)/mrm332.h
374 +$(PROJECT_INCLUDE)/mo376.h: include/mo376.h $(PROJECT_INCLUDE)/$(dirstamp)
375 +       $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/mo376.h
376 +PREINSTALL_FILES += $(PROJECT_INCLUDE)/mo376.h
377  
378  $(PROJECT_INCLUDE)/coverhd.h: ../../shared/include/coverhd.h $(PROJECT_INCLUDE)/$(dirstamp)
379         $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/coverhd.h