Re: [PATCH v3 1/7] ARM: dts: imx6: pcaaxl3: Order nodes alphabetically

2019-12-11 Thread Sascha Hauer
On Wed, Dec 11, 2019 at 11:59:15AM +0100, Stefan Riedmueller wrote:
> Bring the device tree nodes in alphabetical order and in this context
> also remove the deprecated iomux group.
> 
> Signed-off-by: Stefan Riedmueller 
> ---
> Changes in v3:
>  - Rebased on latest master
> ---

Applied, thanks

Sascha

-- 
Pengutronix e.K.   | |
Steuerwalder Str. 21   | http://www.pengutronix.de/  |
31137 Hildesheim, Germany  | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |

___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH 1/2] ARM: omap: support for WAGO PFC200v3 750-821x

2019-12-11 Thread Roland Hieber
Based on the downstream patch series in the WAGO PFC firmware SDK [1].
Downstream has support for other boards too, which we leave out for now
because no devices are available for testing. The upstream device trees
have been used as-is except that uart0 was set to "okay" so barebox can
enable the console on startup.

[1]: 
https://github.com/WAGO/pfc-firmware-sdk/tree/V03.02.02-FW14/configs/wago-pfcXXX/patches/barebox-2018.10.0

Signed-off-by: Roland Hieber 
---
 Documentation/boards/am335x.rst   |   2 +
 Documentation/boards/am335x/wago-pfc.rst  |  90 +++
 arch/arm/boards/Makefile  |   1 +
 arch/arm/boards/wago-pfc-am335x/Makefile  |   3 +
 arch/arm/boards/wago-pfc-am335x/board.c   |  86 +++
 .../defaultenv-pfc-am335x/boot/emmc   |   4 +
 .../defaultenv-pfc-am335x/boot/mmc|   4 +
 .../defaultenv-pfc-am335x/init/bootsource |  12 +
 arch/arm/boards/wago-pfc-am335x/lowlevel.c|  98 
 arch/arm/boards/wago-pfc-am335x/ram-timings.h |  94 
 arch/arm/configs/am335x_mlo_defconfig |   1 +
 arch/arm/configs/omap_defconfig   |   1 +
 arch/arm/dts/Makefile |   2 +
 arch/arm/dts/am335x-pfc-750_821x-mlo.dts  |  31 +++
 arch/arm/dts/am335x-pfc-750_821x.dts  |  66 +
 arch/arm/dts/am335x-pfc-emmc.dtsi |  29 +++
 arch/arm/dts/am335x-pfc-leds.dtsi | 203 
 arch/arm/dts/am335x-pfc-nand.dtsi |  89 +++
 arch/arm/dts/am335x-pfc-rmii12.dtsi   |  62 +
 arch/arm/dts/am335x-pfc-rmii2.dtsi|  40 +++
 arch/arm/dts/am335x-pfc-strip.dtsi|  48 
 arch/arm/dts/am335x-pfc.dtsi  | 228 ++
 arch/arm/mach-omap/Kconfig|   7 +
 images/Makefile.am33xx|   8 +
 24 files changed, 1209 insertions(+)
 create mode 100644 Documentation/boards/am335x/wago-pfc.rst
 create mode 100644 arch/arm/boards/wago-pfc-am335x/Makefile
 create mode 100644 arch/arm/boards/wago-pfc-am335x/board.c
 create mode 100644 
arch/arm/boards/wago-pfc-am335x/defaultenv-pfc-am335x/boot/emmc
 create mode 100644 
arch/arm/boards/wago-pfc-am335x/defaultenv-pfc-am335x/boot/mmc
 create mode 100644 
arch/arm/boards/wago-pfc-am335x/defaultenv-pfc-am335x/init/bootsource
 create mode 100644 arch/arm/boards/wago-pfc-am335x/lowlevel.c
 create mode 100644 arch/arm/boards/wago-pfc-am335x/ram-timings.h
 create mode 100644 arch/arm/dts/am335x-pfc-750_821x-mlo.dts
 create mode 100644 arch/arm/dts/am335x-pfc-750_821x.dts
 create mode 100644 arch/arm/dts/am335x-pfc-emmc.dtsi
 create mode 100644 arch/arm/dts/am335x-pfc-leds.dtsi
 create mode 100644 arch/arm/dts/am335x-pfc-nand.dtsi
 create mode 100644 arch/arm/dts/am335x-pfc-rmii12.dtsi
 create mode 100644 arch/arm/dts/am335x-pfc-rmii2.dtsi
 create mode 100644 arch/arm/dts/am335x-pfc-strip.dtsi
 create mode 100644 arch/arm/dts/am335x-pfc.dtsi

diff --git a/Documentation/boards/am335x.rst b/Documentation/boards/am335x.rst
index f54611428bb3..0da479a1c3f0 100644
--- a/Documentation/boards/am335x.rst
+++ b/Documentation/boards/am335x.rst
@@ -30,6 +30,8 @@ resulting images will be placed under ``images/``:
 
 Some boards come in different variants, make sure to pick the correct one.
 
+.. _am335x_starting_barebox:
+
 Starting and updating barebox
 -
 
