rebuilding uboot with flex-builder: my tricks

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

rebuilding uboot with flex-builder: my tricks

2,284 Views
john_reed
Contributor II

Here's some findings on u-boot some of you may find valuable.

Couple days ago I'm doing some low-level work, trying to get a SATA drive recognized on a layerscape platform (1043ardb).    I wanted to add both the 'sata' command and the 'scsi' command to u-boot.    Maybe start there, see what's what.

Ohhhhhh, fancy, shmancy tool called "flex-builder" to automate everything for me!!   Slam dunk.   30 minutes max.

About a day-and-a-half later, and a little frustration.....

After a bit of searching/reading/messing around, I settled on a 2-stage approach for rebuilding u-boot:

    flex-builder -c firmware -m ls1043ardb -b sd

    flex-builder -i mkfw -m ls1043ardb -b sd

The 1st one rebuilds the firmware pieces: which includes uboot.

The 2nd one creates the .img you burn to the sdcard with dd.

What I found was that I could indeed re-compile u-boot and it does build fine, but the changes would not get into the final image.      A simple example:  I tried changing the string "autoboot" to "Autoboat". (in common/autoboot.c).

Trick #1:  reconfiguring u-boot

     - File to edit is:  <product>_tfa_defconfig       (my mistake was thinking the file was:   <product>_sdcard_defconfig)

     - after eding the tfa_defconfig, manually delete this directory:

                           $FBDIR/build/firmware/u-boot/<product>/output/<product>_tfa_defconfig

     - rebuild u-boot with 3 stage approach (my Trick #2)

Trick #2:  2-stage approach from above changed to 3 stage approach:

    - rm -f $FBDIR/build/firmware/u-boot/ls1043ardb/uboot_<product>_tfa.bin

    - flex-builder -c firmware -m ls1043ardb -b sd

    - flex-builder -i mkfw -m ls1043ardb -b sd

That 'rm -f' statement forces the tfa configuration of u-boot to rebuild.   Without that, it doesn't rebuild.

Happy Layer-scaping!!

JR

Labels (1)
Tags (1)
2 Replies

1,554 Views
rkajave
Contributor I

where is this uboot source actually present? e.g. file common/autoboot.c

I did 

flex-builder -c firmware -m ls1028ardb -b sd  and

flex-builder -i mkfw -m ls1028ardb -b sd

assuming it will checkout uboot and other sources. but seems in build/firmware/u-boot/ls1028ardb/output/ls1028ardb_tfa_defconfig only generated files present, not .c files.

Also path packages/firmware, no uboot folder.

If if any config needs to be changed and rebuilt uboot i think need to change in components/firmware/uboot/configs/ls1028ardb_tfa_defconfig.

but if any source file need to change and rebuilt how to get source files, recompile and generate .bin so -i mkfw generates .img file with updated source .bin file?

 

0 Kudos
Reply

2,240 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello john Reed,

Thank you. I always use "rm -rf build/firmware/u-boot/<platform>/output/" when rebuilding u-boot.

Thanks,

Yiping