From: Pavel Pisa Date: Thu, 7 Dec 2006 16:38:07 +0000 (+0100) Subject: Minimal build support for M5235BCC board X-Git-Url: http://rtime.felk.cvut.cz/gitweb/rtems-devel.git/commitdiff_plain/e63a4c4e8b974e5b6337b030caeb98be0eb90d6e Minimal build support for M5235BCC board darcs-hash:20061207163807-ff715-4076419d0f8df0c02e58366eeaa85a47d238ca52.gz --- diff --git a/rtems-build/m68k-m5235bcc/bdm/m68k-bdm.cfg b/rtems-build/m68k-m5235bcc/bdm/m68k-bdm.cfg new file mode 100644 index 0000000..297d012 --- /dev/null +++ b/rtems-build/m68k-m5235bcc/bdm/m68k-bdm.cfg @@ -0,0 +1,111 @@ + +#!/bin/bash + +../../../bdm/m68k/configure \ + --prefix=/opt/m68k-rtems4.7 \ + --enable-bdmctrl \ + --with-libbfd=/opt/m68k-rtems4.7/lib/libbfd.a \ + --with-libiberty=/opt/m68k-rtems4.7/lib/libiberty.a \ + --with-bfd-include-dir=/opt/m68k-rtems4.7/include \ + --enable-driver \ + --enable-ioperm + +# `configure' configures m68k-bdm 1.3.2 to adapt to many kinds of systems. +# +# Usage: ../../../bdm/m68k/configure [OPTION]... [VAR=VALUE]... + +# To assign environment variables (e.g., CC, CFLAGS...), specify them as +# VAR=VALUE. See below for descriptions of some of the useful variables. +# +# Defaults for the options are specified in brackets. +# +# Configuration: +# -h, --help display this help and exit +# --help=short display options specific to this package +# --help=recursive display the short help of all the included packages +# -V, --version display version information and exit +# -q, --quiet, --silent do not print `checking...' messages +# --cache-file=FILE cache test results in FILE [disabled] +# -C, --config-cache alias for `--cache-file=config.cache' +# -n, --no-create do not create output files +# --srcdir=DIR find the sources in DIR [configure dir or `..'] +# +# Installation directories: +# --prefix=PREFIX install architecture-independent files in PREFIX +# [/usr/local] +# --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX +# [PREFIX] +# +# By default, `make install' will install all the files in +# `/usr/local/bin', `/usr/local/lib' etc. You can specify +# an installation prefix other than `/usr/local' using `--prefix', +# for instance `--prefix=$HOME'. +# +# For better control, use the options below. +# +# Fine tuning of the installation directories: +# --bindir=DIR user executables [EPREFIX/bin] +# --sbindir=DIR system admin executables [EPREFIX/sbin] +# --libexecdir=DIR program executables [EPREFIX/libexec] +# --sysconfdir=DIR read-only single-machine data [PREFIX/etc] +# --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] +# --localstatedir=DIR modifiable single-machine data [PREFIX/var] +# --libdir=DIR object code libraries [EPREFIX/lib] +# --includedir=DIR C header files [PREFIX/include] +# --oldincludedir=DIR C header files for non-gcc [/usr/include] +# --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] +# --datadir=DIR read-only architecture-independent data [DATAROOTDIR] +# --infodir=DIR info documentation [DATAROOTDIR/info] +# --localedir=DIR locale-dependent data [DATAROOTDIR/locale] +# --mandir=DIR man documentation [DATAROOTDIR/man] +# --docdir=DIR documentation root [DATAROOTDIR/doc/m68k-bdm] +# --htmldir=DIR html documentation [DOCDIR] +# --dvidir=DIR dvi documentation [DOCDIR] +# --pdfdir=DIR pdf documentation [DOCDIR] +# --psdir=DIR ps documentation [DOCDIR] +# +# Program names: +# --program-prefix=PREFIX prepend PREFIX to installed program names +# --program-suffix=SUFFIX append SUFFIX to installed program names +# --program-transform-name=PROGRAM run sed PROGRAM on installed program names +# +# System types: +# --build=BUILD configure for building on BUILD [guessed] +# --host=HOST cross-compile to build programs to run on HOST [BUILD] +# --target=TARGET configure for building compilers for TARGET [HOST] +# +# Optional Features: +# --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) +# --enable-FEATURE[=ARG] include FEATURE [ARG=yes] +# --disable-dependency-tracking speeds up one-time build +# --enable-dependency-tracking do not reject slow dependency extractors +# --enable-debug Turn on debug information (enabled) +# --enable-remote Turn on the remote protocol (enabled) +# --enable-ioperm Turn on direct ioperm hardware access (autodetected) +# --enable-driver Turn on driver support (autodetected) +# --enable-server Turn on server support (enabled) +# --enable-bdmctrl Turn on bdmctrl support (disabled) +# --enable-flashlib Turn on flashlib support (enabled) +# --enable-bdmflash Build the bdmflash utility (enabled) +# --enable-bdmmon Build the bdmmon utility (enabled) +# +# Optional Packages: +# --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] +# --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) +# --with-libbfd=FILE path to libbfd.a library to use +# --with-libiberty=FILE path to libiberty.a library to use +# --with-bfd-include-dir=DIR include path for correct bfd.h +# +# Some influential environment variables: +# CC C compiler command +# CFLAGS C compiler flags +# LDFLAGS linker flags, e.g. -L if you have libraries in a +# nonstandard directory +# CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if +# you have headers in a nonstandard directory +# +# Use these variables to override the choices made by `configure' or to help +# it to find libraries and programs with nonstandard names/locations. +# +# Report bugs to . +# \ No newline at end of file diff --git a/rtems-build/m68k-m5235bcc/binutils/binutils-m68k-rtems.cfg b/rtems-build/m68k-m5235bcc/binutils/binutils-m68k-rtems.cfg new file mode 100644 index 0000000..02c0711 --- /dev/null +++ b/rtems-build/m68k-m5235bcc/binutils/binutils-m68k-rtems.cfg @@ -0,0 +1,158 @@ +#Usage: configure [OPTIONS] [HOST] +# +#Options: [defaults in brackets] +# --prefix=MYDIR install into MYDIR [/usr/local] +# --exec-prefix=MYDIR install host-dependent files into MYDIR [/usr/local] +# --help print this message [normal config] +# --build=BUILD configure for building on BUILD [BUILD=HOST] +# --host=HOST configure for HOST [determined via config.guess] +# --norecursion configure this directory only [recurse] +# --program-prefix=FOO prepend FOO to installed program names [""] +# --program-suffix=FOO append FOO to installed program names [""] +# --program-transform-name=P transform installed names by sed pattern P [""] +# --site=SITE configure with site-specific makefile for SITE +# --srcdir=DIR find the sources in DIR [. or ..] +# --target=TARGET configure for TARGET [TARGET=HOST] +# --tmpdir=TMPDIR create temporary files in TMPDIR [/tmp] +# --nfp configure for software floating point [hard float] +# --with-FOO, --with-FOO=BAR package FOO is available (parameter BAR) +# --without-FOO package FOO is NOT available +# --enable-FOO, --enable-FOO=BAR include feature FOO (parameter BAR) +# --disable-FOO do not include feature FOO +# +#Where HOST and TARGET are something like "sparc-sunos", "mips-sgi-irix5", etc. +# +#Usage: configure [options] [host] +#Options: [defaults in brackets after descriptions] +#Configuration: +# --cache-file=FILE cache test results in FILE +# --help print this message +# --no-create do not create output files +# --quiet, --silent do not print `checking...' messages +# --version print the version of autoconf that created configure +#Directory and file names: +# --prefix=PREFIX install architecture-independent files in PREFIX +# [/usr/local] +# --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX +# [same as prefix] +# --bindir=DIR user executables in DIR [EPREFIX/bin] +# --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] +# --libexecdir=DIR program executables in DIR [EPREFIX/libexec] +# --datadir=DIR read-only architecture-independent data in DIR +# [PREFIX/share] +# --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] +# --sharedstatedir=DIR modifiable architecture-independent data in DIR +# [PREFIX/com] +# --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] +# --libdir=DIR object code libraries in DIR [EPREFIX/lib] +# --includedir=DIR C header files in DIR [PREFIX/include] +# --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] +# --infodir=DIR info documentation in DIR [PREFIX/info] +# --mandir=DIR man documentation in DIR [PREFIX/man] +# --srcdir=DIR find the sources in DIR [configure dir or ..] +# --program-prefix=PREFIX prepend PREFIX to installed program names +# --program-suffix=SUFFIX append SUFFIX to installed program names +# --program-transform-name=PROGRAM +# run sed PROGRAM on installed program names +#Host type: +# --build=BUILD configure for building on BUILD [BUILD=HOST] +# --host=HOST configure for HOST [guessed] +# --target=TARGET configure for TARGET [TARGET=HOST] +#Features and packages: +# --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) +# --enable-FEATURE[=ARG] include FEATURE [ARG=yes] +# --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] +# --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) +# --x-includes=DIR X include files are in DIR +# --x-libraries=DIR X library files are in DIR +#--enable and --with options recognized: +# --enable-shared[=PKGS] build shared libraries [default=no] +# --enable-static[=PKGS] build static libraries [default=yes] +# --enable-fast-install[=PKGS] optimize for fast installation [default=yes] +# --with-gnu-ld assume the C compiler uses GNU ld [default=no] +# --disable-libtool-lock avoid locking (might break parallel builds) +# --with-pic try to use only PIC/non-PIC objects [default=use both] +# --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes) +# --enable-targets alternative target configurations +# --enable-commonbfdlib build shared BFD/opcodes/libiberty library +# --with-mmap try using mmap for BFD input files if available +# --enable-build-warnings Enable build-time compiler warnings if gcc is used +# --enable-maintainer-mode enable make rules and dependencies not useful +# (and sometimes confusing) to the casual installer +# --disable-nls do not use Native Language Support +# --with-included-gettext use the GNU gettext library included here +#Usage: configure [options] [host] +#Options: [defaults in brackets after descriptions] +#Configuration: +# --cache-file=FILE cache test results in FILE +# --help print this message +# --no-create do not create output files +# --quiet, --silent do not print `checking...' messages +# --version print the version of autoconf that created configure +#Directory and file names: +# --prefix=PREFIX install architecture-independent files in PREFIX +# [/usr/local] +# --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX +# [same as prefix] +# --bindir=DIR user executables in DIR [EPREFIX/bin] +# --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] +# --libexecdir=DIR program executables in DIR [EPREFIX/libexec] +# --datadir=DIR read-only architecture-independent data in DIR +# [PREFIX/share] +# --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] +# --sharedstatedir=DIR modifiable architecture-independent data in DIR +# [PREFIX/com] +# --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] +# --libdir=DIR object code libraries in DIR [EPREFIX/lib] +# --includedir=DIR C header files in DIR [PREFIX/include] +# --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] +# --infodir=DIR info documentation in DIR [PREFIX/info] +# --mandir=DIR man documentation in DIR [PREFIX/man] +# --srcdir=DIR find the sources in DIR [configure dir or ..] +# --program-prefix=PREFIX prepend PREFIX to installed program names +# --program-suffix=SUFFIX append SUFFIX to installed program names +# --program-transform-name=PROGRAM +# run sed PROGRAM on installed program names +#Host type: +# --build=BUILD configure for building on BUILD [BUILD=HOST] +# --host=HOST configure for HOST [guessed] +# --target=TARGET configure for TARGET [TARGET=HOST] +#Features and packages: +# --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) +# --enable-FEATURE[=ARG] include FEATURE [ARG=yes] +# --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] +# --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) +# --x-includes=DIR X include files are in DIR +# --x-libraries=DIR X library files are in DIR +#--enable and --with options recognized: +# --enable-shared[=PKGS] build shared libraries [default=yes] +# --enable-static[=PKGS] build static libraries [default=yes] +# --enable-fast-install[=PKGS] optimize for fast installation [default=yes] +# --with-gnu-ld assume the C compiler uses GNU ld [default=no] +# --disable-libtool-lock avoid locking (might break parallel builds) +# --with-pic try to use only PIC/non-PIC objects [default=use both] +# --enable-targets alternative target configurations +# --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes) +# --enable-build-warnings Enable build-time compiler warnings if gcc is used +# --disable-nls do not use Native Language Support +# --with-included-gettext use the GNU gettext library included here +# --enable-maintainer-mode enable make rules and dependencies not useful +# (and sometimes confusing) to the casual installer + +# --target=i586-pc-linux-gnulibc1 +# --target=i586-mingw32 +# --target=m68k-coff +# --target=m68k-linux-gnulibc1 +# --target=h8300-hitachi-coff +# --target=tic30-ti-coff +# --host=i586-pc-linux-gnulibc1 +CFLAGS=-O2 LDFLAGS=-s \ +../../../binutils/configure \ +--host=i486-linux-gnu \ +--target=m68k-rtems4.7 \ +--with-gnu-ld --exec-prefix=/opt/m68k-rtems4.7 --prefix=/opt/m68k-rtems4.7 \ +--verbose --with-mmap --enable-64-bit-bfd \ +--enable-targets=m68k-linux-elf --disable-werror +#i586-go32, +#--ieee, +#srec,symbolsrec,tekhex,binary,ihex,trad-core diff --git a/rtems-build/m68k-m5235bcc/gcc/gcc-m68k-rtems.cfg b/rtems-build/m68k-m5235bcc/gcc/gcc-m68k-rtems.cfg new file mode 100644 index 0000000..8fda550 --- /dev/null +++ b/rtems-build/m68k-m5235bcc/gcc/gcc-m68k-rtems.cfg @@ -0,0 +1,364 @@ +# Usage: configure [options] [host] +# Options: [defaults in brackets after descriptions] +# Configuration: +# --cache-file=FILE cache test results in FILE +# --help print this message +# --no-create do not create output files +# --quiet, --silent do not print `checking...' messages +# --version print the version of autoconf that created configure +# Directory and file names: +# --prefix=PREFIX install architecture-independent files in PREFIX +# [/usr/local] +# --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX +# [same as prefix] +# --bindir=DIR user executables in DIR [EPREFIX/bin] +# --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] +# --libexecdir=DIR program executables in DIR [EPREFIX/libexec] +# --datadir=DIR read-only architecture-independent data in DIR +# [PREFIX/share] +# --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] +# --sharedstatedir=DIR modifiable architecture-independent data in DIR +# [PREFIX/com] +# --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] +# --libdir=DIR object code libraries in DIR [EPREFIX/lib] +# --includedir=DIR C header files in DIR [PREFIX/include] +# --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] +# --infodir=DIR info documentation in DIR [PREFIX/info] +# --mandir=DIR man documentation in DIR [PREFIX/man] +# --srcdir=DIR find the sources in DIR [configure dir or ..] +# --program-prefix=PREFIX prepend PREFIX to installed program names +# --program-suffix=SUFFIX append SUFFIX to installed program names +# --program-transform-name=PROGRAM +# run sed PROGRAM on installed program names +# Host type: +# --build=BUILD configure for building on BUILD [BUILD=HOST] +# --host=HOST configure for HOST [guessed] +# --target=TARGET configure for TARGET [TARGET=HOST] +# Features and packages: +# --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) +# --enable-FEATURE[=ARG] include FEATURE [ARG=yes] +# --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] +# --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) +# --x-includes=DIR X include files are in DIR +# --x-libraries=DIR X library files are in DIR +# --enable and --with options recognized: +# --with-gnu-ld arrange to work with GNU ld. +# --with-gnu-as arrange to work with GNU as. +# --with-stabs arrange to use stabs instead of host debug format. +# --with-elf arrange to use ELF instead of host debug format. +# --with-local-prefix=DIR specifies directory to put local include. +# --with-gxx-include-dir=DIR +# specifies directory to put g++ header files. +# --enable-checking enable expensive run-time checks. +# --enable-c-cpplib Use cpplib for C. +# --enable-haifa Use the experimental scheduler. +# --disable-haifa Don't use the experimental scheduler for the +# targets which normally enable it. +# --with-fast-fixincludes Use a faster fixinclude program. Experimental +# --enable-threads enable thread usage for target GCC. +# --enable-threads=LIB use LIB thread package for target GCC. +# + +# *-*-gnu*) +# *-*-linux-gnu*) +# *-*-sysv*) +# *-*-sysv4*) +# 1750a-*-*) +# a29k-*-*) # Default a29k environment. +# a29k-*-bsd* | a29k-*-sym1*) +# a29k-*-udi | a29k-*-coff) +# a29k-wrs-vxworks*) +# alpha*-*-*) +# alpha*-*-linux-gnu*) +# alpha*-*-linux-gnuecoff*) +# alpha*-*-linux-gnulibc1*) +# alpha*-*-netbsd*) +# alpha*-*-vxworks*) +# alpha*-*-winnt*) +# alpha*-dec-osf*) +# alpha*-dec-vms*) +# arc-*-elf*) +# arm*-*-*) +# arm*-*-netbsd*) +# arm-*-aout) +# arm-*-coff* | armel-*-coff*) +# arm-*-linux-gnuaout*) # ARM GNU/Linux +# arm-*-riscix*) # Acorn RISC machine +# arm-*-riscix1.[[01]]*) # Acorn RISC machine (early versions) +# arm-semi-aof | armel-semi-aof) +# arm-semi-aout | armel-semi-aout) +# c1-convex-*) # Convex C1 +# c2-convex-*) # Convex C2 +# c32-convex-*) +# c34-convex-*) +# c38-convex-*) +# case $machine in +# case $machine in +# clipper-intergraph-clix*) +# dsp16xx-*) +# elxsi-elxsi-*) +# esac +# esac +# esac +# h8300-*-*) +# hppa*-*-lites*) +# hppa1.0-*-bsd*) +# hppa1.0-*-hiux*) +# hppa1.0-*-hpux*) +# hppa1.0-*-hpux10*) +# hppa1.0-*-hpux7*) +# hppa1.0-*-hpux8*) +# hppa1.0-*-hpux8.0[[0-2]]*) +# hppa1.0-*-osf*) +# hppa1.1-*-bsd*) +# hppa1.1-*-hiux*) +# hppa1.1-*-hpux*) +# hppa1.1-*-hpux10*) +# hppa1.1-*-hpux8*) +# hppa1.1-*-hpux8.0[[0-2]]*) +# hppa1.1-*-osf*) +# hppa1.1-*-pro*) +# hppa1.1-*-rtems*) +# i370-*-mvs*) +# i386-*-vsta) # Intel 80386's running VSTa kernel +# i386-sun-sunos*) # Sun i386 roadrunner +# i486-*-*) +# i586-*-*) +# i686-*-* | i786-*-*) +# i860-*-bsd*) +# i860-*-mach*) +# i860-*-osf*) # Intel Paragon XP/S, OSF/1AD +# i860-*-sysv3*) +# i860-*-sysv4*) +# i860-alliant-*) # Alliant FX/2800 +# i960-*-*) # Default i960 environment. +# i960-*-coff*) +# i960-*-rtems) +# i960-wrs-vxworks*) +# i960-wrs-vxworks5 | i960-wrs-vxworks5.0*) +# i960-wrs-vxworks5* | i960-wrs-vxworks) +# i[[34567]]86-*-aout*) +# i[[34567]]86-*-bsd*) +# i[[34567]]86-*-bsdi* | i[[34567]]86-*-bsd386*) +# i[[34567]]86-*-coff*) +# i[[34567]]86-*-freebsd*) +# i[[34567]]86-*-freebsdelf*) +# i[[34567]]86-*-gnu*) +# i[[34567]]86-*-isc*) # 80386 running ISC system +# i[[34567]]86-*-linux-gnu*) # Intel 80386's running GNU/Linux +# i[[34567]]86-*-linux-gnuaout*) # Intel 80386's running GNU/Linux +# i[[34567]]86-*-linux-gnulibc1) # Intel 80386's running GNU/Linux +# i[[34567]]86-*-linux-gnuoldld*) # Intel 80386's running GNU/Linux +# i[[34567]]86-*-lynxos*) +# i[[34567]]86-*-mach*) +# i[[34567]]86-*-mingw32*) +# i[[34567]]86-*-netbsd*) +# i[[34567]]86-*-osf1*) # Intel 80386's running OSF/1 1.3+ +# i[[34567]]86-*-osfrose*) # 386 using OSF/rose +# i[[34567]]86-*-pe | i[[34567]]86-*-cygwin32) +# i[[34567]]86-*-rtems*) +# i[[34567]]86-*-rtemself*) +# i[[34567]]86-*-sco*) # 80386 running SCO system +# i[[34567]]86-*-sco3.2v4*) # 80386 running SCO 3.2v4 system +# i[[34567]]86-*-sco3.2v5*) # 80386 running SCO Open Server 5 +# i[[34567]]86-*-solaris2*) +# i[[34567]]86-*-sysv*) # Intel 80386's running system V +# i[[34567]]86-*-sysv4*) # Intel 80386's running system V.4 +# i[[34567]]86-*-sysv5*) # Intel x86 on System V Release 5 +# i[[34567]]86-*-winnt3*) +# i[[34567]]86-dg-dgux*) +# i[[34567]]86-go32-msdos | i[[34567]]86-*-go32*) +# i[[34567]]86-go32-rtems*) +# i[[34567]]86-ibm-aix*) # IBM PS/2 running AIX +# i[[34567]]86-moss-msdos* | i[[34567]]86-*-moss*) +# i[[34567]]86-ncr-sysv4*) # NCR 3000 - ix86 running system V.4 +# i[[34567]]86-next-*) +# i[[34567]]86-pc-msdosdjgpp*) +# i[[34567]]86-sequent-bsd*) # 80386 from Sequent +# i[[34567]]86-sequent-ptx1*) +# i[[34567]]86-sequent-ptx2* | i[[34567]]86-sequent-sysv3*) +# i[[34567]]86-sequent-ptx4* | i[[34567]]86-sequent-sysv4*) +# i[[34567]]86-wrs-vxworks*) +# if [[ "$target_cpu_default2" != "" ]] +# m32r-*-elf*) +# m68000-att-sysv*) +# m68000-convergent-sysv*) +# m68000-hp-bsd*) # HP 9000/200 running BSD +# m68000-hp-hpux*) # HP 9000 series 300 +# m68000-sun-sunos3*) +# m68000-sun-sunos4*) +# m68k*-*-netbsd*) +# m68k-*-aout*) +# m68k-*-coff*) +# m68k-*-linux-gnu*) # Motorola m68k's running GNU/Linux +# m68k-*-linux-gnuaout*) # Motorola m68k's running GNU/Linux +# m68k-*-linux-gnulibc1) # Motorola m68k's running GNU/Linux +# m68k-*-lynxos*) +# m68k-*-psos*) +# m68k-*-rtems*) +# m68k-*-sysv3*) # Motorola m68k's running system V.3 +# m68k-*-sysv4*) # Motorola m68k's running system V.4 +# m68k-altos-sysv*) # Altos 3068 +# m68k-apollo-*) +# m68k-apple-aux*) # Apple Macintosh running A/UX +# m68k-atari-sysv4*) # Atari variant of V.4. +# m68k-bull-sysv*) # Bull DPX/2 +# m68k-cbm-sysv4*) # Commodore variant of V.4. +# m68k-ccur-rtu) +# m68k-crds-unos*) +# m68k-hp-bsd*) # HP 9000/3xx running Berkeley Unix +# m68k-hp-bsd4.4*) # HP 9000/3xx running 4.4bsd +# m68k-hp-hpux*) # HP 9000 series 300 +# m68k-hp-hpux7*) # HP 9000 series 300 running HPUX version 7. +# m68k-isi-bsd*) +# m68k-motorola-sysv*) +# m68k-ncr-sysv*) # NCR Tower 32 SVR3 +# m68k-next-nextstep2*) +# m68k-next-nextstep3*) +# m68k-plexus-sysv*) +# m68k-sony-bsd* | m68k-sony-newsos*) +# m68k-sony-newsos3*) +# m68k-sun-mach*) +# m68k-sun-sunos*) # For SunOS 4 (the default). +# m68k-sun-sunos3*) +# m68k-tti-*) +# m68k-wrs-vxworks*) +# m88k-*-aout*) +# m88k-*-coff*) +# m88k-*-luna*) +# m88k-*-sysv3*) +# m88k-*-sysv4*) +# m88k-dg-dgux*) +# m88k-dolphin-sysv3*) +# m88k-tektronix-sysv3) +# mips*-*-*) +# mips*-*-ecoff* | mips*-*-elf*) +# mips-*-*) # Default MIPS RISC-OS 4.0. +# mips-*-bsd* | mips-*-riscosbsd* | mips-*-riscos[[1234]]bsd*) +# mips-*-ecoff*) +# mips-*-elf*) +# mips-*-gnu*) +# mips-*-riscos[[56789]]*) # Default MIPS RISC-OS 5.0. +# mips-*-riscos[[56789]]bsd*) +# mips-*-riscos[[56789]]sysv*) +# mips-*-riscos[[56789]]sysv4*) +# mips-*-sysv* | mips-*-riscos*sysv*) +# mips-*-sysv4* | mips-*-riscos[[1234]]sysv4* | mips-*-riscossysv4*) +# mips-*-ultrix* | mips-dec-mach3) # Decstation. +# mips-dec-bsd*) # Decstation running 4.4 BSD +# mips-dec-osf*) # Decstation running OSF/1 as shipped by DIGITAL +# mips-dec-osfrose*) # Decstation running OSF/1 reference port with OSF/rose. +# mips-sgi-*) # Mostly like a MIPS. +# mips-sgi-irix4*) # Mostly like a MIPS. +# mips-sgi-irix4loser*) # Mostly like a MIPS. +# mips-sgi-irix5*) # SGI System V.4., IRIX 5 +# mips-sgi-irix5cross64) # Irix5 host, Irix 6 target, cross64 +# mips-sgi-irix6*) # SGI System V.4., IRIX 6 +# mips-sni-sysv4) +# mips-sony-bsd* | mips-sony-newsos*) # Sony NEWS 3600 or risc/news. +# mips-sony-sysv*) # Sony NEWS 3800 with NEWSOS5.0. +# mips-tandem-sysv4*) # Tandem S2 running NonStop UX +# mips-wrs-vxworks) +# mips64-*-elf*) +# mips64el-*-elf*) +# mips64orion-*-elf*) +# mips64orion-*-rtems*) +# mips64orionel-*-elf*) +# mipsel-*-ecoff*) +# mipsel-*-elf*) +# mipsel-*-netbsd* | mips-dec-netbsd*) # Decstation running NetBSD +# mipstx39-*-elf*) +# mipstx39el-*-elf*) +# mn10200-*-*) +# mn10300-*-*) +# ns32k-*-netbsd*) +# ns32k-encore-bsd*) +# ns32k-merlin-*) +# ns32k-pc532-mach*) +# ns32k-pc532-minix*) +# ns32k-sequent-bsd*) +# ns32k-tek6100-bsd*) +# ns32k-tek6200-bsd*) +# pdp11-*-*) +# pdp11-*-bsd) +# powerpc*-*-* | rs6000-*-*) +# powerpc-*-beos*) +# powerpc-*-eabi*) +# powerpc-*-eabiaix*) +# powerpc-*-eabisim*) +# powerpc-*-linux-gnu*) +# powerpc-*-linux-gnulibc1) +# powerpc-*-rtems*) +# powerpc-*-sysv* | powerpc-*-elf*) +# powerpc-wrs-vxworks*) +# powerpcle-*-eabi*) +# powerpcle-*-eabisim*) +# powerpcle-*-pe | powerpcle-*-cygwin32) +# powerpcle-*-solaris2*) +# powerpcle-*-sysv* | powerpcle-*-elf*) +# powerpcle-*-winnt* ) +# pyramid-*-*) +# romp-*-aos*) +# romp-*-mach*) +# rs6000-*-lynxos*) +# rs6000-*-mach*) +# rs6000-bull-bosx) +# rs6000-ibm-aix*) +# rs6000-ibm-aix3.2.[[456789]]* | powerpc-ibm-aix3.2.[[456789]]*) +# rs6000-ibm-aix3.[[01]]*) +# rs6000-ibm-aix4.[[12]]* | powerpc-ibm-aix4.[[12]]*) +# rs6000-ibm-aix4.[[3456789]].* | powerpc-ibm-aix4.[[3456789]].*) +# rs6000-ibm-aix[[56789]].* | powerpc-ibm-aix[[56789]].*) +# sh-*-*) +# sh-*-elf*) +# sh-*-rtems*) +# sh-*-rtemself*) +# sparc*-*-*) +# sparc-*-aout*) +# sparc-*-bsd*) +# sparc-*-elf*) +# sparc-*-linux-gnu*) # Sparc's running GNU/Linux, libc6 +# sparc-*-linux-gnuaout*) # Sparc's running GNU/Linux, a.out +# sparc-*-linux-gnulibc1*) # Sparc's running GNU/Linux, libc5 +# sparc-*-lynxos*) +# sparc-*-netbsd*) +# sparc-*-rtems*) +# sparc-*-solaris2*) +# sparc-*-sunos3*) +# sparc-*-sunos4*) +# sparc-*-sunos4.0*) +# sparc-*-sysv4*) +# sparc-*-vxsim*) +# sparc-tti-*) +# sparc-wrs-vxworks* | sparclite-wrs-vxworks*) +# sparc64-*-aout*) +# sparc64-*-elf*) +# sparc64-*-linux*) # 64-bit Sparc's running GNU/Linux +# sparclet-*-aout*) +# sparclite-*-aout*) +# sparclite-*-coff*) +# target_cpu_default2= +# thumb-*-coff* | thumbel-*-coff*) +# v850-*-*) +# vax-*-*) # vax default entry +# vax-*-bsd*) # vaxen running BSD +# vax-*-netbsd*) +# vax-*-sysv*) # vaxen running system V +# vax-*-ultrix*) # vaxen running ultrix +# vax-*-vms*) # vaxen running VMS +# we32k-att-sysv*) + +# --target=m68k-linux-gnulibc1 +# --enable-version-specific-runtime-libs +# --with-float=soft \ + +../../../gcc/configure \ + --host=i486-linux-gnu \ + --target=m68k-rtems4.7 \ + --exec-prefix=/opt/m68k-rtems4.7 --prefix=/opt/m68k-rtems4.7 \ + --with-gnu-ld \ + --with-gnu-as \ + --with-newlib \ + --enable-languages=c,c++ \ + --enable-threads=rtems \ + --verbose diff --git a/rtems-build/m68k-m5235bcc/gdb/gdb-m68k-bdm-elf.cfg b/rtems-build/m68k-m5235bcc/gdb/gdb-m68k-bdm-elf.cfg new file mode 100755 index 0000000..3d32b56 --- /dev/null +++ b/rtems-build/m68k-m5235bcc/gdb/gdb-m68k-bdm-elf.cfg @@ -0,0 +1,82 @@ +#!/bin/bash + +export CFLAGS="-I /opt/m68k-rtems4.7/include" +export LDFLAGS="-L /opt/m68k-rtems4.7/lib" + +../../../gdb/configure \ + --target=m68k-bdm-elf \ + --prefix=/opt/m68k-rtems4.7 + +# Usage: configure [options] [host] +# Options: [defaults in brackets after descriptions] +# Configuration: +# --cache-file=FILE cache test results in FILE +# --help print this message +# --no-create do not create output files +# --quiet, --silent do not print `checking...' messages +# --site-file=FILE use FILE as the site file +# --version print the version of autoconf that created configure +# Directory and file names: +# --prefix=PREFIX install architecture-independent files in PREFIX +# [/usr/local] +# --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX +# [same as prefix] +# --bindir=DIR user executables in DIR [EPREFIX/bin] +# --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] +# --libexecdir=DIR program executables in DIR [EPREFIX/libexec] +# --datadir=DIR read-only architecture-independent data in DIR +# [PREFIX/share] +# --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] +# --sharedstatedir=DIR modifiable architecture-independent data in DIR +# [PREFIX/com] +# --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] +# --libdir=DIR object code libraries in DIR [EPREFIX/lib] +# --includedir=DIR C header files in DIR [PREFIX/include] +# --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] +# --infodir=DIR info documentation in DIR [PREFIX/info] +# --mandir=DIR man documentation in DIR [PREFIX/man] +# --srcdir=DIR find the sources in DIR [configure dir or ..] +# --program-prefix=PREFIX prepend PREFIX to installed program names +# --program-suffix=SUFFIX append SUFFIX to installed program names +# --program-transform-name=PROGRAM +# run sed PROGRAM on installed program names +# Host type: +# --build=BUILD configure for building on BUILD [BUILD=HOST] +# --host=HOST configure for HOST [guessed] +# --target=TARGET configure for TARGET [TARGET=HOST] +# Features and packages: +# --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) +# --enable-FEATURE[=ARG] include FEATURE [ARG=yes] +# --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] +# --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) +# --x-includes=DIR X include files are in DIR +# --x-libraries=DIR X library files are in DIR +# --enable and --with options recognized: +# --enable-maintainer-mode enable make rules and dependencies not useful +# (and sometimes confusing) to the casual installer +# --disable-nls do not use Native Language Support +# --with-included-gettext use the GNU gettext library included here +# --with-separate-debug-dir=path Look for global separate debug info in this path [LIBDIR/debug] +# --disable-gdbcli disable command-line interface (CLI) +# --disable-gdbmi disable machine-interface (MI) +# --enable-tui enable full-screen terminal user interface (TUI) +# --enable-gdbtk enable gdbtk graphical user interface (GUI) +# --with-libunwind Use libunwind frame unwinding support +# --enable-profiling enable profiling of GDB +# --without-included-regex don't use included regex; this is the default +# on systems with version 2 of the GNU C library +# (use with caution on other system) +# --with-sysroot[=DIR] Search for usr/lib et al within DIR. +# --enable-build-warnings Enable build-time compiler warnings if gcc is used +# --enable-gdb-build-warnings Enable GDB specific build-time compiler warnings if gcc is used +# --with-tclconfig=DIR Directory containing tcl configuration (tclConfig.sh) +# --with-tkconfig=DIR Directory containing tk configuration (tkConfig.sh) +# --with-tclinclude=DIR Directory where tcl private headers are +# --with-tkinclude=DIR Directory where tk private headers are +# --with-itclconfig Directory containing itcl configuration (itclConfig.sh) +# --with-itkconfig Directory containing itk configuration (itkConfig.sh) +# --with-x use the X Window System +# --enable-sim Link gdb with simulator +# --enable-multi-ice build the multi-ice-gdb-server +# --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib +# \ No newline at end of file diff --git a/rtems-build/m68k-m5235bcc/gdb/m5235.gdb b/rtems-build/m68k-m5235bcc/gdb/m5235.gdb new file mode 100644 index 0000000..f6b7ed1 --- /dev/null +++ b/rtems-build/m68k-m5235bcc/gdb/m5235.gdb @@ -0,0 +1,145 @@ +target bdm /dev/bdmcf0 + +set remotecache off + +set $IPSBAR = 0x40000000 + +set $DCR = $IPSBAR + 0x000040 +set $DACR0 = $IPSBAR + 0x000048 +set $DMR0 = $IPSBAR + 0x00004C + +set $CSAR0 = $IPSBAR + 0x000080 +set $CSMR0 = $IPSBAR + 0x000084 +set $CSCR0 = $IPSBAR + 0x00008A + +set $PAR_SDRAM = $IPSBAR + 0x100046 +set $PAR_AD = $IPSBAR + 0x100040 + +set $WCR = $IPSBAR + 0x140000 + +define delay + set $delay = 0 + while ($delay < 20000) + set $delay += 1 + end +end + +define delay_memsync + set $delay = 0 + while ($delay < 1000) + set $delay += 1 + end +end + +define setup-cs + # 2MB FLASH on CS0 at 0x80000000 + set *(unsigned short *)$CSAR0 = 0x0000ffe0 + set *(unsigned long *)$CSMR0 = 0x001F0001 + set *(unsigned short *)$CSCR0 = 0x00001980 +end + +define setup-sdram + # Set PAR_SDRAM to allow SDRAM signals to be enable + set *(unsigned char *)$PAR_SDRAM = 0x3F + # Set PAR_AD to allow 32-bit SDRAM if the external boot device is 16-bit + set *(unsigned char *)$PAR_AD = 0xE1 + + # SDRAM + set *(unsigned short *)$DCR = 0x0446 + set *(unsigned long *)$DACR0 = 0x00001300 + set *(unsigned long *)$DMR0 = 0x00FC0001 + + # Set IP in DACR and init precharge. + set *(unsigned long *)$DACR0 |= 0x00000008 + set *(0x00000000) = 0xAA55AA55 + delay + + # Set RE in DACR + set *(unsigned long *)$DACR0 |= 0x00008000 + # Issue IMRS + set *(unsigned long *)$DACR0 |= 0x00000040 + set *(0x00000400) = 0xAA55AA55 + delay +end + +define setup-other + # Turn Off WCR + set *(unsigned char *)$WCR = 0x00 +end + +define setup-board + bdm-reset + + # Set VBR to the vector table. + #set $vbr = 0x00000000 + # Set internal SRAM to start at 0x20000000 + #set $rambar = 0x20000001 + + setup-other + setup-cs + setup-sdram +end + +define debug-sramtest + set $srambase = 0x20000000 + set $sramsize = 0x00010000 + set $j = 0 + printf "Testing SRAM : 0x%08X - 0x%08X\n", $srambase, ($srambase + $sramsize) + set $i = $srambase + while $i < ($srambase + $sramsize) + set *(unsigned long *)($i) = 0xAA55AA55 + delay_memsync + if 0xAA55AA55 != *(unsigned long *)$i + printf " 0x%08X = FAIL\n", $i + else + printf " 0x%08X = OK", $i + if $j % 4 == 3 + printf "\n" + end + set $j = $j + 1 + end + set $i = $i + 0x400 + end +end + +define debug-ramtest + set $sdrambase = 0x00000000 + set $sdramsize = 0x01000000 + set $j = 0 + printf "Testing SDRAM : 0x%08X - 0x%08X\n", $sdrambase, ($sdrambase + $sdramsize) + set $i = $sdrambase + while $i < ($sdrambase + $sdramsize) + set *(unsigned long *)($i) = 0xAA55AA55 + delay_memsync + if 0xAA55AA55 != *(unsigned long *)$i + printf " 0x%08X = FAIL\n", $i + else + printf " 0x%08X = OK", $i + if $j % 4 == 3 + printf "\n" + end + set $j = $j + 1 + end + set $i = $i + 0x10000 + end + printf "\n" +end + +define execute + set $pc = *(long *)0x00000004 + tbreak main + tk gdbtk_update +end + +define debug-printexception + printf "vector: %d", *(unsigned short *)$sp >> 2 &0x1F + printf "old pc: 0x%08x", *(unsigned long *)($sp + 4) + printf "old sr: 0x%02x", *(unsigned short *)($sp + 2) +end + +define six + si + x /10i $pc +end + +setup-board \ No newline at end of file diff --git a/rtems-build/m68k-m5235bcc/rtems/m68k-rtems-sys-m5235bcc.cfg b/rtems-build/m68k-m5235bcc/rtems/m68k-rtems-sys-m5235bcc.cfg new file mode 100644 index 0000000..c77068e --- /dev/null +++ b/rtems-build/m68k-m5235bcc/rtems/m68k-rtems-sys-m5235bcc.cfg @@ -0,0 +1,121 @@ +../../../rtems/configure --target=m68k-rtems4.7 --prefix=/opt/m68k-rtems4.7 \ + --enable-rtems-inlines --disable-multiprocessing --enable-cxx \ + --enable-rdbg --enable-maintainer-mode --enable-tests=yes \ + --enable-networking --enable-posix --enable-itron --disable-ada \ + --disable-expada --disable-multilib --disable-docs \ + --enable-rtemsbsp=mcf5235 + +# --enable-rtems-debug \ +# `configure' configures rtems 4.6.99.1 to adapt to many kinds of systems. +# +# Usage: ../rtems/configure [OPTION]... [VAR=VALUE]... +# +# To assign environment variables (e.g., CC, CFLAGS...), specify them as +# VAR=VALUE. See below for descriptions of some of the useful variables. +# +# Defaults for the options are specified in brackets. +# +# Configuration: +# -h, --help display this help and exit +# --help=short display options specific to this package +# --help=recursive display the short help of all the included packages +# -V, --version display version information and exit +# -q, --quiet, --silent do not print `checking...' messages +# --cache-file=FILE cache test results in FILE [disabled] +# -C, --config-cache alias for `--cache-file=config.cache' +# -n, --no-create do not create output files +# --srcdir=DIR find the sources in DIR [configure dir or `..'] +# +# Installation directories: +# --prefix=PREFIX install architecture-independent files in PREFIX +# [/opt/rtems-4.7] +# --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX +# [PREFIX] +# +# By default, `make install' will install all the files in +# `/opt/rtems-4.7/bin', `/opt/rtems-4.7/lib' etc. You can specify +# an installation prefix other than `/opt/rtems-4.7' using `--prefix', +# for instance `--prefix=$HOME'. +# +# For better control, use the options below. +# +# Fine tuning of the installation directories: +# --bindir=DIR user executables [EPREFIX/bin] +# --sbindir=DIR system admin executables [EPREFIX/sbin] +# --libexecdir=DIR program executables [EPREFIX/libexec] +# --datadir=DIR read-only architecture-independent data [PREFIX/share] +# --sysconfdir=DIR read-only single-machine data [PREFIX/etc] +# --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] +# --localstatedir=DIR modifiable single-machine data [PREFIX/var] +# --libdir=DIR object code libraries [EPREFIX/lib] +# --includedir=DIR C header files [PREFIX/include] +# --oldincludedir=DIR C header files for non-gcc [/usr/include] +# --infodir=DIR info documentation [PREFIX/info] +# --mandir=DIR man documentation [PREFIX/man] +# +# Program names: +# --program-prefix=PREFIX prepend PREFIX to installed program names +# --program-suffix=SUFFIX append SUFFIX to installed program names +# --program-transform-name=PROGRAM run sed PROGRAM on installed program names +# +# System types: +# --build=BUILD configure for building on BUILD [guessed] +# --host=HOST cross-compile to build programs to run on HOST [BUILD] +# --target=TARGET configure for building compilers for TARGET [HOST] +# +# Optional Features: +# --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) +# --enable-FEATURE[=ARG] include FEATURE [ARG=yes] +# --enable-maintainer-mode enable make rules and dependencies not useful +# (and sometimes confusing) to the casual installer +# --enable-multiprocessing +# enable multiprocessing interface +# --enable-posix enable posix interface +# --enable-itron enable itron interface +# --enable-networking enable TCP/IP stack +# --enable-rdbg enable remote debugger +# --enable-rtems-inlines enable RTEMS inline functions (default:enabled, +# disable to use macros) +# --enable-cxx enable C++ support and build the rtems++ library +# --enable-tests enable tests (default:samples) +# --enable-rtems-debug enable RTEMS_DEBUG +# --enable-rtemsbsp="bsp1 bsp2 .." +# BSPs to include in build +# --enable-multilib build many library versions (default=no) +# --enable-docs enable building documentation (default:disabled) +# CC_FOR_BUILD +# c-compiler to be used for build subdirs (default: auto-detected) +# CFLAGS_FOR_BUILD +# c-flags to be used for build subdirs (default: provided by +# autoconf) +# CXX_FOR_BUILD +# c++-compiler to be used for build subdirs (default: +# auto-detected) +# CXXFLAGS_FOR_BUILD +# c++-flags to be used for build subdirs (default: provided by +# autoconf) +# CC_FOR_HOST c-compiler to be used for host subdirs (default: auto-detected) +# CFLAGS_FOR_HOST +# c-flags to be used for host subdirs (default: provided by +# autoconf) +# CXX_FOR_HOST +# c++-compiler to be used for host subdirs (default: +# auto-detected) +# CXXFLAGS_FOR_HOST +# c++-flags to be used for host subdirs (default: provided by +# autoconf) +# CC_FOR_TARGET +# c-compiler to be used for target subdirs (default: +# auto-detected) +# CFLAGS_FOR_TARGET +# c-flags to be used for target subdirs (default: provided by +# autoconf) +# CXX_FOR_TARGET +# c++-compiler to be used for target subdirs (default: +# auto-detected) +# CXXFLAGS_FOR_TARGET +# c++-flags to be used for target subdirs (default: provided by +# autoconf) +# +# Report bugs to . +# diff --git a/rtems-patches/rtems-m5235bcc-changes.patch b/rtems-patches/rtems-m5235bcc-changes.patch new file mode 100644 index 0000000..4ad67a9 --- /dev/null +++ b/rtems-patches/rtems-m5235bcc-changes.patch @@ -0,0 +1,104 @@ +--- + c/src/lib/libbsp/m68k/mcf5235/start/start.S | 1 + c/src/lib/libbsp/m68k/mcf5235/startup/init5235.c | 75 ++++++++++++----------- + 2 files changed, 42 insertions(+), 34 deletions(-) + +Index: rtems-4.6.99.3/c/src/lib/libbsp/m68k/mcf5235/start/start.S +=================================================================== +--- rtems-4.6.99.3.orig/c/src/lib/libbsp/m68k/mcf5235/start/start.S 2006-12-07 16:00:00.000000000 +0100 ++++ rtems-4.6.99.3/c/src/lib/libbsp/m68k/mcf5235/start/start.S 2006-12-07 16:09:00.000000000 +0100 +@@ -315,6 +315,7 @@ + move.l #0x01000000,d0 | Set system frequency to 150 MHz + move.l d0, (0x40120000) + move.w #0x2700,sr | Disable interrupts ++ move.l #INITIAL_STACK,sp + + move.l #__SRAMBASE+1,d0 | Enable the MCF5235 internal SRAM + movec d0,%rambar | ...so we have a stack +Index: rtems-4.6.99.3/c/src/lib/libbsp/m68k/mcf5235/startup/init5235.c +=================================================================== +--- rtems-4.6.99.3.orig/c/src/lib/libbsp/m68k/mcf5235/startup/init5235.c 2006-12-07 16:03:50.000000000 +0100 ++++ rtems-4.6.99.3/c/src/lib/libbsp/m68k/mcf5235/startup/init5235.c 2006-12-07 16:21:37.000000000 +0100 +@@ -24,41 +24,48 @@ + MCF5235_GPIO_UART=0x3FFF; + MCF5235_GPIO_PAR_AD=0xE1; + +- //Setup the Chip Selects so CS0 is flash +- MCF5235_CS_CSAR0 =(0xFFE00000 & 0xffff0000)>>16; +- MCF5235_CS_CSMR0 = 0x001f0001; +- MCF5235_CS_CSCR0 = 0x1980; +- +- //Setup the SDRAM +- for(x=0; x<20000; x++) +- { +- temp +=1; +- } +- MCF5235_SDRAMC_DCR = 0x042E; +- MCF5235_SDRAMC_DACR0 = 0x00001300; +- MCF5235_SDRAMC_DMR0 = (0x00FC0000) | (0x00000001); +- for(x=0; x<20000; x++) +- { +- temp +=1; +- } +- // set ip ( bit 3 ) in dacr +- MCF5235_SDRAMC_DACR0 |= (0x00000008) ; +- // init precharge +- *((unsigned long *)MM_SDRAM_BASE) = 0xDEADBEEF; +- // set RE in dacr +- MCF5235_SDRAMC_DACR0 |= (0x00008000); +- // wait +- for(x=0; x<20000; x++) +- { +- temp +=1; +- } +- // issue IMRS +- MCF5235_SDRAMC_DACR0 |= (0x00000040); +- *((short *)MM_SDRAM_BASE) = 0; +- for(x=0; x<60000; x++) +- { +- temp +=1; ++ /* Find actual execution address */ ++ asm ("\tlea.l @pc,%0\n\t" : "=r" (temp) ); ++ ++ /* Initialization of SDRAM leads to disaster if code runs from it */ ++ if ((temp ^ MM_SDRAM_BASE) & ~0x000fffff) { ++ //Setup the Chip Selects so CS0 is flash ++ MCF5235_CS_CSAR0 =(0xFFE00000 & 0xffff0000)>>16; ++ MCF5235_CS_CSMR0 = 0x001f0001; ++ MCF5235_CS_CSCR0 = 0x1980; ++ ++ //Setup the SDRAM ++ for(x=0; x<20000; x++) ++ { ++ temp +=1; ++ } ++ MCF5235_SDRAMC_DCR = 0x042E; ++ MCF5235_SDRAMC_DACR0 = 0x00001300; ++ MCF5235_SDRAMC_DMR0 = (0x00FC0000) | (0x00000001); ++ for(x=0; x<20000; x++) ++ { ++ temp +=1; ++ } ++ // set ip ( bit 3 ) in dacr ++ MCF5235_SDRAMC_DACR0 |= (0x00000008) ; ++ // init precharge ++ *((unsigned long *)MM_SDRAM_BASE) = 0xDEADBEEF; ++ // set RE in dacr ++ MCF5235_SDRAMC_DACR0 |= (0x00008000); ++ // wait ++ for(x=0; x<20000; x++) ++ { ++ temp +=1; ++ } ++ // issue IMRS ++ MCF5235_SDRAMC_DACR0 |= (0x00000040); ++ *((short *)MM_SDRAM_BASE) = 0; ++ for(x=0; x<60000; x++) ++ { ++ temp +=1; ++ } + } ++ + *((unsigned long*)MM_SDRAM_BASE)=0x12345678; + + /* Copy the interrupt vector table to address 0x0 in SDRAM */