changeset 580:d13814ac7bd2

Adding Linux bootstrap to EDB7312. Minor tweak to common code required.
author gthomas
date Fri, 07 Feb 2003 00:25:01 +0000
parents aa8519b22eb0
children e2b797ca39b4
files packages/hal/arm/arch/current/ChangeLog packages/hal/arm/arch/current/src/redboot_linux_exec.c packages/hal/arm/edb7xxx/current/ChangeLog packages/hal/arm/edb7xxx/current/cdl/hal_arm_edb7xxx.cdl packages/hal/arm/edb7xxx/current/include/hal_platform_setup.h packages/hal/arm/edb7xxx/current/include/plf_io.h packages/hal/arm/edb7xxx/current/misc/edb7312_redboot_ROMRAM.ecm packages/hal/arm/edb7xxx/current/src/edb7xxx_misc.c
diffstat 8 files changed, 63 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/packages/hal/arm/arch/current/ChangeLog
+++ b/packages/hal/arm/arch/current/ChangeLog
@@ -1,3 +1,7 @@
+2003-02-06  Gary Thomas  <gary@mlbassoc.com>
+
+	* src/redboot_linux_exec.c: Make sure RAM description is sane.
+
 2003-01-31  Mark Salter  <msalter@redhat.com>
 
 	* src/hal_syscall.c (hal_syscall_handler): Let generic syscall code
--- a/packages/hal/arm/arch/current/src/redboot_linux_exec.c
+++ b/packages/hal/arm/arch/current/src/redboot_linux_exec.c
@@ -9,6 +9,7 @@
 // -------------------------------------------
 // This file is part of eCos, the Embedded Configurable Operating System.
 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
+// Copyright (C) 2003 Gary Thomas
 //
 // 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
@@ -306,13 +307,15 @@ do_exec(int argc, char *argv[])
     /* Next ATAG_MEM. */
     params->hdr.size = (sizeof(struct tag_mem32) + sizeof(struct tag_header))/sizeof(long);
     params->hdr.tag = ATAG_MEM;
-    params->u.mem.start = CYGARC_PHYSICAL_ADDRESS(CYGMEM_REGION_ram);
     /* Round up so there's only one bit set in the memory size.
      * Don't double it if it's already a power of two, though.
      */
     params->u.mem.size  = 1<<hal_msbindex(CYGMEM_REGION_ram_SIZE);
     if (params->u.mem.size < CYGMEM_REGION_ram_SIZE)
 	    params->u.mem.size <<= 1;
