[PATCH] usbarmory: Add DM_I2C and DM_SERIAL support

2023-09-21 Thread Andrej Rosano
From: Andrej Rosano 

Use DM_I2C and DM_SERIAL as it is now mandatory.

Signed-off-by: Andrej Rosano 
---
 configs/usbarmory_defconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/configs/usbarmory_defconfig b/configs/usbarmory_defconfig
index 66c969f95e..277f055aef 100644
--- a/configs/usbarmory_defconfig
+++ b/configs/usbarmory_defconfig
@@ -29,7 +29,7 @@ CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_USE_HOSTNAME=y
 CONFIG_HOSTNAME="usbarmory"
-CONFIG_SYS_I2C_LEGACY=y
+CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_MXC=y
 CONFIG_FSL_IIM=y
 CONFIG_FSL_ESDHC_IMX=y
@@ -39,6 +39,7 @@ CONFIG_PINCTRL_IMX5=y
 CONFIG_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_DM_REGULATOR_GPIO=y
+CONFIG_DM_SERIAL=y
 CONFIG_MXC_UART=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_MX5=y
-- 
2.42.0


[PATCH 2/2] imx53: usbarmory: Use ethernet driver model

2021-08-17 Thread andrej . rosano
From: Andrej Rosano 

Enable ethernet driver model as it is mandatory.

Signed-off-by: Andrej Rosano 
---
 configs/usbarmory_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/usbarmory_defconfig b/configs/usbarmory_defconfig
index 91eb3a4965..ea76068bbb 100644
--- a/configs/usbarmory_defconfig
+++ b/configs/usbarmory_defconfig
@@ -34,3 +34,4 @@ CONFIG_MXC_UART=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_EHCI_MX5=y
+CONFIG_DM_ETH=y
-- 
2.32.0



[PATCH 1/2] imx53: usbarmory: Add card detect configuration

2021-08-17 Thread andrej . rosano
From: Andrej Rosano 

After the enforcement of DM_MMC the microSD card is not detected. Fix by
correctly configuring the card detect in the devicetree.

Signed-off-by: Andrej Rosano 
---
 arch/arm/dts/imx53-usbarmory.dts | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/dts/imx53-usbarmory.dts b/arch/arm/dts/imx53-usbarmory.dts
index f34993a490..433b62e736 100644
--- a/arch/arm/dts/imx53-usbarmory.dts
+++ b/arch/arm/dts/imx53-usbarmory.dts
@@ -91,6 +91,7 @@
 &esdhc1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_esdhc1>;
+   broken-cd;
status = "okay";
 };
 
-- 
2.32.0



[PATCH] ARM: mx6: add support for USB armory Mk II board

2020-10-21 Thread andrej . rosano
From: Andrej Rosano 

Add support for F-Secure USB armory Mk II board, an open source
flash-drive sized computer based on Freescale i.MX6UL SoC.

http://inversepath.com/usbarmory

Signed-off-by: Andrej Rosano 
Cc: Stefano Babic 
---
 arch/arm/dts/Makefile |   1 +
 arch/arm/dts/imx6ull-usbarmory.dts| 200 ++
 arch/arm/mach-imx/mx6/Kconfig |   5 +
 board/inversepath/usbarmory-mark-two/Kconfig  |  71 
 .../usbarmory-mark-two/MAINTAINERS|   6 +
 board/inversepath/usbarmory-mark-two/Makefile |  10 +
 .../usbarmory-mark-two/imximage-1gb.cfg   |  87 +
 .../usbarmory-mark-two/imximage-512mb.cfg |  89 +
 .../usbarmory-mark-two/usbarmory-mark-two.c   | 347 ++
 configs/usbarmory-mark-two_defconfig  |  72 
 include/configs/usbarmory-mark-two.h  | 234 
 11 files changed, 1122 insertions(+)
 create mode 100644 arch/arm/dts/imx6ull-usbarmory.dts
 create mode 100644 board/inversepath/usbarmory-mark-two/Kconfig
 create mode 100644 board/inversepath/usbarmory-mark-two/MAINTAINERS
 create mode 100644 board/inversepath/usbarmory-mark-two/Makefile
 create mode 100644 board/inversepath/usbarmory-mark-two/imximage-1gb.cfg
 create mode 100644 board/inversepath/usbarmory-mark-two/imximage-512mb.cfg
 create mode 100644 board/inversepath/usbarmory-mark-two/usbarmory-mark-two.c
 create mode 100644 configs/usbarmory-mark-two_defconfig
 create mode 100644 include/configs/usbarmory-mark-two.h

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index b195723f16..d17c14c9bb 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -731,6 +731,7 @@ dtb-$(CONFIG_MX6ULL) += \
imx6ull-myir-mys-6ulx-eval.dtb \
imx6ull-phytec-segin-ff-rdk-emmc.dtb \
imx6ull-dart-6ul.dtb \
+   imx6ull-usbarmory.dtb \
imx6ull-somlabs-visionsom.dtb \
imx6ulz-14x14-evk.dtb
 
