diff options
author | Joe Schaack <jschaack@xes-inc.com> | 2013-02-21 17:29:45 -0500 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2013-04-05 07:05:53 -0400 |
commit | 05ff8c258c76dd469232a03ec8d45f7e7267e0ac (patch) | |
tree | bbecfe3fc604264c90c6037477120d520d594ef4 /drivers/mtd/ofpart.c | |
parent | e66e280c36e09e4573089862e7dc2ade9e680088 (diff) |
mtd: ofpart: support partitions of 4 GiB and larger
Previously, partitions were limited to less than 4 GiB in size because
the address and size were read as 32-bit values. Add support for 64-bit
values to support devices of 4 GiB and larger.
Signed-off-by: Joe Schaack <jschaack@xes-inc.com>
Signed-off-by: Nate Case <ncase@xes-inc.com>
Signed-off-by: Aaron Sierra <asierra@xes-inc.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/ofpart.c')
-rw-r--r-- | drivers/mtd/ofpart.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/mtd/ofpart.c b/drivers/mtd/ofpart.c index 30bd907a260a..553d6d6d5603 100644 --- a/drivers/mtd/ofpart.c +++ b/drivers/mtd/ofpart.c | |||
@@ -55,6 +55,7 @@ static int parse_ofpart_partitions(struct mtd_info *master, | |||
55 | while ((pp = of_get_next_child(node, pp))) { | 55 | while ((pp = of_get_next_child(node, pp))) { |
56 | const __be32 *reg; | 56 | const __be32 *reg; |
57 | int len; | 57 | int len; |
58 | int a_cells, s_cells; | ||
58 | 59 | ||
59 | reg = of_get_property(pp, "reg", &len); | 60 | reg = of_get_property(pp, "reg", &len); |
60 | if (!reg) { | 61 | if (!reg) { |
@@ -62,8 +63,10 @@ static int parse_ofpart_partitions(struct mtd_info *master, | |||
62 | continue; | 63 | continue; |
63 | } | 64 | } |
64 | 65 | ||
65 | (*pparts)[i].offset = be32_to_cpu(reg[0]); | 66 | a_cells = of_n_addr_cells(pp); |
66 | (*pparts)[i].size = be32_to_cpu(reg[1]); | 67 | s_cells = of_n_size_cells(pp); |
68 | (*pparts)[i].offset = of_read_number(reg, a_cells); | ||
69 | (*pparts)[i].size = of_read_number(reg + a_cells, s_cells); | ||
67 | 70 | ||
68 | partname = of_get_property(pp, "label", &len); | 71 | partname = of_get_property(pp, "label", &len); |
69 | if (!partname) | 72 | if (!partname) |