From 28b38f3c3073a2edf7daa7140c5db204fa3645ff Mon Sep 17 00:00:00 2001 From: Thomas Doerfler Date: Thu, 25 Feb 2010 11:01:35 +0000 Subject: combine all checks for missing MAC address enable FPU, if POSIX init task present explicitly disable all edge port interrupts --- c/src/lib/libbsp/m68k/genmcf548x/ChangeLog | 7 +++++++ c/src/lib/libbsp/m68k/genmcf548x/network/network.c | 24 ++++++++-------------- .../lib/libbsp/m68k/genmcf548x/startup/bspstart.c | 10 ++++----- .../lib/libbsp/m68k/genmcf548x/startup/init548x.c | 4 ++++ 4 files changed, 24 insertions(+), 21 deletions(-) (limited to 'c/src/lib/libbsp/m68k/genmcf548x') diff --git a/c/src/lib/libbsp/m68k/genmcf548x/ChangeLog b/c/src/lib/libbsp/m68k/genmcf548x/ChangeLog index 87d4ce7c17..d7b2bfb11f 100644 --- a/c/src/lib/libbsp/m68k/genmcf548x/ChangeLog +++ b/c/src/lib/libbsp/m68k/genmcf548x/ChangeLog @@ -1,3 +1,10 @@ +2010-02-24 Thomas Doerfler + + * network/network.c: combine all checks for missing MAC address + * startup/bspstart.c: enable FPU, if POSIX init task present + * startup/init548x.c: explicitly disable all edge port interrupts + + 2009-12-16 Thomas Doerfler * console/console.c: adapted to new prototype for *_write diff --git a/c/src/lib/libbsp/m68k/genmcf548x/network/network.c b/c/src/lib/libbsp/m68k/genmcf548x/network/network.c index 797f3f9117..a94ba360ca 100644 --- a/c/src/lib/libbsp/m68k/genmcf548x/network/network.c +++ b/c/src/lib/libbsp/m68k/genmcf548x/network/network.c @@ -1721,13 +1721,6 @@ int rtems_mcf548x_fec_driver_attach(struct rtems_bsdnet_ifconfig *config) /* There is no entry in NVRAM, but there is in the ifconfig struct, so use it. */ memcpy((void *)sc->arpcom.ac_enaddr, config->hardware_address, ETHER_ADDR_LEN); } - else - { - /* There is no ethernet address provided, so it could be read - * from the Ethernet protocol block of SCC1 in DPRAM. - */ - rtems_panic("No Ethernet address specified!\n"); - } #else /* NVRAM_CONFIGURE != 1 */ @@ -1736,15 +1729,6 @@ int rtems_mcf548x_fec_driver_attach(struct rtems_bsdnet_ifconfig *config) memcpy(sc->arpcom.ac_enaddr, config->hardware_address, ETHER_ADDR_LEN); - } - else - { - - /* There is no ethernet address provided, so it could be read - * from the Ethernet protocol block of SCC1 in DPRAM. - */ - rtems_panic("No Ethernet address specified!\n"); - } #endif /* NVRAM_CONFIGURE != 1 */ @@ -1770,6 +1754,14 @@ int rtems_mcf548x_fec_driver_attach(struct rtems_bsdnet_ifconfig *config) ); } #endif + if ((sc->arpcom.ac_enaddr[0] == 0) && + (sc->arpcom.ac_enaddr[1] == 0) && + (sc->arpcom.ac_enaddr[2] == 0)) { + /* There is no ethernet address provided, so it could be read + * from the Ethernet protocol block of SCC1 in DPRAM. + */ + rtems_panic("No Ethernet address specified!\n"); + } if(config->mtu) mtu = config->mtu; else diff --git a/c/src/lib/libbsp/m68k/genmcf548x/startup/bspstart.c b/c/src/lib/libbsp/m68k/genmcf548x/startup/bspstart.c index 9bd57c9abb..67774a2ad7 100644 --- a/c/src/lib/libbsp/m68k/genmcf548x/startup/bspstart.c +++ b/c/src/lib/libbsp/m68k/genmcf548x/startup/bspstart.c @@ -274,11 +274,11 @@ void bsp_start( void ) _CPU_cacr_shadow = BSP_CACR_INIT; /* Switch on FPU in CACR shadow register if necessary */ - if ( - Configuration_RTEMS_API.User_initialization_tasks_table != NULL && - (Configuration_RTEMS_API.User_initialization_tasks_table->attribute_set - & RTEMS_FLOATING_POINT) != 0 - ) { + if ((Configuration_POSIX_API.number_of_initialization_threads > 0) || + ((Configuration_RTEMS_API.number_of_initialization_tasks > 0) && + (Configuration_RTEMS_API.User_initialization_tasks_table + ->attribute_set & RTEMS_FLOATING_POINT) != 0) + ) { _CPU_cacr_shadow &= ~MCF548X_CACR_DF; } diff --git a/c/src/lib/libbsp/m68k/genmcf548x/startup/init548x.c b/c/src/lib/libbsp/m68k/genmcf548x/startup/init548x.c index 21923deef9..7f2646d7d3 100644 --- a/c/src/lib/libbsp/m68k/genmcf548x/startup/init548x.c +++ b/c/src/lib/libbsp/m68k/genmcf548x/startup/init548x.c @@ -321,4 +321,8 @@ gpio_init(void) ); #endif + /* + * make sure the "edge port" has all interrupts disabled + */ + MCF548X_EPORT_EPIER = 0; } -- cgit v1.2.3