diff --git a/arch/arm/dts/imx6ull-usbarmory.dts 
b/arch/arm/dts/imx6ull-usbarmory.dts
new file mode 100644
index 00..d5a616f703
--- /dev/null
+++ b/arch/arm/dts/imx6ull-usbarmory.dts
@@ -0,0 +1,200 @@
+/*
+ * USB armory Mk II device tree file
+ * https://github.com/inversepath/usbarmory
+ *
+ * Copyright (C) 2019, F-Secure Corporation
+ * Andrej Rosano 
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This file is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+
+#include "imx6ull.dtsi"
+
+/ {
+   model = "F-Secure USB armory Mk II";
+   compatible = "inversepath,imx6ull-usbarmory-mkII", "fsl,imx6ull";
+
+   chosen {
+   stdout-path = &uart2;
+   };
+
+   memory {
+   reg = <0x8000 0x2000>;
+   };
+
+   leds {
+   compatible = "gpio-leds";
+   pinctrl-names = "default";
+   pinctrl-0 = <&pinctrl_led>;
+
+   led-white {
+   label = "LED_WHITE";
+   gpios = <&gpio4 21 GPIO_ACTIVE_LOW>;
+   

Re: [U-Boot] [PATCH 2/2] usbarmory: Add board_run_command() function

2016-06-20 Thread Andrej Rosano
Hi Stefano,

On Mon, Jun 20, 2016 at 05:46:52PM +0200, Stefano Babic wrote:
> Hallo Andrej,
> 
> On 20/06/2016 17:21, and...@inversepath.com wrote:
> > From: Andrej Rosano 
> > 
> > Define a default board_run_command() function. This function contains
> > the commands needed to boot the board when CLI is disabled 
> > (CONFIG_CMDLINE=n).
> > 
> > Signed-off-by: Andrej Rosano 
> > ---
> >  board/inversepath/usbarmory/usbarmory.c | 31 
> > +++
> >  include/configs/usbarmory.h | 11 +++
> >  2 files changed, 38 insertions(+), 4 deletions(-)
> > 
> > diff --git a/board/inversepath/usbarmory/usbarmory.c 
> > b/board/inversepath/usbarmory/usbarmory.c
> > index a809039..a11e3b3 100644
> > --- a/board/inversepath/usbarmory/usbarmory.c
> > +++ b/board/inversepath/usbarmory/usbarmory.c
> > @@ -415,3 +415,34 @@ int checkboard(void)
> > puts("Board: Inverse Path USB armory MkI\n");
> > return 0;
> >  }
> > +
> > +#ifndef CONFIG_CMDLINE
> > +static char *ext2_argv[] = {
> > +   "ext2load",
> > +   "mmc",
> > +   "0:1",
> > +   USBARMORY_FIT_ADDR,
> > +   USBARMORY_FIT_PATH
> > +};
> > +
> > +static char *bootm_argv[] = {
> > +   "bootm",
> > +   USBARMORY_FIT_ADDR
> > +};
> > +
> > +int board_run_command(const char *cmdline)
> > +{
> > +   printf("%s %s %s %s %s\n", ext2_argv[0], ext2_argv[1], ext2_argv[2],
> > +  ext2_argv[3], ext2_argv[4]);
> > +
> > +   if (do_ext2load(NULL, 0, 5, ext2_argv) != 0) {
> > +   udelay(5*1000*1000);
> > +   return 1;
> > +   }
> > +
> > +   printf("%s %s\n", bootm_argv[0], bootm_argv[1]);
> > +   do_bootm(NULL, 0, 2, bootm_argv);
> > +
> > +   return 1;
> > +}
> 
> I ten to NACK this. You can do exactly the same with a U-Boot script,
> and if you want to have this as default, you can change your default
> environment. This is just a wrapper around the hush shell.

The intention of the patch is to boot the kernel while having the CLI disabled
(CONFIG_CMDLINE=n). The U-Boot script needs the CLI to be enabled AFAIK.

It is better having the CLI disabled when using the Verified Boot, otherwise
there are chances to bypass the FIT image verification (e.g. using md/mw
commands in case are available):

https://github.com/inversepath/usbarmory/blob/master/software/secure_boot/u-boot-2016.05_patches/0003-Disable-CLI.patch

Andrej

> 
> 
> > +#endif
> > diff --git a/include/configs/usbarmory.h b/include/configs/usbarmory.h
> > index c0e093f..5484204 100644
> > --- a/include/configs/usbarmory.h
> > +++ b/include/configs/usbarmory.h
> > @@ -17,16 +17,13 @@
> >  #define CONFIG_SYS_FSL_CLK
> >  #define CONFIG_BOARD_EARLY_INIT_F
> >  #define CONFIG_MXC_GPIO
> > +#define CONFIG_SYS_NO_FLASH
> >  
> >  #include 
> >  
> >  #include 
> >  
> > -/* U-Boot commands */
> > -
> >  /* U-Boot environment */
> > -#define CONFIG_ENV_OVERWRITE
> > -#define CONFIG_SYS_NO_FLASH
> >  #define CONFIG_ENV_OFFSET  (6 * 64 * 1024)
> >  #define CONFIG_ENV_SIZE(8 * 1024)
> >  #define CONFIG_ENV_IS_IN_MMC
> > @@ -101,6 +98,12 @@
> > "console=ttymxc0,115200\0"  \
> > BOOTENV
> >  
> > +#ifndef CONFIG_CMDLINE
> > +#define CONFIG_BOOTARGS "console=ttymxc0,115200 root=/dev/mmcblk0p1 
> > rootwait rw"
> > +#define USBARMORY_FIT_PATH "/boot/usbarmory.itb"
> > +#define USBARMORY_FIT_ADDR "0x7080"
> > +#endif
> > +
> >  /* Physical Memory Map */
> >  #define CONFIG_NR_DRAM_BANKS   1
> >  #define PHYS_SDRAM CSD0_BASE_ADDR
> > 
> 
> Best regards,
> Stefano Babic
> 
> -- 
> =
> 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
> =

--
Andrej Rosano   Inverse Path Srl
  http://www.inversepath.com

0x01939B215BB8 574E 68E8 D841 E18F  D5E9 CEAD E0CF 0193 9B21
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 0/2] ARM: mx5: add support for USB armory board

2015-04-08 Thread Andrej Rosano
Hi Stefano,

On Wed, Apr 08, 2015 at 10:53:02AM +0200, Stefano Babic wrote:
> On 01/04/2015 13:32, Stefano Babic wrote:
> > Hi Chris,
> > 
> > On 01/04/2015 04:46, Chris Kuethe wrote:
> >> Any chance of this being accepted into 2015.04?
> >>
> > 
> 
> checpatch reports some issues by patch 2/2. Can you please fix them and
> resubmit ? Thanks !

Just resubmitted the v5 version.

Thanks,
Andrej

> 
> Best regards,
> Stefano Babic
> 
> 
> -- 
> =
> 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

--
Andrej Rosano   Inverse Path Srl
  http://www.inversepath.com

0x01939B215BB8 574E 68E8 D841 E18F  D5E9 CEAD E0CF 0193 9B21
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 0/2] ARM: mx5: add support for USB armory board

2015-03-26 Thread Andrej Rosano
Hi Chris,

On Thu, Mar 26, 2015 at 02:53:58PM -0700, Chris Kuethe wrote:
> On Thu, Mar 26, 2015 at 4:49 AM,   wrote:
> > From: Andrej Rosano 
> >
> > Hello,
> >
> > this series adds support for USB armory board. The patches are
> > prepared against imx tree as it uses the new arch/board approach.
> >
> > The first patch add introduces the arch/board approach for mx5,
> > as already done for mx6.
> 
> Yep, that works.
> 
> > The second patch adds basic support for USB armory board and
> > is an updated version (v4) with the modifications described bellow.
> 
> If I test this against HEAD as of
> f643d9294f45487f22e8f33d6572530f17eff4e9, I get an error reated to
> IMX_CONFIG.

Please note that the patch is prepared against imx tree and not the
mainline one, where the "arch/board approach" is not yet merged.

Cheers,
Andrej

> 
> "board/inversepath/usbarmory/Kconfig:3:warning: config symbol defined
> without type"
> 
> Here's a diff to fix that
> 
> diff --git a/board/inversepath/usbarmory/Kconfig
> b/board/inversepath/usbarmory/Kconfig
> index c2cd544..4776b1d 100644
> --- a/board/inversepath/usbarmory/Kconfig
> +++ b/board/inversepath/usbarmory/Kconfig
> @@ -1,8 +1,5 @@
>  if TARGET_USBARMORY
> 
> -config IMX_CONFIG
> -default "board/inversepath/usbarmory/imximage.cfg"
> -
>  config SYS_BOARD
>  default "usbarmory"
> 
> diff --git a/configs/usbarmory_defconfig b/configs/usbarmory_defconfig
> index 10bdd9e..237b1ca 100644
> --- a/configs/usbarmory_defconfig
> +++ b/configs/usbarmory_defconfig
> @@ -1,3 +1,4 @@
>  CONFIG_ARM=y
>  CONFIG_ARCH_MX5=y
>  CONFIG_TARGET_USBARMORY=y
> +CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/inversepath/usbarmory/imximage.cfg"
> 
> 
> > Changes for v4:
> >  - Remove ifdef for CONFIG_FSL_ESDHC as it must always be present
> >  - Remove explicit GPIO input setup (all GPIO are input after reset)
> >  - Remove dummy board_late_init() and CONFIG_BOARD_LATE_INIT
> >  - Remove CONFIG_BOOTARGS
> >  - Fix compiling errors due to config_distro_bootcmd.h inclusion position
> 
> Tested-by: Chris Kuethe 
> 
> > 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
> >
> > Andrej Rosano (2):
> >   ARM: mx5: move to a standard arch/board approach
> >   ARM: mx5: add support for USB armory board
> >
> >
> > Andrej Rosano (2):
> >   ARM: mx5: move to a standard arch/board approach
> >   ARM: mx5: add support for USB armory board
> 
> 
> 
> -- 
> GDB has a 'break' feature; why doesn't it have 'fix' too?

--
Andrej Rosano   Inverse Path Srl
  http://www.inversepath.com

0x01939B215BB8 574E 68E8 D841 E18F  D5E9 CEAD E0CF 0193 9B21
___
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 
> > +#
>

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

2015-03-24 Thread Andrej Rosano
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, 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.
> ...
> >> 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 
>  #include 
> +#include 
>  
>  /* 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_CBSIZE512
>  #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  0x7200
>  #define CONFIG_SYS_TEXT_BASE 0x7780
>  #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 0x7080 /boot/uImage; ext2load mmc 0:1" \
> - "0x7100 /boot/imx53-usbarmory.dtb; bootm 0x7080 - 0x7100"
> + "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 
> +
> +#define MEM_LAYOUT_ENV_SETTINGS \
> + "kernel_addr_r=0x7080\0" \
> + "fdt_addr_r=0x7100\0" \
> + "scriptaddr=0x7080\0" \
> + "pxefile_addr_r=0x7080\0" \
> + "ramdisk_addr_r=0x7300\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
  http://www.inversepath.com

0x01939B215BB8 574E 68E8 D841 E18F  D5E9 CEAD E0CF 0193 9B21
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


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

2015-03-19 Thread Andrej Rosano
Hi Vagrant,

On Thu, Mar 19, 2015 at 09:55:26AM -0700, Vagrant Cascadian wrote:
> On 2015-02-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.
> ...
> > diff --git a/include/configs/usbarmory.h b/include/configs/usbarmory.h
> > new file mode 100644
> > index 000..e00ec7b
> > --- /dev/null
> > +++ b/include/configs/usbarmory.h
> ...
> > +#include 
> > +#include 
> 
> 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.
> 
> I'd like to enable the usbarmory target in Debian's u-boot packages, and
> this would make it easier for it to behave more-or-less consistantly
> with several other platforms, and allow for more flexibility when
> booting.

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.

Thanks

Andrej

> 
> 
> live well,
>   vagrant



--
Andrej Rosano   Inverse Path Srl
  http://www.inversepath.com

0x01939B215BB8 574E 68E8 D841 E18F  D5E9 CEAD E0CF 0193 9B21
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


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

2015-03-18 Thread Andrej Rosano
On Tue, Mar 17, 2015 at 01:30:12PM -0300, Fabio Estevam wrote:
> On Mon, Mar 16, 2015 at 1:50 PM, Chris Kuethe  wrote:
> 
> > U-Boot 2015.04-rc3-00209-ga74ef40-dirty (Mar 15 2015 - 22:04:22)
> >
> > CPU:   Freescale i.MX53 rev2.1 at 800 MHz
> > Reset cause: WDOG
> 
> Here the reset cause is printed correctly.
> 
> > Board: Inverse Path USB armory MkI
> > I2C:   ready
> > DRAM:  512 MiB
> > MMC:   FSL_SDHC: 0
> > In:serial
> > Out:   serial
> > Err:   serial
> > CPU:   Freescale i.MX53 rev2.1 at 800 MHz
> > Reset cause: unknown reset
> 
> ,but here it fails.
> 
> Why does CPU version and reset cause are printed twice?

The print_cpuinfo() was called twice, fixed in the v2 patch
I just submitted.

> 
> Is this happening with all mx53 boards or only with this one?

mx53loco should have the same issue, but I did not tested it.

Andrej

> 
> I currently don't have access to any mx53 board to test this myself.
> 
> I am adding some folks on Cc who may have access to other mx53 boards
> and could probably test whether we have a common mx53 issue here.
> 
> Regards,
> 
> Fabio Estevam

--
Andrej Rosano   Inverse Path Srl
  http://www.inversepath.com

0x01939B215BB8 574E 68E8 D841 E18F  D5E9 CEAD E0CF 0193 9B21
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot