This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
ARM - Platform specific memory layout
- From: Gary Thomas <gary at mlbassoc dot com>
- To: eCos patches <ecos-patches at sources dot redhat dot com>
- Cc: Robin Farine <robin dot farine at acn-group dot ch>
- Date: 12 Feb 2003 14:06:57 -0700
- Subject: ARM - Platform specific memory layout
Index: hal/arm/arch/current/ChangeLog
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/hal/arm/arch/current/ChangeLog,v
retrieving revision 1.82
diff -u -5 -p -r1.82 ChangeLog
--- hal/arm/arch/current/ChangeLog 7 Feb 2003 00:25:01 -0000 1.82
+++ hal/arm/arch/current/ChangeLog 12 Feb 2003 21:04:40 -0000
@@ -1,5 +1,10 @@
+2003-02-12 Gary Thomas <gary@mlbassoc.com> inspired by
+2003-02-12 Robin Farine <robin.farine@acn-group.ch>
+
+ * src/redboot_linux_exec.c: Allow platform to override memory layout.
+ Also, give error if no "-b" option and base/load address unknown.
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>
Index: hal/arm/arch/current/src/redboot_linux_exec.c
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/hal/arm/arch/current/src/redboot_linux_exec.c,v
retrieving revision 1.6
diff -u -5 -p -r1.6 redboot_linux_exec.c
--- hal/arm/arch/current/src/redboot_linux_exec.c 7 Feb 2003 00:25:01 -0000 1.6
+++ hal/arm/arch/current/src/redboot_linux_exec.c 12 Feb 2003 20:56:25 -0000
@@ -246,10 +246,27 @@ struct tag {
};
// End of inclusion from <asm-arm/setup.h>
//=========================================================================
+// Default memory layout - can be overridden by platform, typically in
+// <cyg/hal/plf_io.h>
+#ifndef CYGHWR_REDBOOT_LINUX_ATAG_MEM
+#define CYGHWR_REDBOOT_LINUX_ATAG_MEM(_p_) \
+ /* Next ATAG_MEM. */ \
+ _p_->hdr.size = (sizeof(struct tag_mem32) + sizeof(struct tag_header))/sizeof(long); \
+ _p_->hdr.tag = ATAG_MEM; \
+ /* 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. \
+ */ \
+ _p_->u.mem.size = 1<<hal_msbindex(CYGMEM_REGION_ram_SIZE); \
+ if (_p_->u.mem.size < CYGMEM_REGION_ram_SIZE) \
+ _p_->u.mem.size <<= 1; \
+ _p_->u.mem.start = CYGARC_PHYSICAL_ADDRESS(CYGMEM_REGION_ram);
+#endif
+
+
// Round up a quantity to a longword (32 bit) length
#define ROUNDUP(n) (((n)+3)&~3)
static void
do_exec(int argc, char *argv[])
@@ -302,22 +319,11 @@ do_exec(int argc, char *argv[])
params->u.core.flags = 0;
params->u.core.pagesize = 0;
params->u.core.rootdev = 0;
params = (struct tag *)((long *)params + params->hdr.size);
- /* Next ATAG_MEM. */
- params->hdr.size = (sizeof(struct tag_mem32) + sizeof(struct tag_header))/sizeof(long);
- params->hdr.tag = ATAG_MEM;
- /* 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);
+ CYGHWR_REDBOOT_LINUX_ATAG_MEM(params)
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);
params->hdr.tag = ATAG_INITRD2;
params->u.initrd.start = CYGARC_PHYSICAL_ADDRESS(ramdisk_addr);
@@ -352,10 +358,15 @@ do_exec(int argc, char *argv[])
}
script_timeout_ms -= CYGNUM_REDBOOT_CLI_IDLE_TIMEOUT;
}
}
if (!base_addr_set) {
+ if ((base_addr == 0) || (length == 0)) {
+ // Probably not valid - don't try it
+ diag_printf("No default base address set!\n");
+ return;
+ }
diag_printf("Using base address %p and length %p\n",
(void*)base_addr, (void*)length);
} else if (base_addr_set && !length_set) {
diag_printf("Length required for non-standard base address\n");
return;
Index: hal/arm/edb7xxx/current/ChangeLog
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/hal/arm/edb7xxx/current/ChangeLog,v
retrieving revision 1.39
diff -u -5 -p -r1.39 ChangeLog
--- hal/arm/edb7xxx/current/ChangeLog 7 Feb 2003 00:25:01 -0000 1.39
+++ hal/arm/edb7xxx/current/ChangeLog 12 Feb 2003 21:02:00 -0000
@@ -1,5 +1,9 @@
+2003-02-12 Gary Thomas <gary@mlbassoc.com>
+
+ * include/plf_io.h: Provide proper memory layout for EDB7312.
+
2003-02-06 Gary Thomas <gary@mind.be>
* misc/edb7312_redboot_ROMRAM.ecm:
* src/edb7xxx_misc.c:
* include/plf_io.h:
Index: hal/arm/edb7xxx/current/include/plf_io.h
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/hal/arm/edb7xxx/current/include/plf_io.h,v
retrieving revision 1.3
diff -u -5 -p -r1.3 plf_io.h
--- hal/arm/edb7xxx/current/include/plf_io.h 7 Feb 2003 00:25:01 -0000 1.3
+++ hal/arm/edb7xxx/current/include/plf_io.h 12 Feb 2003 21:02:52 -0000
@@ -43,11 +43,11 @@
//####ECOSGPLCOPYRIGHTEND####
//=============================================================================
//#####DESCRIPTIONBEGIN####
//
// Author(s): jskov
-// Contributors: jskov
+// Contributors: jskov, gthomas
// Date: 2002-01-28
// Purpose: Platform specific support routines
// Description:
// Usage: #include <cyg/hal/hal_io.h>
//
@@ -60,8 +60,25 @@
#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)
+
+#if defined(CYGPKG_REDBOOT_ARM_LINUX_EXEC) && defined(CYGHWR_HAL_ARM_EDB7XXX_VARIANT_EP7312)
+#define _CYGHWR_LAYOUT_ONLY
+#include <cyg/hal/hal_platform_setup.h>
+// Describe memory layout for Linux
+#define CYGHWR_REDBOOT_LINUX_ATAG_MEM(_p_) \
+ /* Next ATAG_MEM. */ \
+ _p_->hdr.size = (sizeof(struct tag_mem32) + sizeof(struct tag_header))/sizeof(long); \
+ _p_->hdr.tag = ATAG_MEM; \
+ /* 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. \
+ */ \
+ _p_->u.mem.size = 1<<hal_msbindex(CYGMEM_REGION_ram_SIZE); \
+ if (_p_->u.mem.size < CYGMEM_REGION_ram_SIZE) \
+ _p_->u.mem.size <<= 1; \
+ _p_->u.mem.start = DRAM_PA_START;
+#endif
#endif // CYGONCE_HAL_ARM_EDB7XXX_PLF_IO_H
// EOF plf_io.h
--
------------------------------------------------------------
Gary Thomas |
MLB Associates | Consulting for the
+1 (970) 229-1963 | Embedded world
http://www.mlbassoc.com/ |
email: <gary@mlbassoc.com> |
gpg: http://www.chez-thomas.org/gary/gpg_key.asc
------------------------------------------------------------