2007-12-14 Chris Johns <chrisj@rtems.org>

* 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.
This commit is contained in:
Chris Johns
2007-12-22 08:28:57 +00:00
parent 1ff9922df0
commit e85eb70bc7
3 changed files with 43 additions and 10 deletions

View File

@@ -1,3 +1,10 @@
2007-12-14 Chris Johns <chrisj@rtems.org>
* 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.
2007-12-14 Chris Johns <chrisj@rtems.org>
* gdb-init: Add the show-exception.

View File

@@ -7,7 +7,7 @@ target remote | m68k-bdm-gdbserver pipe /dev/bdmcf0
# The console loop in the Axman dbug monitor. Found by trial and error
# with the debugger.
#
hb *0xffe254c0
thb *0xffe254c0
#
# Show the exception stack frame.

View File

@@ -307,6 +307,28 @@ mcf5235_fec_initialize_hardware(struct mcf5235_enet_struct *sc)
MCF5235_INTC0_IMRL &= ~(MCF5235_INTC0_IMRL_INT27 | MCF5235_INTC0_IMRL_MASKALL);
}
/*
* Get the MAC address from the hardware.
*/
static void
fec_get_mac_address(volatile struct mcf5235_enet_struct *sc, unsigned char* hwaddr)
{
unsigned long addr;
addr = MCF5235_FEC_PALR;
hwaddr[0] = (addr >> 24) & 0xff;
hwaddr[1] = (addr >> 16) & 0xff;
hwaddr[2] = (addr >> 8) & 0xff;
hwaddr[3] = (addr >> 0) & 0xff;
addr = MCF5235_FEC_PAUR;
hwaddr[4] = (addr >> 24) & 0xff;
hwaddr[5] = (addr >> 16) & 0xff;
}
/*
* Soak up buffer descriptors that have been sent.
*/
@@ -789,26 +811,30 @@ rtems_fec_driver_attach(struct rtems_bsdnet_ifconfig *config, int attaching )
/*
* Is driver free?
*/
if ((unitNumber <= 0) || (unitNumber > NIFACES)) {
printf("Bad FEC unit number.\n");
if ((unitNumber < 0) || (unitNumber >= NIFACES)) {
printf("mcf5235: bad FEC unit number.\n");
return 0;
}
sc = &enet_driver[unitNumber - 1];
sc = &enet_driver[unitNumber];
ifp = &sc->arpcom.ac_if;
if (ifp->if_softc != NULL) {
printf("Driver already in use.\n");
printf("mcf5235: driver already in use.\n");
return 0;
}
/*
* Process options
*/
if (config->hardware_address)
memcpy(sc->arpcom.ac_enaddr, config->hardware_address, ETHER_ADDR_LEN);
else
fec_get_mac_address(sc, sc->arpcom.ac_enaddr);
hwaddr = config->hardware_address;
printf("%s%d: Ethernet address: %02x:%02x:%02x:%02x:%02x:%02x\n",
unitName, unitNumber,
hwaddr[0], hwaddr[1], hwaddr[2],
hwaddr[3], hwaddr[4], hwaddr[5]);
memcpy(sc->arpcom.ac_enaddr, hwaddr, ETHER_ADDR_LEN);
printf("%s%d: mac: %02x:%02x:%02x:%02x:%02x:%02x\n",
unitName, unitNumber,
hwaddr[0], hwaddr[1], hwaddr[2],
hwaddr[3], hwaddr[4], hwaddr[5]);
if (config->mtu)
mtu = config->mtu;