Thursday, May 20, 2010

port GNU/Linux kernel to ixp435

Copyright (c) Shawn the R0ck.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation;with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.A copy of the license is included in the section entitled "GNU Free Documentation License".

I have port (by a company Im working for) to ixp420 last month. That would not be fit in your kernel.A standard kernel has been successful to port on kixrp435(ixp435 reference platform) dev-board recently. Im gonna share with you guys about it. There are few stuffs you need to get before you start the hack.

1,Download the files that you will use

2,try to get a cross-compiler(I have been using a customized GNU toolchains by timesys).My armv5b-linux-gcc version is 3.4.1-7

3,Of course you need a kernel-

4(optional), you can use the rootfs I created.

I totally agree with Ken Thompson said"This is a consequence rather than a goal. I abhor a system designed for the "user", if that word is a coded pejorative meaning "stupid and unsophisticated". That's a good reason dont be expected the doc(or is called "log") might be readable as a literature. I'm writting this for hackers but not as users. Hope can helps.

happy hacking!
May Lord's hacking spirit guide us!

decompress files:
#tar jxvf linux-
#cp -r linux- linux-
#cp linux-* linux-

do "source ixp400_xscale_sw/buildUtils/" after you have already set the right path in: ixp400_xscale_sw/buildUtils/

Copy the Makefile and Kconfig to your kernel directory that may be:linux-

#cp ixp400_eth.c IxLinuxEDDIoctl.h linux-2.6.28/driver/net
#cp config.bak linux-
#cp semaphore.c linux-
#cp semaphore.h linux-

edit ixp_osal/platforms/ixp43X/os/linux/include/IxOsalOsOem.h:
#include "asm/hardware.h"
#include "asm/arch/irqs.h"

#include "mach/hardware.h"
#include "mach/irqs.h"

edit ixp_osal/common/os/linux/include/core/IxOsalOsTypes.h
#include "asm/semaphore.h"

#include "linux/semaphore.h"

edit ixp_osal/common/os/linux/include/core/IxOsalOs.h
replace "consistent_sync" with "dma_cache_maint"

edit ixp400_xscale_sw/src/oslinux/IxLinuxInit.c
1,add #include "linux/fs.h"
2,comment these 3 lines:
/* if (unregister_chrdev(DEV_IXNPE_MAJOR_NUMBER, "ixNpe"))
printk (KERN_ERR "Failed to unregister driver for

And,add a line above it:
unregister_chrdev(DEV_IXNPE_MAJOR_NUMBER, "ixNpe")


replace "SA_SHIRQ" with "IRQF_SHARED"

check your kernel config
# make $IX_KBUILD_CROSSCOMPILE menuconfig

compile kernel

compile npe driver
# cd ixp400_xscale_sw
# make all

then you will get 3 files(ixp400.ko,IxNpeMicrocode.dat,ixp400_eth.ko)

that's all your ixp435 platform needs.

# insmod ixp400.ko
ixp400: module license 'unspecified' taints kernel.
# cat IxNpeMicrocode.dat > /dev/ixNpe
# insmod ixp400_eth.ko
ixp400_eth: Initializing IXP400 NPE Ethernet driver software v. 1.8
ixp400_eth: CPU clock speed (approx) = 398 MHz
ixp400_eth: Found PHY 0 at address 1
ixp400_eth: Found PHY 1 at address 2
ixp400_eth: Found PHY 2 at address 3
ixp400_eth: Found PHY 3 at address 4
ixp400_eth: Found PHY 4 at address 5
ixp400_eth: ixp1 is using NPEC and the PHY at address 1
ixp400_eth: ixp2 is using NPEA and the PHY at address 2
ixp400_eth: Use default MAC address 00:02:b3:02:02:02 for port 1
ixp400_eth: Use default MAC address 00:02:b3:03:03:03 for port 2

see,it works!

btw:I found a community the named openixp provided many FOSS solutions on ixp platform.unfortunately, it seems it was not update for a "while"


Rs To Gold said...

Like the simple life, very clean and very quiet , Thanks for sharing.I like your photos.Look forward to you have more Posts
Cheap RS 2007 Gold
Gold For RS
World of Warcraft Gold Billig

Stackjack said...


I am trying port the IXP code that you have above to the Linux version 3.8.0-ADI-2012R2-pre on the kixp435 dev platform.

I managed to get only 1 Ethernet MII port working. But soon as i enable the second Ethernet port, the initialization of the Linux/IXP driver gets trashed.

I can compile for either Eth0 or Eth1, but not both at the same time.

Have you done any later kernel port on the IXP435 dev kit?, or have any idea how i can fix it?