Message ID | 1450167975-13265-2-git-send-email-Peng.Fan@freescale.com |
---|---|
State | Deferred |
Delegated to: | Stefano Babic |
Headers | show
Return-Path: <u-boot-bounces@lists.denx.de> 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 E62D61402D9 for <incoming@patchwork.ozlabs.org>; Tue, 15 Dec 2015 19:27:50 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2A7DC4BBB9; Tue, 15 Dec 2015 09:27:34 +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 VFsTWBuKvQ-6; Tue, 15 Dec 2015 09:27:33 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4F5874BB95; Tue, 15 Dec 2015 09:27:29 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 08C4D4BB1B for <u-boot@lists.denx.de>; Tue, 15 Dec 2015 09:27:06 +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 MCKWHgMOESZu for <u-boot@lists.denx.de>; Tue, 15 Dec 2015 09:27:05 +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 na01-bn1-obe.outbound.protection.outlook.com (mail-bn1bn0104.outbound.protection.outlook.com [157.56.110.104]) by theia.denx.de (Postfix) with ESMTPS id 466744BB0E for <u-boot@lists.denx.de>; Tue, 15 Dec 2015 09:26:57 +0100 (CET) Received: from BLUPR0301CA0002.namprd03.prod.outlook.com (10.162.113.140) by DM2PR0301MB0686.namprd03.prod.outlook.com (10.160.96.24) with Microsoft SMTP Server (TLS) id 15.1.337.19; Tue, 15 Dec 2015 08:26:55 +0000 Received: from BY2FFO11FD034.protection.gbl (2a01:111:f400:7c0c::178) by BLUPR0301CA0002.outlook.office365.com (2a01:111:e400:5259::12) with Microsoft SMTP Server (TLS) id 15.1.355.16 via Frontend Transport; Tue, 15 Dec 2015 08:26:55 +0000 Authentication-Results: spf=permerror (sender IP is 192.88.168.50) smtp.mailfrom=freescale.com; denx.de; dkim=none (message not signed) header.d=none; denx.de; dmarc=none action=none header.from=freescale.com; Received-SPF: PermError (protection.outlook.com: domain of freescale.com used an invalid SPF mechanism) Received: from tx30smr01.am.freescale.net (192.88.168.50) by BY2FFO11FD034.mail.protection.outlook.com (10.1.14.219) with Microsoft SMTP Server (TLS) id 15.1.346.13 via Frontend Transport; Tue, 15 Dec 2015 08:26:53 +0000 Received: from linux-7smt.suse ([10.193.99.203]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id tBF8QbsB006496; Tue, 15 Dec 2015 01:26:52 -0700 From: Peng Fan <Peng.Fan@freescale.com> To: <u-boot@lists.denx.de> Date: Tue, 15 Dec 2015 16:26:12 +0800 Message-ID: <1450167975-13265-2-git-send-email-Peng.Fan@freescale.com> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1450167975-13265-1-git-send-email-Peng.Fan@freescale.com> References: <1450167975-13265-1-git-send-email-Peng.Fan@freescale.com> X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD034; 1:hJf6kYl2lm+RLlZbBURk8iFRS/WY+ZkNzUfxEwLyRIkrbJ5gDAR+LAfB3dPDtz5u1CyvhSQc9ta0kahh4Hu549qE4cm9r8Se7xHAyNdFiVNBvLqIeSK8T/DtFPcLrOb9pqRJP6YYeY1QEhlU4XTh5kggL6hfA0cyJipnREriaZdS25eQxzqUtULCRo57a+FVjqUub4vGwDdF1/2YZT+RlZ59pqqJLFXiD23hLPUq0BsE8JAMfGefMR7HN4HNaxhlCFTQW9fAnFbmRk6YO5lpp1pWTTW3iNcPH7gT0k93Y0UnaKZ5ta55dTxJQZG97Zrtw1Azt+RabQJND+SXsjXbQsuchd8stEJj7MQgd8L/xMqEclcFN8VXkRPYU6l40lGSY0QwulpLgzomOvJywUUcDmaNtfhOij+uuZ5K5UW7Dyo= X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(448002)(199003)(189002)(86362001)(47776003)(1096002)(85326001)(87936001)(1220700001)(36756003)(106466001)(586003)(19580405001)(2950100001)(104016004)(2351001)(19580395003)(76176999)(5008740100001)(81156007)(50986999)(48376002)(92566002)(5003940100001)(97736004)(189998001)(50226001)(6806005)(110136002)(5001960100002)(77096005)(50466002)(11100500001)(229853001)(32563001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM2PR0301MB0686; H:tx30smr01.am.freescale.net; FPR:; SPF:PermError; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0686; 2:7WOZJfaEQ7In4dfARDm5IicBTYk7kiC72OqdCga40xwGzka7MzGd3hlM0temIyCfM1oykOiFreBhVXIoJ4gZi6wY7vvL8I6Qe99QHFFz2WGZEAAt9YmvqBusYSRAAmzotpNLng+oIBOUeu4zEVuC4w==; 3:6jAxL6PIB0gbdeblpakroSbhSQYnaCArWQlADe2vk/4E7HZlUbp7lDa6ICHGsMtr0soKU209i8F3A1Swx+mwms3HFXqOJAoAax9mIcsxP6C/PgBaD53h7deIxg5jaPjpcpnCF9G4KcwFC0ylZYXuylxu58EgS+hmzVuycvPbJp6+CFekjlU/fZQ250zrpmWySSnmpu7bSst7QooTXEvUx4sObOdHeUqCDKDprAU+WxQ=; 25:tw9JehlcHvHAYcXQ/jfmfoy1eEsCmn4ui+F0sv1xYt7ao1zAYzEyxsUu/2gCRXrmEAptTvO6t7Hgy8NV32LUJh/ZIohm25LvdMvxQQxh83/6W3p7kRp4ep5by+5Af3gebgkYSOA5+54BM3SYlyaYlO85KcRZ00yop2ONhvfZzjod2zTEk+/luXOYy41zkcW6ltm5nYS5Hn/e4eHQ3s5V26WMvDYto0dTpIISbHTVJZAvAAXFqfOpJGvjrv0xZPlO X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB0686; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0686; 20:aMpBXZesvrudoD24WzLA02khqRvQ4ZyksFZUbZviRZv85nwjJ7xMNZB1b9yym9NzIo/f8DeCKYJI8jYiWCYD5jYp5EcfBBBWYHie3u1IR1M3wZESnrOqxNbaKTA8Qgv4VpnGsQUR0sD8LfOnHYDV/zW87rkAOyPRT5KF43wjbz6tDdAaLIYJsb9yUHtEL+lSFBZmOYEzUVopBql7FOdOBZDorUoKwHpndQ8L28pVKrzJ5aBLzvH8w4OejwU5m6wmDGsOrRO8/kJfpqwMSIMxWcomk7eGspr+1LS2DSJr5FB/FLjRZKHOyZGol4jCs+1b7XAAV6CnK69KfQ8IxU72Xyapo9cabvMXX00XheugyX0=; 4:2JiKSotBYxaNs5AjfeY4ji85L8EI0Bn56Oi137mfYS28ytpmb3IAIkBFLHuW5E0bXcByqfjJLbO86OB0jYJY116XSOjxCPDD4DNfD6FAXhZ/9ubv0bRTWo0scYfN3ZZUIv6RyYVshpU7pglAqQign7JvP5DhYh4xQxtL42l/2Ib+PuM0b9TMKNlpgDWy1qTr+lMTXAH5DoPRHfM9pwSS5uiju90OYeZKmmOXQG0jYf/zuxd07IJojb1FACn/bBpHQHohLgXpAIl93FiA2BRmH8ZfuuQ7ChQ8c14EnBcjWGlWN6YVkOCGqcR9q3r0X8kK9PiZiXYW9x67vQ874B5m31qxwktnDaMP6p5obKj4Lg2Tswxkehqppo9nsrvnnwoYXYS5qiekSBetuOT4+H8iFJ8iyCLVAjSIvBAeyYr9GHY= X-Microsoft-Antispam-PRVS: <DM2PR0301MB06860F02E392AF832F5BE6C482EE0@DM2PR0301MB0686.namprd03.prod.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:(101931422205132); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(520078)(8121501046)(3002001)(10201501046); SRVR:DM2PR0301MB0686; BCL:0; PCL:0; RULEID:; SRVR:DM2PR0301MB0686; X-Forefront-PRVS: 07915F544A X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR0301MB0686; 23:57LYbUiEUTggWg8VFpdc3neM0C+TtjEekqPjroy?= =?us-ascii?Q?uejdObiVqCintNRI+RXOiv7qq0Q1dfaq7hotcg05OQlxH6PVzLlNJHg5CBPb?= =?us-ascii?Q?ZVCNp9707dQbpQqVV8asIodKfJOphui/BliqunWhUyaGLvPm4hsZjQKBF+C5?= =?us-ascii?Q?z440hDbcq3m2xSzVJF3jiEY0l3XnN2y1xS2Y23yrO4Xt/Z9+funUyCwGh6hR?= =?us-ascii?Q?WobPbsCm8KdhzBTJ92AgM4xB5bUR+EI3Ps/BG1Lx04Y5tyZITnl9Tu3xB7te?= =?us-ascii?Q?nxGNUBIwq+VZVYlEL3HFD4B5WjFnnk5kHDx4kiXTAuKMos96glv1LbDwpeT4?= =?us-ascii?Q?UmMml7KJwIPsRCdI0v0H05KY24/CzU6kgMP+kREp1J519UEl1ebYhuGdzBrd?= =?us-ascii?Q?h0rn9gPEO0DYI4C4ygOv+wxJWS9MXWK3MzXQKKsXzYwvvIWJH6XGNMdLb5NM?= =?us-ascii?Q?bSbjXiHVohjsTggjguowA336FZO2duzFuWsNV3wZ5kiZvB4DrRAkZWyCk0CW?= =?us-ascii?Q?Q64YlhgwUts8WDdGs7UaIX+DOmCAgL0XVlolxhMBVFnzcc2d2287uLoJeJ9L?= =?us-ascii?Q?sVbUIdRkdw1c+EH5lhE4MCr/bud9TwVC6fS2e74cWoGdIS1MEsIX6Tq0jvPT?= =?us-ascii?Q?xr4TN4uCiir6MD6vTGRWMy5zMz4UIZs6kH5MTVpllXr6Y4cFrWpq39vV1+FT?= =?us-ascii?Q?EucOrLPrB5LWELcBw3OoqBJLiEpP/iOI95ozMM+ILjyRpR2OpU33wfU+St+l?= =?us-ascii?Q?H5mV7t6qtmdycbwkDGJxEH+hyH5jiGlscCAWvJTnviWjg6QVSUQ6P22w8BCS?= =?us-ascii?Q?51qHUtxNcXUpfMCLLXlPd/qRflNTDoIkfERdu9kodGZsfU9vsdklHNKUBcjM?= =?us-ascii?Q?SZ41qoNqAglQHNqsO2w3dIiKD78PrBAjhGiYdvuVG7nd4ZSvLd4rvbvsm8vq?= =?us-ascii?Q?kkl4NXG6rW10J9Z3ed+JFM574AJGQ9jEVyOt6Hg5pcsongUHCOpqLJCis4kD?= =?us-ascii?Q?OxR4=3D?= X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0686; 5:UkjXUyeh4claFN9ckWsqDKfs/T3x3NVmsXVxF77MsrA0NQTEhd5Nu0z0N7ImYAFqhrVUdhTkg9HJpz0Smvmyy3VoeoQrGStFTrLjUmXrLPwvI09o9xQUnsf0PwqwDmwDuSttYr1umLj60Cc36Jx+1A==; 24:mxZqqT3GIGXzaBaxhnNti51oTiItdtuG9m/rPv1PGRtfeppkOxtqgz5l50LQQNvEblCcdZQQrqxX/bT45W7o5dqMTW0tEOk7poAjjS9iOYQ= X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Dec 2015 08:26:53.9358 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0301MB0686 Subject: [U-Boot] [PATCH 2/5] imx: mx6sabresd: implement mmc_get_env_devno X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion <u-boot.lists.denx.de> List-Unsubscribe: <http://lists.denx.de/mailman/options/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=unsubscribe> List-Archive: <http://lists.denx.de/pipermail/u-boot/> List-Post: <mailto:u-boot@lists.denx.de> List-Help: <mailto:u-boot-request@lists.denx.de?subject=help> List-Subscribe: <http://lists.denx.de/mailman/listinfo/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" <u-boot-bounces@lists.denx.de> |
diff --git a/board/freescale/mx6sabresd/mx6sabresd.c b/board/freescale/mx6sabresd/mx6sabresd.c index 581c9d5..22ed331 100644 --- a/board/freescale/mx6sabresd/mx6sabresd.c +++ b/board/freescale/mx6sabresd/mx6sabresd.c @@ -234,6 +234,35 @@ struct fsl_esdhc_cfg usdhc_cfg[3] = { #define USDHC2_CD_GPIO IMX_GPIO_NR(2, 2) #define USDHC3_CD_GPIO IMX_GPIO_NR(2, 0) +int mmc_get_env_devno(void) +{ + struct src *src_regs = (struct src *)SRC_BASE_ADDR; + u32 soc_sbmr = readl(&src_regs->sbmr1); + u32 dev_no; + u32 bootsel; + + /* + * Refer to + * "i.MX 6Dual/6Quad Applications Processor Reference Manual" + * Chapter "8.5.3.1 Expansion Device eFUSE Configuration" + */ + bootsel = (soc_sbmr & 0x000000FF) >> 6 ; + + /* If not boot from sd/mmc, use default value */ + if (bootsel != 1) + return CONFIG_SYS_MMC_ENV_DEV; + + /* BOOT_CFG2[3] and BOOT_CFG2[4] */ + dev_no = (soc_sbmr & 0x00001800) >> 11; + + /* + * need ubstract 1 to map to the mmc device id + * see the comments in board_mmc_init function + */ + + return --dev_no; +} + int board_mmc_getcd(struct mmc *mmc) { struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv;
Implement mmc_get_env_devno, support loading env successfully when booting from different slots. Signed-off-by: Peng Fan <Peng.Fan@freescale.com> Cc: Stefano Babic <sbabic@denx.de> --- board/freescale/mx6sabresd/mx6sabresd.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+)