mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 0/5] ARM: rpi: refactor debug_ll
@ 2019-03-06  9:42 Sascha Hauer
  2019-03-06  9:42 ` [PATCH 1/5] ARM: rpi: Move UART base address definitions to header file Sascha Hauer
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Sascha Hauer @ 2019-03-06  9:42 UTC (permalink / raw)
  To: Barebox List

This picks up the series from Tomaž and also adds mini UART early
debugging support useful for the rpi3 which comes up with this
UART by default.
The ns16550 early debugging support is done in a generic way which
I tested on Layerscape. I don't have any raspberry pies here, so
totally untested on these boards.

Sascha

Sascha Hauer (5):
  ARM: rpi: Move UART base address definitions to header file
  debug_ll: Move pl011 header file to architecture independent place
  debug_ll: Add ns16550 early debugging functions
  ARM: rpi: move debug UART Kconfig settings
  ARM: rpi: Add mini UART debug_ll support

 arch/arm/boards/raspberry-pi/rpi-common.c     |  5 +-
 arch/arm/mach-bcm283x/Kconfig                 | 20 -------
 arch/arm/mach-bcm283x/include/mach/debug_ll.h | 51 +++++++++++++++--
 arch/arm/mach-bcm283x/include/mach/platform.h |  4 ++
 .../arm/mach-highbank/include/mach/debug_ll.h |  2 +-
 arch/arm/mach-qemu/include/mach/debug_ll.h    |  2 +-
 .../mach-versatile/include/mach/debug_ll.h    |  2 +-
 .../arm/mach-vexpress/include/mach/debug_ll.h |  2 +-
 common/Kconfig                                | 19 +++++++
 include/debug_ll/ns16550.h                    | 56 +++++++++++++++++++
 .../debug_ll/pl011.h                          |  0
 11 files changed, 130 insertions(+), 33 deletions(-)
 create mode 100644 include/debug_ll/ns16550.h
 rename arch/arm/include/asm/debug_ll_pl011.h => include/debug_ll/pl011.h (100%)

-- 
2.20.1


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

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

* [PATCH 1/5] ARM: rpi: Move UART base address definitions to header file
  2019-03-06  9:42 [PATCH 0/5] ARM: rpi: refactor debug_ll Sascha Hauer
@ 2019-03-06  9:42 ` Sascha Hauer
  2019-03-06  9:42 ` [PATCH 2/5] debug_ll: Move pl011 header file to architecture independent place Sascha Hauer
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Sascha Hauer @ 2019-03-06  9:42 UTC (permalink / raw)
  To: Barebox List

Move defines to header file to make them reusable.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/boards/raspberry-pi/rpi-common.c     | 5 +----
 arch/arm/mach-bcm283x/include/mach/platform.h | 4 ++++
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boards/raspberry-pi/rpi-common.c b/arch/arm/boards/raspberry-pi/rpi-common.c
index 9d334cde12..60cea7f8e9 100644
--- a/arch/arm/boards/raspberry-pi/rpi-common.c
+++ b/arch/arm/boards/raspberry-pi/rpi-common.c
@@ -34,6 +34,7 @@
 
 #include <mach/core.h>
 #include <mach/mbox.h>
+#include <mach/platform.h>
 
 #include "rpi.h"
 #include "lowlevel.h"
@@ -320,10 +321,6 @@ static int rpi_clock_init(void)
 }
 postconsole_initcall(rpi_clock_init);
 
-#define BCM2835_PL011_BASE 0x20201000
-#define BCM2836_PL011_BASE 0x3f201000
-#define BCM2836_MINIUART_BASE 0x3f215040
-
 static int rpi_console_clock_init(void)
 {
 	struct clk *clk;
diff --git a/arch/arm/mach-bcm283x/include/mach/platform.h b/arch/arm/mach-bcm283x/include/mach/platform.h
index 80b529a46f..d8561c1610 100644
--- a/arch/arm/mach-bcm283x/include/mach/platform.h
+++ b/arch/arm/mach-bcm283x/include/mach/platform.h
@@ -30,6 +30,10 @@
 
 #define BCM2835_CACHELINE_SIZE	64
 
+#define BCM2835_PL011_BASE 0x20201000
+#define BCM2836_PL011_BASE 0x3f201000
+#define BCM2836_MINIUART_BASE 0x3f215040
+
 #endif
 
 /* END */
-- 
2.20.1


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

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

* [PATCH 2/5] debug_ll: Move pl011 header file to architecture independent place
  2019-03-06  9:42 [PATCH 0/5] ARM: rpi: refactor debug_ll Sascha Hauer
  2019-03-06  9:42 ` [PATCH 1/5] ARM: rpi: Move UART base address definitions to header file Sascha Hauer
