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>
This commit is contained in:
committed by
Artem Bityutskiy
parent
1a31368bf9
commit
78dd9e3500
@@ -116,8 +116,9 @@ static struct mtd_partition ts72xx_nand_parts[] = {
|
|||||||
.mask_flags = MTD_WRITEABLE, /* force read-only */
|
.mask_flags = MTD_WRITEABLE, /* force read-only */
|
||||||
}, {
|
}, {
|
||||||
.name = "Linux",
|
.name = "Linux",
|
||||||
.offset = MTDPART_OFS_APPEND,
|
.offset = MTDPART_OFS_RETAIN,
|
||||||
.size = 0, /* filled in later */
|
.size = TS72XX_REDBOOT_PART_SIZE,
|
||||||
|
/* leave so much for last partition */
|
||||||
}, {
|
}, {
|
||||||
.name = "RedBoot",
|
.name = "RedBoot",
|
||||||
.offset = MTDPART_OFS_APPEND,
|
.offset = MTDPART_OFS_APPEND,
|
||||||
@@ -126,28 +127,14 @@ static struct mtd_partition ts72xx_nand_parts[] = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
static void ts72xx_nand_set_parts(uint64_t size,
|
|
||||||
struct platform_nand_chip *chip)
|
|
||||||
{
|
|
||||||
/* Factory TS-72xx boards only come with 32MiB or 128MiB NAND options */
|
|
||||||
if (size == SZ_32M || size == SZ_128M) {
|
|
||||||
/* Set the "Linux" partition size */
|
|
||||||
ts72xx_nand_parts[1].size = size - TS72XX_REDBOOT_PART_SIZE;
|
|
||||||
|
|
||||||
chip->partitions = ts72xx_nand_parts;
|
|
||||||
chip->nr_partitions = ARRAY_SIZE(ts72xx_nand_parts);
|
|
||||||
} else {
|
|
||||||
pr_warning("Unknown nand disk size:%lluMiB\n", size >> 20);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct platform_nand_data ts72xx_nand_data = {
|
static struct platform_nand_data ts72xx_nand_data = {
|
||||||
.chip = {
|
.chip = {
|
||||||
.nr_chips = 1,
|
.nr_chips = 1,
|
||||||
.chip_offset = 0,
|
.chip_offset = 0,
|
||||||
.chip_delay = 15,
|
.chip_delay = 15,
|
||||||
.part_probe_types = ts72xx_nand_part_probes,
|
.part_probe_types = ts72xx_nand_part_probes,
|
||||||
.set_parts = ts72xx_nand_set_parts,
|
.partitions = ts72xx_nand_parts,
|
||||||
|
.nr_partitions = ARRAY_SIZE(ts72xx_nand_parts),
|
||||||
},
|
},
|
||||||
.ctrl = {
|
.ctrl = {
|
||||||
.cmd_ctrl = ts72xx_nand_hwcontrol,
|
.cmd_ctrl = ts72xx_nand_hwcontrol,
|
||||||
|
Reference in New Issue
Block a user