UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Participant jamsoft
Participant
4,304 Views
Registered: ‎11-22-2016

customize u-boot

Jump to solution

Hello,

 

I am using Petalinux 2016.4 and what I need now is to customize the generated u-boot.elf file by adding my own board init code (I have a custom board).

 

Can someone point me to the file/files/directories where my code can be placed and where it will be included for the u-boot.elf file build with the "petalinux-build -c u-boot" command, please?

 

Thank you for any advices...

 

Jirka

Kindly note: please mark the Answer as "Accept as solution" if information provided is helpful and/or give Kudos to a post. Thank you!
0 Kudos
1 Solution

Accepted Solutions
Participant jamsoft
Participant
7,476 Views
Registered: ‎11-22-2016

Re: customize u-boot

Jump to solution

Finally, I've found the files I need!!!

 

My Krusader got always frozen while searching the text for the board_init() function and moreover, I've overlooked the board.c file within the search results when searching for files... I am getting old, blind or tired :-)

 

So the u-boot board.c file is located on the following path:

 

<project_root>/build/tmp/work/plnx_arm-xilinx-linux-gnueabi/u-boot-xlnx/v2016.07-xilinx+gitAUTOINC+0b94ce5ed4-r0/build/source/board/xilinx/zynq

 

Maybe it will help to someone in future...

 

Thanks to everyone for reading my post and trying find a solution :-)

 

Regards,

 

Jirka

Kindly note: please mark the Answer as "Accept as solution" if information provided is helpful and/or give Kudos to a post. Thank you!
0 Kudos
8 Replies
Explorer
Explorer
4,303 Views
Registered: ‎09-14-2016

Re: customize u-boot

Jump to solution

Hello,

 

If i remember rightly,

 

cp <your_src_dir>/ps7_init_gpl.{c,h} output/build/uboot-xilinx-v2016.4/board/xilinx/zynq/

 

Regards,

Trigger

0 Kudos
Participant jamsoft
Participant
4,293 Views
Registered: ‎11-22-2016

Re: customize u-boot

Jump to solution

Thank you for your fast reply.

 

I've found that there are 3 directories within the Petalinux project where the ps7_init_gpl.{c,h} are located:

 

1) <project_path>/components/plnx_workspace/device-tree-generation/ps7_init_gpl.c

2) <project_path>/components/plnx_workspace/fsbl_hwproj/ps7_init_gpl.c

3) <project_path>/project-spec/hw-description/ps7_init_gpl.c

 

Which one will be the best choice, please?

 

Regards,

 

Jirka

Kindly note: please mark the Answer as "Accept as solution" if information provided is helpful and/or give Kudos to a post. Thank you!
0 Kudos
Participant jamsoft
Participant
4,255 Views
Registered: ‎11-22-2016

Re: customize u-boot

Jump to solution

Really nobody who knows?

 

So I have another question that could solution for me - what I need to change to build uImage from the petalinux project insteed of image.ub, please?

 

Jirka

Kindly note: please mark the Answer as "Accept as solution" if information provided is helpful and/or give Kudos to a post. Thank you!
0 Kudos
Explorer
Explorer
4,242 Views
Registered: ‎09-14-2016

Re: customize u-boot

Jump to solution

I think the better is :

 

<project_path>/project-spec/hw-description/ps7_init_gpl.c

 

but i'm not sure because I build my custom OS with Yocto :S

 

You can also try one by one...

 

Regards,

Trigger

0 Kudos
Participant jamsoft
Participant
4,222 Views
Registered: ‎11-22-2016

Re: customize u-boot

Jump to solution

Thank you but no one of this three files is included in the u-boot.elf file build...

 

I am also using the Yocto build (Petalinux tools 2016.4).

 

I have found how to change some configuration, e.g. environment variables, etc. (inside the <project_root>/project-spec/meta-user/recipes-bsp/u-boot/files/platform-top.h) for the u-boot file but it is not what I need to achieve. I need to add custom code to make some settings to my hardware. I need this settings are made in u-boot, before the (peta)linux loading.

 

I have the settings defined in functions in the settings.c file I wrote. Before, I used the Linaro linux - there is a Bootloader project including a folder named "board" in which the board.c file is located. I've added my settings.c file inside this folder and made the "extern" declaration of the settings.c functions inside the board.c and calling of this functions inside the board.c "int board_init()" function. Everything was built and working fine.

 

Now I need move my project from the Linaro to the Petalinux . I am able to build everything and run the Petalinux on my custom board except my settings that need to be processed by u-boot.

 

I do not know which ".c" files are used for building the u-boot.elf. I can't find the equivalent of Linaro "board.c" file or the "board_init()" function.

 

Xilinx or other Petalinux experts, PLEASE, help me to solve this problem...

 

Thank you for every advices,

 

Jirka 

Kindly note: please mark the Answer as "Accept as solution" if information provided is helpful and/or give Kudos to a post. Thank you!
0 Kudos
Participant jamsoft
Participant
7,477 Views
Registered: ‎11-22-2016

Re: customize u-boot

Jump to solution

Finally, I've found the files I need!!!

 

My Krusader got always frozen while searching the text for the board_init() function and moreover, I've overlooked the board.c file within the search results when searching for files... I am getting old, blind or tired :-)

 

So the u-boot board.c file is located on the following path:

 

<project_root>/build/tmp/work/plnx_arm-xilinx-linux-gnueabi/u-boot-xlnx/v2016.07-xilinx+gitAUTOINC+0b94ce5ed4-r0/build/source/board/xilinx/zynq

 

Maybe it will help to someone in future...

 

Thanks to everyone for reading my post and trying find a solution :-)

 

Regards,

 

Jirka

Kindly note: please mark the Answer as "Accept as solution" if information provided is helpful and/or give Kudos to a post. Thank you!
0 Kudos
Visitor seethapp
Visitor
2,899 Views
Registered: ‎05-21-2013

Re: customize u-boot

Jump to solution

I'm in the process of migrating from Vivado/Petalinux 15.2 to 17.2. As mentioned here I have some custom changes in board.c and zynq_i2c.c. In the earlier versions the source is <plnx-projroot>/components/u-boot/u-boot-plnx. Once I make the changes they are permanent.  However with the Yocto there is no u-boot source. When I enter petalinux-config -c u-boot, It is creating the folder as mentioned above in the <plnx-projroot>/build/tmp/work/plnx_arm-xilinx-linux-gnueabi/u-boot-xlnx/v2017.01-xilinx+gitAUTOINC+5290eb544b-r0/build/ and I can drop my changes and build the u-boot. However on successful build it wipes out the source folder.

I am sure many of the users will have the custom changes and modify the u-boot as per their requirements. Where the new petalinux is expected to drop these changes? It looks to me it is fetching the changes from git repository.I hope it is bound to a tagged version and downloaded and resides locally.

 

Can someone shed some light on this

 

Thanks,

Seetharam

0 Kudos
Highlighted
Explorer
Explorer
446 Views
Registered: ‎06-03-2015

Re: customize u-boot

Jump to solution

Hi all,

This is done based on 

1. boot rom design

2. board_init_f()

3. board_init_r()

4. main loop()

First & Second are not able to reduce the code because they provides minimal functionality need for u-boot and board initlization,

third step talks about board_init_r (), peripherals required by board are intilized here, if you want to reduce boot code size, identify the Peripherals need in u-boot level and reduce it to minimal based on custom board.

Give kudos if the post is helpful.

Thanks & Regards

Satish G    

G Satish Kumar
0 Kudos