cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
12,237 Views
Registered: ‎02-06-2015

Custom u-boot in PetaLinux

Hello!

 

I am new to PetaLinux development and running into an issue trying to use custom u-Boot source.

 

I am following the instructions from here:  http://www.wiki.xilinx.com/PetaLinux+Getting+Started

It tells me to place new source to <PROJECT_ROOT>/components/

 

linux-host> git clone git://github.com/Xilinx/u-boot-xlnx.git
linux-host> cd u-boot-xlnx

 

I checked out xilinx version of uBoot and placed it in components/u-boot/u-boot-xlnx

 

I then ran petalinux-config and selected u-boot-xlnx as my new u-boot source.

 

When I run petalinux-build I get an error though:

 

[localhost Avnet-Digilent-ZedBoard-2014.4]$ petalinux-build -c u-boot
INFO: Checking component...
INFO: Generating make files and build linux/u-boot
INFO: Generating make files for the subcomponents of linux/u-boot
INFO: Building linux/u-boot
[INFO ] update linux/u-boot source
[INFO ] generate linux/u-boot configuration files
[ERROR] make[3]: *** [zynq_zc70x_defconfig] Error 1
[ERROR] make[2]: *** [zynq_zc70x_config] Error 2
[ERROR] make[1]: *** [sub-make] Error 2
ERROR: Failed to build linux/u-boot

 

build/build.log contains the following lines:

 

[ALL ] make[2]: Entering directory `/home/axion/Avnet-Digilent-ZedBoard-2014.4/
build/linux/u-boot/u-boot-xlnx'
[ALL ] GEN ./Makefile
[ALL ] drivers/Kconfig:3: can't open file "drivers/core/Kconfig"
[ERROR] make[3]: *** [zynq_zc70x_defconfig] Error 1
[ERROR] make[2]: *** [zynq_zc70x_config] Error 2
[ALL ] make[2]: Leaving directory `/home/axion/Avnet-Digilent-ZedBoard-2014.4/b
uild/linux/u-boot/u-boot-xlnx'
[ERROR] make[1]: *** [sub-make] Error 2
[ALL ] make[1]: Leaving directory `/home/axion/Avnet-Digilent-ZedBoard-2014.4/b
uild/linux/u-boot/src/u-boot-xlnx'
[ALL ] make: *** [/home/axion/Avnet-Digilent-ZedBoard-2014.4/build/linux/u-boot
/u-boot-xlnx/include/config.h] Error 255
[ALL ] make: Leaving directory `/home/axion/Avnet-Digilent-ZedBoard-2014.4/buil
d/linux/u-boot'

 

Apparently u-boot source was never copied to <PROJECT_ROOT>/build folder.  Is there anything else I should do?  

 

I'd like to be able to use petalinux tools (petalinux-build, petalinux-package, etc.) since it is very straight-forward.  Plus it is very convenient to have configuration files in subsustems/linux/configs

 

Thank you very much.

 

Tags (1)
0 Kudos
5 Replies
Xilinx Employee
Xilinx Employee
12,184 Views
Registered: ‎12-17-2007

Welcome to embedded Linux!  the instructions you're following are for build-from-scratch Linux, not PetaLinux.  Both are valid ways to build Linux but they are not equivalent.  For PetaLinux to build a custom U-Boot, specify the Git repository you'd like to use in the top-level configuration (eg, "petalinux-config" at the terminal prompt) rather than downloading on your own as you did here.

-------------------------------------------
this space intentionally left blank
0 Kudos
Highlighted
Observer
Observer
12,177 Views
Registered: ‎01-19-2015

Petalinux will do all the heavy lifting for you with respect to aquiring the source files and compiling them.  I found this tutorial pretty useful for creating a baseline sytem. 

 

ug1156-petalinux-tools-workflow-tutorial.pdf

 

After you get a baseline system up and running, to change the source for say u-boot, go this directory in your petalinux installation and edit the code that you want to change.

 

{PETALINUX_INSTALLATION}/petalinux-v2014.4-final/components/u-boot/u-boot-plnx

 

Then, you can try it out by issuing the following commands.  When you ask petalinux to re-build it pulls differences from the installation directory mentioned.

 

petalinux-build -c u-boot -x mrproper

petalinux-build -c u-boot

petalinux-boot --jtag --u-boot

 

Nathan

 

 

0 Kudos
Highlighted
Visitor
Visitor
12,088 Views
Registered: ‎02-06-2015

Thank you!

 

However, I run into the same problem when I exectue petalinux-build -c u-boot

 

 