@ 2019-03-06  9:42 ` Sascha Hauer
  2019-03-06  9:42 ` [PATCH 3/5] debug_ll: Add ns16550 early debugging functions Sascha Hauer
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Sascha Hauer @ 2019-03-06  9:42 UTC (permalink / raw)
  To: Barebox List

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-bcm283x/include/mach/debug_ll.h                   | 2 +-
 arch/arm/mach-highbank/include/mach/debug_ll.h                  | 2 +-
 arch/arm/mach-qemu/include/mach/debug_ll.h                      | 2 +-
 arch/arm/mach-versatile/include/mach/debug_ll.h                 | 2 +-
 arch/arm/mach-vexpress/include/mach/debug_ll.h                  | 2 +-
 .../include/asm/debug_ll_pl011.h => include/debug_ll/pl011.h    | 0
 6 files changed, 5 insertions(+), 5 deletions(-)
 rename arch/arm/include/asm/debug_ll_pl011.h => include/debug_ll/pl011.h (100%)

diff --git a/arch/arm/mach-bcm283x/include/mach/debug_ll.h b/arch/arm/mach-bcm283x/include/mach/debug_ll.h
index a625a8bdb7..2e95bf8320 100644
--- a/arch/arm/mach-bcm283x/include/mach/debug_ll.h
+++ b/arch/arm/mach-bcm283x/include/mach/debug_ll.h
@@ -26,6 +26,6 @@
 
 #define DEBUG_LL_UART_ADDR CONFIG_MACH_RPI_DEBUG_UART_BASE
 
-#include <asm/debug_ll_pl011.h>
+#include <debug_ll/pl011.h>
 
 #endif /* __MACH_BCM2835_DEBUG_LL_H__ */
diff --git a/arch/arm/mach-highbank/include/mach/debug_ll.h b/arch/arm/mach-highbank/include/mach/debug_ll.h
index 1820eb1d13..5d0fae80e7 100644
--- a/arch/arm/mach-highbank/include/mach/debug_ll.h
+++ b/arch/arm/mach-highbank/include/mach/debug_ll.h
@@ -9,6 +9,6 @@
 
 #define DEBUG_LL_UART_ADDR 0xfff36000
 
-#include <asm/debug_ll_pl011.h>
+#include <debug_ll/pl011.h>
 
 #endif
diff --git a/arch/arm/mach-qemu/include/mach/debug_ll.h b/arch/arm/mach-qemu/include/mach/debug_ll.h
index 89b06923ad..d59f68ea19 100644
--- a/arch/arm/mach-qemu/include/mach/debug_ll.h
+++ b/arch/arm/mach-qemu/include/mach/debug_ll.h
@@ -19,6 +19,6 @@
 #define DEBUG_LL_UART_ADDR DEBUG_LL_PHYS_BASE_RS1
 #endif
 
-#include <asm/debug_ll_pl011.h>
+#include <debug_ll/pl011.h>
 
 #endif
diff --git a/arch/arm/mach-versatile/include/mach/debug_ll.h b/arch/arm/mach-versatile/include/mach/debug_ll.h
index e6ee877a54..073402c51a 100644
--- a/arch/arm/mach-versatile/include/mach/debug_ll.h
+++ b/arch/arm/mach-versatile/include/mach/debug_ll.h
@@ -18,6 +18,6 @@
 
 #define DEBUG_LL_UART_ADDR 0x101F1000
 
-#include <asm/debug_ll_pl011.h>
+#include <debug_ll/pl011.h>
 
 #endif
diff --git a/arch/arm/mach-vexpress/include/mach/debug_ll.h b/arch/arm/mach-vexpress/include/mach/debug_ll.h
index 89b06923ad..d59f68ea19 100644
--- a/arch/arm/mach-vexpress/include/mach/debug_ll.h
+++ b/arch/arm/mach-vexpress/include/mach/debug_ll.h
@@ -19,6 +19,6 @@
 #define DEBUG_LL_UART_ADDR DEBUG_LL_PHYS_BASE_RS1
 #endif
 
-#include <asm/debug_ll_pl011.h>
+#include <debug_ll/pl011.h>
 
 #endif
diff --git a/arch/arm/include/asm/debug_ll_pl011.h b/include/debug_ll/pl011.h
similarity index 100%
rename from arch/arm/include/asm/debug_ll_pl011.h
rename to include/debug_ll/pl011.h
-- 
2.20.1


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

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

* [PATCH 3/5] debug_ll: Add ns16550 early debugging functions
  2019-03-06  9:42 [PATCH 0/5] ARM: rpi: refactor debug_ll Sascha Hauer
  2019-03-06  9:42 ` [PATCH 1/5] ARM: rpi: Move UART base address definitions to header file Sascha Hauer
  2019-03-06  9:42 ` [PATCH 2/5] debug_ll: Move pl011 header file to architecture independent place Sascha Hauer
@ 2019-03-06  9:42 ` Sascha Hauer
  2019-03-06  9:42 ` [PATCH 4/5] ARM: rpi: move debug UART Kconfig settings Sascha Hauer
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Sascha Hauer @ 2019-03-06  9:42 UTC (permalink / raw)
  To: Barebox List

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 include/debug_ll/ns16550.h | 56 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 56 insertions(+)
 create mode 100644 include/debug_ll/ns16550.h

diff --git a/include/debug_ll/ns16550.h b/include/debug_ll/ns16550.h
new file mode 100644
index 0000000000..7e4dbeb453
--- /dev/null
+++ b/include/debug_ll/ns16550.h
@@ -0,0 +1,56 @@
+#ifndef __DEBUG_LL_NS16550_H
+#define __DEBUG_LL_NS16550_H
+
+/*
+ * Early debugging functions for the NS16550
+ * This file needs register access functions declared as:
+ *
+ * uint8_t debug_ll_read_reg(int reg);
+ * void debug_ll_write_reg(int reg, uint8_t val);
+ */
+#define NS16550_THR	0x0
+#define NS16550_RBR	0x0
+#define NS16550_DLL	0x0
+#define NS16550_IER	0x1
+#define NS16550_DLM	0x1
+#define NS16550_FCR	0x2
+#define NS16550_LCR	0x3
+#define NS16550_MCR	0x4
+#define NS16550_LSR	0x5
+
+#define NS16550_LCR_VAL		0x3 /* 8 data, 1 stop, no parity */
+#define NS16550_MCR_VAL		0x3 /* RTS/DTR */
+#define NS16550_FCR_VAL		0x7 /* Clear & enable FIFOs */
+
+#define NS16550_LSR_DR		0x01 /* UART received data present */
+#define NS16550_LSR_THRE	0x20 /* Xmit holding register empty */
+
+#define NS16550_LCR_BKSE	0x80 /* Bank select enable */
+
+static inline void PUTC_LL(char ch)
+{
+        while (!(debug_ll_read_reg(NS16550_LSR) & NS16550_LSR_THRE))
+                ;
+
+        debug_ll_write_reg(NS16550_THR, ch);
+}
+
+static inline uint16_t debug_ll_ns16550_calc_divisor(unsigned long clk)
+{
+	return clk / (115200 * 16);
+}
+
+static inline void debug_ll_ns16550_init(uint16_t divisor)
+{
+	debug_ll_write_reg(NS16550_LCR, 0x0); /* select ier reg */
+        debug_ll_write_reg(0x00, NS16550_IER);
+
+	debug_ll_write_reg(NS16550_LCR, NS16550_LCR_BKSE);
+	debug_ll_write_reg(NS16550_DLL, divisor & 0xff);
+	debug_ll_write_reg(NS16550_DLM, (divisor >> 8) & 0xff);
+	debug_ll_write_reg(NS16550_LCR, NS16550_LCR_VAL);
+	debug_ll_write_reg(NS16550_MCR, NS16550_MCR_VAL);
+	debug_ll_write_reg(NS16550_FCR, NS16550_FCR_VAL);
+}
+
+#endif
-- 
2.20.1


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

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

* [PATCH 4/5] ARM: rpi: move debug UART Kconfig settings
  2019-03-06  9:42 [PATCH 0/5] ARM: rpi: refactor debug_ll Sascha Hauer
                   ` (2 preceding siblings ...)
  2019-03-06  9:42 ` [PATCH 3/5] debug_ll: Add ns16550 early debugging functions Sascha Hauer
@ 2019-03-06  9:42 ` Sascha Hauer
  2019-03-07  9:52   ` Tomaž Šolc
  2019-03-06  9:42 ` [PATCH 5/5] ARM: rpi: Add mini UART debug_ll support Sascha Hauer
  2019-03-07 10:00 ` [PATCH 0/5] ARM: rpi: refactor debug_ll Tomaž Šolc
  5 siblings, 1 reply; 12+ messages in thread
From: Sascha Hauer @ 2019-03-06  9:42 UTC (permalink / raw)
  To: Barebox List

In contrast to other architectures, R.Pi debug UART config was placed
under the "System Type" menu, not under the "Debugging -> low-level
debugging port". This made this setting easy to miss when enabling low
level debug mesages.

While at it use the existing base address defines rather than defining
them again in Kconfig.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-bcm283x/Kconfig                 | 20 -------------------
 arch/arm/mach-bcm283x/include/mach/debug_ll.h | 12 +++++++----
 common/Kconfig                                | 13 ++++++++++++
 3 files changed, 21 insertions(+), 24 deletions(-)

diff --git a/arch/arm/mach-bcm283x/Kconfig b/arch/arm/mach-bcm283x/Kconfig
index bb5f75dc90..9d6a7b2ec2 100644
--- a/arch/arm/mach-bcm283x/Kconfig
+++ b/arch/arm/mach-bcm283x/Kconfig
@@ -33,24 +33,4 @@ config MACH_RPI_CM3
 
 endmenu
 
-config MACH_RPI_DEBUG_UART_BASE
-	hex
-	default 0x20201000 if MACH_RPI_DEBUG_UART_RPI
-	default 0x3f201000 if MACH_RPI_DEBUG_UART_RPI2
-
-if DEBUG_LL
-
-choice
-	prompt "Lowlevel debug UART"
-
-config MACH_RPI_DEBUG_UART_RPI
-	bool "use RaspberryPi 1 compatible base"
-
-config MACH_RPI_DEBUG_UART_RPI2
-	bool "use RaspberryPi 2 and 3 compatible base"
-
-endchoice
-
-endif
-
 endif
diff --git a/arch/arm/mach-bcm283x/include/mach/debug_ll.h b/arch/arm/mach-bcm283x/include/mach/debug_ll.h
index 2e95bf8320..2d2103e338 100644
--- a/arch/arm/mach-bcm283x/include/mach/debug_ll.h
+++ b/arch/arm/mach-bcm283x/include/mach/debug_ll.h
@@ -20,12 +20,16 @@
 
 #include <mach/platform.h>
 
-#ifndef CONFIG_MACH_RPI_DEBUG_UART_BASE
-#define CONFIG_MACH_RPI_DEBUG_UART_BASE 0
-#endif
+#ifdef CONFIG_DEBUG_RPI1_UART
+
+#define DEBUG_LL_UART_ADDR BCM2835_PL011_BASE
+#include <debug_ll/pl011.h>
 
-#define DEBUG_LL_UART_ADDR CONFIG_MACH_RPI_DEBUG_UART_BASE
+#elif defined CONFIG_DEBUG_RPI2_3_UART
 
+#define DEBUG_LL_UART_ADDR BCM2836_PL011_BASE
 #include <debug_ll/pl011.h>
 
+#endif
+
 #endif /* __MACH_BCM2835_DEBUG_LL_H__ */
diff --git a/common/Kconfig b/common/Kconfig
index 21b33f06f7..563cf15fb1 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -1159,6 +1159,19 @@ config DEBUG_SOCFPGA_UART1
 	  Say Y here if you want kernel low-level debugging support
 	  on SOCFPGA(Arria 10) based platforms.
 
