| The Datasheet Archive - 100 Million Datasheets from 7500 Manufacturers. |
Paul Wilson NCSD Applications Scotland embedded systems become mo
Top Searches for this datasheetAN2661 Rev. 5/2004 Software Migration from (AMCC) 440GP MPC8540 Paul Wilson NCSD Applications Scotland embedded systems become more complex, software complexity become deciding factor when architecting system. cost porting code sometimes offset benefits that come with additional features processor platform. Fortunately, software migration easy, especially when staying within processor core architecture. This document details device driver lower-level software migration from 440GP Embedded PowerPCprocessor recently acquired Applied Micro Circuits Corporation (AMCC) Motorola's PowerQUICC IIIproduct family. both processors PowerPC based, software migration caveats, leaving architects with decisions based more hardware functionality processor feature sets. this application note following topics addressed: Topic Section "Feature Comparison" Section "Software Migration Overview" Section "DDR SDRAM" Section "Interrupt Controller" Section "General Purpose Timers" Section "DMA Transfers" Section "Buffer Descriptors" Section "Ethernet" Section "UART" Section "I2C" Section "PCI-X" Section "Conclusions" Section "Document Revision History" Page More Information This Product, www.freescale.com Feature Comparison Feature Comparison SDRAM memory controller Fast Ethernet controllers 32-/64-bit PCI-X UART capability Peripheral 440GP embedded PowerPC processor includes PowerPC core (based 32-bit implementation Book architecture) well following integrated peripherals: Motorola's PowerQUICC architecture based latest embedded PowerPC architecture Book definition uses high performance e500 core with 256-Kbytes Level cache. PowerQUICC also offers integrated 10/100/1000 three-speed Ethernet controllers (TSEC), SDRAM memory controller, 64-bit PCI-X/PCI controller, RapidIO interconnect. MPC8540 MPC8560 latest PowerQUICC integrated communication processors: MPC8540 integrated host processor Ethernet only options (two 10/100/1000 Mbps interfaces 10/100 Mbps interface) with dual UART interfaces designed provide highest level performance integration lower system cost. MPC8560 integrated communication processor. This device differs from MPC8540 that includes dedicated RISC communications controller (referred CPM) handling communication protocols. MPC8560 supports fast serial communications channels (FCCs) Mbps ATM, 10/100 Ethernet, HDLC rates. Support full-duplex, time-division-multiplexed (TDM) channels using multi-channel controllers (MCCs) provided. addition, MPC8560 supports four serial communications controllers (SCCs), serial peripheral interface (SPI), interface. this application note will specifically discuss software migration from 440GP embedded PowerPC processor Motorola MPC8540 PowerQUICC processor. comparison these devices, highlighting features common both processors shown Table features 440GP shown subset features found MPC8540, enabling easy hardware migration PowerQUICC family. further investigation, features common both processors somewhat similar from software point view. This enables reasonable easy migration from 440GP MPC8540 from both hardware software prospective. Software Migration from (AMCC) 440GP MPC8540 MOTOROLA More Information This Product, www.freescale.com Software Migration Overview Table Feature Comparison 440GP versus MPC8540 Feature Core frequency Core architecture cache (I/D) SRAM/L2 cache 440GP 32-bit Book PowerPC 32-/32-Kbytes 8-Kbytes SRAM/No MPC8540 32-bit Book PowerPC 32-/32-Kbytes 256-Kbytes 256-Kbytes SRAM 128-/128-Kbytes 32-/64-bit, Gbytes external/22 internal 8-bit parallel RapidIO v2.2 33/66 PCI-X 10/100 10/100/1 Gbit 0.13 controller User programmable memory controller Interrupt controller channels RapidIO PCI-X (32-/64-bit) Ethernet UART 32-/64-bit, Gbytes external/45 internal v2.2 33/66 PCI-X 10/100 0.25 Technology Power Software Migration Overview High-level software such RTOS (real-time operating system) high-level applications running RTOS (for example, server) should affected processor selection. RTOS typically utilizes board support package (BSP) order communicate with underlying hardware, this subject change with hardware. Changes outside scope this document, since these changes only RTOS dependent, hardware dependent well. Device drivers most affected software element when migrating hardware platform. term `device driver' concerned with communication with anything external processor through mechanisms internal processor. This includes, limited interrupt handling, Ethernet physical layer devices (PHYs) through internal MAC, memory devices through DDR-SDRAM memory controller, RS-232 transceivers through UART interface, internal controller. porting code from 440GP MPC8540, differences features common both processors will discussed. Namely: SDRAM controller Interrupt controller General purpose timers transfers MOTOROLA Software Migration from (AMCC) 440GP MPC8540 More Information This Product, www.freescale.com SDRAM Ethernet UART PCI-X byte ordering 440GP MPC8540 big-endian, enabling easy software migration. SDRAM 440GP programmable SDRAM controller which supports SDRAMs provide 64-bit interface SDRAM memory with optional error checking correction (ECC). controller supports page mode operation with bank interleaving always active maintain eight open pages. controller supports four 512-Mbytes logical banks limited configurations, providing memory Gbytes. Global memory timings, address bank sizes, memory addressing modes programmable. System power reduced placing SDRAM controller sleep and/or self-refresh mode. PowerQUICC fully programmable SDRAM controller which supports JEDEC complaint DDR-I SDRAM standard memories (333-MHz data rate) with optional ECC. PowerQUICC supports page mode operation retain currently active SDRAM page pipelined burst accesses simultaneously open pages each memory bank). Fourteen multiplexed address signals logical bank signals provide support device densities Mbits Gbits. Four chip select signals provided support physical banks memory each from Mbytes Gbytes size DIMM modules. these banks provide theoretical maximum 4-Gbytes main memory, Gbytes could span entire 32-bit address space. However, since space must reserved boot ROM, configuration registers other important addressable locations, maximum memory limited Gbytes. Many similarities exist between integrated DDR-SDRAM controllers MPC8540 440GP follows: However, configuration DDR-SDRAM slightly different explained following sections. 440GP DDR-SDRAM Controller 440GP utilizes indirectly accessed registers configuration SDRAM controller. These registers accessed through SDRAM0_CFGADDR SDRAM0_CFGDATA registers. system reset processor, software must configure then enable SDRAM controller. registers used configuration 440GP SDRAM controller shown following tables. Table shows SDRAM0_CFG0 register which enables specific features SDRAM controller. Software Migration from (AMCC) 440GP MPC8540 MOTOROLA More Information This Product, www.freescale.com SDRAM Table 440GP SDRAM0_CFG0 Bits Name DCEN MCHK RDEN DMWD UIOS Description SDRAM controller enabled/disabled enabled/disabled Registered DIMM enabled/disabled Page management unit enabled/disabled SDRAM width 64-bit Unused state Page deallocation policy Undocumented bits reserved. Table shows SDRAM0_CFG1 register which enables SDRAM controller power management self-refresh features. Table 440GP SDRAM0_CFG1 Bits Name PMEN Self-refresh entry Description Power management enabled/disabled Undocumented bits reserved. Table shows SDRAM0_DEVOPT register which allows configuration defined SDRAM device specific options. Table 440GP SDRAM0_DEVOPT Bits Name Description SDRAM device enabled/disabled SDRAM device drive strength Undocumented bits reserved. 440GP SRAM controller supports four logical banks. Table shows SDRAM0_BnCR registers which configure enable memory each logical bank. Table 440GP SDRAM0_BnCR Bits 12-14 16-18 Name SDBA SDSZ SDAM SDBE Base address DDR-SDRAM size Description SDRAM address mode/memory organization Memory bank enabled Undocumented bits reserved. MOTOROLA Software Migration from (AMCC) 440GP MPC8540 More Information This Product, www.freescale.com SDRAM Table shows SDRAM0_TR0 register which used configure DDR-SDRAM device specific timing parameters. Table 440GP SDRAM0_TR0 Bits 12-13 14-15 Name SDWR SDWD SDCL SDPA SDCP SDLD SDRA SDRD Description SDRAM write recovery SDRAM write-to-write delay SDRAM latency SDRAM precharge command next activate command minimum SDRAM read/write precharge command command SDRAM command leadoff SDRAM refresh command next activate SDRAM delay 16-17 27-29 30-31 Undocumented bits reserved. SDRAM0_TR1 register used control various aspects SDRAM read data path. MPC8540 DDR-SDRAM Controller MPC8540 DDR-SDRAM controller registers directly accessed shown following tables. Table shows chip select memory bound registers (CSn_BNDS) which define address range memory banks controlled that chip select. Table MPC8540 CSn_BNDS Bits 16-23 Name Description Starting address chip select (bank) address chip select (bank) Undocumented bits reserved. Table shows chip select configuration registers (CSn_CONFIG) which define memory organization (number row/columns). Table MPC8540 CSn_CONFIG Bits 21-23 29-31 Name CS_n_EN AP_n_EN Chip select enable Description Chip select auto precharge enable bits SDRAM chip select column bits SDRAM chip select Undocumented bits reserved. Software Migration from (AMCC) 440GP MPC8540 MOTOROLA More Information This Product, www.freescale.com SDRAM Table shows SDRAM timing configuration register (TIMING_CFG1) which used define timing intervals between various SDRAM control commands. Table MPC8540 TIMING_CFG1 Bits 9-11 13-15 16-19 22-23 Name PRETOACT ACTTOPRE ACTTORW CASLAT REFREC WRREC ACTTOACT WRTORD Description Precharge activate interval (trp) Activate precharge interval (tras) Activate read/write interval SDRAM (trcd) latency from read command Refresh recovery time (trfc) Last data precharge interval (twr) Activate activate interval (trrd) Last write data pair read command issue internal (twtr) 25-27 30-31 Undocumented bits reserved. Table shows SDRAM configuration register (DDR_SDRAM_CFG) which used enable/disable features memory controller including: self-refresh, ECC, dynamic power management. Table MPC8540 DDR_SDRAM_CFG Bits Name MEM_EN SREN ECC_EN RDEN Description SDRAM controller enabled/disabled Self-refresh enable enable Registered DIMM enabled/disabled SDRAM_TYPE Type SDRAM device used DYN_PWR Dynamic power management enabled/disabled Undocumented bits reserved. Table shows SDRAM mode configuration (DDR_SDRAM_Mode) which used define mode registers SDRAM device. Table MPC8540 DDR_SDRAM_MODE Bits 0-15 16-31 Name ESDMODE SDMODE Extended SDRAM mode SDRAM mode Description MOTOROLA Software Migration from (AMCC) 440GP MPC8540 More Information This Product, www.freescale.com SDRAM Table shows SDRAM interval configuration (DDR_SDRAM_INTERVAL) which used configure precharge refresh intervals. Table MPC8540 DDR_SDRAM_INTERVAL Bits 18-31 Name REFINT BSTOPRE Refresh interval Precharge interval Description Undocumented bits reserved. Porting SDRAM MPC8540 been seen previous sections, similarities exist between SDRAM controller 440GP MPC8540, although exact register formats different. MPC8540 DDR-SDRAM controller registers directly accessed CPU, however, 440GP SDRAM controller registers indirectly accessed CPU. features SDRAM controller registers from 440GP MPC8540 shown Table Table Register Mapping 440GP MPC8540 Feature Refresh enable/timer latency (taa) Precharge activate timing (trp) Activate precharge (tras) Refresh recovery timing (trfc) Activate read/write timing (trcd) Write recovery (twr) Power management enable SDRAM disabled SDRAM base address SDRAM size Memory organization Memory bank enabled 440GP Register SDRAM0_CFG1[SRE] SDRAM0_TR0[SDCL] SDRAM0_TR0[SDPA] SDRAM0_TR0[SDCP] SDRAM0_TR0[SDRA] SDRAM0_TR0[SDCP] SDRAM0_TR0[SDWR] SDRAM0_CFG1[PMEN] SDRAM0_DEVOPT[DLL] SDRAM0_BnCR[SDBA] SDRAM0_BnCR[SDSZ] SDRAM0_BnCR[SDBA] SDRAM0_BnCR[SDBE] MPC8540 Register DDR_SDRAM_CFG[SREN] DDR_SDRAM_INTERVAL[REFINT] TIMING_CFG_1[CASLAT] TIMING_CFG_1[PRETOACT] TIMING_CFG_1[ACTTOPRE] TIMING_CFG_1[REFREC] TIMING_CFG_1[ACTTORW] TIMING_CFG_1[WRREC] DDR_SDRAM_CFG[DYN_PWR] LCRR[DBYP] CSn_BNDs[SAn] CSn_BNDs[SAn] [EAn] CSn_CONFIG[ROW_BIT_CS_n] CSn_CONFIG[COL_BIT_CS_n] CSn_CONFIG[CS_n_EN] 440GP uses pre-defined `modes' (SDRAM0_BnCR[SDRAM]) each logical bank, which defines supported DDR-SDRAM configuration. This mode combined with size (SDRAM0_BnCR[SDSZ]) memory initializes DDR-SDRAM memory controller address muliplexing (precharge pin) settings. Software Migration from (AMCC) 440GP MPC8540 MOTOROLA More Information This Product, www.freescale.com Interrupt Controller MPC8540 uses CSn_CONFIG registers each logical bank, define DDR-SDRAM configuration terms number columns. These settings combined with size (CSn_BNDs) memory initialize DDR-SDRAM memory controller address muliplexing (precharge pin) settings. Interrupt Controller Many similarities exist between interrupt controllers 440GP MPC8540. However, configuration interrupt controllers again different. 440GP Interrupt Controller 440GP contains universal interrupt controllers (UIC0 UIC1) that provide necessary control, status, communication between internal interrupts, external interrupts, processor core. UICs cascaded shown Figure Interrupt Sources Non-Critical Interrupt Processor Core Critical Interrupt Non-Critical Interrupt Interrupt Sources UIC1 Critical Interrupt UIC0 Figure 440GP Overview UIC0 collects interrupts from internal external sources, including critical non-critical interrupt outputs secondary interrupt controller, UIC1. Table shows registers used configuration 440GP universal interrupt controller. Table 440GP Interrupt Controller Registers Offset 0x0C0 0x0D0 0x0C2 0x0D2 0x0C3 0x0D3 0x0C4 0x0D4 0x0C5 0x0D5 Name UIC0_SR UIC1_SR UIC0_ER UIC1_ER UIC0_CR UIC1_CR UIC0_PR UIC1_PR UIC0_TR UIC1_TR Description status register status register enable register enable register critical register critical register polarity register polarity register trigger register trigger register MOTOROLA Software Migration from (AMCC) 440GP MPC8540 More Information This Product, www.freescale.com Interrupt Controller Table 440GP Interrupt Controller Registers (continued) Offset 0x0C6 0x0D6 0x0C7 0x0D7 0x0C8 0x0D8 Name UIC0_MSR UIC1_MSR UIC0_VCR UIC1_VCR UIC0_VR UIC1_VR Description masked status register masked status register vector configuration register vector configuration register vector register vector register status registers (UIC0_SR UIC1_SR) used capture hold internal external interrupts until they reset software writing interrupt (bit) location these registers. fields enable registers (UIC0_E UIC1_ER) match status registers used enable disable reporting interrupts status registers. Similarly, fields critical registers (UIC0_CR UIC1_CR) determine whether interrupt captured status registers generates non-critical critical interrupt. fields priority registers (UIC0_PR UIC1_PR) determine whether interrupt captured status registers positive negative priority. fields trigger registers (UIC0_TR UIC1_TR) determine whether interrupt captured status registers edge-sensitive level-sensitive. masked status registers (UIC0_MSR UIC1_MSR) read-only registers which contain result masking status registers (UIC0_SR UIC1_SR) enable registers (UIC0_E UIC1_ER). This allows software check which enabled interrupts active. vector configuration registers (UIC0_VCR UIC1_VCR) write-only registers which enable software control interrupt vector generation critical interrupts only. These registers contain address, used interrupt vector base address (VBA), field specifying interrupt ordering priority (PRO). field contains either base address interrupt handler vector table base address interrupt handler associated with each interrupt. actual interrupt vector (the address interrupt handler that services interrupt) generated vector registers (UIC0_VR UIC1_VR) using VBA. field controls whether interrupt associated with UICn_SR[0] UICn_SR[31] highest priority. UICn_VCR[PRO] interrupt associated with UICn_SR[31] highest priority; UICn_VCR[PRO] interrupt associated with UICn_SR[0] highest priority. closest highest priority field that programmed UICn_CR interrupt second highest priority. Priority decreases across UICn_SR opposite highest priority field. MPC8540 Interrupt Controller MPC8540 programmable interrupt controller (PIC) compliant with OpenPIC architecture supports external, internal interrupt sources, inter-processor interrupts, global timers, message registers. reset using global configuration register (GCR). addition, this same register used program operate modes: Pass through mode. external active high interrupt request IRQ0 directly passed e500 core. other external requests ignored internal interrupts passed IRQ_OUT signal. Software Migration from (AMCC) 440GP MPC8540 MOTOROLA More Information This Product, www.freescale.com Interrupt Controller Mixed mode. External internal interrupts delivered according programmed options (IRQ_OUT e500 interrupt destination registers). Each interrupt source (except inter-processor interrupts) interrupt destination register, which determines destination that interrupt: external sources-EIDR0-EIDR11 internal sources-IIDR0-IIDR31 messaging sources-MIDR0-MIDR3 timer sources-GTDR0-GTDR3 Core_int (e500 interrupt) Core_cint (e500 critical interrupt) IRQ_OUT (external pin) There three interrupt destinations possible interrupt basis: Each interrupt source interrupt vector/priority register configure priority (there programmable interrupt priority levels interrupt), vector, masking, polarity/sensing (for external interrupt sources only). external sources-EIVPR0-EIVPR11 internal sources-IIVPR0-IIVPR31 messaging sources-MIVPR0-MIVPR3 timer sources-GTVPR0-GTVPR3 inter-processor sources-IPIVR0-IPIVR3 There critical interrupt summary registers (CISR0 CISR1), which determine active interrupt directed processor's critical interrupt signal, Core_cint. There CTPR (processor current task priority register) used software current task priority being executed core. current priority interrupt should higher than value CTPR serviced. IACK (processor interrupts acknowledge register), response interrupt should read software obtain vector interrupt being serviced. Reading IACK also following side effects: associated field interrupt pending register cleared edge-sensitive interrupts. in-service register (ISR) updated. interrupt signal (int cint) processor negated. Writing (end interrupt) register, signals processing highest-priority interrupt currently in-service processor. write updates retiring highest priority interrupt. nested interrupts, processor servicing interrupt, only interrupted again receives interrupt request from source with higher priority than currently being serviced. This true even software, part interrupt service routine, writes lower value into CTPR. Thus, although several interrupts in-service simultaneously, code currently executing always handling highest priority interrupts that service. When processor performs cycle, this highest priority interrupt taken out-of-service. next cycle takes next-highest priority interrupt out-of-service, interrupt with lower priority than those currently in-service started until higher priority interrupts complete even priority greater than CTPR value. MOTOROLA Software Migration from (AMCC) 440GP MPC8540 More Information This Product, www.freescale.com Interrupt Controller addition, MPC8560 device, there separate interrupt controller which manages, prioritizes, routes interrupts from serial peripheral parallel ports PIC. Porting Interrupts MPC8540 Similarities exist between interrupt controller 440GP MPC8540, although exact register formats different. features interrupt controller registers from 440GP MPC8540 shown Table Table Mapping Features 440GP Interrupt Controller PowerQUICC Feature Enabling/masking interrupts 440GP Register UIC0_ER-UIC1_ER UIC0_MSR-UIC1_MSR MPC8540 Register Mask field following registers: EIVPR0-EIVPR11 IIVPR0-IIVPR31 IVPR0-MIVPR3 GTVPR0-GTVPR3 IPIVR0-IPIVR3 Activity field following registers: EIVPR0-EIVPR11 IIVPR0-IIVPR31 IVPR0-MIVPR3 GTVPR0-GTVPR3 IPIVR0-IPIVR3 CISR0 CISR1 Polarity field following registers: EIVPR0-EIVPR11 IIVPR0-IIVPR31 IVPR0-MIVPR3 GTVPR0-GTVPR3 IPIVR0-IPIVR3 Sense field following registers external interrupt sources only: EIVPR0-EIVPR11 Priority vector fields following registers: EIVPR0-EIVPR11 IIVPR0-IIVPR31 IVPR0-MIVPR3 GTVPR0-GTVPR3 IPIVR0-IPIVR3 Interrupt status UIC0_SR-UIC1_SR Critical interrupts Interrupt polarity UIC0_CR-UIC1_CR UIC0_PR-UIC1_PR Edge level sensitive UIC0_TR-UIC1_TR Vector/prioritization UIC0_VR-UIC1_VR UIC0_VCR-UIC1_VCR 440GP defines separate registers different features interrupt controller. MPC8540 defines registers each interrupt source which determines: polarity, vector/prioritization, sensing, interrupt status, interrupt source enabled. 440GP, critical interrupts, only fixed priority levels defined priority field vector configuration registers. MPC8540 more flexible interrupt controller which defines interrupt vector/priority register each interrupt source which used configure levels priority. Software Migration from (AMCC) 440GP MPC8540 MOTOROLA More Information This Product, www.freescale.com General Purpose Timers General Purpose Timers Timer facilities (including time base, decrementer, fixed internal timer (FIT), watchdog) between 440GP MPC8540 Book implementation identical will discussed this section. However, configuration general purpose timers differs somewhat. 440GP General Purpose Timers 440GP supports general purpose timer (GPT) with maskable compare registers 32-bit time base counter. Each compare register corresponding interrupt universal interrupt controller (UIC). interrupts generated specific count match between contents compare register time base counter. interrupts also generated specific interval masking individual bits compare register. MPC8540 General Purpose Timers MPC8540 supports four global (general purpose timers) which programmable within programmable interrupt controller. There appropriate clock prescalers synchronizers provide time base four internal timers unit. timers individually programmed generate processor interrupt when they count down zero used generate regular periodic interrupts. Each timer four configuration control registers. They follows: Global timer current count register (GTCCRn) Global timer base count register (GTBCRn) Global timer vector-priority register (GTVPRn) Global timer destination register (GTDRn) timer frequency four timers determined timer frequency reporting register (TFRR), timer interrupts edge-triggered interrupts. timer period expires while previous interrupt from same source pending in-service, subsequent interrupt lost. timer control register (TCR) provides users with ability create timers larger than 31-bit global timers. 16-bit timers internally cascaded form 32-bit counter. Timer internally cascaded timer timer internally cascaded timer timer global configuration registers (TGCRs) used timers into cascaded mode. option also exists change timer frequency setting appropriate fields TCR. Porting General Purpose Timers MPC8540 Similarities exist between general purpose timers 440GP MPC8540, although exact register formats different. Table illustrates general purpose timer registers from 440GP MPC8540. Table Mapping Features 440GP MPC8540 Feature Number timers Time base counter Compare timers 440GP Register GP0_TBC GP0_COMP0-4 GP0_MASK0-4 MPC8540 Register GTBCR0-3 GTCCR0-3 MOTOROLA Software Migration from (AMCC) 440GP MPC8540 More Information This Product, www.freescale.com Transfers Table Mapping Features 440GP MPC8540 (continued) Feature Interrupt enable/status information Polarity (for external trigger) Status information 440GP Register GPT0_ISS, GPT0_ISC, GPT0_IE DMA0_POL DMA0_SR MPC8540 Register GTVPR0-3 programmable. DGSR Transfers 440GP Controller 440GP controller provides four channels. Each channel control, count control, source address, destination address, scatter/gather address registers (see Table 17). Table 440GP Controller Registers Offset 0x100 0x101 0x102 0x103 0x104 0x105 0x106 0x107 0x108-0x11F 0x120 0x123 0x125 0x125 Name DMA0_CR0 DMA0_CTC0 DMA0_SAH0 DMA0_SAL0 DMA0_DAH0 DMA0_DAL0 DMA0_SGH0 DMA0_SGL0 DMA0_SR DMA0_SGC DMA0_SLP DMA0_POL Description channel control register count control register source address high register source address register description address high register description address register scatter/gather address high register scatter/gather address register above channels status register scatter/gather command register sleep mode register polarity configuration register When these registers have been programmed user, controller performs requested data transfer between memory peripherals memory-to-memory without need host intervention. external peripheral transfers, three external signals supported each channel follows: DMAReqn-DMA request used request data transfer DMAAckn-DMA acknowledge used instruct peripheral start transfer EOTn[TCn]-End transfer terminal count signal used stop channel. polarity configuration register (DMA0_POL) used polarity (active state) external DMAI/O signals: DMAReqn, DMAAckn, EOTn[TCn]. Software Migration from (AMCC) 440GP MPC8540 MOTOROLA More Information This Product, www.freescale.com Transfers channel control registers (DMA0_CR0-DMA0_CR3) used configure enable their respective channels. Configuration settings include transfer modes, width, channel priority. Before channel transfer data, channel control, count control, source address, destination address registers must programmed. count control registers (DMA0_CT0-DMA0_CT3) contain number transfers remaining transaction their respective channels when EOTn[TCn] programmed terminal count output, along with additional channel control information. addition, these registers contain fields used enable interrupts terminal count, transfer, error conditions. Other fields enable parity checking during peripheral portion peripheral type. source address registers (DMA0_SAHn DMA0_SALn) contain source address memory-to-memory memory-to-peripheral transfers. destination address registers (DMA0_DAH0-DMA0_DAH3 DMA0_DAL0-DMA0_DAL3) contain destination address memory-to-memory peripheral-to-memory transfers. status register (DMA0_SR) provides status information each channels. sleep mode register (DMA0_SLP) enables controller enter sleep (low-power) mode after programmed number idle cycles. Each four channels supports scatter/gather transfers. This scatter/gather capability allows chaining multiple controller operations within channel. When channel setup scatter/gather transfers (DMA0_SGC[SSGn] scatter/gather descriptor address registers (DMA0_SGH0-DMA0_SGH3 DMA0_SGL0-DMA0_SGL3) contain memory address next scatter/gather descriptor table. Prior starting scatter/gather transfer, software must write address channel's descriptor table DMA0_SGHn DMA0_SGLn. Once scatter/gather transfer starts, DMA0_SGHn DMA0_SGLn automatically updated from descriptor table. scatter/gather command register (DMA0_SGC) determines start scatter/gather transfers enabled channels With normal transfer, necessary program channel's control, count control, source, destination registers each transfer. scatter/gather capability controller provides more efficient solution applications that require multiple transactions single channel. Instead individually programming channel's registers, software creates (linked list) descriptor tables system memory. configure channel scatter/gather transfer, scatter/gather descriptor address registers (DMA0_SGHn DMA0_SGLn) channel address first descriptor table, which must quadword (16-byte) aligned. format these descriptor tables shown Figure Byte Word Word Word Word Word Word Word Word Byte Byte Byte Channel Control Word (DMA_CRn) Configuration Bits Count (DMA_CTCn) Source Address High (DMA_SAHn) Source Address (DMA_SALn) Destination Address High (DMA_DAHn) Destination Address (DMA_DALn) Linked Next Scatter/Gather Descriptor Address High (DMA_SGHn) Linked Next Scatter/Gather Descriptor Address (DMA_SGLn) word link (LK). Figure Descriptor Table Format MOTOROLA Software Migration from (AMCC) 440GP MPC8540 More Information This Product, www.freescale.com Transfers begin scatter/gather transfer, software writes DMA0_SGC register follows: Enable mask-DMA0_SGC[EMn] Start scatter/gather DMA0_SGC[SSGn] Finally, indicate location descriptor tables DMA0_SGC[SGLn] controller then reads descriptor table address (DMA0_SGHn DMA0_SGLn) updates controller registers. receiving data from scatter/gather descriptor table, channel's terminal count status (DMA0_SR[TCn]) transfer status (DMA0_SR[EOTn]) automatically cleared. After loading channel's registers from descriptor table, transfer functions normal non-scatter/gather operation. (link) set, scatter/gather process stops when current transfer completes. Otherwise, controller reads descriptor table address (DMA0_SGHn DMA0_SGLn) process repeats. MPC8540 Controller MPC8540 supports four high-speed channels transferring blocks data between RapidIO controller, PCI, local address space, independent e500 core external hosts. Data transfers triggered controlled software triggered controlled external device using handshake signals DMA_DREQ, DMA_DACK, DMA_DDONE. addition, misaligned transfers sub-block transfers bytes supported channel basis, minimize number discrete memory transactions maximize performance over interfaces, such RapidIO. summary controller registers shown Table Table MPC8540 Register Summary Name CLNDARn SATRn SARn DATRn DARn BCRn NLNDARn CLSDARn NLSDARn SSRn DSRn DGSR Description mode register Status register current link descriptor address register source attributes register source address register destination attributes register destination address register byte count register next link descriptor address register current list alternate base descriptor address register next list alternate base descriptor address register source stride register destination stride register general status register four channels. Software Migration from (AMCC) 440GP MPC8540 MOTOROLA More Information This Product, www.freescale.com Transfers There main modes operation follows: Direct mode-In this mode software initializes parameters transfer appropriate register follows: Mode register (MRn), including MRn[CTM] stride mode desired, MRn[XFE] external starts transfer, MRn[EMS_EN] software (single-register write) starts transfer, MRn[SRW] Program other options Program stride registers (SSRn DSRn), enabled. Stride capability allows channel transfer data from selected memory regions memory segment skippng over certain regions that segment. Program number bytes transfer byte count register (BCRn), Mbytes. Program source attributes 32-bit source attributes register (SATRn). Program source address 32-bit source address register (SARn). Program destination attributes 32-bit destination attributes register (DATRn). Program destination address 32-bit destination address register (DARn). Chaining Mode-In this mode software does program source/destination parameters registers. Instead, software provides parameters transfer link descriptor tables memory (one chain). Program mode register (MRn) Current link descriptor address register (CLNDARn) used point first descriptor. When started, reads parameters transfer including next descriptor address loaded next link descriptor address register (NLNDARn). When current segment transferred, NLNDARn[EOLND] set, complete. set, next link descriptor address from NLNDARn read current link descriptor address register (CLNDARn) process repeated. link descriptor format basic chaining mode shown Figure extended chaining mode allows user setup series buffer descriptors referenced from linked list. controller, this linked list, then walk through multiple allowing complex transactions performed. MOTOROLA Software Migration from (AMCC) 440GP MPC8540 More Information This Product, www.freescale.com Transfers Memory CLNDARn Descriptor Link Descriptor Source Attributes Source Address Destination Attributes NLNDARn Descriptor Destination Address Reserved Next Link Descriptor Address Byte Count Descriptor Reserved Last Descriptor Figure MPC8540 Basic Chaining Mode-Link Descriptor Format Porting Transfers MPC8540 Similarities exist between controller 440GP MPC8540, although exact register formats different. features controllers registers from 440GP MPC8540 shown Table Table Mapping Features 440GP Controller MPC8540 Feature Enabling channels mode operation Transfer size Source address/attributes Destination address/attributes chaining 440GP Register DMA0_CRn DMA0_CRn[PW] DMA0_CTn[TC] DMA0_SAHn DMA0_SALn DMA0_DAHn DMA0_DALn DMA0_SCHn, DMA0_SGLn, DMA_SCRn, link descriptor tables external memory DMA0_SLP DMA0_POL DMA0_SR MPC8540 Register BCRn SARn SATRn DARn DATRn MRn[CTM] CLNDARn, NLNDARn, link descriptor tables external memory Supported globally specific programmable DGSR Sleep mode Polarity (for external trigger) Status information MPC8540 provides identical features 440GP transfers. addition, controller MPC8540 more flexible offers additional support extended chaining mode stride transfers. Software Migration from (AMCC) 440GP MPC8540 MOTOROLA More Information This Product, www.freescale.com Buffer Descriptors Buffer Descriptors Buffer descriptors (BDs) primary data structures used 440GP MPC8540 passing data between higher level software on-chip serial communication peripherals. Organization differs between 440GP MPC8540, basic structure similar, easing migration MPC8540. example, differences Ethernet operation 440GP MPC8540 will examined. 440GP Buffer Descriptors 440GP, hardware block referred memory access layer (MAL) manages data transfers between Ethernet controllers (EMACs). communicate with software device drivers, utilizes buffer descriptor ring structure external memory. software device driver uses buffer descriptor structure inform about buffer locations packet buffer status. descriptors pointers actual buffers organized circular queues. Each EMAC associated with tables (transmit receive) buffer descriptors table. format buffer descriptor (BD) shown Figure same both transmit receive. Offset Offset Status/Control Data Buffer Pointer MSbs) Data Buffer Pointer LSbs) Data Length Figure 440GP Buffer Descriptor Format most significant half word each buffer descriptor contains status/control bits. second half word determines MSbs data buffer pointer data length bytes) referenced this buffer descriptor. second word buffer descriptor contains LSbs data buffer pointer that points actual data buffer memory. example data buffer structure external memory shown Figure MOTOROLA Software Migration from (AMCC) 440GP MPC8540 More Information This Product, www.freescale.com Buffer Descriptors Table Pointer Register Tables (Memory) Memory Descriptor Descriptor Channel Table Pointer Buffer Pointer Data Buffer NOTE: means wrap this descriptor. Buffer Pointer Figure 440GP Data Buffers External Memory Table shows format status/control bits transmit buffer descriptors. Bits 6-15 used EMAC specific control information during write access status information during read access. Table 440GP Status/Control Bits TxBDs Name Description Ready-indicates buffer ready transmission Wrap-last buffer circular table Continuous mode-indicates continuous transmission buffer regardless Indicates last buffer frame Reserved Specifies Interrupt generated processing Generate (control) Indicates (status) BPACK LOCS Generate padding (control) Indicates packet (status) Insert source address (control) Loss carrier sense (status) Replace source address (control) Excessive deferral (status) Software Migration from (AMCC) 440GP MPC8540 MOTOROLA More Information This Product, www.freescale.com Buffer Descriptors Table 440GP Status/Control Bits TxBDs (continued) Name IVTg RVTg Insert VLAN (control) Excessive collisions (status) Replace VLAN (control) Late collisions (status) Multiple collisions (status) Single collision (status) Underrun (status) Signal quality error (status) Description Table shows format status/control bits receive buffer descriptors. Bits 6-15 used EMAC specific status information. Table 440GP Status/Control Bits RxBDs Name Description Empty-indicates receive data buffer ready receive data Wrap-last buffer circular table Continuous mode-indicates continuous reception data regardless Indicates last buffer frame Indicates first buffer frame Specifies interrupt generated processing Indicates overrun error indication Pause packet indication packet-indicates early termination caused packet error Runt packet error indication Short event error indication Alignment error indication error indication Packet long error indication range error indication range error indication MOTOROLA Software Migration from (AMCC) 440GP MPC8540 More Information This Product, www.freescale.com Buffer Descriptors MPC8540 Buffer Descriptors three-speed ethernet controllers (TSECs) MPC8540 also buffer descriptors data buffers transmission reception Ethernet frames. format buffer descriptor (BD) shown Figure same both transmit receive: Offset 0x00 Offset 0x02 Offset 0x04 Offset 0x06 Status/Control Bits Data Length Tx/Rx Buffer Pointer Figure MPC8540 Buffer Descriptor Format first word contains status/control bits buffer data length bytes) transmitted received. second word buffer descriptor contains data buffer pointer that points actual data buffer memory. example data buffer structure external memory shown Figure Memory System Memory Buffer Descriptors Status Control TxBD Table Pointer (TBASE) RxBD Table Pointer (RBASE) TxBD Table Data Length Buffer Pointer Buffer Buffer Descriptors RxBD Table Status Control Data Length Buffer Pointer Buffer Figure Example MPC8540 TSEC Memory Structures Table shows format status/control bits MPC8540 TSEC transmit buffer descriptors. Table MPC8540 TSEC Status/Control Bits Name Description Ready-indicates buffer ready transmission Padding short <64-byte Ethernet frames Wrap-last buffer circular table Specifies interrupt generated processing Software Migration from (AMCC) 440GP MPC8540 MOTOROLA More Information This Product, www.freescale.com Buffer Descriptors Table MPC8540 TSEC Status/Control Bits (continued) Name 10-13 Description Indicates last buffer frame Transmit Defer Reserved Hugh frame enable (control) Late collision indication Retry limit reached indication Retry count indicates number retries Underrun indication Reserved Table shows format status/control fields MPC8540 TSEC receive buffer descriptors. Table MPC8540 TSEC Status/Control Fields RxBDs Name Description Empty-indicates receive data buffer ready receive data Reserved Wrap-last buffer circular table Specifies interrupt generated processing Indicates last buffer frame Indicates first buffer frame Reserved Miss-frame accepted because promiscuous match address Broadcast-frame broadcast address Multicast-frame multicast address Large-indicates frame bigger than maximum frame length received Non-octet-frame divisible received Short-indicates short frame received enabled CRC-frame error Overrun indication Truncation-indicates frame truncated MOTOROLA Software Migration from (AMCC) 440GP MPC8540 More Information This Product, www.freescale.com Ethernet Porting Buffer Descriptors MPC8540 Since both MPC8540 440GP rely circular queues buffer descriptors, porting software applications from 440GP MPC8540 should relatively straightforward. Buffer descriptors themselves have similar format, although exact contents differ. Ethernet Table Ethernet Comparison 440GP versus MPC8540 Ethernet Feature Standards 440GP IEEE 802.3, 802.3u, 802.3x, 10/100 Mbps MII, RMII, SMII 10/100 Mbps 10/100 Mbps Unicast, multicast, broadcast, promiscuous mode Programmable option VLAN insertion/replacement transmit packets MPC8540 IEEE 802.3, 802.3u, 802.3x, 802.3z, 802.3ab 10/100/1000 Mbps GMII, RGMII, MII, RMII, TBI, RTBI 10/100 Mbps 10/100/1000 Mbps Unicast, multicast, broadcast, promiscuous mode Programmable option None comparison Ethernet features between 440GP MPC8540 shown Table Speeds Interfaces Half-duplex support Full-duplex support Automatic retransmission packets collision (CRC) checking generation Programmable inter-packet Flow control (including pause packet checking generation) Address recognition Jumbo frame support Automatic source address insertion replacement VLAN support Wake (WOL) handling Many similarities exist between Ethernet access controllers (EMACs) 440GP three-speed ethernet controllers (TSECs) MPC8540. following sections will only discuss Ethernet features common both processors configuration differences. 440GP Ethernet Controllers 440GP supports Ethernet access controllers (EMACs) half-/full-duplex operation 10/100 Mbps. Each EMAC uses media independent interface (MII) controlled ZMII bridge connect standard Ethernet physical devices (PHYs). Software Migration from (AMCC) 440GP MPC8540 MOTOROLA More Information This Product, www.freescale.com Ethernet ZMII bridge supports interface, RMII/SMII interfaces selected enabling bits 28-29 power-on configuration register (CPC0_STRP0). addition, there three registers which control maintain status information ZMII bridge. register summary each EMAC shown Table Table 440GP Ethernet Register Summary Name EMACn_MR0 EMACn_MR1 EMACn_TR0 EMACn_TR1 Mode register Mode register Transmit mode register Transmit mode register Receive mode register Interrupt status register Interrupt status enable register Individual address high Individual address VLAN TPID (tag protocol identifier) register VLAN (tag control information) register Pause timer register Individual address hash tables Group address hash tables Last source address high Last source address Inter-packet value register control register Transmit request threshold register Receive low/high water mark register Transmitted octets Received octets Description EMACn_RMR EMACn_ISR EMACn_ISER EMACn_IAHR EMACn_IALR EMACn_VTPID EMACn_VTCI EMACn_PTR EMACn_IAHT1-4 EMACn_GAHT1-4 EMACn_LSAH EMACn_LSAL EMACn_IPGVR EMACn_STACR EMACn_TRTR EMACn_RWMR EMACn_OCTX EMACn_OCRX registers EMAC operations described follows: mode registers (EMACn_MR0 EMACn_MR1) define operating mode including: Tx/Rx enable, full-duplex operation, flow control, 10/100 Mbps operation, FIFO size, loopback mode, VLAN enable. receive mode register (EMACn_RMR) defines EMAC mode during receive operation including: address recognition modes, strip padding/FCS enable/disable, propagate pause packets, reception oversized packets. MOTOROLA Software Migration from (AMCC) 440GP MPC8540 More Information This Product, www.freescale.com Ethernet EMAC generates interrupt events using contents interrupt status register (EMACn_ISR) corresponding mask bits interrupt status enable register (EMACn_ISER). pause timer register (EMACn_PTR) defines time period which pause function enabled. inter-packet value register (EMACn_IPGVR) defines value one-third inter-packet next packet transmitted. transmitted octets received octets registers (EMACn_OCTX EMACn_OCRX) read only registers which contain number octets transmitted received. These registers used software RMON statistics. individual address high register (EMACn_IAHR) contains high-order half word station unique individual address. During packet reception, EMAC programmed individual address match mode (EMACn_RMR[IAE] contents EMACn_IAHR concatenated with content individual address register (EMACn_IALR) form composite address that compared with destination address received packet. individual address hash tables (EMACn_IAHT1-EMACn_IAHT4) used hash table function multiple individual addressing mode. group address hash tables (EMACn_GAHT1-EMACn_GAHT4) used hash table function multiple group addressing mode. EMACn_RWMR defines conditions that cause EMAC activate urgent priority request, that manage flow control. MPC8540 Ethernet Controllers MPC8540 supports three-speed Ethernet controllers (TSECs). Each TSEC designed support 10/100/1000 Mbps Ethernet/802.3 networks using standard MAC-PHY interfaces follows connect external Ethernet transceiver: interface running 10/100 Mbps GMII interface running Gbps interface that connected SerDes device fibre channel applications Reduced signal count versions GMII (RGMII) ten-bit (RTBI) interfaces TSEC interface (GMII TBI) width (reduce standard) initialized sampling certain signals during power-on reset sequence. value these signals sampled into PORDEVSR (POR device status register) while HRESET asserted. addition, Ethernet control register (ECNTRL) determines interface type width, enabled RMON statistics. block diagram TSEC controller shown Figure Software Migration from (AMCC) 440GP MPC8540 MOTOROLA More Information This Product, www.freescale.com Ethernet Tx/Rx Descriptors Tx/Rx Data Tx/Rx Status Block Interface FIFO Kbytes Address/Data Filtering Pack Words FIFO Control FIFO Kbytes Unpack Words System Data Path Layer GMII Counters Clocks Reduced Signal Interface Reduced Signal Interface GMII RGMI RTBI Management Figure MPC8540 TSEC Block Diagram TSEC device programmed combination control/status registers buffer descriptors. CSRs used mode control, interrupts, access status information. descriptors used pass data buffers related buffer status frame information between hardware software. TSEC control/status registers 32-bits wide divided into following sections depending functions they support: General control/status registers-The interrupt event (IEVENT) used generate operational interrupts, transceiver/network error interrupts, corresponding interrupt enable register (IMASK) also set. Ethernet control register (ECNTR0) used reset, configure, initialize TSEC including: enabling/resetting counters statistics, enabling mode, reduced standard interfaces, interface speed. pause timer value register (PTV) written user store pause duration used when TSEC initiates pause. FIFO control/status registers-Allow user change some default settings FIFO that used optimize operation performance safety. Transmit specific control/status registers-The transmit control register (TCTRL) used half-duplex flow control operation pause frame transmission requests. Additional registers used maintain TxBD parameters (including length, base address, pointers). MOTOROLA Software Migration from (AMCC) 440GP MPC8540 More Information This Product, www.freescale.com Ethernet Receive specific control/status registers-The receive control register (RCTRL) used enable broadcast reject, promiscuous mode, receive short frame modes. Additional registers used maintain RxBD parameters (including length, base address, pointers). control/status registers-The configuration register (MACCFG1) used configure functionality including: transmit/receive enable, flow control transmit/receive enable, loopback operation. configuration register (MACCFG2) used configure functionality including: preamble length, interface modes, padding/CRC enable, Hugh frame enable, full- half-duplex operation. inter-packet gap/inter-frame register (IPGIFG) used program inter-frame frame, non-back-to-back back-to-back inter-packet gaps. half-duplex register (HAFDUP) used program features TSEC half-duplex operation 10/100 Mbps. maximum frame length register (MAXFRM) sets maximum frame size both transmit receive directions. Additional registers used management interface. statistic registers-The separate statistics counter registers, which simply count accumulate statistical events that occur packets transmitted received. Hash function registers-The individual address registers (IADDRn) represent entries individual (unicast) address hash table used address recognition process. While field receive frame processed through 32-bit generator, bits remainder mapped entries. user enable hash entry setting appropriate bit. hash table occurs result points enabled hash entry. group address registers (GADDRn) represent entries group (multicast) address hash table used address recognition process. While field receive frame processed through 32-bit generator, bits remainder mapped entries. user enable hash entry setting appropriate bit. hash table occurs result points enabled hash entry. Finally, attribute register (ATTR) defines attributes transaction types used access buffer descriptors, write receive data, read transmit data buffers including: snooping cache data extraction. Finally, registers define operation ten-bit interface (TBI). Porting Ethernet MPC8540 Similarities exist between 440GP Ethernet controllers three-speed Ethernet controllers MPC8540, although exact register formats different. features Ethernet controllers registers from 440GP MPC8540 shown Table Table Mapping Features 440GP Ethernet Controller MPC8540 Feature Enable interrupts Interface modes/speed Pause packet time Address recognition (individual) Inter-packet (frame) 440GP Register EMACn_ISR EMACn_ISER ZMII0_FER ZMII0_SSR EMACn_PTR EMACn_IAHR, EMACn_IAHR EMACn_IAHT1-4, EMACn_GAHT1-4 EMACn_IPGVR MPC8540 Register IEVENT IMASK ECNTR0 MACCFG2 IADDR0-7, GADDR0-8 IPGFG Software Migration from (AMCC) 440GP MPC8540 MOTOROLA More Information This Product, www.freescale.com UART Table Mapping Features 440GP Ethernet Controller MPC8540 (continued) Feature Enabled MAC/flow control functionality Loopback operation RMON statistics 440GP Register EMACn_MR0 EMACn_MR1 EMACn_MR1 Limited support with octet counts EMACn_OCTRX EMACn_OCTTX registers MPC8540 Register MACCFG1 MACCFG1 separate statistics counter registers addition, MPC8540 TSEC FIFO control status registers which enable features including: FIFO thresholds Underrun trigger Flow control Interrupt coalescing This allows user optimized Ethernet system performance minimize underrun overrun events. UART 440GP UART 440GP there UART interfaces complete sets UART registers (one UART0 UART1) almost identical MPC8540. There registers shown Table each UART interface used configuration, control, status. Table 440GP UART Register Summary Name UARTn_RBR UARTn_THR UARTn_IER UARTn_IIR UARTn_FCR UARTn_LCR UARTn_MCR UARTn_LSR UARTn_MSR UARTn_SCR UARTn_DLL UARTn_DLM Description UART receive buffer register UART transmitter holding register UART interrupt enable register UART interrupt identification register UART FIFO control register UART line control register UART modem control register UART line status register UART modem status register UART scratch register UART divisor latch (LSB) UART divisor latch (MSB) MOTOROLA Software Migration from (AMCC) 440GP MPC8540 More Information This Product, www.freescale.com MPC8540 PowerQUICC MPC8540 (dual) universal asynchronous receiver/transmitters (UARTs). There complete sets DUART registers (one UART0 UART1). There registers shown Table each UART interface used configuration, control, status. Table MPC8540 DUART Register Summary Name URBRn UTHRn UDLBn UIER Description UART receive buffer register UART transmitter holding register UART divisor least significant byte register UART interrupt enable register UART divisor most significant byte register UART interrupt identification register UART FIFO control register UART alternate function register UART line control register UART modem control register UART line status register UART modem status register UART scratch register UART status register UDMBn UIIRn UFCRn UAFRn ULCRn UMCRn ULSRs UMSRn USCRn UDSRn Porting UART MPC8540 UART programming mode between 440GP MPC8540 almost identical. registers byte wide. Reads writes these registers must byte-wide operations. However, there additional registers MPC8540 DUART programming model follows: UART alternate function registers (UAFRs) which give software ability write both UART0 UART1 registers simultaneously with same write operation. UAFRs also provide means device's performance monitor track baud clock. UART status registers (UDSRs) which read only registers that return transmitter receiver FIFO status. inter-IC (I2C) two-wire, bidirectional serial that provides simple, efficient method data exchange between devices. synchronous, multi-master allows 440GP MPC8540 exchange data with other devices such microcontrollers, EEPROMs, real-time clock devices, converters. comparison features between 440GP MPC8540 shown Table Software Migration from (AMCC) 440GP MPC8540 MOTOROLA More Information This Product, www.freescale.com Table Comparison 440GP versus MPC8540 Ethernet Feature Clocking Addressing Data transfers Support master/slave operation Multi-master operation On-chip filtering 440GP 10-bit 8-bit MPC8540 Software programmable clock frequency 7-bit only 8-bit Many similarities exist between controllers 440GP PowerQUICC III. 10.1 440GP Controller 440GP supports interfaces. Table shows registers used configuration interfaces 440GP. There 1-byte wide registers each interface. Table 440GP Register Summary Name I2Cn_MDBUF I2Cn_SDBUF I2Cn_LMADR I2Cn_HMADR I2Cn_CNTL I2Cn_MDCNTL I2Cn_STS I2Cn_EXTSTS I2Cn_LSADR I2Cn_HSADR I2Cn_CLKDIV I2Cn_INTRMSK I2Cn_XFRCNT I2C_XTCNTLSS I2Cn_DIRECTCNTL Description master data buffer slave data buffer master address high master address control mode control status extended status slave address high slave address clock divide interrupt mask transfer count extended control slave status direct control master slave data buffer (I2Cn_MDBUF I2Cn_SDBUF) registers 1-byte 4-byte FIFO buffer. master slave address (I2Cn_LMADR I2Cn_LSADR) registers form addresses that interface transmits bus. master slave high address (I2Cn_HMADR I2Cn_HSADR) registers provide upper address bits 10-bit addressing mode. I2Cn control register (I2Cn_CNTL) starts stops interface master transfers bus. When transfer begins, MOTOROLA Software Migration from (AMCC) 440GP MPC8540 More Information This Product, www.freescale.com interface uses values I2Cn_CNTL determine type size transfer. I2Cn mode control register (I2Cn_MDCNTL) sets major modes operation bus. addition, I2Cx_MDCNTL force data buffers into empty state. I2Cn status register (I2Cn_STS) contains state interface status previously requested master transfers. I2Cn extended status register (I2Cn_EXTSTS) reports additional status. During after transfers, software read I2Cn_STS I2Cn_EXTSTS registers determine state interface bus. I2Cn clock divide register (I2Cn_CLKDIV) contains clock divider ratio used determine base clock from (on-chip peripheral bus) clock. I2Cn interrupt mask register (I2Cn_INTRMSK) specifies which conditions generate interrupt when interrupt enabled. I2Cn transfer count register (I2Cn_XFRCNT) reports number bytes transferred during master slave operation. I2Cn extended control slave status register (I2Cn_XTCNTLSS) provides additional control interface functions reports status slave operations. I2Cn direct control register (I2Cn_DIRECTCNTL), which controls monitors serial clock (I2CSCL) serial data (I2CSDA) signal, used error recovery when malfunction detected interface. 10.2 MPC8540 Controller MPC8540 supports interface. Table shows registers 1-byte wide) used configuration, control, status information interface MPC8540. Table MPC8540 Register Summary Name I2CADR I2CFDR I2CCR I2CSR I2CDR I2CDFSRR Description address register frequency divider register control register status register data register digital filter sampling rate register address register defines address which interface responds when addressed slave. Note that this address that sent during address-calling cycle when module master mode. frequency divider register contains frequency divider ratio used determine serial clock frequency from clock. control register determines controller mode operation. status register read-only used software determine status information controller. data register used initiate transmission reception data byte time. digital filter sampling rate register used assist filtering signal noise. 10.3 Porting MPC8540 programming mode between 440GP MPC8540 almost identical. However, 440GP controller supports 10-bit addressing, programming model differs that separate address/data registers supported master slave operation. Therefore, programming model MPC8540 operation much simpler. Table illustrates registers from 440GP MPC8540 operation. Software Migration from (AMCC) 440GP MPC8540 MOTOROLA More Information This Product, www.freescale.com PCI-X Table Mapping Features 440GP Controller MPC8540 Feature 7-bit addressing 10-bit addressing Master/slave data buffers Clock divide Status information Control 440GP Register I2C_LMADR I2C_LMSDR I2C_HMADR I2C_HSADR I2C_MBUF I2C_SBUF I2C_CLKDIV I2C_STS I2C_CNTL, I2C_MDCNTL I2C_XTCNTLSS MPC8540 Register I2CADR I2CDR I2CFDR I2CCSR I2CCCR PCI-X interface 440GP MPC8540 version compliant support transaction speeds MHz. addition support, both devices support PCI-X standard (version 1.0A) MHz. Designers systems incorporating PCI/PICE-X devices should refer respective specification thorough description PCI/PCI-X buses. 11.1 440GP PCI-X Bridge PCI-X bridge implemented 440GP provides interface between processor local (PLB). enables initiators access slaves masters access targets. initiators targets conventional PCI-X mode. PCI-X bridge includes optional arbiter typically used only host-bridge mode. This internal arbiter used with external masters (six pairs) disabled. When disabled, PCI-X bridge REQ/GNT pair that attach external arbiter. PCI-X bridge register memory consists internal registers used controlling PCI-X bridge. These registers accessed from both enabled). Most accessed from type configuration cycles when IDSEL input PCI-X bridge active. PCI-X bridge hardware implements registers little-endian byte ordering. Thus, software that runs big-endian mode must take this into account when accessing registers. PCI-X bridge registers 440GP must must accessed with single-beat, 4-byte transfers. These divided into following sections depending functions they support: PCI-X standard header registers-These registers located offsets 0x00-0x3f part defined standard header, include configuration address data registers used generate external configuration cycles. Bridge options registers-These registers determine miscellaneous control operation PCI-X bridge including frequency operation, interrupts sources, PCI-X enabled, etc. Error handling registers-These 32-bit read/write registers used enable detection reporting errors bus. outbound/inbound registers-The outbound (POM) registers used address space memory space vice versa inbound (PIM) registers. MOTOROLA Software Migration from (AMCC) 440GP MPC8540 More Information This Product, www.freescale.com PCI-X capability block definition registers-These registers used generate interrupts (outbound interrupts) receive interrupts from (inbound interrupts). These interrupts either standard interrupt signals message signaled interrupts (MSI). Power management register block definition registers-These registers include capabilities, power management status control registers which determine functions related power management defined Power Management Interface Specification, Version 1.1. PCI-X capability block definition registers-These registers support additional standard registers defined standard PCI-X addendum Local Specification. Simple message passing inbound registers-These registers used simple message passing mechanism inbound MSI. masters generate configuration cycles accessing CONFIG_ADDRESS CONFIG_DATA registers that located space. CONFIG_ADDRESS CONFIG_DATA must accessed with single-beat transfers that don't cross 32-bit boundary. general mechanism accessing configuration space write value into CONFIG_ADDRESS that specifies number, device number that bus, configuration register that device being accessed. Then, read write CONFIG_DATA causes bridge generate configuration cycle, with address type translated from CONFIG_ADDRESS value. format CONFIG_ADDRESS register shown Figure CONFIG_ADDRESS register controls what type cycle generated when CONFIG_DATA accessed. Number Function Device Number Number Register Number Type Figure Format 440GP CONFIG_ADDRESS Register PCI-X bridge controller supports detection reporting several types errors. errors reported status information saved configuration register set, that error type determination done. PCI-X bridge register several ranges address space several ranges address space that claim. These ranges allow master access internal register set, cause PCI-X bridge generate memory, I/O, configuration, special cycles bus. destination memory space, there three address ranges that PCI-X bridge claim. number ranges their location address space programmable determined outbound `POM' registers. Figure shows registers address space address space. Software Migration from (AMCC) 440GP MPC8540 MOTOROLA More Information This Product, www.freescale.com PCI-X Local Address Size/Attribute BAR-PCI Base Address Size Memory Region Memory Region Size Starting Address Starting Address Figure Registers Used Outbound Address Translation destination space, there memory address ranges address range that PCI-X bridge claim. number ranges their locations address space programmable determined inbound (PIM) registers. Figure shows registers address space memory space. #/BAR Local Address Size/Attribute BAR-PCI Base Address Size Memory Region Memory Region Size Starting Address Starting Address Figure Registers Used Inbound Address Translation simple message passing mechanism enables messages exchanged between master device (the host) master device (the local CPU). interface consists 32-bit message register 32-bit message register. 64-bit messages, message high message high registers used. 11.2 MPC8540 PCI-X Controller architecture hierarchical, multi-master arbritration scheme that uses either 64-bit addressing post transactions onto bus. Transactions either accepted, retried, deferred. later cases, master repeats transaction that needs retried deferred transactions accepted started target while master retries transaction. MPC8540 five different pairs request/grant pairs, hence five external masters supported. performance interface enhanced level round-robin arbitration algorithm used arbiter through ability mirror pre-fetched read accesses. While MOTOROLA Software Migration from (AMCC) 440GP MPC8540 More Information This Product, www.freescale.com PCI-X interface supports both inbound outbound data streaming, amount data that actually streamed limited both depth pre-fetching target disconnect limit specification. MPC8540, this disconnect will occur after cache lines (that after bytes). This helps devices hogging prevents system bottlenecks/interface starvation, when operating high speed interfaces such RapidIO Gigabit Ethernet. MPC8540 PCI-X controller supports following register types: Memory-mapped registers-these registers control address translation (inbound/outbound), error management, configuration register access MPC8540. PCI-X configuration registers contained within PCI-X configuration header-these registers specified specification every device. PCI-X memory-mapped registers accessed reading writing address comprised base address (specified CCSRBAR local side PCSRBAR PCI-X side) plus offset specific register accessed. Note that memory-mapped registers (except PCI-X configuration data register, CFG_DATA) must only accessed 32-bit words. outbound address translation mapping unit controls mapping transactions from internal 32-bit address space MPC8540 external address space. outbound ATMU consists four translation windows plus default translation transactions that four windows. Each window contains base address that points beginning window local address map, translation address that specifies high-order bits transaction external address space, attributes including window size external transaction type. inbound address translation mapping unit controls mapping transactions from external address space local address space MPC8540. inbound ATMU comprised four windows-a configuration window (highest priority) three general translation windows. Each window contains base address, which points beginning window external address map, translation address that specifies upper order bits transaction local address space, attributes including window size internal transaction attributes. When PCI-X error detected, appropriate error PCI-X error detect register. Subsequent errors appropriate error bits error detection registers, relevant information (attributes, address, data) captured only first error. Local Specification defines configuration registers contained within PCI-X configuration header from 0x00 through 0x3F. PCI-X Addendum Local Specification defines additional registers beyond 0x3F. common PCI-X configuration header implemented MPC8540 shown Figure accessed indirect method using pair 32-bit memory-mapped access registers, CFG_ADDR CFG_DATA. Software Migration from (AMCC) 440GP MPC8540 MOTOROLA More Information This Product, www.freescale.com PCI-X Address Offset (Hex) Reserved Device Vendor Status Command Programming Interface Base Class Code Subclass Code Revision BIST Control Header Type Latency Timer Cache Line Size Configuration Status Register Base Address Register (PCSRBAR) 32-Bit Memory Base Address Register 64-Bit Memory Base Address Register 64-Bit High Memory Base Address Register 64-Bit Memory Base Address Register 64-Bit High Memory Base Address Register Subsystem Subsystem Vendor Capability Pointer MAX_LAT MIN_GNT Interrupt Interrupt Line Arbiter Configuration Function Figure MPC8540 Common PCI-X Configuration Header access configuration space, 32-bit value must written CFG_ADDR register specifying target bus, target device that bus, configuration register accessed within that device. read write CFG_DATA register causes host bridge translate access into configuration cycle (provided enable CONFIG_ADDR device number 0b1_1111). translated information will according type number device number type number equal 11.3 Porting MPC8540 interface 440GP MPC8540 both version compliant support PCI-X standard (version 1.0A). Therefore, many programming similarities between programming mode 440GP MPC8540 exist, although exact register formats differ: Table illustrates registers from 440GP MPC8540 general operation. Table Mapping Features 440GP PCI-X Controller MPC8540 Feature configuration header 440GP Register standard header registers (offsets 0x00-0x3F) MPC8540 Register Accessed indirectly using device number CONFIG_ADDR register. PCI-X standard header registers (offsets 0x00-0x44) type transaction determined from translated information CONFIG_ADDR register. Type number device number Type number equal Note CONFIG_ADDR register, enabled reserved. type transaction CONFIG_ADDR register 31-Reserved 0-Determines transaction type MOTOROLA Software Migration from (AMCC) 440GP MPC8540 More Information This Product, www.freescale.com Conclusions Table Mapping Features 440GP PCI-X Controller MPC8540 (continued) Feature Inbound transactions- window size attributes Inbound transactions- address mapping 440GP Register PICX0_PIM0SA PICX0_PIM1SA PICX0_PIM2SA PICX0_PIM0LAL PICX0_PIM0LAH PICX0_BAR0L PICX0_BAR0H PICX0_PIM1LAL PICX0_PIM1LAH PICX0_BAR1 MPC8540 Register PIWAR PITAR PIWBAR PIWBEAR PICX0_PIM2LAL PICX0_PIM2LAH PICX0_BAR2L PICX0_BAR2H Outbound transactions- window size attributes Outbound transactions- address mapping PICX0_POM0SA PICX0_POM1SA PICX0_POM2SA PICX0_P0M0LAL PICX0_P0M0LAH PICX0_POM0PCIAL PICX0_POM0PCIAH PICX0_P0M1LAL PICX0_P0M1LAH PICX0_POM1PCIAL PICX0_POM1PCIAH fixed hardware coded address fixed Error handling-enable PCIX0_ERREN errors status/detection PCIX0_ERRSTS Error handling-attributes Error handling-address capture Error handling-data capture PCIX0_PLBBESR (error attributes) PCIX0_PLBEARL PCIX0_PLBEARH ERR_EN ERR_DR ERR_ATTRIB ERR_ADDR ERR_EXT_ADDR ERR_DL ERR_DH POWAR POTAR POTEAR POWBAR Conclusions Migrating hardware platform inherent software implications typically becomes challenge many software engineers unwilling face. Fortunately, both 440GP MPC8540 based 32-bit implementation Book PowerPC architecture, enabling high-level software port with minimal trouble. low-level feature 440GP subset features available MPC8540, with many similarities between implementation architectures. shown this document, porting low-level code relatively straightforward process. With software migration longer deciding factor processor selection, embedded processors once again decided system architects. Performance, flexibility, features become deciding factors, Software Migration from (AMCC) 440GP MPC8540 MOTOROLA More Information This Product, www.freescale.com Document Revision History PowerQUICC family provides high level performance integration cost today's embedded systems. Document Revision History Table provides revision history this document. Table Document Revision History Rev. Date 5/26/2004 Initial release. Substantive Change(s) MOTOROLA Software Migration from (AMCC) 440GP MPC8540 More Information This Product, www.freescale.com REACH USA/EUROPE/LOCATIONS LISTED: Motorola Literature Distribution P.O. 5405, Denver, Colorado 80217 1-480-768-2130 (800) 521-6274 JAPAN: Motorola Japan Ltd. SPS, Technical Information Center 3-20-1, Minami-Azabu Minato-ku Tokyo 106-8573 Japan 81-3-3440-3569 Information this document provided solely enable system software implementers Motorola products. There express implied copyright licenses granted hereunder design fabricate integrated circuits integrated circuits based information this document. Motorola reserves right make changes without further notice products herein. Motorola makes warranty, representation guarantee regarding suitability products particular purpose, does Motorola assume liability arising application product circuit, specifically disclaims liability, including without ASIA/PACIFIC: Motorola Semiconductors H.K. Ltd. Silicon Harbour Centre, King Street Industrial Estate, N.T., Hong Kong 852-26668334 HOME PAGE: www.motorola.com/semiconductors limitation consequential incidental damages. "Typical" parameters which provided Motorola data sheets and/or specifications vary different applications actual performance vary over time. operating parameters, including "Typicals" must validated each customer application customer's technical experts. Motorola does convey license under patent rights rights others. Motorola products designed, intended, authorized components systems intended surgical implant into body, other applications intended support sustain life, other application which failure Motorola product could create situation where personal injury death occur. Should Buyer purchase Motorola products such unintended unauthorized application, Buyer shall indemnify hold Motorola officers, employees, subsidiaries, affiliates, distributors harmless against claims, costs, damages, expenses, reasonable attorney fees arising directly indirectly, claim personal injury death associated with such unintended unauthorized use, even such claim alleges that Motorola negligent regarding design manufacture part. Motorola Stylized Logo registered U.S. Patent Trademark Office. digital trademark Motorola, Inc. PowerPC name trademark Corp. used under license. other product service names property their respective owners. Motorola, Inc. Equal Opportunity/Affirmative Action Employer. Motorola, Inc. 2004 AN2661 More Information This Product, www.freescale.com Other recent searchesSA160CONNKIT - SA160CONNKIT SA160CONNKIT Datasheet PK-41815-001 - PK-41815-001 PK-41815-001 Datasheet NTE399 - NTE399 NTE399 Datasheet NTE2366 - NTE2366 NTE2366 Datasheet MAX3202E - MAX3202E MAX3202E Datasheet MAX3203E - MAX3203E MAX3203E Datasheet MAX3204E - MAX3204E MAX3204E Datasheet MAX3206E - MAX3206E MAX3206E Datasheet FYS-5212 - FYS-5212 FYS-5212 Datasheet EPE6133LG - EPE6133LG EPE6133LG Datasheet BPRA071 - BPRA071 BPRA071 Datasheet
Privacy Policy | Disclaimer |