From patchwork Sun Sep 6 08:48:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikita Kiryanov X-Patchwork-Id: 514903 X-Patchwork-Delegate: sbabic@denx.de 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 1B14A1401AF for ; Sun, 6 Sep 2015 18:50:50 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=compulab.co.il header.i=@compulab.co.il header.b=sB0TlPvu; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 656A84B748; Sun, 6 Sep 2015 10:50:40 +0200 (CEST) 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 FeFfipItVpYK; Sun, 6 Sep 2015 10:50:40 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5B6514B6EB; Sun, 6 Sep 2015 10:50:31 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 743ED4B6E8 for ; Sun, 6 Sep 2015 10:50:25 +0200 (CEST) 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 zS99GDWRTU8t for ; Sun, 6 Sep 2015 10:50:25 +0200 (CEST) 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 compulab.co.il (softlayer.compulab.co.il [50.23.254.55]) by theia.denx.de (Postfix) with ESMTPS id 088564B6EF for ; Sun, 6 Sep 2015 10:50:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=compulab.co.il; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=sdBx17yerxnWhWIqFAEej1d6Av8SFpclA0WR8JcvkRk=; b=sB0TlPvuGLCnVnwoqKhOrosKaZDuMEDBklSNf5BWj08R3hZ1J4Y+JIfUY5QxWl7wFQBbywynNF4tSOLsXtZfzdO0BVR0/6oeH4oPfaT5eElf2OX75SKiiH+a2T5fVyVdQiM7/LhE3vDSE4qTg67XLTrFCyQxatHT0JxdfwEzttw=; Received: from [62.90.235.247] (port=64549 helo=zimbra-mta.compulab.co.il) by softlayer.compulab.co.il with esmtp (Exim 4.85) (envelope-from ) id 1ZYVeU-0002lp-Q1; Sun, 06 Sep 2015 11:50:19 +0300 Received: from localhost (localhost [127.0.0.1]) by zimbra-mta.compulab.co.il (Postfix) with ESMTP id DB3C2483541; Sun, 6 Sep 2015 11:50:17 +0300 (IDT) Received: from zimbra-mta.compulab.co.il ([127.0.0.1]) by localhost (zimbra-mta.compulab.co.il [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id Q-2J_EtFKNEI; Sun, 6 Sep 2015 11:50:17 +0300 (IDT) Received: from localhost (localhost [127.0.0.1]) by zimbra-mta.compulab.co.il (Postfix) with ESMTP id 5949F483538; Sun, 6 Sep 2015 11:50:17 +0300 (IDT) X-Virus-Scanned: amavisd-new at zimbra-mta.compulab.co.il Received: from zimbra-mta.compulab.co.il ([127.0.0.1]) by localhost (zimbra-mta.compulab.co.il [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id SAhZ3jeCtbal; Sun, 6 Sep 2015 11:50:17 +0300 (IDT) Received: from skynet.compulab.local (nikita-pc.compulab.local [192.168.11.211]) by zimbra-mta.compulab.co.il (Postfix) with ESMTP id 3A89C48353D; Sun, 6 Sep 2015 11:50:17 +0300 (IDT) From: Nikita Kiryanov To: u-boot@lists.denx.de Date: Sun, 6 Sep 2015 11:48:38 +0300 Message-Id: <1441529318-23973-5-git-send-email-nikita@compulab.co.il> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1441529318-23973-1-git-send-email-nikita@compulab.co.il> References: <1441529318-23973-1-git-send-email-nikita@compulab.co.il> X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - softlayer.compulab.co.il X-AntiAbuse: Original Domain - lists.denx.de X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - compulab.co.il X-Get-Message-Sender-Via: softlayer.compulab.co.il: acl_c_relayhosts_text_entry: nikita@compulab.co.il|compulab.co.il Subject: [U-Boot] [PATCH V2 4/4] arm: mx6: cm-fx6: modify device tree for old revisions of utilite 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: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Old revisions of Utilite (a miniature PC based on cm-fx6) do not have a card detect for mmc, and thus the kernel needs to be told that there's a persistent storage on usdhc3 to force it to probe the mmc card. Check the baseboard revision and modify the device tree accordingly if needed. Cc: Stefano Babic Cc: Igor Grinberg Signed-off-by: Nikita Kiryanov --- Changes in V2: - #define USDHC3_PATH instead of const variable usdhc3_path - Do not update device tree on eeprom read failures in a more explicit way board/compulab/cm_fx6/cm_fx6.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/board/compulab/cm_fx6/cm_fx6.c b/board/compulab/cm_fx6/cm_fx6.c index 572111d..a21e7b0 100644 --- a/board/compulab/cm_fx6/cm_fx6.c +++ b/board/compulab/cm_fx6/cm_fx6.c @@ -580,9 +580,14 @@ int cm_fx6_setup_ecspi(void) { return 0; } #endif #ifdef CONFIG_OF_BOARD_SETUP +#define USDHC3_PATH "/soc/aips-bus@02100000/usdhc@02198000/" int ft_board_setup(void *blob, bd_t *bd) { + u32 baseboard_rev; + int nodeoffset; uint8_t enetaddr[6]; + char baseboard_name[16]; + int err; /* MAC addr */ if (eth_getenv_enetaddr("ethaddr", enetaddr)) { @@ -596,6 +601,21 @@ int ft_board_setup(void *blob, bd_t *bd) enetaddr, 6, 1); } + baseboard_rev = cl_eeprom_get_board_rev(0); + err = cl_eeprom_get_product_name((uchar *)baseboard_name, 0); + if (err || baseboard_rev == 0) + 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, "non-removable", + NULL, 0, 1); + fdt_find_and_setprop(blob, USDHC3_PATH, "keep-power-in-suspend", + NULL, 0, 1); + } + return 0; } #endif