This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| making_kernel_with_dtb [2012/12/06 20:17] – 78.122.157.53 | making_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 device | + | Since Linux 3.y.z, the kernel support arm devices |
| - | The idea is to make one kernel which supports | + | The idea behind |
| - | The bootloader passes a device tree binary (DTB) to Linux, describing the platform. | + | This tree describe the devices of the platform |
| + | |||
| + | The bootloader passes a device tree binary (DTB) to Linux. | ||
| If the bootloader can't pass the DTB to the kernel, you need to append to it. | If the bootloader can't pass the DTB to the kernel, you need to append to it. | ||
| Line 11: | 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 |
| | Debian squeeze | [[http:// | | Debian squeeze | [[http:// | ||
| Line 17: | 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 | ||
| + | * those unsupported ;-) | ||
| - | | + | 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/ | + | |
| - | ====== Making | + | Get the source from the [[https:// |
| - | Next build your kernel | + | git clone git:// |
| + | |||
| + | ===== Lacie-nas.org ===== | ||
| + | |||
| + | Get the source from the [[http:// | ||
| + | |||
| + | git clone git:// | ||
| + | |||
| + | 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/ | ||
| + | |||
| + | ====== Building kernel ====== | ||
| + | |||
| + | First, you have to get a kernel configuration for your kernel | ||
| + | |||
| + | For example, to configure a Linux 3.7.x kernel | ||
| + | |||
| + | cd lacie-linux.git | ||
| + | wget ftp:// | ||
| + | make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- oldconfig | ||
| + | |||
| + | If you are not happy with our default configurations, | ||
| + | |||
| + | make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- kirkwood_defconfig | ||
| + | |||
| + | Now, you can build your kernel: | ||
| - | make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- | ||
| 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 | + | ====== 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/ | + | DTB are in the arch/ |
| - | cat arch/ | + | cat arch/ |
| Now you need to add an header for u-boot loader. | Now you need to add an header for u-boot loader. | ||
| Line 46: | Line 72: | ||
| ^ Distribution name ^ command to get an arm toolchain ^ | ^ Distribution name ^ command to get an arm toolchain ^ | ||
| - | | Ubuntu 12.10 | sudo apt-get install u-boot-tools | | + | | Ubuntu 12.10 | sudo apt-get install u-boot-tools | |
| + | | Debian Squeeze | apt-get install uboot-mkimage | | ||
| Make uImage. This is the binary to be loaded by u-boot : | Make uImage. This is the binary to be loaded by u-boot : | ||