Cambridge Broadband Ltd.
mpc8260sar is an linux ATM device driver for the PowerQUICCII range of
processors. The PowerQUICCII is the 2nd generation of PowerQUICC
processors designed by Motorola for networking applications. The
MPC8260 is a member of the PowerQUICCII range, but actually all MPC82xx
and MPC83xx processors are also PowerQUICCIIs, and this driver should
work equally well on those.
This device driver can be built as either kernel resident or as a
loadable module. It meets the linux ATM device driver API - which
basically means that it acts as a glue layer between the hardware SAR
engine and the kernel's ATM networking stack. In the case of the
PowerQUICCII the SAR engine resides in its 2nd generation Comms
Processor Module, or CPM.
- Build Instructions
- Development platform
- Kernel and modules
- Linux 2.6
- Standalone ATM to
Ethernet bridging application
- nfs root filesystem
- standalone application
- Phy control utility
- Design notes
- Help Wanted
This software is licenced under the GPL.
Share and enjoy!
Back in 2001 I published the original PowerQUICCI
driver and named it mpc860sar. I was helped by Daris Nevil,
who gave me a starting point in the form of some GPL'd code, and by
Dave Pegler who wrote some of the final driver code.
This driver was then ported to the PowerQUICCII by a number of people
and published here.
Later my company decided to upgrade to the PowerQUICCII themselves and
I had a look at this project. This code was extremely helpful to
me but it did not work out of the box
and I found I had to do a lot of work to get the driver operational, to
restore some of the original features, and to improve
performance. As a result the final code bears little resemblance
to the original port and I felt this justified consolidating the
changes by creating a new project rather than sending the authors of
the original port a patch. I hope this does not offend anyone.
I'd like to thank Russell McGuire for sending a fix concerning the
calculation of the internal BRG rate for systems with low speed PHYs.
I'd also like to thank Fabien Clement for adding PQ2FADS and linux-2.6 support.
A brief summary of the features offered by mpc8260sar.
- 2 priorities for tx. CBR channels are top priority, UBR are
- 2 priorities for rx. CBR receptions are handled in
interrupt. UBR are reception handling is scheduled for later
processing by the kernel and has lower priority.
- Full QoS spec supported. This includes min_pcr, pcr, and
max_pcr on both UBR and CBR rings.
- AAL0 and AAL5 support.
- Overbooking supported on UBR ring (auto VC off), strict bandwidth
accounting on CBR ring.
- VPI/VCI range configurable at build time. Currently
- Up to 62 internal channels (using on-chip Dual Port RAM) -
configurable up to 254 depending on DPRAM availability.
- Up to 64 external channels (using external SDRAM) - configurable
up to 64k depending on SDRAM availability.
- Extensive statistics in
- Buffer size of 1632 bytes - optimising for ethernet over ATM.
- AAL5 frames may span multiple buffers up to 9180 bytes - allowing
for CLIP support.
- Quick interrupt handling with low priority work offloaded to
scheduled tasks by kernel
- Kernel resident or
- Support for phy-ioctls and loopback SAR ioctl
- Optional support for prevention of process CPU starvation.
- Currently supports CR826/PM828, MPC8272ADS, and PQ2FADS
You are free to choose any PQII platform and linux kernel you
wish. However, the following list describes the platform on which
I developed and tested the code, and is therefore your best bet if you
want to get things up and running quickly. If anyone wishes to
contribute patches and/orinstructions for other platforms I am happy to
include them in the project.
3.1.1 build 2005-03-07 (also available on CDROM from denx.de)
3.1.1 build 2005-03-07 source RPMS (also available on CDROM from
- Denx LinuxPPC development kernel dated 2005-03-06. This is
automatically installed by the ELDK, but can also be checked out of
cvs -z6 -d :pserver:email@example.com:/cvsroot co -P -D 2005-03-06 linuxppc_2_4_devel
- Patches and additional
SRPMS from this site. See build instructions below.
- Microsys PM828 Miriac Module. Contains
MPC8280 CPU, 128MB SDRAM, 32MB flash. Available via Denx.
- Microsys CR826 Evaluation
Carrier v2 with
ATM option and PM5350 PHY. Available via Denx.
- Standard ATX power supply, OC3 (SC) connectors, lots of CAT5.
- Freescale MPC8272ADS
- Standard ATX power supply, OC3 (SC) connectors, lots of
CAT5. (Should come with development board.)
- Very important: ELDK, linuxppc,
and u-boot wiki.
The following is merely a description of my development and build
process. You are free to attempt a different method yourself, but
please try this before contacting me with queries.
Read the ELDK
chapter of the DULG user
manual. Now install the ELDK in
Prepare the target root directory
use as an nfs-mounted root directory as described in the ELDK user
manual (basically you need to run a couple of scripts as superuser).
Install the ELDK source CDROM, i.e. mount it and copy
I have packaged the linux-atm
utilities into an SRPM here.
Copy this to
/opt/eldk/target/SRPMS. Install this
SRPM, rebuild the RPM using the instructions in the ELDK user manual,
then install it onto the target root filesystem, again using the
instructions in the ELDK user manual.
I have also packaged the bridge-utils
utilities into an SRPM here.
Copy this to
/opt/eldk/target/SRPMS. Install this
SRPM, rebuild the RPM
using the instructions in the ELDK user manual, then install it onto
the target root filesystem, again using the instructions in the ELDK
Kernel and modules
Change to the directory where the ELDK installs the kernel source:
cd /opt/eldk/ppc_6xx/usr/src/linux-2.4.25/First you must modify the default ELDK kernel to support the
platforms, and integrate the ATM driver. Apply the latest
mpc8260sar patch, e.g.
patch -p1 [--dry_run] < linuxppc-2005-03-06-2006-05-11.patch
(NB: The first date in the name of
the patch is the date at which the original kernel code was checked out
of Denx CVS. The second date is the release date of the
patch. This is the latest release of the this patch.
As I make new releases I
will update this link and move old releases here. Older patches contain the ATM
device driver as well.)
Next you must extract the ATM driver:
tar xzf mpc8260sar-2006-02-22.tar.gz
Build the kernel, and build and install the modules:
make PM826_config # If your platform is CR826/PM828
make ads8272_config # If your platform is MPC8272ADS
make PQ2FADS_config # If your platform is PQ2FADS
make modules_install INSTALL_MOD_PATH=/opt/eldk/ppc_6xx
The ATM device driver itself supports linux-2.6. Support for
linux-2.6 was submitted by Fabien Clement and I have not tested it
myself. As yet there is no patch to integrate the atm/ directory
into the linux-2.6 kernel but this should be fairly straightforward to
Standalone ATM to
Ethernet bridging application
Here I shall describe how to build an example standalone ATM to
Ethernet bridging application based on a kernel and simple
ramdisk. This code is based on the SELF SRPM in the ELDK source
tar xzf SELF-atm2eth-bridge-app.tar.gz
ln -sf linux-2.4.25 linux
make clean all
This creates a combined kernel/ramdisk file
which, when run, starts a bridge br0 from nas999 to eth0.
choose to rebuild u-boot you will probably need to do the following if
using the CR826 board:
patch -p1 [--dry_run] < u-boot-1.1.3-pm82x-local-not-pcibus.patch
This patch is to work around the fact that since the CR826 has been
modded for ATM, it needs a local bus to communicate with the ATM PHY
management interface. This is incompatible with PCI
functionality, and the CPU has to be told this in the hard reset
You will need to rebuild u-boot because the default image from
Freescale (u-boot-1.1.1) is configured to use FCC1 for ethernet, and
this conflicts with the ATM driver. You may want to apply this
patch which enables u-boot to be burnt into the base of flash:
patch -p1 [--dry_run] < u-boot-1.1.3-boot-ads8272-from-flash-base.patch
If you do, you will also need to adjust jumper JP9 so that the CPU
reads the Hard Reset Configuration Word from flash rather than from an
on board CPLD called the BCSR.
The code which supports the PQ2FADS was submitted to me by Fabien
Clement and I have not tested this platform.
You will need to set up your u-boot environment to allow it to boot
either the kernel+nfs root filesystem, or the standalone kernel+ramdisk
image. This log shows how I
did it on the CR826/PM828 platform. This log shows how I did it on the
nfs root filesystem
Make sure your tftp server can serve a copy of
Also ensure that your NFS server can serve
(The DULG user manual can help with this.) Then, on the serial
console to u-boot type
run nfsbootOnce the kernel has booted, log in and type
Make sure that your tftp server can serve a copy of
Then on the serial console to u-boot type:
The board should start bridging straight away.
Phy control utility
On the CR826/PM828 development
platform you can just use
sonetdiag, which is installed
by the linux-atm package (see above.)
On the MPC8272ADS and PQ2FADS development platform there is a later phy
not compatible with sonetdiag. Therefore you need to use a
different utility called
pm5384_ctrl, which you will need
to build yourself, like so:
The following spreadsheets were created by SmartBits, which was used to
test the ATM to Ethernet bridging performance of the standalone
application on the CR826/PM828 platform.
The upshot is that it can cope with an aggregate of over 75k packets
- The source code currently only builds for the PM826/CR826 or
PM828/CR826 or MPC8272ADS. In menuconfig I've added an 'choice'
option for PM826 carrier board.
option is presented if the the PM826 platform is selected. The
PM826_defconfig file in the patch selects the CONFIG_CR826 choice for
option. The result of this is that CONFIG_MPC8260SAR is offered,
and atm-8260.o will include cr826.o if it is built. The file
cr826.c contains the entry and exit points for the module and thus
controls how the module is configured. Similarly for the ADS
build the file ads8272.c contains the entry and exit points.
- If other boards become supported then the driver should detect
this from the CONFIG_ options and not
build cr826.c or ads8272.c.
should build another analogous source file containing a configuration
appropriate to that board.
- I've added an option CONFIG_CPU_STARVATION_WATCHDOG which is not
set in the .config written by the patch. If selected this will
build a watchdog that can be opened, configured, and patted by multiple
independent user processes. If any of these time out then the
mpc8260sar and fcc_enet drivers will enter a low cpu-usage mode until
all of the opened watchdogs have been patted. The idea behind
this is to protect important user processes from CPU starvation when
the kernel is passing a lot of traffic. You may or may not find
- I've made some small mods to the fcc_enet.c code. Some are
just protection against potential bugs, but I've also added support for
CONFIG_CPU_STARVATION_WATCHDOG as described above. Also, I
re-enabled support for promiscuous mode which was for some unknown
A list of things either not yet supported or not yet working.
- Better support for FCC1. Currently the pins are all
hardcoded. I'm not sure if a different pin selection is possible
- MPHY support. Zoran had apparently already done this for
the atm8260 sourceforge project but I have not used that yet. It
would be nice to support both MPHY modes: direct and indirect polling.
- TC/IMA. Currently we only support UTOPIA as a cell
transport mechanism (see utopia.c). It would be nice to support
TC (ATM over E1) in a file called, say, tc.c, and IMA in a file called,
- ABR. The driver currently only supports UBR and CBR.
Maybe we could add ABR support later. The SAR can do it!
ajz @ cambridgebroadband . com 2005-07-25