All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] newbie questions regarding some config options.
@ 2011-06-13 12:31 Christopher Harvey
  2011-06-13 13:09 ` PHIL.EDWORTHY at renesas.com
  0 siblings, 1 reply; 9+ messages in thread
From: Christopher Harvey @ 2011-06-13 12:31 UTC (permalink / raw)
  To: u-boot

 As per the README file:

 	Subscribe to u-boot mailing list;

 	if (clueless)
 		email("Hi, I am new to U-Boot, how do I get started?");

 I'm messing around with uboot and QEMU (qemu-system-arm -M 
 realview-pbx-a9 -kernel u-boot.bin), things are going pretty well in the 
 sense that I'm not having too much trouble reading most of the code and 
 creating a new board. I have some questions that I can't figure out by 
 reading the code. What is the CONFIG_SYS_TEXT_BASE variable and how can 
 I figure out what it should be?

 I randomly set it to 0x0...then tried to debug u-boot under qemu, but 
 when stepping in the start.S file it was instantly clear that it wasn't 
 really working because gdb said the code ran right though the
 _start: b reset
 instruction and qemu eventually crashed with the following output:
 qemu: fatal: Trying to execute code outside RAM or ROM at 0xfeb70cdc

 R00=00000000 R01=ffff0000 R02=00000000 R03=000108ac
 R04=ffff0000 R05=ffbedf70 R06=ffff0000 R07=00000010
 R08=00001000 R09=ffff0000 R10=000108ac R11=00000000
 R12=00001078 R13=ffbedf60 R14=00000960 R15=feb70cdc
 PSR=600001d3 -ZC- A svc32
 Aborted

 Apart from that everything is pretty clear to me, but I want to make 
 sure I'm getting this points right:
 Is the environment the set of variables that can be modified with 
 setenv?
 How can I determine the "size of the environment"?  Is it the number of 
 characters including variable names?

 Also, is there anything special I need to do with gdb to get it to 
 follow relocating code?

 thanks,
 -Chris

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] newbie questions regarding some config options.
  2011-06-13 12:31 [U-Boot] newbie questions regarding some config options Christopher Harvey
@ 2011-06-13 13:09 ` PHIL.EDWORTHY at renesas.com
  2011-06-13 13:59   ` Matthias Weisser
  2011-06-13 15:58   ` Wolfgang Denk
  0 siblings, 2 replies; 9+ messages in thread
From: PHIL.EDWORTHY at renesas.com @ 2011-06-13 13:09 UTC (permalink / raw)
  To: u-boot


Hi Christopher,

> What is the CONFIG_SYS_TEXT_BASE variable and how can
>  I figure out what it should be?

U-boot is typically stored in flash and one of the first things it does when executed is relocate to ram. CONFIG_SYS_TEXT_BASE is the relocation
address. Typically, u-boot global data, heap and then stack is stored just below this.

Since u-boot is used to load some other program like the kernel, you need the u-boot relocation address to be out of the way of this. So, for the
boards I have seen (not arm), CONFIG_SYS_TEXT_BASE is set to the top of ram - 256KB, i.e. enough room for the u-boot image.

I am sure more experienced u-boot developers will correct me if I am wrong :)

Regards
Phil

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] newbie questions regarding some config options.
  2011-06-13 13:09 ` PHIL.EDWORTHY at renesas.com
@ 2011-06-13 13:59   ` Matthias Weisser
  2011-06-13 14:08     ` PHIL.EDWORTHY at renesas.com
  2011-06-13 15:58   ` Wolfgang Denk
  1 sibling, 1 reply; 9+ messages in thread
From: Matthias Weisser @ 2011-06-13 13:59 UTC (permalink / raw)
  To: u-boot

Am 13.06.2011 15:09, schrieb PHIL.EDWORTHY at renesas.com:
> 
> Hi Christopher,
> 
>> What is the CONFIG_SYS_TEXT_BASE variable and how can
>>  I figure out what it should be?
> 
> U-boot is typically stored in flash and one of the first things it does when executed is relocate to ram. CONFIG_SYS_TEXT_BASE is
the relocation
> address. Typically, u-boot global data, heap and then stack is stored just below this.

On ARM, CONFIG_SYS_TEXT_BASE is typically the base address of the image
in flash. This is, on a system booting from NOR, the address of the
first instruction which is fetched from the CPU.

> Since u-boot is used to load some other program like the kernel, you need the u-boot relocation address to be out of the way of this. So, for the
> boards I have seen (not arm), CONFIG_SYS_TEXT_BASE is set to the top of ram - 256KB, i.e. enough room for the u-boot image.

