2010-12-28 07:20:04     Where is Uboot saved? How does it find Linux?

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

2010-12-28 07:20:04     Where is Uboot saved? How does it find Linux?

Gilles Ganault (FRANCE)

Message: 97032   

Hello

 

I'm a newbie with embedded Linux, and am confused about a couple of things while playing with the Atcom IP01 (Blackfin BF532 + NAND):

 

1. Where is Uboot saved? Some documentation ("Method 2") says that a RAM-based Linux should be saved in NAND at /dev/mtdblock0, while another document says that upgrading Uboot requires saving it to /dev/mtd0

 

So... if /dev/mt0 and /dev/mtdblock0 refer to the first partition in the NAND, how can it contain both a bootloader and Linux (and its attached RAM-based root filesystem)?

 

2. How does the Blackin know where to locate Uboot, and how does Uboot know where to locate the Linux kernel?

Apparently, Uboot will run whatever command is defined in "bootcmd", which happens to be defined thusly in my Atcom : "nboot 0x2000000 0". Does this mean that Uboot will load whatever OS lives in the NAND starting at adress 0 by copying it into RAM at address 0x2000000?

 

Thank you.

QuoteReplyEditDelete

 

 

2010-12-28 12:26:30     Re: Where is Uboot saved? How does it find Linux?

Mike Frysinger (UNITED STATES)

Message: 97035   

 

where u-boot is actually stored is completely board dependent.  but since you're using a BF532, the only place it most likely could be is the start of parallel flash or spi flash.  just look at the u-boot boot output to find out.

 

there is no requirement in either Linux detecting and supporting every flash on the system, or in the exact order devices are populated.  so perhaps your Linux config doesnt support the flash where u-boot lives.

 

as for how the Blackfin boots u-boot, please read the documentation:

http://docs.blackfin.uclinux.org/doku.php?id=bootloaders

 

same for u-boot booting linux:

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

QuoteReplyEditDelete

 

 

2010-12-28 18:11:35     Re: Where is Uboot saved? How does it find Linux?

Gilles Ganault (FRANCE)

Message: 97038   

 

Thanks Mike for the help.

 

When booting the appliance, Uboot displays the preboot env't variable which contains "echo starting from spi flash". Typing "help" shows that it supports "eeprom" and "nand", and when I run "save", env't variables are saved into EEPROM.

 

I don't know the difference between EEPROM, NAND, and parallel/SPI flash, but it looks like Uboot lives in the first partition in the NAND:

 

> cat /proc/mtd

 

dev:    size   erasesize  name

 

mtd0: 00300000 00001000 "ROMfs"

 

mtd1: 00800000 00020000 "linux kernel"

 

mtd2: 0f800000 00020000 "file system"

 

I'll keep reading. Thank you.

QuoteReplyEditDelete

 

 

2010-12-28 18:27:53     Re: Where is Uboot saved? How does it find Linux?

Mike Frysinger (UNITED STATES)

Message: 97039   

 

i highly doubt u-boot lives in nand since the BF532 doesnt support booting from async devices such as NAND.  if u-boot talks about eeprom, then most likely it is using the old eeprom sub system to boot out of spi flash.

 

that /proc/mtd output indicates that the flash u-boot lives in is not accessible under that Linux configuration.

QuoteReplyEditDelete

 

 

2010-12-28 19:03:56     Re: Where is Uboot saved? How does it find Linux?

Gilles Ganault (FRANCE)

Message: 97040   

 

Yup, that appliance has a 256k SIP flash from which it fetches Uboot:

 

www.rowetel.com/images/ip04/ip04_hw_arch.png

 

Thanks for the confirmation.

QuoteReplyEditDelete

Attachments

    Outcomes