ARM: OMAP1: ams-delta: Provide board specific partition info
authorJanusz Krzysztofik <jmkrzyszt@gmail.com>
Wed, 12 Feb 2020 00:39:18 +0000 (01:39 +0100)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Mon, 9 Mar 2020 13:51:01 +0000 (14:51 +0100)
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>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200212003929.6682-4-jmkrzyszt@gmail.com
arch/arm/mach-omap1/board-ams-delta.c

index a2aa7a1..f4d2ef9 100644 (file)
@@ -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"