[PATCH 1/4] common: bootm: allow letting IH_ARCH undefined

2020-06-23 Thread Clement Leger
Some architecture might not want to support uImage. To do so, allow IH_ARCH to be let undefined. Signed-off-by: Clement Leger --- common/bootm.c | 2 +- include/image.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/common/bootm.c b/common/bootm.c index

[PATCH 4/4] kvx: add support for elf loading using bootm

2020-06-23 Thread Clement Leger
From: Clement Leger In order to boot elfs files, add bootm command support for kvx. This support can boot elf files using bootm elf support. initrd and device-tree handling is also included and loads them after the elf file load address. Signed-off-by: Clement Leger --- arch/kvx/Kconfig

[PATCH 3/4] kvx: add D-cache inval and I-cache sync

2020-06-23 Thread Clement Leger
Before booting, we must make sure the I-cache is synchronized with the D-cache to execute loaded instructions. In order to do that, add a function which execute a fence to ensure every memory accesses have been committed out of processor pipeline to memory and then invalidate I-cache to reload

[PATCH 0/4] kvx: add elf bootm support

2020-06-23 Thread Clement Leger
This serie adds support for elf bootm support on KVX architecture. First patches are allowing to build elf support for KVX and then bootm support is added to KVX. Clement Leger (4): common: bootm: allow letting IH_ARCH undefined common: Kconfig: remove MIPS dependency kvx: add D-cache inval

[PATCH 2/4] common: Kconfig: remove MIPS dependency

2020-06-23 Thread Clement Leger
There is no reason anymore to limit the use of elf on mips since there is no elf specific support needed in architectures. Remove this dependency and drop COMPILE_TEST config. Signed-off-by: Clement Leger --- common/Kconfig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git

[PATCH] kbuild: fix typo in --no-whole-archive flag

2020-06-23 Thread Clement Leger
"whole" was replaced with "while" during a previous patch. Fix this flag to allow building correctly. Fixes 0a78b33954 ("kbuild: switch over to thin archive") Signed-off-by: Clement Leger --- arch/kvx/Makefile | 2 +- arch/mips/pbl/Makefile | 2 +- 2 files changed, 2 insertions(+), 2

Re: reset / watchdog on an imx7d soc

2020-06-23 Thread Giorgio Dal Molin
Hi Fabio, thank you for your quick reply. I've already found the errata you linked in your mail but I had no success applying the suggestion there; maybe I'm doing it wrong. Let's take the Option 3 there: Use the SNVS LPCR register to turn off the system power It suggests to set the

Re: reset / watchdog on an imx7d soc

2020-06-23 Thread Fabio Estevam
Hi Giorgio, On Tue, Jun 23, 2020 at 10:48 AM Giorgio Dal Molin wrote: > Can anyone confirm that the current barebox is able to restart an imx7 soc > without > using external signals ? You really need to use the WDOG_B pin to trigger the reset due to an i.MX7 erratum. Please check the i.MX7

[PATCH v2] ARM: dts: vexpress-v2p-ca15: adapt fixed NOR flash partition setup

2020-06-23 Thread Ahmad Fatoum
Roland already fixed the vexpress-v2p-ca9: > 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

reset / watchdog on an imx7d soc

2020-06-23 Thread Giorgio Dal Molin
Hi, I'm having problems with the reset command on an imx7d soc. As far as I understand it, to reboot barebox on an imx7 the 'reset' command invokes the watchdog1, forcing it to do its job: in drivers/watchdog/imxwd.c: static void imx21_soc_reset(struct imx_wd *priv) ... val |=

[PATCH] ARM: dts: vexpress-v2p-ca15: adapt fixed NOR flash partition setup

2020-06-23 Thread Ahmad Fatoum
Roland already fixed the vexpress-v2p-ca15: > 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

Mailing list issues

2020-06-23 Thread Sascha Hauer
Hello, I just heard that infradead.org had a hard disk crash. The last backup was from May 2018 which is the state restored now. This includes the mailing list archive as well as the subscriptions. If you are unsubscribed from the barebox mailing list and find yourself subscribed now again,

