This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

mn10300/asb update


Updating mn10300/asb HAL to support RedBoot instead of CygMon.

--Mark

Index: ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/ChangeLog,v
retrieving revision 1.84
diff -u -p -5 -r1.84 ChangeLog
--- ChangeLog	12 Nov 2002 17:38:37 -0000	1.84
+++ ChangeLog	14 Nov 2002 17:46:01 -0000
@@ -1,5 +1,9 @@
+2002-11-14  Mark Salter  <msalter@redhat.com>
+
+	* ecos.db: Add flash package for AM33 ASB2303.
+
 2002-11-12  Gary Thomas  <gary@mlbassoc.com>
 
 	* ecos.db: Add NPWR (Xscale from Team ASA).  Reorganize Xscale
 	IOP310 based platforms (IQ80310).
 
Index: ecos.db
===================================================================
RCS file: /cvs/ecos/ecos/packages/ecos.db,v
retrieving revision 1.76
diff -u -p -5 -r1.76 ecos.db
--- ecos.db	12 Nov 2002 17:38:37 -0000	1.76
+++ ecos.db	14 Nov 2002 17:46:04 -0000
@@ -490,10 +490,21 @@ package CYGPKG_DEVS_FLASH_MN10300_STB {
 	hardware
         description "
            This package contains hardware support for FLASH memory
 	   on the Matsushita MN10300 STB platform (SRAM2 socket)."
 }
+
+package CYGPKG_DEVS_FLASH_MN10300_ASB2303 {
+	alias 		{ "FLASH memory support for Matsushita ASB2303" flash_asb2303 }
+	directory	devs/flash/mn10300/asb2303
+	script		flash_asb2303.cdl
+	hardware
+        description "
+           This package contains hardware support for FLASH memory
+	   on the Matsushita MN10300 ASB2303 platform (system flash socket)."
+}
+
 package CYGPKG_DEVS_FLASH_MN10300_ASB2305 {
 	alias 		{ "FLASH memory support for Matsushita ASB2305" flash_asb2305 }
 	directory	devs/flash/mn10300/asb2305
 	script		flash_asb2305.cdl
 	hardware
@@ -3905,10 +3916,12 @@ target stb {
 target asb {
         alias		{ "Matsushita ASB2303 board" }
 	packages        { CYGPKG_HAL_MN10300
                           CYGPKG_HAL_MN10300_AM33_ASB
                           CYGPKG_HAL_MN10300_AM33
+                          CYGPKG_DEVS_FLASH_AMD_AM29XXXXX
+                          CYGPKG_DEVS_FLASH_MN10300_ASB2303
         }
         description "
            The asb target provides the packages needed to run
            eCos on a Matsushita ASB2303 board."
 }
Index: devs/flash/mn10300/asb2303/current/ChangeLog
===================================================================
RCS file: devs/flash/mn10300/asb2303/current/ChangeLog
diff -N devs/flash/mn10300/asb2303/current/ChangeLog
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ devs/flash/mn10300/asb2303/current/ChangeLog	14 Nov 2002 17:46:06 -0000
@@ -0,0 +1,35 @@
+
+//===========================================================================
+//####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####
+//===========================================================================
Index: devs/flash/mn10300/asb2303/current/cdl/flash_asb2303.cdl
===================================================================
RCS file: devs/flash/mn10300/asb2303/current/cdl/flash_asb2303.cdl
diff -N devs/flash/mn10300/asb2303/current/cdl/flash_asb2303.cdl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ devs/flash/mn10300/asb2303/current/cdl/flash_asb2303.cdl	14 Nov 2002 17:46:06 -0000
@@ -0,0 +1,81 @@
+# ====================================================================
+#
+#      flash_asb2303.cdl
+#
+#      FLASH memory - Hardware support on Matsushita ASB2303
+#
+# ====================================================================
+#####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####
+# ====================================================================
+######DESCRIPTIONBEGIN####
+#
+# Author(s):      msalter
+# Original data:  dhowells
+# Contributors:
+# Date:           2002-11-08
+#
+#####DESCRIPTIONEND####
+#
+# ====================================================================
+
+cdl_package CYGPKG_DEVS_FLASH_MN10300_ASB2303 {
+    display       "Matsushita MN10300 ASB2303 FLASH memory support"
+
+    parent        CYGPKG_IO_FLASH
+    active_if     CYGPKG_IO_FLASH
+    requires      CYGPKG_HAL_MN10300_AM33_ASB
+
+    implements    CYGHWR_IO_FLASH_DEVICE
+
+    compile       mn10300_asb2303_flash.c
+
+    # Arguably this should do in the generic package
+    # but then there is a logic loop so you can never enable it.
+    cdl_interface CYGINT_DEVS_FLASH_AMD_AM29XXXXX_REQUIRED {
+        display   "Generic AMD AM29XXXXX driver required"
+    }
+
+    cdl_option CYGHWR_DEVS_FLASH_MN10300_ASB2303_BANK {
+        display       "Which flash bank to program"
+        flavor        data
+        legal_values  { "BootPROM" "SysFlash" }
+        default_value { "SysFlash" }
+        description   "
+           This option controls which bank of flash will be programmable."
+    }
+
+    implements    CYGINT_DEVS_FLASH_AMD_AM29XXXXX_REQUIRED
+    requires      CYGHWR_DEVS_FLASH_AMD_AM29DL324D
+    requires      CYGHWR_DEVS_FLASH_AMD_AM29LV800
+}
Index: devs/flash/mn10300/asb2303/current/src/mn10300_asb2303_flash.c
===================================================================
RCS file: devs/flash/mn10300/asb2303/current/src/mn10300_asb2303_flash.c
diff -N devs/flash/mn10300/asb2303/current/src/mn10300_asb2303_flash.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ devs/flash/mn10300/asb2303/current/src/mn10300_asb2303_flash.c	14 Nov 2002 17:46:06 -0000
@@ -0,0 +1,88 @@
+//==========================================================================
+//
+//      mn10300_asb2303_flash.c
+//
+//      Flash programming for Matsushita ASB2303
+//
+//==========================================================================
+//####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####
+//==========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):    msalter
+// Contributors: msalter
+// Date:         2002-11-08
+// Purpose:      
+// Description:  
+//              
+//####DESCRIPTIONEND####
+//
+//==========================================================================
+#include <pkgconf/devs_flash_mn10300_asb2303.h>
+
+//--------------------------------------------------------------------------
+// Device properties
+
+#if defined(CYGHWR_DEVS_FLASH_MN10300_ASB2303_BANK_SysFlash)
+// We use a four chip parallel AM29DL324BE module plugged into the System Flash socket
+// on the ASB2303 board.
+#define CYGNUM_FLASH_INTERLEAVE	(4)
+#define CYGNUM_FLASH_SERIES	(1)
+#define CYGNUM_FLASH_WIDTH	(8)
+#define CYGNUM_FLASH_16AS8
+#define CYGNUM_FLASH_BASE 	(0x84000000u)	/* cached flash chip address */
+
+#elif defined(CYGHWR_DEVS_FLASH_MN10300_ASB2303_BANK_BootPROM)
+// We have a single AM29LV800TA soldered onto the board as the boot PROM
+#define CYGNUM_FLASH_INTERLEAVE	(1)
+#define CYGNUM_FLASH_SERIES	(1)
+#define CYGNUM_FLASH_WIDTH	(16)
+#define CYGNUM_FLASH_BASE 	(0x80000000u)	/* cached flash chip address */
+
+#else
+#error unknown flash bank selected
+#endif
+
+//--------------------------------------------------------------------------
+// Platform specific extras
+
+// Offset of uncached shadow region
+#define FLASH_P2V( _a_ ) ((volatile flash_data_t *)((CYG_ADDRWORD)(_a_)+0x20000000))
+
+//--------------------------------------------------------------------------
+// Now include the driver code.
+#include "cyg/io/flash_am29xxxxx.inl"
+
+// ------------------------------------------------------------------------
+// EOF mn10300_asb2303_flash.c
Index: hal/mn10300/am33/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/mn10300/am33/current/ChangeLog,v
retrieving revision 1.6
diff -u -p -5 -r1.6 ChangeLog
--- hal/mn10300/am33/current/ChangeLog	20 May 2002 22:23:14 -0000	1.6
+++ hal/mn10300/am33/current/ChangeLog	14 Nov 2002 17:46:09 -0000
@@ -1,5 +1,13 @@
+2002-11-14  Mark Salter  <msalter@redhat.com>
+
+	* include/var_intr.h (HAL_CLOCK_INITIALIZE): Save _period_ for
+	use by other code.
+
+	* src/redboot_cmds.c: New file.
+	* cdl/hal_mn10300_am33.cdl: Add support for RedBoot exec command.
+
 2001-10-18  David Howells  <dhowells@redhat.com>
 
 	* include/variant.inc: Suppress as many interrupt sources as
 	possible whilst booting.
 
Index: hal/mn10300/am33/current/cdl/hal_mn10300_am33.cdl
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/mn10300/am33/current/cdl/hal_mn10300_am33.cdl,v
retrieving revision 1.5
diff -u -p -5 -r1.5 hal_mn10300_am33.cdl
--- hal/mn10300/am33/current/cdl/hal_mn10300_am33.cdl	23 May 2002 23:03:58 -0000	1.5
+++ hal/mn10300/am33/current/cdl/hal_mn10300_am33.cdl	14 Nov 2002 17:46:09 -0000
@@ -79,10 +79,72 @@ cdl_package CYGPKG_HAL_MN10300_AM33 {
         puts $::cdl_header "#include <pkgconf/hal_mn10300.h>"
     }
 
     compile       var_misc.c variant.S
 
+    cdl_option CYGHWR_HAL_MN10300_PROCESSOR_OSC {
+        display       "Processor Oscillator input"
+        flavor        data
+        legal_values  16666667 to 33333333
+        default_value { CYGHWR_HAL_MN10300_PROCESSOR_OSC_DEFAULT ?
+                        CYGHWR_HAL_MN10300_PROCESSOR_OSC_DEFAULT : 25000000}
+        description   "
+           The MN10300 processor can run at various frequencies. These
+           values are expressed in Hz.  Note that there are several
+           steppings of the MN10300 rated to run at different maximum
+           frequencies.  Check the specs to make sure that your
+           particular processor can run at the rate you select here."
+    }
+
+    # Real-time clock/counter specifics
+    cdl_component CYGNUM_HAL_RTC_CONSTANTS {
+        display       "Real-time clock constants."
+        description   "
+            The NUMERATOR divided by the DENOMINATOR gives the number of
+            nanoseconds per tick. The PERIOD is the divider to be programmed
+            into a hardware timer that is driven from an appropriate hardware
+            clock, such that the timer overflows once per tick (normally
+            generating a CPU interrupt to mark the end of a tick). The tick
+            rate is typically 100Hz.
+            The clock is generated with onboard 16-bit timers TM4 and TM5
+            cascaded together to form a 32-bit timer."
+        flavor none
+
+        cdl_option CYGHWR_HAL_MN10300_IOCLK_SPEED {
+            display          "Processor I/O clock speed (Hz)"
+            flavor           data
+            calculated       CYGHWR_HAL_MN10300_PROCESSOR_OSC
+            description      "
+                The processor I/O clock speed, from which onboard timers can
+                draw their sources."
+        }
+
+        cdl_option CYGNUM_HAL_RTC_NUMERATOR {
+            display       "Real-time clock numerator"
+            flavor        data
+            calculated    (1000 * 1000 * 1000)
+        }
+
+        cdl_option CYGNUM_HAL_RTC_DENOMINATOR {
+            display       "Real-time clock denominator"
+            flavor        data
+            calculated    100
+            description   "
+              This option selects the heartbeat rate for the real-time clock.
+              The rate is specified in ticks per second.  Change this value
+              with caution - too high and your system will become saturated
+              just handling clock interrupts, too low and some operations
+              such as thread scheduling may become sluggish."
+        }
+
+        cdl_option CYGNUM_HAL_RTC_PERIOD {
+            display       "Real-time clock divisor"
+            flavor        data
+            calculated    (CYGHWR_HAL_MN10300_IOCLK_SPEED / CYGNUM_HAL_RTC_DENOMINATOR)
+        }
+    }
+
     make {
         <PREFIX>/lib/target.ld: <PACKAGE>/src/mn10300_am33.ld
         $(CC) -E -P -Wp,-MD,target.tmp -DEXTRAS=1 -xc $(INCLUDE_PATH) $(CFLAGS) -o $@ $<
         @echo $@ ": \\" > $(notdir $@).deps
         @tail +2 target.tmp >> $(notdir $@).deps
@@ -104,6 +166,39 @@ cdl_package CYGPKG_HAL_MN10300_AM33 {
         description   "
             Enable this option if the hardware is able to program the flash
             without turning off CPU data caching."
     }
 
+    cdl_component CYGPKG_REDBOOT_MN10300_AM33_OPTIONS {
+        display       "Redboot for AM33 options"
+        flavor        none
+        no_define
+        parent        CYGPKG_REDBOOT
+        active_if     CYGPKG_REDBOOT
+        description   "
+            This option lists the target's requirements for a valid Redboot
+            configuration."
+
+        cdl_component CYGPKG_REDBOOT_AM33_LINUX_EXEC {
+            display        "Provide the exec command in RedBoot"
+            flavor         none
+            parent         CYGPKG_REDBOOT_MN10300_AM33_OPTIONS
+            active_if      CYGBLD_BUILD_REDBOOT_WITH_EXEC
+            description    "
+                This option contains requirements for booting linux
+                from RedBoot. The component is enabled/disabled from
+                RedBoots CDL."
+            compile -library=libextras.a redboot_linux_exec.c
+
+            cdl_option CYGHWR_REDBOOT_AM33_LINUX_CMD_ADDRESS {
+                display       "Base address of linux kernel command line"
+                flavor        data
+                default_value 0x8C001000
+                description   "
+                   This is the base address of the area of memory used to
+                   pass a command line to the Linux kernel. This should be
+                   chosen to avoid overlap with the kernel and any ramdisk
+                   image."
+            }
+        }
+    }
 }
Index: hal/mn10300/am33/current/include/var_intr.h
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/mn10300/am33/current/include/var_intr.h,v
retrieving revision 1.4
diff -u -p -5 -r1.4 var_intr.h
--- hal/mn10300/am33/current/include/var_intr.h	23 May 2002 23:03:59 -0000	1.4
+++ hal/mn10300/am33/current/include/var_intr.h	14 Nov 2002 17:46:09 -0000
@@ -511,10 +511,11 @@ CYG_MACRO_END
 #define TIMER5_BR        0xd4003092
 #define TIMER5_MD        0xd4003082
 
 //--------------------------------------------------------------------------
 // Clock control.
+extern cyg_uint32 __hal_period__;
 
 #define HAL_CLOCK_INITIALIZE( _period_ )                                \
 {                                                                       \
     volatile cyg_uint16 *timer4_br      = (cyg_uint16 *)TIMER4_BR;      \
     volatile cyg_uint8 *timer4_md       = (cyg_uint8 *)TIMER4_MD;       \
@@ -530,10 +531,12 @@ CYG_MACRO_END
                                                                         \
     *timer4_br = (_period_)&0x0000FFFF;                                 \
                                                                         \
     *timer4_md = 0x40;                                                  \
     *timer4_md = 0x80;                                                  \
+                                                                        \
+    __hal_period__ = _period_;                                          \
 }
 
 #define HAL_CLOCK_RESET( _vector_, _period_ )
 
 #define HAL_CLOCK_READ( _pvalue_ )                                      \
@@ -550,16 +553,16 @@ CYG_MACRO_END
     do {                                                                \
         t5 = *timer5_cr;                                                \
         t4 = *timer4_cr;                                                \
     } while( t5 != *timer5_cr );                                        \
                                                                         \
-    *(_pvalue_) = CYGNUM_KERNEL_COUNTERS_RTC_PERIOD - ((t5<<16) + t4);  \
+    *(_pvalue_) = __hal_period__ - ((t5<<16) + t4);                     \
 }
 
-// FIXME: above line should not use CYGNUM_KERNEL_COUNTERS_RTC_PERIOD since
-// this means the HAL gets configured by kernel options even when the
-// kernel is disabled!
+extern void hal_delay_us(cyg_int32 usecs);
+
+#define HAL_DELAY_US(n)          hal_delay_us(n);
 
 
 //--------------------------------------------------------------------------
 #endif // ifndef CYGONCE_HAL_VAR_INTR_H
 // End of var_intr.h
Index: hal/mn10300/am33/current/src/redboot_linux_exec.c
===================================================================
RCS file: hal/mn10300/am33/current/src/redboot_linux_exec.c
diff -N hal/mn10300/am33/current/src/redboot_linux_exec.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ hal/mn10300/am33/current/src/redboot_linux_exec.c	14 Nov 2002 17:46:09 -0000
@@ -0,0 +1,132 @@
+//==========================================================================
+//
+//      redboot_linux_exec.c
+//
+//      AM33 Linux specific RedBoot exec command
+//
+//==========================================================================
+//####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####
+//==========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):    dhowells
+// Contributors: gthomas, jskov, msalter
+// Date:         2001-07-19
+// Purpose:      
+// Description:  
+//              
+// This code is part of RedBoot (tm).
+//
+//####DESCRIPTIONEND####
+//
+//==========================================================================
+
+#include <redboot.h>
+
+#include <cyg/hal/hal_intr.h>
+#include <cyg/hal/hal_cache.h>
+
+// Exported CLI function(s)
+
+// The exec command works like the go command in YAMON - that is,
+// providing callee with argc, argv, and env. In addition to the
+// information provided by the user, 
+
+static void do_exec(int argc, char *argv[]);
+
+static char exec_usage[] =
+            "[-w timeout] [-c \"kernel command line\"] [<entry_point>]";
+
+RedBoot_cmd("exec", 
+            "Execute an image - with MMU off", 
+            exec_usage,
+            do_exec
+	    );
+
+typedef void (*code_fun)(void) __attribute__((noreturn));
+
+static void 
+do_exec(int argc, char *argv[])
+{
+    unsigned long oldints;
+    bool wait_time_set;
+    int  wait_time, res;
+    bool cmd_line_set;
+    struct option_info opts[4];
+    code_fun entry;
+    char line[8];
+    char *cmd_line;
+    int num_options;
+
+    entry = (code_fun)entry_address;  // Default from last 'load' operation
+    init_opts(&opts[0], 'w', true, OPTION_ARG_TYPE_NUM, 
+              (void **)&wait_time, (bool *)&wait_time_set, "wait timeout");
+    init_opts(&opts[1], 'c', true, OPTION_ARG_TYPE_STR, 
+              (void **)&cmd_line, (bool *)&cmd_line_set, "kernel command line");
+    num_options = 2;
+
+    if (!scan_opts(argc, argv, 1, opts, num_options, (void *)&entry, 
+                   OPTION_ARG_TYPE_NUM, "starting address"))
+    {
+        return;
+    }
+    if (cmd_line_set) {
+	memcpy((char*)CYGHWR_REDBOOT_AM33_LINUX_CMD_ADDRESS,"cmdline:",8);
+        strncpy((char*)CYGHWR_REDBOOT_AM33_LINUX_CMD_ADDRESS+8,cmd_line,256);
+	*(char*)(CYGHWR_REDBOOT_AM33_LINUX_CMD_ADDRESS+8+256) = 0;
+    }
+    else {
+	*(char*)(CYGHWR_REDBOOT_AM33_LINUX_CMD_ADDRESS+256) = 0;
+    }
+
+    if (wait_time_set) {
+        diag_printf("About to start execution at %p - abort with ^C within %d seconds\n",
+                    (void *)entry, wait_time);
+        res = _rb_gets(line, sizeof(line), wait_time*1000);
+        if (res == _GETS_CTRLC) {
+            return;
+        }
+    }
+
+    HAL_DISABLE_INTERRUPTS(oldints);
+    HAL_DCACHE_SYNC();
+    HAL_ICACHE_DISABLE();
+    HAL_DCACHE_DISABLE();
+    HAL_DCACHE_SYNC();
+    HAL_ICACHE_INVALIDATE_ALL();
+    HAL_DCACHE_INVALIDATE_ALL();
+    (*entry)();
+}
+
+// EOF redboot_linux_exec.c
Index: hal/mn10300/am33/current/src/var_misc.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/mn10300/am33/current/src/var_misc.c,v
retrieving revision 1.4
diff -u -p -5 -r1.4 var_misc.c
--- hal/mn10300/am33/current/src/var_misc.c	23 May 2002 23:03:59 -0000	1.4
+++ hal/mn10300/am33/current/src/var_misc.c	14 Nov 2002 17:46:09 -0000
@@ -57,15 +57,19 @@
 #include <cyg/infra/cyg_trac.h>         // tracing macros
 #include <cyg/infra/cyg_ass.h>          // assertion macros
 
 #include <cyg/hal/hal_cache.h>
 
+#include <cyg/hal/hal_intr.h>           // HAL_CLOCK_READ
+
 /*------------------------------------------------------------------------*/
 /* Variant specific initialization routine.                               */
 
 void hal_variant_init(void)
 {
+    // Let the timer run at a default rate (for delays)
+    HAL_CLOCK_INITIALIZE(CYGNUM_HAL_RTC_PERIOD);
 }
 
 /*------------------------------------------------------------------------*/
 /* Cache functions.                                                       */
 
@@ -100,10 +104,45 @@ void cyg_hal_dcache_store(CYG_ADDRWORD b
     }
     if (state)
         HAL_DCACHE_ENABLE();
 }
 #endif
