aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Eremin-Solenikov <dbaryshkov@gmail.com>2011-06-06 10:04:15 -0400
committerArtem Bityutskiy <artem.bityutskiy@intel.com>2011-09-11 08:02:04 -0400
commit78dd9e3500873edd6005a41f8ba178eacbff64c5 (patch)
tree19c48a9924f25b3ee976b372267f1476c956088c
parent1a31368bf92ef2a7da3ba379672c405bd2751df9 (diff)
ts72xx: use MTDPART_OFS_RETAIN for mtd partitioning
Instead of specifying a callback for dynamic partitioning, use MTDPART_OFS_RETAIN for reserving a place near the end of flash for RedBoot. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Cc: Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ryan Mallon <ryan@bluewatersys.com> Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
-rw-r--r--arch/arm/mach-ep93xx/ts72xx.c23
1 files changed, 5 insertions, 18 deletions
diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
index c2d2cf40ead..dea42e26215 100644
--- a/arch/arm/mach-ep93xx/ts72xx.c
+++ b/arch/arm/mach-ep93xx/ts72xx.c
@@ -116,8 +116,9 @@ static struct mtd_partition ts72xx_nand_parts[] = {
116 .mask_flags = MTD_WRITEABLE, /* force read-only */ 116 .mask_flags = MTD_WRITEABLE, /* force read-only */
117 }, { 117 }, {
118 .name = "Linux", 118 .name = "Linux",
119 .offset = MTDPART_OFS_APPEND, 119 .offset = MTDPART_OFS_RETAIN,
120 .size = 0, /* filled in later */ 120 .size = TS72XX_REDBOOT_PART_SIZE,
121 /* leave so much for last partition */
121 }, { 122 }, {
122 .name = "RedBoot", 123 .name = "RedBoot",
123 .offset = MTDPART_OFS_APPEND, 124 .offset = MTDPART_OFS_APPEND,
@@ -126,28 +127,14 @@ static struct mtd_partition ts72xx_nand_parts[] = {
126 }, 127 },
127}; 128};
128 129
129static void ts72xx_nand_set_parts(uint64_t size,
130 struct platform_nand_chip *chip)
131{
132 /* Factory TS-72xx boards only come with 32MiB or 128MiB NAND options */
133 if (size == SZ_32M || size == SZ_128M) {
134 /* Set the "Linux" partition size */
135 ts72xx_nand_parts[1].size = size - TS72XX_REDBOOT_PART_SIZE;
136
137 chip->partitions = ts72xx_nand_parts;
138 chip->nr_partitions = ARRAY_SIZE(ts72xx_nand_parts);
139 } else {
140 pr_warning("Unknown nand disk size:%lluMiB\n", size >> 20);
141 }
142}
143
144static struct platform_nand_data ts72xx_nand_data = { 130static struct platform_nand_data ts72xx_nand_data = {
145 .chip = { 131 .chip = {
146 .nr_chips = 1, 132 .nr_chips = 1,
147 .chip_offset = 0, 133 .chip_offset = 0,
148 .chip_delay = 15, 134 .chip_delay = 15,
149 .part_probe_types = ts72xx_nand_part_probes, 135 .part_probe_types = ts72xx_nand_part_probes,
150 .set_parts = ts72xx_nand_set_parts, 136 .partitions = ts72xx_nand_parts,
137 .nr_partitions = ARRAY_SIZE(ts72xx_nand_parts),
151 }, 138 },
152 .ctrl = { 139 .ctrl = {
153 .cmd_ctrl = ts72xx_nand_hwcontrol, 140 .cmd_ctrl = ts72xx_nand_hwcontrol,