Engineering Bulletin. General Description. Provided Files. AN2297/D Rev. 0.1, 6/2002. Implementing an MGT5100 Ethernet Driver

Similar documents
HCS08 SG Family Background Debug Mode Entry

Quarter 1, 2006 SG1003Q12006 Rev 0 ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2006

Motorola RF CATV Distribution Amplifiers

Is Now Part of To learn more about ON Semiconductor, please visit our website at

Using the Synchronized Pulse-Width Modulation etpu Function by:

AND9191/D. KAI-2093 Image Sensor and the SMPTE Standard APPLICATION NOTE.

ADDITIONAL CONDUCTED MEASUREMENTS BOARD DESCRIPTION

MRFIC1804. The MRFIC Line SEMICONDUCTOR TECHNICAL DATA

Mask Set Errata for Mask 1M07J

AND9185/D. Large Signal Output Optimization for Interline CCD Image Sensors APPLICATION NOTE

Is Now Part of To learn more about ON Semiconductor, please visit our website at

MC54/74F568 MC54/74F569 4-BIT BIDIRECTIONAL COUNTERS (WITH 3-STATE OUTPUTS) 4-BIT BIDIRECTIONAL COUNTERS (WITH 3-STATE OUTPUTS)

ExtIO Plugin User Guide

QSB34GR / QSB34ZR / QSB34CGR / QSB34CZR Surface-Mount Silicon Pin Photodiode

APPLICATION NOTE. Figure 1. Typical Wire-OR Configuration. 1 Publication Order Number: AN1650/D

Is Now Part of To learn more about ON Semiconductor, please visit our website at

Is Now Part of To learn more about ON Semiconductor, please visit our website at

Self Restoring Logic (SRL) Cell Targets Space Application Designs

Is Now Part of To learn more about ON Semiconductor, please visit our website at

Is Now Part of To learn more about ON Semiconductor, please visit our website at

TCP-3039H. Advance Information 3.9 pf Passive Tunable Integrated Circuits (PTIC) PTIC. RF in. RF out

RF Power Amplifier Lineup InGaP HBT and N-Channel Enhancement-Mode Lateral MOSFET

NSI45020T1G. Constant Current Regulator & LED Driver. 45 V, 20 ma 15%

Is Now Part of To learn more about ON Semiconductor, please visit our website at

Is Now Part of To learn more about ON Semiconductor, please visit our website at

Table 1. Summary of MCF5223x Errata

Configuring and using the DCU2 on the MPC5606S MCU

NSR0130P2. Schottky Barrier Diode 30 V SCHOTTKY BARRIER DIODE

Is Now Part of To learn more about ON Semiconductor, please visit our website at

BAS40-04LT1G, SBAS40-04LT1G. Dual Series Schottky Barrier Diode 40 VOLTS SCHOTTKY BARRIER DIODES

Is Now Part of To learn more about ON Semiconductor, please visit our website at

Is Now Part of To learn more about ON Semiconductor, please visit our website at

Is Now Part of To learn more about ON Semiconductor, please visit our website at

RB751S40T5G. Schottky Barrier Diode 40 V SCHOTTKY BARRIER DIODE

NS8050U MICROWIRE PLUSTM Interface

MBD301G, MMBD301LT1G, MMBD301LT3G, SMMBD301LT3G. Silicon Hot-Carrier Diodes. Schottky Barrier Diodes

Is Now Part of. To learn more about ON Semiconductor, please visit our website at

Fast Quadrature Decode TPU Function (FQD)

This document describes a program for 7-segment LED display (dynamic lighting).

How to Enable Debugging for FLEXSPI NOR Flash

MP-III Writer User Manual MANUAL REVISION HISTORY Version Date Description V1.0 Mar First Issue SONiX TECHNOLOGY CO., LTD. Page 2 Version 1.0

This document describes a program for 7-segment LED display (dynamic lighting) and key matrix and input.

Integration Note. Any feature not specifically noted as supported should be assumed to be unsupported.

Is Now Part of To learn more about ON Semiconductor, please visit our website at

CAT Channel Ultra High Efficiency LED Driver with 32 Dimming Levels

