diff options
author | sascha <sascha@nomad.localdomain> | 2007-10-19 13:07:01 +0200 |
---|---|---|
committer | sascha <sascha@nomad.localdomain> | 2007-10-19 13:07:01 +0200 |
commit | ad72b775f1362be701a06034a1a682ac61659c29 (patch) | |
tree | deaf82002a6a3ef3fbd55adfca671db9f455b41f /common | |
parent | 8ed683dddb84e1daf4ce73463d98fe4787d40bef (diff) | |
parent | f855f6e865e457e220fce0caad70f29d3e9aaef3 (diff) | |
download | barebox-ad72b775f1362be701a06034a1a682ac61659c29.tar.gz barebox-ad72b775f1362be701a06034a1a682ac61659c29.tar.xz |
Merge octopus:/home/git/projects/u-boot-v2
Diffstat (limited to 'common')
-rw-r--r-- | common/partition.c | 123 |
1 files changed, 123 insertions, 0 deletions
diff --git a/common/partition.c b/common/partition.c index 98bae393a2..69b269e34f 100644 --- a/common/partition.c +++ b/common/partition.c @@ -1,3 +1,29 @@ +/* + * (C) 2007 Pengutronix, Sascha Hauer <s.hauer@pengutronix.de> + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +/** + * @file + * @brief Partition handling on top of devices + */ #include <common.h> #include <init.h> @@ -123,3 +149,100 @@ static int partition_init(void) } device_initcall(partition_init); + +/** +@page partitions Partition Handling + +Partitions are runtime informartion only, not permanent. So they must be set +everytime the system started. The required command can be embedded into the +default environment. + +@note Partitions defined in this way are intended to be used with the kernel +command line partition parsing feature. In Uboot2 these types of partitions are +handled in the same way as every other device. + +@par The addpart command + +What we want: + +@code + device nor0 + |--- partition 0 + |--- partition 1 + |--- partition 2 + |--- partition 3 + `--- partition 4 +@endcode + +How to get: + +@code +$ addpart /dev/nor0 256k(uboot),128k(env),256k(bla),1024k(blubb),2048k(friesel) +$ devinfo + |---nor0.uboot + |---nor0.env + |---nor0.bla + |---nor0.blubb + |---nor0.friesel +@endcode + +@par Partitions with sub partitions: + +Partitions are based on devices. And partitions will result into devices. So +there is a way to create sub partitions on partitions. + +What we want: + +@code + device nor0 + |--- partition 0 + |--- partition 1 + |--- partition 2 + |--- partition 3 + `--- partition 4 + |--- partition 0 + `--- partition 1 +@endcode + +How to get: + +@code +$ addpart /dev/nor0 256k(uboot),128k(env),256k(bla),1M(blubb),2048k(friesel) +$ devinfo + |---nor0.uboot + |---nor0.env + |---nor0.bla + |---nor0.blubb + |---nor0.friesel + +$ addpart /dev/nor0.friesel 1024(fussel),1024k(boerks) +$ devinfo + |---nor0.uboot + |---nor0.env + |---nor0.bla + |---nor0.blubb + |---nor0.friesel + |---nor0.friesel.fussel + `---nor0.friesel.boerks +@endcode + +@par Partitions forwarding to the kernel: + +@code +$ device="nor0" +$ partitions="256k(uboot),128k(env),256k(bla),1024k(blubb),2048k(friesel)" +$ addpart /dev/$device:$partitions +@endcode + +@par Removing partitions: + +As partitions are a logically information only, they can be removed from a +device at runtime. You can't remove a single partition within others on the +same device. Only all partitions on the given device can be removed with this +command. + +As sub partitions occure as devices you also can remove sub partitions from +their parent in this way. If the parent itself will be removed all its sub +partitions will also removed. + +*/
\ No newline at end of file |