From patchwork Fri Jun 22 05:16:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jay Carlson X-Patchwork-Id: 933113 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=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="bEbBNVCQ"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 41BmyK2pwTz9s3C for ; Fri, 22 Jun 2018 15:16:41 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id ED759C21FB0; Fri, 22 Jun 2018 05:16:31 +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=FREEMAIL_FROM, RCVD_IN_MSPIKE_H2, 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 724A4C21C2F; Fri, 22 Jun 2018 05:16:29 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 79240C21C2F; Fri, 22 Jun 2018 05:16:28 +0000 (UTC) Received: from mail-io0-f173.google.com (mail-io0-f173.google.com [209.85.223.173]) by lists.denx.de (Postfix) with ESMTPS id D58AEC21C2C for ; Fri, 22 Jun 2018 05:16:27 +0000 (UTC) Received: by mail-io0-f173.google.com with SMTP id i23-v6so2166766iog.10 for ; Thu, 21 Jun 2018 22:16:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=sbl3zR5QUeTs7DyLbHEfOYBhTV9Q5ZRy1Z4H5+03ggI=; b=bEbBNVCQ8L+pQzFUkzQT+nZkqPMO6ug277xmKJ++GuoIcjF+EWSXoFTOC1McBmGE95 fBOB5x/7uC+xPISkgUKSjlyNCoe0NF8YVjMfXVmz3xKTwRB/LH26w9IDxzry0zXe8PjK bfC1+RJrMhJHko0OF5eT07R9+7t3ZZOjhLxsrMkBicDcYCDwzfz5vA1xZTIcBu1lfL0b twvDplW3F5ztZ3SiNs/vLxSgBZ5Z7+4XcjX06B9rYvc8tRqLAbmu7h0TV2PfVqfO3CTt FVfJA2jYuTZxpG7dykanzgv+BnqhbK9d5Fyg4V6D/Aq8IUbh76BsTnRQum6Zbei7skT5 M5zQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=sbl3zR5QUeTs7DyLbHEfOYBhTV9Q5ZRy1Z4H5+03ggI=; b=c/fPr1V3klrDSqs6+mdilLOGmhkFRohIJzl/ePDfsGPAlmEkUHB3PyuJ3MzNQot7pM nR5QQxLCedWKNDoIZnUOQ19jh2/9QkvXpMUvuslaotjC9gp3XI2bLsiz2ki5lppuN20M xnZCtkY5HBi0bcSgVnNiH+LUUWT7q4nepZ0uV2YVxNChIVpDGrDOq+gA8hhiUyF2VDlq Op1/JXJIXqPMtHxMrIzbmnapGRhMSUEl4Bek9ICPZdRNRzDc3iMtgIakvm1ku+zLrDCB /Ovo3iPrtG5GCJbn3ZdCKSXx3HJZYa+V6RQIsg+0cdv0g5RtKN82xjwXr419pcarUAoB v2Lg== X-Gm-Message-State: APt69E2xyPs9AReJDzlGak1Ua0PGZ46xyNjiGQnb570zW/u/aQYtlyrK 4q6P7Ksf3fPgGJpo3S61b5LZDQ== X-Google-Smtp-Source: AAOMgpfRhLiqRj0uJ5cB6HL5qcV+SIIpO2F7uvHgEj2tbTXOO3GN3qqwR307jl2wAb1a8SqE53INIw== X-Received: by 2002:a6b:b40e:: with SMTP id d14-v6mr95470iof.163.1529644586306; Thu, 21 Jun 2018 22:16:26 -0700 (PDT) Received: from localhost.localdomain ([162.250.116.23]) by smtp.gmail.com with ESMTPSA id n4-v6sm2783649ioc.76.2018.06.21.22.16.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 21 Jun 2018 22:16:25 -0700 (PDT) From: Jay Carlson To: u-boot@lists.denx.de Date: Fri, 22 Jun 2018 00:16:03 -0500 Message-Id: <20180622051603.9592-1-jay.d.carlson@gmail.com> X-Mailer: git-send-email 2.16.1.windows.4 Subject: [U-Boot] [PATCH v2] arm, imx6: add support for SD/MMC Manufacture Mode 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: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" This patch adds support for booting blank i.MX6 devices in SD/MMC Manufacture Mode: a fallback mode which the boot ROM enters when no fuses or boot mode pins have been set, the USB serial downloader connection is inactive, and there is an SD card inserted into uSDHC1. The i.MX7 and i.MX8, which both have a Boot_SW_Info data structure which can be parsed to determine boot source, is unaffected by this patch. Signed-off-by: Jay Carlson --- arch/arm/mach-imx/spl.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/arm/mach-imx/spl.c b/arch/arm/mach-imx/spl.c index a20b30d154..8ecae8605c 100644 --- a/arch/arm/mach-imx/spl.c +++ b/arch/arm/mach-imx/spl.c @@ -43,6 +43,16 @@ u32 spl_boot_device(void) */ if (is_usbotg_phy_active()) return BOOT_DEVICE_BOARD; + + /** + * To support SD/MMC Manufacture Mode, we check that BOOT_MODE == 0 + * and that BT_FUSE_SEL == 0. If this was disabled via + * blowing DISABLE_SDMMC_MFG, or if SDMMC MFG mode failed, + * we would be in USB download mode, which the previous line would + * have detected. + */ + if (((bmode >> 24) & 0x03) == 0x00 && (bmode >> 4) == 0x00) + return BOOT_DEVICE_MMC1; /* BOOT_CFG1[7:4] - see IMX6DQRM Table 8-8 */ switch ((reg & IMX6_BMODE_MASK) >> IMX6_BMODE_SHIFT) {