New Encoding Technique to Reform Erasure Code Data Overwrite Xiaodong Liu & Qihua Dai Intel Corporation

STB Front Panel User s Guide

Laboratory Exercise 4

Applications. NCO Clock Generator 1. Fine freq. adjustment. Synthesizer 0. Fine freq. adjustment. Synthesizer 1 Fs= Bs 1. *Ks 1. *16*Ms 1.

Modbus for SKF IMx and Analyst

SPI Serial Communication and Nokia 5110 LCD Screen

Obsolete Product(s) - Obsolete Product(s)

Obsolete Product(s) - Obsolete Product(s)

Is Now Part of. To learn more about ON Semiconductor, please visit our website at

STEVAL-ICB004V1. Advanced resistive touchscreen controller demonstration board based on the STMPE811. Features. Description

STEVAL-ILL029V1. Front panel demonstration board based on the STLED325 and STM8S. Features. Description

L7208. Portable consumer electronics spindle and VCM motor controller. General features. Spindle driver. Description. VCM driver.

Solutions for a Real Time World. Unigen Corp. Wireless Module Products. PAN Radio Modules Demonstration & Evaluation Kit UGWxxxxxxxxx (Part Number)

Main components Narrow-band OFDM power line networking PRIME compliant system-on-chip

NCS2566. Six-Channel Video Driver with Triple SD & Triple Selectable SD/HD Filters

Main components Proximity and ambient light sensing (ALS) module

VJ 6040 UHF Chip Antenna for Mobile Devices

Enable input provides synchronized operation with other components

Obsolete Product(s) - Obsolete Product(s)

STEVAL-CCM003V1. Graphic panel with ZigBee features based on the STM32 and SPZBE260 module. Features. Description

Multi-channel LED driver with integrated boost controller for medium, large LCD panel backlight based on LED7708 and STM32F103C6T6A

AND8383/D. Introduction to Audio Processing Using the WOLA Filterbank Coprocessor APPLICATION NOTE

STEVAL-IHM008V1. BLDC & AC motor control Power board SEMITOP 2 1kW. Features. Applications

M24LR04E-R, M24LR16E-R, M24LR64E-R Errata sheet

AN2421 Application note

STEVAL-IKR001V7D. Sub Ghz transceiver daughterboard with power amplifier based on the SPIRIT1. Features. Description

ADDENDUM TO MC68306 Integrated EC000 Processor User s Manual

Is Now Part of To learn more about ON Semiconductor, please visit our website at

GM60028H. DisplayPort transmitter. Features. Applications

Differences Between Controller Continuum ADC Modules 12-bit ADC vs. 16-bit ADC

STEVAL-SPBT2ATV2. USB Dongle for the Bluetooth class 2 SPBT2532C2.AT module. Features. Description

DP8212 DP8212M 8-Bit Input Output Port

STEVAL-ILL037V1. Demonstration board for the HVLED805 IC for LED power supply. Features. Description

LAX_x Logic Analyzer

STEVAL-IFN003V1. PMSM FOC motor driver based on the L6230 and STM32F103. Features. Description

EVALPM8803-FWD. EVALPM8803-FWD: IEEE802.3at compliant demonstration kit with synchronous active clamp forward PoE converter. Features.

STA3005. Dual-IF AM/FM digital radio receiver. Feature summary. Order codes

Contents. DSP56300 Enhanced Synchronous Serial Interface (ESSI) Programming MOTOROLA. Semiconductor Application Note. By Tina M.

EVBUM2283/D. KLI-4104 Image Sensor Evaluation Timing Specification EVAL BOARD USER S MANUAL ALTERA CODE FEATURES/FUNCTIONS

Is Now Part of To learn more about ON Semiconductor, please visit our website at

STEVAL-IHM024V W 3-phase inverter using the L6390 and STGDL6NC60DI for vector control. Features. Applications. Description

UG0651 User Guide. Scaler. February2018

IoT Toolbox Mobile Application User Manual

GM69010H DisplayPort, HDMI, and component input receiver Features Applications

Netzer AqBiSS Electric Encoders

AtlonA 4x4 HDMI over CAT5 Matrix Switcher with IR Control AT-HD44M-SR. User Manual

M24SR-DISCOVERY. Discovery kit for the M24SR series Dynamic NFC/RFID tag. Features

Sapera LT 8.0 Acquisition Parameters Reference Manual

Is Now Part of To learn more about ON Semiconductor, please visit our website at

STEVAL-ILL015V1. High brightness RGB LED array with LED error detection based on the STP24DP05 and STM32. Features. Description

VT5365. Single-chip optical mouse sensor for wireless applications. Features. Applications. Technical specifications. Description.

LMH0344 3Gbps HD/SD SDI Adaptive Cable Equalizer

Debugging IDT S-RIO Gen2 Switches Using RapidFET JTAG

Is Now Part of. To learn more about ON Semiconductor, please visit our website at

SMPTE 259M EG-1 Color Bar Generation, RP 178 Pathological Generation, Grey Pattern Generation IP Core AN4087

Transcription:

Engineering Bulletin AN2297/D Rev. 0.1, 6/2002 Implementing an MGT5100 Ethernet Driver General Description To write an ethernet driver for the MGT5100 Faster Ethernet Controller (FEC) under CodeWarrior EPPC6.1, follow this guide. This document describes simple FEC register initialization and buffer descriptor (BD) handling and SmartComm (MGT5100 DMA engine). Buffer descriptors are software data structures documented in the MGT5100 User s Guide used to send and receive ethernet frames from the FEC. This document is intended to aid developers implementing their own MGT5100 ethernet driver. A simple example test program is also provided to show a single transmission and reception of a data packet. Tranceivers The FEC requires an external ethernet tranceiver chip (PHY) to connect to a physical interface. There are two basic types of PHY: those with a seven-wire interface and the standard 18-wire media independent interface (MII). The code is written for an Intel LXT905LE seven-wire PHY and an Intel LXT971ALE MII PHY. Other seven- and 18-wire PHYs may be similar to these such that one may use the same initialization code. Provided Files Ethernet Driver mgt5100fec.c This file provides register initialization for the MGT5100 FEC as well as data structure initialization for the FEC buffer descriptor handling code. It also provides primitive runtime send and receive frame functions and their helpers, which can be called from the user s kernel services and interrupt handlers. Motorola, Inc., 2002

eth_task.dist.s Assembler-ready SmartComm opcodes and registers are encapsulated in this file. These are the backend of the MGT5100_Eth_Send() and MGT5100_Eth_Receive() functions defined in mgt5100fec.c that manage buffer descriptors and the FEC s transmit and receive FIFOs. The directives used are that of GNU assembler or CodeWarrior assembler depending on if MWERKS is defined at the top of the file. It is possible the directives will need to be modified when a different assembler is used to compile this file. loadtask.c The loadtask() function loads the ethernet task from eth_task.dist.s into the SmartComm module. nif.c This module implements a sample network interface (nif) for integration between the simple handlers in mgt5100fec.c and higher level network protocol stacks. The user may wish to reimplement this to better match the interface between their own network code and interrupt handlers. mgt5100fec.h This file contains FEC register definitions, software data types and declarations. cpu/ppc/mgt5100/mgt5100.h This file contains MGT5100-specific PowerPC definitions. In particular it contains machine base address register (MBAR) offsets for the GPIO, SmartDMA, ethernet and SRAM peripherals. cpu/ppc/mgt5100/sdma.h This file contains SmartDMA definitions and declarations, interrupt and task enable/disable macros and buffer descriptor parameter addresses. cpu/ppc/mgt5100/int_ctrl.h This file contains MGT5100 interrupt controller register definitions. cpu/ppc/mgt5100/gpio_std.h This file contains MGT5100 general purpose I/O (GPIO) register definitions. board.h This file contains board-specific definitions, notably the MBAR address. types.h This file contains definitions for machine word sizes and general programming. 2 Implementing an MGT5100 Ethernet Driver MOTOROLA

User Defined Functions Example Program main.c This file sets up the environment for testing and then calls the Ethernet test routine interrupt.c This file contains an interrupt handler to trap all exceptions defined in the exception table. test_ethernet.c This file contains code to initialize FEC and SmartComm, and to execute the test in the example program. CodeWarrior Files MGT5100_ETHERNET_EXAMPLE_data/ This directory contains CodeWarrior project files needed to compile and run the example program. eppc_exceptions.asm This file contains the exception vector table for MGT5100. 5100_Mot_EVB_RAM.lcf This file contains linker commands that CodeWarrior uses to define memory regions and other link-time parameters. 5100_Mot_EVB_init.c This file contains routines to intialize the IceCube board. Prefix_ethernet.h This file contains Ethernet example definitions. Prefix_5100_Mot_EVB_ISR.h This file contains board Ethernet example environment setup definitions. 5100_Mot_EVB_init.cfg This file contains CodeWarrior target initialization for MGT5100. User Defined Functions The follwing functions are required by but not defined in the provided driver code. They are provided in the example program. NBUF *nbuf_allocate(int size) This function allocates a network buffer descriptor. It is a specific case of an ANSI malloc() library call. The size argument is the requested buffer size in bytes. void nbuf_release(nbuf *frame) The complement of nbuf_allocate(), this function releases a network buffer descriptor back to the free pool much like the ANSI free() library call. MOTOROLA Implementing an MGT5100 Ethernet Driver 3

phy_type_t board_eth_phy_type(void) This function provides runtime configuration of a board s ethernet transceiver type defined by the phy_type_t enum in mgt5100fec.h. phy_model_t board_eth_phy_model(void) This function provides runtime configuration of a board s specific ethernet tranceiver model name defined by the phy_model_t enum in mgt5100fec.h. void board_msecond_wait(int mseconds) This function delays execution for mseconds milliseconds. int printf(char *format,...) This is the C stdio printf(3) function. It is used for debugging purposes only and required if the ETH_DEBUG macro is defined. Order of Operations 1. Set MBAR to 0xf0000000 in CodeWarrior s target initialization file. 2. Initializes SDRAM controller by CodeWarrior s target initialization file. 3. Call the test_ethernet() function to begin the following Ethernet test operations. 4. Set the element taskbar address in sdma_regs to MBAR_SRAM to point to the base of the Task Table. 5. Call the loadtask() function to load receive and transmit Ethernet SDMA tasks into the SRAM. 6. Call the MGT5100_Eth_Init() function to initialize software data structures. 7. Call the nif_bind_proto() function to register a receive callback function with a given protocol. 8. Call the MGT5100_Eth_Start() function to configure the FEC control registers, configure the MII PHY registers (if present, 7-wire PHYs need no initialization) and start the SmartComm task. 9. Call the MGT5100_Eth_Send() function to send an Ethernet data frame from a source address to a destination address. In the case of the test example included, source and destination have the same address. 10. Call the MGT5100_Eth_Receive() function in the interrupt handler to manage received frames. However, in this test example, test_rx_buf() function is called instead to check the status of the receive buffer. 11. Call the MGT5100_Eth_Stop() function to stop sending and receiving ethernet frames. This causes the SmartComm task and the FEC to be disabled. 4 Implementing an MGT5100 Ethernet Driver MOTOROLA

Order of Operations Ethernet Test Example Follow these steps in order to run the Ethernet Test Example using CodeWarrior EPPC6.1 in conjunction with Abatron BDI 2000. 1. Install and set up CodeWarrior EPPC6.1. 2. Install and set up Abatron BDI2000. 3. Set up MGT5100 IceCube board. 4. Power up Abatron. 5. Power up IceCube board. 6. Make a serial connection (57600, 8N1) to the IceCube board to view standard output from the execution of the test program. 7. Open up the Ethernet Example Test CodeWarrior Project MGT5100 ETHERNET EXAMPLE.mcp. 8. Click Run Button from the CodeWarrior Stationary or select Run from the Project Menu. 9. The output of the test program should closely resemble the following sample output. Test Program Sample Output Welcome to CodeWarrior EPPC 6.1! 2 RAM Version Jun 7 2002 01:25:28 Welcome to CodeWarrior EPPC 6.1! 1 RAM Version Jun 7 2002 01:25:28 ************************************ Ethernet Test Settings ETH_DEBUG: 0x1ff Promiscous mode used Loop mode used Receive interrupt disabled Transceive interrupt disabled base task number = 0, number of tasks = 2 task_org = 0x00007f00 start1 = 0x00000009, start2 = 0xf00041b8 TDT start = 0x00000040, end = 0x000001b8 MGT5100_Eth_Start is called Mii reg 0: 0x1000 Mii reg 1: 0x782d Mii reg 2: 0x0013 Mii reg 3: 0x78e2 Mii reg 4: 0x01e1 Mii reg 5: 0x45e1 Mii reg 6: 0x0007 Mii reg 7: 0x2001 Mii reg 8: 0x0000 Mii reg 16: 0x0084 Mii reg 17: 0x4780 Mii reg 18: 0x0000 Mii reg 19: 0x00f4 Mii reg 20: 0x0422 SDMA task will be enabled now MOTOROLA Implementing an MGT5100 Ethernet Driver 5