diff --git a/Documentation/boards/am335x/wago-pfc.rst 
b/Documentation/boards/am335x/wago-pfc.rst
new file mode 100644
index ..bec2a7c1f05a
--- /dev/null
+++ b/Documentation/boards/am335x/wago-pfc.rst
@@ -0,0 +1,90 @@
+.. SPDX-License-Identifier: GPL-2.0-only
+
+WAGO PFC200 Fieldbus Controllers (AM335x based)
+
+
+These devices already run a version of Barebox out of the box,
+although the debug console is disabled in the factory settings.
+
+Currently supported devices:
+
+* WAGO PFC200v3 750-8214
+
+Initial Device Preparation
+--
+
+The factory firmware looks for an MLO on the eMMC first.
+If nothing bootable is found there, the ROM code searches for a loader on the
+SD card instead.
+This means we have to erase the internal MLO in order to boot from the SD card.
+
+#. If you haven't set up your device yet,
+   grab a current `firmware `_,
+   write it to an SD card, and boot the device with it.
+   You also need a DHCP server to connect to the device over ethernet.
+
+#. Connect to the web interface and log in with admin privileges.
+   (The default user is ``admin``, password ``wago``).
+
+#. Make sure that SSH is enabled and root login is allowed in
+   *Ports and Services* → *SSH*.
+
+#. Connect to the device over SSH, using user ``root`` and password ``wago``.
+
+#. The eMMC boot partition is */dev/mmcblk1p1*, which contains boot loaders
+   for several PFC variants (probably as a backup?),
+   but only the file named 

[PATCH 2/2] ARM: omap: reword MACH_WAGO_PFC_AM35XX kconfig help text

2019-12-11 Thread Roland Hieber
Better differenciate it from the new MACH_WAGO_PFC_AM335X above it, and
fix indentation to be consistent with the rest of the file.

Signed-off-by: Roland Hieber 
---
 arch/arm/mach-omap/Kconfig | 13 +++--
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-omap/Kconfig b/arch/arm/mach-omap/Kconfig
index 6f8f4473a36f..239872726a96 100644
--- a/arch/arm/mach-omap/Kconfig
+++ b/arch/arm/mach-omap/Kconfig
@@ -191,12 +191,13 @@ config MACH_WAGO_PFC_AM335X
  PFC200 750-821x
 
 config MACH_WAGO_PFC_AM35XX
-bool "Wago PFC200 Fieldbus Controller"
-select ARCH_AM35XX
-select HAVE_PBL_MULTI_IMAGES
-select HAVE_CONFIGURABLE_MEMORY_LAYOUT
-help
-  Say Y here if you are using a the AM3505 based PFC200 controller
+   bool "Wago PFC200 Fieldbus Controller (AM3505 based)"
+   select ARCH_AM35XX
+   select HAVE_PBL_MULTI_IMAGES
+   select HAVE_CONFIGURABLE_MEMORY_LAYOUT
+   help
+ Say Y here if you are using an AM3505 based PFC200 controller, like
+ PFC200 750-820x
 
 endif
 
-- 
2.24.0


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH v3 7/7] ARM: dts: imx6: phytec: Increase NAND barebox partition size

2019-12-11 Thread Stefan Riedmueller
For NAND flash with eraseblock size 1 MB and more the current
barebox partition size is not sufficient. The 4 FCB copies alone occupy
the 4 MB partition size. Increase the partition size to 16 MB to be fit
for the future and leaving some blocks for bad block handling as well.

Signed-off-by: Stefan Riedmueller 
---
Changes in v3:
 - Rebased on latest master
---
 arch/arm/dts/imx6qdl-phytec-pfla02.dtsi  | 6 +++---
 arch/arm/dts/imx6qdl-phytec-phycard-som.dtsi | 6 +++---
 arch/arm/dts/imx6qdl-phytec-phycore-som.dtsi | 6 +++---
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/arch/arm/dts/imx6qdl-phytec-pfla02.dtsi 
b/arch/arm/dts/imx6qdl-phytec-pfla02.dtsi
index 846ebbe6b18b..841ad653b26d 100644
--- a/arch/arm/dts/imx6qdl-phytec-pfla02.dtsi
+++ b/arch/arm/dts/imx6qdl-phytec-pfla02.dtsi
@@ -98,17 +98,17 @@
 
partition@0 {
label = "barebox";
-   reg = <0x0 0x40>;
+   reg = <0x0 0x100>;
};
 
partition@40 {
label = "barebox-environment";
-   reg = <0x40 0x10>;
+   reg = <0x100 0x10>;
};
 
partition@50 {
label = "root";
-   reg = <0x50 0x0>;
+   reg = <0x110 0x0>;
};
};
 };
diff --git a/arch/arm/dts/imx6qdl-phytec-phycard-som.dtsi 
b/arch/arm/dts/imx6qdl-phytec-phycard-som.dtsi
index 892bce1fc0ab..5d287258bb6c 100644
--- a/arch/arm/dts/imx6qdl-phytec-phycard-som.dtsi
+++ b/arch/arm/dts/imx6qdl-phytec-phycard-som.dtsi
@@ -42,17 +42,17 @@
 
partition@0 {
label = "barebox";
-   reg = <0x0 0x40>;
+   reg = <0x0 0x100>;
};
 
environment_nand: partition@40 {
label = "barebox-environment";
-   reg = <0x40 0x2>;
+   reg = <0x100 0x10>;
};
 
partition@42 {
label = "root";
-   reg = <0x42 0x0>;
+   reg = <0x110 0x0>;
};
};
 };
diff --git a/arch/arm/dts/imx6qdl-phytec-phycore-som.dtsi 
b/arch/arm/dts/imx6qdl-phytec-phycore-som.dtsi
index 69f252b42382..918b62f794b3 100644
--- a/arch/arm/dts/imx6qdl-phytec-phycore-som.dtsi
+++ b/arch/arm/dts/imx6qdl-phytec-phycore-som.dtsi
@@ -50,17 +50,17 @@
 
partition@0 {
label = "barebox";
-   reg = <0x0 0x40>;
+   reg = <0x0 0x100>;
};
 
partition@40 {
label = "barebox-environment";
-   reg = <0x40 0x10>;
+   reg = <0x100 0x10>;
};
 
partition@50 {
label = "root";
-   reg = <0x50 0x0>;
+   reg = <0x110 0x0>;
};
};
 };
