16
GMII Gigabit Ethernet Autonegotiation Component Guide C-WARE SOFTWARE TOOLSET, VERSION 2.4 CSTCGEAN-UG/D Rev 01 Freescale Semiconductor, I nc...

GMII Gigabit Ethernet Autonegotiation Component Guidecache.freescale.com/files/netcomm/doc/user_guide/CSTCGEAN-UG.pdf · GMII Gigabit Ethernet Autonegotiation Component Guide C-WARE

  • Upload
    lelien

  • View
    234

  • Download
    0

Embed Size (px)

Citation preview

Fre

esc

ale

Se

mic

on

du

cto

r, I

Freescale Semiconductor, Inc.

nc

...

GMII Gigabit Ethernet Autonegotiation Component Guide

C-WARE SOFTWARE TOOLSET, VERSION 2.4

CSTCGEAN-UG/DRev 01

For More Information On This Product,

Go to: www.freescale.com

Fre

esc

ale

Se

mic

on

du

cto

r, I

Freescale Semiconductor, Inc.

nc

...

Copyright © 2004 Motorola, Inc. All rights reserved. No part of this documentation may be reproduced in any form or by any means or used to make any derivative work (such as translation, transformation, or adaptation) without written permission from Motorola.

Motorola reserves the right to revise this documentation and to make changes in content from time to time without obligation on the part of Motorola to provide notification of such revision or change.

Motorola provides this documentation without warranty, term, or condition of any kind, either implied or expressed, including, but not limited to, the implied warranties, terms or conditions of merchantability, satisfactory quality, and fitness for a particular purpose. Motorola may make improvements or changes in the product(s) and/or the program(s) described in this documentation at any time.

C-3e, C-5, C-5e, C-Port, and C-Ware are all trademarks of C-Port, a Motorola Company. Motorola and the stylized Motorola logo are registered in the US Patent & Trademark Office. All other product or service names are the property of their respective owners.

For More Information On This Product,

Go to: www.freescale.com

MOTOROLA GENERAL BUSINESS INFORMATION

Fre

esc

ale

Se

mic

on

du

cto

r, I

Freescale Semiconductor, Inc.

For More Inform Go to: w

nc

...

CSTCGEAN-UG/D

Rev 01

CONTENTS

About This GuideGuide Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5Using PDF Documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6Guide Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7Revision History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8References to CST Pathnames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9Related Product Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

CHAPTER 1 GMII Gigabit Ethernet Autonegotiation Component GuideOverview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

Prerequisite Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11Component Control and Data Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12Standards Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13Resource Utilization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

XPRC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13CPRC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

Supplied Application Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14Common . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14XPRC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14CPRC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15Binaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

Alternate Application Component Configurations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

CSTCGEAN-UG/D REV 01

ation On This Product,ww.freescale.com

4 CONTENTS

Fre

esc

ale

Se

mic

on

du

cto

r, I

Freescale Semiconductor, Inc.

nc

...

CSTCGEAN-UG/D REV 01 MOTOROLA GENERAL BUSINESS INFORMATION

For More Information On This Product,

Go to: www.freescale.com

MOTOROLA GENERAL BUSINESS INFORMATION

Fre

esc

ale

Se

mic

on

du

cto

r, I

Freescale Semiconductor, Inc.

For More Inform Go to: w

nc

...

CSTCGEAN-UG/D

Rev 01

ABOUT THIS GUIDE

Guide Overview This document describes the design and features of the C-Ware GMII Gigabit Ethernet Autonegotiation application component (component identifier gmiiAutoNeg) .

This guide is intended for users of the C-Ware Software Toolset (CST) who want to build any application provided in the CST or who want to develop new C-Ware-based applications targeted to a C-Port network processor device.

This guide contains one chapter that covers the following major topics:

• Overview

• Component Control and Data Flow

• Standards Support

• Resource Utilization

• Supplied Application Files

• Alternate Application Component Configurations

CSTCGEAN-UG/D REV 01

ation On This Product,ww.freescale.com

6 ABOUT THIS GUIDE

Fre

esc

ale

Se

mic

on

du

cto

r, I

Freescale Semiconductor, Inc.

nc

...

Using PDF Documents Electronic documents are provided as PDF files. Open and view them using the Adobe® Acrobat® Reader application, version 3.0 or later. If necessary, download the Acrobat Reader from the Adobe Systems, Inc. web site:

http://www.adobe.com/prodindex/acrobat/readstep.html

PDF files offer several ways for moving among the document’s pages, as follows:

• To move quickly from section to section within the document, use the Acrobat bookmarks that appear on the left side of the Acrobat Reader window. The bookmarks provide an expandable ‘outline’ view of the document’s contents. To display the document’s Acrobat bookmarks, press the ‘Display both bookmarks and page’ button on the Acrobat Reader tool bar.

• To move to the referenced page of an entry in the document’s Contents or Index, click on the entry itself, each of which is “hot linked.”

• To follow a cross-reference to a heading, figure, or table, click the blue text.

• To move to the beginning or end of the document, to move page by page within the document, or to navigate among the pages you displayed by clicking on hyperlinks, use the Acrobat Reader navigation buttons shown in this figure:

Beginning of document End of document

Next pagePrevious page

Previous or next hyperlink

CSTCGEAN-UG/D REV 01 MOTOROLA GENERAL BUSINESS INFORMATION

For More Information On This Product,

Go to: www.freescale.com

Guide Conventions 7

Fre

esc

ale

Se

mic

on

du

cto

r, I

Freescale Semiconductor, Inc.

nc

...

Table 1 summarizes how to navigate within an electronic document.

Guide Conventions The following visual elements are used throughout this guide, where applicable:

This icon and text designates information of special note.

Warning: This icon and text indicate a potentially dangerous procedure. Instructions contained in the warnings must be followed.

Warning: This icon and text indicate a procedure where the reader must take precautions regarding laser light.

This icon and text indicate the possibility of electrostatic discharge (ESD) in a procedure that requires the reader to take the proper ESD precautions.

Table 1 Navigating Within a PDF Document

TO NAVIGATE THIS WAY CLICK THIS

Move from section to section within the document.

A bookmark on the left side of the Acrobat Reader window

Move to an entry in the document’s Contents or Index.

The entry itself

Follow a cross-reference (highlighted in blue text).

The cross-reference text

Move page by page. The appropriate Acrobat Reader navigation buttons

Move to the beginning or end of the document.

The appropriate Acrobat Reader navigation buttons

Move backward or forward among a series of hyperlinks you have selected.

The appropriate Acrobat Reader navigation buttons

MOTOROLA GENERAL BUSINESS INFORMATION CSTCGEAN-UG/D REV 01

For More Information On This Product,

Go to: www.freescale.com

8 ABOUT THIS GUIDE

Fre

esc

ale

Se

mic

on

du

cto

r, I

Freescale Semiconductor, Inc.

nc

...

Revision History Table 2 provides details about changes made for each revision of this guide.

Table 2 Build System Conventions Guide Revision History

REVISION DATE CHANGES

01 9/2001 New document.

CSTCGEAN-UG/D REV 01 MOTOROLA GENERAL BUSINESS INFORMATION

For More Information On This Product,

Go to: www.freescale.com

References to CST Pathnames 9

Fre

esc

ale

Se

mic

on

du

cto

r, I

Freescale Semiconductor, Inc.

nc

...

References to CST Pathnames

You typically install the C-Ware Software Toolset (CST) on your development workstation in a directory path suggested by the installation procedure, such as:

• C:\C-Port\Cstx.y\ (on Windows 2000/XP)

• /usr/yourlogin/C-Port/Cstx.y/ (on Sun SPARC Solaris and Linux)

or:

/usr/cport/C-Port/Cstx.y/

or:

/opt/C-Port/Cstx.y/

where ‘x’ is a major version number and ‘y’ is a minor (or intermediate) version number.

You typically install each CST version under some directory path ...\C-Port\Cstx.y\. However, the user can install the CST in any directory on the development workstation. The user can also install more than one CST version on the same workstation.

Therefore, to refer to installed CST directories, we use pathnames that are relative to the ...\C-Port\Cstx.y\ path, which is the “root” of a given CST installation.

For example, the apps\gbeSwitch\ directory path refers to the location of the Gigabit Ethernet Switch application that is installed as part of the CST. The full path of this directory on a Windows 2000/XP system might be C:\C-Port\Cst2.1\apps\gbeSwitch\, so this convention is convenience for shortening the pathname.

Other top-level directories that are installed as part of the CST include bin\, diags\, Documentation\, services\, and so on. These directories are described in the C-Ware Software Toolset Getting Started Guide document, which is part of the CST documentation set.

MOTOROLA GENERAL BUSINESS INFORMATION CSTCGEAN-UG/D REV 01

For More Information On This Product,

Go to: www.freescale.com

10 ABOUT THIS GUIDE

Fre

esc

ale

Se

mic

on

du

cto

r, I

Freescale Semiconductor, Inc.

nc

...

Related Product Documentation

Table 3 lists the documentation for the C-Ware library of reference applications.

Table 3 C-Ware Application Library Documentation Set

DOCUMENT NAME PURPOSE DOCUMENT ID

AAL-5 Fabric Port SAR to Gigabit Ethernet Switch Application Guide

Describes the key characteristics of the gbeOc12SarFp applications.

CSTAA5F2G-UG

AAL-5 SAR to Gigabit Ethernet Switch Application Guide

Describes the key characteristics of the gbeOc12Sar application. CSTAA52G-UG

FibreChannel to Gigabit Ethernet IP Gateway Application Guide

Describes the key characteristics of the gbeFc application. CSTAFC2G-UG

Frame Relay to ATM to 10/100 Ethernet Switch Router Application Guide

Describes the key characteristics of the switchRouter application. CSTAFRAE-UG

Gigabit Ethernet Switch Application Guide Describes the key characteristics of the gbeSwitch application. CSTAGBE-UG

Multi-PHY Switch Application Guide Describes the key characteristics of the mphySwitch application. CSTAMPHYS-UG

Packet Over SONET Switch Application Guide Describes the key characteristics of the posOc48Sc application. CSTAPOS-UG

Packet Over SONET to Ethernet Switch Application Guide

Describes the key characteristics of the enetOc3Switch application.

CSTAPOS2E-UG

Packet Over SONET to Gigabit Ethernet Switch Application Guide

Describes the key characteristics of the posGbeSwitch application.

CSTAPOS2G-UG

Voice Over IP to Voice Over ATM Media Gateway Application Guide

Describes the key characteristics of the voIpToVoAtmSwitch application.

CSTAVOIP-UG

Fabric Processor Configuration Component Guide

Describes the key characteristics of the fabrics application component.

CSTCFPC-UG

GMII Gigabit Ethernet Autonegotiation Component Guide

Describes the key characteristics of the gmiiAutoNeg application component.

CSTCGEAN-UG

ICMP Support Component Guide Describes the key characteristics of the ip application component. CSTCICMP-UG

MPC750 SBC Host Stack Support Component Guide

Describes the key characteristics of the stackSupport application component.

CSTCMHSS-UG

PHY Configuration Component Guide Describes the key characteristics of the phy application component.

CSTCPHYC-UG

QMU Configuration and RC Support Component Guide

Describes the key characteristics of the queueUtils application component.

CSTCQRCS-UG

SONET Monitoring Component Guide Describes the key characteristics of the sonet application component.

CSTCSMC-UG

CSTCGEAN-UG/D REV 01 MOTOROLA GENERAL BUSINESS INFORMATION

For More Information On This Product,

Go to: www.freescale.com

MOTOROLA GENERAL BUSINESS INFORMATION

Fre

esc

ale

Se

mic

on

du

cto

r, I

Freescale Semiconductor, Inc.

For More Inform Go to: w

nc

...

CSTCGEAN-UG/D

Rev 01

Chapter 1

GMII GIGABIT ETHERNET AUTONEGOTIATION COMPONENT GUIDE

Overview This document specifies how an application may use the gmiiAutoNeg application component in the CST.

This C-Ware application component provides an application with a 10/100/1000 GMII autonegotiation capability. This component assumes the use of a Broadcom BCM5402 or interface-compatible GMII PHY connected to the C-5 NP’s MDIO interface. It also assumes the use of the Combo-2 PIM regarding the association of CPRCs with GMII ports.

Prerequisite Reading Readers of this document are assumed to have read or be familiar with the topics in the following documents in the CST:

• C-Ware Software Toolset Getting Started Guide — How to get started with the CST.

• Build System Conventions — Description of how the build system works.

CSTCGEAN-UG/D REV 01

ation On This Product,ww.freescale.com

12 CHAPTER 1: GMII GIGABIT ETHERNET AUTONEGOTIATION COMPONENT GUIDE

Fre

esc

ale

Se

mic

on

du

cto

r, I

Freescale Semiconductor, Inc.

nc

...

Component Control and Data Flow

Since the CPRCs do not have access to the MDIO interface, the XPRC must monitor and convey the PHY state to the associated CPRCs. The following diagram depicts the control flow for a GMII autonegotiation update action. A textual description follows the diagram.

Figure 1 Control Flow

1 The XPRC reads registers on GMII PHY over the MDIO interface to monitor the PHY link status.

2 GMII autonegotiation code on the XPRC sends a message to the Base CPRC for the cluster directing it to disable the port.

3 The Base CPRC, using shared memory writes, sets the port state to disabled for all CPRCs in the cluster.

4 The Base CPRC sends an acknowledgement message to the XPRC indicating that the port is disabled.

XPRCBase CPRC

for Cluster

Non-Base

CPRC

GMII PHY

New Link Status[1] Disable Port [2]

Port Disabled [4]

New Port Status [5]Port Updated [8]

Enable Port [9]

Port Enabled [11]

portState Disabled [3]

New Port Status [6]

Port Updated [7]

portState Enabled [10]

CSTCGEAN-UG/D REV 01 MOTOROLA GENERAL BUSINESS INFORMATION

For More Information On This Product,

Go to: www.freescale.com

Standards Support 13

Fre

esc

ale

Se

mic

on

du

cto

r, I

Freescale Semiconductor, Inc.

nc

...

5 The XPRC sends a message to the Base CPRC with the new port status (line rate, duplex mode, etc.).

6 The Base CPRC sends a message to each non-base CPRC with the new port status.

7 The non-base CPRCs send acknowledgement messages to the Base CPRC indicating that port status has been updated. The Base CPRC now updates its own local port status.

8 The Base CPRC sends an acknowledgement message to the XPRC indicating that the port status has been updated.

9 The XPRC sends a message to the Base CPRC directing it to enable the port.

10 The Base CPRC, using shared memory writes, sets the port state to enabled for all CPRCs in the cluster.

Standards Support There are no applicable standards related to this application component.

Resource Utilization The resources used by this application component are described below.

XPRC The GMII autonegotiation code running on the XPRC monitors the GMII PHY for state changes and monitors a control queue for messages from the CPRCs. To implement the sequence described above in the flow diagram the XPRC utilizes a state machine in the GMII autonegotiation code. Each cycle through the states starts with a read of the PHY. The main processing loop in the application’s XPRC code is responsible for periodically calling the GMII autonegotiation code to trigger reading the GMII PHY. If the link status read from the PHY matches the currently configured state, the state machine returns to the initial state until called again by the application. If the link status differs from the currently configured state, additional states are exercised to generate the message sequence described by the flow diagram.

Currently there have been problems with sporadic autonegotiation sequences triggered by temporary changes in the pause mode value read from the PHY. To prevent these temporary changes from triggering a full autonegotiation sequence in the XPRC and CPRC, the XPRC currently ignores the value for pause mode from the PHY and always programs the CPRC for symmetric pause support.

MOTOROLA GENERAL BUSINESS INFORMATION CSTCGEAN-UG/D REV 01

For More Information On This Product,

Go to: www.freescale.com

14 CHAPTER 1: GMII GIGABIT ETHERNET AUTONEGOTIATION COMPONENT GUIDE

Fre

esc

ale

Se

mic

on

du

cto

r, I

Freescale Semiconductor, Inc.

nc

...

CPRC The CPRC GMII autonegotiation processing is strictly message driven. The application must periodically check for the presence of messages in the GMII control queue and call the gmiiAutoNegProcessCtlCmd() routine to read and process the message.

The application must also periodically check the value of the global ‘portState’ variable and transition to a halted state when the ‘portState’ indicates that the port is disabled.

After entering the halted state, application processing on the base CPRC is responsible for generating the port disabled message to the XPRC and should then continuously monitor the control queue for all CPRCs. After the ‘portState’ indicates that the port has been re-enabled, the application is free to resume normal processing.

Supplied Application Files Below is a list of the files that are a part of this application and a brief description of their contents.

Common Files that apply to all processors are as follows:

XPRC Files that apply to the XPRC are as follows:

FILE NAME LOCATION DESCRIPTION

gmiiPhyIf.h .../c5/inc/ Contains definitions, types, and data structures used for GMII autonegotiation on both the CPRC and XPRC.

FILE NAME LOCATION DESCRIPTION

gmiiAutoNegXp.h .../c5/xprc/inc/ Types and function prototypes for use with the gmiiAutoNegXp.c file.

gmiiPhyMgmtXp.h .../c5/xprc/inc/ Types and function prototypes for use with the gmiiPhyMgmtXp.c file

gmiiAutoNegXp.c .../c5/xprc/src Contains initialization and message processing code for GMII autonegotiation on the XPRC.

gmiiPhyMgmtXp.c .../c5/xprc/src Contains initialization and state machine processing for reading the GMII PHY and generating appropriate messages.

CSTCGEAN-UG/D REV 01 MOTOROLA GENERAL BUSINESS INFORMATION

For More Information On This Product,

Go to: www.freescale.com

Alternate Application Component Configurations 15

Fre

esc

ale

Se

mic

on

du

cto

r, I

Freescale Semiconductor, Inc.

nc

...

CPRC Files that apply to the CPRC are as follows:

Binaries Binary files associated with this application component include:

Alternate Application Component Configurations

There are two configurations for GMII autonegotiation supported by this component:

• Two ports of single cluster GMII

• One port of dual cluster GMII

The default build is for one port of dual cluster. In order to build for the other configuration, the library must be compiled with SINGLE_CLUSTER_GMII defined. If both configurations are desired in a single installation, one of the configurations must be compiled to a separate area to avoid a library with mixed configurations. The posGbeSwitch application compiles for single cluster and compiles the GMII autonegotiation source code to the application’s object code area. Please see that application’s Makefile for an example of how that is done.

FILE NAME LOCATION DESCRIPTION

gmiiAutoNegCp.h .../c5/cprc/inc/ Contains definitions and prototypes for use with the gmiiAutoNegCp.c file.

gmiiAutoNegCp.c .../c5/cprc/src/ Contains initialization, message processing for GMII autonegotiation, and code necessary for reconfiguring the port and SDPs for the different GMII modes.

FILE NAME LOCATION DESCRIPTION

gmiiAutoNeg.a .../lib/$VARIANT/$CPORT_PROC/

Library containing executable code for this component.

MOTOROLA GENERAL BUSINESS INFORMATION CSTCGEAN-UG/D REV 01

For More Information On This Product,

Go to: www.freescale.com

16 CHAPTER 1: GMII GIGABIT ETHERNET AUTONEGOTIATION COMPONENT GUIDE

Fre

esc

ale

Se

mic

on

du

cto

r, I

Freescale Semiconductor, Inc.

nc

...

CSTCGEAN-UG/D REV 01 MOTOROLA GENERAL BUSINESS INFORMATION

For More Information On This Product,

Go to: www.freescale.com