[axion@localhost u-boot-xlnx]$ petalinux-build -c u-boot
INFO: Checking component...
INFO: Generating make files and build linux/u-boot
INFO: Checking if the remote url is a valid git remote repository!
INFO: Fetching remote component u-boot
Cloning into '/home/axion/Avnet-Digilent-ZedBoard-2014.4/build/linux/u-boot/download/u-boot-xlnx'...
remote: Counting objects: 11271, done.
remote: Compressing objects: 100% (9828/9828), done.
remote: Total 11271 (delta 1749), reused 5145 (delta 1093), pack-reused 0
Receiving objects: 100% (11271/11271), 13.39 MiB | 325.00 KiB/s, done.
Resolving deltas: 100% (1749/1749), done.
INFO: Generating make files for the subcomponents of linux/u-boot
INFO: Building linux/u-boot
[INFO ] update linux/u-boot source
[INFO ] generate linux/u-boot configuration files
[ERROR] make[3]: *** [zynq_zc70x_defconfig] Error 1
[ERROR] make[2]: *** [zynq_zc70x_config] Error 2
[ERROR] make[1]: *** [sub-make] Error 2
ERROR: Failed to build linux/u-boot

 

=========================

From build.log:

 

 

[INFO ] generate linux/u-boot configuration files
[ALL ] make O=/home/axion/Avnet-Digilent-ZedBoard-2014.4/build/linux/u-boot/u-b
oot-xlnx -C /home/axion/Avnet-Digilent-ZedBoard-2014.4/build/linux/u-boot/src/u-
boot-xlnx -j2 zynq_zc70x_config || exit 255
[ALL ] make[1]: Entering directory `/home/axion/Avnet-Digilent-ZedBoard-2014.4/
build/linux/u-boot/src/u-boot-xlnx'
[ALL ] make[2]: Entering directory `/home/axion/Avnet-Digilent-ZedBoard-2014.4/
build/linux/u-boot/u-boot-xlnx'
[ALL ] GEN ./Makefile
[ALL ] HOSTCC scripts/basic/fixdep
[ALL ] HOSTCC scripts/kconfig/conf.o
[ALL ] SHIPPED scripts/kconfig/zconf.tab.c
[ALL ] SHIPPED scripts/kconfig/zconf.lex.c
[ALL ] SHIPPED scripts/kconfig/zconf.hash.c
[ALL ] HOSTCC scripts/kconfig/zconf.tab.o
[ALL ] HOSTLD scripts/kconfig/conf
[ALL ] drivers/Kconfig:3: can't open file "drivers/core/Kconfig"
[ERROR] make[3]: *** [zynq_zc70x_defconfig] Error 1
[ERROR] make[2]: *** [zynq_zc70x_config] Error 2
[ALL ] make[2]: Leaving directory `/home/axion/Avnet-Digilent-ZedBoard-2014.4/b
uild/linux/u-boot/u-boot-xlnx'
[ERROR] make[1]: *** [sub-make] Error 2
[ALL ] make[1]: Leaving directory `/home/axion/Avnet-Digilent-ZedBoard-2014.4/b
uild/linux/u-boot/src/u-boot-xlnx'
[ALL ] make: *** [/home/axion/Avnet-Digilent-ZedBoard-2014.4/build/linux/u-boot
/u-boot-xlnx/include/config.h] Error 255
[ALL ] make: Leaving directory `/home/axion/Avnet-Digilent-ZedBoard-2014.4/buil
d/linux/u-boot'

 

drivers/Kconfig file does contain a line 'source "drivers/core/Kconfig"' however, there is no folder named 'core' in under u-boot-xlnx/drivers

 

 

0 Kudos
Highlighted
Visitor
Visitor
11,743 Views
Registered: ‎06-01-2015

Hello,

 

I have the same problem with the external u-boot from github. I downloaded it from github and changed the u-boot in petalinux-config. Also I changed the custom target in petalinux-config to zynq_zed, but the problem still remains.

 

Maybe someone can help us ;)

0 Kudos
Highlighted
Explorer
Explorer
11,591 Views
Registered: ‎06-05-2014

To me this looks ilke a bug in the toolchain not copying over the source files. As a workaround what I did was to simply run it once, then let it fail. Then copy the source files over manually once the directory is in place

So...

cd build/linux/u-boot/u-boot-xlnx/source

rm *

cp -r <directory you have your u-boot checked out to>/u-boot-xlnx/* .

 

then

petalinux-build -c u-boot

 

hopefully this gets fixed in 2015.2, which should be out pretty soon.

0 Kudos