Changeset 104df63 in rtems


Ignore:
Timestamp:
Jan 9, 2006, 3:44:11 PM (15 years ago)
Author:
Ralf Corsepius <ralf.corsepius@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
f245c5e
Parents:
9d8ad28
Message:

2006-01-09 Ralf Corsepius <ralf.corsepius@…>

  • libchip/network/open_eth.c, libchip/network/open_eth.h: Merger from rtems-4-6-branch.
Location:
c/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • c/src/ChangeLog

    r9d8ad28 r104df63  
     12006-01-09      Ralf Corsepius <ralf.corsepius@rtems.org>
     2
     3        * libchip/network/open_eth.c, libchip/network/open_eth.h:
     4        Merger from rtems-4-6-branch.
     5
    162006-01-09      Ralf Corsepius <ralf.corsepius@rtems.org>
    27
  • c/src/libchip/network/open_eth.c

    r9d8ad28 r104df63  
    3030#include <bsp.h>
    3131
     32#include <inttypes.h>
    3233#include <stdlib.h>
    3334#include <stdio.h>
     
    105106#define OETH_SUSPEND_NOTXBUF
    106107 */
    107 
    108 #define OETH_RATE_10MHZ
    109108
    110109#if (MCLBYTES < RBUF_SIZE)
     
    133132    struct MDRX *rxdesc;
    134133    rtems_vector_number vector;
    135 
     134    unsigned int en100MHz;
    136135
    137136    /*
     
    164163open_eth_interrupt_handler (rtems_vector_number v)
    165164{
    166     uint32_t   status;
     165    uint32_t status;
    167166
    168167    /* read and clear interrupt cause */
     
    192191}
    193192
    194 static uint32_t   read_mii(uint32_t  addr)
     193static uint32_t read_mii(uint32_t addr)
    195194{
    196195    while (oc.regs->miistatus & OETH_MIISTATUS_BUSY) {}
     
    206205}
    207206
    208 static void write_mii(uint32_t   addr, uint32_t  data)
     207static void write_mii(uint32_t addr, uint32_t data)
    209208{
    210209    while (oc.regs->miistatus & OETH_MIISTATUS_BUSY) {}
     
    235234
    236235    /* reset PHY and wait for complettion */
    237     mii_cr = read_mii(0);
    238     mii_cr = 0x3320;
    239 #ifdef OETH_RATE_10MHZ
    240     mii_cr = 0;
    241 #endif
     236    mii_cr = 0x3300;
     237    if (!sc->en100MHz) mii_cr = 0;
    242238    write_mii(0, mii_cr | 0x8000);
    243239    while (read_mii(0) & 0x8000) {}
    244     write_mii(20, 0x1422);
    245 #ifdef OETH_RATE_10MHZ
    246     mii_cr = 0;
    247 #endif
    248     write_mii(0, mii_cr);
    249     printf("open_eth: driver attached, PHY config : 0x%04x\n", read_mii(0));
     240    if (!sc->en100MHz) write_mii(0, 0);
     241    mii_cr = read_mii(0);
     242    printf("open_eth: driver attached, PHY config : 0x%04" PRIx32 "\n", read_mii(0));
    250243
    251244#ifdef OPEN_ETH_DEBUG
     
    500493
    501494      /* write buffer descriptor length and status */
     495      len_status &= 0x0000ffff;
    502496      len_status |= (len << 16) | (OETH_TX_BD_READY | OETH_TX_BD_CRC);
    503497      dp->regs->xd[dp->tx_ptr].len_status = len_status;
     
    726720    sc->txbufs = chip->txd_count;
    727721    sc->rxbufs = chip->rxd_count;
     722    sc->en100MHz = chip->en100MHz;
    728723
    729724
  • c/src/libchip/network/open_eth.h

    r9d8ad28 r104df63  
    1313  uint32_t                txd_count;
    1414  uint32_t                rxd_count;
     15  uint32_t                en100MHz;
    1516} open_eth_configuration_t;
    1617
Note: See TracChangeset for help on using the changeset viewer.