]> rtime.felk.cvut.cz Git - rtems-devel.git/blob - rtems-patches/rtems-update-mrm332-to-mo376.patch
9ca710e43b5fe5b6e4e1f31ee74bf18e275946bd
[rtems-devel.git] / rtems-patches / rtems-update-mrm332-to-mo376.patch
1 Index: rtems-051009/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-051009/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-051009/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 @@ -2,6 +2,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-051009/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-051009/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-051009/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-051009/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 @@ -17,7 +17,7 @@ DISTCLEANFILES = include/bspopts.h
115  
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 @@ -97,9 +97,9 @@ $(PROJECT_INCLUDE)/bspopts.h: include/bs
124         $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bspopts.h
125  PREINSTALL_FILES += $(PROJECT_INCLUDE)/bspopts.h
126  
127 -$(PROJECT_INCLUDE)/mrm332.h: include/mrm332.h $(PROJECT_INCLUDE)/$(dirstamp)
128 -       $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/mrm332.h
129 -PREINSTALL_FILES += $(PROJECT_INCLUDE)/mrm332.h
130 +$(PROJECT_INCLUDE)/mo376.h: include/mo376.h $(PROJECT_INCLUDE)/$(dirstamp)
131 +       $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/mo376.h
132 +PREINSTALL_FILES += $(PROJECT_INCLUDE)/mo376.h
133  
134  $(PROJECT_INCLUDE)/coverhd.h: ../../shared/include/coverhd.h $(PROJECT_INCLUDE)/$(dirstamp)
135         $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/coverhd.h
136 Index: rtems-051009/c/src/lib/libbsp/m68k/mo376/console/sci.c
137 ===================================================================
138 --- rtems.orig/c/src/lib/libbsp/m68k/mo376/console/sci.c
139 +++ rtems/c/src/lib/libbsp/m68k/mo376/console/sci.c
140 @@ -129,7 +129,7 @@
141  
142  // system clock definitions, i dont have documentation on this...
143  
144 -#if 0 // Not needed, this is provided in mrm332.h
145 +#if 0 // Not needed, this is provided in mo376.h
146  #define XTAL            32768.0                        // crystal frequency in Hz
147  #define NUMB_W          0                              // system clock parameters
148  #define NUMB_X          1
149 @@ -1238,7 +1238,7 @@ static void SciSetBaud(uint32_t   rate)
150  
151      // calculate the register value as a float and convert to an int
152      // set baud rate - you must define the system clock constant
153 -    // see mrm332.h for an example
154 +    // see mo376.h for an example
155  
156      value = ( (uint16_t) ( SYS_CLOCK / rate / 32.0 + 0.5 ) & 0x1fff );
157  
158 Index: rtems-051009/c/src/lib/libbsp/m68k/mo376/startup/start_c.c
159 ===================================================================
160 --- rtems.orig/c/src/lib/libbsp/m68k/mo376/startup/start_c.c
161 +++ rtems/c/src/lib/libbsp/m68k/mo376/startup/start_c.c
162 @@ -2,7 +2,7 @@
163   *  $Id
164   */
165  
166 -#include <mrm332.h>
167 +#include <mo376.h>
168  #include <rtems/m68k/sim.h>
169  #define __START_C__
170  #include "bsp.h"
171 Index: rtems-051009/c/src/lib/libbsp/m68k/mo376/times
172 ===================================================================
173 --- rtems.orig/c/src/lib/libbsp/m68k/mo376/times
174 +++ rtems/c/src/lib/libbsp/m68k/mo376/times
175 @@ -1,5 +1,5 @@
176  #
177 -#  Timing Test Suite Results for the MRM332 BSP
178 +#  Timing Test Suite Results for the MO376 BSP
179  #
180  #  $Id: times,v 1.2 2004/01/07 21:13:50 joel Exp $
181  #
182 @@ -8,9 +8,9 @@ NOTE:  This BSP is user submitted and no
183  
184  TBD: MATT - update this with real times!
185  
186 -Board:                MRM332 
187 +Board:                MO376 
188  CPU:                  68332
189 -Clock Speed:          20 Mhz
190 +Clock Speed:          21 Mhz
191  Memory Configuration: SRAM, DRAM, cache, etc
192  Wait States:          
193  
194 Index: rtems-051009/c/src/lib/libbsp/m68k/mo376/include/mo376.h
195 ===================================================================
196 --- /dev/null
197 +++ rtems/c/src/lib/libbsp/m68k/mo376/include/mo376.h
198 @@ -0,0 +1,70 @@
199 +/*  mo376.h
200 + *
201 + *  $Id: mo376.h,v 1.5 2004/04/21 16:01:35 ralf Exp $
202 + */
203 +
204 +#ifndef _MO376_H_
205 +#define _MO376_H_
206 +
207 +/* SIM_MM (SIM Module Mapping) determines the location of the control
208 +   register block. When MM=0, register addresses range fom 0x7ff000 to
209 +   0x7FFFFF. When MM=1, register addresses range from 0xfff000 to
210 +   0xffffff. */
211 +#define SIM_MM 1
212 +
213 +/* Interrupt related definitions */
214 +#define SIM_IARB 15
215 +#define QSM_IARB 10
216 +
217 +#define MRM_PIV 64
218 +#define ISRL_PIT 4             /* zero disables PIT */
219 +
220 +#define EFI_QIVR 66            /* 66=>SCI and 67=>QSPI interrupt */
221 +#define ISRL_QSPI 0
222 +
223 +#define EFI_SPINT 24           /* spurious interrupt */
224 +#define EFI_INT1 25            /* CTS interrupt */
225 +#define ISRL_SCI 6
226 +
227 +/* System Clock definitions */
228 +#define XTAL 32768.0           /* crystal frequency in Hz */
229 +
230 +#if 0
231 +/* Default MRM clock rate (8.388688 MHz) set by CPU32: */
232 +#define MRM_W 0                        /* system clock parameters */
233 +#define MRM_X 0
234 +#define MRM_Y 0x3f
235 +#endif
236 +
237 +#if 1
238 +/* 16.77722 MHz: */
239 +#define MRM_W 1                        /* system clock parameters */
240 +#define MRM_X 1
241 +#define MRM_Y 0x0f
242 +#endif
243 +
244 +#if 0
245 +/* 25.16582 MHz: */
246 +#define MRM_W 1                        /* system clock parameters */
247 +#define MRM_X 1
248 +#define MRM_Y 0x17
249 +#endif
250 +
251 +#define SYS_CLOCK (XTAL*4.0*(MRM_Y+1)*(1 << (2*MRM_W+MRM_X)))
252 +#define SCI_BAUD 19200         /* RS232 Baud Rate */
253 +
254 +/* macros/functions */
255 +
256 +#ifndef ASM
257 +
258 +/*
259 + *  This prototype really should have the noreturn attribute but
260 + *  that causes a warning. Not sure how to fix that.
261 + */
262 +/*   static void reboot(void) __attribute__ ((noreturn)); */
263 +static void reboot(void);
264 +__inline__ static void reboot() {asm("trap #15; .word 0x0063");}
265 +
266 +#endif /* ASM */
267 +
268 +#endif /* _MRM_H_ */
269 Index: rtems-051009/c/src/lib/libbsp/m68k/mo376/include/mrm332.h
270 ===================================================================
271 --- rtems.orig/c/src/lib/libbsp/m68k/mo376/include/mrm332.h
272 +++ /dev/null
273 @@ -1,70 +0,0 @@
274 -/*  mrm332.h
275 - *
276 - *  $Id: mrm332.h,v 1.5 2004/04/21 16:01:35 ralf Exp $
277 - */
278 -
279 -#ifndef _MRM332_H_
280 -#define _MRM332_H_
281 -
282 -/* SIM_MM (SIM Module Mapping) determines the location of the control
283 -   register block. When MM=0, register addresses range fom 0x7ff000 to
284 -   0x7FFFFF. When MM=1, register addresses range from 0xfff000 to
285 -   0xffffff. */
286 -#define SIM_MM 1
287 -
288 -/* Interrupt related definitions */
289 -#define SIM_IARB 15
290 -#define QSM_IARB 10
291 -
292 -#define MRM_PIV 64
293 -#define ISRL_PIT 4             /* zero disables PIT */
294 -
295 -#define EFI_QIVR 66            /* 66=>SCI and 67=>QSPI interrupt */
296 -#define ISRL_QSPI 0
297 -
298 -#define EFI_SPINT 24           /* spurious interrupt */
299 -#define EFI_INT1 25            /* CTS interrupt */
300 -#define ISRL_SCI 6
301 -
302 -/* System Clock definitions */
303 -#define XTAL 32768.0           /* crystal frequency in Hz */
304 -
305 -#if 0
306 -/* Default MRM clock rate (8.388688 MHz) set by CPU32: */
307 -#define MRM_W 0                        /* system clock parameters */
308 -#define MRM_X 0
309 -#define MRM_Y 0x3f
310 -#endif
311 -
312 -#if 1
313 -/* 16.77722 MHz: */
314 -#define MRM_W 1                        /* system clock parameters */
315 -#define MRM_X 1
316 -#define MRM_Y 0x0f
317 -#endif
318 -
319 -#if 0
320 -/* 25.16582 MHz: */
321 -#define MRM_W 1                        /* system clock parameters */
322 -#define MRM_X 1
323 -#define MRM_Y 0x17
324 -#endif
325 -
326 -#define SYS_CLOCK (XTAL*4.0*(MRM_Y+1)*(1 << (2*MRM_W+MRM_X)))
327 -#define SCI_BAUD 19200         /* RS232 Baud Rate */
328 -
329 -/* macros/functions */
330 -
331 -#ifndef ASM
332 -
333 -/*
334 - *  This prototype really should have the noreturn attribute but
335 - *  that causes a warning. Not sure how to fix that.
336 - */
337 -/*   static void reboot(void) __attribute__ ((noreturn)); */
338 -static void reboot(void);
339 -__inline__ static void reboot() {asm("trap #15; .word 0x0063");}
340 -
341 -#endif /* ASM */
342 -
343 -#endif /* _MRM_H_ */
344 Index: rtems-051009/make/custom/mo376.cfg
345 ===================================================================
346 --- rtems.orig/make/custom/mo376.cfg
347 +++ rtems/make/custom/mo376.cfg
348 @@ -1,7 +1,7 @@
349  #
350 -#  Config file for the mrm332 BSP
351 +#  Config file for the mo376 BSP
352  #
353 -#  $Id: mrm332.cfg,v 1.8 2004/02/04 16:50:30 ralf Exp $
354 +#  $Id: mo376.cfg,v 1.8 2004/02/04 16:50:30 ralf Exp $
355  #
356  
357  include $(RTEMS_ROOT)/make/custom/default.cfg
358 @@ -10,7 +10,7 @@ RTEMS_CPU=m68k
359  RTEMS_CPU_MODEL=m68332
360  
361  # This is the actual bsp directory used during the build process.
362 -RTEMS_BSP_FAMILY=mrm332
363 +RTEMS_BSP_FAMILY=mo376
364  
365  #  This contains the compiler options necessary to select the CPU model
366  #  and (hopefully) optimize for it. 
367 @@ -26,7 +26,7 @@ CFLAGS_OPTIMIZE_V=-O4 -fomit-frame-point
368  ifeq ($(MRM_IN_ROM),yes)
369  # Build a rommable image - move the .data section after the .text section
370  # in the image.
371 -CPU_CFLAGS += -qnolinkcmds -T $(exec_prefix)/mrm332/lib/linkcmds_ROM
372 +CPU_CFLAGS += -qnolinkcmds -T $(exec_prefix)/mo376/lib/linkcmds_ROM
373  
374  #  This is a good way to get debug information.  The output file is large
375  #  though and greatly slows the build process so only do this if needed.