Re: [PATCH 1/4] ARM: vexpress: dts: use direct instead of &{/path}

2020-06-23 Thread Ahmad Fatoum
On 6/23/20 3:25 PM, Ahmad Fatoum wrote: > 6940ba22c66a ("dts: update to v5.3-rc1") added a label that we can > reference instead of relying on the path not changing. Make use of it, > so the compilation doesn't fail along with the v5.8-rc1 dts/ sync. > > Signed-off-by: Ahmad Fatoum > --- >

[PATCH 3/4] clk: at91: remove no-longer needed dt-compat code

2020-06-23 Thread Ahmad Fatoum
dt-compat.c implemented bindings for following compatibles: atmel,at91rm9200-clk-main-osc atmel,at91sam9x5-clk-main-rc-osc atmel,at91rm9200-clk-main atmel,at91sam9x5-clk-main atmel,at91rm9200-clk-master atmel,at91sam9x5-clk-master

[PATCH 2/4] ARM: stm32mp: dts: extend now upstream stm32mp157c-lxa-mc1.dts

2020-06-23 Thread Ahmad Fatoum
With the recent v5.8-rc1 device tree sync, we can drop everything but the barebox-specific parts from the barebox device tree. The rest now comes from the upstream device tree. Signed-off-by: Ahmad Fatoum --- arch/arm/dts/stm32mp157c-lxa-mc1.dts | 2 +- arch/arm/dts/stm32mp157c-lxa-mc1.dtsi

[PATCH 0/4] dts: clean up and a fix

2020-06-23 Thread Ahmad Fatoum
Hello Sascha, the vexpress changed paths, again, so building now fails. Fortunately[1], a label: had been introduced meanwhile, that we could use. This is what the first patch does. Please order it before the v5.8-rc1 sync, so we don't have intermittent build breakage[2]. The other three patches

[PATCH 1/4] ARM: vexpress: dts: use direct instead of &{/path}

2020-06-23 Thread Ahmad Fatoum
6940ba22c66a ("dts: update to v5.3-rc1") added a label that we can reference instead of relying on the path not changing. Make use of it, so the compilation doesn't fail along with the v5.8-rc1 dts/ sync. Signed-off-by: Ahmad Fatoum --- [afa: board is still broken, because the

[PATCH 4/4] clk: at91: remove now-duplicate crutch #defines

2020-06-23 Thread Ahmad Fatoum
As the code comment describes, these #defines were only needed temporarily till dts/ is synced vs Linux v5.8-rc1. This is now the case, so drop them again. Signed-off-by: Ahmad Fatoum --- drivers/clk/at91/pmc.h | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/clk/at91/pmc.h

[PATCH 12/20] arm: imx: add initial imx8mp support

2020-06-23 Thread Sascha Hauer
From: Oleksij Rempel This adds base support for the i.MX8MP SoC. Not much to do here as this SoC is quite similar to the i.MX8M. This adds: - Kconfig symbols - bootsource detection - register base address defines - iomux defines Signed-off-by: Oleksij Rempel --- arch/arm/mach-imx/Kconfig

[PATCH 15/20] clk: imx: Add imx8mp clk driver

2020-06-23 Thread Sascha Hauer
From: Oleksij Rempel This adds clock support for the i.MX8MP, taken from Linux-5.7. Signed-off-by: Oleksij Rempel --- drivers/clk/imx/Makefile | 2 + drivers/clk/imx/clk-imx8mp.c | 720 +++ 2 files changed, 722 insertions(+) create mode 100644

[PATCH 03/20] scripts: imx-image: Add extra code path for i.MX35

2020-06-23 Thread Sascha Hauer
The i.MX35 writes two copies of the header at the beginning of the image. This is written in a loop right now. Make the i.MX35 an extra code path so that it is out of the way for the changes in the next patches. Signed-off-by: Sascha Hauer --- scripts/imx/imx-image.c | 11 +++ 1 file

[PATCH 16/20] mci: imx-esdhc-pbl: Add imx8mp_esdhc_load_image() for i.MX8MP

2020-06-23 Thread Sascha Hauer
The image format of the i.MX8MP is different from i.MX8M, so add its own image loading function for it. Older i.MX SoCs had a IVT Offset (the offset from the start of the image to the actual data) of 1KiB. This was done to leave space for the partition table at the beginning of the device. To

[PATCH 07/20] scripts: imx-image: rename dcdofs to ivtofs

2020-06-23 Thread Sascha Hauer
This renames the dcdofs config option in the imx-image tool to ivtofs. dcdofs is a misnomer. The DCD (Device Configuration Data) is only one part of the data linked into the IVT (Image Vector Table), but the meaning of the option is really the latter, not the former. Signed-off-by: Sascha Hauer

[PATCH 19/20] ARM: i.MX8MP: Add ocotp support

2020-06-23 Thread Sascha Hauer
Signed-off-by: Sascha Hauer --- drivers/nvmem/ocotp.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/drivers/nvmem/ocotp.c b/drivers/nvmem/ocotp.c index 34e33dee82..62f510785b 100644 --- a/drivers/nvmem/ocotp.c +++ b/drivers/nvmem/ocotp.c @@ -728,6 +728,14 @@ static struct

[PATCH 20/20] arm: boards: add initial imx8mp-evk support

2020-06-23 Thread Sascha Hauer
From: Oleksij Rempel This adds support for the NXP i.MX8MP-EVK board. The SDRAM timings are taken from U-Boot-2020.07-rc4, other information how to initialize the board are form U-Boot as well. Signed-off-by: Oleksij Rempel Signed-off-by: Sascha Hauer ---

[PATCH 10/20] net: fec_imx: add fsl,imx8mp-fec compatible

2020-06-23 Thread Sascha Hauer
From: Oleksij Rempel Signed-off-by: Oleksij Rempel --- drivers/net/fec_imx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/fec_imx.c b/drivers/net/fec_imx.c index 772f930f0d..aefb626e67 100644 --- a/drivers/net/fec_imx.c +++ b/drivers/net/fec_imx.c @@ -922,6 +922,9 @@

[PATCH 00/20] i.MX8MP support

2020-06-23 Thread Sascha Hauer
Hi All, This series adds support for the NXP i.MX8MP SoC along with the i.MX8MP-EVK board. Most of the stuff is quiet straight forward as the i.MX8MP is quite similar to the i.MX8M. Only the image format is subtly changed and as a consequence we have quite some patches on the imx-image tool. For

[PATCH 11/20] mci: imx-esdhc: Add i.MX8mp compatible

2020-06-23 Thread Sascha Hauer
From: Oleksij Rempel Only add the compatible string to let the driver match. Signed-off-by: Oleksij Rempel --- drivers/mci/imx-esdhc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mci/imx-esdhc.c b/drivers/mci/imx-esdhc.c index bff8dd67ad..b383344142 100644 ---

[PATCH 17/20] net: phy: realtek: handle RX delay setting

2020-06-23 Thread Sascha Hauer
RX delay and TX delay can be configured independently on the RTL8211F. Decode the phy mode setting and set both bits accordingly. This is based on Linux commit 1b3047b5208a ("net: phy: realtek: add support for configuring the RX delay on RTL8211F") Signed-off-by: Sascha Hauer ---

[PATCH 18/20] ARM: i.MX: bbu: Fix IVT offset for i.MX8MP

2020-06-23 Thread Sascha Hauer
Signed-off-by: Sascha Hauer --- arch/arm/mach-imx/imx-bbu-internal.c | 17 +++-- 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/arch/arm/mach-imx/imx-bbu-internal.c b/arch/arm/mach-imx/imx-bbu-internal.c index a922470988..1b3cb70da8 100644 ---

[PATCH 09/20] pinctrl: imx-iomux-v3: Add i.MX8MP compatible

2020-06-23 Thread Sascha Hauer
Signed-off-by: Sascha Hauer --- drivers/pinctrl/imx-iomux-v3.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/pinctrl/imx-iomux-v3.c b/drivers/pinctrl/imx-iomux-v3.c index a45c242fd1..fd05274512 100644 --- a/drivers/pinctrl/imx-iomux-v3.c +++ b/drivers/pinctrl/imx-iomux-v3.c @@

[PATCH 14/20] mfd: Add pca9440 register map

2020-06-23 Thread Sascha Hauer
The pca9440 is a PMIC found on the i.MX8MP-EVK board. This adds the register map for it. Signed-off-by: Sascha Hauer --- include/mfd/pca9450.h | 55 +++ 1 file changed, 55 insertions(+) create mode 100644 include/mfd/pca9450.h diff --git

[PATCH 06/20] scripts: imx-image: rename image_dcd_offset to image_ivt_offset

2020-06-23 Thread Sascha Hauer
image_dcd_offset is a misnomer, it should really be image_ivt_offset. The DCD (Device Configuration Data) is only one part of the data linked into the IVT (Image Vector Table), but the meaning of the variable is really the latter, not the former. Signed-off-by: Sascha Hauer ---

[PATCH 04/20] scripts: imx-image: exit with error when barebox header conflicts with IVT

2020-06-23 Thread Sascha Hauer
When the IVT is right at the beginning of the image it conflicts with the barebox header. Bail out with an error when this happens. Signed-off-by: Sascha Hauer --- scripts/imx/imx-image.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/scripts/imx/imx-image.c b/scripts/imx/imx-image.c

[PATCH 13/20] scripts: imx-image: Add i.MX8MP support

2020-06-23 Thread Sascha Hauer
Signed-off-by: Sascha Hauer --- scripts/imx/imx.c | 1 + scripts/imx/imx.h | 9 - 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/imx/imx.c b/scripts/imx/imx.c index 5eacfdf76b..4d2f65af9b 100644 --- a/scripts/imx/imx.c +++ b/scripts/imx/imx.c @@ -240,6 +240,7 @@

[PATCH 02/20] scripts: imx-image: exit on read/write failures

2020-06-23 Thread Sascha Hauer
When xread/xwrite fails the caller bails out of the program with an error. We can drop all the error handling by letting xread/xwrite call exit() themselves. Signed-off-by: Sascha Hauer --- scripts/imx/imx-image.c | 77 - 1 file changed, 23 insertions(+),

[PATCH 08/20] serial: i.MX: Add i.MX8MP compatible

2020-06-23 Thread Sascha Hauer
Signed-off-by: Sascha Hauer --- drivers/serial/serial_imx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/serial/serial_imx.c b/drivers/serial/serial_imx.c index e5280ac3e9..c0265fc2d7 100644 --- a/drivers/serial/serial_imx.c +++ b/drivers/serial/serial_imx.c @@ -290,6 +290,9 @@

[PATCH 01/20] scripts: imx-image: Only set DCD pointer when we have DCD data

2020-06-23 Thread Sascha Hauer
When we do not have any DCD data we can set the pointer to the data to NULL. Signed-off-by: Sascha Hauer --- scripts/imx/imx-image.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/scripts/imx/imx-image.c b/scripts/imx/imx-image.c index ec7444a772..2481ae6403

[PATCH 05/20] scripts: imx-image: Fix writing image with IVT offset = 0

2020-06-23 Thread Sascha Hauer
When we have written the barebox header the next thing we do is to lseek forward by the size of the header gap. This means our position is already inside of the rest of the image and we have to skip this offset from the rest of the image. This only works when the rest of the image doesn't have

Re: [PATCH 2/3] kbuild: add infrastructure to build userspace programs

2020-06-23 Thread Sascha Hauer
On Tue, Jun 23, 2020 at 12:07:01PM +0900, Masahiro Yamada wrote: > Import Linux commit 7f3a59db274c3e3d884c785e363a054110f1c266 > > Signed-off-by: Masahiro Yamada > --- > Very nice. Building userspace programs always was kind of a hack. Applied, thanks Sascha > Makefile |

Re: [PATCH 0/2] clk: at91: sync with Linux v5.8-rc1

2020-06-23 Thread Sascha Hauer
On Tue, Jun 23, 2020 at 08:20:09AM +0200, Ahmad Fatoum wrote: > Hello Sascha, > > This series adds support for the new sama5d3 clk bindings present in v5.8-rc1. > Please apply before the v5.8-rc1 device tree sync, so we avoid intermittent > breakage for the microchip-ksz9477-evb. Did that and

Re: [PATCH v2 1/3] mci: sdhci: atmel: don't print errors on command timeouts

2020-06-23 Thread Sascha Hauer
On Tue, Jun 23, 2020 at 12:08:44PM +0200, Ahmad Fatoum wrote: > Time outs can be expected, e.g. when probing whether a card is a MMC > one. The core handles it, so don't have the driver print an error. > > While at it, simplify the error handling. We don't need to read the > status more than once

[PATCH v2 1/3] mci: sdhci: atmel: don't print errors on command timeouts

2020-06-23 Thread Ahmad Fatoum
Time outs can be expected, e.g. when probing whether a card is a MMC one. The core handles it, so don't have the driver print an error. While at it, simplify the error handling. We don't need to read the status more than once and returning -EPERM on non-timeout is what the other drivers are

[PATCH v2 2/3] mci: sdhci: atmel: use dev_printf instead of pr_print in common code

2020-06-23 Thread Ahmad Fatoum
On boards like the sama5d27 som1 ek, we have two SD card slots, so error messages are more useful if they refer to the SDHCI instance. We didn't do this at first, because the common code is compiled for PBL as well. With a sprinkle of preprocessor ifdeffery, we can have both. Signed-off-by: Ahmad

[PATCH v2 3/3] mci: sdhci: atmel: avoid buggy SDHCI_RESET_ALL

2020-06-23 Thread Ahmad Fatoum
On the sama5d27, currently only the MCI used for boot is operational. The other one errors out when failing to reset the card. Changing the RESET_ALL to RESET_CMD | RESET_DATA fixes this. This might be due to the SoC's "11.1 Software 'Reset For all' command may not execute properly" erratum[1]:

Re: [PATCH 1/2] clk: sync of_clk_get_parent_name with upstream

2020-06-23 Thread Sascha Hauer
On Mon, Jun 22, 2020 at 11:53:51AM +0200, Ahmad Fatoum wrote: > Upstream of_clk_get_parent_name only resorts to node name as a fallback. > Instead, it uses the name supplied for registered clocks whenever > possible. On the sama5d2, this results in sckc@f8048050 and slowck, > respectively. So far,

Re: [PATCH 2/3] mci: sdhci: atmel: use dev_printf instead of pr_print in common code

2020-06-23 Thread Ahmad Fatoum
On 6/23/20 11:46 AM, Sascha Hauer wrote: > On Mon, Jun 22, 2020 at 10:39:42AM +0200, Ahmad Fatoum wrote: >> On boards like the sama5d27 som1 ek, we have two SD card slots, so error >> messages are more useful if they refer to the SDHCI instance. We didn't >> do this at first, because the common

Re: [PATCH] ARM: at91: add at91sam9/sama5 reset reason detection

2020-06-23 Thread Sascha Hauer
On Mon, Jun 22, 2020 at 10:42:05AM +0200, Ahmad Fatoum wrote: > The reset controller status register contains information about the last > reset's cause. Tell barebox about it. > > Signed-off-by: Ahmad Fatoum > --- > arch/arm/mach-at91/at91sam9_rst.c | 30 ++ > 1

Re: [PATCH 2/3] mci: sdhci: atmel: use dev_printf instead of pr_print in common code