-- 
2.7.4


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH v3 5/7] ARM: dts: imx6: phycard: Switch to new partitions binding

2019-12-11 Thread Stefan Riedmueller
The SD card interface is still using the legacy partition binding.
Change this by switching to the new bindings.

Signed-off-by: Stefan Riedmueller 
---
Changes in v3:
 - Rebased on latest master
---
 arch/arm/dts/imx6qdl-phytec-phycard-som.dtsi | 22 +-
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/arch/arm/dts/imx6qdl-phytec-phycard-som.dtsi 
b/arch/arm/dts/imx6qdl-phytec-phycard-som.dtsi
index f1a5e5962362..f17ba7bf808d 100644
--- a/arch/arm/dts/imx6qdl-phytec-phycard-som.dtsi
+++ b/arch/arm/dts/imx6qdl-phytec-phycard-som.dtsi
@@ -158,15 +158,19 @@
 cd-gpios = < 22 0>;
 status = "disabled";
 
-   #address-cells = <1>;
-   #size-cells = <1>;
+   partitions {
+   compatible = "fixed-partitions";
+   #address-cells = <1>;
+   #size-cells = <1>;
 
-   partition@0 {
-   label = "barebox";
-   reg = <0x0 0xe>;
-   };
-   environment_usdhc3: partition@e {
-   label = "barebox-environment";
-   reg = <0xe 0x2>;
+   partition@0 {
+   label = "barebox";
+   reg = <0x0 0xe>;
+   };
+
+   environment_usdhc3: partition@e {
+   label = "barebox-environment";
+   reg = <0xe 0x2>;
+   };
};
 };
-- 
2.7.4


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH v3 6/7] ARM: dts: imx6: phycard: Use gpio binding constants

2019-12-11 Thread Stefan Riedmueller
Signed-off-by: Stefan Riedmueller 
---
Changes in v3:
 - Rebased on latest master
---
 arch/arm/dts/imx6qdl-phytec-phycard-som.dtsi | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/arm/dts/imx6qdl-phytec-phycard-som.dtsi 
b/arch/arm/dts/imx6qdl-phytec-phycard-som.dtsi
index f17ba7bf808d..892bce1fc0ab 100644
--- a/arch/arm/dts/imx6qdl-phytec-phycard-som.dtsi
+++ b/arch/arm/dts/imx6qdl-phytec-phycard-som.dtsi
@@ -4,6 +4,8 @@
  * Author: Christian Hemp 
  */
 
+#include 
+
 / {
chosen {
environment-nand {
@@ -155,7 +157,7 @@
  {
 pinctrl-names = "default";
 pinctrl-0 = <_usdhc3>;
-cd-gpios = < 22 0>;
+cd-gpios = < 22 GPIO_ACTIVE_HIGH>;
 status = "disabled";
 
partitions {
-- 
2.7.4


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH v3 2/7] ARM: dts: imx6: pcaaxl3: Update license and model description

2019-12-11 Thread Stefan Riedmueller
Make use of SPDX license identifiers and update copyright notices and
model descriptions of the phyCARD-i.MX 6 SOM.

Signed-off-by: Stefan Riedmueller 
---
Changes in v3:
 - Rebased on latest master
---
 arch/arm/dts/imx6q-phytec-pbaa03.dts   | 13 -
 arch/arm/dts/imx6q-phytec-pcaaxl3.dtsi | 13 -
 2 files changed, 8 insertions(+), 18 deletions(-)

diff --git a/arch/arm/dts/imx6q-phytec-pbaa03.dts 
b/arch/arm/dts/imx6q-phytec-pbaa03.dts
index 5216a2dfe316..8034f90804ec 100644
--- a/arch/arm/dts/imx6q-phytec-pbaa03.dts
+++ b/arch/arm/dts/imx6q-phytec-pbaa03.dts
@@ -1,12 +1,7 @@
+// SPDX-License-Identifier: (GPL-2.0-or-later)
 /*
- * Copyright 2014 Christian Hemp, Phytec Messtechnik GmbH
- *
- * 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
+ * Copyright (C) 2014 PHYTEC Messtechnik GmbH
+ * Author: Christian Hemp 
  */
 
 /dts-v1/;
@@ -16,7 +11,7 @@
 #include "imx6q-phytec-pcaaxl3.dtsi"
 
 / {
-   model = "Phytec phyCARD-i.MX6 Quad Carrier-Board";
+   model = "PHYTEC phyCARD-i.MX6 Quad";
compatible = "phytec,imx6q-pbaa03", "phytec,imx6q-pcaaxl3", "fsl,imx6q";
 
chosen {
diff --git a/arch/arm/dts/imx6q-phytec-pcaaxl3.dtsi 
b/arch/arm/dts/imx6q-phytec-pcaaxl3.dtsi
index db986f87ef26..0dbd5419ba10 100644
--- a/arch/arm/dts/imx6q-phytec-pcaaxl3.dtsi
+++ b/arch/arm/dts/imx6q-phytec-pcaaxl3.dtsi
@@ -1,19 +1,14 @@
+// SPDX-License-Identifier: (GPL-2.0-or-later)
 /*
- * Copyright 201 Christian Hemp, Phytec Messtechnik GmbH
- *
- * 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
+ * Copyright (C) 2014 PHYTEC Messtechnik GmbH
+ * Author: Christian Hemp 
  */
 
 #include 
 #include "imx6q.dtsi"
 
 / {
-   model = "Phytec phyCARD-i.MX6 Quad";
+   model = "PHYTEC phyCARD-i.MX6 Quad";
compatible = "phytec,imx6q-pcaaxl3", "fsl,imx6q";
 
chosen {
-- 
2.7.4


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH v3 1/7] ARM: dts: imx6: pcaaxl3: Order nodes alphabetically

2019-12-11 Thread Stefan Riedmueller
Bring the device tree nodes in alphabetical order and in this context
also remove the deprecated iomux group.

Signed-off-by: Stefan Riedmueller 
---
Changes in v3:
 - Rebased on latest master
---
 arch/arm/dts/imx6q-phytec-pcaaxl3.dtsi | 182 -
 1 file changed, 90 insertions(+), 92 deletions(-)

diff --git a/arch/arm/dts/imx6q-phytec-pcaaxl3.dtsi 
b/arch/arm/dts/imx6q-phytec-pcaaxl3.dtsi
index 66b547ad8eef..db986f87ef26 100644
--- a/arch/arm/dts/imx6q-phytec-pcaaxl3.dtsi
+++ b/arch/arm/dts/imx6q-phytec-pcaaxl3.dtsi
@@ -17,104 +17,16 @@
compatible = "phytec,imx6q-pcaaxl3", "fsl,imx6q";
 
chosen {
-   environment-sd3 {
-   compatible = "barebox,environment";
-   device-path = _usdhc3;
-   status = "disabled";
-   };
-
environment-nand {
compatible = "barebox,environment";
device-path = _nand;
status = "disabled";
};
-   };
-};
-
- {
-   status = "okay";
-   pinctrl-names = "default";
-   pinctrl-0 = <_i2c1>;
-
-   eeprom: m24c32@50 {
-   compatible = "st,24c32", "at24";
-   reg = <0x50>;
-   };
-};
-
- {
-   pinctrl-names = "default";
-
-   imx6q-phytec-pcaaxl3 {
-   pinctrl_enet: enetgrp {
-   fsl,pins = <
-   MX6QDL_PAD_ENET_MDC__ENET_MDC   0x1b0b0
-   MX6QDL_PAD_ENET_MDIO__ENET_MDIO 0x1b0b0
-   MX6QDL_PAD_ENET_RXD0__ENET_RX_DATA0 0x1b0b0
-   MX6QDL_PAD_ENET_RXD1__ENET_RX_DATA1 0x1b0b0
-   MX6QDL_PAD_ENET_RX_ER__ENET_RX_ER   0x1b0b0
-   MX6QDL_PAD_ENET_TX_EN__ENET_TX_EN   0x1b0b0
-   MX6QDL_PAD_ENET_TXD0__ENET_TX_DATA0 0x1b0b0
-   MX6QDL_PAD_ENET_TXD1__ENET_TX_DATA1 0x1b0b0
-   MX6QDL_PAD_ENET_CRS_DV__ENET_RX_EN  0x1b0b0
-   MX6QDL_PAD_ENET_REF_CLK__ENET_TX_CLK0x1b0b0
-   MX6QDL_PAD_KEY_COL0__ENET_RX_DATA3  0x1b0b0
-   MX6QDL_PAD_KEY_ROW0__ENET_TX_DATA3  0x1b0b0
-   MX6QDL_PAD_KEY_ROW1__ENET_COL   0x1b0b0
-   MX6QDL_PAD_KEY_COL2__ENET_RX_DATA2  0x1b0b0
-   MX6QDL_PAD_KEY_ROW2__ENET_TX_DATA2  0x1b0b0
-   MX6QDL_PAD_KEY_COL3__ENET_CRS   0x1b0b0
-   MX6QDL_PAD_GPIO_18__ENET_RX_CLK 0x1b0b0
-   MX6QDL_PAD_GPIO_19__ENET_TX_ER  0x1b0b0
-   >;
-   };
-
-   pinctrl_gpmi_nand: gpmigrp {
-   fsl,pins = <
-   MX6QDL_PAD_NANDF_CLE__NAND_CLE  0xb0b1
-   MX6QDL_PAD_NANDF_ALE__NAND_ALE  0xb0b1
-   MX6QDL_PAD_NANDF_WP_B__NAND_WP_B0xb0b1
-   MX6QDL_PAD_NANDF_RB0__NAND_READY_B  0xb000
-   MX6QDL_PAD_NANDF_CS0__NAND_CE0_B0xb0b1
-   MX6QDL_PAD_NANDF_CS1__NAND_CE1_B0xb0b1
-   MX6QDL_PAD_SD4_CMD__NAND_RE_B   0xb0b1
-   MX6QDL_PAD_SD4_CLK__NAND_WE_B   0xb0b1
-   MX6QDL_PAD_NANDF_D0__NAND_DATA000xb0b1
-   MX6QDL_PAD_NANDF_D1__NAND_DATA010xb0b1
-   MX6QDL_PAD_NANDF_D2__NAND_DATA020xb0b1
-   MX6QDL_PAD_NANDF_D3__NAND_DATA030xb0b1
-   MX6QDL_PAD_NANDF_D4__NAND_DATA040xb0b1
-   MX6QDL_PAD_NANDF_D5__NAND_DATA050xb0b1
-   MX6QDL_PAD_NANDF_D6__NAND_DATA060xb0b1
-   MX6QDL_PAD_NANDF_D7__NAND_DATA070xb0b1
-   MX6QDL_PAD_SD4_DAT0__NAND_DQS   0x00b1
-   >;
-   };
-
-   pinctrl_i2c1: i2c1grp {
-   fsl,pins = <
-   MX6QDL_PAD_EIM_D21__I2C1_SCL
0x4001b8b1
-   MX6QDL_PAD_EIM_D28__I2C1_SDA
0x4001b8b1
-   >;
-   };
-
-   pinctrl_uart3: uart3grp {
-   fsl,pins = <
-   MX6QDL_PAD_EIM_D24__UART3_TX_DATA   0x1b0b1
-   MX6QDL_PAD_EIM_D25__UART3_RX_DATA   0x1b0b1
-   >;
-   };
 
-  

[PATCH v3 4/7] ARM: dts: imx6: phycard: Make eeprom configurable

2019-12-11 Thread Stefan Riedmueller
The EEPROM is a configurable option. So make it configurable from the
dts file.

Signed-off-by: Stefan Riedmueller 
---
Changes in v3:
 - Rebased on latest master
---
 arch/arm/dts/imx6q-phytec-phycard.dts| 4 
 arch/arm/dts/imx6qdl-phytec-phycard-som.dtsi | 1 +
 2 files changed, 5 insertions(+)

diff --git a/arch/arm/dts/imx6q-phytec-phycard.dts 
b/arch/arm/dts/imx6q-phytec-phycard.dts
index 09106f7d4dda..c06461c2c73d 100644
--- a/arch/arm/dts/imx6q-phytec-phycard.dts
+++ b/arch/arm/dts/imx6q-phytec-phycard.dts
@@ -23,6 +23,10 @@
};
 };
 
+ {
+   status = "okay";
+};
+
  {
status = "okay";
 };
diff --git a/arch/arm/dts/imx6qdl-phytec-phycard-som.dtsi 
b/arch/arm/dts/imx6qdl-phytec-phycard-som.dtsi
index 6d963f191024..f1a5e5962362 100644
--- a/arch/arm/dts/imx6qdl-phytec-phycard-som.dtsi
+++ b/arch/arm/dts/imx6qdl-phytec-phycard-som.dtsi
@@ -63,6 +63,7 @@
eeprom: m24c32@50 {
compatible = "st,24c32", "at24";
reg = <0x50>;
+   status = "disabled";
};
 };
 
-- 
2.7.4


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH v3 3/7] ARM: dts: imx6: pcaaxl3: Make use of the simpler name phycard

2019-12-11 Thread Stefan Riedmueller
Use the simpler name phycard instead of the article number pcaaxl3
for device tree file names and image names of the phyCARD-i.MX 6.

Signed-off-by: Stefan Riedmueller 
---
Changes in v3:
 - Rebased on latest master
---
 arch/arm/boards/phytec-som-imx6/lowlevel.c  | 6 +++---
 arch/arm/dts/Makefile   | 2 +-
 arch/arm/dts/{imx6q-phytec-pbaa03.dts => imx6q-phytec-phycard.dts}  | 6 +-
 .../{imx6q-phytec-pcaaxl3.dtsi => imx6qdl-phytec-phycard-som.dtsi}  | 6 --
 images/Makefile.imx | 6 +++---
 5 files changed, 12 insertions(+), 14 deletions(-)
 rename arch/arm/dts/{imx6q-phytec-pbaa03.dts => imx6q-phytec-phycard.dts} (83%)
 rename arch/arm/dts/{imx6q-phytec-pcaaxl3.dtsi => 
imx6qdl-phytec-phycard-som.dtsi} (96%)

diff --git a/arch/arm/boards/phytec-som-imx6/lowlevel.c 
b/arch/arm/boards/phytec-som-imx6/lowlevel.c
index 2de84169c692..900aa19c19ea 100644
--- a/arch/arm/boards/phytec-som-imx6/lowlevel.c
+++ b/arch/arm/boards/phytec-som-imx6/lowlevel.c
@@ -90,9 +90,9 @@ static void __noreturn start_imx6_phytec_common(uint32_t size,
 __dtb_##fdt_name##_start); \
}
 
-PHYTEC_ENTRY(start_phytec_pbaa03_1gib, imx6q_phytec_pbaa03, SZ_1G, true);
-PHYTEC_ENTRY(start_phytec_pbaa03_1gib_1bank, imx6q_phytec_pbaa03, SZ_1G, true);
-PHYTEC_ENTRY(start_phytec_pbaa03_2gib, imx6q_phytec_pbaa03, SZ_2G, true);
+PHYTEC_ENTRY(start_phytec_phycard_imx6q_1gib, imx6q_phytec_phycard, SZ_1G, 
true);
+PHYTEC_ENTRY(start_phytec_phycard_imx6q_1gib_1bank, imx6q_phytec_phycard, 
SZ_1G, true);
+PHYTEC_ENTRY(start_phytec_phycard_imx6q_2gib, imx6q_phytec_phycard, SZ_2G, 
true);
 
 PHYTEC_ENTRY(start_phytec_pbab01_512mb_1bank, imx6q_phytec_pbab01, SZ_512M, 
true);
 PHYTEC_ENTRY(start_phytec_pbab01_1gib, imx6q_phytec_pbab01, SZ_1G, true);
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 5c9a311c5f8a..e8dca0b8513c 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -52,7 +52,7 @@ lwl-dtb-$(CONFIG_MACH_PHYTEC_SOM_AM335X) += 
am335x-phytec-phyflex-som.dtb.o am33
am335x-phytec-phycore-som-nand-no-eeprom.dtb.o 
am335x-phytec-phycore-som-nand-no-spi-no-eeprom.dtb.o \
am335x-phytec-phycore-som-emmc.dtb.o \
am335x-phytec-phycard-som.dtb.o am335x-phytec-phycard-som-mlo.dtb.o
-lwl-dtb-$(CONFIG_MACH_PHYTEC_SOM_IMX6) += imx6q-phytec-pbaa03.dtb.o \
+lwl-dtb-$(CONFIG_MACH_PHYTEC_SOM_IMX6) += imx6q-phytec-phycard.dtb.o \
imx6s-phytec-pbab01.dtb.o \
imx6dl-phytec-pbab01.dtb.o \
imx6q-phytec-pbab01.dtb.o \
diff --git a/arch/arm/dts/imx6q-phytec-pbaa03.dts 
b/arch/arm/dts/imx6q-phytec-phycard.dts
similarity index 83%
rename from arch/arm/dts/imx6q-phytec-pbaa03.dts
rename to arch/arm/dts/imx6q-phytec-phycard.dts
index 8034f90804ec..09106f7d4dda 100644
--- a/arch/arm/dts/imx6q-phytec-pbaa03.dts
+++ b/arch/arm/dts/imx6q-phytec-phycard.dts
@@ -5,10 +5,14 @@
  */
 
 /dts-v1/;
+
 #ifdef CONFIG_BOOTM_FITIMAGE_PUBKEY
 #include CONFIG_BOOTM_FITIMAGE_PUBKEY
 #endif
-#include "imx6q-phytec-pcaaxl3.dtsi"
+
+#include 
+#include "imx6q.dtsi"
+#include "imx6qdl-phytec-phycard-som.dtsi"
 
 / {
model = "PHYTEC phyCARD-i.MX6 Quad";
diff --git a/arch/arm/dts/imx6q-phytec-pcaaxl3.dtsi 
b/arch/arm/dts/imx6qdl-phytec-phycard-som.dtsi
similarity index 96%
rename from arch/arm/dts/imx6q-phytec-pcaaxl3.dtsi
rename to arch/arm/dts/imx6qdl-phytec-phycard-som.dtsi
index 0dbd5419ba10..6d963f191024 100644
--- a/arch/arm/dts/imx6q-phytec-pcaaxl3.dtsi
+++ b/arch/arm/dts/imx6qdl-phytec-phycard-som.dtsi
@@ -4,13 +4,7 @@
  * Author: Christian Hemp 
  */
 
-#include 
-#include "imx6q.dtsi"
-
 / {
-   model = "PHYTEC phyCARD-i.MX6 Quad";
-   compatible = "phytec,imx6q-pcaaxl3", "fsl,imx6q";
-
chosen {
environment-nand {
compatible = "barebox,environment";
diff --git a/images/Makefile.imx b/images/Makefile.imx
index 53d4ac8202c5..5b60037c0787 100644
--- a/images/Makefile.imx
+++ b/images/Makefile.imx
@@ -281,11 +281,11 @@ $(call build_imx_habv4img, CONFIG_MACH_EMBEST_MARSBOARD, 
start_imx6q_marsboard,
 
 $(call build_imx_habv4img, CONFIG_MACH_EMBEST_RIOTBOARD, 
start_imx6s_riotboard, embest-riotboard/flash-header-embest-riotboard, 
embest-imx6s-riotboard)
 
-$(call build_imx_habv4img, CONFIG_MACH_PHYTEC_SOM_IMX6, 
start_phytec_pbaa03_1gib, phytec-som-imx6/flash-header-phytec-pcaaxl3-1gib, 
phytec-pbaa03-1gib)
+$(call build_imx_habv4img, CONFIG_MACH_PHYTEC_SOM_IMX6, 
start_phytec_phycard_imx6q_1gib, 
phytec-som-imx6/flash-header-phytec-pcaaxl3-1gib, phytec-phycard-imx6q-1gib)
 
-$(call build_imx_habv4img, CONFIG_MACH_PHYTEC_SOM_IMX6, 
start_phytec_pbaa03_1gib_1bank, 
phytec-som-imx6/flash-header-phytec-pcaaxl3-1gib-1bank, 
phytec-pbaa03-1gib-1bank)
+$(call build_imx_habv4img, CONFIG_MACH_PHYTEC_SOM_IMX6, 

[PATCH] commands: miitool: handle powerdown-flag

2019-12-11 Thread Hubert Feurstein
Signed-off-by: Hubert Feurstein 
---
 commands/miitool.c | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/commands/miitool.c b/commands/miitool.c
index 4ea6fda34..a87d567ac 100644
--- a/commands/miitool.c
+++ b/commands/miitool.c
@@ -140,7 +140,10 @@ static int show_basic_mii(struct mii_bus *mii, struct 
phy_device *phydev,
}
 
*buf = '\0';
-   if (bmcr & BMCR_ANENABLE) {
+
+   if (bmcr & BMCR_PDOWN) {
+   sprintf(buf, "powerdown, ");
+   } else if (bmcr & BMCR_ANENABLE) {
if (bmsr & BMSR_ANEGCOMPLETE) {
if (advert & lkpar) {
sprintf(buf, "%s%s, ", (lkpar & LPA_LPACK) ?
@@ -192,6 +195,8 @@ static int show_basic_mii(struct mii_bus *mii, struct 
phy_device *phydev,
printf("loopback, ");
if (bmcr & BMCR_ISOLATE)
printf("isolate, ");
+   if (bmcr & BMCR_PDOWN)
+   printf("powerdown, ");
if (bmcr & BMCR_CTST)
printf("collision test, ");
if (bmcr & BMCR_ANENABLE) {
-- 
2.24.0


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


Re: [PATCH] habv4: add the possibility to changing the signing area from Kconfig

2019-12-11 Thread Maik Otto
Hi Sascha,

so do you think we should always start from-dcdofs instead of full?
at the moment i use this configuration with from-dcdofs and i think you
have right, there is
not really a good case to sign the area between 0x00 and dcdofs in the
barebox build
What is the best solution in your opinion?
change default from full to dcdofs in the scripts/imx/imx.c ?
additional delete full and skip-mbr ?

Best regards

Maik


Am 11.12.2019 um 09:15 schrieb Sascha Hauer:
> On Wed, Dec 11, 2019 at 08:57:45AM +0100, Maik Otto wrote:
>> Hi Sascha,
>>
>> in my opinion it is better to have it configurable, because ther are
>> different use cases and security requirements.
>> i found the problem by creating  a sd-card \emmc image with wic.  The
>> mbr, the partition table and bootloader became be signed at barebox
>> build and wic changes
>> the partition table at the end of the build process. Then the sd card
>> image could not boot , because the signature was wrong. yeah secure boot
>> works :-)
>> the highest protection you have, when mbr and partition table is signed
>> with the bootloader, but it is not always necessary.
> But in which cases is it really necessary? I can't think of any. The mbr
> and partition table are not evaluated by the ROM code, hence they do not
> need to be signed for HAB.
>
> The images generated by the build system all do not have a partition table
> included, so basically we are currently enforcing no partition table at
> all which is just not useful.
>
> I think the current way of including the first KiB in signed area comes
> from the fact that we started doing HAB on a NAND device which doesn't
> have a partition table. Other projects we are currently doing use eMMC
> where we use the boot partitions, again no MBR or partition table.
>
> If we had started on SD cards, we wouldn't have included the partition
> table in the signature and also would never have thought it would be a
> good idea to do so.
>
> Regards
>  Sascha
>


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


Re: [PATCH 1/4] ARM: zynq: zedboard: split out PS7 init

2019-12-11 Thread Sascha Hauer
On Tue, Dec 10, 2019 at 11:03:19PM +0100, Lucas Stach wrote:
> Move the PS7 inititalization into its own function. This helps
> readability and logically splits the FPGA toolchain generated
> setup from the reset of the board init.
> 
> Also execute the PS7 setup after the lowlevel CPU init, as this
> is the regular order used in the Barebox codebase.
> 
> Signed-off-by: Lucas Stach 
> ---
>  arch/arm/boards/avnet-zedboard/lowlevel.c | 13 +
>  1 file changed, 9 insertions(+), 4 deletions(-)

Applied, thanks

Sascha


-- 
Pengutronix e.K.   | |
Steuerwalder Str. 21   | http://www.pengutronix.de/  |
31137 Hildesheim, Germany  | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |

___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


Re: [PATCH 1/1] mci: imx-esdhc: fix termination of statement

2019-12-11 Thread Sascha Hauer
On Tue, Dec 10, 2019 at 03:46:57PM +0100, Hubert Feurstein wrote:
> Use semicolon instead of comma to terminate statement.
> 
> Signed-off-by: Hubert Feurstein 
> ---
>  drivers/mci/imx-esdhc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks

Sascha


-- 
Pengutronix e.K.   | |
Steuerwalder Str. 21   | http://www.pengutronix.de/  |
31137 Hildesheim, Germany  | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |

___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


Re: [PATCH v2] Allow usage of default environment without environment file storage

2019-12-11 Thread Sascha Hauer
On Mon, Dec 09, 2019 at 11:49:28AM +0100, Albert Schwarzkopf wrote:
> Currently, the default environment is only used when the
> barebox environment on the persistent store is not valid
> or when ENVFS_FLAGS_FORCE_BUILT_IN is set in the super block.
> 
> However, ENVFS_FLAGS_FORCE_BUILT_IN can be cleared and the
> environmnet variables in the persistent store will be
> used again. This may not be desirable.
> 
> This patch allows building CONFIG_DEFAULT_ENVIRONMENT
> independent of CONFIG_ENV_HANDLING. This can be useful
> if you never want to load or write values from the
> persistent store and you only need to read environment variables
> from your default environment.
> 
> If CONFIG_ENV_HANDLING is not set, a message will be printed to the
> user indicating that changes to non-volatile variables won't be
> persisted.
> 
> Move envfs functions that are needed when CONFIG_DEFAULT_ENVIRONMENT
> and/or CONFIG_ENV_HANDLING is set to a new file common/envfs-core.c.
> 
> Signed-off-by: Albert Schwarzkopf 
> ---

Applied, thanks

Sascha

-- 
Pengutronix e.K.   | |
Steuerwalder Str. 21   | http://www.pengutronix.de/  |
31137 Hildesheim, Germany  | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |

___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


Re: [PATCH] of: demote most debug output to loglevel 8 (vdebug)

2019-12-11 Thread Sascha Hauer
On Tue, Dec 10, 2019 at 07:31:40PM +0100, Roland Hieber wrote:
> Loglevel 7 (debug) is often useful to get barebox running on new
> hardware; however, the heavy output of "OF:" messages makes most
> boards take several minutes to boot to a prompt, printing things which
> are probably interesting when debugging OF code itself, but not very
> helpful otherwise. Degrade most of the message to loglevel 8 (vdebug).
> 
> Signed-off-by: Roland Hieber 
> 

Applied, thanks

Sascha

-- 
Pengutronix e.K.   | |
Steuerwalder Str. 21   | http://www.pengutronix.de/  |
31137 Hildesheim, Germany  | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |

___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


Re: [PATCH] commands: digest: don't be to restrictive with the length of verification files

2019-12-11 Thread Sascha Hauer
On Tue, Dec 10, 2019 at 06:36:01PM +0100, Hubert Feurstein wrote:
> Otherwise it is not possible to verify against a file created by shaXsum
> from linux. Usually there is the filename appended after the hash.
> 
> Signed-off-by: Hubert Feurstein 
> ---
>  commands/digest.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks

Sascha

-- 
Pengutronix e.K.   | |
Steuerwalder Str. 21   | http://www.pengutronix.de/  |
31137 Hildesheim, Germany  | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |

___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


Re: [PATCH 1/4] led: unify led trigger tables

2019-12-11 Thread Sascha Hauer
On Tue, Dec 10, 2019 at 06:13:01PM +0100, Hubert Feurstein wrote:
> Currently we have two slightly different led-trigger tables. One in the
> core module, and the other one in the led-triggers module. The one in the
> core module, which is used to parse the device-tree triggers, is lacking
> net-rx and net-tx.
> 
> Signed-off-by: Hubert Feurstein 
> ---
>  drivers/led/core.c | 46 +++---
>  drivers/led/led-triggers.c | 25 -
>  2 files changed, 28 insertions(+), 43 deletions(-)

Applied, thanks

Sascha

-- 
Pengutronix e.K.   | |
Steuerwalder Str. 21   | http://www.pengutronix.de/  |
31137 Hildesheim, Germany  | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |

___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


Re: [PATCH v2] firmware: zynqmp-fpga: drop example bin format header

2019-12-11 Thread Sascha Hauer
On Tue, Dec 10, 2019 at 12:38:33PM +0100, Michael Tretter wrote:
> Avoid the example bitstream header to validate the bitstream that should
> be loaded into the FPGA. The header is mostly 0x with a few
> special values at a certain offsets and can be better described with the
> offsets and their magic values.
> 
> As a drive by, this fixes/removes a broken check in the header
> validation. The != operator has a higher precedence than ?: and this
> check should have had parenthesis around the ?: expression:
> 
>   bin_header[i] != (byte_order == XILINX_BYTE_ORDER_BIT) ?
>   bin_format[i] : __swab32(bin_format[i])
> 
> Signed-off-by: Michael Tretter 
> Reviewed-by: Thomas Haemmerle 
> ---
> Changes in v2:
>  - Fix subject zynmp-fpga -> zynqmp-fpga
> 
>  drivers/firmware/zynqmp-fpga.c | 121 +
>  1 file changed, 62 insertions(+), 59 deletions(-)

Applied, thanks

Sascha

-- 
Pengutronix e.K.   | |
Steuerwalder Str. 21   | http://www.pengutronix.de/  |
31137 Hildesheim, Germany  | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |

___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


Re: [PATCH] mtd: spi-nor: Add support for en25qh64

2019-12-11 Thread Sascha Hauer
On Mon, Dec 09, 2019 at 04:20:33PM +0100, Ulrich Ölmann wrote:
> This is a port of Linux kernel commit
> 
> | commit 30a2c8aa3c520d54bcaf3015ca8141b0156448b1
> | Author: Roger Pueyo Centelles 
> | Date:   Thu Feb 7 20:09:35 2019 +0100
> |
> | mtd: spi-nor: Add support for en25qh64
> |
> | The Eon EN25QH64 is a 64 Mbit SPI NOR flash memory chip found
> | on recent wireless routers. Its 32, 128 and 256 Mbit siblings
> | are already supported.
> |
> | Tested on a COMFAST CF-E120A v3 router board.
> |
> | Signed-off-by: Roger Pueyo Centelles 
> | Reviewed-by: Tudor Ambarus 
> | Signed-off-by: Boris Brezillon 
> 
> Signed-off-by: Ulrich Ölmann 
> ---
>  drivers/mtd/spi-nor/spi-nor.c | 2 ++
>  1 file changed, 2 insertions(+)

Applied, thanks

Sascha

-- 
Pengutronix e.K.   | |
Steuerwalder Str. 21   | http://www.pengutronix.de/  |
31137 Hildesheim, Germany  | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |

___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


Re: [PATCH v2 1/3] images: i.MX: rearrange image rules in preparation for boilerplate removal

2019-12-11 Thread Sascha Hauer
On Mon, Dec 09, 2019 at 03:11:12PM +0100, Ahmad Fatoum wrote:
> The following commit will introduce a variable define to remove the
> duplication in the different [supe]*imximg rules.
> 
> Prepare for this by rearranging the command line flags to line up with
> the letters in the extension (i.e. -e -s for esimximg instead of -s -e)
> and by splitting off a multi-target rule into two.
> 
> The former improves readability when the define is introduced, as it is
> then easy to see the correspondence between extension and arguments.
> 
> The latter is needed because we will call the variable for each target.
> 
> No functional change.
> 
> Signed-off-by: Ahmad Fatoum 
> ---

Applied, thanks

Sascha

-- 
Pengutronix e.K.   | |
Steuerwalder Str. 21   | http://www.pengutronix.de/  |
31137 Hildesheim, Germany  | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |

___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


Re: [PATCH] habv4: add the possibility to changing the signing area from Kconfig

2019-12-11 Thread Sascha Hauer
On Wed, Dec 11, 2019 at 08:57:45AM +0100, Maik Otto wrote:
> Hi Sascha,
> 
> in my opinion it is better to have it configurable, because ther are
> different use cases and security requirements.
> i found the problem by creating  a sd-card \emmc image with wic.  The
> mbr, the partition table and bootloader became be signed at barebox
> build and wic changes
> the partition table at the end of the build process. Then the sd card
> image could not boot , because the signature was wrong. yeah secure boot
> works :-)
> the highest protection you have, when mbr and partition table is signed
> with the bootloader, but it is not always necessary.

But in which cases is it really necessary? I can't think of any. The mbr
and partition table are not evaluated by the ROM code, hence they do not
need to be signed for HAB.

The images generated by the build system all do not have a partition table
included, so basically we are currently enforcing no partition table at
all which is just not useful.

I think the current way of including the first KiB in signed area comes
from the fact that we started doing HAB on a NAND device which doesn't
have a partition table. Other projects we are currently doing use eMMC
where we use the boot partitions, again no MBR or partition table.

If we had started on SD cards, we wouldn't have included the partition
table in the signature and also would never have thought it would be a
good idea to do so.

Regards
 Sascha

-- 
Pengutronix e.K.   | |
Steuerwalder Str. 21   | http://www.pengutronix.de/  |
31137 Hildesheim, Germany  | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |

___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox