Changeset f9fe954 in rtems


Ignore:
Timestamp:
Aug 16, 2012, 10:19:14 AM (7 years ago)
Author:
Christian Mauderer <christian.mauderer@…>
Branches:
4.11, master
Children:
7b865a4
Parents:
6f89813
git-author:
Christian Mauderer <christian.mauderer@…> (08/16/12 10:19:14)
git-committer:
Sebastian Huber <sebastian.huber@…> (08/21/12 09:06:24)
Message:

bsp/mpc55xx: Fix SMSC9218I_BIG_ENDIAN_SUPPORT

Location:
c/src/lib/libbsp/powerpc/mpc55xxevb
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/powerpc/mpc55xxevb/include/smsc9218i.h

    r6f89813 rf9fe954  
    7171#ifdef SMSC9218I_BIG_ENDIAN_SUPPORT
    7272  volatile smsc9218i_registers *const smsc9218i =
     73    (volatile smsc9218i_registers *) 0x3fff8000;
     74  volatile smsc9218i_registers *const smsc9218i_dma =
    7375    (volatile smsc9218i_registers *) 0x3fff8200;
    7476#else
    7577  volatile smsc9218i_registers *const smsc9218i =
    7678    (volatile smsc9218i_registers *) 0x3fff8000;
     79  volatile smsc9218i_registers *const smsc9218i_dma =
     80    (volatile smsc9218i_registers *) 0x3fff8000;
    7781#endif
    7882
     
    8084
    8185#ifdef SMSC9218I_BIG_ENDIAN_SUPPORT
     86  #define SMSC9218I_BIT_POS(pos) (pos)
     87#else
    8288  #define SMSC9218I_BIT_POS(pos) \
    8389    ((pos) > 15 ? \
    8490      ((pos) > 23 ? (pos) - 24 : (pos) - 8) \
    8591        : ((pos) > 7 ? (pos) + 8 : (pos) + 24))
    86 #else
    87   #define SMSC9218I_BIT_POS(pos) (pos)
    8892#endif
    8993
     
    106110
    107111#ifdef SMSC9218I_BIG_ENDIAN_SUPPORT
     112  #define SMSC9218I_SWAP(val) (val)
     113#else
    108114  #define SMSC9218I_SWAP(val) \
    109115    ((((val) >> 24) & 0xff) \
     
    111117      | ((((val) >> 8) & 0xff) << 16) \
    112118      | (((val) & 0xff) << 24))
    113 #else
    114   #define SMSC9218I_SWAP(val) (val)
    115119#endif
    116120
  • c/src/lib/libbsp/powerpc/mpc55xxevb/network/smsc9218i.c

    r6f89813 rf9fe954  
    777777  smsc9218i_driver_entry *e,
    778778  volatile smsc9218i_registers *regs,
     779  volatile smsc9218i_registers *regs_dma,
    779780  smsc9218i_receive_job_control *jc
    780781)
     
    796797    struct tcd_t *next_tcd = &jc->tcd_table [(i + 1) % SMSC9218I_RX_JOBS];
    797798
    798     tcd->SADDR = (uint32_t) &regs->rx_fifo_data;
     799    tcd->SADDR = (uint32_t) &regs_dma->rx_fifo_data;
    799800    tcd->SDF.B.SSIZE = 0x2;
    800801    tcd->SDF.B.DSIZE = 0x2;
     
    847848  smsc9218i_driver_entry *e = (smsc9218i_driver_entry *) arg;
    848849  volatile smsc9218i_registers *const regs = smsc9218i;
     850  volatile smsc9218i_registers *const regs_dma = smsc9218i_dma;
    849851  uint32_t mac_cr = 0;
    850852
    851   smsc9218i_init_receive_jobs(e, regs, jc);
     853  smsc9218i_init_receive_jobs(e, regs, regs_dma, jc);
    852854
    853855  /* Configure receiver */
     
    13361338  struct ifnet *ifp = &e->arpcom.ac_if;
    13371339  volatile smsc9218i_registers *const regs = smsc9218i;
     1340  volatile smsc9218i_registers *const regs_dma = smsc9218i_dma;
    13381341  uint32_t mac_cr = 0;
    13391342  smsc9218i_transmit_job_control *jc = &smsc_tx_jc;
     
    13631366    tcd.CDF.B.CITER = 1;
    13641367    tcd.BMF.R = SMSC9218I_TCD_BMF_LINK;
    1365     tcd.DADDR = (uint32_t) &regs->tx_fifo_data;
    1366 
     1368
     1369    tcd.DADDR = (uint32_t) &regs_dma->tx_fifo_data;
    13671370    tcd.DLAST_SGA = (int32_t) next_command_tcd;
    13681371    *data_tcd = tcd;
    13691372
     1373    tcd.DADDR = (uint32_t) &regs->tx_fifo_data;
    13701374    tcd.SADDR = (uint32_t) &jc->command_table [i].a;
    13711375    tcd.NBYTES = 8;
Note: See TracChangeset for help on using the changeset viewer.