summaryrefslogtreecommitdiff
path: root/board/compulab
diff options
context:
space:
mode:
authorChristopher Spinrath <christopher.spinrath@rwth-aachen.de>2016-07-12 21:37:36 (GMT)
committerStefano Babic <sbabic@denx.de>2016-07-19 17:52:13 (GMT)
commit62d6bac66038163641d6ba43ac47347447fedb82 (patch)
treebb6616a9f1ab6e4473e86d9fd01da17e9e3cf8fb /board/compulab
parentf4ae23a7cd6fff3e0b9d250411b6714c6a1a2930 (diff)
downloadu-boot-62d6bac66038163641d6ba43ac47347447fedb82.tar.xz
ARM: board: cm_fx6: fixup mtd partitions in the fdt
The cm-fx6 module has an on-board st,m25p compatible spi flash chip used for U-Boot (binary & environment). Overwrite the partitions in the device tree by the partition table provided in the mtdparts environment variable, if it is set. This allows to specify a kernel independent partitioning in the environment and provides a convient way for the user to adapt the partition table. Signed-off-by: Christopher Spinrath <christopher.spinrath@rwth-aachen.de> Acked-by: Igor Grinberg <grinberg@compulab.co.il>
Diffstat (limited to 'board/compulab')
-rw-r--r--board/compulab/cm_fx6/cm_fx6.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/board/compulab/cm_fx6/cm_fx6.c b/board/compulab/cm_fx6/cm_fx6.c
index 712057a..566c19b 100644
--- a/board/compulab/cm_fx6/cm_fx6.c
+++ b/board/compulab/cm_fx6/cm_fx6.c
@@ -12,6 +12,7 @@
#include <dm.h>
#include <fsl_esdhc.h>
#include <miiphy.h>
+#include <mtd_node.h>
#include <netdev.h>
#include <errno.h>
#include <usb.h>
@@ -28,6 +29,7 @@
#include <asm/io.h>
#include <asm/gpio.h>
#include <dm/platform_data/serial_mxc.h>
+#include <jffs2/load_kernel.h>
#include "common.h"
#include "../common/eeprom.h"
#include "../common/common.h"
@@ -581,6 +583,17 @@ int cm_fx6_setup_ecspi(void) { return 0; }
#ifdef CONFIG_OF_BOARD_SETUP
#define USDHC3_PATH "/soc/aips-bus@02100000/usdhc@02198000/"
+
+struct node_info nodes[] = {
+ /*
+ * Both entries target the same flash chip. The st,m25p compatible
+ * is used in the vendor device trees, while upstream uses (the
+ * documented) jedec,spi-nor comptatible.
+ */
+ { "st,m25p", MTD_DEV_TYPE_NOR, },
+ { "jedec,spi-nor", MTD_DEV_TYPE_NOR, },
+};
+
int ft_board_setup(void *blob, bd_t *bd)
{
u32 baseboard_rev;
@@ -589,6 +602,8 @@ int ft_board_setup(void *blob, bd_t *bd)
char baseboard_name[16];
int err;
+ fdt_shrink_to_minimum(blob); /* Make room for new properties */
+
/* MAC addr */
if (eth_getenv_enetaddr("ethaddr", enetaddr)) {
fdt_find_and_setprop(blob,
@@ -607,7 +622,6 @@ int ft_board_setup(void *blob, bd_t *bd)
return 0; /* Assume not an early revision SB-FX6m baseboard */
if (!strncmp("SB-FX6m", baseboard_name, 7) && baseboard_rev <= 120) {
- fdt_shrink_to_minimum(blob); /* Make room for new properties */
nodeoffset = fdt_path_offset(blob, USDHC3_PATH);
fdt_delprop(blob, nodeoffset, "cd-gpios");
fdt_find_and_setprop(blob, USDHC3_PATH, "broken-cd",
@@ -616,6 +630,8 @@ int ft_board_setup(void *blob, bd_t *bd)
NULL, 0, 1);
}
+ fdt_fixup_mtdparts(blob, nodes, ARRAY_SIZE(nodes));
+
return 0;
}
#endif