From ed0e3e60ed0c3e6e7234fb05bc3497fd02d36c72 Mon Sep 17 00:00:00 2001
From: Andrew Johnson
Date: Tue, 26 Apr 2011 12:44:46 -0500
Subject: [PATCH] RTEMS: Changes suggested by Kate Feng
* Added macros for configuring MBUF and CLUSTER space allocation
* More MBUF and CLUSTER space on mvme3100, mvme5500 and beatnik
* MVME5500: link with bspExt, use .elf extension like other BSPs
---
configure/os/CONFIG.Common.RTEMS-beatnik | 19 +++++++++----------
configure/os/CONFIG.Common.RTEMS-mvme2100 | 11 ++++++-----
configure/os/CONFIG.Common.RTEMS-mvme3100 | 17 +++++++++++------
configure/os/CONFIG.Common.RTEMS-mvme5500 | 11 ++++++++---
documentation/RELEASE_NOTES.html | 15 +++++++++++++++
src/RTEMS/base/rtems_netconfig.c | 18 ++++++++++++++----
6 files changed, 63 insertions(+), 28 deletions(-)
diff --git a/configure/os/CONFIG.Common.RTEMS-beatnik b/configure/os/CONFIG.Common.RTEMS-beatnik
index f3260fc5f..714bb3782 100644
--- a/configure/os/CONFIG.Common.RTEMS-beatnik
+++ b/configure/os/CONFIG.Common.RTEMS-beatnik
@@ -1,17 +1,19 @@
#
# CONFIG.Common.RTEMS-beatnik
-# A migration from Eric Norum's CONFIG.Common.RTEMS-mvme5500
-# Author: Dayle Kotturi
-# SLAC
-# dayle@slac.stanford.edu
+# $Revision-Id$
+# Author: Dayle Kotturi
#
# All RTEMS targets use the same Makefile fragment
#
-override EXE=.elf
+EXE = .elf
RTEMS_TARGET_CPU = powerpc
-GNU_TARGET=powerpc-rtems
+GNU_TARGET = powerpc-rtems
ARCH_DEP_CFLAGS += -DMY_DO_BOOTP=NULL
ARCH_DEP_CFLAGS += -DHAVE_MOTLOAD
+ARCH_DEP_CFLAGS += -DRTEMS_NETWORK_CONFIG_MBUF_SPACE=2048
+ARCH_DEP_CFLAGS += -DRTEMS_NETWORK_CONFIG_CLUSTER_SPACE=5120
+
+OP_SYS_LDLIBS += -lbspExt
MUNCH_SUFFIX = .boot
MUNCHNAME = $(PRODNAME:%$(EXE)=%$(MUNCH_SUFFIX))
@@ -19,16 +21,13 @@ define MUNCH_CMD
$(RTEMS_TOOLS)/bin/$(OBJCOPY_FOR_TARGET) -O binary $< $@
endef
-CROSS_COMPILER_TARGET_ARCHS=RTEMS-beatnik
-
include $(CONFIG)/os/CONFIG.Common.RTEMS
+
RTEMSSYMS=$(PRODNAME:%$(EXE)=%.sym)
RTEMSIMGS=$(PRODNAME:%$(EXE)=%.bin)
INSTALL_RTEMSSYMS=$(RTEMSSYMS:%=$(INSTALL_BIN)/%)
INSTALL_RTEMSIMGS=$(RTEMSIMGS:%=$(INSTALL_BIN)/%)
-OP_SYS_LDLIBS += -lbspExt
-
%.sym: %$(EXE)
$(XSYMS) $^ $@
diff --git a/configure/os/CONFIG.Common.RTEMS-mvme2100 b/configure/os/CONFIG.Common.RTEMS-mvme2100
index a09a064f3..9f7eeefca 100644
--- a/configure/os/CONFIG.Common.RTEMS-mvme2100
+++ b/configure/os/CONFIG.Common.RTEMS-mvme2100
@@ -1,15 +1,18 @@
#
+# CONFIG.Common.RTEMS-mvme3100
# $Revision-Id$
-# Author: W. Eric Norum
-# Canadian Light Source
-# eric@cls.usask.ca
+# Author: W. Eric Norum
#
# All RTEMS targets use the same Makefile fragment
#
+EXE = .elf
RTEMS_TARGET_CPU = powerpc
+GNU_TARGET = powerpc-rtems
ARCH_DEP_CFLAGS += -DMY_DO_BOOTP=NULL
ARCH_DEP_CFLAGS += -DHAVE_PPCBUG
+OP_SYS_LDLIBS += -lbspExt
+
MUNCH_SUFFIX = .boot
MUNCHNAME = $(PRODNAME:%$(EXE)=%$(MUNCH_SUFFIX))
define MUNCH_CMD
@@ -24,6 +27,4 @@ define MUNCH_CMD
rm -f rtems.gz
endef
-OP_SYS_LDLIBS += -lbspExt
-
include $(CONFIG)/os/CONFIG.Common.RTEMS
diff --git a/configure/os/CONFIG.Common.RTEMS-mvme3100 b/configure/os/CONFIG.Common.RTEMS-mvme3100
index bea023374..5ee0757e5 100644
--- a/configure/os/CONFIG.Common.RTEMS-mvme3100
+++ b/configure/os/CONFIG.Common.RTEMS-mvme3100
@@ -1,11 +1,19 @@
#
+# CONFIG.Common.RTEMS-mvme3100
+# $Revision-Id$
+# Author: W. Eric Norum
+#
# All RTEMS targets use the same Makefile fragment
#
-override EXE=.elf
+EXE = .elf
RTEMS_TARGET_CPU = powerpc
-GNU_TARGET=powerpc-rtems
+GNU_TARGET = powerpc-rtems
ARCH_DEP_CFLAGS += -DMY_DO_BOOTP=NULL
ARCH_DEP_CFLAGS += -DHAVE_MOTLOAD
+ARCH_DEP_CFLAGS += -DRTEMS_NETWORK_CONFIG_MBUF_SPACE=2048
+ARCH_DEP_CFLAGS += -DRTEMS_NETWORK_CONFIG_CLUSTER_SPACE=5120
+
+OP_SYS_LDLIBS += -lbspExt
MUNCH_SUFFIX = .boot
MUNCHNAME = $(PRODNAME:%$(EXE)=%$(MUNCH_SUFFIX))
@@ -13,16 +21,13 @@ define MUNCH_CMD
$(RTEMS_TOOLS)/bin/$(OBJCOPY_FOR_TARGET) -O binary $< $@
endef
-CROSS_COMPILER_TARGET_ARCHS=RTEMS-beatnik
-
include $(CONFIG)/os/CONFIG.Common.RTEMS
+
RTEMSSYMS=$(PRODNAME:%$(EXE)=%.sym)
RTEMSIMGS=$(PRODNAME:%$(EXE)=%.bin)
INSTALL_RTEMSSYMS=$(RTEMSSYMS:%=$(INSTALL_BIN)/%)
INSTALL_RTEMSIMGS=$(RTEMSIMGS:%=$(INSTALL_BIN)/%)
-OP_SYS_LDLIBS += -lbspExt
-
%.sym: %$(EXE)
$(XSYMS) $^ $@
diff --git a/configure/os/CONFIG.Common.RTEMS-mvme5500 b/configure/os/CONFIG.Common.RTEMS-mvme5500
index 2544445a5..082e46b38 100644
--- a/configure/os/CONFIG.Common.RTEMS-mvme5500
+++ b/configure/os/CONFIG.Common.RTEMS-mvme5500
@@ -1,16 +1,21 @@
#
+# CONFIG.Common.RTEMS-mvme5500
# $Revision-Id$
-# Author: W. Eric Norum
-# Advanced Photon Source
-# norume@aps.anl.gov
+# Author: W. Eric Norum
#
# All RTEMS targets use the same Makefile fragment
#
+EXE = .elf
RTEMS_TARGET_CPU = powerpc
+GNU_TARGET = powerpc-rtems
ARCH_DEP_CFLAGS += -DMY_DO_BOOTP=NULL
ARCH_DEP_CFLAGS += -DHAVE_MOTLOAD
+ARCH_DEP_CFLAGS += -DRTEMS_NETWORK_CONFIG_MBUF_SPACE=2048
+ARCH_DEP_CFLAGS += -DRTEMS_NETWORK_CONFIG_CLUSTER_SPACE=5120
ARCH_DEP_CFLAGS += -DBSP_NVRAM_BASE_ADDR=0xf1110000
+OP_SYS_LDLIBS += -lbspExt
+
MUNCH_SUFFIX = .boot
MUNCHNAME = $(PRODNAME:%$(EXE)=%$(MUNCH_SUFFIX))
define MUNCH_CMD
diff --git a/documentation/RELEASE_NOTES.html b/documentation/RELEASE_NOTES.html
index dc0e7f91d..16dacd411 100644
--- a/documentation/RELEASE_NOTES.html
+++ b/documentation/RELEASE_NOTES.html
@@ -69,6 +69,21 @@ fixed in this release:
+RTEMS-mvme5500
+
+This target now automatically links binary files with the bspExt library, and
+adds the extension .elf to their filenames, matching the other mvme
+targets.
+
+RTEMS Network Buffer Configuration
+
+Add the macros RTEMS_NETWORK_CONFIG_MBUF_SPACE and
+RTEMS_NETWORK_CONFIG_MBUF_SPACE to rtems_netconfig.c to allow
+customization of the network buffer space allocated. The configuration files
+for the RTEMS-mvme3100, RTEMS-mvme5500 and RTEMS-beatnik targets now default to
+allocating 2MB for mbufs and 5MB for clusters; other RTEMS targets will continue
+to use 180KB and 350KB rspectively.
+
RTEMS TFTP filesystem
Use the new mount API to initialize TFTP on newer RTEMS versions.
diff --git a/src/RTEMS/base/rtems_netconfig.c b/src/RTEMS/base/rtems_netconfig.c
index 93c3cf80a..910961153 100644
--- a/src/RTEMS/base/rtems_netconfig.c
+++ b/src/RTEMS/base/rtems_netconfig.c
@@ -1,7 +1,6 @@
/*************************************************************************\
* Copyright (c) 2002 The University of Saskatchewan
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
+* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
@@ -93,6 +92,17 @@ static struct rtems_bsdnet_ifconfig bsp_driver_config = {
# define MY_DO_BOOTP rtems_bsdnet_do_bootp
#endif
+/*
+ * Allow site- and BSP-specific network buffer space configuration.
+ * The macro values are specified in KBytes.
+ */
+#ifndef RTEMS_NETWORK_CONFIG_MBUF_SPACE
+# define RTEMS_NETWORK_CONFIG_MBUF_SPACE 180
+#endif
+#ifndef RTEMS_NETWORK_CONFIG_CLUSTER_SPACE
+# define RTEMS_NETWORK_CONFIG_CLUSTER_SPACE 350
+#endif
+
/*
* Network configuration
*/
@@ -104,8 +114,8 @@ struct rtems_bsdnet_config rtems_bsdnet_config = {
/* EPICS scan thread. */
/* If non-zero then the network daemons will run */
/* at this *RTEMS* priority */
- 180*1024, /* MBUF space */
- 350*1024, /* MBUF cluster space */
+ RTEMS_NETWORK_CONFIG_MBUF_SPACE*1024,
+ RTEMS_NETWORK_CONFIG_CLUSTER_SPACE*1024,
NULL, /* Host name */
MY_DOMAINNAME, /* Domain name */
};