Intel IXP

This is a page about things i have done with a Intel IXP2xxx card. It is a Radisys ENP2611, based on IXP2400. Whenever i feel like it I put some info here, to help my own memory as well as maybe some other ones that have the same strugles as i do.

Make an ARP packet

It sounds simple, and might be for you, but I had to read and think to make an ARP packet on the XScale. The Code

Share a struct

This is how i share a struct in SRAM between the XScale and the microengines. The Code


This is some example code for the hash unit for the microengines. The Code
Written in assembler: The Code
The Intel IXP2400/IXP2800 Network Processors Programmer's Reference Manual talkes about using the hash unit in the XScale in Here are some examples: The Code

Use multiple ME

This is an example of how to load code or a .list file on multiple microengines. The Code

Lennert Buytenheks code

Lennert Buytenhek has written some code that enables you to write programs on the IXP without using the Intel SDK. This way you can have all your code as open source. Here you get Lennerts code, .
All code I have used with the microengines are in assembler. I'm not sure how it will work with C.
First the microengine code needs to be assembled with Intels assembler "uca". That is the only thing we are using from the SDK.
Next step is to make a ucode file. This is done with "uengine-0.0.37/lib/ MEcodename listfile.list > headerfile.h"
In the Perl file there is a short description of it:
"Convert a .list file (as generated by the intel 'uca' uengine assembler or the 'ucld' uengine linker) into a .h file that can be included into a C app for uploading into an IXP microengine."

In your C program that runs on the Xscale, you include the .h file with a regular:
#include "headerfile.h"
In my program, I have a init function that resets, loads the microcode, and starts them.
static void init(void) {
   //Resets all microengines
   //Loads code to the chosen microengine
   ixp2000_uengine_load(microenginenumber, &MEcodename);
   //Starts the contexts on the chosen microengine according to context mask
   ixp2000_uengine_start_contexts(microenginenumber, 0xff);

Without the SDK, there are constants and defines that do not work anymore, e.g. VIRT_SRAM_BASE is no longer defined. So each memoryregion one the card you are using has to be mapped:
memarea = ioremap_nocache(0x00000000, 128 * 4096);
cap_csr = ioremap_nocache(0xc0004000, 4096);//See IXP2400_2800 Fast Write CSR
This is the code we are using with Lennerts code to map the memory we need.

In lib/ixp2000-lib-userspace.c, ioremap_nocache is defined. First argument is physical address to map, and the next one is how many bytes to map.
So this example mapped SDRAM starting at address 0x0, over a range of 128 4K pages,
and the CSR Access Proxy(CAP) Control and Status Registers (CSRs) for the hash unit.

With Lennerts code, we need to initialize the hash unit in a different way:
void hash_init(void) {
   unsigned int *hashunit;
   hashunit = (unsigned int*) (cap_csr + 0x900); //See code above for mapping
   // 48bit multipler registers:
   hashunit[0] = 0x12345678;
   hashunit[1] = 0x87654321;
   // 64bit multipler registers:
   hashunit[2] = 0xabcd8765;
   hashunit[3] = 0x5678abcd;
   // 128bit multipler registers (four of these):
   hashunit[4] = 0xaabb2367;
   hashunit[5] = 0x6732aabb;
   hashunit[6] = 0x625165ca;
   hashunit[7] = 0x65ca1561;

Note that we need to map the control registers into memoryspace before we can write to them.

In "uengine-0.0.37.tar.gz" there are some examples. The code does not have too many comments. But if you have the IXP2400_2800_PRM open, you are able to understand it.
I do belive the code in the SDK is effective, but my problem was to understand it. It has just too many macros going everywhere, and it is copyrighted. Lennerts code is much easier to understand and change. You can make it do just what you want, and no more.


Radisys support
HitchHacker Guide to ENP-2611
HitchHacker Guide to ENP-2611 2(?)
Lennerts code
Intel Network Processors
Princeton ixp2xxx mailing list
Georgia Tech ixp2xxx mailing list
Both mailing list are pretty much dead. But you can find a lot of information in the one from Princeton.


Since I couldn't find a link to Georgia Techs IXP driver, and I couldn't find it at Georgia Tech either, I put the driver here, so you are able to play with it.
Georgia Tech ixp2400 PCI driver (gtixp)
Lennerts Buytenheks code

And please, if anyone finds any bugs, or have a better idea, or way of doing things, tell me. I am quite a newbe at this...

my email: camaro468 ATT gmail dott com