From patchwork Thu May 16 03:18:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 1100277 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="VmlJ70M+"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 454HNc4C5Qz9sMQ for ; Thu, 16 May 2019 13:44:30 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 23608C21E2F; Thu, 16 May 2019 03:19:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_PASS, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 841AAC21DD4; Thu, 16 May 2019 03:19:05 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id A0A3FC21D83; Thu, 16 May 2019 03:18:59 +0000 (UTC) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70044.outbound.protection.outlook.com [40.107.7.44]) by lists.denx.de (Postfix) with ESMTPS id 8874EC21CB1 for ; Thu, 16 May 2019 03:18:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=y/evjpxhSxZX7LWM55FFBc9RywbdUQMAajH2JxtWkDw=; b=VmlJ70M+TLjFCkk9aMrk6BrO9YAAKLYD3qUu1CGu1yWqJFLWhNY/N1H4T1kzu8f1EDUvPHod5uMS1zmi5m/1MN7hNqoSD0RoA2rch8cV6uPHpjHG2NkcDgQE/8XdYro+YN+XYei3Yt5dGor1r93uNQ/QzovKgQGbTpEKyoh3ot0= Received: from AM0PR04MB4481.eurprd04.prod.outlook.com (52.135.147.15) by AM0PR04MB6594.eurprd04.prod.outlook.com (20.179.255.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1878.24; Thu, 16 May 2019 03:18:56 +0000 Received: from AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::3173:24:d401:2378]) by AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::3173:24:d401:2378%6]) with mapi id 15.20.1878.024; Thu, 16 May 2019 03:18:56 +0000 From: Peng Fan To: "sbabic@denx.de" , "festevam@gmail.com" Thread-Topic: [PATCH 03/15] i.MX7ULP: evk: Modify FDT file to disable SD3.0 for usb boot Thread-Index: AQHVC5YYw+7M+lU5yEGYRtmY/dFc3g== Date: Thu, 16 May 2019 03:18:56 +0000 Message-ID: <20190516033236.10594-3-peng.fan@nxp.com> References: <20190516033236.10594-1-peng.fan@nxp.com> In-Reply-To: <20190516033236.10594-1-peng.fan@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.16.4 x-clientproxiedby: HK2PR0401CA0008.apcprd04.prod.outlook.com (2603:1096:202:2::18) To AM0PR04MB4481.eurprd04.prod.outlook.com (2603:10a6:208:70::15) authentication-results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [119.31.174.71] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2dc89176-c026-48ac-7c70-08d6d9ad3af2 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4618075)(2017052603328)(7193020); SRVR:AM0PR04MB6594; x-ms-traffictypediagnostic: AM0PR04MB6594: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4502; x-forefront-prvs: 0039C6E5C5 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(136003)(376002)(366004)(346002)(396003)(199004)(189003)(2906002)(3846002)(66556008)(6116002)(8676002)(73956011)(81166006)(186003)(66476007)(6436002)(81156014)(66066001)(86362001)(6486002)(2616005)(11346002)(446003)(26005)(64756008)(7736002)(305945005)(6512007)(486006)(44832011)(476003)(316002)(66946007)(5660300002)(102836004)(256004)(8936002)(52116002)(54906003)(478600001)(1076003)(4326008)(71190400001)(71200400001)(36756003)(66446008)(14454004)(53936002)(110136005)(2501003)(386003)(68736007)(6506007)(76176011)(99286004)(25786009)(50226002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB6594; H:AM0PR04MB4481.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: ZVX/fpb+PuIMg/r0P9ZeVwEq1w/TJpgTd1CFIPuhcdCJWMyCTK0y0HvtszDYelNLqfTOq9XQRRRFGTHoZ0gkzI/WusPNdWH4YoobI3LBhTqhbqiQc2LAdnsciSVwONkhIqHPcqi3TEfdoXxM8omifgp6uDhoigQStZHA5IjIDWvWFu+ZmSw5rU4JJ+CEnWo7GMRq84qcxb5cB1Nyy2AW1qSW5HRAnRwrOjuYn7wTcWuarbpYDr/kRGb+rbtOZv+DJYSxecCaiA+VDvpJXPX5Rm6LYFYECEga100/fbgpuLWXTeuBTHl9p8489euVNqPemDKac9kjrvxLbs4AWKExXfQU1XrVEh/sPOt61ZpRbeSXuEvOPBrlorphZBehZ4rJc5tPbaJnjuaf2L1RLWV8v6hqxNnbbKe+n2XksWAPDeQ= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2dc89176-c026-48ac-7c70-08d6d9ad3af2 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 May 2019 03:18:56.4001 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB6594 Cc: "u-boot@lists.denx.de" , dl-uboot-imx Subject: [U-Boot] [PATCH 03/15] i.MX7ULP: evk: Modify FDT file to disable SD3.0 for usb boot X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" Since the SD3.0 kernel driver needs M4 image support, this causes problem for usb boot booting into kernel. To decouple the relationship, we modify the FDT file in u-boot to disable SD3.0. So the kernel won't depend on M4 image. Signed-off-by: Peng Fan --- board/freescale/mx7ulp_evk/mx7ulp_evk.c | 47 +++++++++++++++++++++++++++++++++ configs/mx7ulp_evk_defconfig | 1 + 2 files changed, 48 insertions(+) diff --git a/board/freescale/mx7ulp_evk/mx7ulp_evk.c b/board/freescale/mx7ulp_evk/mx7ulp_evk.c index 3a12fe1551..7527263577 100644 --- a/board/freescale/mx7ulp_evk/mx7ulp_evk.c +++ b/board/freescale/mx7ulp_evk/mx7ulp_evk.c @@ -4,10 +4,12 @@ */ #include +#include #include #include #include #include +#include DECLARE_GLOBAL_DATA_PTR; @@ -45,3 +47,48 @@ int board_init(void) return 0; } + +#if IS_ENABLED(CONFIG_OF_BOARD_SETUP) +int ft_board_setup(void *blob, bd_t *bd) +{ + const char *path; + int rc, nodeoff; + + if (get_boot_device() == USB_BOOT) { + path = fdt_get_alias(blob, "mmc0"); + if (!path) { + puts("Not found mmc0\n"); + return 0; + } + + nodeoff = fdt_path_offset(blob, path); + if (nodeoff < 0) + return 0; + + printf("Found usdhc0 node\n"); + if (fdt_get_property(blob, nodeoff, "vqmmc-supply", + NULL) != NULL) { + rc = fdt_delprop(blob, nodeoff, "vqmmc-supply"); + if (!rc) { + puts("Removed vqmmc-supply property\n"); +add: + rc = fdt_setprop(blob, nodeoff, + "no-1-8-v", NULL, 0); + if (rc == -FDT_ERR_NOSPACE) { + rc = fdt_increase_size(blob, 32); + if (!rc) + goto add; + } else if (rc) { + printf("Failed to add no-1-8-v property, %d\n", rc); + } else { + puts("Added no-1-8-v property\n"); + } + } else { + printf("Failed to remove vqmmc-supply property, %d\n", rc); + } + } + } + + return 0; +} +#endif diff --git a/configs/mx7ulp_evk_defconfig b/configs/mx7ulp_evk_defconfig index d125ccc1af..c7af66b2e9 100644 --- a/configs/mx7ulp_evk_defconfig +++ b/configs/mx7ulp_evk_defconfig @@ -3,6 +3,7 @@ CONFIG_ARCH_MX7ULP=y CONFIG_SYS_TEXT_BASE=0x67800000 CONFIG_TARGET_MX7ULP_EVK=y CONFIG_NR_DRAM_BANKS=1 +CONFIG_OF_BOARD_SETUP=y CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/mx7ulp_evk/imximage.cfg" CONFIG_BOUNCE_BUFFER=y CONFIG_HUSH_PARSER=y