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

📄 target.nr

📁 VxWorks下 Mcpn750的BSP源代码
💻 NR
📖 第 1 页 / 共 5 页
字号:
.TS Ccenter;lf3 sr lw(3.2i) ..ne 6.sp .5Upstream I/O or Memory 0 BAR:Size:	T{4MBT}Direction:	T{Out-Bound (MCPN750 to cPCI)T}cPCI Adrs:	T{CPCI_MSTR_MEM_BUS (0x80000000 by convention)T}Local PCI Adrs:	T{Dynamic (assigned by MCPN750)T}Local CPU Adrs:	T{Dynamic (based on local PCI adrs)T}Use:	T{R/W access to host DRAMT}.TE.TS Ccenter;lf3 sr lw(3.2i) ..ne 6.sp .5Upstream Memory 1 BAR:Size:	T{32MBT}Direction:	T{Out-Bound (MCPN750 to cPCI)T}cPCI Adrs:	T{Base cPCI address of the host's dynamic PCI configuration area (0x02000000 forthe default MCP750 BSP)T}Local PCI Adrs:	T{Dynamic (assigned by MCPN750)T}Local CPU Adrs:	T{Dynamic (based on local PCI adrs)T}Use:	T{R/W access to cPCI devicesT}.TEThe remaining Dec2155x Base Address Registers are not used by the BSP andare available for use by the application..SS "Dec2155x Address Translation:Due to the dynamic nature of PCI address allocation, the locations of theupstream Dec2155x windows move as devices are added to the MCPN750 PCIbus. Since these windows map the cPCI space into the local MCPN750 PCIand CPU address spaces, their positions determine where the cPCIresources appear when viewed by the MCPN750 CPU and any MCPN750 residentPCI devices. Likewise, the downstream windows move as cPCI devices areadded and removed. The downstream windows are used to map the on-boardPCI and DRAM resources into the cPCI address space for access by the hostand other cPCI devices.To assist with address translation, two translation routines areprovided by this BSP:.TS Ccenter;rw20 lw(3.2i) .sysLocalToBusAdrs()	T{Translates a local CPU address to an equivalent cPCI or local PCI memory orI/O address.T}sysBusToLocalAdrs()	T{Translates a cPCI or local PCI memory or I/O space address to a local CPUequivalent address.T}.TE.HP 6NOTE: The translations performed by sysLocalToBusAdrs() and sysBusToLocalAdrs() are not symmetrical if one of the endpoints is the CompactPCI bus. sysLocalToBusAdrs() translates by locating a downstream window whichmakes the local CPU address visible in the cPCI address space.sysBusToLocalAdrs() performs a similar operation by locating an upstream windowwhich makes the cPCI address visible in the local CPU address space. Since thetwo sets of windows map different areas of the local address space,the translation is not reversible..SS "Accessing Dec2155x CSR Registers"Due to dynamic PCI address allocation, the PCI address assigned to theDec2155x CSR area cannot be known until runtime. To determine theassigned address, it is necessary to read the Secondary CSR memoryBAR (or the Secondary CSR I/O BAR if I/O space is to be used).The following code fragment derives the CPU address of the Scratchpad 0register using its PCI memory space address:.CS    UINT32 bar;    /* get the contents of the secondary CSR memory BAR       (see note below) */    if (pciConfigInLong (0, DEC2155X_PCI_DEV_NUMBER, 0,                         DEC2155X_CFG_SEC_CSR_MEM_BAR,                         &bar) != OK)        {        return (ERROR);        }    /* calculate the local PCI address of the scratchpad 0       register */    bar += DEC2155X_CSR_SCRATCHPAD0;    /* convert the result to the CPU equivalent address */    if (sysBusToLocalAdrs (PCI_SPACE_MEM_PRI, (char *)bar,                         (char **)&bar) != OK)        {        return (ERROR);        }    return (bar);.CE.HP 6NOTE: Using the constant DEC2155X_PCI_DEV_NUMBER ensures that theon-board Dec2155x is read. If a search of the local PCI bus hadbeen performed using the Dec2155x device ID, the returned Bus,Device and Function numbers may have corresponded to a Dec2155xpart found on an installed PMC card..POnce the local CPU address is known, the cPCI address can be derived byadding the following code fragment before returning the result:    if (sysLocalToBusAdrs (PCI_BACKPANEL_MEMORY_SPACE,                           (char *)bar,                           (char **)&bar) != OK)        return (ERROR);    else        return (bar);.CE.SS "Internal Dec2155x Interrupt Sources"At start-up, all Dec2155x interrupt sources are masked and cleared.Before unmasking an interrupt, an application ISR service routine must beattached to the appropriate Dec2155x interrupt vector using intConnect().Multiple ISR service routines can be connected to each vector if requiredby the application. Once the handler is attached, the interrupt can beenabled and disabled by calling sysDec2155xIntEnable() orsysDec2155xIntDisable() as required. Interrupt vector definitions for theDec2155x internal interrupt sources are defined in mcpx750.h.Unique interrupt vectors are provided for each of the 16 bits in theDec2155x Secondary IRQ register. Bit 0 (LSB) corresponds toDEC2155X_DOORBELL0_INT_VEC with the remaining bits mapped in sequence.These doorbell interrupts can be used for host-to-MCPN750 orMCPN750-to-MCPN750 event notification. The Dec2155x interrupt handlerclears these interrupts which simplifies the application ISR.Individual interrupt vectors are also provided for Dec2155x Hot SwapPower State and I2O in-bound list events. The Dec2155x interrupt handleralso clears these interrupts.The 64 Upstream Memory 2 BAR Page Crossing interrupts are all presentedon a single interrupt vector and the application ISR is responsible forclearing the bits serviced. Calls to sysDec2155xIntEnable() andsysDec2155xIntDisable() enable or disable all 64 interrupts.The Dec2155x interrupt handler provides a default service routine for allunclaimed interrupt vectors, including the Upstream Memory 2 BAR PageCrossing interrupt. The default routine reports the event and clears theinterrupt source..SS "Compact PCI Backpanel Interrupts"The Dec2155x can generate cPCI backpanel interrupts using any of the bitsin the Primary IRQ register if they have been un-masked by the host. Thefollowing code fragment generates a compact PCI backpanel interrupt bysetting bit 15 (MSB) of the Primary IRQ register:    if (sysBusIntGen (DEC2155X_DOORBELL15_INT_LVL,                      DEC2155X_DOORBELL15_INT_VEC) != OK)        return (ERROR);Note that the cPCI bus does not provide an interrupt vector to the host.The vector number passed to sysBusIntGen() simply identifies which bit inthe register to set. It is the host's responsibility to locate theinterrupt source and clear the interrupt.In-bound cPCI backpanel interrupts are routed directed to the MCPN750Raven MPIC and can be enabled, disabled and handled by callingsysIntEnable(), sysIntDisable() and intConnect() with the MPIC vectornumber of the desired backpanel interrupt line.  By default, cPCIbackpanel interrupts are disabled for the MCPN750 in config.h.  It isrecommended that these interrupts be left disabled to prevent interactionproblems with the MCP750 and cPCI system operation..HP 6NOTE: Great care must be exercised when cPCI backpanel interrupts arebeing generated and received simultaneously. If the packpanelinterrupt line driven by the MCPN750 is also enabled for receivinginterrupts, the MCPN750 will be interrupted by its own backpanelinterrupt. This scenario causes complications because the backpanelinterrupts are configured as level sensitive and difficulties areencountered in determining the party responsible for clearing theinterrupt source. In general, backpanel interrupt generation isuseful for signaling an event to the host, but in-bound packpanelinterrupts have limited usefulness..SS "Altering the Default Dec2155x Configuration:Altering the Dec2155x configuration requires the careful consideration ofseveral items:.IPDec2155x window sizes and alignment..IPDec2155x translation values..IPThe size and alignment of the host's dynamic PCI configuration area..IPThe size and alignment of the MCPN750's dynamic PCI configuration area..PThe Dec2155x window parameters are controlled by #defines in config.h. There are three defines associated with each window:.TS Ccenter;rw11 lw(4.0i) .\&..._SIZE	T{determines the size of the window in bytes and must be anintegral power of two. The minimum size for a PCI I/Ospace window is 64 bytes. The minimum size for a PCImemory space window is 4KB. To disable a window, set thesize to 0. Note that the Dec2155x will not allow thePrimary CSR and Downstream Memory 0 BAR to 0 to bedisabled. If the size of this window is set to zero, theDec2155x will default to a 4KB window.T}\f3NOTE:\f1	T{If a window value is not a power of 2, or is below the minimum size, sysLib.cwill not compile.T}.TE.TS Ccenter;rw11 lw(4.0i) .\&..._TYPE	T{determines the type of the window and any placementrestrictions. For proper operation, the window must beconfigured for placement anywhere in the 32-bit PCIaddress space.T}.TE.TS Ccenter;rw11 lw(4.0i) .\&..._TRANS	T{determines the base address of the window on the targetPCI bus. It is important to remember that this is a localPCI address (downstream window) or a cPCI address(upstream window). The translation value chosen must bean even multiple if the window size.T}\f3NOTE:\f1	T{If the translation value is not a multiple of the windowsize, sysLib.c will not build.T}.TEThe default window sizes can be reduced without altering the sizes of thedynamic PCI configuration area. However, if the required values aresignificantly reduced from the default values, reducing the size of thedynamic PCI configuration area reduces the size of the MMU page tables atthe ratio of 128:1 (a 128KB reduction saves 1KB of MMU table space).The size of the PCI memory space used for dynamic PCI configuration iscontrolled by PCI_MSTR_MEMIO_LOCAL in config.h and the area's base addressis controlled by PCI_MSTR_MEMIO_BUS in mcpx750.h. By default, the companionMCP750 BSP allocates a 32MB area aligned to a 32MB boundary for dynamicPCI configuration. To access peer MCPN750 DRAM areas, an upstream windowmust be opened which matches the size of the host's dynamic PCIconfiguration area. For translation to work correctly, the host'sdynamic PCI configuration area must be aligned to a multiple of thearea's size and the corresponding Dec2155x upstream translation registermust contain the area's base cPCI address (not CPU address). Since thisBSP supports peer-to-peer access between MCPN750 DRAM areas, the defaultdynamic PCI configuration area for the MCPN750 is 64MB aligned to a 32MBboundary which satisfies these requirements.In addition to the peer access window, sufficient space must also beavailable for mapping the host DRAM upstream window and any spacerequired by MCPN750-resident PCI devices. A margin must also be allowedfor areas that are unusable due to window alignment requirements.If the application does not require peer-to-peer MCPN750 DRAM access, thelarge 32MB window used to contain the host's dynamic PCI configurationarea can be eliminated with a corresponding decrease in the requiredMCPN750 dynamic PCI configuration area. If peer-to-peer doorbellinterrupts are still required, the doorbell interrupt registers of peerMCPN750s may be accessed through an I/O window which has much smallerCPU address space requirements. This would require re-configuring thedefault BSP to access host DRAM through Upstream Memory 1 BAR and usingthe Upstream I/O or Memory 0 BAR to access the peer MCPN750 doorbellinterrupt registers..SS "Shared Memory Support"The MPCN750 supports shared memory backplane communication withthe MCP750 or CPV5000 as the Compact PCI host node.  The Wind Riverdocumentation provides a great deal of information regarding sharedmemory concepts.  The section below provides tutorial style informationregarding the setup of a shared memory system involving the MCPN750 andeither a MCP750 or a CPV5000.Setting up a working shared memory system involves proper setting ofcertain "config.h" parameters and proper setting of boot parametersvia the "c" command from the boot prompt.  There are three componentsinvolved in shared memory communication which must be configuredproperly to create a working system:.IP "Anchor:"This is an area of memory which must be accessible to all nodesparticipating in shared memory backplane communication.  The anchorpoints to the actual shared memory buffer pool which must be locatedin the same memory space as the anchor itself.  The associated"config.h" parameter is SM_ANCHOR_ADRS.  In certain configurations,nonzero nodes will "poll" for the location of the anchor.  "config.h"defines which comes into play for polling are SM_OFF_BOARD andSYS_SM_SYSTEM_MEM_POLL..IP "Master node:"This node is always designated as node zero.  It is the node whichsets up the anchor and shared memory pool.  Once the anchor and sharedmemory pool is set up, the master node acts as a peer with the othernodes.  The node number (0 in this case) is one of the boot parameterswhich can be set up with the "c" command from the bootline prompt..IP "Sequential addressing:"This is is governed by a "config.h" parameter, INCLUDE_SM_SEQ_ADDR and isused when sequential IP addresses are assigned to the participatingnodes.  Node zero is assigned the lowest IP address, followed by nodes1, 2 etc. which are assigned the subsequent and sequential IP addresses.The advantage of sequential addressing is that fewer boot parametersmust be specified to configure the system..LPThe following restrictions apply to shared memory configurations..IP "1)"Node zero must not boot over the shared memory interface.  Onlynonzero nodes are allowed to boot over the shared memory "sm"interface..IP "2)"The location of the anchor must be statically determinable by themaster node (node 0).  That is, the location of the anchor must

⌨️ 快捷键说明

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