mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 0/4] pbl and debug_ll fixes
@ 2024-06-07  0:12 Antony Pavlov
  2024-06-07  0:12 ` [PATCH 1/4] pbl: enable image verification for MIPS and RISC-V too Antony Pavlov
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Antony Pavlov @ 2024-06-07  0:12 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

Antony Pavlov (4):
  pbl: enable image verification for MIPS and RISC-V too
  RISC-V: fix crash on start if CONFIG_IMAGE_COMPRESSION_NONE=y
  ARM: bcm283x: fix compilation with debug_ll enabled
  ARM: vexpress: make debug_ll work

 arch/riscv/boot/start.c          | 11 ++++++++---
 include/mach/bcm283x/debug_ll.h  |  2 ++
 include/mach/vexpress/debug_ll.h | 12 +-----------
 pbl/Kconfig                      |  2 +-
 4 files changed, 12 insertions(+), 15 deletions(-)

-- 
2.39.0




^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/4] pbl: enable image verification for MIPS and RISC-V too
  2024-06-07  0:12 [PATCH 0/4] pbl and debug_ll fixes Antony Pavlov
@ 2024-06-07  0:12 ` Antony Pavlov
  2024-06-07  0:12 ` [PATCH 2/4] RISC-V: fix crash on start if CONFIG_IMAGE_COMPRESSION_NONE=y Antony Pavlov
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Antony Pavlov @ 2024-06-07  0:12 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
 pbl/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pbl/Kconfig b/pbl/Kconfig
index d1877a988d2..5ff2a6ad3c3 100644
--- a/pbl/Kconfig
+++ b/pbl/Kconfig
@@ -54,7 +54,7 @@ config PBL_FULLY_PIC
 	  the code sections.
 
 config PBL_VERIFY_PIGGY
-	depends on ARM
+	depends on ARM || MIPS || RISCV
 	bool "Verify barebox proper hash before decompression" if COMPILE_TEST
 
 config BOARD_GENERIC_DT
-- 
2.39.0




^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 2/4] RISC-V: fix crash on start if CONFIG_IMAGE_COMPRESSION_NONE=y
  2024-06-07  0:12 [PATCH 0/4] pbl and debug_ll fixes Antony Pavlov
  2024-06-07  0:12 ` [PATCH 1/4] pbl: enable image verification for MIPS and RISC-V too Antony Pavlov
@ 2024-06-07  0:12 ` Antony Pavlov
  2024-06-07  0:12 ` [PATCH 3/4] ARM: bcm283x: fix compilation with debug_ll enabled Antony Pavlov
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Antony Pavlov @ 2024-06-07  0:12 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

Use the same approach as ARM barebox uses.

See also 6c03bdf8f99 ("kbuild: pbl: use same compression algo for both
barebox and DTB").

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
 arch/riscv/boot/start.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/arch/riscv/boot/start.c b/arch/riscv/boot/start.c
index 2e18105bbfb..ab9bb6f320f 100644
--- a/arch/riscv/boot/start.c
+++ b/arch/riscv/boot/start.c
@@ -35,7 +35,7 @@ static unsigned long barebox_boarddata_size;
 void *barebox_riscv_boot_dtb(void)
 {
 	void *dtb;
-	int ret;
+	int ret = 0;
 	struct barebox_boarddata_compressed_dtb *compressed_dtb;
 	static void *boot_dtb;
 
@@ -58,8 +58,13 @@ void *barebox_riscv_boot_dtb(void)
 	if (!dtb)
 		return NULL;
 
-	ret = uncompress(compressed_dtb->data, compressed_dtb->datalen,
-			 NULL, NULL, dtb, NULL, NULL);
+	if (IS_ENABLED(CONFIG_IMAGE_COMPRESSION_NONE))
+		memcpy(dtb, compressed_dtb->data,
+		       compressed_dtb->datalen_uncompressed);
+	else
+		ret = uncompress(compressed_dtb->data, compressed_dtb->datalen,
+				 NULL, NULL, dtb, NULL, NULL);
+
 	if (ret) {
 		pr_err("uncompressing dtb failed\n");
 		free(dtb);
-- 
2.39.0




^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 3/4] ARM: bcm283x: fix compilation with debug_ll enabled
  2024-06-07  0:12 [PATCH 0/4] pbl and debug_ll fixes Antony Pavlov
  2024-06-07  0:12 ` [PATCH 1/4] pbl: enable image verification for MIPS and RISC-V too Antony Pavlov
  2024-06-07  0:12 ` [PATCH 2/4] RISC-V: fix crash on start if CONFIG_IMAGE_COMPRESSION_NONE=y Antony Pavlov
@ 2024-06-07  0:12 ` Antony Pavlov
  2024-06-07  0:12 ` [PATCH 4/4] ARM: vexpress: make debug_ll work Antony Pavlov
  2024-06-10 12:25 ` [PATCH 0/4] pbl and debug_ll fixes Sascha Hauer
  4 siblings, 0 replies; 8+ messages in thread
From: Antony Pavlov @ 2024-06-07  0:12 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

How to reproduce compilation error:

1. make multi_v7_defconfig
2. enable CONFIG_DEBUG_LL=y and CONFIG_DEBUG_RPI3_MINI_UART=y
3. make
...

include/mach/bcm283x/debug_ll.h: In function ‘debug_ll_init’:
include/mach/bcm283x/debug_ll.h:56:41: error: implicit declaration of
function ‘BIT’ [-Werror=imp
licit-function-declaration]
   56 | #define BCM2836_AUX_CLOCK_EN_UART       BIT(0) /* Bit 0 enables
      the Miniuart */
      |                                         ^~~

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
 include/mach/bcm283x/debug_ll.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/mach/bcm283x/debug_ll.h b/include/mach/bcm283x/debug_ll.h
index 844305109aa..8bbff4fd9a2 100644
--- a/include/mach/bcm283x/debug_ll.h
+++ b/include/mach/bcm283x/debug_ll.h
@@ -52,6 +52,8 @@ static inline void debug_ll_write_reg(void __iomem *base, int reg, uint8_t val)
 	writeb(val, base + (reg << 2));
 }
 
+#include <linux/bits.h>
+
 #define BCM2836_AUX_CLOCK_ENB		0x3f215004 /* BCM2835 AUX Clock enable register */
 #define BCM2836_AUX_CLOCK_EN_UART	BIT(0) /* Bit 0 enables the Miniuart */
 
-- 
2.39.0




^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 4/4] ARM: vexpress: make debug_ll work
  2024-06-07  0:12 [PATCH 0/4] pbl and debug_ll fixes Antony Pavlov
                   ` (2 preceding siblings ...)
  2024-06-07  0:12 ` [PATCH 3/4] ARM: bcm283x: fix compilation with debug_ll enabled Antony Pavlov
@ 2024-06-07  0:12 ` Antony Pavlov
  2024-06-07  6:24   ` Antony Pavlov
  2024-06-10 12:25 ` [PATCH 0/4] pbl and debug_ll fixes Sascha Hauer
  4 siblings, 1 reply; 8+ messages in thread
From: Antony Pavlov @ 2024-06-07  0:12 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

The UART address from dtb is used.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
 include/mach/vexpress/debug_ll.h | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/include/mach/vexpress/debug_ll.h b/include/mach/vexpress/debug_ll.h
index cd01d5d0185..3d67e7645d3 100644
--- a/include/mach/vexpress/debug_ll.h
+++ b/include/mach/vexpress/debug_ll.h
@@ -7,17 +7,7 @@
 #ifndef __MACH_VEXPRESS_DEBUG_LL_H__
 #define   __MACH_VEXPRESS_DEBUG_LL_H__
 
-#include <linux/amba/serial.h>
-#include <io.h>
-
-#define DEBUG_LL_PHYS_BASE		0x10000000
-#define DEBUG_LL_PHYS_BASE_RS1		0x1c000000
-
-#ifdef MP
-#define DEBUG_LL_UART_ADDR DEBUG_LL_PHYS_BASE
-#else
-#define DEBUG_LL_UART_ADDR DEBUG_LL_PHYS_BASE_RS1
-#endif
+#define DEBUG_LL_UART_ADDR 0x1c090000
 
 #include <debug_ll/pl011.h>
 
-- 
2.39.0




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 4/4] ARM: vexpress: make debug_ll work
  2024-06-07  0:12 ` [PATCH 4/4] ARM: vexpress: make debug_ll work Antony Pavlov
@ 2024-06-07  6:24   ` Antony Pavlov
  2024-06-10 12:28     ` Sascha Hauer
  0 siblings, 1 reply; 8+ messages in thread
From: Antony Pavlov @ 2024-06-07  6:24 UTC (permalink / raw)
  To: Antony Pavlov; +Cc: barebox, Ahmad Fatoum

On Fri,  7 Jun 2024 03:12:59 +0300
Antony Pavlov <antonynpavlov@gmail.com> wrote:

Hi All!

Please fix misspelling in the subject of the original patch message. I have missed final "s" in the word "works".

The subject should be "ARM: vexpress: make debug_ll works".

> The UART address from dtb is used.
> 
> Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
> ---
>  include/mach/vexpress/debug_ll.h | 12 +-----------
>  1 file changed, 1 insertion(+), 11 deletions(-)
> 
> diff --git a/include/mach/vexpress/debug_ll.h b/include/mach/vexpress/debug_ll.h
> index cd01d5d0185..3d67e7645d3 100644
> --- a/include/mach/vexpress/debug_ll.h
> +++ b/include/mach/vexpress/debug_ll.h
> @@ -7,17 +7,7 @@
>  #ifndef __MACH_VEXPRESS_DEBUG_LL_H__
>  #define   __MACH_VEXPRESS_DEBUG_LL_H__
>  
> -#include <linux/amba/serial.h>
> -#include <io.h>
> -
> -#define DEBUG_LL_PHYS_BASE		0x10000000
> -#define DEBUG_LL_PHYS_BASE_RS1		0x1c000000
> -
> -#ifdef MP
> -#define DEBUG_LL_UART_ADDR DEBUG_LL_PHYS_BASE
> -#else
> -#define DEBUG_LL_UART_ADDR DEBUG_LL_PHYS_BASE_RS1
> -#endif
> +#define DEBUG_LL_UART_ADDR 0x1c090000
>  
>  #include <debug_ll/pl011.h>
>  
> -- 
> 2.39.0
> 


-- 
Best regards,
  Antony Pavlov



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/4] pbl and debug_ll fixes
  2024-06-07  0:12 [PATCH 0/4] pbl and debug_ll fixes Antony Pavlov
                   ` (3 preceding siblings ...)
  2024-06-07  0:12 ` [PATCH 4/4] ARM: vexpress: make debug_ll work Antony Pavlov
@ 2024-06-10 12:25 ` Sascha Hauer
  4 siblings, 0 replies; 8+ messages in thread
From: Sascha Hauer @ 2024-06-10 12:25 UTC (permalink / raw)
  To: barebox, Antony Pavlov; +Cc: Ahmad Fatoum


On Fri, 07 Jun 2024 03:12:55 +0300, Antony Pavlov wrote:
> Antony Pavlov (4):
>   pbl: enable image verification for MIPS and RISC-V too
>   RISC-V: fix crash on start if CONFIG_IMAGE_COMPRESSION_NONE=y
>   ARM: bcm283x: fix compilation with debug_ll enabled
>   ARM: vexpress: make debug_ll work
> 
> arch/riscv/boot/start.c          | 11 ++++++++---
>  include/mach/bcm283x/debug_ll.h  |  2 ++
>  include/mach/vexpress/debug_ll.h | 12 +-----------
>  pbl/Kconfig                      |  2 +-
>  4 files changed, 12 insertions(+), 15 deletions(-)
> 
> [...]

Applied, thanks!

[1/4] pbl: enable image verification for MIPS and RISC-V too
      https://git.pengutronix.de/cgit/barebox/commit/?id=52268376496b (link may not be stable)
[2/4] RISC-V: fix crash on start if CONFIG_IMAGE_COMPRESSION_NONE=y
      https://git.pengutronix.de/cgit/barebox/commit/?id=c66d877a7b3d (link may not be stable)
[3/4] ARM: bcm283x: fix compilation with debug_ll enabled
      https://git.pengutronix.de/cgit/barebox/commit/?id=462373cde141 (link may not be stable)
[4/4] ARM: vexpress: make debug_ll work
      https://git.pengutronix.de/cgit/barebox/commit/?id=3a154b29d16e (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 4/4] ARM: vexpress: make debug_ll work
  2024-06-07  6:24   ` Antony Pavlov
@ 2024-06-10 12:28     ` Sascha Hauer
  0 siblings, 0 replies; 8+ messages in thread
From: Sascha Hauer @ 2024-06-10 12:28 UTC (permalink / raw)
  To: Antony Pavlov; +Cc: barebox, Ahmad Fatoum

On Fri, Jun 07, 2024 at 09:24:09AM +0300, Antony Pavlov wrote:
> On Fri,  7 Jun 2024 03:12:59 +0300
> Antony Pavlov <antonynpavlov@gmail.com> wrote:
> 
> Hi All!
> 
> Please fix misspelling in the subject of the original patch message. I
> have missed final "s" in the word "works".
> 
> The subject should be "ARM: vexpress: make debug_ll works".

No, it shouldn't. The original spelling is fine.

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-5555 |



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-06-10 12:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-07  0:12 [PATCH 0/4] pbl and debug_ll fixes Antony Pavlov
2024-06-07  0:12 ` [PATCH 1/4] pbl: enable image verification for MIPS and RISC-V too Antony Pavlov
2024-06-07  0:12 ` [PATCH 2/4] RISC-V: fix crash on start if CONFIG_IMAGE_COMPRESSION_NONE=y Antony Pavlov
2024-06-07  0:12 ` [PATCH 3/4] ARM: bcm283x: fix compilation with debug_ll enabled Antony Pavlov
2024-06-07  0:12 ` [PATCH 4/4] ARM: vexpress: make debug_ll work Antony Pavlov
2024-06-07  6:24   ` Antony Pavlov
2024-06-10 12:28     ` Sascha Hauer
2024-06-10 12:25 ` [PATCH 0/4] pbl and debug_ll fixes Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox