diff mbox

[U-Boot,2/2] igep00x0: fixup FDT according to detected flash type

Message ID 20170218232449.k6xxnthuo5kgqumy@lenoch
State Accepted
Commit e4290aa10af0a69c81bbb3be1a8aef7465aed2ad
Delegated to: Tom Rini
Headers show

Commit Message

Ladislav Michl Feb. 18, 2017, 11:24 p.m. UTC
Leave only detected flash type enabled in FTD as otherwise GPMC CS is
claimed (and never freed) by Linux, causing 'concurent' flash type
not to be probed.

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
---
 board/isee/igep00x0/igep00x0.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

Comments

Tom Rini March 16, 2017, 8:40 p.m. UTC | #1
On Sun, Feb 19, 2017 at 12:24:49AM +0100, Ladislav Michl wrote:

> Leave only detected flash type enabled in FTD as otherwise GPMC CS is
> claimed (and never freed) by Linux, causing 'concurent' flash type
> not to be probed.
> 
> Signed-off-by: Ladislav Michl <ladis@linux-mips.org>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/board/isee/igep00x0/igep00x0.c b/board/isee/igep00x0/igep00x0.c
index 65cc7dfdec..e032f313a6 100644
--- a/board/isee/igep00x0/igep00x0.c
+++ b/board/isee/igep00x0/igep00x0.c
@@ -214,6 +214,20 @@  void board_mmc_power_init(void)
 #endif
 
 #ifdef CONFIG_OF_BOARD_SETUP
+static int ft_enable_by_compatible(void *blob, char *compat, int enable)
+{
+	int off = fdt_node_offset_by_compatible(blob, -1, compat);
+	if (off < 0)
+		return off;
+
+	if (enable)
+		fdt_status_okay(blob, off);
+	else
+		fdt_status_disabled(blob, off);
+
+	return 0;
+}
+
 int ft_board_setup(void *blob, bd_t *bd)
 {
 #ifdef CONFIG_FDT_FIXUP_PARTITIONS
@@ -224,6 +238,11 @@  int ft_board_setup(void *blob, bd_t *bd)
 
 	fdt_fixup_mtdparts(blob, nodes, ARRAY_SIZE(nodes));
 #endif
+	ft_enable_by_compatible(blob, "ti,omap2-nand",
+				gpmc_cs0_flash == MTD_DEV_TYPE_NAND);
+	ft_enable_by_compatible(blob, "ti,omap2-onenand",
+				gpmc_cs0_flash == MTD_DEV_TYPE_ONENAND);
+
 	return 0;
 }
 #endif