* patch to add support for mcf5282 based Future/Netburner 5282Badge eval board
@ 2005-04-13 13:41 Errin Bechtel
0 siblings, 0 replies; only message in thread
From: Errin Bechtel @ 2005-04-13 13:41 UTC (permalink / raw)
To: ecos-devel
Index:
packages/hal/m68k/mcf52xx/mcf5282/5282badge/plf/current/cdl/hal_m68k_mcf52xx_mcf5282_5282badge.cdl
===================================================================
RCS file:
packages/hal/m68k/mcf52xx/mcf5282/5282badge/plf/current/cdl/hal_m68k_mcf52xx_mcf5282_5282badge.cdl
diff -N
packages/hal/m68k/mcf52xx/mcf5282/5282badge/plf/current/cdl/hal_m68k_mcf52xx_mcf5282_5282badge.cdl
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++
packages/hal/m68k/mcf52xx/mcf5282/5282badge/plf/current/cdl/hal_m68k_mcf52xx_mcf5282_5282badge.cdl
1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,270 @@
+#
====================================================================
+#
+# hal_m68k_mcf52xx_mcf5282_5282badge.cdl
+#
+# Future/Netburner 5282badge evaluation board
HAL package configuration data
+#
+#
====================================================================
+#####ECOSGPLCOPYRIGHTBEGIN####
+## -------------------------------------------
+## This file is part of eCos, the Embedded
Configurable Operating System.
+## Copyright (C) 1998, 1999, 2000, 2001, 2002 Red
Hat, Inc.
+##
+## eCos is free software; you can redistribute it
and/or modify it under
+## the terms of the GNU General Public License as
published by the Free
+## Software Foundation; either version 2 or (at your
option) any later version.
+##
+## eCos 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 eCos; if not, write to the Free Software
Foundation, Inc.,
+## 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA.
+##
+## As a special exception, if other files instantiate
templates or use macros
+## or inline functions from this file, or you compile
this file and link it
+## with other works to produce a work based on this
file, this file does not
+## by itself cause the resulting work to be covered
by the GNU General Public
+## License. However the source code for this file
must still be made available
+## in accordance with section (3) of the GNU General
Public License.
+##
+## This exception does not invalidate any other
reasons why a work based on
+## this file might be covered by the GNU General
Public License.
+##
+## Alternative licenses for eCos may be arranged by
contacting Red Hat, Inc.
+## at http://sources.redhat.com/ecos/ecos-license/
+## -------------------------------------------
+#####ECOSGPLCOPYRIGHTEND####
+#
====================================================================
+
+cdl_package
CYGPKG_HAL_M68K_MCF52xx_MCF5282_FUTURENETBURNER5282BADGE
{
+ display "Future/Netburner 5282badge
evaluation board"
+ parent CYGPKG_HAL_M68K_MCF52xx_MCF5282
+ define_header
hal_m68k_mcf52xx_mcf5282_5282badge.h
+ include_dir cyg/hal
+
+ description "The Future/Netburner 5282badge
evaluation board platform HAL
+ package should be used when targeting
the actual hardware for
+ the Future/Netburner 5282badge
evaluation board platform."
+
+ define_proc {
+ puts $::cdl_header "#include
<pkgconf/hal_m68k_mcf52xx_mcf5282.h>"
+ }
+
+ compile plf_startup.c hal_diag.c plf_misc.c
+
+# implements CYGINT_HAL_DEBUG_GDB_STUBS
+# implements CYGINT_HAL_DEBUG_GDB_STUBS_BREAK
+
+ define_proc {
+ puts $::cdl_system_header "#define
CYGBLD_HAL_TARGET_H <pkgconf/hal_m68k.h>"
+ puts $::cdl_system_header "#define
CYGBLD_HAL_VARIANT_H
<pkgconf/hal_m68k_mcf52xx_mcf5282.h>"
+ puts $::cdl_system_header "#define
CYGBLD_HAL_PLATFORM_H
<pkgconf/hal_m68k_mcf52xx_mcf5282_5282badge.h>"
+ }
+
+ cdl_component CYG_HAL_STARTUP {
+ display "Startup type"
+ flavor data
+ legal_values {"RAM" "ROM"}
+ default_value {"RAM"}
+ no_define
+ define -file system.h CYG_HAL_STARTUP
+
+ description "When targeting the
Future/Netburner 5282badge evaluation board
+ it is expected that the image
will be downloaded into RAM
+ via the Motorola dBUG monitor."
+
+ }
+
+ cdl_option CYGHWR_HAL_SYSTEM_CLOCK_MHZ {
+ display "System clock speed in MHz"
+ flavor data
+ legal_values 66.3552
+ default_value 66.3552
+
+ description "This option identifies the
system clock that the
+ processor uses. This value is
used to set clock dividers
+ for some devices."
+
+ }
+
+ cdl_option
CYGHWR_HAL_M68K_MCF52xx_MCF5282_5282BADGE_DIAG_BAUD {
+ display "Diagnostic Serial Port Baud
Rate"
+ flavor data
+ legal_values 9600 19200 38400 115200
+ default_value 115200
+
+ description "This option selects the
baud rate used for the
+ diagnostic port. Note: this
should match the value chosen
+ for the GDB port if the
diagnostic and GDB port are the
+ same."
+
+ }
+
+ cdl_option
CYGHWR_HAL_M68K_MCF52xx_MCF5282_5282BADGE_GDB_BAUD {
+ display "GDB Serial Port Baud Rate"
+ flavor data
+ legal_values 9600 19200 38400 115200
+ default_value 115200
+
+ description "This option controls the baud
rate used for the GDB
+ connection."
+
+ }
+
+ # Real-time clock/counter specifics
+ cdl_component CYGNUM_HAL_RTC_CONSTANTS {
+ display "Real-time clock constants."
+ flavor none
+
+ description "Set the periodic timer on
the mcf5282 to 1.25 ms or
+ 1250000 ns."
+
+ cdl_option CYGNUM_HAL_RTC_NUMERATOR {
+ display "Real-time clock numerator"
+ flavor data
+ default_value 1000000000
+ }
+ cdl_option CYGNUM_HAL_RTC_DENOMINATOR {
+ display "Real-time clock
denominator"
+ flavor data
+ default_value 1000
+ }
+ cdl_option CYGNUM_HAL_RTC_PERIOD {
+ display "Real-time clock period"
+ flavor data
+ default_value 1250000
+ }
+ }
+
+ cdl_component CYGBLD_GLOBAL_OPTIONS {
+ display "Global build options"
+ flavor none
+ parent CYGPKG_NONE
+
+ description "Global build options
including control over compiler
+ flags, linker flags and choice of
toolchain."
+
+ cdl_option CYGBLD_GLOBAL_COMMAND_PREFIX {
+ display "Global command prefix"
+ flavor data
+ no_define
+ default_value { "m68k-elf" }
+
+ description "This option specifies
the command prefix used
+ when invoking the build
tools."
+
+ }
+
+ cdl_option CYGBLD_GLOBAL_CFLAGS {
+ display "Global compiler flags"
+ flavor data
+ no_define
+ default_value { "-m5200 -malign-int -Wall
-Wpointer-arith -Wstrict-prototypes -Winline -Wundef
-Woverloaded-virtual -g -O2 -ffunction-sections
-fdata-sections -fno-rtti -fno-exceptions
-fvtable-thunks=3 -finit-priority
-fomit-frame-pointer" }
+ description "This option controls
the global compiler flags
+ which are used to compile
all packages by default.
+ Individual packages may
define options which
+ override these global
flags."
+
+ }
+
+ cdl_option CYGBLD_GLOBAL_LDFLAGS {
+ display "Global linker flags"
+ flavor data
+ no_define
+ default_value { "-m5200 -g -nostdlib
-Wl,--gc-sections -Wl,-static" }
+
+ description "This option controls
the global linker flags.
+ Individual packages may
define options which
+ override these global
flags."
+
+ }
+
+ cdl_option CYGBLD_BUILD_GDB_STUBS {
+ display "Build GDB stub ROM image"
+ default_value 0
+ requires { CYG_HAL_STARTUP == "ROM" }
+ requires CYGSEM_HAL_ROM_MONITOR
+ requires CYGBLD_BUILD_COMMON_GDB_STUBS
+ requires
CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
+ requires !
CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT
+ requires !
CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT
+ requires !
CYGDBG_HAL_COMMON_INTERRUPTS_SAVE_MINIMUM_CONTEXT
+ requires !
CYGDBG_HAL_COMMON_CONTEXT_SAVE_MINIMUM
+ no_define
+
+ description "This option enables
the building of the GDB
+ stubs for the board.
The common HAL controls
+ takes care of most of
the build process, but the
+ final conversion from ELF
image to binary data is
+ handled by the platform
CDL, allowing relocation
+ of the data if
necessary."
+
+ make -priority 320 {
+ <PREFIX>/bin/gdb_module.srec :
<PREFIX>/bin/gdb_module.img
+ $(OBJCOPY) -O srec $< $@
+ }
+ }
+ }
+
+ cdl_component CYGHWR_MEMORY_LAYOUT {
+ display "Memory layout"
+ flavor data
+ no_define
+ calculated { CYG_HAL_STARTUP == "RAM" ?
"m68k_mcf52xx_mcf5282_5282badge_ram" : \
+
"m68k_mcf52xx_mcf5282_5282badge_rom" }
+
+ cdl_option CYGHWR_MEMORY_LAYOUT_LDI {
+ display "Memory layout linker script
fragment"
+ flavor data
+ no_define
+ define -file system.h
CYGHWR_MEMORY_LAYOUT_LDI
+ calculated { CYG_HAL_STARTUP == "RAM" ?
"<pkgconf/mlt_m68k_mcf52xx_mcf5282_5282badge_ram.ldi>"
: \
+
"<pkgconf/mlt_m68k_mcf52xx_mcf5282_5282badge_rom.ldi>"
}
+ }
+
+ cdl_option CYGHWR_MEMORY_LAYOUT_H {
+ display "Memory layout header file"
+ flavor data
+ no_define
+ define -file system.h
CYGHWR_MEMORY_LAYOUT_H
+ calculated { CYG_HAL_STARTUP == "RAM" ?
"<pkgconf/mlt_m68k_mcf52xx_mcf5282_5282badge_ram.h>" :
\
+
"<pkgconf/mlt_m68k_mcf52xx_mcf5282_5282badge_rom.h>" }
+ }
+ }
+
+ cdl_option CYGSEM_HAL_USE_ROM_MONITOR {
+ display "Work with a ROM monitor"
+ flavor booldata
+ legal_values { "GDB_stubs" }
+ default_value { CYG_HAL_STARTUP == "RAM" ?
"GDB_stubs" : 0 }
+ requires { CYG_HAL_STARTUP == "RAM" }
+ parent CYGPKG_HAL_ROM_MONITOR
+
+ description "Support can be enabled
for boot ROMs or ROM
+ monitors which contain GDB
stubs. This support
+ changes various eCos
semantics such as the encoding of
+ diagnostic output, and the
overriding of hardware
+ interrupt vectors."
+
+ }
+
+ cdl_option CYGSEM_HAL_ROM_MONITOR {
+ display "Behave as a ROM monitor"
+ flavor bool
+ default_value 0
+ parent CYGPKG_HAL_ROM_MONITOR
+ requires { CYG_HAL_STARTUP == "ROM" }
+
+ description "Enable this option if this
program is to be used as
+ a ROM monitor, i.e.
applications will be loaded into
+ RAM on the board, and this
ROM monitor may process
+ exceptions or interrupts
generated from the
+ application. This enables
features such as utilizing
+ a separate interrupt
stack when exceptions are
+ generated."
+
+ }
+}
Index:
packages/hal/m68k/mcf52xx/mcf5282/5282badge/plf/current/include/hal_memmap.h
===================================================================
RCS file:
packages/hal/m68k/mcf52xx/mcf5282/5282badge/plf/current/include/hal_memmap.h
diff -N
packages/hal/m68k/mcf52xx/mcf5282/5282badge/plf/current/include/hal_memmap.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++
packages/hal/m68k/mcf52xx/mcf5282/5282badge/plf/current/include/hal_memmap.h
1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,67 @@
+#ifndef HAL_MEMMAP_H
+#define HAL_MEMMAP_H
+//==========================================================================
+//####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded
Configurable Operating System.
+// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red
Hat, Inc.
+//
+// eCos is free software; you can redistribute it
and/or modify it under
+// the terms of the GNU General Public License as
published by the Free
+// Software Foundation; either version 2 or (at your
option) any later version.
+//
+// eCos 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 eCos; if not, write to the Free Software
Foundation, Inc.,
+// 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA.
+//
+// As a special exception, if other files instantiate
templates or use macros
+// or inline functions from this file, or you compile
this file and link it
+// with other works to produce a work based on this
file, this file does not
+// by itself cause the resulting work to be covered
by the GNU General Public
+// License. However the source code for this file
must still be made available
+// in accordance with section (3) of the GNU General
Public License.
+//
+// This exception does not invalidate any other
reasons why a work based on
+// this file might be covered by the GNU General
Public License.
+//
+// Alternative licenses for eCos may be arranged by
contacting Red Hat, Inc.
+// at http://sources.redhat.com/ecos/ecos-license/
+// -------------------------------------------
+//####ECOSGPLCOPYRIGHTEND####
+//==========================================================================
+
+#include <cyg/infra/cyg_type.h>
+
+// WARNING: DO NOT CHANGE THE TYPES OF THESE
LABELS. THE LINKER DEFINES
+// THESE AND WE WANT TO USE THE VARIABLES NOT THE
VARIABLES THEMSELVES.
+
+#define SECTION_DEC(_name_) \
+ externC unsigned char __ ## _name_ ## _start[]; \
+ externC unsigned char __ ## _name_ ## _end[]; \
+ externC unsigned char __ ## _name_ ## _size[];
+
+SECTION_DEC(rom)
+SECTION_DEC(ram)
+SECTION_DEC(bss)
+SECTION_DEC(sbss)
+SECTION_DEC(ram_data)
+SECTION_DEC(rom_data)
+SECTION_DEC(heap1)
+SECTION_DEC(uninvar)
+SECTION_DEC(romvec)
+SECTION_DEC(ramvec)
+
+/*****************************************************************************
+On-chip registers, System Integration Module (SIM)
+*****************************************************************************/
+
+#define MCF5282_MBAR (0x40000000)
+#define MCF5282_EXT_SDRAM (0x30000000)
+
+#endif /* HAL_MEMMAP_H */
+
Index:
packages/hal/m68k/mcf52xx/mcf5282/5282badge/plf/current/include/plf_intr.h
===================================================================
RCS file:
packages/hal/m68k/mcf52xx/mcf5282/5282badge/plf/current/include/plf_intr.h
diff -N
packages/hal/m68k/mcf52xx/mcf5282/5282badge/plf/current/include/plf_intr.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++
packages/hal/m68k/mcf52xx/mcf5282/5282badge/plf/current/include/plf_intr.h
1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,97 @@
+#ifndef CYGONCE_HAL_PLF_INTR_H
+#define CYGONCE_HAL_PLF_INTR_H
+
+//==========================================================================
+//
+// plf_intr.h
+//
+// Platform specific interrupt and clock support
+//
+//
+//==========================================================================
+//####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded
Configurable Operating System.
+// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red
Hat, Inc.
+//
+// eCos is free software; you can redistribute it
and/or modify it under
+// the terms of the GNU General Public License as
published by the Free
+// Software Foundation; either version 2 or (at your
option) any later version.
+//
+// eCos 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 eCos; if not, write to the Free Software
Foundation, Inc.,
+// 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA.
+//
+// As a special exception, if other files instantiate
templates or use macros
+// or inline functions from this file, or you compile
this file and link it
+// with other works to produce a work based on this
file, this file does not
+// by itself cause the resulting work to be covered
by the GNU General Public
+// License. However the source code for this file
must still be made available
+// in accordance with section (3) of the GNU General
Public License.
+//
+// This exception does not invalidate any other
reasons why a work based on
+// this file might be covered by the GNU General
Public License.
+//
+// Alternative licenses for eCos may be arranged by
contacting Red Hat, Inc.
+// at http://sources.redhat.com/ecos/ecos-license/
+// -------------------------------------------
+//####ECOSGPLCOPYRIGHTEND####
+//==========================================================================
+
+#include <pkgconf/hal.h>
+#include <cyg/infra/cyg_type.h>
+
+//--------------------------------------------------------------------------
+// Interrupt vectors.
+
+/* The vector used by the Real time clock
*/
+#define CYGNUM_HAL_INTERRUPT_RTC
(CYGNUM_HAL_VECTOR_PIT0)
+
+//---------------------------------------------------------------------------
+// Clock control
+
+/* The mcf5282 has 4 timers 0-3. Define the
timer number that we want */
+/* to use for the OS's clock.
*/
+
+#define CYGNUM_HAL_RTC_TIMER_NUM (0)
+
+/* Set the timer to generate 1 ms or 1250000 ns
period interrupts. */
+
+#define HAL_M68K_MCF52xx_MCF5282_CLOCK_NS 1250000
+#if CYGNUM_HAL_RTC_PERIOD !=
HAL_M68K_MCF52xx_MCF5282_CLOCK_NS
+#warning Unexpected clock period for this board!!!
+#endif
+
+/* Initialize the timer to generate an interrupt
every 1 ms. Use the */
+/* system clock divided by 16 as the source. Using
11*3 as the prescaler */
+/* gives a 8 us counter. When this counter reaches
125 (1 ms) generate an */
+/* interrupt.
*/
+
+externC void hal_clock_initialize(cyg_uint32 period);
+
+#define HAL_CLOCK_INITIALIZE(_period_)
\
+ hal_clock_initialize(_period_)
+
+/* We must clear the bit in the timer event
register before we can get */
+/* another interrupt.
*/
+
+#define HAL_CLOCK_RESET( _vector_, _period_ )
\
+CYG_MACRO_START
\
+MCF5282_SIM->pit[CYGNUM_HAL_RTC_TIMER_NUM].pcsr |=
MCF5282_PIT_PCSR_PIF; \
+CYG_MACRO_END
+
+/* Read the current counter from the timer.
*/
+
+#define HAL_CLOCK_READ( _pvalue_ )
\
+CYG_MACRO_START
\
+*(_pvalue_) =
MCF5282_SIM->pit[CYGNUM_HAL_RTC_TIMER_NUM].pcntr;
\
+CYG_MACRO_END
+
+//---------------------------------------------------------------------------
+#endif // ifndef CYGONCE_HAL_PLF_INTR_H
+
Index:
packages/hal/m68k/mcf52xx/mcf5282/5282badge/plf/current/include/plf_startup.h
===================================================================
RCS file:
packages/hal/m68k/mcf52xx/mcf5282/5282badge/plf/current/include/plf_startup.h
diff -N
packages/hal/m68k/mcf52xx/mcf5282/5282badge/plf/current/include/plf_startup.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++
packages/hal/m68k/mcf52xx/mcf5282/5282badge/plf/current/include/plf_startup.h
1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,55 @@
+#ifndef _PLF_STARTUP_H
+#define _PLF_STARTUP_H
+//==========================================================================
+//####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded
Configurable Operating System.
+// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red
Hat, Inc.
+//
+// eCos is free software; you can redistribute it
and/or modify it under
+// the terms of the GNU General Public License as
published by the Free
+// Software Foundation; either version 2 or (at your
option) any later version.
+//
+// eCos 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 eCos; if not, write to the Free Software
Foundation, Inc.,
+// 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA.
+//
+// As a special exception, if other files instantiate
templates or use macros
+// or inline functions from this file, or you compile
this file and link it
+// with other works to produce a work based on this
file, this file does not
+// by itself cause the resulting work to be covered
by the GNU General Public
+// License. However the source code for this file
must still be made available
+// in accordance with section (3) of the GNU General
Public License.
+//
+// This exception does not invalidate any other
reasons why a work based on
+// this file might be covered by the GNU General
Public License.
+//
+// Alternative licenses for eCos may be arranged by
contacting Red Hat, Inc.
+// at http://sources.redhat.com/ecos/ecos-license/
+// -------------------------------------------
+//####ECOSGPLCOPYRIGHTEND####
+//==========================================================================
+
+#include <cyg/infra/cyg_type.h>
+
+// The following label specifies whether the HAL
should enable or disable
+// the data transfer acknowledge output pin on the
mcf5282 device.
+
+#define HAL_MCF5282_ENABLE_DATA_TA (false)
+
+// Platform-specific reset vector initialization
routine
+
+externC void plf_reset(void);
+
+// Initialize the cache and access control
registers for the current
+// platform.
+
+void plf_init_cache_acr(void);
+
+#endif // _PLF_STARTUP_H
+
Index:
packages/hal/m68k/mcf52xx/mcf5282/5282badge/plf/current/include/pkgconf/mlt_m68k_mcf52xx_mcf5282_5282badge_ram.h
===================================================================
RCS file:
packages/hal/m68k/mcf52xx/mcf5282/5282badge/plf/current/include/pkgconf/mlt_m68k_mcf52xx_mcf5282_5282badge_ram.h
diff -N
packages/hal/m68k/mcf52xx/mcf5282/5282badge/plf/current/include/pkgconf/mlt_m68k_mcf52xx_mcf5282_5282badge_ram.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++
packages/hal/m68k/mcf52xx/mcf5282/5282badge/plf/current/include/pkgconf/mlt_m68k_mcf52xx_mcf5282_5282badge_ram.h
1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,50 @@
+#ifndef _MLT_M68K_RAM_H
+#define _MLT_M68K_RAM_H
+//==========================================================================
+//####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded
Configurable Operating System.
+// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red
Hat, Inc.
+//
+// eCos is free software; you can redistribute it
and/or modify it under
+// the terms of the GNU General Public License as
published by the Free
+// Software Foundation; either version 2 or (at your
option) any later version.
+//
+// eCos 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 eCos; if not, write to the Free Software
Foundation, Inc.,
+// 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA.
+//
+// As a special exception, if other files instantiate
templates or use macros
+// or inline functions from this file, or you compile
this file and link it
+// with other works to produce a work based on this
file, this file does not
+// by itself cause the resulting work to be covered
by the GNU General Public
+// License. However the source code for this file
must still be made available
+// in accordance with section (3) of the GNU General
Public License.
+//
+// This exception does not invalidate any other
reasons why a work based on
+// this file might be covered by the GNU General
Public License.
+//
+// Alternative licenses for eCos may be arranged by
contacting Red Hat, Inc.
+// at http://sources.redhat.com/ecos/ecos-license/
+// -------------------------------------------
+//####ECOSGPLCOPYRIGHTEND####
+//==========================================================================
+
+// eCos memory layout
+
+#ifndef __ASSEMBLER__
+
+#include <cyg/hal/hal_memmap.h>
+
+#endif
+
+#define CYGMEM_SECTION_heap1 (__heap1_start)
+#define CYGMEM_SECTION_heap1_SIZE
((size_t)(__heap1_size))
+
+#endif // _MLT_M68K_RAM_H
+
Index:
packages/hal/m68k/mcf52xx/mcf5282/5282badge/plf/current/include/pkgconf/mlt_m68k_mcf52xx_mcf5282_5282badge_ram.ldi
===================================================================
RCS file:
packages/hal/m68k/mcf52xx/mcf5282/5282badge/plf/current/include/pkgconf/mlt_m68k_mcf52xx_mcf5282_5282badge_ram.ldi
diff -N
packages/hal/m68k/mcf52xx/mcf5282/5282badge/plf/current/include/pkgconf/mlt_m68k_mcf52xx_mcf5282_5282badge_ram.ldi
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++
packages/hal/m68k/mcf52xx/mcf5282/5282badge/plf/current/include/pkgconf/mlt_m68k_mcf52xx_mcf5282_5282badge_ram.ldi
1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,80 @@
+//===========================================================================
+//
+// RAM startup linker control script
+//
+//===========================================================================
+//####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded
Configurable Operating System.
+// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red
Hat, Inc.
+//
+// eCos is free software; you can redistribute it
and/or modify it under
+// the terms of the GNU General Public License as
published by the Free
+// Software Foundation; either version 2 or (at your
option) any later version.
+//
+// eCos 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 eCos; if not, write to the Free Software
Foundation, Inc.,
+// 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA.
+//
+// As a special exception, if other files instantiate
templates or use macros
+// or inline functions from this file, or you compile
this file and link it
+// with other works to produce a work based on this
file, this file does not
+// by itself cause the resulting work to be covered
by the GNU General Public
+// License. However the source code for this file
must still be made available
+// in accordance with section (3) of the GNU General
Public License.
+//
+// This exception does not invalidate any other
reasons why a work based on
+// this file might be covered by the GNU General
Public License.
+//
+// Alternative licenses for eCos may be arranged by
contacting Red Hat, Inc.
+// at http://sources.redhat.com/ecos/ecos-license/
+// -------------------------------------------
+//####ECOSGPLCOPYRIGHTEND####
+//===========================================================================
+
+MEMORY
+{
+ rom (rx) : ORIGIN = 0x30000000, LENGTH =
0x00100000
+ ram (wx) : ORIGIN = 0x30100000, LENGTH =
0x00700000
+}
+
+SECTIONS
+{
+ SECTIONS_BEGIN
+
+ GENERIC_SECTION (rom, rom, 0x30000000
(NOLOAD), LMA_EQ_VMA, 0x00100000)
+ GENERIC_SECTION (ram, ram, 0x30100000
(NOLOAD), LMA_EQ_VMA, 0x00700000)
+
+ SECTION_romvec (rom, __rom_start,
LMA_EQ_VMA, 0x400)
+ SECTION_text (rom, ALIGN (0x4),
FOLLOWING (.romvec))
+ SECTION_fini (rom, ALIGN (0x4),
FOLLOWING (.text))
+ SECTION_rodata1 (rom, ALIGN (0x4),
FOLLOWING (.fini))
+ SECTION_rodata (rom, ALIGN (0x4),
FOLLOWING (.rodata1))
+ SECTION_fixup (rom, ALIGN (0x4),
FOLLOWING (.rodata))
+
+ // WARNING: If you change the order of these
sections, be sure to change
+ // the location of the data section.
+
+ SECTION_gcc_except_table (rom, ALIGN (0x4),
FOLLOWING (.fixup))
+ __rom_data_addr = ABSOLUTE(.);
+
+ GENERIC_SECTION (ramvec, ram,
__ram_start (NOLOAD), LMA_EQ_VMA, 0x400)
+ SECTION_data (ram, ALIGN (0x4),
FOLLOWING (.gcc_except_table), __rom_data_addr)
+ SECTION_sbss (ram, ALIGN (0x4)
(NOLOAD), LMA_EQ_VMA)
+ SECTION_bss (ram, ALIGN (0x4)
(NOLOAD), LMA_EQ_VMA)
+ SECTION_uninvar (ram, ALIGN (0x4)
(NOLOAD), LMA_EQ_VMA)
+
+ // Allocate a heap section.
+
+ SECTION_heap1 (ram, ALIGN (0x4),
LMA_EQ_VMA, 0x20000)
+ // The build tool looks for this
"CYG_LABEL_DEFN..." string.
+ CYG_LABEL_DEFN(__heap1) = ABSOLUTE
(__heap1_start);
+
+ SECTIONS_END
+}
+
Index:
packages/hal/m68k/mcf52xx/mcf5282/5282badge/plf/current/src/hal_diag.c
===================================================================
RCS file:
packages/hal/m68k/mcf52xx/mcf5282/5282badge/plf/current/src/hal_diag.c
diff -N
packages/hal/m68k/mcf52xx/mcf5282/5282badge/plf/current/src/hal_diag.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++
packages/hal/m68k/mcf52xx/mcf5282/5282badge/plf/current/src/hal_diag.c
1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,147 @@
+//=============================================================================
+//
+// hal_diag.c
+//
+// HAL diagnostic output code
+//
+//=============================================================================
+//####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded
Configurable Operating System.
+// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red
Hat, Inc.
+//
+// eCos is free software; you can redistribute it
and/or modify it under
+// the terms of the GNU General Public License as
published by the Free
+// Software Foundation; either version 2 or (at your
option) any later version.
+//
+// eCos 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 eCos; if not, write to the Free Software
Foundation, Inc.,
+// 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA.
+//
+// As a special exception, if other files instantiate
templates or use macros
+// or inline functions from this file, or you compile
this file and link it
+// with other works to produce a work based on this
file, this file does not
+// by itself cause the resulting work to be covered
by the GNU General Public
+// License. However the source code for this file
must still be made available
+// in accordance with section (3) of the GNU General
Public License.
+//
+// This exception does not invalidate any other
reasons why a work based on
+// this file might be covered by the GNU General
Public License.
+//
+// Alternative licenses for eCos may be arranged by
contacting Red Hat, Inc.
+// at http://sources.redhat.com/ecos/ecos-license/
+// -------------------------------------------
+//####ECOSGPLCOPYRIGHTEND####
+//=============================================================================
+
+#include <pkgconf/hal.h>
+
+#include <cyg/hal/hal_diag.h> // our
header.
+
+#if defined(CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS)
+#include <cyg/hal/hal_stub.h> //
hal_output_gdb_string
+#endif
+
+#include <cyg/infra/cyg_type.h> // base
types, externC
+#include <cyg/hal/hal_io.h> // IO macros
+#include <cyg/hal/hal_intr.h> // Interrupt
macros
+
+#include <cyg/hal/hal_arch.h>
+
+#define CYG_KERNEL_DIAG_SERIAL
+
+//-----------------------------------------------------------------------------
+// Serial diag functions.
+#ifdef CYG_KERNEL_DIAG_SERIAL
+
+// Include the serial driver.
+
+void hal_diag_init(void)
+{
+ CYG_WORD16 clk_div;
+
+ /* We must first enable the UART output pins
from the general-purpose */
+ /* I/O module.
*/
+
+ /* Enable the UART0 pins in the port B control
register. */
+
+ MCF5282_SIM->gpio.puapar |= MCF5282_PUAPAR_URXD0
| MCF5282_PUAPAR_UTXD0;
+
+ /* Before we do anything else, make sure we
have enabled CTS (our */
+ /* RTS) in case the device we are using
relies on hardware flow */
+ /* control. Note that this step is our only
attempt at hardware flow */
+ /* control.
*/
+
+ //MCF5282_SIM->uart[0].uop1 = 1;
+
+ /* Initialize UART0 */
+
+ /* Reset Transmitter */
+ MCF5282_SIM->uart[0].write.ucr =
MCF5282_UART_UCR_RESET_TX;
+
+ /* Reset Receiver */
+ MCF5282_SIM->uart[0].write.ucr =
MCF5282_UART_UCR_RESET_RX;
+
+ /* Reset Mode Register */
+ MCF5282_SIM->uart[0].write.ucr =
MCF5282_UART_UCR_RESET_MR;
+
+ MCF5282_SIM->uart[0].write.ucr =
MCF5282_UART_UCR_RESET_ERROR;
+ //MCF5282_SIM->uart[0].write.ucr =
MCF5282_UART_UCR_RESET_BKCHGINT;
+
+ /* Mode register 1 sets the UART to 8 data
bits with no parity, and */
+ /* mode register 2 forces 1 stop bit. Reading
or write to the mode */
+ /* register switches it from umr1 to umr2. To
set it to umr1, we must */
+ /* write a reset mode register command to the
command register. */
+
+ MCF5282_SIM->uart[0].write.umr =
MCF5282_UART_UMR1_BC_8 | MCF5282_UART_UMR1_PM_NONE;
+ MCF5282_SIM->uart[0].write.umr =
MCF5282_UART_UMR2_STOP_BITS_1;
+
+ /* reset interrupt mask register */
+ MCF5282_SIM->uart[0].write.uimr = 0x00;
+
+ /* Select a prescaled (by 1/32) CLKIN for the
clock source. */
+ MCF5282_SIM->uart[0].write.ucsr =
MCF5282_UART_UCSR_RXCLKTIMER |
MCF5282_UART_UCSR_TXCLKTIMER;
+
+ /* Calculate baud settings
*/
+ clk_div = (CYG_WORD16)
+
((CYGHWR_HAL_SYSTEM_CLOCK_MHZ*1000000.0)/
+
(CYGHWR_HAL_M68K_MCF52xx_MCF5282_5282BADGE_DIAG_BAUD *
32.0));
+ MCF5282_SIM->uart[0].write.ubg1 = clk_div >> 8;
+ MCF5282_SIM->uart[0].write.ubg2 = clk_div &
0x00ff;
+
+ /* Enable the transmitter and receiver.
*/
+ MCF5282_SIM->uart[0].write.ucr =
MCF5282_UART_UCR_RX_ENABLED |
MCF5282_UART_UCR_TX_ENABLED; // enable RX and TX
+
+}
+
+void hal_diag_write_char(cyg_int8 ch)
+{
+
+ /* Loop until the transmit data holding register
is empty. */
+ while (!(MCF5282_SIM->uart[0].read.usr &
MCF5282_UART_USR_TXRDY));
+
+ /* Write the character to the transmit status
register. */
+ MCF5282_SIM->uart[0].write.utbuf = ch;
+
+ /* Loop until the transmit data FIFO and the
shift register are */
+ /* empty.
*/
+
+ while ((!(MCF5282_SIM->uart[0].read.usr &
MCF5282_UART_USR_TXEMP)));
+}
+
+cyg_int8 hal_diag_read_char(void)
+{
+
+ return 0;
+}
+
+#endif // ifdef CYG_KERNEL_DIAG_SERIAL
+
+//-----------------------------------------------------------------------------
+// End of hal_diag.c
+
Index:
packages/hal/m68k/mcf52xx/mcf5282/5282badge/plf/current/src/plf_misc.c
===================================================================
RCS file:
packages/hal/m68k/mcf52xx/mcf5282/5282badge/plf/current/src/plf_misc.c
diff -N
packages/hal/m68k/mcf52xx/mcf5282/5282badge/plf/current/src/plf_misc.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++
packages/hal/m68k/mcf52xx/mcf5282/5282badge/plf/current/src/plf_misc.c
1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,52 @@
+//==========================================================================
+//####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded
Configurable Operating System.
+// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red
Hat, Inc.
+//
+// eCos is free software; you can redistribute it
and/or modify it under
+// the terms of the GNU General Public License as
published by the Free
+// Software Foundation; either version 2 or (at your
option) any later version.
+//
+// eCos 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 eCos; if not, write to the Free Software
Foundation, Inc.,
+// 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA.
+//
+// As a special exception, if other files instantiate
templates or use macros
+// or inline functions from this file, or you compile
this file and link it
+// with other works to produce a work based on this
file, this file does not
+// by itself cause the resulting work to be covered
by the GNU General Public
+// License. However the source code for this file
must still be made available
+// in accordance with section (3) of the GNU General
Public License.
+//
+// This exception does not invalidate any other
reasons why a work based on
+// this file might be covered by the GNU General
Public License.
+//
+// Alternative licenses for eCos may be arranged by
contacting Red Hat, Inc.
+// at http://sources.redhat.com/ecos/ecos-license/
+// -------------------------------------------
+//####ECOSGPLCOPYRIGHTEND####
+//==========================================================================
+
+#include <cyg/infra/cyg_type.h>
+#include <pkgconf/hal.h>
+#include <cyg/hal/hal_startup.h>
+#include <cyg/hal/hal_memmap.h>
+#include <cyg/hal/hal_arch.h>
+#include <cyg/hal/hal_intr.h> // Interrupt
macros
+
+//#define MCF5282_PIT0_PRIORITY_LEVEL 0x36
+
+void hal_clock_initialize(cyg_uint32 period)
+{
+ MCF5282_SIM->pit[CYGNUM_HAL_RTC_TIMER_NUM].pmr =
20735; // set reload value
+
+ // init timer
+ MCF5282_SIM->pit[CYGNUM_HAL_RTC_TIMER_NUM].pcsr =
(MCF5282_PIT_PCSR_PRE_DIV_4 |
+ MCF5282_PIT_PCSR_PIE | MCF5282_PIT_PCSR_RLD |
MCF5282_PIT_PCSR_EN);
+}
Index:
packages/hal/m68k/mcf52xx/mcf5282/5282badge/plf/current/src/plf_startup.c
===================================================================
RCS file:
packages/hal/m68k/mcf52xx/mcf5282/5282badge/plf/current/src/plf_startup.c
diff -N
packages/hal/m68k/mcf52xx/mcf5282/5282badge/plf/current/src/plf_startup.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++
packages/hal/m68k/mcf52xx/mcf5282/5282badge/plf/current/src/plf_startup.c
1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,183 @@
+//==========================================================================
+//####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded
Configurable Operating System.
+// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red
Hat, Inc.
+//
+// eCos is free software; you can redistribute it
and/or modify it under
+// the terms of the GNU General Public License as
published by the Free
+// Software Foundation; either version 2 or (at your
option) any later version.
+//
+// eCos 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 eCos; if not, write to the Free Software
Foundation, Inc.,
+// 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA.
+//
+// As a special exception, if other files instantiate
templates or use macros
+// or inline functions from this file, or you compile
this file and link it
+// with other works to produce a work based on this
file, this file does not
+// by itself cause the resulting work to be covered
by the GNU General Public
+// License. However the source code for this file
must still be made available
+// in accordance with section (3) of the GNU General
Public License.
+//
+// This exception does not invalidate any other
reasons why a work based on
+// this file might be covered by the GNU General
Public License.
+//
+// Alternative licenses for eCos may be arranged by
contacting Red Hat, Inc.
+// at http://sources.redhat.com/ecos/ecos-license/
+// -------------------------------------------
+//####ECOSGPLCOPYRIGHTEND####
+//==========================================================================
+
+#include <cyg/infra/cyg_type.h>
+#include <pkgconf/hal.h>
+#include <cyg/hal/hal_startup.h>
+#include <cyg/hal/hal_memmap.h>
+#include <cyg/hal/hal_arch.h>
+
+#if 0
+#include <cyg/hal/hal_intr.h>
+#include <cyg/hal/hal_diag.h> //
hal_diag_init
+#include <cyg/infra/diag.h> //
diag_printf
+
+#define CYG_HAL_RESET_DEBUG_ENABLE
+#ifdef CYG_HAL_RESET_DEBUG_ENABLE
+#define CYG_HAL_RESET_DEBUG diag_printf
+#else
+#define CYG_HAL_RESET_DEBUG()
+#endif // CYG_HAL_RESET_DEBUG_ENABLE
+#endif
+
+/*****************************************************************************
+plf_init_cache_acr -- Initialize the cache and access
control registers
+
+ The var_init_cache_acr routine already
invalidated the cache and ACRs.
+This routine only needs to enable the ACRs that it
will use.
+
+INPUT:
+
+OUTPUT:
+
+RETURN VALUE:
+
+ None
+
+*****************************************************************************/
+void plf_init_cache_acr(void)
+{
+
+ // Enable the instruction cache with the
following options:
+ // Enable CPUSHL invalidation.
+ // No freeze.
+ // Invalidate all cache lines (flush).
+ // No external arbiter control.
+ // Disable non-cacheable instruction bursting.
+ // Default memory is cacheable.
+ // Enable buffered writes.
+ // Read and write access permitted by default.
+ // Instruction fetch size is cache line.
+
+ mcf52xx_wr_acr0((CYG_WORD32)0x3000E000);
+
+ mcf52xx_wr_cacr((CYG_WORD32)0x80400000);
+
+ // Leave the access control registers disabled
by default.
+
+}
+
+/*****************************************************************************
+plf_reset -- Platform-specific reset vector
initialization routine
+
+ This routine must be called with interrupts
disabled.
+
+INPUT:
+
+OUTPUT:
+
+RETURN VALUE:
+
+ None
+
+*****************************************************************************/
+void plf_reset(void)
+{
+ u32_t i;
+
+ // disable watchdog
+ MCF5282_SIM->wtm.wcr = 0;
+
+ // setup PLL
+ MCF5282_SIM->clock.syncr = MCF5282_CLOCK_SYNCR_MFD2
| MCF5282_CLOCK_SYNCR_MFD1 | MCF5282_CLOCK_SYNCR_MFD0;
// set clock to (3.6864Mhz * 18)
+
+ while(!(MCF5282_SIM->clock.synsr &
MCF5282_CLOCK_SYNSR_LOCK)); // wait for PLL to
lock
+
+ /*
+ * Check to see if the SDRAM has already been
initialized
+ * by a run control tool
+ */
+ if (!(MCF5282_SIM->sdram.dacr0 &
MCF5282_SDRAM_DACR_RE))
+ {
+ /*
+ * Initialize DRAM Control Register: DCR
+ */
+ MCF5282_SIM->sdram.dcr = 0x001F;
+
+ /*
+ * Initialize DACR0
+ */
+ MCF5282_SIM->sdram.dacr0 = (MCF5282_EXT_SDRAM &
0xFC000000) | MCF5282_SDRAM_DACR_CASL0 // CAS 2
+ | MCF5282_SDRAM_DACR_CBM1 |
MCF5282_SDRAM_DACR_CBM0 // CBM = 3
+ | MCF5282_SDRAM_DACR_PS1; // 16 bit
port
+
+ /*
+ * Initialize DMR0
+ */
+ MCF5282_SIM->sdram.dmr0 = 0x01FC0001;
+
+ /*
+ * Set IP (bit 3) in DACR
+ */
+ MCF5282_SIM->sdram.dacr0 |= MCF5282_SDRAM_DACR_IP;
+
+ /*
+ * Wait 30ns to allow banks to precharge
+ */
+ for (i = 0; i < 5; i++)
+ {
+ asm("nop\n");
+ }
+
+ /*
+ * Write to this block to initiate precharge
+ */
+ *(u16_t *)(MCF5282_EXT_SDRAM) = 0xA5A5;
+
+ /*
+ * Set RE (bit 15) in DACR
+ */
+ MCF5282_SIM->sdram.dacr0 = MCF5282_SIM->sdram.dacr0
| MCF5282_SDRAM_DACR_RE;
+
+ /*
+ * Wait for at least 8 auto refresh cycles to occur
+ */
+ for (i = 0; i < 2000; i++)
+ {
+ asm("nop\n");
+ }
+
+ /*
+ * Finish the configuration by issuing the IMRS.
+ */
+ MCF5282_SIM->sdram.dacr0 |=
MCF5282_SDRAM_DACR_IMRS;
+
+ /*
+ * Write to the SDRAM Mode Register
+ */
+ *(u16_t *)(MCF5282_EXT_SDRAM + 0x800) = 0xA5A5;
+ }
+}
+
__________________________________
Do you Yahoo!?
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-04-13 13:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-13 13:41 patch to add support for mcf5282 based Future/Netburner 5282Badge eval board Errin Bechtel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).