+
+/*------------------------------------------------------------------------*/
+/* Clock functions.                                                       */
+
+cyg_uint32 __hal_period__;
+
+// Delay for some usecs.
+void
+hal_delay_us(cyg_int32 delay)
+{
+#define _TICKS_PER_USEC (CYGHWR_HAL_MN10300_PROCESSOR_OSC/1000000)
+    cyg_uint32 now, prev, diff, usecs;
+
+    diff = usecs = 0;
+    HAL_CLOCK_READ(&prev);
+
+    while (delay > usecs) {
+	HAL_CLOCK_READ(&now);
+
+	if (now < prev)
+	    diff += (now + (__hal_period__ - prev));
+	else
+	    diff += (now - prev);
+
+	prev = now;
+
+	if (diff >= _TICKS_PER_USEC) {
+	    usecs += (diff / _TICKS_PER_USEC);
+	    diff %= _TICKS_PER_USEC;
+	}
+    }
+}
+
+
+
 
 #ifdef CYGPKG_CYGMON
 /*------------------------------------------------------------------------*/
 /* GDB Register functions.                                                */
 #include <cyg/hal/var_arch.h>
Index: hal/mn10300/asb/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/mn10300/asb/current/ChangeLog,v
retrieving revision 1.3
diff -u -p -5 -r1.3 ChangeLog
--- hal/mn10300/asb/current/ChangeLog	6 Aug 2002 16:00:18 -0000	1.3
+++ hal/mn10300/asb/current/ChangeLog	14 Nov 2002 17:46:09 -0000
@@ -1,5 +1,16 @@
+2002-11-14  Mark Salter  <msalter@redhat.com>
+
+	* src/plf_misc.c: Don't mess with TBR.
+	* src/plf_stub.c: Tweak for RedBoot support.
+	* src/ser_asb.c:  Calculate baudrate divisor based on IOCLK. Register
+	getc_timeout_set handler.
+	* include/pkgconf/mlt*: Updated for flash support and adjusted RAM
+	addresses
+	* include/platform.inc: Always place boot flash at 0x80000000 and
+	system flash at 0x84000000.
+
 2002-08-06  Gary Thomas  <gary@chez-thomas.org>
 2002-08-06  Motoya Kurotsu <kurotsu@allied-telesis.co.jp>	
 
 	* src/ser_asb.c: I/O channel data can't be constant - contains
 	timeout information which can be changed.