+    params->u.mem.start = CYGARC_PHYSICAL_ADDRESS(CYGMEM_REGION_ram);
+    // Linux doesn't like physical RAM to start on odd boundary 
+    params->u.mem.start &= ~(params->u.mem.size-1);
     params = (struct tag *)((long *)params + params->hdr.size);
     if (ramdisk_addr_set) {
         params->hdr.size = (sizeof(struct tag_initrd) + sizeof(struct tag_header))/sizeof(long);
--- a/packages/hal/arm/edb7xxx/current/ChangeLog
+++ b/packages/hal/arm/edb7xxx/current/ChangeLog
@@ -1,3 +1,12 @@
+2003-02-06  Gary Thomas  <gary@mind.be>
+
+	* misc/edb7312_redboot_ROMRAM.ecm: 
+	* src/edb7xxx_misc.c: 
+	* include/plf_io.h: 
+	* include/hal_platform_setup.h: 
+	* cdl/hal_arm_edb7xxx.cdl: Add support for booting Linux by defining
+	CYGARC_PHYSICAL_ADDRESS().
+
 2002-12-06  Gary Thomas  <gthomas@ecoscentric.com>
 
 	* misc/edb7312_redboot_ROMRAM.ecm: 
--- a/packages/hal/arm/edb7xxx/current/cdl/hal_arm_edb7xxx.cdl
+++ b/packages/hal/arm/edb7xxx/current/cdl/hal_arm_edb7xxx.cdl
@@ -9,6 +9,7 @@
 ## -------------------------------------------
 ## This file is part of eCos, the Embedded Configurable Operating System.
 ## Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
+## Copyright (C) 2003 Gary Thomas <gary@mind.be>
 ##
 ## 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
@@ -70,8 +71,12 @@ CL-PS7111 and EP7xxx based development b
     define_proc {
         puts $::cdl_system_header "#define CYGBLD_HAL_TARGET_H   <pkgconf/hal_arm.h>"
         puts $::cdl_system_header "#define CYGBLD_HAL_PLATFORM_H <pkgconf/hal_arm_edb7xxx.h>"
+        puts $::cdl_header "#define HAL_PLATFORM_MACHINE_TYPE  131"
+        puts $::cdl_header "#define CYGHWR_REDBOOT_ARM_TRAMPOLINE_ADDRESS 0x00001f00"
     }
 
+    requires { CYGHWR_REDBOOT_ARM_LINUX_EXEC_ADDRESS_DEFAULT == 0xC0038000 }
+
     cdl_option CYGHWR_HAL_ARM_EDB7XXX_VARIANT {
         display       "Cirrus Logic processor variant"
         flavor        data
--- a/packages/hal/arm/edb7xxx/current/include/hal_platform_setup.h
+++ b/packages/hal/arm/edb7xxx/current/include/hal_platform_setup.h
@@ -12,6 +12,7 @@
 // -------------------------------------------
 // This file is part of eCos, the Embedded Configurable Operating System.
 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
+// Copyright (C) 2003 Gary Thomas <gary@mind.be>
 //
 // 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
@@ -123,7 +124,7 @@
 #define IO_LA_END        0x8000f000
 #define IO_PA            0x80000000
 
-
+#ifndef _CYGHWR_LAYOUT_ONLY
 // Define startup code [macros]
 #if defined(CYGSEM_HAL_INSTALL_MMU_TABLES)
 
@@ -553,6 +554,7 @@ 20:	str	r5,[r1],#4
 
 #define PLATFORM_SETUP1
 #endif
+#endif //_CYGHWR_LAYOUT_ONLY
 
 /*---------------------------------------------------------------------------*/
 /* end of hal_platform_setup.h                                               */
--- a/packages/hal/arm/edb7xxx/current/include/plf_io.h
+++ b/packages/hal/arm/edb7xxx/current/include/plf_io.h
@@ -12,6 +12,7 @@
 // -------------------------------------------
 // This file is part of eCos, the Embedded Configurable Operating System.
 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
+// Copyright (C) 2003 Gary Thomas <gary@mind.be>
 //
 // 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
@@ -54,7 +55,13 @@
 //
 //===========================================================================*/
 
+#include <pkgconf/hal.h>
+#include <pkgconf/system.h>
+#include CYGBLD_HAL_PLATFORM_H
 #include <cyg/hal/hal_edb7xxx.h>
 
+extern unsigned long _edb7xxx_physical_address(unsigned long addr);
+#define CYGARC_PHYSICAL_ADDRESS(x) _edb7xxx_physical_address((unsigned long) x)
+
 #endif // CYGONCE_HAL_ARM_EDB7XXX_PLF_IO_H
 // EOF plf_io.h
--- a/packages/hal/arm/edb7xxx/current/misc/edb7312_redboot_ROMRAM.ecm
+++ b/packages/hal/arm/edb7xxx/current/misc/edb7312_redboot_ROMRAM.ecm
@@ -17,13 +17,14 @@ cdl_configuration eCos {
     package -hardware CYGPKG_DEVS_ETH_CL_CS8900A current ;
     package -hardware CYGPKG_IO_SERIAL_ARM_EDB7XXX current ;
     package -hardware CYGPKG_DEVS_FLASH_EDB7XXX current ;
-    package -hardware CYGPKG_DEVS_FLASH_STRATA 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_NS_DNS current ;
+    package -template CYGPKG_CRC current ;
+    package -hardware CYGPKG_DEVS_FLASH_STRATA current ;
     package CYGPKG_IO_FLASH current ;
     package CYGPKG_IO_ETH_DRIVERS current ;
     package CYGPKG_COMPRESS_ZLIB current ;
@@ -73,10 +74,22 @@ cdl_component CYGBLD_BUILD_REDBOOT {
     user_value 1
 };
 
+cdl_option CYGBLD_BUILD_REDBOOT_WITH_EXEC {
+    user_value 1
+};
+
 cdl_option CYGBLD_REDBOOT_MIN_IMAGE_SIZE {
     user_value 0x00040000
 };
 
+cdl_option CYGSEM_REDBOOT_FLASH_COMBINED_FIS_AND_CONFIG {
+    user_value 1
+};
+
+cdl_option CYGHWR_REDBOOT_ARM_LINUX_EXEC_ADDRESS_DEFAULT {
+    inferred_value 0xC0038000
+};
+
 cdl_option CYGBLD_ISO_STRTOK_R_HEADER {
     inferred_value 1 <cyg/libc/string/string.h>
 };
@@ -106,7 +119,3 @@ cdl_option CYGPKG_NS_DNS_BUILD {
 };
 
 
-cdl_option CYGBLD_BUILD_REDBOOT_WITH_EXEC {
-    user_value 0
-};
-
--- a/packages/hal/arm/edb7xxx/current/src/edb7xxx_misc.c
+++ b/packages/hal/arm/edb7xxx/current/src/edb7xxx_misc.c
@@ -9,6 +9,7 @@
 // -------------------------------------------
 // This file is part of eCos, the Embedded Configurable Operating System.
 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
+// Copyright (C) 2003 Gary Thomas <gary@mind.be>
 //
 // 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
@@ -559,5 +560,21 @@ void hal_interrupt_set_level(int vector,
     // No interrupts are configurable on this hardware
 }
 
+#define _CYGHWR_LAYOUT_ONLY
+#include <cyg/hal/hal_platform_setup.h>
+
+unsigned long
+_edb7xxx_physical_address(unsigned long addr)
+{
+    unsigned long res;
+
+    if (addr < DRAM_LA_END) {
+        res = addr + DRAM_PA;
+    } else {
+        res = addr | 0xC0000000;
+    }
+    return res;
+}
+
 /*------------------------------------------------------------------------*/
 // EOF hal_misc.c