Changes

Jump to: navigation, search

U-booting Funtoo on the TI AM335x X2 SBC-B2

1,156 bytes added, 3 years ago
m
Introduction
Installing Funtoo to a Raspberry Pi is fun, but there are a lot more boards out there. For example, the carrier boards that hold a DIMM mounted AM335x series cpu. To get this going, we need to use the U-Boot bootloader, some knowledge of device tree blobs, and a lot of patience.
For this article, we are using this [http://www.goembed.com/index.php/Products/detail/tpid/49 board]. You can read all about it [https://www.dropbox.com/sh/qk4fligwqth7547/AADVvhXGAOxkbqFRKPP8eeSja/SBC335x-B2A?dl=0 here] but the steps depicted here should get you a manufacturer supplied 4.1.8 kernel with a Funtoo stage3 running on it. Possibly. Don't buy it if you don't absolutely need it. There are far better choices.
{{note|When you pick a board, documentation is just as important as hardware features. Without it, you WILL be hunting down someone in Shenzhen to explain why the board refuses to boot (you forgot to ground C8, of course).}}
== Making the Environment ==
Edit xcompile_variables to set XC_WORK, XC_LINUX_PREFIX, ARCH, CROSSDEV_TARGET, and STAGE3 variables to taste. For this board, we use:
* CROSSDEV_TARGET="arm-linux-gnueabihf"* ARCH=arm* STAGE3=funtoo-current/arm-32bit/armv7a_neon_hardfp* STAGE3_CFLAGS="-O2 -pipe -march=armv7-a -mfpu=neon -mfloat-abi=hard"* STAGE3_NAME=stage3-latest.tar.xz
{{console|body=
{{console|body=
# . xcompile_variables
# echo $KERNEL_VERSIONget_kernel_version
4.1.18
# set_kernel_extraversion = -defconfig && . xcompile_variables.sh
# get_kernel_version
4.1.18-defconfig
# cd $XC_KERNEL_SRC
# alias make="make -j<N>"
Setting XC_KERNEL_OLDCONFIG to /usr/src/fun_kernel/configs/<XC_LINUX_PREFIX>/4.1.18.kconf
# cp XC_KERNEL_OLDCONFIG .config
# ARCH=$ARCH CROSS_COMPILE=$CROSSDEV_TARGET- make zImage modules dtbs
}}
 
== U-Boot Building ==
== Setup Stage3 ==
Follow the steps in http://funtoo.org/Crossdev_Automation#Stage3_Configuration but do not set up a software clock. Our board has a hardware clock.
===Copy Over Kernel Files and Firmware===
# cp $XC_FIRMWARE/* $XC_STAGE3S/lib/firmware
# cp arch/arm/boot/zImage $XC_STAGE3S/boot
# get_kernel_release() { (cd cp arch/arm/boot/dts/*.dtb $XC_KERNEL_SRC ; ARCH=$ARCH CROSS_COMPILE=$CROSSDEV_TARGET- make kernelrelease;) }XC_STAGE3S/boot
# rm $XC_STAGE3S/lib/modules/`get_kernel_release`/{build,source}
}}
}}
Reboot! Moment of truth: do you really know what you are doing? {{tip|Once you get the board up and sshd running on it, then use rsync -e "ssh" $XC_STAGE3S/{boot,lib} <board_ip>:/ to do the kernel hacking. How long can you keep it up?}} == If It Boots... ===== Device Tree Fun ===This is important. In embedded world we need to always handle the relationship between the cpu and baseboard that carries it. We can use the u-boot shell to find this out. {{console|body==> bdinfoarch_number = 0x00000F8Cboot_params = 0x10000100DRAM bank = 0x00000000-> start = 0x10000000-> size = 0x80000000eth0name = FEC ethaddr = (not set)current eth = FEC ip_addr = <NULL>baudrate = 115200 bpsTLB addr = 0x8FFF0000relocaddr = 0x8FF4A000reloc off = 0x7874A000irq_sp = 0x8EF47EA0sp start = 0x8EF47E90FB base = 0x8EF4B7C0}} This structure is extremely useful in finding an appropriate device tree file so that the cpu can talk to the registers on the hardware and engage with interupts. It's pretty cool.
wiki-users
755
edits

Navigation menu