Re: [PATCH v2] ARM: dts: rockchip: temporarily remove emmc hs200 speed from rk3288-veyron-speedy.

2016-10-18 Thread Vagrant Cascadian
On 2016-10-18, Paul Kocialkowski wrote:
> Le mardi 18 octobre 2016 à 11:21 +0200, Heiko Stübner a écrit :
>> Am Sonntag, 16. Oktober 2016, 21:49:43 schrieb Paul Kocialkowski:
>> > Le mardi 27 septembre 2016 à 13:53 -0700, Vagrant Cascadian a écrit :
>> > > 
>> > > This essentially mimics what was done with rk3288-veyron-minnie in
>> > > commit 984926781122f034d5bc9962815d135b6c4a8e1d.
>> > > 
>> > > The eMMC of the speedy Chromebook also appears to need the same tuning
>> > > workaround, as it frequently fails to recognize the eMMC without it.
>> > 
>> > I have a device where (without this patch) eMMC sometimes fails, with:
>> > [3.561010] dwmmc_rockchip ff0f.dwmmc: Successfully tuned phase to
>> > 175 [3.571742] mmc2: new HS200 MMC card at address 0001
>> > [3.571943] mmcblk2: mmc2:0001 HAG2e 14.7 GiB 
>> > [3.572026] mmcblk2boot0: mmc2:0001 HAG2e partition 1 4.00 MiB
>> > [3.572107] mmcblk2boot1: mmc2:0001 HAG2e partition 2 4.00 MiB
>> > [3.572181] mmcblk2rpmb: mmc2:0001 HAG2e partition 3 4.00 MiB
>> > [3.685647] mmcblk2: error -110 transferring data, sector 0, nr 8, cmd
>> > response 0x900, card status 0x0

>> > And sometimes works, with:
>> > [3.451058] dwmmc_rockchip ff0f.dwmmc: Successfully tuned phase to
>> > 176 [3.491093] mmc2: new HS200 MMC card at address 0001
>> > [3.491277] mmcblk2: mmc2:0001 HAG2e 14.7 GiB 
>> > [3.491345] mmcblk2boot0: mmc2:0001 HAG2e partition 1 4.00 MiB
>> > [3.491409] mmcblk2boot1: mmc2:0001 HAG2e partition 2 4.00 MiB
>> > [3.491474] mmcblk2rpmb: mmc2:0001 HAG2e partition 3 4.00 MiB
>> > [3.493548]  mmcblk2: p1 p2

This is similar behavior to my veyron-speedy. Here are several boot logs
From running 4.8.0-rc7, with some failures and some successes:

  https://cascadia.aikidev.net/~vagrant/veyron-speedy/


>> > However, with this change, it always fails, with:
>> > [3.322129] mmc_host mmc2: Bus speed (slot 0) = 5000Hz (slot req
>> > 5200Hz, actual 5000HZ div = 0) [3.333174] mmc2: error -110
>> > whilst initialising MMC card
>> > 
>> > I don't have so much time to investigate this issue, but it's clear that
>> > this patch doesn't fix the issue (and actually worsens it) for my device.

Well, that makes things more complicated.


>> As discussed on IRC we now have varying reports of the emmc working or not 
>> working with and without that patch applied. So it's not really a bandaid 
>> fix 
>> and I've thus dropped this patch again.
>
> Thanks for dropping it! For the record, my eMMC shows up as:
> mmcblk2: mmc2:0001 HAG2e 14.7 GiB

Mine looks similar, although reporting as mmc0:

  [3.166550] mmcblk0: mmc0:0001 HAG2e 14.7 GiB


> Maybe it could help to share what each tested device reports as eMMC model and
> associate that with the current behavior, in spite of getting a clearer idea 
> of
> what issue affects what model.

FWIW, I'm using a veyron-speedy with 4GB of ram, not sure what other
information might be useful to distinguish between different models.

On the bottom of the case, it claims to be a C201P. Near the serial,
it's marked as C201PA-DS02-LG.


live well,
  vagrant


signature.asc
Description: PGP signature


Re: [PATCH v2] ARM: dts: rockchip: temporarily remove emmc hs200 speed from rk3288-veyron-speedy.

2016-10-18 Thread Vagrant Cascadian
On 2016-10-18, Paul Kocialkowski wrote:
> Le mardi 18 octobre 2016 à 11:21 +0200, Heiko Stübner a écrit :
>> Am Sonntag, 16. Oktober 2016, 21:49:43 schrieb Paul Kocialkowski:
>> > Le mardi 27 septembre 2016 à 13:53 -0700, Vagrant Cascadian a écrit :
>> > > 
>> > > This essentially mimics what was done with rk3288-veyron-minnie in
>> > > commit 984926781122f034d5bc9962815d135b6c4a8e1d.
>> > > 
>> > > The eMMC of the speedy Chromebook also appears to need the same tuning
>> > > workaround, as it frequently fails to recognize the eMMC without it.
>> > 
>> > I have a device where (without this patch) eMMC sometimes fails, with:
>> > [3.561010] dwmmc_rockchip ff0f.dwmmc: Successfully tuned phase to
>> > 175 [3.571742] mmc2: new HS200 MMC card at address 0001
>> > [3.571943] mmcblk2: mmc2:0001 HAG2e 14.7 GiB 
>> > [3.572026] mmcblk2boot0: mmc2:0001 HAG2e partition 1 4.00 MiB
>> > [3.572107] mmcblk2boot1: mmc2:0001 HAG2e partition 2 4.00 MiB
>> > [3.572181] mmcblk2rpmb: mmc2:0001 HAG2e partition 3 4.00 MiB
>> > [3.685647] mmcblk2: error -110 transferring data, sector 0, nr 8, cmd
>> > response 0x900, card status 0x0

>> > And sometimes works, with:
>> > [3.451058] dwmmc_rockchip ff0f.dwmmc: Successfully tuned phase to
>> > 176 [3.491093] mmc2: new HS200 MMC card at address 0001
>> > [3.491277] mmcblk2: mmc2:0001 HAG2e 14.7 GiB 
>> > [3.491345] mmcblk2boot0: mmc2:0001 HAG2e partition 1 4.00 MiB
>> > [3.491409] mmcblk2boot1: mmc2:0001 HAG2e partition 2 4.00 MiB
>> > [3.491474] mmcblk2rpmb: mmc2:0001 HAG2e partition 3 4.00 MiB
>> > [3.493548]  mmcblk2: p1 p2

This is similar behavior to my veyron-speedy. Here are several boot logs
From running 4.8.0-rc7, with some failures and some successes:

  https://cascadia.aikidev.net/~vagrant/veyron-speedy/


>> > However, with this change, it always fails, with:
>> > [3.322129] mmc_host mmc2: Bus speed (slot 0) = 5000Hz (slot req
>> > 5200Hz, actual 5000HZ div = 0) [3.333174] mmc2: error -110
>> > whilst initialising MMC card
>> > 
>> > I don't have so much time to investigate this issue, but it's clear that
>> > this patch doesn't fix the issue (and actually worsens it) for my device.

Well, that makes things more complicated.


>> As discussed on IRC we now have varying reports of the emmc working or not 
>> working with and without that patch applied. So it's not really a bandaid 
>> fix 
>> and I've thus dropped this patch again.
>
> Thanks for dropping it! For the record, my eMMC shows up as:
> mmcblk2: mmc2:0001 HAG2e 14.7 GiB

Mine looks similar, although reporting as mmc0:

  [3.166550] mmcblk0: mmc0:0001 HAG2e 14.7 GiB


> Maybe it could help to share what each tested device reports as eMMC model and
> associate that with the current behavior, in spite of getting a clearer idea 
> of
> what issue affects what model.

FWIW, I'm using a veyron-speedy with 4GB of ram, not sure what other
information might be useful to distinguish between different models.

On the bottom of the case, it claims to be a C201P. Near the serial,
it's marked as C201PA-DS02-LG.


live well,
  vagrant


signature.asc
Description: PGP signature


[PATCH v2] ARM: dts: rockchip: temporarily remove emmc hs200 speed from rk3288-veyron-speedy.

2016-09-27 Thread Vagrant Cascadian
This essentially mimics what was done with rk3288-veyron-minnie in
commit 984926781122f034d5bc9962815d135b6c4a8e1d.

The eMMC of the speedy Chromebook also appears to need the same tuning
workaround, as it frequently fails to recognize the eMMC without it.

