Re: [U-Boot] [PATCH v3] arm: mx5: Add support for USB armory board

2015-03-24 Thread Vagrant Cascadian
On 2015-03-24, and...@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:

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=0x7080\0" \
"fdt_addr_r=0x7100\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   0x7780
 #define CONFIG_SYS_LOAD_ADDR   CONFIG_LOADADDR
 #define CONFIG_HOSTNAMEusbarmory
-#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


live well,
  vagrant


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3] arm: mx5: Add support for USB armory board

2015-03-24 Thread Chris Kuethe
On Tue, Mar 24, 2015 at 4:25 PM, Vagrant Cascadian  wrote:
> Unfortunately, this fails to build with numerous errors such as:

Heh. I was just about to go investigate that.

> ...
> +#include 
> +
>  #define MEM_LAYOUT_ENV_SETTINGS \

This section works for me.

> 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):
>

This section also untested by me.


-- 
GDB has a 'break' feature; why doesn't it have 'fix' too?
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3] arm: mx5: Add support for USB armory board

2015-03-25 Thread Stefano Babic
Hi Andrej,

On 24/03/2015 14:26, and...@inversepath.com wrote:
> From: Andrej Rosano 
> 
> Add support for Inverse Path USB armory board, an open source
> flash-drive sized computer based on Freescale i.MX53 SoC.
> 
> http://inversepath.com/usbarmory
> 
> Signed-off-by: Andrej Rosano 
> Cc: Stefano Babic 
> Cc: Chris Kuethe 
> Cc: Fabio Estevam 
> Cc: Vagrant Cascadian 
> ---
> Changes for v3:
>  - Add config_distro support
> 
> Changes for v2:
>  - Fix double print_cpuinfo() call
>  - Fix CONFIG_BOOTCOMMAND typo
>  - Fix CONFIG_SYS_FSL_ESDHC_NUM to 1
> 
>  arch/arm/Kconfig |5 +
>  board/inversepath/usbarmory/Kconfig  |   15 +
>  board/inversepath/usbarmory/MAINTAINERS  |6 +
>  board/inversepath/usbarmory/Makefile |   10 +
>  board/inversepath/usbarmory/imximage.cfg |   82 ++
>  board/inversepath/usbarmory/usbarmory.c  |  439 
> ++
>  configs/usbarmory_defconfig  |3 +
>  include/configs/usbarmory.h  |  127 +
>  8 files changed, 687 insertions(+)
>  create mode 100644 board/inversepath/usbarmory/Kconfig
>  create mode 100644 board/inversepath/usbarmory/MAINTAINERS
>  create mode 100644 board/inversepath/usbarmory/Makefile
>  create mode 100644 board/inversepath/usbarmory/imximage.cfg
>  create mode 100644 board/inversepath/usbarmory/usbarmory.c
>  create mode 100644 configs/usbarmory_defconfig
>  create mode 100644 include/configs/usbarmory.h
> 
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index b9ebee1..a490084 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -462,6 +462,10 @@ config TARGET_MX53SMD
>   bool "Support mx53smd"
>   select CPU_V7
>  
> +config TARGET_USBARMORY
> + bool "Support USB armory"
> + select CPU_V7
> +

I recently merged Boris Brezillon's patches to move new boards outside
arm/Kconfig. Patches were related to MX6, but the same mechanism can be
reused for MX5/MX53. It should be better to have the same and bew boards
should not change arm/Kconfig. That generates conflicts by merging
different architecture.

Can you take a look at it and move USB armory to that approach ?


>  config TARGET_MX51_EFIKAMX
>   bool "Support mx51_efikamx"
>   select CPU_V7
> @@ -819,6 +823,7 @@ source "board/h2200/Kconfig"
>  source "board/hale/tt01/Kconfig"
>  source "board/icpdas/lp8x4x/Kconfig"
>  source "board/imx31_phycore/Kconfig"
> +source "board/inversepath/usbarmory/Kconfig"
>  source "board/isee/igep0033/Kconfig"
>  source "board/jornada/Kconfig"
>  source "board/karo/tx25/Kconfig"
> diff --git a/board/inversepath/usbarmory/Kconfig 
> b/board/inversepath/usbarmory/Kconfig
> new file mode 100644
> index 000..254b6c9
> --- /dev/null
> +++ b/board/inversepath/usbarmory/Kconfig
> @@ -0,0 +1,15 @@
> +if TARGET_USBARMORY
> +
> +config SYS_BOARD
> + default "usbarmory"
> +
> +config SYS_VENDOR
> + default "inversepath"
> +
> +config SYS_SOC
> + default "mx5"
> +
> +config SYS_CONFIG_NAME
> + default "usbarmory"
> +
> +endif
> diff --git a/board/inversepath/usbarmory/MAINTAINERS 
> b/board/inversepath/usbarmory/MAINTAINERS
> new file mode 100644
> index 000..71a3dd4
> --- /dev/null
> +++ b/board/inversepath/usbarmory/MAINTAINERS
> @@ -0,0 +1,6 @@
> +USBARMORY BOARD
> +M:   Andrej Rosano 
> +S:   Maintained
> +F:   board/inversepath/usbarmory/
> +F:   include/configs/usbarmory.h
> +F:   configs/usbarmory_defconfig
> diff --git a/board/inversepath/usbarmory/Makefile 
> b/board/inversepath/usbarmory/Makefile
> new file mode 100644
> index 000..9b8bd80
> --- /dev/null
> +++ b/board/inversepath/usbarmory/Makefile
> @@ -0,0 +1,10 @@
> +#
> +# USB armory MkI board Makefile
> +# http://inversepath.com/usbarmory
> +#
> +# Copyright (C) 2015, Inverse Path
> +# Andrej Rosano 
> +#
> +# SPDX-License-Identifier:|GPL-2.0+
> +
> +obj-y:= usbarmory.o
> diff --git a/board/inversepath/usbarmory/imximage.cfg 
> b/board/inversepath/usbarmory/imximage.cfg
> new file mode 100644
> index 000..392d2f9
> --- /dev/null
> +++ b/board/inversepath/usbarmory/imximage.cfg
> @@ -0,0 +1,82 @@
> +/*
> + * USB armory MkI board imximage configuration
> + * http://inversepath.com/usbarmory
> + *
> + * Copyright (C) 2015, Inverse Path
> + * Andrej Rosano 
> + *
> + * SPDX-License-Identifier:|GPL-2.0+
> + */
> +
> +IMAGE_VERSION 2
> +BOOT_FROM sd
> +
> +
> +/* IOMUX */
> +
> +DATA 4 0x53fa86f4 0x /* GRP_DDRMODE_CTL */
> +DATA 4 0x53fa8714 0x /* GRP_DDRMODE */
> +DATA 4 0x53fa86fc 0x /* GRP_DDRPKE  */
> +DATA 4 0x53fa8724 0x0400 /* GRP_DDR_TYPE*/
> +
> +DATA 4 0x53fa872c 0x0030 /* GRP_B3DS   */
> +DATA 4 0x53fa8554 0x0030 /* DRAM_DQM3  */
> +DATA 4 0x53fa8558 0x00300040 /* DRAM_SDQS3 */
> +
> +DATA 4 0x53fa8728 0x0030 /* GRP_B2DS   */
> +DATA 4 0x53fa8560 0x0030 /* DRAM_DQM2  */
> +DATA 4 0x53fa8568 0x00300040 /* DRAM_SDQS2 */
> +
> +DATA 4 0x53fa871c 0x0030 /* GRP_B1DS   */
> +DATA 4 0x53

Re: [U-Boot] [PATCH v3] arm: mx5: Add support for USB armory board

2015-03-25 Thread Vagrant Cascadian
On 2015-03-25, Stefano Babic wrote:
>> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
>> index b9ebee1..a490084 100644
>> --- a/arch/arm/Kconfig
>> +++ b/arch/arm/Kconfig
>> @@ -462,6 +462,10 @@ config TARGET_MX53SMD
>>  bool "Support mx53smd"
>>  select CPU_V7
>>  
>> +config TARGET_USBARMORY
>> +bool "Support USB armory"
>> +select CPU_V7
>> +
>
> I recently merged Boris Brezillon's patches to move new boards outside
> arm/Kconfig. Patches were related to MX6, but the same mechanism can be
> reused for MX5/MX53. It should be better to have the same and bew boards
> should not change arm/Kconfig. That generates conflicts by merging
> different architecture.
>
> Can you take a look at it and move USB armory to that approach ?

I've got an updated patch for this based on u-boot-imx; would you like a
separate patch for the mx5 changes, or should it be included as part of
the usbarmory series?


live well,
  vagrant


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3] arm: mx5: Add support for USB armory board

2015-03-25 Thread Andrej Rosano
Hi Stefano,

On Wed, Mar 25, 2015 at 09:48:36AM +0100, Stefano Babic wrote:
> Hi Andrej,
> 
> On 24/03/2015 14:26, and...@inversepath.com wrote:
> > From: Andrej Rosano 
> > 
> > Add support for Inverse Path USB armory board, an open source
> > flash-drive sized computer based on Freescale i.MX53 SoC.
> > 
> > http://inversepath.com/usbarmory
> > 
> > Signed-off-by: Andrej Rosano 
> > Cc: Stefano Babic 
> > Cc: Chris Kuethe 
> > Cc: Fabio Estevam 
> > Cc: Vagrant Cascadian 
> > ---
> > Changes for v3:
> >  - Add config_distro support
> > 
> > Changes for v2:
> >  - Fix double print_cpuinfo() call
> >  - Fix CONFIG_BOOTCOMMAND typo
> >  - Fix CONFIG_SYS_FSL_ESDHC_NUM to 1
> > 
> >  arch/arm/Kconfig |5 +
> >  board/inversepath/usbarmory/Kconfig  |   15 +
> >  board/inversepath/usbarmory/MAINTAINERS  |6 +
> >  board/inversepath/usbarmory/Makefile |   10 +
> >  board/inversepath/usbarmory/imximage.cfg |   82 ++
> >  board/inversepath/usbarmory/usbarmory.c  |  439 
> > ++
> >  configs/usbarmory_defconfig  |3 +
> >  include/configs/usbarmory.h  |  127 +
> >  8 files changed, 687 insertions(+)
> >  create mode 100644 board/inversepath/usbarmory/Kconfig
> >  create mode 100644 board/inversepath/usbarmory/MAINTAINERS
> >  create mode 100644 board/inversepath/usbarmory/Makefile
> >  create mode 100644 board/inversepath/usbarmory/imximage.cfg
> >  create mode 100644 board/inversepath/usbarmory/usbarmory.c
> >  create mode 100644 configs/usbarmory_defconfig
> >  create mode 100644 include/configs/usbarmory.h
> > 
> > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> > index b9ebee1..a490084 100644
> > --- a/arch/arm/Kconfig
> > +++ b/arch/arm/Kconfig
> > @@ -462,6 +462,10 @@ config TARGET_MX53SMD
> > bool "Support mx53smd"
> > select CPU_V7
> >  
> > +config TARGET_USBARMORY
> > +   bool "Support USB armory"
> > +   select CPU_V7
> > +
> 
> I recently merged Boris Brezillon's patches to move new boards outside
> arm/Kconfig. Patches were related to MX6, but the same mechanism can be
> reused for MX5/MX53. It should be better to have the same and bew boards
> should not change arm/Kconfig. That generates conflicts by merging
> different architecture.
> 
> Can you take a look at it and move USB armory to that approach ?

Sure.

