2008-08-19 06:53:36     How to allocate huge buffer in u-boot

Document created by Aaronwu Employee on Sep 18, 2013
Version 1Show Document
  • View in full screen mode

2008-08-19 06:53:36     How to allocate huge buffer in u-boot

Appalayagari Sreedhar (INDIA)

Message: 60638   

 

Hi,

 

I am working with BF533 and using uboot version u-boot 1.1.6

 

I am trying to allocate 2 MB buffer in u-boot.

 

in common/cmd_bootm.c file, i could see that the starting address of the buffer is around 0x3fda036.

 

my board has sdram 64 MB and CFG_MONITOR_BASE address is 0x3fc0000, my u-boot size is around 100KB.

 

and when i starts booting it goes to exception.

 

I read the documentation of uboot memory layout

 

http://docs.blackfin.uclinux.org/doku.php?id=bootloaders:u-boot:memory-layout

 

i tried with increasing the size of Global data by using this macro.

 

CFG_GBL_DATA_SIZE - Size of the global data (should not really need to change)

 

default it is 0x4000 , i changed it to 0x200000 it did not work for me.

 

is i am missing anything or doing wrong.

 

please guide me how to allocate a huge buffer of size 2 MB or more in u-boot.

 

Best Regards, Sreedhar.

 

 

 

QuoteReplyEditDelete

 

 

2008-08-19 10:59:41     Re: How to allocate huge buffer in u-boot

Mike Frysinger (UNITED STATES)

Message: 60651   

 

*how* are you trying to allocate 2 meg

QuoteReplyEditDelete

 

 

2008-08-20 02:59:24     Re: How to allocate huge buffer in u-boot

Appalayagari Sreedhar (INDIA)

Message: 60716   

 

Hi,

 

We are allocating the huge buffer like this.

 

unsigned short buffer[ ] = {

 

                                                        #include "file.dat"

 

                                               };

 

file.dat is of size 2MB. in the cmd_bootm.c file.

 

Best Regards,Sreedhar.

 

 

QuoteReplyEditDelete

 

 

2008-08-20 03:42:11     Re: How to allocate huge buffer in u-boot

Mike Frysinger (UNITED STATES)

Message: 60723   

 

assuming that is in file scope and not function scope, that will place the buffer in your readonly .data section ... it doesnt matter how the other memory regions (malloc/global) are laid out as .data is part of the monitor region.

 

QuoteReplyEditDelete

 

 

2008-08-20 05:47:06     Re: How to allocate huge buffer in u-boot

Appalayagari Sreedhar (INDIA)

Message: 60746   

 

Hi Mike,

 

Thankyou, How i can solve this problem.

 

if i declare the buffer like this

 

unsigned short buffer[0x100000];   global.

 

will it be allocated other than the CFG_MONITOR_LEN region.

 

I will try and test here, if that is not the correct method, please suggest me how to allocate the huge buffer globally.

 

Best Regards,Sreedhar.

QuoteReplyEditDelete

 

 

2008-08-20 09:34:25     Re: How to allocate huge buffer in u-boot

Mike Frysinger (UNITED STATES)

Message: 60755   

 

that will place it into your .bss then, but that will still be in your monitor region

 

but if you did not change the CFG_MONITOR_LEN, then u-boot would not have linked in the first place

QuoteReplyEditDelete

 

 

2008-08-21 07:36:28     Re: How to allocate huge buffer in u-boot

Appalayagari Sreedhar (INDIA)

Message: 60825   

 

Hi Mike,

 

The address of the buffer is in the CFG_MONITOR_LEN only.

 

but the CFG_MONITOR_LEN is 256KB. The size of the dat file is around 1.5MB

 

It is compiling succesfully, but its going to exception at run time.

 

can you tell me why this is happening.

 

if we increase the CFG_MONITOR_LEN will that  be correct method.

 

Best Regards, Sreedhar.

QuoteReplyEditDelete

 

 

2008-08-21 11:11:44     Re: How to allocate huge buffer in u-boot

Mike Frysinger (UNITED STATES)

Message: 60845   

 

what version of u-boot are you using ?  it should not be linking because you did not properly update the regions ...

QuoteReplyEditDelete

 

 

2008-08-21 11:51:56     Re: How to allocate huge buffer in u-boot

Appalayagari Sreedhar (INDIA)

Message: 60849   

 

Hi Mike,

 

uboot version : u-boot - 1.1.6

 

Best Regards,Sreedhar.

QuoteReplyEditDelete

 

 

2008-08-21 12:01:13     Re: How to allocate huge buffer in u-boot

Mike Frysinger (UNITED STATES)

Message: 60851   

 

that doesnt say what Blackfin release.  we do 200#R# releases.

QuoteReplyEditDelete

 

 

2008-08-21 12:24:46     Re: How to allocate huge buffer in u-boot

Appalayagari Sreedhar (INDIA)

Message: 60853   

 

Hi Mike,

 

Sorry, Here the details.

 

-Boot 1.1.6-svn (ADI-2007R1)

 

Best Regards,Sreedhar.

QuoteReplyEditDelete

 

 

2008-08-21 12:36:47     Re: How to allocate huge buffer in u-boot

Mike Frysinger (UNITED STATES)

Message: 60854   

 

the latest release is 2008R1.5

QuoteReplyEditDelete

 

 

2008-08-21 14:01:40     Re: How to allocate huge buffer in u-boot

Appalayagari Sreedhar (INDIA)

Message: 60859   

 

Hi Mike,

 

I am working with 2007R1-RC3 distribution, if i upgrade it to 2008R1.5 do i need to upgrade the kernel to 2008 also?

 

I dont want to upgrade the kernel because most of the developments are in 2007R1-RC3.

 

If i want to continue with the u-boot 1.1.6 2007R1 version, if i increase the CFG_MONITOR_LEN will that be ok?.

 

please clarify me.

 

Best Regards,Sreedhar.

QuoteReplyEditDelete

 

 

2008-08-22 10:54:41     Re: How to allocate huge buffer in u-boot

Appalayagari Sreedhar (INDIA)

Message: 60917   

 

Hi Mike,

 

Can you please clarify me, if i increase the CFG_MONITOR_LEN will that help me?.

 

 

 

If I want to upgrade to 2008R1.5 do I need to upgrade my distribution also to 2008.

 

currently i am working with 2007R1 u-boot 1.1.6 and distribution 2007R1-RC3.

 

Best Regards,Sreedhar.

QuoteReplyEditDelete

 

 

2008-08-28 22:28:18     Re: How to allocate huge buffer in u-boot

Robin Getz (UNITED STATES)

Message: 61296   

 

Sreedhar:

 

We don't test mix and match versions, but I can't think of a reason why an newer U-Boot wouldn't work with a kernel that is only one version behind (but it is getting late here)

 

It should be a easy test for you.

 

-Robin

QuoteReplyEditDelete

 

 

2009-08-24 21:09:14     Re: How to allocate huge buffer in u-boot

Mike Frysinger (UNITED STATES)

Message: 79163   

 

this is probably fixed in 2009R1 now by using a dedicated exception stack

Attachments

    Outcomes