Index: hal/mn10300/asb/current/cdl/hal_mn10300_am33_asb.cdl
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/mn10300/asb/current/cdl/hal_mn10300_am33_asb.cdl,v
retrieving revision 1.2
diff -u -p -5 -r1.2 hal_mn10300_am33_asb.cdl
--- hal/mn10300/asb/current/cdl/hal_mn10300_am33_asb.cdl	23 May 2002 23:04:03 -0000	1.2
+++ hal/mn10300/asb/current/cdl/hal_mn10300_am33_asb.cdl	14 Nov 2002 17:46:10 -0000
@@ -66,10 +66,12 @@ cdl_package CYGPKG_HAL_MN10300_AM33_ASB 
     implements    CYGINT_HAL_DEBUG_GDB_STUBS
     implements    CYGINT_HAL_DEBUG_GDB_STUBS_BREAK
     implements    CYGINT_HAL_VIRTUAL_VECTOR_SUPPORT
     implements    CYGINT_HAL_VIRTUAL_VECTOR_COMM_BAUD_SUPPORT
 
+    requires CYGSEM_HAL_UNCACHED_FLASH_ACCESS == 1;
+
     define_proc {
         puts $::cdl_system_header "#define CYGBLD_HAL_TARGET_H   <pkgconf/hal_mn10300_am33.h>"
         puts $::cdl_system_header "#define CYGBLD_HAL_PLATFORM_H <pkgconf/hal_mn10300_am33_asb.h>"
         puts $::cdl_system_header "#define HAL_PLATFORM_BOARD    \"Panasonic ASB2303\""
         puts $::cdl_system_header "#define HAL_PLATFORM_EXTRA    \"\""
@@ -85,53 +87,82 @@ cdl_package CYGPKG_HAL_MN10300_AM33_ASB 
 	define -file system.h CYG_HAL_STARTUP
         description   "
             Currently only ROM startup type is supported."
     }
 
