common: fdt_support: Check mtdparts cell size
authorStefan Mavrodiev <stefan@olimex.com>
Wed, 24 Apr 2019 05:31:54 +0000 (08:31 +0300)
committerSimon Glass <sjg@chromium.org>
Tue, 21 May 2019 23:33:23 +0000 (17:33 -0600)
commit3a9a62a18e57b1ed3adbe3a3d00b9793ec55c08f
treea2621d26a0642e1a5e618d6deac1bc5d99cdd521
parent3bf2f15351e9533c9c99ebbdd93cafca30558b0d
common: fdt_support: Check mtdparts cell size

When using fdt_fixup_mtdparts() offset and length cell sizes
are limited to 4 bytes (1 cell). However if the mtd device is
bigger then 4GiB, then #address-cells and #size-cells are
8 bytes (2 cells) [1].

This patch read #size-cells and uses either fdt32_t or
fdt64_t cell size. The default is fdt32_t.

[1] Documentation/devicetree/bindings/mtd/partition.txt

Signed-off-by: Stefan Mavrodiev <stefan@olimex.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
common/fdt_support.c