Signed-off-by: Vagrant Cascadian <vagra...@aikidev.net>
---
Changes in v2:
 - Added Signed-off-by.

 arch/arm/boot/dts/rk3288-veyron-speedy.dts | 5 +
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/boot/dts/rk3288-veyron-speedy.dts 
b/arch/arm/boot/dts/rk3288-veyron-speedy.dts
index a0d033f..500fd18 100644
--- a/arch/arm/boot/dts/rk3288-veyron-speedy.dts
+++ b/arch/arm/boot/dts/rk3288-veyron-speedy.dts
@@ -124,6 +124,11 @@
_bus4>;
 };

+
+ {
+   /delete-property/mmc-hs200-1_8v;
+};
+
 _5v {
enable-active-high;
gpio = < 21 GPIO_ACTIVE_HIGH>;
-- 
2.9.3


signature.asc
Description: PGP signature


[PATCH v2] ARM: dts: rockchip: temporarily remove emmc hs200 speed from rk3288-veyron-speedy.

2016-09-27 Thread Vagrant Cascadian
This essentially mimics what was done with rk3288-veyron-minnie in
commit 984926781122f034d5bc9962815d135b6c4a8e1d.

The eMMC of the speedy Chromebook also appears to need the same tuning
workaround, as it frequently fails to recognize the eMMC without it.

Signed-off-by: Vagrant Cascadian 
---
Changes in v2:
 - Added Signed-off-by.

 arch/arm/boot/dts/rk3288-veyron-speedy.dts | 5 +
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/boot/dts/rk3288-veyron-speedy.dts 
b/arch/arm/boot/dts/rk3288-veyron-speedy.dts
index a0d033f..500fd18 100644
--- a/arch/arm/boot/dts/rk3288-veyron-speedy.dts
+++ b/arch/arm/boot/dts/rk3288-veyron-speedy.dts
@@ -124,6 +124,11 @@
_bus4>;
 };

+
+ {
+   /delete-property/mmc-hs200-1_8v;
+};
+
 _5v {
enable-active-high;
gpio = < 21 GPIO_ACTIVE_HIGH>;
-- 
2.9.3


signature.asc
Description: PGP signature


Re: [PATCH v3 2/2] ARM: dts: imx53: add support for USB armory board

2016-09-05 Thread Vagrant Cascadian
On 2016-09-05, and...@inversepath.com wrote:
> From: Andrej Rosano <and...@inversepath.com>
>
> Add support for Inverse Path USB armory board, an open source
> flash-drive sized computer based on NXP i.MX53 SoC.
>
> https://inversepath.com/usbarmory
>
> Signed-off-by: Andrej Rosano <and...@inversepath.com>

Boots with v4.8-rc5, USB OTG works, serial console works.

Tested-by: Vagrant Cascadian <vagr...@debian.org>

live well,
  vagrant

> ---
>  arch/arm/boot/dts/Makefile|   1 +
>  arch/arm/boot/dts/imx53-usbarmory.dts | 224 
> ++
>  2 files changed, 225 insertions(+)
>  create mode 100644 arch/arm/boot/dts/imx53-usbarmory.dts
>
> diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
> index faacd52..20790b8 100644
> --- a/arch/arm/boot/dts/Makefile
> +++ b/arch/arm/boot/dts/Makefile
> @@ -315,6 +315,7 @@ dtb-$(CONFIG_SOC_IMX53) += \
>   imx53-smd.dtb \
>   imx53-tx53-x03x.dtb \
>   imx53-tx53-x13x.dtb \
> + imx53-usbarmory.dtb \
>   imx53-voipac-bsb.dtb
>  dtb-$(CONFIG_SOC_IMX6Q) += \
>   imx6dl-apf6dev.dtb \
> diff --git a/arch/arm/boot/dts/imx53-usbarmory.dts 
> b/arch/arm/boot/dts/imx53-usbarmory.dts
> new file mode 100644
> index 000..6782d7f
> --- /dev/null
> +++ b/arch/arm/boot/dts/imx53-usbarmory.dts
> @@ -0,0 +1,224 @@
> +/*
> + * USB armory MkI device tree file
> + * https://inversepath.com/usbarmory
> + *
> + * Copyright (C) 2015, Inverse Path
> + * Andrej Rosano <and...@inversepath.com>
> + *
> + * 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 "imx53.dtsi"
> +
> +/ {
> + model = "Inverse Path USB armory";
> + compatible = "inversepath,imx53-usbarmory", "fsl,imx53";
> +};
> +
> +/ {
> + chosen {
> + stdout-path = 
> + };
> +
> + memory {
> + reg = <0x7000 0x2000>;
> + };
> +
> + leds {
> + compatible = "gpio-leds";
> + pinctrl-names = "default";
> + pinctrl-0 = <_led>;
> +
> + user {
> + label = "LED";
> + gpios = < 27 GPIO_ACTIVE_LOW>;
> + linux,default-trigger = "heartbeat";
> + };
> + };
> +};
> +
> +/*
> + * Not every i.MX53 P/N supports clock > 800MHz.
> + * As USB armory does not mount a specific P/N set a safe clock upper limit.
> + */
> + {
> + operating-points = <
> + /* kHz */
&g

Re: [PATCH v3 2/2] ARM: dts: imx53: add support for USB armory board

2016-09-05 Thread Vagrant Cascadian
On 2016-09-05, and...@inversepath.com wrote:
> From: Andrej Rosano 
>
> Add support for Inverse Path USB armory board, an open source
> flash-drive sized computer based on NXP i.MX53 SoC.
>
> https://inversepath.com/usbarmory
>
> Signed-off-by: Andrej Rosano 

Boots with v4.8-rc5, USB OTG works, serial console works.

Tested-by: Vagrant Cascadian 

live well,
  vagrant

> ---
>  arch/arm/boot/dts/Makefile|   1 +
>  arch/arm/boot/dts/imx53-usbarmory.dts | 224 
> ++
>  2 files changed, 225 insertions(+)
>  create mode 100644 arch/arm/boot/dts/imx53-usbarmory.dts
>
> diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
> index faacd52..20790b8 100644
> --- a/arch/arm/boot/dts/Makefile
> +++ b/arch/arm/boot/dts/Makefile
> @@ -315,6 +315,7 @@ dtb-$(CONFIG_SOC_IMX53) += \
>   imx53-smd.dtb \
>   imx53-tx53-x03x.dtb \
>   imx53-tx53-x13x.dtb \
> + imx53-usbarmory.dtb \
>   imx53-voipac-bsb.dtb
>  dtb-$(CONFIG_SOC_IMX6Q) += \
>   imx6dl-apf6dev.dtb \
> diff --git a/arch/arm/boot/dts/imx53-usbarmory.dts 
> b/arch/arm/boot/dts/imx53-usbarmory.dts
> new file mode 100644
> index 000..6782d7f
> --- /dev/null
> +++ b/arch/arm/boot/dts/imx53-usbarmory.dts
> @@ -0,0 +1,224 @@
> +/*
> + * USB armory MkI device tree file
> + * https://inversepath.com/usbarmory
> + *
> + * Copyright (C) 2015, Inverse Path
> + * 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 "imx53.dtsi"
> +
> +/ {
> + model = "Inverse Path USB armory";
> + compatible = "inversepath,imx53-usbarmory", "fsl,imx53";
> +};
> +
> +/ {
> + chosen {
> + stdout-path = 
> + };
> +
> + memory {
> + reg = <0x7000 0x2000>;
> + };
> +
> + leds {
> + compatible = "gpio-leds";
> + pinctrl-names = "default";
> + pinctrl-0 = <_led>;
> +
> + user {
> + label = "LED";
> + gpios = < 27 GPIO_ACTIVE_LOW>;
> + linux,default-trigger = "heartbeat";
> + };
> + };
> +};
> +
> +/*
> + * Not every i.MX53 P/N supports clock > 800MHz.
> + * As USB armory does not mount a specific P/N set a safe clock upper limit.
> + */
> + {
> + operating-points = <
> + /* kHz */
> + 16  85
> + 40  90
> + 80 105
> + >;
> +};
> +
> + {
> + pinctrl-nam

[PATCH] ARM: dts: rockchip: temporarily remove emmc hs200 speed from rk3288-veyron-speedy.

2016-08-29 Thread Vagrant Cascadian
This essentially mimics what was done with rk3288-veyron-minnie in
commit 984926781122f034d5bc9962815d135b6c4a8e1d.

The eMMC of the speedy Chromebook also appears to need the same tuning
workaround, as it frequently fails to recognize the eMMC without it.

---
 arch/arm/boot/dts/rk3288-veyron-speedy.dts | 5 +
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/boot/dts/rk3288-veyron-speedy.dts 
b/arch/arm/boot/dts/rk3288-veyron-speedy.dts
index a0d033f..500fd18 100644
--- a/arch/arm/boot/dts/rk3288-veyron-speedy.dts
+++ b/arch/arm/boot/dts/rk3288-veyron-speedy.dts
@@ -124,6 +124,11 @@
_bus4>;
 };
 
+
+ {
+   /delete-property/mmc-hs200-1_8v;
+};
+
 _5v {
enable-active-high;
gpio = < 21 GPIO_ACTIVE_HIGH>;
-- 
2.9.3



signature.asc
Description: PGP signature


[PATCH] ARM: dts: rockchip: temporarily remove emmc hs200 speed from rk3288-veyron-speedy.

2016-08-29 Thread Vagrant Cascadian
This essentially mimics what was done with rk3288-veyron-minnie in
commit 984926781122f034d5bc9962815d135b6c4a8e1d.

The eMMC of the speedy Chromebook also appears to need the same tuning
workaround, as it frequently fails to recognize the eMMC without it.

---
 arch/arm/boot/dts/rk3288-veyron-speedy.dts | 5 +
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/boot/dts/rk3288-veyron-speedy.dts 
b/arch/arm/boot/dts/rk3288-veyron-speedy.dts
index a0d033f..500fd18 100644
--- a/arch/arm/boot/dts/rk3288-veyron-speedy.dts
+++ b/arch/arm/boot/dts/rk3288-veyron-speedy.dts
@@ -124,6 +124,11 @@
_bus4>;
 };
 
+
+ {
+   /delete-property/mmc-hs200-1_8v;
+};
+
 _5v {
enable-active-high;
gpio = < 21 GPIO_ACTIVE_HIGH>;
-- 
2.9.3



signature.asc
Description: PGP signature


Re: [PATCH] ARM: dts: imx5: Add dts files for USB armory.

2015-05-13 Thread Vagrant Cascadian
On 2015-04-27, Vagrant Cascadian wrote:
> On 2015-04-27, Shawn Guo wrote:
>> On Fri, Mar 27, 2015 at 01:23:00PM -0700, Vagrant Cascadian wrote:
>>> Add support for the USB armory board by Inverse Path. This board
>>> features a Freescale iMX53 SoC, 512MB RAM, and USB OTG operating in
>>> either peripheral or host mode, and 5 GPIO pins.
>>> 
>>> One .dtb is generated for operating in peripheral mode, and one is
>>> generated for operating in host mode.
>>
>> Is it possible to ask bootloader to patch the dtb instead of maintaining
>> a new one for just changing one USB property?
>
> It does appear to be possible with u-boot:
>
>   load mmc 0:1 $fdt_addr_r $fdtfile
>   fdt addr $fdt_addr_r
>   fdt set /soc/aips@5000/usb@53f8 dr_mode host
>
> Since the user would have to manually select the appropriate .dtb
> anyways, it may be reasonable to drop the host_mode.dtb and rely on the
> u-boot to tweak the fdt on boot to switch between usb modes.

Given that it is possible to set from u-boot, I'm wondering if it
wouldn't be worth reworking the patch to only generate a single .dtb for
now, and revisit the options for switching between USB host mode and
peripheral mode later?

live well,
  vagrant


signature.asc
Description: PGP signature


Re: [PATCH] ARM: dts: imx5: Add dts files for USB armory.

2015-05-13 Thread Vagrant Cascadian
On 2015-04-27, Vagrant Cascadian wrote:
 On 2015-04-27, Shawn Guo wrote:
 On Fri, Mar 27, 2015 at 01:23:00PM -0700, Vagrant Cascadian wrote:
 Add support for the USB armory board by Inverse Path. This board
 features a Freescale iMX53 SoC, 512MB RAM, and USB OTG operating in
 either peripheral or host mode, and 5 GPIO pins.
 
 One .dtb is generated for operating in peripheral mode, and one is
 generated for operating in host mode.

 Is it possible to ask bootloader to patch the dtb instead of maintaining
 a new one for just changing one USB property?

 It does appear to be possible with u-boot:

   load mmc 0:1 $fdt_addr_r $fdtfile
   fdt addr $fdt_addr_r
   fdt set /soc/aips@5000/usb@53f8 dr_mode host

 Since the user would have to manually select the appropriate .dtb
 anyways, it may be reasonable to drop the host_mode.dtb and rely on the
 u-boot to tweak the fdt on boot to switch between usb modes.

Given that it is possible to set from u-boot, I'm wondering if it
wouldn't be worth reworking the patch to only generate a single .dtb for
now, and revisit the options for switching between USB host mode and
peripheral mode later?

live well,
  vagrant


signature.asc
Description: PGP signature


Re: [PATCH] ARM: dts: imx5: Add dts files for USB armory.

2015-04-27 Thread Vagrant Cascadian
On 2015-04-27, Shawn Guo wrote:
> On Fri, Mar 27, 2015 at 01:23:00PM -0700, Vagrant Cascadian wrote:
>> Add support for the USB armory board by Inverse Path. This board
>> features a Freescale iMX53 SoC, 512MB RAM, and USB OTG operating in
>> either peripheral or host mode, and 5 GPIO pins.
>> 
>> One .dtb is generated for operating in peripheral mode, and one is
>> generated for operating in host mode.
>
> Is it possible to ask bootloader to patch the dtb instead of maintaining
> a new one for just changing one USB property?

It does appear to be possible with u-boot:

  load mmc 0:1 $fdt_addr_r $fdtfile
  fdt addr $fdt_addr_r
  fdt set /soc/aips@5000/usb@53f8 dr_mode host

Since the user would have to manually select the appropriate .dtb
anyways, it may be reasonable to drop the host_mode.dtb and rely on the
u-boot to tweak the fdt on boot to switch between usb modes.

It is considerably more complicated than setting the fdtfile variable to
the desired .dtb, as various out-of-the box boot scripts will load the
.dtb file defined in the fdtfile variable, overwriting any changes made
with "fdt set".

Given the additional complication in boot scripts, my preference would
be to ship both .dtb files...


Thanks for the time and consideration!


live well,
  vagrant


signature.asc
Description: PGP signature


Re: [PATCH] ARM: dts: imx5: Add dts files for USB armory.

2015-04-27 Thread Vagrant Cascadian
On 2015-04-27, Shawn Guo wrote:
 On Fri, Mar 27, 2015 at 01:23:00PM -0700, Vagrant Cascadian wrote:
 Add support for the USB armory board by Inverse Path. This board
 features a Freescale iMX53 SoC, 512MB RAM, and USB OTG operating in
 either peripheral or host mode, and 5 GPIO pins.
 
 One .dtb is generated for operating in peripheral mode, and one is
 generated for operating in host mode.

 Is it possible to ask bootloader to patch the dtb instead of maintaining
 a new one for just changing one USB property?

It does appear to be possible with u-boot:

  load mmc 0:1 $fdt_addr_r $fdtfile
  fdt addr $fdt_addr_r
  fdt set /soc/aips@5000/usb@53f8 dr_mode host

Since the user would have to manually select the appropriate .dtb
anyways, it may be reasonable to drop the host_mode.dtb and rely on the
u-boot to tweak the fdt on boot to switch between usb modes.

It is considerably more complicated than setting the fdtfile variable to
the desired .dtb, as various out-of-the box boot scripts will load the
.dtb file defined in the fdtfile variable, overwriting any changes made
with fdt set.

Given the additional complication in boot scripts, my preference would
be to ship both .dtb files...


Thanks for the time and consideration!


live well,
  vagrant


signature.asc
Description: PGP signature


[PATCH] ARM: dts: imx5: Add dts files for USB armory.

2015-03-27 Thread Vagrant Cascadian
Add support for the USB armory board by Inverse Path. This board
features a Freescale iMX53 SoC, 512MB RAM, and USB OTG operating in
either peripheral or host mode, and 5 GPIO pins.

One .dtb is generated for operating in peripheral mode, and one is
generated for operating in host mode.

Signed-off-by: Vagrant Cascadian 
Cc: Andrej Rosano 
Cc: Rob Herring 
Cc: Pawel Moll 
Cc: Mark Rutland 
Cc: Ian Campbell 
Cc: Kumar Gala 
Cc: Russell King 
Cc: Shawn Guo 
Cc: Sascha Hauer 
Cc: devicet...@vger.kernel.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
---
 arch/arm/boot/dts/Makefile  |   2 +
 arch/arm/boot/dts/imx53-usbarmory-host_mode.dts |  17 +++
 arch/arm/boot/dts/imx53-usbarmory.dts   |  13 ++
 arch/arm/boot/dts/imx53-usbarmory.dtsi  | 183 
 4 files changed, 215 insertions(+)
 create mode 100644 arch/arm/boot/dts/imx53-usbarmory-host_mode.dts
 create mode 100644 arch/arm/boot/dts/imx53-usbarmory.dts
 create mode 100644 arch/arm/boot/dts/imx53-usbarmory.dtsi

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index a1c776b..bd2258b 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -244,6 +244,8 @@ dtb-$(CONFIG_SOC_IMX53) += \
imx53-smd.dtb \
imx53-tx53-x03x.dtb \
imx53-tx53-x13x.dtb \
+   imx53-usbarmory.dtb \
+   imx53-usbarmory-host_mode.dtb \
imx53-voipac-bsb.dtb
 dtb-$(CONFIG_SOC_IMX6Q) += \
imx6dl-aristainetos_4.dtb \
diff --git a/arch/arm/boot/dts/imx53-usbarmory-host_mode.dts 
b/arch/arm/boot/dts/imx53-usbarmory-host_mode.dts
new file mode 100644
index 000..a94cb1d
--- /dev/null
+++ b/arch/arm/boot/dts/imx53-usbarmory-host_mode.dts
@@ -0,0 +1,17 @@
+/*
+ * Copyright 2015 Inverse Path, S.r.l.
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+/dts-v1/;
+#include "imx53-usbarmory.dtsi"
+
+ {
+   dr_mode = "host";
+};
diff --git a/arch/arm/boot/dts/imx53-usbarmory.dts 
b/arch/arm/boot/dts/imx53-usbarmory.dts
new file mode 100644
index 000..c86a4d8
--- /dev/null
+++ b/arch/arm/boot/dts/imx53-usbarmory.dts
@@ -0,0 +1,13 @@
+/*
+ * Copyright 2015 Inverse Path, S.r.l.
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+/dts-v1/;
+#include "imx53-usbarmory.dtsi"
diff --git a/arch/arm/boot/dts/imx53-usbarmory.dtsi 
b/arch/arm/boot/dts/imx53-usbarmory.dtsi
new file mode 100644
index 000..b4a9052
--- /dev/null
+++ b/arch/arm/boot/dts/imx53-usbarmory.dtsi
@@ -0,0 +1,183 @@
+/*
+ * Copyright 2015 Inverse Path, S.r.l.
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+#include "imx53.dtsi"
+
+/ {
+   model = "Inverse Path USB armory";
+   compatible = "inversepath,imx53-usbarmory", "fsl,imx53";
+};
+
+/ {
+   chosen {
+   stdout-path = 
+   };
+
+   memory {
+   reg = <0x7000 0x2000>;
+   };
+
+   leds {
+   compatible = "gpio-leds";
+   pinctrl-names = "default";
+   pinctrl-0 = <_pin_gpio4_27>;
+
+   user {
+   label = "LED";
+   gpios = < 27 0>;
+   linux,default-trigger = "heartbeat";
+   };
+   };
+};
+
+ {
+   pinctrl-names = "default";
+   pinctrl-0 = <_esdhc1>;
+   status = "okay";
+};
+
+ {
+   pinctrl-names = "default";
+   pinctrl-0 = <_hog>;
+
+   imx53-usbarmory {
+   pinctrl_hog: hoggrp {
+   fsl,pins = <
+   MX53_PAD_GPIO_0__CCM_SSI_EXT1_CLK 0x8000
+   MX53_PAD_GPIO_8__GPIO1_8  0x8000
+   MX53_PAD_PATA_DATA14__GPIO2_140x8000
+   MX53_PAD_PATA_DATA15__GPIO2_150x8000
+   MX53_PAD_EIM_DA11__GPIO3_11   0x8000
+   MX53_PAD_EIM_DA12__GPIO3_12   0x8000
+   MX53_PAD_PATA_DA_0__GPIO7

[PATCH] ARM: dts: imx5: Add dts files for USB armory.

2015-03-27 Thread Vagrant Cascadian
Add support for the USB armory board by Inverse Path. This board
features a Freescale iMX53 SoC, 512MB RAM, and USB OTG operating in
either peripheral or host mode, and 5 GPIO pins.

One .dtb is generated for operating in peripheral mode, and one is
generated for operating in host mode.

Signed-off-by: Vagrant Cascadian vagr...@debian.org
Cc: Andrej Rosano and...@inversepath.com
Cc: Rob Herring robh...@kernel.org
Cc: Pawel Moll pawel.m...@arm.com
Cc: Mark Rutland mark.rutl...@arm.com
Cc: Ian Campbell ijc+devicet...@hellion.org.uk
Cc: Kumar Gala ga...@codeaurora.org
Cc: Russell King li...@arm.linux.org.uk
Cc: Shawn Guo shawn@linaro.org
Cc: Sascha Hauer ker...@pengutronix.de
Cc: devicet...@vger.kernel.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
---
 arch/arm/boot/dts/Makefile  |   2 +
 arch/arm/boot/dts/imx53-usbarmory-host_mode.dts |  17 +++
 arch/arm/boot/dts/imx53-usbarmory.dts   |  13 ++
 arch/arm/boot/dts/imx53-usbarmory.dtsi  | 183 
 4 files changed, 215 insertions(+)
 create mode 100644 arch/arm/boot/dts/imx53-usbarmory-host_mode.dts
 create mode 100644 arch/arm/boot/dts/imx53-usbarmory.dts
 create mode 100644 arch/arm/boot/dts/imx53-usbarmory.dtsi

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index a1c776b..bd2258b 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -244,6 +244,8 @@ dtb-$(CONFIG_SOC_IMX53) += \
imx53-smd.dtb \
imx53-tx53-x03x.dtb \
imx53-tx53-x13x.dtb \
+   imx53-usbarmory.dtb \
+   imx53-usbarmory-host_mode.dtb \
imx53-voipac-bsb.dtb
 dtb-$(CONFIG_SOC_IMX6Q) += \
imx6dl-aristainetos_4.dtb \
diff --git a/arch/arm/boot/dts/imx53-usbarmory-host_mode.dts 
b/arch/arm/boot/dts/imx53-usbarmory-host_mode.dts
new file mode 100644
index 000..a94cb1d
--- /dev/null
+++ b/arch/arm/boot/dts/imx53-usbarmory-host_mode.dts
@@ -0,0 +1,17 @@
+/*
+ * Copyright 2015 Inverse Path, S.r.l.
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+/dts-v1/;
+#include imx53-usbarmory.dtsi
+
+usbotg {
+   dr_mode = host;
+};
diff --git a/arch/arm/boot/dts/imx53-usbarmory.dts 
b/arch/arm/boot/dts/imx53-usbarmory.dts
new file mode 100644
index 000..c86a4d8
--- /dev/null
+++ b/arch/arm/boot/dts/imx53-usbarmory.dts
@@ -0,0 +1,13 @@
+/*
+ * Copyright 2015 Inverse Path, S.r.l.
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+/dts-v1/;
+#include imx53-usbarmory.dtsi
diff --git a/arch/arm/boot/dts/imx53-usbarmory.dtsi 
b/arch/arm/boot/dts/imx53-usbarmory.dtsi
new file mode 100644
index 000..b4a9052
--- /dev/null
+++ b/arch/arm/boot/dts/imx53-usbarmory.dtsi
@@ -0,0 +1,183 @@
+/*
+ * Copyright 2015 Inverse Path, S.r.l.
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+#include imx53.dtsi
+
+/ {
+   model = Inverse Path USB armory;
+   compatible = inversepath,imx53-usbarmory, fsl,imx53;
+};
+
+/ {
+   chosen {
+   stdout-path = uart1;
+   };
+
+   memory {
+   reg = 0x7000 0x2000;
+   };
+
+   leds {
+   compatible = gpio-leds;
+   pinctrl-names = default;
+   pinctrl-0 = led_pin_gpio4_27;
+
+   user {
+   label = LED;
+   gpios = gpio4 27 0;
+   linux,default-trigger = heartbeat;
+   };
+   };
+};
+
+esdhc1 {
+   pinctrl-names = default;
+   pinctrl-0 = pinctrl_esdhc1;
+   status = okay;
+};
+
+iomuxc {
+   pinctrl-names = default;
+   pinctrl-0 = pinctrl_hog;
+
+   imx53-usbarmory {
+   pinctrl_hog: hoggrp {
+   fsl,pins = 
+   MX53_PAD_GPIO_0__CCM_SSI_EXT1_CLK 0x8000
+   MX53_PAD_GPIO_8__GPIO1_8  0x8000
+   MX53_PAD_PATA_DATA14__GPIO2_140x8000
+   MX53_PAD_PATA_DATA15__GPIO2_150x8000
+   MX53_PAD_EIM_DA11__GPIO3_11   0x8000
+   MX53_PAD_EIM_DA12__GPIO3_12   0x8000