![]() |
|
If you can't view the Datasheet, Please click here to try to view without PDF Reader . |
|
Datasheet File OCR Text: |
overview qmc memory organization qmc commands qmc exceptions buffer descriptors qmc initialization features deleted in mc68mh360 performance multi-subchannel (msc) microcode 68360 bit numbering frequently-asked questions connecting isdn interfaces to quicc32 index 1 2 3 4 5 6 8 7 b c ind 9 a f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
overview qmc memory organization qmc commands qmc exceptions buffer descriptors qmc initialization features deleted in mc68mh360 performance multi-subchannel (msc) microcode 68360 bit numbering frequently-asked questions connecting isdn interfaces to quicc32 index 1 2 3 4 5 6 8 7 a b ind c 9 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmcsupplement/ad 8/97 qmc supplement to mc68360 and mpc860 users manuals f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . contents iii contents paragraph number title page number audience ................................................................................................................ xi organization........................................................................................................... xi additional reading ............................................................................................... xii conventions .......................................................................................................... xii acronyms and abbreviations .............................................................................. xiii chapter 1 overview 1.1 the qmc (quicc multichannel controller) ..................................................... 1-1 1.2 introduction.......................................................................................................... 1-1 1.3 qmc features...................................................................................................... 1-3 1.4 the time slot assigner and the qmc ................................................................ 1-4 1.5 the serial interface (si)....................................................................................... 1-4 1.5.1 synchronization ............................................................................................... 1-5 1.5.2 loopback mode ............................................................................................... 1-5 1.5.3 echo mode....................................................................................................... 1-5 1.5.4 inverted signals ............................................................................................... 1-5 1.6 qmc serial routing and example applications................................................. 1-6 1.7 scc changes on the fly .................................................................................... 1-10 1.8 si ram errors................................................................................................... 1-10 1.9 e1/t1 frame description................................................................................... 1-11 chapter 2 qmc memory organization 2.1 qmc memory structure ...................................................................................... 2-2 2.1.1 dual-ported ram base ................................................................................... 2-3 2.1.2 scc base and global multichannel parameters ............................................. 2-3 2.1.3 tsatrx/tsattx pointers and time slot assignment table ....................... 2-3 2.1.4 tsatrx/tsattx channel pointers............................................................... 2-4 2.1.5 logical channel tbase and rbase............................................................. 2-4 2.1.6 mcbase ......................................................................................................... 2-4 2.1.7 buffer descriptor table ................................................................................... 2-4 2.1.8 data buffer pointer.......................................................................................... 2-5 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement contents paragraph number title page number 2.1.9 data buffer .......................................................................................................2-5 2.2 global multichannel parameters ..........................................................................2-5 2.3 multiple scc assignment tables ......................................................................2-10 2.4 channel-specific parameters..............................................................................2-14 2.4.1 channel-specific hdlc parameters..............................................................2-14 2.4.1.1 chamrchannel mode register (hdlc).............................................2-15 2.4.1.2 tstatetx internal state (hdlc)........................................................2-17 2.4.1.3 intmskinterrupt mask (hdlc) ..........................................................2-18 2.4.1.4 rstaterx internal state (hdlc) .......................................................2-19 2.4.2 channel-specific transparent parameters .....................................................2-20 2.4.2.1 chamrchannel mode register (transparent mode) ..........................2-21 2.4.2.2 tstatetx internal state (transparent mode) .....................................2-23 2.4.2.3 intmskinterrupt mask (transparent mode)........................................2-24 2.4.2.4 trnsynctransparent synchronization ...............................................2-24 2.4.2.5 rstaterx internal state (transparent mode).....................................2-28 chapter 3 qmc commands 3.1 transmit commands.............................................................................................3-1 3.2 receive commands ..............................................................................................3-2 chapter 4 qmc exceptions 4.1 global error events ..............................................................................................4-2 4.1.1 global underrun (gun)...................................................................................4-3 4.1.2 global overrun (gov) in the fifo.................................................................4-3 4.1.3 restart from a global error..............................................................................4-3 4.2 scc event register (scce) ................................................................................4-3 4.3 interrupt table entry ............................................................................................4-5 4.4 channel interrupt processing flow ......................................................................4-7 chapter 5 buffer descriptors 5.1 receive buffer descriptor ....................................................................................5-1 5.2 transmit buffer descriptor ..................................................................................5-5 5.3 placement of buffer descriptors ..........................................................................5-7 5.3.1 mc68mh360 internal memory structure........................................................5-7 5.3.2 parameter ram usage for qmc over several sccs......................................5-9 5.3.3 mpc860mh internal memory structure .......................................................5-14 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . contents v contents paragraph number title page number 5.3.4 mc68mh360 configured for qmc and ethernet.........................................5-20 chapter 6 qmc initialization 6.1 initialization steps................................................................................................6-1 6.2 68mh360 t1 example.......................................................................................6-10 6.3 restarting the transmitter..................................................................................6-17 6.4 restarting the receiver ......................................................................................6-17 6.5 disabling receiver and transmitter...................................................................6-17 6.6 debugging hints ................................................................................................6-17 6.6.1 pointer registers ............................................................................................6-17 6.6.2 state registers................................................................................................6-18 chapter 7 features deleted in mc68mh360 chapter 8 performance 8.1 common channel combinations .........................................................................8-1 8.2 cpm loading .......................................................................................................8-2 8.3 bus latency and peak load .................................................................................8-5 chapter 9 multi-subchannel (msc) microcode 9.1 msc microcode features.....................................................................................9-1 9.2 msc microcode operation ..................................................................................9-2 9.3 programming the msc protocol ..........................................................................9-3 9.4 msc subchanneling example .............................................................................9-6 9.5 qmc memory organization ................................................................................9-7 9.6 multi-subchannel initialization............................................................................9-8 appendix a 68360 bit numbering a.1 time slot assignment table............................................................................... a-1 a.2 registers in hdlc mode.................................................................................... a-3 a.3 registers in transparent mode ........................................................................... a-4 a.4 command register.............................................................................................. a-4 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement contents paragraph number title page number a.5 scc event register .............................................................................................a-5 a.6 sccm register....................................................................................................a-5 a.7 receive and transmit buffer descriptors ...........................................................a-5 appendix b frequently-asked questions b.1 questions common to mh360 and 860mh........................................................b-1 b.2 860mh-related questions ..................................................................................b-2 b.3 mh360-related questions ..................................................................................b-4 appendix c connecting isdn multiple s/t or u interfaces to quicc32 c.1 the qmc protocol ..............................................................................................c-1 c.2 control and status information ...........................................................................c-2 c.3 data clock (dcl) and frame sync (fsc) generation.......................................c-4 c.3.1 mc145574 s/t interface.................................................................................c-5 c.3.1.1 activation procedure ...................................................................................c-8 c.3.1.2 deactivation procedure .............................................................................c-11 c.3.2 mc145572 u interface..................................................................................c-12 c.3.2.1 activation procedure .................................................................................c-14 c.3.2.2 deactivation procedure .............................................................................c-14 c.3.3 system configuration....................................................................................c-14 c.3.3.1 s/t-interface configuration ......................................................................c-14 c.3.3.2 u-interface configuration .........................................................................c-15 c.3.3.3 quicc32 configuration ...........................................................................c-15 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . illustrations illustrations figure number title page number 1-1 qmc channel addressing capability ............................................................................. 1-2 1-2 ethernet-to-bri bridge using mc68en360................................................................... 1-6 1-3 internal routing for ethernet-to-bri bridge using mc68en360.................................. 1-7 1-4 ethernet-to-bri bridge using mc68mh360 ................................................................. 1-8 1-5 internal routing for ethernet-to-bri bridge using mc68mh360 ................................ 1-8 1-6 ethernet-to-pri bridge using mpc860mh.................................................................... 1-9 1-7 internal routing for ethernet-to-pri bridge using mpc860 ......................................... 1-9 1-8 frame structures for e1/cept and t1 tdm interfaces ............................................... 1-12 1-9 mc68mh360 connection to a tdm bus ..................................................................... 1-13 2-1 mc68mh360 and mpc860mh internal memory structures......................................... 2-1 2-2 qmc memory structure .................................................................................................. 2-2 2-3 time slot assignment table ........................................................................................... 2-8 2-4 time slot assignment table for 64-channel common rx and tx mapping............... 2-10 2-5 rx time slot assignment table for 32 channels over two sccs............................... 2-11 2-6 time slot assignment tables for 64 channels over 2 sccs ........................................ 2-13 2-7 chamrchannel mode register (hdlc) ................................................................ 2-15 2-8 tstatetx internal state (hdlc) ........................................................................... 2-17 2-9 intmsk and interrupt table entry (hdlc)................................................................ 2-18 2-10 rstaterx internal state (hdlc)........................................................................... 2-19 2-11 chamrchannel mode register (transparent mode).............................................. 2-21 2-12 tstatetx internal state (transparent mode)......................................................... 2-23 2-13 intmsk and interrupt table entry (transparent mode) ............................................. 2-24 2-14 examples of different t1 time slot allocation............................................................ 2-27 2-15 rstaterx internal state (transparent mode) ........................................................ 2-28 3-1 command register (cr).................................................................................................. 3-1 4-1 circular interrupt table in external memory.................................................................. 4-1 4-2 scc event register ......................................................................................................... 4 -4 4-3 sccm register ............................................................................................................... . 4-5 4-4 interrupt table entry....................................................................................................... . 4-5 4-5 channel interrupt flow .................................................................................................... 4- 8 5-1 receive buffer descriptor (rxbd) ................................................................................. 5-1 5-2 nonoctet alignment data ................................................................................................ 5-4 5-3 transmit buffer descriptor (txbd) ................................................................................ 5-5 5-4 relation between pad and nof..................................................................................... 5-6 5-5 mc68mh360 internal memory....................................................................................... 5-8 5-6 scc2 parameter ram overlap example........................................................................ 5-8 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement illustrations figure number title page number 5-7 mc68mh360 scc1 parameter ram usage ................................................................ 5-10 5-8 mc68mh360 scc2 parameter ram usage ................................................................ 5-11 5-9 mc68mh360 scc3 parameter ram usage ................................................................ 5-12 5-10 mc68mh360 scc4 parameter ram usage ................................................................ 5-13 5-11 mpc860mh internal memory ...................................................................................... 5-14 5-12 mpc860mh scc1 parameter ram usage.................................................................. 5-16 5-13 mpc860mh scc2 parameter ram usage.................................................................. 5-17 5-14 mpc860mh scc3 parameter ram usage.................................................................. 5-18 5-15 mpc860mh scc4 parameter ram usage.................................................................. 5-19 9-1 two-bit subchannel implementation without msc microcode ..................................... 9-2 9-2 two-bit subchannel implementation with msc microcode .......................................... 9-3 9-3 time slot assignment table showing msc configuration ........................................... 9-4 9-4 example for eight 2-bit subchannels.............................................................................. 9-6 9-5 mpc860mh internal memory map with msc microcode enabled .............................. 9-7 a-1 time slot assignment table .......................................................................................... a-1 a-2 time slot assignment table for 64-channel common rx and tx mapping................ a-2 a-3 chamrchannel mode register (hdlc) ................................................................. a-3 a-4 interrupt table entry and intmsk (hdlc)................................................................. a-3 a-5 tstate (hdlc) ........................................................................................................... a-3 a-6 rstate (hdlc)........................................................................................................... a-3 a-7 chamrchannel mode register (transparent mode)............................................... a-4 a-8 intmsk and interrupt table entry (transparent mode) .............................................. a-4 a-9 tstate (transparent mode)......................................................................................... a-4 a-10 rstate (transparent mode) ........................................................................................ a-4 a-11 command register.......................................................................................................... a -4 a-12 scc event (scce) register........................................................................................... a-5 a-13 sccm register .............................................................................................................. . a-5 a-14 receive buffer descriptor (rxbd) ................................................................................ a-5 a-15 transmit buffer descriptor (txbd) ............................................................................... a-5 c-1 idl2 bus structure for a connection to the qmc bus...................................................c-2 c-2 idl and scp connections between the quicc32 and the s/t interface.......................c-3 c-3 idl and scp connections between the quicc32 and the u interface..........................c-4 c-4 fsc generation from a 2.048-mhz clockblock diagram .........................................c-6 c-5 fsc generation from a 2.048-mhz clocktiming ......................................................c-6 c-6 connection between four s/t interfaces and the quicc32...........................................c-7 c-7 timing diagram for an activation initiated by the nt...................................................c-9 c-8 timing diagram for an activation initiated by the te .................................................c-10 c-9 timing diagram for a deactivation (always initiated by the nt) ...............................c-11 c-10 connection between four u interfaces and the quicc32 ...........................................c-13 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . tables tables table number title page number i acronyms and abbreviated terms .................................................................................. xiii 2-1 global multichannel parameters...................................................................................... 2-5 2-2 time slot assignment table entry fields for receive section ...................................... 2-9 2-3 time slot assignment table entry fields for transmit section..................................... 2-9 2-4 channel-specific hdlc parameters ............................................................................. 2-14 2-5 chamr field descriptions (hdlc)............................................................................ 2-16 2-6 tstate field descriptions for mh360 (hdlc)......................................................... 2-17 2-7 tstate field descriptions for 860mh (hdlc)......................................................... 2-18 2-8 rstate field descriptions for mh360 (hdlc) ........................................................ 2-19 2-9 rstate field descriptions for 860mh (hdlc) ........................................................ 2-20 2-10 channel-specific transparent parameters..................................................................... 2-20 2-11 chamr bit settings (transparent mode) .................................................................... 2-22 2-12 tstate field descriptions for mh360 (transparent mode) ...................................... 2-23 2-13 tstate field descriptions for 860mh (transparent mode) ...................................... 2-23 2-14 rstate field descriptions for mh360 (transparent mode)...................................... 2-28 2-15 rstate field descriptions for 860mh (transparent mode)...................................... 2-29 4-1 scc event register field descriptions........................................................................... 4-4 4-2 interrupt table entry field descriptions ......................................................................... 4-5 5-1 receive buffer descriptor (rxbd) field descriptions ................................................... 5-1 5-2 transmit buffer descriptor (txbd) field descriptions.................................................. 5-5 5-3 mc68360 functions available ........................................................................................ 5-9 5-4 mpc860mh functions available ................................................................................. 5-15 6-1 transmit buffer descriptor field descriptions ............................................................... 6-1 6-2 sicr bit settings........................................................................................................... .. 6-2 6-3 sigmr bit settings ......................................................................................................... 6 -4 6-4 gsmr_h bit settings ..................................................................................................... 6-4 6-5 gsmr_l bit settings ...................................................................................................... 6-5 6-6 chamr bit settings ....................................................................................................... 6-9 6-7 pointer registers ........................................................................................................... . 6-18 6-8 state registers............................................................................................................. ... 6-18 8-1 common qmc configurations........................................................................................ 8-1 8-2 cpm performance table.................................................................................................. 8-2 8-3 qmc actions in tx buffer switch.................................................................................. 8-5 8-4 simulated latencies ......................................................................................................... 8-6 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement tables table number title page number 9-1 time slot assignment table entry fields for receive (msc) ....................................... 9-4 9-2 time slot assignment table entry fields for transmit (msc)...................................... 9-5 b-1 cpu performance ............................................................................................................b -1 c-1 tclk frequencies selected by br13[5] and br7[2] ....................................................c-5 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . about this book about this book this document is a supplement to the mc68360 quad integrated communications controller users manual (mc68360um/ad) and the mpc860 powerquicc users manual (mpc860um/ad). it replaces the mc68mh360 reference manual (mc68mh360rm/ad). to locate any published errata or updates for this document, refer to the website at http://www.mot.com/netcomm. audience this manual is intended for system software and hardware developers. it is assumed that the reader understands basic concepts of time-division-multiplexed processors and how the mpc860 cpm operates. organization following is a summary and a brief description of the major sections of this manual: ? chapter 1, overview, gives an introduction to the qmc (quicc multichannel controller) protocol including some example applications. ? chapter 2, qmc memory organization, describes the operation speci?c to the qmc protocol. ? chapter 3, qmc commands, discusses the transmit and receive commands. ? chapter 4, qmc exceptions, describes qmc interrupt handling. ? chapter 5, buffer descriptors, describes the contents of the receive and transmit buffer descriptors for the qmc protocol and discusses the placement of qmc and non-qmc buffer descriptors in internal and external memory. ? chapter 6, qmc initialization, discusses the essential steps to initialize qmc after a hard reset. ? chapter 7, features deleted in mc68mh360, lists the features deleted from the mh360. ? chapter 8, performance, provides a performance table for common con?gurations supported by the 860mh and/or mh360; covers general guidelines and examples for determining the serial bit rate and cpm loading on a given system; and discusses system bus utilization and arbitration. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement ? chapter 9, multi-subchannel (msc) microcode, provides the msc microcode features and operation, and discusses how to program the msc protocol. ? appendix a, 68360 bit numbering,shows the bit numbering used for the 68360. ? appendix b, frequently-asked questions, provides a list of common questions and solutions for the mh360 and 860mh. ? appendix c, connecting s/t or u interfaces to quicc32, shows how multiple mc145574 (s/t interface) or mc145572 (u interface) can be connected to a quicc32. it describes the level-1 connections and explains the data ?ow through the devices. ? this manual also includes an index. additional reading this section provides a brief list of additional reading that supplements the information in this manual. the following materials are available from the motorola literature distribution centers listed on the back cover of this manual; the document order numbers are included in parentheses for ease in ordering: ? mpc860 powerquicc users manual (mpc860um/ad) ? mc68360 quad integrated communications controller users manual , rev. 1 (m68360um/ad) ? m68000 family programmers reference manual , rev. 1 (m68000pm/ad) conventions this document uses the following notational conventions: active_high names for signals that are active high are shown in uppercase text without an overbar. active-high signals are referred to as asserted when they are high and negated when they are low. active_low a bar over a signal name indicates that the signal is active low. active-low signals are referred to as asserted (active) when they are low and negated when they are high. 0x0f hexadecimal numbers 0b0011 binary numbers reg[field] abbreviations or acronyms for registers are shown in uppercase text. speci?c bit ?elds or ranges are shown in brackets. bold font (?eld name)entries in boldface must be initialized by the user. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . about this book acronyms and abbreviations table i contains acronyms and abbreviations that are used in this document. table i. acronyms and abbreviated terms term meaning bd buffer descriptor bps bits per second bri basic rate interface brg baud rate generator cpm communications processor module cr command register dcl data clock signal fsc frame sync signal gsm global system for mobile communications gov global receiver overrun (global error) gun global transmitting underrun (global error) hdlc high-level data link control i 2 c interprocessor-integrated controller channel msc multi-subchannel microcode nmsi nonmultiplexed serial interface qmc quicc multichannel controller quicc quad integrated communication controller rccr risc controller con?guration register rxbd receive buffer descriptor scc serial communication controller scce scc event register si serial interface routing ss-7 signaling system 7 tdm time-division multiplexing tsa time slot assigner tso time slot zero txbd transmit buffer descriptor f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . chapter 1. overview chapter 1 overview 10 10 this chapter gives an overview of the qmc protocol including some example applications. 1.1 the qmc (quicc multichannel controller) the qmc protocol emulates up to 64 logical channels within one scc (serial communication controller) using the same time-division-multiplexed (tdm) physical interface. this multichannel protocol is implemented using the cpm rom space and additional hardware; it is not a downloadable microcode. the standard quicc family members (mc68360 1 , mpc860 2 , etc.) work in tdm applications but can only support one logical channel per scc. the parts currently supporting the qmc protocol are a superset to the following devices: ? mc68mh360 is a superset of the mc68en360 3 ? mpc860mh is a superset of the mpc860en ? mpc860dh is a superset of the mpc860de the qmc parts are pin-compatible with their respective family members. with minor adjustments, they can be used in identical applications such as primary rate isdn support. 1.2 introduction ideal for e1/t1 applications, the qmc protocol can multiplex any 64-channel combination of subgroups to one tdm interface. each of the channels can be separately programmed either to perform hdlc formatting/ deformatting or to act as a transparent channel. both of the si serial interfaces (for example, tdm a or tdm b ) can be dedicated to the qmc protocol. the si transfers the whole frame to an scc 4 . using the cpm risc, the scc 1 mc68360 is trademarked as the quicc. 2 mpc860 is trademarked as the powerquicc. 3 on the mc68mh360, protocol support for centronics and bisync have been removed to create space for the qmc microcode. 4 this is the normal operating mode; however, it is possible to split the tdm stream over several sccs. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement works transparently, not participating in any qmc protocol functions. the scc only performs the parallel-to-serial conversion and adds elasticity through its fifo memory. the cpm, with its special enhanced microcode and additional dedicated hardware for framing and masking support, does all of the protocol processing for each of the 64 channels. note that it is executed without intervention from the on-board cpu. figure 1-1 illustrates the qmcs multichannel capability. note that each scc can support up to 64 channels from the tdm; however, there are limitations depending on the device used. this is summarized in section 1.3, qmc features. each scc can work in qmc mode, either alone or together in any combination. the larger fifo of scc1 yields the best performance and is therefore recommended for qmc operation. one tdm connection can be routed to one or more sccs operating in qmc mode, with each scc operating on different time slots. it is possible to use both tdms for qmc with combined routing to one scc or to separate sccs. when using two tdms connected to one scc, restrictions such as using common clocks and sync inputs apply; it is also important to avoid collisions by separating the serial interface (si) routing. figure 1-1. qmc channel addressing capability cpm scc1 scc2 scc3 scc4 smc1 smc2 serial interface 64 1 64 1 64 1 64 1 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . chapter 1. overview 1.3 qmc features ? mc68mh360-speci?c features up to 32 independent communication channels arbitrary mapping of any of 0C31 channels to any of 0C31 tdm time slot can support arbitrary mapping of any of 0C31 channels to any of 0C63 tdm time slots in case of common rx and tx mapping up to three additional hdlc 64-kbps channels at 25-mhz system clock simultaneous ethernet support at 33-mhz system clock up to 64 dma channels with linear buffer array ? mpc860mh/dh-speci?c features up to 64 independent communication channels arbitrary mapping of any of 0C63 channels to any of 0C63 tdm time slots supports arbitrary mapping of any of 0C63 channels to any of 0C127 tdm time slots in case of common rx and tx mapping two simultaneous 32-channel e1 links at 50-mhz system clock up to 128 dma channels with linear buffer array ? common features independent mapping for receive/transmit supports either transparent or hdlc protocols for each channel interrupt circular buffer with programmable size and over?ow identi?cation global loop mode individual channel loop mode through the si programmable frame length (via si) ? serial interface serial-multiplexed (full duplex) input/output 2048-, 1544-, or 1536-kbps pcm highways compatible with t1/ds1 24-channel and cept e1 32-channel pcm highway, isdn basic rate, isdn primary rate and user-de?ned subchanneling on each time slot allows independent transmit and receive routing, frame syncs, and clocking concatenation of any, not necessarily consecutive, time slots to channels independently for receive/transmit supports h0, h11, and h12 isdn channels allows dynamic allocation of channels f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement ? system interface on-chip bus arbitration for serial dmas with no performance penalty ef?cient bus usage (no bus usage for nonactive channels and active channels that have nothing to transmit) ef?cient control of the interrupts to the cpu supports external buffer descriptors table uses on-chip enlarged dual-ported ram for parameter storage 1.4 the time slot assigner and the qmc the time slot assigner (tsa) in the mh devices is no different from the other versions. this section discusses the new possibilities when using the tsa in combination with the qmc. the qmc protocol can be executed in nonmultiplexed serial interface (nmsi) mode, but the usual operating mode takes advantage of the programmable time slot assigner,. a frame synchronization pulse alerts the time slot assigner to start counting clock pulses. the user programs what bits are routed to the different internal serial channels. the tsa is an intelligent multiplexer that restarts its sequence on every frame synchronization pulse. external strobe signals allow other devices that do not have built-in time slot assigner functions to participate in the tdm interface. this is very useful when interfacing to the mc68302 or other telecommunication devices like codecs. the time slot assigner is not limited to standard tdm lines. it is a ?exible, programmable device that allows the user to route any combination of bits and bytes to any channel. for example, the user can transmit 3 bits from scc2, skip 12 bytes, and then transmit another 17 bits from scc1. this routing must be programmed into the tsa memory. the complexity of the routing is limited only by the number of program entries in the tsa. ideal for tdm bridging applications, the mc68mh360 and mpc860mh have two independent time slot assigners and physical interfaces. a complete set of independent receive and transmit clock signals, as well as independent synchronization signals, are available for each tdm. 1.5 the serial interface (si) functions such as frame synchronization, loopback, echo, and inverted signals are performed in the serial interface and cannot be achieved in nmsi mode. it is recommended to use the serial interface even if only one scc is used for the tdm bus. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . chapter 1. overview 1.5.1 synchronization independent receive and transmit clocks and frame synchronization signals control the data transfer. in nmsi operation, synchronization occurs only once to initiate a transfer using the cd (receive) and cts (transmit) signals in pulse mode. if any noise corrupts either signal, the qmc will be out of synchronization until the whole protocol is restarted. in contrast, the more robust si performs a synchronization on each frame, limiting the damage from noise error on the clock or synchronization lines. noisy channels can be restarted individually without interrupting other channels. for more details about possible errors in the tdm interface, see section 1.8, si ram errors. 1.5.2 loopback mode the loopback from a transmitter to a receiver is implemented on a per channel basis for every logical channel. a common transmit and receive clock as well as a common frame synchronization pulse must be provided for loopback mode to work. the loopback is done on a ?xed time slot, meaning that if one logical channel transmits on time slot 17, the loopback occurs through time slot 17 also, whether it is same logical channel or not that receives the incoming data. the reason for this restriction is that no buffering is performed after a channel is processed by the transmitter, or before it reaches the receiver. previously reserved, bit 15 of each entry in the si-ram is now the loopback bit controlling the loopback for the corresponding time slot. it is important to have each individual time slot as an entry in the si-ram for proper loopback on each individual channel. 1.5.3 echo mode the si can be programmed to echo incoming data. in this mode, the complete tdm link is retransmitted from the incoming l1rxdx to the l1txdx pin on a bit-by-bit basis. the receiver section of the selected scc can operate normally and also receive the incoming bit stream. this is also known as global echo mode on the whole link. individual time slot echo is not possible with qmc without software intervention. 1.5.4 inverted signals for each scc, the dpll can be used to invert the bitstream of the transmitter before the signal reaches the pin. this is not a bit-order inversion, but a logical level inversion. the dpll can also invert the incoming data before it is forwarded to the receiver section. a logical inversion on a per channel basis is not possible in the qmc without external hardware. to invert a speci?c channel, the si can be programmed to send a strobe signal at the channels corresponding time slot, assuming the scc is operating in qmc mode. this strobe can then be connected to an external xor gate to perform the inversion. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement 1.6 qmc serial routing and example applications the qmc protocol provides multiple logical channels from a single scc. the scc channel dedicated to operate the qmc protocol should have all the relevant bits or time slots routed to it. individual logical channels are selected by a combination of signals routed through the tdm and tables within the qmc protocol. contrasting a non-qmc example application with qmc implementations highlights bene?ts of the multichannel protocol. figure 1-2 shows an ethernet-to-bri bridge using an mc68en360, a non-qmc device. the con?guration shows the ethernet routed via an nmsi interface to scc1. the isdn bri is routed via the tsa over an idl2 1 interface to scc2Cscc4 for the 2 b + d (b1, b2, and d) channels. the ?rst byte of the frame (b1) is routed to scc2, the second byte (b2) to scc3, and then the next two bits (the d channel) to scc4. in this example, smc2 is used to connect to a pc over rs232. the internal routing is illustrated in figure 1-3. note that three sccs are required to implement the isdn bri. this uses all the mc68en360s serial channels without ef?cient use of the cpm bandwidth. figure 1-2. ethernet-to-bri bridge using mc68en360 1 the idl2 interface is a full duplex isdn interface used to interface to a physical layer device, such as the motorola isdn s/t transceiver mc145474. tsa scc2 scc3 scc4 scc1 smc2 mc68en360 ethernet uart idl2 mc68160 to lan to pc rs232 mc145574 4-wire isdn line spi f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . chapter 1. overview figure 1-3. internal routing for ethernet-to-bri bridge using mc68en360 the following example shows how an mc68mh360 can implement the bri using only one scc, leaving scc3 and scc4 available to run other protocols such as frame relay over hdlc and another ethernet link, on scc1, to the lan. the qmc protocol allows all three channels b1, b2, and d to be routed to scc2 using the tsa. the ?rst byte (b1) is routed to logical channel 1, the second byte (b2) to logical channel 2, and the third byte to logical channel 3, of which only the ?rst 2 bits represent the d channel as illustrated in figure 1-4 and figure 1-5. this routing is de?ned in the qmc time slot assignment tables. the ?rst advantage of the qmc protocol is that it releases sccs to run other protocols. the second advantage is highlighted in the next example. e b1b2d u memory en360 scc1 scc2 scc3 scc4 smc1 smc2 nmsi nmsi tsa ethernet uart bri isdn b1 b2 d f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement figure 1-4. ethernet-to-bri bridge using mc68mh360 figure 1-5. internal routing for ethernet-to-bri bridge using mc68mh360 figure 1-6 and figure 1-7 show how to build a pri isdn-to-ethernet bridge using an mpc860mh. scc1 is used for the ethernet channel. scc2 is con?gured for qmc mode in which each of the 30 b channels and the d channel are routed to separate logical channels. the true advantage of the qmc protocol is the ability to route multiple channels to a single scc. tsa scc2 scc1 smc2 mc68mh360 ethernet uart idl2 mc68160 to lan to pc rs232 mc145574 4-wire isdn line scc3 scc4 spi eu memory mh360 scc1 scc2 scc3 scc4 smc1 smc2 nmsi nmsi uart bri isdn b1 b2 d b1 b2 d tsa ethernet f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . chapter 1. overview figure 1-6. ethernet-to-pri bridge using mpc860mh figure 1-7. internal routing for ethernet-to-pri bridge using mpc860 tsa scc2 scc1 smc2 mp860mh ethernet uart mc68160 to lan to pc rs232 ds2180a 4-wire isdn line scc4 scc2 dallas semiconductor isdn framer spi e b1 u memory 860mh scc1 scc2 scc3 scc4 smc1 smc2 nmsi nmsi ethernet uart pri isdn b1 d b2 b30 b2 b30 tsa d f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement 1.7 scc changes on the fly changes can be made on the ?y in the qmc routing tables, but changes made in the si ram require the link to be disconnected. if the connection is maintained during changes, synchronization and routing errors are likely to happen in the current frame. a workaround uses a shadow ram routing table. the shadow table can hold alternative routing information to be switched in at the appropriate time slot boundary. the drawback to this method is that the number of entries in the si ram is reduced by half. but since the routing tables in the qmc protocol are being changed anyway, the recommended solution is to have all relevant time slots routed to the scc. the si ram also gives the user the capability to multiplex other channels to and from a tdm if not all time slots are used by the qmc. a third option is to have several external devices multiplexed. use the open collector mode if several quiccs or powerquiccs are connected together for subchanneling applications. 1.8 si ram errors the following three types of errors are identi?ed: ? data bit error ? clock pulse error ? synchronization pulse error errors in frame-based protocols are easy to detect by the protocol controller. an error in an hdlc channel is detected at the end of a frame when a buffer is closed and all status bits are reported in the buffer descriptor (bd). the error type for bit errors is normally crc errors. for errors occurring in the si (noise on clock or synchronization pulses), the error may also be of type frame-length-violation or non-octet-aligned. see chapter 5, buffer descriptors, for more information. this section covers the type of errors reported through the buffer descriptors. for transparent channels, the error detection mechanism is left to the user in higher-level software. most transparent channels, such as voice carriers, are tolerant of errors. frame-based channels, on the other hand, require error detection since they often rely on critical control messages. the number of clocks that occur between sync pulses is given in the si ram programming. the clock-counting state machine expects a new sync pulse after the end of each frame. the following paragraphs discuss the different error cases and describe the counter state and the frame delay before synchronization is resumed. a clock pulse error occurs if other than exactly one clock pulse is detected by the si ram in a given frame. in this error case, since the si ram bases its routing on counting clock pulses, the now corrupted signal routing affects all channels. the si ram expects another sync pulse when it reaches the last entry of the frame. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . chapter 1. overview if a clock pulse is missing in a given frame n, the counter will fail to reach its end state before the next sync pulse (n+1) arrives, causing that sync pulse to be ignored. when the counter ?nally reaches its end state, it waits for the next sync pulse (n+2) before resetting. correct routing is thus resumed in frame (n+2). in the case of an extra clock pulse, the counter reaches its end state too early and resumes synchronized routing upon detecting the next sync pulse (n+1). synchronization pulse errors are similar to clock pulse errors. if the frame pulse comes too late, this is similar to having missed a clock pulse in the last time slot. if the frame pulse is too early, it is similar to having one additional clock pulse. 1.9 e1/t1 frame description the primary rate isdn connections offer a cost-effective, high-speed interface. the physical connections in north america offer 24 connections over a t1 interface; in europe an e1 (or cept) connection gives 32 connections of 64 kbps each with a time-division- multiplexed architecture. time-division-multiplexing (tdm) allows several communication channels to share the same physical media. the data stream of each channel is divided into a number of subpackages. each channel is then assigned a subdivision of the tdm line called a time slot. this time slot is repeated over time in a regular pattern. a concatenation of the channels subpackages comprises a frame. the frequency of frame repetition depends on the particular communication interface. two examplesthe t1 line used in north america and the e1 interface used in europe illustrate tdm. for both e1 and t1, the frames must be repeated at a frequency of 8 khz, or every 125 m s. in many applications the required channel speed is 64 kbps. for example, almost all voice channels use 8-khz sampling with 8-bit resolution. each channel in a t1 or e1 interface occupies 8 bits per time slot. the t1 interface multiplexes 24 channels, requiring 24 time slots per frame. in addition to the channels bits, one more bit, for frame signaling and synchronization, is added to create a frame totaling 193 bits. the resulting t1 physical interface is thus 1.544 mbps (8 khz * 193 bits). the e1 frame consists of multiplexing 32 channels resulting in a speed of 2.048 mbps (8 khz * 256 bits). these two frames are illustrated in figure 1-8. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement figure 1-8. frame structures for e1/cept and t1 tdm interfaces for any station to receive and transmit on a tdm line, it is necessary for it to determine the correct time slot boundary. the service provider or the ptt provides a 4-wire interface with a continuous bit stream coming down the line. the t1 and e1 have information embedded in the data stream that delineates frames. the bit pattern in position 193 in t1 over a period of several frames establishes a synchronization pattern. a station may have the capability to search for this pattern and thus ?nd the correct time for frame synchronization. in a similar way, time slots 0 and 16 are reserved not only for synchronization but also for signaling in the e1 interface. depending on its capability, a node can either extract this synchronization information or it can be supported by framer and time slot assigner devices. framing bit 193 frame structure for t1 1.544 mbps 193 bits/125 m s 0 1 22 23 0 256 bits/125 m s framing (ts0) frame structure for e1 2.048 mbps signaling (ts16) 12 31 30 0 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . chapter 1. overview a framer device will retrieve the 8-khz frame synchronization pulses and clock signals for both transmit and receive sections. a time slot assigner will use these signals as inputs to generate pulses or envelope signals for individual bit patterns, i.e., strobe signals for devices without time slot assignment capability such as the mc68302, a ?rst-generation communication processor. for a backplane type of design without a synchronization to a network, the qmc devices are capable of generating all necessary bus signals from their timers and baud-rate generators. this design type is illustrated for a quicc32 in figure 1-9. figure 1-9. mc68mh360 connection to a tdm bus e1ds2151q rx and tx clocks and frame synchronization mc68mh360 quicc32 quicc or other tdm line device rx tx strobe signals system functions t1ds2153 line i/f unit for e1/t1 potential parts from dallas semiconductor f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . chapter 2. qmc memory organization chapter 2 qmc memory organization 20 20 this section describes the operation speci?c to the qmc protocol. when not running the qmc protocol, sccs operate as described in the mc68360 and mpc860 users manuals. figure 2-1 shows the dual-ported ram structure for the mc68mh360 and the mpc860mh. the mc68mh360 and the mpc860mh have similar functionality but are organized in a different manner. figure 2-1. mc68mh360 and mpc860mh internal memory structures dprbase 2-kbyte scc1 parameter ram scc2 parameter ram scc3 parameter ram scc4 parameter ram 4-kbyte internal registers dual-ported ram 4-kbyte internal registers 4-kbyte dual-ported ram immr immr + 0x2000 immr + 0x3c00 dprbase+0x1000 192 bytes 192 bytes 192 bytes 192 bytes dprbase+0x0d00 dprbase+0x0e00 dprbase+0x0f00 dprbase+0x0c00 mc68mh360 mpc860mh parameter ram f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement 2.1 qmc memory structure figure 2-2 shows how data is addressed by the qmc protocol. it discusses addressing the dual-ported ram to access data within the buffers. figure 2-2. qmc memory structure 1. dual-ported ram channel 0 speci?c parameters channel 1 speci?c parameters channel 5 speci?c parameters channel 30 speci?c parameters channel 31 speci?c parameters 2. scc base scc1 parameter ram mcbase tx_s_ptr rx_s_ptr tsa table rx tsa table tx time slot pointer 0 time slot pointer 1 time slot pointer 5 time slot pointer 30 time slot pointer 31 time slot pointer 0 time slot pointer 1 time slot pointer 5 time slot pointer 30 time slot pointer 31 3. time slot 4. channel pointer scc2 parameter ram scc3 parameter ram scc4 parameter ram lc5 tbase lc5 rbase 5.logical channel tbase & rbase 6. mcbase assignment table txbd 1 pointer txbd 2 pointer txbd n pointer rxbd 1 pointer rxbd 2 pointer rxbd n pointer 12345678 abcdef12 12345678 abcdef12 7. bd table 8. data buffer 64 k external memory data buffer external memory 9. data buffer pointer base f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . chapter 2. qmc memory organization 2.1.1 dual-ported ram base the mc68mh360s internal memory is mapped into an 8-kbyte block of memory, and the starting address is dictated by the dprbase programmed in the mbar register. for more detail on the quicc internal memory structure, see section 3 of mc68360 quad integrated communications controller users manual . the mpc860mh has its internal memory mapped into a 16-kbyte block of memory. the isb programmed in the immr register determines the starting address of this memory block. for more information on the powerquicc internal memory structure, see section 3 of mpc860 powerquicc users manual . all internal registers are addressed as offsets within the dual-ported ram; therefore, all pointers are relative to this base address. 2.1.2 scc base and global multichannel parameters the scc base points to the start of the parameter ram for each of the sccs at 256-byte intervals. on the mc68mh360, each scc has 192 bytes of parameter ram; each scc on the mpc860mh has 256 bytes. when the qmc protocol is enabled on an scc, its parameter ram is used to store the global multichannel parameters for all the logical channels. this area contains parameters and pointers that are common to all channels. note as the qmc requires 0xaf bytes of parameter ram for its global multichannel parameters, this may cause con?ict with other cpm functionality. for example, when using the mpc860mh with scc1 in qmc mode, i 2 c is unavailable. 2.1.3 tsatrx/tsattx pointers and time slot assignment table the time slot assignment table pointers are within the global multichannel parameters. there are two pointerstx_s_ptr for transmit and rx_s_ptr for receive. the rx_s_ptr is normally set to scc base + 20; this is the normal location of the receive time slot assignment table. the tx_s_ptr is normally set to scc base + 60; this is the normal location of the transmit time slot assignment table. however, if the receiver and the transmitter have the same mapping for the logical channels, tx_s_ptr can point to scc base + 20 so that rx and tx have a common time slot assignment table. note that if a single tdm channel is routed to more than one scc, they may also use just one time slot assignment table for all sccs. see section 2.3, multiple scc assignment tables, for more information. the time slot assignment table holds one 32-bit entry for each time slot. it has options for subchanneling, a valid bit, and a logical channel pointer. for 64-channel support there is only space for one table; therefore, common rx and tx parameters will need to be used unless one of the tsa tables can be accommodated elsewhere in memory, such as in the parameter ram area of another scc. associated with the rx/tx_s_ptr are the rx/txptr pointers that are maintained by the cpm and point to the current time slot. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement 2.1.4 tsatrx/tsattx channel pointers the channel pointers are 12-bit pointers to the channel-speci?c parameters in the internal dual-ported ram. these should not be confused with tsatrx/tsattx pointers as described in section 2.1.3, tsatrx/tsattx pointers and time slot assignment table. the 6 most-signi?cant bits of the address are taken from the time slot assignment table. for the mh360, the most-signi?cant bit must be zero as the addressing range is only 2 kbytes. the 6 least-signi?cant bits are zero, mapping out a 64-byte area for each of the channel- speci?c parameters. the channel-speci?c parameters are common for rx and tx. for 32- channel support, 2 kbytes of dual-ported ram is required (32 * 64), and for 64-channel support, 4 kbytes of dual-ported ram is required (64 * 64). in most cases, time slot 0 channel pointer will address the base of dual-ported ram for logical channel 0, and time slot 1 channel pointer would address the base of dual-ported ram + 4 for logical channel 1. in figure 2-2, time slot 5 channel pointer addresses logical channel 5, requiring the channel pointer being set to 0b000101. note it is possible to concatenate multiple time slots to one logical channel. this is achieved by setting the channel pointers of the grouped time slots to the same logical channel. 2.1.5 logical channel tbase and rbase tbase and rbase are within the channel-speci?c parameters. tbase is the tx buffer descriptor base address, and rbase is the rx buffer descriptor base address. these 16-bit offsets from mcbase point to individual logical channels buffer descriptors located within the buffer descriptor table. note that there are individual tbase and rbase values for each logical channel. 2.1.6 mcbase mcbase is located in the global multichannel parameters. each scc has a unique mcbase value pointing to the base of the sccs buffer descriptor table in external memory. for example, the address of logical channel ?ves tx buffer descriptor table is mcbase + logical channel ?ve tbase. 2.1.7 buffer descriptor table a buffer descriptor table for each scc is located in a 64-kbyte area of external memory. this block size is determined by the tbase and rbase addressing range. the memory segment must be long-word-aligned but can start anywhere in memory. each scc has a maximum of 16,384 (64 kbytes memory ? 4-byte pointers) buffers. for a 32-channel implementation, each logical channel has a maximum of 256 (16,384 / (32 * 2)) buffers for receive and 256 buffers for transmit. for each logical channel, there is a circular queue with programmable start address and length. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . chapter 2. qmc memory organization 2.1.8 data buffer pointer as with the standard cpm protocols, the data buffer is addressed by a 32-bit pointer within the buffer descriptor. this addresses the data received or transmitted from external memory. 2.1.9 data buffer the data buffers in external memory can hold up to 64 kbytes of data as determined by the data length in the buffer descriptor. 2.2 global multichannel parameters the global multichannel parameters reside in the sccs parameter ram page and are common to all logical channels. the largest portion of the global area is the time slot assigner tables for the receiver and transmitter section of the scc. for 32-channel support, there is one table for tx and one for rx within the parameter ram. if the connection is split over multiple sccs, this table only needs to be present once for multiple sccs operating in qmc mode. see section 2.3, multiple scc assignment tables, for more information. for 64-channel support there is only space for one table; therefore common rx and tx parameters will need to be used unless one of the tsa tables can be accommodated elsewhere in memory, such as in the parameter ram area of another scc. the dual-ported ram is used for the channel-speci?c area for all sccs. it is important that individual time slots are mapped to only one scc, and that individual logical channels are separated to avoid contention. table 2-1 lists the global parameters. note that the boldfaced parameters must be initialized by the user. see chapter 6, qmc initialization, for more information. table 2-1. global multichannel parameters offset to scc base name width (bits) description 00 mcbase 32 multichannel base pointerthis host-initialized parameter points to the starting address of the 64-kbyte buffer descriptor table in external memory. the mcbase is used with the tbase and rbase registers in the channel-speci?c parameters. 04 qmcstate 16 multichannel controller state (initialize to 0x8000)internal qmc state machine value used by risc processor for global state de?nition. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement 06 mrblr 16 maximum receive buffer lengththis host-initialized entry de?nes the maximum number of bytes written to a receive buffer before moving to the next buffer for this channel. this parameter is only valid in hdlc mode. the buffer area allocated in memory for each buffer is mrblr + 4. the qmc adds another long word if non-octet-aligned frames are received in hdlc operation. the non-octet information is written only to the last buffer of a frame, but it can happen in any buffer. see section 5.1, receive buffer descriptor, for more information. as the qmc works on long-word alignment, mrblr value should be a multiple of 4 bytes. 08 tx_s_ptr 16 tx time slot assignment table pointer (scc base + 60 in normal mode; scc base + 20 for common rx & tx time slot assignment tables)this global qmc parameter de?nes the start value of the tsattx table. the tsattx table in the global multichannel parameter listing starts by default at scc base + 60. tx_s_ptr lets the user move the starting address of this table. if the same routing and masking are used for the transmitter and receiver, the tables can be overlaid, so tx_s_ptr can point to scc base + 20. this parameter is an offset from dprbase. this table must be present only once per scc global area. other sccs can access this location. 0a rxptr 16 rx pointer (initialize to scc base + 20)this global qmc parameter is a risc variable that points to the current receiver time slot. the host must initialize this pointer to the starting location of tsatrx. the risc processor increments this pointer whenever it completes the processing of a received time slot. 0c grfthr 16 global receive frame thresholdused to reduce interrupt overhead when many short hdlc frames arrive, each causing an rxf interrupt. grfthr can be set to limit the frequency of interrupts. note that the rxf event is written to the interrupt table on each received frame, but gint is set only when the number of rxf events (by all channels) reaches the grfthr value. grfthr can be changed on the ?y. for information about exception handling, see chapter 4, qmc exceptions. 0e grfcnt 16 global receive frame count (initialized grfcnt = grfthr)a down-counter used to implement the grfthr feature. grfcnt decrements for each frame received. no other receiver interrupts affect this counter. the counter value is set to the threshold during initialization. grfcnt is automatically reset to the grfthr value by the cpm after a global interrupt. 10 intbase 32 multichannel interrupt base address (host-initialized)this pointer contains the starting address of the interrupt circular queue in external memory. each entry contains information about an interrupt request that has been generated by the qmc to the host. each scc operating in qmc mode has its own interrupt table in external memory. see chapter 4, qmc exceptions. 14 intptr 32 multichannel interrupt pointer (host-initialized)this global parameter holds the address of the next qmc interrupt entry in the circular interrupt table. the risc processor writes the next interrupt information to this entry when an exception occurs. the host must copy the value of intbase to intptr before enabling interrupts. table 2-1. global multichannel parameters (continued) offset to scc base name width (bits) description f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . chapter 2. qmc memory organization 18 rx_s_ptr 16 rx time-slot assignment table pointer (default = scc base + 20 in normal mode)this global qmc parameter de?nes the start value of the tsatrx table, which must be present only once per scc global area. other sccs may access this location. 1a txptr 16 txptr (initialize to scc base + 60)this global parameter is a risc variable that points to the current transmitter time slot. the host must initialize it to the starting location of tsattx. the risc processor increments this pointer whenever it completes the processing of a transmitter time slot. 1c c_mask32 32 crc constant (0xdebb20e3)required to calculate 32-bit crc-ccitt. c_mask32 is written by the host during qmc initialization. it is used for 32-bit crc-ccitt calculation if hdlc mode of operation is chosen for a selected channel. (this is a programmable option. for each hdlc channel, one of two crcs can be chosen, as programmed in chamr.) for more information, see section 2.4.1, channel-speci?c hdlc parameters, and table 2-5. this entry must have a correct value if at least one hdlc channel is used; otherwise, it can be cleared (0). 20 tsatrx 32 entries x 16 time slot assignment table rxhost-initialized, 16-bit-wide table with 32 entries that de?ne mapping of logical channels to time slots for the qmc receiver. the qmc protocol looks at chunks of 8 bits regardless of whether they come from one physical time slot of the tdm or whatever other combination of bits the tsa transfers to the scc. these 8 bits are referred to as a time slot in the assignment table. it is recommended but not required to route all bits from the tdm to the scc and to do all enabling and masking in the time-slot assignment table. see figure 2-3. 60 tsattx 32 entries x 16 time slot assignment table txmaps a speci?c logical channel to each physical time slot. time slot assignment table tx is a host-initialized, 16-bit table with 32 entries that de?ne the mapping of channels to time slots for the qmc transmitter. the qmc protocol looks at chunks of 8 bits regardless if they go to one physical time slot of the tdm or whatever other combination of bits are transferred from the scc to the tdm through the tsa. these 8 bits are referred to as a time slot in the assignment table. it is recommended but not required to route all bits from the tdm to the scc and to do all enabling and masking in the time slot assignment table. see figure 2-3. a0 c_mask16 16 crc constant (0xf0b8)required to calculate 16-bit crc-ccitt. this constant is written by the host during qmc initialization. it is used for 16-bit crc-ccitt calculation if hdlc mode of operation is chosen for a selected channel. (this is a programmable option. for each hdlc channel, one of two crcs can be chosen, as programmed in chamr.) for more information, see section 2.4.1, channel-speci?c hdlc parameters, and table 2-5. this entry must have a correct value if at least one hdlc channel is used; otherwise, it can be cleared (0). a4 temp_rba 32 temporary receive buffer address a8 temp_crc 32 temporary cyclic redundancy check table 2-1. global multichannel parameters (continued) offset to scc base name width (bits) description f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement note the area between scc base + 20 and scc base + 9f is normally used for tsa tables. the mapping above is ideal for 32-channel support. the exact mapping of the tsa tables is determined by the programming of rx_s_ptr and tx_s_ptr, and is not ?xed. for 64-channel support it is suggested to use common rx and tx parameters. the tsa table will be common and have 64 entries starting at scc base + 20; see figure 2-4. alternatively, another sccs parameter ram may be used, as determined by rx_s_ptr and tx_s_ptr; see figure 2-6 for more information. however implemented, the tsa tables may reside anywhere in internal memory. figure 2-3 shows a general time slot assignment table for 32 16-bit time slots. the ?elds will be used to either transmit or receive channels. figure 2-3. time slot assignment table channel pointer w v time slot 0 time slot 1 time slot 30 time slot 31 32 x 16 mask(2:7) mask(0:1) channel pointer w v mask(2:7) mask(0:1) channel pointer w v mask(2:7) mask(0:1) channel pointer w v mask(2:7) mask(0:1) channel pointer w v mask(2:7) mask(0:1) channel pointer w v mask(2:7) mask(0:1) channel pointer w v mask(2:7) mask(0:1) note : for the 68360, the bit numberin g is reversed. see appendix a for more information. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . chapter 2. qmc memory organization table 2-2 describes the ?elds in the time slot assignment table for receive. table 2-3 describes the ?elds in the time slot assignment table for transmit. table 2-2. time slot assignment table entry fields for receive section field description v valid bitthe valid bit indicates whether this time slot is valid. 0 the data in this 8-bit time slot is totally ignored and not written to any buffer. 1 the data in this 8-bit time slot is valid and written to the current buffer, pointed to by the channel pointer entry, after protocol processing (e.g. zero deletion in hdlc). individual bits can be masked out as described later. w wrap bitidenti?es the last entry in tsatrx. 0 this is not the last time slot in the frame. 1 the risc processor wraps around and handles time slot 0 or the ?rst 8 bits transferred from the tsa in the next request. the next request is identi?ed by a frame synchronization pulse. rx channel pointer this 6-bit ?eld of the tsatrx entry identi?es the data channel routed to this time slot. the actual channel pointer is 12 bits long, and contains the starting address of the channel-speci?c parameter area (address of rbase). the 6 most-signi?cant bits are taken from the tsatrx channel pointer ?eld, and the 6 least-signi?cant bits are always internally set to zero. for the mh360, the most- signi?cant bit must be set to zero, as the addressing range is 2 kbytes. mask(0C7) mask bitsthese 8 bits identify the valid bits in this time slot for subchanneling support. for 8-bit resolution, all mask bits should be set to 1. any unmasked bit (1) is processed in the receiver for a valid time slot. any masked bit (0) is ignored by the receiver for a valid channel and no bit counter is affected. table 2-3. time slot assignment table entry fields for transmit section name description v valid bitthe valid bit indicates whether this time slot is valid. 0 logic 1 is transmitted. if the tx signal of the tdm interface is programmed to be an open drain output (port b programming), other devices can transmit on nonvalid time slots. 1 data is transmitted from its associated buffer in combination with the mask bit settings. w wrap bitthe wrap bit identi?es the last entry in tsattx. 0 this is not the last time slot in the frame. 1 the risc processor wraps around and handles time slot 0 or the ?rst 8 bits of data in the scc in the next request. the next request is identi?ed by a frame synchronization pulse. tx channel pointer this 6-bit ?eld of the tsattx entry identi?es the data channel routed to this time slot. the actual channel pointer is 12 bits long, and contains the starting address of the channel-speci?c parameter area (address of tbase). the 6 most-signi?cant bits are taken from the tsattx channel pointer ?eld, and the 6 least-signi?cant bits are always internally set to zero. for the mh360 the most- signi?cant bit must be set to zero, as the addressing range is 2 kbytes. mask(0C7) mask bitsidenti?es the valid bits in this time slot for subchanneling support. for 8-bit resolution, all mask bits should be set to 1. for a valid channel with an unmasked bit (1), the bit position is ?lled according to the protocol. a valid channel with a masked bit (0) transmits a logic high (1). f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement if the transmitter and receiver have the same mapping then it is possible to use a common time slot assignment table. this is initialized by setting both tx_s_ptr and rx_s_ptr to scc base + 20. for 64-channel support it is suggested to use common rx and tx parameters. the time slot assignment table will then also be common and have 64 entries starting at scc base + 20; see figure 2-4. figure 2-4. time slot assignment table for 64-channel common rx and tx mapping 2.3 multiple scc assignment tables assume a scenario as depicted in figure 2-5. a 2.048-mbps tdm link is fed directly into the tsa. within the si ram, the even channels (byte-wide) are muxed to scc3 and the odd channels are muxed to scc2. this arrangement is used to spread the load over two sccs. this effectively doubles the fifo depth on the qmc protocol. time slots are switched to alternate sccs to avoid data bursts that may stress the fifos. each scc sees a continuous bitstream without any gaps as described earlier. channel pointer w v time slot 0 time slot 1 time slot 62 time slot 63 64 x 16 mask(2:7) mask(0:1) channel pointer w v mask(2:7) mask(0:1) channel pointer w v mask(2:7) mask(0:1) channel pointer w v mask(2:7) mask(0:1) channel pointer w v mask(2:7) mask(0:1) channel pointer w v mask(2:7) mask(0:1) channel pointer w v mask(2:7) mask(0:1) note : for the 68360, the bit numbering is reversed. see appendix a for more information. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . chapter 2. qmc memory organization figure 2-5. rx time slot assignment table for 32 channels over two sccs note it is important that multiples of bytes are routed to each scc to delineate between time slots. unused bits shall be routed to the scc and be masked in the time slot assignment table. 1 234567 28 29 0 30 31 ........... 24 6 28 0 30 ........... 1 357 29 31 ........... tsa scc3 scc2 cpm rx_s_ptr_2 rx_s_ptr_3 v = 1, w = 0, c.p -> lc2 v = 1, w = 0, c.p -> lc4 v = 1, w = 0, c.p -> lc0 v = 1, w = 0, c.p -> lc28 v = 1, w = 1, c.p -> lc30 v = 1, w = 0, c.p -> lc1 v = 1, w = 0, c.p -> lc3 v = 1, w = 0, c.p -> lc5 v = 1, w = 0, c.p -> lc29 v = 1, w = 1, c.p -> lc31 scc3 parameter ram scc2 parameter ram time slot assignment table rx_2 time slot assignment table rx_3 (not used) rx data stream into tsa even channels muxed to scc3 odd channels muxed to scc2 common tsatrx located in scc2 parameter ram scc base +0x20 scc base + 0x40 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement in figure 2-5, each scc has its own pointer, rx_s_ptr_2 and rx_s_ptr_3, addressing scc2s time slot assignment table. this table only needs to be present once in one of the scc2s global parameter area. rx_s_ptr_2 points to the start of the table, address scc base + 20. the 16 logical channels from scc2 are located in the ?rst 16 entries of the table. the entry for logical channel 30 has the wrap bit (w) set, causing the cpm to wrap back to logical channel 0 on reception of the next byte routed to scc2. rx_s_ptr_3 addresses scc base + 40, the start of the 16 entries for scc3. the entry for logical channel 31 has the wrap bit (w) set, causing the cpm to wrap back to logical channel 1 on reception of the next byte routed to scc3. each entry within the table has a channel pointer to a logical channel. it is important that different sccs do not point to the same logical channel. the tsattx is also located in scc2s parameter ram. this means that the area reserved for the tsa tables in scc3s parameter ram is free for alternative use. a second scenario is depicted in figure 2-6. a 4.096-mbps tdm link is fed directly into the tsa. again, within the si ram, the even channels (byte-wide) are muxed to scc3 and the odd channels are muxed to scc2. this arrangement is used to spread the load over two sccs. another reason this method may be used is to facilitate separate routing for the rx and tx logical channels. this requires two 64-entry tables that require 256 bytes, but only 128 bytes are allocated in the parameter ram of an scc for time slot assignment tables. in this case, the rx table is located in scc2s parameter ram, and the tx table is located in scc3s parameter ram, making most ef?cient use of memory. changes on the ?y are easily accomplished by setting or clearing the valid bit for each time slot. changes to the mask bits can also be made on the ?y. this does not cause any problems to the qmc microcode itself, but may cause protocol errors on the channel in question depending on when this change is done. it is possible to have a time slot assignment table for every scc in its corresponding ram page and have all of the tdm routed to the different sccs. this gives the user a very ?exible system that can be changed on the ?y without disconnecting the tdm interface. in this case the user must ensure that no collisions occur on the transmit lines from several sccs. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . chapter 2. qmc memory organization figure 2-6. time slot assignment tables for 64 channels over 2 sccs 1 234567 60 61 0 62 63 ........... 24 6 60 0 62 ........... 1 357 61 63 ........... tsa scc3 scc2 cpm rx_s_ptr_2 rx_s_ptr_3 v = 1, w = 0, c.p -> lc2 v = 1, w = 0, c.p -> lc4 v = 1, w = 0, c.p -> lc0 v = 1, w = 0, c.p -> lc60 v = 1, w = 1, c.p -> lc62 v = 1, w = 0, c.p -> lc1 v = 1, w = 0, c.p -> lc 3 v = 1, w = 0, c.p -> lc5 v = 1, w = 0, c.p -> lc61 v = 1, w = 1, c.p -> lc63 scc3 parameter ram scc2 parameter ram time slot assignment table rx time slot assignment table rx located in scc3 parameter ram data stream into tsa even channels muxed to scc3 odd channels muxed to scc2 common tsatrx located in scc2 parameter ram scc2 base +0x20 scc2 base +0x60 tx_s_ptr_2 tx_s_ptr_3 located in scc 2 parameter ram common tsattx located in scc3 parameter ram scc3 base + 0x20 scc3 base +0x60 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement 2.4 channel-speci?c parameters the channel-speci?c parameters are located in the lower part of the dual-ported ram. each channel occupies 64 bytes of parameters. physical time slots can be matched to logical channels in several combinations. unused logical channels leave a hole in the channel- speci?c parameters that can be used for buffer descriptors for the other sccs. the channel-speci?c area determines the operating modehdlc or transparent. several entries take on different meanings depending on the protocol chosen. 2.4.1 channel-speci?c hdlc parameters table 2-4 describes the channel-speci?c hdlc parameters. boldfaced parameters must be initialized by the user. table 2-4. channel-specific hdlc parameters offset name width (bits) description 00 tbase 16 tx buffer descriptor base addressoffset of the channels transmit buffer descriptor table relative to mcbase, host-initialized. see figure 2-2. 02 chamr 16 channel mode register. see section 2.4.1.1, chamrchannel mode register (hdlc). 04 tstate 32 tx internal state tstate de?nes the internal tx state. host-initialized to 0x3800 _ 0000fc = 8, motorola mode for mh360. host-initialized to 0x3000 _ 0000 at = 0, motorola mode for 860mh. initialize before enabling the channel. see section 2.4.1.2, tstatetx internal state (hdlc). 08 32 tx internal data pointerpoints to current absolute address of channel. 0c tbptr 16 tx buffer descriptor pointer (host-initialized to tbase before enabling the channel or after a fatal error before reinitializing the channel again)offset of current bd relative to mcbase. see table 2-1. mcbase + tbptr gives the address for the bd in use. 0e 16 tx internal byte countnumber of remaining bytes 10 tupack 32 (tx temp) unpack 4 bytes from 1 long word 14 zistate 32 zero-insertion state (host-initialized to 0x0000 _ 0100 for hdlc or transparent operation)contains the previous state of the zero-insertion state machine. 18 tcrc 32 temp transmit crctemp value of crc calculation result 1c intmsk 16 channels interrupt mask ?agssee section 2.4.1.3, intmskinterrupt mask (hdlc). 1e bdflags 16 temp 20 rbase 16 rx buffer descriptor offset (host-initialized) de?nes the offset of the channels receive bd table relative to mcbase (64-kbyte table). see figure 2-2. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . chapter 2. qmc memory organization 2.4.1.1 chamrchannel mode register (hdlc) the channel mode register is a word-length, host-initialized register. figure 2-7 shows the channel mode register for hdlc operation. notes : 1. all bits that are de?ned as reserved should be cleared (0). 2. for the 68360, the bit numbering is reversed. see appendix a for more information. figure 2-7. chamrchannel mode register (hdlc) 22 mflr 16 maximum frame length register (host-initialized)de?nes the longest expectable frame for this channel. its maximum value is 64 kbytes. the remainder of a frame which is larger than mflr is discarded and a ?ag in the last frames bd is set (lg). an interrupt request (rxf and rxb) might be generated depending on the interrupt mask. the frame length is considered to be everything between ?ags, including crc. mflr is checked every long word, but the content may be on any number of bytes. if mflr is set to 5 for example, checking is done when 8 bytes have been received. at this point, the sdma transfers the long word to memory, and all 8 bytes will be in the receive buffer. also at this point the mflr violation (>5) is detected and the interrupt may be generated. no more data will be written into this buffer when the mflr violation is detected. 24 rstate 32 rx internal state initialize to 0x3900 _ 0000 fc=9, motorola mode for mh360 or initialize to 0x3100 _ 0000 at=1, motorola mode for 860mh. see section 2.4.1.4, rstaterx internal state (hdlc), for more information. 28 32 rx internal data pointerpoints to current address of speci?c channel. 2c rbptr 16 rx buffer descriptor pointer (host-initialized to rbase prior to operation or due to a fatal error)contains the offset from mcbase to the current receive buffer. see table 2-1. mcbase + rbptr gives the address for the bd in use. 2e 16 rx internal byte countper channel: number of remaining bytes in buffer 30 rpack 32 (rx temp) packs 4 bytes to 1 long word before writing to buffer. 34 zdstate 32 zero deletion machine state(host-initialized to 0x0000 _ 0080 in hdlc mode, 0x1800 _ 0080 in transparent mode, prior to operation and after a fatal rx error (global overrun, busy) before channel initialization.)contains the previous state of zero deletion state machine. the middle 2 bytes, represented by zeros in the initialization value above, hold the received pattern during reception. a window of 16 bits shows the history of what is received on this logical channel. more information is given in the application note section. 38 rcrc 32 temp receive crctemp value of crc calculation result 3c max_cnt 16 max_length countercount length remaining 3 e tmp_mb 16 tempholds min(max_cnt, rx internal byte count) 0 123456789101112131415 mode 0 idlm ent reserved pol crc 0 reserved nof reset: 0 000000000000000 table 2-4. channel-specific hdlc parameters (continued) offset name width (bits) description f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement table 2-5 describes the channel mode registers ?elds for hdlc operation. boldfaced parameters must be initialized by the user. table 2-5. chamr field descriptions (hdlc) field name description 0 mode modeeach channel has a programmable option whether to use transparent mode or hdlc mode. 0 transparent mode 1 hdlc mode 10 2 idlm idle mode. 0 idle mode is disabled. no idle patterns are transmitted between frames. after transmitting the nof + 1 ?ags, the transmitter starts the data of the frame. if between frames and the frame buffer is not ready, the transmitter sends ?ags until it can start transmitting the data. the nof shall be greater or equal to the pad setting; see section 5.2, transmit buffer descriptor. if nof = 0, this is identical to ?ag sharing in hdlc mode. for a high cpm load or with long bus latencies, the qmc protocol may insert additional ?ags. 1 idle mode enabled. at least one idle pattern is transmitted between adjacent frames. if between frames and the frame buffer is not ready, the transmitter sends idle characters. when data is ready, the nof + 1 ?ags are sent followed by the data frame. if in idle mode and nof = 1, the following sequence is transmitted: ......init value, ff, ff, ?ag, ?ag, data,...... the init value before the idle will be 1s, in this case it is assumed the transmitter was uninitialized. an uninitialized scc transmits 1s in every position. 3 ent enable transmit. 0 disable transmitter. if this bit is cleared and the channels transmitter is routed to a certain time slot (within tsattx, see figure 2-3) the transmitter sends 1s on this time slot. 1 the transmit portion of the channel is enabled and data is sent according to protocol and to other control settings. note that there is no enr bit in the qmc protocol. to enable the receiver, the zdstate and rstate parameters shall be set to their initial values. 4C6 reserved 7 pol enable polling. this bit enables the transmitter to poll the transmit buffer descriptors. 0 the cpm does not check the ready bit (r) in the transmit buffer descriptor. 1 the cpm checks the ready bit (r) in the transmit buffer descriptor. the user can use this bit to prevent unnecessary external bus cycles when checking the ready bit (r) in the buffer descriptor. this bit should always be set by the software at the beginning of a transmit sequence of one or more frames. this bit is cleared (0) by the risc processor when no more buffers are ready in the transmit queue when it ?nds a buffer descriptor with the r bit cleared (0), i. e., at the end of a frame or at the end of a multiframe transmission. in order to prevent deadlock the software should always prepare the new bd, or multiple bds, and set (1) the ready bit in the bd, before setting (1) the pol bit. note that as this bit is automatically cleared by the cpm; the user should not attempt to clear this bit in software. 8 crc this bit selects the type of crc when using the hdlc channel mode. 0 16-bit ccitt-crc is selected for this channel. 1 32-bit ccitt-crc is selected. 90 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . chapter 2. qmc memory organization 2.4.1.2 tstatetx internal state (hdlc) tstate de?nes the internal transmitter state. the high byte of tstate de?nes the function code/address type and the motorola/intel bit. bit 3 (or bit 28 for the 68360) should always be set to 1. figure 2-8 shows the tstate register for hdlc operation. note : for the 68360, the bit numbering is reversed. see appendix a for more information. figure 2-8. tstatetx internal state (hdlc) for the mh360, tstate should be host-initialized to 0x3800_0000 before enabling the channelfunction code 8. table 2-6 describes the tstate ?elds for the mh360 with boldfaced parameters to be initialized by the user. for the 860mh, tstate should be host-initialized to 0x3000_0000 before enabling the channelat = 0. note that for the 860mh, bit 4 should always be zero as only bits 5C7 map to at[1C3]. table 2-7 describes the tstate ?elds for the 860mh with boldfaced parameters to be initialized by the user. 10C11 reserved 12C15 nof number of ?agsde?nes the minimum number of ?ags before frames. however, even if nof = 0, at least one ?ag is transmitted before the ?rst frame. see the description of the idlm bit for more information. 01234567 0 0 1 mot fc[3C0]/ at[1C3] table 2-6. tstate field descriptions for mh360 (hdlc) field name description 0C1 0 2 1 3 mot motorola/intel bit 0 = the bus format is intel format (little-endian). 1 = the system bus is considered to be organized in motorola format (big-endian). 4C7 fc[3C0] function codethis ?eld contains the function code for the transmitter dma channel for data buffers in external memory (transmit buffers). function codes are needed by the memory controller to decode a correct memory cycle and activate the correct handshaking. table 2-5. chamr field descriptions (hdlc) (continued) field name description f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement 2.4.1.3 intmskinterrupt mask (hdlc) each event de?ned in the interrupt circular queue entry maps directly to a bit in intmsk as shown in figure 2-9. there is one mask bit for each eventnid (bit 2), idl (bit 3), mrf (bit 10), un (bit 11), rxf (bit 12), bsy (bit 13), txb (bit 14) and rxb (bit 15). bits that do not map to an event are reserved. reserved bits must be set to zero. refer to chapter 4, qmc exceptions, for more detail. ? 0 = no interrupt request is generated and no new entry is written in the circular interrupt table. ? 1 = interrupts are enabled. this register is initialized by the host prior to operation. interrupt table entry: intmsk: note : for the 68360, the bit numbering is reversed. see appendix a for more information. figure 2-9. intmsk and interrupt table entry (hdlc) table 2-7. tstate field descriptions for 860mh (hdlc) field name description 0C1 0 2 1 3 mot motorola/intel bit 0 = the bus format is intel format (little-endian). 1 = the system bus is considered to be organized in motorola format (big-endian). 4 0 5C7 at[1C3] address typethis ?eld contains the address type for the transmitter dma channel for data buffers in external memory (transmit buffers). address types are needed by the memory controller to decode a correct memory cycle and activate the correct handshaking. 0 123456789101112131415 v w nid idl channel number mrf un rxf bsy txb rxb reset: 0 000000 000000000 0 123456789101112131415 reserved interrupt mask reserved interrupt mask bits reset: 0 000000 000000000 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . chapter 2. qmc memory organization 2.4.1.4 rstaterx internal state (hdlc) host-initialized to 0x3900_0000 before enabling the channel or after a fatal error (that is, global overrun, busy) or after a stop rx command. the high byte of rstate de?nes the function code/address type and the motorola/intel bit. bit 3 (or bit 28 for the 68360) should always be set to 1. figure 2-10 shows the rstate register for hdlc operation. note : for the 68360, the bit numbering is reversed. see appendix a for more information. figure 2-10. rstaterx internal state (hdlc) for the mh360, rstate should be host-initialized to 0x3900_0000 before enabling the channelfunction code 9. table 2-8 describes the rstate ?elds for the mh360 with boldfaced parameters to be initialized by the user. for the 860mh, rstate should be host-initialized to 0x3100_0000 before enabling the channelat = 1. note that for the 860mh, bit 4 should always be zero as only bits 5C7 map to at[1C3]. table 2-9 describes the rstate ?elds for the 860mh with boldfaced parameters to be initialized by the user. 01234567 0 0 1 mot fc[3C0]/ at[1C3] table 2-8. rstate field descriptions for mh360 (hdlc) field name description 0C1 0 21 3 mot motorola/intel bit 0 = the bus format is intel format (little-endian). 1 = the system bus is considered to be organized in motorola format (big-endian). 4C7 fc[3C0] function codethis ?eld contains the function code for the transmitter dma channel for data buffers in external memory (transmit buffers). function codes are needed by the memory controller to decode a correct memory cycle and activate the correct handshaking. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement 2.4.2 channel-speci?c transparent parameters table 2-10 describes the channel-speci?c transparent parameters. boldfaced parameters must be initialized by the user. table 2-9. rstate field descriptions for 860mh (hdlc) field name description 0C1 0 2 1 3 mot motorola/intel bit 0 = the bus format is intel format (little-endian). 1 = the system bus is considered to be organized in motorola format (big-endian). 4 0 5C7 at[1C3] address typethis ?eld contains the address type for the transmitter dma channel for data buffers in external memory (transmit buffers). address types are needed by the memory controller to decode a correct memory cycle and activate the correct handshaking. table 2-10. channel-specific transparent parameters offset name width description 00 tbase 16 tx buffer descriptor base addressde?nes the offset of the channels transmit bd table relative to mcbase, host-initialized. see figure 2-2. 02 chamr 16 channel mode register. see section 2.4.2.1, chamrchannel mode register (transparent mode). 04 tstate 32 tx internal state tstate de?nes the internal tx state. host-initialized to 0x3800 _ 0000fc = 8, motorola mode for mh360. host-initialized to 0x3000 _ 0000at = 0, motorola mode for 860mh. initialize before enabling the channel. see section 2.4.2.2, tstatetx internal state (transparent mode). 08 32 tx internal data pointerpoints to current absolute address of channel. 0c tbptr 16 tx buffer descriptor pointer (host-initialized to tbase before enabling the channel or after a fatal error before reinitializing the channel)contains the offset of current bd relative to mcbase. see table 2-1. mcbase + tbptr gives the address for the bd in use. 0e 16 tx internal byte countnumber of remaining bytes 10 tupack 32 (tx temp) unpack 4 bytes from 1 long word 14 zistate 32 zero-insertion machine state (host-initialized to 0x0000 _ 0100)contains the previous state of the zero-insertion state machine. 18 res 32 1c intmsk 16 channels interrupt mask ?ags. see figure 2-9. 1e bdflags 16 temp 20 rbase 16 receive buffer descriptor base offsetde?nes the offset of the channels 64-kbyte receive bd table relative to mcbase. host-initialized. see also figure 2-2. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . chapter 2. qmc memory organization 2.4.2.1 chamrchannel mode register (transparent mode) the channel mode register is a word-length, host-initialized register. figure 2-11 shows the channel mode register for transparent mode. notes : 1. all bits de?ned as reserved are cleared (0). 2. for the 68360, the bit numbering is reversed. see appendix a for more information. figure 2-11. chamrchannel mode register (transparent mode) table 2-11 describes the channel mode registers ?elds for transparent operation. boldfaced parameters must be initialized by the user. 22 tmrblr 16 transparent maximum receive buffer length (host-initialized entry)de?nes the maximum number of bytes written to a receive buffer before moving to the next buffer for this channel. note that this value must be a multiple of 4 bytes as the qmc works on long-word alignment. 24 rstate 32 rx internal state initialize to 0x3900 _ 0000 fc = 9, motorola mode for mh360, initialize to 0x3100 _ 0000 at = 1, motorola mode for 860mh. see section 2.4.2.5, rstaterx internal state (transparent mode), for more information. 28 32 rx internal data pointerpoints to current address of speci?c channel. 2c rbptr 16 rx buffer descriptor pointer (host-initialized to rbase, prior to operation or due to a fatal error)contains the offset from mcbase to the current receive buffer. see figure 2-2. mcbase + rbptr gives the address for the bd in use. 2e 16 rx internal byte countper channel: number of remaining bytes in buffer 30 rpack 32 (rx temp)packs 4 bytes to 1 long word before writing to buffer. 34 zdstate 32 zero deletion machine state(host-initialized to 0x0000 _ 0080 in hdlc mode, 0x1800 _ 0080 in transparent mode, prior to operation and after a fatal rx error (global overrun, busy) before channel initialization.)contains the previous state of the zero-deletion state machine. the middle 2 bytes, represented by zeros in the initialization value above, holds the received pattern during reception. a window of 16 bits shows the history of what is received on this logical channel. 38 res 32 3c trnsync 16 transparent synchronizationin transparent mode, this register controls synchronization for single time slots or superchannel applications. see section 2.4.2.4, trnsynctransparent synchronization. 3e res 16 0 123456789101112131415 mode rd 1 ent resd sync res pol 0 0 reserved 0 reset: 0 000000000000000 table 2-10. channel-specific transparent parameters (continued) offset name width description f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement table 2-11. chamr bit settings (transparent mode) field name description 0 mode modeeach channel has a programmable option whether to use transparent mode or hdlc mode. 0 transparent mode 1 hdlc mode 1 rd reverse data 0 the bit order will not be reversed, transmitting/receiving the lsb of each octet ?rst. 1 the bit order as seen on the channels is reversed, transmitting/receiving the msb of each octet ?rst. 21 3 ent enable transmit 0 disable transmitter. if this bit is cleared and the channels transmitter is routed to a certain time slot (within tsattx, see figure 2-3) the transmitter sends 1s on this time slot. 1 the transmit portion of the channel is enabled and data is sent according to protocol and to other control settings. 4 reserved 5 sync synchronizationcontrols synchronization of multichannel operation in transparent mode. 0 the ?rst byte is put in the ?rst available time slot or is read from the ?rst available time slot to this logical channel. 1 the synchronization algorithm according to transync is done. 6 res reserved 7 pol enable pollingenables the transmitter to poll the transmit bds. 0 the cpm will not check the ready (r) bit in the transmit buffer descriptor. 1 the cpm will go check the ready (r) bit in the transmit buffer descriptor. the user can use this bit to prevent unnecessary external bus cycles when checking the ready bit (r) in the buffer descriptor. software should always set pol at the beginning of a transmit sequence of one or more frames. the risc processor clears pol (0) when no more buffers are ready in the transmit queue when it ?nds a buffer descriptor with the r bit cleared (0), that is, at the end of a frame or at the end of a multiframe transmission. to prevent deadlock, software should prepare the new bd, or multiple bds, and set (1) the ready (r) bit in the bd before setting (1) pol. note that the cpm automatically clears this bit; the user should never try to clear this bit in software. 8C9 0 10C11 reserved 12C15 0 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . chapter 2. qmc memory organization 2.4.2.2 tstatetx internal state (transparent mode) tstate de?nes the internal transmitter state. the high byte of tstate de?nes the function code/address type and the motorola/intel bit (bit 3) that should always be set to 1. figure 2-12 shows the tstate register for transparent mode. note : for the 68360, the bit numbering is reversed. see appendix a for more information. figure 2-12. tstatetx internal state (t ransparent mode) for the mh360, tstate should be host-initialized to 0x3800_0000 before enabling the channelfunction code 8. table 2-12 describes the tstate ?elds for the mh360 with boldfaced parameters to be initialized by the user. for the 860mh, tstate should be host-initialized to 0x3000_0000 before enabling the channelat = 0. note that for the 860mh bit 4 should always be zero as only bits 5C7 map to at[1C3] . table 2-13 describes the tstate ?elds for the 860mh with boldfaced parameters to be initialized by the user. 01234567 0 0 1 mot fc[3C0]/ at[1C3] table 2-12. tstate field descriptions for mh360 (transparent mode) field name description 0C1 0 2 1 3 mot motorola/intel bit 0 = the bus format is intel format (little-endian). 1 = the system bus is considered to be organized in motorola format (big-endian). 4C7 fc[3C0] function codethis ?eld contains the function code for the transmitter dma channel for data buffers in external memory (transmit buffers). function codes are needed by the memory controller to decode a correct memory cycle and activate the correct handshaking. table 2-13. tstate field descriptions for 860mh (transparent mode) field name description 0C1 0 2 1 3 mot motorola/intel bit 0 = the bus format is intel format (little-endian). 1 = the system bus is considered to be organized in motorola format (big-endian). 4 0 5C7 at[1C3] address typethis ?eld contains the address type for the transmitter dma channel for data buffers in external memory (transmit buffers). address types are needed by the memory controller to decode a correct memory cycle and activate the correct handshaking. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement 2.4.2.3 intmskinterrupt mask (transparent mode) each event de?ned in the interrupt circular queue entry maps directly to a bit in intmsk as shown in figure 2-13. there is one mask bit for each eventun (bit 11), bsy (bit 13), txb (bit 14) and rxb (bit 15). bits that do not map to an event are reserved. reserved bits must be set to zero. ? 0 = no interrupt request is generated and no new entry is written in the circular interrupt table. ? 1 = interrupts are enabled. this register is initialized by the host before operation. interrupt table entry: intmsk: note : for the 68360, the bit numbering is reversed. see appendix a for more information. figure 2-13. intmsk and interrupt table entry (transparent mode) 2.4.2.4 trnsynctransparent synchronization in transparent mode, the trnsync register controls the synchronization for single time slots or superchannel applications. note this register has no meaning if the sync bit in the channel mode register (chamr) is cleared (0). when sending a transparent message over several time slots, it is necessary to know in which time slot the ?rst byte of data appears. the trnsync word-length register is divided into two parts with the high byte controlling the ?rst received time slot and the low byte controlling the transmitter synchronization. 0 123456789101112131415 v w res res C channel number res un res bsy txb rxb reset: 0 000000000000000 0 123456789101112131415 reserved reserved reserved res interrupt mask bits reset: 0 000000000000000 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . chapter 2. qmc memory organization take the example of a superchannel of several time slots: tsn, tsn + 1, tsn + 2 ....... tsn + x the algorithm for the receiver byte in decimal is: (tsn + 1) * 2 the algorithm for the transmit byte in decimal is: (tsn + x + 1) * 2 the result from these calculations is a decimal value programmed into trnsync. note note that ts n is not necessarily the ?rst time slot in the frame. for example, if a superchannel is produced from ts2, ts4, and ts6, the message may be arranged with ts4 holding the ?rst byte, then ts6, and the ?nal byte held in ts2 of the following frame. the following nine cases in figure 2-14, named c1 to c9, show different scenarios ranging from a single time slot per logical channel to a superchannel using several time slots. in this application, 24 time slots are routed to this scc from the si ram. after time slot 23, the frame starts with 0 again. the arrow in all the ?gures illustrates the starting position. c1 is for a single byte in ts7, so tsn = 7 rx byte: (7+1) * 2 = 16 as x = 0, tsn + x = tsn = 7, so tx byte: (7 + 1) * 2 = 16 c2 is a single byte in ts23, so tsn = 23. note that time slot after 23 is 0, so in the calculations below 23 + 1 = 0. rx byte: (23 + 1) * 2 = 0 as x = 0, tsn + x = tsn = 23, so tx byte: (23 + 1) * 2 = 0 c3 is a 2-byte pattern ts7, ts8, so tsn = 7 rx byte: (7 + 1) * 2 = 16 as x = 1, tsn + x = 8, so tx byte: (8 + 1) * 2 = 18 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement c4 is a 2-byte pattern ts8, ts7, so tsn = 8 rx byte: (8+1) * 2 = 16 as x = 1, tsn + x = 7, so tx byte: (7 + 1) * 2 = 16 c5 is a 2-byte pattern ts19, ts23, so tsn = 19 rx byte: (19 + 1) * 2 = 40 as x = 1, tsn + x = 23, so tx byte: (23 + 1) * 2 = 0 c6 is a 2-byte pattern ts23, ts19, so tsn = 23 rx byte: (23 + 1) * 2 = 0 as x = 1, tsn + x = 19, so; tx byte: (19 + 1) * 2 = 40 c7 is a 4-byte pattern ts20, ts23, ts8, ts9 & ts19, so tsn = 20 rx byte: (20 + 1) * 2 = 42 as x = 5, tsn + x = 19, so tx byte: (19 + 1) * 2 = 40 c8 is a 4-byte pattern ts8, ts9, ts19, ts20 & ts23, so tsn = 8 rx byte: (8 + 1) * 2 = 18 as x = 5, tsn + x = 23, so tx byte: (23 + 1) * 2 = 0 c9 is a 4-byte pattern ts19, ts20, ts23, ts8 & ts9, so tsn = 19 rx byte: (19 + 1) * 2 = 40 as x = 5, tsn + x = 9, so tx byte: (9 + 1) * 2 = 20 note case c1 and c2 can be used as described above. a more elegant solution for single time slot applications is to have the sync bit cleared (0) in the channel mode register. both scenarios produce the same result. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . chapter 2. qmc memory organization figure 2-14. examples of different t1 time slot allocation single channel in ts7 7 0 c1 single channel in ts23 23 0 c2 dual channel in ts 7+8 78 0 c3 dual channel in ts7+8 78 0 c4 dual channel in ts19+23 19 23 0 c5 dual channel in ts19+23 23 19 0 c6 multi channel in ts8+9+19+20+23 0 8 9 19 20 23 c7 multi channel in ts8+9+19+20+23 0 19 20 23 89 c8 multi channel in ts8+9+19+20+23 0 8 9 19 20 23 c9 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement 2.4.2.5 rstaterx internal state (transparent mode) the rstate is host-initialized before enabling the channel or after a fatal error (that is, global overrun, busy) or after a stop rx command. the high byte of rstate de?nes the function code/address type and the motorola/intel bit. bit 3 (or bit 29 for the 68360) should always be set to 1. figure 2-15 shows the rstate register for transparent mode. note : for the 68360, the bit numbering is reversed. see appendix a for more information. figure 2-15. rstaterx internal state (transparent mode) for the mh360, rstate should be initialized to 0x3900_0000 before enabling the channelfunction code 9. table 2-14 describes the rstate ?elds for the mh360 with boldfaced parameters to be initialized by the user. 01234567 0 0 1 mot fc[3C0]/ at[1C3] table 2-14. rstate field descriptions for mh360 (transparent mode) field name description 0C1 0 2 1 3 mot motorola/intel bit 0 = the bus format is intel format (little-endian). 1 = the system bus is considered to be organized in motorola format (big-endian). 4C7 fc[3C0] function codethis ?eld contains the function code for the transmitter dma channel for data buffers in external memory (transmit buffers). function codes are needed by the memory controller to decode a correct memory cycle and activate the correct handshaking. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . chapter 2. qmc memory organization for the 860mh, rstate should be initialized to 0x3100_0000 before enabling the channel at = 1. note that for the 860mh, bit 4 should always be zero as only bits 5C7 map to at[1C3]. table 2-15 describes the rstate ?elds for the 860mh with boldfaced parameters to be initialized by the user. table 2-15. rstate field descriptions for 860mh (transparent mode) field name description 0C1 0 2 1 3 mot motorola/intel bit 0 = the bus format is intel format (little-endian). 1 = the system bus is considered to be organized in motorola format (big-endian). 4 0 5C7 at[1C3] address typethis ?eld contains the address type for the transmitter dma channel for data buffers in external memory (transmit buffers). address types are needed by the memory controller to decode a correct memory cycle and activate the correct handshaking. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . chapter 3. qmc commands chapter 3 qmc commands 30 30 the host issues commands to the qmc by writing to the command register (cr). the qmc commands are similar to those of standard quicc hdlc protocol. the cr format for qmc is shown in figure 3-1. note : for the 68360, the bit numbering is reversed. see appendix a for more information. figure 3-1. command register (cr) 3.1 transmit commands stop transmit qmc supplement 3.2 receive commands stop receive chapter 4. qmc exceptions chapter 4 qmc exceptions 40 40 qmc interrupt handling involves two principle data structuresthe scc event register (scce) and the circular interrupt table. figure 4-1 illustrates the circular interrupt table. figure 4-1. circular interrupt table in external memory intbase (interrupt base) points to the starting location of the queue in external memory, and intptr (interrupt pointer) marks the current empty position available to the risc processor. both pointers are host-initialized global qmc parameters; see table 2-1. the entry whose w (wrap) bit is set to 1 marks the end of the queue. when one of the qmc channels generates an interrupt request, the risc processor writes a new entry to the queue. in addition to the channels number, this entry contains a description of the exception. the v (valid) bit is then set and intptr is incremented. when intptr reaches the entry with w = 1, intptr is reset to intbase. an interrupt is written to the interrupt table only if it survives a mask with the intmask (interrupt mask) register. following a write to the queue, the qmc protocol updates the scc event register (scce) according to the type of exception. v = 1 interrupt flags v = 0 x v = 0 x v = 0 x v = 1 interrupt flags v = 1 interrupt flags v = 1 interrupt flags v = 0 x v = 0 x v = 0 x intbase software pointer intptr w = 0 w = 0 w = 0 w = 0 w = 0 w = 0 w = 0 w = 0 w = 0 w = 1 16 bits f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement following a request that is not masked out by the intmask or the sccm (scc mask) register, an interrupt is generated to the host. the host reads the scce to determine the cause of interrupt. a dedicated scce bit (gint) indicates that at least one new entry was added to the queue. after clearing gint, the host starts processing the queue. the host then clears this entrys valid bit (v). the host follows this procedure until it reaches an entry with v = 0, indicating an invalid entry. note it is important that the user clear all interrupt ?ags in a queue entry even though its valid bit may be cleared since old ?ags are not necessarily overwritten with each new event. 4.1 global error events a global error affects the operation of the scc. a global error can occur for two reasons serial data rates being too high for the cpm to handle, and cpm bus latency being too long for correct fifo operation. there are two global errors global transmitting underrun (gun) and global receiver overrun (gov). gun indicates that transmission has failed due to lack of data; and gov indicates that the receiver has failed because the risc processor did not write previous data to the receive buffer. in both cases, it is unknown which channel(s) are affected. nonglobal, individual channel errors are handled differently. see section 4.3, interrupt table entry, for underrun and overrun in a speci?c channel. the incoming data to the cpm is governed by transfers between the scc and the si. every transfer in either direction causes a request to the cpm state machine. if requests are received too quickly, the cpm crashes due to an overload of serial data. this causes a global error depending on whether it happened in the transmit side or the receive side. this error affects all qmc channels. the other error condition is bus latency. a receiving channel submits data to the fifo for transfer to external memory as long as the channel operates normally. if the bus latency for the sdma channels is too long and the receive fifo is ?lled and overwritten, a receiver over?ow occurs. the overwriting channels cannot be traced, affecting entire qmc operation. a similar situation can occur during transmission when the sdma cannot ?ll the fifo from external memory because of bus latency. again, it cannot be determined which channel is underrun, and the whole qmc operation is affected. global errors are unlikely to occur in normal system operation, if correct serial speed is used. the only area of concern is data movement between the fifo and external memory. to avoid problems, the user must understand the bus arbitration mechanism of the quicc and meet the latency requirements; see chapter 8, performance, for more information. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . chapter 4. qmc exceptions 4.1.1 global underrun (gun) the qmc performs the following actions when it detects a gun event: ? transmits an abort sequence of minimum sixteen 1s in each time slot. ? generates an interrupt request to the host (if enabled) and sets the gun bit in the scce register. ? stops reading data from buffer. ? sends idles or flags in all time slots depending on channel mode settings until the host does the following: host initializes all transmitting channels and time slots by preparing all buffer descriptors for transmission (r bits are set) and setting the pol bit. no other re- initialization is needed. 4.1.2 global overrun (gov) in the fifo a global overrun affects all channels operating from an scc. following gov, the qmc performs the following: ? updates the rstate register to prevent further reception on this channel. bit 20 in the rstate register indicates that the receiver is stopped. ? generates an interrupt request to the host (if enabled) and sets the gov bit in the scce. ? stops writing data to all channels buffers. ? waits for host to initialize all the receiving channels by setting ?rst the zdstate followed by the rstate to their initial values. 4.1.3 restart from a global error the last two bullets in the above two sections describe the only steps necessary for re- initialization. the transmit and receive sections must be restarted individually for each separate logical channel. for details about initialization, see chapter 6, qmc initialization. 4.2 scc event register (scce) the qmcs scce is a word-length register used to report events and generate interrupt requests. see figure 4-2 and table 4-1 for scce ?eld descriptions. for each of its ?ags, a corresponding programmable mask/enable bit in the sccm determines whether an interrupt request is generated. if a bit in the sccm register is zero, the corresponding interrupt ?ag does not survive, and the cpm does not proceed with its usual interrupt handling. if a bit in the sccm is set, the corresponding interrupt ?ag in the scce survives, and the scc event bit is set in the cpm interrupt-pending register. see figure 4-3 for sccm assignments. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement note : for the 68360, the bit numbering is reversed. see appendix a for more information. figure 4-2. scc event register 01234567 iqov gint gun gov table 4-1 . scc event register field descriptions field name description 0C3 reserved 4 iqov interrupt table (interrupt queue) over?ow 0 no interrupt table over?ow has occurred. 1 an over?ow condition in the circular interrupt table occurs (and an interrupt request is generated). this condition occurs if the risc processor attempts to write a new interrupt entry into an entry that was not handled by the host. such an entry is identi?ed by v = 1. this entry is cleared by the software immediately after entering the interrupt routine. when this occurs, the last interrupt is lost and not overwritten on the ?rst entry. 5 gint global interrupt 0 no global interrupt has occurred. 1 this ?ag indicates that at least one new entry in the circular interrupt table has been generated by the qmc. the host clears gint by writing a 1 to its location in scce. after clearing it, the host reads the next entry from the circular interrupt table, and starts processing a speci?c channels exception. the user must make sure that no more valid interrupts are pending in the interrupt table after clearing the gint bit, before performing the rte to avoid deadlock. this procedure ensures that no pending interrupts exist in the queue. 6 gun global transmitter underrun 0 no global transmitter underrun has occurred. 1 this ?ag indicates that an underrun occurred in the sccs transmitter fifo. this error is fatal since it is unknown which channel(s) are affected. following the assertion of the gun bit in the scce, the qmc stops transmitting data on all channels. the tdm tx line goes into idle mode. this error affects only the transmitter; the receiver continues to work. after initializing all the individual channels, the host may resume transmitting. if enabled in the sccm, an interrupt request is generated when gun is set. the host may clear gun by writing 1 to its location in the scce. 7 gov global receiver overrun 0 no global receiver overrun has occurred. 1 this ?ag indicates that an overrun occurred in the sccs transmitter fifo. this error is fatal since it is unknown which channel(s) are affected. following the assertion of the gov bit in the scce, the qmc stops receiving data on all channels. data is no longer written to memory. this error affects only the receiver; the transmitter continues to work. after initializing all the individual channels, the host may resume receiving. if enabled in sccm, an interrupt request is generated when gov is set. the host may clear gov by writing 1 to its location in the scce. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . chapter 4. qmc exceptions note : for the 68360, the bit numbering is reversed. see appendix a for more information. figure 4-3. sccm register 4.3 interrupt table entry the interrupt table contains information about channel-speci?c events. its ?ags are shown in figure 4-4. note that some bits have no meaning when operating in transparent mode. for more detailed description on which bits are used in hdlc and transparent operation, refer to section 2.4, channel-speci?c parameters. table 4-2 describes the ?elds of an interrupt table entry. note : for the 68360, the bit numbering is reversed. see appendix a for more information. figure 4-4. interrupt table entry 01234567 iqov gint gun gov 0 123456789101112131415 v w nid idl channel number mrf un rxf bsy txb rxb reset: 0 0000000 00000000 table 4-2. interrupt table entry field descriptions field name description 0 v valid bit 0 = entry is not valid. 1 = valid entry containing interrupt information. upon generating a new entry, the risc processor sets this bit. the v bit is cleared by the host immediately after it reads the interrupt ?ags in this entry (before processing the interrupt). the v bits in the queue are host-initialized. during the initialization procedure, the host must clear those bits in all queue entries. 1 w wrap bit 0 = this is not the last entry in the circular interrupt table. 1 = this is the last circular interrupt table entry. the next events entry is written/read (by risc/ host) from the address contained in intbase. during initialization, the host must clear all w bits in the queue except the last one which must be set. the length of the queue is left to the user and can be a maximum of 64 kbytes. 2 nid not idle 0 = no nid event has occurred. 1 = a pattern which is not an idle pattern was identi?ed. nid interrupts are not generated in transparent mode. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement 3 idl idle 0 = no idl event has occurred. 1 = the channels receiver has identi?ed the ?rst occurrence of hdlc idle (fffe) after any non-idle pattern. idl interrupts are not generated in transparent mode. 4 reserved 5C9 channel number this 5-bit ?eld identi?es the requesting logical channel index (0C31). 10 mrf maximum receive frame length violationthis interrupt occurs in hdlc mode when more than mflr number bytes are received. as soon as mflr is exceeded, this interrupt is generated and the remainder of the frame is discarded. at this point the receive buffer is not closed and the reception process continues. the receive buffer is closed upon detecting a ?ag. the length ?eld written to this buffer descriptor is the entire number of bytes received between the two ?ags. mrf interrupts are not generated in transparent mode. note : the mrf interrupt is generated directly when the mflr value is a multiple of 4 bytes. the checking of this is done on a long-word boundary whenever the sdma transfers 32 bits to memory. if mflr is not aligned to 4x bytes, this interrupt may be 1- to 3-byte timings late for this channel. in any case, the violation can be checked to any number of bytes. the last entry in the data buffer is always a full long word. 11 un tx no data 0 = no un event has occurred. 1 = there is no valid data to send to the transmitter. the transmitter sends an abort indication consisting of 16 consecutive 1s and then sends idles or ?ags according to the protocol and the channel mode register setting. this error occurs when a transmit channel has no data buffer ready for a multibuffer transmission already in progress. transmission of a frame is a continuous bitstream without gaps or interruption. when a buffer is not ready in the middle of this sequence, it is an error situation. this can be viewed as channel underrun. the transmitter for this channel is stopped. see section 6.3, restarting the transmitter, for recovery information. 12 rxf rx frame 0 = no rxf event has occurred. 1 = a complete hdlc frame is received. data is stored in external memory and the buffer descriptor is updated. if during frame reception an abort sequence of at least seven 1s is detected, the buffer is closed and both rxb and rxf are reported along with the ab in the buffer descriptor. as a result of end-of-frame, the global frame counter grfcnt is decremented for interrupt generation. this counter is decremented on rxf only, regardless if the rxf was caused by correct closing or due to an error. rxf interrupts are not generated in transparent mode. 13 bsy busy 0 = no bsy event has occurred. 1 = a frame was received but was discarded due to lack of buffers. this can be viewed as channel overrun. after a busy condition, the receiver for this channel is disabled and no more data is transferred to memory. receiver restart is described in section 6.4, restarting the receiver. table 4-2. interrupt table entry field descriptions (continued) field name description f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement 4.4 channel interrupt processing flow figure 4-5 illustrates the ?ow of a channel interrupt. note that this does not describe the processing of the global interrupts gun and gov. 14 txb tx buffer 0 = no txb event has occurred. 1 = a buffer has been completely transmitted. this bit is set (and an interrupt request is generated) as soon as the programmed number of pad characters (or the closing ?ag, for pad = 0) is written to the sccs transmit fifo. the number of pad characters determines the timing of the txb interrupt in relation to the closing ?ag sent out at txd. see chapter 5, buffer descriptors, for an explanation of pad characters and their use. 15 rxb rx buffer 0 = no rxb event has occurred. 1 = a buffer has been received on this channel. table 4-2. interrupt table entry field descriptions (continued) field name description f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement figure 4-5. channel interrupt flow start interrupt occurs = 0 ? set sccex.iqov n y make new entry including v =1; increment intptr end set sccex.gint n end y rxf event ? decrement grfcnt grfcnt = 0? y n interrupt masked in intmsk? end y intptr->citentry.v f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . chapter 5. buffer descriptors chapter 5 buffer descriptors 50 50 qmc buffer descriptors are located within 64 kbytes in external memory; see figure 2-2. each buffer descriptor contains key information about the buffer it de?nes. the ?rst two sections describe the contents of the receive and transmit buffer descriptors for the qmc protocol. the third section discusses the placement of qmc and non-qmc buffer descriptors in internal and external memory. 5.1 receive buffer descriptor figure 5-1 shows a receive buffer descriptor. notes : for the 68360, the bit numbering is reversed. see appendix a for more information. entries in boldface must be initialized by the user. figure 5-1. receive buffer descriptor (rxbd) table 5-1 describes the individual ?elds of a receive buffer descriptor. boldfaced entries must be initialized by the user. 0123456789101112131415 offset + 0 e wi lf cm ub lg no ab cr offset + 2 data length offset + 4 rx data buffer pointer offset + 6 table 5-1. receive buffer descriptor (rxbd) field descriptions field name description 0 e empty 0 the data buffer associated with this buffer descriptor has been ?lled with received data, or data reception has been aborted due to an error. the core is free to examine or write to any ?eld of this rxbd. the cpm does not use this buffer descriptor again while the empty bit remains zero. 1 the data buffer associated with this buffer descriptor is empty, or reception is currently in progress. this rxbd and its associated receive buffer are owned by the cpm. if e = 1, the cpu core should not write to any ?eld of this rxbd. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement 1 2 w wrap (?nal buffer descriptor in table) 0 this is not the last buffer descriptor in the rxbd table. 1 this is the last buffer descriptor in the rxbd table. after this buffer is used, the cpm receives incoming data into the ?rst buffer descriptor in the table (the buffer descriptor pointed to by rbase). the number of rxbds in this table is programmable and is determined only by the wrap bit and by the space constraints of the dual-ported ram. 3 i interrupt 0 the rxb bit will not be set after this buffer has been used, but rxf operation remains unaffected. 1 the rxb bit (and/or the rxf bit in hdlc mode) of the interrupt table entry will be set when this buffer has been used by the hdlc controller. these two bits may cause interrupts (if enabled). 4 l last-in-frame (hdlc mode only)the hdlc controller sets l when this buffer is the last in a frame. this implies the receipt of a closing ?ag or reception of an error, in which case one or more of the cd, ov, ab, and lg bits are set. the hdlc controller writes the number of frame octets to the data length ?eld. 0 this buffer is not the last in a frame. 1 this buffer is the last in a frame. 5 f first-in-framethe controller sets this bit when this buffer is the ?rst in a frame. 0 the buffer is not the ?rst in a frame. 1 the buffer is the ?rst in a frame. 6 cm continuous mode 0 normal operation. 1 the empty bit is not cleared by the cpm after this buffer descriptor is closed, allowing the associated data buffer to be overwritten automatically when the cpm next accesses this buffer descriptor. the empty bit is not cleared if an error occurs during reception. the user must terminate continuous mode by clearing this bit. 7 8 ub user bitthe cpm never touches, sets, or clears this user-de?ned bit. the user determines how this bit is used. for example, it can be used to signal between higher level protocols whether a buffer has been processed by the cpu. 9 10 lg rx frame length violation (hdlc mode only)a frame length greater than the maximum value was received in this channel. only the maximum-allowed number of bytes, mflr rounded to the nearest higher longword alignment, are written to the data buffer. this event is recognized as soon as the mflr value is exceeded when data is long-word-aligned. when data is not long- word-aligned, this interrupt occurs when the sdma writes 32 bits to memory. the worst-case latency from mflr violation until detected is 3-byte timings for this channel. when mflr violation is detected, the receiver is still receiving even though the data is discarded. the buffer is closed when a ?ag is detected, and this is considered to be the closing ?ag for this buffer. at this point, lg = 1 and an interrupt may be generated. the length ?eld for this buffer includes everything between the opening ?ag and this last identi?ed ?ag. table 5-1. receive buffer descriptor (rxbd) field descriptions (continued) field name description f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . chapter 5. buffer descriptors figure 5-2 shows how non-octet alignment is reported and how data is stored. the two diagrams on the left show the reception of a single-buffer, 12-byte frame including the crc. in the top case, the reception is correctly octet-aligned and the frame length indicates 12 bytes. 11 no rx non-octet-aligned frame (hdlc mode only)a frame that contained a number of bits not exactly divisible by eight was received. no = 1 for any type of nonalignment regardless of frame length. the shortest frame that can be detected is of type flag-bit-flag. this causes the buffer to be closed with the no error indicated. figure 5-2 shows how the non-octet alignment is reported and where data can be found. 12 ab rx abort sequencea minimum of seven consecutive ones was received during frame reception. abort is not detected between frames. the sequence ...closing-?ag, data, crc, ?ag, ab, ?ag, data, opening-?ag... does not cause an abort error. if the abort is long enough to be an idle, an idle line interrupt may be generated. an abort within the frame is not reported by a unique interrupt but rather with an rxf interrupt; the user has to examine the buffer descriptor. 13 cr rx crc errorthis frame contains a crc error. the received crc bytes are always written to the receive buffer. 14C15 16C31 dl data lengththe number of octets written by the cpm into this buffer descriptors data buffer. it is written by the cpm once when the buffer descriptor is closed. when this buffer descriptor is the last buffer descriptor of a frame (l = 1), the data length equals the total number of octets in the frame (including the two- or four-byte crc). note: the amount of memory allocated for this buffer should be greater than or equal to the contents of the maximum receive buffer length register (mrblr + 4). 32C63 rxbp rx buffer pointerthe receive buffer pointer, which always points to the ?rst location of the associated data buffer, may reside in either internal or external memory. the rx buffer pointer must be divisible by 4. table 5-1. receive buffer descriptor (rxbd) field descriptions (continued) field name description f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement figure 5-2. nonoctet alignment data in the bottom case, two more bits are received. the frame length is now 13 bytes, and the address positions x13 through x15 point to invalid data. address position x12 contains information about the non-octet alignment. valid information is written starting at the msb position, shown as x in the diagram. starting from the lsb position, zeros are ?lled in followed by a 1 immediately preceding the valid data. the two diagrams on the right show how the data and the extra information is stored for a frame length that is not a multiple of 4 bytes. the additional information is always on a long-word boundary. in the top case the frame length is 10 bytes and in the bottom case the length is 11 bytes. for a minimum frame consisting of ?ag, 1 bit, ?ag the frame length is 1. the only valid entry is at address xx0 with content of x1000000. to accommodate the extra long word that may be written at the end of a frame, it is recommended to reserve mrblr + 4 bytes for each buffer area. address xx0 address xx4 address xx8 address x12 1234 5678 9 101112 xtra 0 0 0 xx1 0 0 0 0 0 address xx0 address xx4 address xx8 address x12 1234 5678 910 xtra 0 0 0 xx1 0 0 0 0 0 address xx0 address xx4 address xx8 address x12 1234 5678 910 address xx0 address xx4 address xx8 address x12 1234 5678 9 101112 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . chapter 5. buffer descriptors 5.2 transmit buffer descriptor figure 5-3 shows the transmit buffer descriptor. notes : entries in boldface must be initialized by the user. for the 68360, the bit numbering is reversed. see appendix a for more information. figure 5-3. transmit buffer descriptor (txbd) table 5-2 describes the individual ?elds of a transmit buffer descriptor. boldfaced entries must be initialized by the user. 0123456789101112131415 offset + 0 r wi ltccmub pad offset + 2 data length offset + 4 tx data buffer pointer offset + 6 table 5-2. transmit buffer descriptor (txbd) field descriptions field name description 0 r ready 0 the data buffer associated with this buffer descriptor is not ready for transmission. the user can manipulate this buffer descriptor or its associated data buffer. the cpm clears this bit after the buffer has been transmitted or after an error condition is encountered. 1 the data buffer, which has been prepared for transmission by the user, has not been transmitted or is being transmitted. if r = 1, the user cannot write to ?elds of this buffer descriptor. 1 2 w wrap (?nal buffer descriptor in table) 0 this is not the last buffer descriptor in the txbd table. 1 this is the last descriptor in the tx buffer descriptor table. after this buffer is used, the cpm transmits data from the ?rst buffer descriptor in the table (the buffer descriptor pointed to by tbase). the number of txbds in this table is programmable and is determined only by the wrap bit and the overall space constraints of the dual-ported ram. 3 i interrupt 0 no interrupt is generated after this buffer has been serviced. 1 txb in the circular interrupt table entry is set when the controller services this buffer. this bit can cause an interrupt (if enabled). 4 l last 0 this is not the last buffer in the frame. 1 this is the last buffer in the current frame. 5 tc tx crc (hdlc mode only). this bit is valid only when l = 1; otherwise, it is ignored. 0 transmit the closing ?ag after the last data byte. this setting can be used for testing purposes to send an erroneous crc after the data. 1 transmit the crc sequence after the last data byte. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement figure 5-4 shows a txb interrupt generated after (pad + 1) ?ag characters following the closing ?ag. four ?ags (nof = 3) precede the next data. to set up this sequence correctly, the pad value must not exceed nof. figure 5-4. relation between pad and nof 6 cm continuous mode 0 normal operation. 1 the r bit is not cleared by the cpm after this buffer descriptor is closed, allowing the associated data buffer to be retransmitted automatically when the cpm next accesses this buffer descriptor. 7 8 ub user bitthe cpm never touches, sets, or clears this user-de?ned bit. the user determines how this bit is used. for example, it can be used to signal between higher-level protocols whether a buffer has been processed by the cpu. 9C11 12C15 pa d padding bitsthese four bits indicate the number of pad characters (0x7e or 0xff depending on idlm mode in the chamr register) that the transmitter sends after the closing ?ag. the transmitter issues a txb interrupt only after sending the programmed value of pads to the tx fifo. the user can use the pad value to guarantee that a txb interrupt occurs after the closing ?ag has been sent on the txd line. pad = 0 means the txb interrupt is issued immediately after sending the closing ?ag to the tx fifo. the number of pad characters depends on the fifo size and the number of time slots in use. an example explains the calculation: in scc1 the fifo is 32 bytes. if 16 time slots are used in the link, the resulting number of pad characters is 32/16 = 2, to append to this buffer to ensure that the txb interrupt is not given before the closing ?ag has been transmitted through the txd line. the number of pad characters must not exceed the nof characters, ensuring that the closing of one buffer (the interrupt generation) occurs before the start of the next frame (clearing of r-bit). after the sequence of a closing ?ag followed by (pad + 1) ?ag characters, a txb interrupt will be generated; see figure 5-4. 16C31 dl data lengththe data length is the number of bytes the cpm should transmit from this buffer descriptors data buffer. it is never modi?ed by the cpm. this ?eld should be greater than zero. 32C63 txbp tx buffer pointerthe transmit buffer pointer, which contains the address of the associated data buffer, may be even or odd. the buffer may reside in either internal or external memory. this value is never modi?ed by the cpm. table 5-2. transmit buffer descriptor (txbd) field descriptions (continued) field name description data crc flg flg flg flg pad=1, nof=3 data txb interrupt clearing r-bit f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . chapter 5. buffer descriptors 5.3 placement of buffer descriptors the internal dual-ported ram is used to store the buffer descriptors for all non-qmc operation. this solution causes minimum loading of the external bus. when starting any operation or switching between buffers during operations, several accesses must be made by the cpm to ?nd the actual data buffers and to read and write control and status information. this process is unseen by the user for internal accesses, and any external bus master or memory refresh control can occur uninterrupted. 5.3.1 mc68mh360 internal memory structure to support 32 channels on the mc68mh360, the entire 2-kbyte dual-ported ram is needed for channel-speci?c parameters. each logical channel occupies 64 bytes; thus 32 channels require 2 kbytes. no con?icts arise for qmc operation since it uses external memory for the buffer descriptors; however, buffer descriptors for other protocols must be in internal memory. if the qmc uses all 32 channels, no space is left in the lower 2-kbyte area; the only free areas are in the ram pages, each 192-bytes large. depending on the functions, channels and protocols used, some areas remain free for buffer descriptors. if a function is not enabled, its parameter ram area may be used. if fewer than 32 logical channels are used or if physical channels are concatenated to super channels, space is freed in the dual-ported ram. each logical channel creates a 64-byte hole in the dual-ported ram that an scc can use for buffer descriptors. qmc channels can use this area rather than external memory for buffer descriptors, reducing the load on the external bus. if the external 64-kbyte area overlaps the internal dual-ported ram, external and internal buffer descriptors can be combined for the qmc. this is controlled by the show cycles setting. if split buses are used with shen1/shen0 = 00, a memory access is always made to the dual-ported ram if the source is an internal master. for more information, refer to the description of the module con?guration register in the mc68360 quad integrated communications controller users manual . figure 5-5 shows the internal memory map. figure 5-6 shows the scc parameter ram overlap example. figure 5-7 through figure 5-10 give a detailed memory map for each scc, showing parameter ram usage for different functions. ? ram page one is dedicated to scc1 and for miscellaneous storage. ? ram page two is dedicated for scc2, risc timers, and the spi channel. ? ram page three is dedicated for scc3, smc1, and idma1 operations. ? ram page four is dedicated for scc4, smc2, and idma2 operations. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement figure 5-5. mc68mh360 internal memory figure 5-6. scc2 parameter ram overlap example dprbase 2 kbytes scc1 parameter ram scc2 parameter ram scc3 parameter ram scc4 parameter ram 4 kbytes internal registers dual-ported ram dprbase+0x1000 192 bytes 192 bytes 192 bytes 192 bytes dprbase + 0x0d00 dprbase + 0x0e00 dprbase + 0x0f00 dprbase + 0x0c00 dprbase+d00 dprbase+db0 dprbase+dbf dprbase+daf dprbase+d80 dprbase+daf dprbase+da8 dprbase+da7 dprbase+da4 dprbase+da3 timer registers ethernet registers spi registers area of overlap f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . chapter 5. buffer descriptors note the gaps shown between ram pages are not implemented on the mc68360mh and cannot be addressed. table 5-3 shows functions available for various protocols on each scc for the mc68360. figure 5-7 to figure 5-10 show that not all the functions available to each scc can be used simultaneously due to overlaps of the register locations stored in the parameter ram. for example, in figure 5-8, the spi area overlaps the ethernet area, which means the user can use either spi or ethernet on scc2, but not both at once. 5.3.2 parameter ram usage for qmc over several sccs there are two possible memory con?gurations for operating the qmc protocol on several sccs. for each scc in qmc protocol, a global parameter area is used, consuming at most 170 bytes if every global area contains the routing tables. the time slot assignment tables (tsatrx and tsattx) together occupy 128 bytes. the tables for each scc in the parameter ram can be duplicated, requiring 170 bytes per scc. alternatively, multiple sccs can use one set of common time slot assignment tables (tsatrx and tsattx), as described in section 2.1.3, tsatrx/tsattx pointers and time slot assignment table. one scc ram page uses 172 bytes, 44 bytes for registers and 128 bytes for the common time slot assignment tables, allowing the other sccs to use only 44 bytes of parameter ram for qmc protocol, freeing 128 bytes. this alternative is referred to as qmc on multiple sccs in figure 5-7 to figure 5-15. table 5-3. mc68360 functions available function available? transparent hdlc uart ethernet qmc shared qmc scc1 yes misc misc misc misc misc misc no scc2 yes spi, timer spi, timer spi, timer timer timer timer no spi spi spi scc3 yes idma1, smc1 idma1, smc1 idma1, smc1 idma1 no idma1, smc1 idma1, smc1 smc1 scc4 yes idma2, smc2 idma2, smc2 idma2, smc2 idma2 no idma2, smc2 idma2, smc2 smc2 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement figure 5-7. mc68mh360 scc1 parameter ram usage dprbase + c00 dprbase + c00 dprbase+c00 hdlc uart transparent dprbase + cb0 dprbase + cbf dprbase + cb0 dprbase + cbf dprbase + cb0 dprbase + cbf dprbase + c38 dprbase + caf dprbase + c37 transparent regs = 56 bytes free area misc regs = 120 bytes = 16 bytes hdlc regs = 92 bytes free area = 84 bytes misc regs = 16 bytes dprbase + c5c dprbase + c5b uart regs = 102 bytes free area = 74 bytes misc regs = 16 bytes dprbase + c66 dprbase + c65 dprbase + c00 dprbase + c00 dprbase + c00 qmc qmc on ethernet dprbase + cb0 dprbase + cbf dprbase + cb0 dprbase + cbf dprbase + ca4 dprbase + caf dprbase + ca3 ethernet regs = 164 bytes free area misc regs = 12 bytes = 16 bytes qmc regs = 172 bytes free area = 4 bytes misc regs = 16 bytes dprbase + cac dprbase + cab qmc regs = 32 bytes free area = 128 bytes misc regs = 16 bytes dprbase + c20 dprbase + c1f multiple sccs # dprbase + caf dprbase + caf dprbase + caf dprbase + cac dprbase + cab dprbase + ca0 dprbase + c9f dprbase + cb0 dprbase + cbf dprbase + caf qmc regs =12 bytes free area = 4 bytes locations used locations free for scc registers for bd locations used for secondary registers # tsatrx & tsattx are mapped to an alternative sccs parameter ram. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . chapter 5. buffer descriptors figure 5-8. mc68mh360 scc2 parameter ram usage dprbase + d00 dprbase + d00 dprbase + d00 hdlc uart transparent dprbase + db0 dprbase + dbf dprbase + db0 dprbase + dbf dprbase + db0 dprbase + dbf dprbase + d38 dprbase + daf dprbase + d37 transparent regs = 56 bytes free area timer regs = 72bytes = 16 bytes hdlc regs = 92 bytes free area = 36bytes timer regs = 16 bytes dprbase + d5c dprbase + d5b uart regs = 102 bytes free area = 26bytes timer regs = 16 bytes dprbase + d66 dprbase + d65 dprbase + d00 dprbase + d00 dprbase + d00 qmc * qmc on ethernet * dprbase + db0 dprbase + dbf dprbase + db0 dprbase + dbf dprbase + da4 dprbase + daf dprbase + da3 ethernet regs = 164 bytes free area timer regs = 12 bytes = 16 bytes qmc regs = 172 bytes free area = 4 bytes timer regs = 16 bytes dprbase + dac dprbase + dab qmc regs = 32 bytes free area = 128 bytes timer regs = 16 bytes dprbase + d20 dprbase + d1f multiple sccs *# dprbase + daf dprbase + daf dprbase + daf dprbase + dac dprbase + dab dprbase + da0 dprbase + d9f dprbase + db0 dprbase + dbf dprbase + daf qmc regs =12 bytes free area = 4 bytes locations used locations free for scc registers for bd locations used for secondary registers spi regs = 40bytes dprbase + d80 dprbase + daf dprbase + da8 dprbase + da7 free area = 8 bytes spi regs = 40bytes dprbase + d80 dprbase + daf dprbase + da8 dprbase + da7 free area = 8 bytes spi regs = 40bytes dprbase + d80 dprbase + daf dprbase + da8 dprbase + da7 free area = 8 bytes *spi not available in these configurations due to memory conflict. #tsatrx & tsattx are mapped to an alternative sccs parameter ram. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement figure 5-9. mc68mh360 scc3 parameter ram usage dprbase+e00 dprbase+e00 dprbase+e00 hdlc uart transparent dprbase+ebf dprbase+e38 dprbase+e37 transparent regs = 56 bytes free area = 56 bytes hdlc regs = 92 bytes dprbase+e5c dprbase+e5b uart regs = 102 bytes dprbase+e00 dprbase+e00 dprbase+e00 qmc * qmc on ethernet * dprbase+ebf dprbase+ebf dprbase+ea4 dprbase+ea3 ethernet regs = 164 bytes free area = 28 bytes qmc regs = 172 bytes free area = 20bytes dprbase+eac dprbase+eab qmc regs = 32 bytes free area =80 bytes dprbase+e20 dprbase+e1f multiple sccs # dprbase+eac dprbase+eab dprbase+ea0 dprbase+e9f dprbase+ebf qmc regs =12 bytes free area = 20bytes locations used locations free for scc registers for bd locations used for secondary registers smc1 regs = 56 bytes dprbase+e80 dprbase+e7f dprbase+eb8 dprbase+eb7 free area = 8 bytes # - tsatrx & tsattx are mapped to an alternative sccs parameter ram, * - smc1 and idma1 not available in these configurations due to memory conflict. dprbase+e70 dprbase+e6f idma1 regs = 12 bytes dprbase+e7c dprbase+e7b free area = 4bytes dprbase+ebf free area = 20bytes smc1 regs = 56 bytes dprbase+e80 dprbase+e7f dprbase+eb8 dprbase+eb7 free area = 8 bytes dprbase+e70 dprbase+e6f idma1 regs = 12 bytes dprbase+e7c dprbase+e7b free area = 4bytes dprbase+ebf free area = 10bytes smc1 regs = 56 bytes dprbase+e80 dprbase+e7f dprbase+eb8 dprbase+eb7 free area = 8 bytes dprbase+e70 dprbase+e6f idma regs = 12 bytes dprbase+e7c dprbase+e7b free area = 4bytes dprbase+e66 dprbase+e65 free area = 36 bytes idma1 regs = 12 bytes dprbase+e70 dprbase+e6f dprbase+e7c dprbase+e7b smc1 is not available in this configuration due to memory conflict. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . chapter 5. buffer descriptors figure 5-10. mc68mh360 scc4 parameter ram usage dprbase + f00 dprbase + f00 dprbase+f00 hdlc uart transparent dprbase + fbf dprbase + f38 dprbase + f37 transparent regs = 56 bytes free area = 56 bytes hdlc regs = 92 bytes dprbase + f5c dprbase + f5b uart regs = 102 bytes dprbase + f00 dprbase + f00 dprbase + f00 qmc * qmc on ethernet * dprbase + fbf dprbase + fbf dprbase + fa4 dprbase + fa3 ethernet regs = 164 bytes free area = 28 bytes qmc regs = 172 bytes free area = 20bytes dprbase + fac dprbase + fab qmc regs = 32 bytes free area =80 bytes dprbase + f20 dprbase + f1f multiple sccs # dprbase + fac dprbase + fab dprbase + fa0 dprbase + f9f dprbase + fbf qmc regs =12 bytes free area = 20bytes locations used locations free for scc registers for bd locations used for secondary registers smc2 regs = 56 bytes dprbase + f80 dprbase + f7f dprbase + fb8 dprbase + fb7 free area = 8 bytes #tsatrx & tsattx are mapped to an alternative sccs parameter ram, *smc2 and idma2 are not available in these configurations due to memory conflict. dprbase + f70 dprbase + f6f idma2regs = 12 bytes dprbase + f7c dprbase + f7b free area = 4bytes dprbase + fbf free area = 20bytes smc2 regs = 56 bytes dprbase + f80 dprbase + f7f dprbase + fb8 dprbase + fb7 free area = 8 bytes dprbase + f70 dprbase + f6f idma2 regs = 12 bytes dprbase + f7c dprbase + f7b free area = 4bytes dprbase + fbf free area = 10bytes smc2 regs = 56 bytes dprbase + f80 dprbase + f7f dprbase + fb8 dprbase + fb7 free area = 8 bytes dprbase + f70 dprbase + f6f idma2 regs = 12 bytes dprbase + f7c dprbase + f7b free area = 4bytes dprbase + f66 dprbase + f65 free area = 36 bytes idma2 regs = 12 bytes dprbase + f70 dprbase + f6f dprbase + f7c dprbase + f7b smc2 is not available in this configuration due to memory conflict. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement 5.3.3 mpc860mh internal memory structure figure 5-11 shows the internal memory structure of the mpc860mh. to support 32 channels on the mp860, only 2-kbyte dual-ported ram is needed for channel-speci?c parameters. each logical channel occupies 64 bytes; thus 32 channels require 2 kbytes, leaving 2 kbytes free in the dual-ported ram for buffer descriptors for other protocols. to support 64 channels on the mpc860, 4-kbyte dual-ported ram is required for channel- speci?c parameters. each logical channel occupies 64 bytes, requiring 4 kbytes for 64 channels. non-qmc protocol implementations may be constrained by these memory requirements since their buffer descriptors need to use internal memory space. figure 5-11. mpc860mh internal memory 4 kbytes internal registers 4 kbytes dual-ported ram immr immr + 0x2000 parameter ram immr + 0x3c00 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . chapter 5. buffer descriptors if the qmc operates with a full 64 channels, no space is left in the lower 4-kbyte area. in this case, the only free areas are in the ram pages, each 256-bytes large. depending on the functions, channels and protocols used, some areas remain free for buffer descriptors. also, if a particular function is not enabled, its parameter ram area may also be used. if fewer than 64 logical channels are used or if physical channels are concatenated to super channels, space is freed in the dual-ported ram. each unused logical channel creates a 64- byte hole in the dual-ported ram. this area is free for buffer descriptors for any scc. qmc channels can also use this space instead of external memory for buffer descriptors, reducing the load on the external bus. figure 5-11 shows the internal memory map for the mpc860mh. figure 5-12 to figure 5-15 show a more detailed memory map for each scc, showing the parameter ram usage for different functions. ? ram page one is dedicated to scc1, i 2 c, idma1 and for miscellaneous storage. ? ram page two is dedicated for scc2, spi, idma2 and risc timers ? ram page three is dedicated for scc3, smc1 and dsp1 operations. ? ram page four is dedicated for scc4, smc2 and dsp2 operations. table 5-4 shows the functions available for various protocols on each scc for the mpc860mh. figure 5-12 to figure 5-15 show that not all the functions available on each scc can be used simultaneously due to overlaps of the register locations stored in the parameter ram. table 5-4. mpc860mh functions available function available? transparent hdlc uart ethernet qmc shared qmc scc1 yes misc, i 2 c, idma1 misc, i 2 c, idma1 misc, i 2 c, idma1 misc, idma1 misc, idma1 misc, idma1 no i 2 ci 2 ci 2 c scc2 yes spi, timer, idma2 spi, timer, idma2 spi, timer, idma2 timer, idma2 timer, idma2 timer, idma2 no spi spi spi scc3 yes smc1, dsp1 smc1, dsp1 smc1, dsp1 dsp1 dsp1 dsp1 no smc1 smc1 smc1 scc4 yes smc2, dsp2 smc2, dsp2 smc2, dsp2 dsp2 dsp2 dsp2 no smc2 smc2 smc2 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement figure 5-12. mpc860mh scc1 parameter ram usage immr + 3c00 hdlc uart transparent immr + 3c38 immr + 3c37 transparent regs = 56 bytes idma1 regs = 64bytes hdlc regs = 92 bytes uart regs = 102 bytes immr + 3c00 immr + 3c00 qmc * qmc on ethernet * ethernet regs = 164 bytes qmc regs = 172 bytes free area = 4 bytes qmc regs = 32 bytes free area = 128 bytes immr + 3c20 immr + 3c1f multiple sccs *# qmc regs =12 bytes locations used locations free for scc registers for bd locations used for secondary registers #tsatrx & tsattx are mapped to an alternative sccs parameter ram. immr + 3c80 immr + 3c7f free area = 72bytes i 2 c regs = 48bytes immr + 3cb0 immr + 3caf misc regs = 16 bytes immr + 3cc0 immr +3cbf immr + 3cff immr+3c00 immr + 3c5c immr + 3c5b immr + 3c80 immr + 3c7f immr + 3cb0 immr + 3caf immr + 3cc0 immr + 3cbf immr + 3cff idma1 regs = 64bytes free area = 36 bytes i 2 c regs = 48bytes misc regs = 16 bytes immr + 3c80 immr + 3c7f immr + 3cb0 immr + 3caf immr + 3cc0 immr + 3cbf immr + 3cff idma1 regs = 64bytes i 2 c regs = 48bytes misc regs = 16 bytes immr + 3c66 immr + 3c65 free area = 26 bytes immr+3c00 immr + 3c00 immr + 3cb0 immr + 3caf immr + 3cc0 immr + 3cbf immr + 3cff idma1 regs = 64bytes misc regs = 16 bytes immr + 3ca4 immr + 3ca3 free area = 12bytes immr + 3cb0 immr + 3caf immr + 3cc0 immr + 3cbf immr + 3cff idma1 regs = 64bytes misc regs = 16 bytes immr + 3cac immr + 3cab immr + 3ca0 immr + 3c9f free area = 4 bytes immr + 3cb0 immr + 3caf immr + 3cc0 immr + 3cbf immr + 3cff idma1 regs = 64bytes misc regs = 16 bytes immr + 3cac immr + 3cab *i 2 c is not available in these configurations due to memory conflict. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . chapter 5. buffer descriptors figure 5-13. mpc860mh scc2 parameter ram usage immr + 3d00 hdlc uart transparent immr + 3d38 immr + 3d37 transparent regs = 56 bytes idma2 regs = 64bytes hdlc regs = 92 bytes uart regs = 102 bytes immr + 3d00 immr + 3d00 qmc * qmc on ethernet * ethernet regs = 164 bytes qmc regs = 172 bytes free area = 4 bytes qmc regs = 32 bytes free area = 128 bytes immr + 3d20 immr + 3d1f multiple sccs *# qmc regs =12 bytes locations used locations free for scc registers for bd locations used for secondary registers #tsatrx & tsattx are mapped to an alternative sccs parameter ram. immr + 3d80 immr + 3d7f free area = 72bytes spi regs = 48bytes immr + 3db0 immr + 3daf timers regs = 16 bytes immr + 3dc0 immr + 3dbf immr + 3dff immr + 3d00 immr + 3d5c immr + 3d5b free area = 36 bytes immr + 3d66 immr + 3d65 free area = 26 bytes immr + 3d00 immr + 3d00 immr + 3db0 immr + 3daf immr + 3dc0 immr + 3dbf immr + 3dff immr + 3da4 immr + 3da3 free area = 12bytes immr + 3db0 immr + 3daf immr + 3dc0 immr + 3dbf immr + 3dff immr + 3dac immr + 3dab immr + 3da0 immr + 3d9f free area = 4 bytes immr + 3db0 immr + 3daf immr + 3dc0 immr + 3dbf immr + 3dff immr + 3dac immr + 3dab *spi is not available in these configurations due to memory conflict. immr + 3d80 immr + 3d7f immr + 3db0 immr + 3daf immr + 3dc0 immr + 3dbf immr + 3dff idma2 regs = 64bytes spi regs = 48bytes timers regs = 16 bytes immr + 3d80 immr + 3d7f immr + 3db0 immr + 3daf immr + 3dc0 immr + 3dbf immr + 3dff idma2 regs = 64bytes spi regs = 48bytes timers regs = 16 bytes idma2 regs = 64bytes timers regs = 16 bytes idma2 regs = 64bytes timers regs = 16 bytes idma2 regs = 64bytes timers regs = 16 bytes f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement figure 5-14. mpc860mh scc3 parameter ram usage immr + 3e00 hdlc uart transparent immr + 3e38 immr + 3e37 transparent regs = 56 bytes dsp1 regs = 64bytes hdlc regs = 92 bytes uart regs = 102 bytes immr + 3e00 immr + 3e00 qmc * qmc on ethernet * ethernet regs = 164 bytes qmc regs = 172 bytes free area = 20bytes qmc regs = 32 bytes free area = 128 bytes immr + 3e20 immr + 3e1f multiple sccs *# qmc regs =12 bytes locations used locations free for scc registers for bd locations used for secondary registers #tsatrx & tsattx are mapped to an alternative sccs parameter ram. immr + 3e80 immr + 3e7f free area = 72bytes smc1 regs = 56 bytes immr + 3eb8 immr + 3eb7 immr + 3ec0 immr + 3ebf immr + 3eff immr + 3e00 immr + 3e5c immr + 3e5b free area = 36 bytes immr + 3e66 immr + 3e65 free area = 26 bytes immr + 3e00 immr + 3e00 immr + 3ea4 immr + 3ea3 free area = 28 bytes immr + 3eac immr + 3eab immr + 3ea0 immr + 3e9f free area = 20bytes immr + 3eac immr + 3eab *smc1 is not available in these configurations due to memory conflict. free area = 8 bytes dsp1 regs = 64bytes immr + 3e80 immr + 3e7f smc1 regs = 56 bytes immr + 3eb8 immr + 3eb7 immr + 3ec0 immr + 3ebf immr + 3eff free area = 8 bytes dsp1 regs = 64bytes immr + 3e80 immr + 3e7f smc1 regs = 56 bytes immr + 3eb8 immr + 3eb7 immr + 3ec0 immr + 3ebf immr + 3eff free area = 8 bytes dsp1 regs = 64bytes immr + 3ec0 immr + 3ebf immr + 3eff dsp1 regs = 64bytes immr + 3ec0 immr + 3ebf immr + 3eff dsp1 regs = 64bytes immr + 3ec0 immr + 3ebf immr + 3eff f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . chapter 5. buffer descriptors figure 5-15. mpc860mh scc4 parameter ram usage immr + 3f00 hdlc uart transparent immr + 3f38 immr + 3f37 transparent regs = 56 bytes dsp2 regs = 64bytes hdlc regs = 92 bytes uart regs = 102 bytes immr + 3f00 immr + 3f00 qmc * qmc on ethernet * ethernet regs = 164 bytes qmc regs = 172 bytes free area = 20bytes qmc regs = 32 bytes free area = 128 bytes immr + 3f20 immr + 3f1f multiple sccs *# qmc regs =12 bytes locations used locations free for scc registers for bd locations used for secondary registers #tsatrx & tsattx are mapped to an alternative sccs parameter ram. immr + 3f80 immr + 3f7f free area = 72bytes smc2 regs = 56 bytes immr + 3fb8 immr + 3fb7 immr + 3fc0 immr + 3fbf immr + 3fff immr + 3f00 immr + 3f5c immr + 3f5b free area = 36 bytes immr + 3f66 immr + 3f65 free area = 26 bytes immr + 3f00 immr + 3f00 immr + 3fa4 immr + 3fa3 free area = 28 bytes immr + 3fac immr + 3fab immr + 3fa0 immr + 3f9f free area = 20bytes immr + 3fac immr + 3fab * smc2 is not available in these configurations due to memory conflict. free area = 8 bytes dsp2 regs = 64bytes immr + 3f80 immr + 3f7f smc2 regs = 56 bytes immr + 3fb8 immr + 3fb7 immr + 3fc0 immr + 3fbf immr + 3fff free area = 8 bytes dsp2 regs = 64bytes immr + 3f80 immr + 3f7f smc2 regs = 56 bytes immr + 3fb8 immr + 3fb7 immr + 3fc0 immr + 3ebf immr + 3fff free area = 8 bytes dsp2 regs = 64bytes immr + 3fc0 immr + 3fbf immr + 3fff dsp2 regs = 64bytes immr + 3fc0 immr + 3fbf immr + 3fff dsp2 regs = 64bytes immr + 3fc0 immr + 3fbf immr + 3fff f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement 5.3.4 mc68mh360 con?gured for qmc and ethernet certain dif?culties may arise when qmc and ethernet are used together. in a 25-mhz system, ethernet can work together with 16 qmc channels. in this case, a careful use of logical channels can free a 1-kbyte space in the parameter area for up to 128 buffer descriptors. for more information, see section 5.3.2, parameter ram usage for qmc over several sccs. for 32-channel qmc operation coupled with ethernet, a 33-mhz part is required. in addition, ethernet must operate on scc1, and the qmc protocol must be divided over scc3 and scc4 to use the combined fifo size. this leaves scc4s parameter ram page unused as the largest single open space for the scc1 ethernet, resulting in 24 buffer descriptors for transmission and reception in a single block. see chapter 2, qmc memory organization, for more information. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . chapter 6. qmc initialization chapter 6 qmc initialization 60 60 this section describes the essential steps to initialize qmc after a hard reset. section 6.1, initialization steps, discusses the steps required to initialize the qmc protocol, and section 6.2, 68mh360 t1 example, provides example code. 6.1 initialization steps this section describes the steps required to initialize the qmc protocol. step 1 : initialize the simode (serial interface mode) register. the simode register is de?ned on page 7-78 of the mc68360 users manual, and page 16-114 of the mpc860 users manual. table 6-1 shows the transmit buffer descriptor ?eld descriptions. table 6-1. transmit buffer descriptor field descriptions name no. of bits description setting smcx 1 connect to tdm or nmsi x smcxcs 3 specify clock source x sdmx 2 normal, echo, or loopback mode 00 rfsdx 2 receive frame sync delay system-speci?c dscx 1 double-speed clock (gci) system-speci?c crtx 1 common transmit and receive sync & clk system-speci?c stzx 1 set l1txdx to until serial clks 0 cex 1 clock edge for xmit system-speci?c fex 1 frame sync edge system-speci?c gmx 1 grant mode support 0 tfsdx 2 transmit frame sync delay system-speci?c f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement since the simode register defaults to 0x0000_0000, a typical application may set these bits as follows: simode.crta = 1; /* common syncs & clocks */ simode.rfsda = 1; /* receive frame sync = 1 clock delay */ simode.tfsda = 1; /* transmit frame sync = 1 clock delay */ step 2 : initialize the sicr (si clock route) register. the sicr register is de?ned on page 7-86 of the mc68360 users manual and page 16-121 of the mpc860 users manual. table 6-2 shows the sicr bit settings. as the sicr register defaults to 0x0000_0000, a typical application may set these bits as follows: sicr.sc1 = 1; /* scc1 is tdm */ step 3 : con?gure port a for tdma and/or tdmb signals, l1txdx, l1rxdx, l1tclkx, and l1rclkx. for more information on port a, see page 7-358 of the mc68360 users manual and page 16-455 of the mpc860 users manual. the following setting enables tdma and tdmb, and selects both l1tclkx and l1rclkx pins. note that only l1rclkx is required if common clocking is selected by the crtx bit in the simode register. papar = 0xa5f0; /* init port a pin assignment register */ padir = 0x00f0; /* init port a data direction register */ step 4 : con?gure port b for tdma and/or tdmb signals, l1clkox and l1st1, 2, 3, and/ or 4. for more information on port b, see page 7-363 of the mc68360 users manual and page 16-460 of the mpc860 users manual. the following setting enables both l1clkox and all l1stx strobes. note that the l1stx functions are repeated on port c and should only be con?gured on one port. pbpar = 0xfc00; /* init port b pin assignment register */ pbdir = 0x0c00; /* init port b data direction register */ table 6-2. sicr bit settings name no. of bits description setting grx 1 support sccx grant mode 0 scx 1 connect sccx to tdm or nmsi 1 rxcsx 3 connect sccx receive to a clock x - as scx = 1 txcsx 3 connect sccx transmit to a clock x - as scx = 1 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . chapter 6. qmc initialization step 5 : con?gure port c for tdma and/or tdmb signals l1st1, 2, 3, and/or 4; l1tsyncx and/or l1rsyncx. for more information on port c, see page 7-365 of the mc68360 users manual and page 16-465 of the mpc860 users manual. the following setting enables l1rsyncx, l1tsyncx, and all l1stx strobes. note that if common clocking is used, selected by the crtx bit in the si mode register, only l1rsyncx is required. note that the l1stx functions are repeated on port b and should only be con?gured on one port. pcpar = 0x0f0f; /* init port c pin assignment register */ pcdir = 0x000f; /* init port c data direction register */ step 6 : write the values to the si ram locations that will route the time slots required. for more information on si ram programming, see page 7-72 of the mc68360 users manual and page 16-106 of the mpc860 users manual. the following example con?gures every byte to be transferred to scc1; note that the ?nal entry in both the tx and rx tables has the lst bit set. also, this example for tdma assumes that sigmr[rdm] is set to 0b10 (32 entries for rx and tx). if n is the last entry, the following applies: siram[0] = 0x0042; /* init 1st receive element */ siram[1] = 0x0042; /* init 2nd receive element */ siram[n-1] = 0x0043; /* init nth receive element */ siram[32] = 0x0042; /* init 1st xmit element */ siram[33] = 0x0042; /* init 2nd xmit element */ siram[34] = 0x0042; /* init 3rd xmit element */ siram[32+n] = 0x0043; /* init nth xmit element */ note on the mh360, the si ram is mapped in a continuous 256- byte block from regb + 700->7ff. on the 860mh, it is mapped to a 512-byte block from c00->dff. also on the 860mh, the si ram has 16-bit entries aligned to 32-bit boundaries; therefore, only half of the actual address space is valid (there are 256 valid bytes). f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement step 7 : enable tdm. the tdms are enabled via the si global mode register, sigmr. for more information on sigmr programming, see page 7-77 of the mc68360 users manual and page 16-113 of the mpc860 users manual. see table 6-3 for sigmr bit settings. the following example enables both tdm channels for 32 entries. sigmr = 0x0e; /* enable tdma, tdmb, each 32 entries, no shadow */ note that sigmr[rdm] must be 0b1x if tdmb is used even if tdma is not enabled. step 8 . if shadow ram is used, the si command register (sicmr) is used to alternate between normal and shadow ram routings. for more information on sicmr programming, see page 7-87 of the mc68360 users manual and page 16-122 of the mpc860 users manual. to enable both the rx and tx normal ram area, use the following command: sicmr = 0x00; /* enable rx and tx normal ram */ to enable both the rx and tx shadow ram area, use the following command: sicmr = 0xf0; /* enable rx and tx shadow ram on both tdms */ change this entry dynamically to allow switching between the shadow and normal ram. step 9 . initialize general sccx mode reg high, gsmr_h (see table 6-4). for more information on gsmr programming, see page 7-111 of the mc68360 users manual and page 16-148 of the mpc860 users manual. table 6-3. sigmr bit settings name number of bits description setting enb 1 enable tdmb system-speci?c ena 1 enable tdma system-speci?c rdm 2 ram division mode system-speci?c table 6-4. gsmr_h bit settings name no. of bits description setting ipr 1 infrared rx polarity, only on 860mh x gde 1 glitch detect enable x tcrc 2 transparent crc system-speci?c revd 1 reverse data 0 trx 1 transparent receiver 0 ttx 1 transparent transmitter 0 cdp 1 cd pulse 1 ctsp 1 cts pulse 1 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . chapter 6. qmc initialization a typical setting would be: gsmr_h = 0x0000_0780; /* enable pulse mode and sampling */ step 10 . initialize general sccx mode reg low, gsmr_l (see table 6-5). for more information on gsmr programming, see page 7-111 of the mc68360 users manual and page 16-153 of the mpc860 users manual. cds 1 cd sampling 1 ctss 1 cts sampling 1 tfl 1 transmit fifo length 0 rfw 1 receive fifo width 0 txsy 1 transmitter synchronized to the receiver 0 synl 2 sync length 00b rtsm 1 rts mode 0 rsyn 1 receive synchronization timing 0 table 6-5. gsmr_l bit settings name no. of bits description setting sir 1 infrared encoding, only on 860mh x edge 2 clock edge 00 tci 1 transmit clock invert 0 tsnc 2 transmit sense 00b rinv 1 dpll receive input invert data 0 tinv 1 dpll transmit input invert data 0 tpl 3 tx preamble length 0b000 tpp 2 tx preamble pattern 0b00 tend 1 transmitter frame ending 0 tdcr 2 transmit divide clock rate 00 rdcr 2 receive divide clock rate 00 renc 2 receive decoding 00 tenc 2 transmitter decoding 00 diag 2 diagnostic mode system-speci?c enr 1 enable receive 0 ent 1 enable transmit 0 mode 4 channel protocol mode 0b1010 table 6-4. gsmr_h bit settings (continued) name no. of bits description setting f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement clear the enr and ent bits at the end of the initialization. the mode setting for qmc mode is 0b1010. a typical setting would be: gsmr_l = 0x0000_000a; /* enable qmc */ step 11 . initialize basic global multichannel parameters as follows. see chapter 2, qmc memory organization, for more information. ? mcbase: (multichannel base pointer) is a pointer to a 64-kbyte buffer descriptor table in external memory. for example: scc1.mcbase = 0x1_0000; /* bd base located 0x1_0000 */ ? intbase: (interrupt table base pointer) - points to the interrupt table in external memory. for example: scc1.intbase = 0xf000; /* interrupt table base 0xf000 */ ? mrblr: (maximum receive buffer length) - should be large (> 30) for better performance and should be a multiple of 4 bytes. this is valid for hdlc only. for example: scc1.mrblr = 60; /* set receive buffer length to 60 */ ? grfthr: (global receive frame threshold) - normally set to 1. for example: scc1.grfthr = 1; /* 1 receive frame to interrupt */ ? grfcnt: (global receive frame count) - should be initialized to the same value as grfthr. for example: scc1.grfcnt = 1; /* 1 receive frame to interrupt */ c_mask32:crc constant, 32-bit =0xdebb20e3 scc1.c_mask32 = 0xdebb20e3; /* init 32-bit crc const */ c_mask16:crc constant,16-bit=0xfob8 scc1.c_mask16 = 0xf0b8; /* init 16-bit crc const */ step 12 . copy intbase to intptr (multichannel interrupt pointer). see chapter 4, qmc exceptions, for more information. scc1.intptr = scc1.intbase; /* init intptr */ f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . chapter 6. qmc initialization step 13 . initialize the time slot assignment tables, tsattx and tsatrx. each valid entry should have the v bit set. clear the w bit in all entries except the last entry in the table. the mask bits determine which bits of the time slot are processed by the cpmCnormally set to 0xff to process all 8 bits. the 6-bit cp ?eld holds the most-signi?cant bits of the starting address of the channel-speci?c parameter area. for the mh360, the most-signi?cant bit must be zero. the 6 least-signi?cant bits are always cleared. see section 2.1.3, tsatrx/ tsattx pointers and time slot assignment table, for more information. the following is example pseudocode for tsa table programming: for (x = 0; x < time slots; x++) { scc1.tsatr[x].w = 0; /* not last time slot */ scc1.tsatr[x].cp = x; /* mark channel number */ scc1.tsatr[x].mask0_1 = 3; /* no subchanneling */ scc1.tsatr[x].mask2_7 = 0x3f; /* no subchanneling */ scc1.tsatr[x].v = 1; /* mark time slot valid */ } scc1.tsatr[last].w = 1; /* last time slot wrap */ step 14 . initialize tsat pointers (tx_s_ptr and rx_s_ptr), and the current time slot entry pointers, (rxptr and txptr). initialize both tx_s_ptr and txptr to the ?rst entry of the tsatx. also initialize both rx_s_ptr and rxptr to the ?rst entry of the tsarx. for common rx and tx time slot assignment tables, they all should point to scc base + 20; however, they may be located anywhere within the dual-ported ram. see section 2.1.3, tsatrx/tsattx pointers and time slot assignment table, for more information. the following is an example con?guration: scc1.tx_s_ptr = scc1.mcbase+0x20;/* init pointer to tsattx table */ scc1.txptr = scc1.tx_s_ptr; scc1.rx_s_ptr = scc1.mcbase+0x20;/* init pointer to tsatrx table */ scc1.rxptr = scc1.rx_s_ptr; step 15 . initialize multichannel controller state qmc-state to 0x8000. pdpr->scc1.qmc_state = 0x8000; f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement step 16 . initialize channel-speci?c parameters for hdlc or transparent mode as follows. for more information on hdlc, see section 2.4.1, channel-speci?c hdlc parameters, and for transparent mode, see section 2.4.2, channel-speci?c transparent parameters. repeat for each of the enabled channels. ? tbase: txbd descriptors base address. initialize to location of ?rst txbd = mcbase+tbase. rbase: rxbd descriptors base address. initialize to location of ?rst rxbd = mcbase+rbase. ch[0].rbase = 0; /* locate ch0 rxbds at 0 */ ch[0].tbase = 8; /* locate ch0 txbds at 8 */ ch[1].rbase = 0x10; /* locate ch1 rxbds 0x10 */ ch[1].tbase = 0x18; /* locate ch1 txbds 0x18 */ ch[2].rbase = 0x20; /* locate ch2 rxbds 0x20 */ ch[2].tbase = 0x28; /* locate ch2 txbds 0x28 */ ch[3].rbase = 0x30; /* locate ch3 rxbds 0x30 */ ch[3].tbase = 0x38; /* locate ch3 txbds 0x38 */ copy rbase to rbptr (rx buffer descriptor pointer) and tbase to tbptr (tx buffer descriptor pointer). ch[x].tbptr = ch[x].tbase; ch[x].rbptr = ch[x].rbase; ? tstate: tx internal state. for the mh360, this is typically 0x3800 _ 0000. for the 860mh, this is typically 0x3000 _ 0000. ch[x].tstate = 0x3800_0000; /* setting for mh360 */ ch[x].tstate = 0x3000_0000; /* setting for 860mh */ ? rstate: rx internal state. for the mh360, this is typically 0x3900 _ 0000. for the 860mh, this is typically 0x3100 _ 0000. ch[x].rstate = 0x3900_0000; /* setting for mh360 */ ch[x].rstate = 0x3100_0000; /* setting for 860mh */ ? zistate: zero insertion should be initialized to 0x0000 _ 0100. ch[x].zistate = 0x100; ? zdstate: zero deletion machine state should be initialized to 0x1800 _ 0080 for transparent mode or 0x0000 _ 0080 for hdlc. ch[x].zdstate = 0x80; /* set zdztate for hdlc */ ? intmsk: channels interrupt mask ?ags. bits should be set to enable the corresponding interrupts. ch[x].intmsk = 0xa; f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . chapter 6. qmc initialization ? mflr/mrblr: mflr (hdlc mode)application-dependent. mrblr (transparent mode)must be divisible by 4 and large (>30) for better performance. ch[x].mflr = 60; ? trnsync: transparent synchronization, system-speci?c. step 17 . initialize rxbds. prepare an adequate number of receive buffers at the location addressed by rbase. in the status word, set the e bit, set the i bit if interrupts are required and set the w bit for the last buffer descriptor. the data length is normally cleared, and the buffer pointer is set to a location in external memory. see section 5.1, receive buffer descriptor, for more information. repeat for each enabled channel. step 18 . initialize txbds. prepare an adequate number of transmit buffers at the location addressed by tbase. in the status word, set the r bit, set the i bit if interrupts are required, and set the w bit for the last buffer descriptor. other options are available and may be set or cleared depending on the application. the data length is written with the number of bytes to transmit, and the buffer pointer is set to a location in external memory. see section 5.2, transmit buffer descriptor, for more information. repeat for each enabled channel. step 19 . initialize the circular interrupt table. if interrupts are required, initialize the interrupt table as explained in chapter 4, qmc exceptions. clear the v and w bits, but make sure to set the last entrys w bit. step 20 . initialize the channel mode register chamr (see table 6-6). for more information see section 2.4.1.1, chamrchannel mode register (hdlc), for hdlc mode and section 2.4.2.1, chamrchannel mode register (transparent mode), for transparent mode. table 6-6. chamr bit settings name number of bits description setting mode 1 0transparent; 1hdlc x rd/0 1 transparent only: reverse data x 1/idlm 1 hdlc only: idle mode x ent 1 enable transmit 0 sync 1 transparent only: synchronization x pol 1 enable polling 0 crc 1 hdlc only: crc x nof 4 minimum number of ?ags x f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement note the ent bit is initially cleared, but then must be set when the channel is ready to start transmitting. similarly, the pol bit is initially cleared, but then must be set each time a buffer descriptor is enabled to transmit. example settings are as follows: ch[x].chamr.mode = 1; /* select hdlc */ ch[x].chamr.idlm = 0; /* no idles between frames */ ch[x].chamr.ent = 1; /* enable channel xmit */ ch[x].chamr.crc = 1; /* select 32-bit crc */ ch[x].chamr.nof = 7; /* 7 flags between frames */ ch[x].chamr.pol = 1; /* enable polling by risc */ step 21 . initialize the scce register. from reset, sccex will be zero requiring no initialization. however, if required, it can be cleared by writing a 1 in each of the status bits. see section 4.1, global error events, for more information. scce1 = 0xf; /* clear all interrupts */ step 22 . initialize the mask register, sccmx. any interrupts which are not used should be masked in the sccm register. scc interrupts should be enabled using the cimr register, if required. the cimr register is de?ned on page 7-381 of the mc68360 users manual and page 16-483 of the mpc860 users manual. sccm1 = 0xf; /* enable all interrupts */ cimr.scc1 = 1; /* scc1 interrupts enabled */ step 23 . enable the transmitter (ent bit) and the receiver (enr bit) in the general scc mode register (gsmr). gsmr_l1.enr = 1; /* enable receiver */ gsmr_l1.ent = 1; /* enable transmit */ 6.2 68mh360 t1 example /* this is an example of transmitting and receiving on four */ /* hdlc channels in loopback mode. */ /* equipment : sbc360 evaluation board with quicc32 */ /* (t1mh.c) */ void *const stdout = 0; /* standard output device */ #include chapter 6. qmc initialization struct descs { rxbdq recvbd0; /* receive buffer 0 */ txbdq xmitbd0; /* transmit buffer 0 */ } chbd[4]; /* 4 sets of chan descriptors */ static char *poem[6]; /* poem area */ short linecntr; /* line counter */ struct intrpten { unsigned v:1; /* entry valid bit */ unsigned w:1; /* entry wrap bit */ unsigned nid:1; /* not-an-idle has occurred */ unsigned idl:1; /* an idle has occurred */ unsigned :1; unsigned chnmbr:5; /* channel number */ unsigned mrf:1; /* maximum frame length violation */ unsigned un:1; /* tx underrun */ unsigned rxf:1; /* receive frame */ unsigned bsy:1; /* frame discarded, no buffers */ unsigned txb:1; /* buffer transmitted */ unsigned rxb:1; /* receive buffer closed */ } intrpt[10]; /* interrupt table */ short recvcnt,xmitcnt,othrcnt = 0; /* interrupt counters */ main() { void scc1esr(); /* exception service rtn */ int *pvec; /* exception vector pntr */ char vecblk = 3; /* vector number block */ char intlvl = 4; /* interrupt level */ pdpr = (struct dprbase *) (getmbar() & 0xffffe000);/* init dual-ported ram ptr */ pdpr->cicr.vba2_vba0 = (unsigned) (vecblk);/* vecs at vec num 0x60-7f */ pdpr->cicr.irl2_irl0 = (unsigned) (intlvl);/* cpm interrupts level 4 */ pdpr->cicr.hp4_hp0 = 0x1f; /* no int priority change */ /* scdp is zero from reset */ pdpr->cicr.sccp = 1; /* scc2 to sccc position */ pdpr->cicr.scbp = 2; /* scc3 to sccb position */ pdpr->cicr.scap = 3; /* scc4 to scca position */ f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement pvec = (int *) (getvbr() + (((vecblk << 5) + 0x1e) * 4));/* calculate vector address */ *pvec = (int) scc1esr; /* init int vector */ pdpr->trr4 = 8; /* init timer ref */ pdpr->tmr4.ps = 0; /* init prescalar */ pdpr->tmr4.om = 1; /* select toggle */ pdpr->tmr4.frr = 1; /* restart after ref reac */ pdpr->tmr4.iclk = 1; /* master clock */ pdpr->tgcr.rst4 = 1; /* enable timer */ pdpr->papar |= 0x8000 /* enable tout4 pin */ pdpr->padir |= 0x8000; /* pin 15 is an output */ pdpr->trr3 = 174; /* init timer ref */ pdpr->tmr3.ps = 0; /* init prescalar */ pdpr->tmr3.om = 0; /* select pulse */ pdpr->tmr3.frr = 1; /* restart after ref reac */ pdpr->tmr3.iclk = 3; /* external clock */ pdpr->tgcr.rst3 = 1; /* enable timer */ pdpr->papar |= 0x3000;/* enable tout3 & tin3 */ pdpr->padir |= 0x2000; /* pin 13 is an output */ /* sdcr has been initialized by the debugger */ pdpr->simode.crta = 1; /* common syncs & clocks */ pdpr->simode.rfsda = 1; /* receive frame sync 1 clk dly */ pdpr->simode.tfsda = 1; /* xmit frame sync 1 clk dly */ pdpr->sicr.sc1 = 1; /* scc1 is tdm */ pdpr->papar |= 0x100; /* enable l1rclka */ /* papar, padir & paodr are cleared at reset */ pdpr->pcpar = 0x800; /* enable l1rsynca */ /* port c registers are cleared at reset */ pdpr->sigmr = 4; /* enable tdma */ pdpr->siram[0] = 0x8042; /* init 1st receive element */ pdpr->siram[1] = 0x8042; /* init 2nd receive element */ pdpr->siram[2] = 0x8042; /* init 3rd receive element */ pdpr->siram[3] = 0x8043; /* init 4th receive element */ pdpr->siram[64] = 0x8042; /* init 1st xmit element */ pdpr->siram[65] = 0x8042; /* init 2nd xmit element */ pdpr->siram[66] = 0x8042; /* init 3rd xmit element */ pdpr->siram[67] = 0x8043; /* init 4th xmit element */ f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . chapter 6. qmc initialization pdpr->gsmr_h1.cdp = 1; /* enable cd* pulse */ pdpr->gsmr_h1.ctsp = 1; /* enable cts* pulse */ pdpr->gsmr_h1.cds = 1; /* enable cds* sampling */ pdpr->gsmr_h1.ctss = 1; /* enable cts* sampling */ /* gsmr_h1 is zero from reset */ pdpr->gsmr_l1.mode = 0xa; /* select qmc mode */ /* gsmr_l1 is zero from reset */ pdpr->scc1.mcbase = 0x1_0000; /* bd base located 0x1_0000 */ pdpr->scc1.intbase = 0xf000; /* interrupt table base 0xf000 */ pdpr->scc1.mrblr = 60; /* set receive buffer length to 60 */ pdpr->scc1.grfthr = 1; /* 1 receive frame to intrpt */ pdpr->scc1.grfcnt = 1; /* 1 receive frame to intrpt */ pdpr->scc1.c_mask32 = 0xdebb20e3;/* init 32-bit crc const */ pdpr->scc1.c_mask16 = 0xf0b8; /* init 16-bit crc const */ pdpr->scc1.intptr = pdpr->scc1.intbase;/* init intptr */ inittsatr(4); pdpr->scc1.tsatr[3].w = 1; /* last time slot */ pdpr->scc1.tx_s_ptr = (short *)(pdpr->scc1.mcbase+0x20);/* init pntr to tsattx table */ pdpr->scc1.txptr = pdpr->scc1.tx_s_ptr;/* init curr tsattx pntr */ pdpr->scc1.rx_s_ptr = (short *)(pdpr->scc1.mcbase+0x20);/* init pntr to tsatrx table */ pdpr->scc1.rxptr = pdpr->scc1.rx_s_ptr;/* init curr tsatrx pntr */ pdpr->scc1.qmc_state = 0x8000;/* init qmc-state */ chbd = (struct descs *)((int)(pdpr->scc1.mbase)); pdpr->ch[0].rbase = 0; /* locate ch0 rxbds at 0 */ pdpr->ch[0].tbase = 8; /* locate ch0 txbds at 8 */ pdpr->ch[1].rbase = 0x10; /* locate ch1 rxbds 0x10 */ pdpr->ch[1].tbase = 0x18; /* locate ch1 txbds 0x18 */ pdpr->ch[2].rbase = 0x20; /* locate ch2 rxbds 0x20 */ pdpr->ch[2].tbase = 0x28; /* locate ch2 txbds 0x28 */ pdpr->ch[3].rbase = 0x30; /* locate ch3 rxbds 0x30 */ pdpr->ch[3].tbase = 0x38; /* locate ch3 txbds 0x38 */ for (v1 = 0; v1 < 4; v1++) { pdpr->ch[v1].tstate = 0x3800_0000; pdpr->ch[v1].rstate = 0x3900_0000; pdpr->ch[v1].zistate = 0x100; f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement pdpr->ch[v1].zdstate = 0x80; pdpr->ch[v1].intmsk = 0xa; pdpr->ch[v1].mflr = 60; pdpr->ch[v1].tbptr = pdpr->ch[v1].tbase; pdpr->ch[v1].rbptr = pdpr->ch[v1].rbase; }; chbd[0].recvbd0.rxbdptr = (char *)((int)chbd + 0x100);/* receive bd0 pointer=0x100 */ chbd[1].recvbd0.rxbdptr = (char *)((int)chbd + 0x200);/* receive bd1 pointer=0x200 */ chbd[2].recvbd0.rxbdptr = (char *)((int)chbd + 0x300);/* receive bd2 pointer=0x300 */ chbd[3].recvbd0.rxbdptr = (char *)((int)chbd + 0x400);/* receive bd3 pointer=0x400 */ for (v1 = 0; v1 < 4; v1++) { chbd[v1].recvbd0.rxbdsac.e = 1; /* mark receive bufs empty */ chbd[v1].recvbd0.rxbdsac.w = 1; /*endreceive buffer descriptors */ chbd[v1].recvbd0.rxbdsac.i = 1; /* enable intrpts */ /* continuous mode bits are initialized to 0 from reset */ /* transmit data length field is initialized to 0 from */ /* reset; the ready bit is also 0 from reset. */ chbd[v1].xmitbd0.txbdsac.w = 1;/* end xmit buffer descriptors */ chbd[v1].xmitbd0.txbdsac.i = 1; /* enable intrpts */ chbd[v1].xmitbd0.txbdsac.l = 1; /* last buffer in frame */ chbd[v1].xmitbd0.txbdsac.tc= 1; /* xmit crc sequence */ chbd[v1].xmitbd0.txbdcnt = 0; /* clear data length field */ }; /* clear interrupt table */ intrpt = pdpr->intbase; for (v1 = 0; v1 < 10; v1++) { intrpt[v1].v = 0; /* clear valid bits */ intrpt[v1].w = 0; /* clear wrap bits */ }; intrpt[9].w = 1; poem[0] = "humpty dumpty sat on a wall\n\r"; poem[1] = "humpty dumpty had a great fall\n\r"; poem[2] = "all the king's horses and all the king's men\n\r"; f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . chapter 6. qmc initialization poem[3] = "couldn't put humpty together again\n\r"; poem[4] = ""; poem[5] = ""; linecntr = 0; /* init line counter */ for (linecntr = 0; linecntr < 4; linecntr++) { chbd[linecntr].xmitbd0.txbdptr = poem[linecntr];/* init xmit pointer */ chbd[linecntr].xmitbd0.txbdcnt = strlen(poem[linecntr]) + 1;/* init xmit cnt */ chbd[linecntr].xmitbd0.txbdsac.r = 1;/* set xmit in bd */ } for (v1 = 0; v1 < 3; v1++) { pdpr->ch[v1].chamr.mode = 1; /* select hdlc */ pdpr->ch[v1].chamr.idlm = 0; /* no idles between frames */ pdpr->ch[v1].chamr.ent = 1; /* enable channel xmit */ pdpr->ch[v1].chamr.crc = 1; /* select 32-bit crc */ pdpr->ch[v1].chamr.nof = 7; /* 7 flags between frames */ pdpr->ch[v1].chamr.pol = 1; /* enable polling by risc */ } /* scce1 is cleared from reset */ pdpr->sccm1 = 0xf; /* enable all intrpts */ pdpr->cimr.scc1 = 1; /* scc1 interrupts enabled */ pdpr->gsmr_l1.enr = 1; /* enable receiver */ pdpr->gsmr_l1.ent = 1; /* enable transmit */ while (pdpr->gsmr_l1.enr == 1 | pdpr->gsmr_l1.ent == 1) asm (" stop #$2000"); /* stop for next interrupt */ } #pragma interrupt() /* make function an exception sr */ void scc1esr() /* scc1 exception service rtn */ { short er; /* event register scratchpad loc */ asm(" move.w #$2300,sr"); /* decrement interrupt mask level */ er = pdpr->scce1; /* init event register scratchpad */ pdpr->scce1 = er; /* clear event register */ if ((er & 8) == 8) /* if interrupt table overflow */ f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement {}; if ((er & 4) == 4) /* if global interrupt occurred */ {}; if ((er & 2) == 2) /* if global underrun */ {}; if ((er & 1) == 1) /* if global overrun */ {}; pdpr->cisr = 0x4000_0000; /* clear in-service bit */ } getmbar() { asm(" move.w #7,d0"); /* cpu space func code to d0 */ asm(" movec.l d0,sfc"); /* load sfc for cpu space */ asm(" lea.l $3ff00,a0"); /* a0 points to mbar */ asm(" moves.l (a0),d0"); /* get mbar */ } getvbr() { asm(" movec.l vbr,d0"); /* get vector base reg value */ } inittsatr(maxts) short maxts; { short curts; for (curts = 0; curts < maxts; curts++) { pdpr->scc1.tsatr[curts].w = 0; /* not last time slot */ pdpr->scc1.tsatr[curts].cp = curts; /* mark chan nmbr */ pdpr->scc1.tsatr[curts].mask7_6 = 3;/* no subchaneling */ pdpr->scc1.tsatr[curts].mask5_0 = 0x3f;/* no subchnlng */ pdpr->scc1.tsatr[curts].v = 1; /* mark time slot valid */ } } f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . chapter 6. qmc initialization 6.3 restarting the transmitter a global underrun may require the scc transmitter to be restarted. however, for channel- speci?c errors, only the affected channel need be restarted. the following steps are required to restart each channel: ? prepare buffer descriptors. ? set the pol bit in the channel mode register. a stopped, but not deactivated channel is started as described above. a deactivated channel must ?rst have the zistate and tstate reinitialized to their correct values, followed by setting tsattx[v] and chamr[ent]. lastly, set chamr[pol] if the buffers are ready. 6.4 restarting the receiver a global receiver overrun may require the scc receiver to be restarted. however, for channel-speci?c errors, only the affected channel need be restarted. the following steps are required to restart each channel: ? prepare buffer descriptors. ? initialize the zdstate to either 0x080 (hdlc) or 0x1800_0080 (transparent). ? initialize the rstate to 0x3900_0000 for mh360 and 860mh. 6.5 disabling receiver and transmitter a transmit channel can be stopped from sending any more data to the line with the stop command described in section 3.1, transmit commands. the transmitter will continue to send idles or flags according to the channel mode register setting. to deactivate a channel, the v bit has to be cleared in the time slot assignment table and the ent bit has to be cleared in the channel mode register. to stop a channel while receiving, use the stop command as described in section 3.2, receive commands, then perform a restart as described above. 6.6 debugging hints note that the following guidelines are subject to change; code should not rely on this information. the hints are for debugging purposes only. 6.6.1 pointer registers table 6-7 discusses the debugging hints for pointer registers. see section 2.4.1, channel- speci?c hdlc parameters, and see section 2.4.2, channel-speci?c transparent parameters, for more information. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement 6.6.2 state registers the qmc has two sets of state parametersglobal and channel-speci?c. these registers change if the qmc is running and the scc is receiving clock. notes : 1 for more information on tstate and rstate, see section 2.4.1, channel-specific hdlc parameters. 2 zistate and zdstate contain no meaningful parameters. table 6-7. pointer registers offset name comments channel-speci?c parameters hdlc and transparent 08 tx internal data pointer holds pointer to current data in buffer. 0e tx internal byte count holds down-counter of data left to transmit in this buffer descriptorloaded when the buffer descriptor is opened with the bd length ?eld. 28 rx internal data pointer holds pointer to address inside the current buffer where data will be received. 2e rx internal byte count holds down-counter of space left in this rx buffer loaded when the bd is opened with the mrblr ?eld. table 6-8. state registers offset name comments global state parameter 04 qmcstate bit 0 ? 1 if the qmc is stopped or has not started ? 0 if the qmc is running channel-speci?c parameters hdlc 1, 2 04 tstate bit 8 currently transmitting a frame bit 9 buffer descriptor is currently open (data is being transmitted from a bd) bit 12 channel has been initialized and is running 24 rstate bit 8currently receiving a frame bit 9 buffer descriptor is currently open (data is being received into a bd) bit 11 reception is halted low wordcurrent bd status word channel-speci?c parameters transparent 04 tstate bit 9 buffer descriptor is currently open (data is being transmitted from a bd) bit 12channel has been initialized and is running. 24 rstate bit 9 buffer descriptor is currently open (data is being received into a bd) bit 11 reception is halted low wordcurrent bd status word f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . chapter 7. features deleted in mc68mh360 chapter 7 features deleted in mc68mh360 70 70 an mc68mh360 operating in normal mode without the qmc protocol can perform the same functions as the mc68360 and mc68en360 with two exceptions in protocol support. in order to create space in the cpm rom for the qmc protocol, the support for centronics and bisync have been removed from the mh360. in all other respects, the mc68mh360 is compatible with its predecessors. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . chapter 8. performance chapter 8 performance 80 80 calculating performance is key to choosing the clock frequency required for a given system. for the 860mh and mh360, the large number of possible channel combinations complicates performance estimation. this chapter addresses the problem by ?rst providing a performance table for common con?gurations supported by the 860mh and/or the mh360 in section 8.1, common channel combinations. for con?gurations not covered in the ?rst section, section 8.2, cpm loading, covers general guidelines and examples for determining the serial bit rate and cpm loading on a given system. the ?nal section, section 8.3, bus latency and peak load, addresses system bus utilization and arbitration. for more de?nitive answers to performance questions, benchmark the desired con?guration on a development board. 8.1 common channel combinations table 8-1 provides some common channel combinations con?gured on the mh devices along with suggested operating frequencies. note that the mh360 is available only at 25 and 33 mhz,; the 860mh is currently available at 25, 40, and 50 mhz. table 8-1. common qmc configurations protocols selected frequency supported 25 mhz 33 mhz 40 mhz 50 mhz scc1: 24-channel qmc. serial bit rate 1.544 mbps (t1) yes yes yes yes scc1: 32-channel qmc. serial bit rate 2.048 mbps (e1/cept) yes yes yes yes scc1: 10-mbps ethernet; scc2: 12 x 64-kbps qmc; scc3: 12 x 64-kbps qmc. tdm bit rate = 1.544 mbps yes yes yes yes scc1: 10-mbps ethernet; scc2: 16 x 64-kbps qmc; tdm bit rate = 1.544 mbps yes yes yes yes scc1: 32 x 64-kbps qmc; scc2: 64 kbps; scc3:64 kbps; scc4: 64 kbps; all hdlc. ye s ye s ye s ye s f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement 8.2 cpm loading this section primarily deals with the cpm loading of the mh360 and 860mh. as the cpm architecture is identical on both devices, the performance for a given clock frequency is identical. compared to standard protocols, the qmc protocol places more demands on the cpm risc because it requires the cpm to handle all of the bit manipulation normally implemented with hardware support built into the sccs. the scc operates transparently in qmc mode. the sccs main function is serial-to- parallel conversion of the data stream out of the time slot assigner, and parallel-to-serial conversion of the data stream gated into the time slot assigner. all bit manipulating is done in the cpm risc software or hardware. thus, the cpm has a much higher load when operating in qmc mode, even if all time slots are concatenated to one logical channel. this loading is re?ected in the measured performance. table 8-2 gives loading guidelines. the table assumes a single scc running at 100% of the cpm bandwidth. for each protocol supported, the table gives the ratio of the scc bit rate versus clock frequency, and the maximum serial throughput at standard frequencies. scc1: 10-mbps ethernet; scc2: 16 x 64-kbps qmc; scc3: 16 x 64-kbps qmc; scc4: 64-kbps hdlc. tdm bit rate = 2.048 mbps no yes yes yes scc1: 10-mbps ethernet; scc2: 12 x 64-kbps qmc; scc3: 12 x 64-kbps qmc; scc4: 64-kbps hdlc. tdm bit rate = 1.544 mbps no yes yes yes scc1: 24-channel qmc; scc2: 24-channel qmc. serial bit rate 2 x 1.544 mbps 2 x t1 no no yes yes scc1: 10-mbps ethernet scc2: 24-channel qmc; scc3: 24 channel qmc. serial bit rate 2 x 1.544 mbps 2 x t1 no no no yes scc1: 32-channel qmc; scc2: 32-channel qmc. serial bit rate 2 x 2.048 mbps (e1/cept) no no no yes table 8-2. cpm performance table protocol scc rate: clock frequency mbps: mhz maximum serial throughput 25 mhz mbps 33 mhz mbps 40 mhz mbps 50 mhz mbps transparent 1 : 3.125 fd 8 10.56 12.8 16 hdlc 1 : 3.125 fd 8 10.56 12.8 16 uart 1 : 10.4 fd 2.4 3.168 3.84 4.8 table 8-1. common qmc configurations (continued) protocols selected frequency supported 25 mhz 33 mhz 40 mhz 50 mhz f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . chapter 8. performance note fd = full duplex, hd = half duplex further examples are given in appendix a of the mpc860 users manual. using table 8-2, estimations of bandwidth utilization may be made. to calculate the total system load, add the cpm utilization from every channel together. assuming approximately linear performance versus frequency 1 , the general problem reduces to taking simple ratios: for example, since a 25-mhz ethernet running at 22 mbps consumes approximately 100% of the bandwidth, what bandwidth does a 10-mbps channel require? the above equation shows the 10-mbps channel requiring 45% of the cpm bandwidth. more examples follow. 1 most protocols performance is scalable linearly to frequency with the exception of ethernet which has nonlinear behavior. however, for these calculations we assume linear scaling with frequency. ethernet 1 : 1.136 hd 22 29 35 44 smc transparent 1 : 16.67 fd 1.5 1.98 2.4 3 smc uart 1 : 113.636 fd 0.220 0.290 0.352 0.440 qmc 1 : 11.90 fd 2.1 2.8 3.36 4.2 bisync 1: 16.67 fd 1.5 1.98 2.4 3 table 8-2. cpm performance table (continued) protocol scc rate: clock frequency mbps: mhz maximum serial throughput 25 mhz mbps 33 mhz mbps 40 mhz mbps 50 mhz mbps cpm utiilization serial rate 1 max serial rate 1 ------------------------------------- ? ?? serial rate 2 max serial rate 2 ------------------------------------- ? ?? ? + = cpm utilization serial rate max serial rate ---------------------------------- - 10 22 ----- - 0.45 === f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement example #1 a device is operating at 25 mhz. scc1 runs 1x10-mbps ethernet in half duplex, scc2 runs 1 x 2-mbps hdlc, scc3 runs 1 x 64-kbps hdlc, scc4 runs 1 x 9.6-kbps uart and smc1 runs 1 x 38-kbps smc uart. the following equation applies: this yields a percentage cpm utilization of 96% meaning the device can handle these protocols at this frequency. note the 9.6-kbps uart link only requires 0.4% of the cpm bandwidth, implying that in any con?guration where there is free bandwidth that it will be possible to run a low-rate uart link. example #2 a device operating at 25 mhz is required to run 24 channels at 64 kbps in qmc mode with an additional 2 hdlc channels operating at 128 kbps each. the following equation applies: example #3 the last example shows an application with 32 qmc channels and one additional 2-mbps hdlc channel. the following equation applies: since the result above is greater than 1, this con?guration may not work at 25 mhz. if a 33- mhz operation is used, cpm utilization will drop below 1, allowing the combination to be supported. the following equation applies: in general, a channel combination will work if the combined load is less than 1. the equations are scalable to frequency with the exception of the nonlinear ethernet protocol. taking ethernet into account is dif?cult. designers will need to benchmark performance for results near 1. 10 22 ----- - ? ?? 2 8 -- - ? ?? 0.064 2.4 ------------- ? ?? 0.0096 2.4 ---------------- ? ?? 0.038 0.22 ------------- ? ?? + + + + 0.96 ( <1) = 2 0.128 8 ---------------------- ? ?? 24 0.064 2.1 ------------------------- ? ?? + 0.76 ( <1) = 2 8 -- - ? ?? 32 0.064 2.1 ------------------------- ? ?? + 1.22 (will not work) = 1.22 25 33 ----- - ? ?? 0.92 (<1) = f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . chapter 8. performance 8.3 bus latency and peak load each time slot is 8 bits, but the qmc protocol transfers 32 bits of data whenever possible. thus, for each active channel operating within large frames, two 32-bit sdma data transfers (one for tx and one for rx) occur approximately every fourth tdm frame (every 500 m s in cept/t1 interfaces). during buffer closing or opening, load will increase approximately 3 to 4 times. table 8-3 illustrates the bus activities involved when one qmc channel switches from one tx hdlc frame to the next. note : the table assumes the channel uses one time slot per tdm frame and that no pad characters, preceding ?ags or ?ag sharing is used. in table 8-3, the frame number refers to the 125- m s frame; the numbering is arbitrary but sequential. the actions refer to the visible functions executed on the cpm. the number of external bus cycles executed by the cpm represents the load on the bus. the sequence in table 8-3 starts when the last 32 bits are read from a buffer. one byte is transferred over the tdm link per frame over the next four 125- m s frames. then the crc is sent. in this case, it is a 16-bit crc requiring two time slots over the next two frames. the heavy load on the bus starts when the cpm must close the buffer in frame 8. at this point the cpm needs three accesses to the bus to read and write to the interrupt table and update the buffer descriptors status. in the following frame, the next buffer is opened requiring three accesses to read the status and length, read the data pointer and read the data. table 8-3. qmc actions in tx buffer switch frame number actions number of bus cycles 1 read long word from buffer (last in frame) 1 2 send byte 0 3 send byte 0 4 send byte 0 5 send last byte in frame 0 6 send crc 0 7 send crc 0 8 send ?ag read interrupt table write interrupt table write bd 3 9 send ?ag read next bd status/length read bd data pointer read data 3 10 send ?rst byte of next frame 0 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement in the worst-case scenario, all channels open and close a buffer during the same tdm frame resulting in the peak load all performance calculations are based on. this peak load is far from the norm and can be controlled by the transmitter spreading the starting point of transmit buffers over several tdm frames. in multimaster systems, bus latency may affect the performance of the device. the maximum external bus latency ?gures shown in table 8-4 are measured from the assertion of the br (bus request) to the assertion of the bgack (bus grant acknowledge); that is, from start of bus request output being active until the cycle is completed. for multimaster systems, bus arbitration overhead is included. latencies of up to 40 clocks were simulated; for values over 40, the acceptable latency may be larger. table 8-4 shows average maximum acceptable bus latencies, meaning the device can tolerate longer bus delays if they are infrequent. for lengthy delays, a larger fifo can pick up the slack, continuing emptying or ?lling depending on the data ?ow direction. therefore, the larger the fifo the more tolerant the system is to infrequent peaks in bus delays. however, the average acceptable bus latency still depends on the overall data rate and frame length and not on the fifo size. table 8-4. simulated latencies maximum acceptable latency (bus cycles) channel combinations 25 mhz 33 mhz not supported 12 scc1: ethernet; scc2: 16 x 64 kbps; scc3: 16 x 64 kbps not supported 11 scc1: ethernet; scc2: 16 x 64 kbps; scc3: 16 x 64 kbps; scc4: 64 kbps hdlc 9 clocks >40 scc1: 32 x 64 kbps. serial bit rate 2.048 mbps (e1/cept) 8 clocks 35 scc1: 32 x 64 kbps; scc2: 64 kbps; scc3: 64 kbps; scc4: 64 kbps; all hdlc 40 clocks >40 qmc with 24 channels. serial bit rate 1.544 mbps (t1) 33 clocks >40 scc1: 24 x 64 kbps; scc2: 64 kbps; scc3: 64 kbps; scc4: 64 kbps; all hdlc 8 clocks 24 scc1: ethernet; scc2: 12 x 64 kbps; scc3: 12 x 64 kbps. tdm bit rate = 1.544 mbps not supported 23 scc1: ethernet; scc2: 12 x 64 kbps; scc3: 12 x 64 kbps; scc4: 64-kbps hdlc. tdm bit rate = 1.544 mbps 40 clocks >40 scc1: 16 x 128 kbps. tdm bit rate = 2.048 mbps f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . chapter 9. multi-subchannel (msc) microcode chapter 9 multi-subchannel (msc) microcode 90 90 the risc processor in the powerquicc has an option to execute microcode from the internal dual-ported ram. motorola uses this feature to enhance existing protocols or implement additional protocols. customers can purchase ram microcodes in an object- code format and download it to the powerquicc dual-ported ram during system initialization. the ram microcode is provided by motorola as a set of s records that can be downloaded directly to an application development system or stored in a system eprom; for more information on s records, see appendix c of the m68000 family programmers reference manual . after system reset, the binary of the microcode should be copied to the dual-ported ram. the quicc registers, including the risc controller con?guration register (rccr), should be initialized as speci?ed in the microcode ram documentation. before the risc is used in the system, the user should issue a reset command to the communications processor command register (cr). the microcode ram functions are available in addition to all protocols available in the standard quicc microcode rom. 9.1 msc microcode features the multi-subchannel (msc) microcode is a downloadable microcode for the mpc860mh and has the following key features: ? general multiple subchannels within a single 8-bit time slot bit resolution for subchannels up to 32 independent communications channels for both rx and tx supports either transparent or hdlc protocols per subchannel ? performance 32 channels + 10-mbps ethernet support at 40-mhz system clock f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement 9.2 msc microcode operation in normal operation (without the msc microcode), the qmc protocol allows speci?c bits in an 8-bit time slot to be masked to create a single subchannel per scc. a problem arises when multiple subchannels are multiplexed within a single time slot as in gsm (global system for mobile communications) where four 16-kbps subchannels are multiplexed into a single 64-kbps channel over a 2.048-mbps a bis link. a brute-force solution routes the separate subchannels to different sccs, consuming all four sccs for the single tdm link as shown in figure 9-1. each scc ?lters out one of the four 2-bit subchannels in time slot 2 (ts2) using a unique mask located in its time slot assignment tables (tsatrx/tsattx). with the msc microcode, subchannels can be regenerated using only one scc. figure 9-1. two-bit subchannel implementation without msc microcode the msc microcode enables an 8-bit time slot to be split into multiple, bit-resolution subchannels. the microcode applies user-de?ned masks in a time slot assignment table entry to subdivide a given channel. bit 11 of a table entry is now called the l bit to mark the last subchannel of a given time slot. figure 9-2 shows the msc microcode solution to the above gsm problem. again in this example, time slot 2 contains four 2-bit channels, but now the full time slot can be routed to a single scc and split into subchannels within the time slot assignment tables. ts0 ts1 ts2 ts31 8 bits scc1 scc2 scc4 scc3 masking performed within each scc to create 2-bit channels f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . chapter 9. multi-subchannel (msc) microcode note as the l bit (bit 11 of a time slot assignment table entry) is taken from the original channel pointer ?eld, the addressing capability of the qmc is reduced from 6 bits (64 channels) to 5 bits (32 channels) for receive and transmit. figure 9-2. two-bit subchannel implementation with msc microcode 9.3 programming the msc protocol the msc protocol con?guration is identical to the qmc con?guration with the exception of the time slot assignment tables. figure 9-3 shows the addition of the l bit needed for the msc con?guration. note that it is possible to have up to 32 channels coming from any permutation of the time slots. ts0 ts1 ts2 ts31 8 bits scc1 lc2a lc2b lc2c lc2d masking performed by a single scc to create four 2-bit channels f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement figure 9-3. time slot assignment table showing msc configuration table 9-1 describes the ?elds in the time slot assignment table for receive (tsatrx) when the msc microcode is enabled. table 9-1. time slot assignment table entry fields for receive (msc) field description v valid bitthe valid bit indicates whether this time slot is valid. 0 the data in this 8-bit time slot is totally ignored and not written to any buffer. 1 the data in this 8-bit time slot is valid and written to the current buffer, pointed to by the channel pointer entry, after protocol processing (for example, zero deletion in hdlc). w wrap bitidenti?es the last entry in tsattx. 0 this is not the last time slot in the frame. 1 the risc processor wraps around and handles time slot 0 or the ?rst 8 bits transferred from the tsa in the next request. the next request is identi?ed by a frame synchronization pulse. time slot 0 time slot 1 time slot 30 time slot 31 32 x 16 channel pointer w v mask(2:7) mask(0:1) l channel pointer w v mask(2:7) mask(0:1) l channel pointer w v mask(2:7) mask(0:1) l channel pointer w v mask(2:7) mask(0:1) l channel pointer w v mask(2:7) mask(0:1) l channel pointer w v mask(2:7) mask(0:1) l channel pointer w v mask(2:7) mask(0:1) l f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . chapter 9. multi-subchannel (msc) microcode table 9-2 describes the ?elds in the time slot assignment table for transmit (tsattx) for msc operation. l last bitidenti?es the last subchannel in a time slot. 0 this is not the last subchannel in the time slot. 1 this is the last sub channel within an 8-bit time slot.the risc processor handles the next time slot transferred from the tsa in the next request. rx channel pointer this ?eld of the tsatrx entry identi?es the data channel that is routed to this time slot. the actual channel pointer is 11 bits long, and contains the starting address of the channel-speci?c parameter area (address of tbase). the 5 most-signi?cant bits are taken from tsatrx, and the 6 least- signi?cant bits are always internally set to zero. for the msc operation, the addressing range is 2 kbytes. mask(0C7) mask bitsthese 8 bits identify the valid bits in this time slot for subchanneling support. for 8-bit resolution, all mask bits should be set to 1. any unmasked bit (1) is processed in the receiver for a valid time slot. any masked bit (0) is ignored by the receiver for a valid channel and no bit counter is affected. table 9-2. time slot assignment table entry fields for transmit (msc) name description v valid bitthe valid bit indicates whether this time slot is valid. 0 logic 1 is transmitted. if the tx signal of the tdm interface is programmed to be an open drain output (port b programming), other devices can transmit on nonvalid time slots. 1 data is transmitted from its associated buffer in combination with the mask bit settings. w wrap bitthe wrap bit identi?es the last entry in tsattx. 0 this is not the last time slot in the frame. 1 the risc processor wraps around and handles time slot 0 or the ?rst 8 bits of data in the scc in the next request. the next request is identi?ed by a frame synchronization pulse. l last bitidenti?es the last subchannel in a time slot. 0 this is not the last subchannel in the time slot. 1 this is the last sub channel within an 8-bit time slot.the risc processor handles the next time slot transferred to the tsa in the next request. tx channel pointer this ?eld of the tsattx entry identi?es a data channel which is routed to this time slot. the actual channel pointer is 11 bits long, and contains the starting address of the channel-speci?c parameter area (address of tbase). the 5 most signi?cant bits are taken from tsattx channel pointer ?eld, and the 6 least signi?cant bits are always internally set to zero. for msc protocol, the addressing range is 2 kbytes. mask(0C7) mask bitsidenti?es the valid bits in this time slot for subchanneling support. for 8-bit resolution, all mask bits should be set to 1. for a valid channel with an unmasked bit (1), the bit position is ?lled according to the protocol. a valid channel with a masked bit (0) transmits a logic high (1). table 9-1. time slot assignment table entry fields for receive (msc) (continued) field description f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement 9.4 msc subchanneling example figure 9-4 shows an example for eight 20-bit subchannels. figure 9-4. example for eight 2-bit subchannels the example in figure 9-4 uses two time slots to handle eight 2-bit subchannels. time slot 0 is subdivided into four 2-bit subchannels. note that time slot 0 is processed four times for the channels labeled 0a, 0b, 0c and 0d, each with different masks. it is only in the fourth entry that the l-bit (last bit) is set, instructing the cpm to process the next time slot. the same is true for time slot 31. it again is subdivided into four 2-bit subchannels. note that the maximum number of channels is 32 due to the 5-bit channel pointer. channel #0a w v 000011 00 0 channel #0c w v 110000 00 0 channel #0b w v 001100 00 0 channel #31c w v 110000 00 0 channel #31d w v 000000 11 1 channel #31b w v 001100 00 0 channel #31a w v 000011 00 0 channel #0d w v 000000 11 1 time slot 0 time slot 31 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . chapter 9. multi-subchannel (msc) microcode 9.5 qmc memory organization figure 9-5 shows the internal memory map of the mpc860mh when the msc microcode is resident. note that the microcode resides in the ?rst 1 kbyte of dual-ported ram and uses the last 256 bytes of dual-ported ram for data. this means that the channel-speci?c parameters are offset from immr + 0x2400, and may occupy up to immr + 0x2bff. this space can hold parameters for up to 32 channels. any unused memory, and the 768 bytes from immr = 0x2c00 may be used by the user for buffer descriptors or as standard ram. figure 9-5. mpc860mh internal memory map with msc microcode enabled 4-kbyte internal registers 4-kbyte dual-ported ram immr immr + 0x2000 immr + 0x3c00 parameter ram immr + 0x2000 immr + 0x2400 immr + 0x3000 immr + 0x2f00 microcode & immr + 0x2c00 2 kbytes for channel- specific parameters 1 kbyte microcode 256-byte microcode 768-byte user/bd microcode scratch not implemented f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement 9.6 multi-subchannel initialization the initialization of the msc microcode is the same as the standard qmc initialization with the following additions: ? prepare tsattx and tsatrx to include the l (last) bit ? the risc controller trap registers for the mpc860 rev a must be set as follows: address scc base + 9cc, rctr1 = 0x8074 address scc base + 9ce, rctr2 = 0x8054 address scc base + 9d0, rctr3 = 0x92f2 address scc base + 9d2, rctr4 = 0x9097 ? load microcode s records into dual-ported ram ? set the rccr (address scc base + 9c4) = 0x0002 ? set the gsmr_h = 0x07a0 (rfw = 1) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . appendix a. 68360 bit numbering appendix a 68360 bit numbering a0 a0 this appendix shows the bit numbering for the 68360. a.1 time slot assignment table figure a-1 shows the 68360 bit numbering for a general time slot assignment table for thirty-two 16-bit time slots. the ?elds will be used to either transmit or receive channels. figure a-1. time slot assignment table channel pointer w v time slot 0 time slot 1 time slot 30 time slot 31 32 x 16 mask(5:0) mask(7:6) channel pointer w v mask(5:0) mask(7:6) channel pointer w v mask(5:0) mask(7:6) channel pointer w v mask(5:0) mask(7:6) channel pointer w v mask(5:0) mask(7:6) channel pointer w v mask(5:0) mask(7:6) channel pointer w v mask(5:0) mask(7:6) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement figure a-2 shows the 68360 bit numbering for a time slot assignment table for 64-channel common rx and tx mapping. figure a-2. time slot assignment table for 64-channel common rx and tx mapping channel pointer w v time slot 0 time slot 1 time slot 62 time slot 63 64 x 16 mask(5:0) mask(7:6) channel pointer w v mask(5:0) mask(7:6) channel pointer w v mask(5:0) mask(7:6) channel pointer w v mask(5:0) mask(7:6) channel pointer w v mask(5:0) mask(7:6) channel pointer w v mask(5:0) mask(7:6) channel pointer w v mask(5:0) mask(7:6) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . appendix a. 68360 bit numbering a.2 registers in hdlc mode figure a-3 to figure a-6 show the 68360 bit numbering for registers in hdlc mode. figure a-3. chamrchannel mode register (hdlc) interrupt table entry: intmsk: figure a-4. interrupt table entry and intmsk (hdlc) figure a-5. tstate (hdlc) figure a-6. rstate (hdlc) 1514131211109876543210 mode 0 idlm ent reserved pol crc 0 reserved nof reset: 0 000000000000000 1514131211109876543210 v w nid idl channel number mrf un rxf bsy txb rxb reset: 0 000000 000000000 1514131211109876543210 reserved interrupt mask reserved interrupt mask bits reset: 0 000000 000000000 31 30 29 28 27 26 25 24 0 0 1 mot fc3Cfc0 31 30 29 28 27 26 25 24 0 0 1 mot fc[3C0] f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement a.3 registers in transparent mode figure a-7 to figure a-10 show the 68360 bit numbering for registers in transparent mode. figure a-7. chamrchannel mode register (transparent mode) intmsk: intmsk: figure a-8. intmsk and interrupt table entry (transparent mode) . figure a-9. tstate (transparent mode) . figure a-10. rstate (transparent mode) a.4 command register figure a-11 shows the 68360 bit numbering for the command register. figure a-11. command register 1514131211109876543210 mode rd 1 ent resvd sync C pol 0 0 reserved 0 reset: 0 00000 modck 1 modck 1 00000000 1514131211109876543210 reserved reserved reserved res interrupt mask bits reset: 0 000000000000000 1514131211109876543210 reserved reserved reserved res interrupt mask bits reset: 0 000000000000000 31 30 29 28 27 26 25 24 0 0 1 mot fc[3C0] 31 30 29 28 27 26 25 24 0 0 1 mot fc3Cfc0 1514131211109876543210 rst qmc opcode 11100 channel number C flg f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . appendix a. 68360 bit numbering a.5 scc event register figure a-12 shows the 68360 bit numbering for the scc event register. figure a-12. scc event (scce) register a.6 sccm register figure a-13 shows the 68360 bit numbering for the sccm register. figure a-13. sccm register a.7 receive and transmit buffer descriptors figure a-14 and figure a-15 show the 68360 bit numbering for the receive and transmit buffer descriptors. figure a-14. receive buffer descriptor (rxbd) figure a-15. transmit buffer descriptor (txbd) 76543210 iqov gint gun gov 76543210 iqov gint gun gov 1514131211109876543210 offset + 0 e wi lf cm ub lg no ab cr offset + 2 data length offset + 4 rx data buffer pointer offset + 6 1514131211109876543210 offset + 0 r wi ltccmub pad offset + 2 data length offset + 4 tx data buffer pointer offset + 6 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . appendix b. frequently-asked questions appendix b frequently-asked questions b0 b0 this appendix provides a list of frequently-asked questions and solutions for the mh360 and 860mh. b.1 questions common to mh360 and 860mh q: what are the performance differences between the 68mh360 and 860mh? a: since the 860 and 360 have the same cpm, performance scales linearly with frequency as shown in table b-1. q: comparing the mh360 and 860mh, what is the best way to support two t1 tdm channels? a: there are two bottlenecks in running the qmc protocol on the 360 and 860. one is cpm performance, and the other is parameter ram space. running the qmc protocol consumes nearly all of the cpm bandwidth at 25 mhz. as the cpm is the same for the 360 and 860, the same limitation applies to both when running at 25 mhz. in addition, the qmc protocol consumes nearly all of the dual-ported ram of a 360 preventing more than one qmc from running at the same time (even if the 360s speed could be increased). however, since the 860 has twice as much dual-ported ram as the 360, it does have enough space to run two qmcs. also, the cpm bandwidth is doubled at 50 mhz. table b-1. cpu performance device frequency performance mh360 25 mhz 6.3 dhrystone mips 33 mhz 8.4 dhrystone mips powerquicc 25 mhz 33 dhrystone mips 40 mhz 52 dhrystone mips 50 mhz 66 dhrystone mips f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement therefore, a 50-mhz mpc860mh will be needed to run 64 channels of hdlc on one device. b.2 860mh-related questions q: is ethernet only available on scc1 for both 860en and 860mh? a: ethernet is available on any channel. we recommend it on scc1 due to its larger fifo. q: how is 64-channel qmc implemented on the 50-mhz 860mh? what is the serial speed of the tdm channels? a: use two sccs running 32-channel qmc protocol. each channel is assumed to be 64-kbps, like a normal time slot on a t1/e1 line, giving an aggregate rate of 4 mbps (that is, twice the e1 rate). q: does running transparent-mode processing on the qmc channels decrease the load on the cpm? a: cpm loading in transparent mode is not signi?cantly different from the loading in hdlc mode; therefore, performance will be the same. q: how many channelized t1/e1 ports does the 860mh support? (where e1 is thirty- two 64-kbps channels and t1 is 24 channels) a: with respect to running multiple channels of hdlc, the major limitation of the current 860mh is clock frequency. a 25-mhz part can run only 32 hdlc channels, while a 50-mhz part can run 64 channels. at this point, however, the size of the dual-ported ram limits the number of hdlc channels to 64. the mpc860 also has just two time slot assigners. therefore, it can directly terminate at most two t1s or e1s. q: how is the 860mh con?gured to support more than 32 channels. a: the qmc protocol for the 860mh can be used to support more than 32 hdlc channels in three ways: ? in one method, use shared transmit/receive channel routing on one scc to run the qmc protocol linking the maximum of 64 time slots of a single multiplexed line to 64 separate logical channels. ? in another method, run the qmc protocol on two separate sccs, each with its own set of parameters. with this method, two separate e1s can be routed to the two separate sccs. it is not possible, however, to share channels from both e1s at random between the sccs. (one e1 will map to the 32 logical channels of one scc.) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . appendix b. frequently-asked questions ? a hybrid approach runs a single line of up to 64 multiplexed time slots to two separate sccs, each with its own set of parameters. normally this would route 32 time slots to each scc. this would have the bene?t of doubling your effective fifo depth, allowing greater system design ?exibility. q: my understanding is that the mh360 could not support the ss-7 microcode. is this also true of the 860mh? a: the 860mh will not support ss-7 over the multiplexed (qmc) channels. if ss-7 is to be run, it must be run over its own dedicated scc. however, by using the time slot assigner, the traf?c from this scc could be routed over the same e1 or t1 as the other multiplexed hdlc channels. for example, one channel of an e1 could be routed to an scc running ss-7, and the other 31 channels to an scc running qmc. thus, the number of ss-7 channels allowed is limited to the number of sccs (that is, at most 4). q: what is the cpms maximum cpu bus utilization when running two 2-mbps qmc channels? a: for 64 channels (two e1 lines), two 2-mbps full duplex means 8 mbps of aggregate traf?c. factoring in a large margin for buffer descriptor accesses bumps this 8 mbps up to 10 mbps. the 10 mbps of traf?c translates to 0.3 megatransfers of 32 bits each requiring only 1.5 mhz out of a 50-mhz bus (assuming a 5 wait-state memory). a similar calculation for ethernet would account for higher data traf?c and fewer descriptor accesses. q: is the 860mh pin compatible with the 860dh? a: yes, it is pin compatible. q: are bisync and centronics still removed from the 860mh as they are with the mh360? a: no, centronics and bisync are both supported on the 860mh. q: how is time slot 0 identi?ed on an scc? is an external sync required? a: the tsa identi?es time slot 0. a sync pulse must be provided to the tsa at the beginning of a frame. q: what does the larger dual-ported ram on the 860mh provide? a: the larger dual-ported ram means that up to 64 qmc channels may be supported. it also provides more buffer descriptor area needed for the higher serial performance at higher speeds. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement b.3 mh360-related questions q: does the mh360 still have a full ethernet controller? a: yes. q: what frequency mh360 is required to support 10-mbps ethernet and 64-channel qmc on a 2.048-mbps tdm? a: a 33-mhz mh360 is required. q: how should an mh360 be con?gured to run both 2.048-mbps qmc and 10-mbps ethernet? a: put ethernet on scc1 and split the tdm time slot16 channels on scc2 and 16 on scc3. q: when the part has the core disabled (68040 companion mode), will it support both the ethernet and a 32-channel qmc when clocked at 25 mhz? if not, how many qmc channels will it handle? a: a 33-mhz part is needed to run 32-channel qmc and ethernet. a 25-mhz mh360 can support 24-channel qmc and ethernet. the bottleneck is in the cpm performance not the cpu. q: is the pinout for the mh360 the same as the standard 360? a: yes. q: can two gci ports be connected to an mh360? a: yes, with some caveats. run each gci channel into a tsa. then use scc1 for the two b channels and scc2 for the other two b channels. finally, use scc3 and scc4 for the respective d channels. however, this method provides no support for m-, c/ i-, a-, or e-channels. q: what are the differences in loopback modes for the time slot assigner, particularly with respect to the mh360? a: there are three ways to do loopback: ? use the gsmr to make all 32 virtual channels loop back as they pass through the scc. each virtual channel will transmit through the scc in the order de?ned in the transmit portion of the si ram. the transmit side of the virtual channel will loop back directly into the receive side of the virtual channel with no indirection by the si. ? use the simode to cause global loopback of the multiplexed data stream in the si. by this method, the ?rst transmit time slot will loop back into the ?rst receive time slot, etc. however, different time slots can be assigned to different virtual channels in the si ram. for example, virtual channel 1 could be assigned to f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . appendix b. frequently-asked questions transmit time slot 1, but virtual channel 5 could be assigned to receive time slot 1. therefore, global loopback would cause the data transmitted on channel 1 to be received on channel 5. ? for loopback on an individual time slot, set bit 15 of the corresponding entry in the siram. for the last two methods, use a common transmit/receive clock and transmit/receive sync pulses. also in these last two methods, if the loopbacked data is to be received on the same virtual channel, make sure the transmit and receive portions of your si ram entries match. q: does the mh360 support signalling system 7 (ss-7) on all 32 channels? a: no. the mh360 does not support ss-7. run the ss-7 microcode on a normal quicc to get 4 channels of ss-7 support. q: is any extra support logic required to attach an mh360 to an isdn primary rate line? a: yes, a t1 transceiver and framer unit will be needed. manufacturers include dallas semiconductor, mitel, and level one. q: can the mh360 be used as an isdn basic rate terminator? a: yes, send multiple motorola u interface outputs into a single scc using the qmc controller and the motorola idl2. q: 360 documentation says that the time slot assigner can be used with all of the sccs and the smcs. however, the mh360 reference manual states that the time slot assigner works with the sccs. can the time slot assigner work with the smcs? a: yes. q: what is the maximum bus latency at 25 mhz when using 32 64-kbps channels? a: nine clocks. it is very important. at 25 mhz, the cpm is just able to empty the fifo quickly enough to prevent underrun. if the part is run at 33 mhz or if only 24 channels are needed, the margin increases allowing for a better worst case. q: can tdm b be used for the qmc on the mh360? a: yes. q: can the transparent channels of the mh360 (qmc mode) synchronize on an inline data pattern? a: no. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . appendix c. connecting isdn multiple s/t or u interfaces to quicc32 appendix c connecting isdn multiple s/t or u interfaces to quicc32 c0 c0 using idl or gci protocols, the mc145574 (s/t interface) and the mc145572 (u interface) can be gluelessly interfaced to members of the mc68302 family for low-cost, active-isdn basic rate terminal applications. for applications needing to support more than one basic rate interface (bri), such as lan/ wan bridges, pbx, line cards or multiple-line terminal adaptors, a system solution using multiple mc145574s or mc145572s can be built around a quicc32 (mc68mh360). the quicc32 and the qmc (quiccs multichannel controller) protocol are useful for such isdn applications requiring several logical channels on one physical medium. this appendix shows how multiple mc145574s or mc145572s can be connected to a quicc32, describing the level-1 connections and explaining the data ?ow through the devices. no software issues are addressed in this appendix. c.1 the qmc protocol based upon the idl bus, the qmc protocol implemented on the quicc32 generates a tdm (time-division multiplexing) bus with programmable time slots for each isdn interface. with 32 time slots, each carrying 8 consecutive bits forming 64-kbps channels, a 2-mbps tdm line (roughly equivalent to a cept/e1 link) can be created. time slot zero (ts0) is dedicated to the ?rst b1 channel, with ts1 assigned to the ?rst b2 channel and ts2 to the ?rst d channel. even though only 2 bits are used for signaling, the d channel has 8 bits reserved on the tdm link since the qmc microcode must process data on 8-bit boundaries for correct delineation of channels. the unused 6 bits are masked in the qmc time slot assignment table. since the tdm line allows a maximum of 32 channels, the above process of routing channels to time slots (that is, the second b1 channel routed to ts3 and so on) can be repeated for up to 10 bris. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement using on-chip time slot assigners, the s/t and u interfaces in idl2 mode can match the qmc bus structureboth interfaces can be connected to a 2.048-mhz idl2 bus and route the b1 channel, b2 channel and d channel to any time slot. figure c-1 shows the idl2 bus con?gured to match the qmc protocol. figure c-1. idl2 bus structure for a connection to the qmc bus c.2 control and status information using the spi port, the quicc32 and the isdn interfaces exchange control and status information via out-of-band signaling. optionally, the mc145572s could use an 8-bit parallel port for control and status transfer, allowing the u interfaces to be connected to the processor bus. figure c-2 shows the connection between the quicc32 and an s/t interface. idl-clk idl-tx idl-rx b1 b2 d b1 b2 d ts2 ts1 ts0 ts3 ts31 ts30 b1 b2 d b1 b2 d b1 b2 d ts2 ts1 ts0 ts3 ts31 ts30 b1 b2 d idl-fsc f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . appendix c. connecting isdn multiple s/t or u interfaces to quicc32 figure c-2. idl and scp connections between the quicc32 and the s/t interface the quicc32 is always a slave on the idl bus, with the data clock (dcl) and frame sync (fsc) signals acting as inputs. as explained in section c.3, data clock (dcl) and frame sync (fsc) generation, this speci?c application requires the s/t interface be con?gured in slave mode on the idl bus, with external circuitry providing the dcl and fsc signals to both the quicc32 and the s/t interface. the d channel request/grant function is not required for this application since each s/t is assumed to be directly connected to the nt1 (that is, point-to-point con?guration with only one te connected to one nt). the dgnt signal is left unconnected, and dreq can be directly connected to vss. as there is no contention on the d channel, the d channel contention procedure of the mc145574 should be disabled by setting br7[6]. figure c-3 shows the connection between the quicc32 and a u interface. isdn s/t chip mc145574 quicc32 dcl din dout fsc dreq dgnt irq scpen l1clkx l1txdx l1rxdx l1sync irq gpi/o spiclk spitx spirx scpclk scprx scptx line interface nc vss te/nt m/s gnd vcc pull-up resistors on scpen and irq signals are not represented. * f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement figure c-3. idl and scp connections between the quicc32 and the u interface as with the s/t interface example, the u interface must be con?gured in slave mode with the dcl and fsc signals provided to both the quicc32 and the u interface. in slave mode, the fsx and fsr signals of the mc145572 must be connected together. there are no dreq/dgrant signals on the u interface. c.3 data clock (dcl) and frame sync (fsc) generation the main consideration when connecting multiple interfaces to the same physical medium is the clock and frame sync generation. as stated earlier, the quicc32 does not provide dcl and fsc signals. the u or s/t interface could be con?gured in master mode on the idl bus and generate both dcl and fsc synchronized to the line-interface signal. to have all the b- and d channels of a multi-interface system synchronized on the same tdm bus, only one s/t or u interface should be con?gured as master to provide common dcl and fsc signals to the quicc32 and all other interfaces. isdn u chip mc145572 quicc32 dcl din dout fsx fsr irq scpen l1clkx l1txdx l1rxdx l1sync irq gpi/o spiclk spitx spirx scpclk scprx scptx line interface pullup resistors on scpen and irq pins are not represented. * nt/lt m/s gnd vcc f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . appendix c. connecting isdn multiple s/t or u interfaces to quicc32 however, this con?guration works only if the single master s/t or u interface is guaranteed to be active, constantly generating synchronized dcl and fsc signals for the network. since the designated master transceiver cannot be guaranteed active, all transceivers must be con?gured in slave mode, and the problem of synchronization remains. dcl and fsc must be generated from within the network and cannot be derived from an independent source (e.g., crystal or oscillator). however, the s/t and u interfaces, even in slave mode, provide a way to generate these signals as explained in the following sections. c.3.1 mc145574 s/t interface to facilitate the generation of timing signals required by the slave idl interface, tclk is provided in the s/t interface. the tclk signal will output a clock synchronized to the received data transmitted by the nt. that clock is output only when the s/t interface is active and when the dcl and fsc signals are present (both conditions are required simultaneously). this tclk signal can be used to provide network timing. its frequency is selectable via the scp. the tclk signal of the mc145574 is enabled by setting or7[5]. br13[5] and br7[2] determine the tclk frequency as shown in table c-1. a tclk signal con?gured as a 2.048-mhz clock can be used as the dcl for the idl bus. dividing the tclk signal by 256 provides the 8-khz frame sync fsc. since the fsc must have a pulse between one dcl and eight dcls in width, additional logic may be needed after the divider to generate a signal with a correct duty cycle. figure c-4 and figure c-5 show a schematic and a timing diagram, respectively, for a logic design used to generate a 8-khz fsc with a 1-dcl width pulse from a 2.048-mhz clock (tclk). table c-1. tclk frequencies selected by br13[5] and br7[2] br13[5] br7[2] tclk 0 0 2.56 mhz 0 1 2.048 mhz 1 0 1.536 mhz 1 1 512 khz f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement figure c-4. fsc generation from a 2.048-mhz clockblock diagram figure c-5. fsc generation from a 2.048-mhz clocktiming the s/t interface includes elastic buffers allowing continued operation under any phase relationship between the idl frame sync and the network. these buffers allow the frame sync to wander with respect to the network up to 60 m s peak-to-peak, exceeding the q.502 requirements of 18 m s peak-to-peak over a 24-hour period. figure c-6 shows a block diagram of the connection between four s/t interfaces and the quicc32. the diagram would be the same for up to 10 s/t interfaces. 256 divider duty cycle of 50% 2.048-mhz 8-khz clock duty cycle 50% d clk q q d clk q q fsc 2.048- mhz 2.048-mhz flip-?op 1 flip-?op 2 clock clock clock 8-khz clock 2.048-mhz 2.048-mhz q flip-?op 1 q flip-?op 2 fsc 8 khz inverted clock clock f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . appendix c. connecting isdn multiple s/t or u interfaces to quicc32 figure c-6. connection between four s/t interfaces and the quicc32 quicc32 33 mhz ram rom flash mc145574 mc145574 mc145574 mc145574 idl2 tclk tclk tclk tclk idl2 idl2 idl2 irq irq irq irq irq 1 irq2 irq3 irq 4 idl2 scp sel spi i/o scpen1 scpen2 scpen3 scpen4 scpen scpen1 scpen scpen2 scpen scpen3 scpen scpen4 i/o tsa scc3 scc1 management port scc2 idl2 fsc idl2 dcl divider by 256 (frame sync generator) mux int irq 1 irq 2 irq 3 irq 4 s/t s/t s/t s/t brg4 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement c.3.1.1 activation procedure if no s/t transceiver is active, no tclk clock is generated. once the ?rst transceiver is activated, it will generate a tclk signal only if dcl and fsc signals are present as well. pseudo dcl and fsc signals generated from one of the baud rate generators (brg) of the quicc32 can be used to generate the tclk signal. the brg can generate a clock based on the quicc32s system clock. a divider factor should be chosen so that the brg frequency is close to 2.048 mhz. this clock then feeds into the 256-divider circuitry of figure c-4 to generate a pseudo dcl and a pseudo fsc. a multiplexer commanded by the quicc32 is required to select either the brg signal or the tclk signals of the transceivers to be the clock master generating the dcl and fsc signals. when no transceiver is activated, the quicc32 selects the brg to be the clock master, and the s/t interface receives the pseudo dcl and fsc signals. (these two signals are not synchronized to the network but are not used to sample data.) as the ?rst mc145574 is activated, it will be able to generate the tclk signal; see figure c-7. this transceiver will then send an interrupt to the quicc32 (irq3register nr3[3]meaning info 2 has been received) indicating that the activation process has begun. the quicc32 then uses the multiplexer to select the tclk signal of that mc145574 to be the clock master. as shown in figure c-7 and figure c-8, the tclk signal is present before the interruption, with at least 750 m s between the irq and the received info 4. the quicc32 therefore has 750 m s to react to the irq and to select the new clock master. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . appendix c. connecting isdn multiple s/t or u interfaces to quicc32 figure c-7. timing diagram for an activation initiated by the nt time (rx info 2) info 0 tx rx tx rx info 0 rx tx info 2 info 3 tx rx rx tx info 4 tclk irq3 irq3 irq3 te nt 1 2 3 1: 1250 to 1500 ms (= 5 to 6 s/t frames x 250 ms) 2: > 750 ms (= 3 s/t frames x 250 ms) 3: > 300 ms (rx info 3) (rx info 4) enabled f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement figure c-8. timing diagram for an activation initiated by the te time info 0 tx rx tx rx info 0 info 1 tx rx rx tx info 2 info 0 tx rx info 3 tx rx rx tx info 4 tclk irq3 irq3 irq3 irq3 irq3 te nt 1 2 3 4 5 1: 500 to 750 ms (= 2 to 3 s/t frames x 250 ms) 2: @ 0 m s 3: 1000 to 1500 ms (= 4 to 6 s/t frames x 250 ms) 4: > 1000 ms (= 4 s/t frames x 250 ms) 5: > 300 ms enabled (rx info2) (rx info 4) (rx info 3) (rx info 0) (rx info 1) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . appendix c. connecting isdn multiple s/t or u interfaces to quicc32 c.3.1.2 deactivation procedure when the clock-master s/t interface is deactivated, the quicc32 receives an interrupt indicating the deactivation status (irq3 register nr3 bit 3 meaning info 0 of figure c-9 has been received). then, if another s/t interface is active, its tclk signal must be selected to become the clock master; otherwise, the quicc32 can select the brg to be the clock master. as shown in figure c-9, the tclk signal is disabled about 72.8 m s after the interruption. therefore, the quicc32 has 72.8 m s to react to the irq and to select another clock master. figure c-9. timing diagram for a deactivation (always initiated by the nt) info 3 tx rx tx rx info 4 rx tx info 0 tclk irq3 te nt 1 2 1: 500 ms (= 2 s/t frames x 250 ms) 2: 72.8 ms (= 14 bit x 5.2 ms) info 0 tx rx irq3 disabled (rx info 0) (rx info 0) time f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement c.3.2 mc145572 u interface the freqref signal of the mc145572 provides a clock synchronized to the network timing for the u interface. this frequency reference is a ?xed 2.048-mhz clock enabled by setting or8[4] in the mc145572 register set. the u interfaces freqref differs from the tclk of the s/t interface. when enabled, the freqref signal generates the 2.048-mhz clock regardless of the activation status of the u interface (but that clock is synchronized to the network only when the u interface is activated). also, freqref does not require the dcl and fsc signals to enable clock generation. like the s/t interface, on the other hand, the freqref signal can be used as the dcl for the idl bus. when divided by 256, freqref can also be used to generate the 8-khz frame sync fsc. the same logic design used for the s/t interface must be added to insure a correct fsc duty cycle; see figure c-4. also like the s/t interface, elastic buffers are included to allow the u interface to operate with any phase relationship between the idl frame sync and the network. figure c-10 shows a block diagram of the connection between four u interfaces and the quicc32. the diagram would be the same for up to 10 u interfaces. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . appendix c. connecting isdn multiple s/t or u interfaces to quicc32 figure c-10. connection between four u interfaces and the quicc32 quicc32 33 mhz ram rom flash mc145572 mc145572 mc145572 mc145572 idl2 freqref freqref freqref freqref idl2 idl2 idl2 irq irq irq irq irq 1 irq2 irq3 irq 4 idl2 scp sel spi i/o scpen1 scpen2 scpen3 scpen4 scpen scpen1 scpen scpen2 scpen scpen3 scpen scpen4 i/o tsa scc3 scc1 management port scc2 idl2 fsc idl2 dcl divider by 256 (frame sync generator) mux int irq 1 irq 2 irq 3 irq 4 u dc metallic termination u dc metallic termination u dc metallic termination u dc metallic termination f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement c.3.2.1 activation procedure during the initialization, the freqref signal of each u interface is enabled. a multiplexer commanded by the quicc32 is used to select the u interface clock master. when the ?rst mc145572 is activated, its freqref signal synchronizes to the network. the mc145572 then sends an interrupt to the quicc32 (irq1 register nr3[1] meaning uao = 1 has been received) indicating that the activation process has begun. before responding to lt with act = 1 (which will enable the data transfer), the quicc32 can select, through the multiplexer, this particular freqref signal to be the clock master. since the quicc32 has the initiative to enable the data transfer, there is no timing constraint to react to the interrupt. c.3.2.2 deactivation procedure according to the ansi speci?cation t1.601-1988, prior to deactivating, the lt should notify the nt of the pending deactivation by clearing the m4 channel dea bit towards the nt for at least three superframes. then, the nt can be deactivated by sending a deactivation request. the mc145572 not only has the ability to generate an interrupt after the reception of the third dea bit = 0, but also after the reception of the second dea bit = 0. when the clock-master u interface is deactivated, the quicc32 receives an interrupt indicating that the second dea bit = 0 has been received. the quicc32 has then the ability to select another activated u interface (if there is one), to be the clock master. the quicc32 has 12 ms (1 superframe) until receiving the next dea bit = 0, indicating the pending deactivation, and therefore 12 ms to react to the interrupt. if none of the u interfaces are activated, no change in the multiplex selection is required. c.3.3 system con?guration the following sections provide a checklist of the main features that need to be con?gured for each device. c.3.3.1 s/t-interface con?guration do the following for an s/t-interface con?guration: ? idl2 with time slot assigner (tsa enabled in reg. or6[5C7]; tsa selection in or0 to or5) ? slave mode (dcl & fsc are input) - (pin m/s to gnd) ? tclk enabled at 2.048 mhz (or7[5] = 1; br13[5] = 0; br7[2] = 1) ? d channel contention procedure disabled (br7[6] = 1) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . appendix c. connecting isdn multiple s/t or u interfaces to quicc32 c.3.3.2 u-interface con?guration do the following for u-interface con?guration: ? idl2 with time slot assigner (tsa enabled in reg. or6[5C7]; tsa selection in reg. or0 to or5) ? slave mode (dcl & fsc are input) - (pin m/s to gnd) ? freqref enabled at 2.048 mhz (reg. or8[4] = 1) c.3.3.3 quicc32 con?guration do the following for quicc32 con?guration: ? scc3 using the qmc protocol for handling the different channels of the multiplexed idl2 bus. (d channels are hdlc encoded/decoded and b-channels can be con?gured for transparent or hdlc framing) ? scc1 can be con?gured for ethernet, hdlc, transparent, or uart. ? scc2 and scc4 can be con?gured for hdlc, transparent, or uart. ? the spi is connected to the scp port of each s/t or u interface for handling con?guration and control information. ? for the u interface, the spi/scp connection can be replaced by a connection of the 8-bit parallel port of the u transceiver to the processor bus of the quicc. ? one i/o signal can be dedicated for handling the scpen signal of each s/t or u interface. ? one interrupt signal can be dedicated for handling the irq signal of each s/t or u interface. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . index index a acronyms and abbreviations, xiii alignment non-octet alignment data, 5-4 b bibliography of additional reading, xii bit numbering, mc68360, a-1 buffer descriptor buffer descriptor tables, 2-4 data buffer pointer, 2-5 placement, 5-7 rxbd, 5-1 txbd, 5-5 bus latency and peak load, 8-5 c channel channel addressing capability, 1-2 channel pointers mcbase, 2-4 rbase, 2-4 tbase, 2-4 time slot assignment, 2-4 tsatrx, 2-9 tsattx, 2-9 channel-specific parameters, 2-14, 6-18 channel-specific transparent parameters, 2-20 common combinations, 8-1 interrupt processing flow, 4-7 interrupt table entry, 4-5 circular interrupt table, external memory, 4-1 commands receive, 3-2 transmit, 3-1 configuration difficulties, mc68mh360, 5-20 conventions, xii cpm loading, 8-2 d data clock generation, c-4 disabling receiver/transmitter, 6-17 e e1/t1 frame description, 1-11 echo mode, 1-5 errors global error events, 4-2 si ram, 1-10 ethernet mc68mh360 configuration, 5-20 routing examples, 1-6C1-9 exceptions channel interrupt processing flow, 4-7 interrupt table entry, 4-5 overview, 4-1 txb, 5-6 f features deleted, 7-1 summary, list, 1-3 frame sync generation, c-4 frequently asked questions (faq), b-1 g global error events description, 4-2 restart, 4-3, 6-17 global multichannel parameters, 2-5, 6-18 global overrun, 4-3 global underrun, 4-3 i interrupt table entry, 4-5, a-3, a-4 inverted signals, 1-5 isdn connection to quicc32, c-1 l latency bus latency and peak load, 8-5 simulated latencies, 8-6 loading cpm loading, 8-2 peak load and bus latency, 8-5 loopback mode, 1-5 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement index m mc68mh360 ethernet configuration, 5-20 memory circular interrupt table, external memory, 4-1 internal memory structures mc68mh360, 2-1, 5-7 mpc860mh, 2-1, 5-14 memory organization, 2-1 memory structure, 2-2 qmc memory organization, 9-7 multichannel parameters and scc base, 2-3 multi-subchannel microcode (msc) features list, 9-1 initialization, 9-8 operation, 9-2 programming the msc protocol, 9-3 subchanneling example, 9-6 n nonmulitplexed serial interface (nmsi) mode, 1-4 p parameters channel-specific parameters, 2-14 hdlc parameters, 2-14 ram usage over several sccs, 5-9 scc2 parameter ram overlap (example), 5-8 transparent parameters, 2-20 peak load and bus latency, 8-5 performance issues, 8-1 pointers channel pointers mcbase, 2-4 rbase, 2-4 tbase, 2-4 time slot assignment, 2-4 tsatrx, 2-9 tsattx, 2-9 data buffer, 2-5 pointer registers, 6-17 table pointers time slot assignment, 2-3 q qmc channel addressing capability, 1-2 commands, 3-1 common channel combinations, 8-1 features list, 1-3 global parameters, 2-5 initialization, 6-1 mc68mh360 configuration, 5-20 protocol, 1-1, c-1 ram usage over several sccs, 5-9 routing table changes, 1-10 quicc overview, 1-1 quicc32 protocol, c-1 r ram channel-specific parameters, 2-14 dual-ported base, 2-3 scc2 parameter ram overlap (example), 5-8 si ram errors, 1-10 registers command register, a-4 hdlc mode chamr, 2-15, a-3 interrupt table entry, a-3 intmsk, 2-18, a-3 rstate, 2-19, a-3 tstate, 2-17, a-3 pointer registers, 6-17 rxbd, a-5 scc mask, a-5 scce, 4-3, a-5 state registers, 6-18 transparent mode chamr, 2-21, a-4 interrupt table entry, a-4 intmsk, 2-24, a-4 rstate, 2-28, a-4 trnsync, 2-24 tstate, 2-23, a-4 txbd, a-5 risc processor, 9-1 routing examples (serial), 1-6 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . index index s scc base parameters, 2-3 changing qmc routing tables, 1-10 global multichannel parameters, 2-3, 2-5 multiple assignment tables, 2-10 ram usage over several sccs, 5-9 serial interface (si), 1-4 serial routing examples, 1-6 si ram errors, 1-10 signals, inverted, 1-5 synchronization, 1-5 t tdm interface connecting to a tdm bus, 1-13 time slot assigner (tsa) overview, 1-4 pointers, 2-3 tsa tables 32 channels over 2 scc, 2-11 64 channels over 2 sccs, 2-13 64-channel common rx/tx mapping, 2-10 msc configuration, 9-4 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . qmc supplement index f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . overview qmc memory organization qmc commands qmc exceptions buffer descriptors qmc initialization features deleted in mc68mh360 performance multi-subchannel (msc) microcode 68360 bit numbering frequently-asked questions connecting isdn interfaces to quicc32 index 1 2 3 4 5 6 8 7 b c ind 9 a f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . overview qmc memory organization qmc commands qmc exceptions buffer descriptors qmc initialization features deleted in mc68mh360 performance multi-subchannel (msc) microcode 68360 bit numbering frequently-asked questions connecting isdn interfaces to quicc32 index 1 2 3 4 5 6 8 7 a b ind c 9 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . |
Price & Availability of MC68MH360AI33L
![]() |
|
|
All Rights Reserved © IC-ON-LINE 2003 - 2022 |
[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy] |
Mirror Sites : [www.datasheet.hk]
[www.maxim4u.com] [www.ic-on-line.cn]
[www.ic-on-line.com] [www.ic-on-line.net]
[www.alldatasheet.com.cn]
[www.gdcy.com]
[www.gdcy.net] |