Skip to content. | Skip to navigation

Personal tools

Navigation

You are here: Home / Software / Sheevaplug / Kernel

Kernel

Build a Kernel for the sheevaplug / guruplug

Requirements

I assume you have a unix system and are using a bash.

You require a cross compile toolchain. You can bootstrap your own, or get one from Codesourcery. See Cross Compiler

Sources

vanilla linux 2.6.34.1 (see http://www.kernel.org)
patches from http://sheeva.with-linux.com/

0001-Kirkwood-Marvell-GuruPlug-support-2.6.34.patch
0002-Driver-for-Marvell-Libertas-8688-SDIO-micro-AP-suppo.patch
0003-Initial-defconfig.patch
linux-2.6.29-usb-serial-evdo.patch
mvsdio-1-2.6.30.patch
mvsdio-2.patch

Environment

Setup your shell environment (and if you have spaces in the path stuff will break, i didn't care for spaces)

user@host> export SRC=/path/to/kernel/and/patches
user@host> export BUILD=/path/where/you/want/to/work
user@host> export KVER=2.6.34.1
user@host> export ARCH=arm
           # next one depends where you unpacked the toolchain, its the folder with arm*-gcc
user@host> export TOOLCHAIN=$HOME/projects/plug/cross/toolchain/bin
           # this depends how specific your toolchain is
           # it's the part in front of gcc
user@host> export CROSS_COMPILE=armv5tel-softfloat-linux-gnueabi-
user@host> export PATH=$TOOLCHAIN:/bin:/usr/bin

Now this should work and deliver output like this

user@host> ${CROSS_COMPILE}gcc --version
armv5tel-softfloat-linux-gnueabi-gcc (GCC) 4.4.4
Copyright (C) 2010 Free Software Foundation, Inc.

 

Extract

user@host> cd $BUILD
user@host> tar jxf $SRC/linux-$KVER.tar.bz2
user@host> cd $BUILD/linux-$KVER
user@host> for p in $SRC/*.patch; do patch -p1 < $p ; done

 

Configure

user@host> cd $BUILD/linux-$KVER
user@host> make ARCH=$ARCH guruplug_defconfig

Or you take the config from sheeva.with-linux.com. copy it to $BUILD/linux-$KVER/.config and

user@host> make ARCH=$ARCH oldconfig

 

Build

user@host> make ARCH=$ARCH uImage

results is arch/arm/boot/uImage

 

Boot

Place the uImage on a tftpserver (tftp not ftp). Connect a serial console to your plug. Start it up and interrupt u-boot to reach the marvel prompt. All changes are temporary, the only last till the next reset unless you do a saveenv. Please do not enter the comments ;)
         # your tftp server
Marvell> setenv serverip 192.168.1.1
         # address the plug should use
Marvell> setenv ipaddr 192.168.1.2
Marvell> setenv netmask 255.255.255.0
         # now we load the kernel
Marvell> tftp 0xa00000 uImage
Using egiga0 device
TFTP from server 192.168.1.1; our IP address is 192.168.1.2
Filename 'uImage'.
Load address: 0xa00000
Loading: #################################################################
         ...
         ##########
done
Bytes transferred = 2709892 (295984 hex)

         # the serial console
Marvell> setenv bootargs 'console=ttyS0,115200'
         # start the kernel
Marvell> bootm 0xa00000
## Booting kernel from Legacy Image at 00a00000 ...
   Image Name:   Linux-2.6.34.1
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2709828 Bytes =  2.6 MB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...
Uncompressing Linux... done, booting the kernel.
Linux version 2.6.34.1 (scorch@falcon) (gcc version 4.4.4 (GCC) ) #1 PREEMPT Sat Jul 17 15:13:14 CEST 2010
CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=00053977
CPU: VIVT data cache, VIVT instruction cache
Machine: Marvell GuruPlug Reference Board
...
VFS: Unable to mount root fs via NFS, trying floppy.
VFS: Cannot open root device "(null)" or unknown-block(2,0)
Please append a correct "root=" boot option; here are the available partitions:
1f00            1024 mtdblock0 (driver?)
1f01            4096 mtdblock1 (driver?)
1f02          519168 mtdblock2 (driver?)
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)
[<c00304bc>] (unwind_backtrace+0x0/0xf0) from [<c03ce114>] (panic+0x48/0xc8)
[<c03ce114>] (panic+0x48/0xc8) from [<c0008f08>] (mount_block_root+0x1c8/0x208)
[<c0008f08>] (mount_block_root+0x1c8/0x208) from [<c00091a0>] (prepare_namespace+0x160/0x1b8)
[<c00091a0>] (prepare_namespace+0x160/0x1b8) from [<c0008478>] (kernel_init+0x118/0x15c)
[<c0008478>] (kernel_init+0x118/0x15c) from [<c002c414>] (kernel_thread_exit+0x0/0x8)

 

Perfect. The Kernel booted. It is just missing a root filesystem.