This is the mail archive of the ecos-discuss@sourceware.org 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]

Re: Using defines in .ldi for variable RAM sizes


On Mon, 5 Jul 2010, Manuel Borchers wrote:

Hi all,

while cleaning up the port to the netX family, I came to the point
where I need to deal with differnet sizes of SDRAM.

The several boards Hilscher has in its portfolio use differnet types
and amounts of RAM.
I got the configuration for the different types of RAM already
integrated in the platform port through cdl_options. So, what I'd like
to do is doing the same for the size of the installed RAM. Is it
possible and safe to use, e.g. CYGNUM_HAL_SDRAM_SIZE in the ldi-file
which will be set by an cdl_option?

I'd like to use something like this:
sdram(rwx)   : ORIGIN = 0x80000000, LENGTH = CYGNUM_HAL_SDRAM_SIZE

and in the corresponding header file:
#define CYGMEM_REGION_ram_SIZE    (CYGNUM_HAL_SDRAM_SIZE)

instead of the fixed minimum RAM size, I'm currently using.

Hi Manuel,


Look, please, on a top and bottom of hal/arm/arch/*/src/arm.ld

As you can see it includes 'pkgconf/system.h' header on top and the it
will include your layout definitions, so, your target's CDL would have
something likes (just an example)

        cdl_option CYGHWR_HAL_ARM_NETX_BSP_MEMORY_SIZE {
            ...
            define -file system.h CYGNUM_HAL_SDRAM_SIZE
            ...
        }

It will define that what you asked for in 'pkgconf/system.h'.

And about run-time. Your platform startup code can put at 0x40 DRAM size
as well (hal/arm/arch/*/src/vectors.S)

HTH

Sergei

--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


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