summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/developers_manual.dox11
-rw-r--r--Documentation/users_manual.dox4
-rw-r--r--arch/architecture.dox6
-rw-r--r--commands/cat.c21
-rw-r--r--commands/cd.c13
-rw-r--r--commands/cp.c21
-rw-r--r--commands/environment.c34
-rw-r--r--common/date.c5
-rw-r--r--common/env.c68
9 files changed, 166 insertions, 17 deletions
diff --git a/Documentation/developers_manual.dox b/Documentation/developers_manual.dox
index 8978ab955c..17e5e0faa8 100644
--- a/Documentation/developers_manual.dox
+++ b/Documentation/developers_manual.dox
@@ -2,12 +2,9 @@
FIXME: Hints and tips for simply adapting UBootv2
-@subpage dev_board
-
-@subpage dev_cpu
-
-@subpage dev_architecture
-
-@subpage dev_params
+ - @subpage dev_board
+ - @subpage dev_cpu
+ - @subpage dev_architecture
+ - @subpage dev_params
*/ \ No newline at end of file
diff --git a/Documentation/users_manual.dox b/Documentation/users_manual.dox
index 232c0f5445..4d7f31af93 100644
--- a/Documentation/users_manual.dox
+++ b/Documentation/users_manual.dox
@@ -2,7 +2,7 @@
FIXME: Hints and tips for simply using UBootv2
-@subpage command_reference
-@subpage partitions
+ - @subpage command_reference
+ - @subpage partitions
*/ \ No newline at end of file
diff --git a/arch/architecture.dox b/arch/architecture.dox
index e2356bbd73..1e5d675a29 100644
--- a/arch/architecture.dox
+++ b/arch/architecture.dox
@@ -8,8 +8,8 @@ Friesel
Frasel
-@subpage dev_arm_mach
-@subpage dev_bf_mach
-@subpage dev_ppc_mach
+ - @subpage dev_arm_mach
+ - @subpage dev_bf_mach
+ - @subpage dev_ppc_mach
*/
diff --git a/commands/cat.c b/commands/cat.c
index 7a8facd0e3..af33eca80c 100644
--- a/commands/cat.c
+++ b/commands/cat.c
@@ -1,6 +1,4 @@
/*
- * cat.c - conacatenate files
- *
* Copyright (c) 2007 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
*
* See file CREDITS for list of people who contributed to this
@@ -20,6 +18,11 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+/**
+ * @file
+ * @brief Concatenate files to stdout command
+ */
+
#include <common.h>
#include <command.h>
#include <fs.h>
@@ -29,6 +32,11 @@
#include <xfuncs.h>
#include <malloc.h>
+/**
+ * @param[in] cmdtp FIXME
+ * @param[in] argc Argument count from command line
+ * @param[in] argv List of input arguments
+ */
static int do_cat(cmd_tbl_t *cmdtp, int argc, char *argv[])
{
int ret;
@@ -85,3 +93,12 @@ U_BOOT_CMD_START(cat)
.usage = "concatenate file(s)",
U_BOOT_CMD_HELP(cmd_cat_help)
U_BOOT_CMD_END
+
+/**
+ * @page cat_command cat (concatenate)
+ *
+ * Usage is: cat <file> [<file> ...]
+ *
+ * Concatenate files to stdout. Currently only printable characters
+ * and \\n and \\t are printed, but this should be optional
+ */
diff --git a/commands/cd.c b/commands/cd.c
index 4263d0922e..08c3a2d268 100644
--- a/commands/cd.c
+++ b/commands/cd.c
@@ -20,6 +20,11 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+/**
+ * @file
+ * @brief Change working directory
+ */
+
#include <common.h>
#include <command.h>
#include <fs.h>
@@ -52,3 +57,11 @@ U_BOOT_CMD_START(cd)
.usage = "change working directory",
U_BOOT_CMD_HELP(cmd_cd_help)
U_BOOT_CMD_END
+
+/**
+ * @page cd_command cd (change working directory)
+ *
+ * Usage is: cd [<directory name>]
+ *
+ * Change to <directory name>. If called without argument, change to / (root)
+ */
diff --git a/commands/cp.c b/commands/cp.c
index ea0a91d467..e26ff1fa00 100644
--- a/commands/cp.c
+++ b/commands/cp.c
@@ -20,6 +20,10 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+/**
+ * @file
+ * @brief "cp" command implementation
+ */
#include <common.h>
#include <command.h>
#include <fs.h>
@@ -32,6 +36,10 @@
#define RW_BUF_SIZE (ulong)4096
+/**
+ * @param[in] src FIXME
+ * @param[out] dst FIXME
+ */
static int copy_file(const char *src, const char *dst)
{
char *rw_buf = NULL;
@@ -79,6 +87,11 @@ out:
return ret;
}
+/**
+ * @param[in] cmdtp FIXME
+ * @param[in] argc Argument count from command line
+ * @param[in] argv List of input arguments
+ */
static int do_cp ( cmd_tbl_t *cmdtp, int argc, char *argv[])
{
int ret = 1;
@@ -134,3 +147,11 @@ U_BOOT_CMD_START(cp)
.usage = "copy files",
U_BOOT_CMD_HELP(cmd_cp_help)
U_BOOT_CMD_END
+
+/**
+ * @page cp_command cp (copy)
+ *
+ * Usage: cp <source> [<source>] <destination>
+ *
+ * FIXME
+ */
diff --git a/commands/environment.c b/commands/environment.c
index 999a5f3fb4..b5517aa977 100644
--- a/commands/environment.c
+++ b/commands/environment.c
@@ -20,6 +20,11 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+/**
+ * @file
+ * @brief Managing environment and environment variables
+ */
+
#ifdef __U_BOOT__
#include <common.h>
#include <command.h>
@@ -205,7 +210,7 @@ out:
}
static __maybe_unused char cmd_saveenv_help[] =
-"Usage: saveenv [DIRECTORY] [ENVFS]\n"
+"Usage: saveenv [<envfs>] [<directory>]\n"
"Save the files in <directory> to the persistent storage device <envfs>.\n"
"<envfs> is normally a block in flash, but could be any other file.\n"
"If ommitted <directory> defaults to /env and <envfs> defaults to /dev/env0.\n"
@@ -219,6 +224,20 @@ U_BOOT_CMD_START(saveenv)
U_BOOT_CMD_END
#endif /* __U_BOOT__ */
+/**
+ * @page saveenv_command saveenv
+ *
+ * Usage: saveenv [<envfs>] [<directory>]
+ *
+ * Save the files in <directory> to the persistent storage device <envfs>.
+ * <envfs> is normally a block in flash, but could be any other file.
+ *
+ * If ommitted <directory> defaults to /env and <envfs> defaults to
+ * /dev/env0.
+ *
+ * @note envfs can only handle files. Directories are skipped silently.
+ */
+
int envfs_load(char *filename, char *dir)
{
struct envfs_super super;
@@ -349,3 +368,16 @@ U_BOOT_CMD_START(loadenv)
U_BOOT_CMD_HELP(cmd_loadenv_help)
U_BOOT_CMD_END
#endif /* __U_BOOT__ */
+
+/**
+ * @page loadenv_command loadenv
+ *
+ * Usage: loadenv [<directory>] [<envfs>]
+ *
+ * Load the persistent storage contained in <envfs> to the directory <directory>.
+ *
+ * If ommitted <directory> defaults to /env and <envfs> defaults to
+ * /dev/env0.
+ *
+ * @note envfs can only handle files. Directories are skipped silently.
+ */
diff --git a/common/date.c b/common/date.c
index c656b9678a..47d96afd3f 100644
--- a/common/date.c
+++ b/common/date.c
@@ -21,8 +21,9 @@
* MA 02111-1307 USA
*/
-/*
- * Date & Time support for Philips PCF8563 RTC
+/**
+ * @file
+ * @brief Date & Time support
*/
#include <common.h>
diff --git a/common/env.c b/common/env.c
index 62134bda33..1b092c94fe 100644
--- a/common/env.c
+++ b/common/env.c
@@ -20,6 +20,11 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+/**
+ * @file
+ * @brief Environment support
+ */
+
#include <common.h>
#include <command.h>
#include <driver.h>
@@ -28,21 +33,36 @@
#include <errno.h>
#include <init.h>
+/**
+ * Managment of a environment variable
+ */
struct variable_d {
+ /*! List management */
struct variable_d *next;
+ /*! variable length data */
char data[0];
};
#define VARIABLE_D_SIZE(name, value) (sizeof(struct variable_d) + strlen(name) + strlen(value) + 2)
+/**
+ * FIXME
+ */
struct env_context {
+ /*! FIXME */
struct env_context *parent;
+ /*! FIXME */
struct variable_d *local;
+ /*! FIXME */
struct variable_d *global;
};
static struct env_context *context;
+/**
+ * Remove a list of environment variables
+ * @param[inout] v Variable anchor to remove
+ */
static void free_variables(struct variable_d *v)
{
struct variable_d *next;
@@ -54,6 +74,9 @@ static void free_variables(struct variable_d *v)
}
}
+/**
+ * FIXME
+ */
int env_push_context(void)
{
struct env_context *c = xzalloc(sizeof(struct env_context));
@@ -74,6 +97,9 @@ int env_push_context(void)
late_initcall(env_push_context);
+/**
+ * FIXME
+ */
int env_pop_context(void)
{
struct env_context *c = context;
@@ -89,11 +115,21 @@ int env_pop_context(void)
return -EINVAL;
}
+/**
+ * Return variable's value
+ * @param[in] var Variable of interest
+ * @return Value as text
+ */
static char *var_val(struct variable_d *var)
{
return &var->data[strlen(var->data) + 1];
}
+/**
+ * Return variable's name
+ * @param[in] var Variable of interest
+ * @return Name as text
+ */
static char *var_name(struct variable_d *var)
{
return var->data;
@@ -267,6 +303,17 @@ U_BOOT_CMD_START(printenv)
" - print value of environment variable 'name'\n")
U_BOOT_CMD_END
+/**
+ * @page printenv_command printenv
+ *
+ * Usage: printenv [<name>]
+ *
+ * Print environment variables.
+ * If <name> was given, it prints out its content if the environment variable
+ * <name> exists.
+ * Without the <name> argument all current environment variables are printed.
+ */
+
#ifdef CONFIG_SIMPLE_PARSER
static int do_setenv ( cmd_tbl_t *cmdtp, int argc, char *argv[])
{
@@ -291,6 +338,19 @@ U_BOOT_CMD_START(setenv)
" - delete environment variable 'name'\n")
U_BOOT_CMD_END
+/**
+ * @page setenv_command setenv
+ *
+ * Usage: setenv <name> [<value>]
+ *
+ * Set environment variable <name> to <value ...>
+ * If no <value> was given, the variable <name> will be removed.
+ *
+ * This command can be replaced by using the simpler form:
+ *
+ * <name> = <value>
+ */
+
#endif
static int do_export ( cmd_tbl_t *cmdtp, int argc, char *argv[])
@@ -329,3 +389,11 @@ U_BOOT_CMD_START(export)
U_BOOT_CMD_HELP(cmd_export_help)
U_BOOT_CMD_END
+/**
+ * @page export_command export
+ *
+ * Usage: export <var>[=value]...
+ *
+ * Export an environment variable to subsequently executed scripts
+ */
+