downloading the build from Yocto project...

Moderator: nferre

ma5645
Posts: 11
Joined: Sat May 24, 2014 5:33 am

downloading the build from Yocto project...

Thu Jun 12, 2014 11:32 pm

I finished to build the Linux kernel, but attempt to run  - fails in the following way:
"
...
Hit any key to stop autoboot:  0 
U-Boot> tftpboot 21400000 zImage
gmac0: PHY present at 7
gmac0: Starting autonegotiation...
gmac0: Autonegotiation complete
gmac0: link up, 1000Mbps full-duplex (lpa: 0x2800)
Using gmac0 device
TFTP from server 192.168.1.192; our IP address is 192.168.1.185
Filename 'zImage'.
Load address: 0x21400000
Loading: #################################################################
         #################################################################
         #################################################################
         ##########################################
         2.7 MiB/s
done
Bytes transferred = 3477111 (350e77 hex)
U-Boot> go 21400000
## Starting application at 0x21400000 ...
Uncompressing Linux... done, booting the kernel.
Error: unrecognized/unsupported machine ID (r1 = 0x2bb61b6c).
Available machine support:
ID (hex)        NAME
ffffffff        Atmel SAMA5 (Device Tree)
Please check your kernel config and/or bootloader.
....
"
I think that I'm missing some  basic steps... Is there any instructions how to build/to load the kernel? Some troubleshooting step description? 
I would appreciate all help and advice! 
Thanks,
Michael.
P.S.  Sorry, if the question has been answered already.  I searched, but failed to find...
blue_z
Location: USA
Posts: 1764
Joined: Thu Apr 19, 2007 10:15 pm

Re: downloading the build from Yocto project...

Fri Jun 13, 2014 2:23 am

ma5645 wrote:I finished to build the Linux kernel, but attempt to run  - fails in the following way:  

I think that I'm missing some  basic steps
Yes, there are a few issues.
ma5645 wrote:U-Boot> tftpboot 21400000 zImage
Yes, `tftpboot` is the smart and fast method of testing out a new kernel.  
Except that U-Boot expects a uImage file, not a zImage.
The uImage is created from the zImage by applying the `mkimage` command.  
This can be done by `make uImage` when building the kernel, or by specification in Buildroot's menuconfig or Yocto's ??? (I don't use Yocto).  
Or are you using the zImage because you thought the `go` command seems to work better with zImage than uImage?
ma5645 wrote:U-Boot> go 21400000
## Starting application at 0x21400000 ...
Notice that U-Boot's response to your `go` command is "Starting application..."?  
You need to read up on U-Boot commands.  
The `go` command is for execution of "standalone" programs.  
For the Linux kernel, you need to use the `bootm` command so that memory buffers for ATAGs and the kernel command line can be prepared and/or registers are loaded to point to the initramfs and/or Device Tree blob.  
Since the registers for the machine ID and DTB were not loaded, you ended up with
ma5645 wrote:Error: unrecognized/unsupported machine ID (r1 = 0x2bb61b6c).
Use the `printenv` command to see what U-Boot would do with a `bootd` command, i.e. the bootcmd variable, and also inspect the bootargs variable. 

Regards
ma5645
Posts: 11
Joined: Sat May 24, 2014 5:33 am

Re: downloading the build from Yocto project...

Fri Jun 13, 2014 4:09 am

Thank you for the speedy reply!

>>> Except that U-Boot expects a uImage file, not a zImage.  
Oh... I thought that the Yocto is using mkimage to prepare file for uBoot...

>>>Or are you using the zImage because you thought the `go` command seems to work better with zImage than uImage? 

No, I thought that Yocto would prepare everything for uboot, since the uboot seems to be a 'de facto default final' loader...  Agreed, had to double check it.... ;(

>>>For the Linux kernel, you need to use the `bootm` command so that memory buffers for ATAGs and the kernel command line can be prepared and/or registers are loaded to point to the initramfs and/or Device Tree blob.   

Thanks,  I  suspected that the root of the problem within the chair in front of my computer! ;)
I'll try to correct, thanks for explanation!

>>>>`printenv` command to see what U-Boot would do with a `bootd` command, i.e. the bootcmd variable, and also inspect the bootargs variable.
U-Boot> printenv
baudrate=115200
bootargs=console=ttyS0,115200 earlyprintk mtdparts=atmel_nand:256k(bootstrap)ro,512k(uboot)ro,256K(env),256k(evn_redundent),256k(spare),512k(dtb),6M(kernel)ro,-(rootfs) rootfstype=ubifs ubi.mtd=7 root=ubi0:rootfs
bootcmd=nand read 0x21000000 0x180000 0x80000;nand read 0x22000000 0x200000 0x600000;bootz 0x22000000 - 0x21000000

You mentioned that you are not usisg Yocto... What would be the alternative? Debian? Any links for info? 

Thank a lot for the help! 
Michael.
blue_z
Location: USA
Posts: 1764
Joined: Thu Apr 19, 2007 10:15 pm

Re: downloading the build from Yocto project...

Fri Jun 13, 2014 4:53 am

ma5645 wrote:bootcmd=nand read 0x21000000 0x180000 0x80000;nand read 0x22000000 0x200000 0x600000;bootz 0x22000000 - 0x21000000
Correction to my previous comments.

You can use/load zImage instead of uImage, so long as you use the (new) `bootz` command instead of `bootm`.

The bootcmd indicates that you should load that zImage to address x22000000.
You should also be tftp'ing a DTB to address 0x21000000.
Note the hyphen in the `bootz`command to indicate an omitted value for an initramfs.
ma5645 wrote:You mentioned that you are not usisg Yocto...
I'm not working on an Explained board, so don't worry.
I am using Buildroot, which is considered an easier to use (but less sophisticated?) build environment.

BTW the boot program is spelled U-Boot. The form "uBoot" (as in microBoot) is never correct in any context.

Regards
ma5645
Posts: 11
Joined: Sat May 24, 2014 5:33 am

Re: downloading the build from Yocto project...

Fri Jun 13, 2014 5:45 am

The bootcmd indicates that you should load that zImage to address x22000000. 
You should also be tftp'ing a DTB to address 0x21000000. 
Note the hyphen in the `bootz`command to indicate an omitted value for an initramfs.
Thanks a lot!  
I managed to load the kernel build via Yocto... Still long way to go, but at least,  first step done...

Michael.

Return to “SAMA5-based”

Who is online

Users browsing this forum: Google [Bot] and 2 guests