BUilding everything from scratch (buildroot) - Printable Version +- PINE64 (https://forum.pine64.org) +-- Forum: ROCK64 (https://forum.pine64.org/forumdisplay.php?fid=85) +--- Forum: General Discussion on ROCK64 (https://forum.pine64.org/forumdisplay.php?fid=86) +--- Thread: BUilding everything from scratch (buildroot) (/showthread.php?tid=6767) |
BUilding everything from scratch (buildroot) - lm- - 11-10-2018 Hi, I bought rock64 and now I am trying to prepare very minimal script that will build all steps from scratch. Intend is to publish it to buildroot repository later. But I have problem booting kernel. Some information what have I already done and where I am stuck. 1. tpl, spl and uboot are build from ayufan repository, branch "2017.09-rockchip-ayufan-1035-gd646df03ac", and "rock64-rk3328_defconfig", no changes have been made to the files. To create tpl/spl image I use these commands (this is flashed to 0x40). Note, no rockchip binary blobs anywhere! Code: $MKIMAGE -n rk3328 -T rksd -d $BINARIES_DIR/u-boot-tpl.bin $BINARIES_DIR/u-boot-tpl.img 2. then ATF is built, also from ayufan repository and "rk3328" as a platform. Generated BL31 is used to generate u-boot.itb (with make u-boot.itb from ayufan repo). That u-boot.itb is flashed to 0x200 on sdcard. 3. Kernel, no surprise here, it's from ayufan repo, "rockchip_linux_defconfig" used and "rockchip/rk3328-rock64" dts from in-tree, again no changes have been made. 4. Now sdcard image is generated with this config: Code: image sdcard.img { It's in mbr dos format (so no gpt). On rootfs there is extlinux, Image and dtb in /boot directory. 5. Toolchain is gcc 7.x and binutils 2.29.x. Now logs, Code: <debug_uart> U-Boot TPL board init And that's it. No more output and I am completaly out of ideas how to proceed. u-boot properly boots, it finds my kernel and dtb, it loads it but it fails to boot it. Kernel and dtb are good, I downloaded slackware image for rock64 and replaced Image and dtb, and it started - I could see todays date and my build host in kernel message, so it's enough of a proof linux and dtb are generated properly. Anybody got any idea what am I missing? I was thinking that it might be mbr instead of gpt or missing initrd, but slackware image doesn't use them as well. I would appreciate any advice or ideas how to proceed with that. RE: BUilding everything from scratch (buildroot) - lm- - 11-11-2018 I found what was wrong. Buildroot by default used build/rk3328/release/bl31.bin file, and uboot needs build/rk3328/release/bl31/bl31.elf. Somehow bl31.bin was enough for the u-boot to start, but not for kernel. Also it works with mainline kernel and mainline ATF. RE: BUilding everything from scratch (buildroot) - lm- - 02-04-2019 Hi, If someone is interested I've published my patch for rock64 board to work with buildroot. Default config uses mainline stuff whenever possible, the only forked thing is uboot from ayufan, both kernel and atf are taken from mainline. Patch can be downloaded from here: http://patchwork.ozlabs.org/patch/1035643/ Note, you also need this patch as dependency: http://patchwork.ozlabs.org/patch/996196/ If you use buildroot, or would like to use rock64 with buildroot, and you have some spare time, please test and review those patches, so they can be accepted into buildroot. Thanks. RE: BUilding everything from scratch (buildroot) - LMM - 02-06-2019 Hello, I am interested in testing your patch but I don't know how (I am really a newbie in image building). In fact I am interested because I would like to try to flash an image on a sd or mmc card after having booted a minimal kernel through ethernet (I was unable to boot the regular images - Debian, ubuntu, Armbian - directly from ethernet : the boot starts but I could not obtain a console). Where can I find the procedure ? LMM. RE: BUilding everything from scratch (buildroot) - hisstone - 03-11-2019 Thanks a lot for your share! I am also interested for testing the method, but not sure how to compile u-boot and kernel based on ayufan repository, Can you share your build method for it? RE: BUilding everything from scratch (buildroot) - hisstone - 03-12-2019 I have compiled buildroot success using the buildroot.2019.02 download from buildroot web site and compile using rock64_defconfig, then write output/image files( loader1 = u-boot-tpl-spl.img, loader2 = u-boot.itb ) to SD card, console error log: <debug_uart> U-Boot TPL board init data training error col error LPDDR3 DRAM frequency: 800MHz data training error Can you help me explain this info? How to fix it? RE: BUilding everything from scratch (buildroot) - lm- - 04-11-2019 Hi @hisstone, sorry for not replying, kinda forgot about that topic, and notification didn't reach me, hmm. Did you fix this problem? If not, do you flash generated sdcard.img or do you flash it manually? There should be sdcard.img which has all ofset in place, so it's as easy as dd if=sdcard.img of=/dev/mmcblkp0 I'll try to compile with buildroot 2019.2 and check this out. @LMM Patch has been merged into buildroot, but if you still want to test this, steps are really easy. Clone newest buildroot, then Code: make rock64_defconfig Just make sure /dev/mmcblk0 (or /dev/sdb if you are using usb2mmc coverter) is really your sd card, or you can mess up your disk! RE: BUilding everything from scratch (buildroot) - lm- - 04-11-2019 Hi @hisstone I've built rock64_defconfig with 2019.02 and I have no problem booting image. Make sure you use sdcard.img file and not "u-boot-tpl-spl.img" and familly. If using sdcard.img doesn't work then I have no clue what might be wrong. You might want to look into "drivers/ram/rockchip/sdram_rk3328.c" file. In line 372 there is data_training(), you can try adding there some printf()s to know what is going on. Maybe there is something wrong with DDRAM? Check if increasing time to ram to train from 50usec to 200usec fixes the issue. RE: BUilding everything from scratch (buildroot) - hisstone - 07-12-2019 hi, @lm- sorry for reply the testing result delay. I have make image success with the buildroot-2019.02 version, and using sdcard.img with sd card. but the system booting with this error below: note my rock64 hardware with 1G DDR and the hw version is 2.0. the system reset again and again with below messages: Code: U-Boot 2017.09 (Jul 11 2019 - 16:27:30 +0800) RE: BUilding everything from scratch (buildroot) - tomarm - 01-23-2020 I just built ayufans latest 4.4.20x kernel and u-boot from his repo's successfully on the rock64 board not in qemu. I ran stuff like make blah_defconfig for both and it worked. Now I am sitting here wondering....great ya fumbled through that...now how are you gonna get that stuff onto the usb3 laptop hdd you have hanging off the board that has free space at the beginning and has a Linux from Scratch systemd build that's sitting on sda2. I assume I have to dd in the 3 (?) required boot .img files I should have from building u-boot. That's where I'm at and it's the limit of my knowledge on doing this stuff. I previously built LFS and used ARch arm's uboot and kernel with no problem but Arch arm rootfs and kernel leave alot to be desired as far as correct setting of parameters (bad usb3, nic, ram mem speed drivers/configs) to successfully compile source pkgs the way armbian does. That's the why of all this ayufan building fyi. I think I got pretty far for a beginner with a source build of linux. Now that I've written what I have can someone help me finish this process? Or should I start a new tread? I felt this thread has good background so I posted here. I can't find anything else on this but this thread that assumes alot of things the reader would know. Thanks |