README for Linux Device Tree kernels on AriaG25 =============================================== In this directory and below, there are several Linux kernels and associated support files for the Aria G25 by Acme Systems, see: http://www.acmesystems.it/aria These kernels use Device Tree (DT) configuration which is relatively new at the time of writing, at least for ARM processors and Atmel's AT91 family. These kernels and boot infrastructure are based on work by Robert Nelson (RN) which can be found at this site: http://www.eewiki.net/dashboard.action and specifically this page: http://www.eewiki.net/display/linuxonarm/AT91SAM9x5 Note that the Aria G25 board contains Atmel's AT91SAM9G25 SoC which is a member of a sub-family known as AT91SAM9x5. The author uses a 1 GB microSD card (ATP industrial grade) +++ with three partitions: - partition1: dos or vfat format, about 32 MB in size - partition2: ext4 (Linux) [most of the space] - partition3: Linux swap [optional, 64 MB ?] Following Acme's partition naming: - partition1: kernel - partition2: rootfs - partition3: swap There is a copy of the contents of my first partition in the partition1 directory under each kernel version (e.g. 310/partition1 ). At boot the AT91SAM9G25 SoC executes a file called "boot.bin" on the first partition of the microSD card (dos or vfat format required). In this case boot.bin is AT91Bootstrap from Atmel. That then looks for a file called u-boot.bin and its parameter file called uEnv.txt . Several versions of uboot are provided, the difference being if and how long they will wait for the user to interrupt the load with a key press. The live uboot file (i.e. u-boot.bin) waits 0 seconds (and should not allow the user to interrupt). And if uboot succeeds then it boots a file called zImage which it expects to be a Linux kernel. As configured in uEnv.txt it passes the at91-ariag25.dtb file to the kernel. "dtb" files are called Device Tree Blobs and they are compiled by dtc from source files with extensions "dts" or "dtsi". For ARM CPUs these magic configuration files are found in the /arch/arm/boot/dts directory. The author sometimes modifies at91-ariag25.dts and at91sam9x5.dtsi (from the patched source tree provided by RN) so if modified, they are provided. Best not to try to write dts/dtsi files from scratch, start with something that is close to the AriaG25 such as the at91sam9g25ek.dts which is a G25 evaluation board from Atmel. Configuring silicon in the G25 to be active or inactive after boot is relatively simple in some cases. For example, the second I2C host in silicon is activated by this line in at91-ariag25.dts i2c1: i2c@f8014000 { status = "okay"; }; To de-activate it change that to: i2c1: i2c@f8014000 { # status = "okay"; }; This works because an earlier included file (namely at91sam9x5.dtsi) contained this line for i2c1: 'status = "disabled";'. The latter status (in at91-ariag25.dts) overrides the former one. Watchdog support is a little tricky since once it is turned off, then it remains disabled until the next power cycle. And the boot.bin from RN's tree disables the watchdog. So in 310 there are now additionally boot.bin_no_wdt and boot.bin_wdt files either of which can be copied to boot.bin (and in 310 boot.bin is the same as boot.bin_no_wdt). Please change the MAC address (Ethernet) defined in the uEnv.txt file. Best to keep the first 3 bytes the same: my_ethaddr=00 04 25 aa bb cc Follow RN's instructions to build a root file system. In my experiments Debian 6.0 boots faster than Debian 7.0 . YMMV. Don't forget to modify /etc/fstab , /etc/network/interfaces and /etc/inittab as directed. Older, lk 2.6.38 vintage root file systems provided by Acme don't seem to work with RN's DT kernels, don't know why, typically freezing during the "loading Linux kernel" step. When RN's infrastructure is used to build kernels (and after the first build), 'cd ..../armv5_devel ; tools/rebuild.sh' will save you time); the results are placed in the deploy directory. For the lk 3.10 kernel (sometimes known as lk 3.10.0) these are important files: - 3.10.0-armv5-x0.16.zImage [becomes zImage in partition 1] - 3.10.0-armv5-x0.16-modules.tar.gz - 3.10.0-armv5-x0.16-dtbs.tar.gz [includes at91-ariag25.dtb] - dtbs/at91-ariag25.dtb [copied to dtbs folder on partition 1] The system.sh script file provided reflects that the author has an up to date git source tree from Linus Torvalds in his /home/dougg/linux-stable directory. It can be periodically updated with 'git pull'. The defconfig file becomes to kernel's ".config" file which configures the kernel build. In RN's tree defconfig should be placed in the armv5_devel/patches directory. Once there is is probably a good idea to overwrite the kernel's live .config file with: cd /patches cp defconfig ../KERNEL/.config Since RN's infrastructure is made of several parts, doing something like 'cd armv5_devel/KERNEL; git pull' will update the Linux kernel part of his infrastructure _but_ not his patches and other scripts ***. That can lead to confusion as some have found. The author just starts again producing a series of directories that look like: ..../310/armv5_devel Storage is cheap ... Note that these kernels are based on DT configuration files (e.g. at91-ariag25.dts and the files it includes). This is quite different from the patched kernels based on lk 2.6.38 that Acme Systems provide with the Aria G25 ****. Device tree is also known as Open Firmware and because is it very new in the Linux kernel (and for Atmel SoCs), good general documentation seems to be scarce. For DT syntax and some examples see: http://devicetree.org/Device_Tree_Usage There are kernel documentation files under the /Documentation/devicetree/bindings directory (e.g. look for files containing "atmel" or "at91"). As always documentation is "work in progress". Recently Atmel updated their Linux4Sam pages, see: http://www.at91.com/linux4sam/bin/view/Linux4SAM/ and they are now based on lk 3.6.9 . That is right at the infancy of DT for at91 devices. There have been lots of recent changes in DT support within the kernel and the dust is yet to settle; so unless Atmel have backported a lot of DT changes, then lk 3.6.9 is either DT less or has minimal DT support for the 9x5 sub-family. Networking problems =================== Sometimes when changing the Ethernet Mac address you can run into problems with the interface number. Due to the /etc/udev/rules.d/70-persistent-net.rules file the previous MAC address is remembered and the eth0 interface is reserved for the older MAC address while your new MAC address gets eth1. Since the root file systems expects only one Ethernet wired device at eth0 then wired Ethernet will appear not to work. The solution is to delete that file. Actually that file is such a pest that making an /etc/rc.local entry to delete it may be useful! Which system ============ 'cat /proc/cpuinfo' doesn't differentiate between AriaG25, FoxG20 and various other 9x5 sub-family SoCs and those closely related. Try 'cat /proc/device-tree/model' instead. See the at91-ariag25.dts config file to see where that comes from. Shifting kernel gpio numbers ============================ Beware: round about lk 3.3 the kernel GPIO pin numbering changed. Prior to that the origin was 32, so PA0 was kernel GPIO pin 32. Since lk 3.3 (including all kernels held hereunder) the origin is now 0, so PA0 is now kernel GPIO pin 0. Existing applications may need to be changed! ag25g20_utils ============= This is a package of Linux user space utilities for the AriagG25 and the FoxG20 boards. More generally it should work on AT91SAM9G25 (perhaps other members of the At91SAM9x5 sub-family) and AT91SAM9G20 based systems. See: http://sg.danny.cz/foxg20/ag25g20_utils/readme.txt The most recent tarball is: http://sg.danny.cz/foxg20/ag25g20_utils-0.96r10.tgz and the corresponding Debian binary package: http://sg.danny.cz/foxg20/ag25g20-utils_0.96-1_armel.deb D. Gilbert 20130708 Please send corrections and additions to dgilbert@interlog.com +++ it has been observed that larger microSD cards (e.g. some "HC" models) are flakier during boot. It seems various bootstrap programs read data from the SD card at the maximum allowable speed, and contain virtually no error recovery code; not a good combination *** RN's infrastructure has two git trees: the main tree whose root is the armv5_devel directory, and the second tree whose root is the armv5_devel/KERNEL directory **** Acme Systems is in the process of upgrading to DT kernels