Booting linux from at91bootstrap failes

Moderator: nferre

mattthias
Posts: 3
Joined: Thu May 12, 2016 7:19 pm

Booting linux from at91bootstrap failes

Tue Jan 09, 2018 12:06 pm

Hello,

i want to boot a Linux kernel and DTB directly from at91bootstrap. The actual problem happens on a custom hardware but i can reproduce it on the SAMA5D3 Xplained evaluation board.

After copying kernel and dtb to the memory the uImage ssems to booting but the than the error message "Failed to load image" appears.

Code: Select all

  NAND: Image: Copy 0x3963a8 bytes from 0x200000 to 0x22000000
  NAND: dt blob: Copy 0x87ae bytes from 0x180000 to 0x21000000
  try zImage magic: 0x2e342d78 is found
  try uImage magic: 0x27051956 is found

  Booting uImage ......
  Relocating kernel image, dest: 0x20008000, src: 0x22000040
   ...... 0x396368 bytes data transferred

  Using device tree in place at 0x21000000
  NAND: Failed to load image
I checked that kernel and dtb are bootable using at91bootstrap and U-Boot. Anyone an idea what could be wrong here?


What i did:
  1. Build a Kernel from linux-at91 (tag: linux4sam_5.7) using the sama_defconfig

    Code: Select all

        git checkout -b matthias/linux4sam_5.7 linux4sam_5.7
        export ARCH=arm
        export CROSS_COMPILE=arm-linux-gnueabihf-
        make sama5_defconfig
        make -j4  LOADADDR=0x20008000 uImage dtbs
    
  2. Build at91bootstrap (with "Debug Level: even louder oputput")

    Code: Select all

        export CROSS_COMPILE=arm-linux-gnueabihf-
        git checkout -b matthias/v3.8.9 v3.8.9
        make mrproper
        make sama5d3_xplainednf_linux_image_dt_defconfig
        make menuconfig # (for Debug level)
        make
    
  3. Flashed the resulting binaries on the board using sam-ba 2.16
    Send Bootfile : sama5d3_xplained-nandflashboot-linux-image-dt-3.8.9.bin
    Send File to 0x180000: at91-sama5d3_xplained.dtb
    Send File to 0x200000: uImage
  4. Reset the board and watch the output:

    Code: Select all

      AT91Bootstrap 3.8.9 (Di 9. Jan 09:40:46 CET 2018)
    
      Auto-Config the TWI Bus by the board
      PHY: ETH0 PHY: Enter power down mode
      PHY: ETH1 PHY: Enter power down mode
      twi read: timeout to wait RXRDY bit
      twi read: timeout to wait RXRDY bit
      ACT8865: Disable ACT8865's I2C interface
      NAND: ONFI flash detected
      NAND: Manufacturer ID: 0x2c Chip ID: 0xda
      NAND: Page Bytes: 2048, Spare Bytes: 64
      NAND: ECC Correctability Bits: 4, ECC Sector Bytes: 512
      NAND: Disable On-Die ECC
      PMECC: version is: 0x112
      PMECC: page_size: 2048, oob_size: 64, pmecc_cap: 4, sector_size: 512
      NAND: Initialize PMECC params, cap: 4, sector: 512
      NAND: Image: Copy 0x3963a8 bytes from 0x200000 to 0x22000000
      NAND: dt blob: Copy 0x87ae bytes from 0x180000 to 0x21000000
      try zImage magic: 0x2e342d78 is found
      try uImage magic: 0x27051956 is found
    
      Booting uImage ......
      Relocating kernel image, dest: 0x20008000, src: 0x22000040
       ...... 0x396368 bytes data transferred
    
      Using device tree in place at 0x21000000
      NAND: Failed to load image
    



Best wishes,
Matthias
blue_z
Location: USA
Posts: 1784
Joined: Thu Apr 19, 2007 10:15 pm

Re: Booting linux from at91bootstrap failes

Tue Jan 09, 2018 11:44 pm

mattthias wrote:Anyone an idea what could be wrong here?
You've provided salient information except for details about your host environment, in particular the toolchain that you're using.
There have been a few instances where changing the toolchain resolved the boot issue, e.g. viewtopic.php?f=33&t=23932&start=15#p50096


Regards
mattthias
Posts: 3
Joined: Thu May 12, 2016 7:19 pm

Re: Booting linux from at91bootstrap failes

Wed Jan 10, 2018 10:11 am

Hello blue_z, hi *,
blue_z wrote: You've provided salient information except for details about your host environment, in particular the toolchain that you're using.
There have been a few instances where changing the toolchain resolved the boot issue, e.g. viewtopic.php?f=33&t=23932&start=15#p50096
thanks for the hint! Indeed i use gcc 6 ( https://releases.linaro.org/components/ ... ihf.tar.xz) on Debian GNU/Linux 9.3 (stretch).

Code: Select all

$ arm-linux-gnueabihf-gcc --version
arm-linux-gnueabihf-gcc (Linaro GCC 6.3-2017.05) 6.3.1 20170404

I'll install an older gcc version, try again and report back.

Best wishes,
Matthias
mattthias
Posts: 3
Joined: Thu May 12, 2016 7:19 pm

Re: Booting linux from at91bootstrap failes

Fri Jan 26, 2018 11:00 pm

Here is an update on my problem. As advised i changed the tool chain and tested the following:

- gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf
- gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf
- gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf

I realized that the non "hf" version was mentioned in the other topic and also tested that one:
- gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabi

and a self built tool chain:
- arm-linux-gcc (crosstool-NG 1.20.0) 4.9.1

I had no success so i just moved one minor version of at91bootstrap back (using v3.8.8 instead of the latest 3.8.9) and it worked. I can use whatever tool chain i want to compile at91bootstrap and can boot the Linux kernel directly from at91bootstrap.

So my solution for now: Stay away from at91bootstrap v3.8.9 and use v3.8.8.

I hope that helps somebody :).


Best wishes,
Matthias
queifaro
Posts: 14
Joined: Fri Dec 20, 2013 11:19 am

Re: Booting linux from at91bootstrap failes

Thu Feb 08, 2018 12:11 am

Hello,

uImage should be suitable for u-boot loading, so i think in that case you need to use zImage instead.

Also at91bootstrap can be configured using load Linux directly option ... using make menuconfig to check if your flashing address match both for kernel and dtb image address and size configured in at91bootstrap

I m involved in exactly same needs but on SAMA5D2.... so please share your progress.... if any...:)

Best
Fabio
blue_z
Location: USA
Posts: 1784
Joined: Thu Apr 19, 2007 10:15 pm

Re: Booting linux from at91bootstrap failes

Thu Feb 08, 2018 12:48 am

queifaro wrote:uImage should be suitable for u-boot loading, so i think in that case you need to use zImage instead.
AT91Bootstrap can handle either kernel image.

queifaro wrote:.... so please share your progress.... if any...:)
Seems like you didn't read or misread his last post.
Matthias isolated the problem, and is successful in booting Linux using AT91Bootstrap, so long as he uses the older 3.8.8 version.

Regards

Return to “SAMA5-based”

Who is online

Users browsing this forum: No registered users and 3 guests