⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 motcpmend.html

📁 vxworks相关论文
💻 HTML
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/motCpmEnd.html - generated by refgen from motCpmEnd.c --> <title> motCpmEnd </title></head><body bgcolor="#FFFFFF"> <hr><a name="top"></a><p align=right><a href="libIndex.html"><i>VxWorks Reference Manual :  Libraries</i></a></p></blockquote><h1>motCpmEnd</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>motCpmEnd</strong> - END style Motorola MC68EN360/MPC800 network interface driver </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><i><a href="./motCpmEnd.html#motCpmEndLoad">motCpmEndLoad</a></i>(&nbsp;)</b>  -  initialize the driver and device<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This module implements the Motorola MC68EN360 QUICC as well as the MPC821 andMPC860 Power-QUICC Ethernet Enhanced network interface driver.<p>All the above mentioned microprocessors feature a number of Serial Communication Controllers (SCC) that support different serial protocolsincluding IEEE 802.3 and Ethernet CSMA-CD. As a result, when the Ethernetmode of a SCC is selected, by properly programming its general Mode Register(GSMR), they can implement the full set of media access control and channelinterface functions those protocol require. However, while the MC68EN360 QUICC and the MPC860 Power-QUICC support up to four SCCs per unit, the MPC821 only includes two on-chip SCCs.<p>This driver is designed to support the Ethernet mode of a SCC residing on theCPM processor core, no matter which among the MC68EN360 QUICC or any of the PPC800 Series. In fact, the major differences among these processors, as faras the driver is concerned, are to be found in the mapping of the internal Dual-Port RAM. The driver is generic in the sense that it does not carewhich SCC is being used. In addition, it poses no constraint on the number of individual units that may be used per board. However, this number shouldbe specified in the bsp through the macro <b>MAX_SCC_CHANNELS</b>. The default valuefor this macro in the driver is 4.<p>To achieve these goals, the driver requires several target-specific valuesprovided as an input string to the load routine. It also requires some external support routines.  These target-specific values and the external support routines are described below.<p>This network interface driver does not include support for trailer protocolsor data chaining.  However, buffer loaning has been implemented in an effort to boost performance. <p>This driver maintains cache coherency by allocating buffer space using the <b><i><a href="./cacheLib.html#cacheDmaMalloc">cacheDmaMalloc</a></i>(&nbsp;)</b> routine.  This is provided for boards whose hostprocessor use data cache space, e.g. the MPC800 Series. Altough the MC68EN360 does not have cache memory, it may be used in a particular configuration: <b>MC68EN360 in 040 companion mode</b> where that is attachedto processors that may cache memory. However, due to a lack of suitable hardware, the multiple unit support and '040 companion mode support have not been tested.<p></blockquote><h4>BOARD LAYOUT</h4><blockquote><p>This device is on-chip.  No jumpering diagram is necessary.<p></blockquote><h4>EXTERNAL INTERFACE</h4><blockquote><p>This driver provides the standard END external interface.  The only external interface is the <b><i><a href="./motCpmEnd.html#motCpmEndLoad">motCpmEndLoad</a></i>(&nbsp;)</b> routine.  The parameters are passed into the <b><i><a href="./motCpmEnd.html#motCpmEndLoad">motCpmEndLoad</a></i>(&nbsp;)</b> function as a single colon-delimited string.The <b><i><a href="./motCpmEnd.html#motCpmEndLoad">motCpmEndLoad</a></i>(&nbsp;)</b> function uses <b><i><a href="./ansiString.html#strtok">strtok</a></i>(&nbsp;)</b> to parse the string, which it expects to be of the following format:<p><i>unit</i>:<i>motCpmAddr</i>:<i>ivec</i>:<i>sccNum</i>:<i>txBdNum</i>:<i>rxBdNum</i>:<i>txBdBase</i>: <i>rxBdBase</i>:<i>bufBase</i> <p></blockquote><h4>TARGET-SPECIFIC PARAMETERS</h4><blockquote><p><p><dl><dt><i>unit</i><dd>A convenient holdover from the former model.  This parameter is used onlyin the string name for the driver.<p><dt><i>motCpmAddr</i><dd>Indicates the address at which the host processor presents its internal memory (also known as the dual ported RAM base address). With this address, and the SCC number (see below), the driver is able to compute the location of the SCC parameter RAM and the SCC register map, and, ultimately, to program the SCC for proper operations. This parameter should point to the internal memory of the processor where the SCC physically resides. This location might not necessarily be the Dual-Port RAM of the microprocessor configured as master on the target board.<p><dt><i>ivec</i><dd>This driver configures the host processor to generate hardware interruptsfor various events within the device. The interrupt-vector offsetparameter is used to connect the driver's ISR to the interrupt througha call to the VxWorks system function <b><i><a href="./intArchLib.html#intConnect">intConnect</a></i>(&nbsp;)</b>.<p><dt><i>sccNum</i><dd>This driver is written to support multiple individual device units.Thus, the multiple units supported by this driver can reside on different chips or on different SCCs within a single host processor. This parameter is used to explicitly state which SCC is being used (SCC1 is most commonly used, thus this parameter most often equals "1").<p><dt><i>txBdNum</i> and <i>rxBdNum</i><dd>Specify the number of transmit and receive buffer descriptors (BDs). Each buffer descriptor resides in 8 bytes of the processor's dual-ported RAM space, and each one points to a 1520 byte buffer in regular RAM.  There must be a minimum of two transmit and two receive BDs. There is no maximum, although more than a certain amount does not speed up the driver and wastes valuable dual-ported RAM space. If any of these parametersis "NULL", a default value of "32" BDs is used.<p><dt><i>txBdBase</i> and <i>rxBdBase</i><dd>Indicate the base location of the transmit and receive buffer descriptors (BDs). They are offsets, in bytes, from the base address of the hostprocessor's internal memory (see above). Each BD takes up 8 bytes ofdual-ported RAM, and it is the user's responsibility to ensure that allspecified BDs fit within dual-ported RAM. This includes any otherBDs the target board might be using, including other SCCs, SMCs, and theSPI device. There is no default for these parameters.  They must beprovided by the user.<p><dt><i>bufBase</i><dd>Tells the driver that space for the transmit and receive buffers need not be allocated but should be taken from a cache-coherent private memory space provided by the user at the given address.  The user should be aware that memory used for buffers must be 4-byte aligned and non-cacheable.  All the buffers must fit in the given memory space.  No checking is performed.  This includes all transmit and receive buffers (see above).  Each buffer is 1520 bytes.  If this parameter is "NONE", space for buffers is obtained by calling <b><i><a href="./cacheLib.html#cacheDmaMalloc">cacheDmaMalloc</a></i>(&nbsp;)</b> in <b><i><a href="./motCpmEnd.html#motCpmEndLoad">motCpmEndLoad</a></i>(&nbsp;)</b>. </dl><p></blockquote><h4>EXTERNAL SUPPORT REQUIREMENTS</h4><blockquote><p>This driver requires three external support functions:<dl><dt><b><i>sysXxxEnetEnable</i>(&nbsp;)</b><dd> </dl><p>This is either <b><i><a href="../bsp/ads360/sysLib.html#sys360EnetEnable" >sys360EnetEnable</a></i>(&nbsp;)</b> or <b><i><a href="../bsp/ads860/sysLib.html#sysCpmEnetEnable" >sysCpmEnetEnable</a></i>(&nbsp;)</b>, based on the actual host processor being used. See below for the actual prototypes.This routine is expected to handle any target-specific functions needed to enable the Ethernet controller. These functions typically include enabling the Transmit Enable signal (TENA) and connecting the transmit and receive clocks to the SCC. This routine is expected to return OK on success, or ERROR. The driver calls this routine, once per unit, from the <b><i><a href="./motCpmEnd.html#motCpmEndLoad">motCpmEndLoad</a></i>(&nbsp;)</b> routine.<dl><dt><b><i>sysXxxEnetDisable</i>(&nbsp;)</b><dd> </dl><p>This is either <b><i><a href="../bsp/ads360/sysLib.html#sys360EnetDisable" >sys360EnetDisable</a></i>(&nbsp;)</b> or <b><i><a href="../bsp/ads860/sysLib.html#sysCpmEnetDisable" >sysCpmEnetDisable</a></i>(&nbsp;)</b>, based on the actual host processor being used. See below for the actual prototypes.This routine is expected to handle any target-specific functions required to disable the Ethernet controller. This usually involves disabling the Transmit Enable (TENA) signal.  This routine is expected to return OK on success, or ERROR. The driver calls this routine from the <b><i>motCpmEndStop</i>(&nbsp;)</b> routine each time a unit is disabled.<dl><dt><b><i>sysXxxEnetAddrGet</i>(&nbsp;)</b><dd> </dl><p>This is either <b><i><a href="../bsp/ads360/sysLib.html#sys360EnetAddrGet" >sys360EnetAddrGet</a></i>(&nbsp;)</b> or <b><i><a href="../bsp/ads860/sysLib.html#sysCpmEnetAddrGet" >sysCpmEnetAddrGet</a></i>(&nbsp;)</b>, based on the actual host processor being used. See below for the actual prototypes.The driver expects this routine to provide the six-byte Ethernet hardware address that is used by this unit.  This routine must copy the six-byte address to the space provided by <i>addr</i>.  This routine is expected to return OK on success, or ERROR.  The driver calls this routine, once per unit, from the <b><i><a href="./motCpmEnd.html#motCpmEndLoad">motCpmEndLoad</a></i>(&nbsp;)</b> routine.<p><p>In the case of the CPU32, the prototypes of the above mentioned supportroutines are as follows:<pre>    STATUS sys360EnetEnable (int unit, UINT32 regBase)    void sys360EnetDisable (int unit, UINT32 regBase)    STATUS sys360EnetAddrGet (int unit, u_char * addr)</pre><p><p>In the case of the PPC860, the prototypes of the above mentioned supportroutines are as follows:<pre>    STATUS sysCpmEnetEnable (int unit)    void sysCpmEnetDisable (int unit)    STATUS sysCpmEnetAddrGet (int unit, UINT8 * addr)</pre><p><p></blockquote><h4>SYSTEM RESOURCE USAGE</h4><blockquote><p>When implemented, this driver requires the following system resources:<p>&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;one&nbsp;mutual&nbsp;exclusion&nbsp;semaphore<br>&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;one&nbsp;interrupt&nbsp;vector<br>&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;0&nbsp;bytes&nbsp;in&nbsp;the&nbsp;initialized&nbsp;data&nbsp;section&nbsp;(data)<br>&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;1272&nbsp;bytes&nbsp;in&nbsp;the&nbsp;uninitialized&nbsp;data&nbsp;section&nbsp;(BSS)<p>The data and BSS sections are quoted for the CPU32 architecture and couldvary for other architectures.  The code size (text) varies greatly betweenarchitectures, and is therefore not quoted here.<p>If the driver allocates the memory to share with the Ethernet device unit,it does so by calling the <b><i><a href="./cacheLib.html#cacheDmaMalloc">cacheDmaMalloc</a></i>(&nbsp;)</b> routine.  For the default caseof 32 transmit buffers, 32 receive buffers, and 16 loaner buffers (this is notconfigurable), the total size requested is 121,600 bytes.  If a non-cacheable memory region is provided by the user, the size of this region should be this amount, unless the user has specified a different number of transmit or receive BDs.<p>This driver can operate only if this memory region is non-cacheableor if the hardware implements bus snooping.  The driver cannot maintaincache coherency for the device because the buffers are asynchronouslymodified by both the driver and the device, and these fields might share the same cache line.  Additionally, the chip's dual-ported RAM must bedeclared as non-cacheable memory where applicable (for example, when attachedto a 68040 processor). For more information, see the<i>Motorola MC68EN360 User's Manual </i>,<i>Motorola MPC860 User's Manual </i>,<i>Motorola MPC821 User's Manual </i><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./motCpmEnd.html#top">motCpmEnd</a></b><hr><a name="motCpmEndLoad"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>motCpmEndLoad</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>motCpmEndLoad</i>(&nbsp;)</strong> - initialize the driver and device</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>END_OBJ *motCpmEndLoad    (    char * initString /* parameter string */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine initializes the driver and the device to the operational state.All of the device specific parameters are passed in the <i>initString</i>, whichis of the following format:<p><i>unit</i>:<i>motCpmAddr</i>:<i>ivec</i>:<i>sccNum</i>:<i>txBdNum</i>:<i>rxBdNum</i>:<i>txBdBase</i>:<i>rxBdBase</i>:<i>bufBase</i> <p>The parameters of this string are individually described in the <b><a href="./motCpmEnd.html#top">motCpmEnd</a></b> man page.<p>The SCC shares a region of memory with the driver.  The caller of this routine can specify the address of a non-cacheable memory region with<i>bufBase</i>.  Or, if this parameter is "NONE", the driver obtains thismemory region by making calls to <b><i><a href="./cacheLib.html#cacheDmaMalloc">cacheDmaMalloc</a></i>(&nbsp;)</b>.  Non-cacheable memory space is important whenever the host processor uses cache memory.This is also the case when the MC68EN360 is operating in companionmode and is attached to a processor with cache memory.<p>After non-cacheable memory is obtained, this routine divides up thememory between the various buffer descriptors (BDs).  The numberof BDs can be specified by <i>txBdNum</i> and <i>rxBdNum</i>, or if "NULL", adefault value of 32 BDs will be used.  An additional number of buffers arereserved as receive loaner buffers.  The number of loaner buffers isa default number of 16.<p>The user must specify the location of the transmit and receive BDs inthe processor's dual ported RAM.  <i>txBdBase</i> and <i>rxBdBase</i> give theoffsets from <i>motCpmAddr</i> for the base of the BD rings.  Each BD uses 8 bytes. Care must be taken so that the specified locations for Ethernet BDs do not conflict with other dual ported RAM structures.<p>Multiple individual device units are supported by this driver.  Deviceunits can reside on different chips, or could be on different SCCswithin a single processor. The <i>sccNum</i> parameter is used to explicitlystate which SCC is being used. SCC1 is most commonly used, thus thisparameter most often equals "1".<p>Before this routine returns, it connects up the interrupt vector <i>ivec</i>.<p></blockquote><h4>RETURNS</h4><blockquote><p>An END object pointer or NULL on error.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./motCpmEnd.html#top">motCpmEnd</a></b>, <i>Motorola MC68EN360 User's Manual </i>,  <i>Motorola MPC860 User's Manual </i>,  <i>Motorola MPC821 User's Manual </i></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -