Re: [PATCH 4/4] onenand init: Pass configuration data from board-*.c files

2009-04-30 Thread Tony Lindgren
* Adrian Hunter  [090429 22:52]:
> Tony Lindgren wrote:
>> Pass configuration data from board-*.c files.
>>
>> Also remove support for the OMAP_TAG_PARTITION tag.
>> If the partition info is passed, it should be passed from
>> cmdline, and probably should be done in a generic way
>> in the drivers/mtd.
>>
>> Signed-off-by: Tony Lindgren 
>> ---
>
> NAK
>
> This would break all our flashing infrastructure.

The OMAP_TAG_PARTITION and others will have to go,
the omap tags have been rejected several times by RMK.

The right solution is to follow Linux standards and pass
the options from the cmdline.

Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 4/4] onenand init: Pass configuration data from board-*.c files

2009-04-29 Thread Adrian Hunter

Tony Lindgren wrote:

Pass configuration data from board-*.c files.

Also remove support for the OMAP_TAG_PARTITION tag.
If the partition info is passed, it should be passed from
cmdline, and probably should be done in a generic way
in the drivers/mtd.

Signed-off-by: Tony Lindgren 
---


NAK

This would break all our flashing infrastructure.
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 4/4] onenand init: Pass configuration data from board-*.c files

2009-04-29 Thread Tony Lindgren
Pass configuration data from board-*.c files.

Also remove support for the OMAP_TAG_PARTITION tag.
If the partition info is passed, it should be passed from
cmdline, and probably should be done in a generic way
in the drivers/mtd.

Signed-off-by: Tony Lindgren 
---
 arch/arm/mach-omap2/board-n800.c |   49 +-
 arch/arm/mach-omap2/board-rx51-peripherals.c |   46 
 arch/arm/mach-omap2/board-rx51.c |2 -
 arch/arm/mach-omap2/gpmc-onenand.c   |   47 +
 arch/arm/plat-omap/include/mach/board.h  |8 
 arch/arm/plat-omap/include/mach/onenand.h|   16 +++-
 6 files changed, 116 insertions(+), 52 deletions(-)

diff --git a/arch/arm/mach-omap2/board-n800.c b/arch/arm/mach-omap2/board-n800.c
index 3d0a83b..e882e4b 100644
--- a/arch/arm/mach-omap2/board-n800.c
+++ b/arch/arm/mach-omap2/board-n800.c
@@ -41,6 +41,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include <../drivers/cbus/tahvo.h>
@@ -685,11 +686,55 @@ static struct i2c_board_info __initdata_or_module 
n810_i2c_board_info_2[] = {
},
 };
 
+#if defined(CONFIG_MTD_ONENAND_OMAP2) || 
defined(CONFIG_MTD_ONENAND_OMAP2_MODULE)
+
+static struct mtd_partition onenand_partitions[] = {
+   {
+   .name   = "bootloader",
+   .offset = 0,
+   .size   = 0x2,
+   .mask_flags = MTD_WRITEABLE,/* Force read-only */
+   },
+   {
+   .name   = "config",
+   .offset = MTDPART_OFS_APPEND,
+   .size   = 0x6,
+   },
+   {
+   .name   = "kernel",
+   .offset = MTDPART_OFS_APPEND,
+   .size   = 0x20,
+   },
+   {
+   .name   = "initfs",
+   .offset = MTDPART_OFS_APPEND,
+   .size   = 0x40,
+   },
+   {
+   .name   = "rootfs",
+   .offset = MTDPART_OFS_APPEND,
+   .size   = MTDPART_SIZ_FULL,
+   },
+};
+
+static struct omap_onenand_platform_data board_onenand_data = {
+   .cs = 0,
+   .gpio_irq   = 26,
+   .parts  = onenand_partitions,
+   .nr_parts   = ARRAY_SIZE(onenand_partitions),
+};
+
+static void __init board_onenand_init(void)
+{
+   gpmc_onenand_init(&board_onenand_data);
+}
+
+#endif
+
 void __init nokia_n800_common_init(void)
 {
platform_add_devices(n800_devices, ARRAY_SIZE(n800_devices));
 
-   gpmc_onenand_init();
n800_mmc_init();
n800_bt_init();
n800_dsp_init();
@@ -717,6 +762,7 @@ void __init nokia_n800_common_init(void)

mipid_dev_init();
blizzard_dev_init();
+   board_onenand_init();
 }
 
 static void __init nokia_n800_init(void)
@@ -728,6 +774,7 @@ static void __init nokia_n800_init(void)
tea5761_dev_init();
omap_register_gpio_switches(n800_gpio_switches,
ARRAY_SIZE(n800_gpio_switches));
+   board_onenand_init();
 }
 
 void __init nokia_n800_map_io(void)
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c 
b/arch/arm/mach-omap2/board-rx51-peripherals.c
index 22183af..7b1ee3d 100644
--- a/arch/arm/mach-omap2/board-rx51-peripherals.c
+++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "mmc-twl4030.h"
 
@@ -478,6 +479,50 @@ static int __init rx51_i2c_init(void)
return 0;
 }
 
+#if defined(CONFIG_MTD_ONENAND_OMAP2) || 
defined(CONFIG_MTD_ONENAND_OMAP2_MODULE)
+
+static struct mtd_partition onenand_partitions[] = {
+   {
+   .name   = "bootloader",
+   .offset = 0,
+   .size   = 0x2,
+   .mask_flags = MTD_WRITEABLE,/* Force read-only */
+   },
+   {
+   .name   = "config",
+   .offset = MTDPART_OFS_APPEND,
+   .size   = 0x6,
+   },
+   {
+   .name   = "kernel",
+   .offset = MTDPART_OFS_APPEND,
+   .size   = 0x20,
+   },
+   {
+   .name   = "initfs",
+   .offset = MTDPART_OFS_APPEND,
+   .size   = 0x20,
+   },
+   {
+   .name   = "rootfs",
+   .offset = MTDPART_OFS_APPEND,
+   .size   = MTDPART_SIZ_FULL,
+   },
+};
+
+static struct omap_onenand_platform_data board_onenand_data = {
+   .cs = 0,
+   .gpio_irq   = 65,
+   .parts  = onenand_partitions,
+   .nr_parts   = ARRAY_SIZE(onenand_partitions),
+};
+
+static void __init board_onenand_init(void)
+{
+   gpmc_onenand_init(&boa