Printed in U.S.A., October 1996
L411001–9761 revisionA
SPWU013A
ThunderLAN
t
Programmer’s Guide
TNETE100A, TNETE1 10A, TNETE211
Manufacturing Part Number: L411001-9761 revision A
Literature Number: SPWU013A
October 1996
Running Title—Attribute Reference
T exas Instruments (TI) reserves the right to make changes to its products or to discontinue any
semiconductor product or service without notice, and advises its customers to obtain the latest
version of relevant information to verify , before placing orders, that the information being relied
on is current.
TI warrants performance of its semiconductor products and related software to the specifications
applicable at the time of sale in accordance with TI’s standard warranty . T esting and other quality
control techniques are utilized to the extent TI deems necessary to support this warranty.
Specific testing of all parameters of each device is not necessarily performed, except those
mandated by government requirements.
Certain applications using semiconductor products may involve potential risks of death,
personal injury , or severe property or environmental damage (“Critical Applications”).
TI SEMICONDUCTOR PRODUCTS ARE NOT DESIGNED, INTENDED, AUTHORIZED, OR
WARRANTED TO BE SUITABLE FOR USE IN LIFE-SUPPORT APPLICATIONS, DEVICES
OR SYSTEMS OR OTHER CRITICAL APPLICATIONS.
IMPORTANT NOTICE
Inclusion of TI products in such applications is understood to be fully at the risk of the customer.
Use of TI products in such applications requires the written approval of an appropriate TI officer .
Questions concerning potential risk applications should be directed to TI through a local SC
sales office.
In order to minimize risks associated with the customer’s applications, adequate design and
operating safeguards should be provided by the customer to minimize inherent or procedural
hazards.
TI assumes no liability for applications assistance, customer product design, software
performance, or infringement of patents or services described herein. Nor does TI warrant or
represent that any license, either express or implied, is granted under any patent right, copyright,
mask work right, or other intellectual property right of TI covering or relating to any combination,
machine, or process in which such semiconductor products or services might be or are used.
Copyright 1996, Texas Instruments Incorporated
ii
About This Manual
The
implementations of ThunderLAN networking hardware:
-
-
-
How to Use This Manual
The goal of this book is to assist you in the development of drivers for the
ThunderLAN controllers. This document contains the following chapters:
Chapter 1, ThunderLAN Overview, describes some Texas
Instruments-specific hardware features. These include the enhanced
media independent interface (MII), which passes interrupts from an
attached physical interface (PHY) to the host.
assists you in using the following
-
Chapter 2, ThunderLAN Registers, shows how to access the various
ThunderLAN registers and how to use these registers to access external
devices attached to ThunderLAN.
-
Chapter 3, Initializing and Resetting, discusses how to initialize and reset
the controller and the attached PHYs.
-
Chapter 4, Interrupt Handling, describes what happens when interrupts
occur and how to correct failure conditions.
-
Chapter 5, List Structures, describes how to pass data to ThunderLAN
using a system of linked list structures.
-
Chapter 6, Transmitting and Receiving Frames, explains the format and
procedure for transmitting and receiving, as well as the linked list structure
required.
-
Chapter 7, Physical Interface, discusses the features of ThunderLAN
which support IEEE 802.3- and 802.12-compliant devices.
iii
Notational Conventions
Notational Conventions
This document uses the following conventions:
-
-
Related Documentation
Information Technology Local and Metropolitan Area Networks–Part 12:
MAC Parameters, Physical Layer, Medium Attachment Units and
Program listings, program examples, and interactive displays are shown
in a special font. Examples use a bold version of the special font for
emphasis. Here is a sample program listing:
A lower case ‘x’ in a number indicates that position can be anything (don’t
care). Here are some examples:
J
0x00
J
0x0004
J
0x4000501
Demand-Priority Access Method, Physical Layer and Repeater
Specifications for 100-Mb/s Operation,
Draft 8.0 of the Revision
Marked for Technical changes of IEEE Standard 802.12.
Repeater for 100-Mb/s Operation,
Draft 5.0 of the Supplement to 1993
version of ANSI/IEEE Std. 802.3: Carrier Sense Multiple Access with
Collision Detection (CSMA/CD) Access Method & Physical Layer
Specifications.
is the specification which
ThunderLAN is designed to meet. T o obtain copies, contact PCI Special
Interest Group, P .O. Box 14070, Portland, OR 97214, 1–800–433–5177.
(Texas
Instruments literature number SPWT089) discusses specific buffering
and pacing techniques for improving adapter performance by adjusting
the resources and transmit procedures to achieve optimal transmission
rate and minimal CPU use.
EXEL Microelectronics, 1993, which contains the
device specifications for the XL24C02 2M-bit electrically erasable
EPROM.
iv
If Y ou Need Assistance / Trademarks
If You Need Assistance. . .
-
World-Wide Web Sites
TI Onlinehttp://www.ti.com
Semiconductor PIChttp://www.ti.com/sc/docs/pic/home.htm
Networking Home Pagehttp://www.ti.com/sc/docs/network/nbuhomex.htm
-
North America, South America, Central America
Product Information Center (PIC)(972) 644-5580
TI Literature Response Center U.S.A.(800) 477-8924
Software Registration/Upgrades(214) 638-0333Fax: (214) 638-7742
U.S.A. Factory Repair/Hardware Upgrades(713) 274-2285
U.S. Technical Training Organization(972) 644-5580
Networking HotlineFax: (713) 274-4027
-
Europe, Middle East, Africa
European Product Information Center (EPIC) Hotlines:
Literature Response Center+852 2 956 7288Fax: +852 2 956 2200
-
Japan
Product Information Center+0120-81-0026 (in Japan)Fax: +0120-81-0036 (in Japan)
+03-3457-0972 or (INTL) 813-3457-0972Fax: +03-3457-1259 or (INTL) 813-3457-1259
-
Documentation
When making suggestions or reporting errors in documentation, please include the following information that is on the title
page: the full title of the book, the publication date, and the literature number.
The ThunderLAN family consists of highly integrated, single-chip networking
hardware. It uses a high-speed architecture that provides a complete peripheral component interconnect (PCI)- to-10Base-T/AUI (adapter unit interface)
Ethernet solution. It allows the flexibility to handle 100M-bps Ethernet protocols as the user’s networking requirements change.
The TNETE100A, one implementation of the ThunderLAN architecture, is an
intelligent protocol network interface. Modular support for the 100 Base-T
(IEEE 802.3u) and 100VG-AnyLAN (IEEE 802.12) is provided via a media
independent interface (MII). The TNETE110A is the same device without the
MII and is 10M bps only . ThunderLAN uses a single driver suite to support multiple networking protocols.
ThunderLAN architecture was designed to achieve the following goals:
-
High performance with low use of host CPU
-
Simplicity of design
-
Ease of upgrade to higher speed networks
-
Freedom of choice of network protocol
ThunderLAN allows a simple system design by integrating a PCI controller, an
internal first in, first out (FIFO) buffer , a LAN controller, and a 10Base-T physical interface (PHY).
An integrated PHY provides interface functions for 10Base-T carrier sense
multiple access/collision detect (CSMA/CD) (Ethernet). A MII is used to communicate with the integrated PHY. The PHY is an independent module from
the rest of the ThunderLAN controller. This allows the PHY to be reset and
placed in a power-down mode.
FIFO
registers
Multiplexed
SRAM
LAN
controller
PHY
LAN
802.3
100M-bps
MII
The PCI controller is responsible for direct memory accesses (DMAs) to and
from the host memory . It is designed to relieve the host from time-consuming
data movements, thereby reducing use of the host CPU. The PCI interface
supports a 32-bit data path.
ThunderLAN supports two transmit and one receive channels. The demand
priority protocol supports two frame priorities: normal and priority. The two
transmit channels provide independent host channels for these two priority
types. CSMA/CD protocols only support a single frame priority, but the two
channels can be used to prioritize network access, if needed. All received
frames pass through the single receive channel.
ThunderLAN’s multiplexed SRAM is 3.375K bytes in size. This allows it to support one 1.5K byte FIFO for receive, two 0.75K byte FIFOs for the two transmit
(Tx) channels, and three 128-byte lists (see section 5.1, List Management). In
one-channel mode, the two Tx channels are combined, giving a single 1.5Kbyte FIFO for a single Tx channel. Supporting 1.5K byte of FIFO per channel
allows full frame buffering of Ethernet frames. PCI latency is such that a minimum of 500 bytes of storage is required to support 100M-bps LANs. (Refer to
PCI Local Bus Specification,
the
revision 2.0, section 3.5, Latency).
ThunderLAN’s industry-standard MII permits ease of upgrade. External devices can be connected to the MII and managed, if they support the two-wire
management interface. PHY layer functions for 100M-bps CSMA/CD and demand priority are connected to the MII.
1-2
1.2Networking Protocols
The MII also allows freedom in choosing a networking protocol. It allows the
use of standard 100M bps CSMA/CD PHY chips. ThunderLAN uses these signal lines to interface to an external 100M bps demand priority PHY . This gives
ThunderLAN the flexibility necessary to handle 10Base-T, 10Base-2,
10Base-5 AUI, 100Base-TX, 100Base-T4, 100Base-FX, and 100VG-AnyLAN
today, while supporting emerging technologies.
ThunderLAN is designed to simplify the software used to transmit frames, receive frames, and service the PHY events. It accomplishes this by integrating
time-consuming tasks into the controller. These tasks include:
-
The DMA of data into and out of the controller
-
A simplified, interrupt-driven frame buffer management technique
-
The elimination of PHY register polling through MII interrupts
DMA of data is handled through list structures. ThunderLAN’s method of handling data through list structures has parallels with the method used in Texas
Instruments TI380 COMMprocessors. There are some differences, such as
the use of a 0 forward pointer.
Networking Protocols
ThunderLAN is designed to meet
its PCI interface standards.
PCI Local Bus Specification
, revision 2.0 for
ThunderLAN Overview
1-3
PCI Interface
1.3PCI Interface
1.3.1PCI Cycles
The PCI local bus is a high-performance, 32- or 64-bit bus with multiplexed address and data lines. The bus is designed to be a medium between highly integrated peripheral controller components such as ThunderLAN, add-in boards,
and processor/memory systems.
ThunderLAN executes the following cycles when it acts as the PCI bus master.
The hexadecimal number shown is the bus command encoded in the PC/
BE[3::0]# signals.
-
0x7h–memory write
-
0xCh–memory read multiple
-
0xEh–memory read line
ThunderLAN responds to the following PCI cycles when acting in slave mode
on the PCI bus:
-
0x2h–I/O read
-
0x3h–I/O write
-
0x6h–memory read
-
0x7h–memory write
-
0xAh–configuration read
-
0xBh–configuration write
-
0xCh–memory read multiple
-
0xEh–memory read line
-
0xFh–memory write and invalidate
1-4
Future versions of ThunderLAN may not be limited to these PCI cycles. T exas
Instruments reserves the right to add or delete any cycles to the ThunderLAN
PCI controller. When designing a system, ensure that the attached interface
to ThunderLAN is fully compliant with the
PCI Local Bus Specification
.
1.3.2Byte Ordering
PCI Interface
ThunderLAN follows the
ferring data on the PCI bus. The PCI bus data is transferred on the P AD[31::0]
lines. PAD31 is the most significant bit, and PAD0 is the least significant bit.
The 32 data lines are enough to transfer four bytes per data cycle. Byte 0 is
the LSbyte and byte 3 is the MSbyte. Byte 0 uses bits 0–7, byte 1 uses bits
8–15, byte 2 uses bits 16–23, byte 3 uses bits 24–31.
Figure 1–2. PCI Bus Byte Assignment
31
ThunderLAN uses the full four bytes per data cycle. The only exception is when
the data to be transferred is not octet aligned. In this case, the PCI controller
might not transfer the full four bytes on the first cycle. ThunderLAN deasserts
the IRDY signal only once, if needed, to synchronize the PCI bus to the internal
64-bit architecture. The deassertion of IRDY occurs on the third cycle of the
PCI bus. ThunderLAN does not deassert IRDY for the rest of the transfer unless the PCI bus asserts the TRDY signal.
PCI Local Bus Specification
convention when trans-
07815162324
Byte 0Byte 1Byte 2Byte 3
ThunderLAN Overview
1-5
1-6
Chapter 2
ThunderLAN Registers
ThunderLAN uses a variety of registers to perform its networking functions.
These include peripheral component interface (PCI) registers, host registers,
internal direct input/output (DIO) registers, media independent interface (MII)
registers, and physical interface (PHY) registers. Access to these is a requirement for setting up the ThunderLAN controller and any of the PHY devices attached to the MII. They must be accessed as well for transmission, initiation,
and reception of data. Other activities which require the user to understand
ThunderLAN’s register spaces include determining the cause of event-driven
interrupts and how to clear them and diagnostic functions. This chapter explains register configurations and discusses control of these spaces through
code examples.
The following figure shows the various register spaces provided by ThunderLAN. It also shows how a driver uses ThunderLAN’s registers to interface to
external devices such as PHYs, BIOS ROMs, and EEPROMs.
Figure 2–1. How ThunderLAN Registers are Addressed
ThunderLAN
Host registers
SRAM
Internal/DIO registers
NetCmd
NetSts
NetSio
AREG0–3
HASH
Statistics
registers
LEDreg
PCI
HOST CMD
CH PARM
HOST INT
DIO ADR
DIO DATA
PCI registers
I/O base
address
Memory
base address
BIOS ROM
base address
PCI NVRAM
MDIO/MDCLK
EDIO/EDCLK
MII/PHY registers
Generic
Autonegotiation
Reserved
PHY specific
Serial EEPROM
BIOS ROM
2-2
LED IF
LED
One block of registers, the host registers, appear at a programmable place in
memory or port address space, directly on the PCI bus. The beginning address
is determined by the value written into the PCI configuration space base address registers. Once the base register’s address is determined, ThunderLAN
reads and writes to these registers like ordinary memory or I/O ports. Since the
ThunderLAN devices are directly connected to the PCI, there is no external
decode logic that generates a chip select—all the decode is done internally.
ThunderLAN’s internal/DIO registers are accessed via the DIO_ADR and
DIO_DA TA registers in the host register group. An address is placed in the host
DIO_ADR register , and the data to be read or written to the DIO register is read
or written to the DIO_DA TA register. The internal/DIO register space is referenced indirectly via the host registers to minimize the amount of host address
space required to support the ThunderLAN controller. External devices and
their data are also reached via indirect reference through the host registers
Register Addresses
and PCI configuration registers to make control of the system possible through
the one PCI interface.
An EEPROM, required by the PCI, can be written to at manufacture time
through the PCI_NVRAM register, which is located in the host register space.
The EEPROM can also be accessed through the NetSio register which is located in the internal/DIO register space. Control registers on the PHY side of
the MII management interface can be similarly written and read through the
NetSio register.
A BIOS ROM can be enabled via the BRE bit in the PCI BIOS ROM base address register, and its chip selected address dynamically assigned via a base
register in the configuration space. The BRE bit points to a valid address in the
ROM address space which causes two byte-address strobe cycles (EALE,
EXLE) and a read before the PCI cycle is completed.
ThunderLAN Registers
2-3
PCI Configuration Space
2.2PCI Configuration Space
Figure 2–2.The PCI Configuration Space Registers
Base class
(02h)
Reserved
Vendor IDDevice ID
StatusCommand
Subclass
Reserved
(00h)(00h)
I/O base address
Memory base address
Reserved (00h)
Cardbus CIS Pointer
Reserved (00h)
BIOS ROM base address
Reserved (00h)
Reserved (00h)
Reserved (00h)
Reserved (00h)
Reserved (00h)
Reserved (00h)
Program interface
(00h)
Latency
timer
Int pin(01h)Min_GntMax_Lat
Byte 0Byte 1Byte 2Byte 3
Revision
Cache line
size
Interrupt line
Reset control
IntDis
031
read only
00h
read/write
04h
read only
08h
read/write
0Ch
read/write
10h
read/write
14h
18h
28h
2Ch
read/write
30h
34h
38h
read/write
3Ch
read/write
40h
44h
48h
read only
2-4
Reserved (00h)
Reserved (00h)
PCI NVRAM
B4h
read only
FFh
Register configuration space information fields are needed to identify a board
in a slot to a driver. The functional purpose of the board, the manufacturer , the
revision, and several bus requirements can be obtained by inspecting these
parameters. The PCI configuration space uses these registers which are
called out in the
-
Identify the ThunderLAN controller. This includes setting the interrupt as-
PCI Local Bus Specification.
These enable the PCI system to:
signed to ThunderLAN.
-
Map the host registers using either the I/O base address register or the
memory base address register. The driver uses the address contained in
these registers to access ThunderLAN’s internal registers.
PCI Configuration Space
-
Set up the PCI bus. Several PCI bus options can be selected through
these registers, including latency and grant. (Refer to
ification,
-
Map a BIOS ROM using the BIOS ROM base address register
subsection 3.5)
PCI Local Bus Spec-
Many of the registers in the PCI configuration space are accessed with PCI
BIOS calls. Refer to the
PCI Local Bus Specification,
chapter 6, for the commands supported by your specific PCI BIOS. Some operating systems (O/Ss)
provide BIOS call support. Your operating system’s user’s guide contains
these specific BIOS support routines.
The PCI specification requires that a bus-resident device respond to bus cycle
codes reserved for reading and writing to configuration space. See the
Local Bus Specification
document for more information on how these short,
PCI
slot-dependent address spaces appear to the host processor. The shaded
registers in Figure 2–3 can be autoloaded from an external serial EEPROM.
Check the following before accessing the PCI configuration space:
-
Ensure that there is a PCI BIOS present or other support for BIOS calls.
-
Ensure that the BIOS is the right revision.
-
Use a PCI BIOS call to find all attached devices on the PCI bus. Make sure
that you are talking to the right device on the PCI bus.
Attaching a pullup resistor to the EDIO pin allows the board designer to automatically read an EEPROM after reset to determine the contents of the first
eight bytes, shown shaded below. If the host attempts to read any of the configuration space during the time the adapter is reading the EEPROM, ThunderLAN rejects the request by signaling target-retry.
Figure 2–3. Configuration EEPROM Data Format
Vendor ID LSByte
Vendor ID MSByte
Device ID LSByte
Device ID MSByte
Revision
Subclass
Min_Gnt
Max_Lat
Checksum
Address
C0h
C1h
C2h
C3h
C4h
C5h
C6h
C7h
C8h
ThunderLAN Registers
2-5
PCI Configuration Space
Normally , access to the configuration space is limited to the operating system.
On power-up, the vendor ID, device ID, revision, subclass, Min_Gnt, and
Max_Lat registers are loaded with default values. Vendor-specific data is
loaded into these registers by placing the data into the EEPROM, which is read
at the end of reset if autoload is enabled with a pullup resistor on the EDIO pin.
If the data read from the EEPROM has a checksum error, values are fetched
from the default PCI parameter registers, which are located at addresses
0x08h to 0x0Fh in the internal/DIO registers space.
Some fields in the configuration space like the bits in the memory base address
register and the I/O base address register, which indicate the space size allocation required to access the host registers, are hardwired in the ThunderLAN controllers. Some of the allowed PCI configuration space values like base
registers beyond the basic I/O and memory base registers are not implemented because no other entities are supported by this PCI interface other than the
network function.
To find register information, you must first identify the PCI function ID:
//––––––––––––––––––––––––––––––––––––––––––––––––––––––––
// PCIFindDevice – Find PCI device
//
// Parameters:
// DeviceIDWORD The device ID
// VendorIDWORD The vendor ID
// IndexWORD index (normally 0, use when more than
1 device)
// pDevWORD* Where to put the device id
//
// Return val:
// int0 if successful. see std return codes in
header
//––––––––––––––––––––––––––––––––––––––––––––––––––––––––
WORD PciFindDevice(
WORD deviceID,
WORD vendorID,
WORD Index,
WORD *pDev)
{
union REGS r;
This code returns the function ID that is used to request reads and writes to
the ThunderLAN PCI configuration space; this varies from installation to installation, based on hardware implementation and slot. This ID is necessary to determine where ThunderLAN is. The device ID indicates a networking card, and
the vendor ID is the manufacturer code. These values can be overlaid in the
configuration space with values from the EEPROM during the autoconfiguration. These should be available to the driver software either in the BIOS ROM
or on machine-readable media supplied with the network board(s).
The following example reads a byte of a PCI register:
//––––––––––––––––––––––––––––––––––––––––––––––––––––––––
// PciRdByte() – Read a byte from PCI configuration space
//
// Parameters:
// devid WORD pci device identifier
// addr WORD config address
//
// Return val:
// BYTE value read
//––––––––––––––––––––––––––––––––––––––––––––––––––––––––
BYTE PciRdByte(WORD devid, WORD addr)
{
union REGS r;
r.h.ah = PCI_FUNCTION_ID; /* PCI_FUNCTION_ID