+config DEBUG_RPI1_UART
+	bool "RaspberryPi 1 debug UART"
+	depends on ARCH_BCM283X
+	help
+	  Say Y here if you want low-level debugging support on
+	  RaspberryPi 1 boards.
+
+config DEBUG_RPI2_UART
+	bool "RaspberryPi 2/3 debug UART"
+	depends on ARCH_BCM283X
+	help
+	  Say Y here if you want low-level debugging support on
+	  RaspberryPi 2 and 3 boards.
 
 endchoice
 
-- 
2.20.1


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

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

* [PATCH 5/5] ARM: rpi: Add mini UART debug_ll support
  2019-03-06  9:42 [PATCH 0/5] ARM: rpi: refactor debug_ll Sascha Hauer
                   ` (3 preceding siblings ...)
  2019-03-06  9:42 ` [PATCH 4/5] ARM: rpi: move debug UART Kconfig settings Sascha Hauer
@ 2019-03-06  9:42 ` Sascha Hauer
  2019-03-07  9:52   ` Tomaž Šolc
  2019-03-07 10:00 ` [PATCH 0/5] ARM: rpi: refactor debug_ll Tomaž Šolc
  5 siblings, 1 reply; 12+ messages in thread
From: Sascha Hauer @ 2019-03-06  9:42 UTC (permalink / raw)
  To: Barebox List

The raspberry pi 3 comes up with the mini UART as default, so allow to
use it for debug_ll output.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-bcm283x/include/mach/debug_ll.h | 37 +++++++++++++++++++
 common/Kconfig                                |  6 +++
 2 files changed, 43 insertions(+)

diff --git a/arch/arm/mach-bcm283x/include/mach/debug_ll.h b/arch/arm/mach-bcm283x/include/mach/debug_ll.h
index 2d2103e338..99c59d011b 100644
--- a/arch/arm/mach-bcm283x/include/mach/debug_ll.h
+++ b/arch/arm/mach-bcm283x/include/mach/debug_ll.h
@@ -22,14 +22,51 @@
 
 #ifdef CONFIG_DEBUG_RPI1_UART
 
+static inline void debug_ll_init(void)
+{
+	/* Configured by ROM */
+}
+
 #define DEBUG_LL_UART_ADDR BCM2835_PL011_BASE
 #include <debug_ll/pl011.h>
 
 #elif defined CONFIG_DEBUG_RPI2_3_UART
 
+static inline void debug_ll_init(void)
+{
+	/* Configured by ROM */
+}
+
 #define DEBUG_LL_UART_ADDR BCM2836_PL011_BASE
 #include <debug_ll/pl011.h>
 
+#elif defined CONFIG_DEBUG_RPI3_MINI_UART
+
+static inline uint8_t debug_ll_read_reg(int reg)
+{
+	return readb(BCM2836_MINIUART_BASE + (reg << 2));
+}
+
+static inline void debug_ll_write_reg(int reg, uint8_t val)
+{
+	writeb(val, BCM2836_MINIUART_BASE + (reg << 2));
+}
+
+#define BCM2836_AUX_CLOCK_ENB		0x3f215004 /* BCM2835 AUX Clock enable register */
+#define BCM2836_AUX_CLOCK_EN_UART	BIT(0) /* Bit 0 enables the Miniuart */
+
+#include <debug_ll/ns16550.h>
+
+static inline void debug_ll_init(void)
+{
+	uint16_t divisor;
+
+	writeb(BCM2836_AUX_CLOCK_EN_UART, BCM2836_AUX_CLOCK_ENB);
+
+	divisor = debug_ll_ns16550_calc_divisor(250000000 * 2);
+	debug_ll_ns16550_init(divisor);
+}
+
 #endif
 
 #endif /* __MACH_BCM2835_DEBUG_LL_H__ */
diff --git a/common/Kconfig b/common/Kconfig
index 563cf15fb1..0c6acfcddb 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -1173,6 +1173,12 @@ config DEBUG_RPI2_UART
 	  Say Y here if you want low-level debugging support on
 	  RaspberryPi 2 and 3 boards.
 
+config DEBUG_RPI3_MINI_UART
+	bool "RaspberryPi 3 mini UART
+	depends on ARCH_BCM283X
+	help
+	  Say Y here if you want low-level debugging support on
+	  RaspberryPi 3 board mini UART.
 endchoice
 
 config DEBUG_IMX_UART_PORT
-- 
2.20.1


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

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

* Re: [PATCH 5/5] ARM: rpi: Add mini UART debug_ll support
  2019-03-06  9:42 ` [PATCH 5/5] ARM: rpi: Add mini UART debug_ll support Sascha Hauer
@ 2019-03-07  9:52   ` Tomaž Šolc
  2019-03-07 13:24     ` Sascha Hauer
  0 siblings, 1 reply; 12+ messages in thread
From: Tomaž Šolc @ 2019-03-07  9:52 UTC (permalink / raw)
  To: Sascha Hauer, Barebox List

Hi

On 6. 03. 19 10:42, Sascha Hauer wrote:
> diff --git a/common/Kconfig b/common/Kconfig
> index 563cf15fb1..0c6acfcddb 100644
> --- a/common/Kconfig
> +++ b/common/Kconfig
> @@ -1173,6 +1173,12 @@ config DEBUG_RPI2_UART
>   	  Say Y here if you want low-level debugging support on
>   	  RaspberryPi 2 and 3 boards.
>   
> +config DEBUG_RPI3_MINI_UART
> +	bool "RaspberryPi 3 mini UART

The line above is missing the closing double quote.

I also recommend changing the labels on other two UART options to say 
"PL011 UART" instead of "debug UART" so that the difference is more obvious.

Can you also please include in this series my patch that expands the 
help message for DEBUG_LL I sent earlier?

> +	depends on ARCH_BCM283X
> +	help
> +	  Say Y here if you want low-level debugging support on
> +	  RaspberryPi 3 board mini UART.
>   endchoice
>   
>   config DEBUG_IMX_UART_PORT
> 

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

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

* Re: [PATCH 4/5] ARM: rpi: move debug UART Kconfig settings
  2019-03-06  9:42 ` [PATCH 4/5] ARM: rpi: move debug UART Kconfig settings Sascha Hauer
@ 2019-03-07  9:52   ` Tomaž Šolc
  0 siblings, 0 replies; 12+ messages in thread
From: Tomaž Šolc @ 2019-03-07  9:52 UTC (permalink / raw)
  To: Sascha Hauer, Barebox List

Hi

On 6. 03. 19 10:42, Sascha Hauer wrote:
> In contrast to other architectures, R.Pi debug UART config was placed
> under the "System Type" menu, not under the "Debugging -> low-level
> debugging port". This made this setting easy to miss when enabling low
> level debug mesages.
> 
> While at it use the existing base address defines rather than defining
> them again in Kconfig.
> 
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
>   arch/arm/mach-bcm283x/Kconfig                 | 20 -------------------
>   arch/arm/mach-bcm283x/include/mach/debug_ll.h | 12 +++++++----
>   common/Kconfig                                | 13 ++++++++++++
>   3 files changed, 21 insertions(+), 24 deletions(-)
> 
[...]

> diff --git a/arch/arm/mach-bcm283x/include/mach/debug_ll.h b/arch/arm/mach-bcm283x/include/mach/debug_ll.h
> index 2e95bf8320..2d2103e338 100644
> --- a/arch/arm/mach-bcm283x/include/mach/debug_ll.h
> +++ b/arch/arm/mach-bcm283x/include/mach/debug_ll.h
> @@ -20,12 +20,16 @@
>   
>   #include <mach/platform.h>
>   
> -#ifndef CONFIG_MACH_RPI_DEBUG_UART_BASE
> -#define CONFIG_MACH_RPI_DEBUG_UART_BASE 0
> -#endif
> +#ifdef CONFIG_DEBUG_RPI1_UART
> +
> +#define DEBUG_LL_UART_ADDR BCM2835_PL011_BASE
> +#include <debug_ll/pl011.h>
>   
> -#define DEBUG_LL_UART_ADDR CONFIG_MACH_RPI_DEBUG_UART_BASE
> +#elif defined CONFIG_DEBUG_RPI2_3_UART

This elif should either be "CONFIG_DEBUG_RPI2_UART" or the Kconfig below 
should set DEBUG_RPI2_3_UART.

>   
> +#define DEBUG_LL_UART_ADDR BCM2836_PL011_BASE
>   #include <debug_ll/pl011.h>
>   
> +#endif
> +
>   #endif /* __MACH_BCM2835_DEBUG_LL_H__ */
> diff --git a/common/Kconfig b/common/Kconfig
> index 21b33f06f7..563cf15fb1 100644
> --- a/common/Kconfig
> +++ b/common/Kconfig
> @@ -1159,6 +1159,19 @@ config DEBUG_SOCFPGA_UART1
>   	  Say Y here if you want kernel low-level debugging support
>   	  on SOCFPGA(Arria 10) based platforms.
>   
> +config DEBUG_RPI1_UART
> +	bool "RaspberryPi 1 debug UART"
> +	depends on ARCH_BCM283X
> +	help
> +	  Say Y here if you want low-level debugging support on
> +	  RaspberryPi 1 boards.
> +
> +config DEBUG_RPI2_UART
> +	bool "RaspberryPi 2/3 debug UART"
> +	depends on ARCH_BCM283X
> +	help
> +	  Say Y here if you want low-level debugging support on
> +	  RaspberryPi 2 and 3 boards.
>   
>   endchoice

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

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

* Re: [PATCH 0/5] ARM: rpi: refactor debug_ll
  2019-03-06  9:42 [PATCH 0/5] ARM: rpi: refactor debug_ll Sascha Hauer
                   ` (4 preceding siblings ...)
  2019-03-06  9:42 ` [PATCH 5/5] ARM: rpi: Add mini UART debug_ll support Sascha Hauer
@ 2019-03-07 10:00 ` Tomaž Šolc
  5 siblings, 0 replies; 12+ messages in thread
From: Tomaž Šolc @ 2019-03-07 10:00 UTC (permalink / raw)
  To: Sascha Hauer, Barebox List

Hi

I tried this series on R.Pi 3B (make rpi_defconfig + 
DEBUG_RPI3_MINI_UART) and Compute Module 3 (make rpi_defconfig + 
DEBUG_RPI2_UART) and after the two small fixes I mention in my other 
replies they both work as expected. Thanks!

Best regards
Tomaž

On 6. 03. 19 10:42, Sascha Hauer wrote:
> This picks up the series from Tomaž and also adds mini UART early
> debugging support useful for the rpi3 which comes up with this
> UART by default.
> The ns16550 early debugging support is done in a generic way which
> I tested on Layerscape. I don't have any raspberry pies here, so
> totally untested on these boards.
> 
> Sascha
> 
> Sascha Hauer (5):
>    ARM: rpi: Move UART base address definitions to header file
>    debug_ll: Move pl011 header file to architecture independent place
>    debug_ll: Add ns16550 early debugging functions
>    ARM: rpi: move debug UART Kconfig settings
>    ARM: rpi: Add mini UART debug_ll support
> 
>   arch/arm/boards/raspberry-pi/rpi-common.c     |  5 +-
>   arch/arm/mach-bcm283x/Kconfig                 | 20 -------
>   arch/arm/mach-bcm283x/include/mach/debug_ll.h | 51 +++++++++++++++--
>   arch/arm/mach-bcm283x/include/mach/platform.h |  4 ++
>   .../arm/mach-highbank/include/mach/debug_ll.h |  2 +-
>   arch/arm/mach-qemu/include/mach/debug_ll.h    |  2 +-
>   .../mach-versatile/include/mach/debug_ll.h    |  2 +-
>   .../arm/mach-vexpress/include/mach/debug_ll.h |  2 +-
>   common/Kconfig                                | 19 +++++++
>   include/debug_ll/ns16550.h                    | 56 +++++++++++++++++++
>   .../debug_ll/pl011.h                          |  0
>   11 files changed, 130 insertions(+), 33 deletions(-)
>   create mode 100644 include/debug_ll/ns16550.h
>   rename arch/arm/include/asm/debug_ll_pl011.h => include/debug_ll/pl011.h (100%)
> 

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

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

* Re: [PATCH 5/5] ARM: rpi: Add mini UART debug_ll support
  2019-03-07  9:52   ` Tomaž Šolc
@ 2019-03-07 13:24     ` Sascha Hauer
  2019-03-07 13:32       ` [HELP] Kernel + initrd in FIT Seraphim Dolbilov
  0 siblings, 1 reply; 12+ messages in thread
From: Sascha Hauer @ 2019-03-07 13:24 UTC (permalink / raw)
  To: Tomaž Šolc; +Cc: Barebox List

On Thu, Mar 07, 2019 at 10:52:33AM +0100, Tomaž Šolc wrote:
> Hi
> 
> On 6. 03. 19 10:42, Sascha Hauer wrote:
> > diff --git a/common/Kconfig b/common/Kconfig
> > index 563cf15fb1..0c6acfcddb 100644
> > --- a/common/Kconfig
> > +++ b/common/Kconfig
> > @@ -1173,6 +1173,12 @@ config DEBUG_RPI2_UART
> >   	  Say Y here if you want low-level debugging support on
> >   	  RaspberryPi 2 and 3 boards.
> > +config DEBUG_RPI3_MINI_UART
> > +	bool "RaspberryPi 3 mini UART
> 
> The line above is missing the closing double quote.
> 
> I also recommend changing the labels on other two UART options to say "PL011
> UART" instead of "debug UART" so that the difference is more obvious.
> 
> Can you also please include in this series my patch that expands the help
> message for DEBUG_LL I sent earlier?

Yes, applied that one. Thanks for testing and fixing ;)

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

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

* [HELP] Kernel + initrd in FIT
  2019-03-07 13:24     ` Sascha Hauer
@ 2019-03-07 13:32       ` Seraphim Dolbilov
  2019-03-11  7:25         ` Sascha Hauer
  0 siblings, 1 reply; 12+ messages in thread
From: Seraphim Dolbilov @ 2019-03-07 13:32 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: Barebox List

Hello,

I'm interested in way Barebox passes initrd to kernel if both are taken
from FIT. What shall I do, if I want my kernel and initrd to be compressed
in a single FIT image? What kernel boot params and config options
should be set then?

-- 
Yours sincerely,
Seraphim Dolbilov


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

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

* Re: [HELP] Kernel + initrd in FIT
  2019-03-07 13:32       ` [HELP] Kernel + initrd in FIT Seraphim Dolbilov
@ 2019-03-11  7:25         ` Sascha Hauer
  0 siblings, 0 replies; 12+ messages in thread
From: Sascha Hauer @ 2019-03-11  7:25 UTC (permalink / raw)
  To: Seraphim Dolbilov; +Cc: Barebox List

Hi Seraphim,

Please do not ask new questions as a response to other threads.

On Thu, Mar 07, 2019 at 04:32:21PM +0300, Seraphim Dolbilov wrote:
> Hello,
> 
> I'm interested in way Barebox passes initrd to kernel if both are taken
> from FIT. What shall I do, if I want my kernel and initrd to be compressed
> in a single FIT image? What kernel boot params and config options
> should be set then?

If you put the ramdisk into the ramdisk property of the configuration
node in your its file then no further action is required. barebox will
pass the ramdisk in the "linux,initrd-start" and "linux,initrd-end"
properties in the devicetree.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

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

end of thread, other threads:[~2019-03-11  7:25 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-06  9:42 [PATCH 0/5] ARM: rpi: refactor debug_ll Sascha Hauer
2019-03-06  9:42 ` [PATCH 1/5] ARM: rpi: Move UART base address definitions to header file Sascha Hauer
2019-03-06  9:42 ` [PATCH 2/5] debug_ll: Move pl011 header file to architecture independent place Sascha Hauer
2019-03-06  9:42 ` [PATCH 3/5] debug_ll: Add ns16550 early debugging functions Sascha Hauer
2019-03-06  9:42 ` [PATCH 4/5] ARM: rpi: move debug UART Kconfig settings Sascha Hauer
2019-03-07  9:52   ` Tomaž Šolc
2019-03-06  9:42 ` [PATCH 5/5] ARM: rpi: Add mini UART debug_ll support Sascha Hauer
2019-03-07  9:52   ` Tomaž Šolc
2019-03-07 13:24     ` Sascha Hauer
2019-03-07 13:32       ` [HELP] Kernel + initrd in FIT Seraphim Dolbilov
2019-03-11  7:25         ` Sascha Hauer
2019-03-07 10:00 ` [PATCH 0/5] ARM: rpi: refactor debug_ll Tomaž Šolc

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