Initializing the TSEC Controller



Similar documents
etpu Host Interface by:

Local Interconnect Network (LIN) Physical Interface

Improving Embedded Software Test Effectiveness in Automotive Applications

Programming Audio Applications in the i.mx21 MC9328MX21

Data Movement Between Big-Endian and Little-Endian Devices

Windows 7: Using USB TAP on a Classic CodeWarrior Installation (MGT V9.2 DSC V8.3)

Performance Monitor on PowerQUICC II Pro Processors

PowerQUICC II Pro (MPC83xx) PCI Agent Initialization

Understanding LCD Memory and Bus Bandwidth Requirements ColdFire, LCD, and Crossbar Switch

User Interface Design using CGI Programming and Boa Web Server on M5249C3 Board

Detecting a CPM Overload on the PowerQUICC II

Connecting Low-Cost External Electrodes to MED-EKG

How To Build A Project On An Eclipse Powerbook For Anarc (Powerbook) On An Ipa (Powerpoint) On A Microcontroller (Powerboard) On Microcontrollers (Powerstation) On Your Microcontroller 2 (Powerclock

Software Real Time Clock Implementation on MC9S08LG32

Handling Freescale Pressure Sensors

IRTC Compensation and 1 Hz Clock Generation

Using WinUSB in a Visual Studio Project with Freescale USB device controller

Enhanced Serial Interface Mapping

Techniques and Tools for Software Analysis

Hardware Configurations for the i.mx Family USB Modules

MPC8245/MPC8241 Memory Clock Design Guidelines: Part 1

Cyclic Redundant Checker Calculation on Power Architecture Technology and Comparison of Big-Endian Versus Little-Endian

Connecting to an SMTP Server Using the Freescale NanoSSL Client

Blood Pressure Monitor Using Flexis QE128 Gabriel Sanchez RTAC Americas

Flexible Active Shutter Control Interface using the MC1323x

Installation of the MMA955xL CodeWarrior Service Pack Author: Fengyi Li Application Engineer

How To Control A Motor Control On An Hvac Platform

Point-of-Sale (POS) Users Guide Lech José Olmedo Guerrero Jaime Herrerro Gallardo RTAC Americas

PQ-MDS-T1 Module. HW Getting Started Guide. Contents. About This Document. Required Reading. Definitions, Acronyms, and Abbreviations

Using the Performance Monitor Unit on the e200z760n3 Power Architecture Core

Freescale Embedded GUI Converter Utility 2.0 Quick User Guide

Generate Makefiles from Command Line Support in Eclipse-Based CodeWarrior Software

MC13783 Buck and Boost Inductor Sizing

MCF54418 NAND Flash Controller

Freescale Semiconductor. Integrated Silicon Pressure Sensor. On-Chip Signal Conditioned, Temperature Compensated and Calibrated MPX4080D.

3-Phase BLDC Motor Control with Hall Sensors Using 56800/E Digital Signal Controllers

How to Convert 3-Axis Directions and Swap X-Y Axis of Accelerometer Data within Android Driver by: Gang Chen Field Applications Engineer

MLPPP in the Evolving Radio Access Network

Using Program Memory As Data Memory. 1. Introduction Program Memory and Data. Contents. Memory. Freescale Semiconductor Application Note

Genesi Pegasos II Setup

White Paper. Freescale s Embedded Hypervisor for QorIQ P4 Series Communications Platform

Using XGATE to Implement LIN Communication on HCS12X Daniel Malik 8/16-Bit Products Division East Kilbride, Scotland

VGA Output using TV-Out Extension Solution i.mx21

Understanding Pressure and Pressure Measurement

Freescale Semiconductor. Integrated Silicon Pressure Sensor. On-Chip Signal Conditioned, Temperature Compensated and Calibrated MPX5500.

USB HID bootloader for the MC9S08JM60

Real Time Development of MC Applications using the PC Master Software Visualization Tool. 1. Introduction. 2. Development of Motor Control.

MSC8156 and MSC8157 PCI Express Performance

Using the HC08 SCI Module

3-Phase BLDC Motor Control with Hall Sensors Using the MC56F8013

Using the Kinetis Security and Flash Protection Features

How To Fit A 2Mm Exposed Pad To A Dfn Package

How To Measure Power Of A Permanent Magnet Synchronous Motor

Using the High Input Voltage Charger for Single Cell Li-Ion Batteries (KIT34671EPEVBE)

How To Improve Performance On A P4080 Processor

ColdFire Security SEC and Hardware Encryption Acceleration Overview

ITU-T V.42bis Data Dictionary Search on the StarCore SC140/SC1400 Cores

Freescale Variable Key Security Protocol Transmitter User s Guide by: Ioseph Martínez and Christian Michel Applications Engineering - RTAC Americas

Processor Expert Software Microcontrollers Driver Suite Getting Started Guide

Developing an Application for the i.mx Devices on the Linux Platform

Using eflexpwm Module for ADC Synchronization in MC56F82xx and MC56F84xx Family of Digital Signal Controllers

Efficient Low-Level Software Development for the i.mx Platform

Implementing Positioning Algorithms Using Accelerometers

User Guide. Introduction. HCS12PLLCALUG/D Rev. 0, 12/2002. HCS12 PLL Component Calculator

CodeWarrior Development Studio Floating Licensing Quick Start

Comparison of MC9S08QE128 and MCF51QE128 Microcontrollers Scott Pape and Eduardo Montanez Systems Engineering, Freescale Microcontroller Division

Emulated EEPROM Implementation in Dual Flash Architecture on MC9S08LG32 With Demo Description

Installing Service Pack Updater Archive for CodeWarrior Tools (Windows and Linux) Quick Start

i.mx28 Ethernet Performance on Linux

Getting Started with the Student Learning Kit Featuring the Freescale HCS12 Microcontroller Application Module

A Utility for Programming Single FLASH Array HCS12 MCUs, with Minimum RAM Overhead

Adding SDIO Wi-Fi Solution to i.mx Windows CE 5.0/Windows CE 6.0

VLE 16-bit and 32-bit Instruction Length Decode Algorithm

i.mx Applications Processors with Hantro's Multimedia Framework

Quickly Turning Ideas into Microcontroller-Based Applications with CodeWarrior Development Tools and UNIS Processor Expert

NOT RECOMMENDED FOR NEW DESIGN

CodeWarrior Development Studio for Freescale S12(X) Microcontrollers Quick Start

AND8336. Design Examples of On Board Dual Supply Voltage Logic Translators. Prepared by: Jim Lepkowski ON Semiconductor.

Installing Service Pack Updater Archive for CodeWarrior Tools (Windows and Linux) Quick Start

Configuring the FlexTimer for Position and Speed Measurement with an Encoder

SEMICONDUCTOR TECHNICAL DATA

AND9190/D. Vertical Timing Optimization for Interline CCD Image Sensors APPLICATION NOTE

AND8365/D. 125 kbps with AMIS-4168x APPLICATION NOTE

USB to SPI Interface Evaluation Board

Robust Over-the-Air Firmware Updates Using Program Flash Memory Swap on Kinetis Microcontrollers

NOT RECOMMENDED FOR NEW DESIGN

P D Operating Junction Temperature T J 200 C Storage Temperature Range T stg 65 to +150 C

How to Do EEPROM Emulation Using Double Flash Array on MC9S08LC60 Ronald Gonzalez and Tatiana Orofino RTAC Americas

LOW POWER SCHOTTKY. GUARANTEED OPERATING RANGES ORDERING INFORMATION

MPXAZ6115A MPXHZ6115A SERIES. Freescale Semiconductor Technical Data. MPXAZ6115A Rev 4, 01/2007

LOW POWER NARROWBAND FM IF

Avoiding Read While Write Errors When Developing In-Software Flash Programming Applications for Kinetis and ColdFire+ MCUs

AND9015. A Solution for Peak EMI Reduction with Spread Spectrum Clock Generators APPLICATION NOTE. Prepared by: Apps Team, BIDC ON Semiconductor

Freescale Semiconductor, Inc. Product Brief Integrated Portable System Processor DragonBall ΤΜ

Ref Parameters Symbol Conditions Min Typ Max Units. Standby μa. 3 Range kpa. 4 Resolution 0.15 kpa. 5 Accuracy -20ºC to 85ºC ±1 kpa

ULN2803A ULN2804A OCTAL PERIPHERAL DRIVER ARRAYS

Freescale Semiconductor, I

Transcription:

Freescale Semiconductor Application Note Document Number: AN2925 Rev. 0, 11/2005 Initializing the TSEC Controller by Ahsan Kabir Digital Systems Division Freescale Semiconductor, Inc. Austin, TX This application note describes how to initialize the MPC8560 TSEC controller. The software is written for the TSEC controller and it is tested on the MPC8560ADS board. The TSEC software, which is tested on the MPC8560ADS board, is available with this application note at the Freescale web site listed on the back cover of this document. The ID of the.zip file is AN2925SW. To augment the comments embedded in the source code, this application note describes how the MAC loopback, PHY loopback, and external loopback work. Contents 1. Introduction................................. 2 2. Test Cases.................................. 3 3. Test Results................................. 4 4. File Structure................................ 4 5. Conclusion................................. 4 Freescale Semiconductor, Inc., 2004, 2005. All rights reserved.

Introduction 1 Introduction The TSEC controller has a wide variety of features. This application note focuses on important operational concepts in the test code. 1.1 Hardware Setup The software is tested on MPC8560ADS RevA board, which has two Gigabit Ethernet PHY devices, one connected to TSEC1 and the other connected to TSEC2. These PHY devices are Alaska Ultra 88E1011S from Marvell. Power-on reset configuration of these PHY devices depends on the J55 and J47 headers. J55 controls the configuration settings for TSEC1 and J47 controls the configuration settings for TSEC2. For instance, the PHY connected to TSEC1 has a different PHY address based on whether the configuration plug is placed on the J55 header. Without the configuration plug, the PHY address connected to TSEC1 is 0; with the configuration plug, it is 15. The software assumes that both J55 and J47 are without the configuration plugs. To better understand how the power-on reset configuration values are determined for the PHY devices, refer to the schematic view of J55 and J47. Also, refer to Section 11.4 of the MPC8560ADS User s Manual and the PHY datasheet. 1.2 Software Test code written to initialize the TSEC controller prepares 32 transmit and receive BDs. Enough embedded comments are provided in the source code for easy understanding of the code flow. Following are the key features of the TSEC software: Individual address is used for the station (ADS). The MAC address for the station is 0x12345678ABCD. Note that assignaddresses() routine byte swaps this value and places the swapped value into two station address registers. The MAC address is swapped because it must be presented in Little-Endian format. Thirty-two BDs (transmit and receive) are defined in the BD rings. For transmit buffers, a static array of structure type TSEC_TXBUFFER is defined. As for the receive buffers, the code assumes that the start address of the receive buffer is 0xD00000. The preparetxbufferbd() and preparerxbufferbd() routines define the transmit BD ring, transmit buffer, receive BD ring, and receive buffer. When the user requests PHY Loopback, phyinit() routine initializes the Gigabit PHY connected to the TSEC. The software uses APIs to manage the read and write operations. In the PHY loopback mode, the control register (#0) is programmed to set the PHY in Gigabit mode and also to set the loopback mode. The test code provides polling and interrupts to check the status of frame transmission and reception. The default setting of this code has 32 BDs in the transmit and receive BD ring. Interrupt coalescing is enabled and, for every 16 frames transmitted, one interrupt is generated. For every 16 frames received, one interrupt is generated. The interrupt handler for transmit tsec1transmitisr() increments a global variable upon exiting. This counter value 2 Freescale Semiconductor

Test Cases becomes 2 after the run. The receive path functions in much the same way. The interrupt service routines can be found in the epic_handler.c file. For interrupts, the PIC controller is also initialized. 2 Test Cases The TSEC project is compiled and debugged using Codewarrior 8.6. Use the supplied tsec.mcp project and load this project in the CodeWarrior environment. For the printf statements to work, make sure that the CCB frequency of the MPC8560ADS board is set to 266MHz. Different clocks can be set up using the dip switch settings of the board, as described in the board user s manual for the MPC8560ADS RevA system. For all test cases discussed, the common operation is to compare the received data with the trashiness data. The test passes when received data is same as transmitted data. Test cases are defined through the MACRO values in tsec.h file. For all test cases, the following MACRO should be undefined. These two MACROs are present and indicate work in progress, but they cannot be used for the current version of the software. //#define NORMAL_MODE /* transmitting to wires and receiving from wires */ Also, for each test case, the user can use the polling scheme or interrupt scheme to get the status of frame transmission and reception by uncommenting either of the following: //#define STATUS_POLLING #define STATUS_INTERRUPT 2.1 MAC Loopback In MAC loopback mode, the loopback is performed within the TSEC MAC itself. The TSEC transmitter sends out data that is then looped back to the TSEC receiver. The PHY is not involved. Uncomment MAC_INTERNAL_LOOPBACK and comment out PHY_LOOPBACK in the tsec.h file. Also, choose the interface for this loopback mode. Define INTERFACE_MODE as GMII_INTERFACE, MII_INTERFACE, or TBI_INTERFACE. 2.2 PHY Loopback In PHY loopback mode, the TSEC MAC transmits data that is looped back by the PHY device to the receiver of the TSEC MAC. Uncomment PHY_LOOPBACK and comment out MAC_INTERNAL_LOOPBACK in the tsec.h file. The interface for PHY loopback is always GMII_INTERFACE. Freescale Semiconductor 3

Test Results 3 Test Results The software sends 32 Ethernet frames and receives 32 frames. In the polling scheme, the checkresults() routine returns a value of 0xFFFFFFFF when the receive frames match the transmitted frames. The transmitted frames are static arrays and these buffers can be checked using debugger transmitbuffer[]. For the receive buffer, memory display starts at memory location 0xD00000. If the interrupt scheme is chosen, global variables txbdcounter and rxbdcounter should both be 2. These global variables are incremented from tsec1transmitisr() and tsec1receiveisr(), respectively. 4 File Structure main.c: invokes a routine to initialize PIC and TSEC. tsec.c: initializes the TSEC controller. mgmt.c: contains APIs to manage initialization, reads, and writes. marvell_phy.c: contains minimal code for initializing the PHY. epic.c: contains initialization code for the PIC and other utility routines related to PIC. epic_handler.c: contains TSEC handlers. tsec.h: contains all MACROs for defining various test cases. epic.h: contains MACROs related to the PIC. 5 Conclusion The TSEC software tests TSEC loopback mode for the MAC and PHY. In the future, it may connect the TSEC to the external tester. 4 Freescale Semiconductor

Conclusion THIS PAGE INTENTIONALLY LEFT BLANK Freescale Semiconductor 5

Conclusion THIS PAGE INTENTIONALLY LEFT BLANK 6 Freescale Semiconductor

Conclusion THIS PAGE INTENTIONALLY LEFT BLANK Freescale Semiconductor 7

How to Reach Us: Home Page: www.freescale.com email: support@freescale.com USA/Europe or Locations Not Listed: Freescale Semiconductor Technical Information Center, CH370 1300 N. Alma School Road Chandler, Arizona 85224 (800) 521-6274 480-768-2130 support@freescale.com Europe, Middle East, and Africa: Freescale Halbleiter Deutschland GmbH Technical Information Center Schatzbogen 7 81829 Muenchen, Germany +44 1296 380 456 (English) +46 8 52200080 (English) +49 89 92103 559 (German) +33 1 69 35 48 48 (French) support@freescale.com Japan: Freescale Semiconductor Japan Ltd. Headquarters ARCO Tower 15F 1-8-1, Shimo-Meguro, Meguro-ku Tokyo 153-0064, Japan 0120 191014 +81 2666 8080 support.japan@freescale.com Asia/Pacific: Freescale Semiconductor Hong Kong Ltd. Technical Information Center 2 Dai King Street Tai Po Industrial Estate, Tai Po, N.T., Hong Kong +800 2666 8080 support.asia@freescale.com For Literature Requests Only: Freescale Semiconductor Literature Distribution Center P.O. Box 5405 Denver, Colorado 80217 (800) 441-2447 303-675-2140 Fax: 303-675-2150 LDCForFreescaleSemiconductor @hibbertgroup.com Information in this document is provided solely to enable system and software implementers to use Freescale Semiconductor 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. Freescale Semiconductor reserves the right to make changes without further notice to any products herein. Freescale Semiconductor makes no warranty, representation or guarantee regarding the suitability of its products for any particular purpose, nor does Freescale Semiconductor 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 Freescale Semiconductor 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. Freescale Semiconductor does not convey any license under its patent rights nor the rights of others. Freescale Semiconductor 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 Freescale Semiconductor product could create a situation where personal injury or death may occur. Should Buyer purchase or use Freescale Semiconductor products for any such unintended or unauthorized application, Buyer shall indemnify and hold Freescale Semiconductor 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 Freescale Semiconductor was negligent regarding the design or manufacture of the part. Freescale and the Freescale logo are trademarks of Freescale Semiconductor, Inc. The described product contains a PowerPC processor core. The PowerPC name is a trademark of IBM Corp. and used under license. All other product or service names are the property of their respective owners. Freescale Semiconductor, Inc., 2004, 2005. Document Number: AN2925 Rev. 0 11/2005