Motorola MPC5200 User Manual

®
KwikNet
MPC5200 FEC
Device Driver
User's Guide
Version 3
First Printing: November 15, 2004 Last Printing: September 15, 2005
Copyright © 2004 - 2005
KADAK Products Ltd.
206 - 1847 West Broadway Avenue
Vancouver, BC, Canada, V6J 1Y5
Phone: (604) 734-2796 Fax: (604) 734-8114
TECHNICAL SUPPORT
KADAK Products Ltd. is committed to technical support for its software products. Our programs are designed to be easily incorporated in your systems and every effort has been made to eliminate errors.
Engineering Change Notices (ECNs) are provided periodically to repair faults or to improve performance. You will automatically receive these updates during the product's initial support period. For technical support beyond the initial period, you must purchase a Technical Support Subscription. Contact KADAK for details. Please keep us inform ed of the primary user in your company to whom update notices and other pertinent information should be directed.
Should you require direct technical assistance in your use of this KADAK software product, engineering support is available by telephone, fax or e-mail. KADAK reserves the right to charge for technical support services which it deems to be beyond the normal scope of technical support.
We would be pleased to receive your comments and suggestions concerning this produ ct and its documentation. Your feedback helps in the continuing product evolution.
KwikNet MPC5200 FEC Device Driver
KADAK Products Ltd.
206 - 1847 West Broadway Avenue
Vancouver, BC, Canada, V6J 1Y5
Phone: (604) 734-2796 Fax: (604) 734-8114 e-mail: amxtech@kadak.com
KADAK
i
Copyright © 2004-2005 by KADAK Products Ltd.
All rights reserved.
No part of this publication may be reproduced, transmitted, transcribed, stored in a retrieval system, or translated into any language or computer language, in any form or by any means, electronic, mechanical, magnetic, optical, chemical, manual or otherwise, without the prior written permission of KADAK Products Ltd., Vancouver, BC, CANADA.
DISCLAIMER
KADAK Products Ltd. makes no representations or warranties 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 revise this publication and to make changes from time to time in the content hereof without obligation of KADAK Products Ltd. to notify any person of such revision or changes.
TRADEMARKS
AMX in the stylized form and KwikNet are registered trademarks of KADAK Products Ltd. AMX, AMX/FS, InSight, Microsoft, MS-DOS and Windows are registered trademarks of Microsoft Corporation. All other trademarked names are the property of their respective owners.
ii
KwikLook and KwikPeg are trademarks of KADAK Products Ltd.
KADAK
KwikNet MPC5200 FEC Device Driver
KwikNet
1. Introduction 1
2. Installation 2
3. Configuring the Network 3
4. Configuring the Device Driver 4
5. Making the KwikNet MPC5200 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 Exceptions............................................................ 10
6.4 Configuring the Physical Device.......................................................... 12
Mode 0: No Delay................................................................................ 12
Mode 1: Continuous Poll..................................................................... 12
Mode 2: Periodic Sampling.................................................................. 13
Choosing the Mode of Operation......................................................... 13
Event Callback Notification................................................................. 13
MPC5200 FEC Device Driver User's Guide

Table of Contents

Page
Appendix A. MPC5200 FEC Device Driver Data Sheet 14
KwikNet MPC5200 FEC Device Driver
KADAK
iii
This page left blank intentionally.
iv
KADAK
KwikNet MPC5200 FEC Device Driver
KwikNet MPC5200 FEC Device Driver

1. Introduction

The Motorola PowerPC MPC5200 includes a single channel Fast Ethernet Controller (FEC) that supports 10Mbps and 100Mbps data transfer rates. The FEC can operate only in conjunction with the MPC5200 BestComm DMA Engine that provides DMA services to a number of MPC5200 subsystems.
The BestComm engine is driven by its private tasks which execute from microcode located in the MPC5200 static RAM memory. These tasks are not to be confused with tasks managed by an RTOS such as KADAK's AMX kernel. Within this document, the term task will be assumed to reference a BestComm task unless otherwise specified.
The BestComm API and microcode modules are supplied by Freescale Semiconductor, Inc. You must refer to the following Freescale documents for guidance in the proper setup and use of the BestComm DMA Engine.
MPC5200 User Manual BestComm API User’s Guide Application Notes 2251, 2604, 2609
Getting Started
The
KwikNet MPC5200 FEC Ethernet Device Driver consists of a number of components
which collectively support a single Ethernet network interface managed by the KwikNet TCP/IP Stack. These components must be compiled and the resulting object modules must be merged into a library module which will be referred to as the KwikNet MPC5200 BestComm Library. The device dri ver can be used with KwikNet PPC32 (PN383-2) and AMX PPC32 (PN382-1) or with the KwikNet Porting Kit (PN713-2).
To add the MPC5200 FEC device driver to your application, proceed as follows. Install the driver in its own directory, separate from
The MPC5200 FEC device driver must be attached to a
KwikNet, as described in Chapter 2.
KwikNet network interface. Th e
network interface is defined as descri b ed in C hapter 3. The d evi ce d river i s t hen att ached to the network interface as described in Chapter 4. The devic e drive r par ameters r equired to configure the driver are specified in the data sheet provided in Appendix A.
Once you have defined the operating characteristics of the network interface and the MPC5200 FEC device driver, you can build your KwikNet Librar y. You must build the
KwikNet Library prior to compiling the driver source modules. By building the KwikNet
Library first, you will ensure that all of the required KwikNet header files have been collected together and are ready for your use.
The MPC5200 FEC device driver components must be compiled and the resulting object modules must be merged into the application is then compiled and linked with this library and the
KwikNet MPC5200 BestComm Library. Your
KwikNet Library as
described in Chapter 5.
KwikNet MPC5200 FEC Device Driver
KADAK
1

2. Installation

The KwikNet MPC5200 FEC Ethernet Device Driver is provided on the KwikNet CD-ROM. The installation process installs the driver files in directory KNT303\KN5200E within an installation directory of your choice. Note that this directory is separate from
KwikNet PPC32 installation directory KNT383 or the KwikNet Porting Kit installation
the directory
The driver files are installed in the following subdirectories within installation directory
KNT303\KN5200E:
The KwikNet MPC5200 FEC Ethernet Device Driver consists of the following files:
KNT713.
ERR Construction error summary M5200E Driver source and header files M5200BC BestComm API and microcode source and header files MAKE Construction make directory TOOLXXX Toolset specific files TOOLXXX\LIB Toolset specific library will be built here
M5200E\M5200E.H Device driver header file M5200E\M5200E.C Device driver source file M5200E\M5200EBS.C Physical device pin assignment 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 specification file
README.TXT Version information
The following BestComm API and micro code source files are available from Freescale Semiconductor, Inc. These files are provided to you as permitted by the terms of the Freescale source code distribution agreement described in the source files. The files provided by KADAK in directory M5200BC are the most recent variants tested by KADAK. Text file
README.TXT in the root of the installation directory identifies the
BestComm version and its release date.
M5200BC\BESTCOMM_API.H M5200BC\BESTCOMM_API.C M5200BC\BESTCOMM_PRIV.H M5200BC\DMA_IMAGE.C M5200BC\DMA_IMAGE.H M5200BC\DMA_IMAGE.RELOC.C M5200BC\DMA_IMAGE.CAPI.H M5200BC\LOAD_TASK.C M5200BC\PPCTYPES.H M5200BC\TASKSETUP_BDTABLE.C M5200BC\MGT5200\MGT5200.H M5200BC\TASKSETUP_FEC_RX_BD.C M5200BC\MGT5200\SDMA.H M5200BC\TASKSETUP_FEC_TX_BD.C M5200BC\TASK_API\BESTCOMM_API_MEM.H M5200BC\TASK_API\BESTCOMM_CNTRL.H M5200BC\TASK_API\TASKSETUP_BDTABLE.H M5200BC\TASK_API\TASKSETUP_GENERAL.H
2
KADAK
KwikNet MPC5200 FEC Device Driver

3. Configuring the Network

You must define each network that your application supports. You can dynamically add a network interface at runtime. Alternatively, you can define your network interface in your KwikNet 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 Configuration Manager to edit your Network Parameter File. The network parameters are edited on the Networks property page. The layout of the window is shown below. Follow the directions provided in Chapter 2.4 of the KwikNet TCP/IP Stack User's Guide.
KwikNet MPC5200 FEC Device Driver
KADAK
3
Loading...
+ 19 hidden pages