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]

little-endian support for ixdp425 and grg


Index: devs/flash/arm/grg/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/arm/grg/current/ChangeLog,v
retrieving revision 1.2
diff -u -p -5 -r1.2 ChangeLog
--- devs/flash/arm/grg/current/ChangeLog	24 Mar 2003 13:31:16 -0000	1.2
+++ devs/flash/arm/grg/current/ChangeLog	2 Sep 2004 20:12:46 -0000
@@ -1,5 +1,9 @@
+2004-09-02  Mark Salter  <msalter@redhat.com>
+
+	* include/grg_strataflash.inl: Add little-endian support.
+
 2003-03-24  Mark Salter  <msalter@redhat.com>
 
 	* cdl/flash_grg.cdl: Fix copyright notice.
 
 2003-02-07  Mark Salter  <msalter@redhat.com>
@@ -8,11 +12,11 @@
 
 //===========================================================================
 //####ECOSGPLCOPYRIGHTBEGIN####
 // -------------------------------------------
 // This file is part of eCos, the Embedded Configurable Operating System.
-// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Red Hat, Inc.
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 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.
 //
Index: devs/flash/arm/grg/current/include/grg_strataflash.inl
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/arm/grg/current/include/grg_strataflash.inl,v
retrieving revision 1.1
diff -u -p -5 -r1.1 grg_strataflash.inl
--- devs/flash/arm/grg/current/include/grg_strataflash.inl	18 Mar 2003 13:10:02 -0000	1.1
+++ devs/flash/arm/grg/current/include/grg_strataflash.inl	2 Sep 2004 20:12:46 -0000
@@ -60,8 +60,17 @@
 
 #define CYGNUM_FLASH_BASE 	(0x50000000u)
 #define CYGNUM_FLASH_WIDTH 	(16)
 #define CYGNUM_FLASH_BLANK      (1)
 
+#include <pkgconf/hal.h>  // for CYGHWR_HAL_ARM_BIGENDIAN
+
+// We have to do some address gymnastics in little-endian mode
+#ifndef CYGHWR_HAL_ARM_BIGENDIAN
+#define __INV(a) ((flash_t *)((unsigned)(a) ^ 0x2))
+#define CYGHWR_FLASH_WRITE_BUF(a,b) (*__INV(a) = *__INV(b))
+#define CYGHWR_FLASH_READ_QUERY(a)  (*__INV(a))
+#endif
+
 #endif  // CYGONCE_DEVS_FLASH_GRG_STRATAFLASH_INL
 // ------------------------------------------------------------------------
 // EOF grg_strataflash.inl
Index: devs/flash/arm/ixdp425/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/arm/ixdp425/current/ChangeLog,v
retrieving revision 1.2
diff -u -p -5 -r1.2 ChangeLog
--- devs/flash/arm/ixdp425/current/ChangeLog	24 Mar 2003 13:31:16 -0000	1.2
+++ devs/flash/arm/ixdp425/current/ChangeLog	2 Sep 2004 20:12:46 -0000
@@ -1,14 +1,18 @@
+2004-09-02  Mark Salter  <msalter@redhat.com>
+
+	* include/ixdp425_strataflash.inl: Support little-endian.
+
 2003-03-24  Mark Salter  <msalter@redhat.com>
 
 	* cdl/flash_ixdp425.cdl: Fix copyright notice.
 
 //===========================================================================
 //####ECOSGPLCOPYRIGHTBEGIN####
 // -------------------------------------------
 // This file is part of eCos, the Embedded Configurable Operating System.
-// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Red Hat, Inc.
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 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.
 //
Index: devs/flash/arm/ixdp425/current/include/ixdp425_strataflash.inl
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/arm/ixdp425/current/include/ixdp425_strataflash.inl,v
retrieving revision 1.1
diff -u -p -5 -r1.1 ixdp425_strataflash.inl
--- devs/flash/arm/ixdp425/current/include/ixdp425_strataflash.inl	18 Mar 2003 13:10:02 -0000	1.1
+++ devs/flash/arm/ixdp425/current/include/ixdp425_strataflash.inl	2 Sep 2004 20:12:47 -0000
@@ -8,11 +8,11 @@
 //
 //==========================================================================
 //####ECOSGPLCOPYRIGHTBEGIN####
 // -------------------------------------------
 // This file is part of eCos, the Embedded Configurable Operating System.
-// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 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.
 //
@@ -60,8 +60,17 @@
 
 #define CYGNUM_FLASH_BASE 	(0x50000000u)
 #define CYGNUM_FLASH_WIDTH 	(16)
 #define CYGNUM_FLASH_BLANK      (1)
 
+#include <pkgconf/hal.h>  // for CYGHWR_HAL_ARM_BIGENDIAN
+
+// We have to do some address gymnastics in little-endian mode
+#ifndef CYGHWR_HAL_ARM_BIGENDIAN
+#define __INV(a) ((flash_t *)((unsigned)(a) ^ 0x2))
+#define CYGHWR_FLASH_WRITE_BUF(a,b) (*__INV(a) = *__INV(b))
+#define CYGHWR_FLASH_READ_QUERY(a)  (*__INV(a))
+#endif
+
 #endif  // CYGONCE_DEVS_FLASH_IXDP425_STRATAFLASH_INL
 // ------------------------------------------------------------------------
 // EOF ixdp425_strataflash.inl
Index: hal/arm/xscale/cores/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/xscale/cores/current/ChangeLog,v
retrieving revision 1.4
diff -u -p -5 -r1.4 ChangeLog
--- hal/arm/xscale/cores/current/ChangeLog	4 Feb 2003 22:27:56 -0000	1.4
+++ hal/arm/xscale/cores/current/ChangeLog	2 Sep 2004 20:12:51 -0000
@@ -1,5 +1,10 @@
+2004-09-02  Mark Salter  <msalter@redhat.com>
+
+	* include/hal_xscale.h: Add CYGARC_HAL_MMU_OFF_X.
+	* include/hal_mm.h: Add some convenience macros.
+
 2003-02-04  Mark Salter  <msalter@redhat.com>
 
 	* cdl/hal_arm_xscale_core.cdl (CYGSEM_HAL_ARM_XSCALE_BTB): New option.
 
 	* include/hal_xscale.h: Make enabling of BTB conditional on 
@@ -32,11 +37,11 @@
 
 //===========================================================================
 //####ECOSGPLCOPYRIGHTBEGIN####
 // -------------------------------------------
 // This file is part of eCos, the Embedded Configurable Operating System.
-// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Red Hat, Inc.
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 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.
 //
Index: hal/arm/xscale/cores/current/include/hal_mm.h
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/xscale/cores/current/include/hal_mm.h,v
retrieving revision 1.1
diff -u -p -5 -r1.1 hal_mm.h
--- hal/arm/xscale/cores/current/include/hal_mm.h	23 Sep 2002 15:57:53 -0000	1.1
+++ hal/arm/xscale/cores/current/include/hal_mm.h	2 Sep 2004 20:12:51 -0000
@@ -9,11 +9,11 @@
 //
 //=============================================================================
 //####ECOSGPLCOPYRIGHTBEGIN####
 // -------------------------------------------
 // This file is part of eCos, the Embedded Configurable Operating System.
-// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004 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.
 //
@@ -87,10 +87,21 @@
 // form a second level extended small page entry
 .macro SL_XSMPAGE_ENTRY base,x,ap,c,b
 .word (\base << 12) | (\x << 6) | (\ap << 4) | (\c << 3) | (\b << 2) | 3
 .endm
 
+.macro XSCALE_MMU_SECTION abase vbase size cache buff access x p
+        ldr     r0, =(0x4000 + (\vbase << 2))
+        ldr     r1, =(0x4000 + (\vbase << 2) + (\size << 2))
+        ldr     r2, =((\abase << 20) + (\x << 12) + (\access << 10) + (\p << 9) + (\cache << 3) + (\buff << 2) + 2)
+     981:
+        str     r2, [r0], #4
+        add     r2, r2, #(1 << 20)
+        cmp     r0, r1
+        bne     981b
+.endm
+
 #else
 
 // -------------------------------------------------------------------------
 // MMU initialization:
 // 
@@ -131,11 +142,12 @@ struct ARM_MMU_FIRST_LEVEL_SECTION {
     unsigned int c : 1;
     unsigned int imp : 1;
     unsigned int domain : 4;
     unsigned int p : 1;
     unsigned int ap : 2;
-    unsigned int tex : 8;
+    unsigned int x : 1;
+    unsigned int tex : 7;
     unsigned int base_address : 12;
 };
 #define ARM_MMU_FIRST_LEVEL_SECTION_ID 0x2
 
 struct ARM_MMU_FIRST_LEVEL_RESERVED {
@@ -148,33 +160,44 @@ struct ARM_MMU_FIRST_LEVEL_RESERVED {
    (unsigned long *)((unsigned long)(ttb_base) + ((table_index) << 2))
 
 #define ARM_FIRST_LEVEL_PAGE_TABLE_SIZE 0x4000
 
 #define ARM_MMU_SECTION(ttb_base, actual_base, virtual_base,              \
-                        cacheable, bufferable, perm)                      \
+                        cacheable, bufferable, perm, xbit, pbit)          \
     CYG_MACRO_START                                                       \
         register union ARM_MMU_FIRST_LEVEL_DESCRIPTOR desc;               \
                                                                           \
         desc.word = 0;                                                    \
         desc.section.id = ARM_MMU_FIRST_LEVEL_SECTION_ID;                 \
         desc.section.domain = 0;                                          \
         desc.section.c = (cacheable);                                     \
         desc.section.b = (bufferable);                                    \
         desc.section.ap = (perm);                                         \
         desc.section.base_address = (actual_base);                        \
+        desc.section.x = (xbit);                                          \
+        desc.section.p = (pbit);                                          \
         *ARM_MMU_FIRST_LEVEL_DESCRIPTOR_ADDRESS(ttb_base, (virtual_base)) \
                             = desc.word;                                  \
     CYG_MACRO_END
 
