From patchwork Tue Mar 24 23:25:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vagrant Cascadian X-Patchwork-Id: 454102 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 ED04C14009B for ; Wed, 25 Mar 2015 10:25:50 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6892D4A046; Wed, 25 Mar 2015 00:25:47 +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 EJEFg4ziRYb4; Wed, 25 Mar 2015 00:25:47 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 843F84A033; Wed, 25 Mar 2015 00:25:46 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id AA6394A033 for ; Wed, 25 Mar 2015 00:25:43 +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 tdtGE6lHuubf for ; Wed, 25 Mar 2015 00:25:43 +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 cascadia.aikidev.net (cascadia.aikidev.net [173.255.214.101]) by theia.denx.de (Postfix) with ESMTP id 239674A02E for ; Wed, 25 Mar 2015 00:25:40 +0100 (CET) Received: from localhost (unknown [IPv6:2601:7:780:9bc:86a6:c8ff:fe87:ac53]) (Authenticated sender: vagrant@cascadia.debian.net) by cascadia.aikidev.net (Postfix) with ESMTPSA id C1E141AAE4; Tue, 24 Mar 2015 16:25:38 -0700 (PDT) From: Vagrant Cascadian To: andrej@inversepath.com, u-boot@lists.denx.de In-Reply-To: <1427203612-19822-1-git-send-email-andrej@inversepath.com> References: <1427203612-19822-1-git-send-email-andrej@inversepath.com> User-Agent: Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 (x86_64-pc-linux-gnu) X-Hashcash: 1:20:150324:sbabic@denx.de::Zh6UlSKKkPNF18VK:0001qIQ X-Hashcash: 1:20:150324:andrej@inversepath.com::5v7sfo/N1dEGQYea:0000000000000000000000000000000000000001dBs X-Hashcash: 1:20:150324:chris.kuethe@gmail.com::F2tspV/+cjmCTtHk:00000000000000000000000000000000000000042/m X-Hashcash: 1:20:150324:u-boot@lists.denx.de::O1AmOBGEUR9EZ5+t:000000000000000000000000000000000000000006RmM X-Hashcash: 1:20:150324:festevam@gmail.com::TmFzlDTVoxFtAgcl:0000000000000000000000000000000000000000000HMi8 Date: Tue, 24 Mar 2015 16:25:34 -0700 Message-ID: <87oaniou4x.fsf@aikidev.net> MIME-Version: 1.0 Subject: Re: [U-Boot] [PATCH v3] arm: mx5: Add support for USB armory board 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: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" On 2015-03-24, andrej@inversepath.com wrote: > Add support for Inverse Path USB armory board, an open source > flash-drive sized computer based on Freescale i.MX53 SoC. Thanks! Unfortunately, this fails to build with numerous errors such as: CC arch/arm/lib/asm-offsets.s In file included from include/config.h:6:0, from /«BUILDDIR»/u-boot-2015.04~rc4+dfsg1/include/common.h:18, from /«BUILDDIR»/u-boot-2015.04~rc4+dfsg1/lib/asm-offsets.c:15: /«BUILDDIR»/u-boot-2015.04~rc4+dfsg1/include/configs/usbarmory.h:86:0: warning: "CONFIG_BOOTCOMMAND" redefined #define CONFIG_BOOTCOMMAND \ ^ In file included from /«BUILDDIR»/u-boot-2015.04~rc4+dfsg1/include/configs/usbarmory.h:27:0, from include/config.h:6, from /«BUILDDIR»/u-boot-2015.04~rc4+dfsg1/include/common.h:18, from /«BUILDDIR»/u-boot-2015.04~rc4+dfsg1/lib/asm-offsets.c:15: /«BUILDDIR»/u-boot-2015.04~rc4+dfsg1/include/config_distro_bootcmd.h:232:0: note: this is the location of the previous definition #define CONFIG_BOOTCOMMAND "run distro_bootcmd" ^ It is caused by including config_distro_bootcmd.h too early, and config_distro_bootcmd.h defines CONFIG_BOOTCOMMAND before it is set in include/configs/usbarmory.h. The include for config_distro_bootcmd.h should be *after* CONFIG_BOOTCOMMAND and BOOT_TARGET_DEVICES are defined, at least. There are also other conditionals that may be impacted but are more subtle. So here's a tested trivial patch to fix that: live well, vagrant Index: u-boot/include/configs/usbarmory.h =================================================================== --- u-boot.orig/include/configs/usbarmory.h +++ u-boot/include/configs/usbarmory.h @@ -24,7 +24,6 @@ #include #include -#include /* U-Boot commands */ #define CONFIG_CMD_MEMTEST @@ -92,6 +91,8 @@ #define BOOT_TARGET_DEVICES(func) \ func(MMC, mmc, 0) +#include + #define MEM_LAYOUT_ENV_SETTINGS \ "kernel_addr_r=0x70800000\0" \ "fdt_addr_r=0x71000000\0" \ I'd like to propose only setting bootargs when the default action is kicking in to allow for a different root device, or root device discovery from an initramfs, or boot scripts, etc... Something along these lines (untested): Index: u-boot/include/configs/usbarmory.h =================================================================== --- u-boot.orig/include/configs/usbarmory.h +++ u-boot/include/configs/usbarmory.h @@ -80,10 +80,9 @@ #define CONFIG_SYS_TEXT_BASE 0x77800000 #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR #define CONFIG_HOSTNAME usbarmory -#define CONFIG_BOOTARGS \ - "console=ttymxc0,115200 root=/dev/mmcblk0p1 rootwait rw" #define CONFIG_BOOTCOMMAND \ "run distro_bootcmd; " \ + "setenv bootargs console=${console} ${bootargs_default}; " \ "ext2load mmc 0:1 ${kernel_addr_r} /boot/uImage; " \ "ext2load mmc 0:1 ${fdt_addr_r} /boot/${fdtfile}; " \ "bootm ${kernel_addr_r} - ${fdt_addr_r}" @@ -102,6 +101,7 @@ #define CONFIG_EXTRA_ENV_SETTINGS \ MEM_LAYOUT_ENV_SETTINGS \ + "bootargs_default=root=/dev/mmcblk0p1 rootwait rw\0" \ "fdtfile=imx53-usbarmory.dtb\0" \ "console=ttymxc0,115200\0" \ BOOTENV