Hardware/ARMEBS/3/Linux
m |
Marc.pignat (Talk | contribs) |
||
Line 1: | Line 1: | ||
− | {{ | + | {{public}} |
{{TOC right}} | {{TOC right}} | ||
Latest revision as of 14:42, 26 June 2015
|
GNU/Linux
Kernel features (as of r1416)
- kernel 2.6.26
- drivers
- serial ports
- buttons (sending keyboard events)
- S1..S4 sends KEY_A..D
- leds (can be driven by userland or by different kernel events (cpu_idle, timer, ...))
- /sys/class/leds/led0 is LD4
- /sys/class/leds/led1 is LD5
- documentation : [source:/linux/trunk/Documentation/leds-class.txt linux/Documentation/leds-class.txt]
- flash (mtd partitions)
- /dev/mtd0, 256ko, x10000000 - 0x10040000 is reserved for u-boot
- /dev/mtd1, 128ko, x10040000 - 0x10060000 is reserved for u-boot configuration data
- /dev/mtd2, 2Mo, 0x10060000 - 0x10026000 is for storing the kernel u-boot image
- /dev/mtd3, rest of 16Mo, 0x10260000 - 0x11000000 is space for a filesystem (romfs, jffs2, ...)
- usb host (storage, keyboard, mouse, bluetooth, wifi, ...)
- compact flash (storage)
- sd(io)/mmc (storage, wifi, ...)
- mezza_lcd (support 1 to 4 board at the same time)
- display in 8 or 16 bpp
- crt (maximum resolution 800x600)
- lcd (tested in 320x240, 640x480)
- keyboard
- touchscreen (drivers seems okay, but does not work with X11)
Links
- Fast Linux Boot
- Linux Kernel Command Line
- Linux root file system
- Writing drivers
Setup
- make sure you've setup a development environement
Kernel sources are stored into our subversion server
- Latest sources (trunk) : https://svn.hevs.ch/svn/uit/armebs3/linux/trunk
Compiling (since r641)
- Choose a place to work (for instance /opt/armebs3)
mkdir -p /opt/armebs3 cd/opt/armebs3
- Checkout the latest source [1]
svn checkout https://svn.hevs.ch/svn/uit/armebs3/linux/trunk armebs3_linux
- Set it up
cd armebs3_linux make armebs3_defconfig # restore default selection make menuconfig
- Make
make # will compile kernel and modules
Testing (TFTP version)
The kernel can be get from the network using u-boot. You need to set up some thinks to make this work.
- The host machine must have a tftp server, with your kernel (in a u-boot .img file)
- u-boot environment variable
- serverip must be set to the server IP address
- ipaddr must be set to the ARMEBS3 IP address
- then you can load the kernel
- tftpboot 0x21000000 uImage
- and execute it
- bootm 0x21000000
- don't forget to set the bootargs variable for setting the linux command line
- This can be run automatically at boot
- setenv bootcmd "tftpboot 0x21000000 uImage ; bootm 0x21000000"
The load process will show a timeout when used in the automatic way since the ethernet phy is powered off during the reset phase.
Installing (NFS version)
see NFS root for using an NFS server as root filesystem.
If your nfs root is at INSTALL_MOD_PATH=/opt/armebs3/nfs
1. copy the kernel
su -c "cp output/arch/arm/boot/uImage /opt/armeb3/nfs/"
2. install your new modules
su -c "make modules_install INSTALL_MOD_PATH=/opt/armebs3/nfs"
3. upgrading your kernel (the name of the mtd tools vary from snapgear to debian, {{{eraseall}}} becomes {{{flash_eraseall}}} and so on)
flash_eraseall /dev/mtd/2 cat uImage > /dev/mtd/2
Who made this ?
- The base kernel comes from http://www.kernel.org www.kernel.org
- The patches specific to the microcontroller of the ARMEBS3 comes from http://maxim.org.za/AT91RM9200/2.6 maxim.org.za/AT91RM9200/2.6
- Drivers, and board support have been written/patched/fixed by us.
Maintenance example from 2.6.22 to 2.6.23
- Insert the vanilla 2.6.23 kernel into svn
- Create branch/kernel.org/2.6.23 : svn cp https://svn.hevs.ch/svn/uit/armebs3/linux/branch/kernel.org/2.6.22 https://svn.hevs.ch/svn/uit/armebs3/linux/branch/kernel.org/2.6.23
- checkout and patch it (patch-2.6.23)
- svn add/remove changed files
- commit
- Now make our kernel the new one
- create a working dir svn cp https://svn.hevs.ch/svn/uit/armebs3/linux/branch/work/2.6.22 https://svn.hevs.ch/svn/uit/armebs3/linux/branch/work/2.6.23
- checkout
- merge changes, here is the subtility: we must diff kernel.org/2.6.22 against kernel.org/2.6.23, and apply the diff on work/2.6.23 : svn merge https://svn.hevs.ch/svn/uit/armebs3/linux/branch/kernel.org/2.6.22 https://svn.hevs.ch/svn/uit/armebs3/linux/branch/kernel.org/2.6.23 .
- resolve conflicts and commit
Naming convention
In this documentation, like in many other places, the "Linux" term is used (slightly improperly) as the name of an OS (operating system).
Linux is the name of the kernel, and GNU is the name (taken from the license name) of the tools.
An OS is exactly that: a kernel AND some tools for doing something.
So, the right notation should be "GNU/Linux" for the OS, but in this documentation Linux will be used.
Why GNU/Linux
The HEVs has choosen GNU/Linux because
- It exists and must be evaluated
- Linux is portable and this is a concern
- Linux has an enormous set of available open source applications and libraries for doing almost anything, but specialy interesting for us:
- Network capabilities (TCP/IP, ethernet, ...)
- Cryptography (https, ssl, ssh, ...)
- ...
External links
http://www.kernel.org The Linux kernel homepage::
http://www.gnu.org The GNU Operating System::
http://www.tldp.org The linux documentation project: A lot of HOWTO, and various documentation
http://www.lwn.net The linux weekly newsletter: Linux documentation, kernel in deph-documentation (including API changes between each minor versions), very technical and intresting
http://lwn.net/Kernel/LDD3/ O'reilly Linux Device Driver book: The book in PDF, good starting point, but not really up-to-date.
http://gcc.gnu.org The GNU compiler collection: Homepage of gcc
http://maxim.org.za/at91_26.html AT91RM9200 kernel patches : Patches for the Atmel AT91RM9200 mcu, before they're merged into the mainline kernel
http://www.snapgear.org Snapgear : Cross-compiled embedded Linux distribution
http://www.debian.org Debian : Home of the debian project and Linux distribution
http://subversion.tigris.org Subversion : The version control system we use
http://dsl.org/cookbook/cookbook_toc.html Linux cookbook : A good starting point for beginners