-#define X_ARM_MMU_SECTION(abase,vbase,size,cache,buff,access)      \
-    { int i; int j = abase; int k = vbase;                         \
-      for (i = size; i > 0 ; i--,j++,k++)                          \
-      {                                                            \
-        ARM_MMU_SECTION(ttb_base, j, k, cache, buff, access);      \
-      }                                                            \
+#define X_ARM_MMU_SECTION(abase,vbase,size,cache,buff,access)       \
+    { int i; int j = abase; int k = vbase;                          \
+      for (i = size; i > 0 ; i--,j++,k++)                           \
+      {                                                             \
+        ARM_MMU_SECTION(ttb_base, j, k, cache, buff, access, 0, 0); \
+      }                                                             \
     }
 
+
+#define XSCALE_MMU_SECTION(abase,vbase,size,cache,buff,access, x, p)  \
+    { int i; int j = abase; int k = vbase;                            \
+      for (i = size; i > 0 ; i--,j++,k++)                             \
+      {                                                               \
+        ARM_MMU_SECTION(ttb_base, j, k, cache, buff, access, x, p);   \
+      }                                                               \
+      }
+  
 union ARM_MMU_FIRST_LEVEL_DESCRIPTOR {
     unsigned long word;
     struct ARM_MMU_FIRST_LEVEL_FAULT fault;
     struct ARM_MMU_FIRST_LEVEL_PAGE_TABLE page_table;
     struct ARM_MMU_FIRST_LEVEL_SECTION section;
Index: hal/arm/xscale/cores/current/include/hal_xscale.h
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/xscale/cores/current/include/hal_xscale.h,v
retrieving revision 1.2
diff -u -p -5 -r1.2 hal_xscale.h
--- hal/arm/xscale/cores/current/include/hal_xscale.h	4 Feb 2003 22:27:56 -0000	1.2
+++ hal/arm/xscale/cores/current/include/hal_xscale.h	2 Sep 2004 20:12:51 -0000
@@ -6,11 +6,11 @@
 //
 //=============================================================================
 //####ECOSGPLCOPYRIGHTBEGIN####
 // -------------------------------------------
 // This file is part of eCos, the Embedded Configurable Operating System.
-// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Red Hat, Inc.
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 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.
 //
@@ -91,24 +91,48 @@ static inline void CPWAIT(void) {
 		  "mov  %0,%0\n"
 		  "sub  pc,pc,#4" : "=r" (tmp));
 }
 #endif
 
-// Override the default MMU off code. This is intended
-// to be included in an inline asm statement.
-#define CYGARC_HAL_MMU_OFF(__paddr__)        \
-              "   mrc p15,0,r0,c1,c0,0\n"    \
+#define __CYGARC_GET_CTLREG \
+              "   mrc p15,0,r0,c1,c0,0\n"
+
+#define __CYGARC_CLR_MMU_BITS \
+              "   bic r0,r0,#0x05\n"
+
+#ifdef CYGHWR_HAL_ARM_BIGENDIAN
+#define __CYGARC_CLR_MMU_BITS_X \
+              "   bic r0,r0,#0x85\n"
+#else
+#define __CYGARC_CLR_MMU_BITS_X \
               "   bic r0,r0,#0x05\n"         \
+              "   orr r0,r0,#0x80\n"
+#endif
+
+#define __CYGARC_SET_CTLREG(__paddr__) \
               "   b 99f\n"                   \
               "   .p2align 5\n"              \
               "99:\n"                        \
               "   mcr p15,0,r0,c1,c0,0\n"    \
               "   mrc p15,0,r0,c2,c0,0\n"    \
               "   mov r0,r0\n"	             \
               "   sub pc,pc,#4\n"            \
               "   mov pc," #__paddr__ "\n"
 
+
+// Override the default MMU off code. This is intended
+// to be included in an inline asm statement.
+#define CYGARC_HAL_MMU_OFF(__paddr__)        \
+    __CYGARC_GET_CTLREG                      \
+    __CYGARC_CLR_MMU_BITS                    \
+    __CYGARC_SET_CTLREG(__paddr__)
+
+#define CYGARC_HAL_MMU_OFF_X(__paddr__)      \
+    __CYGARC_GET_CTLREG                      \
+    __CYGARC_CLR_MMU_BITS_X                  \
+    __CYGARC_SET_CTLREG(__paddr__)
+
 #ifdef __ASSEMBLER__
 
 #define REG8(a,b)  (b)
 #define REG16(a,b) (b)
 #define REG32(a,b) (b)
Index: hal/arm/xscale/grg/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/xscale/grg/current/ChangeLog,v
retrieving revision 1.4
diff -u -p -5 -r1.4 ChangeLog
--- hal/arm/xscale/grg/current/ChangeLog	30 Jun 2003 13:07:07 -0000	1.4
+++ hal/arm/xscale/grg/current/ChangeLog	2 Sep 2004 20:12:51 -0000
@@ -1,5 +1,16 @@
+2004-09-02  Mark Salter  <msalter@redhat.com>
+
+	* include/hal_platform_extras.h: Removed.
+	* misc/redboot_ROMLE.ecm: New file.
+	* misc/redboot_RAMLE.ecm: New file.
+	* cdl/hal_arm_xscale_grg.cdl: Add little-endian support.
+	* misc/redboot_RAM.ecm: Ditto.
+	* misc/redboot_ROM.ecm: Ditto.
+	* include/hal_platform_setup.h: Ditto.
+	* include/grg.h: Add some defines for use in page table setup.
+
 2003-06-30  Mark Salter  <msalter@redhat.com>
 
 	* include/hal_platform_setup.h: Fix CYGINT_HAL_ARM_BIGENDIAN test.
 	Remove unused ROMRAM cruft.
 
@@ -33,11 +44,11 @@
 
 //===========================================================================
 //####ECOSGPLCOPYRIGHTBEGIN####
 // -------------------------------------------
 // This file is part of eCos, the Embedded Configurable Operating System.
-// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Red Hat, Inc.
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 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.
 //
Index: hal/arm/xscale/grg/current/cdl/hal_arm_xscale_grg.cdl
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/xscale/grg/current/cdl/hal_arm_xscale_grg.cdl,v
retrieving revision 1.1
diff -u -p -5 -r1.1 hal_arm_xscale_grg.cdl
--- hal/arm/xscale/grg/current/cdl/hal_arm_xscale_grg.cdl	18 Mar 2003 13:10:02 -0000	1.1
+++ hal/arm/xscale/grg/current/cdl/hal_arm_xscale_grg.cdl	2 Sep 2004 20:12:51 -0000
@@ -65,11 +65,15 @@ cdl_package CYGPKG_HAL_ARM_XSCALE_GRG {
         puts $::cdl_system_header "#define CYGBLD_HAL_VARIANT_H  <pkgconf/hal_arm_xscale_ixp425.h>"
         puts $::cdl_system_header "#define CYGBLD_HAL_PLATFORM_H <pkgconf/hal_arm_xscale_grg.h>"
         puts $::cdl_header "#define CYGBLD_HAL_PLF_INTS_H <cyg/hal/hal_plf_ints.h>"
 	puts $::cdl_header "#define HAL_PLATFORM_CPU    \"XScale\""
         puts $::cdl_header "#define HAL_PLATFORM_BOARD  \"Intel Generic Residential Gateway\""
-        puts $::cdl_header "#define HAL_PLATFORM_EXTRA  \"\""
+        puts $::cdl_header "#ifdef CYGHWR_HAL_ARM_BIGENDIAN"
+        puts $::cdl_header "#define HAL_PLATFORM_EXTRA  \"BE\""
+        puts $::cdl_header "#else"
+        puts $::cdl_header "#define HAL_PLATFORM_EXTRA  \"LE\""
+        puts $::cdl_header "#endif"
         puts $::cdl_header "#define HAL_PLATFORM_MACHINE_TYPE  290"
     }
 
     cdl_component CYG_HAL_STARTUP {
         display       "Startup type"
@@ -107,22 +111,24 @@ cdl_package CYGPKG_HAL_ARM_XSCALE_GRG {
 
         cdl_option CYGBLD_GLOBAL_CFLAGS {
             display "Global compiler flags"
             flavor  data
             no_define
-            default_value { "-mcpu=xscale -mbig-endian -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority -mapcs-frame" }
+            default_value { CYGHWR_HAL_ARM_BIGENDIAN ? "-mbig-endian -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -mapcs-frame" :
+	                    "-Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -mapcs-frame" }
             description   "
                 This option controls the global compiler flags which are used to
                 compile all packages by default. Individual packages may define
                 options which override these global flags."
         }
 
         cdl_option CYGBLD_GLOBAL_LDFLAGS {
             display "Global linker flags"
             flavor  data
             no_define
-            default_value { "-mcpu=xscale -mbig-endian -Wl,--gc-sections -Wl,-static -g -O2 -nostdlib" }
+            default_value { CYGHWR_HAL_ARM_BIGENDIAN ? "-mbig-endian -Wl,--gc-sections -Wl,-static -g -O2 -nostdlib" :
+	                    "-Wl,--gc-sections -Wl,-static -g -O2 -nostdlib" }
             description   "
                 This option controls the global linker flags. Individual
                 packages may define options which override these global flags."
         }
 
Index: hal/arm/xscale/grg/current/include/grg.h
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/xscale/grg/current/include/grg.h,v
retrieving revision 1.2
diff -u -p -5 -r1.2 grg.h
--- hal/arm/xscale/grg/current/include/grg.h	4 Apr 2003 14:52:31 -0000	1.2
+++ hal/arm/xscale/grg/current/include/grg.h	2 Sep 2004 20:12:51 -0000
@@ -9,11 +9,11 @@
 //
 //=============================================================================
 //####ECOSGPLCOPYRIGHTBEGIN####
 // -------------------------------------------
 // This file is part of eCos, the Embedded Configurable Operating System.
-// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Red Hat, Inc.
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 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.
 //
@@ -60,13 +60,19 @@
 #include <cyg/hal/hal_ixp425.h>
 
 // These must match setup in the page table in hal_platform_extras.h
 #define SDRAM_PHYS_BASE                    0x00000000
 #define SDRAM_BASE                         0x00000000
-#define SDRAM_UNCACHED_BASE                0x10000000
+#define SDRAM_ALIAS_BASE                   0x10000000
+#define SDRAM_UNCACHED_BASE                0x20000000
+#define SDRAM_DC_BASE                      0x30000000
 #define SDRAM_SIZE                         0x02000000  // 32MB
 
+#define IXDP_FLASH_BASE                    0x50000000
+#define IXDP_FLASH_SIZE                    0x01000000
+#define IXDP_FLASH_DC_BASE                 0xA0000000
+
 // CS0 (flash optimum timing)
 #define IXP425_EXP_CS0_INIT \
  (EXP_ADDR_T(3) | EXP_SETUP_T(3) | EXP_STROBE_T(15) | EXP_HOLD_T(3) | \
   EXP_RECOVERY_T(15) | EXP_SZ_16M | EXP_WR_EN | EXP_BYTE_RD16 | EXP_CS_EN)
 
Index: hal/arm/xscale/grg/current/include/hal_platform_extras.h
===================================================================
RCS file: hal/arm/xscale/grg/current/include/hal_platform_extras.h
diff -N hal/arm/xscale/grg/current/include/hal_platform_extras.h
--- hal/arm/xscale/grg/current/include/hal_platform_extras.h	18 Mar 2003 13:10:03 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,223 +0,0 @@
-#ifndef CYGONCE_HAL_PLATFORM_EXTRAS_H
-#define CYGONCE_HAL_PLATFORM_EXTRAS_H
-
-/*=============================================================================
-//
-//      hal_platform_extras.h
-//
-//      Platform specific MMU table.
-//
-//=============================================================================
-//####ECOSGPLCOPYRIGHTBEGIN####
-// -------------------------------------------
-// This file is part of eCos, the Embedded Configurable Operating System.
-// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 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-12-08
-// Purpose:      Intel XScale Generic Residential Platform specific mmu table
-// Description: 
-// Usage:        #include <cyg/hal/hal_platform_extras.h>
-//     Only used by "vectors.S"         
-//
-//####DESCRIPTIONEND####
-//
-//===========================================================================*/
-
-#if defined(CYG_HAL_STARTUP_ROM) || defined(CYG_HAL_STARTUP_ROMRAM)
-#if defined(CYG_HAL_STARTUP_ROMRAM)
-        .section .text
-	.ltorg
-	.p2align 13
-#else
-        .section .mmu_tables, "a"
-#endif
-
-    mmu_table:
-        //  This page table sets up the preferred mapping:
-        //
-        //  Virtual Address   Physical Address  XCB  Size (MB)  Description
-        //  ---------------   ----------------  ---  ---------  -----------
-        //     0x00000000       0x00000000      010      32     SDRAM (cached)
-        //     0x10000000       0x10000000      000      32     SDRAM (alias)
-        //     0x20000000       0x00000000      000      32     SDRAM (uncached)
-        //     0x48000000       0x48000000      000      64     PCI Data
-        //     0x50000000       0x50000000      010      16     Flash (CS0)
-        //     0x51000000       0x51000000      000     112     CS1 - CS7
-	//     0x60000000       0x60000000      000      64     Queue Manager
-	//     0xC0000000       0xC0000000      000       1     PCI Controller
-	//     0xC4000000       0xC4000000      000       1     Exp. Bus Config
-	//     0xC8000000       0xC8000000      000       1     Misc IXP425 IO
-	//     0xCC000000       0xCC000000      000       1     SDRAM Config
-
-	// 32MB SDRAM
-	.set	__base,0x000
-	.rept	0x020 - 0x000
-	FL_SECTION_ENTRY __base,0,3,0,0,1,0
-	.set	__base,__base+1
-	.endr
-
-	// 224MB Unused
-	.rept	0x100 - 0x020
-	.word 0
-	.set	__base,__base+1
-	.endr
-
-	// 32MB SDRAM Alias
-	.rept	0x120 - 0x100
-	FL_SECTION_ENTRY __base,0,3,0,0,1,0
-	.set	__base,__base+1
-	.endr
-
-	// 224MB Unused
-	.rept	0x200 - 0x120
-	.word 0
-	.set	__base,__base+1
-	.endr
-
-	// 32MB SDRAM (uncached)
-	.set	__base,0x000
-	.rept	0x220 - 0x200
-	FL_SECTION_ENTRY __base,0,3,0,0,0,0
-	.set	__base,__base+1
-	.endr
-
-	// 224MB Unused
-	.set	__base,0x220
-	.rept	0x300 - 0x220
-	.word 0
-	.set	__base,__base+1
-	.endr
-
-	// 384MB Unused
-	.rept	0x480 - 0x300
-	.word 0
-	.set	__base,__base+1
-	.endr
-
-	// 64MB PCI Data
-	.rept	0x4C0 - 0x480
-	FL_SECTION_ENTRY __base,0,3,0,0,0,0
-	.set	__base,__base+1
-	.endr
-
-	// 64MB Unused
-	.rept	0x500 - 0x4C0
-	.word 0
-	.set	__base,__base+1
-	.endr
-
-	// 16MB Flash  (Expansion bus CS0)
-	.rept	0x510 - 0x500
-	FL_SECTION_ENTRY __base,0,3,0,0,1,0
-	.set	__base,__base+1
-	.endr
-
-	// Rest of Expansion bus (CS1-CS7)
-	.rept	0x600 - 0x510
-	FL_SECTION_ENTRY __base,0,3,0,0,0,0
-	.set	__base,__base+1
-	.endr
-
-	// 64MB Queue Manager
-	.rept	0x640 - 0x600
-	FL_SECTION_ENTRY __base,0,3,0,0,0,0
-	.set	__base,__base+1
-	.endr
-
-	// 1472MB Unused
-	.rept	0xC00 - 0x640
-	.word 0
-	.set	__base,__base+1
-	.endr
-  
-	// 1MB PCI Controller
-	.rept	0xC01 - 0xC00
-	FL_SECTION_ENTRY __base,0,3,0,0,0,0
-	.set	__base,__base+1
-	.endr
-
-	// 63MB Unused
-	.rept	0xC40 - 0xC01
-	.word 0
-	.set	__base,__base+1
-	.endr
-
-	// 1MB Expansion bus config
-	.rept	0xC41 - 0xC40
-	FL_SECTION_ENTRY __base,0,3,0,0,0,0
-	.set	__base,__base+1
-	.endr
-
-	// 63MB Unused
-	.rept	0xC80 - 0xC41
-	.word 0
-	.set	__base,__base+1
-	.endr
-
-	// 1MB Misc IO
-	.rept	0xC81 - 0xC80
-	FL_SECTION_ENTRY __base,0,3,0,0,0,0
-	.set	__base,__base+1
-	.endr
-
-	// 63MB Unused
-	.rept	0xCC0 - 0xC81
-	.word 0
-	.set	__base,__base+1
-	.endr
-
-	// 1MB SDRAM Config
-	.rept	0xCC1 - 0xCC0
-	FL_SECTION_ENTRY __base,0,3,0,0,0,0
-	.set	__base,__base+1
-	.endr
-
-	// 63MB Unused
-	.rept	0xD00 - 0xCC1
-	.word 0
-	.set	__base,__base+1
-	.endr
-                  
-	// Rest is Unused
-	.rept	0x1000 - 0xD00
-        .word 0
-	.set	__base,__base+1
-	.endr
-
-#endif /* defined(CYG_HAL_STARTUP_ROM) || defined(CYG_HAL_STARTUP_ROMRAM) */
-
-/*---------------------------------------------------------------------------*/
-/* end of hal_platform_extras.h                                              */
-#endif /* CYGONCE_HAL_PLATFORM_EXTRAS_H */
Index: hal/arm/xscale/grg/current/include/hal_platform_setup.h
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/xscale/grg/current/include/hal_platform_setup.h,v
retrieving revision 1.2
diff -u -p -5 -r1.2 hal_platform_setup.h
--- hal/arm/xscale/grg/current/include/hal_platform_setup.h	30 Jun 2003 13:07:08 -0000	1.2
+++ hal/arm/xscale/grg/current/include/hal_platform_setup.h	2 Sep 2004 20:12:51 -0000
@@ -9,11 +9,11 @@
 //
 //=============================================================================
 //####ECOSGPLCOPYRIGHTBEGIN####
 // -------------------------------------------
 // This file is part of eCos, the Embedded Configurable Operating System.
-// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Red Hat, Inc.
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004 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.
 //
@@ -61,13 +61,31 @@
 #include <cyg/hal/hal_ixp425.h>         // Variant specific hardware definitions
 #include <cyg/hal/hal_mmu.h>            // MMU definitions
 #include <cyg/hal/hal_mm.h>             // more MMU definitions
 #include <cyg/hal/grg.h>                // Platform specific hardware definitions
 
+// ------------------------------------------------------------------------
+// Convenience macros for setting up page table
+// 
+.macro IXP_MAP_SDRAM va, c, b, x, p
+    XSCALE_MMU_SECTION SDRAM_PHYS_BASE>>20, \va>>20, SDRAM_SIZE>>20, \c, \b, 3, \x, \p
+.endm
+
+.macro IXP_MAP_EXP_V n, va, sz, c, b, x, p
+    XSCALE_MMU_SECTION (0x500 + ((IXP425_EXP_CS_SIZE * \n) >> 20)), \va>>20, \sz>>20, \c, \b, 3, \x, \p
+.endm
+
+.macro IXP_MAP_EXP n, sz, c, b, x, p
+    IXP_MAP_EXP_V \n, (0x50000000 + (IXP425_EXP_CS_SIZE * \n)), \sz, \c, \b, \x, \p
+.endm
+
+.macro IXP_MAP_IO addr, sz
+    XSCALE_MMU_SECTION \addr>>20, \addr>>20, \sz>>20, 0, 0, 3, 0, 0
+.endm
+
 #if defined(CYG_HAL_STARTUP_ROM)
 #define PLATFORM_SETUP1  _platform_setup1
-#define PLATFORM_EXTRAS  <cyg/hal/hal_platform_extras.h>
 #define CYGHWR_HAL_ARM_HAS_MMU
 
 // ------------------------------------------------------------------------
 // Define macro used to diddle the LEDs during early initialization.
 // Can use r0+r1.  Argument in \x.
@@ -84,11 +102,11 @@
 
 // ------------------------------------------------------------------------
 // This macro represents the initial startup code for the platform        
 	.macro _platform_setup1
 
-#if CYGINT_HAL_ARM_BIGENDIAN
+#ifdef CYGHWR_HAL_ARM_BIGENDIAN
         // set big-endian
 	mrc	p15, 0, r0, c1, c0, 0
         orr	r0, r0, #0x80
 	mcr	p15, 0, r0, c1, c0, 0
         CPWAIT  r0
@@ -199,10 +217,16 @@
 	// start normal operation
 	mov	r1, #SDRAM_IR_NORMAL
         str	r1, [r0, #IXP425_SDRAM_IR]
 	DELAY   0x10000, r1
 
+        // Enable byte swapping control via page table P bit.    
+        ldr     r2, =IXP425_EXP_CFG_BASE
+        ldr     r1, [r2, #IXP425_EXP_CNFG1]
+        orr     r1, r1, #EXP_CNFG1_BYTE_SWAP_EN
+        str     r1, [r2, #IXP425_EXP_CNFG1]
+
 	// value to load into pc to jump to real runtime address
 	ldr     r0, =1f
 
 	// Setup EXP_CNFG0 value to switch EXP bus out of low memory
 	ldr 	r2, =IXP425_EXP_CFG_BASE
@@ -224,24 +248,42 @@ icache_boundary:
         nop
                             // display FFFF and loop forever.
     0:  b       0b
     1:
 
-	// Move mmu tables into RAM so page table walks by the cpu
+	// Build mmu tables into RAM so page table walks by the cpu
 	// don't interfere with FLASH programming.
-	ldr	r0, =mmu_table
-	add     r2, r0, #0x4000     	// End of tables
 	mov	r1, #SDRAM_PHYS_BASE
 	orr	r1, r1, #0x4000		// RAM tables
+	add     r2, r1, #0x4000     	// End of tables
 
-	// everything can go as-is
+	// First clear table
+	mov	r0, #0
     1:
-	ldr	r3, [r0], #4
-	str	r3, [r1], #4
-	cmp	r0, r2
+	str	r0, [r1], #4
+	cmp	r1, r2
 	bne	1b
 
+        // Build section mappings
+	IXP_MAP_SDRAM   SDRAM_BASE,           1, 0, 0, 0   // Cached SDRAM
+	IXP_MAP_SDRAM   SDRAM_ALIAS_BASE,     1, 0, 0, 0   // Cached SDRAM alias
+	IXP_MAP_SDRAM   SDRAM_UNCACHED_BASE,  0, 0, 0, 0   // Uncached SDRAM
+	IXP_MAP_SDRAM   SDRAM_DC_BASE,        1, 0, 0, 1   // Cached data coherent SDRAM
+
+	IXP_MAP_EXP 0, IXDP_FLASH_SIZE,       1, 0, 0, 0   // Flash
+	IXP_MAP_EXP 4, (1 << 20),             0, 0, 0, 0   // NPE use
+	IXP_MAP_EXP 5, (1 << 20),             0, 0, 0, 0   // NPE use
+
+	IXP_MAP_EXP_V 0, IXDP_FLASH_DC_BASE, IXDP_FLASH_SIZE, 1, 0, 0, 1  // data coherent flash
+
+	IXP_MAP_IO      IXP425_PCI_WINDOW_BASE,  IXP425_PCI_WINDOW_SIZE
+	IXP_MAP_IO      IXP425_QMGR_BASE,        IXP425_QMGR_SIZE
+	IXP_MAP_IO	IXP425_PCI_CFG_BASE,     IXP425_PCI_CFG_SIZE
+	IXP_MAP_IO	IXP425_EXP_CFG_BASE,     IXP425_EXP_CFG_SIZE
+	IXP_MAP_IO	IXP425_MISC_CFG_BASE,    IXP425_MISC_CFG_SIZE
+	IXP_MAP_IO	IXP425_SDRAM_CFG_BASE,   IXP425_SDRAM_CFG_SIZE
+
         mcr     p15, 0, r0, c7, c10, 4  // drain the write & fill buffers
         CPWAIT  r0
 
 	// Set the TTB register to DRAM mmu_table
 	ldr	r0, =(SDRAM_PHYS_BASE | 0x4000) // RAM tables
Index: hal/arm/xscale/grg/current/misc/redboot_RAM.ecm
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/xscale/grg/current/misc/redboot_RAM.ecm,v
retrieving revision 1.2
diff -u -p -5 -r1.2 redboot_RAM.ecm
--- hal/arm/xscale/grg/current/misc/redboot_RAM.ecm	2 Apr 2003 18:08:52 -0000	1.2
+++ hal/arm/xscale/grg/current/misc/redboot_RAM.ecm	2 Sep 2004 20:12:51 -0000
@@ -22,10 +22,11 @@ cdl_configuration eCos {
     package -template CYGPKG_HAL current ;
     package -template CYGPKG_INFRA current ;
     package -template CYGPKG_REDBOOT current ;
     package -template CYGPKG_ISOINFRA current ;
     package -template CYGPKG_LIBC_STRING current ;
+    package -template CYGPKG_CRC current ;
     package CYGPKG_IO_FLASH current ;
     package CYGPKG_IO_ETH_DRIVERS current ;
     package CYGPKG_MEMALLOC current ;
     package CYGPKG_COMPRESS_ZLIB current ;
 };
@@ -81,11 +82,11 @@ cdl_component CYGSEM_REDBOOT_FLASH_CONFI
 cdl_component CYGSEM_REDBOOT_BSP_SYSCALLS {
     inferred_value 1
 };
 
 cdl_option CYGHWR_REDBOOT_ARM_LINUX_EXEC_ADDRESS_DEFAULT {
-    inferred_value 0x600000
+    inferred_value 0x1600000
 };
 
 cdl_option CYGHWR_HAL_IXP425_PCI_NP_WORKAROUND {
     inferred_value 1
 };
@@ -112,9 +113,13 @@ cdl_option CYGBLD_ISO_STRING_STRFUNCS_HE
 
 cdl_option CYGPKG_HAL_GDB_FILEIO {
     user_value 1
 };
 
-cdl_option CYGOPT_DEVS_FLASH_STRATA_NOT_IN_RAM {
-   inferred_value 0
+cdl_option CYGHWR_REDBOOT_LINUX_EXEC_X_SWITCH {
+    user_value 1
+}
+ 
+cdl_option CYGHWR_HAL_ARM_BIGENDIAN {
+    user_value 1
 };
 
Index: hal/arm/xscale/grg/current/misc/redboot_RAMLE.ecm
===================================================================
RCS file: hal/arm/xscale/grg/current/misc/redboot_RAMLE.ecm
diff -N hal/arm/xscale/grg/current/misc/redboot_RAMLE.ecm
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ hal/arm/xscale/grg/current/misc/redboot_RAMLE.ecm	2 Sep 2004 20:12:51 -0000
@@ -0,0 +1,128 @@
+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    grg ;
+    template    redboot ;
+    package -hardware CYGPKG_HAL_ARM current ;
+    package -hardware CYGPKG_HAL_ARM_XSCALE_CORE current ;
+    package -hardware CYGPKG_HAL_ARM_XSCALE_IXP425 current ;
+    package -hardware CYGPKG_HAL_ARM_XSCALE_GRG current ;
+    package -hardware CYGPKG_DEVS_FLASH_STRATA current ;
+    package -hardware CYGPKG_DEVS_FLASH_GRG current ;
+    package -hardware CYGPKG_DEVS_ETH_INTEL_I82559 current ;
+    package -hardware CYGPKG_DEVS_ETH_ARM_GRG_I82559 current ;
+    package -template CYGPKG_HAL current ;
+    package -template CYGPKG_INFRA current ;
+    package -template CYGPKG_REDBOOT current ;
+    package -template CYGPKG_ISOINFRA current ;
+    package -template CYGPKG_LIBC_STRING current ;
+    package -template CYGPKG_CRC current ;
+    package CYGPKG_IO_FLASH current ;
+    package CYGPKG_IO_ETH_DRIVERS current ;
+    package CYGPKG_MEMALLOC current ;
+    package CYGPKG_COMPRESS_ZLIB current ;
+};
+
+cdl_component CYG_HAL_STARTUP {
+    user_value RAM
+};
+
+cdl_option CYGBLD_BUILD_GDB_STUBS {
+    user_value 0
+};
+
+cdl_option CYGFUN_LIBC_STRING_BSD_FUNCS {
+    inferred_value 0
+};
+
+cdl_option CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE {
+    user_value 4096
+};
+
+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_CTRLC_SUPPORT {
+    inferred_value 0
+};
+
+cdl_option CYGSEM_HAL_USE_ROM_MONITOR {
+    inferred_value 0 0
+};
+
+cdl_component CYGBLD_BUILD_REDBOOT {
+    user_value 1
+};
+
+cdl_option CYGBLD_REDBOOT_MIN_IMAGE_SIZE {
+    inferred_value 0x40000
+};
+
+cdl_component CYGSEM_REDBOOT_FLASH_CONFIG {
+    user_value 1
+};
+
+cdl_component CYGSEM_REDBOOT_BSP_SYSCALLS {
+    inferred_value 1
+};
+
+cdl_option CYGHWR_REDBOOT_ARM_LINUX_EXEC_ADDRESS_DEFAULT {
+    inferred_value 0x1600000
+};
+
+cdl_option CYGHWR_HAL_IXP425_PCI_NP_WORKAROUND {
+    inferred_value 1
+};
+
+cdl_option CYGBLD_ISO_STRTOK_R_HEADER {
+    inferred_value 1 <cyg/libc/string/string.h>
+};
+
+cdl_option CYGBLD_ISO_STRING_LOCALE_FUNCS_HEADER {
+    inferred_value 1 <cyg/libc/string/string.h>
+};
+
+cdl_option CYGBLD_ISO_STRING_BSD_FUNCS_HEADER {
+    inferred_value 1 <cyg/libc/string/bsdstring.h>
+};
+
+cdl_option CYGBLD_ISO_STRING_MEMFUNCS_HEADER {
+    inferred_value 1 <cyg/libc/string/string.h>
+};
+
+cdl_option CYGBLD_ISO_STRING_STRFUNCS_HEADER {
+    inferred_value 1 <cyg/libc/string/string.h>
+};
+
+cdl_option CYGPKG_HAL_GDB_FILEIO {
+    user_value 1
+};
+
+cdl_option CYGHWR_REDBOOT_LINUX_EXEC_X_SWITCH {
+    user_value 1
+}
+ 
+cdl_option CYGHWR_HAL_ARM_BIGENDIAN {
+    user_value 0
+};
+
+cdl_option CYGOPT_REDBOOT_FLASH_BYTEORDER {
+    user_value MSBFIRST
+}
Index: hal/arm/xscale/grg/current/misc/redboot_ROM.ecm
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/xscale/grg/current/misc/redboot_ROM.ecm,v
retrieving revision 1.2
diff -u -p -5 -r1.2 redboot_ROM.ecm
--- hal/arm/xscale/grg/current/misc/redboot_ROM.ecm	2 Apr 2003 18:08:52 -0000	1.2
+++ hal/arm/xscale/grg/current/misc/redboot_ROM.ecm	2 Sep 2004 20:12:51 -0000
@@ -22,10 +22,11 @@ cdl_configuration eCos {
     package -template CYGPKG_HAL current ;
     package -template CYGPKG_INFRA current ;
     package -template CYGPKG_REDBOOT current ;
     package -template CYGPKG_ISOINFRA current ;
     package -template CYGPKG_LIBC_STRING current ;
+    package -template CYGPKG_CRC current ;
     package CYGPKG_IO_FLASH current ;
     package CYGPKG_IO_ETH_DRIVERS current ;
     package CYGPKG_MEMALLOC current ;
     package CYGPKG_COMPRESS_ZLIB current ;
 };
@@ -85,11 +86,11 @@ cdl_component CYGSEM_REDBOOT_FLASH_CONFI
 cdl_component CYGSEM_REDBOOT_BSP_SYSCALLS {
    inferred_value 1
 };
 
 cdl_option CYGHWR_REDBOOT_ARM_LINUX_EXEC_ADDRESS_DEFAULT {
-    inferred_value 0x600000
+    inferred_value 0x1600000
 };
 
 cdl_option CYGHWR_HAL_IXP425_PCI_NP_WORKAROUND {
     inferred_value 1
 };
@@ -120,5 +121,13 @@ cdl_option CYGBLD_ISO_DNS_HEADER {
 
 cdl_option CYGPKG_HAL_GDB_FILEIO {
     user_value 1
 };
 
+cdl_option CYGHWR_REDBOOT_LINUX_EXEC_X_SWITCH {
+    user_value 1
+}
+ 
+cdl_option CYGHWR_HAL_ARM_BIGENDIAN {
+    user_value 1
+};
+
Index: hal/arm/xscale/grg/current/misc/redboot_ROMLE.ecm
===================================================================
RCS file: hal/arm/xscale/grg/current/misc/redboot_ROMLE.ecm
diff -N hal/arm/xscale/grg/current/misc/redboot_ROMLE.ecm
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ hal/arm/xscale/grg/current/misc/redboot_ROMLE.ecm	2 Sep 2004 20:12:51 -0000
@@ -0,0 +1,136 @@
+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    grg ;
+    template    redboot ;
+    package -hardware CYGPKG_HAL_ARM current ;
+    package -hardware CYGPKG_HAL_ARM_XSCALE_CORE current ;
+    package -hardware CYGPKG_HAL_ARM_XSCALE_IXP425 current ;
+    package -hardware CYGPKG_HAL_ARM_XSCALE_GRG current ;
+    package -hardware CYGPKG_DEVS_FLASH_STRATA current ;
+    package -hardware CYGPKG_DEVS_FLASH_GRG current ;
+    package -hardware CYGPKG_DEVS_ETH_INTEL_I82559 current ;
+    package -hardware CYGPKG_DEVS_ETH_ARM_GRG_I82559 current ;
+    package -template CYGPKG_HAL current ;
+    package -template CYGPKG_INFRA current ;
+    package -template CYGPKG_REDBOOT current ;
+    package -template CYGPKG_ISOINFRA current ;
+    package -template CYGPKG_LIBC_STRING current ;
+    package -template CYGPKG_CRC current ;
+    package CYGPKG_IO_FLASH current ;
+    package CYGPKG_IO_ETH_DRIVERS current ;
+    package CYGPKG_MEMALLOC current ;
+    package CYGPKG_COMPRESS_ZLIB current ;
+};
+
+cdl_component CYG_HAL_STARTUP {
+    user_value ROM
+};
+
+cdl_option CYGBLD_BUILD_GDB_STUBS {
+    user_value 0
+};
+
+cdl_option CYGFUN_LIBC_STRING_BSD_FUNCS {
+    inferred_value 0
+};
+
+cdl_option CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE {
+    user_value 4096
+};
+
+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_CTRLC_SUPPORT {
+    inferred_value 0
+};
+
+cdl_option CYGSEM_HAL_ROM_MONITOR {
+    user_value 1
+};
+
+cdl_option CYGSEM_HAL_USE_ROM_MONITOR {
+    inferred_value 0 0
+};
+
+cdl_component CYGBLD_BUILD_REDBOOT {
+    user_value 1
+};
+
+cdl_option CYGBLD_REDBOOT_MIN_IMAGE_SIZE {
+    inferred_value 0x40000
+};
+
+cdl_component CYGSEM_REDBOOT_FLASH_CONFIG {
+    user_value 1
+};
+
+cdl_component CYGSEM_REDBOOT_BSP_SYSCALLS {
+   inferred_value 1
+};
+
+cdl_option CYGHWR_REDBOOT_ARM_LINUX_EXEC_ADDRESS_DEFAULT {
+    inferred_value 0x1600000
+};
+
+cdl_option CYGHWR_HAL_IXP425_PCI_NP_WORKAROUND {
+    inferred_value 1
+};
+
+cdl_option CYGBLD_ISO_STRTOK_R_HEADER {
+    inferred_value 1 <cyg/libc/string/string.h>
+};
+
+cdl_option CYGBLD_ISO_STRING_LOCALE_FUNCS_HEADER {
+    inferred_value 1 <cyg/libc/string/string.h>
+};
+
+cdl_option CYGBLD_ISO_STRING_BSD_FUNCS_HEADER {
+    inferred_value 1 <cyg/libc/string/bsdstring.h>
+};
+
+cdl_option CYGBLD_ISO_STRING_MEMFUNCS_HEADER {
+    inferred_value 1 <cyg/libc/string/string.h>
+};
+
+cdl_option CYGBLD_ISO_STRING_STRFUNCS_HEADER {
+    inferred_value 1 <cyg/libc/string/string.h>
+};
+
+cdl_option CYGBLD_ISO_DNS_HEADER {
+    inferred_value 1 <cyg/ns/dns/dns.h>
+};
+
+cdl_option CYGPKG_HAL_GDB_FILEIO {
+    user_value 1
+};
+
+cdl_option CYGHWR_REDBOOT_LINUX_EXEC_X_SWITCH {
+    user_value 1
+}
+ 
+cdl_option CYGHWR_HAL_ARM_BIGENDIAN {
+    user_value 0
+};
+
+cdl_option CYGOPT_REDBOOT_FLASH_BYTEORDER {
+    user_value MSBFIRST
+}
Index: hal/arm/xscale/ixdp425/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/xscale/ixdp425/current/ChangeLog,v
retrieving revision 1.6
diff -u -p -5 -r1.6 ChangeLog
--- hal/arm/xscale/ixdp425/current/ChangeLog	30 Jun 2003 13:07:08 -0000	1.6
+++ hal/arm/xscale/ixdp425/current/ChangeLog	2 Sep 2004 20:12:51 -0000
@@ -1,5 +1,17 @@
+2004-09-02  Mark Salter  <msalter@redhat.com>
+
+	* src/ixdp425_pci.c: Fix compilation when not configured for PCI.
+	* include/ixdp425.h: Add some defines for use in page table setup.
+	* include/hal_platform_extras.h: Removed.
+	* misc/redboot_ROMLE.ecm: New file.
+	* misc/redboot_RAMLE.ecm: New file.
+	* cdl/hal_arm_xscale_ixdp425.cdl: Add little-endian support.
+	* misc/redboot_RAM.ecm: Ditto.
+	* misc/redboot_ROM.ecm: Ditto.
+	* include/hal_platform_setup.h: Ditto.
+
 2003-06-30  Mark Salter  <msalter@redhat.com>
 
 	* include/hal_platform_setup.h: Fix CYGINT_HAL_ARM_BIGENDIAN test.
 	Remove unused ROMRAM cruft.
 
Index: hal/arm/xscale/ixdp425/current/cdl/hal_arm_xscale_ixdp425.cdl
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/xscale/ixdp425/current/cdl/hal_arm_xscale_ixdp425.cdl,v
retrieving revision 1.3
diff -u -p -5 -r1.3 hal_arm_xscale_ixdp425.cdl
--- hal/arm/xscale/ixdp425/current/cdl/hal_arm_xscale_ixdp425.cdl	2 Apr 2003 18:36:47 -0000	1.3
+++ hal/arm/xscale/ixdp425/current/cdl/hal_arm_xscale_ixdp425.cdl	2 Sep 2004 20:12:51 -0000
@@ -65,11 +65,15 @@ cdl_package CYGPKG_HAL_ARM_XSCALE_IXDP42
         puts $::cdl_system_header "#define CYGBLD_HAL_VARIANT_H  <pkgconf/hal_arm_xscale_ixp425.h>"
         puts $::cdl_system_header "#define CYGBLD_HAL_PLATFORM_H <pkgconf/hal_arm_xscale_ixdp425.h>"
         puts $::cdl_header "#define CYGBLD_HAL_PLF_INTS_H <cyg/hal/hal_plf_ints.h>"
 	puts $::cdl_header "#define HAL_PLATFORM_CPU    \"XScale\""
         puts $::cdl_header "#define HAL_PLATFORM_BOARD  \"IXDP425 Development Platform\""
-        puts $::cdl_header "#define HAL_PLATFORM_EXTRA  \"\""
+        puts $::cdl_header "#ifdef CYGHWR_HAL_ARM_BIGENDIAN"
+        puts $::cdl_header "#define HAL_PLATFORM_EXTRA  \"BE\""
+        puts $::cdl_header "#else"
+        puts $::cdl_header "#define HAL_PLATFORM_EXTRA  \"LE\""
+        puts $::cdl_header "#endif"
         puts $::cdl_header "#define HAL_PLATFORM_MACHINE_TYPE  245"
     }
 
     cdl_component CYG_HAL_STARTUP {
         display       "Startup type"
@@ -107,22 +111,24 @@ cdl_package CYGPKG_HAL_ARM_XSCALE_IXDP42
 
         cdl_option CYGBLD_GLOBAL_CFLAGS {
             display "Global compiler flags"
             flavor  data
             no_define
-            default_value { "-mcpu=xscale -mbig-endian -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority -mapcs-frame" }
+            default_value { CYGHWR_HAL_ARM_BIGENDIAN ? "-mbig-endian -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -mapcs-frame" :
+	                    "-Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -mapcs-frame" }
             description   "
                 This option controls the global compiler flags which are used to
                 compile all packages by default. Individual packages may define
                 options which override these global flags."
         }
 
         cdl_option CYGBLD_GLOBAL_LDFLAGS {
             display "Global linker flags"
             flavor  data
             no_define
-            default_value { "-mcpu=xscale -mbig-endian -Wl,--gc-sections -Wl,-static -g -O2 -nostdlib" }
+            default_value { CYGHWR_HAL_ARM_BIGENDIAN ? "-mbig-endian -Wl,--gc-sections -Wl,-static -g -O2 -nostdlib" :
+	                    "-Wl,--gc-sections -Wl,-static -g -O2 -nostdlib " }
             description   "
                 This option controls the global linker flags. Individual
                 packages may define options which override these global flags."
         }
 
Index: hal/arm/xscale/ixdp425/current/include/hal_platform_extras.h
===================================================================
RCS file: hal/arm/xscale/ixdp425/current/include/hal_platform_extras.h
diff -N hal/arm/xscale/ixdp425/current/include/hal_platform_extras.h
--- hal/arm/xscale/ixdp425/current/include/hal_platform_extras.h	18 Mar 2003 13:10:03 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,205 +0,0 @@
-#ifndef CYGONCE_HAL_PLATFORM_EXTRAS_H
-#define CYGONCE_HAL_PLATFORM_EXTRAS_H
-
-/*=============================================================================
-//
-//      hal_platform_extras.h
-//
-//      Platform specific MMU table.
-//
-//=============================================================================
-//####ECOSGPLCOPYRIGHTBEGIN####
-// -------------------------------------------
-// This file is part of eCos, the Embedded Configurable Operating System.
-// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 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-12-08
-// Purpose:      Intel XScale IXDP425 platform specific mmu table
-// Description: 
-// Usage:        #include <cyg/hal/hal_platform_extras.h>
-//     Only used by "vectors.S"         
-//
-//####DESCRIPTIONEND####
-//
-//===========================================================================*/
-
-#if defined(CYG_HAL_STARTUP_ROM) || defined(CYG_HAL_STARTUP_ROMRAM)
-#if defined(CYG_HAL_STARTUP_ROMRAM)
-        .section .text
-	.ltorg
-	.p2align 13
-#else
-        .section .mmu_tables, "a"
-#endif
-
-    mmu_table:
-        //  This page table sets up the preferred mapping:
-        //
-        //  Virtual Address   Physical Address  XCB  Size (MB)  Description
-        //  ---------------   ----------------  ---  ---------  -----------
-        //     0x00000000       0x00000000      010     256     SDRAM (cached)
-        //     0x10000000       0x10000000      010     256     SDRAM (alias)
-        //     0x20000000       0x00000000      000     256     SDRAM (uncached)
-        //     0x48000000       0x48000000      000      64     PCI Data
-        //     0x50000000       0x50000000      010      16     Flash (CS0)
-        //     0x51000000       0x51000000      000     112     CS1 - CS7
-	//     0x60000000       0x60000000      000      64     Queue Manager
-	//     0xC0000000       0xC0000000      000       1     PCI Controller
-	//     0xC4000000       0xC4000000      000       1     Exp. Bus Config
-	//     0xC8000000       0xC8000000      000       1     Misc IXP425 IO
-	//     0xCC000000       0xCC000000      000       1     SDRAM Config
-
-	// 256MB SDRAM
-	.set	__base,0x000
-	.rept	0x100 - 0x000
-	FL_SECTION_ENTRY __base,0,3,0,0,1,0
-	.set	__base,__base+1
-	.endr
-
-	// 256MB SDRAM (alias)
-	.rept	0x200 - 0x100
-	FL_SECTION_ENTRY __base,0,3,0,0,1,0
-	.set	__base,__base+1
-	.endr
-
-	// 256MB SDRAM (uncached)
-	.set	__base,0x000
-	.rept	0x300 - 0x200
-	FL_SECTION_ENTRY __base,0,3,0,0,0,0
-	.set	__base,__base+1
-	.endr
-
-	// 384MB Unused
-	.set	__base,0x300
-	.rept	0x480 - 0x300
-	.word 0
-	.set	__base,__base+1
-	.endr
-
-	// 64MB PCI Data
-	.rept	0x4C0 - 0x480
-	FL_SECTION_ENTRY __base,0,3,0,0,0,0
-	.set	__base,__base+1
-	.endr
-
-	// 64MB Unused
-	.rept	0x500 - 0x4C0
-	.word 0
-	.set	__base,__base+1
-	.endr
-
-	// 16MB Flash  (Expansion bus CS0)
-	.rept	0x510 - 0x500
-	FL_SECTION_ENTRY __base,0,3,0,0,1,0
-	.set	__base,__base+1
-	.endr
-
-	// Rest of Expansion bus (CS1-CS7)
-	.rept	0x600 - 0x510
-	FL_SECTION_ENTRY __base,0,3,0,0,0,0
-	.set	__base,__base+1
-	.endr
-
-	// 64MB Queue Manager
-	.rept	0x640 - 0x600
-	FL_SECTION_ENTRY __base,0,3,0,0,0,0
-	.set	__base,__base+1
-	.endr
-
-	// 1472MB Unused
-	.rept	0xC00 - 0x640
-	.word 0
-	.set	__base,__base+1
-	.endr
-  
-	// 1MB PCI Controller
-	.rept	0xC01 - 0xC00
-	FL_SECTION_ENTRY __base,0,3,0,0,0,0
-	.set	__base,__base+1
-	.endr
-
-	// 63MB Unused
-	.rept	0xC40 - 0xC01
-	.word 0
-	.set	__base,__base+1
-	.endr
-
-	// 1MB Expansion bus config
-	.rept	0xC41 - 0xC40
-	FL_SECTION_ENTRY __base,0,3,0,0,0,0
-	.set	__base,__base+1
-	.endr
-
-	// 63MB Unused
-	.rept	0xC80 - 0xC41
-	.word 0
-	.set	__base,__base+1
-	.endr
-
-	// 1MB Misc IO
-	.rept	0xC81 - 0xC80
-	FL_SECTION_ENTRY __base,0,3,0,0,0,0
-	.set	__base,__base+1
-	.endr
-
-	// 63MB Unused
-	.rept	0xCC0 - 0xC81
-	.word 0
-	.set	__base,__base+1
-	.endr
-
-	// 1MB SDRAM Config
-	.rept	0xCC1 - 0xCC0
-	FL_SECTION_ENTRY __base,0,3,0,0,0,0
-	.set	__base,__base+1
-	.endr
-
-	// 63MB Unused
-	.rept	0xD00 - 0xCC1
-	.word 0
-	.set	__base,__base+1
-	.endr
-                  
-	// Rest is Unused
-	.rept	0x1000 - 0xD00
-        .word 0
-	.set	__base,__base+1
-	.endr
-
-#endif /* defined(CYG_HAL_STARTUP_ROM) || defined(CYG_HAL_STARTUP_ROMRAM) */
-
-/*---------------------------------------------------------------------------*/
-/* end of hal_platform_extras.h                                              */
-#endif /* CYGONCE_HAL_PLATFORM_EXTRAS_H */
Index: hal/arm/xscale/ixdp425/current/include/hal_platform_setup.h
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/xscale/ixdp425/current/include/hal_platform_setup.h,v
retrieving revision 1.2
diff -u -p -5 -r1.2 hal_platform_setup.h
--- hal/arm/xscale/ixdp425/current/include/hal_platform_setup.h	30 Jun 2003 13:07:08 -0000	1.2
+++ hal/arm/xscale/ixdp425/current/include/hal_platform_setup.h	2 Sep 2004 20:12:51 -0000
@@ -9,11 +9,11 @@
 //
 //=============================================================================
 //####ECOSGPLCOPYRIGHTBEGIN####
 // -------------------------------------------
 // This file is part of eCos, the Embedded Configurable Operating System.
-// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Red Hat, Inc.
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004 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.
 //
@@ -61,13 +61,32 @@
 #include <cyg/hal/hal_ixp425.h>         // Variant specific hardware definitions
 #include <cyg/hal/hal_mmu.h>            // MMU definitions
 #include <cyg/hal/hal_mm.h>             // more MMU definitions
 #include <cyg/hal/ixdp425.h>            // Platform specific hardware definitions
 
+// ------------------------------------------------------------------------
+// Convenience macros for setting up page table
+// 
+.macro IXP_MAP_SDRAM va, c, b, x, p
+    XSCALE_MMU_SECTION SDRAM_PHYS_BASE>>20, \va>>20, SDRAM_SIZE>>20, \c, \b, 3, \x, \p
+.endm
+
+.macro IXP_MAP_EXP_V n, va, sz, c, b, x, p
+    XSCALE_MMU_SECTION (0x500 + ((IXP425_EXP_CS_SIZE * \n) >> 20)), \va>>20, \sz>>20, \c, \b, 3, \x, \p
+.endm
+
+.macro IXP_MAP_EXP n, sz, c, b, x, p
+    IXP_MAP_EXP_V \n, (0x50000000 + (IXP425_EXP_CS_SIZE * \n)), \sz, \c, \b, \x, \p
+.endm
+
+.macro IXP_MAP_IO addr, sz
+    XSCALE_MMU_SECTION \addr>>20, \addr>>20, \sz>>20, 0, 0, 3, 0, 0
+.endm
+
+
 #if defined(CYG_HAL_STARTUP_ROM)
 #define PLATFORM_SETUP1  _platform_setup1
-#define PLATFORM_EXTRAS  <cyg/hal/hal_platform_extras.h>
 #define CYGHWR_HAL_ARM_HAS_MMU
 
 // ------------------------------------------------------------------------
 // Define macro used to diddle the LEDs during early initialization.
 // Can use r0+r1.  Argument in \x.
@@ -84,11 +103,11 @@
 
 // ------------------------------------------------------------------------
 // This macro represents the initial startup code for the platform        
 	.macro _platform_setup1
 
-#if CYGINT_HAL_ARM_BIGENDIAN
+#ifdef CYGHWR_HAL_ARM_BIGENDIAN
         // set big-endian
 	mrc	p15, 0, r0, c1, c0, 0
         orr	r0, r0, #0x80
 	mcr	p15, 0, r0, c1, c0, 0
         CPWAIT  r0
@@ -205,10 +224,16 @@
         str	r1, [r0, #IXP425_SDRAM_IR]
 	DELAY   0x10000, r1
 
 	DISPLAY	0x1003, r7, r8
 
+        // Enable byte swapping control via page table P bit.    
+        ldr     r2, =IXP425_EXP_CFG_BASE
+        ldr     r1, [r2, #IXP425_EXP_CNFG1]
+        orr     r1, r1, #EXP_CNFG1_BYTE_SWAP_EN
+        str     r1, [r2, #IXP425_EXP_CNFG1]
+
 	// value to load into pc to jump to real runtime address
 	ldr     r0, =1f
 
 	// Setup EXP_CNFG0 value to switch EXP bus out of low memory
 	ldr 	r2, =IXP425_EXP_CFG_BASE
@@ -234,24 +259,43 @@ icache_boundary:
     0:  b       0b
     1:
 
 	DISPLAY	0x1004, r7, r8
 
-	// Move mmu tables into RAM so page table walks by the cpu
+	// Build mmu tables into RAM so page table walks by the cpu
 	// don't interfere with FLASH programming.
-	ldr	r0, =mmu_table
-	add     r2, r0, #0x4000     	// End of tables
 	mov	r1, #SDRAM_PHYS_BASE
 	orr	r1, r1, #0x4000		// RAM tables
+	add     r2, r1, #0x4000     	// End of tables
 
-	// everything can go as-is
+	// First clear table
+	mov	r0, #0
     1:
-	ldr	r3, [r0], #4
-	str	r3, [r1], #4
-	cmp	r0, r2
+	str	r0, [r1], #4
+	cmp	r1, r2
 	bne	1b
 
+        // Build section mappings
+	IXP_MAP_SDRAM   SDRAM_BASE,           1, 0, 0, 0   // Cached SDRAM
+	IXP_MAP_SDRAM   SDRAM_ALIAS_BASE,     1, 0, 0, 0   // Cached SDRAM alias
+	IXP_MAP_SDRAM   SDRAM_UNCACHED_BASE,  0, 0, 0, 0   // Uncached SDRAM
+	IXP_MAP_SDRAM   SDRAM_DC_BASE,        1, 0, 0, 1   // Cached data coherent SDRAM
+
+	IXP_MAP_EXP 0, IXDP_FLASH_SIZE,       1, 0, 0, 0   // Flash
+	IXP_MAP_EXP 2, IXDP425_LED_SIZE,      0, 0, 0, 0   // LED
+	IXP_MAP_EXP 4, (1 << 20),             0, 0, 0, 0   // NPE use
+	IXP_MAP_EXP 5, (1 << 20),             0, 0, 0, 0   // NPE use
+
+	IXP_MAP_EXP_V 0, IXDP_FLASH_DC_BASE, IXDP_FLASH_SIZE, 1, 0, 0, 1  // data coherent flash
+
+	IXP_MAP_IO      IXP425_PCI_WINDOW_BASE,  IXP425_PCI_WINDOW_SIZE
+	IXP_MAP_IO      IXP425_QMGR_BASE,        IXP425_QMGR_SIZE
+	IXP_MAP_IO	IXP425_PCI_CFG_BASE,     IXP425_PCI_CFG_SIZE
+	IXP_MAP_IO	IXP425_EXP_CFG_BASE,     IXP425_EXP_CFG_SIZE
+	IXP_MAP_IO	IXP425_MISC_CFG_BASE,    IXP425_MISC_CFG_SIZE
+	IXP_MAP_IO	IXP425_SDRAM_CFG_BASE,   IXP425_SDRAM_CFG_SIZE
+
 	DISPLAY	0x1005, r7, r8
 
         mcr     p15, 0, r0, c7, c10, 4  // drain the write & fill buffers
         CPWAIT  r0
 
Index: hal/arm/xscale/ixdp425/current/include/ixdp425.h
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/xscale/ixdp425/current/include/ixdp425.h,v
retrieving revision 1.2
diff -u -p -5 -r1.2 ixdp425.h
--- hal/arm/xscale/ixdp425/current/include/ixdp425.h	4 Apr 2003 14:52:31 -0000	1.2
+++ hal/arm/xscale/ixdp425/current/include/ixdp425.h	2 Sep 2004 20:12:51 -0000
@@ -9,11 +9,11 @@
 //
 //=============================================================================
 //####ECOSGPLCOPYRIGHTBEGIN####
 // -------------------------------------------
 // This file is part of eCos, the Embedded Configurable Operating System.
-// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Red Hat, Inc.
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 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.
 //
@@ -60,14 +60,22 @@
 #include <cyg/hal/hal_ixp425.h>
 
 // These must match setup in the page table in hal_platform_extras.h
 #define SDRAM_PHYS_BASE                    0x00000000
 #define SDRAM_BASE                         0x00000000
-#define SDRAM_UNCACHED_BASE                0x10000000
+#define SDRAM_ALIAS_BASE                   0x10000000
+#define SDRAM_UNCACHED_BASE                0x20000000
+#define SDRAM_DC_BASE                      0x30000000
 #define SDRAM_SIZE                         0x10000000  // 256MB
 
-#define IXDP425_LED_DATA                   REG16(0, 0x52000000)
+#define IXDP425_LED_BASE                   0x52000000
+#define IXDP425_LED_SIZE                   0x00100000
+#define IXDP425_LED_DATA                   REG16(0, IXDP425_LED_BASE)
+
+#define IXDP_FLASH_BASE                    0x50000000
+#define IXDP_FLASH_SIZE                    0x01000000
+#define IXDP_FLASH_DC_BASE                 0xA0000000
 
 // CS0 (flash optimum timing)
 #define IXP425_EXP_CS0_INIT \
  (EXP_ADDR_T(3) | EXP_SETUP_T(3) | EXP_STROBE_T(15) | EXP_HOLD_T(3) | \
   EXP_RECOVERY_T(15) | EXP_SZ_16M | EXP_WR_EN | EXP_BYTE_RD16 | EXP_CS_EN)
Index: hal/arm/xscale/ixdp425/current/misc/redboot_RAM.ecm
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/xscale/ixdp425/current/misc/redboot_RAM.ecm,v
retrieving revision 1.2
diff -u -p -5 -r1.2 redboot_RAM.ecm
--- hal/arm/xscale/ixdp425/current/misc/redboot_RAM.ecm	2 Apr 2003 18:08:52 -0000	1.2
+++ hal/arm/xscale/ixdp425/current/misc/redboot_RAM.ecm	2 Sep 2004 20:12:51 -0000
@@ -22,10 +22,11 @@ cdl_configuration eCos {
     package -template CYGPKG_HAL current ;
     package -template CYGPKG_INFRA current ;
     package -template CYGPKG_REDBOOT current ;
     package -template CYGPKG_ISOINFRA current ;
     package -template CYGPKG_LIBC_STRING current ;
+    package -template CYGPKG_CRC current ;
     package CYGPKG_IO_FLASH current ;
     package CYGPKG_IO_ETH_DRIVERS current ;
     package CYGPKG_MEMALLOC current ;
     package CYGPKG_COMPRESS_ZLIB current ;
 };
@@ -112,8 +113,13 @@ cdl_option CYGBLD_ISO_STRING_STRFUNCS_HE
 
 cdl_option CYGPKG_HAL_GDB_FILEIO {
     user_value 1
 };
 
-cdl_option CYGOPT_DEVS_FLASH_STRATA_NOT_IN_RAM {
-   inferred_value 0
+cdl_option CYGHWR_REDBOOT_LINUX_EXEC_X_SWITCH {
+    user_value 1
 }
+ 
+cdl_option CYGHWR_HAL_ARM_BIGENDIAN {
+    user_value 1
+};
+
Index: hal/arm/xscale/ixdp425/current/misc/redboot_RAMLE.ecm
===================================================================
RCS file: hal/arm/xscale/ixdp425/current/misc/redboot_RAMLE.ecm
diff -N hal/arm/xscale/ixdp425/current/misc/redboot_RAMLE.ecm
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ hal/arm/xscale/ixdp425/current/misc/redboot_RAMLE.ecm	2 Sep 2004 20:12:51 -0000
@@ -0,0 +1,128 @@
+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    ixdp425 ;
+    template    redboot ;
+    package -hardware CYGPKG_HAL_ARM current ;
+    package -hardware CYGPKG_HAL_ARM_XSCALE_CORE current ;
+    package -hardware CYGPKG_HAL_ARM_XSCALE_IXP425 current ;
+    package -hardware CYGPKG_HAL_ARM_XSCALE_IXDP425 current ;
+    package -hardware CYGPKG_DEVS_FLASH_STRATA current ;
+    package -hardware CYGPKG_DEVS_FLASH_IXDP425 current ;
+    package -hardware CYGPKG_DEVS_ETH_INTEL_I82559 current ;
+    package -hardware CYGPKG_DEVS_ETH_ARM_IXDP425_I82559 current ;
+    package -template CYGPKG_HAL current ;
+    package -template CYGPKG_INFRA current ;
+    package -template CYGPKG_REDBOOT current ;
+    package -template CYGPKG_ISOINFRA current ;
+    package -template CYGPKG_LIBC_STRING current ;
+    package -template CYGPKG_CRC current ;
+    package CYGPKG_IO_FLASH current ;
+    package CYGPKG_IO_ETH_DRIVERS current ;
+    package CYGPKG_MEMALLOC current ;
+    package CYGPKG_COMPRESS_ZLIB current ;
+};
+
+cdl_component CYG_HAL_STARTUP {
+    user_value RAM
+};
+
+cdl_option CYGBLD_BUILD_GDB_STUBS {
+    user_value 0
+};
+
+cdl_option CYGFUN_LIBC_STRING_BSD_FUNCS {
+    inferred_value 0
+};
+
+cdl_option CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE {
+    user_value 4096
+};
+
+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_CTRLC_SUPPORT {
+    inferred_value 0
+};
+
+cdl_option CYGSEM_HAL_USE_ROM_MONITOR {
+    inferred_value 0 0
+};
+
+cdl_component CYGBLD_BUILD_REDBOOT {
+    user_value 1
+};
+
+cdl_option CYGBLD_REDBOOT_MIN_IMAGE_SIZE {
+    inferred_value 0x40000
+};
+
+cdl_component CYGSEM_REDBOOT_FLASH_CONFIG {
+    user_value 1
+};
+
+cdl_component CYGSEM_REDBOOT_BSP_SYSCALLS {
+    inferred_value 1
+};
+
+cdl_option CYGHWR_REDBOOT_ARM_LINUX_EXEC_ADDRESS_DEFAULT {
+    inferred_value 0x6000000
+};
+
+cdl_option CYGHWR_HAL_IXP425_PCI_NP_WORKAROUND {
+    inferred_value 1
+};
+
+cdl_option CYGBLD_ISO_STRTOK_R_HEADER {
+    inferred_value 1 <cyg/libc/string/string.h>
+};
+
+cdl_option CYGBLD_ISO_STRING_LOCALE_FUNCS_HEADER {
+    inferred_value 1 <cyg/libc/string/string.h>
+};
+
+cdl_option CYGBLD_ISO_STRING_BSD_FUNCS_HEADER {
+    inferred_value 1 <cyg/libc/string/bsdstring.h>
+};
+
+cdl_option CYGBLD_ISO_STRING_MEMFUNCS_HEADER {
+    inferred_value 1 <cyg/libc/string/string.h>
+};
+
+cdl_option CYGBLD_ISO_STRING_STRFUNCS_HEADER {
+    inferred_value 1 <cyg/libc/string/string.h>
+};
+
+cdl_option CYGPKG_HAL_GDB_FILEIO {
+    user_value 1
+};
+
+cdl_option CYGHWR_REDBOOT_LINUX_EXEC_X_SWITCH {
+    user_value 1
+}
+ 
+cdl_option CYGHWR_HAL_ARM_BIGENDIAN {
+    user_value 0
+};
+
+cdl_option CYGOPT_REDBOOT_FLASH_BYTEORDER {
+    user_value MSBFIRST
+}
Index: hal/arm/xscale/ixdp425/current/misc/redboot_ROM.ecm
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/xscale/ixdp425/current/misc/redboot_ROM.ecm,v
retrieving revision 1.2
diff -u -p -5 -r1.2 redboot_ROM.ecm
--- hal/arm/xscale/ixdp425/current/misc/redboot_ROM.ecm	2 Apr 2003 18:08:52 -0000	1.2
+++ hal/arm/xscale/ixdp425/current/misc/redboot_ROM.ecm	2 Sep 2004 20:12:51 -0000
@@ -22,10 +22,11 @@ cdl_configuration eCos {
     package -template CYGPKG_HAL current ;
     package -template CYGPKG_INFRA current ;
     package -template CYGPKG_REDBOOT current ;
     package -template CYGPKG_ISOINFRA current ;
     package -template CYGPKG_LIBC_STRING current ;
+    package -template CYGPKG_CRC current ;
     package CYGPKG_IO_FLASH current ;
     package CYGPKG_IO_ETH_DRIVERS current ;
     package CYGPKG_MEMALLOC current ;
     package CYGPKG_COMPRESS_ZLIB current ;
 };
@@ -120,6 +121,14 @@ cdl_option CYGBLD_ISO_DNS_HEADER {
 
 cdl_option CYGPKG_HAL_GDB_FILEIO {
     user_value 1
 };
 
+cdl_option CYGHWR_REDBOOT_LINUX_EXEC_X_SWITCH {
+    user_value 1
+}
+ 
+cdl_option CYGHWR_HAL_ARM_BIGENDIAN {
+    user_value 1
+};
+
 
Index: hal/arm/xscale/ixdp425/current/misc/redboot_ROMLE.ecm
===================================================================
RCS file: hal/arm/xscale/ixdp425/current/misc/redboot_ROMLE.ecm
diff -N hal/arm/xscale/ixdp425/current/misc/redboot_ROMLE.ecm
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ hal/arm/xscale/ixdp425/current/misc/redboot_ROMLE.ecm	2 Sep 2004 20:12:51 -0000
@@ -0,0 +1,136 @@
+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    ixdp425 ;
+    template    redboot ;
+    package -hardware CYGPKG_HAL_ARM current ;
+    package -hardware CYGPKG_HAL_ARM_XSCALE_CORE current ;
+    package -hardware CYGPKG_HAL_ARM_XSCALE_IXP425 current ;
+    package -hardware CYGPKG_HAL_ARM_XSCALE_IXDP425 current ;
+    package -hardware CYGPKG_DEVS_FLASH_STRATA current ;
+    package -hardware CYGPKG_DEVS_FLASH_IXDP425 current ;
+    package -hardware CYGPKG_DEVS_ETH_INTEL_I82559 current ;
+    package -hardware CYGPKG_DEVS_ETH_ARM_IXDP425_I82559 current ;
+    package -template CYGPKG_HAL current ;
+    package -template CYGPKG_INFRA current ;
+    package -template CYGPKG_REDBOOT current ;
+    package -template CYGPKG_ISOINFRA current ;
+    package -template CYGPKG_LIBC_STRING current ;
+    package -template CYGPKG_CRC current ;
+    package CYGPKG_IO_FLASH current ;
+    package CYGPKG_IO_ETH_DRIVERS current ;
+    package CYGPKG_MEMALLOC current ;
+    package CYGPKG_COMPRESS_ZLIB current ;
+};
+
+cdl_component CYG_HAL_STARTUP {
+    user_value ROM
+};
+
+cdl_option CYGBLD_BUILD_GDB_STUBS {
+    user_value 0
+};
+
+cdl_option CYGFUN_LIBC_STRING_BSD_FUNCS {
+    inferred_value 0
+};
+
+cdl_option CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE {
+    user_value 4096
+};
+
+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_CTRLC_SUPPORT {
+    inferred_value 0
+};
+
+cdl_option CYGSEM_HAL_ROM_MONITOR {
+    user_value 1
+};
+
+cdl_option CYGSEM_HAL_USE_ROM_MONITOR {
+    inferred_value 0 0
+};
+
+cdl_component CYGBLD_BUILD_REDBOOT {
+    user_value 1
+};
+
+cdl_option CYGBLD_REDBOOT_MIN_IMAGE_SIZE {
+    inferred_value 0x40000
+};
+
+cdl_component CYGSEM_REDBOOT_FLASH_CONFIG {
+    user_value 1
+};
+
+cdl_component CYGSEM_REDBOOT_BSP_SYSCALLS {
+   inferred_value 1
+};
+
+cdl_option CYGHWR_REDBOOT_ARM_LINUX_EXEC_ADDRESS_DEFAULT {
+    inferred_value 0x6000000
+};
+
+cdl_option CYGHWR_HAL_IXP425_PCI_NP_WORKAROUND {
+    inferred_value 1
+};
+
+cdl_option CYGBLD_ISO_STRTOK_R_HEADER {
+    inferred_value 1 <cyg/libc/string/string.h>
+};
+
+cdl_option CYGBLD_ISO_STRING_LOCALE_FUNCS_HEADER {
+    inferred_value 1 <cyg/libc/string/string.h>
+};
+
+cdl_option CYGBLD_ISO_STRING_BSD_FUNCS_HEADER {
+    inferred_value 1 <cyg/libc/string/bsdstring.h>
+};
+
+cdl_option CYGBLD_ISO_STRING_MEMFUNCS_HEADER {
+    inferred_value 1 <cyg/libc/string/string.h>
+};
+
+cdl_option CYGBLD_ISO_STRING_STRFUNCS_HEADER {
+    inferred_value 1 <cyg/libc/string/string.h>
+};
+
+cdl_option CYGBLD_ISO_DNS_HEADER {
+    inferred_value 1 <cyg/ns/dns/dns.h>
+};
+
+cdl_option CYGPKG_HAL_GDB_FILEIO {
+    user_value 1
+};
+
+cdl_option CYGHWR_REDBOOT_LINUX_EXEC_X_SWITCH {
+    user_value 1
+}
+ 
+cdl_option CYGHWR_HAL_ARM_BIGENDIAN {
+    user_value 0
+};
+
+cdl_option CYGOPT_REDBOOT_FLASH_BYTEORDER {
+    user_value MSBFIRST
+}
Index: hal/arm/xscale/ixdp425/current/src/ixdp425_pci.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/xscale/ixdp425/current/src/ixdp425_pci.c,v
retrieving revision 1.1
diff -u -p -5 -r1.1 ixdp425_pci.c
--- hal/arm/xscale/ixdp425/current/src/ixdp425_pci.c	18 Mar 2003 13:10:04 -0000	1.1
+++ hal/arm/xscale/ixdp425/current/src/ixdp425_pci.c	2 Sep 2004 20:12:51 -0000
@@ -6,11 +6,11 @@
 //
 //==========================================================================
 //####ECOSGPLCOPYRIGHTBEGIN####
 // -------------------------------------------
 // This file is part of eCos, the Embedded Configurable Operating System.
-// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004 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.
 //
@@ -61,14 +61,14 @@
 #include <cyg/hal/hal_if.h>             // calling interface API
 #include <cyg/hal/hal_arch.h>           // Register state info
 #include <cyg/hal/hal_diag.h>
 #include <cyg/hal/hal_intr.h>           // Interrupt names
 #include <cyg/hal/hal_cache.h>
-#include <cyg/io/pci_hw.h>
-#include <cyg/io/pci.h>
 
 #ifdef CYGPKG_IO_PCI
+#include <cyg/io/pci_hw.h>
+#include <cyg/io/pci.h>
 
 #define IXP425_PCI_MAX_DEV      4
 #define IXP425_PCI_IRQ_LINES    4
 
 // PCI pin mappings
Index: hal/arm/xscale/ixp425/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/xscale/ixp425/current/ChangeLog,v
retrieving revision 1.6
diff -u -p -5 -r1.6 ChangeLog
--- hal/arm/xscale/ixp425/current/ChangeLog	5 Dec 2003 09:56:58 -0000	1.6
+++ hal/arm/xscale/ixp425/current/ChangeLog	2 Sep 2004 20:12:51 -0000
@@ -1,5 +1,13 @@
+2004-09-02  Mark Salter  <msalter@redhat.com>
+
+	* include/var_io.h: Add externs for hal_flash_{read,program}.
+	* include/hal_ixp425.h: Add more register related defines.
+	* cdl/hal_arm_xscale_ixp425.cdl: Add little-endian support.
+	* src/ixp425_pci.c: Ditto.
+	* src/ixp425_redboot.c: New file.
+
 2003-12-05  David Vrabel  <dvrabel@arcom.com>
 
 	* include/hal_diag.h: hal_delay_us() is a C function.
 
 2003-07-18  Nick Garnett  <nickg@balti.calivar.com>
Index: hal/arm/xscale/ixp425/current/cdl/hal_arm_xscale_ixp425.cdl
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/xscale/ixp425/current/cdl/hal_arm_xscale_ixp425.cdl,v
retrieving revision 1.2
diff -u -p -5 -r1.2 hal_arm_xscale_ixp425.cdl
--- hal/arm/xscale/ixp425/current/cdl/hal_arm_xscale_ixp425.cdl	24 Jul 2003 20:24:00 -0000	1.2
+++ hal/arm/xscale/ixp425/current/cdl/hal_arm_xscale_ixp425.cdl	2 Sep 2004 20:12:51 -0000
@@ -63,11 +63,11 @@ cdl_package CYGPKG_HAL_ARM_XSCALE_IXP425
         for the Intel IXP425 network processors. It is also
         necessary to select a specific target platform HAL
         package."
 
     # Let the architectural HAL see this variant's interrupts file
-     define_proc {
+    define_proc {
         puts $::cdl_header \
        "#define CYGBLD_HAL_VAR_INTS_H <cyg/hal/hal_var_ints.h>"
         puts $::cdl_header \
        "#define CYGBLD_HAL_VAR_H <cyg/hal/hal_ixp425.h>"
 
@@ -196,13 +196,16 @@ cdl_package CYGPKG_HAL_ARM_XSCALE_IXP425
         parent        CYGPKG_REDBOOT
         active_if     CYGPKG_REDBOOT
         description   "
             This option lists the target's requirements for a valid Redboot
             configuration."
+	compile -library=libextras.a ixp425_redboot.c
 
         # RedBoot details
         requires { CYGHWR_REDBOOT_ARM_LINUX_EXEC_ADDRESS_DEFAULT != 0 }
         define_proc {
             puts $::cdl_header "#define CYGHWR_REDBOOT_ARM_TRAMPOLINE_ADDRESS 0x00001f00"
+            puts $::cdl_header "#define HAL_FLASH_READ(a,b,c,d) hal_flash_read((a),(b),(c),(d))"
+            puts $::cdl_header "#define HAL_FLASH_PROGRAM(a,b,c,d) hal_flash_program((a),(b),(c),(d))"
         }
     }
 }
Index: hal/arm/xscale/ixp425/current/include/hal_ixp425.h
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/xscale/ixp425/current/include/hal_ixp425.h,v
retrieving revision 1.2
diff -u -p -5 -r1.2 hal_ixp425.h
--- hal/arm/xscale/ixp425/current/include/hal_ixp425.h	8 Apr 2003 17:16:56 -0000	1.2
+++ hal/arm/xscale/ixp425/current/include/hal_ixp425.h	2 Sep 2004 20:12:51 -0000
@@ -6,11 +6,11 @@
 //
 //=============================================================================
 //####ECOSGPLCOPYRIGHTBEGIN####
 // -------------------------------------------
 // This file is part of eCos, the Embedded Configurable Operating System.
-// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Red Hat, Inc.
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 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.
 //
@@ -55,12 +55,23 @@
 
 #include <pkgconf/system.h>
 #include <cyg/hal/hal_xscale.h>
 
 // --------------------------------------------------------------------------
+#define IXP425_PCI_WINDOW_BASE     0x48000000
+#define IXP425_PCI_WINDOW_SIZE     0x04000000
+
+#define IXP425_QMGR_BASE           0x60000000
+#define IXP425_QMGR_SIZE           0x04000000
+
+#define IXP425_MISC_CFG_BASE       0xC8000000
+#define IXP425_MISC_CFG_SIZE       0x00100000
+
+// --------------------------------------------------------------------------
 // PCI Registers  (Chapter 6)
 #define IXP425_PCI_CFG_BASE        0xC0000000
+#define IXP425_PCI_CFG_SIZE        0x00100000
 #define IXP425_PCI_NP_AD           REG32(IXP425_PCI_CFG_BASE,0x00)
 #define IXP425_PCI_NP_CBE          REG32(IXP425_PCI_CFG_BASE,0x04)
 #define IXP425_PCI_NP_WDATA        REG32(IXP425_PCI_CFG_BASE,0x08)
 #define IXP425_PCI_NP_RDATA        REG32(IXP425_PCI_CFG_BASE,0x0C)
 #define IXP425_PCI_CRP_AD_CPE      REG32(IXP425_PCI_CFG_BASE,0x10)
@@ -132,10 +143,11 @@
 #define PCI_INTEN_PDB              (1 << 7)
 
 // --------------------------------------------------------------------------
 // SDRAM Registers  (Chapter 7)
 #define IXP425_SDRAM_CFG_BASE      0xCC000000
+#define IXP425_SDRAM_CFG_SIZE      0x00100000
 #define IXP425_SDRAM_CONFIG        REG32(IXP425_SDRAM_CFG_BASE,0x00)
 #define IXP425_SDRAM_REFRESH       REG32(IXP425_SDRAM_CFG_BASE,0x04)
 #define IXP425_SDRAM_IR            REG32(IXP425_SDRAM_CFG_BASE,0x08)
 
 // SDRAM_CONFIG bits
@@ -158,10 +170,13 @@
 #define SDRAM_IR_NORMAL            6
 
 // --------------------------------------------------------------------------
 // Expansion Bus Register (Chapter 9)
 #define IXP425_EXP_CFG_BASE	   0xC4000000
+#define IXP425_EXP_CFG_SIZE	   0x00100000
+#define IXP425_EXP_CS_BASE         0x50000000
+#define IXP425_EXP_CS_SIZE         0x01000000
 #define IXP425_EXP_CS0             REG32(IXP425_EXP_CFG_BASE,0x00)
 #define IXP425_EXP_CS1             REG32(IXP425_EXP_CFG_BASE,0x04)
 #define IXP425_EXP_CS2             REG32(IXP425_EXP_CFG_BASE,0x08)
 #define IXP425_EXP_CS3             REG32(IXP425_EXP_CFG_BASE,0x0C)
 #define IXP425_EXP_CS4             REG32(IXP425_EXP_CFG_BASE,0x10)
@@ -219,10 +234,11 @@
 #define EXP_CNFG0_MEM_MAP          (1 << 31)
 
 // EXP_CNFG1 bits
 #define EXP_CNFG1_SW_INT0          (1 << 0)
 #define EXP_CNFG1_SW_INT1          (1 << 1)
+#define EXP_CNFG1_BYTE_SWAP_EN     (1 << 8)
 
 
 // --------------------------------------------------------------------------
 // GPIO (Chapter 13)
 #define IXP425_GPIO_CFG_BASE       0xC8004000
Index: hal/arm/xscale/ixp425/current/include/var_io.h
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/xscale/ixp425/current/include/var_io.h,v
retrieving revision 1.1
diff -u -p -5 -r1.1 var_io.h
--- hal/arm/xscale/ixp425/current/include/var_io.h	18 Mar 2003 13:10:04 -0000	1.1
+++ hal/arm/xscale/ixp425/current/include/var_io.h	2 Sep 2004 20:12:51 -0000
@@ -9,11 +9,11 @@
 //
 //=============================================================================
 //####ECOSGPLCOPYRIGHTBEGIN####
 // -------------------------------------------
 // This file is part of eCos, the Embedded Configurable Operating System.
-// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Red Hat, Inc.
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 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.
 //
@@ -227,8 +227,14 @@ extern void cyg_hal_plf_pci_translate_in
         (*((volatile CYG_WORD32 *)(_reg_)) = (_value_));           \
     CYG_MACRO_END
 
 #define HAL_IO_MACROS_DEFINED
 
+//-----------------------------------------------------------------------------
+// HAL flash functions.
+// These perform special operations between RedBoot and the flash driver.
+
+externC int hal_flash_read(void *addr, void *data, int len, void **err);
+externC int hal_flash_program(void *addr, void *data, int len, void **err);
 
 #endif // CYGONCE_HAL_ARM_IXP425_VAR_IO_H
 // EOF var_io.h
Index: hal/arm/xscale/ixp425/current/src/ixp425_pci.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/xscale/ixp425/current/src/ixp425_pci.c,v
retrieving revision 1.2
diff -u -p -5 -r1.2 ixp425_pci.c
--- hal/arm/xscale/ixp425/current/src/ixp425_pci.c	6 Apr 2003 23:19:40 -0000	1.2
+++ hal/arm/xscale/ixp425/current/src/ixp425_pci.c	2 Sep 2004 20:12:51 -0000
@@ -387,10 +387,15 @@ cyg_hal_plf_pci_io_inl(cyg_uint32 offset
     cyg_uint32 cmd = pci_config(0, 0, offset, PCI_NP_CMD_IOR, 4);
 
     return pci_np_read(cmd);
 }
 
+#ifdef CYGHWR_HAL_ARM_BIGENDIAN
+#define CSR_ENDIAN_BITS  (PCI_CSR_PDS | PCI_CSR_ABE | PCI_CSR_ADS)
+#else
+#define CSR_ENDIAN_BITS  (PCI_CSR_ABE | PCI_CSR_ADS)
+#endif
 
 void
 cyg_hal_plf_pci_init(void)
 {  
     static int inited = 0;
@@ -438,11 +443,11 @@ cyg_hal_plf_pci_init(void)
 	//
 	// Set Initialize Complete in PCI Control Register: allow IXP425 to
 	// respond to PCI configuration cycles. Specify that the AHB bus is
 	// operating in big endian mode. Set up byte lane swapping between 
 	// little-endian PCI and the big-endian AHB bus 
-	*IXP425_PCI_CSR = PCI_CSR_IC | PCI_CSR_ABE | PCI_CSR_PDS | PCI_CSR_ADS;
+	*IXP425_PCI_CSR = PCI_CSR_IC | CSR_ENDIAN_BITS;
     
 	HAL_PCI_CFG_WRITE_UINT16(0, 0, CYG_PCI_CFG_COMMAND,
 		 CYG_PCI_CFG_COMMAND_MASTER | CYG_PCI_CFG_COMMAND_MEMORY);
     } else {
 	//
Index: hal/arm/xscale/ixp425/current/src/ixp425_redboot.c
===================================================================
RCS file: hal/arm/xscale/ixp425/current/src/ixp425_redboot.c
diff -N hal/arm/xscale/ixp425/current/src/ixp425_redboot.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ hal/arm/xscale/ixp425/current/src/ixp425_redboot.c	2 Sep 2004 20:12:51 -0000
@@ -0,0 +1,145 @@
+//==========================================================================
+//
+//      ixp425_redboot.c
+//
+//      RedBoot board support code for Intel IXP425 Network Processor
+//
+//==========================================================================
+//####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 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:         2004-08-30
+// Purpose:      RedBoot board-specific support
+// Description:  Implementations of board-specic RedBoot support.
+//
+//####DESCRIPTIONEND####
+//
+//========================================================================*/
+
+#include <redboot.h>
+#include <cyg/io/flash.h>
+
+#ifdef CYGOPT_REDBOOT_FIS
+extern void *fis_addr;
+#endif
+
+#ifdef CYGSEM_REDBOOT_FLASH_CONFIG
+extern void *cfg_base;
+#endif
+
+//
+// Little endian mode requires some trickery due to the way the IXP4xx
+// AHB and expansion busses work.
+//
+int
+hal_flash_read(void *addr, void *data, int len, void **err)
+{
+    int retval;
+
+    retval = flash_read(addr, data, len, err);
+
+    if (0
+#if (CYG_BYTEORDER == CYG_LSBFIRST) && defined(CYGOPT_REDBOOT_FLASH_BYTEORDER_MSBFIRST)
+#ifdef CYGOPT_REDBOOT_FIS
+	|| addr == fis_addr
+#endif
+#ifdef CYGSEM_REDBOOT_FLASH_CONFIG
+	|| addr == cfg_base
+#endif
+#endif
+	) {
+	cyg_uint32 *p;
+	int i;
+
+	for (i = 0, p = data; i < len; i += 4, ++p)
+	    *p = CYG_SWAP32(*p);
+    }
+    return retval;
+}
+
+// Try to figure out if RedBoot is re-flashing a RedBoot with
+// a different endianess. This is obviously not foolproof, but
+// should be good enough.
+static inline int
+is_swabbed_redboot(void *faddr, cyg_uint32 *p)
+{
+    if (faddr == (void *)0x50000000
+	    && (CYG_SWAP32(p[1]) == 0xe59ff018)
+	    && (CYG_SWAP32(p[2]) == 0xe59ff018)
+	    && (CYG_SWAP32(p[3]) == 0xe59ff018)
+	    && (CYG_SWAP32(p[4]) == 0xe59ff018)
+	    && (p[5] == 0))
+	return 1;
+    return 0;
+}
+
+int
+hal_flash_program(void *addr, void *data, int len, void **err)
+{
+    int swabbed = 0;
+    cyg_uint32 *p;
+    int i, retval;
+
+    if (is_swabbed_redboot(addr, data)
+#if (CYG_BYTEORDER == CYG_LSBFIRST) && defined(CYGOPT_REDBOOT_FLASH_BYTEORDER_MSBFIRST)
+#ifdef CYGOPT_REDBOOT_FIS
+	|| addr == fis_addr
+#endif
+#ifdef CYGSEM_REDBOOT_FLASH_CONFIG
+	|| addr == cfg_base
+#endif
+#endif
+	) {
+	swabbed = 1;
+	for (i = 0, p = data; i < len; i += 4, ++p)
+	    *p = CYG_SWAP32(*p);
+    }
+
+    retval = flash_program(addr, data, len, err);
+
+    if (swabbed) {
+	for (i = 0, p = data; i < len; i += 4, ++p)
+	    *p = CYG_SWAP32(*p);
+    }
+
+    return retval;
+}
+
+
+/*------------------------------------------------------------------------*/
+// EOF ixp425_redboot.c
+
Index: hal/arm/xscale/prpmc1100/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/xscale/prpmc1100/current/ChangeLog,v
retrieving revision 1.2
diff -u -p -5 -r1.2 ChangeLog
--- hal/arm/xscale/prpmc1100/current/ChangeLog	30 Jun 2003 13:07:08 -0000	1.2
+++ hal/arm/xscale/prpmc1100/current/ChangeLog	2 Sep 2004 20:12:52 -0000
@@ -1,5 +1,9 @@
+2004-09-02  Mark Salter  <msalter@redhat.com>
+
+	* misc/redboot_RAM.ecm: Remove CYGOPT_DEVS_FLASH_STRATA_NOT_IN_RAM.
+
 2003-06-30  Mark Salter  <msalter@redhat.com>
 
 	* include/hal_platform_setup.h: Fix CYGINT_HAL_ARM_BIGENDIAN test.
 	Remove unused ROMRAM cruft.
 
@@ -11,11 +15,11 @@
 
 //===========================================================================
 //####ECOSGPLCOPYRIGHTBEGIN####
 // -------------------------------------------
 // This file is part of eCos, the Embedded Configurable Operating System.
-// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Red Hat, Inc.
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 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.
 //
Index: hal/arm/xscale/prpmc1100/current/misc/redboot_RAM.ecm
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/xscale/prpmc1100/current/misc/redboot_RAM.ecm,v
retrieving revision 1.1
diff -u -p -5 -r1.1 redboot_RAM.ecm
--- hal/arm/xscale/prpmc1100/current/misc/redboot_RAM.ecm	5 Jun 2003 13:21:26 -0000	1.1
+++ hal/arm/xscale/prpmc1100/current/misc/redboot_RAM.ecm	2 Sep 2004 20:12:52 -0000
@@ -110,8 +110,5 @@ cdl_option CYGBLD_ISO_STRING_STRFUNCS_HE
 
 cdl_option CYGPKG_HAL_GDB_FILEIO {
     user_value 1
 };
 
-cdl_option CYGOPT_DEVS_FLASH_STRATA_NOT_IN_RAM {
-   inferred_value 0
-};


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