MGT5100_Eth_Send is called Frame is sent RX Buffer 0 not empty Status: 0x0800 Data Length: 518 MGT5100_Eth_Stop is called Mii reg 0: 0x1000 Mii reg 1: 0x782d Mii reg 2: 0x0013 Mii reg 3: 0x78e2 Mii reg 4: 0x01e1 Mii reg 5: 0x45e1 Mii reg 6: 0x0007 Mii reg 7: 0x2001 Mii reg 8: 0x0000 Mii reg 16: 0x0084 Mii reg 17: 0x4780 Mii reg 18: 0x0000 Mii reg 19: 0x0000 Mii reg 20: 0x0422 6 Implementing an MGT5100 Ethernet Driver MOTOROLA

Order of Operations MOTOROLA Implementing an MGT5100 Ethernet Driver 7

HOW TO REACH US: USA/EUROPE/LOCATIONS NOT LISTED: Motorola Literature Distribution; P.O. Box 5405, Denver, Colorado 80217 1-303-675-2140 or 1-800-441-2447 JAPAN: Motorola Japan Ltd.; SPS, Technical Information Center, 3-20-1, Minami-Azabu Minato-ku, Tokyo 106-8573 Japan 81-3-3440-3569 ASIA/PACIFIC: Motorola Semiconductors H.K. Ltd.; Silicon Harbour Centre, 2 Dai King Street, Tai Po Industrial Estate, Tai Po, N.T., Hong Kong 852-26668334 TECHNICAL INFORMATION CENTER: 1-800-521-6274 HOME PAGE: http://www.motorola.com/semiconductors Information in this document is provided solely to enable system and software implementers to use Motorola products. There are no express or implied copyright licenses granted hereunder to design or fabricate any integrated circuits or integrated circuits based on the information in this document. Motorola reserves the right to make changes without further notice to any products herein. Motorola makes no warranty, representation or guarantee regarding the suitability of its products for any particular purpose, nor does Motorola assume any liability arising out of the application or use of any product or circuit, and specifically disclaims any and all liability, including without limitation consequential or incidental damages. Typical parameters which may be provided in Motorola data sheets and/or specifications can and do vary in different applications and actual performance may vary over time. All operating parameters, including Typicals must be validated for each customer application by customer s technical experts. Motorola does not convey any license under its patent rights nor the rights of others. Motorola products are not designed, intended, or authorized for use as components in systems intended for surgical implant into the body, or other applications intended to support or sustain life, or for any other application in which the failure of the Motorola product could create a situation where personal injury or death may occur. Should Buyer purchase or use Motorola products for any such unintended or unauthorized application, Buyer shall indemnify and hold Motorola and its officers, employees, subsidiaries, affiliates, and distributors harmless against all claims, costs, damages, and expenses, and reasonable attorney fees arising out of, directly or indirectly, any claim of personal injury or death associated with such unintended or unauthorized use, even if such claim alleges that Motorola was negligent regarding the design or manufacture of the part. Motorola and the Stylized M Logo are registered in the U.S. Patent and Trademark Office. digital dna is a trademark of Motorola, Inc. All other product or service names are the property of their respective owners. Motorola, Inc. is an Equal Opportunity/Affirmative Action Employer. Motorola, Inc. 2002 AN2297/D