User Tools

Site Tools


making_kernel_with_dtb

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
making_kernel_with_dtb [2012/12/06 20:23] 78.122.157.53making_kernel_with_dtb [2013/06/12 08:01] (current) starox
Line 1: Line 1:
 ====== Introduction ====== ====== Introduction ======
  
-Since Linux x.y.z, the kernel support arm devices via a device tree.+Since Linux 3.y.z, the kernel support arm devices via a device tree.
 The idea behind is to make an unique kernel which supports every platforms. The idea behind is to make an unique kernel which supports every platforms.
 This tree describe the devices of the platform in order to initialize them. This tree describe the devices of the platform in order to initialize them.
Line 13: Line 13:
  
 ^ Distribution name ^ toolchain provider ^ commands to get mkimage command ^ toolchain triplet ^ ^ Distribution name ^ toolchain provider ^ commands to get mkimage command ^ toolchain triplet ^
-| Ubuntu 12.10 | ubuntu |sudo apt-get install arm-linux-gnueabi-gcc | arm-linux-gnueabi- |+| Ubuntu >= 12.10 | ubuntu |sudo apt-get install arm-linux-gnueabi-gcc | arm-linux-gnueabi- |
 | Debian squeeze | [[http://www.emdebian.org/|embedian]] | Follow instruction on [[http://www.emdebian.org/crosstools.html]] or [[http://wiki.debian.org/EmdebianToolchain]] \\ The quick way : \\ ''# echo "deb http://www.emdebian.org/debian/ squeeze main" >> etc/apt/sources.list\\ # apt-get update\\ # apt-get install emdebian-archive-keyring\\ # apt-key add /usr/share/emdebian-tools/emdebian-archive-keyring.gpg\\ # apt-key add /usr/share/keyrings/emdebian-archive-keyring.gpg\\ # apt-get update\\  # apt-get install gcc-4.4-arm-linux-gnueabi'' | arm-linux-gnueabi- | | Debian squeeze | [[http://www.emdebian.org/|embedian]] | Follow instruction on [[http://www.emdebian.org/crosstools.html]] or [[http://wiki.debian.org/EmdebianToolchain]] \\ The quick way : \\ ''# echo "deb http://www.emdebian.org/debian/ squeeze main" >> etc/apt/sources.list\\ # apt-get update\\ # apt-get install emdebian-archive-keyring\\ # apt-key add /usr/share/emdebian-tools/emdebian-archive-keyring.gpg\\ # apt-key add /usr/share/keyrings/emdebian-archive-keyring.gpg\\ # apt-get update\\  # apt-get install gcc-4.4-arm-linux-gnueabi'' | arm-linux-gnueabi- |
  
Line 19: Line 19:
 ====== Setting up kernel source ====== ====== Setting up kernel source ======
  
-Get the source from lacie-nas.org :+There is 2 kind of LaCie devices : 
 +  * those supported by the mainstream linux kernel 
 +  * those supported by the lacie-nas.org kernel 
 +  * those unsupported ;-)
  
-  git clone git://lacie-nas.org/linux-lacie.git+Here is some commands to get kernel source from a git repository although there are other way to get the mainstream kernel.\\  
 +These repositories ensure that you have the latest updates.
  
-As DTB is not yet in mainstream for marvell platforms, you need to check out the DTB branch +===== Mainstream =====
-   +
-  cd linux-lacie +
-  git checkout -b remotes/origin/kirkwood/master+
  
-====== Making kernel =====+Get the source from the  [[https://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=summary|git kernel repository]] :
  
-Next build your kernel with your toolchain here is for kirkwood :+  git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git -b master 
 + 
 +===== Lacie-nas.org ===== 
 + 
 +Get the source from the [[http://git.lacie-nas.org/?p=linux-lacie.git;a=summary|lacie-nas git repository]] : 
 + 
 +  git clone git://lacie-nas.org/linux-lacie.git -b kirkwood/master 
 + 
 +If a work is on-going on a board, then a dedicated branch is created. This branch shoud be up-to-date (and maybe also unstable). For example, for a LaCie CloudBox, you may use the branch kirkwood/cloudbox. 
 + 
 +====== Building kernel ====== 
 + 
 +First, you have to get a kernel configuration for your kernel version and your board. The default configurations for LaCie boards (Orion and Kirkwood) are available [[ftp://lacie-nas.org/kernel/config|in our FPT repository]]. Pick-up the one which suits you best. 
 + 
 +For example, to configure a Linux 3.7.x kernel for a Kirkwood based LaCie boards: 
 + 
 +  cd lacie-linux.git 
 +  wget ftp://lacie-nas.org/kernel/kirkwood/linux_3.7.0-rc6_kirkwood_lacie_defconfig -O .config 
 +  make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- oldconfig 
 + 
 +If you are not happy with our default configurations, you can use the one provided with the kernel. For Kirkwood boards: 
 + 
 +  make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- kirkwood_defconfig 
 +   
 +Now, you can build your kernel:
  
-  make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-  kirkwood_defconfig 
   make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-   make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-
  
 This will build kernel image, and dtb for all kirkwood platforms. This will build kernel image, and dtb for all kirkwood platforms.
  
-====== Preparing kernel for u-boot ======+====== Preparing kernel for U-Boot ======
  
 Now you have to append the DTB to kernel. Now you have to append the DTB to kernel.
-DTB are in the arch/arm/boot/ directory. Choose the one corresponding to your device ( here this is a network space 2 lite ) :+DTB are in the arch/arm/boot/ directory. Choose the one corresponding to your device (here this is a network space 2 lite) :
  
-  cat arch/arm/boot/zImage arch/arm/boot/kirkwood-ns2lite.dtb > zImage+kirkwood-ns2lite.dtb+  cat arch/arm/boot/zImage arch/arm/boot/dts/kirkwood-ns2lite.dtb > zImage+kirkwood-ns2lite.dtb
  
 Now you need to add an header for u-boot loader.  Now you need to add an header for u-boot loader. 
making_kernel_with_dtb.1354821783.txt.gz · Last modified: 2012/12/06 20:23 by 78.122.157.53