[U-Boot] Question about getting the length of u-boot binary.

shawn xy Bai programassem at gmail.com
Thu Aug 9 16:32:37 CEST 2012


Hi,  everyone, how long no see.

Recently, I'm about to port U-boot to our board with MIPS cpu.

When I look at the function "board_init_f" in arch/mips/lib/board.c,
it's found that  "ulong addr, addr_sp, len = (ulong)&uboot_end -
CONFIG_SYS_MONITOR_BASE;"

And I know "uboot_end" is assigned in u-boot.lds, which is also stored
as a word at offset -8 in front of "in_ram" label.

What I want to know is
why use the address of "uboot_end" in that equation, rather than using
the value of "uboot_end"
what I mean is why not go like this  "len = (ulong)uboot_end -
CONFIG_SYS_MONITOR_BASE".

Also, there is one more question about the usage of CONFIG_SYS_TEXT_BASE

In our <board.h>,
#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE

To my knowledge, -fPIC option is used to build u-boot.bin.
Doesn't it mean where u-boot runs is irrelevant to where it is linked?
If yes, why CONFIG_SYS_TEXT_BASE is needed to indicate where U-boot is
linked to, rather than the default linked address 0x0000_0000.
I find CONFIG_SYS_TEXT_BASE is used with -Ttext linker option when
generating u-boot.bin, if it is assigned.

Could you help me explain the necessity of CONFIG_SYS_TEXT_BASE existence?
Or, even if CONFIG_SYS_TEXT_BASE is not assigned with a exlicit value,
building u-boot.bin will actually be successful without any problems
too.
Does it just exist for the flexbility?

If it have to be configured,  how shoud I configure it to coordinate
with our memory layout ?
What's the relationship between CONFIG_SYS_TEXT_BASE and CONFIG_SYS_SDRAM_BASE ?
Even with NOR FLASH or NAND FLASH address space?

By the way, when I want to use hotmail to send this mail,  there comes
the error:
"Message rejected. No base64 encoded MIME text parts allowed."

Do you have any ideas?

Thanks in advance.


More information about the U-Boot mailing list