The relocation address is dynamically calculated from a couple of
(runtime) information and has nothing to do with CONFIG_SYS_TEXT_BASE.
This is true for ARM and AFAIK for PPC.

Matthias

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] newbie questions regarding some config options.
  2011-06-13 13:59   ` Matthias Weisser
@ 2011-06-13 14:08     ` PHIL.EDWORTHY at renesas.com
  2011-06-13 14:12       ` Christopher Harvey
  2011-06-13 15:59       ` Wolfgang Denk
  0 siblings, 2 replies; 9+ messages in thread
From: PHIL.EDWORTHY at renesas.com @ 2011-06-13 14:08 UTC (permalink / raw)
  To: u-boot

Hi Matthias,

> >> What is the CONFIG_SYS_TEXT_BASE variable and how can
> >>  I figure out what it should be?
> >
> > U-boot is typically stored in flash and one of the first things it does when executed is relocate to ram. CONFIG_SYS_TEXT_BASE is
> the relocation
> > address. Typically, u-boot global data, heap and then stack is stored just below this.
>
> On ARM, CONFIG_SYS_TEXT_BASE is typically the base address of the image
> in flash. This is, on a system booting from NOR, the address of the
> first instruction which is fetched from the CPU.
>
> > Since u-boot is used to load some other program like the kernel, you need the u-boot relocation address to be out of the way of this. So, for the
> > boards I have seen (not arm), CONFIG_SYS_TEXT_BASE is set to the top of ram - 256KB, i.e. enough room for the u-boot image.
>
> The relocation address is dynamically calculated from a couple of
> (runtime) information and has nothing to do with CONFIG_SYS_TEXT_BASE.
> This is true for ARM and AFAIK for PPC.

Thanks for the additional info - SH is a little different then!

Phil

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] newbie questions regarding some config options.
  2011-06-13 14:08     ` PHIL.EDWORTHY at renesas.com
@ 2011-06-13 14:12       ` Christopher Harvey
  2011-06-13 16:00         ` Wolfgang Denk
  2011-06-13 15:59       ` Wolfgang Denk
  1 sibling, 1 reply; 9+ messages in thread
From: Christopher Harvey @ 2011-06-13 14:12 UTC (permalink / raw)
  To: u-boot

 On Mon, 13 Jun 2011 15:08:35 +0100, PHIL.EDWORTHY at renesas.com wrote:
> Hi Matthias,
>
>> >> What is the CONFIG_SYS_TEXT_BASE variable and how can
>> >>  I figure out what it should be?
>> >
>> > U-boot is typically stored in flash and one of the first things it 
>> does when executed is relocate to ram. CONFIG_SYS_TEXT_BASE is
>> > the relocation
>> > address. Typically, u-boot global data, heap and then stack is 
>> stored just below this.
>>
>> On ARM, CONFIG_SYS_TEXT_BASE is typically the base address of the 
>> image
>> in flash. This is, on a system booting from NOR, the address of the
>> first instruction which is fetched from the CPU.
>>
>> > Since u-boot is used to load some other program like the kernel, 
>> you need the u-boot relocation address to be out of the way of this. 
>> So, for the
>> > boards I have seen (not arm), CONFIG_SYS_TEXT_BASE is set to the 
>> top of ram - 256KB, i.e. enough room for the u-boot image.
>>
>> The relocation address is dynamically calculated from a couple of
>> (runtime) information and has nothing to do with 
>> CONFIG_SYS_TEXT_BASE.
>> This is true for ARM and AFAIK for PPC.
>
> Thanks for the additional info - SH is a little different then!
>
> Phil

 Thanks for the information. Since CONFIG_SYS_TEXT_BASE seems to be a 
 critical value and isn't something that can be ignored, maybe it 
 deserves an entry in the already helpful README. I'd write it myself but 
 I'm not qualified.

 -Chris

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] newbie questions regarding some config options.
  2011-06-13 13:09 ` PHIL.EDWORTHY at renesas.com
  2011-06-13 13:59   ` Matthias Weisser
@ 2011-06-13 15:58   ` Wolfgang Denk
  2014-08-22  3:49     ` Chris
  1 sibling, 1 reply; 9+ messages in thread
From: Wolfgang Denk @ 2011-06-13 15:58 UTC (permalink / raw)
  To: u-boot

Dear PHIL.EDWORTHY at renesas.com,

In message <OF460D0558.A844A780-ONC12578AE.0047905C-802578AE.00482EFA@eu.necel.com> you wrote:
>
> 
> U-boot is typically stored in flash and one of the first things it
> does when executed is relocate to ram. CONFIG_SYS_TEXT_BASE is the
> relocation address. Typically, u-boot global data, heap and then

This is completely wrong.  The relocation address is determined
dynamically, depending on RAM size and a number of coinfigured
options.

CONFIG_SYS_TEXT_BASE is the start address of the text segment when
execution starts - on ROM booting systems this is an address in ROM.

> I am sure more experienced u-boot developers will correct me if I am wrong :)

Indeed this was necessary.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
A person who is more than casually interested in computers should  be
well  schooled in machine language, since it is a fundamental part of
a computer.                                           -- Donald Knuth

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] newbie questions regarding some config options.
  2011-06-13 14:08     ` PHIL.EDWORTHY at renesas.com
  2011-06-13 14:12       ` Christopher Harvey
@ 2011-06-13 15:59       ` Wolfgang Denk
  1 sibling, 0 replies; 9+ messages in thread
From: Wolfgang Denk @ 2011-06-13 15:59 UTC (permalink / raw)
  To: u-boot

Dear PHIL.EDWORTHY at renesas.com,

In message <OF0DAC137B.B5EC37B0-ONC12578AE.004D7395-802578AE.004D9320@eu.necel.com> you wrote:
>
> > The relocation address is dynamically calculated from a couple of
> > (runtime) information and has nothing to do with CONFIG_SYS_TEXT_BASE.
> > This is true for ARM and AFAIK for PPC.
> 
> Thanks for the additional info - SH is a little different then!

Several architectures copied the old ARM model of not performing
proper relocation.  They all should be fixed...

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Hokey religions and ancient weapons are  no  substitute  for  a  good
blaster at your side.                                      - Han Solo

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] newbie questions regarding some config options.
  2011-06-13 14:12       ` Christopher Harvey
@ 2011-06-13 16:00         ` Wolfgang Denk
  0 siblings, 0 replies; 9+ messages in thread
From: Wolfgang Denk @ 2011-06-13 16:00 UTC (permalink / raw)
  To: u-boot

Dear Christopher Harvey,

In message <900370e88f15c7517c5e2bb29f0a1408@basementcode.com> you wrote:
>
>  Thanks for the information. Since CONFIG_SYS_TEXT_BASE seems to be a 
>  critical value and isn't something that can be ignored, maybe it 
>  deserves an entry in the already helpful README. I'd write it myself but 
>  I'm not qualified.

Try it, and others will fill in and/or correct where necessary.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
If a group of N persons implements a COBOL compiler,  there  will  be
N-1 passes. Someone in the group has to be the manager. - T. Cheatham

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] newbie questions regarding some config options.
  2011-06-13 15:58   ` Wolfgang Denk
@ 2014-08-22  3:49     ` Chris
  0 siblings, 0 replies; 9+ messages in thread
From: Chris @ 2014-08-22  3:49 UTC (permalink / raw)
  To: u-boot

Wolfgang Denk <wd <at> denx.de> writes:

> 
> Dear PHIL.EDWORTHY <at> renesas.com,
> 
> In message <OF460D0558.A844A780-ONC12578AE.0047905C-802578AE.00482EFA <at> 
eu.necel.com> you wrote:
> >
> > 
> > U-boot is typically stored in flash and one of the first things it
> > does when executed is relocate to ram. CONFIG_SYS_TEXT_BASE is the
> > relocation address. Typically, u-boot global data, heap and then
> 
> This is completely wrong.  The relocation address is determined
> dynamically, depending on RAM size and a number of coinfigured
> options.
> 
> CONFIG_SYS_TEXT_BASE is the start address of the text segment when
> execution starts - on ROM booting systems this is an address in ROM.
> 
> > I am sure more experienced u-boot developers will correct me if I am 
wrong :)
> 
> Indeed this was necessary.
> 
> Best regards,
> 
> Wolfgang Denk
> 

Hello Wolfgang,

is it safe to say that this is the base address of the flash memory, the 
CONFIG_SYS_TEXT_BASE? Of course if I boot from flash..
Say if my flash is in 0x10000000 for NCS0 of at91rm9200 as an example,
CONFIG_SYS_TEXT_BASE = 0x10000000?

Thanks

Chris

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-08-22  3:49 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-13 12:31 [U-Boot] newbie questions regarding some config options Christopher Harvey
2011-06-13 13:09 ` PHIL.EDWORTHY at renesas.com
2011-06-13 13:59   ` Matthias Weisser
2011-06-13 14:08     ` PHIL.EDWORTHY at renesas.com
2011-06-13 14:12       ` Christopher Harvey
2011-06-13 16:00         ` Wolfgang Denk
2011-06-13 15:59       ` Wolfgang Denk
2011-06-13 15:58   ` Wolfgang Denk
2014-08-22  3:49     ` Chris

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.