From patchwork Thu Dec 1 11:52:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yegor Yefremov X-Patchwork-Id: 701482 X-Patchwork-Delegate: trini@ti.com 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 3tTwdp2P7rz9tlB for ; Thu, 1 Dec 2016 22:53:02 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=googlemail.com header.i=@googlemail.com header.b="S7VNtBUz"; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 73DFEA75CD; Thu, 1 Dec 2016 12:52:52 +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 eMR4iouU0SgO; Thu, 1 Dec 2016 12:52:52 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2585AB3863; Thu, 1 Dec 2016 12:52:50 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id AED81A75C3 for ; Thu, 1 Dec 2016 12:52:46 +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 fPaL9_zIqbWl for ; Thu, 1 Dec 2016 12:52:46 +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 mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by theia.denx.de (Postfix) with ESMTPS id 73966A75AC for ; Thu, 1 Dec 2016 12:52:38 +0100 (CET) Received: by mail-wm0-f67.google.com with SMTP id u144so33723277wmu.0 for ; Thu, 01 Dec 2016 03:52:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=YGaeqwuQxVisYLxkCT8UpbLxBWTjhjkN9iYb6Cw5J1g=; b=S7VNtBUzQ60DJHhlfmMWfkYsjBRLZku/oU/Kh0+zClJcHZiir9tBb+0JpHRRGAfteg xmv0EIEFZ2ztSQkk52SX7PB81K1lZpXycKjRguUnjFIx6KGTCwl0tzWQDOluE878li+I IOd1PrGqslqw0hboQlCbBK5OWi0cKijjqH853+0PGdhamwtvX7Yi65BoE9kq3XC53osx XWe7PIMWhX1WyXKEJlztomt0xDQvqsM97075MEccGCRzvHuGDTd0Qmu2U58Pdf3eo8Qf v2BwXvNHqu+QBi0bL0caz6RS1q2TrGPzFQxUpxJOLySfj10BkgIFFfbgl01tzsi+0u2b 8j1A== 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=YGaeqwuQxVisYLxkCT8UpbLxBWTjhjkN9iYb6Cw5J1g=; b=X4O+KGY2p2yfW7RLDDdqOrYoerx8bpTXlPcnVroyrKDIsl4exMvgLPlsgumlONKNKM +/rnmAjq0vKrTTJLY2nEBeYRzHH0ITWU3zBVMbRoksZWhOGR4PAX650xJw/zGiNk8h+e Df0Vbz07Nm2A8BJmbEWEsY5VrsMHMLEZO2Hp843uLYEYXKmczAez/DlGh7wtTdTThQg/ AtTyZwRFJ3d3cT/rYYChLZA7zrjHnWNjg/t9SyZTtY94NJKQoNwLDciU1aWTDZXUe5PL eOSvC/0K6gp52SXIc0dBGK5o6Xyc8yQUh8XfyvrAID2XvcwsQPaw+TpAjvSsV+dB1hs3 Oe4w== X-Gm-Message-State: AKaTC03yCFDNuWE/7ePj4Q9Co/PfAerNJQ7+IETTnRdzuyZR1N5iPQSwbycfA6n/JoJpQw== X-Received: by 10.28.111.139 with SMTP id c11mr34775216wmi.139.1480593158152; Thu, 01 Dec 2016 03:52:38 -0800 (PST) Received: from development1.visionsystems.de (mail.visionsystems.de. [213.209.99.202]) by smtp.gmail.com with ESMTPSA id t82sm489082wmd.17.2016.12.01.03.52.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 01 Dec 2016 03:52:37 -0800 (PST) From: yegorslists@googlemail.com To: u-boot@lists.denx.de Date: Thu, 1 Dec 2016 12:52:18 +0100 Message-Id: <1480593138-31105-3-git-send-email-yegorslists@googlemail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1480593138-31105-1-git-send-email-yegorslists@googlemail.com> References: <1480593138-31105-1-git-send-email-yegorslists@googlemail.com> Cc: thomas.petazzoni@free-electrons.com, trini@konsulko.com Subject: [U-Boot] [PATCH 3/3] arm: baltos: enable booting from USB 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" From: Yegor Yefremov First of all U-Boot would search for a USB mass storage device with either uEnv.txt or kernel-fit.itb and boot. If USB mass storage device is not available or doesn't provide these files then MMC will be tried. Signed-off-by: Yegor Yefremov Reviewed-by: Tom Rini --- include/configs/baltos.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/include/configs/baltos.h b/include/configs/baltos.h index 8efd513..06f5ceb 100644 --- a/include/configs/baltos.h +++ b/include/configs/baltos.h @@ -102,7 +102,9 @@ "optargs=\0" \ "mmcdev=0\0" \ "mmcroot=/dev/mmcblk0p2 ro\0" \ + "usbroot=/dev/sda2 ro\0" \ "mmcrootfstype=ext4 rootwait\0" \ + "usbrootfstype=ext4 rootwait\0" \ "rootpath=/export/rootfs\0" \ "nfsopts=nolock\0" \ "static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}" \ @@ -114,6 +116,11 @@ "${mtdparts} " \ "root=${mmcroot} " \ "rootfstype=${mmcrootfstype}\0" \ + "usbargs=setenv bootargs console=${console} " \ + "${optargs} " \ + "${mtdparts} " \ + "root=${usbroot} " \ + "rootfstype=${usbrootfstype}\0" \ "spiroot=/dev/mtdblock4 rw\0" \ "spirootfstype=jffs2\0" \ "spisrcaddr=0xe0000\0" \ @@ -130,15 +137,25 @@ "ip=dhcp\0" \ "bootenv=uEnv.txt\0" \ "loadbootenv=load mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \ + "usbloadbootenv=load usb 0:1 ${loadaddr} ${bootenv}\0" \ "importbootenv=echo Importing environment from mmc ...; " \ "env import -t $loadaddr $filesize\0" \ + "usbimportbootenv=echo Importing environment from USB ...; " \ + "env import -t $loadaddr $filesize\0" \ "ramargs=setenv bootargs console=${console} " \ "${optargs} " \ "root=${ramroot} " \ "rootfstype=${ramrootfstype}\0" \ "loadramdisk=load mmc ${mmcdev} ${rdaddr} ramdisk.gz\0" \ "loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \ + "usbloadimage=load usb 0:1 ${loadaddr} kernel-fit.itb\0" \ "loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \ + "usbloados=run usbargs; " \ + "bootm ${loadaddr}#conf${board_name}; " \ + "if test $? -ne 0; then " \ + "echo Using default FIT configuration; " \ + "bootm ${loadaddr}; " \ + "fi;\0" \ "mmcloados=run mmcargs; " \ "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ "if run loadfdt; then " \ @@ -153,6 +170,21 @@ "else " \ "bootz; " \ "fi;\0" \ + "usbboot=usb reset; " \ + "if usb storage; then " \ + "echo USB drive found;" \ + "if run usbloadbootenv; then " \ + "echo Loaded environment from ${bootenv};" \ + "run usbimportbootenv;" \ + "fi;" \ + "if test -n $uenvcmd; then " \ + "echo Running uenvcmd ...;" \ + "run uenvcmd;" \ + "fi;" \ + "if run usbloadimage; then " \ + "run usbloados;" \ + "fi;" \ + "fi;\0" \ "mmcboot=mmc dev ${mmcdev}; " \ "if mmc rescan; then " \ "echo SD/MMC found on device ${mmcdev};" \ @@ -190,6 +222,7 @@ #define CONFIG_BOOTCOMMAND \ "run findfdt; " \ + "run usbboot;" \ "run mmcboot;" \ "setenv mmcdev 1; " \ "setenv bootpart 1:2; " \