Re: [PATCH] mci: bcm2835: Set mci host for sdhci

2024-05-24 Thread Sascha Hauer


On Wed, 22 May 2024 08:15:27 +0200, Jonas Richardsen wrote:
> The pointer `sdhci.mci` is currently not being set for the bcm2835. This
> leads to a null pointer dereference for example in `sdhci_wait_idle()`
> if the `sdhci_read` function fails or times out.
> 
> Set the pointer within the `bcm2835_mci_probe` function. This is
> analogous to the behaviour seen in `arasan_sdhci_probe`,
> `fsl_esdhc_probe`, `rk_sdhci_probe` and other, similar functions.
> 
> [...]

Applied, thanks!

[1/1] mci: bcm2835: Set mci host for sdhci
  https://git.pengutronix.de/cgit/barebox/commit/?id=5d74c69b3279 (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH master 1/3] mci: sdhci: use host device, not card, for debug message

2024-05-24 Thread Sascha Hauer


On Wed, 22 May 2024 10:07:32 +0200, Ahmad Fatoum wrote:
> All other messages printed in sdhci.c use the host's device to prefix
> the message, except this one debug message here that uses the card's
> instead. Unify this by using the host device everywhere.
> 
> 

Applied, thanks!

[1/3] mci: sdhci: use host device, not card, for debug message
  https://git.pengutronix.de/cgit/barebox/commit/?id=affdaa4a9df4 (link may 
not be stable)
[2/3] mci: sdhci: retrieve host device via common helper or NULL
  https://git.pengutronix.de/cgit/barebox/commit/?id=1ddaa6821b90 (link may 
not be stable)
[3/3] mci: sdhci: populate struct sdhci::mci in drivers
  https://git.pengutronix.de/cgit/barebox/commit/?id=532da9c40cdc (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH master] nvmem: bsec: make OP-TEE TA interaction optional

2024-05-24 Thread Sascha Hauer


On Fri, 24 May 2024 12:35:14 +0200, Ahmad Fatoum wrote:
> When targeting older OP-TEE versions, a PTA for BSEC access may not be
> available. Allow disabling STM32_BSEC_OPTEE_TA in this case, so the
> driver falls back to the secure monitor call silicon provider service.
> 
> 

Applied, thanks!

[1/1] nvmem: bsec: make OP-TEE TA interaction optional
  https://git.pengutronix.de/cgit/barebox/commit/?id=ead274ad3bc2 (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH 0/3] net: phy: dp83867: sync dp83867_phy_reset

2024-05-24 Thread Sascha Hauer


On Thu, 23 May 2024 16:40:27 +0200, Stefan Kerkmann wrote:
> I ran into the same problem as Roland with this Phy driver and missed
> the fix that landed in 095cd32961aab64cfe72941ce43d99876852e12b ("net:
> phy: dp83867: reset PHY on probe"). I'm still submitting this series as
> a refactoring of the fix - with the goal of being closer to the upstream
> Linux implementation.
> 
> 
> [...]

Applied, thanks!

[1/3] net: phy: allow PHY drivers to implement their own software reset
  https://git.pengutronix.de/cgit/barebox/commit/?id=bca02a0f549f (link may 
not be stable)
[2/3] net: phy: document core PHY structures
  https://git.pengutronix.de/cgit/barebox/commit/?id=7fb2f20dc854 (link may 
not be stable)
[3/3] net: phy: dp83867: sync dp83867_phy_rest
  https://git.pengutronix.de/cgit/barebox/commit/?id=adde7a0344ac (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH 0/4] make more use of handoff data

2024-05-21 Thread Sascha Hauer


On Tue, 21 May 2024 12:49:09 +0200, Sascha Hauer wrote:
> struct boarddata is a mechanism to pass a ARM machine number from PBL to
> barebox proper. The EFI payload also uses it to pass some custom
> pointers to barebox proper. handoff data was created for exactly this
> purpose, so retire boarddata and use handoff data instead.
> 
> @afa, the efi patch is compile tested only. Could you give it a try?
> 
> [...]

Applied, thanks!

[1/4] handoff-data: put handoff data into data section
  https://git.pengutronix.de/cgit/barebox/commit/?id=bd7ecdd33ea7 (link may 
not be stable)
[2/4] efi-payload: use handoff data to pass data to barebox proper
  https://git.pengutronix.de/cgit/barebox/commit/?id=26b93791e9d3 (link may 
not be stable)
[3/4] ARM: beagle: setup C environment early
  https://git.pengutronix.de/cgit/barebox/commit/?id=439d2f864760 (link may 
not be stable)
[4/4] ARM: replace boarddata with handoff data
  https://git.pengutronix.de/cgit/barebox/commit/?id=602aaa68a66d (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH v2 1/3] pinctrl: split off consumer API into linux/pinctrl/consumer.h

2024-05-21 Thread Sascha Hauer


On Tue, 21 May 2024 14:13:55 +0200, Ahmad Fatoum wrote:
> Follow-up patches will align the barebox pinctrl consumer API with
> Linux'. So it makes sense to have the header called the same as well.
> Users of the old pinctrl.h header are unaffected as it will include
> the new .
> 
> 

Applied, thanks!

[1/3] pinctrl: split off consumer API into linux/pinctrl/consumer.h
  https://git.pengutronix.de/cgit/barebox/commit/?id=6da06fc95ba1 (link may 
not be stable)
[2/3] pinctrl: rename barebox pinctrl_select_state to pinctrl_get_select
  https://git.pengutronix.de/cgit/barebox/commit/?id=ee4be3efa1e7 (link may 
not be stable)
[3/3] pinctrl: implement pinctrl_lookup_state/select_state
  https://git.pengutronix.de/cgit/barebox/commit/?id=da674fab4c62 (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH] include: linux/types.h: define intptr_t

2024-05-21 Thread Sascha Hauer


On Tue, 21 May 2024 10:29:44 +0200, Ahmad Fatoum wrote:
> We already define the unsigned uintptr_t, but lack its signed
> counterpart although we do define INTPTR_MAX. Add the definition
> for completeness.
> 
> 

Applied, thanks!

[1/1] include: linux/types.h: define intptr_t
  https://git.pengutronix.de/cgit/barebox/commit/?id=7176954ca289 (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH 1/2] usbgadget: fix error code in common code base

2024-05-21 Thread Sascha Hauer


On Tue, 21 May 2024 10:06:16 +0200, Marco Felsch wrote:
> Don't use command error codes in the common code base. Instead the
> commands should convert common error codes into command error codes.
> 
> 

Applied, thanks!

[1/2] usbgadget: fix error code in common code base
  https://git.pengutronix.de/cgit/barebox/commit/?id=41276fd07089 (link may 
not be stable)
[2/2] usbgadget: split usbgadget_register into prepare and register
  https://git.pengutronix.de/cgit/barebox/commit/?id=ef3c7fac172c (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH master 1/2] list: fix CONFIG_DEBUG_LIST link failure in PBL

2024-05-21 Thread Sascha Hauer


On Wed, 15 May 2024 08:07:57 +0200, Ahmad Fatoum wrote:
> With the addition of PBL handoff data, we now use  in PBL.
> This works fine with CONFIG_DEBUG_LIST disabled, because all functions are
> inlined, but when building with the option enabled, references to the
> out-of-line sanity checking functions breaks the build.
> 
> Fix this by omitting these references when building for PBL.
> 
> [...]

Applied, thanks!

[1/2] list: fix CONFIG_DEBUG_LIST link failure in PBL
  https://git.pengutronix.de/cgit/barebox/commit/?id=84d8445e0dfb (link may 
not be stable)
[2/2] pblimage: ls1028a: fix handling of short reads on
  https://git.pengutronix.de/cgit/barebox/commit/?id=27d7f5dcb305 (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH 1/3] pinctrl: split off consumer API into linux/pinctrl/consumer.h

2024-05-21 Thread Sascha Hauer


On Fri, 17 May 2024 07:56:10 +0200, Ahmad Fatoum wrote:
> Follow-up patches will align the barebox pinctrl consumer API with
> Linux'. So it makes sense to have the header called the same as well.
> Users of the old pinctrl.h header are unaffected as it will include
> the new .
> 
> 

Applied, thanks!

[1/3] pinctrl: split off consumer API into linux/pinctrl/consumer.h
  https://git.pengutronix.de/cgit/barebox/commit/?id=2cbfef3c0964 (link may 
not be stable)
[2/3] pinctrl: rename barebox pinctrl_select_state to pinctrl_get_select
  https://git.pengutronix.de/cgit/barebox/commit/?id=1a34f8cc686a (link may 
not be stable)
[3/3] pinctrl: implement pinctrl_lookup_state/select_state
  https://git.pengutronix.de/cgit/barebox/commit/?id=e13c73ff4b17 (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH] driver: move some inline getters for struct device into device.h

2024-05-21 Thread Sascha Hauer


On Fri, 17 May 2024 07:57:51 +0200, Ahmad Fatoum wrote:
> The purpose of device.h is to contain only the device related
> definitions and have as few header dependencies as possible.
> 
> dev_of_node() and dev_is_dma_coherent() are accessors for struct device
> and have no other dependencies, so move them into this header as well.
> 
> 
> [...]

Applied, thanks!

[1/1] driver: move some inline getters for struct device into device.h
  https://git.pengutronix.de/cgit/barebox/commit/?id=16a636613978 (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH] mci: imx-esdhc: retire esdhc_platform_data

2024-05-21 Thread Sascha Hauer


On Fri, 17 May 2024 07:59:51 +0200, Ahmad Fatoum wrote:
> We have no board in-tree that doesn't probe the imx-esdhc from DT.
> The platform data is thus unused as the PBL usage happens without it,
> therefore remove that struct definition and the dead code handling it.
> 
> 

Applied, thanks!

[1/1] mci: imx-esdhc: retire esdhc_platform_data
  https://git.pengutronix.de/cgit/barebox/commit/?id=4cce368d53c1 (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH] mci: collect host operation in struct mci_ops

2024-05-21 Thread Sascha Hauer


On Fri, 17 May 2024 08:09:44 +0200, Ahmad Fatoum wrote:
> The number of ops implementable by MCI drivers increase due to HS200
> support and will increase more for HS400. Collecting them into a common
> struct makes it easier to specialize them for drivers that support
> multiple variants and makes code more similar to Linux.
> 
> No functional change.
> 
> [...]

Applied, thanks!

[1/1] mci: collect host operation in struct mci_ops
  https://git.pengutronix.de/cgit/barebox/commit/?id=dfef2a2d2792 (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH] common: hide DEFAULT_COMPRESSION menu

2024-05-21 Thread Sascha Hauer


On Fri, 17 May 2024 08:21:51 +0200, Ahmad Fatoum wrote:
> CONFIG_DEFAULT_COMPRESSION_* refers to the compression done for
> in-barebox binaries and is not useful when barebox proper as a whole is
> compressed as in that case, we would have compression applied twice.
> 
> For this reason, DEFAULT_COMPRESSION_NONE is the only possible choice in
> a PBL-enabled build. Having the choice with only one option is confusing
> though, so let's hide the prompt.
> 
> [...]

Applied, thanks!

[1/1] common: hide DEFAULT_COMPRESSION menu
  https://git.pengutronix.de/cgit/barebox/commit/?id=f661c703ff46 (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH master] ARM: layerscape: fix layerscape multiarch build with DEBUG_LL

2024-05-21 Thread Sascha Hauer


On Fri, 17 May 2024 08:22:14 +0200, Ahmad Fatoum wrote:
> Layerscape was added recently into the CONFIG_ARCH_MULTIARCH (really
> multiplatform), but the required changes to DBEUG_LL was omitted, which
> breaks DEBUG_LL use for other platforms that aren't layerscape.
> 
> Fix this, so DEBUG_LL may be used for either layerscape or other enabled
> platforms.
> 
> [...]

Applied, thanks!

[1/1] ARM: layerscape: fix layerscape multiarch build with DEBUG_LL
  https://git.pengutronix.de/cgit/barebox/commit/?id=a8fa6c2afcb1 (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




[PATCH 3/4] ARM: beagle: setup C environment early

2024-05-21 Thread Sascha Hauer
Setup C environment in early board code. This will be needed in the next
step. Factored out to a separate patch to ease bisecting.

Signed-off-by: Sascha Hauer 
---
 arch/arm/boards/beagle/lowlevel.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/boards/beagle/lowlevel.c 
b/arch/arm/boards/beagle/lowlevel.c
index e4610722f6..828c8c76b3 100644
--- a/arch/arm/boards/beagle/lowlevel.c
+++ b/arch/arm/boards/beagle/lowlevel.c
@@ -175,6 +175,9 @@ ENTRY_FUNCTION(start_omap3_beagleboard_sdram, bootinfo, r1, 
r2)
 {
omap3_save_bootinfo((void *)bootinfo);
 
+   relocate_to_current_adr();
+   setup_c();
+
beagle_board_init_sdram();
 }
 
-- 
2.39.2




[PATCH 1/4] handoff-data: put handoff data into data section

2024-05-21 Thread Sascha Hauer
The intention was to put the handoff data into the data section and not
into the bss section so that it won't be cleared by another call to
setup_c(). This was not fully done, add a __section(.data) to the
missing places.

Signed-off-by: Sascha Hauer 
---
 include/pbl/handoff-data.h | 18 +-
 pbl/handoff-data.c |  2 +-
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/include/pbl/handoff-data.h b/include/pbl/handoff-data.h
index 7f883421df..18ea9e508b 100644
--- a/include/pbl/handoff-data.h
+++ b/include/pbl/handoff-data.h
@@ -24,15 +24,15 @@ struct handoff_data_entry {
unsigned int flags;
 };
 
-#define handoff_data_add_flags(_cookie, _data, _size, _flags)  \
-   do {\
-   static struct handoff_data_entry hde;   \
-   hde.cookie = _cookie;   \
-   hde.data = _data;   \
-   hde.size = _size;   \
-   hde.flags = _flags; \
-   \
-   handoff_data_add_entry();   \
+#define handoff_data_add_flags(_cookie, _data, _size, _flags)  \
+   do {\
+   static struct handoff_data_entry hde __section(.data);  \
+   hde.cookie = _cookie;   \
+   hde.data = _data;   \
+   hde.size = _size;   \
+   hde.flags = _flags; \
+   \
+   handoff_data_add_entry();   \
} while (0);
 
 #define handoff_data_add(_cookie, _data, _size)\
diff --git a/pbl/handoff-data.c b/pbl/handoff-data.c
index e6745797c0..85c3985995 100644
--- a/pbl/handoff-data.c
+++ b/pbl/handoff-data.c
@@ -9,7 +9,7 @@ static struct handoff_data *handoff_data = (void *)-1;
 
 static struct handoff_data *handoff_data_get(void)
 {
-   static struct handoff_data __handoff_data;
+   static struct handoff_data __handoff_data __section(.data);
 
/*
 * Sometimes the PBL copies itself to some other location and is
-- 
2.39.2




[PATCH 2/4] efi-payload: use handoff data to pass data to barebox proper

2024-05-21 Thread Sascha Hauer
EFI payload uses custom fields in struct boarddata to pass data from PBL
to barebox proper. handoff data was created for exactly this purpose.
Now that we have it, switch EFI payload over to use it.

Signed-off-by: Sascha Hauer 
---
 efi/payload/boarddata.c| 12 +++-
 efi/payload/entry-multi.c  | 16 +++-
 include/boarddata.h|  4 
 include/efi/efi-payload.h  |  5 +
 include/pbl/handoff-data.h |  1 +
 5 files changed, 20 insertions(+), 18 deletions(-)

diff --git a/efi/payload/boarddata.c b/efi/payload/boarddata.c
index 3260e31c7b..d4e4b5ac1d 100644
--- a/efi/payload/boarddata.c
+++ b/efi/payload/boarddata.c
@@ -8,25 +8,27 @@
 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
 #include 
 #include 
+#include 
 
 static int handle_efi_boarddata(void)
 {
-   const struct barebox_boarddata *bd = barebox_get_boarddata();
+   size_t size;
+   struct barebox_efi_data *efidata;
efi_status_t efiret;
 
-   if (!barebox_boarddata_is_machine(bd, BAREBOX_MACH_TYPE_EFI))
+   efidata = handoff_data_get_entry(HANDOFF_DATA_EFI, );
+   if (!efidata)
return 0;
 
barebox_add_memory_bank("ram0", mem_malloc_start(), mem_malloc_size());
 
-   efi_parent_image = bd->image;
-   efi_sys_table = bd->sys_table;
+   efi_parent_image = efidata->image;
+   efi_sys_table = efidata->sys_table;
BS = efi_sys_table->boottime;
RT = efi_sys_table->runtime;
 
diff --git a/efi/payload/entry-multi.c b/efi/payload/entry-multi.c
index f929ab01ec..26cf2ebfa7 100644
--- a/efi/payload/entry-multi.c
+++ b/efi/payload/entry-multi.c
@@ -3,18 +3,13 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
-
-static struct barebox_boarddata boarddata = {
-   .magic = BAREBOX_BOARDDATA_MAGIC,
-   .machine = BAREBOX_MACH_TYPE_EFI,
-};
+#include 
 
 asmlinkage void __efistub_efi_pe_entry(void *image, struct efi_system_table 
*sys_table);
 
@@ -30,16 +25,19 @@ void __efistub_efi_pe_entry(void *image, struct 
efi_system_table *sys_table)
 {
size_t memsize;
efi_physical_addr_t mem;
+   static struct barebox_efi_data efidata;
 
 #ifdef DEBUG
sys_table->con_out->output_string(sys_table->con_out, L"\nbarebox\n");
 #endif
pbl_set_putc(efi_putc, sys_table);
 
-   boarddata.image = image;
-   boarddata.sys_table = sys_table;
+   efidata.image = image;
+   efidata.sys_table = sys_table;
+
+   handoff_data_add(HANDOFF_DATA_EFI, , sizeof(efidata));
 
mem = efi_earlymem_alloc(sys_table, );
 
-   barebox_pbl_entry(mem, memsize, );
+   barebox_pbl_entry(mem, memsize, NULL);
 }
diff --git a/include/boarddata.h b/include/boarddata.h
index 8c048fd957..6092d5f304 100644
--- a/include/boarddata.h
+++ b/include/boarddata.h
@@ -15,10 +15,6 @@ struct barebox_boarddata {
  * that do not potientially clashes with registered 
machines,
  * i.e. use a number > 0x1.
  */
-#ifdef CONFIG_EFI_STUB
-   void *image;
-   void *sys_table;
-#endif
 };
 
 /*
diff --git a/include/efi/efi-payload.h b/include/efi/efi-payload.h
index 774c069229..73b1b9bd8e 100644
--- a/include/efi/efi-payload.h
+++ b/include/efi/efi-payload.h
@@ -8,6 +8,11 @@
 struct efi_system_table;
 struct efi_loaded_image;
 
+struct barebox_efi_data {
+   void *image;
+   void *sys_table;
+};
+
 extern struct efi_system_table *efi_sys_table;
 extern efi_handle_t efi_parent_image;
 extern struct efi_device_path *efi_device_path;
diff --git a/include/pbl/handoff-data.h b/include/pbl/handoff-data.h
index 18ea9e508b..044b4bb884 100644
--- a/include/pbl/handoff-data.h
+++ b/include/pbl/handoff-data.h
@@ -12,6 +12,7 @@ struct handoff_data {
 #define HANDOFF_DATA_INTERNAL_DT_Z HANDOFF_DATA_BAREBOX(1)
 #define HANDOFF_DATA_EXTERNAL_DT   HANDOFF_DATA_BAREBOX(2)
 #define HANDOFF_DATA_BOARDDATA HANDOFF_DATA_BAREBOX(3)
+#define HANDOFF_DATA_EFI   HANDOFF_DATA_BAREBOX(4)
 
 #define HANDOFF_DATA_BOARD(n)  (0x951726fb + (n))
 
-- 
2.39.2




[PATCH 0/4] make more use of handoff data

2024-05-21 Thread Sascha Hauer
struct boarddata is a mechanism to pass a ARM machine number from PBL to
barebox proper. The EFI payload also uses it to pass some custom
pointers to barebox proper. handoff data was created for exactly this
purpose, so retire boarddata and use handoff data instead.

@afa, the efi patch is compile tested only. Could you give it a try?

Sascha

Sascha Hauer (4):
  handoff-data: put handoff data into data section
  efi-payload: use handoff data to pass data to barebox proper
  ARM: beagle: setup C environment early
  ARM: replace boarddata with handoff data

 arch/arm/boards/beagle/lowlevel.c |  9 ++--
 arch/arm/boards/chumby_falconwing/lowlevel.c  |  7 +--
 .../boards/crystalfontz-cfa10036/lowlevel.c   |  7 +--
 arch/arm/boards/freescale-mx23-evk/lowlevel.c |  7 +--
 arch/arm/boards/imx233-olinuxino/lowlevel.c   |  7 +--
 arch/arm/boards/karo-tx28/lowlevel.c  |  7 +--
 arch/arm/cpu/start.c  | 20 +++-
 arch/arm/cpu/uncompress.c |  3 --
 arch/arm/include/asm/barebox-arm.h| 24 -
 efi/payload/boarddata.c   | 12 +++--
 efi/payload/entry-multi.c | 16 +++---
 include/boarddata.h   | 49 ---
 include/efi/efi-payload.h |  5 ++
 include/pbl/handoff-data.h| 21 
 pbl/handoff-data.c|  6 +--
 15 files changed, 64 insertions(+), 136 deletions(-)
 delete mode 100644 include/boarddata.h

-- 
2.39.2




[PATCH 4/4] ARM: replace boarddata with handoff data

2024-05-21 Thread Sascha Hauer
struct boarddata can be used to pass a ARM machine number from PBL to
barebox proper. Now that we have handoff data for this purpose, retire
struct boarddata and use handoff data instead.

Signed-off-by: Sascha Hauer 
---
 arch/arm/boards/beagle/lowlevel.c |  6 +--
 arch/arm/boards/chumby_falconwing/lowlevel.c  |  7 +--
 .../boards/crystalfontz-cfa10036/lowlevel.c   |  7 +--
 arch/arm/boards/freescale-mx23-evk/lowlevel.c |  7 +--
 arch/arm/boards/imx233-olinuxino/lowlevel.c   |  7 +--
 arch/arm/boards/karo-tx28/lowlevel.c  |  7 +--
 arch/arm/cpu/start.c  | 20 +++--
 arch/arm/cpu/uncompress.c |  3 --
 arch/arm/include/asm/barebox-arm.h| 24 --
 include/boarddata.h   | 45 ---
 include/pbl/handoff-data.h|  2 +-
 pbl/handoff-data.c|  4 +-
 12 files changed, 31 insertions(+), 108 deletions(-)
 delete mode 100644 include/boarddata.h

diff --git a/arch/arm/boards/beagle/lowlevel.c 
b/arch/arm/boards/beagle/lowlevel.c
index 828c8c76b3..e7f76aca4e 100644
--- a/arch/arm/boards/beagle/lowlevel.c
+++ b/arch/arm/boards/beagle/lowlevel.c
@@ -164,11 +164,9 @@ static void sdrc_init(void)
 
 static noinline int beagle_board_init_sdram(void)
 {
-   struct barebox_arm_boarddata *bd = (void *)OMAP3_SRAM_SCRATCH_SPACE + 
0x10;
+   handoff_add_arm_machine(MACH_TYPE_OMAP3_BEAGLE);
 
-   boarddata_create(bd, MACH_TYPE_OMAP3_BEAGLE);
-
-   barebox_arm_entry(0x8000, SZ_128M, bd);
+   barebox_arm_entry(0x8000, SZ_128M, NULL);
 }
 
 ENTRY_FUNCTION(start_omap3_beagleboard_sdram, bootinfo, r1, r2)
diff --git a/arch/arm/boards/chumby_falconwing/lowlevel.c 
b/arch/arm/boards/chumby_falconwing/lowlevel.c
index fdda6ba5f2..e823767739 100644
--- a/arch/arm/boards/chumby_falconwing/lowlevel.c
+++ b/arch/arm/boards/chumby_falconwing/lowlevel.c
@@ -9,12 +9,9 @@
 
 static noinline void continue_imx_entry(size_t size)
 {
-   static struct barebox_arm_boarddata boarddata = {
-   .magic = BAREBOX_ARM_BOARDDATA_MAGIC,
-   .machine = MACH_TYPE_CHUMBY,
-   };
+   handoff_add_arm_machine(MACH_TYPE_CHUMBY);
 
-   barebox_arm_entry(IMX_MEMORY_BASE, size, );
+   barebox_arm_entry(IMX_MEMORY_BASE, size, NULL);
 }
 
 ENTRY_FUNCTION(start_chumby_falconwing, r0, r1, r2)
diff --git a/arch/arm/boards/crystalfontz-cfa10036/lowlevel.c 
b/arch/arm/boards/crystalfontz-cfa10036/lowlevel.c
index 447ef0dc66..2468f304e7 100644
--- a/arch/arm/boards/crystalfontz-cfa10036/lowlevel.c
+++ b/arch/arm/boards/crystalfontz-cfa10036/lowlevel.c
@@ -9,12 +9,9 @@
 
 static noinline void continue_imx_entry(size_t size)
 {
-   static struct barebox_arm_boarddata boarddata = {
-   .magic = BAREBOX_ARM_BOARDDATA_MAGIC,
-   .machine = MACH_TYPE_CFA10036,
-   };
+   handoff_add_arm_machine(MACH_TYPE_CFA10036);
 
-   barebox_arm_entry(IMX_MEMORY_BASE, size, );
+   barebox_arm_entry(IMX_MEMORY_BASE, size, NULL);
 }
 
 ENTRY_FUNCTION(start_cfa10036, r0, r1, r2)
diff --git a/arch/arm/boards/freescale-mx23-evk/lowlevel.c 
b/arch/arm/boards/freescale-mx23-evk/lowlevel.c
index 195ade3a7f..2f31b4fd0c 100644
--- a/arch/arm/boards/freescale-mx23-evk/lowlevel.c
+++ b/arch/arm/boards/freescale-mx23-evk/lowlevel.c
@@ -9,12 +9,9 @@
 
 static noinline void continue_imx_entry(size_t size)
 {
-   static struct barebox_arm_boarddata boarddata = {
-   .magic = BAREBOX_ARM_BOARDDATA_MAGIC,
-   .machine = MACH_TYPE_MX23EVK,
-   };
+   handoff_add_arm_machine(MACH_TYPE_MX23EVK);
 
-   barebox_arm_entry(IMX_MEMORY_BASE, size, );
+   barebox_arm_entry(IMX_MEMORY_BASE, size, NULL);
 }
 
 ENTRY_FUNCTION(start_imx23_evk, r0, r1, r2)
diff --git a/arch/arm/boards/imx233-olinuxino/lowlevel.c 
b/arch/arm/boards/imx233-olinuxino/lowlevel.c
index 91c1ba3dba..e4b6b1207f 100644
--- a/arch/arm/boards/imx233-olinuxino/lowlevel.c
+++ b/arch/arm/boards/imx233-olinuxino/lowlevel.c
@@ -13,12 +13,9 @@
 
 static noinline void continue_imx_entry(size_t size)
 {
-   static struct barebox_arm_boarddata boarddata = {
-   .magic = BAREBOX_ARM_BOARDDATA_MAGIC,
-   .machine = MACH_TYPE_IMX233_OLINUXINO,
-   };
+   handoff_add_arm_machine(MACH_TYPE_IMX233_OLINUXINO);
 
-   barebox_arm_entry(IMX_MEMORY_BASE, size, );
+   barebox_arm_entry(IMX_MEMORY_BASE, size, NULL);
 }
 
 ENTRY_FUNCTION(start_barebox_olinuxino_imx23, r0, r1, r2)
diff --git a/arch/arm/boards/karo-tx28/lowlevel.c 
b/arch/arm/boards/karo-tx28/lowlevel.c
index 3be5f521e1..e423d5ecab 100644
--- a/arch/arm/boards/karo-tx28/lowlevel.c
+++ b/arch/arm/boards/karo-tx28/lowlevel.c
@@ -17,12 +17,9 @@
 
 static noinline void continue_imx_entry(size_t size)
 {
-   static struct barebox_arm_boarddata boarddata = {
-   .magic = BAREBOX_ARM_BOARDDATA_MAGIC,
-   .machine

Re: [PATCH master 1/2] ARM: cpu: start: align uncompressed DTB size to 4 bytes

2024-05-21 Thread Sascha Hauer


On Fri, 17 May 2024 08:22:24 +0200, Ahmad Fatoum wrote:
> KASAN reports that decompression exceeds the bounds of the allocation
> and my DT size isn't 4-bytes aligned. Align the allocation size to fix
> this.
> 
> 

Applied, thanks!

[1/2] ARM: cpu: start: align uncompressed DTB size to 4 bytes
  https://git.pengutronix.de/cgit/barebox/commit/?id=ce38eef3c056 (link may 
not be stable)
[2/2] RISC-V: start: align uncompressed DTB size to 4 bytes
  https://git.pengutronix.de/cgit/barebox/commit/?id=249164bc555f (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH v2 0/6] add PBL handoff-data support

2024-05-21 Thread Sascha Hauer


On Fri, 17 May 2024 08:45:05 +0200, Ahmad Fatoum wrote:
> This series replaces the 3 patches from v1 that are in next.
> 
> The first 3 patches are new: They ensure that the handoff structs
> (linked list pointers, cookie, flags, ...) are also reserved in the
> SDRAM banks and not only the data.
> 
> The three patches after that differ to v1 mainly in that reservation
> of space for the handoff data is correctly taken care of. This was
> erroneous both in PBL and in barebox proper and led to problems for me
> trying to boot a Qemu Virt64 machine that has for some reason a FDT that
> describes its size in the header as 1MiB.
> 
> [...]

Applied, thanks!

[1/6] memory: add support for requesting barebox area as a whole
  https://git.pengutronix.de/cgit/barebox/commit/?id=59289e3d8cc3 (link may 
not be stable)
[2/6] treewide: use request_barebox_region for possible barebox memory regions
  https://git.pengutronix.de/cgit/barebox/commit/?id=64fa27a491b8 (link may 
not be stable)
[3/6] ARM: cpu: start: register barebox memory area
  https://git.pengutronix.de/cgit/barebox/commit/?id=3f7b6146669c (link may 
not be stable)
[4/6] ARM: move blob_is_arm_boarddata() to include
  https://git.pengutronix.de/cgit/barebox/commit/?id=fad13ab1cdc6 (link may 
not be stable)
[5/6] add handoff-data support
  https://git.pengutronix.de/cgit/barebox/commit/?id=e72ea06e3ad3 (link may 
not be stable)
[6/6] ARM: pass handoff data from PBL to proper
  https://git.pengutronix.de/cgit/barebox/commit/?id=b02063a8aa22 (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH master 1/2] ARM: document PBL barebox memory layout

2024-05-21 Thread Sascha Hauer


On Fri, 17 May 2024 08:10:56 +0200, Ahmad Fatoum wrote:
> Apparently, we have an overlap between ramoops/barebox proper
> and the early malloc area. Before fixing that, let's add a diagram
> explaining the current state of affairs.
> 
> 

Applied, thanks!

[1/2] ARM: document PBL barebox memory layout
  https://git.pengutronix.de/cgit/barebox/commit/?id=c9af0d2b5e57 (link may 
not be stable)
[2/2] ARM: fix overlap between ramoops area and early malloc area
  https://git.pengutronix.de/cgit/barebox/commit/?id=d1cc8a4045a0 (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH master] filetype: fix OOB read when detecting type of truncated kernel images

2024-05-21 Thread Sascha Hauer


On Fri, 17 May 2024 09:47:35 +0200, Ahmad Fatoum wrote:
> The ARM and RISC-V kernel Image format features a 64-byte header and
> places the 32-bit magic value identifying it at offset 56.
> 
> The check for the magic values should thus ensure that at least 56 bytes
> are guaranteed to be available in the buffer, thus move it into
> the >= 64 byte segment of the function.
> 
> [...]

Applied, thanks!

[1/1] filetype: fix OOB read when detecting type of truncated kernel images
  https://git.pengutronix.de/cgit/barebox/commit/?id=0b12b757feaa (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH 1/2] images: sha_sum: mark as not needing executable stack

2024-05-21 Thread Sascha Hauer


On Fri, 17 May 2024 09:47:53 +0200, Ahmad Fatoum wrote:
> The hash section contains only data, so add a note that an executable
> stack is not needed. This will suppress a warning when we start using
> this on sandbox.
> 
> 

Applied, thanks!

[1/2] images: sha_sum: mark as not needing executable stack
  https://git.pengutronix.de/cgit/barebox/commit/?id=320b72bfc91b (link may 
not be stable)
[2/2] x86: lib: setjmp: mark as not needing executable stack
  https://git.pengutronix.de/cgit/barebox/commit/?id=628e7d6e5d1c (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH 5/7] regulator: of_regulator: remove unused allocation

2024-05-21 Thread Sascha Hauer
On Fri, May 17, 2024 at 09:48:22AM +0200, Ahmad Fatoum wrote:
> We leak this allocation, but we don't actually need it, so drop it.
> 
> Signed-off-by: Ahmad Fatoum 
> ---
>  drivers/regulator/of_regulator.c | 6 --
>  1 file changed, 6 deletions(-)
> 
> diff --git a/drivers/regulator/of_regulator.c 
> b/drivers/regulator/of_regulator.c
> index 10f75a4f1c60..c037f85c439d 100644
> --- a/drivers/regulator/of_regulator.c
> +++ b/drivers/regulator/of_regulator.c
> @@ -41,16 +41,10 @@ int of_regulator_match(struct device *dev, struct 
> device_node *node,
>   unsigned int i;
>   const char *name;
>   struct device_node *child;
> - struct devm_of_regulator_matches *devm_matches;
>  
>   if (!dev || !node)
>   return -EINVAL;
>  
> - devm_matches = xzalloc(sizeof(struct devm_of_regulator_matches));
> -
> - devm_matches->matches = matches;
> - devm_matches->num_matches = num_matches;
> -

Removed the definition of struct devm_of_regulator_matches along with
this patch.

Sascha

>   for (i = 0; i < num_matches; i++) {
>   struct of_regulator_match *match = [i];
>   match->of_node = NULL;
> -- 
> 2.39.2
> 
> 
> 

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



Re: [PATCH 1/7] of: free unflattened overlays after application

2024-05-21 Thread Sascha Hauer


On Fri, 17 May 2024 09:48:18 +0200, Ahmad Fatoum wrote:
> of_unflatten_dtb allocates an unflattened tree and of_overlay_apply_tree
> copies it into another tree. The unflattened tree is then usually
> leaked. Add a function that takes care of these two steps and then frees
> the tree.
> 
> 

Applied, thanks!

[1/7] of: free unflattened overlays after application
  https://git.pengutronix.de/cgit/barebox/commit/?id=21598db0d106 (link may 
not be stable)
[2/7] of: overlay: do not leak fixed up path
  https://git.pengutronix.de/cgit/barebox/commit/?id=92b4598183fb (link may 
not be stable)
[3/7] test: self: digest: don't leak digest buffers
  https://git.pengutronix.de/cgit/barebox/commit/?id=920740d28004 (link may 
not be stable)
[4/7] test: self: ramfs: fix memory leak
  https://git.pengutronix.de/cgit/barebox/commit/?id=3451af15b4cb (link may 
not be stable)
[5/7] regulator: of_regulator: remove unused allocation
  https://git.pengutronix.de/cgit/barebox/commit/?id=ae990b192979 (link may 
not be stable)
[6/7] globalvar: fix memory leak
  https://git.pengutronix.de/cgit/barebox/commit/?id=4dcae371c292 (link may 
not be stable)
[7/7] power: reset: reboot-mode: fix memory leak
  https://git.pengutronix.de/cgit/barebox/commit/?id=22f770fb9041 (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH 1/2] FIT: fix build with sandbox

2024-05-21 Thread Sascha Hauer


On Fri, 17 May 2024 09:48:34 +0200, Ahmad Fatoum wrote:
> As FIT is built only for ARM so far, this sandbox-related code has
> bitrotted. To prepare allowing it to build for other platforms, adjust
> the API to the current state.
> 
> 

Applied, thanks!

[1/2] FIT: fix build with sandbox
  https://git.pengutronix.de/cgit/barebox/commit/?id=9f82a33c178e (link may 
not be stable)
[2/2] common: fit: don't have BOOTM_FITIMAGE depend on ARM
  https://git.pengutronix.de/cgit/barebox/commit/?id=09201c7dd960 (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH] pbl: compile PBL decompression code optionally

2024-05-21 Thread Sascha Hauer


On Fri, 17 May 2024 09:48:43 +0200, Ahmad Fatoum wrote:
> There's no point in compiling PBL decompression code when
> CONFIG_HAVE_IMAGE_COMPRESSION is not selected, so reflect that in Kbuild
> to save some build time.
> 
> 

Applied, thanks!

[1/1] pbl: compile PBL decompression code optionally
  https://git.pengutronix.de/cgit/barebox/commit/?id=05cc671bbebb (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH] sandbox: enable frame pointers unconditionally

2024-05-21 Thread Sascha Hauer


On Fri, 17 May 2024 09:48:51 +0200, Ahmad Fatoum wrote:
> We have no size constraints on sandbox, so enable frame pointers for
> easier debugging.
> 
> 

Applied, thanks!

[1/1] sandbox: enable frame pointers unconditionally
  https://git.pengutronix.de/cgit/barebox/commit/?id=df68faf5b855 (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH] treewide: use an unsigned type for ioctl commands

2024-05-21 Thread Sascha Hauer


On Fri, 17 May 2024 09:49:00 +0200, Ahmad Fatoum wrote:
> Linux & BSD define the ioctl command parameter to be always unsigned.
> POSIX differs and uses a signed integer instead, but as we are importing
> Linux code, it makes sense to use the same signedness to avoid false
> positive warnings about sign-extended constants that get truncated.
> 
> 

Applied, thanks!

[1/1] treewide: use an unsigned type for ioctl commands
  https://git.pengutronix.de/cgit/barebox/commit/?id=d9c9b317673d (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH 0/8] kconfig: cut down on duplication with merged defconfigs

2024-05-21 Thread Sascha Hauer


On Fri, 17 May 2024 15:26:48 +0200, Ahmad Fatoum wrote:
> We currently use scripts/kconfig/merge_config.sh only in MAKEALL.
> Linux has been using it inside Kbuild as well to derive new defconfigs
> from the existing ones that differ only by a few options, e.g. to enable
> virtualization or to switch endianness.
> 
> This is useful for us in barebox as well to cut down on the number of
> configs and to avoid bitrot in the less used ones, e.g. a lot of AT91
> configs can probably be replaced with two lines in mach-at91/Makefile
> each this way and e.g. x86 defconfig could have a virtio.defconfig for
> use with Qemu.
> 
> [...]

Applied, thanks!

[1/8] test: move common config fragments into common/boards/configs
  https://git.pengutronix.de/cgit/barebox/commit/?id=2f186d23e1d3 (link may 
not be stable)
[2/8] kconfig: merge_config.sh: sync with Linux v6.9
  https://git.pengutronix.de/cgit/barebox/commit/?id=0097b2cd7b51 (link may 
not be stable)
[3/8] kbuild: add support for merged defconfigs
  https://git.pengutronix.de/cgit/barebox/commit/?id=520af236cb7c (link may 
not be stable)
[4/8] MIPS: make use of merged defconfigs
  https://git.pengutronix.de/cgit/barebox/commit/?id=fb1007c0343a (link may 
not be stable)
[5/8] sandbox: stdio: fix ctrlc link error when CONFIG_CONSOLE_NONE=y
  https://git.pengutronix.de/cgit/barebox/commit/?id=c71726d70bf4 (link may 
not be stable)
[6/8] net: fix build with CONFIG_SHELL_NONE
  https://git.pengutronix.de/cgit/barebox/commit/?id=bcccae97ac40 (link may 
not be stable)
[7/8] power: reset: reboot-mode: fix link error without globalvar
  https://git.pengutronix.de/cgit/barebox/commit/?id=bf80cd13fa5c (link may 
not be stable)
[8/8] sandbox: add headless_defconfig
  https://git.pengutronix.de/cgit/barebox/commit/?id=15af24567132 (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH 0/7] replace cdev_by_name() with cdev_open_by_name()

2024-05-21 Thread Sascha Hauer


On Thu, 16 May 2024 09:08:15 +0200, Sascha Hauer wrote:
> As Ahmad noticed cdev_by_name() doesn't increase the reference counting
> on the returned cdev which causes problems further down the road. This
> series replaces some of the easier occurences of cdev_by_name() with
> cdev_open_by_name().
> 
> Sascha Hauer (7):
>   ARM: Freescale i.MX23 evk: use cdev_open_by_name()
>   ARM: tx28: use cdev_open_by_name()
>   ARM: omap: use cdev_open_by_name()
>   ARM: Rockchip: use cdev_open_by_name()
>   commands: devlookup: use cdev_open_by_name()
>   commands: findmnt: use cdev_open_by_name()
>   bootm: use cdev_open_by_name()
> 
> [...]

Applied, thanks!

[1/7] ARM: Freescale i.MX23 evk: use cdev_open_by_name()
  https://git.pengutronix.de/cgit/barebox/commit/?id=3111bf9b13d2 (link may 
not be stable)
[2/7] ARM: tx28: use cdev_open_by_name()
  https://git.pengutronix.de/cgit/barebox/commit/?id=05164ce75799 (link may 
not be stable)
[3/7] ARM: omap: use cdev_open_by_name()
  https://git.pengutronix.de/cgit/barebox/commit/?id=50788af27a89 (link may 
not be stable)
[4/7] ARM: Rockchip: use cdev_open_by_name()
  https://git.pengutronix.de/cgit/barebox/commit/?id=9da41e4d65fc (link may 
not be stable)
[5/7] commands: devlookup: use cdev_open_by_name()
  https://git.pengutronix.de/cgit/barebox/commit/?id=bc5868b647aa (link may 
not be stable)
[6/7] commands: findmnt: use cdev_open_by_name()
  https://git.pengutronix.de/cgit/barebox/commit/?id=7aa92b02b84a (link may 
not be stable)
[7/7] bootm: use cdev_open_by_name()
  https://git.pengutronix.de/cgit/barebox/commit/?id=888a17fa7e95 (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH 0/7] replace cdev_by_name() with cdev_open_by_name()

2024-05-16 Thread Sascha Hauer
On Thu, May 16, 2024 at 04:43:04PM +0200, Marco Felsch wrote:
> Hi Sascha,
> 
> On 24-05-16, Sascha Hauer wrote:
> > As Ahmad noticed cdev_by_name() doesn't increase the reference counting
> > on the returned cdev which causes problems further down the road. This
> > series replaces some of the easier occurences of cdev_by_name() with
> > cdev_open_by_name().
> 
> Can we kindly inform the user with a print_once() or so that
> cdev_by_name should be replaced with cdev_open_by_name()?

Some of the call sites of cdev_by_name() are used frequently on all
boards, so this wouldn't be practical.

Sascha

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



Re: [PATCH] ARM: socfpga-xload_*defconfig: merge and disable unused features

2024-05-16 Thread Sascha Hauer


On Thu, 16 May 2024 12:10:52 +0200, Sascha Hauer wrote:
> The socfpga-xload_*defconfig have MC13xxx, AT25 and SPI support enabled.
> Disable these as they are unused. This makes the configs small enough so
> that we can merge the two existing configs into one.
> 
> 

Applied, thanks!

[1/1] ARM: socfpga-xload_*defconfig: merge and disable unused features
  https://git.pengutronix.de/cgit/barebox/commit/?id=d4f47a86f197 (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




[PATCH] ARM: socfpga-xload_*defconfig: merge and disable unused features

2024-05-16 Thread Sascha Hauer
The socfpga-xload_*defconfig have MC13xxx, AT25 and SPI support enabled.
Disable these as they are unused. This makes the configs small enough so
that we can merge the two existing configs into one.

Signed-off-by: Sascha Hauer 
---
 arch/arm/configs/socfpga-xload-2_defconfig | 28 --
 arch/arm/configs/socfpga-xload_defconfig   |  9 +++
 2 files changed, 5 insertions(+), 32 deletions(-)
 delete mode 100644 arch/arm/configs/socfpga-xload-2_defconfig

diff --git a/arch/arm/configs/socfpga-xload-2_defconfig 
b/arch/arm/configs/socfpga-xload-2_defconfig
deleted file mode 100644
index 78b07aae5b..00
--- a/arch/arm/configs/socfpga-xload-2_defconfig
+++ /dev/null
@@ -1,28 +0,0 @@
-CONFIG_ARCH_SOCFPGA=y
-CONFIG_ARCH_SOCFPGA_XLOAD=y
-CONFIG_MACH_SOCFPGA_ALTERA_SOCDK=y
-CONFIG_MACH_SOCFPGA_TERASIC_DE0_NANO_SOC=y
-CONFIG_MACH_SOCFPGA_TERASIC_DE10_NANO=y
-CONFIG_THUMB2_BAREBOX=y
-CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y
-# CONFIG_ARM_EXCEPTIONS is not set
-# CONFIG_MEMINFO is not set
-CONFIG_MMU=y
-CONFIG_MALLOC_SIZE=0x0
-CONFIG_MALLOC_DUMMY=y
-CONFIG_RELOCATABLE=y
-CONFIG_SHELL_NONE=y
-# CONFIG_ERRNO_MESSAGES is not set
-# CONFIG_TIMESTAMP is not set
-CONFIG_DRIVER_SERIAL_NS16550=y
-CONFIG_MCI=y
-CONFIG_MCI_STARTUP=y
-# CONFIG_MCI_WRITE is not set
-CONFIG_MCI_DW=y
-CONFIG_MFD_MC13XXX=y
-CONFIG_EEPROM_AT25=y
-# CONFIG_FS_RAMFS is not set
-# CONFIG_FS_DEVFS is not set
-CONFIG_FS_FAT=y
-CONFIG_BOOTSTRAP=y
-CONFIG_BOOTSTRAP_DISK=y
diff --git a/arch/arm/configs/socfpga-xload_defconfig 
b/arch/arm/configs/socfpga-xload_defconfig
index 008ba64865..37e9ecec71 100644
--- a/arch/arm/configs/socfpga-xload_defconfig
+++ b/arch/arm/configs/socfpga-xload_defconfig
@@ -1,6 +1,9 @@
 CONFIG_ARCH_SOCFPGA=y
 CONFIG_ARCH_SOCFPGA_XLOAD=y
+CONFIG_MACH_SOCFPGA_ALTERA_SOCDK=y
 CONFIG_MACH_SOCFPGA_EBV_SOCRATES=y
+CONFIG_MACH_SOCFPGA_TERASIC_DE0_NANO_SOC=y
+CONFIG_MACH_SOCFPGA_TERASIC_DE10_NANO=y
 CONFIG_MACH_SOCFPGA_TERASIC_SOCKIT=y
 CONFIG_THUMB2_BAREBOX=y
 CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y
@@ -9,17 +12,15 @@ CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y
 CONFIG_MMU=y
 CONFIG_MALLOC_SIZE=0x0
 CONFIG_MALLOC_DUMMY=y
-CONFIG_RELOCATABLE=y
 CONFIG_SHELL_NONE=y
 # CONFIG_ERRNO_MESSAGES is not set
-# CONFIG_TIMESTAMP is not set
 CONFIG_DRIVER_SERIAL_NS16550=y
+# CONFIG_SPI is not set
 CONFIG_MCI=y
 CONFIG_MCI_STARTUP=y
 # CONFIG_MCI_WRITE is not set
 CONFIG_MCI_DW=y
-CONFIG_MFD_MC13XXX=y
-CONFIG_EEPROM_AT25=y
+# CONFIG_VIRTIO_MENU is not set
 # CONFIG_FS_RAMFS is not set
 # CONFIG_FS_DEVFS is not set
 CONFIG_FS_FAT=y
-- 
2.39.2




Re: [PATCH] common: boards: wolfvision: use state_by_alias instead of opencoding

2024-05-16 Thread Sascha Hauer


On Wed, 15 May 2024 08:07:36 +0200, Ahmad Fatoum wrote:
> This introduces no functional change, but makes code a bit more compact.
> 
> 

Applied, thanks!

[1/1] common: boards: wolfvision: use state_by_alias instead of opencoding
  https://git.pengutronix.de/cgit/barebox/commit/?id=6b1df8b8219d (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH master 1/2] list: fix CONFIG_DEBUG_LIST link failure in PBL

2024-05-16 Thread Sascha Hauer
On Wed, May 15, 2024 at 08:07:57AM +0200, Ahmad Fatoum wrote:
> With the addition of PBL handoff data, we now use  in PBL.
> This works fine with CONFIG_DEBUG_LIST disabled, because all functions are
> inlined, but when building with the option enabled, references to the
> out-of-line sanity checking functions breaks the build.
> 
> Fix this by omitting these references when building for PBL.
> 
> Signed-off-by: Ahmad Fatoum 
> ---
>  include/linux/list.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/linux/list.h b/include/linux/list.h
> index 2b3a39ea81e8..e47a8188e807 100644
> --- a/include/linux/list.h
> +++ b/include/linux/list.h
> @@ -36,7 +36,7 @@ static inline void INIT_LIST_HEAD(struct list_head *list)
>   list->prev = list;
>  }
>  
> -#ifdef CONFIG_DEBUG_LIST
> +#if defined(CONFIG_DEBUG_LIST) && !defined(__PBL__)
>  extern bool __list_add_valid_or_report(struct list_head *new,
>  struct list_head *prev,
>  struct list_head *next);

What about compiling list_debug.o for PBL as well?

Sascha

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



Re: [PATCH master 1/3] cdev: return error code from cdev_close

2024-05-16 Thread Sascha Hauer


On Wed, 15 May 2024 10:05:05 +0200, Ahmad Fatoum wrote:
> cdev_operations::close can fail and thus cdev_close should pass along
> the error code to the users instead of discarding it.
> 
> Do that, so users like devfs close() can start propagating this error.
> 
> 

Applied, thanks!

[1/3] cdev: return error code from cdev_close
  https://git.pengutronix.de/cgit/barebox/commit/?id=490dab2db018 (link may 
not be stable)
[2/3] fs: devfs: restore cdev reference count maintenance
  https://git.pengutronix.de/cgit/barebox/commit/?id=dd6ac1612b4b (link may 
not be stable)
[3/3] partition: reparse tables only if CONFIG_PARTITION_MANIPULATION=y
  https://git.pengutronix.de/cgit/barebox/commit/?id=dfdfc732ba6f (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




[PATCH 3/7] ARM: omap: use cdev_open_by_name()

2024-05-16 Thread Sascha Hauer
cdev_by_name() returns a cdev without increasing its reference count. In
order to maintain a proper reference counting use cdev_open_by_name()
instead and make sure it's closed afterwards when no longer needed.

Signed-off-by: Sascha Hauer 
---
 arch/arm/mach-omap/omap_generic.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-omap/omap_generic.c 
b/arch/arm/mach-omap/omap_generic.c
index 99e14fb540..112c806216 100644
--- a/arch/arm/mach-omap/omap_generic.c
+++ b/arch/arm/mach-omap/omap_generic.c
@@ -157,13 +157,16 @@ static int omap_env_init(void)
 
device_detect_by_name(diskdev);
partname = basprintf("%s.0", diskdev);
-   cdev = cdev_by_name(partname);
+   cdev = cdev_open_by_name(partname, O_RDONLY);
if (cdev == NULL) {
pr_err("Failed to get device %s\n", partname);
goto out;
}
 
rootpath = cdev_mount_default(cdev, NULL);
+
+   cdev_close(cdev);
+
if (IS_ERR(rootpath)) {
pr_err("Failed to load environment: mount %s failed (%ld)\n",
cdev->name, PTR_ERR(rootpath));
-- 
2.39.2




[PATCH 0/7] replace cdev_by_name() with cdev_open_by_name()

2024-05-16 Thread Sascha Hauer
As Ahmad noticed cdev_by_name() doesn't increase the reference counting
on the returned cdev which causes problems further down the road. This
series replaces some of the easier occurences of cdev_by_name() with
cdev_open_by_name().

Sascha Hauer (7):
  ARM: Freescale i.MX23 evk: use cdev_open_by_name()
  ARM: tx28: use cdev_open_by_name()
  ARM: omap: use cdev_open_by_name()
  ARM: Rockchip: use cdev_open_by_name()
  commands: devlookup: use cdev_open_by_name()
  commands: findmnt: use cdev_open_by_name()
  bootm: use cdev_open_by_name()

 arch/arm/boards/freescale-mx23-evk/mx23-evk.c | 13 +++--
 arch/arm/boards/karo-tx28/tx28-stk5.c | 13 -
 arch/arm/mach-omap/omap_generic.c |  5 -
 arch/arm/mach-rockchip/bbu.c  |  8 +++-
 commands/devlookup.c  | 15 ++-
 commands/findmnt.c|  3 ++-
 common/bootm.c|  5 -
 7 files changed, 42 insertions(+), 20 deletions(-)

-- 
2.39.2




[PATCH 2/7] ARM: tx28: use cdev_open_by_name()

2024-05-16 Thread Sascha Hauer
cdev_by_name() returns a cdev without increasing its reference count. In
order to maintain a proper reference counting use cdev_open_by_name()
instead and make sure it's closed afterwards when no longer needed.

Signed-off-by: Sascha Hauer 
---
 arch/arm/boards/karo-tx28/tx28-stk5.c | 13 -
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/arch/arm/boards/karo-tx28/tx28-stk5.c 
b/arch/arm/boards/karo-tx28/tx28-stk5.c
index d1fd526c00..01a14a33a3 100644
--- a/arch/arm/boards/karo-tx28/tx28-stk5.c
+++ b/arch/arm/boards/karo-tx28/tx28-stk5.c
@@ -310,20 +310,21 @@ static const uint32_t tx28_starterkit_pad_setup[] = {
  */
 static int register_persistent_environment(void)
 {
-   struct cdev *cdev;
+   struct cdev *cdev, *env;
 
/*
 * The TX28 STK5 has only one usable MCI card socket.
 * So, we expect its name as "disk0".
 */
-   cdev = cdev_by_name("disk0");
+   cdev = cdev_open_by_name("disk0", O_RDONLY);
if (cdev == NULL) {
pr_err("No MCI card preset\n");
return -ENODEV;
}
+   cdev_close(cdev);
 
/* MCI card is present, also a usable partition on it? */
-   cdev = cdev_by_name("disk0.1");
+   cdev = cdev_open_by_name("disk0.1", O_RDONLY);
if (cdev == NULL) {
pr_err("No second partition available\n");
pr_info("Please create at least a second partition with"
@@ -332,9 +333,11 @@ static int register_persistent_environment(void)
}
 
/* use the full partition as our persistent environment storage */
-   cdev = devfs_add_partition("disk0.1", 0, cdev->size,
+   env = devfs_add_partition("disk0.1", 0, cdev->size,
DEVFS_PARTITION_FIXED, "env0");
-   return PTR_ERR_OR_ZERO(cdev);
+   cdev_close(cdev);
+
+   return PTR_ERR_OR_ZERO(env);
 }
 
 static void tx28_get_ethaddr(void)
-- 
2.39.2




[PATCH 6/7] commands: findmnt: use cdev_open_by_name()

2024-05-16 Thread Sascha Hauer
cdev_by_name() returns a cdev without increasing its reference count. In
order to maintain a proper reference counting use cdev_open_by_name()
instead and make sure it's closed afterwards when no longer needed.

Signed-off-by: Sascha Hauer 
---
 commands/findmnt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/commands/findmnt.c b/commands/findmnt.c
index da8f58835f..3c9a520b85 100644
--- a/commands/findmnt.c
+++ b/commands/findmnt.c
@@ -71,7 +71,7 @@ static int do_findmnt(int argc, char *argv[])
const char *backingstore;
struct cdev *cdev;
 
-   cdev = cdev_by_name(devpath_to_name(device));
+   cdev = cdev_open_by_name(devpath_to_name(device), 
O_RDONLY);
if (!cdev)
continue;
 
@@ -82,6 +82,7 @@ static int do_findmnt(int argc, char *argv[])
print_header(_printed);
report_findmnt(target);
}
+   cdev_close(cdev);
}
}
 
-- 
2.39.2




[PATCH 5/7] commands: devlookup: use cdev_open_by_name()

2024-05-16 Thread Sascha Hauer
cdev_by_name() returns a cdev without increasing its reference count. In
order to maintain a proper reference counting use cdev_open_by_name()
instead and make sure it's closed afterwards when no longer needed.

Signed-off-by: Sascha Hauer 
---
 commands/devlookup.c | 15 ++-
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/commands/devlookup.c b/commands/devlookup.c
index ffd6afbaba..bc9bd94614 100644
--- a/commands/devlookup.c
+++ b/commands/devlookup.c
@@ -25,7 +25,7 @@ static int do_devlookup(int argc, char *argv[])
 {
const char *variable = NULL, *devicefile, *paramname;
struct cdev *cdev;
-   int opt;
+   int opt, ret;
 
while ((opt = getopt(argc, argv, "v:")) > 0) {
switch(opt) {
@@ -43,7 +43,7 @@ static int do_devlookup(int argc, char *argv[])
 
devicefile = devpath_to_name(devicefile);
 
-   cdev = cdev_by_name(devicefile);
+   cdev = cdev_open_by_name(devicefile, O_RDONLY);
if (!cdev) {
printf("devlookup: cdev %s not found\n", devicefile);
return -ENOENT;
@@ -51,13 +51,18 @@ static int do_devlookup(int argc, char *argv[])
 
if (!cdev->dev) {
printf("devlookup: cdev %s not associated with a device\n", 
devicefile);
-   return -ENODEV;
+   ret = -ENODEV;
+   goto out;
}
 
if (paramname)
-   return report(variable, dev_get_param(cdev->dev, paramname));
+   ret = report(variable, dev_get_param(cdev->dev, paramname));
+   else
+   ret = report(variable, dev_name(cdev->dev));
+out:
+   cdev_close(cdev);
 
-   return report(variable, dev_name(cdev->dev));
+   return ret;
 }
 
 BAREBOX_CMD_HELP_START(devlookup)
-- 
2.39.2




[PATCH 1/7] ARM: Freescale i.MX23 evk: use cdev_open_by_name()

2024-05-16 Thread Sascha Hauer
cdev_by_name() returns a cdev without increasing its reference count. In
order to maintain a proper reference counting use cdev_open_by_name()
instead and make sure it's closed afterwards when no longer needed.

Signed-off-by: Sascha Hauer 
---
 arch/arm/boards/freescale-mx23-evk/mx23-evk.c | 13 +++--
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/arch/arm/boards/freescale-mx23-evk/mx23-evk.c 
b/arch/arm/boards/freescale-mx23-evk/mx23-evk.c
index d4de99eafb..b10a6e8dcd 100644
--- a/arch/arm/boards/freescale-mx23-evk/mx23-evk.c
+++ b/arch/arm/boards/freescale-mx23-evk/mx23-evk.c
@@ -52,22 +52,21 @@ static struct fsl_usb2_platform_data usb_pdata = {
  */
 static int register_persistent_environment(void)
 {
-   struct cdev *cdev;
+   struct cdev *cdev, *env;
 
/*
 * The imx23-olinuxino only has one MCI card socket.
 * So, we expect its name as "disk0".
 */
-   cdev = cdev_by_name("disk0");
+   cdev = cdev_open_by_name("disk0", O_RDONLY);
if (cdev == NULL) {
pr_err("No MCI card preset\n");
return -ENODEV;
}
-
-
+   cdev_close(cdev);
 
/* MCI card is present, also a useable partition on it? */
-   cdev = cdev_by_name("disk0.1");
+   cdev = cdev_open_by_name("disk0.1", O_RDONLY);
if (cdev == NULL) {
pr_err("No second partition available\n");
pr_info("Please create at least a second partition with"
@@ -76,8 +75,10 @@ static int register_persistent_environment(void)
}
 
/* use the full partition as our persistent environment storage */
-   cdev = devfs_add_partition("disk0.1", 0, cdev->size,
+   env = devfs_add_partition("disk0.1", 0, cdev->size,
DEVFS_PARTITION_FIXED, "env0");
+   cdev_close(cdev);
+
return PTR_ERR_OR_ZERO(cdev);
 }
 
-- 
2.39.2




[PATCH 7/7] bootm: use cdev_open_by_name()

2024-05-16 Thread Sascha Hauer
cdev_by_name() returns a cdev without increasing its reference count. In
order to maintain a proper reference counting use cdev_open_by_name()
instead and make sure it's closed afterwards when no longer needed.

Signed-off-by: Sascha Hauer 
---
 common/bootm.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/common/bootm.c b/common/bootm.c
index c851ab0456..357537c54e 100644
--- a/common/bootm.c
+++ b/common/bootm.c
@@ -760,7 +760,7 @@ int bootm_boot(struct bootm_data *bootm_data)
 
if (bootm_data->root_dev) {
const char *root_dev_name = 
devpath_to_name(bootm_data->root_dev);
-   const struct cdev *root_cdev = 
cdev_by_name(root_dev_name);
+   struct cdev *root_cdev = 
cdev_open_by_name(root_dev_name, O_RDONLY);
 
rootarg = cdev_get_linux_rootarg(root_cdev);
if (!rootarg) {
@@ -773,6 +773,9 @@ int bootm_boot(struct bootm_data *bootm_data)
pr_err("%s doesn't have a PARTUUID, 
cannot set root= option\n",
root_dev_name);
}
+
+   if (root_cdev)
+   cdev_close(root_cdev);
} else {
rootarg = path_get_linux_rootarg(data->os_file);
}
-- 
2.39.2




[PATCH 4/7] ARM: Rockchip: use cdev_open_by_name()

2024-05-16 Thread Sascha Hauer
cdev_by_name() returns a cdev without increasing its reference count. In
order to maintain a proper reference counting use cdev_open_by_name()
instead and make sure it's closed afterwards when no longer needed.

Signed-off-by: Sascha Hauer 
---
 arch/arm/mach-rockchip/bbu.c | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-rockchip/bbu.c b/arch/arm/mach-rockchip/bbu.c
index f15b32937c..7715540863 100644
--- a/arch/arm/mach-rockchip/bbu.c
+++ b/arch/arm/mach-rockchip/bbu.c
@@ -43,6 +43,7 @@ static int rockchip_bbu_mmc_handler(struct bbu_handler 
*handler,
int ret, fd, wr0, wr1;
loff_t space;
const char *cdevname;
+   struct cdev *cdev;
 
filetype = file_detect_type(data->image, data->len);
if (filetype != filetype_rockchip_rkns_image) {
@@ -60,7 +61,12 @@ static int rockchip_bbu_mmc_handler(struct bbu_handler 
*handler,
if (ret)
return ret;
 
-   space = cdev_unallocated_space(cdev_by_name(cdevname));
+   cdev = cdev_open_by_name(cdevname, O_RDONLY);
+   if (!cdev)
+   return -ENOENT;
+
+   space = cdev_unallocated_space(cdev);
+   cdev_close(cdev);
 
if (space < IMG_OFFSET_0 + data->len) {
if (!bbu_force(data, "Unallocated space on %s (%lld) is too 
small for one image\n",
-- 
2.39.2




Re: [PATCH master v2 0/3] Fixes for WolfVision board code library and PF5 mainboard code

2024-05-16 Thread Sascha Hauer


On Wed, 15 May 2024 12:35:54 +0200, Michael Riesch wrote:
> Habidere,
> 
> This series is a follow-up to
> https://lore.barebox.org/barebox/20240412-feature-wolfvision-pf5-v2-0-7e277cc88...@wolfvision.net/
> and fixes a few things. I tried to reply to said thread and announce a
> v3, but I just found that this reply never hit the list for ... reasons.
> 
> [...]

Applied, thanks!

[1/3] arm: boards: add pr_fmt() prefix to wolfvision pf5 board code
  https://git.pengutronix.de/cgit/barebox/commit/?id=cfde0d207cd3 (link may 
not be stable)
[2/3] common: boards: move dependencies to wolfvision board code library
  https://git.pengutronix.de/cgit/barebox/commit/?id=adb7cbee7b31 (link may 
not be stable)
[3/3] common: boards: wolfvision: fix handling of overlays parameter
  https://git.pengutronix.de/cgit/barebox/commit/?id=cc211bb091fc (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH] ddr: imx: rename ddr_get_firmware_ddr to ddr_get_firmware_ddr4

2024-05-16 Thread Sascha Hauer


On Wed, 15 May 2024 13:00:37 +0200, Ahmad Fatoum wrote:
> The omission of the 4 was likely a typo. Adding it makes it clearer what
> the function does and serves symmetry with ddr_get_firmware_lpddr4().
> 
> 

Applied, thanks!

[1/1] ddr: imx: rename ddr_get_firmware_ddr to ddr_get_firmware_ddr4
  https://git.pengutronix.de/cgit/barebox/commit/?id=81c131efcaa5 (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH] watchdog: imxwd: Do not suspend in lpm on i.MX27

2024-05-16 Thread Sascha Hauer


On Wed, 15 May 2024 13:01:56 +0200, Sascha Hauer wrote:
> The i.MX watchdog has two different configurable behaviours for low
> power modes.  The watchdog can either be suspended during low power
> modes or kept running.
> The useful behaviour is normally to disable it during low power modes to
> be able to suspend the system without having the watchdog resetting the
> system. This setting was introduced in the Kernel back in 2014 [1] and
> in barebox back in 2021 [2].
> On i.MX27 however this setting has the effect that the watchdog is
> suspended during normal cpu_do_idle(), so on an idle system it takes
> very long time until the watchdog triggers. This renders this setting
> useless, so disable it on i.MX27. This seems to be fixed on SoCs newer
> than i.MX35.
> 
> [...]

Applied, thanks!

[1/1] watchdog: imxwd: Do not suspend in lpm on i.MX27
  https://git.pengutronix.de/cgit/barebox/commit/?id=d5d01f156ee2 (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH] Documentation: pstore: add some information about interfacing with Linux

2024-05-16 Thread Sascha Hauer


On Wed, 15 May 2024 13:19:02 +0200, Ahmad Fatoum wrote:
> The help text erroneously states that CONFIG_FS_PSTORE_RAMOOPS_RO
> disables writing completely, but this is not correct: It merely stops
> barebox from zapping log content previously written by Linux.
> 
> The Kconfig help text is correct, so adjust the documentation to reflect
> that and while at it, add some more information about how to access
> pstore in Linux.
> 
> [...]

Applied, thanks!

[1/1] Documentation: pstore: add some information about interfacing with Linux
  https://git.pengutronix.de/cgit/barebox/commit/?id=7deedc63739d (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH 1/2] ARM: i.MX8MP: skov: fix variant detection on boards without state

2024-05-16 Thread Sascha Hauer


On Wed, 15 May 2024 13:20:32 +0200, Ahmad Fatoum wrote:
> If barebox booted a board without state partition on the eMMC it did not set a
> refined compatible at all resulting in a failure to boot into Linux userspace.
> 
> Instead just default to the LVDS flavor of the board variant which at least
> leads to a working Linux userspace.
> 
> 
> [...]

Applied, thanks!

[1/2] ARM: i.MX8MP: skov: fix variant detection on boards without state
  https://git.pengutronix.de/cgit/barebox/commit/?id=61808f7f9e31 (link may 
not be stable)
[2/2] ARM: i.MX8MP: skov: update timing parameters for Samsung RAM
  https://git.pengutronix.de/cgit/barebox/commit/?id=592fed919ca8 (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH] of: move ramoops device creation into common code

2024-05-16 Thread Sascha Hauer


On Wed, 15 May 2024 13:22:54 +0200, Ahmad Fatoum wrote:
> We already have a generic place where we check for reserved memory
> matches, so add ramoops there as well.
> 
> 

Applied, thanks!

[1/1] of: move ramoops device creation into common code
  https://git.pengutronix.de/cgit/barebox/commit/?id=34d1c6cc820c (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH] include/linux/kernel.h: fix mult_frac() multiple argument evaluation bug

2024-05-15 Thread Sascha Hauer


On Wed, 15 May 2024 13:27:03 +0200, Ahmad Fatoum wrote:
> This is a port of Linux commit 048a9883267f9b8f8e05dca9e9e8e6f991eea61e:
> 
> | Author: Alexey Dobriyan 
> | AuthorDate: Sat May 20 21:25:19 2023 +0300
> |
> | include/linux/math.h: fix mult_frac() multiple argument evaluation bug
> |
> | mult_frac() evaluates _all_ arguments multiple times in the body.
> |
> | Clarify comment while I'm at it.
> |
> | Link: https://lkml.kernel.org/r/f9f9fdbb-ec8e-4f5e-a998-2a58627a1a43@p183
> | Signed-off-by: Alexey Dobriyan 
> | Signed-off-by: Andrew Morton 
> 
> [...]

Applied, thanks!

[1/1] include/linux/kernel.h: fix mult_frac() multiple argument evaluation bug
  https://git.pengutronix.de/cgit/barebox/commit/?id=3934f477dc82 (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




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

2024-05-15 Thread Sascha Hauer


On Wed, 15 May 2024 15:16:08 +0200, Roland Hieber wrote:
> 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.
> 
> 
> [...]

Applied, thanks!

[1/1] ARM: dts: GoMe e143_01: fix default state priorities
  https://git.pengutronix.de/cgit/barebox/commit/?id=a657866d377b (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH] fs: ramfs: allocate once instead of twice per ramfs chunk

2024-05-15 Thread Sascha Hauer


On Wed, 15 May 2024 17:24:10 +0200, Ahmad Fatoum wrote:
> There's no reason to maintain two allocations per chunk, so just collect
> them both into the same calloc call.
> 
> No functional change.
> 
> 

Applied, thanks!

[1/1] fs: ramfs: allocate once instead of twice per ramfs chunk
  https://git.pengutronix.de/cgit/barebox/commit/?id=6e502a0ca8d9 (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




[PATCH] watchdog: imxwd: Do not suspend in lpm on i.MX27

2024-05-15 Thread Sascha Hauer
The i.MX watchdog has two different configurable behaviours for low
power modes.  The watchdog can either be suspended during low power
modes or kept running.
The useful behaviour is normally to disable it during low power modes to
be able to suspend the system without having the watchdog resetting the
system. This setting was introduced in the Kernel back in 2014 [1] and
in barebox back in 2021 [2].
On i.MX27 however this setting has the effect that the watchdog is
suspended during normal cpu_do_idle(), so on an idle system it takes
very long time until the watchdog triggers. This renders this setting
useless, so disable it on i.MX27. This seems to be fixed on SoCs newer
than i.MX35.

[1] 1a9c5efa576ec ("watchdog: imx2_wdt: disable watchdog timer during low power 
mode")
[2] c3787a81f26bb ("watchdog: imxwd: suspend watchdog timer in low power mode")

Signed-off-by: Sascha Hauer 
---
 drivers/watchdog/imxwd.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/watchdog/imxwd.c b/drivers/watchdog/imxwd.c
index 8f4de5a994..616248af38 100644
--- a/drivers/watchdog/imxwd.c
+++ b/drivers/watchdog/imxwd.c
@@ -33,6 +33,7 @@ struct imx_wd {
struct restart_handler restart_warm;
bool ext_reset;
bool bigendian;
+   bool suspend_in_lpm;
 };
 
 #define to_imx_wd(h) container_of(h, struct imx_wd, wd)
@@ -127,7 +128,8 @@ static int imx21_watchdog_set_timeout(struct imx_wd *priv, 
unsigned timeout)
val |= IMX21_WDOG_WCR_WDT;
 
/* Suspend timer in low power mode */
-   val |= IMX21_WDOG_WCR_WDZST;
+   if (priv->suspend_in_lpm)
+   val |= IMX21_WDOG_WCR_WDZST;
 
/*
 * set time and some write once bits first prior enabling the
@@ -273,6 +275,7 @@ static int imx_wd_probe(struct device *dev)
 
priv->ext_reset = of_property_read_bool(dev->of_node,
"fsl,ext-reset-output");
+   priv->suspend_in_lpm = !of_machine_is_compatible("fsl,imx27");
 
if (IS_ENABLED(CONFIG_WATCHDOG_IMX)) {
if (priv->ops->is_running) {
-- 
2.39.2




Re: [PATCH 1/2] usb:gadget:composite: add public functions for managing setup requests

2024-05-15 Thread Sascha Hauer


On Tue, 14 May 2024 15:03:26 +0200, Enrico Scholz wrote:
> The composite driver does some bookkeeping about pending requests and
> decides in its cleanup function whether requests must be dequeued.
> 
> There are some function drivers (dfu, acm) which queue the requests
> directly which causes e.g.
> 
> | :/ dfu /tmp/img(img)c
> | ...
> | g_multi gadget0: high-speed config #1: Multifunction Composite Gadget
> | fsl_free_request: Freeing queued request
> | [<2fd8d8e5>] (unwind_backtrace+0x1/0x78) from [<2fd34b1f>] 
> (fsl_free_request+0x1f/0x34)
> | [<2fd34b1f>] (fsl_free_request+0x1f/0x34) from [<2fd337cf>] 
> (composite_dev_cleanup+0x77/0xc0)
> | [<2fd337cf>] (composite_dev_cleanup+0x77/0xc0) from [<2fd33867>] 
> (__composite_unbind+0x4f/0x94)
> | [<2fd33867>] (__composite_unbind+0x4f/0x94) from [<2fd3432b>] 
> (gadget_unbind_driver+0x37/0x70)
> | [<2fd3432b>] (gadget_unbind_driver+0x37/0x70) from [<2fd1275f>] 
> (device_remove+0xf/0x20)
> | [<2fd1275f>] (device_remove+0xf/0x20) from [<2fd1289b>] 
> (unregister_driver+0x47/0x60)
> | [<2fd1289b>] (unregister_driver+0x47/0x60) from [<2fd34663>] 
> (usb_gadget_unregister_driver+0xf/0x18)
> | [<2fd34663>] (usb_gadget_unregister_driver+0xf/0x18) from [<2fd37c5b>] 
> (usb_multi_unregister+0x13/0x30)
> | [<2fd37c5b>] (usb_multi_unregister+0x13/0x30) from [<2fd59f67>] 
> (do_dfu+0x47/0x68)
> | [<2fd59f67>] (do_dfu+0x47/0x68) from [<2fd04fdf>] 
> (execute_command+0x23/0x4c)
> | [<2fd04fdf>] (execute_command+0x23/0x4c) from [<2fd0a737>] 
> (run_list_real+0x5ef/0x690)
> | [<2fd0a737>] (run_list_real+0x5ef/0x690) from [<2fd0a00b>] 
> (parse_stream_outer+0xc7/0x154)
> | [<2fd0a00b>] (parse_stream_outer+0xc7/0x154) from [<2fd0a927>] 
> (run_shell+0x3f/0x6c)
> | [<2fd0a927>] (run_shell+0x3f/0x6c) from [<2fd01103>] (run_init+0xeb/0x210)
> | [<2fd01103>] (run_init+0xeb/0x210) from [<2fd01253>] 
> (start_barebox+0x2b/0x6c)
> | [<2fd01253>] (start_barebox+0x2b/0x6c) from [<2fd89b37>] 
> (barebox_non_pbl_start+0xc3/0x108)
> | [<2fd89b37>] (barebox_non_pbl_start+0xc3/0x108) from [<2fd5>] 
> (__bare_init_start+0x1/0xc)
> 
> [...]

Applied, thanks!

[1/2] usb:gadget:composite: add public functions for managing setup requests
  https://git.pengutronix.de/cgit/barebox/commit/?id=bf91067ef12c (link may 
not be stable)
[2/2] usb:gadget: use helper function to queue composite requests
  https://git.pengutronix.de/cgit/barebox/commit/?id=593248cde35d (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH v2] ARM64: reloc: fix relocation error for big fat bareboxes

2024-05-14 Thread Sascha Hauer


On Mon, 13 May 2024 16:01:21 +0200, Ahmad Fatoum wrote:
> A multi_v8 barebox with KASAN enabled is 2051804 bytes even after
> compression and this breaks linking for me:
> 
>   arch/arm/cpu/common.o: in function `global_variable_offset':
>   arch/arm/include/asm/reloc.h:20:(.text.relocate_to_current_adr+0x1c):
> relocation truncated to fit: R_AARCH64_ADR_PREL_LO21 against symbol
> `_text' defined in .text section in .tmp_barebox1
>   arch/arm/include/asm/reloc.h:20:(.text.relocate_to_current_adr+0x40):
> relocation truncated to fit: R_AARCH64_ADR_PREL_LO21 against symbol
> `_text' defined in .text section in .tmp_barebox1
> 
> [...]

Applied, thanks!

[1/1] ARM64: reloc: fix relocation error for big fat bareboxes
  https://git.pengutronix.de/cgit/barebox/commit/?id=9246c916a25a (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH master 1/3] mci: core: reset number of parttions on card probe failure

2024-05-14 Thread Sascha Hauer


On Mon, 13 May 2024 11:58:45 +0200, Ahmad Fatoum wrote:
> mci_part_add records information about MMC hardware partitions and
> increments mci->nr_parts by one afterwards.
> If starting up the card succeeds, this information is then used to
> call mci_register_partition for each added partition.
> 
> If card start up fails, registration will be skipped, but mci->nr_parts
> is not reset. This means that repeatedly calling device_detect will
> overflow the mci->part buffer and overwrite subsequent memory.
> 
> [...]

Applied, thanks!

[1/3] mci: core: reset number of parttions on card probe failure
  https://git.pengutronix.de/cgit/barebox/commit/?id=c3ca560d93be (link may 
not be stable)
[2/3] mci: core: remove HS200 from mci_timing_is_ddr
  https://git.pengutronix.de/cgit/barebox/commit/?id=5d8a81f83b59 (link may 
not be stable)
[3/3] ARM64: reloc: fix relocation error for big fat bareboxes
  https://git.pengutronix.de/cgit/barebox/commit/?id=fdb311841c61 (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH] usb: gadget: ums: add support for optional partition flag

2024-05-13 Thread Sascha Hauer


On Mon, 15 Apr 2024 07:34:30 +0200, Ahmad Fatoum wrote:
> File lists for fastboot support a 'o' flag to silently skip files that
> don't exist at bind time. Add support for the same for USB mass storage
> gadgets as well.
> 
> 

Applied, thanks!

[1/1] usb: gadget: ums: add support for optional partition flag
  https://git.pengutronix.de/cgit/barebox/commit/?id=2487ca3fba71 (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




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

2024-05-13 Thread Sascha Hauer


On Tue, 07 May 2024 15:39:52 +0200, Roland Hieber wrote:
> 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.)
> 
> 
> [...]

Applied, thanks!

[1/1] net: phy: dp83867: reset PHY on probe
  https://git.pengutronix.de/cgit/barebox/commit/?id=59a6b92960ff (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH] Documentation: devel: project-ideas: fix typo

2024-05-13 Thread Sascha Hauer


On Thu, 09 May 2024 12:35:48 +0300, Antony Pavlov wrote:
> 


Applied, thanks!

[1/1] Documentation: devel: project-ideas: fix typo
  https://git.pengutronix.de/cgit/barebox/commit/?id=f15f63ae50d1 (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH] nvmem: imx-ocotp-ele: fix MAC2 layout

2024-05-13 Thread Sascha Hauer


On Wed, 08 May 2024 14:14:45 +0200, Sascha Hauer wrote:
> The MAC address layout for MAC address 2 implemented in the
> imx-ocotp-ele driver matches the one described in the Security Reference
> manual. This contradicts the description in the fusemap though.
> According to the fusemap the layout for MAC2 is the same as for MAC1.
> It's not clear which one is correct, but at least the TQMA93 board has
> MAC2 programmed matching the fusemap, so change the layout accordingly.
> 
> [...]

Applied, thanks!

[1/1] nvmem: imx-ocotp-ele: fix MAC2 layout
  https://git.pengutronix.de/cgit/barebox/commit/?id=d5ad67ce66ee (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH 1/2] pstore: move slash handling into common function

2024-05-08 Thread Sascha Hauer
On Wed, May 08, 2024 at 01:18:35PM +0200, Ahmad Fatoum wrote:
> Both open and stat receive a file path and manually skip over the slash
> before calling pstore_get_by_name. Follow-up commit adds one more user
> of pstore_get_by_name, so instead of duplicating the flash skip a third
> time, move it into pstore_get_by_name.

s/flash/slash while applying.

Sascha

> 
> Signed-off-by: Ahmad Fatoum 
> ---
>  fs/pstore/fs.c | 9 +++--
>  1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/fs/pstore/fs.c b/fs/pstore/fs.c
> index 238a316e9157..f2ffc0ac6251 100644
> --- a/fs/pstore/fs.c
> +++ b/fs/pstore/fs.c
> @@ -130,6 +130,9 @@ static struct pstore_private *pstore_get_by_name(struct 
> list_head *head,
>   if (!name)
>   return NULL;
>  
> + if (name[0] == '/')
> + name++;
> +
>   list_for_each_entry(d, head, list) {
>   if (strcmp(d->name, name) == 0)
>   return d;
> @@ -143,9 +146,6 @@ static int pstore_open(struct device *dev, FILE *file, 
> const char *filename)
>   struct list_head *head = dev->priv;
>   struct pstore_private *d;
>  
> - if (filename[0] == '/')
> - filename++;
> -
>   d = pstore_get_by_name(head, filename);
>   if (!d)
>   return -ENOENT;
> @@ -221,9 +221,6 @@ static int pstore_stat(struct device *dev, const char 
> *filename,
>  {
>   struct pstore_private *d;
>  
> - if (filename[0] == '/')
> - filename++;
> -
>   d = pstore_get_by_name(, filename);
>   if (!d)
>   return -ENOENT;
> -- 
> 2.39.2
> 
> 
> 

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



Re: [PATCH 1/2] pstore: move slash handling into common function

2024-05-08 Thread Sascha Hauer


On Wed, 08 May 2024 13:18:35 +0200, Ahmad Fatoum wrote:
> Both open and stat receive a file path and manually skip over the slash
> before calling pstore_get_by_name. Follow-up commit adds one more user
> of pstore_get_by_name, so instead of duplicating the flash skip a third
> time, move it into pstore_get_by_name.
> 
> 

Applied, thanks!

[1/2] pstore: move slash handling into common function
  https://git.pengutronix.de/cgit/barebox/commit/?id=8cca127ca0ab (link may 
not be stable)
[2/2] pstore: add unlink implementation for deleting pstore files
  https://git.pengutronix.de/cgit/barebox/commit/?id=a7ed187e0f88 (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




[PATCH] nvmem: imx-ocotp-ele: fix MAC2 layout

2024-05-08 Thread Sascha Hauer
The MAC address layout for MAC address 2 implemented in the
imx-ocotp-ele driver matches the one described in the Security Reference
manual. This contradicts the description in the fusemap though.
According to the fusemap the layout for MAC2 is the same as for MAC1.
It's not clear which one is correct, but at least the TQMA93 board has
MAC2 programmed matching the fusemap, so change the layout accordingly.

Signed-off-by: Sascha Hauer 
---
 drivers/nvmem/imx-ocotp-ele.c | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/nvmem/imx-ocotp-ele.c b/drivers/nvmem/imx-ocotp-ele.c
index e4e60ed6af..58d3e62abf 100644
--- a/drivers/nvmem/imx-ocotp-ele.c
+++ b/drivers/nvmem/imx-ocotp-ele.c
@@ -116,14 +116,10 @@ static int imx_ocotp_cell_pp(void *context, const char 
*id, unsigned int offset,
if (id && !strcmp(id, "mac-address")) {
u8 *buf = data;
 
-   if (offset == 0x4ec) {
+   if (offset == 0x4ec || offset == 0x4f2) {
swap(buf[0], buf[5]);
swap(buf[1], buf[4]);
swap(buf[2], buf[3]);
-   } else if (offset == 0x4f2) {
-   swap(buf[0], buf[1]);
-   swap(buf[2], buf[5]);
-   swap(buf[3], buf[4]);
} else {
return -EINVAL;
}
-- 
2.39.2




[PATCH] mtd: nand: raw: add back support for marking blocks as good

2024-05-07 Thread Sascha Hauer
Support for marking blocks as good was lost during the last NAND layer
update. Add that back.

Signed-off-by: Sascha Hauer 
---
 drivers/mtd/nand/raw/nand_base.c | 64 
 1 file changed, 64 insertions(+)

diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c
index 119e640eaf..c7cde7643f 100644
--- a/drivers/mtd/nand/raw/nand_base.c
+++ b/drivers/mtd/nand/raw/nand_base.c
@@ -493,6 +493,49 @@ static int nand_block_markbad_lowlevel(struct nand_chip 
*chip, loff_t ofs)
return ret;
 }
 
+/**
+ * nand_block_markgood_lowlevel - mark a block good
+ * @mtd: MTD device structure
+ * @ofs: offset from device start
+ *
+ * We try operations in the following order:
+ *  (1) erase the affected block
+ *  (2) check bad block marker
+ *  (3) update the BBT
+ */
+static int nand_block_markgood_lowlevel(struct nand_chip *chip, loff_t ofs)
+{
+   struct mtd_info *mtd = nand_to_mtd(chip);
+   bool allow_erasebad;
+   int ret;
+
+   if (!(chip->bbt_options & NAND_BBT_NO_OOB_BBM)) {
+   struct erase_info einfo;
+
+   /* Attempt erase possibly bad block */
+   allow_erasebad = mtd->allow_erasebad;
+   mtd->allow_erasebad = true;
+   memset(, 0, sizeof(einfo));
+   einfo.mtd = mtd;
+   einfo.addr = ofs;
+   einfo.len = 1 << chip->phys_erase_shift;
+   nand_erase_nand(chip, , 0);
+   mtd->allow_erasebad = allow_erasebad;
+   }
+
+   /* Mark block good in BBT */
+   if (chip->bbt) {
+   ret = nand_markgood_bbt(chip, ofs);
+   if (ret)
+   return ret;
+   }
+
+   if (mtd->ecc_stats.badblocks > 0)
+   mtd->ecc_stats.badblocks--;
+
+   return 0;
+}
+
 /**
  * nand_block_isreserved - [GENERIC] Check if a block is marked reserved.
  * @mtd: MTD device structure
@@ -4621,6 +4664,26 @@ static int nand_block_markbad(struct mtd_info *mtd, 
loff_t ofs)
return nand_block_markbad_lowlevel(mtd_to_nand(mtd), ofs);
 }
 
+/**
+ * nand_block_markbad - [MTD Interface] Mark block at the given offset as bad
+ * @mtd: MTD device structure
+ * @ofs: offset relative to mtd start
+ */
+static int nand_block_markgood(struct mtd_info *mtd, loff_t ofs)
+{
+   int ret;
+
+   ret = nand_block_isbad(mtd, ofs);
+   if (ret < 0)
+   return ret;
+
+   if (!ret)
+   /* If it was good already, return success and do nothing */
+   return 0;
+
+   return nand_block_markgood_lowlevel(mtd_to_nand(mtd), ofs);
+}
+
 /**
  * nand_lock - [MTD Interface] Lock the NAND flash
  * @mtd: MTD device structure
@@ -6213,6 +6276,7 @@ int nand_scan_tail(struct nand_chip *chip)
mtd->_block_isbad = nand_block_isbad;
mtd->_block_markbad = nand_block_markbad;
mtd->_max_bad_blocks = nanddev_mtd_max_bad_blocks;
+   mtd->_block_markgood = nand_block_markgood;
 
/*
 * Initialize bitflip_threshold to its default prior scan_bbt() call.
-- 
2.39.2




Re: [PATCH 0/3] add PBL handoff-data support

2024-05-07 Thread Sascha Hauer


On Tue, 30 Apr 2024 12:53:07 +0200, Sascha Hauer wrote:
> We need to pass data from the PBL to barebox proper. Right now we do
> this with passing the data in registers which is quite limited. As the
> amount of information that has to be passed increases it's time to
> overcome this limitation.
> 
> This series introduces handoff-data which is a linked list of memory
> blobs that can be passed from PBL to barebox proper. Board and SoC
> code can append this list with their own entries and pick them up later
> in barebox proper. The ARM architecture is converted over to use handoff
> data, other architectures could follow.
> 
> [...]

Applied, thanks!

[1/3] ARM: move blob_is_arm_boarddata() to include
  https://git.pengutronix.de/cgit/barebox/commit/?id=c78e0862d540 (link may 
not be stable)
[2/3] add handoff-data support
  https://git.pengutronix.de/cgit/barebox/commit/?id=6b17d1443632 (link may 
not be stable)
[3/3] ARM: pass handoff data from PBL to proper
  https://git.pengutronix.de/cgit/barebox/commit/?id=637231379c32 (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH master 1/3] pstore: ramoops: fix use of wrong types on 64-bit

2024-05-07 Thread Sascha Hauer


On Mon, 06 May 2024 18:02:44 +0200, Ahmad Fatoum wrote:
> The kernel struct persistent_ram_buffer uses atomic_t for start and size
> members in the persistent_ram_buffer chunk, which are 32-bit always,
> unlike resource_size_t that we used in barebox, which is 64-bit when
> CONFIG_PHYS_ADDR_T_64BIT=y.
> 
> To fix this, we could use either int32_t or atomic_t. To make
> synchronization with Linux easier, let's use atomic_t.
> 
> [...]

Applied, thanks!

[1/3] pstore: ramoops: fix use of wrong types on 64-bit
  https://git.pengutronix.de/cgit/barebox/commit/?id=914622436219 (link may 
not be stable)
[2/3] pstore: fix size of OF fixup memory region
  https://git.pengutronix.de/cgit/barebox/commit/?id=0efa116b9f48 (link may 
not be stable)
[3/3] pstore: return -ENOENT when file is missing
  https://git.pengutronix.de/cgit/barebox/commit/?id=e70a514bce4b (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH] mtd: nand: mxc_nand: clear NAND_BBT_CREATE flag

2024-05-07 Thread Sascha Hauer


On Fri, 03 May 2024 12:15:09 +0200, Sascha Hauer wrote:
> On i.MX NAND the factory bad block markers are not at the place the NAND
> core expects them to be, so the core also can't properly generate a bad
> block table. Clear the NAND_BBT_CREATE flag to prevent the core from
> doing so. This preserves the behaviour we had previously with the
> barebox driver which was lost when we replaced it with the Kernel
> driver.
> 
> [...]

Applied, thanks!

[1/1] mtd: nand: mxc_nand: clear NAND_BBT_CREATE flag
  https://git.pengutronix.de/cgit/barebox/commit/?id=f4cc035245c6 (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH v2 0/4] mtd: nand: mxc_nand: Only automatically create BBT if NAND seems to be pristine

2024-05-07 Thread Sascha Hauer


On Mon, 06 May 2024 16:46:07 +0200, Uwe Kleine-König wrote:
> this is v2 of this series. The changes are:
> 
>  - More cleanups
>  - Keep checkbad() function (Sascha)
>  - Check each block if it contains a barebox image or a UBI
> 
> (implicit) v1 available at
> https://lore.barebox.org/barebox/20240430094451.1038256-4-u.kleine-koe...@pengutronix.de/T/#t
> 
> [...]

Applied, thanks!

[1/4] mtd: nand: mxc_nand: Improve comment about vendor BBM and address 
verschwurbelung
  https://git.pengutronix.de/cgit/barebox/commit/?id=4bad7cc26bbd (link may 
not be stable)
[2/4] mtd: nand: mxc_nand: Cleanup code creating bad block table
  https://git.pengutronix.de/cgit/barebox/commit/?id=23686460eb8b (link may 
not be stable)
[3/4] mtd: nand: mxc_nand: Add error message if BBT creation fails
  https://git.pengutronix.de/cgit/barebox/commit/?id=8695b02ffa13 (link may 
not be stable)
[4/4] mtd: nand: mxc_nand: Only automatically create BBT if NAND seems to be 
pristine
  https://git.pengutronix.de/cgit/barebox/commit/?id=30130286232a (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH v2 0/5] ARM: i.MX8MP: add nominal drive mode support

2024-05-06 Thread Sascha Hauer


On Fri, 03 May 2024 12:37:12 +0200, Ahmad Fatoum wrote:
> Unlike the i.MX8MM and i.MX8MN SoCs added earlier, the early setup code
> and device tree for the i.MX8MP configures some clocks at frequencies
> that are only validated for overdrive mode, i.e. when VDD_SOC is 950 mV.
> 
> Boards may want to run their SoC at the lower voltage of 850 mV though
> to reduce heat generation and power usage. For this to work, clock rates
> need to adhere to the limits of the nominal drive mode.
> 
> [...]

Applied, thanks!

[1/5] ARM: i.MX8M: pass cpu_type parameter to __imx8m_early_clock_init
  https://git.pengutronix.de/cgit/barebox/commit/?id=ae2dd4a4850f (link may 
not be stable)
[2/5] ARM: i.MX8MP: configure PLL3 as 600MHz
  https://git.pengutronix.de/cgit/barebox/commit/?id=4a8c03958738 (link may 
not be stable)
[3/5] ARM: i.MX8MP: configure PLL3 as noc_io parent
  https://git.pengutronix.de/cgit/barebox/commit/?id=608ea0c2fa33 (link may 
not be stable)
[4/5] ARM: i.MX8MP: don't reparent GIC from BootROM default
  https://git.pengutronix.de/cgit/barebox/commit/?id=ecff33a34978 (link may 
not be stable)
[5/5] ARM: dts: i.MX8MP: Add optional nominal drive mode DTSI
  https://git.pengutronix.de/cgit/barebox/commit/?id=180337d60753 (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH 2/3] ARM: layerscape: add helpful runtime warning when firmware is missing

2024-05-06 Thread Sascha Hauer
On Fri, May 03, 2024 at 12:32:29PM +0200, Ahmad Fatoum wrote:
> Firmware compiled into barebox PBL is rarely optional, so even if
> CONFIG_MISSING_FIRMWARE_ERROR is disabled, barebox will not generate
> images with missing PBL firmware.
> 
> We can relax this for firmware compiled into barebox proper though: If
> the user disables CONFIG_MISSING_FIRMWARE_ERROR, just have the driver
> fail at runtime as not to break other boards in the same build that
> don't require the firmware.
> 
> Missing barebox proper firmware will be detectable as a 0-byte firmware
> blob in the follow-up commit, so prepare for that by printing an
> informative error message.

I changed the order of the first two patches to what this sentence
suggests.

Sascha

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



Re: [PATCH 1/3] firmware: support optional firmware in barebox proper

2024-05-06 Thread Sascha Hauer


On Fri, 03 May 2024 12:32:28 +0200, Ahmad Fatoum wrote:
> For firmware used in the prebootloader, missing firmware is handled
> according to the CONFIG_MISSING_FIRMWARE_ERROR symbol:
> 
>   - If set, barebox will throw an error when assmebling the final image
> with a list of missing firmware
> 
>   - If unset, a warning will be printed for each barebox image that
> can't be built due to missing firmware and all
> 
> [...]

Applied, thanks!

[1/3] firmware: support optional firmware in barebox proper
  https://git.pengutronix.de/cgit/barebox/commit/?id=bd29a3aa7e2a (link may 
not be stable)
[2/3] ARM: layerscape: add helpful runtime warning when firmware is missing
  https://git.pengutronix.de/cgit/barebox/commit/?id=9e436059695a (link may 
not be stable)
[3/3] ci: test: remove generation of dummy firmware
  https://git.pengutronix.de/cgit/barebox/commit/?id=8dc8635d90cb (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH] dma: of_fixups: add fallbacks if /soc doesn't exist

2024-05-06 Thread Sascha Hauer


On Fri, 03 May 2024 12:29:09 +0200, Ahmad Fatoum wrote:
> The fixup was written for Layerscape LS1046A. Enabling it on i.MX8MP
> throws an initcall error, because the SoC node is called /soc@0.
> 
> Improve the situation by falling back to either /soc@0 or just plain /.
> 
> 

Applied, thanks!

[1/1] dma: of_fixups: add fallbacks if /soc doesn't exist
  https://git.pengutronix.de/cgit/barebox/commit/?id=73258bfc5c1b (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH] mfd: pca9450: don't warn if PCA9450_PWRON_STAT is 0

2024-05-06 Thread Sascha Hauer


On Fri, 03 May 2024 12:15:19 +0200, Ahmad Fatoum wrote:
> The register is zeroed on read, so network booting always prints the
> warning that the reset reason is unknown.
> 
> Skip the warning in this case.
> 
> 

Applied, thanks!

[1/1] mfd: pca9450: don't warn if PCA9450_PWRON_STAT is 0
  https://git.pengutronix.de/cgit/barebox/commit/?id=20acc8c050f6 (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH] arm: rockchip: mecsbc: drop duplicate reserved-memory node

2024-05-06 Thread Sascha Hauer


On Fri, 03 May 2024 12:11:31 +0200, Ahmad Fatoum wrote:
> The exact same node is duplicated. Drop one instance.
> 
> 

Applied, thanks!

[1/1] arm: rockchip: mecsbc: drop duplicate reserved-memory node
  https://git.pengutronix.de/cgit/barebox/commit/?id=b2ebe85e64e2 (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH master] ARM: i.MX9: tqma93xx: handle unknown form factors

2024-05-06 Thread Sascha Hauer
On Fri, May 03, 2024 at 12:09:23PM +0200, Ahmad Fatoum wrote:
> GCC warns that fdt may be uninitialized. Fix that by treating unknown
> variants as the CA variant. CA was chosen for no particular reason.
> 
> Signed-off-by: Ahmad Fatoum 
> ---
>  arch/arm/boards/tqma93xx/lowlevel.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/arch/arm/boards/tqma93xx/lowlevel.c 
> b/arch/arm/boards/tqma93xx/lowlevel.c
> index 8d89ee530ff8..66991fc6b03b 100644
> --- a/arch/arm/boards/tqma93xx/lowlevel.c
> +++ b/arch/arm/boards/tqma93xx/lowlevel.c
> @@ -89,6 +89,9 @@ static noinline void tqma93xx_continue(void)
>   case VARD_FORMFACTOR_TYPE_LGA:
>   fdt = __dtb_z_imx93_tqma9352_mba93xxla_start;
>   break;
> + default:
> + pr_warn("Unknown formfactor: 0%x. Assuming connector\n", 
> formfactor);
> + fallthrough;

tqma93xx_get_formfactor() always returns one of the values handled in
this switch/case, so this will never trigger. If gcc mourns about it
then adding the default: is enough, no need to add a message.

Sascha

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



Re: [PATCH master] pblimage: suppress stdout output

2024-05-06 Thread Sascha Hauer


On Fri, 03 May 2024 12:08:56 +0200, Ahmad Fatoum wrote:
> Any output, stdout or stderr, during normal operation looks jarring when
> interleaved with Kbuild, so utilities should just be always silent on
> stdout and print errors to stderr if they occur.
> 
> The pblimage tool violated this and had a stdout debug print left-over and
> printed part of an error message to stdout instead of stderr. Fix both
> instances.
> 
> [...]

Applied, thanks!

[1/1] pblimage: suppress stdout output
  https://git.pengutronix.de/cgit/barebox/commit/?id=302db826b67c (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




[PATCH] mtd: nand: mxc_nand: clear NAND_BBT_CREATE flag

2024-05-03 Thread Sascha Hauer
On i.MX NAND the factory bad block markers are not at the place the NAND
core expects them to be, so the core also can't properly generate a bad
block table. Clear the NAND_BBT_CREATE flag to prevent the core from
doing so. This preserves the behaviour we had previously with the
barebox driver which was lost when we replaced it with the Kernel
driver.

Signed-off-by: Sascha Hauer 
---
 drivers/mtd/nand/raw/mxc_nand.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/raw/mxc_nand.c b/drivers/mtd/nand/raw/mxc_nand.c
index 2774b6bb4f..c6533b20fc 100644
--- a/drivers/mtd/nand/raw/mxc_nand.c
+++ b/drivers/mtd/nand/raw/mxc_nand.c
@@ -1167,7 +1167,7 @@ static uint8_t bbt_pattern[] = { 'B', 'b', 't', '0' };
 static uint8_t mirror_pattern[] = { '1', 't', 'b', 'B' };
 
 static struct nand_bbt_descr bbt_main_descr = {
-   .options = NAND_BBT_LASTBLOCK | NAND_BBT_CREATE | NAND_BBT_WRITE
+   .options = NAND_BBT_LASTBLOCK | NAND_BBT_WRITE
| NAND_BBT_2BIT | NAND_BBT_VERSION | NAND_BBT_PERCHIP,
.offs = 0,
.len = 4,
@@ -1177,7 +1177,7 @@ static struct nand_bbt_descr bbt_main_descr = {
 };
 
 static struct nand_bbt_descr bbt_mirror_descr = {
-   .options = NAND_BBT_LASTBLOCK | NAND_BBT_CREATE | NAND_BBT_WRITE
+   .options = NAND_BBT_LASTBLOCK | NAND_BBT_WRITE
| NAND_BBT_2BIT | NAND_BBT_VERSION | NAND_BBT_PERCHIP,
.offs = 0,
.len = 4,
-- 
2.39.2




Re: [PATCH] ddr: imx8m: fix broken sharing of DRAM timing with TF-A for DFS

2024-05-03 Thread Sascha Hauer


On Mon, 29 Apr 2024 16:16:10 +0200, Ahmad Fatoum wrote:
> To facilitate dynamic frequency scaling, barebox will place the DRAM
> parameters it has configured into a well-known location in DRAM
> for consumption by TF-A.
> 
> This means that we need to be very picky about the struct layout for the
> data we write there to maintain ABI-compatibility. Unfortunately, NXP
> chose for the i.MX9 to add two fields into the middle, when it would
> have been possible to cleanly embed the i.MX8 DRAM timings in the
> i.MX9 DRAM timing struct. This is done now, so we need to arrange
> ourselves with it and ensure that the i.MX8M DRAM timings we share with
> TF-A don't have glimpses of the i.MX9 future.
> 
> [...]

Applied, thanks!

[1/1] ddr: imx8m: fix broken sharing of DRAM timing with TF-A for DFS
  https://git.pengutronix.de/cgit/barebox/commit/?id=ea580697c269 (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH] treewide: use runtime_address() where possible

2024-05-03 Thread Sascha Hauer


On Tue, 30 Apr 2024 07:56:34 +0200, Sascha Hauer wrote:
> We now have runtime_address() to access a linker variable when the
> binary is not yet relocated to the correct address. It provides a
> safer API, so use this one where possible instead of using previous
> way of adding get_runtime_offset() manually.
> 
> 

Applied, thanks!

[1/1] treewide: use runtime_address() where possible
  https://git.pengutronix.de/cgit/barebox/commit/?id=b2ce148e7016 (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH] ARM: remove MLO target

2024-05-03 Thread Sascha Hauer


On Tue, 30 Apr 2024 07:53:48 +0200, Sascha Hauer wrote:
> All am335x boards use multi image support, so the MLO target is unused.
> Remove it.
> 
> 

Applied, thanks!

[1/1] ARM: remove MLO target
  https://git.pengutronix.de/cgit/barebox/commit/?id=3bdf86c81919 (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH 3/3] mtd: mxc-nand: Only automatically create BBT if NAND seems to be pristine

2024-05-03 Thread Sascha Hauer
On Tue, Apr 30, 2024 at 11:44:54AM +0200, Uwe Kleine-König wrote:
> Automatically creating a BBT is the right thing to do if the NAND is
> factory new. However when migrating from a barebox older than commit
> v2020.03.0~28^2~1 ("mtd: nand-imx: Create BBT automatically when
> necessary") on a used machine, this automatism is really bad because it
> most likely marks the blocks containing the barebox image (and possibly
> more) as bad. On such a system the vendor BBMs are gone, but it was
> operated without that information before, so continuing to do so is a
> sane option.
> 
> Add a light check for the NAND to be really pristine: If the first block
> looks like containing a barebox image or a UBI refuse to create a BBT.
> 
> Signed-off-by: Uwe Kleine-König 
> ---
>  drivers/mtd/nand/raw/mxc_nand.c | 58 ++---
>  1 file changed, 31 insertions(+), 27 deletions(-)
> 
> diff --git a/drivers/mtd/nand/raw/mxc_nand.c b/drivers/mtd/nand/raw/mxc_nand.c
> index a72275480144..fd5ae447a198 100644
> --- a/drivers/mtd/nand/raw/mxc_nand.c
> +++ b/drivers/mtd/nand/raw/mxc_nand.c
> @@ -1555,30 +1555,6 @@ static const struct nand_controller_ops 
> mxcnd_controller_ops = {
>   * From this point on we can forget about the BBMs and rely completely
>   * on the flash BBT.
>   */
> -static int checkbad(struct nand_chip *chip, loff_t ofs)
> -{
> - struct mtd_info *mtd = nand_to_mtd(chip);
> - int ret;
> - uint8_t buf[mtd->writesize + mtd->oobsize];
> - struct mtd_oob_ops ops;
> -
> - ops.mode = MTD_OPS_RAW;
> - ops.ooboffs = 0;
> - ops.datbuf = buf;
> - ops.len = mtd->writesize;
> - ops.oobbuf = buf + mtd->writesize;
> - ops.ooblen = mtd->oobsize;
> -
> - ret = mtd_read_oob(mtd, ofs, );
> - if (ret < 0)
> - return ret;
> -
> - if (buf[2000] != 0xff)
> - return 1;
> -
> - return 0;
> -}
> -
>  static int imxnd_create_bbt(struct nand_chip *chip)
>  {
>   struct mtd_info *mtd = nand_to_mtd(chip);
> @@ -1598,12 +1574,40 @@ static int imxnd_create_bbt(struct nand_chip *chip)
>  
>   for (i = 0; i < numblocks; ++i) {
>   loff_t ofs = i << chip->bbt_erase_shift;
> + uint8_t buf[mtd->writesize + mtd->oobsize];
> + struct mtd_oob_ops ops = {
> + .mode = MTD_OPS_RAW,
> + .ooboffs = 0,
> + .datbuf = buf,
> + .len = mtd->writesize,
> + .oobbuf = buf + mtd->writesize,
> + .ooblen = mtd->oobsize,
> + };
>  
> - ret = checkbad(chip, ofs);
> - if (ret < 0)
> + ret = mtd_read_oob(mtd, ofs, );
> + if (ret < 0) {
> + dev_err(mtd->dev.parent, "Failed to read page at 
> 0x%08x\n", (unsigned int)ofs);
>   goto out;
> + }
>  
> - if (ret) {
> + /*
> +  * Automatically adding a BBT based on factory BBTs is only
> +  * sensible if the NAND is pristine. Abort if the first page
> +  * looks like a bootloader or UBI block.
> +  */
> + if (ofs == 0 && is_barebox_arm_head(buf)) {
> + dev_err(mtd->dev.parent, "Flash seems to contain a 
> barebox image, refusing\n");
> + ret = -EINVAL;
> + goto out;
> + }
> +
> + if (ofs == 0 && !memcmp(buf, "UBI#", 4)) {
> + dev_err(mtd->dev.parent, "Flash seems to contain a UBI, 
> refusing\n");
> + ret = -EINVAL;
> + goto out;
> + }
> +
> + if (buf[2000] != 0xff) {
>   bbt[i >> 2] |= 0x03 << (2 * (i & 0x3));
>   dev_info(mtd->dev.parent, "Bad eraseblock %d at 
> 0x%08x\n",
>i, (unsigned int)ofs);

Could you add the new code to checkbad() instead of inlining it? That
way it seems easier to adjust the code in case we have to change the way
how we detect useful data on a page. Rename checkbad() in case the name
doesn't feel appropriate anymore.

Sascha

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



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

2024-05-03 Thread Sascha Hauer


On Tue, 30 Apr 2024 12:23:57 +0200, Roland Hieber wrote:
> 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.
> 
> [...]

Applied, thanks!

[1/1] ARM: i.MX8MP: fix compatible string for koenigbauer,alphajet board
  https://git.pengutronix.de/cgit/barebox/commit/?id=f18bb339857d (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH 2/2] ARM: i.MX8M: add support to handle ROM SError ERR050350

2024-05-03 Thread Sascha Hauer
On Tue, Apr 30, 2024 at 01:29:41PM +0200, Marco Felsch wrote:
> This ports U-Boot commit:
> 
> | commit 2f3c92060dcd6bc9cfd3e2e344a3e1745ca39f09
> | Author: Peng Fan 
> | Date:   Thu Jul 9 13:39:26 2020 +0800
> |
> | imx8m: workaround ROM serror
> |
> | ROM SError happens on two cases:
> |
> | 1. ERR050342, on iMX8MQ HDCP enabled parts ROM writes to GPV1 register, 
> but
> | when ROM patch lock is fused, this write will cause SError.
> |
> | 2. ERR050350, on iMX8MQ/MM/MN, when the field return fuse is burned, HAB
> | is field return mode, but the last 4K of ROM is still protected and 
> cause
> | SError.
> |
> | Since ROM mask SError until ATF unmask it, so then ATF always meets the
> | exception. This patch works around the issue in SPL by enabling SPL
> | Exception vectors table and the SError exception, take the exception
> | to eret immediately to clear the SError.
> |
> | Signed-off-by: Ye Li 
> | Signed-off-by: Peng Fan 
> 
> Other than U-Boot we don't support exceptions in PBL and therefore we
> can handle it simpler by installing an dummy exception table which does
> nothing. The table gets overriden by TF-A later on anyway.
> 
> Signed-off-by: Marco Felsch 
> ---
> Hi all,
> 
> I'm not sure if the relocation should be done within the erratum
> handler or if we should move it into the lowlevel code per default for
> all i.MX8M platforms since the board files call it anyway after the
> lowlevel init. In the later case this would be an separate patch to drop
> the pattern:
> 
>  lowlevel_setup();
>  relocate_to_current_adr();
> 
> from the board files.
> 
> Regards,
>   Marco
> 
>  arch/arm/mach-imx/Makefile|  1 +
>  arch/arm/mach-imx/cpu_init.c  | 12 +-
>  arch/arm/mach-imx/errata.c| 22 ++
>  arch/arm/mach-imx/imx8m_early_exceptions_64.S | 42 +++
>  include/mach/imx/errata.h | 12 ++
>  5 files changed, 88 insertions(+), 1 deletion(-)
>  create mode 100644 arch/arm/mach-imx/errata.c
>  create mode 100644 arch/arm/mach-imx/imx8m_early_exceptions_64.S
>  create mode 100644 include/mach/imx/errata.h
> 
> diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
> index ce8af486aed4..d182f95673f5 100644
> --- a/arch/arm/mach-imx/Makefile
> +++ b/arch/arm/mach-imx/Makefile
> @@ -34,6 +34,7 @@ obj-$(CONFIG_BAREBOX_UPDATE_IMX_EXTERNAL_NAND) += 
> imx-bbu-external-nand.o
>  pbl-$(CONFIG_USB_GADGET_DRIVER_ARC_PBL) += imx-udc.o
>  obj-$(CONFIG_RESET_IMX_SRC) += src.o
>  lwl-y += cpu_init.o
> +lwl-y += errata.o imx8m_early_exceptions_64.o

Should likely be:

lwl-$(CONFIG_ARCH_IMX8M) += imx8m_early_exceptions_64.o

Also you can drop the _64 suffix from the filename as the imx8m_ preifx
already implies this.

>  pbl-y += xload-spi.o xload-common.o xload-imx-nand.o xload-gpmi-nand.o
>  pbl-y += xload-qspi.o
>  obj-pbl-$(CONFIG_ARCH_IMX9) += ele.o
> diff --git a/arch/arm/mach-imx/cpu_init.c b/arch/arm/mach-imx/cpu_init.c
> index c5a47d9b9154..aebbd3defaec 100644
> --- a/arch/arm/mach-imx/cpu_init.c
> +++ b/arch/arm/mach-imx/cpu_init.c
> @@ -6,6 +6,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -75,17 +76,26 @@ void imx8mm_cpu_lowlevel_init(void)
>   imx8m_ccgr_clock_enable(IMX8M_CCM_CCGR_SCTR);
>  
>   imx8m_cpu_lowlevel_init();
> +
> + erratum_050350_imx8m();
>  }
>  
>  void imx8mn_cpu_lowlevel_init(void)
>   __alias(imx8mm_cpu_lowlevel_init);
>  
>  void imx8mp_cpu_lowlevel_init(void)
> - __alias(imx8mm_cpu_lowlevel_init);
> +{
> + /* ungate system counter */
> + imx8m_ccgr_clock_enable(IMX8M_CCM_CCGR_SCTR);
> +
> + imx8m_cpu_lowlevel_init();
> +}
>  
>  void imx8mq_cpu_lowlevel_init(void)
>  {
>   imx8m_cpu_lowlevel_init();
> +
> + erratum_050350_imx8m();
>  }
>  
>  #define CCM_AUTHEN_TZ_NS BIT(9)
> diff --git a/arch/arm/mach-imx/errata.c b/arch/arm/mach-imx/errata.c
> new file mode 100644
> index ..ef8de91a9278
> --- /dev/null
> +++ b/arch/arm/mach-imx/errata.c
> @@ -0,0 +1,22 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +
> +#include 
> +#include 
> +#include 
> +
> +#ifdef CONFIG_CPU_V8
> +
> +extern unsigned long early_imx8m_vectors;
> +
> +void erratum_050350_imx8m(void)
> +{
> + if (current_el() != 3)
> + return;
> +
> + relocate_to_current_adr();
> +
> + asm volatile("msr vbar_el3, %0" : : "r" (_imx8m_vectors) : "cc");
> + asm volatile("msr daifclr, #4;isb");
> +}
> +
> +#endif /* CONFIG_CPU_V8 */
> diff --git a/arch/arm/mach-imx/imx8m_early_exceptions_64.S 
> b/arch/arm/mach-imx/imx8m_early_exceptions_64.S
> new file mode 100644
> index ..cd91e1a07b9c
> --- /dev/null
> +++ b/arch/arm/mach-imx/imx8m_early_exceptions_64.S
> @@ -0,0 +1,42 @@
> +/*
> + * (C) Copyright 2013
> + * David Feng 
> + *
> + * SPDX-License-Identifier:  GPL-2.0+
> + */
> +
> +#include 
> +
> +#ifdef CONFIG_CPU_V8
> 

Re: [PATCH] kbuild: make implicit int to pointer conversion warning an error

2024-05-03 Thread Sascha Hauer


On Tue, 30 Apr 2024 15:15:40 +0200, Ahmad Fatoum wrote:
> We are guilty of using ints as pointers in readl/writel, but the old
> definition of these uses a cast to silence the warning.
> 
> Everywhere else there's no reason to allow this, so make this a hard
> error always to weed out any instances we may still have.
> 
> Disallowing this has the added benefit of making it easier to change API
> in barebox: We do not guarantee out-of-tree board code API stability,
> but we want changes in API to result in build errors, not in warnings
> that may be eaten up by a build system sitting in-between Kbuild and the
> user.
> 
> [...]

Applied, thanks!

[1/1] kbuild: make implicit int to pointer conversion warning an error
  https://git.pengutronix.de/cgit/barebox/commit/?id=bcb16b721fb8 (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH 0/3] bootm: make uImage support optional

2024-05-03 Thread Sascha Hauer


On Tue, 30 Apr 2024 20:06:30 +0200, Ahmad Fatoum wrote:
> While looking into CONFIG_TIMESTAMP, I noticed we still build UIMAGE
> support unconditionally, when BOOTM is enabled. This series makes it
> optional as most users no longer need it.
> 
> Saves me 4KiB in an LZO-compressed ARM64 image.
> 
> Ahmad Fatoum (3):
>   uimage: move file_to_sdram implementation to libfile
>   bootm: allow disabling uImage support
>   uimage: have TIMESTMAP depend on UIMAGE
> 
> [...]

Applied, thanks!

[1/3] uimage: move file_to_sdram implementation to libfile
  https://git.pengutronix.de/cgit/barebox/commit/?id=7b29c539e461 (link may 
not be stable)
[2/3] bootm: allow disabling uImage support
  https://git.pengutronix.de/cgit/barebox/commit/?id=59edd0c3be21 (link may 
not be stable)
[3/3] uimage: have TIMESTMAP depend on UIMAGE
  https://git.pengutronix.de/cgit/barebox/commit/?id=76131012282d (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH master] net: workaround NICs and MDIO busses sharing same OF node

2024-05-03 Thread Sascha Hauer


On Thu, 02 May 2024 09:03:28 +0200, Ahmad Fatoum wrote:
> v2024.04.0 broke Ethernet on the Skov IMX6 board:
> 
>   ERROR: KSZ8873 MDIO mdio1-dev00: can't find ethernet master device
> 
> The board has an Ethernet switch controlled via a bitbanged
> MDIO bus and the MDIO bus of the Ethernet device is unused.
> 
> [...]

Applied, thanks!

[1/1] net: workaround NICs and MDIO busses sharing same OF node
  https://git.pengutronix.de/cgit/barebox/commit/?id=4d0598d894fd (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH] mfd: pca9450: print reset reason as hex if unknown

2024-05-03 Thread Sascha Hauer


On Thu, 02 May 2024 12:17:24 +0200, Ahmad Fatoum wrote:
> On an i.MX93-based board, it was observed that a potential ELE-induced
> reset ended up with an unknown reset reason. To aid in debugging this,
> print the value in hexadecimal when no mapping is known.
> 
> 

Applied, thanks!

[1/1] mfd: pca9450: print reset reason as hex if unknown
  https://git.pengutronix.de/cgit/barebox/commit/?id=9af02f7f50ab (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH 1/2] include: ktime: implement __ktime_divns for 32-bit systems

2024-05-03 Thread Sascha Hauer


On Thu, 02 May 2024 17:14:29 +0200, Ahmad Fatoum wrote:
> ktime_devns is an inline function for constant divisors. For
> non-constant divisors, it's only inline for 64-bit systems and calls to
> an out-of-line __ktime_divns function otherwise.
> 
> Implement the out-of-line function, so it's use of the function in
> common code is portable.
> 
> [...]

Applied, thanks!

[1/2] include: ktime: implement __ktime_divns for 32-bit systems
  https://git.pengutronix.de/cgit/barebox/commit/?id=d3f1bbc9ae16 (link may 
not be stable)
[2/2] poller: report pollers taking more than 20 milliseconds
  https://git.pengutronix.de/cgit/barebox/commit/?id=c5d2a98c51b2 (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH master] mdio_bus: return 0xFFFF when read fails with error code

2024-05-03 Thread Sascha Hauer


On Thu, 02 May 2024 17:17:23 +0200, Ahmad Fatoum wrote:
> phy_read may return an error code if the underlying transport
> misbehaves, e.g. a busy and non-recoverable I2C bus.
> 
> Instead of packing the error code value into the buffer, let's just
> report 0x, which is the natural value used for unresponsive PHYs,
> due to the pull-ups.
> 
> [...]

Applied, thanks!

[1/1] mdio_bus: return 0x when read fails with error code
  https://git.pengutronix.de/cgit/barebox/commit/?id=ff36e78033e8 (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




Re: [PATCH 1/3] net: dsa: ksz9477: always toggle reset gpio if available

2024-05-03 Thread Sascha Hauer


On Thu, 02 May 2024 17:17:55 +0200, Ahmad Fatoum wrote:
> The barebox driver currently only ensures that the switch is out of
> reset, but doesn't actually trigger a reset pulse.
> 
> The Linux driver, on the other hand, holds reset active for 10ms and
> then waits a whopping 100ms after reset deassertion.
> 
> This seems excessive by a thousandfold for at least KSZ9893R[1], whose
> datasheet states:
> 
> [...]

Applied, thanks!

[1/3] net: dsa: ksz9477: always toggle reset gpio if available
  https://git.pengutronix.de/cgit/barebox/commit/?id=372d21e79e30 (link may 
not be stable)
[2/3] net: dsa: ksz9477: report 0 as value when returning error
  https://git.pengutronix.de/cgit/barebox/commit/?id=6d42b2827243 (link may 
not be stable)
[3/3] net: dsa: ksz9477: return negative error codes on PHY access failures
  https://git.pengutronix.de/cgit/barebox/commit/?id=eefd990b4cfd (link may 
not be stable)

Best regards,
-- 
Sascha Hauer 




[PATCH 2/3] add handoff-data support

2024-04-30 Thread Sascha Hauer
We need to pass data from the PBL to barebox proper. Right now we do
this with passing the data in registers which is quite limited. As the
amount of information that has to be passed increases it's time to
overcome this limitation.

With this patch we introduce handoff-data which is a linked list of
memory blobs that can be passed from PBL to barebox proper.

The data format is done in a way that enables us to compile the list
entries and the data into the binary, so that no memory allocations
are needed in PBL.

Signed-off-by: Sascha Hauer 
---
 include/handoff-data.h |  48 +++
 pbl/Makefile   |   1 +
 pbl/handoff-data.c | 192 +
 3 files changed, 241 insertions(+)
 create mode 100644 include/handoff-data.h
 create mode 100644 pbl/handoff-data.c

diff --git a/include/handoff-data.h b/include/handoff-data.h
new file mode 100644
index 00..f5586e22fe
--- /dev/null
+++ b/include/handoff-data.h
@@ -0,0 +1,48 @@
+#ifndef __HANDOFF_DATA_H
+#define __HANDOFF_DATA_H
+
+#include 
+
+struct handoff_data {
+   struct list_head entries;
+};
+
+#define HANDOFF_DATA_BAREBOX(n)(0x28061971 + (n))
+#define HANDOFF_DATA_INTERNAL_DT   HANDOFF_DATA_BAREBOX(0)
+#define HANDOFF_DATA_INTERNAL_DT_Z HANDOFF_DATA_BAREBOX(1)
+#define HANDOFF_DATA_EXTERNAL_DT   HANDOFF_DATA_BAREBOX(2)
+#define HANDOFF_DATA_BOARDDATA HANDOFF_DATA_BAREBOX(3)
+
+#define HANDOFF_DATA_BOARD(n)  (0x951726fb + (n))
+
+struct handoff_data_entry {
+   struct list_head list;
+   void *data;
+   size_t size;
+   unsigned int cookie;
+#define HANDOFF_DATA_FLAG_NO_COPY  BIT(0)
+   unsigned int flags;
+};
+
+#define handoff_data_add_flags(_cookie, _data, _size, _flags)  \
+   do {\
+   static struct handoff_data_entry hde;   \
+   hde.cookie = _cookie;   \
+   hde.data = _data;   \
+   hde.size = _size;   \
+   hde.flags = _flags; \
+   \
+   handoff_data_add_entry();   \
+   } while (0);
+
+#define handoff_data_add(_cookie, _data, _size)\
+   handoff_data_add_flags((_cookie), (_data), (_size), 0)
+
+void handoff_data_add_entry(struct handoff_data_entry *entry);
+size_t handoff_data_size(void);
+void handoff_data_move(void *dest);
+void handoff_data_set(struct handoff_data *handoff);
+void *handoff_data_get_entry(unsigned int cookie, size_t *size);
+int handoff_data_show(void);
+
+#endif /* __HANDOFF_DATA_H */
diff --git a/pbl/Makefile b/pbl/Makefile
index f6e98e78be..79837c5611 100644
--- a/pbl/Makefile
+++ b/pbl/Makefile
@@ -8,3 +8,4 @@ pbl-y += string.o
 pbl-y += decomp.o
 pbl-$(CONFIG_LIBFDT) += fdt.o
 pbl-$(CONFIG_PBL_CONSOLE) += console.o
+obj-pbl-y += handoff-data.o
diff --git a/pbl/handoff-data.c b/pbl/handoff-data.c
new file mode 100644
index 00..fcb27234a6
--- /dev/null
+++ b/pbl/handoff-data.c
@@ -0,0 +1,192 @@
+// SPDX-License-Identifier: GPL-2.0
+#include 
+#include 
+#include 
+#include 
+#include 
+
+static struct handoff_data *handoff_data = (void *)-1;
+
+static struct handoff_data *handoff_data_get(void)
+{
+   static struct handoff_data __handoff_data;
+
+   /*
+* Sometimes the PBL copies itself to some other location and is
+* re-entered at that location. For example on some i.MX SoCs we have
+* to move the PBL out of the SRAM (which will be occupied by the TF-A
+* later). We force the handoff_data variable into the data segment.
+* When moving the PBL somewhere else with handoff_data set we move the
+* content of the variable with it and thus find it to have the correct
+* value in the new PBL.
+*/
+   if (handoff_data == (void *)-1) {
+   handoff_data = &__handoff_data;
+   INIT_LIST_HEAD(_data->entries);
+   }
+
+   return handoff_data;
+}
+
+/**
+ * handoff_data_set - set the handoff data to be at a specified pointer
+ * @handoff: the place where the handoff data is
+ *
+ * This sets the handoff data to @handoff. To be used by barebox proper
+ * to pass the place where the handoff data has been placed by the PBL.
+ */
+void handoff_data_set(struct handoff_data *handoff)
+{
+   handoff_data = handoff;
+}
+
+/**
+ * handoff_data_add_entry - add a new handoff data entry
+ * @hde: the new entry
+ *
+ * This adds a new handoff data entry.
+ */
+void handoff_data_add_entry(struct handoff_data_entry *hde)
+{
+   struct handoff_data *hd = handoff_data_get();
+
+   list_add_tail(>list, >entries);
+}
+
+/**
+ * handoff_data_size - calculate the handoff data size
+ *
+ * This calculates the size needed for the current handoff 

[PATCH 3/3] ARM: pass handoff data from PBL to proper

2024-04-30 Thread Sascha Hauer
Use newly introduced handoff data to pass data from PBL to barebox
proper. This will allow us later to pass more SoC and/or board specific
data from PBL to barebox proper.

Signed-off-by: Sascha Hauer 
---
 arch/arm/cpu/start.c  | 53 ---
 arch/arm/cpu/uncompress.c | 33 +---
 2 files changed, 45 insertions(+), 41 deletions(-)

diff --git a/arch/arm/cpu/start.c b/arch/arm/cpu/start.c
index c13e93c243..b9dbe1f2fb 100644
--- a/arch/arm/cpu/start.c
+++ b/arch/arm/cpu/start.c
@@ -21,6 +21,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -38,10 +39,9 @@ static unsigned long barebox_boarddata_size;
 
 const struct barebox_boarddata *barebox_get_boarddata(void)
 {
-   if (!barebox_boarddata || !blob_is_arm_boarddata(barebox_boarddata))
-   return NULL;
+   size_t size;
 
-   return barebox_boarddata;
+   return handoff_data_get_entry(HANDOFF_DATA_BOARDDATA, );
 }
 
 u32 barebox_arm_machine(void)
@@ -56,19 +56,24 @@ void *barebox_arm_boot_dtb(void)
int ret = 0;
struct barebox_boarddata_compressed_dtb *compressed_dtb;
static void *boot_dtb;
+   void *blob;
+   size_t size;
 
if (boot_dtb)
return boot_dtb;
 
-   if (barebox_boarddata && blob_is_fdt(barebox_boarddata)) {
-   pr_debug("%s: using barebox_boarddata\n", __func__);
-   return barebox_boarddata;
-   }
+   blob = handoff_data_get_entry(HANDOFF_DATA_INTERNAL_DT, );
+   if (blob)
+   return blob;
+
+   blob = handoff_data_get_entry(HANDOFF_DATA_INTERNAL_DT_Z, );
+   if (!blob)
+   return NULL;
 
-   if (!fdt_blob_can_be_decompressed(barebox_boarddata))
+   if (!fdt_blob_can_be_decompressed(blob))
return NULL;
 
-   compressed_dtb = barebox_boarddata;
+   compressed_dtb = blob;
 
pr_debug("%s: using compressed_dtb\n", __func__);
 
@@ -167,34 +172,6 @@ __noreturn __prereloc void barebox_non_pbl_start(unsigned 
long membase,
arm_barebox_size = barebox_size;
malloc_end = barebox_base;
 
-   if (boarddata) {
-   uint32_t totalsize = 0;
-   const char *name;
-
-   if (blob_is_fdt(boarddata)) {
-   totalsize = get_unaligned_be32(boarddata + 4);
-   name = "DTB";
-   } else if (blob_is_compressed_fdt(boarddata)) {
-   struct barebox_boarddata_compressed_dtb *bd = boarddata;
-   totalsize = bd->datalen + sizeof(*bd);
-   name = "Compressed DTB";
-   } else if (blob_is_arm_boarddata(boarddata)) {
-   totalsize = sizeof(struct barebox_arm_boarddata);
-   name = "machine type";
-   }
-
-   if (totalsize) {
-   unsigned long mem = arm_mem_boarddata(membase, endmem,
- totalsize);
-   pr_debug("found %s in boarddata, copying to 0x%08lx\n",
-name, mem);
-   barebox_boarddata = memcpy((void *)mem, boarddata,
-  totalsize);
-   barebox_boarddata_size = totalsize;
-   malloc_end = mem;
-   }
-   }
-
/*
 * Maximum malloc space is the Kconfig value if given
 * or 1GB.
@@ -216,6 +193,8 @@ __noreturn __prereloc void barebox_non_pbl_start(unsigned 
long membase,
 
mem_malloc_init((void *)malloc_start, (void *)malloc_end - 1);
 
+   handoff_data_set(boarddata);
+
if (IS_ENABLED(CONFIG_BOOTM_OPTEE))
of_add_reserve_entry(endmem - OPTEE_SIZE, endmem - 1);
 
diff --git a/arch/arm/cpu/uncompress.c b/arch/arm/cpu/uncompress.c
index aa1a49bfc9..a29703e760 100644
--- a/arch/arm/cpu/uncompress.c
+++ b/arch/arm/cpu/uncompress.c
@@ -10,6 +10,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -18,6 +19,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -29,6 +31,22 @@ unsigned long free_mem_end_ptr;
 extern unsigned char input_data[];
 extern unsigned char input_data_end[];
 
+static void add_handoff_data(void *boarddata)
+{
+   if (blob_is_fdt(boarddata)) {
+   handoff_data_add(HANDOFF_DATA_INTERNAL_DT, boarddata,
+get_unaligned_be32(boarddata + 4));
+   } else if (blob_is_compressed_fdt(boarddata)) {
+   struct barebox_boarddata_compressed_dtb *bd = boarddata;
+
+   handoff_data_add(HANDOFF_DATA_INTERNAL_DT_Z, boarddata,
+bd->datalen + sizeof(*bd));
+   } else if (blob_is_arm_boarddata(boardd

[PATCH 1/3] ARM: move blob_is_arm_boarddata() to include

2024-04-30 Thread Sascha Hauer
Signed-off-by: Sascha Hauer 
---
 arch/arm/cpu/start.c   | 7 ---
 arch/arm/include/asm/barebox-arm.h | 7 +++
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/arm/cpu/start.c b/arch/arm/cpu/start.c
index 6d0a7cfc6b..c13e93c243 100644
--- a/arch/arm/cpu/start.c
+++ b/arch/arm/cpu/start.c
@@ -36,13 +36,6 @@ static unsigned long arm_membase;
 static void *barebox_boarddata;
 static unsigned long barebox_boarddata_size;
 
-static bool blob_is_arm_boarddata(const void *blob)
-{
-   const struct barebox_arm_boarddata *bd = blob;
-
-   return bd->magic == BAREBOX_ARM_BOARDDATA_MAGIC;
-}
-
 const struct barebox_boarddata *barebox_get_boarddata(void)
 {
if (!barebox_boarddata || !blob_is_arm_boarddata(barebox_boarddata))
diff --git a/arch/arm/include/asm/barebox-arm.h 
b/arch/arm/include/asm/barebox-arm.h
index 4d70360b91..67f2b6ac45 100644
--- a/arch/arm/include/asm/barebox-arm.h
+++ b/arch/arm/include/asm/barebox-arm.h
@@ -32,6 +32,13 @@ void __noreturn barebox_arm_entry(unsigned long membase, 
unsigned long memsize,
 #define barebox_arm_boarddata  barebox_boarddata
 #define BAREBOX_ARM_BOARDDATA_MAGICBAREBOX_BOARDDATA_MAGIC
 
+static inline bool blob_is_arm_boarddata(const void *blob)
+{
+   const struct barebox_arm_boarddata *bd = blob;
+
+   return bd->magic == BAREBOX_ARM_BOARDDATA_MAGIC;
+}
+
 u32 barebox_arm_machine(void);
 
 unsigned long arm_mem_ramoops_get(void);
-- 
2.39.2




[PATCH 0/3] add PBL handoff-data support

2024-04-30 Thread Sascha Hauer
We need to pass data from the PBL to barebox proper. Right now we do
this with passing the data in registers which is quite limited. As the
amount of information that has to be passed increases it's time to
overcome this limitation.

This series introduces handoff-data which is a linked list of memory
blobs that can be passed from PBL to barebox proper. Board and SoC
code can append this list with their own entries and pick them up later
in barebox proper. The ARM architecture is converted over to use handoff
data, other architectures could follow.

Sascha Hauer (3):
  ARM: move blob_is_arm_boarddata() to include
  add handoff-data support
  ARM: pass handoff data from PBL to proper

 arch/arm/cpu/start.c   |  60 +++--
 arch/arm/cpu/uncompress.c  |  33 -
 arch/arm/include/asm/barebox-arm.h |   7 ++
 include/handoff-data.h |  48 
 pbl/Makefile   |   1 +
 pbl/handoff-data.c | 192 +
 6 files changed, 293 insertions(+), 48 deletions(-)
 create mode 100644 include/handoff-data.h
 create mode 100644 pbl/handoff-data.c

-- 
2.39.2




[PATCH] treewide: use runtime_address() where possible

2024-04-29 Thread Sascha Hauer
We now have runtime_address() to access a linker variable when the
binary is not yet relocated to the correct address. It provides a
safer API, so use this one where possible instead of using previous
way of adding get_runtime_offset() manually.

Signed-off-by: Sascha Hauer 
---
 arch/arm/boards/ac-sxb/lowlevel.c |  2 +-
 arch/arm/boards/afi-gf/lowlevel.c |  2 +-
 arch/arm/boards/at91sam9263ek/lowlevel_init.c |  2 +-
 arch/arm/boards/at91sam9x5ek/lowlevel.c   |  2 +-
 arch/arm/boards/avnet-zedboard/lowlevel.c |  3 +-
 arch/arm/boards/beaglebone/lowlevel.c |  6 ++--
 .../boundarydevices-nitrogen6/lowlevel.c  | 10 +++---
 arch/arm/boards/ccxmx51/lowlevel.c|  2 +-
 arch/arm/boards/ccxmx53/lowlevel.c|  4 +--
 arch/arm/boards/clep7212/lowlevel.c   |  4 +--
 arch/arm/boards/datamodul-edm-qmx6/lowlevel.c |  2 +-
 arch/arm/boards/dfi-fs700-m60/lowlevel.c  |  6 ++--
 arch/arm/boards/duckbill/lowlevel.c   |  2 +-
 arch/arm/boards/efika-mx-smartbook/lowlevel.c |  2 +-
 arch/arm/boards/element14-warp7/lowlevel.c|  2 +-
 arch/arm/boards/eltec-hipercam/lowlevel.c |  2 +-
 arch/arm/boards/embedsky-e9/lowlevel.c|  2 +-
 arch/arm/boards/embest-marsboard/lowlevel.c   |  2 +-
 arch/arm/boards/embest-riotboard/lowlevel.c   |  2 +-
 arch/arm/boards/enclustra-aa1/lowlevel.c  |  6 ++--
 arch/arm/boards/freescale-mx28-evk/lowlevel.c |  2 +-
 .../boards/freescale-mx51-babbage/lowlevel.c  |  2 +-
 arch/arm/boards/freescale-mx53-qsb/lowlevel.c |  4 +--
 .../boards/freescale-mx53-vmx53/lowlevel.c|  2 +-
 .../boards/freescale-mx6-sabresd/lowlevel.c   |  6 ++--
 .../freescale-mx6sx-sabresdb/lowlevel.c   |  2 +-
 .../boards/freescale-mx7-sabresd/lowlevel.c   |  2 +-
 .../arm/boards/freescale-vf610-twr/lowlevel.c |  2 +-
 arch/arm/boards/gateworks-ventana/lowlevel.c  |  2 +-
 arch/arm/boards/gk802/lowlevel.c  |  2 +-
 .../boards/globalscale-guruplug/lowlevel.c|  3 +-
 .../arm/boards/globalscale-mirabox/lowlevel.c |  3 +-
 arch/arm/boards/grinn-liteboard/lowlevel.c|  3 +-
 arch/arm/boards/guf-vincell/lowlevel.c|  4 +--
 .../kamstrup-mx7-concentrator/lowlevel.c  |  2 +-
 arch/arm/boards/karo-tx25/lowlevel.c  |  2 +-
 arch/arm/boards/karo-tx53/lowlevel.c  |  7 ++--
 arch/arm/boards/karo-tx6x/lowlevel.c  |  8 ++---
 arch/arm/boards/kindle-mx50/lowlevel.c|  6 ++--
 arch/arm/boards/kontron-samx6i/lowlevel.c |  9 ++
 arch/arm/boards/lenovo-ix4-300d/lowlevel.c|  3 +-
 arch/arm/boards/lxa-mc1/lowlevel.c|  2 +-
 .../boards/marvell-armada-xp-db/lowlevel.c|  2 +-
 .../boards/marvell-armada-xp-gp/lowlevel.c|  2 +-
 arch/arm/boards/meerkat96/lowlevel.c  |  2 +-
 .../boards/microchip-ksz9477-evb/lowlevel.c   |  2 +-
 .../boards/microchip-sama5d3-eds/lowlevel.c   |  2 +-
 arch/arm/boards/myirtech-x335x/lowlevel.c |  4 +--
 arch/arm/boards/netgear-rn104/lowlevel.c  |  3 +-
 arch/arm/boards/netgear-rn2120/lowlevel.c |  3 +-
 arch/arm/boards/nvidia-beaver/entry.c |  2 +-
 arch/arm/boards/nvidia-jetson-tk1/entry.c |  2 +-
 .../boards/phytec-phycard-imx27/lowlevel.c|  2 +-
 .../boards/phytec-phycore-imx27/lowlevel.c|  2 +-
 .../arm/boards/phytec-phycore-imx7/lowlevel.c |  2 +-
 .../boards/phytec-phycore-stm32mp1/lowlevel.c |  2 +-
 arch/arm/boards/phytec-som-am335x/lowlevel.c  |  9 ++
 arch/arm/boards/phytec-som-imx6/lowlevel.c|  7 ++--
 arch/arm/boards/phytec-som-rk3288/lowlevel.c  |  2 +-
 .../boards/plathome-openblocks-a6/lowlevel.c  |  3 +-
 .../boards/plathome-openblocks-ax3/lowlevel.c |  3 +-
 arch/arm/boards/protonic-imx6/lowlevel.c  | 32 +--
 arch/arm/boards/protonic-stm32mp1/lowlevel.c  |  6 ++--
 arch/arm/boards/radxa-rock/lowlevel.c |  2 +-
 arch/arm/boards/raspberry-pi/lowlevel.c   | 10 +++---
 arch/arm/boards/reflex-achilles/lowlevel.c|  4 +--
 .../arm/boards/sama5d27-giantboard/lowlevel.c |  2 +-
 arch/arm/boards/sama5d27-som1/lowlevel.c  |  2 +-
 arch/arm/boards/sama5d3_xplained/lowlevel.c   |  2 +-
 arch/arm/boards/sama5d4_wifx/lowlevel.c   |  2 +-
 arch/arm/boards/scb9328/lowlevel.c|  2 +-
 arch/arm/boards/seeed-odyssey/lowlevel.c  |  2 +-
 arch/arm/boards/skov-arm9cpu/lowlevel.c   |  2 +-
 arch/arm/boards/solidrun-cubox/lowlevel.c |  2 +-
 arch/arm/boards/solidrun-microsom/lowlevel.c  | 18 +--
 arch/arm/boards/stm32mp15x-ev1/lowlevel.c |  2 +-
 arch/arm/boards/stm32mp15xx-dkx/lowlevel.c|  6 ++--
 .../boards/technexion-pico-hobbit/lowlevel.c  |  8 ++---
 arch/arm/boards/toradex-colibri-t20/entry.c   |  2 +-
 arch/arm/boards/toshiba-ac100/entry.c |  2 +-
 arch/arm/boards/tqma53/lowlevel.c |  4 +--
 arch/arm/boards/tqma6x/lowlevel.c |  4 +--
 arch/arm/boards/turris-omnia/lowlevel.c   |  3 +-
 arch/arm/boards/udoo-neo/lowlevel.c   |  2 +-
 arch/arm/boards/udoo

[PATCH] ARM: remove MLO target

2024-04-29 Thread Sascha Hauer
All am335x boards use multi image support, so the MLO target is unused.
Remove it.

Signed-off-by: Sascha Hauer 
---
 arch/arm/Makefile | 10 --
 1 file changed, 10 deletions(-)

diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index f91fcb0454..6785432c52 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -112,16 +112,6 @@ KBUILD_CFLAGS_KERNEL += -fPIE
 
 KBUILD_BINARY := barebox.bin
 
-quiet_cmd_mlo ?= IFT $@
-   cmd_mlo ?= scripts/omap_signGP -o MLO -l $(TEXT_BASE) -c $<
-
-MLO: $(KBUILD_BINARY)
-   $(call if_changed,mlo)
-
-ifeq ($(CONFIG_OMAP_BUILD_IFT),y)
-KBUILD_IMAGE := MLO
-endif
-
 archclean:
$(MAKE) $(clean)=$(pbl)
 
-- 
2.39.2




  1   2   3   4   5   6   7   8   9   10   >