From 3ff14ef200fc6f69b6237fffabbad796aa463cfb Mon Sep 17 00:00:00 2001 From: Juergen Beisert Date: Fri, 9 Nov 2007 14:05:23 +0100 Subject: various doc added Signed-off-by: Juergen Beisert --- Documentation/commands.dox | 7 ++++++- commands/flash.c | 40 ++++++++++++++++++++++++++++++++++++++++ commands/net.c | 12 +++++++++--- commands/partition.c | 31 +++++++++++++++++++++++++++++++ common/partition.c | 20 ++++++++++---------- 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 #include #include @@ -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 \ + * + * 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 \ + * + * 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 \ + * + * 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 \ [\] * - * 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. + * + * \ 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 \ \ + * + * Adds a partition description to a device. The partition description has the + * form + * + * size1(name1)[ro],size2(name2)[ro],... + * + * \ 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 \ + * + * 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: -- cgit v1.2.3