commit | 96892737184c6b7b599abc246e5c09e0e3bf2664 | [log] [tgz] |
---|---|---|
author | Jan Kundrát <jan.kundrat@cesnet.cz> | Wed Jan 24 15:39:26 2018 +0100 |
committer | Jan Kundrát <jan.kundrat@cesnet.cz> | Thu Jan 25 16:29:58 2018 +0100 |
tree | d61dcd07a45c8741404e10c143205fbe0ae1a79a | |
parent | 4e36c34faef0389b110a12368b0d84ca9631a964 [diff] |
clearfog: Do not mess with the SPI direct mode I re-read the datasheet, and it seems that the direct mode is really meant to transactions which somehow target SPI flash. The protocol talks about addresses and headers and dummy bytes which exactly correspond to SPI NOR flash IO protocol. It is possible to turn these off and transfer raw data, though. When combined with a CS GPIO, this thing breaks horribly. I've seen my logic analyzer saying that the CS pin went up in the middle of a second byte, etc. That wasn't fun. Going further, the Linux kernel commit b3c195b3a75b which added the direct-mode feature explicitly talks about writes being tested, and reads being supported, but untested. That's weird because I just cannot see how that piece of code implements any reads. It seems that support for reads actually got removed in a v4 posting of this patch, but the commit message was never updated. Yay. This reverts commit 8fd3c5d035fba6e4294f6ae57b974477bf97ef94. Change-Id: Ic3e0939fcafcc94f15eb142ad53a89b66dff2714 Link: https://patchwork.kernel.org/patch/9124561/
This repository contains CzechLight-specific bits for Buildroot. Buildroot is a tool which produces system images for flashing to embedded devices. They have a nice documentation which explains everything that one might need.
Everything is in Gerrit. One should not need to clone anything from anywhere else. The build will download source tarballs of various open source components, though.
TODO: Automate this via the CI system. I want to get the .img
files for testing of each change, eventually.
git clone ssh://$YOUR_LOGIN@cesnet.cz@gerrit.cesnet.cz:29418/CzechLight/br2-external czechlight pushd czechlight git submodule update --init --recursive popd mkdir build-clearfog cd build-clearfog ../czechlight/dev-setup-git.sh make czechlight_clearfog_defconfig make
A full rebuild takes between 30 and 45 minutes on a T460s laptop for targets which use a pre-generated Linaro toolchain (clearfog
, beaglebone
). Other targets take longer because one has to build a toolchain first. When the build finishes, the generated image to be dd
-ed to an SD card is at images/sdcard.img
.
WARNING: Buildroot is fragile. It is not safe to perform incremental builds after changing an "important" setting. Please check their manual for details.
A significant amount of time is wasted in configure
steps which are not parallelized :( as of November 2017. This can be hacked by patching Buildroot's top-level Makefile
, but note that one cannot easily debug stuff afterwards.
diff --git a/Makefile b/Makefile index 79db7fe..905099a 100644 --- a/Makefile +++ b/Makefile @@ -114,7 +114,7 @@ endif # this top-level Makefile in parallel comment the ".NOTPARALLEL" line and # use the -j<jobs> option when building, e.g: # make -j$((`getconf _NPROCESSORS_ONLN`+1)) -.NOTPARALLEL: # absolute path TOPDIR := $(CURDIR)
Also, we are building two different root filesystem instances (an EXT4 image and a tarball for RAUC). This is also currently broken, but we can work around that reasonably easily:
make -j32 target-finalize && make
Apart from the traditional way of re-flashing the SD card or the eMMC from scratch, it's also possible to use RAUC to update. This method preserves the U-Boot version and the U-Boot's environment. Apart from that, everything starting with the kernel and the DTB file and including the root FS is updated. Configuration stored in /cfg
is brought along and preserved as well.
To install an update:
# build node make rsync -avP images/update.raucb somewhere.example.org:path/to/web/root # target, perhaps via an USB console wget http://somewhere.example.org/update.raucb -O /tmp/update.raucb rauc install /tmp/update.raucb reboot