public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Andrej Rosano <andrej@inversepath.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] arm: mx5: Add support for USB armory board
Date: Tue, 24 Mar 2015 14:32:43 +0100	[thread overview]
Message-ID: <20150324133243.GC29219@core.inversepath.com> (raw)
In-Reply-To: <87619ubd0j.fsf@aikidev.net>

Hi Vagrant,

On Sat, Mar 21, 2015 at 08:12:28AM -0700, Vagrant Cascadian wrote:
> On 2015-03-19, Andrej Rosano wrote:
> > On Thu, Mar 19, 2015 at 09:55:26AM -0700, Vagrant Cascadian wrote:
> >> On 2015-02-24, andrej at inversepath.com wrote:
> >> > Add support for Inverse Path USB armory board, an open source
> >> > flash-drive sized computer based on Freescale i.MX53 SoC.
> ...
> >> Would you consider patches that include config_distro_defaults.h and
> >> config_distro_bootcmd.h, documented in doc/README.distro? It may require
> >> adding several variables such as fdt_addr_r, fdtfile, ramdisk_addr_r,
> >> ramdiskfile, kernel_addr_r, bootfile, pxe_addr_r and scriptaddr,
> >> documented in README and doc/README.distro. I'd be happy to work on
> >> patches.
> ...
> > Sure, it would be nice to have this included in the patch.
> > I didn't know about this, I will take a look as well. Let me know if
> > you need any help from my side.
> 
> Ok, here's a quick patch on top of your existing patch. It compiles, but
> I haven't tested that it boots (waiting on some header pins to hook up
> the serial console).
> 
> I tried to preserve default behavior, the only difference is that it
> will first check for extlinux.conf and boot.scr before running the
> default boot action, and has a 2 second rather than 1 second bootdelay.
> 
> Many of the things defined in config_distro_defaults.h were redundant.
> 
> Not sure if CONFIG_LOADADDR needs to be different from
> kernel_addr_r/scriptaddr/pxefile_addr_r, if they can all be the same,
> then they could be defined with CONFIG_LOADADDR. Hopefully
> ramdisk_addr_r is at a reasonable location so it won't be clobbered by
> the fdt or kernel being loaded to a lower address. It may require
> removing the default bootargs to work with boot scripts.

Tested and it works as expected. I have just submitted an updated patch (v3).

Thanks

Andrej

> 
> diff --git a/include/configs/usbarmory.h b/include/configs/usbarmory.h
> index e00ec7b..7e4cc68 100644
> --- a/include/configs/usbarmory.h
> +++ b/include/configs/usbarmory.h
> @@ -22,12 +22,10 @@
>  
>  #include <asm/arch/imx-regs.h>
>  #include <config_cmd_default.h>
> +#include <config_distro_defaults.h>
>  
>  /* U-Boot commands */
> -#define CONFIG_CMD_BOOTZ
> -#define CONFIG_CMD_FAT
>  #define CONFIG_CMD_MEMTEST
> -#define CONFIG_CMD_EXT2
>  #undef CONFIG_CMD_IMLS
>  
>  /* U-Boot environment */
> @@ -39,14 +37,10 @@
>  #define CONFIG_SYS_MMC_ENV_DEV	0
>  
>  /* U-Boot general configurations */
> -#define CONFIG_SYS_LONGHELP
> -#define CONFIG_SYS_HUSH_PARSER
> -#define CONFIG_AUTO_COMPLETE
>  #define CONFIG_SYS_CBSIZE	512
>  #define CONFIG_SYS_PBSIZE	(CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
>  #define CONFIG_SYS_MAXARGS	16
>  #define CONFIG_SYS_BARGSIZE	CONFIG_SYS_CBSIZE
> -#define CONFIG_CMDLINE_EDITING
>  
>  /* UART */
>  #define CONFIG_MXC_UART
> @@ -61,7 +55,6 @@
>  #define CONFIG_SYS_FSL_ESDHC_NUM	2
>  #define CONFIG_MMC
>  #define CONFIG_GENERIC_MMC
> -#define CONFIG_DOS_PARTITION
>  
>  /* USB */
>  #define CONFIG_CMD_USB
> @@ -82,7 +75,6 @@
>  #define CONFIG_FSL_IIM
>  
>  /* Linux boot */
> -#define CONFIG_BOOTDELAY	1
>  #define CONFIG_LOADADDR		0x72000000
>  #define CONFIG_SYS_TEXT_BASE	0x77800000
>  #define CONFIG_SYS_LOAD_ADDR	CONFIG_LOADADDR
> @@ -90,8 +82,28 @@
>  #define CONFIG_BOOTARGS \
>  	"console=ttymxc0,115200 root=/dev/mmcblk0p1 rootwait rw"
>  #define CONFIG_BOOTCOMMAND \
> -	"ext2load mmc 0:1 0x70800000 /boot/uImage; ext2load mmc 0:1" \
> -	"0x71000000 /boot/imx53-usbarmory.dtb; bootm 0x70800000 - 0x71000000"
> +	"run distro_bootcmd; " \
> +	"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}"
> +
> +#define BOOT_TARGET_DEVICES(func) \
> +       func(MMC, mmc, 0)
> +
> +#include <config_distro_bootcmd.h>
> +
> +#define MEM_LAYOUT_ENV_SETTINGS \
> +	"kernel_addr_r=0x70800000\0" \
> +	"fdt_addr_r=0x71000000\0" \
> +	"scriptaddr=0x70800000\0" \
> +	"pxefile_addr_r=0x70800000\0" \
> +	"ramdisk_addr_r=0x73000000\0"
> +
> +#define CONFIG_EXTRA_ENV_SETTINGS	\
> +	MEM_LAYOUT_ENV_SETTINGS		\
> +	"fdtfile=imx53-usbarmory.dtb\0"	\
> +	"console=ttymxc0,115200\0"	\
> +	BOOTENV
>  
>  /* Physical Memory Map */
>  #define CONFIG_NR_DRAM_BANKS		1
> 
> 
> live well,
>   vagrant



--
Andrej Rosano                                           Inverse Path Srl
<andrej@inversepath.com>                      http://www.inversepath.com

0x01939B21            5BB8 574E 68E8 D841 E18F  D5E9 CEAD E0CF 0193 9B21

      reply	other threads:[~2015-03-24 13:32 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-24  9:03 [U-Boot] [PATCH] arm: mx5: Add support for USB armory board andrej at inversepath.com
2015-03-05 19:06 ` Chris Kuethe
2015-03-16 16:50 ` Chris Kuethe
2015-03-17  5:27   ` Chris Kuethe
2015-03-17 16:30   ` Fabio Estevam
2015-03-17 16:49     ` Chris Kuethe
2015-03-17 16:51     ` Eric Nelson
2015-03-17 17:09       ` Stefano Babic
2015-03-17 17:27         ` Fabio Estevam
2015-03-18 23:00     ` Andrej Rosano
2015-03-19 16:55 ` [U-Boot] " Vagrant Cascadian
2015-03-19 17:03   ` Otavio Salvador
2015-03-19 19:18   ` Andrej Rosano
2015-03-21 15:12     ` Vagrant Cascadian
2015-03-24 13:32       ` Andrej Rosano [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150324133243.GC29219@core.inversepath.com \
    --to=andrej@inversepath.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox