background image

10

KADAK

KwikNet

 MPC5200 FEC Device Driver

6.3  MPC5200 Interrupt Exceptions

The PowerPC MPC5200 interrupt management subsystem is incredibly complex.  All
device interrupt sources are funneled through three PowerPC exceptions in the processor
Exception Vector Table.  Normal interrupt sources are vectored to the external interrupt
exception at offset 

0x0500

.  Critical interrupts, including all interrupt requests generated

by the BestComm DMA Engine, are vectored to the critical interrupt exception at offset

0x0A00

.  Other internal interrupt sources are vectored to the system management

exception at offset 

0x1400

.

Assembly language code must be installed in each of these exception vectors to handle
the exception, determine the source of the interrupt which initiated the exception and
service the interrupt source.

A further complication arises because the critical interrupt exception cannot be masked
off.  Hence, a critical interrupt exception from a BestComm interrupt request can preempt
service of a normal interrupt exception or a system management exception.

If you are not familiar with the PowerPC architecture, its exception handling rules, its
interrupt controller operation and PowerPC assembly language programming, writing
exception handler code can be a daunting task.  In fact, the complexity provides a good
reason to use an RTOS such as KADAK's AMX PPC

32

 kernel which services these

exceptions for you.

Operation with AMX PPC

32

Included with AMX PPC

32

 is a board support module 

LITE5200.S

 for the Motorola

Lite5200 Evaluation Board.  Board initialization function 

chbrdinit()

 within this

module is called prior to launching AMX.  This function programs the MPC5200
interrupt controller to reroute the critical interrupt exception from offset 

0x0A00

 to the

external interrupt exception at offset 

0x0500

.  Doing so resolves the interrupt nesting

issue introduced by the non-maskable critical interrupt exception.

Also included in the AMX MPC5200 board support module is the AMX Interrupt
Identification Procedure 

ch500vd()

 which decodes the interrupt source and vectors

through the linear AMX Vector Table to the device specific ISP root.  The ISP root calls
the ISP stem to dismiss the interrupt request and, if necessary, signal that the ISP Handler
is to be executed as soon as possible by the AMX Interrupt Supervisor.

Interrupt Identification Procedure 

ch500vd()

 maps the interrupt sources which generate

an external interrupt exception, a critical interrupt exception or a system management
exception to a single block of 84 vectors within the AMX Vector Table.  Interrupt
Identification Procedure 

ch500vd()

 must be used for each of the three MPC5200

exceptions.

Summary of Contents for KwikNet MPC5200

Page 1: ...Guide Version 3 First Printing November 15 2004 Last Printing September 15 2005 Manual Order Number PN383 9E Copyright 2004 2005 KADAK Products Ltd 206 1847 West Broadway Avenue Vancouver BC Canada V6...

Page 2: ......

Page 3: ...n Contact KADAK for details Please keep us informed of the primary user in your company to whom update notices and other pertinent information should be directed Should you require direct technical as...

Page 4: ...ties with respect to the contents hereof and specifically disclaims any implied warranties of merchantability and fitness for any particular purpose Further KADAK Products Ltd reserves the right to re...

Page 5: ...BestComm Library 5 6 Special Considerations 7 6 1 BestComm Initialization 7 BestComm FEC Initialization 8 MPC5200 Register Support 8 6 2 BestComm Source Code Modifications 9 6 3 MPC5200 Interrupt Exc...

Page 6: ...iv KADAK KwikNet MPC5200 FEC Device Driver This page left blank intentionally...

Page 7: ...nd the resulting object modules must be merged into a library module which will be referred to as the KwikNet MPC5200 BestComm Library The device driver can be used with KwikNet PPC32 PN383 2 and AMX...

Page 8: ...ssignment and MII setup M5200E KN5200BC C KwikNet BestComm initialization source file M5200E KN5200BC H KwikNet BestComm header file MAKE KN5200E MAK KwikNet MPC5200 BestComm Library make specificatio...

