From c05bc62b82f4a0aed6e67a67e430445d095fa2aa Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Fri, 22 Jul 2011 13:02:37 +0000 Subject: 2011-03-31 Kate Feng PR 1778/bsps * vme/VMEConfig.h: Used the VME shared IRQ handlers. * include/bsp.h: Removed BSP_PIC_DO_EOI. * network/if_100MHz/GT64260eth.c: Recycle the Rx mbuf if there is any Rx error. --- c/src/lib/libbsp/powerpc/mvme5500/ChangeLog | 8 ++++++ c/src/lib/libbsp/powerpc/mvme5500/include/bsp.h | 8 ------ .../mvme5500/network/if_100MHz/GT64260eth.c | 29 +++++++++++----------- c/src/lib/libbsp/powerpc/mvme5500/vme/VMEConfig.h | 28 +++++++++++++++++++-- 4 files changed, 49 insertions(+), 24 deletions(-) diff --git a/c/src/lib/libbsp/powerpc/mvme5500/ChangeLog b/c/src/lib/libbsp/powerpc/mvme5500/ChangeLog index f4f6901ba7..5405f524cf 100644 --- a/c/src/lib/libbsp/powerpc/mvme5500/ChangeLog +++ b/c/src/lib/libbsp/powerpc/mvme5500/ChangeLog @@ -1,3 +1,11 @@ +2011-03-31 Kate Feng + + PR 1778/bsps + * vme/VMEConfig.h: Used the VME shared IRQ handlers. + * include/bsp.h: Removed BSP_PIC_DO_EOI. + * network/if_100MHz/GT64260eth.c: + Recycle the Rx mbuf if there is any Rx error. + 2009-05-08 Joel Sherrill * irq/irq.c, network/if_1GHz/POSSIBLEBUG: Removed. diff --git a/c/src/lib/libbsp/powerpc/mvme5500/include/bsp.h b/c/src/lib/libbsp/powerpc/mvme5500/include/bsp.h index 02ca04d243..0ccfa57449 100644 --- a/c/src/lib/libbsp/powerpc/mvme5500/include/bsp.h +++ b/c/src/lib/libbsp/powerpc/mvme5500/include/bsp.h @@ -100,14 +100,6 @@ DiscoveryChipVersion BSP_getDiscoveryChipVersion(); #define BSP_MAX_PCI_BUS_ON_PCI1 2 #define BSP_MAX_PCI_BUS (BSP_MAX_PCI_BUS_ON_PCI0+BSP_MAX_PCI_BUS_ON_PCI1) - -/* The glues to Till's vmeUniverse, although the name does not - * actually reflect the relevant architect of the MVME5500. - * Till TODO ? : BSP_PCI_DO_EOI instead ? - * BSP_EXT_IRQ0 instead of BSP_PCI_IRQ0 ? - * - */ -#define BSP_PIC_DO_EOI inl(0xc34) /* PCI IACK */ #define BSP_PCI_IRQ0 BSP_GPP_IRQ_LOWEST_OFFSET /* diff --git a/c/src/lib/libbsp/powerpc/mvme5500/network/if_100MHz/GT64260eth.c b/c/src/lib/libbsp/powerpc/mvme5500/network/if_100MHz/GT64260eth.c index 3ed43638b1..c04e361d21 100644 --- a/c/src/lib/libbsp/powerpc/mvme5500/network/if_100MHz/GT64260eth.c +++ b/c/src/lib/libbsp/powerpc/mvme5500/network/if_100MHz/GT64260eth.c @@ -743,21 +743,22 @@ static int GT64260eth_rx(struct GTeth_softc *sc) if (cmdsts & RX_STS_SF) sc->stats.frame_errors++; if ((cmdsts & RX_STS_LC) || (cmdsts & RX_STS_COL)) ifp->if_collisions++; - goto give_it_back; + /* recycle the buffer */ + m->m_len=sc->rx_buf_sz; + } + else { + m = sc->rxq_mbuf[sc->rxq_fi]; + m->m_len = m->m_pkthdr.len = byteCount - sizeof(struct ether_header); + eh = mtod (m, struct ether_header *); + m->m_data += sizeof(struct ether_header); + ether_input (ifp, eh, m); + + ifp->if_ipackets++; + ifp->if_ibytes+=byteCount; + --sc->rxq_active; + MGETHDR (m, M_WAIT, MT_DATA); + MCLGET (m, M_WAIT); } - m = sc->rxq_mbuf[sc->rxq_fi]; - m->m_len = m->m_pkthdr.len = byteCount - sizeof(struct ether_header); - eh = mtod (m, struct ether_header *); - m->m_data += sizeof(struct ether_header); - ether_input (ifp, eh, m); - - ifp->if_ipackets++; - ifp->if_ibytes+=byteCount; - --sc->rxq_active; - - give_it_back: - MGETHDR (m, M_WAIT, MT_DATA); - MCLGET (m, M_WAIT); m->m_pkthdr.rcvif = ifp; sc->rxq_mbuf[sc->rxq_fi]= m; /* convert mbuf pointer to data pointer of correct type */ diff --git a/c/src/lib/libbsp/powerpc/mvme5500/vme/VMEConfig.h b/c/src/lib/libbsp/powerpc/mvme5500/vme/VMEConfig.h index 1a901b7c3e..19a70210c7 100644 --- a/c/src/lib/libbsp/powerpc/mvme5500/vme/VMEConfig.h +++ b/c/src/lib/libbsp/powerpc/mvme5500/vme/VMEConfig.h @@ -1,6 +1,21 @@ #ifndef RTEMS_BSP_VME_CONFIG_H #define RTEMS_BSP_VME_CONFIG_H -/* VMEConfig.h, S. Kate Feng modified it for MVME5500 3/04 */ +/* VMEConfig.h, S. Kate Feng modified it for MVME5500 3/04 + * + * May 2011 : Use the VME shared IRQ handlers. + * + * It seems that the implementation of VMEUNIVERSE_IRQ_MGR_FLAG_PW_WORKAROUND + * is not fully developed. The UNIV_REGOFF_VCSR_BS is defined for VME64 + * specification, which does not apply to a VME32 crate. In order to avoid + * spurious VME interrupts, a better and more universal solution is + * to flush the vmeUniverse FIFO by reading a register back within the + * users' Interrupt Service Routine (ISR) before returning. + * + * Some devices might require the ISR to issue an interrupt status READ + * after its IRQ is cleared, but before its corresponding interrupt + * is enabled again. + * + */ /* BSP specific address space configuration parameters */ /* @@ -11,6 +26,10 @@ * layout: */ #define _VME_A32_WIN0_ON_PCI 0x90000000 +/* If _VME_CSR_ON_PCI is defined then the A32 window is reduced to accommodate + * CSR for space. + */ +#define _VME_CSR_ON_PCI 0x9e000000 #define _VME_A24_ON_PCI 0x9f000000 #define _VME_A16_ON_PCI 0x9fff0000 @@ -30,7 +49,12 @@ #define BSP_VME_UNIVERSE_INSTALL_IRQ_MGR(err) \ do { \ - err = vmeUniverseInstallIrqMgr(0,64+12,1,64+13); \ + err = vmeUniverseInstallIrqMgrAlt(VMEUNIVERSE_IRQ_MGR_FLAG_SHARED,\ + 0, BSP_GPP_VME_VLINT0, \ + 1, BSP_GPP_VME_VLINT1, \ + 2, BSP_GPP_VME_VLINT2, \ + 3, BSP_GPP_VME_VLINT3, \ + -1 /* terminate list */); \ } while (0) #endif -- cgit v1.2.3