[PATCH] ARM: i.MX8MP: König+Bauer AlphaJet: remove barebox partition from eMMC

2024-08-13 Thread Roland Hieber
The board cannot boot from eMMC because the SoM does not configure the
boot pins appropriately, and has no way of choosing the eMMC as a boot
medium. Instead, the area is used for the GPT partition table. Remove
the confusing entry from the fixed partition table.

Signed-off-by: Roland Hieber 
---
 arch/arm/dts/imx8mp-koenigbauer-alphajet.dts | 5 -
 1 file changed, 5 deletions(-)

diff --git a/arch/arm/dts/imx8mp-koenigbauer-alphajet.dts 
b/arch/arm/dts/imx8mp-koenigbauer-alphajet.dts
index 5f8c83f2a26c..0f6f7e844e88 100644
--- a/arch/arm/dts/imx8mp-koenigbauer-alphajet.dts
+++ b/arch/arm/dts/imx8mp-koenigbauer-alphajet.dts
@@ -79,11 +79,6 @@ &usdhc3 { /* on-SoM eMMC */
#address-cells = <1>;
#size-cells = <1>;
 
-   partition@0 {
-   label = "barebox";
-   reg = <0x0 0xe>;
-   };
-
env_emmc: partition@e {
label = "barebox-environment";
reg = <0xe 0x2>;
-- 
2.39.2




[PATCH] commands: mipi_dbi: fix null pointer dereference when writing data

2024-05-27 Thread Roland Hieber
When accessing argv[optind + i], the whole array index must stay below
argc, not only i. Also val is only 4 bytes long, so when indexed with i
(which was initialised to optind, which is at least 3) will overflow
after reading one data argument from the command line. Add a guard
against the latter case, and initialise i to 0 to fix the first problem.

Signed-off-by: Roland Hieber 
---
 commands/mipi_dbi.c | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/commands/mipi_dbi.c b/commands/mipi_dbi.c
index b9b665b72151..075d08d2ffb5 100644
--- a/commands/mipi_dbi.c
+++ b/commands/mipi_dbi.c
@@ -79,7 +79,12 @@ static int do_mipi_dbi(int argc, char *argv[])
if (optind == argc && !write)
return mipi_dbi_command_show(dbi, cmd);
 
-   for (i = optind; i < argc; i++) {
+   if (argc > 6) {
+   printf("Error: can only write up to 4 byte at once!\n");
+   return -EOVERFLOW;
+   }
+
+   for (i = 0; i + optind < argc; i++) {
ret = kstrtou8(argv[optind + i], 16, &val[i]);
if (ret < 0)
return ret;
-- 
2.39.2




[PATCH] ARM: dts: GoMe e143_01: fix default state priorities

2024-05-15 Thread Roland Hieber
During the initial installation we can forgo writing an initial state
variable set to the eMMC if it is zeroed, and if the default values
priorities are set correctly. Since only the first rootfs partition is
populated during the install process, it should be preferred over the
second rootfs.

Signed-off-by: Roland Hieber 
---
 arch/arm/dts/imx7d-gome-e143_01.dts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/dts/imx7d-gome-e143_01.dts 
b/arch/arm/dts/imx7d-gome-e143_01.dts
index ea118ddc76f7..ed7f3cfa216b 100644
--- a/arch/arm/dts/imx7d-gome-e143_01.dts
+++ b/arch/arm/dts/imx7d-gome-e143_01.dts
@@ -50,7 +50,7 @@ remaining_attempts@0 {
priority@4 {
reg = <0x4 0x4>;
type = "uint32";
-   default = <10>;
+   default = <20>;
};
};
 
@@ -67,7 +67,7 @@ remaining_attempts@8 {
priority@c {
reg = <0xc 0x4>;
type = "uint32";
-   default = <20>;
+   default = <10>;
};
};
 
-- 
2.39.2




[PATCH] net: phy: dp83867: reset PHY on probe

2024-05-07 Thread Roland Hieber
Some PHY variants set the DP83867_PHYCR_FORCE_LINK_GOOD bit by default,
which should be unset if we want to rely on autonegotiation. Port
dp83867_phy_reset() from Linux v6.9-rc7, which already does all
necessary things, and call it in dp83867_probe(). (Keep the functions in
the original order so that the diff stays clean.)

Suggested-by: Oleksij Rempel 
Signed-off-by: Roland Hieber 
---
 drivers/net/phy/dp83867.c | 18 ++
 1 file changed, 18 insertions(+)

diff --git a/drivers/net/phy/dp83867.c b/drivers/net/phy/dp83867.c
index 5dc5bac12536..aefc65148926 100644
--- a/drivers/net/phy/dp83867.c
+++ b/drivers/net/phy/dp83867.c
@@ -362,6 +362,8 @@ static int dp83867_of_init(struct phy_device *phydev)
return 0;
 }
 
+static int dp83867_phy_reset(struct phy_device *phydev); /* see below */
+
 static int dp83867_probe(struct phy_device *phydev)
 {
struct dp83867_private *dp83867;
@@ -370,6 +372,8 @@ static int dp83867_probe(struct phy_device *phydev)
 
phydev->priv = dp83867;
 
+   dp83867_phy_reset(phydev);
+
return dp83867_of_init(phydev);
 }
 
@@ -563,6 +567,20 @@ static int dp83867_config_init(struct phy_device *phydev)
return 0;
 }
 
+static int dp83867_phy_reset(struct phy_device *phydev)
+{
+   int err;
+
+   err = phy_write(phydev, DP83867_CTRL, DP83867_SW_RESTART);
+   if (err < 0)
+   return err;
+
+   udelay(20);
+
+   return phy_modify(phydev, MII_DP83867_PHYCTRL,
+DP83867_PHYCR_FORCE_LINK_GOOD, 0);
+}
+
 static struct phy_driver dp83867_driver[] = {
{
.phy_id = DP83867_PHY_ID,
-- 
2.39.2




[PATCH] ARM: i.MX8MP: fix compatible string for koenigbauer,alphajet board

2024-04-30 Thread Roland Hieber
During the review of the initial board support patch, the SoM compatible
was changed (and unified) to "congatec,qmx8p" from several different
incompatible variants. However, the compatible in the alphajet device
tree contained a different typo and was overlooked, which had the effect
that the barebox_update handler and the Ethernet fixups were not
registered on the alphajet board.

Fixes: 34f14b1519715d47d879 (2024-03-11, "ARM: i.MX8MP: add König+Bauer 
AlphaJet board")
Rubberducked-by: Ahmad Fatoum 
Signed-off-by: Roland Hieber 
---
 arch/arm/dts/imx8mp-koenigbauer-alphajet.kernel.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/dts/imx8mp-koenigbauer-alphajet.kernel.dts 
b/arch/arm/dts/imx8mp-koenigbauer-alphajet.kernel.dts
index 3f958ddf78e8..198fe1379a05 100644
--- a/arch/arm/dts/imx8mp-koenigbauer-alphajet.kernel.dts
+++ b/arch/arm/dts/imx8mp-koenigbauer-alphajet.kernel.dts
@@ -7,7 +7,7 @@
 
 / {
model = "Koenig+Bauer Alphajet";
-   compatible = "koenigbauer,alphajet", "congatec,qmxp8p", "fsl,imx8mp";
+   compatible = "koenigbauer,alphajet", "congatec,qmx8p", "fsl,imx8mp";
 
display {
compatible = "innolux,g101ice-l01";
-- 
2.39.2




Re: [PATCH v2] ARM: i.MX8MP: add König+Bauer AlphaJet board

2024-03-11 Thread Roland Hieber
On Mon, Mar 11, 2024 at 03:04:56PM +0100, Roland Hieber wrote:
> From: Johannes Zink 
> 
> Add basic support for König+Bauer AlphaJet, based on a Congatec QMX8MP
> SoM with an i.MX8MP SoC in the Industrial Temperature Grade 4GB Variant,
> no inline ECC used.
> 
> Co-Developed-by: Juergen Borleis 
> Signed-off-by: Juergen Borleis 
> Signed-off-by: Johannes Zink 

These two sadly no longer work at PTX ,and the mails will bounce,
removing them from Cc.

 - Roland

> Signed-off-by: Roland Hieber 
> ---
> PATCH v2:
> * take over from Johannes Zink and Jürgen Borleis
> * rebase to current master
> * unify "kb", "koenig-bauer" etc. prefixes into "koenigbauer"
> * use "congatec" vendor prefix according to
>   linux/Documentation/devicetree/bindings/vendor-prefixes.yaml
> * use same sort order for board entries in Kconfig and Makefiles
> * add SPDX-File-Copyright tags
> * cleanup device tree style and whitespace
> * lowlevel.c: rename start_atf() -> start_tfa() for consistency
> * lowlevel.c: add image metadata
> 
> Address review feedback from PATCH v1:
> * split up device trees into upstream (kernel) part and barebox fixups
> * name board folder after SoM
>   - remove now redundant SoM name in flash-header.imxcfg
> * split up kconfig options for SoM and board
> * fix up SoM name, should be "QMX8P"
> * fix undefined symbols in Makefile.imx
> * add the board to multi_v8_defconfig and imx_v8_defconfig
> * board.c: fix "if() {" code style
> * board.c: refactor "kb,alphajet" platform driver into generic
>   "congatec,qmx8p" driver to setup ETH PHY fixup and FlexSPI bbu handler
> * board.c: setup_ethernet_phy: add note about broken regulator handling
> * lowlevel.c: move imx8mp_early_clock_init() into start_tfa, similar to
>   
> https://lore.barebox.org/barebox/20230523095330.3475712-1-a.fat...@pengutronix.de/
> 
> PATCH v1: 
> https://lore.barebox.org/barebox/20230601-koenigbauer-alphajet-upstreaming-v1-1-bcdcc1f13...@pengutronix.de/
> ---
>  arch/arm/boards/Makefile  |1 +
>  arch/arm/boards/congatec-qmx8p/Makefile   |4 +
>  arch/arm/boards/congatec-qmx8p/board.c|   64 +
>  .../flash-header-congatec-qmx8p.imxcfg|   10 +
>  arch/arm/boards/congatec-qmx8p/lowlevel.c |  128 ++
>  .../arm/boards/congatec-qmx8p/lpddr4-timing.c | 1832 +
>  arch/arm/configs/imx_v8_defconfig |1 +
>  arch/arm/configs/multi_v8_defconfig   |1 +
>  arch/arm/dts/Makefile |1 +
>  arch/arm/dts/imx8mp-congatec-qmx8p.dtsi   |   25 +
>  .../arm/dts/imx8mp-congatec-qmx8p.kernel.dtsi | 1040 ++
>  arch/arm/dts/imx8mp-koenigbauer-alphajet.dts  |   96 +
>  .../imx8mp-koenigbauer-alphajet.kernel.dts|   90 +
>  arch/arm/mach-imx/Kconfig |   14 +
>  images/Makefile.imx   |2 +
>  15 files changed, 3309 insertions(+)
>  create mode 100644 arch/arm/boards/congatec-qmx8p/Makefile
>  create mode 100644 arch/arm/boards/congatec-qmx8p/board.c
>  create mode 100644 
> arch/arm/boards/congatec-qmx8p/flash-header-congatec-qmx8p.imxcfg
>  create mode 100644 arch/arm/boards/congatec-qmx8p/lowlevel.c
>  create mode 100644 arch/arm/boards/congatec-qmx8p/lpddr4-timing.c
>  create mode 100644 arch/arm/dts/imx8mp-congatec-qmx8p.dtsi
>  create mode 100644 arch/arm/dts/imx8mp-congatec-qmx8p.kernel.dtsi
>  create mode 100644 arch/arm/dts/imx8mp-koenigbauer-alphajet.dts
>  create mode 100644 arch/arm/dts/imx8mp-koenigbauer-alphajet.kernel.dts
> 
> diff --git a/arch/arm/boards/Makefile b/arch/arm/boards/Makefile
> index e597b02be6c9..5eb5cbefb1c3 100644
> --- a/arch/arm/boards/Makefile
> +++ b/arch/arm/boards/Makefile
> @@ -83,6 +83,7 @@ obj-$(CONFIG_MACH_NXP_IMX8MQ_EVK)   += 
> nxp-imx8mq-evk/
>  obj-$(CONFIG_MACH_NXP_IMX8MM_EVK)+= nxp-imx8mm-evk/
>  obj-$(CONFIG_MACH_NXP_IMX8MN_EVK)+= nxp-imx8mn-evk/
>  obj-$(CONFIG_MACH_NXP_IMX8MP_EVK)+= nxp-imx8mp-evk/
> +obj-$(CONFIG_MACH_CONGATEC_QMX8P_SOM)+= congatec-qmx8p/
>  obj-$(CONFIG_MACH_TQ_MBA8MPXL)   += tqma8mpxl/
>  obj-$(CONFIG_MACH_OMAP343xSDP)   += omap343xdsp/
>  obj-$(CONFIG_MACH_OMAP3EVM)  += omap3evm/
> diff --git a/arch/arm/boards/congatec-qmx8p/Makefile 
> b/arch/arm/boards/congatec-qmx8p/Makefile
> new file mode 100644
> index ..b3ae72be3e3b
> --- /dev/null
> +++ b/arch/arm/boards/congatec-qmx8p/Makefile
> @@ -0,0 +1,4 @@
> +# SPDX-License-Identifier:  GPL-2.0+
> +
> +obj-y += board.o
> +lwl-y += lowlevel.o lpddr4-timing.o
> diff --git a/arch/arm/

[PATCH v2] ARM: i.MX8MP: add König+Bauer AlphaJet board

2024-03-11 Thread Roland Hieber
From: Johannes Zink 

Add basic support for König+Bauer AlphaJet, based on a Congatec QMX8MP
SoM with an i.MX8MP SoC in the Industrial Temperature Grade 4GB Variant,
no inline ECC used.

Co-Developed-by: Juergen Borleis 
Signed-off-by: Juergen Borleis 
Signed-off-by: Johannes Zink 
Signed-off-by: Roland Hieber 
---
PATCH v2:
* take over from Johannes Zink and Jürgen Borleis
* rebase to current master
* unify "kb", "koenig-bauer" etc. prefixes into "koenigbauer"
* use "congatec" vendor prefix according to
  linux/Documentation/devicetree/bindings/vendor-prefixes.yaml
* use same sort order for board entries in Kconfig and Makefiles
* add SPDX-File-Copyright tags
* cleanup device tree style and whitespace
* lowlevel.c: rename start_atf() -> start_tfa() for consistency
* lowlevel.c: add image metadata

Address review feedback from PATCH v1:
* split up device trees into upstream (kernel) part and barebox fixups
* name board folder after SoM
  - remove now redundant SoM name in flash-header.imxcfg
* split up kconfig options for SoM and board
* fix up SoM name, should be "QMX8P"
* fix undefined symbols in Makefile.imx
* add the board to multi_v8_defconfig and imx_v8_defconfig
* board.c: fix "if() {" code style
* board.c: refactor "kb,alphajet" platform driver into generic
  "congatec,qmx8p" driver to setup ETH PHY fixup and FlexSPI bbu handler
* board.c: setup_ethernet_phy: add note about broken regulator handling
* lowlevel.c: move imx8mp_early_clock_init() into start_tfa, similar to
  
https://lore.barebox.org/barebox/20230523095330.3475712-1-a.fat...@pengutronix.de/

PATCH v1: 
https://lore.barebox.org/barebox/20230601-koenigbauer-alphajet-upstreaming-v1-1-bcdcc1f13...@pengutronix.de/
---
 arch/arm/boards/Makefile  |1 +
 arch/arm/boards/congatec-qmx8p/Makefile   |4 +
 arch/arm/boards/congatec-qmx8p/board.c|   64 +
 .../flash-header-congatec-qmx8p.imxcfg|   10 +
 arch/arm/boards/congatec-qmx8p/lowlevel.c |  128 ++
 .../arm/boards/congatec-qmx8p/lpddr4-timing.c | 1832 +
 arch/arm/configs/imx_v8_defconfig |1 +
 arch/arm/configs/multi_v8_defconfig   |1 +
 arch/arm/dts/Makefile |1 +
 arch/arm/dts/imx8mp-congatec-qmx8p.dtsi   |   25 +
 .../arm/dts/imx8mp-congatec-qmx8p.kernel.dtsi | 1040 ++
 arch/arm/dts/imx8mp-koenigbauer-alphajet.dts  |   96 +
 .../imx8mp-koenigbauer-alphajet.kernel.dts|   90 +
 arch/arm/mach-imx/Kconfig |   14 +
 images/Makefile.imx   |2 +
 15 files changed, 3309 insertions(+)
 create mode 100644 arch/arm/boards/congatec-qmx8p/Makefile
 create mode 100644 arch/arm/boards/congatec-qmx8p/board.c
 create mode 100644 
arch/arm/boards/congatec-qmx8p/flash-header-congatec-qmx8p.imxcfg
 create mode 100644 arch/arm/boards/congatec-qmx8p/lowlevel.c
 create mode 100644 arch/arm/boards/congatec-qmx8p/lpddr4-timing.c
 create mode 100644 arch/arm/dts/imx8mp-congatec-qmx8p.dtsi
 create mode 100644 arch/arm/dts/imx8mp-congatec-qmx8p.kernel.dtsi
 create mode 100644 arch/arm/dts/imx8mp-koenigbauer-alphajet.dts
 create mode 100644 arch/arm/dts/imx8mp-koenigbauer-alphajet.kernel.dts

diff --git a/arch/arm/boards/Makefile b/arch/arm/boards/Makefile
index e597b02be6c9..5eb5cbefb1c3 100644
--- a/arch/arm/boards/Makefile
+++ b/arch/arm/boards/Makefile
@@ -83,6 +83,7 @@ obj-$(CONFIG_MACH_NXP_IMX8MQ_EVK) += 
nxp-imx8mq-evk/
 obj-$(CONFIG_MACH_NXP_IMX8MM_EVK)  += nxp-imx8mm-evk/
 obj-$(CONFIG_MACH_NXP_IMX8MN_EVK)  += nxp-imx8mn-evk/
 obj-$(CONFIG_MACH_NXP_IMX8MP_EVK)  += nxp-imx8mp-evk/
+obj-$(CONFIG_MACH_CONGATEC_QMX8P_SOM)  += congatec-qmx8p/
 obj-$(CONFIG_MACH_TQ_MBA8MPXL) += tqma8mpxl/
 obj-$(CONFIG_MACH_OMAP343xSDP) += omap343xdsp/
 obj-$(CONFIG_MACH_OMAP3EVM)+= omap3evm/
diff --git a/arch/arm/boards/congatec-qmx8p/Makefile 
b/arch/arm/boards/congatec-qmx8p/Makefile
new file mode 100644
index ..b3ae72be3e3b
--- /dev/null
+++ b/arch/arm/boards/congatec-qmx8p/Makefile
@@ -0,0 +1,4 @@
+# SPDX-License-Identifier:  GPL-2.0+
+
+obj-y += board.o
+lwl-y += lowlevel.o lpddr4-timing.o
diff --git a/arch/arm/boards/congatec-qmx8p/board.c 
b/arch/arm/boards/congatec-qmx8p/board.c
new file mode 100644
index ..fcec2a17c43c
--- /dev/null
+++ b/arch/arm/boards/congatec-qmx8p/board.c
@@ -0,0 +1,64 @@
+// SPDX-License-Identifier: GPL-2.0
+// SPDX-FileCopyrightText: 2023 Juergen Borleis, Pengutronix
+// SPDX-FileCopyrightText: 2023 Johannes Zink, Pengutronix
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/* Phy regulator handling in Linux is broken for the MX8 EQOs, as the
+ * 'phy-regulators' properties are not handed down properly,

Re: [PATCH v2 2/2] raspi: fixup additional vc created nodes

2024-02-19 Thread Roland Hieber
Hi,

On Mon, Sep 25, 2023 at 01:10:05PM +0200, Denis Osterland-Heim wrote:
> From: Denis OSTERLAND-HEIM 
> 
> The video core creates some additional nodes.
> This code takes over this values.
> The /hat node is only there if an raspi hat with EEPROM is detected.
> 
> Signed-off-by: Denis OSTERLAND-HEIM 
> Acked-by: Ahmad Fatoum 
> ---
>  arch/arm/boards/raspberry-pi/rpi-common.c | 39 +--
>  1 file changed, 30 insertions(+), 9 deletions(-)
> 
> diff --git a/arch/arm/boards/raspberry-pi/rpi-common.c
> b/arch/arm/boards/raspberry-pi/rpi-common.c
> index ceafd55a56..713fad78c9 100644
> --- a/arch/arm/boards/raspberry-pi/rpi-common.c
> +++ b/arch/arm/boards/raspberry-pi/rpi-common.c
> @@ -264,19 +264,37 @@ static enum reset_src_type
> rpi_decode_pm_rsts(struct device_node *chosen,
>  
>  static int rpi_vc_fdt_fixup(struct device_node *root, void *data)
>  {
> -   const struct device_node *vc_chosen = data;
> -   struct device_node *chosen;
> +   const struct device_node *vc_node = data;
> +   struct device_node *node;
> +   struct property *pp;
>  
> -   chosen = of_create_node(root, "/chosen");
> -   if (!chosen)
> +   node = of_create_node(root, vc_node->full_name);
> +   if (!node)
> return -ENOMEM;
>  
> -   of_copy_property(vc_chosen, "overlay_prefix", chosen);
> -   of_copy_property(vc_chosen, "os_prefix", chosen);
> +   for_each_property_of_node(vc_node, pp)
> +   of_copy_property(vc_node, pp->name, node);
>  
> return 0;
>  }
>  
> +static struct device_node *register_vc_fixup(struct device_node *root,
> +    const char *path)
> +{
> +   struct device_node *ret, *tmp;
> +
> +   ret = of_find_node_by_path_from(root, path);
> +   if (ret) {
> +   tmp = of_dup(ret);
> +   tmp->full_name = xstrdup(ret->full_name);
> +   of_register_fixup(rpi_vc_fdt_fixup, tmp);
> +   } else {
> +   pr_info("no '%s' node found in vc fdtn", path);
> +   }
> +
> +   return ret;
> +}
> +
>  static u32 rpi_boot_mode, rpi_boot_part;
>  /* Extract useful information from the VideoCore FDT we got.
>   * Some parameters are defined here:
> @@ -300,14 +318,17 @@ static void rpi_vc_fdt_parse(struct device_node
> *root)
> free(str);
> }
>  
> -   chosen = of_find_node_by_path_from(root, "/chosen");
> +   register_vc_fixup(root, "/system");
> +   register_vc_fixup(root, "/axi");
> +   register_vc_fixup(root, "/reserved-memory");
> +   register_vc_fixup(root, "/hat");
> +   register_vc_fixup(root, "/chosen/bootloader");
> +   chosen = register_vc_fixup(root, "/chosen");

This throws a lot of new warnings and errors on our RPi 3B:

barebox 2024.01.0 #1 2024-02-01T00:00:00+00:00
Buildsystem version: DistroKit-2019.12.0-552-g775624b9f5d6

Board: Raspberry Pi 3 Model B
deep-probe: supported due to raspberrypi,3-model-b
netconsole: registered as netconsole-1
bcm2835-sdhost 3f202000@7e202000.of: registered as mci0
bcm2835_mci 3f30@7e30.of: registered as mci1
mci0: detected SD card version 2.0
mci0: registered disk0
state: New state registered 'state'
state: Using bucket 0@0x
malloc space: 0x1d87f620 -> 0x3b0fec3f (size 472.5 MiB)
WARNING: no property 'serial-number' found in vc fdt's '' node
no '/system' node found in vc fdt
no '/axi' node found in vc fdt
no '/hat' node found in vc fdt
no '/chosen/bootloader' node found in vc fdt
WARNING: no property 'bootargs' found in vc fdt's '/chosen' node
WARNING: no property 'overlay_prefix' found in vc fdt's '/chosen' node
WARNING: no property 'os_prefix' found in vc fdt's '/chosen' node
WARNING: 'pm_rsts' value not found in vc fdt
ERROR: Won't delete root device node
environment load /boot/barebox.env: No such file or directory
Maybe you have to create the partition.

Do you have any idea what is going on here? 

I also don't see /vc.dtb, which should have been created. I have
'vc.kernel: kernel7.img' in the 'global' output, but nothing else
starting with vc.*.

 - Roland

> if (!chosen) {
> pr_err("no '/chosen' node found in vc fdtn");
> goto out;
> }
>  
> -   of_register_fixup(rpi_vc_fdt_fixup, of_dup(chosen));
> -
> bootloader = of_find_node_by_name(chosen, "bootloader");
>  
> str = of_read_vc_string(chosen, "bootargs");
> -- 
> 2.39.2
> 
> 

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



[PATCH 2/3] ARM: i.MX7: Import GoMe device trees from kernel

2023-11-27 Thread Roland Hieber
The kernel device tree for the VAR-SOM-MX7 System-on-Module and the
Gossen Metrawatt Profitest MF (e143_01) have been submitted upstream:
http://lore.kernel.org/r/20231127-b4-imx7-var-som-gome-v1-0-f26f88f2d...@pengutronix.de

Until the fixes are in the upstream kernel and synced to our dts/
folder, add them here so we can already use them. This also includes the
dt-schema validation fixes to the upstream i.MX7 device trees mentioned
in the upstream kernel series.

Signed-off-by: Roland Hieber 
---
 arch/arm/dts/imx7d-gome-e143_01.kernel.dts |  561 
 arch/arm/dts/imx7d-pinfunc.kernel.h|8 +
 arch/arm/dts/imx7d-var-som-mx7.kernel.dtsi |  607 +
 arch/arm/dts/imx7d.kernel.dtsi |  226 
 arch/arm/dts/imx7s.kernel.dtsi | 1354 
 5 files changed, 2756 insertions(+)
 create mode 100644 arch/arm/dts/imx7d-gome-e143_01.kernel.dts
 create mode 100644 arch/arm/dts/imx7d-pinfunc.kernel.h
 create mode 100644 arch/arm/dts/imx7d-var-som-mx7.kernel.dtsi
 create mode 100644 arch/arm/dts/imx7d.kernel.dtsi
 create mode 100644 arch/arm/dts/imx7s.kernel.dtsi

diff --git a/arch/arm/dts/imx7d-gome-e143_01.kernel.dts 
b/arch/arm/dts/imx7d-gome-e143_01.kernel.dts
new file mode 100644
index ..19c7a3d4260e
--- /dev/null
+++ b/arch/arm/dts/imx7d-gome-e143_01.kernel.dts
@@ -0,0 +1,561 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/**
+ * Copyright (C) 2022 Gossen Metrawatt GmbH
+ * Copyright (C) 2022 Marco Felsch, Pengutronix
+ * Copyright (C) 2022 Philipp Zabel, Pengutronix
+ * Copyright (C) 2022 Roland Hieber, Pengutronix
+ */
+/dts-v1/;
+
+#include 
+#include 
+#include 
+#include "imx7d-var-som-mx7.dtsi"
+
+/ {
+   model = "Gossen Metrawatt Profitest MF (e143_01)";
+   compatible = "gome,e143_01", "variscite,var-som-mx7", "fsl,imx7d";
+
+   aliases {
+   gpio7 = &gpio8;
+   rtc0 = &rtc0;
+   };
+
+   max98357a: audio-codec {
+   compatible = "maxim,max98357a";
+   #sound-dai-cells = <0>;
+   pinctrl-names = "default";
+   pinctrl-0 = <&pinctrl_sdmode>;
+   sdmode-gpios = <&gpio3 20 GPIO_ACTIVE_HIGH>; // Pin 60 
AUDIO_SHDN_B
+   };
+
+   gpio-keys {
+   compatible = "gpio-keys";
+   pinctrl-names = "default";
+   pinctrl-0 = <&pinctrl_gpio_keys>, <&pinctrl_gpio_keys_2>;
+   autorepeat;
+
+   button-0 {
+   label = "S0";
+   gpios = <&gpio1 12 GPIO_ACTIVE_LOW>; // Pin 183 
BTN_S0_ESC
+   linux,code = ;
+   wakeup-source;
+   };
+
+   button-1 {
+   label = "S1";
+   gpios = <&gpio1 11 GPIO_ACTIVE_LOW>; // Pin 185 
BTN_S1_MEM
+   linux,code = ;
+   wakeup-source;
+   };
+
+   button-2 {
+   label = "S2";
+   gpios = <&gpio1 10 GPIO_ACTIVE_LOW>; // Pin 181 
BTN_S2_HLP
+   linux,code = ;
+   wakeup-source;
+   };
+
+   button-3 {
+   label = "S3";
+   gpios = <&gpio1 1 GPIO_ACTIVE_LOW>; // Pin 1 BTN_S3_STA
+   linux,code = ;
+   wakeup-source;
+   };
+
+   button-4 {
+   label = "S4";
+   gpios = <&gpio1 2 GPIO_ACTIVE_LOW>; // Pin 168 
BTN_S4_IDN
+   linux,code = ;
+   wakeup-source;
+   };
+
+   button-5 {
+   label = "S5";
+   gpios = <&gpio3 24 GPIO_ACTIVE_LOW>; // Pin 28 BTN_S5
+   linux,code = ;
+   };
+
+   button-6 {
+   label = "S6";
+   gpios = <&gpio3 5 GPIO_ACTIVE_LOW>; // Pin 40 BTN_S6
+   linux,code = ;
+   };
+
+   button-7 {
+   label = "S7";
+   gpios = <&gpio3 22 GPIO_ACTIVE_LOW>; // Pin 38 BTN_S7
+   linux,code = ;
+   };
+
+   button-8 {
+   label = "S8";
+   gpios = <&gpio3 4 GPIO_ACTIVE_LOW>; // Pin 36 BTN_S8
+   linux,code = ;
+   };
+
+   button-9 {
+   label = "S9";
+   gpios = <&gpio3 27 GPIO_ACTIVE_LOW>; // Pin 20 BTN_S9
+   

[PATCH 1/3] drivers: regulator: make pfuze available on i.MX7 too

2023-11-27 Thread Roland Hieber
It can also not hurt to build it for compile-tests.

Signed-off-by: Roland Hieber 
---
 drivers/regulator/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
index 56abe3896e3b..17e217f0bba7 100644
--- a/drivers/regulator/Kconfig
+++ b/drivers/regulator/Kconfig
@@ -20,7 +20,7 @@ config REGULATOR_BCM283X
 config REGULATOR_PFUZE
bool "Freescale PFUZE100/200/3000 regulator driver"
depends on I2C
-   depends on ARCH_IMX6 || ARCH_IMX8MQ
+   depends on ARCH_IMX || COMPILE_TEST
 
 config REGULATOR_STM32_PWR
bool "STMicroelectronics STM32 PWR"
-- 
2.39.2




[PATCH 3/3] ARM: dts: add support for and Gossen Metrawatt e143_01

2023-11-27 Thread Roland Hieber
The e143_01 is based on the Variscite VAR-SOM-MX7. Re-use the kernel
device tree, add environment and state partitions, and a barebox-update
handler for the eMMC.

The DDR setup has been ported from the vendor U-Boot:
<https://github.com/varigit/uboot-imx/blob/imx_v2017.03_4.9.11_1.0.0_ga_var01/board/variscite/mx7dvar_som/imximage.cfg>

Signed-off-by: Roland Hieber 
---
 arch/arm/boards/Makefile  |   1 +
 arch/arm/boards/variscite-som-mx7/Makefile|   4 +
 arch/arm/boards/variscite-som-mx7/board.c |  25 
 .../variscite-som-mx7/flash-header.imxcfg | 100 +++
 arch/arm/boards/variscite-som-mx7/lowlevel.c  |  44 +++
 arch/arm/configs/imx_v7_defconfig |   1 +
 arch/arm/dts/Makefile |   1 +
 arch/arm/dts/imx7d-gome-e143_01.dts   | 119 ++
 arch/arm/dts/imx7d-var-som-mx7.dtsi   |   6 +
 arch/arm/mach-imx/Kconfig |   8 ++
 images/Makefile.imx   |   5 +
 11 files changed, 314 insertions(+)
 create mode 100644 arch/arm/boards/variscite-som-mx7/Makefile
 create mode 100644 arch/arm/boards/variscite-som-mx7/board.c
 create mode 100644 arch/arm/boards/variscite-som-mx7/flash-header.imxcfg
 create mode 100644 arch/arm/boards/variscite-som-mx7/lowlevel.c
 create mode 100644 arch/arm/dts/imx7d-gome-e143_01.dts
 create mode 100644 arch/arm/dts/imx7d-var-som-mx7.dtsi

diff --git a/arch/arm/boards/Makefile b/arch/arm/boards/Makefile
index bdac1e69ee60..37174eb14bcb 100644
--- a/arch/arm/boards/Makefile
+++ b/arch/arm/boards/Makefile
@@ -171,6 +171,7 @@ obj-$(CONFIG_MACH_VIRT2REAL)+= 
virt2real/
 obj-$(CONFIG_MACH_ZEDBOARD)+= avnet-zedboard/
 obj-$(CONFIG_MACH_ZYLONITE)+= zylonite/
 obj-$(CONFIG_MACH_VARISCITE_MX6)   += variscite-mx6/
+obj-$(CONFIG_MACH_VARISCITE_SOM_MX7)   += variscite-som-mx7/
 obj-$(CONFIG_MACH_VSCOM_BALTOS)+= vscom-baltos/
 obj-$(CONFIG_MACH_WARP7)   += element14-warp7/
 obj-$(CONFIG_MACH_WEBASTO_CCBV2)   += webasto-ccbv2/
diff --git a/arch/arm/boards/variscite-som-mx7/Makefile 
b/arch/arm/boards/variscite-som-mx7/Makefile
new file mode 100644
index ..5b7f460c6daf
--- /dev/null
+++ b/arch/arm/boards/variscite-som-mx7/Makefile
@@ -0,0 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0-only
+# SPDX-FileCopyrightText: 2022 Roland Hieber, Pengutronix 
+obj-y += board.o
+lwl-y += lowlevel.o
diff --git a/arch/arm/boards/variscite-som-mx7/board.c 
b/arch/arm/boards/variscite-som-mx7/board.c
new file mode 100644
index ..005228d107af
--- /dev/null
+++ b/arch/arm/boards/variscite-som-mx7/board.c
@@ -0,0 +1,25 @@
+// SPDX-License-Identifier: GPL-2.0-only
+// SPDX-FileCopyrightText: 2022 Roland Hieber, Pengutronix 

+
+#include 
+#include 
+#include 
+
+static int var_som_mx7_probe(struct device_d *dev)
+{
+   imx7_bbu_internal_mmcboot_register_handler("eMMC", "/dev/mmc2", 
BBU_HANDLER_FLAG_DEFAULT);
+   return 0;
+}
+
+static const struct of_device_id var_som_mx7_of_match[] = {
+   { .compatible = "variscite,var-som-mx7" },
+   { /* sentinel */ },
+};
+BAREBOX_DEEP_PROBE_ENABLE(var_som_mx7_of_match);
+
+static struct driver_d var_som_mx7_board_driver = {
+   .name = "board-var-som-mx7",
+   .probe = var_som_mx7_probe,
+   .of_compatible = DRV_OF_COMPAT(var_som_mx7_of_match),
+};
+postcore_platform_driver(var_som_mx7_board_driver);
diff --git a/arch/arm/boards/variscite-som-mx7/flash-header.imxcfg 
b/arch/arm/boards/variscite-som-mx7/flash-header.imxcfg
new file mode 100644
index ..a8ed640cb2c2
--- /dev/null
+++ b/arch/arm/boards/variscite-som-mx7/flash-header.imxcfg
@@ -0,0 +1,100 @@
+/*
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ * SPDX-FileCopyrightText: 2014-2016 Freescale Semiconductor, Inc.
+ * SPDX-FileCopyrightText: 2016 Variscite Ltd.
+ * SPDX-FileCopyrightText: 2022 Gossen Metrawatt GmbH
+ * SPDX-FileCopyrightText: 2022 Roland Hieber, Pengutronix 

+ */
+
+soc imx7
+loadaddr 0x8000
+ivtofs 0x400
+
+#include 
+
+/*
+ * Device Configuration Data (DCD)
+ *
+ * Each entry must have the format:
+ * Addr-type   AddressValue
+ *
+ * where:
+ *  Addr-type register length (1,2 or 4 bytes)
+ *  Address   absolute address of the register
+ *  value value to be stored in the register
+ */
+
+/* Change DDR freq. to 400Mhz */
+wm 32 0x30360070 0x00703021
+wm 32 0x30360090 0x
+wm 32 0x30360070 0x00603021
+check 32 until_all_bits_set 0x30360070 0x8000
+wm 32 0x30389880 0x0001
+
+
+wm 32 0x30340004 0x4F45/* Enable OCRAM EPDC */
+/* Clear then set bit30 to ensure exit from DDR retention */
+wm 32 0x30360388 0x4000
+wm 32 0x30360384 0x4000
+
+wm 32 0x30391000 0x0002/* deassert presetn */
+
+/* ddrc */
+wm 32 0x307a 0x01040001/* mstr */
+wm

[PATCH] commands: i2c_read: default to reading one byte

2023-11-22 Thread Roland Hieber
The help text for i2c_read specifies that -c is optional:

Usage: i2c_read [-bacrwv]

However, using i2c_read without -c falls through in do_i2c_read():

if ((addr < 0) || (count < 1) || (addr > 0x7F))
return COMMAND_ERROR_USAGE;

Actually make -c optional by initialising the count to 1.

Signed-off-by: Roland Hieber 
---
 commands/i2c.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/commands/i2c.c b/commands/i2c.c
index 997d49a94916..3a708531ee0a 100644
--- a/commands/i2c.c
+++ b/commands/i2c.c
@@ -195,7 +195,7 @@ static int do_i2c_read(int argc, char *argv[])
struct i2c_adapter *adapter = NULL;
struct i2c_client client;
u8 *buf;
-   int count = -1, addr = -1, reg = -1, verbose = 0, ret, opt, bus = 0, 
wide = 0;
+   int count = 1, addr = -1, reg = -1, verbose = 0, ret, opt, bus = 0, 
wide = 0;
 
while ((opt = getopt(argc, argv, "a:b:c:r:vw")) > 0) {
switch (opt) {
@@ -264,7 +264,7 @@ BAREBOX_CMD_HELP_OPT("-b BUS\t", "i2c bus number (default 
0)")
 BAREBOX_CMD_HELP_OPT("-a ADDR\t", "i2c device address")
 BAREBOX_CMD_HELP_OPT("-r START", "start register (optional, master receive 
mode if none given)")
 BAREBOX_CMD_HELP_OPT("-w\t",   "use word (16 bit) wide access")
-BAREBOX_CMD_HELP_OPT("-c COUNT", "byte count")
+BAREBOX_CMD_HELP_OPT("-c COUNT", "byte count (default 1)")
 BAREBOX_CMD_HELP_OPT("-v\t",   "verbose")
 BAREBOX_CMD_HELP_END
 
-- 
2.39.2




[PATCH v2] Documentation: dt-bindings: leds: document 'default-on' trigger

2023-11-22 Thread Roland Hieber
The default-on trigger has been supported in barebox since commit
767c6b4a814a2a000f3b (2014-02-28, Sascha Hauer: "led: Add default-on
trigger").

Signed-off-by: Roland Hieber 
---
PATCH v2:
 * change U+2013 EN DASH to U+002D HYPHEN-MINUS to be consistent
   with the rest of the list (feedback from Ulrich Ölmann)

PATCH v1: 
https://lore.barebox.org/barebox/20231121162009.160644-1-...@pengutronix.de
---
 Documentation/devicetree/bindings/leds/common.rst | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/leds/common.rst 
b/Documentation/devicetree/bindings/leds/common.rst
index 09b4e401bc2c..8bf41f0d649b 100644
--- a/Documentation/devicetree/bindings/leds/common.rst
+++ b/Documentation/devicetree/bindings/leds/common.rst
@@ -9,6 +9,7 @@ Common leds properties
 * ``net`` - LED indicates network activity (tx and rx)
 * ``net-rx`` - LED indicates network activity (rx only)
 * ``net-tx`` - LED indicates network activity (tx only)
+* ``default-on`` - LED is switched on by default
 
 * ``label``: The label for this LED. If omitted, the label is taken
   from the node name (excluding the unit address).
-- 
2.39.2




Re: [PATCH] Documentation: dt-bindings: leds: document 'default-on' trigger

2023-11-22 Thread Roland Hieber
On Wed, Nov 22, 2023 at 06:24:21AM +0100, Ulrich Ölmann wrote:
> Hi Roland,
> 
> On Tue, Nov 21 2023 at 17:20 +0100, Roland Hieber  wrote:
> > The default-on trigger has been supported in barebox since commit
> > 767c6b4a814a2a000f3b (2014-02-28, Sascha Hauer: "led: Add default-on
> > trigger").
> >
> > Signed-off-by: Roland Hieber 
> > ---
> >  Documentation/devicetree/bindings/leds/common.rst | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/Documentation/devicetree/bindings/leds/common.rst 
> > b/Documentation/devicetree/bindings/leds/common.rst
> > index 09b4e401bc2c..ad94ceb506b1 100644
> > --- a/Documentation/devicetree/bindings/leds/common.rst
> > +++ b/Documentation/devicetree/bindings/leds/common.rst
> > @@ -9,6 +9,7 @@ Common leds properties
> >  * ``net`` - LED indicates network activity (tx and rx)
> >  * ``net-rx`` - LED indicates network activity (rx only)
> >  * ``net-tx`` - LED indicates network activity (tx only)
> > +* ``default-on`` – LED is switched on by default
> 
> the lines before utilize the character '-' while in your new line a '–'
> is used. I think this should be consistent in one or the other
> direction.

Huh yes… these two characters you wrote look the same on my terminal,
but they are indeed different when I paste them somewhere else!

 - Roland

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



[PATCH] Documentation: dt-bindings: leds: document 'default-on' trigger

2023-11-21 Thread Roland Hieber
The default-on trigger has been supported in barebox since commit
767c6b4a814a2a000f3b (2014-02-28, Sascha Hauer: "led: Add default-on
trigger").

Signed-off-by: Roland Hieber 
---
 Documentation/devicetree/bindings/leds/common.rst | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/leds/common.rst 
b/Documentation/devicetree/bindings/leds/common.rst
index 09b4e401bc2c..ad94ceb506b1 100644
--- a/Documentation/devicetree/bindings/leds/common.rst
+++ b/Documentation/devicetree/bindings/leds/common.rst
@@ -9,6 +9,7 @@ Common leds properties
 * ``net`` - LED indicates network activity (tx and rx)
 * ``net-rx`` - LED indicates network activity (rx only)
 * ``net-tx`` - LED indicates network activity (tx only)
+* ``default-on`` – LED is switched on by default
 
 * ``label``: The label for this LED. If omitted, the label is taken
   from the node name (excluding the unit address).
-- 
2.39.2




[PATCH] doc: booting-linux: improve bootspec chapter

2023-10-06 Thread Roland Hieber
* use the official name of the spec in the title
* transform the URL to a link with title
* mention other well-known search terms (e.g. "blspec", which is used in
  PTXdist, and "bootspec", which is often used by my colleagues)
* don't highlight the scripts/kernel-install output as shell code
* keep the NFS boot paragraph near the SD boot paragraph
* format 'machine-id' and 'linux-appendroot' explanations as definition
  lists so they are easily found when looking for them
* pick some more low-hanging formatting and copy editing fruits (it's
  harvest season after all)

Signed-off-by: Roland Hieber 
---
 Documentation/user/booting-linux.rst | 43 
 1 file changed, 24 insertions(+), 19 deletions(-)

diff --git a/Documentation/user/booting-linux.rst 
b/Documentation/user/booting-linux.rst
index 76883862b938..b26ada943a59 100644
--- a/Documentation/user/booting-linux.rst
+++ b/Documentation/user/booting-linux.rst
@@ -163,12 +163,12 @@ setting the ``global.boot.default`` variable to ``mmc`` 
and then calling
 
 .. _bootloader_spec:
 
-Bootloader Spec
-^^^
+Boot Loader Specification
+^
 
-barebox supports booting according to the bootloader spec:
-
-https://uapi-group.org/specifications/specs/boot_loader_specification/
+barebox supports booting according to the `Boot Loader Specification
+<https://uapi-group.org/specifications/specs/boot_loader_specification/>`__
+(sometimes also known as *Bootloader Spec*, *bootspec* or *blspec*).
 
 It follows another philosophy than the :ref:`boot_entries`. With Boot Entries
 booting is completely configured in the bootloader. Bootloader Spec Entries
@@ -209,7 +209,7 @@ Spec Entry on a SD card:
 
 The entry can be listed with the ``-l`` option:
 
-.. code-block:: sh
+.. code-block:: none
 
   scripts/kernel-install --device=/dev/mmcblk0 -l
 
@@ -223,24 +223,29 @@ The entry can be listed with the ``-l`` option:
 When the SD card shows up as ``mmc1`` in barebox, this entry can be booted with
 ``boot mmc1`` or by setting ``global.boot.default`` to ``mmc1``.
 
-``machine-id`` is an optional key. If the ``global.boot.machine_id`` variable
-is set to a non-empty value, barebox will only boot the Bootloader Spec Entry
-whose ``machine-id`` key matches the ``global.boot.machine_id`` variable.
-All other Bootloader Spec entries will be ignored.
-
-A bootloader spec entry can also reside on an NFS server in which case an
-RFC2224-compatible NFS URI string must be passed to the boot command:
+A bootloader spec entry can also reside on an NFS server, in which case an
+`RFC 2224 <https://datatracker.ietf.org/doc/html/rfc2224>`__-compatible NFS URI
+must be passed to the boot command:
 
 .. code-block:: sh
 
   boot nfs://nfshost[:port]//path/
 
-In addition to the options defined in the original spec barebox understands the
-``linux-appendroot`` option. This is a boolean value and if set to ``true`` 
barebox
-will automatically append a ``root=`` string to the Linux commandline based on 
the
-device where the entry is found on. This makes it possible to use the same 
rootfs
-image on different devices without having to specify a different root= option 
each
-time.
+Additional notes about keys in the bootloader spec entries:
+
+``machine-id``
+   This key is optional. If the ``global.boot.machine_id`` variable is set to a
+   non-empty value, barebox will only boot the Bootloader Spec Entry whose
+   ``machine-id`` key matches the ``global.boot.machine_id`` variable.  All
+   other Bootloader Spec entries will be ignored.
+
+``linux-appendroot``
+   This boolean option is understood by Barebox although it is not part of the
+   original specification. If set to ``true``, barebox will automatically 
append
+   a ``root=`` string to the Linux commandline based on the device where the
+   entry is found on. This makes it possible to use the same rootfs image on
+   different devices without having to specify a different ``root=`` option 
each
+   time.
 
 .. _booting_linux_net:
 
-- 
2.39.2




[PATCH] doc: booting-linux: improve Bootloader spec section

2023-09-14 Thread Roland Hieber
Improve language and clarity of the text, and add formatting.

Signed-off-by: Roland Hieber 
---
 Documentation/user/booting-linux.rst | 36 ++--
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/Documentation/user/booting-linux.rst 
b/Documentation/user/booting-linux.rst
index 0ba6229797cd..76883862b938 100644
--- a/Documentation/user/booting-linux.rst
+++ b/Documentation/user/booting-linux.rst
@@ -172,13 +172,14 @@ 
https://uapi-group.org/specifications/specs/boot_loader_specification/
 
 It follows another philosophy than the :ref:`boot_entries`. With Boot Entries
 booting is completely configured in the bootloader. Bootloader Spec Entries
-on the other hand the boot entries are on a boot medium. This gives a boot 
medium
-the possibility to describe where a Kernel is and what parameters it needs.
+on the other hand are part of the boot medium. This gives a boot medium
+the possibility to describe where a kernel is located and which parameters are
+needed to boot it.
 
-All Bootloader Spec Entries are in a partition on the boot medium under 
``/loader/entries/*.conf``.
-In the Bootloader Spec a boot medium has a dedicated partition to use for
-boot entries. barebox is less strict, it accepts Bootloader Spec Entries on
-every partition barebox can read.
+All Bootloader Spec Entries are located in a partition on the boot medium under
+``/loader/entries/*.conf``. According to the Bootloader Spec, a boot medium has
+to use a dedicated partition for boot entries. barebox is less strict, it
+accepts Bootloader Spec Entries on every partition that barebox can read.
 
 A Bootloader Spec Entry consists of key value pairs::
 
@@ -194,7 +195,7 @@ A Bootloader Spec Entry consists of key value pairs::
 All paths are absolute paths in the partition. Bootloader Spec Entries can
 be created manually, but there also is the ``scripts/kernel-install`` tool to
 create/list/modify entries directly on a MMC/SD card or other media. To use
-it create a SD card / USB memory stick with a /boot partition with type 0xea.
+it, create an SD card / USB memory stick with a ``/boot`` partition with type 
``0xea``.
 The partition can be formatted with FAT or EXT4 filesystem. If you wish to 
write
 to it from barebox later you must use FAT. The following creates a Bootloader
 Spec Entry on a SD card:
@@ -206,7 +207,7 @@ Spec Entry on a SD card:
 --kernel=/home/sha/linux/arch/arm/boot/zImage 
--add-root-option \
 --root=/dev/mmcblk0p1 -o "console=ttymxc0,115200"
 
-The entry can be listed with the -l option:
+The entry can be listed with the ``-l`` option:
 
 .. code-block:: sh
 
@@ -219,23 +220,22 @@ The entry can be listed with the -l option:
 options:console=ttymxc0,115200 root=PARTUUID=0007CB20-01
 linux:  11ab7c89d02c4f66a4e2474ea25b2b84.15/linux
 
-When on barebox the SD card shows up as ``mmc1`` then this entry can be booted 
with
-``boot mmc1`` or with setting ``global.boot.default`` to ``mmc1``.
+When the SD card shows up as ``mmc1`` in barebox, this entry can be booted with
+``boot mmc1`` or by setting ``global.boot.default`` to ``mmc1``.
 
-``machine-id`` is an optional key. If ``global.boot.machine_id`` variable is 
set to
-non-empty value, then barebox accepts only Bootloader Spec entries with 
``machine-id``
-key. In case if value of global variable and Bootloader Spec key match each 
other,
-barebox will choose the boot entry for booting. All other Bootloader Spec 
entries will
-be ignored.
+``machine-id`` is an optional key. If the ``global.boot.machine_id`` variable
+is set to a non-empty value, barebox will only boot the Bootloader Spec Entry
+whose ``machine-id`` key matches the ``global.boot.machine_id`` variable.
+All other Bootloader Spec entries will be ignored.
 
-A bootloader spec entry can also reside on an NFS server in which case a 
RFC2224
-compatible NFS URI string must be passed to the boot command:
+A bootloader spec entry can also reside on an NFS server in which case an
+RFC2224-compatible NFS URI string must be passed to the boot command:
 
 .. code-block:: sh
 
   boot nfs://nfshost[:port]//path/
 
-Additionally to the options defined in the original spec barebox understands 
the
+In addition to the options defined in the original spec barebox understands the
 ``linux-appendroot`` option. This is a boolean value and if set to ``true`` 
barebox
 will automatically append a ``root=`` string to the Linux commandline based on 
the
 device where the entry is found on. This makes it possible to use the same 
rootfs
-- 
2.39.2




[PATCH] commands: global: document usage without parameters

2023-08-14 Thread Roland Hieber
Signed-off-by: Roland Hieber 
---
 commands/global.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/commands/global.c b/commands/global.c
index cf8e9a5b4894..a8ff5ea18fb0 100644
--- a/commands/global.c
+++ b/commands/global.c
@@ -50,6 +50,7 @@ static int do_global(int argc, char *argv[])
 
 BAREBOX_CMD_HELP_START(global)
 BAREBOX_CMD_HELP_TEXT("Add a new global variable named VAR, optionally set to 
VALUE.")
+BAREBOX_CMD_HELP_TEXT("Without options, print all global and env (prefixed 
with *) variables.")
 BAREBOX_CMD_HELP_TEXT("")
 BAREBOX_CMD_HELP_TEXT("Options:")
 BAREBOX_CMD_HELP_OPT("-r", "Remove globalvars")
@@ -58,7 +59,7 @@ BAREBOX_CMD_HELP_END
 BAREBOX_CMD_START(global)
.cmd= do_global,
BAREBOX_CMD_DESC("create or set global variables")
-   BAREBOX_CMD_OPTS("[-r] VAR[=VALUE] ...")
+   BAREBOX_CMD_OPTS("[-r] [VAR[=VALUE] ...]")
BAREBOX_CMD_GROUP(CMD_GRP_ENV)
BAREBOX_CMD_HELP(cmd_global_help)
BAREBOX_CMD_COMPLETE(global_complete)
-- 
2.39.2




[PATCH 4/4] doc: user: state: document backend references using GPT/MBR partitions

2023-08-08 Thread Roland Hieber
Explain first how to define the state node and variable set, and then
go into detail about the different variations of backend definitions,
including the options of referring to a backend partition by its
partuuid or letting barebox auto-detect it by its Type GUID.

Fixes: 776714d9570253c46635 (2023-06-07, "state: allow lookup of barebox state 
partition by Type GUID")
Suggested-by: Ahmad Fatoum 
Signed-off-by: Roland Hieber 
---
 .../devicetree/bindings/mtd/partition.rst |   2 +
 Documentation/user/state.rst  | 110 ++
 2 files changed, 90 insertions(+), 22 deletions(-)

diff --git a/Documentation/devicetree/bindings/mtd/partition.rst 
b/Documentation/devicetree/bindings/mtd/partition.rst
index 0f64dee3c3b3..0ba117dffcd3 100644
--- a/Documentation/devicetree/bindings/mtd/partition.rst
+++ b/Documentation/devicetree/bindings/mtd/partition.rst
@@ -1,3 +1,5 @@
+.. _devicetree_binding_mtd_partition:
+
 Representing flash partitions in devicetree
 ===
 
diff --git a/Documentation/user/state.rst b/Documentation/user/state.rst
index 7f4547f75507..9054a3792337 100644
--- a/Documentation/user/state.rst
+++ b/Documentation/user/state.rst
@@ -540,27 +540,14 @@ content, its backend-type and *state* variable layout.
 SD/eMMC and ATA
 ###
 
-The following devicetree node entry defines some kind of SD/eMMC memory and
-a partition at a specific offset inside it to be used as the backend for the
-*state* variable set.
-
-.. note::
+*state* node definition
+^^^
 
-   If the medium has an on-disk partition table, the device tree partition
-   must either be identical in start offset and size to the MBR/GPT partition
-   or it must reside in non-partitioned space. If this constraint is not
-   satisfied, barebox will emit an error message and refuse to register
-   the device tree partition.
-
-.. code-block:: text
-
-   backend_state_sd: part@10 {
-   label = "state";
-   reg = <0x10 0x2>;
-   };
-
-With this 'backend' definition it's possible to define the *state* variable set
-content, its backend-type and *state* variable layout.
+These storage types have integrated wear-levelling and can be addressed on the
+byte level. The *raw* backend type is suitable for this situation.
+We will explain the possible variants of referring to a backend below,
+but an exemplary definition of the *state* layout and variable set will look
+as follows:
 
 .. code-block:: text
 
@@ -584,8 +571,87 @@ content, its backend-type and *state* variable layout.
};
};
 
-If the *state* variable set is set to be located in a GPT partition, use
-``4778ed65-bf42-45fa-9c5b-287a1dc4aab1`` as the partition type GUID.
+
+Backend definition
+^^
+
+SD/eMMC and ATA devices usually have an on-disk partition table (MBR or GPT),
+which Barebox will parse when a block device is probed.
+There are multiple options to refer to these partitions as the *state* backend
+(i.e. the ``&backend_state_sd`` reference in the example above).
+
+Referencing the partition by GUID
+"""""""""""""""""""""""""""""""""
+
+When using GPT, the backend reference may point directly to a block device's
+device tree node. In this case Barebox will search for a GPT partition with 
Type
+UUID ``4778ed65-bf42-45fa-9c5b-287a1dc4aab1``, and if that partition exists,
+Barebox will use it as the *state* backend.
+
+Here is an abridged example:
+
+.. code-block:: text
+
+   / {
+   soc {
+   bus@210 {
+   mmc1: mmc@219 {
+   // … MMC device definition …
+   };
+   };
+
+   aliases {
+   state = &state_sd;
+   };
+
+   state_sd: state {
+   backend = <&mmc1>;
+   // … rest of definition as per above section
+   };
+   };
+
+This is the recommended approach for device tree enabled system with state
+located on SD or eMMC.
+
+Referencing the partition by *partuuid*
+"""""""""""""""""""""""""""""""""""""""
+
+For systems where block devices are not probed from device tree (e.g. with
+storage on ATA or PCI buses), the *state* partition can be looked up globally
+by specifying its *partuuid*. See the documentation for the :ref:`partuuid
+device tree binding ` for more details.
+
+The *partuuid* is expected to be unique across al

[PATCH 3/4] doc: user: state: update note about redefining existing partitions

2023-08-08 Thread Roland Hieber
Fixes: ec34c2f5333adfee4724 (2023-06-07, "cdev: have devfs_add_partition return 
existing identical partition, not NULL")
Suggested-by: Ahmad Fatoum 
Signed-off-by: Roland Hieber 
---
 Documentation/user/state.rst | 13 +
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/Documentation/user/state.rst b/Documentation/user/state.rst
index 594c2c15945b..7f4547f75507 100644
--- a/Documentation/user/state.rst
+++ b/Documentation/user/state.rst
@@ -542,10 +542,15 @@ SD/eMMC and ATA
 
 The following devicetree node entry defines some kind of SD/eMMC memory and
 a partition at a specific offset inside it to be used as the backend for the
-*state* variable set. Note that currently there is no support for on-disk
-partition tables. Instead, an ofpart partition description must be used. You
-have to make sure that this partition does not conflict with any other 
partition
-in the partition table.
+*state* variable set.
+
+.. note::
+
+   If the medium has an on-disk partition table, the device tree partition
+   must either be identical in start offset and size to the MBR/GPT partition
+   or it must reside in non-partitioned space. If this constraint is not
+   satisfied, barebox will emit an error message and refuse to register
+   the device tree partition.
 
 .. code-block:: text
 
-- 
2.39.2




[PATCH 1/4] doc: dt-bindings: barebox,environment: fix typo

2023-08-08 Thread Roland Hieber
Signed-off-by: Roland Hieber 

---
 .../devicetree/bindings/barebox/barebox,environment.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/barebox/barebox,environment.rst 
b/Documentation/devicetree/bindings/barebox/barebox,environment.rst
index 40239f424ac0..67d1173b2fdc 100644
--- a/Documentation/devicetree/bindings/barebox/barebox,environment.rst
+++ b/Documentation/devicetree/bindings/barebox/barebox,environment.rst
@@ -23,7 +23,7 @@ the path to the environment. Supported values for :
   be the label for MTD partitions, the number for DOS
   partitions (beginning with 0) or the name for GPT partitions.
 
-If the *environmnet* is located in a GPT partition, use
+If the *environment* is located in a GPT partition, use
 ``6C3737F2-07F8-45D1-AD45-15D260AAB24D`` as partition type GUID.
 
 The file-path is the name of a file located in a FAT filesystem on the
-- 
2.39.2




[PATCH 2/4] doc: dt-bindings: improve docs for barebox 'partuuid' property

2023-08-08 Thread Roland Hieber
Explain what the partuuid is, and make the lists valid reStructuredText
syntax.

Signed-off-by: Roland Hieber 
---
 .../devicetree/bindings/mtd/partition.rst   | 17 +
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/Documentation/devicetree/bindings/mtd/partition.rst 
b/Documentation/devicetree/bindings/mtd/partition.rst
index 627b59eda04b..0f64dee3c3b3 100644
--- a/Documentation/devicetree/bindings/mtd/partition.rst
+++ b/Documentation/devicetree/bindings/mtd/partition.rst
@@ -4,13 +4,22 @@ Representing flash partitions in devicetree
 In addition to the upstream binding, another property is added:
 
 Optional properties:
-- ``partuuid`` : The global partition UUID for this partition.
+
+* ``partuuid``: The global partition UUID for this partition.
+  For GPT partitions, the partuuid is the 16-byte GPT Partition UUID (e.g.
+  ``de6f4f5c-c055-4374-09f7-8c6821dfb60e``).
+  For MBR partitions, the partuuid is the 4-byte disk identifier
+  followed by a dash and the partition number (starting with 1, e.g.
+  ``c9178f9d-01``).
+
+  The partuuid is case-insensitive.
 
 Additionally, barebox also supports partitioning the eMMC boot partitions if
 the partition table node is named appropriately:
-- ``partitions`` : user partition
-- ``boot0-partitions`` : boot0 partition
-- ``boot1-partitions`` : boot1 partition
+
+* ``partitions`` : user partition
+* ``boot0-partitions`` : boot0 partition
+* ``boot1-partitions`` : boot1 partition
 
 Examples:
 
-- 
2.39.2




[PATCH master] Convert License Identifiers to SPDX 3.0 for files originating from LiMon

2023-08-04 Thread Roland Hieber
The respective U-Boot commit was ported to Barebox in commit
0b5d36d77b6022bd1f40 (2023-07-27, Sascha Hauer: "Add SPDX License
identifier for files originating from LiMon"), but the U-Boot change was
already made in 2014, and the SPDX specification was updated since then
and deprecated the "GPL-2.0" identifier in favour of "GPL-2.0-only".
Update the license identifiers to SPDX 3.0 specification, which we also
use everywhere else in the Barebox code.

Signed-off-by: Roland Hieber 
---
 include/net.h | 2 +-
 net/dhcp.c| 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/net.h b/include/net.h
index b5a5e1b6168d..5e029c71f29e 100644
--- a/include/net.h
+++ b/include/net.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+// SPDX-License-Identifier: GPL-2.0-only
 // SPDX-FileCopyrightText: 1994-2000 Neil Russell
 /*
  * net.h - barebox networking support
diff --git a/net/dhcp.c b/net/dhcp.c
index 93738e5a6ba6..e1025bf91b02 100644
--- a/net/dhcp.c
+++ b/net/dhcp.c
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+// SPDX-License-Identifier: GPL-2.0-only
 // SPDX-FileCopyrightText: 1994, 1995, 2000 Neil Russell
 // SPDX-FileCopyrightText: 2000 Roland Borde
 // SPDX-FileCopyrightText: 2000 Paolo Scaffardi
-- 
2.39.2




[PATCH v2 2/2] net: phy: dp83867: respect ti,clk-output-sel DT property

2023-06-05 Thread Roland Hieber
On some boards it is necessary to configure the PHY to provide the
correct clock to the FEC.

This ports the rest of the following two kernel commits:

| commit 9708fb630d19ee51ae3aeb3a533e3010da0e8570
| Author: Wadim Egorov 
| Date:   Mi 2018-02-14 17:07:11
|
| net: phy: dp83867: Add binding for the CLK_OUT pin muxing option
|
| The DP83867 has a muxing option for the CLK_OUT pin. It is possible
| to set CLK_OUT for different channels.
| Create a binding to select a specific clock for CLK_OUT pin.
|
| Signed-off-by: Wadim Egorov 
| Signed-off-by: Daniel Schultz 
| Reviewed-by: Andrew Lunn 
| Reviewed-by: Florian Fainelli 
| Signed-off-by: David S. Miller 
|
| commit 13c83cf8af0dcc6103982b4dc0b70826f0b54f21
| Author: Trent Piepho 
| Date:   Mi 2019-05-22 18:43:22
|
| net: phy: dp83867: Add ability to disable output clock
|
| Generally, the output clock pin is only used for testing and only 
serves
| as a source of RF noise after this.  It could be used to daisy-chain
| PHYs, but this is uncommon.  Since the PHY can disable the output, 
make
| doing so an option.  I do this by adding another enumeration to the
| allowed values of ti,clk-output-sel.
|
| The code was not using the value DP83867_CLK_O_SEL_REF_CLK as one 
might
| expect: to select the REF_CLK as the output.  Rather it meant "keep
| clock output setting as is", which, depending on PHY strapping, might
| not be outputting REF_CLK.
|
| Change this so DP83867_CLK_O_SEL_REF_CLK means enable REF_CLK output.
| Omitting the property will leave the setting as is (which was the
| previous behavior in this case).
|
| Out of range values were silently converted into
| DP83867_CLK_O_SEL_REF_CLK.  Change this so they generate an error.
|
| Cc: Andrew Lunn 
| Cc: Florian Fainelli 
| Cc: Heiner Kallweit 
| Signed-off-by: Trent Piepho 
| Reviewed-by: Andrew Lunn 
| Signed-off-by: David S. Miller 

Link: https://git.kernel.org/torvalds/c/9708fb630d19ee51ae3a
Link: https://git.kernel.org/torvalds/c/13c83cf8af0dcc610398
Signed-off-by: Roland Hieber 
---
v1 -> v2:
 * correctly use indirect write instead of direct write with the newly
   introduced helper function

PATCH v1: 
https://lore.barebox.org/barebox/20230601105710.hsslzy2s25pzc...@pengutronix.de

 drivers/net/phy/dp83867.c | 37 +
 1 file changed, 37 insertions(+)

diff --git a/drivers/net/phy/dp83867.c b/drivers/net/phy/dp83867.c
index 375dcd075308..d8109172dfa5 100644
--- a/drivers/net/phy/dp83867.c
+++ b/drivers/net/phy/dp83867.c
@@ -96,6 +96,9 @@
 
 #define DP83867_IO_MUX_CFG_IO_IMPEDANCE_MAX0x0
 #define DP83867_IO_MUX_CFG_IO_IMPEDANCE_MIN0x1f
+#define DP83867_IO_MUX_CFG_CLK_O_DISABLE   BIT(6)
+#define DP83867_IO_MUX_CFG_CLK_O_SEL_MASK  (0x1f << 8)
+#define DP83867_IO_MUX_CFG_CLK_O_SEL_SHIFT 8
 
 /* CFG4 bits */
 #define DP83867_CFG4_PORT_MIRROR_ENBIT(0)
@@ -113,6 +116,8 @@ struct dp83867_private {
int io_impedance;
int port_mirroring;
bool rxctrl_strap_quirk;
+   bool set_clk_output;
+   u32 clk_output_sel;
 };
 
 static int dp83867_read_status(struct phy_device *phydev)
@@ -174,6 +179,22 @@ static int dp83867_of_init(struct phy_device *phydev)
dp83867->io_impedance = -EINVAL;
 
/* Optional configuration */
+   ret = of_property_read_u32(of_node, "ti,clk-output-sel",
+  &dp83867->clk_output_sel);
+   /* If not set, keep default */
+   if (!ret) {
+   dp83867->set_clk_output = true;
+   /* Valid values are 0 to DP83867_CLK_O_SEL_REF_CLK or
+* DP83867_CLK_O_SEL_OFF.
+*/
+   if (dp83867->clk_output_sel > DP83867_CLK_O_SEL_REF_CLK &&
+   dp83867->clk_output_sel != DP83867_CLK_O_SEL_OFF) {
+   dev_err(&phydev->dev, "ti,clk-output-sel value %u out 
of range\n",
+  dp83867->clk_output_sel);
+   return -EINVAL;
+   }
+   }
+
if (of_property_read_bool(of_node, "ti,max-output-impedance"))
dp83867->io_impedance = DP83867_IO_MUX_CFG_IO_IMPEDANCE_MAX;
else if (of_property_read_bool(of_node, "ti,min-output-impedance"))
@@ -308,6 +329,22 @@ static int dp83867_config_init(struct phy_device *phydev)
if (dp83867->port_mirroring != DP83867_PORT_MIRROING_KEEP)
dp83867_config_port_mirroring(phydev);
 
+   /* Clock output selection if muxing property is set */
+   if (dp83867->set_clk_output) {
+   u16 mas

[PATCH v2 1/2] net: phy: add phy_modify_mmd_indirect convenience function

2023-06-05 Thread Roland Hieber
Add a read-modify-write convenience helper similar to phy_modify() for
setting single bits in MMD registers.

Signed-off-by: Roland Hieber 
---
PATCH v1 -> v2: new in v2

 drivers/net/phy/phy.c | 23 +++
 include/linux/phy.h   |  2 ++
 2 files changed, 25 insertions(+)

diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 54dbbca7255a..cbdd5bbfb607 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -882,6 +882,29 @@ void phy_write_mmd_indirect(struct phy_device *phydev, int 
prtad, int devad,
phy_write(phydev, MII_MMD_DATA, data);
 }
 
+/**
+ * phy_modify_mmd_indirect - Convenience function for modifying a MMD register
+ * @phydev: phy device
+ * @prtad: MMD Address
+ * @devad: MMD DEVAD
+ * @mask: bit mask of bits to clear
+ * @set: new value of bits set in @mask
+ *
+ */
+int phy_modify_mmd_indirect(struct phy_device *phydev, int prtad, int devad,
+  u16 mask, u16 set)
+{
+   int ret;
+
+   ret = phy_read_mmd_indirect(phydev, prtad, devad);
+   if (ret < 0)
+   return ret;
+
+   phy_write_mmd_indirect(phydev, prtad, devad, (ret & ~mask) | set);
+
+   return 0;
+}
+
 int genphy_config_init(struct phy_device *phydev)
 {
int val;
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 5c3ad91d5ecc..509bf72de918 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -409,6 +409,8 @@ int phy_scan_fixups(struct phy_device *phydev);
 int phy_read_mmd_indirect(struct phy_device *phydev, int prtad, int devad);
 void phy_write_mmd_indirect(struct phy_device *phydev, int prtad, int devad,
   u16 data);
+int phy_modify_mmd_indirect(struct phy_device *phydev, int prtad, int devad,
+   u16 mask, u16 set);
 
 static inline bool phy_acquired(struct phy_device *phydev)
 {
-- 
2.39.2




Re: [PATCH] net: phy: dp83867: respect ti,clk-output-sel DT property

2023-06-01 Thread Roland Hieber
On Thu, Jun 01, 2023 at 12:08:23PM +0200, Roland Hieber wrote:
> On some boards it is necessary to configure the PHY to provide the
> correct clock to the FEC.
> 
> This ports the rest of the following two kernel commits:
> 
> | commit 9708fb630d19ee51ae3aeb3a533e3010da0e8570
> | Author: Wadim Egorov 
> | Date:   Mi 2018-02-14 17:07:11
> |
> | net: phy: dp83867: Add binding for the CLK_OUT pin muxing option
> |
> | The DP83867 has a muxing option for the CLK_OUT pin. It is possible
> | to set CLK_OUT for different channels.
> | Create a binding to select a specific clock for CLK_OUT pin.
> |
> | Signed-off-by: Wadim Egorov 
> | Signed-off-by: Daniel Schultz 
> | Reviewed-by: Andrew Lunn 
> | Reviewed-by: Florian Fainelli 
> | Signed-off-by: David S. Miller 
> |
> | commit 13c83cf8af0dcc6103982b4dc0b70826f0b54f21
> | Author: Trent Piepho 
> | Date:   Mi 2019-05-22 18:43:22
> |
> | net: phy: dp83867: Add ability to disable output clock
> |
> | Generally, the output clock pin is only used for testing and only 
> serves
> | as a source of RF noise after this.  It could be used to daisy-chain
> | PHYs, but this is uncommon.  Since the PHY can disable the output, 
> make
> | doing so an option.  I do this by adding another enumeration to the
> | allowed values of ti,clk-output-sel.
> |
> | The code was not using the value DP83867_CLK_O_SEL_REF_CLK as one 
> might
> | expect: to select the REF_CLK as the output.  Rather it meant "keep
> | clock output setting as is", which, depending on PHY strapping, 
> might
> | not be outputting REF_CLK.
> |
> | Change this so DP83867_CLK_O_SEL_REF_CLK means enable REF_CLK 
> output.
> | Omitting the property will leave the setting as is (which was the
> | previous behavior in this case).
> |
> | Out of range values were silently converted into
> | DP83867_CLK_O_SEL_REF_CLK.  Change this so they generate an error.
> |
> | Cc: Andrew Lunn 
> | Cc: Florian Fainelli 
> | Cc: Heiner Kallweit 
> | Signed-off-by: Trent Piepho 
> | Reviewed-by: Andrew Lunn 
> | Signed-off-by: David S. Miller 
> 
> Link: https://git.kernel.org/torvalds/c/9708fb630d19ee51ae3a
> Link: https://git.kernel.org/torvalds/c/13c83cf8af0dcc610398
> Signed-off-by: Roland Hieber 
> ---
>  drivers/net/phy/dp83867.c | 36 
>  1 file changed, 36 insertions(+)
> 
> diff --git a/drivers/net/phy/dp83867.c b/drivers/net/phy/dp83867.c
> index 375dcd075308..0bc19dd11270 100644
> --- a/drivers/net/phy/dp83867.c
> +++ b/drivers/net/phy/dp83867.c
> @@ -96,6 +96,9 @@
>  
>  #define DP83867_IO_MUX_CFG_IO_IMPEDANCE_MAX  0x0
>  #define DP83867_IO_MUX_CFG_IO_IMPEDANCE_MIN  0x1f
> +#define DP83867_IO_MUX_CFG_CLK_O_DISABLE BIT(6)
> +#define DP83867_IO_MUX_CFG_CLK_O_SEL_MASK(0x1f << 8)
> +#define DP83867_IO_MUX_CFG_CLK_O_SEL_SHIFT   8
>  
>  /* CFG4 bits */
>  #define DP83867_CFG4_PORT_MIRROR_EN  BIT(0)
> @@ -113,6 +116,8 @@ struct dp83867_private {
>   int io_impedance;
>   int port_mirroring;
>   bool rxctrl_strap_quirk;
> + bool set_clk_output;
> + u32 clk_output_sel;
>  };
>  
>  static int dp83867_read_status(struct phy_device *phydev)
> @@ -174,6 +179,22 @@ static int dp83867_of_init(struct phy_device *phydev)
>   dp83867->io_impedance = -EINVAL;
>  
>   /* Optional configuration */
> + ret = of_property_read_u32(of_node, "ti,clk-output-sel",
> +&dp83867->clk_output_sel);
> + /* If not set, keep default */
> + if (!ret) {
> + dp83867->set_clk_output = true;
> + /* Valid values are 0 to DP83867_CLK_O_SEL_REF_CLK or
> +  * DP83867_CLK_O_SEL_OFF.
> +  */
> + if (dp83867->clk_output_sel > DP83867_CLK_O_SEL_REF_CLK &&
> + dp83867->clk_output_sel != DP83867_CLK_O_SEL_OFF) {
> + dev_err(&phydev->dev, "ti,clk-output-sel value %u out 
> of range\n",
> +dp83867->clk_output_sel);
> + return -EINVAL;
> + }
> + }
> +
>   if (of_property_read_bool(of_node, "ti,max-output-impedance"))
>   dp83867->io_impedance = DP83867_IO_MUX_CFG_IO_IMPEDANCE_MAX;
>   else if (of_property_read_bool(of_node, "ti,min-output-imp

[PATCH] net: phy: dp83867: respect ti,clk-output-sel DT property

2023-06-01 Thread Roland Hieber
On some boards it is necessary to configure the PHY to provide the
correct clock to the FEC.

This ports the rest of the following two kernel commits:

| commit 9708fb630d19ee51ae3aeb3a533e3010da0e8570
| Author: Wadim Egorov 
| Date:   Mi 2018-02-14 17:07:11
|
| net: phy: dp83867: Add binding for the CLK_OUT pin muxing option
|
| The DP83867 has a muxing option for the CLK_OUT pin. It is possible
| to set CLK_OUT for different channels.
| Create a binding to select a specific clock for CLK_OUT pin.
|
| Signed-off-by: Wadim Egorov 
| Signed-off-by: Daniel Schultz 
| Reviewed-by: Andrew Lunn 
| Reviewed-by: Florian Fainelli 
| Signed-off-by: David S. Miller 
|
| commit 13c83cf8af0dcc6103982b4dc0b70826f0b54f21
| Author: Trent Piepho 
| Date:   Mi 2019-05-22 18:43:22
|
| net: phy: dp83867: Add ability to disable output clock
|
| Generally, the output clock pin is only used for testing and only 
serves
| as a source of RF noise after this.  It could be used to daisy-chain
| PHYs, but this is uncommon.  Since the PHY can disable the output, 
make
| doing so an option.  I do this by adding another enumeration to the
| allowed values of ti,clk-output-sel.
|
| The code was not using the value DP83867_CLK_O_SEL_REF_CLK as one 
might
| expect: to select the REF_CLK as the output.  Rather it meant "keep
| clock output setting as is", which, depending on PHY strapping, might
| not be outputting REF_CLK.
|
| Change this so DP83867_CLK_O_SEL_REF_CLK means enable REF_CLK output.
| Omitting the property will leave the setting as is (which was the
| previous behavior in this case).
|
| Out of range values were silently converted into
| DP83867_CLK_O_SEL_REF_CLK.  Change this so they generate an error.
|
| Cc: Andrew Lunn 
| Cc: Florian Fainelli 
| Cc: Heiner Kallweit 
| Signed-off-by: Trent Piepho 
| Reviewed-by: Andrew Lunn 
| Signed-off-by: David S. Miller 

Link: https://git.kernel.org/torvalds/c/9708fb630d19ee51ae3a
Link: https://git.kernel.org/torvalds/c/13c83cf8af0dcc610398
Signed-off-by: Roland Hieber 
---
 drivers/net/phy/dp83867.c | 36 
 1 file changed, 36 insertions(+)

diff --git a/drivers/net/phy/dp83867.c b/drivers/net/phy/dp83867.c
index 375dcd075308..0bc19dd11270 100644
--- a/drivers/net/phy/dp83867.c
+++ b/drivers/net/phy/dp83867.c
@@ -96,6 +96,9 @@
 
 #define DP83867_IO_MUX_CFG_IO_IMPEDANCE_MAX0x0
 #define DP83867_IO_MUX_CFG_IO_IMPEDANCE_MIN0x1f
+#define DP83867_IO_MUX_CFG_CLK_O_DISABLE   BIT(6)
+#define DP83867_IO_MUX_CFG_CLK_O_SEL_MASK  (0x1f << 8)
+#define DP83867_IO_MUX_CFG_CLK_O_SEL_SHIFT 8
 
 /* CFG4 bits */
 #define DP83867_CFG4_PORT_MIRROR_ENBIT(0)
@@ -113,6 +116,8 @@ struct dp83867_private {
int io_impedance;
int port_mirroring;
bool rxctrl_strap_quirk;
+   bool set_clk_output;
+   u32 clk_output_sel;
 };
 
 static int dp83867_read_status(struct phy_device *phydev)
@@ -174,6 +179,22 @@ static int dp83867_of_init(struct phy_device *phydev)
dp83867->io_impedance = -EINVAL;
 
/* Optional configuration */
+   ret = of_property_read_u32(of_node, "ti,clk-output-sel",
+  &dp83867->clk_output_sel);
+   /* If not set, keep default */
+   if (!ret) {
+   dp83867->set_clk_output = true;
+   /* Valid values are 0 to DP83867_CLK_O_SEL_REF_CLK or
+* DP83867_CLK_O_SEL_OFF.
+*/
+   if (dp83867->clk_output_sel > DP83867_CLK_O_SEL_REF_CLK &&
+   dp83867->clk_output_sel != DP83867_CLK_O_SEL_OFF) {
+   dev_err(&phydev->dev, "ti,clk-output-sel value %u out 
of range\n",
+  dp83867->clk_output_sel);
+   return -EINVAL;
+   }
+   }
+
if (of_property_read_bool(of_node, "ti,max-output-impedance"))
dp83867->io_impedance = DP83867_IO_MUX_CFG_IO_IMPEDANCE_MAX;
else if (of_property_read_bool(of_node, "ti,min-output-impedance"))
@@ -308,6 +329,21 @@ static int dp83867_config_init(struct phy_device *phydev)
if (dp83867->port_mirroring != DP83867_PORT_MIRROING_KEEP)
dp83867_config_port_mirroring(phydev);
 
+   /* Clock output selection if muxing property is set */
+   if (dp83867->set_clk_output) {
+   u16 mask = DP83867_IO_MUX_CFG_CLK_O_DISABLE;
+
+   if (dp83867->clk_output_sel == DP83867_CLK_O_SEL_OFF) {
+   val = DP83867_IO_MUX_CFG_CLK_O_DISABLE;
+   } else {
+   

Re: [PATCH] commands: ethlog: wire up help text

2023-05-25 Thread Roland Hieber
On Thu, May 25, 2023 at 05:29:35PM +0200, Roland Hieber wrote:
> The help text for ethlog currently contains only the short synopsis, but
> no explanation what all the options actually do, although that info is
> available a few lines further up. It was probably just forgotten to be
> included in the command definition.

As far as I could see, ethlog was the only (non-trivial) command without
a help text.

 - Roland

> 
> Signed-off-by: Roland Hieber 
> ---
>  commands/ethlog.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/commands/ethlog.c b/commands/ethlog.c
> index 7885d32c6b47..21d88bf1cbfb 100644
> --- a/commands/ethlog.c
> +++ b/commands/ethlog.c
> @@ -90,4 +90,5 @@ BAREBOX_CMD_START(ethlog)
>   BAREBOX_CMD_OPTS("[-rp] [device]")
>   BAREBOX_CMD_GROUP(CMD_GRP_NET)
>   BAREBOX_CMD_COMPLETE(eth_complete)
> + BAREBOX_CMD_HELP(cmd_ethlog_help)
>  BAREBOX_CMD_END
> -- 
> 2.39.2
> 
> 

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



[PATCH] commands: ethlog: wire up help text

2023-05-25 Thread Roland Hieber
The help text for ethlog currently contains only the short synopsis, but
no explanation what all the options actually do, although that info is
available a few lines further up. It was probably just forgotten to be
included in the command definition.

Signed-off-by: Roland Hieber 
---
 commands/ethlog.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/commands/ethlog.c b/commands/ethlog.c
index 7885d32c6b47..21d88bf1cbfb 100644
--- a/commands/ethlog.c
+++ b/commands/ethlog.c
@@ -90,4 +90,5 @@ BAREBOX_CMD_START(ethlog)
BAREBOX_CMD_OPTS("[-rp] [device]")
BAREBOX_CMD_GROUP(CMD_GRP_NET)
BAREBOX_CMD_COMPLETE(eth_complete)
+   BAREBOX_CMD_HELP(cmd_ethlog_help)
 BAREBOX_CMD_END
-- 
2.39.2




Re: [PATCH master] imx-usb-loader: Don't try to verify more data than contained in the image

2023-05-23 Thread Roland Hieber
On Tue, May 23, 2023 at 09:55:24AM +0200, Uwe Kleine-König wrote:
> hello,
> 
> On Tue, May 23, 2023 at 09:16:21AM +0200, Ahmad Fatoum wrote:
> > On platforms that don't have a 2nd stage (in my case i.MX6 without
> > imx6_barebox_start_usb), it usually happens that the transfer limit for
> > the first (and only) upload is bigger than the actual file length.
> > Then the right thing to do is processing the complete image (minus its
> > header), but not more. This was broken by recent refactoring and fixed
> > for the transfer case with commit 3cf4bcd86419 ("imx-usb-loader: Don't
> > try to transfer more data than contained in the image").
> > 
> > The same bug persisted in the verification code though, breaking
> > imx-usb-loader -c:
> > 
> > verifying file...
> > mismatch at offset 0x000999c0. expected:
> > [ hexdump of last bytes of barebox binary ]
> > 
> > A jump to the binary will then be skipped and subsequent imx-usb-loader
> > invocations will have their DCD writes unanswered leading to the
> > dreaded:
> > 
> > main dcd length 328
> > DCD write: sub dcd length: 0x0324, flags: 0x04w3 in err=-7, 
> > last_trans=0  00 00 00 00
> > addr=0x021b001c, val=0x04088032   w4 in err=-7, 
> > last_trans=0  00 00 00 00
> > !!perform_dcd returned -7
> > 4 in err=-7, last_trans=0  00 00 00 00
> > 
> > Applying the same fix as in 3cf4bcd86419 fixes this issue as well.
> > 
> > Fixes: 3367ebc55ebe ("scripts: imx-usb-loader: simplify code flow for file 
> > size calculations")
> > Cc: Uwe Kleine-König 
> > Reported-by: Roland Hieber 
> > Signed-off-by: Ahmad Fatoum 
> > ---
> >  scripts/imx/imx-usb-loader.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/scripts/imx/imx-usb-loader.c b/scripts/imx/imx-usb-loader.c
> > index 5f9c7ff3a458..676f077c2557 100644
> > --- a/scripts/imx/imx-usb-loader.c
> > +++ b/scripts/imx/imx-usb-loader.c
> > @@ -1415,7 +1415,7 @@ static int do_irom_download(struct usb_work *curr, 
> > int verify)
> > if (verify) {
> > printf("verifying file...\n");
> >  
> > -   ret = verify_memory(image, firststage_len, header_addr);
> > +   ret = verify_memory(image, min(fsize, firststage_len), 
> > header_addr);
> > if (ret < 0) {
> > printf("verifying failed\n");
> >     goto cleanup;
> 
> Ah, I see. Looks right.
> 
> Acked-by: Uwe Kleine-König 
> 
> (hmm, already too late.)

Tested-by: Roland Hieber 

(hmm, also too late. Thanks anyway!)

 - Roland

> 
> Best regards
> Uwe
> 
> -- 
> Pengutronix e.K.   | Uwe Kleine-König|
> Industrial Linux Solutions | https://www.pengutronix.de/ |



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



[RFT][PATCH 3/3] ARM: i.MX6: TQMa6x: make tqma6x_env_init reusable

2023-05-11 Thread Roland Hieber
The SPI flash and eMMC are hard-wired on the TQMa6x SoM, so this
function is not specific for the mba6x baseboard but can be used on
other boards with a TQMa6x SoM too.

tqma6x_enet_init is specific to the mba6x board, so rename it to reflect
that fact.

Signed-off-by: Roland Hieber 
---
 arch/arm/boards/tqma6x/board.c | 23 +++
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/arch/arm/boards/tqma6x/board.c b/arch/arm/boards/tqma6x/board.c
index ae339887568a..4bb7223a6e7a 100644
--- a/arch/arm/boards/tqma6x/board.c
+++ b/arch/arm/boards/tqma6x/board.c
@@ -53,7 +53,7 @@ static int ksz9031rn_phy_fixup(struct phy_device *dev)
return 0;
 }
 
-static int tqma6x_enet_init(void)
+static int tq_mba6x_enet_init(void)
 {
if (!of_machine_is_compatible("tq,mba6x"))
return 0;
@@ -77,18 +77,25 @@ static int tqma6x_enet_init(void)
 
return 0;
 }
-fs_initcall(tqma6x_enet_init);
+fs_initcall(tq_mba6x_enet_init);
 
-static int tqma6x_env_init(void)
+static int tqma6x_init(void)
 {
-   if (!of_machine_is_compatible("tq,mba6x"))
-   return 0;
-
imx6_bbu_internal_spi_i2c_register_handler("spiflash", 
"/dev/m25p0.barebox",
BBU_HANDLER_FLAG_DEFAULT);
imx6_bbu_internal_mmcboot_register_handler("emmc", "mmc2", 0);
 
-   device_detect_by_name("mmc2");
+   device_detect_by_name("mmc2"); // eMMC
+
+   return 0;
+}
+
+static int tq_mba6x_env_init(void)
+{
+   if (!of_machine_is_compatible("tq,mba6x"))
+   return 0;
+
+   tqma6x_init();
 
default_environment_path_set("/dev/mmc2.boot1");
 
@@ -96,4 +103,4 @@ static int tqma6x_env_init(void)
 
return 0;
 }
-late_initcall(tqma6x_env_init);
+late_initcall(tq_mba6x_env_init);
-- 
2.39.2




[RFT][PATCH 0/3] TQMa6x cleanup

2023-05-11 Thread Roland Hieber
Hi,

I came across this when working on a similar board, but I don't have a TQ MBa6x
to test these changes, so if someone has one and could try these patches, that
would be great!

 - Roland

Roland Hieber (3):
  ARM: i.MX6: tqma6x: make use of ENTRY_FUNCTION_WITHSTACK
  ARM: i.MX: TQMa6x: migrate flash partitions to device tree
  ARM: i.MX6: TQMa6x: make tqma6x_env_init reusable

 arch/arm/boards/tqma6x/board.c| 25 +++--
 arch/arm/boards/tqma6x/lowlevel.c |  8 ++--
 arch/arm/dts/imx6dl-mba6x.dts | 13 +
 arch/arm/dts/imx6q-mba6x.dts  | 13 +
 4 files changed, 43 insertions(+), 16 deletions(-)

-- 
2.39.2




[RFT][PATCH 2/3] ARM: i.MX: TQMa6x: migrate flash partitions to device tree

2023-05-11 Thread Roland Hieber
This way the partitions are easier to adapt, and the board code becomes
more generic.

Signed-off-by: Roland Hieber 
---
 arch/arm/boards/tqma6x/board.c |  2 --
 arch/arm/dts/imx6dl-mba6x.dts  | 13 +
 arch/arm/dts/imx6q-mba6x.dts   | 13 +
 3 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boards/tqma6x/board.c b/arch/arm/boards/tqma6x/board.c
index 5f59a259e620..ae339887568a 100644
--- a/arch/arm/boards/tqma6x/board.c
+++ b/arch/arm/boards/tqma6x/board.c
@@ -84,8 +84,6 @@ static int tqma6x_env_init(void)
if (!of_machine_is_compatible("tq,mba6x"))
return 0;
 
-   devfs_add_partition("m25p0", 0, SZ_512K, DEVFS_PARTITION_FIXED, 
"m25p0.barebox");
-
imx6_bbu_internal_spi_i2c_register_handler("spiflash", 
"/dev/m25p0.barebox",
BBU_HANDLER_FLAG_DEFAULT);
imx6_bbu_internal_mmcboot_register_handler("emmc", "mmc2", 0);
diff --git a/arch/arm/dts/imx6dl-mba6x.dts b/arch/arm/dts/imx6dl-mba6x.dts
index dddc3d384ccc..612acba3239b 100644
--- a/arch/arm/dts/imx6dl-mba6x.dts
+++ b/arch/arm/dts/imx6dl-mba6x.dts
@@ -27,6 +27,19 @@
};
 };
 
+&flash {
+   partitions {
+   compatible = "fixed-partitions";
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   partition@0 {
+   label = "barebox";
+   reg = <0x0 0x8>;
+   };
+   };
+};
+
 &iomuxc {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_hog>;
diff --git a/arch/arm/dts/imx6q-mba6x.dts b/arch/arm/dts/imx6q-mba6x.dts
index 64635b958213..5154580fae73 100644
--- a/arch/arm/dts/imx6q-mba6x.dts
+++ b/arch/arm/dts/imx6q-mba6x.dts
@@ -27,6 +27,19 @@
};
 };
 
+&flash {
+   partitions {
+   compatible = "fixed-partitions";
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   partition@0 {
+   label = "barebox";
+   reg = <0x0 0x8>;
+   };
+   };
+};
+
 &iomuxc {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_hog>;
-- 
2.39.2




[RFT][PATCH 1/3] ARM: i.MX6: tqma6x: make use of ENTRY_FUNCTION_WITHSTACK

2023-05-11 Thread Roland Hieber
Signed-off-by: Roland Hieber 
---
 arch/arm/boards/tqma6x/lowlevel.c | 8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/arch/arm/boards/tqma6x/lowlevel.c 
b/arch/arm/boards/tqma6x/lowlevel.c
index 9283e3f009f8..6e9c9bed0bf8 100644
--- a/arch/arm/boards/tqma6x/lowlevel.c
+++ b/arch/arm/boards/tqma6x/lowlevel.c
@@ -16,14 +16,12 @@
 extern char __dtb_imx6q_mba6x_start[];
 extern char __dtb_imx6dl_mba6x_start[];
 
-ENTRY_FUNCTION(start_imx6q_mba6x, r0, r1, r2)
+ENTRY_FUNCTION_WITHSTACK(start_imx6q_mba6x, 0x0092, r0, r1, r2)
 {
void *fdt;
 
imx6_cpu_lowlevel_init();
 
-   arm_setup_stack(0x0092);
-
if (IS_ENABLED(CONFIG_DEBUG_LL)) {
writel(0x2, 0x020e0338);
imx6_uart_setup_ll();
@@ -37,14 +35,12 @@ ENTRY_FUNCTION(start_imx6q_mba6x, r0, r1, r2)
barebox_arm_entry(0x1000, SZ_1G, fdt);
 }
 
-ENTRY_FUNCTION(start_imx6dl_mba6x, r0, r1, r2)
+ENTRY_FUNCTION_WITHSTACK(start_imx6dl_mba6x, 0x0092, r0, r1, r2)
 {
void *fdt;
 
imx6_cpu_lowlevel_init();
 
-   arm_setup_stack(0x0092);
-
if (IS_ENABLED(CONFIG_DEBUG_LL)) {
writel(0x2, 0x020e035c);
imx6_uart_setup_ll();
-- 
2.39.2




[PATCH] Documentation: imx: improve reboot mode section

2023-03-20 Thread Roland Hieber
Signed-off-by: Roland Hieber 
---
 Documentation/boards/imx.rst | 15 +++
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/Documentation/boards/imx.rst b/Documentation/boards/imx.rst
index 6c16923340a8..6fbf1554d10e 100644
--- a/Documentation/boards/imx.rst
+++ b/Documentation/boards/imx.rst
@@ -86,8 +86,8 @@ The images can also always be started as second stage on the 
target:
 BootROM Reboot mode codes (bmode)
 ^
 
-For select SoCs, barebox supports communicating an alternative boot medium
-that BootROM should select after a warm reset::
+For selected SoCs, barebox supports communicating an alternative boot medium
+that the BootROM should select after a warm reset::
 
   barebox@FSL i.MX8MM EVK board:/ devinfo gpr.reboot_mode
   Driver: syscon-reboot-mode
@@ -107,10 +107,17 @@ that BootROM should select after a warm reset::
 
   barebox@FSL i.MX8MM EVK board:/ gpr.reboot_mode.next=serial reset -w
 
-This will cause barebox to fall into serial download mode on an i.MX8MM.
+The example above will cause barebox to jump back into serial download mode on
+an i.MX8MM by writing 0x10 into the *SRC_GPR9* register (offset 0x30390094) and
+0x4000 into the *SRC_GPR10* register (offset 0x30390098), and then issuing 
a
+warm :ref:`reset `.
 
 Different SoCs may have more possible reboot modes available.
-See the section on :ref:`Reboot modes` for more information.
+Look for documentation of the *SRC_SBMR* and *SRC_GPR* registers in the
+Reference Manual of your SoC; the values for the ``mode-*`` properties often
+correspond directly to the boot fusemap settings.
+
+See the section on :ref:`Reboot modes` for general information.
 
 High Assurance Boot
 ^^^
-- 
2.30.2




Re: [PATCH 2/2] defaultenv: boot/net: allow customising NFS port and path

2023-02-13 Thread Roland Hieber
On Mon, Feb 13, 2023 at 08:42:11AM +0100, Sascha Hauer wrote:
> On Fri, Feb 10, 2023 at 11:48:31PM +0100, Roland Hieber wrote:
> > There are use cases where the port and mount path of the NFS root need
> > to be changed from the default values, e.g. with the userspace NFS
> > daemon used by 'ptxdist nfsroot', which tells you:
> > 
> > Mount rootfs with nfsroot=/root,v3,tcp,port=13049,mountport=13049
> > 
> > (The port number can vary of course, depending on how many users on your
> > devel server have already started unfsd at the same time.)
> > 
> > Support such use cases by introducing two new variables for the port
> > number and the mount path, which get inserted into the kernel command
> > line. Use the old default mount path as fallback when the new variable
> > is not set.
> 
> Does this approach really make you happy with your usecase? The port
> may change with every invocation of 'ptxdist nfsroot'.
> 
> With bootloaderspec it should be possible to do this in barebox:
> 
> boot nfs://host:13049//root

Ah, I didn't know this! This seems more reasonable to me! :-)

> If that works we might convince Michael to print this line suitable for
> copy-paste along with the output of 'ptxdist nfsroot'.

The message is actually printed by unfsd, but I'll see how this could be
done reasonably in PTXdist.

 - Roland

> Sascha
> 
> > 
> > Signed-off-by: Roland Hieber 
> > ---
> >  Documentation/user/networking.rst | 10 ++
> >  defaultenv/defaultenv-2-base/boot/net | 11 ++-
> >  2 files changed, 20 insertions(+), 1 deletion(-)
> > 
> > diff --git a/Documentation/user/networking.rst 
> > b/Documentation/user/networking.rst
> > index 6bd16ea8d1bd..e95957c0a26a 100644
> > --- a/Documentation/user/networking.rst
> > +++ b/Documentation/user/networking.rst
> > @@ -53,6 +53,16 @@ device:
> >  | global.net.nameserver| ipv4 address | The DNS server used for 
> > resolving host names. |
> >  |  |  | May be set by DHCP.
> >|
> >  
> > +--+--+---+
> > +| global.net.nfspath   | string   | If set, determines the 
> > mount path of the root |
> > +|  |  | file system on the NFS 
> > server.|
> > +|  |  | If not set, the default 
> > value |
> > +|  |  | 
> > ``/home/${global.user}/nfsroot/${global.hostname}``   |
> > +|  |  | is used.   
> >|
> > ++--+--+---+
> > +| global.net.nfsport   | short| If set, determines the 
> > port of the NFS server |
> > +|  |  | (the ``mountport`` and 
> > ``port`` arguments of the  |
> > +|  |  | ``nfsroot`` parameter in 
> > the kernel command line).|
> > ++--+--+---+
> >  | global.net.ifup_force_detect | boolean  | Set to true if your 
> > network device is not |
> >  |  |  | detected automatically 
> > during start (i.e. for |
> >  |  |  | USB network adapters). 
> >|
> > diff --git a/defaultenv/defaultenv-2-base/boot/net 
> > b/defaultenv/defaultenv-2-base/boot/net
> > index e79432eb277c..236955ef6fed 100644
> > --- a/defaultenv/defaultenv-2-base/boot/net
> > +++ b/defaultenv/defaultenv-2-base/boot/net
> > @@ -22,7 +22,16 @@ 
> > initramfs="${path}/${global.user}-initramfs-${global.hostname}"
> >  if [ -f "${initramfs}" ]; then
> > global.bootm.initrd="$initramfs"
> >  else
> > -   nfsroot="${nfsserver}:/home/${global.user}/nfsroot/${global.hostname}"
> > +   if [ -z "${global.net.nfspath}" ]; then
> > +   
> > nfsroot="${nfsserver}:/home/${global.user}/nfsroot/${global.hostname}"
> > +   else
> > +   nfsroot="${nfsserver}:${global.net.nfspath}"
> > +   fi
> > +
> > +   if [ -n "${globa

[PATCH 1/2] Documentation: networking: resize reStructuredText table

2023-02-10 Thread Roland Hieber
Make more space for long lines which we'll add in the next commit.

Signed-off-by: Roland Hieber 
---
 Documentation/user/networking.rst | 38 +++
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/Documentation/user/networking.rst 
b/Documentation/user/networking.rst
index 2306cb6a60d1..6bd16ea8d1bd 100644
--- a/Documentation/user/networking.rst
+++ b/Documentation/user/networking.rst
@@ -38,25 +38,25 @@ Network devices are configured with a set of device 
specific variables:
 Additionally there are some more variables that are not specific to a
 device:
 
-+--+--++
-| name | type |
|
-+==+==++
-| global.net.gateway   | ipv4 host| The network gateway used when 
a host is not in |
-|  |  | any directly visible subnet. 
May be set|
-|  |  | automatically by DHCP. 
|
-+--+--++
-| global.net.server| hostname or  | The default server used by the 
defaultenv boot |
-|  | ipv4 address | scripts for NFS and TFTP; see  
|
-|  |  | :ref:`booting_linux_net`.  
|
-|  |  | If unspecified, may be set by 
DHCP.|
-+--+--++
-| global.net.nameserver| ipv4 address | The DNS server used for 
resolving host names.  |
-|  |  | May be set by DHCP.
|
-+--+--++
-| global.net.ifup_force_detect | boolean  | Set to true if your network 
device is not  |
-|  |  | detected automatically during 
start (i.e. for  |
-|  |  | USB network adapters). 
|
-+--+--++
++--+--+---+
+| name | type |
   |
++==+==+===+
+| global.net.gateway   | ipv4 host| The network gateway used when 
a host is not in|
+|  |  | any directly visible subnet. 
May be set   |
+|  |  | automatically by DHCP. 
   |
++--+--+---+
+| global.net.server| hostname or  | The default server used by the 
defaultenv boot|
+|  | ipv4 address | scripts for NFS and TFTP; see  
   |
+|  |  | :ref:`booting_linux_net`.  
   |
+|  |  | If unspecified, may be set by 
DHCP.   |
++--+--+---+
+| global.net.nameserver| ipv4 address | The DNS server used for 
resolving host names. |
+|  |  | May be set by DHCP.
   |
++--+--+---+
+| global.net.ifup_force_detect | boolean  | Set to true if your network 
device is not |
+|  |  | detected automatically during 
start (i.e. for |
+|  |  | USB network adapters). 
   |
++--+--+---+
 
 The first step for networking is configuring the network device. The network
 device is usually ``eth0``. The current configuration can be viewed with the
-- 
2.30.2




[PATCH 2/2] defaultenv: boot/net: allow customising NFS port and path

2023-02-10 Thread Roland Hieber
There are use cases where the port and mount path of the NFS root need
to be changed from the default values, e.g. with the userspace NFS
daemon used by 'ptxdist nfsroot', which tells you:

Mount rootfs with nfsroot=/root,v3,tcp,port=13049,mountport=13049

(The port number can vary of course, depending on how many users on your
devel server have already started unfsd at the same time.)

Support such use cases by introducing two new variables for the port
number and the mount path, which get inserted into the kernel command
line. Use the old default mount path as fallback when the new variable
is not set.

Signed-off-by: Roland Hieber 
---
 Documentation/user/networking.rst | 10 ++
 defaultenv/defaultenv-2-base/boot/net | 11 ++-
 2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/Documentation/user/networking.rst 
b/Documentation/user/networking.rst
index 6bd16ea8d1bd..e95957c0a26a 100644
--- a/Documentation/user/networking.rst
+++ b/Documentation/user/networking.rst
@@ -53,6 +53,16 @@ device:
 | global.net.nameserver| ipv4 address | The DNS server used for 
resolving host names. |
 |  |  | May be set by DHCP.
   |
 
+--+--+---+
+| global.net.nfspath   | string   | If set, determines the mount 
path of the root |
+|  |  | file system on the NFS server. 
   |
+|  |  | If not set, the default value  
   |
+|  |  | 
``/home/${global.user}/nfsroot/${global.hostname}``   |
+|  |  | is used.   
   |
++--+--+---+
+| global.net.nfsport   | short| If set, determines the port of 
the NFS server |
+|  |  | (the ``mountport`` and 
``port`` arguments of the  |
+|  |  | ``nfsroot`` parameter in the 
kernel command line).|
++--+--+---+
 | global.net.ifup_force_detect | boolean  | Set to true if your network 
device is not |
 |  |  | detected automatically during 
start (i.e. for |
 |  |  | USB network adapters). 
   |
diff --git a/defaultenv/defaultenv-2-base/boot/net 
b/defaultenv/defaultenv-2-base/boot/net
index e79432eb277c..236955ef6fed 100644
--- a/defaultenv/defaultenv-2-base/boot/net
+++ b/defaultenv/defaultenv-2-base/boot/net
@@ -22,7 +22,16 @@ 
initramfs="${path}/${global.user}-initramfs-${global.hostname}"
 if [ -f "${initramfs}" ]; then
global.bootm.initrd="$initramfs"
 else
-   nfsroot="${nfsserver}:/home/${global.user}/nfsroot/${global.hostname}"
+   if [ -z "${global.net.nfspath}" ]; then
+   
nfsroot="${nfsserver}:/home/${global.user}/nfsroot/${global.hostname}"
+   else
+   nfsroot="${nfsserver}:${global.net.nfspath}"
+   fi
+
+   if [ -n "${global.net.nfsport}" ]; then
+   
nfsroot="${nfsroot},port=${global.net.nfsport},mountport=${global.net.nfsport}"
+   fi
+
ip_route_get -b ${global.net.server} global.linux.bootargs.dyn.ip
global.linux.bootargs.dyn.root="root=/dev/nfs nfsroot=$nfsroot,v3,tcp"
 fi
-- 
2.30.2




[PATCH] Documentation: networking: improve net.* variable description

2023-02-06 Thread Roland Hieber
Signed-off-by: Roland Hieber 
---
 Documentation/user/booting-linux.rst |  2 ++
 Documentation/user/networking.rst| 10 ++
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/Documentation/user/booting-linux.rst 
b/Documentation/user/booting-linux.rst
index 60babb513cea..1a95f87e77c4 100644
--- a/Documentation/user/booting-linux.rst
+++ b/Documentation/user/booting-linux.rst
@@ -232,6 +232,8 @@ device where the entry is found on. This makes it possible 
to use the same rootf
 image on different devices without having to specify a different root= option 
each
 time.
 
+.. _booting_linux_net:
+
 Network boot
 
 
diff --git a/Documentation/user/networking.rst 
b/Documentation/user/networking.rst
index 9231ebde56ac..2306cb6a60d1 100644
--- a/Documentation/user/networking.rst
+++ b/Documentation/user/networking.rst
@@ -45,15 +45,17 @@ device:
 |  |  | any directly visible subnet. 
May be set|
 |  |  | automatically by DHCP. 
|
 
+--+--++
-| global.net.server| hostname or  | The default server. If 
unspecified, may be set |
-|  | ipv4 address | by DHCP
|
+| global.net.server| hostname or  | The default server used by the 
defaultenv boot |
+|  | ipv4 address | scripts for NFS and TFTP; see  
|
+|  |  | :ref:`booting_linux_net`.  
|
+|  |  | If unspecified, may be set by 
DHCP.|
 
+--+--++
 | global.net.nameserver| ipv4 address | The DNS server used for 
resolving host names.  |
-|  |  | May be set by DHCP 
|
+|  |  | May be set by DHCP.
|
 
+--+--++
 | global.net.ifup_force_detect | boolean  | Set to true if your network 
device is not  |
 |  |  | detected automatically during 
start (i.e. for  |
-|  |  | USB network adapters)  
|
+|  |  | USB network adapters). 
|
 
+--+--++
 
 The first step for networking is configuring the network device. The network
-- 
2.30.2




[PATCH] doc: slightly improve the porting guide

2022-10-21 Thread Roland Hieber
Turn the first board code excerpt into a full example by adding the
necessary includes files. Then in the line-by-line explanation, ensure a
line break after each explained line by turning the list into a
definition list, and be a bit more verbose when explaining some lines.

Signed-off-by: Roland Hieber 
---
 Documentation/devel/porting.rst | 58 +
 1 file changed, 37 insertions(+), 21 deletions(-)

diff --git a/Documentation/devel/porting.rst b/Documentation/devel/porting.rst
index 01ee26e0d65f..dea5ebd1c511 100644
--- a/Documentation/devel/porting.rst
+++ b/Documentation/devel/porting.rst
@@ -113,6 +113,9 @@ there depends on the previously running code. If a previous 
stage has already
 initialized the DRAM, the only thing you need to do is to set up a stack and
 call the common PBL code with a memory region and your device tree blob::
 
+  #include 
+  #include 
+
   ENTRY_FUNCTION_WITHSTACK(start_my_board, MY_STACK_TOP, r0, r1, r2)
   {
extern char __dtb_my_board_start[];
@@ -128,22 +131,24 @@ call the common PBL code with a memory region and your 
device tree blob::
 
 Lets look at this line by line:
 
- - ``ENTRY_FUNCTION_WITHSTACK(start_my_board, STACK_TOP, r0, r1, r2)``
+``ENTRY_FUNCTION_WITHSTACK(start_my_board, MY_STACK_TOP, r0, r1, r2)``
The entry point is special: It needs to be located at the beginning of the
image, it does not return and may run before a stack is set up.
To make it possible to write this entry point in C, the macro places
-   a machine code prologue that uses ``STACK_TOP`` as the initial stack
+   a machine code prologue that uses ``MY_STACK_TOP`` as the initial stack
pointer. If the stack is already set up, you may pass 0 here.
 
Additionally, the macro passes along a number of registers, in case the
Boot ROM has placed something interesting there.
 
- - ``extern char __dtb_my_board_start[];``
+``extern char __dtb_my_board_start[];``
When a device tree is built as part of the PBL, ``__dtb_*_start`` and
-   ``__dtb_*_end`` will be defined for it. Declare the start variable, so
-   you can pass along the address of the device tree.
+   ``__dtb_*_end`` will be defined for it by the build system;
+   its name is determined by the name of the device tree source file.
+   Declare the start variable, so you can pass along the address of the device
+   tree.
 
- - ``relocate_to_current_adr();``
+``relocate_to_current_adr();``
Machine code contains a mixture of relative and absolute addressing.
Because the PBL doesn't know in advance which address it's loaded to,
the link address of global variables may not be correct. To correct
@@ -152,28 +157,34 @@ Lets look at this line by line:
by this function. Note that this is self-modifying code, so it's not
safe to call this when executing in-place from flash or ROM.
 
- - ``setup_c();``
+``setup_c();``
As a size optimization, zero-initialized variables of static storage
duration are not written to the executable. Instead only the region
where they should be located is described and at runtime that region
is zeroed. This is what ``setup_c()`` does.
 
- - ``pbl_set_putc(my_serial_putc, (void *)BASE_ADDR);``
+``pbl_set_putc(my_serial_putc, (void *)BASE_ADDR);``
Now that we have a C environment set up, lets set our first global
-   variable. ``pbl_set_putc`` saves a function pointer that can be used
-   to output a single character. This can be used for the early PBL
-   console to output messages even before any drivers are initialized.
+   variable. ``pbl_set_putc`` saves a pointer to a function
+   (``my_serial_putc``) that is called by the ``pr_*`` functions to output a
+   single character. This can be used for the early PBL console to output
+   messages even before any drivers are initialized.
+   The second parameter (UART register base address in this instance) is passed
+   as a user parameter when the provided function is called.
 
- - ``barebox_arm_entry`` will compute a new stack top from the supplied memory
-   region and uncompress barebox proper and pass along its arguments.
+``barebox_arm_entry(...)``
+   This will compute a new stack top from the supplied memory
+   region, uncompress barebox proper and pass along its arguments.
 
 Looking at other boards you might see some different patterns:
 
- - ``*_cpu_lowlevel_init();``: Often some common initialization and quirk 
handling
+``*_cpu_lowlevel_init();``
+   Often some common initialization and quirk handling
needs to be done at start. If a board similar to yours does this, you 
probably
want to do likewise.
 
- - ``__naked``: All functions called before stack is correctly initialized 
must be
+``__naked``
+   All functions called before stack is correctly initialized must be
marked with this attribute. Otherwise, function prologue and epilogue may 
access
the uninitialized stack. Note that even with ``__naked``, the compiler may 

Re: [PATCH 11/11] treewide: add SPDX-License-Identifier for files without explicit license

2022-01-03 Thread Roland Hieber
On Mon, Jan 03, 2022 at 01:20:53PM +0100, Uwe Kleine-König wrote:
> On Mon, Jan 03, 2022 at 01:05:39PM +0100, Ahmad Fatoum wrote:
> > diff --git a/arch/arm/tools/gen-mach-types b/arch/arm/tools/gen-mach-types
> > index 04fef71d7be9..fcfc0ed192e1 100644
> > --- a/arch/arm/tools/gen-mach-types
> > +++ b/arch/arm/tools/gen-mach-types
> > @@ -1,5 +1,7 @@
> >  #!/bin/awk
> >  #
> > +# SPDX-License-Identifier: GPL-2.0-only
> > +#
> 
> I would prefer to have the license identifier in the 2nd line. Not sure
> what the standard tells, but ISTR that in Linux the is no "empty" line,
> too.

I was stumbling over this one too, but the standard says "at or near the
top of the file" [1], so I think, this is okay.

Otherwise didn't notice anything strange while scrolling through this
series, except a few newline changes at ends of files here and there,
but I think those are okay too.

[1]: 
https://spdx.github.io/spdx-spec/using-SPDX-short-identifiers-in-source-files/#e2-format-for-spdx-license-identifier

> Otherwise thanks for your effort,

Yes, thank you!

 - Roland

-- 
Roland Hieber, Pengutronix e.K.  | r.hie...@pengutronix.de |
Steuerwalder Str. 21 | https://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: Howto implement bootchooser <-> rauc interaction

2022-01-03 Thread Roland Hieber
On Wed, Dec 15, 2021 at 11:56:21AM +0100, Ahmad Fatoum wrote:
> On 14.12.21 22:40, Konstantin Kletschke wrote:
> > On 2021-12-05 23:55, Roland Hieber wrote:
> > 
> >> You probably also want to delete your bootchooser variables from the env
> > 
> > Are you shure about that? I read some example/documentation at bootlin.com
> > doing/presenting a nice phytec device tree for EEPROM state but later on it 
> > points out to
> > "[...]add bootchooser variables associated to both targets in 
> > arch/arm//env/nv[...]"
> 
> I think Roland meant that you shouldn't rely on the _mutable_ environment
> for production. It's nice to test out stuff, but once you have figured
> out what you need, add it to the built-in environment (e.g.
> arch/arm/ 
> Mutating the environment is mostly a development convenience.

No, I was confusing the "bootchooser" variables with "bootstate"
variables, which should come from state, not from nv. But generally what
Ahmad writes sounds reasonable to me :-) Sorry for the confusion!

 - Roland

>  
> > When I utilize "devinfo state" (with all global/nv bootchoser variables 
> > removed) I get
> > 
> > barebox@TI AM335x BeagleBone black:/ devinfo state
> > Parameters:
> >   bootstate.last_chosen: 0 (type: uint32)
> >   bootstate.system0.ok: 0 (type: uint32)
> >   bootstate.system0.priority: 21 (type: uint32)
> >   bootstate.system0.remaining_attempts: 3 (type: uint32)
> >   bootstate.system1.ok: 0 (type: uint32)
> >   bootstate.system1.priority: 20 (type: uint32)
> >   bootstate.system1.remaining_attempts: 3 (type: uint32)
> >   dirty: 0 (type: bool)
> >   init_from_defaults: 0 (type: bool)
> >   save_on_shutdown: 1 (type: bool)
> > 
> > 
> > Is bootchooser smart enough to gather system0 and system1 as bootable 
> > entries/possibilities?
> > For bootchooser.targets...
> > 
> > My system is not proven to work (I just sent a different mail with my other 
> > issues to this thread)
> > yet, may be there are other issues hidden, but I do not get this part.
> > 
> > I created two boot entries system0 and system1 in /env/boot/ with content 
> > mmc1.1 (for system0) and
> > mmc1.2 (for system1.2). Both are bootloader-spec-enabled partitions. What 
> > me bothers is, "boot mmc1.1" works,
> > "boot system0" not. How do I properly make a bootchoser entry for mmc1.1?
> > 
> > If no variables are required, where could be the cuplrit for this:
> > 
> > barebox@TI AM335x BeagleBone black:/ bootchooser
> > ERROR: bootchooser: Target list $global.bootchooser.targets is empty
> > No bootchooser found
> 
> Doing it in the environment is how it's meant to be used.
> Just do it at compile-time. Having devices in the field with differing
> mutated environments is a lot of headache. Differing barebox-state on the 
> other
> hand is manageable, because you restrict what variables are available
> and how they interact with the rest of the system.
> 
> Cheers,
> Ahmad
> 
> > 
> > 
> > 
> > Kind Regards,
> > Konsti

-- 
Roland Hieber, Pengutronix e.K.  | r.hie...@pengutronix.de |
Steuerwalder Str. 21 | https://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: Howto implement bootchooser <-> rauc interaction

2021-12-05 Thread Roland Hieber
On Fri, Dec 03, 2021 at 09:52:00AM -0800, Trent Piepho wrote:
> On Fri, Dec 3, 2021 at 4:42 AM Konstantin Kletschke
>  wrote:
> > The documentation looks very good and comprehensive overall but may be
> > its me not getting
> > the part how and where the shared data is properly stored.
> 
> You should add a node of "barebox,state" to the *Barebox* device tree.
> Barebox needs to read state when it boots to determine the partition
> to use and set boot attempts.  You also need in aliases { state =
> &your_state_node: }: so it knows which state node it should use.

FYI, there are a few more pointers in the docs too:
<https://www.barebox.org/doc/latest/user/state.html>

In short:  barebox state is meant to be read (and written) from the
Linux world too, in contrast to the barebox env, which is only meant to
be used by barebox itself.

You probably also want to delete your bootchooser variables from the env
so they don't cause confusion :-) You can inspect the state variables
with 'devinfo state', and set them via 'state.variablename=value'. They
should also show up in 'global'.

 - Roland

-- 
Roland Hieber, Pengutronix e.K.  | r.hie...@pengutronix.de |
Steuerwalder Str. 21 | https://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 3/3] drivers: migrate "GPL-2.0+" license identifiers to SPDX 2.0

2021-11-17 Thread Roland Hieber
"GPL-2.0-or-later" was introduced in SPDX 2.0, and the old identifier
"GPL-2.0+" is now deprecated; see <https://spdx.org/licenses>.

Signed-off-by: Roland Hieber 
---
 drivers/block/virtio_blk.c | 2 +-
 drivers/clk/at91/clk-sam9x60-pll.c | 2 +-
 drivers/clocksource/clps711x.c | 2 +-
 drivers/ddr/fsl/arm_ddr_gen3.c | 2 +-
 drivers/ddr/fsl/ctrl_regs.c| 2 +-
 drivers/ddr/fsl/ddr4_dimm_params.c | 2 +-
 drivers/ddr/fsl/fsl_ddr_gen4.c | 2 +-
 drivers/ddr/fsl/options.c  | 2 +-
 drivers/ddr/imx8m/ddr_init.c   | 2 +-
 drivers/ddr/imx8m/ddrphy_csr.c | 2 +-
 drivers/ddr/imx8m/ddrphy_train.c   | 2 +-
 drivers/ddr/imx8m/ddrphy_utils.c   | 2 +-
 drivers/ddr/imx8m/helper.c | 2 +-
 drivers/gpio/gpio-clps711x.c   | 2 +-
 drivers/gpio/gpio-raspberrypi-exp.c| 2 +-
 drivers/mfd/rave-sp.c  | 2 +-
 drivers/misc/ubootvar.c| 2 +-
 drivers/net/fsl-fman.c | 2 +-
 drivers/net/virtio.c   | 2 +-
 drivers/nvmem/rmem.c   | 2 +-
 drivers/phy/freescale/phy-fsl-imx8mq-usb.c | 2 +-
 drivers/power/reset/nvmem-reboot-mode.c| 2 +-
 drivers/reset/reset-stm32.c| 2 +-
 drivers/serial/serial_clps711x.c   | 2 +-
 drivers/serial/serial_sbi.c| 2 +-
 drivers/serial/serial_sifive.c | 2 +-
 drivers/serial/serial_stm32.c  | 2 +-
 drivers/serial/serial_stm32.h  | 2 +-
 drivers/soc/imx/gpcv2.c| 2 +-
 drivers/spi/spi-fsl-dspi.c | 2 +-
 drivers/spi/spi-fsl-qspi.c | 2 +-
 drivers/spi/spi-mem.c  | 2 +-
 drivers/spi/zynq_qspi.c| 2 +-
 drivers/usb/dwc2/core.c| 2 +-
 drivers/usb/dwc2/core.h| 2 +-
 drivers/usb/dwc2/dwc2.c| 2 +-
 drivers/usb/dwc2/dwc2.h| 2 +-
 drivers/usb/dwc2/gadget.c  | 2 +-
 drivers/usb/dwc2/host.c| 2 +-
 drivers/usb/dwc2/regs.h| 2 +-
 drivers/usb/dwc2/rhub.c| 2 +-
 drivers/usb/gadget/storage_common.c| 2 +-
 drivers/usb/host/xhci-mem.c| 2 +-
 drivers/usb/host/xhci-ring.c   | 2 +-
 drivers/usb/host/xhci.c| 2 +-
 drivers/usb/host/xhci.h| 2 +-
 drivers/usb/misc/usb251xb.c| 2 +-
 drivers/virtio/virtio_pci_modern.c | 2 +-
 drivers/virtio/virtio_ring.c   | 2 +-
 drivers/watchdog/rave-sp-wdt.c | 2 +-
 50 files changed, 50 insertions(+), 50 deletions(-)

diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 87ab505f8326..660f3a7b6b9b 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0+
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2018, Tuomas Tynkkynen 
  * Copyright (C) 2018, Bin Meng 
diff --git a/drivers/clk/at91/clk-sam9x60-pll.c 
b/drivers/clk/at91/clk-sam9x60-pll.c
index 744c3833bb34..e94b3eec4192 100644
--- a/drivers/clk/at91/clk-sam9x60-pll.c
+++ b/drivers/clk/at91/clk-sam9x60-pll.c
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0+
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  *  Copyright (C) 2019 Microchip Technology Inc.
  *
diff --git a/drivers/clocksource/clps711x.c b/drivers/clocksource/clps711x.c
index a99147f30c4f..cd099604786e 100644
--- a/drivers/clocksource/clps711x.c
+++ b/drivers/clocksource/clps711x.c
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0+
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* Author: Alexander Shiyan  */
 
 #include 
diff --git a/drivers/ddr/fsl/arm_ddr_gen3.c b/drivers/ddr/fsl/arm_ddr_gen3.c
index c016917a3fbe..a8b96f1261be 100644
--- a/drivers/ddr/fsl/arm_ddr_gen3.c
+++ b/drivers/ddr/fsl/arm_ddr_gen3.c
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0+
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright 2013 Freescale Semiconductor, Inc.
  *
diff --git a/drivers/ddr/fsl/ctrl_regs.c b/drivers/ddr/fsl/ctrl_regs.c
index eb99e0ea21e7..b0d98a929c5d 100644
--- a/drivers/ddr/fsl/ctrl_regs.c
+++ b/drivers/ddr/fsl/ctrl_regs.c
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0+
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright 2008-2016 Freescale Semiconductor, Inc.
  * Copyright 2017-2018 NXP Semiconductor
diff --git a/drivers/ddr/fsl/ddr4_dimm_params.c 
b/drivers/ddr/fsl/ddr4_dimm_params.c
index f39b6e2853b1..0be2de8de611 100644
--- a/drivers/ddr/fsl/ddr4_dimm_params.c
+++ b/drivers/ddr/fsl/ddr4_dimm_params.c
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0+
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright 2014-2016 Freescale Semiconductor, Inc.
  * Copyright 2017-2018 NXP Semiconductor
di

[PATCH 1/3] drivers: mci-bcm2835: remove useless comment

2021-11-17 Thread Roland Hieber
The comment serves no purpose anymore since the previously following
license blurb was migrated to an SPDX license identifier.

Fixes: 28f4a6a4df76f0f1581d (2021-10-30, "drivers: add missing 
SPDX-License-Identifier")
Signed-off-by: Roland Hieber 
---
 drivers/mci/mci-bcm2835.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/mci/mci-bcm2835.c b/drivers/mci/mci-bcm2835.c
index 4913dc27f8a3..7203cd1dacda 100644
--- a/drivers/mci/mci-bcm2835.c
+++ b/drivers/mci/mci-bcm2835.c
@@ -10,8 +10,6 @@
  * timing workarounds) obviously extracted from the Linux kernel at:
  * https://github.com/raspberrypi/linux.git rpi-3.6.y
  *
- * The Linux kernel code has the following (c)
- *
  * Author: Wilhelm Lundgren 
  */
 
-- 
2.30.2


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


Re: [PATCH 2/2] pinctrl: bcm2835: Add support for bcm2711

2021-09-22 Thread Roland Hieber
On Fri, Sep 17, 2021 at 11:41:52AM +0200, Uwe Kleine-König wrote:
> From: Ahmad Fatoum 
> 
> bcm2711-rpi-4-b.dts lists 58 gpio names and the linux driver also uses
> 58 GPIOs for bcm2711.
> 
> Signed-off-by: Uwe Kleine-König 

Ahmad's S-o-b is missing on both.

 - Roland

> ---
>  drivers/pinctrl/pinctrl-bcm2835.c | 22 +-
>  1 file changed, 21 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/pinctrl/pinctrl-bcm2835.c 
> b/drivers/pinctrl/pinctrl-bcm2835.c
> index 38c788c82945..684ead2f8e5e 100644
> --- a/drivers/pinctrl/pinctrl-bcm2835.c
> +++ b/drivers/pinctrl/pinctrl-bcm2835.c
> @@ -52,6 +52,10 @@ struct bcm2835_gpio_chip {
>   struct pinctrl_device pctl;
>  };
>  
> +struct plat_data {
> + unsigned ngpios;
> +};
> +
>  static int bcm2835_set_function(struct gpio_chip *chip, unsigned gpio, int 
> function)
>  {
>   struct bcm2835_gpio_chip *bcmgpio = container_of(chip, struct 
> bcm2835_gpio_chip, chip);
> @@ -149,10 +153,13 @@ static struct pinctrl_ops bcm2835_pinctrl_ops = {
>  
>  static int bcm2835_gpio_probe(struct device_d *dev)
>  {
> + const struct plat_data *plat_data;
>   struct resource *iores;
>   struct bcm2835_gpio_chip *bcmgpio;
>   int ret;
>  
> + plat_data = device_get_match_data(dev);
> +
>   bcmgpio = xzalloc(sizeof(*bcmgpio));
>   iores = dev_request_mem_resource(dev, 0);
>   if (IS_ERR(iores))
> @@ -160,7 +167,8 @@ static int bcm2835_gpio_probe(struct device_d *dev)
>   bcmgpio->base = IOMEM(iores->start);
>   bcmgpio->chip.ops = &bcm2835_gpio_ops;
>   bcmgpio->chip.base = 0;
> - bcmgpio->chip.ngpio = 54;
> + bcmgpio->chip.ngpio = plat_data->ngpios;
> +
>   bcmgpio->chip.dev = dev;
>   bcmgpio->pctl.ops = &bcm2835_pinctrl_ops;
>   bcmgpio->pctl.dev = dev;
> @@ -191,9 +199,21 @@ err:
>   return ret;
>  }
>  
> +static const struct plat_data bcm2835_plat_data = {
> + .ngpios = 54,
> +};
> +
> +static const struct plat_data bcm2711_plat_data = {
> + .ngpios = 58,
> +};
> +
>  static __maybe_unused struct of_device_id bcm2835_gpio_dt_ids[] = {
>   {
>   .compatible = "brcm,bcm2835-gpio",
> + .data = &bcm2835_plat_data,
> + }, {
> + .compatible = "brcm,bcm2711-gpio",
> +     .data = &bcm2711_plat_data,
>   }, {
>   /* sentinel */
>   }
> -- 
> 2.30.2
> 
> 
> ___
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox

-- 
Roland Hieber, Pengutronix e.K.  | r.hie...@pengutronix.de |
Steuerwalder Str. 21 | https://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 2/4] common: add new menu for target tools

2021-09-14 Thread Roland Hieber
On Tue, Sep 14, 2021 at 03:20:14PM +0200, Ahmad Fatoum wrote:
> We have four target tools and will add 3 more in a follow up commit.
> Add a new menu to collect them.
> 
> Signed-off-by: Ahmad Fatoum 

Looks very useful to me.

Acked-by: Roland Hieber 

> ---
>  common/Kconfig  | 26 --
>  scripts/Kconfig | 30 ++
>  2 files changed, 30 insertions(+), 26 deletions(-)
> 
> diff --git a/common/Kconfig b/common/Kconfig
> index 222a438ee545..9dab7532e15e 100644
> --- a/common/Kconfig
> +++ b/common/Kconfig
> @@ -734,18 +734,6 @@ config IMD
>   select CRC32
>   bool "barebox metadata support"
>  
> -config IMD_TARGET
> - bool "build bareboximd target tool"
> - depends on IMD
> -
> -config KERNEL_INSTALL_TARGET
> - bool
> - prompt "Build kernel-install utility for the target"
> - help
> -   Enable this to compile the kernel-install script using the cross
> -   compiler. The utility for the target will be under
> -   scripts/kernel-install-target
> -
>  choice
>   prompt "console support"
>   default CONSOLE_FULL
> @@ -980,20 +968,6 @@ config DEFAULT_ENVIRONMENT_PATH
> be taken. Relative paths will be relative to the barebox top-level
> directory, but absolute paths are fine as well.
>  
> -config BAREBOXENV_TARGET
> - bool
> - prompt "build bareboxenv tool for target"
> - help
> -   'bareboxenv' is a tool to access the barebox environment from a 
> running Linux
> -   system. Say yes here to build it for the target.
> -
> -config BAREBOXCRC32_TARGET
> - bool
> - prompt "build bareboxcrc32 tool for target"
> - help
> -   'bareboxcrc32' is a userspacetool to generate the crc32 checksums the 
> same way
> -   barebox does. Say yes here to build it for the target.
> -
>  config HAS_SCHED
>   bool
>  
> diff --git a/scripts/Kconfig b/scripts/Kconfig
> index b903486ecd8f..f7ed775fbc66 100644
> --- a/scripts/Kconfig
> +++ b/scripts/Kconfig
> @@ -40,3 +40,33 @@ config OMAP4_HOSTTOOL_USBBOOT
> You need libusb-1.0 to compile this tool.
>  
>  endmenu
> +
> +menu "Target Tools"
> +
> +config IMD_TARGET
> + bool "build bareboximd target tool"
> + depends on IMD
> +
> +config KERNEL_INSTALL_TARGET
> + bool
> + prompt "Build kernel-install utility for the target"
> + help
> +   Enable this to compile the kernel-install script using the cross
> +   compiler. The utility for the target will be under
> +   scripts/kernel-install-target
> +
> +config BAREBOXENV_TARGET
> + bool
> + prompt "build bareboxenv tool for target"
> + help
> +   'bareboxenv' is a tool to access the barebox environment from a 
> running Linux
> +   system. Say yes here to build it for the target.
> +
> +config BAREBOXCRC32_TARGET
> + bool
> + prompt "build bareboxcrc32 tool for target"
> + help
> +   'bareboxcrc32' is a userspacetool to generate the crc32 checksums the 
> same way
> +   barebox does. Say yes here to build it for the target.
> +
> +endmenu
> -- 
> 2.30.2
> 
> 

-- 
Roland Hieber, Pengutronix e.K.  | r.hie...@pengutronix.de |
Steuerwalder Str. 21 | https://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] fs: remove unused struct fs_device_d::parent_device

2021-09-14 Thread Roland Hieber
On Tue, Sep 14, 2021 at 11:02:23AM +0200, Ahmad Fatoum wrote:
> On 14.09.21 10:55, Roland Hieber wrote:
> > On Mon, Sep 13, 2021 at 10:30:19AM +0200, Ahmad Fatoum wrote:
> >> The parent_device member is unused anywhere, so drop it.
> > 
> > s/is/isn't/?
> 
> is unused == isn't used..?

Yes. Sorry. Not enough coffee.

 - Roland

-- 
Roland Hieber, Pengutronix e.K.  | r.hie...@pengutronix.de |
Steuerwalder Str. 21 | https://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] fs: remove unused struct fs_device_d::parent_device

2021-09-14 Thread Roland Hieber
On Mon, Sep 13, 2021 at 10:30:19AM +0200, Ahmad Fatoum wrote:
> The parent_device member is unused anywhere, so drop it.

s/is/isn't/?

> 
> Signed-off-by: Ahmad Fatoum 
> ---
>  fs/fs.c  | 1 -
>  include/fs.h | 1 -
>  2 files changed, 2 deletions(-)
> 
> diff --git a/fs/fs.c b/fs/fs.c
> index b6431227d60c..e6fd57b8ac97 100644
> --- a/fs/fs.c
> +++ b/fs/fs.c
> @@ -813,7 +813,6 @@ int fsdev_open_cdev(struct fs_device_d *fsdev)
>   }
>  
>   fsdev->dev.parent = fsdev->cdev->dev;
> - fsdev->parent_device = fsdev->cdev->dev;
>  
>   return 0;
>  }
> diff --git a/include/fs.h b/include/fs.h
> index 5811199c0161..cd5eb571e08e 100644
> --- a/include/fs.h
> +++ b/include/fs.h
> @@ -101,7 +101,6 @@ struct fs_device_d {
>   struct cdev *cdev;
>   bool loop;
>   char *path;
> - struct device_d *parent_device;
>   struct list_head list;
>   char *options;
>   char *linux_rootarg;
> -- 
> 2.33.0
> 
> 
> _______
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Roland Hieber, Pengutronix e.K.  | r.hie...@pengutronix.de |
Steuerwalder Str. 21 | https://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] video: Fix broken bcm2835 fb driver

2021-09-08 Thread Roland Hieber
On Tue, Sep 07, 2021 at 09:29:15AM +0200, Daniel Brát wrote:
> The bcm2835 framebuffer driver was broken, because the address of video
> buffer allocated for us by the GPU and returned through mailbox was
> used without converting it back to ARM address space. That unconverted
> address was also in the range of peripheral addresses, which caused
> other issues later on due to it being filled with garbage data.
> The offset by which to convert the address back can vary by device,
> so the value is read from devicetree 'dma-ranges' for somewhat portable
> operation.
> This fix was tested on Raspberry PI B+ and Raspberry PI 3B+.
> 
> Signed-off-by: Daniel Brát 
> ---
>  drivers/video/bcm2835.c | 21 +++--
>  1 file changed, 19 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/video/bcm2835.c b/drivers/video/bcm2835.c
> index d808bc5c9..2ebe912d0 100644
> --- a/drivers/video/bcm2835.c
> +++ b/drivers/video/bcm2835.c
> @@ -14,6 +14,7 @@
>  #include 
>  #include 
>  
> +#include 
>  #include 
>  
>  struct bcm2835fb_info {
> @@ -58,9 +59,24 @@ static int bcm2835fb_probe(struct device_d *dev)
>   BCM2835_MBOX_STACK_ALIGN(struct msg_fb_query, msg_query);
>   BCM2835_MBOX_STACK_ALIGN(struct msg_fb_setup, msg_setup);
>   struct bcm2835fb_info *info;
> + struct device_node *soc;
>   u32 w, h;
> + u64 dma_addr, cpu_addr, _region_size;
> + phys_addr_t buffer_addr;
>   int ret;
>  
> + soc = of_find_node_by_path("/soc");
> + if (!soc) {
> + dev_err(dev, "could not find required of node /soc\n");

Nit: I'd use "OF" in capitals to ease human parsing and prevent
confusing with the English preposition.

> + return -ENODEV;
> + }
> +
> + ret = of_dma_get_range(soc, &dma_addr, &cpu_addr, &_region_size);
> + if (ret) {
> + dev_err(dev, "of node /soc has no dma-ranges\n");

Here too.

 - Roland

> + return ret;
> + }
> +
>   BCM2835_MBOX_INIT_HDR(msg_query);
>   BCM2835_MBOX_INIT_TAG_NO_REQ(&msg_query->physical_w_h,
>   GET_PHYSICAL_W_H);
> @@ -99,10 +115,11 @@ static int bcm2835fb_probe(struct device_d *dev)
>   return ret;
>   }
>  
> + buffer_addr = (msg_setup->allocate_buffer.body.resp.fb_address & 
> ~dma_addr) + cpu_addr;
> +
>   info = xzalloc(sizeof *info);
>   info->fbi.fbops = &bcm2835fb_ops;
> - info->fbi.screen_base =
> -(void *)msg_setup->allocate_buffer.body.resp.fb_address;
> + info->fbi.screen_base = phys_to_virt(buffer_addr);
>   info->fbi.xres = msg_setup->physical_w_h.body.resp.width;
>   info->fbi.yres = msg_setup->physical_w_h.body.resp.height;
>   info->fbi.bits_per_pixel = 16;
> -- 
> 2.17.1
> 
> 
> ___
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox

-- 
Roland Hieber, Pengutronix e.K.  | r.hie...@pengutronix.de |
Steuerwalder Str. 21 | https://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] arm: mxs: Replace license and copyright boilerplate by SPDX identifiers

2021-08-01 Thread Roland Hieber
On Fri, Jul 30, 2021 at 09:28:02PM +0200, Uwe Kleine-König wrote:
> Converts the files that licensecheck can determine to be licensed under
> GPL-2.0-only or GPL-2.0-or-later and also convert their copyright
> statements to SPDX.
> 
> Signed-off-by: Uwe Kleine-König 
> ---
>  arch/arm/mach-mxs/bcb.c  | 10 +++---
>  arch/arm/mach-mxs/clocksource-imx23.c| 16 ++-
>  arch/arm/mach-mxs/clocksource-imx28.c| 15 ++
>  arch/arm/mach-mxs/imx.c  | 16 ++-
>  arch/arm/mach-mxs/include/mach/clock.h   | 16 ++-
>  arch/arm/mach-mxs/include/mach/fb.h  | 12 +--
>  arch/arm/mach-mxs/include/mach/generic.h | 16 ++-
>  arch/arm/mach-mxs/include/mach/imx-regs.h| 16 ++-
>  arch/arm/mach-mxs/include/mach/imx23-regs.h  | 15 ++
>  arch/arm/mach-mxs/include/mach/imx28-regs.h  | 12 +--
>  arch/arm/mach-mxs/include/mach/iomux-imx23.h | 14 ++---
>  arch/arm/mach-mxs/include/mach/iomux-imx28.h | 12 +--
>  arch/arm/mach-mxs/include/mach/iomux.h   | 16 ++-
>  arch/arm/mach-mxs/include/mach/mci.h | 13 +---
>  arch/arm/mach-mxs/include/mach/ssp.h | 15 --
>  arch/arm/mach-mxs/iomux-imx.c| 16 ++-
>  arch/arm/mach-mxs/ocotp.c| 17 +---
>  arch/arm/mach-mxs/power.c| 17 ++--
>  arch/arm/mach-mxs/soc-imx23.c| 19 --
>  arch/arm/mach-mxs/soc-imx28.c| 19 --
>  arch/arm/mach-mxs/usb-imx23.c| 20 +--
>  arch/arm/mach-mxs/usb-imx28.c| 21 +-------
>  22 files changed, 60 insertions(+), 283 deletions(-)

Reviewed-by: Roland Hieber 

> diff --git a/arch/arm/mach-mxs/bcb.c b/arch/arm/mach-mxs/bcb.c
> index 860508bde7c5..749cf29af610 100644
> --- a/arch/arm/mach-mxs/bcb.c
> +++ b/arch/arm/mach-mxs/bcb.c
> @@ -1,11 +1,7 @@
> +// SPDX-License-Identifier: GPL-2.0-or-later
> +// SPDX-FileCopyrightText: 2011 Wolfram Sang, Pengutronix e.K.
> +
>  /*
> - * (C) Copyright 2011 Wolfram Sang, Pengutronix e.K.
> - *
> - * This program 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.
> - *
>   * Based on a similar function in Karo Electronics TX28-U-Boot (flash.c).
>   * Probably written by Lothar Waßmann (like tx28.c).
>   */
> diff --git a/arch/arm/mach-mxs/clocksource-imx23.c 
> b/arch/arm/mach-mxs/clocksource-imx23.c
> index 8279ee2f2df8..0a6716f87958 100644
> --- a/arch/arm/mach-mxs/clocksource-imx23.c
> +++ b/arch/arm/mach-mxs/clocksource-imx23.c
> @@ -1,17 +1,5 @@
> -/*
> - * (C) Copyright 2010 Juergen Beisert - Pengutronix
> - *
> - * This program 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 program 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.
> - *
> - */
> +// SPDX-License-Identifier: GPL-2.0-or-later
> +// SPDX-FileCopyrightText: 2010 Juergen Beisert, Pengutronix
>  
>  #include 
>  #include 
> diff --git a/arch/arm/mach-mxs/clocksource-imx28.c 
> b/arch/arm/mach-mxs/clocksource-imx28.c
> index 4f38af68b4a5..ea6d4b514630 100644
> --- a/arch/arm/mach-mxs/clocksource-imx28.c
> +++ b/arch/arm/mach-mxs/clocksource-imx28.c
> @@ -1,16 +1,5 @@
> -/*
> - * (C) Copyright 2010 Juergen Beisert - Pengutronix 
> - *
> - * This program 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 program 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.
> - */
> +// SPDX-License-Identifier: GPL-2.0-or-later
> +// SPDX-FileCopyrightText: 2010 Juergen Beisert, Pengutronix 
> 
>  
>  #include 
>  #include 
> diff --git a/arch/arm/mach-mxs/imx.c b/ar

Re: [PATCH] ARM: SoCFPGA: add Terasic DE10-Nano board support

2021-05-31 Thread Roland Hieber
On Fri, May 28, 2021 at 12:29:51PM +0300, Antony Pavlov wrote:
> On Thu, 27 May 2021 21:36:00 +0200
> Gwenhael Goavec-Merou  wrote:
> 
> > From: Gwenhael Goavec-Merou 
> > 
> > The Terasic DE10-Nano board is based on CycloneV SoCFPGA (5CSEBA6) with
> > 
> > What has been tested to work:
> > - SD card
> > - Gigabit network
> 
> What is the status of FPGA bitstream loading?
> 
> ...
> 
> > diff --git a/arch/arm/boards/terasic-de10-nano/iocsr_config_cyclone5.c 
> > b/arch/arm/boards/terasic-de10-nano/iocsr_config_cyclone5.c
> > new file mode 100644
> > index 0..c1291dea4
> > --- /dev/null
> > +++ b/arch/arm/boards/terasic-de10-nano/iocsr_config_cyclone5.c
> > @@ -0,0 +1,678 @@
> > +/* GENERATED FILE - DO NOT EDIT */

By the way, what were the sources from which that file was generated?
(I assume the sources were under BSD-3-Clause…?)

 - Roland

> > +/*
> > + * Copyright Altera Corporation (C) 2012-2014. All rights reserved
> > + *
> > + * SPDX-License-Identifier:BSD-3-Clause
> 
> To: Sascha
> Can we add BSD-3-Clause-licensed file into barebox?
> 
> ...
> 
> > diff --git a/arch/arm/dts/socfpga_cyclone5_de10_nano.dts 
> > b/arch/arm/dts/socfpga_cyclone5_de10_nano.dts
> > new file mode 100644
> > index 0..6965e3820
> > --- /dev/null
> > +++ b/arch/arm/dts/socfpga_cyclone5_de10_nano.dts
> > @@ -0,0 +1,34 @@
> > +/*
> > + *  Copyright (C) 2021 Gwenhael Goavec-Merou 
> > 
> > + *
> > + * This program 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.
> 
> Just use SPDX-License-Identifier here.
> 
> > + * This program 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.
> > + *
> > + * You should have received a copy of the GNU General Public License
> > + * along with this program.  If not, see <http://www.gnu.org/licenses/>.
> > + */
> > +
> 
> -- 
> Best regards,
>   Antony Pavlov
> 
> ___
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Roland Hieber, Pengutronix e.K.  | r.hie...@pengutronix.de |
Steuerwalder Str. 21 | https://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 3/3] fs: add linux_rootarg 'root=mmcblkXpN' support

2021-05-09 Thread Roland Hieber
On Thu, May 06, 2021 at 06:26:16PM +0200, Marco Felsch wrote:
> Since commit fa2d0aa96941 ("mmc: core: Allow setting slot index via
> device tree alias") the linux kernel supports stable mmc device names.
> Barebox has stable names since years so now we can connect both which
> allows us to pass 'root=mmcblkXpN' as argument for the cmdline. Note: it
> is crucial that the kernel device tree and the barebox device tree uses
> the same mmc aliases.
> 
> This patch adds the support to store the above cmdline as linux_rootarg
> if enabled. The partuuid is now used as fallback since it is not as
> unique as the mmcblkXpN scheme. It is added as build option since the
> system integrator needs to check if the used kernel contains the above
> commit.
> 
> Signed-off-by: Marco Felsch 
> ---
> v2:
> - improved Kconfig deps
> - improved Kconfig help message
> - minimal get_linux_mmcblkdev() simplifications
> 
>  common/Kconfig | 21 +
>  fs/fs.c| 42 ++
>  2 files changed, 59 insertions(+), 4 deletions(-)
> 
> diff --git a/common/Kconfig b/common/Kconfig
> index 6b3c1701be..5815ea06f0 100644
> --- a/common/Kconfig
> +++ b/common/Kconfig
> @@ -700,6 +700,27 @@ config FLEXIBLE_BOOTARGS
> to replace parts of the bootargs string without reconstructing it
> completely.
>  
> +config MMCBLKDEV_ROOTARG
> + bool
> + prompt "Support 'root=mmcblkXpN' cmdline appending"
> + depends on FLEXIBLE_BOOTARGS
> + depends on MCI
> + depends on OFTREE
> + help
> +   Enable this option to append 'root=mmcblkXpN' to the cmdline instead
> +   of 'root=PARTUUID=XYZ'. Don't enale this option if your used linux
> +   kernel don't contain commit [1]. The first linux kernel release

Nit: s/enale/enable/; s/don't/doesn't/ (can probably fixed during git-am).

 - Roland

> +   containing that commit is v5.10-rc1.
> +
> +   The appending only happen if barebox 'linux.bootargs.bootm.appendroot'
> +   variable is set or the used blspec entry contains 'linux-appendroot'.
> +
> +   Note: It is crucial that the kernel device tree and the barebox device
> +   tree uses the same mmc aliases.
> +
> +   [1] fa2d0aa96941 ("mmc: core: Allow setting slot index via device tree
> +   alias")
> +
>  config BAREBOX_UPDATE
>   bool "In-system barebox update infrastructure"
>  
> diff --git a/fs/fs.c b/fs/fs.c
> index 881dc2fca0..91feee03e6 100644
> --- a/fs/fs.c
> +++ b/fs/fs.c
> @@ -2831,6 +2831,33 @@ out:
>  }
>  EXPORT_SYMBOL(chdir);
>  
> +static char *get_linux_mmcblkdev(struct fs_device_d *fsdev)
> +{
> + struct cdev *cdevm, *cdev;
> + int id, partnum;
> +
> + cdevm = fsdev->cdev->master;
> + id = of_alias_get_id(cdevm->device_node, "mmc");
> + if (id < 0)
> + return NULL;
> +
> + partnum = 1; /* linux partitions are 1 based */
> + list_for_each_entry(cdev, &cdevm->partitions, partition_entry) {
> +
> + /*
> +  * Partname is not guaranteed but this partition cdev is listed
> +  * in the partitions list so we need to count it instead of
> +  * skipping it.
> +  */
> + if (cdev->partname &&
> + !strcmp(cdev->partname, fsdev->cdev->partname))
> + return basprintf("root=/dev/mmcblk%dp%d", id, partnum);
> + partnum++;
> + }
> +
> + return NULL;
> +}
> +
>  /*
>   * Mount a device to a directory.
>   * We do this by registering a new device on which the filesystem
> @@ -2919,11 +2946,18 @@ int mount(const char *device, const char *fsname, 
> const char *pathname,
>  
>   fsdev->vfsmount.mnt_root = fsdev->sb.s_root;
>  
> - if (!fsdev->linux_rootarg && fsdev->cdev && fsdev->cdev->partuuid[0] != 
> 0) {
> - char *str = basprintf("root=PARTUUID=%s",
> - fsdev->cdev->partuuid);
> + if (!fsdev->linux_rootarg && fsdev->cdev) {
> + char *str = NULL;
> +
> + if (IS_ENABLED(CONFIG_MMCBLKDEV_ROOTARG) &&
> + cdev_is_mci_main_part_dev(fsdev->cdev->master))
> +     str = get_linux_mmcblkdev(fsdev);
> +
> + if (!str && fsdev->cdev->partuuid[0] != 0)
> + str = basprintf("root=PARTUUID=%s", 
> fsdev->cdev->

[PATCH] README: advertise lore.barebox.org instead of mail-archive.com

2021-05-07 Thread Roland Hieber
The archived messages at mail-archive.org only contain a few headers,
and getting git-am-able patch mails from their HTML pages is quirky at
best. Replace the link with the new lore instance, which has a number of
advantages, like raw message contents with full headers, cloneable git
archives, and interoperability with the b4 command line tool.

Signed-off-by: Roland Hieber 
---
 README | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README b/README
index 7c5ef9f8187a..37fd80c10280 100644
--- a/README
+++ b/README
@@ -231,7 +231,7 @@ Contributing
 For any questions regarding barebox, send a mail to the mailing list at
 . The archives for this list are available
 publicly at <http://lists.infradead.org/pipermail/barebox/> and
-<https://www.mail-archive.com/barebox@lists.infradead.org/>.
+<https://lore.barebox.org/barebox/>.
 
 The same list should also be used to send patches. barebox uses a similar
 process as the Linux kernel, so most of the Linux guide for submitting patches
-- 
2.29.2


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


Re: [PATCH 6/9] net: add LiteEth driver

2021-05-06 Thread Roland Hieber
;, __func__, len);
> + litex_write8(priv->base + LITEETH_WRITER_EV_PENDING, reg);
> + goto done;
> + }
> +
> + rx_slot = litex_read8(priv->base + LITEETH_WRITER_SLOT);
> +
> + memcpy(NetRxPackets[0], priv->rx_base + rx_slot * LITEETH_BUFFER_SIZE, 
> len);
> +
> + net_receive(edev, NetRxPackets[0], len);
> +
> + litex_write8(priv->base + LITEETH_WRITER_EV_PENDING, reg);
> +
> +done:
> + return len;
> +}
> +
> +static void liteeth_eth_halt(struct eth_device *edev)
> +{
> + struct liteeth *priv = edev->priv;
> +
> + litex_write8(priv->base + LITEETH_WRITER_EV_ENABLE, 0);
> + litex_write8(priv->base + LITEETH_READER_EV_ENABLE, 0);
> +}
> +
> +static void liteeth_reset_hw(struct liteeth *priv)
> +{
> + /* Reset, twice */
> + litex_write8(priv->base + LITEETH_PHY_CRG_RESET, 0);
> + udelay(10);
> + litex_write8(priv->base + LITEETH_PHY_CRG_RESET, 1);
> + udelay(10);
> + litex_write8(priv->base + LITEETH_PHY_CRG_RESET, 0);
> + udelay(10);
> +}
> +
> +static int liteeth_get_ethaddr(struct eth_device *edev, unsigned char *m)
> +{
> + return 0;
> +}
> +
> +static int liteeth_set_ethaddr(struct eth_device *edev,
> + const unsigned char *mac_addr)
> +{
> + return 0;
> +}
> +
> +static int liteeth_probe(struct device_d *dev)
> +{
> + struct device_node *np = dev->device_node;
> + struct eth_device *edev;
> + void __iomem *buf_base;
> + struct liteeth *priv;
> + int err;
> +
> + priv = xzalloc(sizeof(struct liteeth));
> + edev = &priv->edev;
> + edev->priv = priv;
> + priv->dev = dev;
> +
> + priv->base = dev_request_mem_region(dev, 0);
> + if (IS_ERR(priv->base)) {
> + err = PTR_ERR(priv->base);
> + goto err;
> + }
> +
> + priv->mdio_base = dev_request_mem_region(dev, 1);
> + if (IS_ERR(priv->mdio_base)) {
> + err = PTR_ERR(priv->mdio_base);
> + goto err;
> + }
> +
> + buf_base = dev_request_mem_region(dev, 2);
> + if (IS_ERR(buf_base)) {
> + err = PTR_ERR(buf_base);
> + goto err;
> + }
> +
> + err = of_property_read_u32(np, "rx-fifo-depth",
> + &priv->num_rx_slots);
> + if (err) {
> + dev_err(dev, "unable to get rx-fifo-depth\n");
> + goto err;
> + }
> +
> + err = of_property_read_u32(np, "tx-fifo-depth",
> + &priv->num_tx_slots);
> + if (err) {
> + dev_err(dev, "unable to get tx-fifo-depth\n");
> + goto err;
> + }
> +
> + /* Rx slots */
> + priv->rx_base = buf_base;
> + priv->rx_slot = 0;
> +
> + /* Tx slots come after Rx slots */
> + priv->tx_base = buf_base + priv->num_rx_slots * LITEETH_BUFFER_SIZE;
> + priv->tx_slot = 0;
> +
> + edev->init = liteeth_init_dev;
> + edev->open = liteeth_eth_open;
> + edev->send = liteeth_eth_send;
> + edev->recv = liteeth_eth_rx;
> + edev->get_ethaddr = liteeth_get_ethaddr;
> + edev->set_ethaddr = liteeth_set_ethaddr;
> + edev->halt = liteeth_eth_halt;
> + edev->parent = dev;
> +
> + priv->mdiobb.ops = &bb_ops;
> +
> + priv->mii_bus = alloc_mdio_bitbang(&priv->mdiobb);
> + priv->mii_bus->parent = dev;
> +
> + liteeth_reset_hw(priv);
> +
> + err = eth_register(edev);
> + if (err) {
> + dev_err(dev, "failed to register edev\n");
> + goto err;
> + }
> +
> + err = mdiobus_register(priv->mii_bus);
> + if (err) {
> + dev_err(dev, "failed to register mii_bus\n");
> + goto err;
> + }
> +
> + dev_info(dev, DRV_NAME " driver registered\n");
> +
> + return 0;
> +
> +err:
> + return err;
> +}
> +
> +static const struct of_device_id liteeth_dt_ids[] = {
> + {
> + .compatible = "litex,liteeth"
> + }, {
> + }
> +};
> +
> +static struct driver_d liteeth_driver = {
> + .name = DRV_NAME,
> + .probe = liteeth_probe,
> + .of_compatible = DRV_OF_COMPAT(liteeth_dt_ids),
> +};
> +device_platform_driver(liteeth_driver);
> +
> +MODULE_AUTHOR("Joel Stanley ");
> +MODULE_LICENSE("GPL");
> -- 
> 2.31.1
> 
> 
> ___
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Roland Hieber, Pengutronix e.K.  | r.hie...@pengutronix.de |
Steuerwalder Str. 21 | https://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] fixup! common: add option for shipping KCONFIG_CONFIG as /env/data/config

2021-04-12 Thread Roland Hieber
On Sun, Apr 11, 2021 at 10:39:47PM +0200, Ahmad Fatoum wrote:
> Doesn't make sense to have this without DEFAULT_ENVIRONMENT_GENERIC_NEW
> support. Similar options depend on this as well.
> 
> Signed-off-by: Ahmad Fatoum 

Thanks, this is useful!

For both:
Tested-by: Roland Hieber 

> ---
>  common/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/common/Kconfig b/common/Kconfig
> index 2872c80dbf13..bddf802d3bb4 100644
> --- a/common/Kconfig
> +++ b/common/Kconfig
> @@ -943,6 +943,7 @@ config DEFAULT_ENVIRONMENT_GENERIC_NEW_REBOOT_MODE
>  
>  config DEFAULT_ENVIRONMENT_GENERIC_NEW_IKCONFIG
>   bool "Ship .config as /env/data/config"
> + depends on DEFAULT_ENVIRONMENT_GENERIC_NEW
>   help
> This option embeds the used barebox Kconfig .config file into the
> environment as /env/data/config. This will increases barebox image
> -- 
> 2.31.0
> 
> 
> ___
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Roland Hieber, Pengutronix e.K.  | r.hie...@pengutronix.de |
Steuerwalder Str. 21 | https://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 RESEND] doc: qemu-virt64: fix reST literal block syntax

2021-04-09 Thread Roland Hieber
Signed-off-by: Roland Hieber 
---

 Documentation/boards/aarch64-qemu-virt.rst | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/boards/aarch64-qemu-virt.rst 
b/Documentation/boards/aarch64-qemu-virt.rst
index cadc4e5543c1..42e7d00bfef6 100644
--- a/Documentation/boards/aarch64-qemu-virt.rst
+++ b/Documentation/boards/aarch64-qemu-virt.rst
@@ -8,6 +8,7 @@ Running barebox on QEMU aarch64 virt machine
 
 
 Usage::
+
$ qemu-system-aarch64 -m 2048M \
-cpu cortex-a57 -machine virt \
-display none -serial stdio \
-- 
2.29.2


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


[PATCH] doc: qemu-virt64: fix reST literal block syntax

2021-03-09 Thread Roland Hieber
Signed-off-by: Roland Hieber 
---
While we're at it… :-)

 Documentation/boards/aarch64-qemu-virt.rst | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/boards/aarch64-qemu-virt.rst 
b/Documentation/boards/aarch64-qemu-virt.rst
index cadc4e5543c1..42e7d00bfef6 100644
--- a/Documentation/boards/aarch64-qemu-virt.rst
+++ b/Documentation/boards/aarch64-qemu-virt.rst
@@ -8,6 +8,7 @@ Running barebox on QEMU aarch64 virt machine
 
 
 Usage::
+
$ qemu-system-aarch64 -m 2048M \
-cpu cortex-a57 -machine virt \
-display none -serial stdio \
-- 
2.29.2


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


[PATCH] common: Kconfig: improve defaultenv help texts

2021-01-28 Thread Roland Hieber
Signed-off-by: Roland Hieber 
---
 common/Kconfig | 28 ++--
 1 file changed, 22 insertions(+), 6 deletions(-)

diff --git a/common/Kconfig b/common/Kconfig
index b350f5c355fa..c62c70fb27eb 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -874,6 +874,13 @@ config DEFAULT_ENVIRONMENT_GENERIC_NEW
select NET_CMD_IFUP if NET
select CMD_IP_ROUTE_GET if NET
select CMD_HOST if NET
+   help
+ With this option barebox will use the files found under
+ defaultenv/defaultenv-2-base/ in the source tree as a template for
+ the defaultenv. The directories specified in DEFAULT_ENVIRONMENT_PATH
+ will be added to the default environment. If a file is present in
+ both locations, the file from DEFAULT_ENVIRONMENT_PATH will overwrite
+ that from the template.
 
 config DEFAULT_ENVIRONMENT_GENERIC
bool "Generic environment template (old version)"
@@ -887,9 +894,12 @@ config DEFAULT_ENVIRONMENT_GENERIC
select CMD_CRC_CMP
select CMD_GLOBAL
help
- With this option barebox will use the generic default
- environment found under defaultenv/ in the src tree.
- The Directory given with DEFAULT_ENVIRONMENT_PATH
+ Note: this option is not recommended for new boards; use
+ DEFAULT_ENVIRONMENT_GENERIC_NEW instead.
+
+ With this option barebox will use the old generic default environment
+ found under defaultenv/defaultenv-1/ in the source tree.
+ The directory given with DEFAULT_ENVIRONMENT_PATH
  will be added to the default environment. This should
  at least contain a /env/config file.
  This will be able to overwrite the files from defaultenv.
@@ -899,21 +909,27 @@ config DEFAULT_ENVIRONMENT_GENERIC_NEW_MENU
depends on DEFAULT_ENVIRONMENT_GENERIC_NEW
depends on CMD_MENUTREE
default y
+   help
+ Extend the defaultenv template with a menu that is displayed at boot.
+ The menu files are taken from defaultenv/defaultenv-2-menu/.
 
 config DEFAULT_ENVIRONMENT_GENERIC_NEW_DFU
bool
depends on DEFAULT_ENVIRONMENT_GENERIC_NEW
depends on USB_GADGET_DFU
default y
+   help
+ Extend the defaultenv template with the 'dfu' boot entry, which
+ allows uploading the kernel and oftree over USB via the dfu protocol.
 
 config DEFAULT_ENVIRONMENT_PATH
string
depends on DEFAULT_ENVIRONMENT
prompt "Default environment path"
help
- Space separated list of paths the default environment will be taken 
from.
- Relative paths will be relative to the barebox Toplevel dir, but 
absolute
- paths are fine as well.
+ Space separated list of paths from which the default environment will
+ be taken. Relative paths will be relative to the barebox top-level
+ directory, but absolute paths are fine as well.
 
 config BAREBOXENV_TARGET
bool
-- 
2.30.0


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


Re: [PATCH 2/3] ARM: i.MX: implement GPMI NAND xload

2021-01-20 Thread Roland Hieber
On Wed, Jan 20, 2021 at 01:51:06PM +0100, Andrej Picej wrote:
> From: Sascha Hauer 
> 
> Commit is based on initial Sascha Hauer's work. It implements PBL xload
> mechanism to load image from GPMI NAND flash.
> 
> Additional work was done, so that the NAND's size, page size and OOB's
> size are autodetected and not hardcoded. Detection method follows the
> same methods as used in NAND driver, meaning NAND ONFI support is probed
> and if NAND supports ONFI, NAND memory organization is read from ONFI
> parameter page otherwise "READ ID" is used.
> 
> Currently only implemented for i.MX6 familly of SoCs.
> 
> Signed-off-by: Sascha Hauer 
> Signed-off-by: Primoz Fiser 
> Signed-off-by: Andrej Picej 

I did not look at the code, but I appreciate how those names line up
nicely :-)

 - Roland

-- 
Roland Hieber, Pengutronix e.K.  | r.hie...@pengutronix.de |
Steuerwalder Str. 21 | https://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 2/4] common: dummy_malloc: remove unintended GPL2 eCos-exception-2.0

2020-11-29 Thread Roland Hieber
On Thu, Nov 26, 2020 at 06:55:51PM +0100, Ahmad Fatoum wrote:
> Apparently, the file should be GPL-2.0-only without exceptions:
> 
> On 24.11.20 09:44, Sascha Hauer wrote[1]:
> > This looks like I accidently copied the wrong header. I don't think I
> > did this on purpose. It doesn't make much sense to me when compiling
> > against dummy malloc is different than compiling against tlsf malloc
> > or dlmalloc.
> 
> Ase dropping exceptions is no relicense, it's ok to do here without
> acknowledgement from all authors. Do so.

I don't understand this reasoning. The exception allowed someone to link
this file with non-GPL code, and by dropping this exception, this
possibility is no longer allowed, so there is a change in license terms.

The only two other authors of this file are Andrey and Jean-Christophe,
hereby CCed.

 - Roland
 
> [1]: <20201124084434.gc14...@pengutronix.de>
> 
> Suggested-by: Sascha Hauer 
> Signed-off-by: Ahmad Fatoum 
> ---
> v1 -> v2: new patch
> ---
>  common/dummy_malloc.c | 21 +
>  1 file changed, 1 insertion(+), 20 deletions(-)
> 
> diff --git a/common/dummy_malloc.c b/common/dummy_malloc.c
> index 0120d9be2e85..d99b5059cf91 100644
> --- a/common/dummy_malloc.c
> +++ b/common/dummy_malloc.c
> @@ -1,25 +1,6 @@
> +// SPDX-License-Identifier: GPL-2.0-only
>  /*
>   * Copyright (C) 2013 Sascha Hauer 
> - *
> - * This program is free software; you can redistribute it and/or
> - * modify it under the terms of the GNU General Public License version 2
> - * as published by the Free Software Foundation.
> - *
> - * This program 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.
> - *
> - *
> - * As a special exception, if other files instantiate templates or use macros
> - * or inline functions from this file, or you compile this file and link it
> - * with other works to produce a work based on this file, this file does not
> - * by itself cause the resulting work to be covered by the GNU General Public
> - * License. However the source code for this file must still be made 
> available
> - * in accordance with section (3) of the GNU General Public License.
> -
> - * This exception does not invalidate any other reasons why a work based on
> - * this file might be covered by the GNU General Public License.
>   */
>  #include 
>  #include 
> -- 
> 2.29.2
> 
> 
> ___
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Roland Hieber, Pengutronix e.K.  | r.hie...@pengutronix.de |
Steuerwalder Str. 21 | https://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 11/11] doc: bcm283x: document use of mini-uart on Raspberry Pi Zero W / CM3

2020-11-29 Thread Roland Hieber
On Sat, Nov 28, 2020 at 10:39:34PM +0100, Ahmad Fatoum wrote:
> As described in the UART configuration[1] article in the Raspberry Pi
> Foundation documentation, Raspberry Pi 3 & 4 as well as Zero W use the
> mini-uart as primary (easily user-accessible) UART. At least on the
> Raspberry Zero W and CM3, we need to pass uart_2ndstage=1, so the
> BootROM leaves the 8250 IP in a suitable state for use by barebox.
> Document this.
> 
> [1]: https://www.raspberrypi.org/documentation/configuration/uart.md
> 
> Cc: Roland Hieber 
> Cc: Rouven Czerwinski 
> Cc: Robert Carnecky 
> Cc: Andrew John 
> Signed-off-by: Ahmad Fatoum 
> ---
>  Documentation/boards/bcm2835.rst | 7 +++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/Documentation/boards/bcm2835.rst 
> b/Documentation/boards/bcm2835.rst
> index c896871e0d82..dbdfc2633173 100644
> --- a/Documentation/boards/bcm2835.rst
> +++ b/Documentation/boards/bcm2835.rst
> @@ -23,6 +23,13 @@ Raspberry Pi
>   kernel=barebox.img
>   enable_uart=1
>  
> + If you want to use the mini-uart instead of the PL011, you might need 
> to additionally set::
> +
> + uart_2ndstage=1
> +
> + This is useful on newer boards like the Raspberry Pi Zero W and CM3, 
> which route the
> + more easily accessible primary UART to the mini-uart.

This seems to be non-optional on RPi Zero W, so I would word it more
strongly.

With this series, at least barebox boots, which is better than in master
:-) However, I cannot get the stock kernel (/boot/kernel.img) to boot on
Zero W, and I cannot figure out why:

barebox@RaspberryPi Zero W:/ cat /boot/config.txt 
enable_uart=1
kernel=barebox.img
uart_2ndstage=1
barebox@RaspberryPi Zero W:/ global bootm.image=/boot/kernel.img
barebox@RaspberryPi Zero W:/ global bootm.oftree=/boot/bcm2708-rpi-0-w.dtb
barebox@RaspberryPi Zero W:/ global 
linux.bootargs.dyn.root="root=/dev/mmcblk0p2 rootfstype=ext4 rootwait rw" 
barebox@RaspberryPi Zero W:/ bootm -v

Loading ARM Linux zImage '/boot/kernel.img'
OS image not yet relocated
Passing control to ARM zImage handler
no OS load address, defaulting to 0x014e9000
no initrd load address, defaulting to 0x01a18000
Loading devicetree from '/boot/bcm2708-rpi-0-w.dtb'
commandline: console=ttyS1,115200n8 root=/dev/mmcblk0p2 rootfstype=ext4 
rootwait rw

Starting kernel at 0x014e9000, oftree at 0x01a18000...
Starting kernel in secure mode

and then nothing happens at least for a minute.

I tried leaving 'uart_2ndstage=1' out, leaving 'enable_uart=1' out, setting
'console=ttyS1,115200n8' on the kernel command line, and setting
'console=ttyAMA0,115200n8' (as before), but nothing helped.

The same setup works on a RPI-1B (with bootm.oftree=/boot/bcm2708-rpi-b.dtb),
so at least there's that :)

Did you do anything else for your Zero W?

 - Roland

> +
>   (For more information, refer to the `documentation for config.txt`_.)
>  
>5. Connect to board's UART (115200 8N1);
> -- 
> 2.28.0
> 
> 

-- 
Roland Hieber, Pengutronix e.K.  | r.hie...@pengutronix.de |
Steuerwalder Str. 21 | https://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 3/3] common: replace license statements with SPDX-License-Identifiers

2020-11-26 Thread Roland Hieber
On Mon, Nov 23, 2020 at 05:01:28PM +0100, Ahmad Fatoum wrote:
> For all files in common/ that already have a license text:
>   - Replace with appropriate SPDX-License-Identifier
>   - Remove empty comment lines around replacement
>   - remove comment completely if only thing remaining is name
> of file without description
> 
> Signed-off-by: Ahmad Fatoum 
> ---
> Cc: Roland Hieber 
> Cc: Uwe Kleine-König 

Like Uwe already said, two instances of "o" instead of "only", otherwise
looks correct to me.

Reviewed-by: Roland Hieber 

> ---
>  common/bbu.c   | 10 +-
>  common/binfmt.c|  3 +--
>  common/block.c | 11 +--
>  common/blspec.c| 13 +
>  common/boot.c  | 11 +--
>  common/bootargs.c  | 11 +--
>  common/bootchooser.c   | 11 +--
>  common/bootm.c | 13 +
>  common/bootsource.c| 13 +
>  common/clock.c | 11 +--
>  common/command.c   | 12 +---
>  common/complete.c  | 11 +--
>  common/console.c   | 12 +---
>  common/console_common.c| 12 +---
>  common/console_countdown.c | 11 +--
>  common/date.c  | 12 +---
>  common/ddr_spd.c   |  5 +
>  common/env.c   | 11 +--
>  common/environment.c   | 11 +--
>  common/fastboot.c  |  3 +--
>  common/file-list.c | 11 +--
>  common/filetype.c  | 10 +-
>  common/firmware.c  | 10 +-
>  common/hush.c  | 14 +-
>  common/image-fit.c | 14 +-
>  common/image.c | 12 +---
>  common/imd.c   | 12 +---
>  common/imx-bbu-nand-fcb.c  | 16 +---
>  common/memory.c| 13 +
>  common/memsize.c   | 12 +---
>  common/memtest.c   | 11 +--
>  common/menu.c  | 12 +---
>  common/menutree.c  | 11 +--
>  common/misc.c  | 11 +--
>  common/module.c| 12 +---
>  common/partitions.c| 13 +
>  common/password.c  | 11 +--
>  common/poller.c|  4 +---
>  common/poweroff.c  | 11 +--
>  common/reset_source.c  | 11 +--
>  common/resource.c  | 10 +-
>  common/restart.c   | 11 +--
>  common/s_record.c  | 12 +---
>  common/startup.c   | 12 +---
>  common/tlsf_malloc.c   | 13 +
>  common/ubiformat.c | 11 +--
>  common/uimage.c| 10 +-
>  common/usbgadget.c | 11 +--
>  48 files changed, 48 insertions(+), 480 deletions(-)
> 
> diff --git a/common/bbu.c b/common/bbu.c
> index f284c341b91b..1279d5615525 100644
> --- a/common/bbu.c
> +++ b/common/bbu.c
> @@ -1,16 +1,8 @@
> +// SPDX-License-Identifier: GPL-2.0-only
>  /*
>   * bbu.c - barebox update functions
>   *
>   * Copyright (c) 2012 Sascha Hauer , Pengutronix
> - *
> - * This program is free software; you can redistribute it and/or modify
> - * it under the terms of the GNU General Public License version 2
> - * as published by the Free Software Foundation.
> - *
> - * This program 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.
>   */
>  #include 
>  #include 
> diff --git a/common/binfmt.c b/common/binfmt.c
> index f2ff62458769..184647720648 100644
> --- a/common/binfmt.c
> +++ b/common/binfmt.c
> @@ -1,7 +1,6 @@
> +// SPDX-License-Identifier: GPL-2.0-only
>  /*
>   * Copyright (C) 2012 Jean-Christophe PLAGNIOL-VILLARD 
> 
> - *
> - * GPL v2
>   */
>  
>  #include 
> diff --git a/common/block.c b/common/block.c
> index c522310dcf52..6371010a905b 100644
> --- a/common/block.c
> +++ b/common/block.c
> @@ -1,17 +1,8 @@
> +// SPDX-License-Identifier: GPL-2.0-only
>  /*
>   * block.c - simple block layer
>   *
>   * Copyright (c) 2011 Sascha Hauer , Pengutronix
> - *
> - * This program is free software; you can redistribute it and/or modify
> - * it under the terms of the GNU General Public License version 2
> - * as published by the Free Software Foundation.
> - *
> - * This program is distributed in the hope that it will be useful,
> - * but WITHOUT ANY WARRANTY; without even the implied warranty of
> - * MERCHANTABILITY or

Re: [PATCH 2/3] LICENSES: exceptions: factor out eCos-exception-2.0 for GPL

2020-11-26 Thread Roland Hieber
On Mon, Nov 23, 2020 at 05:01:27PM +0100, Ahmad Fatoum wrote:
> We have code imported from eCos that's licensed with this exception.
> Replace instances of the exceptions with a SPDX-License-Identifier
> referencing the exception in our LICENSES directory.
> 
> Signed-off-by: Ahmad Fatoum 
> ---

Reviewed-by: Roland Hieber 

>  LICENSES/exceptions/eCos-exception-2.0 | 13 +
>  common/dummy_malloc.c  | 21 +
>  drivers/mtd/nand/nand_ecc.c| 22 +-
>  drivers/serial/arm_dcc.c   | 21 +
>  4 files changed, 16 insertions(+), 61 deletions(-)
>  create mode 100644 LICENSES/exceptions/eCos-exception-2.0
> 
> diff --git a/LICENSES/exceptions/eCos-exception-2.0 
> b/LICENSES/exceptions/eCos-exception-2.0
> new file mode 100644
> index ..291103666f10
> --- /dev/null
> +++ b/LICENSES/exceptions/eCos-exception-2.0
> @@ -0,0 +1,13 @@
> +SPDX-Exception-Identifier: eCos-exception-2.0
> +SPDX-URL: https://spdx.org/licenses/eCos-exception-2.0.html
> +SPDX-Licenses: GPL-2.0-only, GPL-2.0-or-later, GPL-2.0, GPL-2.0+
> +License-Text:
> +  As a special exception, if other files instantiate templates or use macros 
> or
> +  inline functions from this file, or you compile this file and link it with
> +  other works to produce a work based on this file, this file does not by 
> itself
> +  cause the resulting work to be covered by the GNU General Public License.
> +  However the source code for this file must still be made available in
> +  accordance with section (3) of the GNU General Public License.
> +
> +  This exception does not invalidate any other reasons why a work based on 
> this
> +  file might be covered by the GNU General Public License.
> diff --git a/common/dummy_malloc.c b/common/dummy_malloc.c
> index 0120d9be2e85..ed74bd2f2302 100644
> --- a/common/dummy_malloc.c
> +++ b/common/dummy_malloc.c
> @@ -1,25 +1,6 @@
> +/* SPDX-License-Identifier: GPL-2.0-only WITH eCos-exception-2.0 */
>  /*
>   * Copyright (C) 2013 Sascha Hauer 
> - *
> - * This program is free software; you can redistribute it and/or
> - * modify it under the terms of the GNU General Public License version 2
> - * as published by the Free Software Foundation.
> - *
> - * This program 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.
> - *
> - *
> - * As a special exception, if other files instantiate templates or use macros
> - * or inline functions from this file, or you compile this file and link it
> - * with other works to produce a work based on this file, this file does not
> - * by itself cause the resulting work to be covered by the GNU General Public
> - * License. However the source code for this file must still be made 
> available
> - * in accordance with section (3) of the GNU General Public License.
> -
> - * This exception does not invalidate any other reasons why a work based on
> - * this file might be covered by the GNU General Public License.
>   */
>  #include 
>  #include 
> diff --git a/drivers/mtd/nand/nand_ecc.c b/drivers/mtd/nand/nand_ecc.c
> index fd6ad7edc8e5..741282093df9 100644
> --- a/drivers/mtd/nand/nand_ecc.c
> +++ b/drivers/mtd/nand/nand_ecc.c
> @@ -1,3 +1,4 @@
> +/* SPDX-License-Identifier: GPL-2.0-or-later WITH eCos-exception-2.0 */
>  /*
>   * This file contains an ECC algorithm from Toshiba that detects and
>   * corrects 1 bit errors in a 256 byte block of data.
> @@ -10,27 +11,6 @@
>   * Copyright (C) 2006 Thomas Gleixner 
>   *
>   * $Id: nand_ecc.c,v 1.15 2005/11/07 11:14:30 gleixner Exp $
> - *
> - * 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 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.
> - *
> - * As a special exception, if other files instantiate templates or use
> - * macros or inline functions from these files, or you compile these
> - * files and link them with other works to produce a work based on these
> - * files, these files do not by themselves cause the resulting work to be
> - * covered by the GNU General Public License. However the source code for
> - * these files must still be made a

[PATCH 1/2] sandbox: remove MXS tools from hosttools_defconfig

2020-11-07 Thread Roland Hieber
CONFIG_MXS_HOSTTOOLS currently only builds the tools mxsimage and
mxsboot, which are both only needed to create bootable images for the
MXS platform, and are not really useful as stand-alone host tools.

Signed-off-by: Roland Hieber 
---
 arch/sandbox/configs/hosttools_defconfig | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/sandbox/configs/hosttools_defconfig 
b/arch/sandbox/configs/hosttools_defconfig
index 72ec0fc462b2..7d3385312488 100644
--- a/arch/sandbox/configs/hosttools_defconfig
+++ b/arch/sandbox/configs/hosttools_defconfig
@@ -2,6 +2,5 @@ CONFIG_IMD=y
 CONFIG_COMPILE_HOST_TOOLS=y
 CONFIG_ARCH_IMX_USBLOADER=y
 CONFIG_MVEBU_HOSTTOOLS=y
-CONFIG_MXS_HOSTTOOLS=y
 CONFIG_OMAP3_USB_LOADER=y
 CONFIG_OMAP4_HOSTTOOL_USBBOOT=y
-- 
2.28.0


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


[PATCH 2/2] mxs: always build mxsimage and mxsboot tools

2020-11-07 Thread Roland Hieber
Both tools are used unconditionally by images/Makefile.mxs. Always
build them for ARCH_MXS, and remove their prompt in the host tools
section, as they are not really useful as stand-alone tools.

Signed-off-by: Roland Hieber 
---
 scripts/Kconfig  | 9 -
 scripts/Makefile | 2 +-
 2 files changed, 1 insertion(+), 10 deletions(-)

diff --git a/scripts/Kconfig b/scripts/Kconfig
index 20530b9ae384..b903486ecd8f 100644
--- a/scripts/Kconfig
+++ b/scripts/Kconfig
@@ -20,15 +20,6 @@ config MVEBU_HOSTTOOLS
  This enables building the tools kwbimage to create an image suitable
  for Marvell mvebu machines and kwboot to boot via UART.
 
-config MXS_HOSTTOOLS
-   bool "mxs hosttools" if COMPILE_HOST_TOOLS
-   depends on ARCH_MXS || COMPILE_HOST_TOOLS
-   default y if ARCH_MXS
-   help
- This builds the tools mxsimage and mxsboot which are needed to
- create bootable image files for mxs. You need openssl development
- files to compile this tool.
-
 config OMAP3_USB_LOADER
bool "omap3 USB loader"
depends on ARCH_OMAP3 || COMPILE_HOST_TOOLS
diff --git a/scripts/Makefile b/scripts/Makefile
index 30b7ec540cdf..744f4dd0e7e6 100644
--- a/scripts/Makefile
+++ b/scripts/Makefile
@@ -21,7 +21,7 @@ hostprogs-always-$(CONFIG_ARCH_DAVINCI)   
+= mkublheader
 HOSTCFLAGS_zynq_mkimage.o = -I$(srctree) 
-I$(srctree)/arch/arm/mach-zynq/include
 hostprogs-always-$(CONFIG_ARCH_ZYNQ)   += zynq_mkimage
 hostprogs-always-$(CONFIG_ARCH_SOCFPGA)+= 
socfpga_mkimage
-hostprogs-always-$(CONFIG_MXS_HOSTTOOLS)   += mxsimage mxsboot
+hostprogs-always-$(CONFIG_ARCH_MXS)+= mxsimage mxsboot
 hostprogs-always-$(CONFIG_ARCH_LAYERSCAPE) += pblimage
 hostprogs-always-$(CONFIG_ARCH_STM32MP)+= stm32image
 KBUILD_HOSTCFLAGS += -I$(srctree)/scripts/include/
-- 
2.28.0


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


Re: bareboxenv-target

2020-11-06 Thread Roland Hieber
On Fri, Nov 06, 2020 at 12:06:08PM +, Barbier, Renaud wrote:
> > >
> > >
> > > It looks like sysroot is missing as when I add to scripts/Makefile:
> > > ifdef SDKTARGETSYSROOT
> > > userccflags += --sysroot=$(SDKTARGETSYSROOT)
> > > endif
> > >
> > > It builds.
> > >
> > > Not much came out from search on google but one thread that refers to
> > this problem when building with Yocto.
> 
> In barebox.inc of the Yocto recipe, I replaced
> export TARGETCFLAGS="${TARGET_LDFLAGS}${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
> with
> export userccflags="${TARGET_LDFLAGS}${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
> 
> It builds.
> 
> Would that  be the way to pass sysroot to scripts/Makefile?

I think someone more knowledgeable about Yocto/OE needs to answer this,
I don't know if anyone is here…

 - Roland

-- 
Roland Hieber, Pengutronix e.K.  | r.hie...@pengutronix.de |
Steuerwalder Str. 21 | https://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: bareboxenv-target

2020-11-06 Thread Roland Hieber
On Fri, Nov 06, 2020 at 09:55:18AM +, Barbier, Renaud wrote:
> We derived out recipe for barebox from the barebox layer.

Which layer is "the barebox layer"?

 - Roland

-- 
Roland Hieber, Pengutronix e.K.  | r.hie...@pengutronix.de |
Steuerwalder Str. 21 | https://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 2/2] ARM: qemu: add support for qemu virt platform

2020-11-04 Thread Roland Hieber
 r0
> + b qemu_virt_start
> diff --git a/arch/arm/mach-qemu/Kconfig b/arch/arm/mach-qemu/Kconfig
> index d30bae4c6f..dd3ccd8740 100644
> --- a/arch/arm/mach-qemu/Kconfig
> +++ b/arch/arm/mach-qemu/Kconfig
> @@ -14,5 +14,12 @@ config MACH_QEMU_VIRT64
>   select ARM_AMBA
>   select HAVE_CONFIGURABLE_MEMORY_LAYOUT
>  
> +config MACH_QEMU_VIRT
> + bool "QEMU arm virt machine"
> + select CPU_V7
> + select ARM_AMBA
> + select RELOCATABLE
> + select ARM_PSCI_CLIENT
> +
>  endchoice
>  endif
> diff --git a/arch/arm/mach-qemu/Makefile b/arch/arm/mach-qemu/Makefile
> index ece277ce0e..8f73aa41a5 100644
> --- a/arch/arm/mach-qemu/Makefile
> +++ b/arch/arm/mach-qemu/Makefile
> @@ -1 +1 @@
> -obj-$(CONFIG_MACH_QEMU_VIRT64) += virt_devices.o
> +obj-$(CONFIG_ARCH_QEMU) += virt_devices.o
> -- 
> 2.28.0
> 
> 
> ___
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Roland Hieber, Pengutronix e.K.  | r.hie...@pengutronix.de |
Steuerwalder Str. 21 | https://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: bareboxenv-target

2020-11-02 Thread Roland Hieber
On Wed, Oct 28, 2020 at 11:09:18AM +, Barbier, Renaud wrote:
> I am building bareboxenv-target for a  cortex-A9 board (not present upstream) 
> with gcc 9.3.0 and got this error:
> 
> arm-oe-linux-gnueabi-gcc -Wp,-MMD,scripts/.bareboxenv-target.d -Wall 
> -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89  
> -I 
> /mnt/projects/all/openware-core/home/renaud/sandbox/bootloader/barebox-rebase/scripts/include
>   -o scripts/bareboxenv-target scripts/bareboxenv-target.c
> In file included from scripts/bareboxenv-target.c:1:
> scripts/bareboxenv.c:17:10: fatal error: stdio.h: No such file or directory
>17 | #include 
>   |  ^
> 
> 
> It looks like sysroot is missing as when I add to scripts/Makefile:
> ifdef SDKTARGETSYSROOT
> userccflags += --sysroot=$(SDKTARGETSYSROOT)
> endif
> 
> It builds.
> 
> Not much came out from search on google but one thread that refers to this 
> problem when building with Yocto.
> 
> Could it it be related to  how our toolchain got build?

Which toolchain were you using? IIRC, the Yocto SDK builds don't set a
valid SYSROOT during the build, and patch it in through a compile option
when calling the compiler.

 - Roland

-- 
Roland Hieber, Pengutronix e.K.  | r.hie...@pengutronix.de |
Steuerwalder Str. 21 | https://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] net: Replace license and copyright boilerplate by SPDX identfiers

2020-11-02 Thread Roland Hieber
On Thu, Oct 29, 2020 at 10:14:04PM +0100, Uwe Kleine-König wrote:
> Converts the files that licensecheck can determine to be licensed under
> GPL-2.0-only or GPL-2.0-or-later and also convert the copyright statements
> to SPDX.
> 
> Signed-off-by: Uwe Kleine-König 
> ---
>  net/eth.c| 17 ++---
>  net/ifup.c   | 20 +---
>  net/lib.c| 24 +++-
>  net/net.c| 24 +++-
>  net/netconsole.c | 19 ---
>  net/nfs.h| 10 ++
>  net/rarp.h   | 18 ++
>  net/sntp.c   | 11 +--
>  8 files changed, 30 insertions(+), 113 deletions(-)

FTR, 
Reviewed-by: Roland Hieber 

> diff --git a/net/eth.c b/net/eth.c
> index 85110ef69585..626b35d5cc65 100644
> --- a/net/eth.c
> +++ b/net/eth.c
> @@ -1,18 +1,5 @@
> -/*
> - * (C) Copyright 2001-2004
> - * Wolfgang Denk, DENX Software Engineering, w...@denx.de.
> - *
> - * This program 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 program 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.
> - *
> - */
> +// SPDX-License-Identifier: GPL-2.0-or-later
> +// SPDX-FileCopyrightText: 2001-2004 Wolfgang Denk , DENX 
> Software Engineering
>  
>  #include 
>  #include 
> diff --git a/net/ifup.c b/net/ifup.c
> index 4b69777c164d..a74037939b8a 100644
> --- a/net/ifup.c
> +++ b/net/ifup.c
> @@ -1,18 +1,8 @@
> -/*
> - * ifup.c - bring up network interfaces
> - *
> - * Copyright (c) 2014 Sascha Hauer , Pengutronix
> - *
> - * This program is free software; you can redistribute it and/or modify
> - * it under the terms of the GNU General Public License version 2
> - * as published by the Free Software Foundation.
> - *
> - * This program 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 detaiifup.
> - *
> - */
> +// SPDX-License-Identifier: GPL-2.0-only
> +// SPDX-FileCopyrightText: 2014 Sascha Hauer , 
> Pengutronix
> +
> +/* ifup.c - bring up network interfaces */
> +
>  #define pr_fmt(fmt)  "ifup: " fmt
>  
>  #include 
> diff --git a/net/lib.c b/net/lib.c
> index 8dc35c1e52a6..d4536441bd71 100644
> --- a/net/lib.c
> +++ b/net/lib.c
> @@ -1,24 +1,14 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +// SPDX-FileCopyrightText: 2015 Sascha Hauer , 
> Pengutronix
> +// SPDX-FileCopyrightText: 1994-2000 Neil Russell
> +// SPDX-FileCopyrightText: 2000 Roland Borde
> +// SPDX-FileCopyrightText: 2000 Paolo Scaffardi
> +// SPDX-FileCopyrightText: 2000-2002 Wolfgang Denk 
> +
>  /*
>   * net.c - barebox networking support
>   *
> - * Copyright (c) 2015 Sascha Hauer , Pengutronix
> - *
>   * based on U-Boot (LiMon) code
> - *
> - * Copyright 1994 - 2000 Neil Russell.
> - * Copyright 2000 Roland Borde
> - * Copyright 2000 Paolo Scaffardi
> - * Copyright 2000-2002 Wolfgang Denk, w...@denx.de
> - *
> - * This program is free software; you can redistribute it and/or modify
> - * it under the terms of the GNU General Public License version 2
> - * as published by the Free Software Foundation.
> - *
> - * This program 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.
> - *
>   */
>  
>  #include 
> diff --git a/net/net.c b/net/net.c
> index e6ac4c68faee..4dffc1bd523a 100644
> --- a/net/net.c
> +++ b/net/net.c
> @@ -1,24 +1,14 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +// SPDX-FileCopyrightText: 2010 Sascha Hauer , 
> Pengutronix
> +// SPDX-FileCopyrightText: 1994-2000 Neil Russell
> +// SPDX-FileCopyrightText: 2000 Roland Borde
> +// SPDX-FileCopyrightText: 2000 Paolo Scaffardi
> +// SPDX-FileCopyrightText: 2000-2002 Wolfgang Denk 
> +
>  /*
>   * net.c - barebox networking support
>   *
> - * Copyright (c) 2010 Sascha Hauer , Pengutronix
> - *
>   * based on U-Boot (LiMon) code
> - *
> - * Copyright 1994 - 2000 Neil Russell.
> - * Copyright 2000 Roland Borde
> - * Copyright 2000 Paolo Scaffardi

Re: [PATCH v2 2/2] ARM: imx: Add Support for Webasto ccbv2

2020-10-10 Thread Roland Hieber
gt; +
> + pinctrl_uart4: uart4grp {
> + fsl,pins = <
> + MX6UL_PAD_LCD_CLK__UART4_DCE_TX   0x1b0b0
> + MX6UL_PAD_LCD_ENABLE__UART4_DCE_RX0x1b0b0
> + >;
> + };
> +
> + pinctrl_uart6: uart6grp {
> + fsl,pins = <
> + MX6UL_PAD_CSI_MCLK__UART6_DCE_TX  0x1b0b0
> + MX6UL_PAD_CSI_PIXCLK__UART6_DCE_RX0x1b0b0
> + MX6UL_PAD_CSI_VSYNC__UART6_DCE_RTS0x1b0b0
> + MX6UL_PAD_CSI_HSYNC__UART6_DCE_CTS0x1b0b0
> + MX6UL_PAD_ENET2_TX_DATA0__GPIO2_IO11  0x10030
> + MX6UL_PAD_GPIO1_IO03__OSC32K_32K_OUT  0x00010
> + >;
> + };
> +
> + pinctrl_uart7: uart7grp {
> + fsl,pins = <
> + MX6UL_PAD_LCD_DATA16__UART7_DCE_TX0x1b0b0
> + MX6UL_PAD_LCD_DATA17__UART7_DCE_RX0x1b0b0
> + >;
> + };
> +
> + pinctrl_usdhc1: usdhc1grp {
> + fsl,pins = <
> + MX6UL_PAD_SD1_CMD__USDHC1_CMD0x10059
> + MX6UL_PAD_SD1_CLK__USDHC1_CLK0x10059
> + MX6UL_PAD_SD1_DATA0__USDHC1_DATA00x10059
> + MX6UL_PAD_SD1_DATA1__USDHC1_DATA10x10059
> + MX6UL_PAD_SD1_DATA2__USDHC1_DATA20x10059
> +     MX6UL_PAD_SD1_DATA3__USDHC1_DATA30x10059
> + MX6UL_PAD_CSI_DATA00__GPIO4_IO21 0x17000
> + MX6UL_PAD_CSI_DATA01__GPIO4_IO22 0x10030
> + >;
> + };
> +
> + pinctrl_usdhc2: usdhc2grp {
> + fsl,pins = <
> + MX6UL_PAD_NAND_RE_B__USDHC2_CLK  0x100e9
> + MX6UL_PAD_NAND_WE_B__USDHC2_CMD  0x100e9
> + MX6UL_PAD_NAND_DATA00__USDHC2_DATA0  0x100e9
> + MX6UL_PAD_NAND_DATA01__USDHC2_DATA1  0x100e9
> + MX6UL_PAD_NAND_DATA02__USDHC2_DATA2  0x100e9
> + MX6UL_PAD_NAND_DATA03__USDHC2_DATA3  0x100e9
> + MX6UL_PAD_NAND_DATA04__USDHC2_DATA4  0x100e9
> + MX6UL_PAD_NAND_DATA05__USDHC2_DATA5  0x100e9
> + MX6UL_PAD_NAND_DATA06__USDHC2_DATA6  0x100e9
> + MX6UL_PAD_NAND_DATA07__USDHC2_DATA7  0x100e9
> + MX6UL_PAD_NAND_ALE__GPIO4_IO10   0x10030
> + >;
> + };
> +
> + pinctrl_wdog: wdoggrp {
> + fsl,pins = <
> + MX6UL_PAD_GPIO1_IO01__WDOG1_WDOG_B  0x00b0
> + >;
> + };
> +};
> diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
> index 720fe874d7..6d8b7b9c4d 100644
> --- a/arch/arm/mach-imx/Kconfig
> +++ b/arch/arm/mach-imx/Kconfig
> @@ -578,6 +578,11 @@ config MACH_DIGI_CCIMX6ULSBCPRO
>   select ARCH_IMX6UL
>   select ARM_USE_COMPRESSED_DTB
>  
> +config MACH_WEBASTO_CCBV2
> + bool "Webasto Common Communication Board V2"
> + select ARCH_IMX6UL
> + select ARM_USE_COMPRESSED_DTB
> +
>  endif
>  
>  # --
> diff --git a/arch/arm/mach-imx/include/mach/imx6-regs.h 
> b/arch/arm/mach-imx/include/mach/imx6-regs.h
> index 1ba22b5bc6..7350ffd16f 100644
> --- a/arch/arm/mach-imx/include/mach/imx6-regs.h
> +++ b/arch/arm/mach-imx/include/mach/imx6-regs.h
> @@ -115,6 +115,7 @@
>  #define MX6_IP2APB_USBPHY1_BASE_ADDR(MX6_AIPS2_OFF_BASE_ADDR + 0x78000)
>  #define MX6_IP2APB_USBPHY2_BASE_ADDR(MX6_AIPS2_OFF_BASE_ADDR + 0x7C000)
>  
> +#define MX6_UART7_BASE_ADDR  0x02018000
>  #define MX6_SATA_BASE_ADDR   0x0220
>  
>  #define MX6_MMDC_PORT01_BASE_ADDR0x1000
> diff --git a/arch/arm/mach-imx/include/mach/iomux-mx6ul.h 
> b/arch/arm/mach-imx/include/mach/iomux-mx6ul.h
> index 7ac5801049..b7727191c2 100644
> --- a/arch/arm/mach-imx/include/mach/iomux-mx6ul.h
> +++ b/arch/arm/mach-imx/include/mach/iomux-mx6ul.h
> @@ -6,7 +6,7 @@
>  #ifndef __ASM_ARCH_IMX6UL_PINS_H__
>  #define __ASM_ARCH_IMX6UL_PINS_H__
>  
> -#include 
> +#include 
>  
>  enum {
>  
> diff --git a/firmware/Kconfig b/firmware/Kconfig
> index 97b7b3c2ee..c2ff51b911 100644
> --- a/firmware/Kconfig
> +++ b/firmware/Kconfig
> @@ -16,4 +16,9 @@ config FIRMWARE_IMX8MP_ATF
>  config FIRMWARE_IMX8MQ_ATF
>  bool
>  
> +config FIRMWARE_CCBV2_OPTEE
> + bool
> + depends on MACH_WEBASTO_CCBV2 && PBL_OPTEE
> + default y
> +
>  endmenu
> diff --git a/firmware/Makefile b/firmware/Makefile
> index 3d4b7fd935..0d1b445783 100644
> --- a/firmware/Makefile
> +++ b/firmware/Makefile
> @@ -17,6 +17,8 @@ firmware-$(CONFIG_DRIVER_NET_FSL_FMAN) += 
> fsl_fman_ucode_ls1046_r1.0_106_4_18.bi
>  
>  firmware-$(CONFIG_ARCH_LAYERSCAPE_PPA) += ppa-ls1046a.bin
>  
> +firmware-$(CONFIG_FIRMWARE_CCBV2_OPTEE) += ccbv2_optee.bin
> +
>  # Create $(fwabs) from $(CONFIG_EXTRA_FIRMWARE_DIR) -- if it doesn't have a
>  # leading /, it's relative to $(srctree).
>  fwdir := $(subst $(quote),,$(CONFIG_EXTRA_FIRMWARE_DIR))
> diff --git a/images/Makefile.imx b/images/Makefile.imx
> index 3434a10e7c..d30d06451b 100644
> --- a/images/Makefile.imx
> +++ b/images/Makefile.imx
> @@ -362,6 +362,8 @@ $(call build_imx_habv4img, 
> CONFIG_MACH_TECHNEXION_PICO_HOBBIT, start_imx6ul_pico
>  
>  $(call build_imx_habv4img, CONFIG_MACH_DIGI_CCIMX6ULSBCPRO, 
> start_imx6ul_ccimx6ulsbcpro, 
> digi-ccimx6ulsom/flash-header-imx6ul-ccimx6ulsbcpro, imx6ul-ccimx6ulsbcpro)
>  
> +$(call build_imx_habv4img, CONFIG_MACH_WEBASTO_CCBV2, start_imx6ul_ccbv2, 
> webasto-ccbv2/flash-header-imx6ul-webasto-ccbv2, imx6ul-webasto-ccbv2)
> +
>  # --- vf6xx based boards ---
>  pblb-$(CONFIG_MACH_VF610_TWR) += start_vf610_twr
>  CFG_start_vf610_twr.pblb.imximg = 
> $(board)/freescale-vf610-twr/flash-header-vf610-twr.imxcfg
> -- 
> 2.28.0
> 
> 
> ___
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Roland Hieber, Pengutronix e.K.  | r.hie...@pengutronix.de |
Steuerwalder Str. 21 | https://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/2] README: update to reflect current state

2020-10-10 Thread Roland Hieber
/mach-*/-> SoC specific code
> +arch/*-> contains architecture specific parts
> +arch/*/include-> architecture specific includes
> +arch/*/mach-* -> SoC specific code
> +arch/*/mach-*/include -> SoC specific includes
>  
>  drivers/serial-> drivers
>  drivers/net
>  drivers/...
>  
> -include/asm-* -> architecture specific includes
> -include/asm-*/arch-*  -> SoC specific includes
> -
>  fs/   -> filesystem support and filesystem drivers
>  
>  lib/  -> generic library functions (getopt, readline and the
> @@ -188,7 +188,7 @@ Documentation/-> Sphinx generated documentation. 
> Call "make docs" to
>  Release Strategy
>  
>  
> -Barebox is developed with git. From time to time, tarball releases are
> +Barebox is developed with git. On a monthly schedule, tarball releases are
>  branched from the repository and released on the project web site. Here
>  are the release rules:
>  
> -- 
> 2.28.0
> 
> 
> ___
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Roland Hieber, Pengutronix e.K.  | r.hie...@pengutronix.de |
Steuerwalder Str. 21 | https://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] arch/x86: Replace license and copyright boilerplate by SPDX identfiers

2020-10-07 Thread Roland Hieber
On Fri, Sep 18, 2020 at 12:35:37PM +0200, Uwe Kleine-König wrote:
> Converts the files that licensecheck can determine the license for.
> Additionally some minor code reformatting is done.
> 
> Signed-off-by: Uwe Kleine-König 

For the record,
Reviewed-by: Roland Hieber 

Also, thanks for moving barebox towards SPDX compatibility! :-)

 - Roland

> ---
>  arch/x86/bios/bios_disk.S | 23 ---
>  arch/x86/bios/memory16.S  | 21 -
>  arch/x86/bios/traveler.S  | 21 -
>  arch/x86/boards/x86_generic/disk_bios_drive.c | 17 ++
>  arch/x86/boards/x86_generic/envsector.h   | 14 +--
>  arch/x86/boards/x86_generic/generic_pc.c  | 17 ++
>  .../boards/x86_generic/intf_platform_ide.c| 19 +++
>  arch/x86/boards/x86_generic/serial_ns16550.c  | 19 +++
>  arch/x86/boot/a20.c   | 16 +
>  arch/x86/boot/bioscall.S  | 13 ---
>  arch/x86/boot/boot.h  | 16 +
>  arch/x86/boot/boot_main.S | 21 -
>  arch/x86/boot/main_entry.c| 17 ++
>  arch/x86/boot/pmjump.S| 12 +++---
>  arch/x86/boot/prepare_uboot.c | 12 +++---
>  arch/x86/boot/regs.c  | 13 ---
>  arch/x86/boot/tty.c   | 16 +
>  arch/x86/include/asm/bitops.h | 14 +--
>  arch/x86/include/asm/byteorder.h  | 14 +--
>  arch/x86/include/asm/common.h | 14 +--
>  arch/x86/include/asm/dma.h|  8 ++-
>  arch/x86/include/asm/modes.h  | 17 ++
>  arch/x86/include/asm/module.h | 14 +--
>  arch/x86/include/asm/segment.h| 17 ++
>  arch/x86/include/asm/string.h | 14 +--
>  arch/x86/include/asm/syslib.h | 17 ++
>  arch/x86/lib/barebox.lds.S| 14 +--
>  arch/x86/lib/gdt.c| 17 ++
>  arch/x86/lib/linux_start.S| 23 ---
>  arch/x86/lib/memory.c | 21 -
>  arch/x86/mach-i386/include/mach/barebox.lds.h | 17 ++
>  arch/x86/mach-i386/pit_timer.c| 17 ++
>  32 files changed, 91 insertions(+), 434 deletions(-)
> 
> diff --git a/arch/x86/bios/bios_disk.S b/arch/x86/bios/bios_disk.S
> index cce33e67afaf..c2a824ed6eb4 100644
> --- a/arch/x86/bios/bios_disk.S
> +++ b/arch/x86/bios/bios_disk.S
> @@ -1,21 +1,8 @@
> -/*
> - * Copyright (C) 2009 Juergen Beisert, Pengutronix
> - *
> - * Mostly stolen from the GRUB2 project
> - *  Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008  Free 
> Software Foundation, Inc.
> - *
> - * This program 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 program 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.
> - *
> - *
> - */
> +/* SPDX-License-Identifier: GPL-2.0-or-later */
> +/* SPDX-FileCopyrightText: 2009 Juergen Beisert, Pengutronix */
> +/* SPDX-FileCopyrightText: 1999-2008 Free Software Foundation, Inc. */
> +
> +/* Mostly stolen from the GRUB2 project */
>  
>  /**
>   * @file
> diff --git a/arch/x86/bios/memory16.S b/arch/x86/bios/memory16.S
> index 76ee72b56cda..e4aef2f256ea 100644
> --- a/arch/x86/bios/memory16.S
> +++ b/arch/x86/bios/memory16.S
> @@ -1,20 +1,7 @@
> -/*
> - * Copyright (C) 2009 Juergen Beisert, Pengutronix
> - *
> - * This code was inspired by the GRUB2 project.
> - *
> - * This program 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 program 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.
> - *
> - *
> - */
> +/* SPDX-License

Re: [PATCH 5/7] scripts/rsatoc: relicense to allow distribution of binary linked with OpenSSL

2020-09-16 Thread Roland Hieber
On Wed, Sep 16, 2020 at 11:17:23AM +0200, Roland Hieber wrote:
> On Wed, Sep 16, 2020 at 10:55:17AM +0200, Roland Hieber wrote:
> > On Tue, Sep 15, 2020 at 10:54:15PM +0200, Uwe Kleine-König wrote:
> > > The GPL (both, versions 2 and 3) are incompatible with the OpenSSL 
> > > license.
> > > According to the Free Software Foundation the copyright holders of GPL
> > > software have to provide an exception to allow this linkage.
> > > 
> > > This is effectively a license change and so needs confirmation by all
> > > copyright holders.
> > > 
> > > Cc: Sascha Hauer 
> > > Signed-off-by: Uwe Kleine-König 
> > 
> > Apart from Sascha's lines, there are also some lines by Marc from commit
> > 4ac9a459cd84ab317192 (2020-07-29, "scripts/rsatoc: fix printing of error
> > message, if environment variable doen't contain a path").
> > I've CCed him hereby.
> 
> Somehow the Cc got lost.

Okay, I've just learned about the "no duplicates" feature of mailman,
apparently Marc is subscribed on this list and has this flag enabled, so
mailman drops the Cc …

 - Roland

-- 
Roland Hieber, Pengutronix e.K.  | r.hie...@pengutronix.de |
Steuerwalder Str. 21 | https://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 4/7] LICENSES: add OpenSSL exception

2020-09-16 Thread Roland Hieber
On Tue, Sep 15, 2020 at 10:54:14PM +0200, Uwe Kleine-König wrote:
> The GPL (both, version 2 and 3) are incompatible with the OpenSSL license.
> (OpenSSL has requirements on attribution, which from the GPL's point of
> view is a further requirement which is forbidden.)
> 
> See https://www.gnu.org/licenses/gpl-faq.html#GPLIncompatibleLibs for
> some more details.
> 
> Signed-off-by: Uwe Kleine-König 
> ---
>  LICENSES/exceptions/OpenSSL-exception | 12 
>  1 file changed, 12 insertions(+)
>  create mode 100644 LICENSES/exceptions/OpenSSL-exception
> 
> diff --git a/LICENSES/exceptions/OpenSSL-exception 
> b/LICENSES/exceptions/OpenSSL-exception
> new file mode 100644
> index ..280c116d4e46
> --- /dev/null
> +++ b/LICENSES/exceptions/OpenSSL-exception
> @@ -0,0 +1,12 @@
> +SPDX-Exception-Identifier: OpenSSL-exception

I think we should not pollute SPDX's namespace with identifiers that
could be defined by them in the future. Instead, I would like use the
identifier "LicenseRef-OpenSSL-exception" in accordance with the SPDX
spec [1].

On the other hand, it's a bit unfortunate that the SPDX pull request [2]
introducing the debian-openssl-exception identifier is not merged yet,
otherwise we could use this one (it has a slightly different wording
compared to the version you used below). But now that some people have
already ACKed the wording below, it seems easier just to rename the
identifier.

[1]: 
https://spdx.github.io/spdx-spec/6-other-licensing-information-detected/#61-license-identifier
[2]: https://github.com/spdx/license-list-XML/pull/824

 - Roland

> +SPDX-Licenses: GPL-2.0-or-later, GPL-2.0-only
> +License-Text:
> +
> +In addition, as a special exception the copyright holders give
> +permission to link the code of this program with the OpenSSL Library (or with
> +modified versions of OpenSSL that use the same license as OpenSSL), and
> +distribute linked combinations including the two. You must obey the GNU 
> General
> +Public License in all respects for all of the code used other than OpenSSL. 
> If
> +you modify this file, you may extend this exception to your version of the
> +file, but you are not obligated to do so. If you do not wish to do so, delete
> +this exception statement from your version.
> -- 
> 2.27.0
> 
> 
> _______
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox

-- 
Roland Hieber, Pengutronix e.K.  | r.hie...@pengutronix.de |
Steuerwalder Str. 21 | https://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 5/7] scripts/rsatoc: relicense to allow distribution of binary linked with OpenSSL

2020-09-16 Thread Roland Hieber
On Wed, Sep 16, 2020 at 10:55:17AM +0200, Roland Hieber wrote:
> On Tue, Sep 15, 2020 at 10:54:15PM +0200, Uwe Kleine-König wrote:
> > The GPL (both, versions 2 and 3) are incompatible with the OpenSSL license.
> > According to the Free Software Foundation the copyright holders of GPL
> > software have to provide an exception to allow this linkage.
> > 
> > This is effectively a license change and so needs confirmation by all
> > copyright holders.
> > 
> > Cc: Sascha Hauer 
> > Signed-off-by: Uwe Kleine-König 
> 
> Apart from Sascha's lines, there are also some lines by Marc from commit
> 4ac9a459cd84ab317192 (2020-07-29, "scripts/rsatoc: fix printing of error
> message, if environment variable doen't contain a path").
> I've CCed him hereby.

Somehow the Cc got lost.

 - Roland

> 
>  - Roland
> 
> > ---
> >  scripts/rsatoc.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/scripts/rsatoc.c b/scripts/rsatoc.c
> > index 8f2eb8fdedc9..142d71b89f9a 100644
> > --- a/scripts/rsatoc.c
> > +++ b/scripts/rsatoc.c
> > @@ -1,4 +1,4 @@
> > -// SPDX-License-Identifier: GPL-2.0+
> > +// SPDX-License-Identifier: GPL-2.0+ WITH OpenSSL-exception
> >  /*
> >   * rsatoc - utility to convert an RSA key to a C struct
> >   *
> > -- 
> > 2.27.0
> > 
> > 
> > ___
> > barebox mailing list
> > barebox@lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/barebox
> 
> -- 
> Roland Hieber, Pengutronix e.K.  | r.hie...@pengutronix.de |
> Steuerwalder Str. 21 | https://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

-- 
Roland Hieber, Pengutronix e.K.  | r.hie...@pengutronix.de |
Steuerwalder Str. 21 | https://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 5/7] scripts/rsatoc: relicense to allow distribution of binary linked with OpenSSL

2020-09-16 Thread Roland Hieber
On Tue, Sep 15, 2020 at 10:54:15PM +0200, Uwe Kleine-König wrote:
> The GPL (both, versions 2 and 3) are incompatible with the OpenSSL license.
> According to the Free Software Foundation the copyright holders of GPL
> software have to provide an exception to allow this linkage.
> 
> This is effectively a license change and so needs confirmation by all
> copyright holders.
> 
> Cc: Sascha Hauer 
> Signed-off-by: Uwe Kleine-König 

Apart from Sascha's lines, there are also some lines by Marc from commit
4ac9a459cd84ab317192 (2020-07-29, "scripts/rsatoc: fix printing of error
message, if environment variable doen't contain a path").
I've CCed him hereby.

 - Roland

> ---
>  scripts/rsatoc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/rsatoc.c b/scripts/rsatoc.c
> index 8f2eb8fdedc9..142d71b89f9a 100644
> --- a/scripts/rsatoc.c
> +++ b/scripts/rsatoc.c
> @@ -1,4 +1,4 @@
> -// SPDX-License-Identifier: GPL-2.0+
> +// SPDX-License-Identifier: GPL-2.0+ WITH OpenSSL-exception
>  /*
>   * rsatoc - utility to convert an RSA key to a C struct
>   *
> -- 
> 2.27.0
> 
> 
> ___
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox

-- 
Roland Hieber, Pengutronix e.K.  | r.hie...@pengutronix.de |
Steuerwalder Str. 21 | https://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 3/7] scripts: convert imx-image and mxsimage to SPDX

2020-09-16 Thread Roland Hieber
On Tue, Sep 15, 2020 at 10:54:13PM +0200, Uwe Kleine-König wrote:
> To simplify automatic license and copyright determination use SPDX tags
> and remove the license boiler plate.
> 
> Signed-off-by: Uwe Kleine-König 
> ---

Reviewed-by: Roland Hieber 

>  scripts/imx/imx-image.c | 17 +++--
>  scripts/mxsimage.c  | 11 ---
>  2 files changed, 7 insertions(+), 21 deletions(-)
> 
> diff --git a/scripts/imx/imx-image.c b/scripts/imx/imx-image.c
> index de04962b09d1..f5e89d07a6ee 100644
> --- a/scripts/imx/imx-image.c
> +++ b/scripts/imx/imx-image.c
> @@ -1,17 +1,6 @@
> -/*
> - * (C) Copyright 2013 Sascha Hauer, Pengutronix
> - *
> - * This program 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 program 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.
> - *
> - */
> +// SPDX-License-Identifier: GPL-2.0-or-later
> +// SPDX-FileCopyrightText: 2013 Sascha Hauer, Pengutronix
> +
>  #define _GNU_SOURCE
>  #include 
>  #include 
> diff --git a/scripts/mxsimage.c b/scripts/mxsimage.c
> index 8a63d7693915..91b467738470 100644
> --- a/scripts/mxsimage.c
> +++ b/scripts/mxsimage.c
> @@ -1,10 +1,7 @@
> -/*
> - * Freescale i.MX23/i.MX28 SB image generator
> - *
> - * Copyright (C) 2012-2013 Marek Vasut 
> - *
> - * SPDX-License-Identifier:  GPL-2.0+
> - */
> +// SPDX-License-Identifier: GPL-2.0-or-later
> +// SPDX-FileCopyrightText: 2012-2013 Marek Vasut 
> +
> +/* Freescale i.MX23/i.MX28 SB image generator */
>  
>  #include 
>  #include 
> -- 
> 2.27.0
> 
> 
> ___
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox

-- 
Roland Hieber, Pengutronix e.K.  | r.hie...@pengutronix.de |
Steuerwalder Str. 21 | https://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 2/7] LICENSES: add used licenses to make spdxcheck happy

2020-09-16 Thread Roland Hieber
On Tue, Sep 15, 2020 at 10:54:12PM +0200, Uwe Kleine-König wrote:
> These are copied verbatim from the Linux kernel (5.9-rc3). From the
> Linux-syscall-note exception a few items had to be removed from the
> SPDX-Licenses: list to make spdxcheck happy.
> 
> Signed-off-by: Uwe Kleine-König 
> ---
>  LICENSES/deprecated/ISC|  24 ++
>  LICENSES/deprecated/X11|  37 ++
>  LICENSES/dual/Apache-2.0   | 187 +
>  LICENSES/exceptions/Linux-syscall-note |  25 ++
>  LICENSES/preferred/BSD-2-Clause|  32 ++
>  LICENSES/preferred/LGPL-2.1| 504 +
>  LICENSES/preferred/LGPL-2.1-or-later   | 468 ---
>  scripts/spdxcheck.py   |   3 +-
>  8 files changed, 811 insertions(+), 469 deletions(-)
>  create mode 100644 LICENSES/deprecated/ISC
>  create mode 100644 LICENSES/deprecated/X11
>  create mode 100644 LICENSES/dual/Apache-2.0
>  create mode 100644 LICENSES/exceptions/Linux-syscall-note
>  create mode 100644 LICENSES/preferred/BSD-2-Clause
>  create mode 100644 LICENSES/preferred/LGPL-2.1
>  delete mode 100644 LICENSES/preferred/LGPL-2.1-or-later
> 
> diff --git a/LICENSES/deprecated/ISC b/LICENSES/deprecated/ISC
> new file mode 100644
> index ..8953c3142079
> --- /dev/null
> +++ b/LICENSES/deprecated/ISC
> @@ -0,0 +1,24 @@
> +Valid-License-Identifier: ISC
> +SPDX-URL: https://spdx.org/licenses/ISC.html
> +Usage-Guide:
> +  To use the ISC License put the following SPDX tag/value pair into a
> +  comment according to the placement guidelines in the licensing rules
> +  documentation:
> +SPDX-License-Identifier: ISC
> +License-Text:
> +
> +ISC License
> +
> +Copyright (c)  
> +
> +Permission to use, copy, modify, and/or distribute this software for any
> +purpose with or without fee is hereby granted, provided that the above
> +copyright notice and this permission notice appear in all copies.
> +
> +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
> +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
> +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
> +SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
> +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
> +OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
> +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
> diff --git a/LICENSES/deprecated/X11 b/LICENSES/deprecated/X11
> new file mode 100644
> index ..fe4353fd
> --- /dev/null
> +++ b/LICENSES/deprecated/X11
> @@ -0,0 +1,37 @@
> +Valid-License-Identifier: X11
> +SPDX-URL: https://spdx.org/licenses/X11.html
> +Usage-Guide:
> +  To use the X11 put the following SPDX tag/value pair into a comment
> +  according to the placement guidelines in the licensing rules
> +  documentation:
> +SPDX-License-Identifier: X11
> +License-Text:
> +
> +
> +X11 License
> +
> +Copyright (C) 1996 X Consortium
> +
> +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
> +X CONSORTIUM 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.
> +
> +Except as contained in this notice, the name of the X Consortium shall not
> +be used in advertising or otherwise to promote the sale, use or other
> +dealings in this Software without prior written authorization from the X
> +Consortium.
> +
> +X Window System is a trademark of X Consortium, Inc.
> diff --git a/LICENSES/dual/Apache-2.0 b/LICENSES/dual/Apache-2.0
> new file mode 100644
> index ..6e89ddeab187
> --- /dev/null
> +++ b/LICENSES/dual/Apache-2.0
> @@ -0,0 +1,187 @@
> +Valid-License-Identifier: Apache-2.0
> +SPDX-URL: https://spdx.org/licenses/Apache-2.0.html
> +Usage-Guide:
> +  Do NOT use. The Apache-2.0 is not GPL2 compatible. It may only be used
> +  for dual-licensed files where the other license is GPL2 compatible.
> +  If you end up using this it MUST be used together with a GPL2 compatible
> +  license using "OR".
> +  To use the Apache License version 2.0 put the foll

[PATCH] mci: bcm2835: depend on sdhci

2020-09-15 Thread Roland Hieber
The driver uses functions defined in sdhci.o, and will fail to build
otherwise:

drivers/mci/mci-bcm2835.o: in function `bcm2835_mci_request':
drivers/mci/mci-bcm2835.c:134: undefined reference to 
`sdhci_set_cmd_xfer_mode'
arm-v5te-linux-gnueabi-ld: drivers/mci/mci-bcm2835.c:169: undefined 
reference to `sdhci_read_response'
arm-v5te-linux-gnueabi-ld: drivers/mci/mci-bcm2835.c:175: undefined 
reference to `sdhci_transfer_data'

Fixes: f8dffc9338dc2c7ae830 (2019-11-19, "mci: bcm2835: Use 
sdhci_set_cmd_xfer_mode()")
Signed-off-by: Roland Hieber 
---
 drivers/mci/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mci/Kconfig b/drivers/mci/Kconfig
index f7dc5c508912..09c056928627 100644
--- a/drivers/mci/Kconfig
+++ b/drivers/mci/Kconfig
@@ -69,6 +69,7 @@ config MCI_S3C
 config MCI_BCM283X
bool "MCI support for BCM283X"
depends on ARCH_BCM283X || COMPILE_TEST
+   select MCI_SDHCI
 
 config MCI_BCM283X_SDHOST
bool "BCM283X sdhost"
-- 
2.28.0


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


Re: [PATCH v2] regulator: provide regulator_get_name() stub for !CONFIG_REGULATOR

2020-09-15 Thread Roland Hieber
On Tue, Sep 15, 2020 at 11:44:17AM +0200, Ahmad Fatoum wrote:
> Otherwise users of this function run into a link error when regulator
> support is compiled out.
> 
> Reported-by: Roland Hieber 
> Signed-off-by: Ahmad Fatoum 

Thanks!
Tested-by: Roland Hieber 

> ---
> Forgot to commit a deleted semicolon..
> ---
>  include/regulator.h | 5 +
>  1 file changed, 5 insertions(+)
> 
> diff --git a/include/regulator.h b/include/regulator.h
> index 12d8e816cdb1..a9cb6dedca5e 100644
> --- a/include/regulator.h
> +++ b/include/regulator.h
> @@ -175,6 +175,11 @@ static inline struct regulator *regulator_get(struct 
> device_d *dev, const char *
>   return NULL;
>  }
>  
> +static inline struct regulator *regulator_get_name(const char *name)
> +{
> + return NULL;
> +}
> +
>  static inline int regulator_enable(struct regulator *r)
>  {
>   return 0;
> -- 
> 2.28.0
> 
> 

-- 
Roland Hieber, Pengutronix e.K.  | r.hie...@pengutronix.de |
Steuerwalder Str. 21 | https://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] sandbox: add a minimal defconfig to build only the host tools

2020-08-28 Thread Roland Hieber
On Fri, Aug 28, 2020 at 11:40:58AM +0300, Antony Pavlov wrote:
> On Mon, 24 Aug 2020 00:39:27 +0200
> Roland Hieber  wrote:
> 
> Hi!
> 
> > For distro packaging, make it possible to build all host tools in one go
> 
> Is there any stuff for Debian packaging?
> 
> There is u-boot-tools package for Debian distro.
> Alas there is no barebox-tools package still.

Current state is at <https://git.pengutronix.de/cgit/debian/barebox/>.
ITP bug is at <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=900958>.

 - Roland

-- 
Roland Hieber, Pengutronix e.K.  | r.hie...@pengutronix.de |
Steuerwalder Str. 21 | https://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: import memtester 4.3.0 from Debian GNU/Linux

2020-08-27 Thread Roland Hieber
intf("\b\b\b\b\b\b\b\b\b\b\b");
> +q = ~q;
> +printf("setting %3u", k * 8 + j);
> +console_flush();
> +p1 = (ulv *) bufa;
> +p2 = (ulv *) bufb;
> +for (i = 0; i < count; i++) {
> +*p1++ = *p2++ = (i % 2) == 0 ? q : ~q;
> +}
> +printf("\b\b\b\b\b\b\b\b\b\b\b");
> +printf("testing %3u", k * 8 + j);
> +console_flush();
> +ret = compare_regions(bufa, bufb, count);
> +if (ret)
> +return -1;
> +}
> +}
> +printf("\b\b\b\b\b\b\b\b\b\b\b   \b\b\b\b\b\b\b\b\b\b\b");
> +console_flush();
> +return 0;
> +}
> +
> +int test_8bit_wide_random(ulv* bufa, ulv* bufb, size_t count) {
> +u8v *p1, *t;
> +ulv *p2;
> +int attempt;
> +unsigned int b, j = 0;
> +size_t i;
> +int ret;
> +
> +putchar(' ');
> +console_flush();
> +for (attempt = 0; attempt < 2;  attempt++) {
> +if (attempt & 1) {
> +p1 = (u8v *) bufa;
> +p2 = bufb;
> +} else {
> +p1 = (u8v *) bufb;
> +p2 = bufa;
> +}
> +for (i = 0; i < count; i++) {
> +t = mword8.bytes;
> +*p2++ = mword8.val = rand_ul();
> +for (b=0; b < UL_LEN/8; b++) {
> +*p1++ = *t++;
> +}
> +if (!(i % PROGRESSOFTEN)) {
> +putchar('\b');
> +putchar(progress[++j % PROGRESSLEN]);
> +console_flush();
> +}
> +}
> +ret = compare_regions(bufa, bufb, count);
> +if (ret)
> +return ret;
> +}
> +printf("\b \b");
> +console_flush();
> +return 0;
> +}
> +
> +int test_16bit_wide_random(ulv* bufa, ulv* bufb, size_t count) {
> +u16v *p1, *t;
> +ulv *p2;
> +int attempt;
> +unsigned int b, j = 0;
> +size_t i;
> +int ret;
> +
> +putchar( ' ' );
> +console_flush();
> +for (attempt = 0; attempt < 2; attempt++) {
> +if (attempt & 1) {
> +p1 = (u16v *) bufa;
> +p2 = bufb;
> +} else {
> +p1 = (u16v *) bufb;
> +p2 = bufa;
> +}
> +for (i = 0; i < count; i++) {
> +t = mword16.u16s;
> +*p2++ = mword16.val = rand_ul();
> +for (b = 0; b < UL_LEN/16; b++) {
> +*p1++ = *t++;
> +}
> +if (!(i % PROGRESSOFTEN)) {
> +putchar('\b');
> +putchar(progress[++j % PROGRESSLEN]);
> +console_flush();
> +}
> +}
> +ret = compare_regions(bufa, bufb, count);
> +if (ret)
> +return ret;
> +}
> +printf("\b \b");
> +console_flush();
> +return 0;
> +}
> diff --git a/commands/memtester/tests.h b/commands/memtester/tests.h
> new file mode 100644
> index 00..7f7eb1a497
> --- /dev/null
> +++ b/commands/memtester/tests.h
> @@ -0,0 +1,37 @@
> +/*
> + * Very simple yet very effective memory tester.
> + * Originally by Simon Kirby  
> + * Version 2 by Charles Cazabon 
> + * Version 3 not publicly released.
> + * Version 4 rewrite:
> + * Copyright (C) 2004-2012 Charles Cazabon 
> + * Licensed under the terms of the GNU General Public License version 2 
> (only).
> + * See the file COPYING for details.

and here

> + *
> + * This file contains the declarations for the functions for the actual 
> tests,
> + * called from the main routine in memtester.c.  See other comments in that 
> + * file.
> + *
> + */
> +
> +/* Function declaration. */
> +
> +int test_stuck_address(unsigned long volatile *bufa, size_t count);
> +int test_random_value(unsigned long volatile *bufa, unsigned long volatile 
> *bufb, size_t count);
> +int test_xor_comparison(unsigned long volatile *bufa, unsigned long volatile 
> *bufb, size_t count);
> +int test_sub_comparison(unsigned long volatile *bufa, unsigned long volatile 
> *bufb, size_t count);
> +int test_mul_comparison(unsigned long volatile *bufa, unsigned long volatile 
> *bufb, size_t count);
> +int test_div_comparison(unsigned long volatile *bufa, unsigned long volatile 
> *bufb, size_t count);
> +int test_or_comparison(unsigned long volatile *bufa, unsigned long volatile 
> *bufb, size_t count);
> +int test_and_comparison(unsigned long volatile *bufa, unsigned long volatile 
> *bufb, size_t count);
> +int test_seqinc_comparison(unsigned long volatile *bufa, unsigned long 
> volatile *bufb, size_t count);
> +int test_solidbits_comparison(unsigned long volatile *bufa, unsigned long 
> volatile *bufb, size_t count);
> +int test_checkerboard_comparison(unsigned long volatile *bufa, unsigned long 
> volatile *bufb, size_t count);
> +int test_blockseq_comparison(unsigned long volatile *bufa, unsigned long 
> volatile *bufb, size_t count);
> +int test_walkbits0_comparison(unsigned long volatile *bufa, unsigned long 
> volatile *bufb, size_t count);
> +int test_walkbits1_comparison(unsigned long volatile *bufa, unsigned long 
> volatile *bufb, size_t count);
> +int test_bitspread_comparison(unsigned long volatile *bufa, unsigned long 
> volatile *bufb, size_t count);
> +int test_bitflip_comparison(unsigned long volatile *bufa, unsigned long 
> volatile *bufb, size_t count);
> +int test_8bit_wide_random(unsigned long volatile *bufa, unsigned long 
> volatile *bufb, size_t count);
> +int test_16bit_wide_random(unsigned long volatile *bufa, unsigned long 
> volatile *bufb, size_t count);
> +
> diff --git a/commands/memtester/types.h b/commands/memtester/types.h
> new file mode 100644
> index 00..8591a800b9
> --- /dev/null
> +++ b/commands/memtester/types.h
> @@ -0,0 +1,36 @@
> +/*
> + * Very simple but very effective user-space memory tester.
> + * Originally by Simon Kirby  
> + * Version 2 by Charles Cazabon 
> + * Version 3 not publicly released.
> + * Version 4 rewrite:
> + * Copyright (C) 2004-2010 Charles Cazabon 
> + * Licensed under the terms of the GNU General Public License version 2 
> (only).
> + * See the file COPYING for details.

and here.

 - Roland

> + *
> + * This file contains typedefs, structure, and union definitions.
> + *
> + */
> +
> +#include "sizes.h"
> +
> +typedef unsigned long ul;
> +typedef unsigned long long ull;
> +typedef unsigned long volatile ulv;
> +typedef unsigned char volatile u8v;
> +typedef unsigned short volatile u16v;
> +
> +struct test {
> +char *name;
> +int (*fp)(ulv *, ulv *, size_t);
> +};
> +
> +typedef union {
> +unsigned char bytes[UL_LEN/8];
> +ul val;
> +} mword8_t;
> +
> +typedef union {
> +unsigned short u16s[UL_LEN/16];
> +ul val;
> +} mword16_t;
> -- 
> 2.24.0
> 
> 
> ___
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Roland Hieber, Pengutronix e.K.  | r.hie...@pengutronix.de |
Steuerwalder Str. 21 | https://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 v2] sandbox: add a minimal defconfig to build only the host tools

2020-08-23 Thread Roland Hieber
For distro packaging, make it possible to build all host tools in one go
(and a very minimal barebox image as an unimportant side artifact).

Signed-off-by: Roland Hieber 
---
v2:
 * also select IMD to get scripts/bareboximd

 arch/sandbox/configs/hosttools_defconfig | 7 +++
 1 file changed, 7 insertions(+)
 create mode 100644 arch/sandbox/configs/hosttools_defconfig

diff --git a/arch/sandbox/configs/hosttools_defconfig 
b/arch/sandbox/configs/hosttools_defconfig
new file mode 100644
index ..72ec0fc462b2
--- /dev/null
+++ b/arch/sandbox/configs/hosttools_defconfig
@@ -0,0 +1,7 @@
+CONFIG_IMD=y
+CONFIG_COMPILE_HOST_TOOLS=y
+CONFIG_ARCH_IMX_USBLOADER=y
+CONFIG_MVEBU_HOSTTOOLS=y
+CONFIG_MXS_HOSTTOOLS=y
+CONFIG_OMAP3_USB_LOADER=y
+CONFIG_OMAP4_HOSTTOOL_USBBOOT=y
-- 
2.28.0


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


[PATCH] common: remove negative dependency on SANDBOX for IMD_TARGET

2020-08-23 Thread Roland Hieber
This dependency was added in commit b3d5c43cb8a2d492355a (2016-04-07,
Antony Pavlov: "common: add dependency !SANDBOX on imd target tool"),
but it seems to compile fine four years down the line.

Signed-off-by: Roland Hieber 
---
 common/Kconfig | 1 -
 1 file changed, 1 deletion(-)

diff --git a/common/Kconfig b/common/Kconfig
index 658437f01c5e..9e2417569bd5 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -699,7 +699,6 @@ config IMD
 config IMD_TARGET
bool "build bareboximd target tool"
depends on IMD
-   depends on !SANDBOX
 
 config KERNEL_INSTALL_TARGET
bool
-- 
2.28.0


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


[PATCH] sandbox: add a minimal defconfig to build only the host tools

2020-08-23 Thread Roland Hieber
For distro packaging, make it possible to build all host tools in one go
(and a very minimal barebox image as an unimportant side artifact).

Signed-off-by: Roland Hieber 
---
 arch/sandbox/configs/hosttools_defconfig | 6 ++
 1 file changed, 6 insertions(+)
 create mode 100644 arch/sandbox/configs/hosttools_defconfig

diff --git a/arch/sandbox/configs/hosttools_defconfig 
b/arch/sandbox/configs/hosttools_defconfig
new file mode 100644
index ..91b03e691ee4
--- /dev/null
+++ b/arch/sandbox/configs/hosttools_defconfig
@@ -0,0 +1,6 @@
+CONFIG_COMPILE_HOST_TOOLS=y
+CONFIG_ARCH_IMX_USBLOADER=y
+CONFIG_MVEBU_HOSTTOOLS=y
+CONFIG_MXS_HOSTTOOLS=y
+CONFIG_OMAP3_USB_LOADER=y
+CONFIG_OMAP4_HOSTTOOL_USBBOOT=y
-- 
2.28.0


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


Re: [PATCH] crypto: caam - Always do rng selftest

2020-07-08 Thread Roland Hieber
@ static void habv4_display_event(uint8_t *data, uint32_t 
> len)
>   habv4_display_event_record((struct hab_event_record *)data);
>  }
>  
> -/* Some chips with HAB >= 4.2.3 have an incorrect implementation of the RNG
> - * self-test in ROM code. In this case, an HAB event is generated, and a
> - * software self-test should be run. This variable is set to @c true by
> - * habv4_get_status() when this occurs. */
> -static bool habv4_need_rng_software_self_test;
> -
> -bool caam_need_rng_software_selftest(void)
> -{
> - return IS_ENABLED(CONFIG_CRYPTO_DEV_FSL_CAAM_RNG_SELF_TEST) &&
> - habv4_need_rng_software_self_test;
> -}
> -
>  #define RNG_FAIL_EVENT_SIZE 36
>  static uint8_t habv4_known_rng_fail_events[][RNG_FAIL_EVENT_SIZE] = {
>   { 0xdb, 0x00, 0x24, 0x42,  0x69, 0x30, 0xe1, 0x1d,
> @@ -457,7 +445,6 @@ static int habv4_get_status(const struct habv4_rvt *rvt)
>   if (IS_ENABLED(CONFIG_CRYPTO_DEV_FSL_CAAM_RNG_SELF_TEST) &&

The removed kconfig symbol is still used here, so this branch is a no-op
now...

 - Roland

>   is_known_rng_fail_event(data, len)) {
>   pr_debug("RNG self-test failure detected, will run 
> software self-test\n");
> - habv4_need_rng_software_self_test = true;
>   } else {
>   pr_err(" HAB warning Event %d \n", 
> index);
>   pr_err("event data:\n");
> diff --git a/include/hab.h b/include/hab.h
> index a74b7dafce..78c2b865ba 100644
> --- a/include/hab.h
> +++ b/include/hab.h
> @@ -23,7 +23,6 @@
>  #ifdef CONFIG_HABV4
>  int imx28_hab_get_status(void);
>  int imx6_hab_get_status(void);
> -bool caam_need_rng_software_selftest(void);
>  #else
>  static inline int imx28_hab_get_status(void)
>  {
> @@ -33,10 +32,6 @@ static inline int imx6_hab_get_status(void)
>  {
>   return -EPERM;
>  }
> -static inline bool caam_need_rng_software_selftest(void)
> -{
> - return false;
> -}
>  #endif
>  
>  #ifdef CONFIG_HABV3
> -- 
> 2.20.1
> 
> 
> ___
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Roland Hieber, Pengutronix e.K.  | r.hie...@pengutronix.de |
Steuerwalder Str. 21 | https://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] ARM: imx: Add Support for Webasto ccbv2

2020-07-02 Thread Roland Hieber
ND_READY_B__UART3_DCE_TX  0x1b0b0
> + MX6UL_PAD_NAND_CE0_B__UART3_DCE_RX0x1b0b0
> + MX6UL_PAD_NAND_CE1_B__UART3_DCE_CTS   0x1b0b0
> + MX6UL_PAD_NAND_CLE__UART3_DCE_RTS 0x1b0b0
> + /* HYS=1, 100k PullDown, 50MHz, R0/6 */
> + MX6UL_PAD_LCD_DATA08__GPIO3_IO13  0x13030  /* 
> X_DB_GPIO2 */
> + MX6UL_PAD_NAND_WP_B__GPIO4_IO11   0x13030  /* 
> X_DB_GPIO1 */
> + >;
> + };
> +
> + pinctrl_uart4: uart4grp {
> + fsl,pins = <
> + MX6UL_PAD_LCD_CLK__UART4_DCE_TX   0x1b0b0
> + MX6UL_PAD_LCD_ENABLE__UART4_DCE_RX0x1b0b0
> + >;
> + };
> +
> + pinctrl_uart6: uart6grp {
> + fsl,pins = <
> + MX6UL_PAD_CSI_MCLK__UART6_DCE_TX  0x1b0b0
> + MX6UL_PAD_CSI_PIXCLK__UART6_DCE_RX0x1b0b0
> + MX6UL_PAD_CSI_VSYNC__UART6_DCE_RTS0x1b0b0
> + MX6UL_PAD_CSI_HSYNC__UART6_DCE_CTS0x1b0b0
> + /* HYS=1, 50MHz, R0/6 */
> + MX6UL_PAD_ENET2_TX_DATA0__GPIO2_IO11  0x10030  /* BT EN 
> */
> + /* HYS=0, 50MHz, R0/2 */
> + MX6UL_PAD_GPIO1_IO03__OSC32K_32K_OUT  0x00010  /* BT 
> SCLK */
> + >;
> + };
> +
> + pinctrl_uart7: uart7grp {
> + fsl,pins = <
> + MX6UL_PAD_LCD_DATA16__UART7_DCE_TX0x1b0b0
> + MX6UL_PAD_LCD_DATA17__UART7_DCE_RX0x1b0b0
> + >;
> + };
> +
> + pinctrl_usdhc1: usdhc1grp {
> + fsl,pins = <
> + /* WiFi SDIO max 50MHz */
> + /* HYS=1, 100MHz, R0/3, SRE=1 */
> + MX6UL_PAD_SD1_CMD__USDHC1_CMD0x10059
> + MX6UL_PAD_SD1_CLK__USDHC1_CLK0x10059
> + MX6UL_PAD_SD1_DATA0__USDHC1_DATA00x10059
> + MX6UL_PAD_SD1_DATA1__USDHC1_DATA10x10059
> + MX6UL_PAD_SD1_DATA2__USDHC1_DATA20x10059
> + MX6UL_PAD_SD1_DATA3__USDHC1_DATA30x10059
> + /* HYS=1, 47k PullUp, Disable output */
> + MX6UL_PAD_CSI_DATA00__GPIO4_IO21 0x17000  /* WLAN 
> IRQ */
> + /* HYS=1, 50MHz, R0/6 */
> + MX6UL_PAD_CSI_DATA01__GPIO4_IO22 0x10030  /* WLAN 
> EN */
> + >;
> + };
> +
> + pinctrl_usdhc2: usdhc2grp {
> + fsl,pins = <
> + /* eMMC max 200MHz */
> + /* HYS=1, 200MHz, R0/5 , SRE=1 */
> + MX6UL_PAD_NAND_RE_B__USDHC2_CLK  0x100e9
> + MX6UL_PAD_NAND_WE_B__USDHC2_CMD  0x100e9
> + MX6UL_PAD_NAND_DATA00__USDHC2_DATA0  0x100e9
> + MX6UL_PAD_NAND_DATA01__USDHC2_DATA1  0x100e9
> + MX6UL_PAD_NAND_DATA02__USDHC2_DATA2  0x100e9
> + MX6UL_PAD_NAND_DATA03__USDHC2_DATA3  0x100e9
> + MX6UL_PAD_NAND_DATA04__USDHC2_DATA4  0x100e9
> + MX6UL_PAD_NAND_DATA05__USDHC2_DATA5  0x100e9
> + MX6UL_PAD_NAND_DATA06__USDHC2_DATA6  0x100e9
> + MX6UL_PAD_NAND_DATA07__USDHC2_DATA7  0x100e9
> + /* HYS=1, 50MHz, R0/6 */
> + MX6UL_PAD_NAND_ALE__GPIO4_IO10   0x10030 /* eMMC 
> RST */
> + >;
> + };
> +
> + pinctrl_wdog: wdoggrp {
> + fsl,pins = <
> + /* HYS=0, 100MHz, R0/6 */
> + MX6UL_PAD_GPIO1_IO01__WDOG1_WDOG_B  0x00b0
> + >;
> + };
> +};
> +
> +/* include the FIT public key for verifying on demand */
> +#ifdef CONFIG_BOOTM_FITIMAGE_PUBKEY
> +#include CONFIG_BOOTM_FITIMAGE_PUBKEY
> +#endif
> diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
> index 6dd5cb2aca..676b6ea47f 100644
> --- a/arch/arm/mach-imx/Kconfig
> +++ b/arch/arm/mach-imx/Kconfig
> @@ -548,6 +548,10 @@ config MACH_DIGI_CCIMX6ULSBCPRO
>   select ARCH_IMX6UL
>   select ARM_USE_COMPRESSED_DTB
>  
> +config MACH_WEBASTO_CCBV2
> + bool "Webasto Common Communication Board V2"
> + select ARCH_IMX6UL
> +
>  endif
>  
>  # --
> diff --git a/arch/arm/mach-imx/include/mach/imx6-regs.h 
> b/arch/arm/mach-imx/include/mach/imx6-regs.h
> index 1ba22b5bc6..7350ffd16f 100644
> --- a/arch/arm/mach-imx/include/mach/imx6-regs.h
> +++ b/arch/arm/mach-imx/include/mach/imx6-regs.h
> @@ -115,6 +115,7 @@
>  #define MX6_IP2APB_USBPHY1_BASE_ADDR(MX6_AIPS2_OFF_BASE_ADDR + 0x78000)
>  #define MX6_IP2APB_USBPHY2_BASE_ADDR(MX6_AIPS2_OFF_BASE_ADDR + 0x7C000)
>  
> +#define MX6_UART7_BASE_ADDR  0x02018000
>  #define MX6_SATA_BASE_ADDR   0x0220
>  
>  #define MX6_MMDC_PORT01_BASE_ADDR0x1000
> diff --git a/firmware/Kconfig b/firmware/Kconfig
> index 169c6ee915..10b7059b7e 100644
> --- a/firmware/Kconfig
> +++ b/firmware/Kconfig
> @@ -13,4 +13,9 @@ config FIRMWARE_IMX8MM_ATF
>  config FIRMWARE_IMX8MQ_ATF
>  bool
>  
> +config FIRMWARE_CCBV2_OPTEE
> +bool
> + depends on MACH_WEBASTO_CCBV2 && PBL_OPTEE
> + default y
> +
>  endmenu
> diff --git a/firmware/Makefile b/firmware/Makefile
> index 020d48440d..ce0db2e094 100644
> --- a/firmware/Makefile
> +++ b/firmware/Makefile
> @@ -16,6 +16,8 @@ firmware-$(CONFIG_DRIVER_NET_FSL_FMAN) += 
> fsl_fman_ucode_ls1046_r1.0_106_4_18.bi
>  
>  firmware-$(CONFIG_ARCH_LAYERSCAPE_PPA) += ppa-ls1046a.bin
>  
> +firmware-$(CONFIG_FIRMWARE_CCBV2_OPTEE) += ccbv2_optee.bin
> +
>  # Create $(fwabs) from $(CONFIG_EXTRA_FIRMWARE_DIR) -- if it doesn't have a
>  # leading /, it's relative to $(srctree).
>  fwdir := $(subst $(quote),,$(CONFIG_EXTRA_FIRMWARE_DIR))
> diff --git a/images/Makefile.imx b/images/Makefile.imx
> index 765702f26d..765ca7acdd 100644
> --- a/images/Makefile.imx
> +++ b/images/Makefile.imx
> @@ -332,6 +332,8 @@ $(call build_imx_habv4img, 
> CONFIG_MACH_TECHNEXION_PICO_HOBBIT, start_imx6ul_pico
>  
>  $(call build_imx_habv4img, CONFIG_MACH_DIGI_CCIMX6ULSBCPRO, 
> start_imx6ul_ccimx6ulsbcpro, 
> digi-ccimx6ulsom/flash-header-imx6ul-ccimx6ulsbcpro, imx6ul-ccimx6ulsbcpro)
>  
> +$(call build_imx_habv4img, CONFIG_MACH_WEBASTO_CCBV2, start_imx6ul_ccbv2, 
> webasto-ccbv2/flash-header-imx6ul-webasto-ccbv2, imx6ul-webasto-ccbv2)
> +
>  # --- vf6xx based boards ---
>  pblb-$(CONFIG_MACH_VF610_TWR) += start_vf610_twr
>  CFG_start_vf610_twr.pblb.imximg = 
> $(board)/freescale-vf610-twr/flash-header-vf610-twr.imxcfg
> -- 
> 2.27.0
> 
> 
> ___
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Roland Hieber, Pengutronix e.K.  | r.hie...@pengutronix.de |
Steuerwalder Str. 21 | https://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] arch/arm/boards: Replace license and copyright boilerplate by SPDX identfiers

2020-05-25 Thread Roland Hieber
On Mon, May 25, 2020 at 07:54:03AM +0200, Sascha Hauer wrote:
> On Tue, May 19, 2020 at 06:37:33PM +0200, Uwe Kleine-König wrote:
> > This adapts all files that were identifed by licensecheck
> > (https://salsa.debian.org/build-common-team/licensecheck.git) as
> > licensed under the GPL.
> > 
> > The advantage is that these specifiers are machine-parseable which helps
> > license conformance, e.g. for packaging barebox in Debian.
> > 
> > While touching these files also do some minor comment reformatting to
> > get some uniform layout.
> > 
> > Signed-off-by: Uwe Kleine-König 
> > ---
> > Changes since (implicit) v1
> > (20200428132405.3624-1-u.kleine-koe...@pengutronix.de):
> > 
> >  - dropped all hunks that Roland identified as questionable
> >  - added a few files that licensecheck was able to identify after an
> >update
> >  - fixing some minor style issues, some of them pointed out by Roland
> >  - dropped the © in SPDX-FileCopyrightText lines
> 
> Applied, thanks

There were some comments on the old thread (see
<20200523150007.erjwm3azjdyay...@pengutronix.de>), which didn't get
answered yet – are those resolved?

 - Roland

-- 
Roland Hieber, Pengutronix e.K.  | r.hie...@pengutronix.de |
Steuerwalder Str. 21 | https://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] arch/arm/boards: Replace license and copyright boilerplate by SPDX identfiers

2020-05-23 Thread Roland Hieber
On Sat, May 23, 2020 at 05:00:07PM +0200, Roland Hieber wrote:
> On Tue, Apr 28, 2020 at 03:24:05PM +0200, Uwe Kleine-König wrote:
> > This adapts all files that were identifed by licensecheck
> > (https://salsa.debian.org/build-common-team/licensecheck.git) as
> > licensed under the GPL.
> > 
> > The advantage is that these specifiers are machine-parseable which helps
> > license conformance, e.g. for packaging barebox in Debian.
> > 
> > While touching these files also do some minor comment reformatting to
> > get some uniform layout.
> > 
> > Signed-off-by: Uwe Kleine-König 
> 
> Hmmm, I don't see why you dropped the following files from your
> (implicit) v2:
> 
> arch/arm/boards/embedsky-e9/board.c
> arch/arm/boards/eukrea_cpuimx27/eukrea_cpuimx27.c
> arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c
> arch/arm/boards/freescale-mx21-ads/imx21ads.c
> arch/arm/boards/freescale-mx35-3ds/3stack.c
> arch/arm/boards/freescale-mx6-sabresd/board.c
> arch/arm/boards/friendlyarm-mini2440/mini2440.c
> arch/arm/boards/friendlyarm-tiny210/tiny210.c
> arch/arm/boards/globalscale-guruplug/board.c 
> arch/arm/boards/globalscale-mirabox/board.c
> arch/arm/boards/imx233-olinuxino/imx23-olinuxino.c
> arch/arm/boards/karo-tx6x/board.c
> arch/arm/boards/phytec-phycard-omap3/pca-a-l1.c
> arch/arm/boards/phytec-phycore-pxa270/config.h
> arch/arm/boards/variscite-mx6/board.c
> arch/arm/boards/variscite-mx6/lowlevel.c
> arch/arm/boards/versatile/versatilepb.c
> arch/arm/boards/zylonite/zylonite.h
> 
> Other than that, what's there is correct, so
> Reviewed-by: Roland Hieber 

Uhm, this was meant for v2, but I replied to the wrong thread, but your
v2 also didn't have "v2" in the subject, so I got confused :P

 - Roland

-- 
Roland Hieber, Pengutronix e.K.  | r.hie...@pengutronix.de |
Steuerwalder Str. 21 | https://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] pwm: Replace license and copyright boilerplate by SPDX identfiers

2020-05-23 Thread Roland Hieber
On Sat, May 23, 2020 at 05:00:32PM +0200, Uwe Kleine-König wrote:
> Hello Sascha, hello Roland,
> 
> On Sat, May 23, 2020 at 04:16:12PM +0200, Roland Hieber wrote:
> > On Fri, May 22, 2020 at 03:17:59PM +0200, Uwe Kleine-König wrote:
> > > Hello Roland,
> > > 
> > > On Fri, May 22, 2020 at 02:55:56PM +0200, Roland Hieber wrote:
> > > > On Wed, May 20, 2020 at 02:10:47PM +0200, Ahmad Fatoum wrote:
> > > > > On 5/19/20 6:52 PM, Uwe Kleine-König wrote:
> > > > > > diff --git a/drivers/pwm/pwm-mxs.c b/drivers/pwm/pwm-mxs.c
> > > > > > index a06040ac3268..1e2db39def22 100644
> > > > > > --- a/drivers/pwm/pwm-mxs.c
> > > > > > +++ b/drivers/pwm/pwm-mxs.c
> > > > > > @@ -1,13 +1,5 @@
> > > > > > -/*
> > > > > > - * Copyright 2012 Freescale Semiconductor, Inc.
> > > > > > - *
> > > > > > - * 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
> > > > > > - */
> > > > > > +// SPDX-License-Identifier: GPL-2.0-only
> > > > > 
> > > > > The deleted text says "or later"
> > > > 
> > > > Ah, I stumbled over this too. The deleted text says:
> > > > 
> > > > "The code contained herein is licensed under the GNU General Public
> > > > License."
> > > > 
> > > > which in itself reads like "you can use any version of the GPL" (i.e.,
> > > > GPL-1.0-or-later). Later then the text says:
> > > > 
> > > > "You may obtain a copy of the GNU General Public License
> > > > Version 2 or later at the following locations:"
> > > > 
> > > > which in my opinion does not say anything about which version of the GPL
> > > > the code is licensed under.
> > > 
> > > This seems to be a problem in the Freescale template. I think I pointed
> > > that out once, but nothing changed.
> > > 
> > > For practical reasons I'd interpret that as "GPL-2.0-or-later".
> > 
> > Yeah, I guess that's alright.
> > 
> > Reviewed-by: Roland Hieber 
> 
> I assume this Reviewed-by: applies only if we squash
> 
> diff --git a/drivers/pwm/pwm-mxs.c b/drivers/pwm/pwm-mxs.c
> index 1e2db39def22..08819b43bc1d 100644
> --- a/drivers/pwm/pwm-mxs.c
> +++ b/drivers/pwm/pwm-mxs.c
> @@ -1,4 +1,4 @@
> -// SPDX-License-Identifier: GPL-2.0-only
> +// SPDX-License-Identifier: GPL-2.0-or-later
>  // SPDX-FileCopyrightText: 2012 Freescale Semiconductor, Inc.
>  
>  #include 
> 
> into the patch Sascha applied.

Yes, that's what I meant too ^^

-- 
Roland Hieber, Pengutronix e.K.  | r.hie...@pengutronix.de |
Steuerwalder Str. 21 | https://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] arch/arm/boards: Replace license and copyright boilerplate by SPDX identfiers

2020-05-23 Thread Roland Hieber
On Tue, Apr 28, 2020 at 03:24:05PM +0200, Uwe Kleine-König wrote:
> This adapts all files that were identifed by licensecheck
> (https://salsa.debian.org/build-common-team/licensecheck.git) as
> licensed under the GPL.
> 
> The advantage is that these specifiers are machine-parseable which helps
> license conformance, e.g. for packaging barebox in Debian.
> 
> While touching these files also do some minor comment reformatting to
> get some uniform layout.
> 
> Signed-off-by: Uwe Kleine-König 

Hmmm, I don't see why you dropped the following files from your
(implicit) v2:

arch/arm/boards/embedsky-e9/board.c
arch/arm/boards/eukrea_cpuimx27/eukrea_cpuimx27.c
arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c
arch/arm/boards/freescale-mx21-ads/imx21ads.c
arch/arm/boards/freescale-mx35-3ds/3stack.c
arch/arm/boards/freescale-mx6-sabresd/board.c
arch/arm/boards/friendlyarm-mini2440/mini2440.c
arch/arm/boards/friendlyarm-tiny210/tiny210.c
arch/arm/boards/globalscale-guruplug/board.c 
arch/arm/boards/globalscale-mirabox/board.c
arch/arm/boards/imx233-olinuxino/imx23-olinuxino.c
arch/arm/boards/karo-tx6x/board.c
arch/arm/boards/phytec-phycard-omap3/pca-a-l1.c
arch/arm/boards/phytec-phycore-pxa270/config.h
arch/arm/boards/variscite-mx6/board.c
arch/arm/boards/variscite-mx6/lowlevel.c
arch/arm/boards/versatile/versatilepb.c
arch/arm/boards/zylonite/zylonite.h

Other than that, what's there is correct, so
Reviewed-by: Roland Hieber 

-- 
Roland Hieber, Pengutronix e.K.  | r.hie...@pengutronix.de |
Steuerwalder Str. 21 | https://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] pwm: Replace license and copyright boilerplate by SPDX identfiers

2020-05-23 Thread Roland Hieber
On Fri, May 22, 2020 at 03:17:59PM +0200, Uwe Kleine-König wrote:
> Hello Roland,
> 
> On Fri, May 22, 2020 at 02:55:56PM +0200, Roland Hieber wrote:
> > On Wed, May 20, 2020 at 02:10:47PM +0200, Ahmad Fatoum wrote:
> > > On 5/19/20 6:52 PM, Uwe Kleine-König wrote:
> > > > diff --git a/drivers/pwm/pwm-mxs.c b/drivers/pwm/pwm-mxs.c
> > > > index a06040ac3268..1e2db39def22 100644
> > > > --- a/drivers/pwm/pwm-mxs.c
> > > > +++ b/drivers/pwm/pwm-mxs.c
> > > > @@ -1,13 +1,5 @@
> > > > -/*
> > > > - * Copyright 2012 Freescale Semiconductor, Inc.
> > > > - *
> > > > - * 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
> > > > - */
> > > > +// SPDX-License-Identifier: GPL-2.0-only
> > > 
> > > The deleted text says "or later"
> > 
> > Ah, I stumbled over this too. The deleted text says:
> > 
> > "The code contained herein is licensed under the GNU General Public
> > License."
> > 
> > which in itself reads like "you can use any version of the GPL" (i.e.,
> > GPL-1.0-or-later). Later then the text says:
> > 
> > "You may obtain a copy of the GNU General Public License
> > Version 2 or later at the following locations:"
> > 
> > which in my opinion does not say anything about which version of the GPL
> > the code is licensed under.
> 
> This seems to be a problem in the Freescale template. I think I pointed
> that out once, but nothing changed.
> 
> For practical reasons I'd interpret that as "GPL-2.0-or-later".

Yeah, I guess that's alright.

Reviewed-by: Roland Hieber 

-- 
Roland Hieber, Pengutronix e.K.  | r.hie...@pengutronix.de |
Steuerwalder Str. 21 | https://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] pwm: Replace license and copyright boilerplate by SPDX identfiers

2020-05-22 Thread Roland Hieber
On Wed, May 20, 2020 at 02:10:47PM +0200, Ahmad Fatoum wrote:
> Hello,
> 
> On 5/19/20 6:52 PM, Uwe Kleine-König wrote:
> > This adapts all files that were identifed by licensecheck
> > (https://salsa.debian.org/build-common-team/licensecheck.git) as
> > licensed under the GPL and that have a (IMHO) clear copyright statement.
> > 
> > The advantage is that these specifiers are machine-parseable which helps
> > license conformance, e.g. for packaging barebox in Debian.
> > 
> > Signed-off-by: Uwe Kleine-König 
> > ---
> >  drivers/pwm/core.c| 15 +++
> >  drivers/pwm/pwm-mxs.c | 12 ++--
> >  drivers/pwm/pxa_pwm.c |  6 ++
> >  3 files changed, 7 insertions(+), 26 deletions(-)
> > 
...
> > diff --git a/drivers/pwm/pwm-mxs.c b/drivers/pwm/pwm-mxs.c
> > index a06040ac3268..1e2db39def22 100644
> > --- a/drivers/pwm/pwm-mxs.c
> > +++ b/drivers/pwm/pwm-mxs.c
> > @@ -1,13 +1,5 @@
> > -/*
> > - * Copyright 2012 Freescale Semiconductor, Inc.
> > - *
> > - * 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
> > - */
> > +// SPDX-License-Identifier: GPL-2.0-only
> 
> The deleted text says "or later"

Ah, I stumbled over this too. The deleted text says:

"The code contained herein is licensed under the GNU General Public
License."

which in itself reads like "you can use any version of the GPL" (i.e.,
GPL-1.0-or-later). Later then the text says:

"You may obtain a copy of the GNU General Public License
Version 2 or later at the following locations:"

which in my opinion does not say anything about which version of the GPL
the code is licensed under.

 - Roland

-- 
Roland Hieber, Pengutronix e.K.  | r.hie...@pengutronix.de |
Steuerwalder Str. 21 | https://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] treewide: replace commas with semicolons where appropriate

2020-05-18 Thread Roland Hieber
/i2c/busses/i2c-omap.c
> index bdb34ca1b4cb..d3f525f333cc 100644
> --- a/drivers/i2c/busses/i2c-omap.c
> +++ b/drivers/i2c/busses/i2c-omap.c
> @@ -1176,7 +1176,7 @@ i2c_omap_probe(struct device_d *pdev)
>  
>   omap_i2c_idle(i2c_omap);
>  
> - i2c_omap->adapter.master_xfer = omap_i2c_xfer,
> + i2c_omap->adapter.master_xfer = omap_i2c_xfer;
>   i2c_omap->adapter.nr = pdev->id;
>   i2c_omap->adapter.dev.parent = pdev;
>   i2c_omap->adapter.dev.device_node = pdev->device_node;
> diff --git a/drivers/mci/stm32_sdmmc2.c b/drivers/mci/stm32_sdmmc2.c
> index 3ce3bb0f89d2..da2dc592adb3 100644
> --- a/drivers/mci/stm32_sdmmc2.c
> +++ b/drivers/mci/stm32_sdmmc2.c
> @@ -586,8 +586,8 @@ static int stm32_sdmmc2_probe(struct amba_device *adev,
>   priv->dev = dev;
>  
>   mci = &priv->mci;
> - mci->send_cmd = stm32_sdmmc2_send_cmd,
> - mci->set_ios = stm32_sdmmc2_set_ios,
> + mci->send_cmd = stm32_sdmmc2_send_cmd;
> + mci->set_ios = stm32_sdmmc2_set_ios;
>   mci->init = stm32_sdmmc2_reset;
>   mci->hw_dev = dev;
>  
> diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
> index 406b8c964f58..7397034586ef 100644
> --- a/drivers/net/usb/usbnet.c
> +++ b/drivers/net/usb/usbnet.c
> @@ -198,11 +198,11 @@ int usbnet_probe(struct usb_device *usbdev, const 
> struct usb_device_id *prod)
>   edev = &undev->edev;
>   undev->udev = usbdev;
>  
> - edev->open = usbnet_open,
> - edev->init = usbnet_init,
> - edev->send = usbnet_send,
> - edev->recv = usbnet_recv,
> - edev->halt = usbnet_halt,
> + edev->open = usbnet_open;
> + edev->init = usbnet_init;
> + edev->send = usbnet_send;
> + edev->recv = usbnet_recv;
> + edev->halt = usbnet_halt;
>   edev->priv = undev;
>   edev->parent = &usbdev->dev;
>  
> -- 
> 2.26.2
> 
> 
> ___
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Roland Hieber, Pengutronix e.K.  | r.hie...@pengutronix.de |
Steuerwalder Str. 21 | https://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 02/23] sandbox: define CONFIG_64BIT as appropriate

2020-05-11 Thread Roland Hieber
On Mon, May 11, 2020 at 09:21:19AM +0200, Ahmad Fatoum wrote:
> From: Ahmad Fatoum 
> 
> All 64-bit architectures are supposed to define CONFIG_64BIT to support
> the relevant 64-bit MMIO accessors. The sandbox architecture is a bit
> of a special case, because barebox uses the toolchain default and
> doesn't force a bitness. Add 64BIT as promptless symbol, which reflects
> the pointer size of the target platform.
> 
> Signed-off-by: Ahmad Fatoum 

Nitpick: S-o-b address is different from the author address.
Same on the next patch.

 - Roland

> ---
>  arch/sandbox/Kconfig| 9 +
>  scripts/gcc-64bitptr.sh | 9 +
>  2 files changed, 18 insertions(+)
>  create mode 100755 scripts/gcc-64bitptr.sh
> 
> diff --git a/arch/sandbox/Kconfig b/arch/sandbox/Kconfig
> index 6ec71a99e53f..46cfe8b4b1c8 100644
> --- a/arch/sandbox/Kconfig
> +++ b/arch/sandbox/Kconfig
> @@ -1,3 +1,5 @@
> +source "scripts/Kconfig.include"
> +
>  config SANDBOX
>   bool
>   select OFTREE
> @@ -20,3 +22,10 @@ config SANDBOX_UNWIND
>   default y
>   select ARCH_HAS_STACK_DUMP
>   depends on UBSAN || KASAN
> +
> +config CC_IS_64BIT
> + def_bool $(success,$(srctree)/scripts/gcc-64bitptr.sh $(CC))
> +
> +config 64BIT
> + bool
> + default CC_IS_64BIT
> diff --git a/scripts/gcc-64bitptr.sh b/scripts/gcc-64bitptr.sh
> new file mode 100755
> index ..7fb05703b813
> --- /dev/null
> +++ b/scripts/gcc-64bitptr.sh
> @@ -0,0 +1,9 @@
> +#!/bin/sh
> +# SPDX-License-Identifier: GPL-2.0-only
> +
> +cat << "END" | $@ -x c - -c -o /dev/null
> +int main(void)
> +{
> + return sizeof(struct { int:-!(sizeof(void *) == 8); });
> +}
> +END
> -- 
> 2.26.2
> 
> 
> ___
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Roland Hieber, Pengutronix e.K.  | r.hie...@pengutronix.de |
Steuerwalder Str. 21 | https://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] ARM: dts: vexpress-v2p-ca9: adapt fixed NOR flash partition setup

2020-05-11 Thread Roland Hieber
On Mon, May 11, 2020 at 08:59:52AM +0200, Sascha Hauer wrote:
> On Wed, Apr 29, 2020 at 05:35:59PM +0200, Roland Hieber wrote:
> > Upstream DTS commit 62a5017bf825c9e4d317 ("ARM: dts: vexpress: specify
> > AFS partition") [1] introduced an empty node at /smb@400
> > /motherboard/flash@0,/partitions, which is preferred by the OF
> > partitions parser over the single partition nodes. In the same commit,
> > upstream set the compatible to "arm,arm-firmware-suite", which barebox
> > does not know about. Adapt our fixed partition setup accordingly by
> > wrapping all partitions in an extra "partitions" node with the correct
> > compatible.
> 
> I wonder what happens when we run this code on a flash that uses the
> arm-firmware-suite partitioning. We may end up with inconsistent
> partitioning then.
> In the end the barebox vexpress code only ever runs on qemu and not on
> the real hardware, so this is not relevant.
> Either way the patch seems like a good start, so applied.

Yes, valid concern. What about creating a separate device tree for the
qemu variant? This way we wouldn't run into that problem on the physical
hardware.

 - Roland

-- 
Roland Hieber, Pengutronix e.K.  | r.hie...@pengutronix.de |
Steuerwalder Str. 21 | https://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 3/3] LICENSES: add Linux-syscall-note exception text

2020-05-10 Thread Roland Hieber
On Fri, May 08, 2020 at 08:21:49AM +0200, Ahmad Fatoum wrote:
> We include Linux headers in barebox, which are licensed under GPL with
> this exception.
> 
> While we are GPL-2.0 as well and don't require the exception, we should
> always provide license texts to the License-Identifiers we are using.
> 
> At the time of this writing these are:
>   * BSD-1-Clause
>   * BSD-2-Clause
>   * BSD-3-Clause
>   * GPL-2.0-only, -or-later and WITH Linux-syscall-note
>   * LGPL-2.1 and -or-later
>   * MIT
>   * X11
>   * ISC
> 
> With this commit, our LICENSES directory now contains licenses for all
> of them.
> 
> Signed-off-by: Ahmad Fatoum 
> ---
>  LICENSES/exceptions/Linux-syscall-note | 25 +
>  1 file changed, 25 insertions(+)
>  create mode 100644 LICENSES/exceptions/Linux-syscall-note

Reviewed-by: Roland Hieber 

> 
> diff --git a/LICENSES/exceptions/Linux-syscall-note 
> b/LICENSES/exceptions/Linux-syscall-note
> new file mode 100644
> index ..9abdad71fafd
> --- /dev/null
> +++ b/LICENSES/exceptions/Linux-syscall-note
> @@ -0,0 +1,25 @@
> +SPDX-Exception-Identifier: Linux-syscall-note
> +SPDX-URL: https://spdx.org/licenses/Linux-syscall-note.html
> +SPDX-Licenses: GPL-2.0, GPL-2.0+, GPL-1.0+, LGPL-2.0, LGPL-2.0+, LGPL-2.1, 
> LGPL-2.1+, GPL-2.0-only, GPL-2.0-or-later
> +Usage-Guide:
> +  This exception is used together with one of the above SPDX-Licenses
> +  to mark user space API (uapi) header files so they can be included
> +  into non GPL compliant user space application code.
> +  To use this exception add it with the keyword WITH to one of the
> +  identifiers in the SPDX-Licenses tag:
> +SPDX-License-Identifier:  WITH Linux-syscall-note
> +License-Text:
> +
> +   NOTE! This copyright does *not* cover user programs that use kernel
> + services by normal system calls - this is merely considered normal use
> + of the kernel, and does *not* fall under the heading of "derived work".
> + Also note that the GPL below is copyrighted by the Free Software
> + Foundation, but the instance of code that it refers to (the Linux
> + kernel) is copyrighted by me and others who actually wrote it.
> +
> + Also note that the only valid version of the GPL as far as the kernel
> + is concerned is _this_ particular version of the license (ie v2, not
> + v2.2 or v3.x or whatever), unless explicitly otherwise stated.
> +
> + Linus Torvalds
> +
> -- 
> 2.26.2
> 
> 
> ___
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Roland Hieber, Pengutronix e.K.  | r.hie...@pengutronix.de |
Steuerwalder Str. 21 | https://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 2/3] LICENSES: import ISC/X11/BSD-2-Clause license Text from Linux

2020-05-10 Thread Roland Hieber
On Fri, May 08, 2020 at 08:21:48AM +0200, Ahmad Fatoum wrote:
> Our dts/ directory contains SPDX-License-Identifiers referencing these
> three licenses. We should thus add the full-text of the LICENSES to the
> source tree. The split into deprecated and preferred is taken from
> Linux.
> 
> Signed-off-by: Ahmad Fatoum 
> ---
>  LICENSES/deprecated/ISC | 24 +
>  LICENSES/deprecated/X11 | 37 +
>  LICENSES/preferred/BSD-2-Clause | 32 
>  3 files changed, 93 insertions(+)
>  create mode 100644 LICENSES/deprecated/ISC
>  create mode 100644 LICENSES/deprecated/X11
>  create mode 100644 LICENSES/preferred/BSD-2-Clause
> 
> diff --git a/LICENSES/deprecated/ISC b/LICENSES/deprecated/ISC
> new file mode 100644
> index ..8953c3142079
> --- /dev/null
> +++ b/LICENSES/deprecated/ISC
> @@ -0,0 +1,24 @@
> +Valid-License-Identifier: ISC
> +SPDX-URL: https://spdx.org/licenses/ISC.html
> +Usage-Guide:
> +  To use the ISC License put the following SPDX tag/value pair into a
> +  comment according to the placement guidelines in the licensing rules
> +  documentation:

We should probably have a license rules documentation somewhere… For now
I would simply link to
<https://www.kernel.org/doc/html/latest/process/license-rules.html>.

> +SPDX-License-Identifier: ISC
> +License-Text:
> +
> +ISC License
> +
> +Copyright (c)  
> +
> +Permission to use, copy, modify, and/or distribute this software for any
> +purpose with or without fee is hereby granted, provided that the above
> +copyright notice and this permission notice appear in all copies.
> +
> +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
> +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
> +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
> +SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
> +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
> +OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
> +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
> diff --git a/LICENSES/deprecated/X11 b/LICENSES/deprecated/X11
> new file mode 100644
> index ..fe4353fd
> --- /dev/null
> +++ b/LICENSES/deprecated/X11
> @@ -0,0 +1,37 @@
> +Valid-License-Identifier: X11
> +SPDX-URL: https://spdx.org/licenses/X11.html
> +Usage-Guide:
> +  To use the X11 put the following SPDX tag/value pair into a comment
> +  according to the placement guidelines in the licensing rules
> +  documentation:

Here too.

> +SPDX-License-Identifier: X11
> +License-Text:
> +
> +
> +X11 License
> +
> +Copyright (C) 1996 X Consortium
> +
> +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
> +X CONSORTIUM 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.
> +
> +Except as contained in this notice, the name of the X Consortium shall not
> +be used in advertising or otherwise to promote the sale, use or other
> +dealings in this Software without prior written authorization from the X
> +Consortium.
> +
> +X Window System is a trademark of X Consortium, Inc.
> diff --git a/LICENSES/preferred/BSD-2-Clause b/LICENSES/preferred/BSD-2-Clause
> new file mode 100644
> index ..da366e2ce50b
> --- /dev/null
> +++ b/LICENSES/preferred/BSD-2-Clause
> @@ -0,0 +1,32 @@
> +Valid-License-Identifier: BSD-2-Clause
> +SPDX-URL: https://spdx.org/licenses/BSD-2-Clause.html
> +Usage-Guide:
> +  To use the BSD 2-clause "Simplified" License put the following SPDX
> +  tag/value pair into a comment according to the placement guidelines in
> +  the licensing rules documentation:

Here too.

If you fix thes

  1   2   3   4   >