summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuergen Beisert <j.beisert@pengutronix.de>2007-11-09 14:05:23 +0100
committerJuergen Beisert <j.beisert@pengutronix.de>2007-11-09 14:05:23 +0100
commit3ff14ef200fc6f69b6237fffabbad796aa463cfb (patch)
treee6e749f27cbd14641eac77e46e8e52736cb0cc92
parent8fe25ecf1270ab08e0b3baf5e8bae91e8f55eaa9 (diff)
downloadbarebox-3ff14ef200fc6f69b6237fffabbad796aa463cfb.tar.gz
barebox-3ff14ef200fc6f69b6237fffabbad796aa463cfb.tar.xz
various doc added
Signed-off-by: Juergen Beisert <j.beisert@pengutronix.de>
-rw-r--r--Documentation/commands.dox7
-rw-r--r--commands/flash.c40
-rw-r--r--commands/net.c12
-rw-r--r--commands/partition.c31
-rw-r--r--common/partition.c20
5 files changed, 96 insertions, 14 deletions
diff --git a/Documentation/commands.dox b/Documentation/commands.dox
index 135787c7e7..fe539e5427 100644
--- a/Documentation/commands.dox
+++ b/Documentation/commands.dox
@@ -1,19 +1,24 @@
/**
* @page command_reference Supported Shell Commands
+ - @subpage addpart_command
- @subpage cat_command
- @subpage cd_command
- @subpage cp_command
+ - @subpage delpart_command
- @subpage devinfo_command
- @subpage edit_command
+ - @subpage erase_command
- @subpage export_command
- @subpage tftp_command
- @subpage loadenv_command
- @subpage mount_command
- @subpage printenv_command
+ - @subpage protect_command
+ - @subpage rarp_command
- @subpage saveenv_command
- @subpage setenv_command
- @subpage sh_command
- - @subpage rarp_command
+ - @subpage unprotect_command
*/
diff --git a/commands/flash.c b/commands/flash.c
index 835663c2b6..cfbf903087 100644
--- a/commands/flash.c
+++ b/commands/flash.c
@@ -23,6 +23,11 @@
* MA 02111-1307 USA
*/
+/**
+ * @file
+ * @brief Flash memory support: erase, protect, unprotect
+ */
+
#include <common.h>
#include <command.h>
#include <cfi_flash.h>
@@ -92,6 +97,18 @@ U_BOOT_CMD_START(erase)
U_BOOT_CMD_HELP(cmd_erase_help)
U_BOOT_CMD_END
+/** @page erase_command erase Erase flash memory
+ *
+ * Usage is: erase \<devicee>
+ *
+ * Erase the flash memory behind the device. It depends on the device given,
+ * what area will be erased. If the device represents the whole flash memory
+ * the whole memory will be erased. If the device represents a partition on
+ * a main flash memory, only this partition part will be erased.
+ *
+ * Refer \b addpart, \b delpart and \b devinfo for partition handling.
+ */
+
static int do_protect (cmd_tbl_t *cmdtp, int argc, char *argv[])
{
int fd;
@@ -163,3 +180,26 @@ U_BOOT_CMD_START(unprotect)
U_BOOT_CMD_HELP(cmd_protect_help)
U_BOOT_CMD_END
+/** @page protect_command protect Protect a flash memory
+ *
+ * Usage is: protect \<devicee>
+ *
+ * Protect the flash memory behind the device. It depends on the device given,
+ * what area will be protected. If the device represents the whole flash memory
+ * the whole memory will be protected. If the device represents a partition on
+ * a main flash memory, only this partition part will be protected.
+ *
+ * Refer \b addpart, \b delpart and \b devinfo for partition handling.
+ */
+
+/** @page unprotect_command unprotect Unprotect a flash memory
+ *
+ * Usage is: unprotect \<devicee>
+ *
+ * Unprotect the flash memory behind the device. It depends on the device given,
+ * what area will be unprotected. If the device represents the whole flash memory
+ * the whole memory will be unprotected. If the device represents a partition
+ * on a main flash memory, only this partition part will be unprotected.
+ *
+ * Refer \b addpart, \b delpart and \b devinfo for partition handling.
+ */
diff --git a/commands/net.c b/commands/net.c
index b9c372a712..b858e67fe7 100644
--- a/commands/net.c
+++ b/commands/net.c
@@ -110,9 +110,15 @@ U_BOOT_CMD_END
*
* Usage is: tftp \<filename\> [\<localfilename\>]
*
- * Load a file via network using BootP/TFTP protocol. FIXME: Where to find it
- * after loading?
- * @note This command is available only, if enabled in the menuconfig.
+ * Load a file via network using BootP/TFTP protocol. The loaded file you
+ * can find after download in you current ramdisk. Refer \b ls command.
+ *
+ * \<localfile> can be the local filename only, or also a device name. In the
+ * case of a device name, the will gets stored there. This works also for
+ * partitions of flash memory. Refer \b erase, \b unprotect for flash
+ * preparation.
+ *
+ * Note: This command is available only, if enabled in the menuconfig.
*/
#ifdef CONFIG_NET_RARP
diff --git a/commands/partition.c b/commands/partition.c
index f2b795bbae..886339c97a 100644
--- a/commands/partition.c
+++ b/commands/partition.c
@@ -21,6 +21,11 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+/**
+ * @file
+ * @brief partition handling and addpart and delpart command
+ */
+
#ifdef CONFIG_ENABLE_PARTITION_NOISE
# define DEBUG
#endif
@@ -199,6 +204,26 @@ U_BOOT_CMD_START(addpart)
U_BOOT_CMD_HELP(cmd_addpart_help)
U_BOOT_CMD_END
+/** @page addpart_command addpart Add a partition to a device
+ *
+ * Usage is: addpart \<device> \<partition description>
+ *
+ * Adds a partition description to a device. The partition description has the
+ * form
+ *
+ * size1(name1)[ro],size2(name2)[ro],...
+ *
+ * \<device> is the device name under. Sizes can be given in decimal or - if
+ * prefixed with 0x - in hex. Sizes can have an optional suffix K,M,G. The
+ * size of the last partition can be specified as '-' for the remaining space
+ * of the device.
+ *
+ * @note The format is the same as used in the Linux kernel for cmdline mtd
+ * partitions.
+ *
+ * @note This command has to be reworked and will probably change it's API.
+ */
+
static int do_delpart(cmd_tbl_t * cmdtp, int argc, char *argv[])
{
struct device_d *dev;
@@ -230,3 +255,9 @@ U_BOOT_CMD_START(delpart)
U_BOOT_CMD_HELP(cmd_delpart_help)
U_BOOT_CMD_END
+/** @page delpart_command delpart Delete a partition
+ *
+ * Usage is: delpart \<device>
+ *
+ * Delete a partition previously added to a device with addpart.
+ */
diff --git a/common/partition.c b/common/partition.c
index bb4006eb0a..4942ffdf55 100644
--- a/common/partition.c
+++ b/common/partition.c
@@ -230,18 +230,18 @@ handled in the same way as every other device.
What we want:
-@code
+@verbatim
device nor0
|--- partition 0
|--- partition 1
|--- partition 2
|--- partition 3
`--- partition 4
-@endcode
+@endverbatim
How to get:
-@code
+@verbatim
$ addpart /dev/nor0 256k(uboot),128k(env),256k(bla),1024k(blubb),2048k(friesel)
$ devinfo
|---nor0.uboot
@@ -249,7 +249,7 @@ $ devinfo
|---nor0.bla
|---nor0.blubb
|---nor0.friesel
-@endcode
+@endverbatim
@par Partitions with sub partitions:
@@ -258,7 +258,7 @@ there is a way to create sub partitions on partitions.
What we want:
-@code
+@verbatim
device nor0
|--- partition 0
|--- partition 1
@@ -267,11 +267,11 @@ What we want:
`--- partition 4
|--- partition 0
`--- partition 1
-@endcode
+@endverbatim
How to get:
-@code
+@verbatim
$ addpart /dev/nor0 256k(uboot),128k(env),256k(bla),1M(blubb),2048k(friesel)
$ devinfo
|---nor0.uboot
@@ -289,15 +289,15 @@ $ devinfo
|---nor0.friesel
|---nor0.friesel.fussel
`---nor0.friesel.boerks
-@endcode
+@endverbatim
@par Forwarding partitions to the kernel:
-@code
+@verbatim
$ device="nor0"
$ partitions="256k(uboot),128k(env),256k(bla),1024k(blubb),2048k(friesel)"
$ addpart /dev/$device:$partitions
-@endcode
+@endverbatim
@par Removing partitions: