diff mbox series

[RFC,03/14] ARM: OMAP1: ams-delta: Provide board specific partition info

Message ID 20200212003929.6682-4-jmkrzyszt@gmail.com (mailing list archive)
State New, archived
Headers show
Series mtd: rawnand: ams-delta: Prepare for merging | expand

Commit Message

Janusz Krzysztofik Feb. 12, 2020, 12:39 a.m. UTC
Now as the Amstrad Delta NAND driver supports fetching information on
MTD partitions from device platform data, add partition info to the
NAND device configuration.

Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
---
 arch/arm/mach-omap1/board-ams-delta.c | 35 +++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

Comments

Tony Lindgren Feb. 12, 2020, 2:51 p.m. UTC | #1
* Janusz Krzysztofik <jmkrzyszt@gmail.com> [200212 00:41]:
> Now as the Amstrad Delta NAND driver supports fetching information on
> MTD partitions from device platform data, add partition info to the
> NAND device configuration.

Fine if you want hardcoded partition info :) Not sure if the partition
info coming from bootloader is any better either.. Ideally there would
be a partition table somewhere on the device like we have for disks..

Anyways, this is best merged together with the mtd patches so:

Acked-by: Tony Lindgren <tony@atomide.com>
Janusz Krzysztofik Feb. 12, 2020, 6:25 p.m. UTC | #2
Hi Tony,

On Wednesday, February 12, 2020 3:51:54 P.M. CET Tony Lindgren wrote:
> * Janusz Krzysztofik <jmkrzyszt@gmail.com> [200212 00:41]:
> > Now as the Amstrad Delta NAND driver supports fetching information on
> > MTD partitions from device platform data, add partition info to the
> > NAND device configuration.
> 
> Fine if you want hardcoded partition info :) Not sure if the partition
> info coming from bootloader is any better either.. Ideally there would
> be a partition table somewhere on the device like we have for disks..

Yeah, but Amstrad didn't provide anything like that, and we may want to get 
convenient access to factory content of the flash.  We might use command line 
for that, though nobody seemed to really like my previous proposal to use 
command line partition info exclusively.

> Anyways, this is best merged together with the mtd patches so:
> 
> Acked-by: Tony Lindgren <tony@atomide.com>

Thanks for your A-b:.  BTW, patch 06/14 also touches the board file and would 
require your acceptance before being merged via mtd, so could you please have 
a look?

Thanks,
Janusz
Tony Lindgren Feb. 12, 2020, 6:28 p.m. UTC | #3
* Janusz Krzysztofik <jmkrzyszt@gmail.com> [200212 18:26]:
> Thanks for your A-b:.  BTW, patch 06/14 also touches the board file and would 
> require your acceptance before being merged via mtd, so could you please have 
> a look?

OK looks good to me, acked that one too.

Tony
Miquel Raynal March 10, 2020, 6:33 p.m. UTC | #4
On Wed, 2020-02-12 at 00:39:18 UTC, Janusz Krzysztofik wrote:
> Now as the Amstrad Delta NAND driver supports fetching information on
> MTD partitions from device platform data, add partition info to the
> NAND device configuration.
> 
> Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
> Acked-by: Tony Lindgren <tony@atomide.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.

Miquel
diff mbox series

Patch

diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c
index a2aa7a12b374..f4d2ef97099e 100644
--- a/arch/arm/mach-omap1/board-ams-delta.c
+++ b/arch/arm/mach-omap1/board-ams-delta.c
@@ -17,6 +17,8 @@ 
 #include <linux/input.h>
 #include <linux/interrupt.h>
 #include <linux/leds.h>
+#include <linux/mtd/nand-gpio.h>
+#include <linux/mtd/partitions.h>
 #include <linux/platform_device.h>
 #include <linux/regulator/consumer.h>
 #include <linux/regulator/fixed.h>
@@ -294,9 +296,42 @@  struct modem_private_data {
 
 static struct modem_private_data modem_priv;
 
+/*
+ * Define partitions for flash device
+ */
+
+static struct mtd_partition partition_info[] = {
+	{ .name		= "Kernel",
+	  .offset	= 0,
+	  .size		= 3 * SZ_1M + SZ_512K },
+	{ .name		= "u-boot",
+	  .offset	= 3 * SZ_1M + SZ_512K,
+	  .size		= SZ_256K },
+	{ .name		= "u-boot params",
+	  .offset	= 3 * SZ_1M + SZ_512K + SZ_256K,
+	  .size		= SZ_256K },
+	{ .name		= "Amstrad LDR",
+	  .offset	= 4 * SZ_1M,
+	  .size		= SZ_256K },
+	{ .name		= "File system",
+	  .offset	= 4 * SZ_1M + 1 * SZ_256K,
+	  .size		= 27 * SZ_1M },
+	{ .name		= "PBL reserved",
+	  .offset	= 32 * SZ_1M - 3 * SZ_256K,
+	  .size		=  3 * SZ_256K },
+};
+
+static struct gpio_nand_platdata nand_platdata = {
+	.parts		= partition_info,
+	.num_parts	= ARRAY_SIZE(partition_info),
+};
+
 static struct platform_device ams_delta_nand_device = {
 	.name	= "ams-delta-nand",
 	.id	= -1,
+	.dev	= {
+		.platform_data = &nand_platdata,
+	},
 };
 
 #define OMAP_GPIO_LABEL		"gpio-0-15"