2020-06-23 Thread Sascha Hauer
On Mon, Jun 22, 2020 at 10:39:42AM +0200, Ahmad Fatoum wrote: > On boards like the sama5d27 som1 ek, we have two SD card slots, so error > messages are more useful if they refer to the SDHCI instance. We didn't > do this at first, because the common code is compiled for PBL as well. > With a

Re: [PATCH v2] startup: inhibit watchdogs on non-interactive autoboot abort

2020-06-23 Thread Sascha Hauer
On Tue, Jun 23, 2020 at 10:34:26AM +0200, Ahmad Fatoum wrote: > Hello Sascha, > > On 6/23/20 10:23 AM, Sascha Hauer wrote: > > On Mon, Jun 22, 2020 at 05:15:25PM +0200, Ahmad Fatoum wrote: > >> nv.autoboot=abort has been added as development aid to have barebox stop > >> at the shell prompt

Re: [PATCH v2] startup: inhibit watchdogs on non-interactive autoboot abort

2020-06-23 Thread Ahmad Fatoum
Hello Sascha, On 6/23/20 10:23 AM, Sascha Hauer wrote: > On Mon, Jun 22, 2020 at 05:15:25PM +0200, Ahmad Fatoum wrote: >> nv.autoboot=abort has been added as development aid to have barebox stop >> at the shell prompt automatically. It makes sense to inhibit all watchdogs >> in this mode, so the

Re: [PATCH v2] startup: inhibit watchdogs on non-interactive autoboot abort

2020-06-23 Thread Sascha Hauer
On Mon, Jun 22, 2020 at 05:15:25PM +0200, Ahmad Fatoum wrote: > nv.autoboot=abort has been added as development aid to have barebox stop > at the shell prompt automatically. It makes sense to inhibit all watchdogs > in this mode, so the user can later use the shell in peace. As a person who is

Re: [PATCH v2] watchdog: permit `wd 0` for non-stoppable, but inactive, watchdogs

2020-06-23 Thread Sascha Hauer
On Mon, Jun 22, 2020 at 05:11:15PM +0200, Ahmad Fatoum wrote: > A watchdog that can't be stopped returns -ENOSYS on set_timeout(0). > If the watchdog supports communicating whether it's running, we could > still allow `wd 0`, if it hasn't been started yet. > > Setting device parameter .priority=0

Re: [PATCH] devinfo: print device parent along with device info

2020-06-23 Thread Sascha Hauer
On Fri, Jun 19, 2020 at 04:03:53PM +0200, Ahmad Fatoum wrote: > Especially for "virtual" devices (e.g. wdog0 or mmc2), it is often > useful to know the corresponding hardware device. > > Instead of always having to search through plain devinfo, just > include this information in the output when

[PATCH 1/2] include: import upstream header

2020-06-23 Thread Ahmad Fatoum
Incoming code makes use of struct_size, which is defined upstream in . Import the Linux v5.8-rc1 header as is. Signed-off-by: Ahmad Fatoum --- include/linux/overflow.h | 319 +++ 1 file changed, 319 insertions(+) create mode 100644 include/linux/overflow.h

[PATCH 0/2] clk: at91: sync with Linux v5.8-rc1

2020-06-23 Thread Ahmad Fatoum
Hello Sascha, This series adds support for the new sama5d3 clk bindings present in v5.8-rc1. Please apply before the v5.8-rc1 device tree sync, so we avoid intermittent breakage for the microchip-ksz9477-evb. Thanks, Ahmad Fatoum (2): include: import upstream header clk: at91: sync with

[PATCH 2/2] clk: at91: sync with Linux v5.8-rc1

2020-06-23 Thread Ahmad Fatoum
This ports over a couple of changes that accrued upstream between v5.6, when we last synchronized, and v5.8-rc1: 5bf7f4a24938 clk: at91: sam9x60: Don't use audio PLL b0ecf1c6c6e8 clk: at91: usb: continue if clk_hw_round_rate() return zero 43b203d32b77 clk: at91: sam9x60: fix usb clock