From patchwork Sat Feb 18 23:24:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ladislav Michl X-Patchwork-Id: 729774 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 3vRcLQ1111z9s8D for ; Mon, 20 Feb 2017 19:31:58 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 49F06B3AF6; Mon, 20 Feb 2017 09:25:01 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TxgE_SLeUh_R; Mon, 20 Feb 2017 09:25:01 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id F028CB3929; Mon, 20 Feb 2017 09:19:24 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4E0B24A068 for ; Sun, 19 Feb 2017 00:25:01 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fnuEsmaZ1Nyo for ; Sun, 19 Feb 2017 00:25:01 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from cvs.linux-mips.org (eddie.linux-mips.org [148.251.95.138]) by theia.denx.de (Postfix) with ESMTP id BCF0F4A026 for ; Sun, 19 Feb 2017 00:24:56 +0100 (CET) Received: (from localhost user: 'ladis' uid#1021 fake: STDIN (ladis@eddie.linux-mips.org)) by eddie.linux-mips.org id S23993891AbdBRXY40egVJ (ORCPT ); Sun, 19 Feb 2017 00:24:56 +0100 Date: Sun, 19 Feb 2017 00:24:49 +0100 From: Ladislav Michl To: u-boot@lists.denx.de Message-ID: <20170218232449.k6xxnthuo5kgqumy@lenoch> References: <20170218232339.52vbbpvv2sosmcc5@lenoch> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20170218232339.52vbbpvv2sosmcc5@lenoch> User-Agent: NeoMutt/20170113 (1.7.2) Cc: Javier Martinez Canillas Subject: [U-Boot] [PATCH 2/2] igep00x0: fixup FDT according to detected flash type X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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 --- board/isee/igep00x0/igep00x0.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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