This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
RE: ROMRAM Application on xScale (PXA255)
- From: "Joe Porthouse" <jporthouse at toptech dot com>
- To: <ecos-discuss-return-34516-jporthouse=toptech dot com at ecos dot sourceware dot org>
- Cc: "'eCos Discussion'" <ecos-discuss at ecos dot sourceware dot org>
- Date: Fri, 24 Mar 2006 13:49:09 -0500
- Subject: RE: [ECOS] ROMRAM Application on xScale (PXA255)
- Dkim-signature: a=rsa-sha1; c=nowsp; d=toptech.com; s=MDaemon; t=1143225891; x=1143830691; i=jporthouse@toptech.com; q=dns; h=DomainKey-Signature: Received:Reply-To:From:To:Cc:Subject:Date:Organization: MIME-Version:Content-Type:Content-Transfer-Encoding:In-reply-to: Thread-Index:Message-ID; b=tx/bFahNJS6pmsE4At3hfEpDBMDXnN4HEcABJC ul/zwp1vI7sHelt1x2TBKLA36KXQKDgDnljTFuL+IaD99fMOyyqirdNKyKJY3dZd wyWpjiOaFbyBJ9KO969/2LTrFfwOu6tbU+0qopODJJMqGpe3KzaPd0vw99kGLRIm xWfYU=
- Reply-to: <jporthouse at toptech dot com>
Mark/All,
Thanks for the reply. I did not find any ROMRAM support in the
IXDP425 (..._ixdp425_romram.ldi or other support files), but I did find some
in the uE250 target platform.
I believe I have found all the references I needed to update but I
am still running into problems getting the application to run.
For starters I can run my application as RAM under redboot, and ROM
without redboot. Problems occur when I attempt to use ROMRAM.
My execution goes bad at the mov pc,r2 right after the MMU is turned
on in hal_platform_init.h.
// MMU on
ldr r2,=1f
mrc p15, 0, r0, c1, c0, 0
orr r0, r0, #MMU_Control_M
orr r0, r0, #MMU_Control_R
mcr p15, 0, r0, c1, c0, 0
mov pc,r2 <------
nop
nop
nop
1:
On bootup the flash is at address 0x00000000. When the MMU is
turned on, the flash is moved to 0x50000000 and the RAM is moved to
0x00000000.
With the ROM startup type the "ldr r2,1f" loads r2 with 0x50000xxx,
the correct address in ROM to continue execution.
With the ROMRAM startup type the "ldr r2,1f" loads r2 with
0x00000xxx, the RAM address to continue execution. Problem is that the
image is not copied from flash to RAM until later in the startup. Execution
is suppose to continue in flash at 0x50000000.
If I change the ..._romram.LDI and ..._romram.h file to locate the
code at 0x50000000, the jump is now correct at 0x50000000, and the flash is
copied to RAM correctly, but the application execution now occurs in the
flash at 0x50000000 instead of RAM.
What am I missing in the setup? How can I get the startup assembly
to compute the correct jump into flash at 0x50000000, but have the program
location addresses stay in RAM at 0x00000000?
..._romram.h is
#ifndef __ASSEMBLER__
#include <cyg/infra/cyg_type.h>
#include <stddef.h>
#endif
#define CYGMEM_REGION_ram (0x00000000)
#define CYGMEM_REGION_ram_SIZE (0x04000000)
#define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R |
CYGMEM_REGION_ATTR_W)
#ifndef __ASSEMBLER__
extern char CYG_LABEL_NAME (__workspace) [];
extern char CYG_LABEL_NAME (__heap1) [];
#endif
#ifdef CYGPKG_REDBOOT
# define CYGMEM_SECTION_heap1 (CYG_LABEL_NAME (__heap1))
# define CYGMEM_SECTION_heap1_SIZE ((size_t) CYG_LABEL_NAME
(__workspace) - (size_t) CYG_LABEL_NAME (__heap1))
# define CYGMEM_SECTION_workspace (CYG_LABEL_NAME
(__workspace))
# define CYGMEM_SECTION_workspace_SIZE
((size_t)CYGMEM_REGION_ram_SIZE - (size_t) CYG_LABEL_NAME (__workspace))
#else
# define CYGMEM_SECTION_heap1 (CYG_LABEL_NAME (__heap1))
# define CYGMEM_SECTION_heap1_SIZE
((size_t)CYGMEM_REGION_ram_SIZE - (size_t) CYG_LABEL_NAME (__heap1))
#endif
..._romram.ldi is
#include <cyg/infra/cyg_type.inc>
MEMORY
{
ram : ORIGIN = 0x00000000, LENGTH = 0x04000000
}
SECTIONS
{
SECTIONS_BEGIN
SECTION_rom_vectors (ram, 0x00000000,
LMA_EQ_VMA)
SECTION_fixed_vectors (ram, 0x00000020,
LMA_EQ_VMA)
SECTION_text (ram, ALIGN (0x4),
LMA_EQ_VMA)
SECTION_fini (ram, ALIGN (0x4),
LMA_EQ_VMA)
SECTION_rodata (ram, ALIGN (0x4),
LMA_EQ_VMA)
SECTION_rodata1 (ram, ALIGN (0x4),
LMA_EQ_VMA)
SECTION_fixup (ram, ALIGN (0x4),
LMA_EQ_VMA)
SECTION_gcc_except_table (ram, ALIGN (0x4),
LMA_EQ_VMA)
SECTION_data (ram, ALIGN (0x4),
LMA_EQ_VMA)
SECTION_bss (ram, ALIGN (0x4),
LMA_EQ_VMA)
CYG_LABEL_DEFN(__heap1) = ALIGN (0x8);
#ifdef CYGPKG_REDBOOT
CYG_LABEL_DEFN(__workspace) = 0x00800000;
#endif
SECTIONS_END
}
Joe Porthouse
Toptech Systems, Inc.
280 Hunt Park Cove
Longwood, FL 32750
407-332-1774 x-265
-----Original Message-----
From: ecos-discuss-owner@ecos.sourceware.org
[mailto:ecos-discuss-owner@ecos.sourceware.org] On Behalf Of Mark Salter
Sent: Monday, March 20, 2006 8:55 AM
To: jporthouse@toptech.com
Cc: 'eCos Discussion'
Subject: Re: [ECOS] ROMRAM Application on xScale (PXA255)
On Sun, 2006-03-19 at 21:01 -0500, Joe Porthouse wrote:
> In a nutshell:
> I am attempting to locate or find the information needed to write
> the code needed to finish the implement of the ROMRAM startup type on the
> xScale platform.
<...>
> The only problem I have is that I can not find any examples of a
> ROMRAM startup type on the PXA255 or any xScale processor.
IXDP425 supports a ROMRAM startup. Some other ARM ports do as well.
XScale is not special in this regard. Just do what other ARM ports
do.
--Mark
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss