[PATCH 3/5] ARM: a9m2410: convert to devfs_append_partition
Uwe Kleine-König
u.kleine-koenig at pengutronix.de
Tue Feb 18 05:36:13 EST 2014
Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
---
arch/arm/boards/a9m2410/a9m2410.c | 24 +++++++++++++++++-------
1 file changed, 17 insertions(+), 7 deletions(-)
diff --git a/arch/arm/boards/a9m2410/a9m2410.c b/arch/arm/boards/a9m2410/a9m2410.c
index b2b6c87117a3..868a27a5e5bf 100644
--- a/arch/arm/boards/a9m2410/a9m2410.c
+++ b/arch/arm/boards/a9m2410/a9m2410.c
@@ -82,6 +82,22 @@ static int a9m2410_mem_init(void)
}
mem_initcall(a9m2410_mem_init);
+static void a9m2410_nand_partitions(void)
+{
+#ifdef CONFIG_NAND
+ loff_t offset = 0;
+
+ /* ----------- add some vital partitions -------- */
+ devfs_append_partition("nand0", &offset, 0x40000,
+ DEVFS_PARTITION_FIXED, "self_raw");
+ dev_add_bb_dev("self_raw", "self0");
+
+ devfs_append_partition("nand0", &offset, 0x20000,
+ DEVFS_PARTITION_FIXED, "env_raw");
+ dev_add_bb_dev("env_raw", "env0");
+#endif
+}
+
static int a9m2410_devices_init(void)
{
uint32_t reg;
@@ -116,14 +132,8 @@ static int a9m2410_devices_init(void)
add_generic_device("smc91c111", DEVICE_ID_DYNAMIC, NULL, S3C_CS1_BASE + 0x300,
16, IORESOURCE_MEM, NULL);
-#ifdef CONFIG_NAND
- /* ----------- add some vital partitions -------- */
- devfs_add_partition("nand0", 0x00000, 0x40000, DEVFS_PARTITION_FIXED, "self_raw");
- dev_add_bb_dev("self_raw", "self0");
+ a9m2410_nand_partitions();
- devfs_add_partition("nand0", 0x40000, 0x20000, DEVFS_PARTITION_FIXED, "env_raw");
- dev_add_bb_dev("env_raw", "env0");
-#endif
armlinux_set_architecture(MACH_TYPE_A9M2410);
return 0;
--
1.8.5.3
More information about the barebox
mailing list