Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: 256MB DDR2 not working on custom board with AT91SAM9G45
PostPosted: Tue Jul 19, 2011 11:30 am 
Offline

Joined: Wed May 25, 2011 9:44 am
Posts: 31
Hi,

There are previous posts with regard to the same problem, but I have tried all the solutions but they are not working for me, so I'm posting again.

I am working on a board with AT91SAM9G45 (designed based on AT91SAM9G45-EKES). I'm using Linux 2.6.32.8. My problem is that Linux does not use the second memory bank (128 MB on EBI_CS1 mapped at 0x20000000).

The memory mapping is as follows:
0x70000000 => 0xc0000000 (128 MB - DDRSDRC0)
0x20000000 => 0xc8000000 (128 MB - EBI_CS1)

While booting I see this message: "Ignoring RAM at 20000000-27ffffff (vmalloc region overlap)".

I have enabled SparseMem and also tried patches posted at:
http://blog.linuxconsulting.ro/2010/05/ ... -with.html

I have checked & verified my DDR2 initializations in AT91Bootstrap.

I have added uBoot boot args as:
mem=exactmap memmap=0x08000000@0x70000000 memmap=0x08000000@0x20000000

The exact/root problem as it seems to me now that linux does not get PHYS_OFFSET / PAGE_OFFSET dynamically depending on the memory bank in use.

Pls suggest the work arounds or any solutions, if someone has already solved it.

- PJ


Top
 Profile  
 
 Post subject: Re: 256MB DDR2 not working on custom board with AT91SAM9G45
PostPosted: Tue Jul 19, 2011 2:17 pm 
Offline

Joined: Sat Oct 30, 2010 6:04 pm
Posts: 574
Either you need to raise the vmalloc ceiling by changing VMALLOC_END in /arc/arm/mach-at91/include/mach/vmalloc.h
Or shrink the size of the vmalloc area so it does impinge on your upper memory block, by specifying the size of the command line using vmalloc=xxxM


Top
 Profile  
 
 Post subject: Re: 256MB DDR2 not working on custom board with AT91SAM9G45
PostPosted: Tue Jul 19, 2011 3:49 pm 
Offline

Joined: Wed May 25, 2011 9:44 am
Posts: 31
Hello,

thanks for your reply.

I tried with vmalooc=64M & vmalloc=16M, the results were same.

I would like you to look into this file: arch/arm/mm/mmu.c
If you check function "sanity_check_meminfo()" where this error is printed, pls note the conditions of the memory check. The condition that fails is "__va(bank->start) < (void *)PAGE_OFFSET".

This happens because the linear memory mapping maps this bank at a wrong virtual address.

Now if you read my earlier post, you will be able to understand what I was trying to ask. (How to dynamically get PHYS_OFFSET with reference to the memory bank referenced)

If you think that I'm missing something, please point out to me.

Some values that you may need:
VMALLOC_END 0xFEE00000
VMALLOC_MIN 0xF6E00000
PAGE_OFFSET 0xC0000000
PHYS_OFFSET 0x70000000

-PJ


Top
 Profile  
 
 Post subject: Re: 256MB DDR2 not working on custom board with AT91SAM9G45
PostPosted: Thu Jul 28, 2011 1:22 pm 
Offline

Joined: Wed May 25, 2011 9:44 am
Posts: 31
I've made the following changes to my Linux 2.6.32-8 to get 256MB of DDR2 working on at91sam9g45-ekes

(1)
added to arch/arm/mach-at91/include/mach/memeory.h
#if defined(CONFIG_ARCH_AT91SAM9G45) || defined(CONFIG_ARCH_AT91SAM9M10)
/*
* Non-linear mapping like so:
* phys => virt
* 0x70000000 => 0xc0000000
* 0x20000000 => 0xc8000000
*/

#define __phys_to_virt(p) \
(((p) & 0x07ffffff) + (((p) & 0x40000000) ? 0xc0000000 : 0xc8000000))


#define __virt_to_phys(v) \
(((v) & 0x07ffffff) + (((v) & 0x08000000) ? 0x20000000 : 0x70000000 ))

#define NODE_MEM_SIZE_BITS 27
#define MAX_PHYSMEM_BITS 32
#define SECTION_SIZE_BITS 27
#define HIGH_MEMORY_VIRT 0xd0000000

#endif


(2)
added to arch/arm/mm/init.c

#ifdef HIGH_MEMORY_VIRT
high_memory = HIGH_MEMORY_VIRT;
#else
high_memory = __va((max_low << PAGE_SHIFT) - 1) + 1;
#endif

(3)
The memory model selected is sparse mem & Highmem disabled.


Now when I boot my system then my kernel does not boot and when I analyze my kernel buffers I see this dump:


Linux version 2.6.32.8 (prasant@prasant-laptop) (gcc version4.2.0 20070413 (prerelease) (CodeSourcery Sourcery G++ Lite 2007q1-10)) #550 PREEMPT Thu Jul 28 16:26:14 IST 2011.

CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177.
CPU: VIVTdata cache, VIVT instruction cache.................. AT91SAM9G45-EKES.
Ignoring unrecognised tag 0x54410008.
Memory policy:ECC disabled, Data cache writeback.
------------[ cut here ]------------.
WARNING: at mm/bootmem.c:545 alloc_arch_preferred_bootmem+0x34/0x64().
Modules linked in:.............................trace+0x0/0xdc) from [<c003d4b8>] (warn_slowpath_common+0x4c/0x68).
[<c003d4b8>] (warn_slowpath_common+0x4c/0x68) from [<c0010e50>] (alloc_arch_preferred_bootmem+0x34/0x64).
[<c0010e50>] (alloc_arch_preferred_bootmem+0x34/0x64) from [<c00113a0>] (___alloc_bootmem_nopanic+0x34/0xdc).
[<c00113a0>] (___alloc_bootmem_nopanic+0x34/0xdc) from [<c00116ac>] (___alloc_bootmem+0xc/0x30).
[<c00116ac>] (___alloc_bootmem+0xc/0x30) from [<c0012850>] (sparse_init+0x14/0x188).
[<c0012850>] (sparse_init+0x14/0x188) from [<c000c69c>] (bootmem_init+0x330/0x454).
[<c000c69c>] (bootmem_init+0x330/0x454) from [<c000d49c>] (paging_init+0x588/0x734).
[<c000d49c>] (paging_init+0x588/0x734) from [<c000b95c>] (setup_arch+0x378/0x634).
[<c000b95c>] (setup_arch+0x378/0x634) from [<c00087d0>] (start_kernel+0x60/0x394).
[<c00087d0>] (start_kernel+0x60/0x394) from [<70008034>] (0x70008034).
---[ end trace 1b75b31a2719ed1c ]---.

Any idea what could be the problems ?

-PJ


Top
 Profile  
 
 Post subject: Re: 256MB DDR2 not working on custom board with AT91SAM9G45
PostPosted: Thu Sep 01, 2011 5:03 pm 
Offline

Joined: Wed Dec 30, 2009 2:37 am
Posts: 4
[quote="pj0585@gmail.com"]I've made the following changes to my Linux 2.6.32-8 to get 256MB of DDR2 working on at91sam9g45-ekes

(1)
added to arch/arm/mach-at91/include/mach/memeory.h
#if defined(CONFIG_ARCH_AT91SAM9G45) || defined(CONFIG_ARCH_AT91SAM9M10)
/*
* Non-linear mapping like so:
* phys => virt
* 0x70000000 => 0xc0000000
* 0x20000000 => 0xc8000000
*/

#define __phys_to_virt(p) \
(((p) & 0x07ffffff) + (((p) & 0x40000000) ? 0xc0000000 : 0xc8000000))


#define __virt_to_phys(v) \
(((v) & 0x07ffffff) + (((v) & 0x08000000) ? 0x20000000 : 0x70000000 ))

#define NODE_MEM_SIZE_BITS 27
#define MAX_PHYSMEM_BITS 32
#define SECTION_SIZE_BITS 27
#define HIGH_MEMORY_VIRT 0xd0000000

#endif


(2)
added to arch/arm/mm/init.c

#ifdef HIGH_MEMORY_VIRT
high_memory = HIGH_MEMORY_VIRT;
#else
high_memory = __va((max_low << PAGE_SHIFT) - 1) + 1;
#endif

(3)
The memory model selected is sparse mem & Highmem disabled.


Now when I boot my system then my kernel does not boot and when I analyze my kernel buffers I see this dump:


Linux version 2.6.32.8 (prasant@prasant-laptop) (gcc version4.2.0 20070413 (prerelease) (CodeSourcery Sourcery G++ Lite 2007q1-10)) #550 PREEMPT Thu Jul 28 16:26:14 IST 2011.

CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177.
CPU: VIVTdata cache, VIVT instruction cache.................. AT91SAM9G45-EKES.
Ignoring unrecognised tag 0x54410008.
Memory policy:ECC disabled, Data cache writeback.
------------[ cut here ]------------.
WARNING: at mm/bootmem.c:545 alloc_arch_preferred_bootmem+0x34/0x64().
Modules linked in:.............................trace+0x0/0xdc) from [<c003d4b8>] (warn_slowpath_common+0x4c/0x68).
[<c003d4b8>] (warn_slowpath_common+0x4c/0x68) from [<c0010e50>] (alloc_arch_preferred_bootmem+0x34/0x64).
[<c0010e50>] (alloc_arch_preferred_bootmem+0x34/0x64) from [<c00113a0>] (___alloc_bootmem_nopanic+0x34/0xdc).
[<c00113a0>] (___alloc_bootmem_nopanic+0x34/0xdc) from [<c00116ac>] (___alloc_bootmem+0xc/0x30).
[<c00116ac>] (___alloc_bootmem+0xc/0x30) from [<c0012850>] (sparse_init+0x14/0x188).
[<c0012850>] (sparse_init+0x14/0x188) from [<c000c69c>] (bootmem_init+0x330/0x454).
[<c000c69c>] (bootmem_init+0x330/0x454) from [<c000d49c>] (paging_init+0x588/0x734).
[<c000d49c>] (paging_init+0x588/0x734) from [<c000b95c>] (setup_arch+0x378/0x634).
[<c000b95c>] (setup_arch+0x378/0x634) from [<c00087d0>] (start_kernel+0x60/0x394).
[<c00087d0>] (start_kernel+0x60/0x394) from [<70008034>] (0x70008034).
---[ end trace 1b75b31a2719ed1c ]---.

Any idea what could be the problems ?

-PJ[/quote]


Hi PJ,

I got the same scenario using a 2.6.30 and 2.6.34 kernels, ¿Do you have any news about the problem? Any solution?

I'm stuck, and I have located the same files as you with the same conclusion.


Top
 Profile  
 
 Post subject: Re: 256MB DDR2 not working on custom board with AT91SAM9G45
PostPosted: Fri Sep 02, 2011 7:14 am 
Offline

Joined: Wed May 25, 2011 9:44 am
Posts: 31
Hi rlobos,

I got the solution by switching to linux 3.0.0.

The details are on the link,
http://lists.arm.linux.org.uk/lurker/me ... 1d.en.html

You will have to read the entire thread, I've posted the entire solution there. Do read the links that I have provided in the thread.

Remember, you have to make changes to both Uboot and update linux.

-PJ


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: