From 9c54f28b70f0fd5919c22920cf8546e65d4632fa Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 6 Aug 2009 21:25:57 +0000 Subject: 2009-08-06 Joel Sherrill * ChangeLog, Makefile, uboot_getenv/Makefile, uboot_getenv/README, uboot_getenv/test.c: New files. --- uboot/ChangeLog | 5 ++++ uboot/Makefile | 9 ++++++++ uboot/uboot_getenv/Makefile | 28 +++++++++++++++++++++++ uboot/uboot_getenv/README | 7 ++++++ uboot/uboot_getenv/test.c | 56 +++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 105 insertions(+) create mode 100644 uboot/ChangeLog create mode 100644 uboot/Makefile create mode 100644 uboot/uboot_getenv/Makefile create mode 100644 uboot/uboot_getenv/README create mode 100644 uboot/uboot_getenv/test.c (limited to 'uboot') diff --git a/uboot/ChangeLog b/uboot/ChangeLog new file mode 100644 index 0000000..a760f9d --- /dev/null +++ b/uboot/ChangeLog @@ -0,0 +1,5 @@ +2009-08-06 Joel Sherrill + + * ChangeLog, Makefile, uboot_getenv/Makefile, uboot_getenv/README, + uboot_getenv/test.c: New files. + diff --git a/uboot/Makefile b/uboot/Makefile new file mode 100644 index 0000000..f60c254 --- /dev/null +++ b/uboot/Makefile @@ -0,0 +1,9 @@ +# +# $Id$ +# + +include $(RTEMS_MAKEFILE_PATH)/Makefile.inc +include $(RTEMS_CUSTOM) +include $(RTEMS_ROOT)/make/directory.cfg + +SUBDIRS = uboot_getenv diff --git a/uboot/uboot_getenv/Makefile b/uboot/uboot_getenv/Makefile new file mode 100644 index 0000000..0dd6b16 --- /dev/null +++ b/uboot/uboot_getenv/Makefile @@ -0,0 +1,28 @@ +# +# $Id$ +# + +# +# RTEMS_MAKEFILE_PATH is typically set in an environment variable +# + +EXEC=uboot_getenv.exe +PGM=${ARCH}/$(EXEC) + +# optional managers required +MANAGERS=all + +# C source names +CSRCS = test.c +COBJS = $(CSRCS:%.c=${ARCH}/%.o) + +include $(RTEMS_MAKEFILE_PATH)/Makefile.inc +include $(RTEMS_CUSTOM) +include $(PROJECT_ROOT)/make/leaf.cfg + +OBJS= $(COBJS) $(CXXOBJS) $(ASOBJS) + +all: ${ARCH} $(PGM) + +$(PGM): $(OBJS) + $(make-exe) diff --git a/uboot/uboot_getenv/README b/uboot/uboot_getenv/README new file mode 100644 index 0000000..7b230c5 --- /dev/null +++ b/uboot/uboot_getenv/README @@ -0,0 +1,7 @@ +# +# README for U-Boot getenv() demo +# + +Some boards on which RTEMS runs have U-Boot. If the BSP supports +it, then you may obtain environment variables which U-Boot has stored +in Flash. diff --git a/uboot/uboot_getenv/test.c b/uboot/uboot_getenv/test.c new file mode 100644 index 0000000..44ce0ec --- /dev/null +++ b/uboot/uboot_getenv/test.c @@ -0,0 +1,56 @@ +/* + * Simple test program -- simplified version of sample test hello. + */ + +#include + +#include +#include + +#if defined(HAS_UBOOT) + void test_getenv( + const char *name + ) + { + const char *bsp_uboot_getenv( + const char *name + ); + const char *rhs = bsp_uboot_getenv( name ); + + printf( "%s=%s\n", name, ((rhs) ? rhs : NULL)); + } +#endif + +rtems_task Init( + rtems_task_argument ignored +) +{ + puts( "\n\n*** U-Boot Get Environment Variable Test ***" ); + #if defined(HAS_UBOOT) + test_getenv( "ipaddr" ); + test_getenv( "baudrate" ); + test_getenv( "bootcmd" ); + test_getenv( "badname" ); + #else + puts( "This BSP does not have U-Boot." ); + #endif + puts( "*** END of U-Boot Get Environment Variable Test ***" ); + + exit( 0 ); +} + +/* configuration information */ + +/* NOTICE: the clock driver is explicitly disabled */ +#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER + +#define CONFIGURE_RTEMS_INIT_TASKS_TABLE + +#define CONFIGURE_MAXIMUM_TASKS 1 + +#define CONFIGURE_INIT + +#include + +/* end of file */ -- cgit v1.2.3