From patchwork Thu Oct 2 19:16:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Nelson X-Patchwork-Id: 396084 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 42710140180 for ; Fri, 3 Oct 2014 05:20:49 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 03E66AB5BE; Thu, 2 Oct 2014 21:19:07 +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 WzewwPsaLh2C; Thu, 2 Oct 2014 21:19:06 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B2C2DAB5A8; Thu, 2 Oct 2014 21:18:37 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3C1F6AB618 for ; Thu, 2 Oct 2014 21:18:33 +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 d2d0fomtkdB1 for ; Thu, 2 Oct 2014 21:18:33 +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 mail-pa0-f53.google.com (mail-pa0-f53.google.com [209.85.220.53]) by theia.denx.de (Postfix) with ESMTPS id 3E21BAB59E for ; Thu, 2 Oct 2014 21:17:58 +0200 (CEST) Received: by mail-pa0-f53.google.com with SMTP id kq14so3170062pab.12 for ; Thu, 02 Oct 2014 12:17:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=/5SB4V/Z+/airYTUh8usSA10kIfSkcyD2JD7NKNLLoY=; b=cm0SSqKDIeTzXsF/deyMMsEReDj1xZI6KgDLTgfviAClCwOJwGmqM/sZeRcXPFuhUl 2GVOzEmBKrHKbFInLoc1U6av6GNO95sa5Wwj/Cd7O6RpC4OHOEkRZ1vNOk/pbboxY2ES S+MSmQ+Vrg25c54RvLO/FU7UK8D0Q1kZ5ERAkZE0PHk14qxg4fq+kh1QkXRmkRL0MM2W FB10IPgfWf10LrbFreYbC7bl80fIowUy8Q4bNbFw1PbvGdM4sBEBaTsnDgMfVakMa4oT acNzWshVf0h3RM/bFfE22ujS+FEiCgsBTIsrhoY9Mnxt8UMOzivpnIotgCOpcZs/1q9Z zIag== X-Gm-Message-State: ALoCoQlTtD7nYDqZx6X15j57UJp8UwVZJSSTC8wLSKDFX1f+SWrhe5OWrlgfQtyPAungzvLdmYTR X-Received: by 10.66.136.12 with SMTP id pw12mr1056612pab.71.1412277476879; Thu, 02 Oct 2014 12:17:56 -0700 (PDT) Received: from localhost.localdomain (174-19-208-215.phnx.qwest.net. [174.19.208.215]) by mx.google.com with ESMTPSA id ot8sm4569317pbc.1.2014.10.02.12.17.54 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 02 Oct 2014 12:17:55 -0700 (PDT) From: Eric Nelson To: u-boot@lists.denx.de Date: Thu, 2 Oct 2014 12:16:44 -0700 Message-Id: <1412277413-30271-24-git-send-email-eric.nelson@boundarydevices.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1412277413-30271-1-git-send-email-eric.nelson@boundarydevices.com> References: <1412277413-30271-1-git-send-email-eric.nelson@boundarydevices.com> Cc: diego.rondini@kynetics.it Subject: [U-Boot] [PATCH 23/32] nitrogen6x: config: expose SATA, then MMC over USB X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.13 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de If no boot script was found, expose internal storage over the USB mass storage gadget to allow easy programming. This is especially useful when SD cards are inaccessible or when loading SATA drives. More details are available in this blog post: http://boundarydevices.com/u-boot-usb-mass-storage-gadget/ Signed-off-by: Eric Nelson --- include/configs/nitrogen6x.h | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/include/configs/nitrogen6x.h b/include/configs/nitrogen6x.h index 3c24443..b31b922 100644 --- a/include/configs/nitrogen6x.h +++ b/include/configs/nitrogen6x.h @@ -180,6 +180,7 @@ #endif #define CONFIG_DRIVE_TYPES CONFIG_DRIVE_SATA CONFIG_DRIVE_MMC CONFIG_DRIVE_USB +#define CONFIG_UMSDEVS CONFIG_DRIVE_SATA CONFIG_DRIVE_MMC #if defined(CONFIG_SABRELITE) #define CONFIG_EXTRA_ENV_SETTINGS \ @@ -260,6 +261,7 @@ #else #define CONFIG_EXTRA_ENV_SETTINGS \ "bootdevs=" CONFIG_DRIVE_TYPES "\0" \ + "umsdevs=" CONFIG_UMSDEVS "\0" \ "console=ttymxc1\0" \ "clearenv=if sf probe || sf probe || sf probe 1 ; then " \ "sf erase 0xc0000 0x2000 && " \ @@ -281,7 +283,26 @@ "echo ; echo 6x_bootscript not found ; " \ "echo ; echo serial console at 115200, 8N1 ; echo ; " \ "echo details at http://boundarydevices.com/6q_bootscript ; " \ - "setenv stdout serial\0" \ + "setenv stdout serial;" \ + "setenv stdin serial,usbkbd;" \ + "for dtype in ${umsdevs} ; do " \ + "if itest.s sata == ${dtype}; then " \ + "initcmd='sata init' ;" \ + "else " \ + "initcmd='mmc rescan' ;" \ + "fi; " \ + "for disk in 0 1 ; do " \ + "if $initcmd && $dtype dev $disk ; then " \ + "setenv stdout serial,vga; " \ + "echo expose ${dtype} ${disk} " \ + "over USB; " \ + "ums 0 $dtype $disk ;" \ + "fi; " \ + " done; " \ + "done ;" \ + "setenv stdout serial,vga; " \ + "echo no block devices found;" \ + "\0" \ "initrd_high=0xffffffff\0" \ "upgradeu=for dtype in ${bootdevs}" \ "; do " \