diff --git a/src/RTEMS/base/Makefile b/src/RTEMS/base/Makefile index 7688f463d..1dcb8770e 100644 --- a/src/RTEMS/base/Makefile +++ b/src/RTEMS/base/Makefile @@ -15,7 +15,10 @@ SRCS += rtems_config.c SRCS += rtems_netconfig.c SRCS += rtems_util.c SRCS += rtems_dummyreg.c -SRCS += setBootConfigFromPPCBUGNVRAM.c + +SRCS_RTEMS-mvme2100 += setBootConfigFromPPCBUGNVRAM.c +SRCS_RTEMS-mvme5500 += setBootConfigFromMOTLOADNVRAM.c +SRCS += $(SRCS_$(T_A)) LIBRARY_RTEMS = rtemsCom LIBRARY_SRCS = $(SRCS) $(BUILD_ARCHS) diff --git a/src/RTEMS/base/rtems_config.c b/src/RTEMS/base/rtems_config.c index 552d8aa82..be29b38ee 100644 --- a/src/RTEMS/base/rtems_config.c +++ b/src/RTEMS/base/rtems_config.c @@ -48,6 +48,8 @@ rtems_task Init (rtems_task_argument argument); #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER -# define CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER +#ifndef mpc7455 +#define CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER +#endif #include diff --git a/src/RTEMS/base/rtems_init.c b/src/RTEMS/base/rtems_init.c index 5c06bc693..d7dd5193e 100644 --- a/src/RTEMS/base/rtems_init.c +++ b/src/RTEMS/base/rtems_init.c @@ -376,13 +376,22 @@ Init (rtems_task_argument ignored) */ #if defined(__i386__) initRemoteGdb(ticksPerSecond); +rtems_bsdnet_bootp_server_name = "164.54.8.131"; +rtems_bsdnet_bootp_cmdline = "epics/vlinac/st.cmd"; +rtems_bsdnet_bootp_cmdline = "epics/test/iocrtems/st.cmd"; #endif -#if defined(__PPC) && defined(HAVE_PPCBUG) +#if defined(HAVE_PPCBUG) { extern void setBootConfigFromPPCBUGNVRAM(void); setBootConfigFromPPCBUGNVRAM(); } #endif +#if defined(HAVE_MOTLOAD) + { + extern void setBootConfigFromMOTLOADNVRAM(void); + setBootConfigFromMOTLOADNVRAM(); + } +#endif /* * Override RTEMS configuration diff --git a/src/RTEMS/base/rtems_netconfig.c b/src/RTEMS/base/rtems_netconfig.c index ba43c88cf..01f6c4774 100644 --- a/src/RTEMS/base/rtems_netconfig.c +++ b/src/RTEMS/base/rtems_netconfig.c @@ -66,9 +66,6 @@ static struct rtems_bsdnet_ifconfig e3c509_driver_config = { extern int rtems_dec21140_driver_attach(); # endif # endif -# if defined(HAVE_PPCBUG) -# define MY_DO_BOOTP NULL -# endif # endif static struct rtems_bsdnet_ifconfig bsp_driver_config = { diff --git a/src/RTEMS/base/setBootConfigFromMOTLOADNVRAM.c b/src/RTEMS/base/setBootConfigFromMOTLOADNVRAM.c new file mode 100644 index 000000000..741c7b4d0 --- /dev/null +++ b/src/RTEMS/base/setBootConfigFromMOTLOADNVRAM.c @@ -0,0 +1,67 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +static char * +gev(const char *parm) +{ + volatile char *nvp = (volatile unsigned char *)(GT64260_DEV1_BASE + 0x10000 + 0x70F8); + char *val; + char *ret; + const char *name; + char c; + + for (;;) { + if (*nvp == '\0') + return NULL; + name = parm; + while ((c = *nvp++) != '\0') { + if ((c == '=') && (*name == '\0')) { + val = (char *)nvp; + while (*nvp++ != '\0') + continue; + ret = malloc(nvp - val); + if (ret == NULL) + return NULL; + nvp = val; + val = ret; + while ((*val++ = *nvp++) != '\0') + continue; + return ret; + } + if (c != *name++) { + while (*nvp++ != '\0') + continue; + break; + } + } + } +} + +void +setBootConfigFromMOTLOADNVRAM(void) +{ + if (rtems_bsdnet_config.bootp != NULL) + return; + rtems_bsdnet_bootp_server_name = gev("mot-/dev/enet0-sipa"); + rtems_bsdnet_config.gateway = gev("mot-/dev/enet0-gipa"); + rtems_bsdnet_config.ifconfig->ip_netmask = gev("mot-/dev/enet0-snma"); + + rtems_bsdnet_config.name_server[0] = gev("rtems-dns-server"); + if (rtems_bsdnet_config.name_server[0] == NULL) + rtems_bsdnet_config.name_server[0] = rtems_bsdnet_bootp_server_name; + rtems_bsdnet_config.log_host = rtems_bsdnet_bootp_server_name; + + rtems_bsdnet_config.ifconfig->ip_address = gev("mot-/dev/enet0-cipa"); + rtems_bsdnet_config.hostname = gev("rtems-client-name"); + if (rtems_bsdnet_config.hostname == NULL) + rtems_bsdnet_config.hostname = rtems_bsdnet_config.ifconfig->ip_address; + + rtems_bsdnet_bootp_boot_file_name = gev("mot-/dev/enet0-file"); + rtems_bsdnet_bootp_cmdline = gev("epics-script"); +} diff --git a/src/RTEMS/base/setBootConfigFromPPCBUGNVRAM.c b/src/RTEMS/base/setBootConfigFromPPCBUGNVRAM.c index 9287ab964..bfc082edf 100644 --- a/src/RTEMS/base/setBootConfigFromPPCBUGNVRAM.c +++ b/src/RTEMS/base/setBootConfigFromPPCBUGNVRAM.c @@ -4,8 +4,6 @@ #include #include -#if defined(__PPC) - struct ppcbug_nvram { rtems_unsigned32 PacketVersionIdentifier; rtems_unsigned32 NodeControlMemoryAddress; @@ -45,6 +43,9 @@ setBootConfigFromPPCBUGNVRAM(void) static char server[INET_ADDRSTRLEN]; static char gateway[INET_ADDRSTRLEN]; + if (rtems_bsdnet_config.bootp != NULL) + return; + /* * Get network configuation from PPCBUG. * The 'correct' way to do this would be to issue a .NETCFIG PPCBUG @@ -80,5 +81,3 @@ setBootConfigFromPPCBUGNVRAM(void) rtems_bsdnet_bootp_boot_file_name = nvram.BootFilenameString; rtems_bsdnet_bootp_cmdline = nvram.ArgumentFilenameString; } - -#endif /* defined(__PPC) */