-    cdl_option CYGHWR_HAL_MN10300_AM33_ASB_DIAG_PORT {
-        display          "Diagnostic Serial Port"
+    cdl_component CYG_HAL_ROM_SLOT {
+        display       "ROM slot in which residing"
+        flavor        data
+        legal_values  {"BootPROM" "SysFlash"}
+        default_value {"BootPROM"}
+        no_define
+        define -file system.h CYG_HAL_ROM_SLOT
+        description   "
+            This specifies which ROM slot the program resides in (and is booted
+            from."
+    }
+
+    cdl_option CYGHWR_HAL_MN10300_PROCESSOR_OSC_DEFAULT {
+        display       "Processor clock rate"
+        calculated    33333333
+        flavor        data
+    }
+
+    cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_DEFAULT {
+        display      "Default console channel."
+        flavor       data
+        legal_values     0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1
+        calculated   0
+    }
+ 
+    cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS {
+        display      "Number of communication channels on the board"
+        flavor       data
+        calculated   2
+    }
+ 
+    cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL {
+        display          "Debug serial port"
+        active_if        CYGPRI_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL_CONFIGURABLE
         flavor data
-        legal_values     0 1
+        legal_values     0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1
         default_value    0
         description      "
-           The ASB2303 board has two serial ports. This option
-           chooses which of these ports will be used for diagnostic output.
-           At present only port 0 is supported."
-   }
-
-   cdl_option CYGHWR_HAL_MN10300_AM33_ASB_DIAG_BAUD {
-       display          "Diagnostic Serial Port Baud Rate"
-       flavor data
-       legal_values     9600 19200 38400 115200
-       default_value    38400
-       define           CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_BAUD
-       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_MN10300_AM33_ASB_GDB_PORT {
-       display          "GDB Serial Port"
-       flavor data
-       legal_values     0 1
-       default_value    0
-       description      "
-           The ASB2303 board has two separate serial ports.  This option
-           chooses which of these ports will be used to connect to a host
-           running GDB.
-           At present only port 0 is supported."
-   }
-
-   cdl_option CYGHWR_HAL_MN10300_AM33_ASB_GDB_BAUD {
-       display          "GDB Serial Port Baud Rate"
-       flavor data
-       legal_values     9600 19200 38400 115200
-       default_value    38400
-       description      "
-           This option controls the baud rate used for the GDB connection."
-   }
+            This option chooses which port will be used to connect to a host
+            running GDB."
+     }
+ 
+     cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL {
+         display          "Diagnostic serial port"
+         active_if        CYGPRI_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_CONFIGURABLE
+         flavor data
+         legal_values     0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1
+         default_value    CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_DEFAULT
+         description      "
+            The ASB2303 board has two serial ports.  This option
+            chooses which port will be used for diagnostic output."
+     }
+
+    cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_BAUD {
+        display       "Diagnostic serial port baud rate"
+        flavor        data
+        legal_values  9600 19200 38400 57600 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 CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL_BAUD {
+        display       "GDB serial port baud rate"
+        flavor        data
+        legal_values  9600 19200 38400 57600 115200
+        default_value 115200
+        description   "
+            This option selects the baud rate used for the GDB port."
+    }
 
     cdl_component CYGBLD_GLOBAL_OPTIONS {
         display "Global build options"
         flavor  none
         parent  CYGPKG_NONE
@@ -204,70 +235,58 @@ cdl_package CYGPKG_HAL_MN10300_AM33_ASB 
         default_value 25
         description   "
             This option determines the number of breakpoints supported by the HAL."
     }
 
-    cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS {
-        display      "Number of communication channels on the board"
-        flavor       data
-        calculated   1
-    }
-
-    cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL {
-        display          "Debug serial port"
-        flavor data
-        legal_values     0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1
-        default_value    0
-        description      "
-           The ASB2303 board has two serial ports.  Currently,
-           only the first serial port is supported. This option
-           chooses which port will be used to connect to a host
-           running GDB."
-    }
- 
-     cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL {
-        display          "Diagnostic serial port"
-        flavor data
-        legal_values     0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1
-        default_value    0
-        description      "
-           The ASB2303 board has two serial ports. Currently,
-           only the first serial port is supported. This option
-           chooses which port will be used for diagnostic output."
-     }
-
     cdl_component CYGHWR_MEMORY_LAYOUT {
         display "Memory layout"
         flavor data
         no_define
-        calculated { CYG_HAL_STARTUP == "RAM" ? "mn10300_am33_asb_ram" : \
-	                                        "mn10300_am33_asb_rom" }
+        calculated { CYG_HAL_STARTUP  == "RAM"      ? "mn10300_am33_asb_ram" : \
+                     CYG_HAL_ROM_SLOT == "BootPROM" ? "mn10300_am33_asb_rom" : \
+                                                      "mn10300_am33_asb_flash" }
 
         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_mn10300_am33_asb_ram.ldi>" : \
-                                                    "<pkgconf/mlt_mn10300_am33_asb_rom.ldi>" }
+            calculated { CYG_HAL_STARTUP == "RAM"       ? "<pkgconf/mlt_mn10300_am33_asb_ram.ldi>" : \
+                         CYG_HAL_ROM_SLOT == "BootPROM" ? "<pkgconf/mlt_mn10300_am33_asb_rom.ldi>" : \
+                                                          "<pkgconf/mlt_mn10300_am33_asb_flash.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_mn10300_am33_asb_ram.h>" : \
-                                                    "<pkgconf/mlt_mn10300_am33_asb_rom.h>" }
+            calculated { CYG_HAL_STARTUP == "RAM"       ? "<pkgconf/mlt_mn10300_am33_asb_ram.h>" : \
+                         CYG_HAL_ROM_SLOT == "BootPROM" ? "<pkgconf/mlt_mn10300_am33_asb_rom.h>" : \
+                                                          "<pkgconf/mlt_mn10300_am33_asb_flash.h>" }
         }
     }
 
+    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."
+    }
+
     cdl_option CYGSEM_HAL_USE_ROM_MONITOR {
         display       "Work with a ROM monitor"
         flavor        booldata
-        legal_values  { "Generic" "CygMon" "GDB_stubs" }
-        default_value { CYG_HAL_STARTUP == "RAM" ? "CygMon" : 0 }
+        legal_values  { "Generic" "GDB_stubs" }
+        default_value { CYG_HAL_STARTUP == "RAM" ? "GDB_stubs" : 0 }
         parent        CYGPKG_HAL_ROM_MONITOR
         requires      { CYG_HAL_STARTUP == "RAM" }
         description   "
             Support can be enabled for three different varieties of ROM monitor.
             This support changes various eCos semantics such as the encoding
@@ -276,49 +295,34 @@ cdl_package CYGPKG_HAL_MN10300_AM33_ASB 
             Firstly there is \"Generic\" support which prevents the HAL
             from overriding the hardware vectors that it does not use, to
             instead allow an installed ROM monitor to handle them. This is
             the most basic support which is likely to be common to most
             implementations of ROM monitor.
-            \"CygMon\" provides support for the Cygnus ROM Monitor.
-            And finally, \"GDB_stubs\" provides support when GDB stubs are
-            included in the ROM monitor or boot ROM."
-    }
-
-    cdl_option CYGSEM_HAL_ROM_MONITOR {
-        display       "Behave as a ROM monitor"
-        flavor        bool
-        default_value 1
-        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."
+             \"GDB_stubs\" provides support when GDB stubs are included in
+             the ROM monitor or boot ROM."
     }
 
-    cdl_component CYGPKG_CYGMON_HAL_OPTIONS {
-        display       "CygMon HAL options"
+    cdl_component CYGPKG_REDBOOT_HAL_OPTIONS {
+        display       "Redboot HAL options"
         flavor        none
         no_define
-        parent        CYGPKG_CYGMON
-        active_if     CYGPKG_CYGMON
+        parent        CYGPKG_REDBOOT
+        active_if     CYGPKG_REDBOOT
         description   "
-            This option also lists the target's requirements for a valid CygMon
+            This option lists the target's requirements for a valid Redboot
             configuration."
-
-        cdl_option CYGBLD_BUILD_CYGMON_BIN {
-            display       "Build CygMon ROM binary image"
-            active_if     CYGBLD_BUILD_CYGMON
+            
+        cdl_option CYGBLD_BUILD_REDBOOT_BIN {
+            display       "Build Redboot ROM binary image"
+            active_if     CYGBLD_BUILD_REDBOOT
             default_value 1
             no_define
-            description "This option enables the conversion of the CygMon ELF
+            description "This option enables the conversion of the Redboot ELF
                          image to a binary image suitable for ROM programming."
     
             make -priority 325 {
-                <PREFIX>/bin/cygmon.bin : <PREFIX>/bin/cygmon.elf
+                <PREFIX>/bin/redboot.bin : <PREFIX>/bin/redboot.elf
                 $(OBJCOPY) --strip-debug $< $(@:.bin=.img) 
                 $(OBJCOPY) -O srec $< $(@:.bin=.srec)
                 $(OBJCOPY) -O binary $< $@
             }
         }
Index: hal/mn10300/asb/current/include/platform.inc
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/mn10300/asb/current/include/platform.inc,v
retrieving revision 1.2
diff -u -p -5 -r1.2 platform.inc
--- hal/mn10300/asb/current/include/platform.inc	23 May 2002 23:04:03 -0000	1.2
+++ hal/mn10300/asb/current/include/platform.inc	14 Nov 2002 17:46:10 -0000
@@ -168,97 +168,118 @@ x\@:
 
 #define BCCR                    0xC0002000
 #define BCCR_INIT               0x12040580
 
 #define SBBASE0                 0xD8C00100
-#define SBBASE0_INIT            0x8000FC01
 #define SBBASE1                 0xD8C00110
-#define SBBASE1_INIT            0x8400FC01
 #define SBBASE2                 0xD8C00120
-#define SBBASE2_INIT            0x8600FFF1
 #define SBBASE3                 0xD8C00130
-#define SBBASE3_INIT            0x00000000
 #define SBBASE4                 0xD8C00140
-#define SBBASE4_INIT            0x00000000
 #define SBBASE5                 0xD8C00150
-#define SBBASE5_INIT            0x00000000
 #define SBBASE6                 0xD8C00160
-#define SBBASE6_INIT            0x00000000
 #define SBBASE7                 0xD8C00170
+
+#define SBBASE0_INIT_SYSFL	0x8000FE01
+#define SBBASE0_INIT_BPROM	0x8400FE01
+#define SBBASE1_INIT_SYSFL	0x8400FE01
+#define SBBASE1_INIT_BPROM	0x8000FE01
+#define SBBASE2_INIT            0x8600FF81
+#define SBBASE3_INIT            0x00000000
+#define SBBASE4_INIT            0x00000000
+#define SBBASE5_INIT            0x00000000
+#define SBBASE6_INIT            0x00000000
 #define SBBASE7_INIT            0x00000000
 
 #define SBCTRL00                0xD8C00200
-#define SBCTRL00_INIT           0x21111000
 #define SBCTRL10                0xD8C00210
-#define SBCTRL10_INIT           0x21111000
 #define SBCTRL20                0xD8C00220
-#define SBCTRL20_INIT           0x21111000
 #define SBCTRL30                0xD8C00230
-#define SBCTRL30_INIT           0x00000000
 #define SBCTRL40                0xD8C00240
-#define SBCTRL40_INIT           0x00000000
 #define SBCTRL50                0xD8C00250
-#define SBCTRL50_INIT           0x00000000
 #define SBCTRL60                0xD8C00260
-#define SBCTRL60_INIT           0x00000000
 #define SBCTRL70                0xD8C00270
+
+#define SBCTRL00_INIT           0x21111000
+#define SBCTRL10_INIT           0x21111000
+#define SBCTRL20_INIT           0x21111000
+#define SBCTRL30_INIT           0x00000000
+#define SBCTRL40_INIT           0x00000000
+#define SBCTRL50_INIT           0x00000000 // 0x21111100
+#define SBCTRL60_INIT           0x00000000 // 0x11110000
 #define SBCTRL70_INIT           0x00000000
 
 #define SBCTRL01                0xD8C00204
-#define SBCTRL01_INIT           0x00100200
 #define SBCTRL11                0xD8C00214
-#define SBCTRL11_INIT           0x00100200
 #define SBCTRL21                0xD8C00224
-#define SBCTRL21_INIT           0x00100200
 #define SBCTRL31                0xD8C00234
-#define SBCTRL31_INIT           0x00000000
 #define SBCTRL41                0xD8C00244
-#define SBCTRL41_INIT           0x00000000
 #define SBCTRL51                0xD8C00254
-#define SBCTRL51_INIT           0x00000000
 #define SBCTRL61                0xD8C00264
-#define SBCTRL61_INIT           0x00000000
 #define SBCTRL71                0xD8C00274
+
+#define SBCTRL01_INIT           0x00100200
+#define SBCTRL11_INIT           0x00100200
+#define SBCTRL21_INIT           0x00100200
+#define SBCTRL31_INIT           0x00000000
+#define SBCTRL41_INIT           0x00000000
+#define SBCTRL51_INIT           0x00000000
+#define SBCTRL61_INIT           0x00000000
 #define SBCTRL71_INIT           0x00000000
 
-#define SBCTRL02                0xD8C00208
-#define SBCTRL02_INIT           0x00000004
+#define SBCTRL02                0xD8C00208 
 #define SBCTRL12                0xD8C00218
-#define SBCTRL12_INIT           0x00000004
 #define SBCTRL22                0xD8C00228
-#define SBCTRL22_INIT           0x00000004
 #define SBCTRL32                0xD8C00238
-#define SBCTRL32_INIT           0x00000000
 #define SBCTRL42                0xD8C00248
-#define SBCTRL42_INIT           0x00000000
 #define SBCTRL52                0xD8C00258
-#define SBCTRL52_INIT           0x00000000
 #define SBCTRL62                0xD8C00268
-#define SBCTRL62_INIT           0x00000000
 #define SBCTRL72                0xD8C00278
+
+#define SBCTRL02_INIT           0x00000004
+#define SBCTRL12_INIT           0x04000004
+#define SBCTRL22_INIT           0x00000004
+#define SBCTRL32_INIT           0x00000000
+#define SBCTRL42_INIT           0x00000000
+#define SBCTRL52_INIT           0x00000000
+#define SBCTRL62_INIT           0x00000000
 #define SBCTRL72_INIT           0x00000000
 
 #define SDBASE0                 0xDA000008
-#define SDBASE0_INIT            0x9000FF81
 #define SDBASE1                 0xDA00000C
-#define SDBASE1_INIT            0x9080FF81
 #define SDRAMBUS                0xDA000000
+
+#if 0
+// 16MB SDRAM
+#define SDBASE0_INIT            0x9000FF81
+#define SDBASE1_INIT            0x9080FF81
 #define SDRAMBUS_INIT           0xA8990654
+#else
+// 64MB SDRAM
+#define SDBASE0_INIT            0x9000fe01
+#define SDBASE1_INIT            0x9200fe01
+#define SDRAMBUS_INIT           0xa89b0654
+#endif
 
 	.macro	hal_memc_init
 	mov	BCCR,a0
 	mov	BCCR_INIT,d0
 	mov	d0,(a0)
 
-	mov	SBBASE0,a0
-	mov	SBBASE0_INIT,d0
-	mov	d0,(a0)
-
-	mov	SBBASE1,a0
-	mov	SBBASE1_INIT,d0
-	mov	d0,(a0)
-
+	// reduce the span of the ROM banks first
+	mov	(SBBASE0),d0
+	btst	1,d0
+	beq	0f
+	mov	0x8000FE01,d0
+	mov	d0,(SBBASE0)
+0:
+	mov	(SBBASE1),d0
+	btst	1,d0
+	beq	0f
+	mov	0x8000FE01,d0
+	mov	d0,(SBBASE1)
+0:
+	
 	mov	SBBASE2,a0
 	mov	SBBASE2_INIT,d0
 	mov	d0,(a0)
 
 	mov	SBBASE3,a0
@@ -387,28 +408,87 @@ x\@:
 
 	mov	SDRAMBUS,a0
 	mov	SDRAMBUS_INIT,d0
 	mov	d0,(a0)
 
-	# Jump forward so we start running from the 80000000 base address
-        mov     0f,a0
+	// now the ROMs need putting into the right place
+	// - this is tricky because when we're booting from the system flash,
+	//   it has had its base address pre-swapped by the CPU
+	// - we need to copy a small piece of code to the SRAM and execute it
+	//   there
+
+	// copy the ROM address adjustor to the SRAM
+	add	-4,sp
+	call	__hal_plf_base_ref,[],0		// note we can't address ourselves directly yet
+__hal_plf_base_ref:
+	movm	(sp),[a3]
+	mov	a3,a0
+	add	__hal_plf_rom_swap_start-__hal_plf_base_ref,a0
+	add	__hal_plf_rom_swap_end-__hal_plf_base_ref,a3
+	mov	0x8C000000,a1
+0:	movbu	(a0),d0
+	movbu	d0,(a1)
+	inc	a0
+	inc	a1
+	cmp	a0,a3
+	bcc	0b
+	mov	0x8C000000,a1
+	jmp	(a1)	
+
+	////////////////////////////////////////////////////////////////
+__hal_plf_rom_swap_start:
+	// put boot PROM at 0x80000000, and system flash at 0x84000000
+	mov	SBBASE0_INIT_BPROM,d0
+	mov	d0,(SBBASE0)
+
+	mov	SBBASE1_INIT_BPROM,d0
+	mov	d0,(SBBASE1)
+
+	// memory bank 0
+	mov	SBCTRL00_INIT,d0
+	mov	d0,(SBCTRL00)
+	mov	SBCTRL01_INIT,d0
+	mov	d0,(SBCTRL01)
+	mov	SBCTRL02_INIT,d0
+	mov	d0,(SBCTRL02)
+
+	// memory bank 1
+	mov	SBCTRL10_INIT,d0
+	mov	d0,(SBCTRL10)
+	mov	SBCTRL11_INIT,d0
+	mov	d0,(SBCTRL11)
+	mov	SBCTRL12_INIT,d0
+	mov	d0,(SBCTRL12)
+
+	// jump forward so we start running from the 80000000/84000000 base address
+        mov     __hal_plf_rom_swap_reentry,a0
 	jmp	(a0)
+__hal_plf_rom_swap_end:
+	////////////////////////////////////////////////////////////////
+
+__hal_plf_rom_swap_reentry:
+	// clear the on-CPU 16Kb SRAM
+	clr	d0
+	mov	16384/4-4,d1
+	mov	0x8C000000,a0
 0:
+	mov	d0,(a0,d1)
+	sub	4,d1
+	bnc	0b
+
 	.endm
 
 #define CYGPKG_HAL_MN10300_MEMC_DEFINED
 
 #endif	
 
 
 //-----------------------------------------------------------------------------
 // Syscall support.
-#ifdef CYGPKG_CYGMON
-// Cygmon provides syscall handling for this board
+// RedBoot provides syscall handling for this board
 // These must be kept in sync with the rest of the tree.
 #define SIGSYS     12
 #define SIGSYSCALL SIGSYS
-#endif
 
 #------------------------------------------------------------------------------
 #endif // ifndef CYGONCE_HAL_PLATFORM_INC
 # end of platform.inc
Index: hal/mn10300/asb/current/include/pkgconf/mlt_mn10300_am33_asb_flash.h
===================================================================
RCS file: hal/mn10300/asb/current/include/pkgconf/mlt_mn10300_am33_asb_flash.h
diff -N hal/mn10300/asb/current/include/pkgconf/mlt_mn10300_am33_asb_flash.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ hal/mn10300/asb/current/include/pkgconf/mlt_mn10300_am33_asb_flash.h	14 Nov 2002 17:46:10 -0000
@@ -0,0 +1,20 @@
+// eCos memory layout - Fri Oct 20 08:28:05 2000
+
+// This is a generated file - do not edit
+
+#ifndef __ASSEMBLER__
+#include <cyg/infra/cyg_type.h>
+#include <stddef.h>
+
+#endif
+#define CYGMEM_REGION_rom	(0x84000000)
+#define CYGMEM_REGION_rom_SIZE	(0x1000000)
+#define CYGMEM_REGION_rom_ATTR	(CYGMEM_REGION_ATTR_R)
+#define CYGMEM_REGION_ram	(0x90000000)
+#define CYGMEM_REGION_ram_SIZE	(0x04000000)
+#define CYGMEM_REGION_ram_ATTR	(CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W)
+#ifndef __ASSEMBLER__
+extern char CYG_LABEL_NAME (__heap1) [];
+#endif
+#define CYGMEM_SECTION_heap1 (CYG_LABEL_NAME (__heap1))
+#define CYGMEM_SECTION_heap1_SIZE (0x94000000 - (size_t) CYG_LABEL_NAME (__heap1))
Index: hal/mn10300/asb/current/include/pkgconf/mlt_mn10300_am33_asb_flash.ldi
===================================================================
RCS file: hal/mn10300/asb/current/include/pkgconf/mlt_mn10300_am33_asb_flash.ldi
diff -N hal/mn10300/asb/current/include/pkgconf/mlt_mn10300_am33_asb_flash.ldi
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ hal/mn10300/asb/current/include/pkgconf/mlt_mn10300_am33_asb_flash.ldi	14 Nov 2002 17:46:10 -0000
@@ -0,0 +1,32 @@
+// eCos memory layout - Fri Oct 20 08:28:05 2000 -*- c -*-
+
+// This is a generated file - do not edit
+
+#include <cyg/infra/cyg_type.inc>
+
+MEMORY
+{
+    rom : ORIGIN = 0x84000000, LENGTH = 0x01000000
+    ram : ORIGIN = 0x90000000, LENGTH = 0x04000000
+}
+
+SECTIONS
+{
+    SECTIONS_BEGIN
+    SECTION_rom_vectors (rom, 0x84000000, LMA_EQ_VMA)
+    SECTION_text (rom, ALIGN (0x1), LMA_EQ_VMA)
+    SECTION_fini (rom, ALIGN (0x1), LMA_EQ_VMA)
+    SECTION_rodata (rom, ALIGN (0x1), LMA_EQ_VMA)
+    SECTION_rodata1 (rom, ALIGN (0x1), LMA_EQ_VMA)
+    SECTION_fixup (rom, ALIGN (0x1), LMA_EQ_VMA)
+    SECTION_gcc_except_table (rom, ALIGN (0x1), LMA_EQ_VMA)
+    SECTION_data (ram, 0x90000000, FOLLOWING (.gcc_except_table))
+    SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA)
+    CYG_LABEL_DEFN(__heap1) = ALIGN (0x8);
+    SECTIONS_END
+}
+
+#define CYG_HAL_PLATFORM_HAL_VSR_TABLE_DEFINED
+
+_hal_vsr_table = 0x8C000000;
+_hal_virtual_vector_table = 0x8C000100;
Index: hal/mn10300/asb/current/include/pkgconf/mlt_mn10300_am33_asb_flash.mlt
===================================================================
RCS file: hal/mn10300/asb/current/include/pkgconf/mlt_mn10300_am33_asb_flash.mlt
diff -N hal/mn10300/asb/current/include/pkgconf/mlt_mn10300_am33_asb_flash.mlt
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ hal/mn10300/asb/current/include/pkgconf/mlt_mn10300_am33_asb_flash.mlt	14 Nov 2002 17:46:10 -0000
@@ -0,0 +1,13 @@
+version 0
+region rom 84000000 1000000 1 !
+region ram 90000000 4000000 0 !
+section rom_vectors 0 1 0 1 1 1 1 1 84000000 84000000 text text !
+section text 0 1 0 1 0 1 0 1 fini fini !
+section fini 0 1 0 1 0 1 0 1 rodata rodata !
+section rodata 0 1 0 1 0 1 0 1 rodata1 rodata1 !
+section rodata1 0 1 0 1 0 1 0 1 fixup fixup !
+section fixup 0 1 0 1 0 1 0 1 gcc_except_table gcc_except_table !
+section gcc_except_table 0 1 0 1 0 0 0 1 data !
+section data 0 1 1 1 1 1 0 0 90000000 bss !
+section bss 0 4 0 1 0 1 0 1 heap1 heap1 !
+section heap1 0 8 0 0 0 0 0 0 !
Index: hal/mn10300/asb/current/include/pkgconf/mlt_mn10300_am33_asb_ram.h
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/mn10300/asb/current/include/pkgconf/mlt_mn10300_am33_asb_ram.h,v
retrieving revision 1.1
diff -u -p -5 -r1.1 mlt_mn10300_am33_asb_ram.h
--- hal/mn10300/asb/current/include/pkgconf/mlt_mn10300_am33_asb_ram.h	20 May 2002 22:23:21 -0000	1.1
+++ hal/mn10300/asb/current/include/pkgconf/mlt_mn10300_am33_asb_ram.h	14 Nov 2002 17:46:10 -0000
@@ -5,13 +5,13 @@
 #ifndef __ASSEMBLER__
 #include <cyg/infra/cyg_type.h>
 #include <stddef.h>
 
 #endif
-#define CYGMEM_REGION_ram (0x90080000)
-#define CYGMEM_REGION_ram_SIZE (0xf80000)
+#define CYGMEM_REGION_ram (0x90020000)
+#define CYGMEM_REGION_ram_SIZE (0x03fe0000)
 #define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W)
 #ifndef __ASSEMBLER__
 extern char CYG_LABEL_NAME (__heap1) [];
 #endif
 #define CYGMEM_SECTION_heap1 (CYG_LABEL_NAME (__heap1))
-#define CYGMEM_SECTION_heap1_SIZE (0x91000000 - (size_t) CYG_LABEL_NAME (__heap1))
+#define CYGMEM_SECTION_heap1_SIZE (0x94000000 - (size_t) CYG_LABEL_NAME (__heap1))
Index: hal/mn10300/asb/current/include/pkgconf/mlt_mn10300_am33_asb_ram.ldi
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/mn10300/asb/current/include/pkgconf/mlt_mn10300_am33_asb_ram.ldi,v
retrieving revision 1.1
diff -u -p -5 -r1.1 mlt_mn10300_am33_asb_ram.ldi
--- hal/mn10300/asb/current/include/pkgconf/mlt_mn10300_am33_asb_ram.ldi	20 May 2002 22:23:21 -0000	1.1
+++ hal/mn10300/asb/current/include/pkgconf/mlt_mn10300_am33_asb_ram.ldi	14 Nov 2002 17:46:10 -0000
@@ -4,17 +4,17 @@
 
 #include <cyg/infra/cyg_type.inc>
 
 MEMORY
 {
-    ram : ORIGIN = 0x90080000, LENGTH = 0xf80000
+    ram : ORIGIN = 0x90020000, LENGTH = 0x3fe0000
 }
 
 SECTIONS
 {
     SECTIONS_BEGIN
-    SECTION_rom_vectors (ram, 0x90080000, LMA_EQ_VMA)
+    SECTION_rom_vectors (ram, 0x90020000, LMA_EQ_VMA)
     SECTION_text (ram, ALIGN (0x1), LMA_EQ_VMA)
     SECTION_fini (ram, ALIGN (0x1), LMA_EQ_VMA)
     SECTION_rodata (ram, ALIGN (0x1), LMA_EQ_VMA)
     SECTION_rodata1 (ram, ALIGN (0x1), LMA_EQ_VMA)
     SECTION_fixup (ram, ALIGN (0x1), LMA_EQ_VMA)
@@ -22,5 +22,10 @@ SECTIONS
     SECTION_data (ram, ALIGN (0x4), LMA_EQ_VMA)
     SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA)
     CYG_LABEL_DEFN(__heap1) = ALIGN (0x8);
     SECTIONS_END
 }
+
+#define CYG_HAL_PLATFORM_HAL_VSR_TABLE_DEFINED
+
+_hal_vsr_table = 0x8C000000;
+_hal_virtual_vector_table = 0x8C000100;
Index: hal/mn10300/asb/current/include/pkgconf/mlt_mn10300_am33_asb_ram.mlt
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/mn10300/asb/current/include/pkgconf/mlt_mn10300_am33_asb_ram.mlt,v
retrieving revision 1.1
diff -u -p -5 -r1.1 mlt_mn10300_am33_asb_ram.mlt
--- hal/mn10300/asb/current/include/pkgconf/mlt_mn10300_am33_asb_ram.mlt	20 May 2002 22:23:21 -0000	1.1
+++ hal/mn10300/asb/current/include/pkgconf/mlt_mn10300_am33_asb_ram.mlt	14 Nov 2002 17:46:10 -0000
@@ -1,8 +1,8 @@
 version 0
-region ram 90080000 f80000 0 !
-section rom_vectors 0 1 0 1 1 1 1 1 90080000 90080000 text text !
+region ram 90020000 3fe0000 0 !
+section rom_vectors 0 1 0 1 1 1 1 1 90020000 90020000 text text !
 section text 0 1 0 1 0 1 0 1 fini fini !
 section fini 0 1 0 1 0 1 0 1 rodata rodata !
 section rodata 0 1 0 1 0 1 0 1 rodata1 rodata1 !
 section rodata1 0 1 0 1 0 1 0 1 fixup fixup !
 section fixup 0 1 0 1 0 1 0 1 gcc_except_table gcc_except_table !
Index: hal/mn10300/asb/current/include/pkgconf/mlt_mn10300_am33_asb_rom.h
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/mn10300/asb/current/include/pkgconf/mlt_mn10300_am33_asb_rom.h,v
retrieving revision 1.1
diff -u -p -5 -r1.1 mlt_mn10300_am33_asb_rom.h
--- hal/mn10300/asb/current/include/pkgconf/mlt_mn10300_am33_asb_rom.h	20 May 2002 22:23:21 -0000	1.1
+++ hal/mn10300/asb/current/include/pkgconf/mlt_mn10300_am33_asb_rom.h	14 Nov 2002 17:46:10 -0000
@@ -6,15 +6,15 @@
 #include <cyg/infra/cyg_type.h>
 #include <stddef.h>
 
 #endif
 #define CYGMEM_REGION_rom (0x80000000)
-#define CYGMEM_REGION_rom_SIZE (0x400000)
+#define CYGMEM_REGION_rom_SIZE (0x100000)
 #define CYGMEM_REGION_rom_ATTR (CYGMEM_REGION_ATTR_R)
-#define CYGMEM_REGION_ram (0x90000200)
-#define CYGMEM_REGION_ram_SIZE (0x7fe00)
+#define CYGMEM_REGION_ram (0x90000000)
+#define CYGMEM_REGION_ram_SIZE (0x4000000)
 #define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W)
 #ifndef __ASSEMBLER__
 extern char CYG_LABEL_NAME (__heap1) [];
 #endif
 #define CYGMEM_SECTION_heap1 (CYG_LABEL_NAME (__heap1))
-#define CYGMEM_SECTION_heap1_SIZE (0x90080000 - (size_t) CYG_LABEL_NAME (__heap1))
+#define CYGMEM_SECTION_heap1_SIZE (0x94000000 - (size_t) CYG_LABEL_NAME (__heap1))
Index: hal/mn10300/asb/current/include/pkgconf/mlt_mn10300_am33_asb_rom.ldi
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/mn10300/asb/current/include/pkgconf/mlt_mn10300_am33_asb_rom.ldi,v
retrieving revision 1.1
diff -u -p -5 -r1.1 mlt_mn10300_am33_asb_rom.ldi
--- hal/mn10300/asb/current/include/pkgconf/mlt_mn10300_am33_asb_rom.ldi	20 May 2002 22:23:21 -0000	1.1
+++ hal/mn10300/asb/current/include/pkgconf/mlt_mn10300_am33_asb_rom.ldi	14 Nov 2002 17:46:10 -0000
@@ -4,12 +4,12 @@
 
 #include <cyg/infra/cyg_type.inc>
 
 MEMORY
 {
-    rom : ORIGIN = 0x80000000, LENGTH = 0x400000
-    ram : ORIGIN = 0x90000200, LENGTH = 0x7fe00
+    rom : ORIGIN = 0x80000000, LENGTH = 0x00100000
+    ram : ORIGIN = 0x90000000, LENGTH = 0x04000000
 }
 
 SECTIONS
 {
     SECTIONS_BEGIN
@@ -18,10 +18,15 @@ SECTIONS
     SECTION_fini (rom, ALIGN (0x1), LMA_EQ_VMA)
     SECTION_rodata (rom, ALIGN (0x1), LMA_EQ_VMA)
     SECTION_rodata1 (rom, ALIGN (0x1), LMA_EQ_VMA)
     SECTION_fixup (rom, ALIGN (0x1), LMA_EQ_VMA)
     SECTION_gcc_except_table (rom, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_data (ram, 0x90000200, FOLLOWING (.gcc_except_table))
+    SECTION_data (ram, 0x90000000, FOLLOWING (.gcc_except_table))
     SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA)
     CYG_LABEL_DEFN(__heap1) = ALIGN (0x8);
     SECTIONS_END
 }
+
+#define CYG_HAL_PLATFORM_HAL_VSR_TABLE_DEFINED
+
+_hal_vsr_table = 0x8C000000;
+_hal_virtual_vector_table = 0x8C000100;
Index: hal/mn10300/asb/current/include/pkgconf/mlt_mn10300_am33_asb_rom.mlt
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/mn10300/asb/current/include/pkgconf/mlt_mn10300_am33_asb_rom.mlt,v
retrieving revision 1.1
diff -u -p -5 -r1.1 mlt_mn10300_am33_asb_rom.mlt
--- hal/mn10300/asb/current/include/pkgconf/mlt_mn10300_am33_asb_rom.mlt	20 May 2002 22:23:21 -0000	1.1
+++ hal/mn10300/asb/current/include/pkgconf/mlt_mn10300_am33_asb_rom.mlt	14 Nov 2002 17:46:10 -0000
@@ -1,13 +1,13 @@
 version 0
-region rom 80000000 400000 1 !
-region ram 90000200 7fe00 0 !
+region rom 80000000 100000 1 !
+region ram 90000000 400000 0 !
 section rom_vectors 0 1 0 1 1 1 1 1 80000000 80000000 text text !
 section text 0 1 0 1 0 1 0 1 fini fini !
 section fini 0 1 0 1 0 1 0 1 rodata rodata !
 section rodata 0 1 0 1 0 1 0 1 rodata1 rodata1 !
 section rodata1 0 1 0 1 0 1 0 1 fixup fixup !
 section fixup 0 1 0 1 0 1 0 1 gcc_except_table gcc_except_table !
 section gcc_except_table 0 1 0 1 0 0 0 1 data !
-section data 0 1 1 1 1 1 0 0 90000200 bss !
+section data 0 1 1 1 1 1 0 0 90000000 bss !
 section bss 0 4 0 1 0 1 0 1 heap1 heap1 !
 section heap1 0 8 0 0 0 0 0 0 !
Index: hal/mn10300/asb/current/misc/redboot_FLASH.ecm
===================================================================
RCS file: hal/mn10300/asb/current/misc/redboot_FLASH.ecm
diff -N hal/mn10300/asb/current/misc/redboot_FLASH.ecm
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ hal/mn10300/asb/current/misc/redboot_FLASH.ecm	14 Nov 2002 17:46:10 -0000
@@ -0,0 +1,93 @@
+cdl_savefile_version 1;
+cdl_savefile_command cdl_savefile_version {};
+cdl_savefile_command cdl_savefile_command {};
+cdl_savefile_command cdl_configuration { description hardware template package };
+cdl_savefile_command cdl_package { value_source user_value wizard_value inferred_value };
+cdl_savefile_command cdl_component { value_source user_value wizard_value inferred_value };
+cdl_savefile_command cdl_option { value_source user_value wizard_value inferred_value };
+cdl_savefile_command cdl_interface { value_source user_value wizard_value inferred_value };
+
+cdl_configuration eCos {
+    description "" ;
+    hardware    asb ;
+    template    redboot ;
+    package -hardware CYGPKG_HAL_MN10300 current ;
+    package -hardware CYGPKG_HAL_MN10300_AM33_ASB current ;
+    package -hardware CYGPKG_HAL_MN10300_AM33 current ;
+    package -template CYGPKG_HAL current ;
+    package -template CYGPKG_INFRA current ;
+    package -template CYGPKG_REDBOOT current ;
+
+    package CYGPKG_IO_FLASH current ;
+    package -hardware CYGPKG_DEVS_FLASH_MN10300_ASB2303 current ;
+    package CYGPKG_DEVS_FLASH_AMD_AM29XXXXX current ;
+};
+
+cdl_option CYGBLD_BUILD_GDB_STUBS {
+    user_value 0
+};
+
+cdl_option CYGDBG_HAL_COMMON_INTERRUPTS_SAVE_MINIMUM_CONTEXT {
+    user_value 0
+};
+
+cdl_option CYGDBG_HAL_COMMON_CONTEXT_SAVE_MINIMUM {
+    inferred_value 0
+};
+
+cdl_option CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS {
+    inferred_value 1
+};
+
+cdl_option CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT {
+    inferred_value 1
+};
+
+cdl_option CYGDBG_HAL_DEBUG_GDB_CTRLC_SUPPORT {
+    inferred_value 0
+};
+
+cdl_option CYGSEM_HAL_USE_ROM_MONITOR {
+    inferred_value 0 0
+};
+
+cdl_option CYGSEM_HAL_ROM_MONITOR {
+    inferred_value 1
+};
+
+cdl_component CYG_HAL_STARTUP {
+    user_value ROM
+};
+
+cdl_component CYG_HAL_ROM_SLOT {
+    user_value "SysFlash"
+};
+
+cdl_component CYGBLD_BUILD_REDBOOT {
+    user_value 1
+};
+
+cdl_option CYGOPT_REDBOOT_FIS {
+    user_value 1
+};
+
+cdl_option CYGHWR_DEVS_FLASH_MN10300_ASB2303_BANK {
+    user_value "BootPROM"
+};
+
+cdl_option CYGHWR_DEVS_FLASH_AMD_AM29DL324D {
+    user_value 1
+};
+
+cdl_option CYGHWR_DEVS_FLASH_AMD_AM29LV800 {
+    user_value 1
+};
+
+cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_BAUD {
+    user_value 115200
+};
+
+cdl_option CYGSEM_REDBOOT_BSP_SYSCALLS {
+  user_value 1
+};
+
Index: hal/mn10300/asb/current/misc/redboot_RAM.ecm
===================================================================
RCS file: hal/mn10300/asb/current/misc/redboot_RAM.ecm
diff -N hal/mn10300/asb/current/misc/redboot_RAM.ecm
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ hal/mn10300/asb/current/misc/redboot_RAM.ecm	14 Nov 2002 17:46:10 -0000
@@ -0,0 +1,88 @@
+cdl_savefile_version 1;
+cdl_savefile_command cdl_savefile_version {};
+cdl_savefile_command cdl_savefile_command {};
+cdl_savefile_command cdl_configuration { description hardware template package };
+cdl_savefile_command cdl_package { value_source user_value wizard_value inferred_value };
+cdl_savefile_command cdl_component { value_source user_value wizard_value inferred_value };
+cdl_savefile_command cdl_option { value_source user_value wizard_value inferred_value };
+cdl_savefile_command cdl_interface { value_source user_value wizard_value inferred_value };
+
+cdl_configuration eCos {
+    description "" ;
+    hardware    asb ;
+    template    redboot ;
+    package -hardware CYGPKG_HAL_MN10300 current ;
+    package -hardware CYGPKG_HAL_MN10300_AM33_ASB current ;
+    package -hardware CYGPKG_HAL_MN10300_AM33 current ;
+    package -template CYGPKG_HAL current ;
+    package -template CYGPKG_INFRA current ;
+    package -template CYGPKG_REDBOOT current ;
+
+    package CYGPKG_IO_FLASH current ;
+    package -hardware CYGPKG_DEVS_FLASH_MN10300_ASB2303 current ;
+    package CYGPKG_DEVS_FLASH_AMD_AM29XXXXX current ;
+};
+
+cdl_option CYGBLD_BUILD_GDB_STUBS {
+    user_value 0
+};
+
+cdl_option CYGDBG_HAL_COMMON_INTERRUPTS_SAVE_MINIMUM_CONTEXT {
+    user_value 0
+};
+
+cdl_option CYGDBG_HAL_COMMON_CONTEXT_SAVE_MINIMUM {
+    inferred_value 0
+};
+
+cdl_option CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS {
+    inferred_value 1
+};
+
+cdl_option CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT {
+    inferred_value 1
+};
+
+cdl_option CYGDBG_HAL_DEBUG_GDB_CTRLC_SUPPORT {
+    inferred_value 0
+};
+
+cdl_option CYGSEM_HAL_USE_ROM_MONITOR {
+    inferred_value 0 0
+};
+
+cdl_option CYGSEM_HAL_ROM_MONITOR {
+    inferred_value 1
+};
+
+cdl_component CYG_HAL_STARTUP {
+    user_value RAM
+};
+
+cdl_component CYGBLD_BUILD_REDBOOT {
+    user_value 1
+};
+
+cdl_option CYGOPT_REDBOOT_FIS {
+    user_value 1
+};
+
+cdl_option CYGHWR_DEVS_FLASH_MN10300_ASB2303_BANK {
+    user_value "BootPROM"
+};
+
+cdl_option CYGHWR_DEVS_FLASH_AMD_AM29DL324D {
+    user_value 1
+};
+
+cdl_option CYGHWR_DEVS_FLASH_AMD_AM29LV800 {
+    user_value 1
+};
+
+cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_BAUD {
+    user_value 115200
+};
+
+cdl_option CYGSEM_REDBOOT_BSP_SYSCALLS {
+  user_value 1
+};
Index: hal/mn10300/asb/current/misc/redboot_ROM.ecm
===================================================================
RCS file: hal/mn10300/asb/current/misc/redboot_ROM.ecm
diff -N hal/mn10300/asb/current/misc/redboot_ROM.ecm
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ hal/mn10300/asb/current/misc/redboot_ROM.ecm	14 Nov 2002 17:46:10 -0000
@@ -0,0 +1,88 @@
+cdl_savefile_version 1;
+cdl_savefile_command cdl_savefile_version {};
+cdl_savefile_command cdl_savefile_command {};
+cdl_savefile_command cdl_configuration { description hardware template package };
+cdl_savefile_command cdl_package { value_source user_value wizard_value inferred_value };
+cdl_savefile_command cdl_component { value_source user_value wizard_value inferred_value };
+cdl_savefile_command cdl_option { value_source user_value wizard_value inferred_value };
+cdl_savefile_command cdl_interface { value_source user_value wizard_value inferred_value };
+
+cdl_configuration eCos {
+    description "" ;
+    hardware    asb ;
+    template    redboot ;
+    package -hardware CYGPKG_HAL_MN10300 current ;
+    package -hardware CYGPKG_HAL_MN10300_AM33_ASB current ;
+    package -hardware CYGPKG_HAL_MN10300_AM33 current ;
+    package -template CYGPKG_HAL current ;
+    package -template CYGPKG_INFRA current ;
+    package -template CYGPKG_REDBOOT current ;
+
+    package CYGPKG_IO_FLASH current ;
+    package -hardware CYGPKG_DEVS_FLASH_MN10300_ASB2303 current ;
+    package CYGPKG_DEVS_FLASH_AMD_AM29XXXXX current ;
+};
+
+cdl_option CYGBLD_BUILD_GDB_STUBS {
+    user_value 0
+};
+
+cdl_option CYGDBG_HAL_COMMON_INTERRUPTS_SAVE_MINIMUM_CONTEXT {
+    user_value 0
+};
+
+cdl_option CYGDBG_HAL_COMMON_CONTEXT_SAVE_MINIMUM {
+    inferred_value 0
+};
+
+cdl_option CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS {
+    inferred_value 1
+};
+
+cdl_option CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT {
+    inferred_value 1
+};
+
+cdl_option CYGDBG_HAL_DEBUG_GDB_CTRLC_SUPPORT {
+    inferred_value 0
+};
+
+cdl_option CYGSEM_HAL_USE_ROM_MONITOR {
+    inferred_value 0 0
+};
+
+cdl_option CYGSEM_HAL_ROM_MONITOR {
+    inferred_value 1
+};
+
+cdl_component CYG_HAL_STARTUP {
+    user_value ROM
+};
+
+cdl_component CYGBLD_BUILD_REDBOOT {
+    user_value 1
+};
+
+cdl_option CYGOPT_REDBOOT_FIS {
+    user_value 1
+};
+
+cdl_option CYGHWR_DEVS_FLASH_MN10300_ASB2303_BANK {
+    user_value "SysFlash"
+};
+
+cdl_option CYGHWR_DEVS_FLASH_AMD_AM29DL324D {
+    user_value 1
+};
+
+cdl_option CYGHWR_DEVS_FLASH_AMD_AM29LV800 {
+    user_value 1
+};
+
+cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_BAUD {
+    user_value 115200
+};
+
+cdl_option CYGSEM_REDBOOT_BSP_SYSCALLS {
+  user_value 1
+};
Index: hal/mn10300/asb/current/src/plf_misc.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/mn10300/asb/current/src/plf_misc.c,v
retrieving revision 1.2
diff -u -p -5 -r1.2 plf_misc.c
--- hal/mn10300/asb/current/src/plf_misc.c	23 May 2002 23:04:04 -0000	1.2
+++ hal/mn10300/asb/current/src/plf_misc.c	14 Nov 2002 17:46:10 -0000
@@ -140,10 +140,11 @@ void hal_platform_init(void)
         static void hal_ctrlc_isr_init(void);
         hal_ctrlc_isr_init();
     }
 #endif    
 
+#if 0
     // Make sure the TBR points at the base of ROM
     {
         #define TBR 0xC0000024
         cyg_uint32 TBR_val;
         HAL_READ_UINT32(TBR, TBR_val);
@@ -157,10 +158,11 @@ void hal_platform_init(void)
         cyg_uint32 mTBR_val;
         HAL_READ_UINT32(mTBR, mTBR_val);
         mTBR_val = (mTBR_val & 0x00FFFFFF) | (CYGMEM_REGION_rom & 0xFF000000);
         HAL_WRITE_UINT32(mTBR, mTBR_val);
     }
+#endif
 }
 
 /*------------------------------------------------------------------------*/
 /* Functions to support the detection and execution of a user provoked    */
 /* program break. These are usually called from interrupt routines.       */
Index: hal/mn10300/asb/current/src/plf_stub.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/mn10300/asb/current/src/plf_stub.c,v
retrieving revision 1.2
diff -u -p -5 -r1.2 plf_stub.c
--- hal/mn10300/asb/current/src/plf_stub.c	23 May 2002 23:04:04 -0000	1.2
+++ hal/mn10300/asb/current/src/plf_stub.c	14 Nov 2002 17:46:10 -0000
@@ -60,10 +60,15 @@
 #include <cyg/hal/hal_intr.h>           // HAL interrupt macros
 
 //---------------------------------------------------------------------------
 
 #ifdef CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT
+
+#define ASB2303_SER0_BASE      0xD4002000
+#define _SERIAL_RXR      0x09
+#define SERIAL0_RXR      ((volatile cyg_uint8 *) (ASB2303_SER0_BASE + _SERIAL_RXR))
+
 // This ISR is called from the interrupt handler. This should only
 // happen when there is no serial driver, so the code shouldn't mess
 // anything up.
 int cyg_hal_gdb_isr(cyg_uint32 vector, target_register_t pc)
 {
@@ -89,10 +94,11 @@ int cyg_hal_gdb_isr(cyg_uint32 vector, t
 
     // Not caused by GDB. Call ISR proper.
     return 1;
 }
 
+#ifndef CYGSEM_HAL_VIRTUAL_VECTOR_SUPPORT
 int hal_asb_interruptible(int state)
 {
     if (state) {
         HAL_WRITE_UINT8 (SERIAL0_ICR, 0);
         HAL_INTERRUPT_ACKNOWLEDGE (CYGNUM_HAL_INTERRUPT_SERIAL_0_RX)
@@ -109,10 +115,11 @@ void hal_asb_init_break_irq( void )
     HAL_WRITE_UINT8 (SERIAL0_ICR, 0);
     HAL_INTERRUPT_ACKNOWLEDGE (CYGNUM_HAL_INTERRUPT_SERIAL_0_RX)
     HAL_INTERRUPT_UNMASK (CYGNUM_HAL_INTERRUPT_SERIAL_0_RX)
     HAL_ENABLE_INTERRUPTS();
 }
+#endif
 #endif
 
 //-----------------------------------------------------------------------------
 
 void hal_asb_platform_init(void)
Index: hal/mn10300/asb/current/src/ser_asb.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/mn10300/asb/current/src/ser_asb.c,v
retrieving revision 1.3
diff -u -p -5 -r1.3 ser_asb.c
--- hal/mn10300/asb/current/src/ser_asb.c	6 Aug 2002 16:00:18 -0000	1.3
+++ hal/mn10300/asb/current/src/ser_asb.c	14 Nov 2002 17:46:11 -0000
@@ -103,101 +103,52 @@
 #define SIO_LSTAT_TRDY  0x20
 #define SIO_LSTAT_RRDY  0x10
 
 #define SIO_INT_ENABLE  0x11
 
-// These values are calculated based on the MN103E010 LSI Manual
-#define PRESCALAR_BASE_1200          198
-#define PRESCALAR_BASE_2400          198
-#define PRESCALAR_BASE_4800          198
-#define PRESCALAR_BASE_9600          198
-#define PRESCALAR_BASE_96002         198
-#define PRESCALAR_BASE_14400         66
-#define PRESCALAR_BASE_19200         0
-#define PRESCALAR_BASE_38400         0
-#define PRESCALAR_BASE_56000         0
-#define PRESCALAR_BASE_57600         0
-#define PRESCALAR_BASE_115200        0
-#define PRESCALAR_BASE_230400        0
-
-#define TIMER_BASE_1200              15
-#define TIMER_BASE_2400              7
-#define TIMER_BASE_4800              3
-#define TIMER_BASE_9600              1
-#define TIMER_BASE_96002             2
-#define TIMER_BASE_14400             3
-#define TIMER_BASE_19200             198
-#define TIMER_BASE_38400             99
-#define TIMER_BASE_56000             68
-#define TIMER_BASE_57600             66
-#define TIMER_BASE_115200            33
-#define TIMER_BASE_230400            16
-
 #define TMR_ENABLE                   0x80
 #define TMR_SRC_IOCLOCK              0x00
 #define TMR_SRC_TMR0_UNDERFLOW       0x04
 
-#define PRESCALAR_MODE_1200          (TMR_ENABLE | TMR_SRC_IOCLOCK)
-#define PRESCALAR_MODE_2400          (TMR_ENABLE | TMR_SRC_IOCLOCK)
-#define PRESCALAR_MODE_4800          (TMR_ENABLE | TMR_SRC_IOCLOCK)
-#define PRESCALAR_MODE_9600          (TMR_ENABLE | TMR_SRC_IOCLOCK)
-#define PRESCALAR_MODE_96002         (TMR_ENABLE | TMR_SRC_IOCLOCK)
-#define PRESCALAR_MODE_14400         (TMR_ENABLE | TMR_SRC_IOCLOCK)
-#define PRESCALAR_MODE_19200         0
-#define PRESCALAR_MODE_38400         0
-#define PRESCALAR_MODE_56000         0
-#define PRESCALAR_MODE_57600         0
-#define PRESCALAR_MODE_115200        0
-#define PRESCALAR_MODE_230400        0
-
-#define TIMER_MODE_1200              (TMR_ENABLE | TMR_SRC_TMR0_UNDERFLOW)
-#define TIMER_MODE_2400              (TMR_ENABLE | TMR_SRC_TMR0_UNDERFLOW)
-#define TIMER_MODE_4800              (TMR_ENABLE | TMR_SRC_TMR0_UNDERFLOW)
-#define TIMER_MODE_9600              (TMR_ENABLE | TMR_SRC_TMR0_UNDERFLOW)
-#define TIMER_MODE_96002             (TMR_ENABLE | TMR_SRC_TMR0_UNDERFLOW)
-#define TIMER_MODE_14400             (TMR_ENABLE | TMR_SRC_TMR0_UNDERFLOW)
-#define TIMER_MODE_19200             (TMR_ENABLE | TMR_SRC_IOCLOCK)
-#define TIMER_MODE_38400             (TMR_ENABLE | TMR_SRC_IOCLOCK)
-#define TIMER_MODE_56000             (TMR_ENABLE | TMR_SRC_IOCLOCK)
-#define TIMER_MODE_57600             (TMR_ENABLE | TMR_SRC_IOCLOCK)
-#define TIMER_MODE_115200            (TMR_ENABLE | TMR_SRC_IOCLOCK)
-#define TIMER_MODE_230400            (TMR_ENABLE | TMR_SRC_IOCLOCK)
-
-#define BAUD_CASE(num)                                   \
-    case num:                                            \
-        prescalar_base_value = PRESCALAR_BASE_ ## num;   \
-        prescalar_mode_value = PRESCALAR_MODE_ ## num;   \
-        timer_base_value = TIMER_BASE_ ## num;           \
-        timer_mode_value = TIMER_MODE_ ## num;           \
-        break;
 
 //-----------------------------------------------------------------------------
 typedef struct {
     cyg_uint8* base;
     cyg_int32 msec_timeout;
     int isr_vector;
+    cyg_int32 baud_rate;
 } channel_data_t;
 
 static channel_data_t channels[2] = {
     { (cyg_uint8*)ASB2303_SER1_BASE, 1000, CYGNUM_HAL_INTERRUPT_SERIAL_1_RX },
     { (cyg_uint8*)ASB2303_SER0_BASE, 1000, CYGNUM_HAL_INTERRUPT_SERIAL_0_RX },
 };
 
 //-----------------------------------------------------------------------------
 // Set the baud rate
 
+static cyg_uint32
+baud_divisor(int baud, int prescaler)
+{
+    cyg_uint32 divisor;
+
+    // divisor == INT(IOCLK/baud/8 + 0.5)
+    divisor = CYGHWR_HAL_MN10300_IOCLK_SPEED * 10;
+    divisor /= (baud / 100);
+    divisor /= prescaler;
+    divisor /= 8;
+    divisor += 500;
+    divisor /= 1000;
+    return divisor;
+}
+
 static int
 cyg_hal_plf_serial_set_baud(cyg_uint8* port, cyg_uint32 baud_rate)
 {
-    volatile cyg_uint8 *prescalar_base_reg = 0, prescalar_base_value = 0;
-    volatile cyg_uint8 *prescalar_mode_reg = 0, prescalar_mode_value = 0;
-    volatile cyg_uint8 *timer_base_reg = 0,     timer_base_value = 0;
-    volatile cyg_uint8 *timer_mode_reg = 0,     timer_mode_value = 0;
-
-    // Always use TMR0 as the prescalar
-    prescalar_base_reg = TIMER0_BR;
-    prescalar_mode_reg = TIMER0_MD;
+    volatile cyg_uint8 *timer_base_reg;
+    volatile cyg_uint8 *timer_mode_reg;
+    cyg_uint32 divisor, prescaler;
 
     if (port == (cyg_uint8*)ASB2303_SER0_BASE)
     {
         // SER0 uses TMR2
         timer_base_reg = TIMER2_BR;
@@ -211,32 +162,45 @@ cyg_hal_plf_serial_set_baud(cyg_uint8* p
         return -1;
     }
 
     switch (baud_rate)
     {
-        BAUD_CASE(1200);
-        BAUD_CASE(2400);
-        BAUD_CASE(4800);
-        BAUD_CASE(9600);
-        BAUD_CASE(96002);
-        BAUD_CASE(14400);
-        BAUD_CASE(19200);
-        BAUD_CASE(38400);
-        BAUD_CASE(56000);
-        BAUD_CASE(57600);
-        BAUD_CASE(115200);
-        BAUD_CASE(230400);
+    case 1200:
+    case 2400:
+    case 4800:
+    case 9600:
+    case 19200:
+    case 38400:
+    case 57600:
+    case 115200:
+    case 230400:
+	break;
 
     default:
         // Unknown baud.  Don't change anything
         return -1;
     }
 
-    HAL_WRITE_UINT8(prescalar_base_reg, prescalar_base_value);
-    HAL_WRITE_UINT8(prescalar_mode_reg, prescalar_mode_value);
-    HAL_WRITE_UINT8(timer_base_reg,     timer_base_value);
-    HAL_WRITE_UINT8(timer_mode_reg,     timer_mode_value);
+    for (prescaler = 1; prescaler <= 256; prescaler++) {
+	divisor = baud_divisor(baud_rate, prescaler);
+	if (divisor <= 256)
+	    break;
+    }
+    --divisor;
+    --prescaler;
+
+    if (prescaler) {
+	HAL_WRITE_UINT8(TIMER0_BR, prescaler);
+	HAL_WRITE_UINT8(TIMER0_MD, TMR_ENABLE | TMR_SRC_IOCLOCK);
+    } else {
+	HAL_WRITE_UINT8(TIMER0_BR, 0);
+	HAL_WRITE_UINT8(TIMER0_MD, 0);
+    }
+
+    HAL_WRITE_UINT8(timer_base_reg, divisor);
+    HAL_WRITE_UINT8(timer_mode_reg, TMR_ENABLE |
+		    (prescaler ? TMR_SRC_TMR0_UNDERFLOW : TMR_SRC_IOCLOCK));
 
     return 0;
 }
 
 //-----------------------------------------------------------------------------
@@ -355,11 +319,10 @@ cyg_hal_plf_serial_read(void* __ch_data,
         *__buf++ = cyg_hal_plf_serial_getc(__ch_data);
 
     CYGARC_HAL_RESTORE_GP();
 }
 
-#if 0
 cyg_bool
 cyg_hal_plf_serial_getc_timeout(void* __ch_data, cyg_uint8* ch)
 {
     int delay_count;
     channel_data_t* chan;
@@ -383,11 +346,10 @@ cyg_hal_plf_serial_getc_timeout(void* __
     }
 
     CYGARC_HAL_RESTORE_GP();
     return res;
 }
-#endif
 
 static int
 cyg_hal_plf_serial_control(void *__ch_data, __comm_control_cmd_t __func, ...)
 {
     static int irq_state = 0;
@@ -523,14 +485,14 @@ cyg_hal_plf_serial_init(void)
     HAL_INTERRUPT_MASK(channels[0].isr_vector);
     HAL_INTERRUPT_MASK(channels[1].isr_vector);
 
     // Init channels
     cyg_hal_plf_serial_init_channel((void*)&channels[0]);
-    cyg_hal_plf_serial_set_baud(channels[0].base, CYGHWR_HAL_MN10300_AM33_ASB_DIAG_BAUD);
+    cyg_hal_plf_serial_set_baud(channels[0].base, CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_BAUD);
 
     cyg_hal_plf_serial_init_channel((void*)&channels[1]);
-    cyg_hal_plf_serial_set_baud(channels[1].base, CYGHWR_HAL_MN10300_AM33_ASB_GDB_BAUD);
+    cyg_hal_plf_serial_set_baud(channels[1].base, CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_BAUD);
     
     // Setup procs in the vector table
 
     // Set channel 0
     CYGACC_CALL_IF_SET_CONSOLE_COMM(0);
@@ -540,13 +502,11 @@ cyg_hal_plf_serial_init(void)
     CYGACC_COMM_IF_READ_SET(*comm, cyg_hal_plf_serial_read);
     CYGACC_COMM_IF_PUTC_SET(*comm, cyg_hal_plf_serial_putc);
     CYGACC_COMM_IF_GETC_SET(*comm, cyg_hal_plf_serial_getc);
     CYGACC_COMM_IF_CONTROL_SET(*comm, cyg_hal_plf_serial_control);
     CYGACC_COMM_IF_DBG_ISR_SET(*comm, cyg_hal_plf_serial_isr);
-#if 0
     CYGACC_COMM_IF_GETC_TIMEOUT_SET(*comm, cyg_hal_plf_serial_getc_timeout);
-#endif
 
     // Set channel 1
     CYGACC_CALL_IF_SET_CONSOLE_COMM(1);
     comm = CYGACC_CALL_IF_CONSOLE_PROCS();
     CYGACC_COMM_IF_CH_DATA_SET(*comm, &channels[1]);
@@ -554,13 +514,11 @@ cyg_hal_plf_serial_init(void)
     CYGACC_COMM_IF_READ_SET(*comm, cyg_hal_plf_serial_read);
     CYGACC_COMM_IF_PUTC_SET(*comm, cyg_hal_plf_serial_putc);
     CYGACC_COMM_IF_GETC_SET(*comm, cyg_hal_plf_serial_getc);
     CYGACC_COMM_IF_CONTROL_SET(*comm, cyg_hal_plf_serial_control);
     CYGACC_COMM_IF_DBG_ISR_SET(*comm, cyg_hal_plf_serial_isr);
-#if 0
     CYGACC_COMM_IF_GETC_TIMEOUT_SET(*comm, cyg_hal_plf_serial_getc_timeout);
-#endif
 
     // Restore original console
     CYGACC_CALL_IF_SET_CONSOLE_COMM(cur);
 }
 
Index: hal/mn10300/asb2305/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/mn10300/asb2305/current/ChangeLog,v
retrieving revision 1.3
diff -u -p -5 -r1.3 ChangeLog
--- hal/mn10300/asb2305/current/ChangeLog	6 Aug 2002 14:34:06 -0000	1.3
+++ hal/mn10300/asb2305/current/ChangeLog	14 Nov 2002 17:46:11 -0000
@@ -1,5 +1,12 @@
+2002-11-14  Mark Salter  <msalter@redhat.com>
+
+	* cdl/hal_mn10300_am33_asb2305.cdl: Remove RedBoot exec option. Now
+	provided in generic AM33 code. Ditto for RTC support.
+	* src/plf_misc.c: hal_delay_us now provided by AM33 package.
+	* src/redboot_cmds.c: Remove.
+
 2002-08-02  Andrew Lunn <Andrew.Lunn@ascom.ch>
 
 	* cdl/hal_mn10300_am33_asb2305.cdl: Redboot exec command can now
 	be disabled by CDL
 	
Index: hal/mn10300/asb2305/current/cdl/hal_mn10300_am33_asb2305.cdl
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/mn10300/asb2305/current/cdl/hal_mn10300_am33_asb2305.cdl,v
retrieving revision 1.3
diff -u -p -5 -r1.3 hal_mn10300_am33_asb2305.cdl
--- hal/mn10300/asb2305/current/cdl/hal_mn10300_am33_asb2305.cdl	6 Aug 2002 14:34:06 -0000	1.3
+++ hal/mn10300/asb2305/current/cdl/hal_mn10300_am33_asb2305.cdl	14 Nov 2002 17:46:11 -0000
@@ -99,52 +99,10 @@ cdl_package CYGPKG_HAL_MN10300_AM33_ASB2
         description   "
             This specifies which ROM slot the program resides in (and is booted
             from."
     }
 
-    # Real-time clock/counter specifics
-    cdl_component CYGNUM_HAL_RTC_CONSTANTS {
-        display       "Real-time clock constants."
-        description   "
-            The NUMERATOR divided by the DENOMINATOR gives the number of
-            nanoseconds per tick. The PERIOD is the divider to be programmed
-            into a hardware timer that is driven from an appropriate hardware
-            clock, such that the timer overflows once per tick (normally
-            generating a CPU interrupt to mark the end of a tick). The tick
-            rate is typically 100Hz.
-            The clock is generated with onboard 16-bit timers TM4 and TM5
-            cascaded together to form a 32-bit timer."
-        flavor none
-
-        cdl_option CYGHWR_HAL_MN10300_IOCLK_SPEED {
-            display          "Processor I/O clock speed (Hz)"
-            flavor           data
-            calculated       (25 * 1000 * 1000)
-            description      "
-                The processor I/O clock speed, from which onboard timers can
-                draw their sources."
-        }
-
-        cdl_option CYGNUM_HAL_RTC_NUMERATOR {
-            display       "Real-time clock numerator"
-            flavor        data
-            calculated    (1000 * 1000 * 1000)
-        }
-
-        cdl_option CYGNUM_HAL_RTC_DENOMINATOR {
-            display       "Real-time clock denominator"
-            flavor        data
-            calculated    100
-        }
-
-        cdl_option CYGNUM_HAL_RTC_PERIOD {
-            display       "Real-time clock divisor"
-            flavor        data
-            calculated    (CYGHWR_HAL_MN10300_IOCLK_SPEED * CYGNUM_HAL_RTC_NUMERATOR) / (1000000000 * CYGNUM_HAL_RTC_DENOMINATOR)
-        }
-    }
-
     cdl_option CYGHWR_HAL_MN10300_AM33_ASB_DIAG_PORT {
         display          "Diagnostic Serial Port"
         flavor data
         legal_values     0 1
         default_value    0
@@ -372,23 +330,10 @@ cdl_package CYGPKG_HAL_MN10300_AM33_ASB2
         active_if     CYGPKG_REDBOOT
         description   "
             This option lists the target's requirements for a valid Redboot
             configuration."
             
-        cdl_component CYGPKG_REDBOOT_HAL_LINUX_EXEC {
-            display       "Provide the exec command in RedBoot"
-            flavor        none
-            no_define
-            parent        CYGPKG_REDBOOT_HAL_OPTIONS
-            active_if     CYGBLD_BUILD_REDBOOT_WITH_EXEC
-            description "
-                This option contains requirements for booting linux
-                from RedBoot. The component is enabled/disabled from
-                RedBoots CDL."
-            compile -library=libextras.a redboot_cmds.c
-        }
-
         cdl_option CYGBLD_BUILD_REDBOOT_BIN {
             display       "Build Redboot ROM binary image"
             active_if     CYGBLD_BUILD_REDBOOT
             default_value 1
             no_define
Index: hal/mn10300/asb2305/current/src/plf_misc.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/mn10300/asb2305/current/src/plf_misc.c,v
retrieving revision 1.2
diff -u -p -5 -r1.2 plf_misc.c
--- hal/mn10300/asb2305/current/src/plf_misc.c	23 May 2002 23:04:05 -0000	1.2
+++ hal/mn10300/asb2305/current/src/plf_misc.c	14 Nov 2002 17:46:12 -0000
@@ -170,35 +170,10 @@ void hal_platform_init(void)
     }
 #endif
 }
 
 /*------------------------------------------------------------------------*/
-/* microsecond resolution delay    */
-void cyg_plf_hal_delay_us(cyg_int32 usecs)
-{
-	cyg_uint8 last, val;
-
-#define TM0MD 0xD4003000
-#define TM0BR 0xD4003010
-#define TM0BC 0xD4003020
-
-	HAL_WRITE_UINT8(TM0BR,25); // IOCLK is 25MHz
-	HAL_WRITE_UINT8(TM0MD,0x40); // stop and load
-	HAL_WRITE_UINT8(TM0MD,0x80); // set source to be IOCLK and go
-
-	HAL_READ_UINT8(TM0BC,last);
-	for (; usecs>0;) {
-		HAL_READ_UINT8(TM0BC,val);
-		if (val==last) continue;
-		if (val>last)
-			usecs--; // count the underflows
-		last = val;
-	}
-	HAL_WRITE_UINT8(TM0MD,0x00); // stop
-}
-
-/*------------------------------------------------------------------------*/
 /* Functions to support the detection and execution of a user provoked    */
 /* program break. These are usually called from interrupt routines.       */
 
 /*------------------------------------------------------------------------*/
 /* Control C ISR support                                                  */
Index: hal/mn10300/asb2305/current/src/redboot_cmds.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/mn10300/asb2305/current/src/redboot_cmds.c,v
retrieving revision 1.2
diff -u -p -5 -r1.2 redboot_cmds.c
--- hal/mn10300/asb2305/current/src/redboot_cmds.c	23 May 2002 23:04:05 -0000	1.2
+++ hal/mn10300/asb2305/current/src/redboot_cmds.c	14 Nov 2002 17:46:12 -0000
@@ -1,132 +0,0 @@
-//==========================================================================
-//
-//      redboot_cmds.c
-//
-//      ASB2305 [platform] specific RedBoot commands
-//
-//==========================================================================
-//####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####
-//==========================================================================
-//#####DESCRIPTIONBEGIN####
-//
-// Author(s):    dhowells
-// Contributors: gthomas, jskov
-// Date:         2001-07-19
-// Purpose:      
-// Description:  
-//              
-// This code is part of RedBoot (tm).
-//
-//####DESCRIPTIONEND####
-//
-//==========================================================================
-
-#include <redboot.h>
-
-#include <cyg/hal/hal_intr.h>
-#include <cyg/hal/hal_cache.h>
-
-// Exported CLI function(s)
-
-// The exec command works like the go command in YAMON - that is,
-// providing callee with argc, argv, and env. In addition to the
-// information provided by the user, 
-
-static void do_exec(int argc, char *argv[]);
-
-static char exec_usage[] =
-            "[-w timeout] [-c \"kernel command line\"] [<entry_point>]";
-
-RedBoot_cmd("exec", 
-            "Execute an image - with MMU off", 
-            exec_usage,
-            do_exec
-	    );
-
-typedef void (*code_fun)(void) __attribute__((noreturn));
-
-static void 
-do_exec(int argc, char *argv[])
-{
-    unsigned long oldints;
-    bool wait_time_set;
-    int  wait_time, res;
-    bool cmd_line_set;
-    struct option_info opts[4];
-    code_fun entry;
-    char line[8];
-    char *cmd_line;
-    int num_options;
-
-    entry = (code_fun)entry_address;  // Default from last 'load' operation
-    init_opts(&opts[0], 'w', true, OPTION_ARG_TYPE_NUM, 
-              (void **)&wait_time, (bool *)&wait_time_set, "wait timeout");
-    init_opts(&opts[1], 'c', true, OPTION_ARG_TYPE_STR, 
-              (void **)&cmd_line, (bool *)&cmd_line_set, "kernel command line");
-    num_options = 2;
-
-    if (!scan_opts(argc, argv, 1, opts, num_options, (void *)&entry, 
-                   OPTION_ARG_TYPE_NUM, "starting address"))
-    {
-        return;
-    }
-    if (cmd_line_set) {
-	memcpy((char*)0x8C001000,"cmdline:",8);
-        strncpy((char*)0x8C001008,cmd_line,256);
-	*(char*)(0x8C001008+256) = 0;
-    }
-    else {
-	*(char*)(0x8C001000+256) = 0;
-    }
-
-    if (wait_time_set) {
-        diag_printf("About to start execution at %p - abort with ^C within %d seconds\n",
-                    (void *)entry, wait_time);
-        res = _rb_gets(line, sizeof(line), wait_time*1000);
-        if (res == _GETS_CTRLC) {
-            return;
-        }
-    }
-
-    HAL_DISABLE_INTERRUPTS(oldints);
-    HAL_DCACHE_SYNC();
-    HAL_ICACHE_DISABLE();
-    HAL_DCACHE_DISABLE();
-    HAL_DCACHE_SYNC();
-    HAL_ICACHE_INVALIDATE_ALL();
-    HAL_DCACHE_INVALIDATE_ALL();
-    (*entry)();
-}
-
-// EOF redboot_cmds.c


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]