Page 9: ...t configuration Networks defined in this manner will be prebuilt for you when KwikNet is started To add a prebuilt MPC5200 Ethernet network interface definition to your KwikNet Library use the KwikNet...

Page 10: ...ameter in the call If you specify a prebuilt network you must define its device driver by using the KwikNet Configuration Manager to edit your KwikNet Network Parameter File The driver parameters are...

Page 11: ...o tailor the KwikNet Library construction process for the Microsoft make utility This file is a copy of the most recent tailoring file for toolset XXX provided with KwikNet PPC32 For toolset UU the fi...

Page 12: ...g Microsoft s NMAKE utility and Metrowerks tools issue the following command NMAKE fKN5200E MAK TOOLSET ME TRKPATH C TRECK During the library construction process all KwikNet device driver source file...

Page 13: ...the BestComm firmware to meet the needs of all parts of your application which depend upon BestComm services A BestComm initialization procedure kn_BestCommSetup is provided with this device driver i...

Page 14: ...alues the call is rejected with an error status because the BestComm FEC subsystem cannot be reconfigured to meet the revised configuration requested A custom timing service is implemented in source f...

Page 15: ...owing code fragment near the beginning of header file BESTCOMM_API H KADAK Products Ltd Patch to avoid compiler errors ifdef CC_INLINE Define alternate keyword for inline function declaration define i...

Page 16: ...ng exception handler code can be a daunting task In fact the complexity provides a good reason to use an RTOS such as KADAK s AMX PPC32 kernel which services these exceptions for you Operation with AM...

Page 17: ...port for two interrupt sources the FEC channel and the BestComm FEC subsystem Each of these interrupt sources is assigned to a specific vector in the AMX Vector Table If the First vector number for th...

Page 18: ...the KwikNet TCP IP stack while it awaits the PHY negotiation results The driver offers three modes of operation to cope with this issue Mode 0 No Delay In the simplest case the driver ignores the nego...

Page 19: ...ion If the PHY auto negotiation fails the Ethernet network driver will declare that the network interface cannot be opened for use Choosing the Mode of Operation To alter the MPC5200 FEC device driver...

Page 20: ...KwikNet device drivers Appendix C of that manual illustrates the layout of a data sheet used to describe each unique KwikNet device driver The KwikNet MPC5200 FEC Ethernet Device Driver conforms to th...

Page 21: ...KwikNet Device Driver MPC5200 FEC Ethernet Copyright 2004 2005 KADAK Products Ltd 206 1847 West Broadway Avenue Vancouver BC Canada V6J 1Y5 Phone 604 734 2796 Fax 604 734 8114...

Page 22: ......

Page 23: ...n the Motorola Lite5200 Evaluation Board Configure This device driver includes a number of low level configurable parameters which can only be adjusted by editing the definitions in the driver source...

Page 24: ...must be 0 S This bit defines the FEC operation speed If this bit is 0 the FEC will operate at 10Mbps If this bit is 1 the FEC will operate at 100Mbps D This bit defines the duplex mode of operation I...

Page 25: ...dles the separation of interrupts and their vectoring through a single linear array referred to as the AMX Vector Table Consequently when using KwikNet with AMX PPC32 the AMX vector numbers are used a...

Page 26: ...g inefficiencies All receive and transmit buffers must be aligned on an n byte boundary where n is defined by symbols DD_RCVALIGN and DD_TXALIGN in header file M5200E H to be 4 To avoid data caching i...

Page 27: ...with KwikNet is also ready for use with this board To port this device driver to your MPC5200 hardware proceed as follows Review header file M5200E H and be sure that the symbols defined at the begin...

Page 28: ...pt source 2 transmit buffers and 8 receive buffers are required Enter the following five device driver parameters Parameter 1 0x00040000 Parameter 2 0x9F000A97 Parameter 3 0 Parameter 4 0x00470029 Par...

Reviews: