-
Notifications
You must be signed in to change notification settings - Fork 4
Setup
We are of course using patches on top of mainline u-boot and mainline kernel.
For now, we will use an sd-card as our storage.
dd if=/dev/zero of=/dev/mmcblk0 bs=1k count=1024
fdisk /dev/mmcblk0
This is what libv's 16GB sd cards look like:
Device Boot Start End Sectors Size Id Type /dev/mmcblk0p1 2048 264191 262144 128M c W95 FAT32 (LBA) /dev/mmcblk0p2 264192 31257599 30993408 14.8G 83 Linux
Now create filesystems:
mkfs.vfat /dev/mmcblk0p1
mkfs.ext4 /dev/mmcblk0p2
Creating a debian rootfs with debootstrap is described on the sunxi wiki.
If you are using a debian based operating system, you can just apt-get install a cross-compiler.
Since libv is using opensuse still, he had to go and get a tarballed toolchain from linaro.
This was untarred to /home/libv/fosdem/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf/bin/, and it's path was added to PATH:
export PATH="$PATH":/home/libv/fosdem/video-new/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf/bin/
Our version of U-boot is current with the latest official release, namely v2019-07.
The changes are:
- enabling the 3.5" LCD for boot status.
- adding GMAC_TX_DELAY=3 for the lime2's newer phyceiver
- disabling hdmi as we want uboot to only show on the lcd.
- enable simplefb
Clone the repo, master holds the relevant changes:
git clone https://github.com/libv/fosdem-video-u-boot
make CROSS_COMPILE=arm-linux-gnueabihf- A20-OLinuXino-Lime2-fosdem_defconfig
make -j4 CROSS_COMPILE=arm-linux-gnueabihf-
Clean:
dd if=/dev/zero of=/dev/mmcblk0 bs=1k count=1023 seek=1Install:
dd if=u-boot-sunxi-with-spl.bin of=/dev/mmcblk0 bs=1k seek=8
Add the file boot.cmd to the filesytem at /dev/mmcblk0p1:
fatload mmc 0 0x46000000 zImage
fatload mmc 0 0x49000000 sun7i-a20-olinuxino-lime2-fosdem.dtb
setenv bootargs console=ttyS0,115200 console=tty0 consoleblank=0 root=/dev/mmcblk0p2 rootwait panic=10 ${extra}
bootz 0x46000000 - 0x49000000
Now run to following to convert boot.cmd to boot.scr (mkimage is part of package u-boot-tools):
mkimage -C none -A arm -T script -d boot.cmd boot.scr
Our kernel is currently based on v5.2, and has the following changes on top:
- Enables the 3.5" LCD.
- Adds cedrus, a mpeg/h.264/h.265 encoder (unused)
- Adds a device specific config and devicetree.
- Adds the sun4i_csi1 capture driver.
- fix hdmi clocking to work with u-boot ignoring hdmi
- fix lcd simplefb setup so the panel does not bleed and so it keeps its backlight enabled
- fixes all sorts of kms issues
git clone https://github.com/libv/fosdem-video-linux
Configure:
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- sunxi_fosdem_defconfig
Build:
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j4 zImage modules dtbs
Copy arch/arm/boot/zImage to the boot partition at mmcblk0p1.
Copy arch/arm/boot/dts/sun7i-a20-olinuxino-lime2-fosdem.dtb to the boot partition at mmcblk0p1.
Assuming that mmcblk0p2 is mounted at /mnt, run
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j4 INSTALL_MOD_PATH=/mnt/ modules_install
Our current test code contains two utilities, one for outputting a test image using KMS, and for capturing it and verifying it contents using V4L2.
It will run on the target devices. I used a banana-pi for hdmi output, and the lime2 with adapter for input. So it is best to clone and build the small utilities there.
You will want to install a few packages:
- build-essential
- git
git clone https://github.com/libv/fosdem-video-hdmi-test
make
Run the following to display 1 million frames.
./hdmi_output 1000000
./hdmi_capture