Changeset e85eb70 in rtems


Ignore:
Timestamp:
Dec 22, 2007, 8:28:57 AM (12 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
4.10, 4.11, 4.9, master
Children:
107f4d34
Parents:
1ff9922
Message:

2007-12-14 Chris Johns <chrisj@…>

  • gdb-init: Make the first hb temporary.
  • network/network.c: Add support for reading the MAC address from the FEC if set by the boot monitor. dBug does not do this unless the network is used which is a shame.
Location:
c/src/lib/libbsp/m68k/mcf5235
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/m68k/mcf5235/ChangeLog

    r1ff9922 re85eb70  
     12007-12-14      Chris Johns <chrisj@rtems.org>
     2
     3        * gdb-init: Make the first hb temporary.
     4        * network/network.c: Add support for reading the MAC address from
     5        the FEC if set by the boot monitor. dBug does not do this unless
     6        the network is used which is a shame.
     7
    182007-12-14      Chris Johns <chrisj@rtems.org>
    29
  • c/src/lib/libbsp/m68k/mcf5235/gdb-init

    r1ff9922 re85eb70  
    88# with the debugger.
    99#
    10 hb *0xffe254c0
     10thb *0xffe254c0
    1111
    1212#
  • c/src/lib/libbsp/m68k/mcf5235/network/network.c

    r1ff9922 re85eb70  
    307307    MCF5235_INTC0_IMRL &= ~(MCF5235_INTC0_IMRL_INT27 | MCF5235_INTC0_IMRL_MASKALL);
    308308}
     309
     310/*
     311 * Get the MAC address from the hardware.
     312 */
     313static void
     314fec_get_mac_address(volatile struct mcf5235_enet_struct *sc, unsigned char* hwaddr)
     315{
     316  unsigned long addr;
     317
     318  addr = MCF5235_FEC_PALR;
     319
     320  hwaddr[0] = (addr >> 24) & 0xff;
     321  hwaddr[1] = (addr >> 16) & 0xff;
     322  hwaddr[2] = (addr >>  8) & 0xff;
     323  hwaddr[3] = (addr >>  0) & 0xff;
     324 
     325  addr = MCF5235_FEC_PAUR;
     326 
     327  hwaddr[4] = (addr >> 24) & 0xff;
     328  hwaddr[5] = (addr >> 16) & 0xff;
     329}
     330                   
    309331
    310332/*
     
    790812     * Is driver free?
    791813     */
    792     if ((unitNumber <= 0) || (unitNumber > NIFACES)) {
    793         printf("Bad FEC unit number.\n");
     814    if ((unitNumber < 0) || (unitNumber >= NIFACES)) {
     815        printf("mcf5235: bad FEC unit number.\n");
    794816        return 0;
    795817    }
    796     sc = &enet_driver[unitNumber - 1];
     818    sc = &enet_driver[unitNumber];
    797819    ifp = &sc->arpcom.ac_if;
    798820    if (ifp->if_softc != NULL) {
    799         printf("Driver already in use.\n");
     821        printf("mcf5235: driver already in use.\n");
    800822        return 0;
    801823    }
     
    804826     * Process options
    805827     */
     828    if (config->hardware_address)
     829      memcpy(sc->arpcom.ac_enaddr, config->hardware_address, ETHER_ADDR_LEN);
     830    else
     831      fec_get_mac_address(sc, sc->arpcom.ac_enaddr);
     832
    806833    hwaddr = config->hardware_address;
    807     printf("%s%d: Ethernet address: %02x:%02x:%02x:%02x:%02x:%02x\n",
    808                                             unitName, unitNumber,
    809                                             hwaddr[0], hwaddr[1], hwaddr[2],
    810                                             hwaddr[3], hwaddr[4], hwaddr[5]);
    811     memcpy(sc->arpcom.ac_enaddr, hwaddr, ETHER_ADDR_LEN);
     834    printf("%s%d: mac: %02x:%02x:%02x:%02x:%02x:%02x\n",
     835           unitName, unitNumber,
     836           hwaddr[0], hwaddr[1], hwaddr[2],
     837           hwaddr[3], hwaddr[4], hwaddr[5]);
    812838
    813839    if (config->mtu)
Note: See TracChangeset for help on using the changeset viewer.