I have been trying to compile imx-bootlets for past couple of hours for iMX-233 and very strange thing is happening:
power_prep bootlet is being compiled for v7 architecture while boot_prep is v5te. This is what readelf -a gives:
$readelf -A power_prep/power_prep Attribute Section: aeabi File Attributes Tag_CPU_name: "7-A" Tag_CPU_arch: v7 Tag_CPU_arch_profile: Application Tag_ARM_ISA_use: Yes Tag_THUMB_ISA_use: Thumb-2 Tag_FP_arch: VFPv3-D16 Tag_ABI_PCS_wchar_t: 4 Tag_ABI_FP_denormal: Needed Tag_ABI_FP_exceptions: Needed Tag_ABI_FP_number_model: IEEE 754 Tag_ABI_align_needed: 8-byte Tag_ABI_enum_size: small Tag_ABI_HardFP_use: SP and DP Tag_ABI_optimization_goals: Prefer Speed Tag_CPU_unaligned_access: v6 Tag_DIV_use: Not allowed $readelf -A boot_prep/boot_prep Attribute Section: aeabi File Attributes Tag_CPU_name: "5TE" Tag_CPU_arch: v5TE Tag_ARM_ISA_use: Yes Tag_THUMB_ISA_use: Thumb-1 Tag_ABI_PCS_wchar_t: 4 Tag_ABI_FP_denormal: Needed Tag_ABI_FP_exceptions: Needed Tag_ABI_FP_number_model: IEEE 754 Tag_ABI_align_needed: 8-byte Tag_ABI_align_preserved: 8-byte, except leaf SP Tag_ABI_enum_size: small Tag_ABI_optimization_goals: Prefer Speed Tag_DIV_use: Not allowed
Now, when I compile sb file ad boot it, it will not work since power_prep is first bootlet and it contains instruction specific to armv7.
I have tried ubuntu/linaro gnueabi, CodeSourcery none-eabi, and gcc 4.7.2 compiled with crosstool-ng for march=armv5t mtune=arm926ej-s, no luck.
However! I did have power_prep and boot_prep compiled using LTIB (I'm using those right now on my board with u-boot) and this is what readelf gives back:
$ readelf -A power_prep/power_prep_v4t Attribute Section: aeabi File Attributes Tag_CPU_name: "ARM9TDMI" Tag_CPU_arch: v4T Tag_ARM_ISA_use: Yes Tag_THUMB_ISA_use: Thumb-1 Tag_ABI_PCS_wchar_t: 4 Tag_ABI_FP_denormal: Needed Tag_ABI_FP_exceptions: Needed Tag_ABI_FP_number_model: IEEE 754 Tag_ABI_align_needed: 8-byte Tag_ABI_enum_size: int Tag_ABI_optimization_goals: Prefer Speed
Why would power_prep compile for v7, no matter what? I can't see any special switches or flags or whatever in makefiles.
Attached is output from last build, compiler is built for armv5te and arm926ej-s.
Original Attachment has been moved to: build.log.zip
Why don't you build U-boot mainline instead? U-boot mainline does contain the bootlets code built-in into U-boot.
There is currently support for mx23evk and mx23olinuxino boards.
My thought exactly: "why not do that?".
Basic idea was to get the bootlets to compile standalone and load some simple "whazzup" program just to confirm everything went fine. That way you have one piece of puzzle (bootlets) that works and then you use it as you build forward.
Figured, u-boot must use bootlets to work in mx23.
So I went to http://www.denx.de/wiki/U-Boot last night and about an hour later I was still reading through README's and makefiles and source code trying to figure out:
1. where support for mx23 is, and
2. how to compile the thing anyway??
Am I on the wrong site? Where is mainline u-boot code hosted? And where is mx23 support? It says in README "just type "make <board_name>_config"" but I don't know what string to put in place of <board_name>. Tried both mx23evk and mx23olinuxino, doesn't work. Tried names of the subfolders in board folder, not working. Tried names of include files from include/configs folder and it got me to a lot of errors (i.e. make mx28evk etc.)
So for starters:
Where can I find source of U-Boot that has support for mx23evk and mx23olinuxino?
Fabio, thanks for quick response!
We are still working on the documentation. In the meantime, please follow the steps below:
1. Get the U-boot source U-boot maintainer repository located at git://git.denx.de/u-boot-imx.git
2. Build U-boot:
- Export your toolchain
- make mx23_olinuxino_config or make mx23evk_config (depending on the board you have)
- make -j4 u-boot.sb
3. Flash the u-boot binary into the SD card:
dd if=u-boot.sb of=/dev/<sd>1 bs=512 seek=4
4. Place the SD card into mx23 board and power on the board.
If you face any issues in this process, please ask in the U-boot mailing list.
Thanks again Fabio,
Checked out u-boot-imx and it built without problems.
I see that arch / arm / cpu / arm926ejs / mxs is the place to look for bootlets for mx23. I will start with those sources and see how to build them standalone.
I was looking for folder named mx23 or mx25 before. Now I saw in u-boot-imx / borad / olimex / mx23_olinuxino and figured out that it uses bootlets from mxs folder.
(Off topic: I'm still little confused about mx23/25 and mxs: same platform or not?)
mxs is family of processors and it contains: mx23 and mx28
No need to build bootlets standalone, just generate the u-boot.sb binary, flash it to the board and boot it.
You can use git://git.denx.de/u-boot-testing.git :: mx233 branch, it contains the latest greatest code. It might be interesting for you to grab git://git.denx.de/mxsldr.git :: master branch , this tool will allow you to load u-boot.sb via USB OTG port of your board (if you have one that is , this will save you lots of mucking with the card ;-) )
Thanks Marek for mxsldr! I have already found sb_loader for linux but haven't tried it yet. Will give this one try also.
USB loader is one great tool compared to SD card
I managed to compile bootlets (I still don't know what was problem with first version, might be environment pollution ;o) and get sample bare metal app working with newlib.