> 
> 
> >  config TARGET_MX51_EFIKAMX
> > bool "Support mx51_efikamx"
> > select CPU_V7
> > @@ -819,6 +823,7 @@ source "board/h2200/Kconfig"
> >  source "board/hale/tt01/Kconfig"
> >  source "board/icpdas/lp8x4x/Kconfig"
> >  source "board/imx31_phycore/Kconfig"
> > +source "board/inversepath/usbarmory/Kconfig"
> >  source "board/isee/igep0033/Kconfig"
> >  source "board/jornada/Kconfig"
> >  source "board/karo/tx25/Kconfig"
> > diff --git a/board/inversepath/usbarmory/Kconfig 
> > b/board/inversepath/usbarmory/Kconfig
> > new file mode 100644
> > index 000..254b6c9
> > --- /dev/null
> > +++ b/board/inversepath/usbarmory/Kconfig
> > @@ -0,0 +1,15 @@
> > +if TARGET_USBARMORY
> > +
> > +config SYS_BOARD
> > +   default "usbarmory"
> > +
> > +config SYS_VENDOR
> > +   default "inversepath"
> > +
> > +config SYS_SOC
> > +   default "mx5"
> > +
> > +config SYS_CONFIG_NAME
> > +   default "usbarmory"
> > +
> > +endif
> > diff --git a/board/inversepath/usbarmory/MAINTAINERS 
> > b/board/inversepath/usbarmory/MAINTAINERS
> > new file mode 100644
> > index 000..71a3dd4
> > --- /dev/null
> > +++ b/board/inversepath/usbarmory/MAINTAINERS
> > @@ -0,0 +1,6 @@
> > +USBARMORY BOARD
> > +M: Andrej Rosano 
> > +S: Maintained
> > +F: board/inversepath/usbarmory/
> > +F: include/configs/usbarmory.h
> > +F: configs/usbarmory_defconfig
> > diff --git a/board/inversepath/usbarmory/Makefile 
> > b/board/inversepath/usbarmory/Makefile
> > new file mode 100644
> > index 000..9b8bd80
> > --- /dev/null
> > +++ b/board/inversepath/usbarmory/Makefile
> > @@ -0,0 +1,10 @@
> > +#
> > +# USB armory MkI board Makefile
> > +# http://inversepath.com/usbarmory
> > +#
> > +# Copyright (C) 2015, Inverse Path
> > +# Andrej Rosano 
> > +#
> > +# SPDX-License-Identifier:|GPL-2.0+
> > +
> > +obj-y  := usbarmory.o
> > diff --git a/board/inversepath/usbarmory/imximage.cfg 
> > b/board/inversepath/usbarmory/imximage.cfg
> > new file mode 100644
> > index 000..392d2f9
> > --- /dev/null
> > +++ b/board/inversepath/usbarmory/imximage.cfg
> > @@ -0,0 +1,82 @@
> > +/*
> > + * USB armory MkI board imximage configuration
> > + * http://inversepath.com/usbarmory
> > + *
> > + * Copyright (C) 2015, Inverse Path
> > + * Andrej Rosano 
> > + *
> > + * SPDX-License-Identifier:|GPL-2.0+
> > + */
> > +
> > +IMAGE_VERSION 2
> > +BOOT_FROM sd
> > +
> > +
> > +/* IOMUX */
> > +
> > +DATA 4 0x53fa86f4 0x /* GRP_DDRMODE_CTL */
> > +DATA 4 0x53fa8714 0x /* GRP_DDRMODE */
> > +DATA 4 0x53fa86fc 0x /* GRP_DDRPKE  */
> > +DATA 4 0x53fa8724 0x0400 /* GRP_DDR_TYPE*/
> > +
> >

Re: [U-Boot] [PATCH v3] arm: mx5: Add support for USB armory board

2015-03-26 Thread Stefano Babic
On 25/03/2015 21:24, Vagrant Cascadian wrote:
> On 2015-03-25, Stefano Babic wrote:
>>> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
>>> index b9ebee1..a490084 100644
>>> --- a/arch/arm/Kconfig
>>> +++ b/arch/arm/Kconfig
>>> @@ -462,6 +462,10 @@ config TARGET_MX53SMD
>>> bool "Support mx53smd"
>>> select CPU_V7
>>>  
>>> +config TARGET_USBARMORY
>>> +   bool "Support USB armory"
>>> +   select CPU_V7
>>> +
>>
>> I recently merged Boris Brezillon's patches to move new boards outside
>> arm/Kconfig. Patches were related to MX6, but the same mechanism can be
>> reused for MX5/MX53. It should be better to have the same and bew boards
>> should not change arm/Kconfig. That generates conflicts by merging
>> different architecture.
>>
>> Can you take a look at it and move USB armory to that approach ?
> 
> I've got an updated patch for this based on u-boot-imx; would you like a
> separate patch for the mx5 changes, or should it be included as part of
> the usbarmory series?

It is ok for me if the patch is part of the series. Simply do not mix
issues. I am expecting a patch as "mx5: move to a standard arch/board"
and then a patch (or several, as you prefer) for USB armory.

Best regards,
Stefano


-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot