mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH v2 1/4] PBL: fdt: implement fdt_device_get_match_data
@ 2021-04-10 11:06 Ahmad Fatoum
  2021-04-10 11:06 ` [PATCH v2 2/4] RISC-V: debug_ll: ns16550: split off debug_ll from generic parts Ahmad Fatoum
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Ahmad Fatoum @ 2021-04-10 11:06 UTC (permalink / raw)
  To: barebox; +Cc: Jules Maselbas, Ahmad Fatoum

Currently, the generic DT image can't properly have a PBL console,
because it's only known at runtime what system we are running on.

As we already parse the FDT in the PBL to get the memory regions, we
could extract the board compatible as well and determine which UART to
use. Add a helper to achieve this.

Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
---
v1 -> v2:
  - use strcasecmp (Jules)
---
 include/pbl.h |  9 +++++++++
 pbl/fdt.c     | 35 +++++++++++++++++++++++++++++++++++
 pbl/string.c  | 12 ++++++++++++
 3 files changed, 56 insertions(+)

diff --git a/include/pbl.h b/include/pbl.h
index 194d5e750839..f58daec7351a 100644
--- a/include/pbl.h
+++ b/include/pbl.h
@@ -34,4 +34,13 @@ ssize_t pbl_fat_load(struct pbl_bio *, const char *filename, void *dest, size_t
 
 void fdt_find_mem(const void *fdt, unsigned long *membase, unsigned long *memsize);
 
+struct fdt_device_id {
+	const char *compatible;
+	const void *data;
+};
+
+const void *
+fdt_device_get_match_data(const void *fdt, const char *nodepath,
+			  const struct fdt_device_id ids[]);
+
 #endif /* __PBL_H__ */
diff --git a/pbl/fdt.c b/pbl/fdt.c
index b4a40a514b8b..18ddb9f48a6e 100644
--- a/pbl/fdt.c
+++ b/pbl/fdt.c
@@ -68,3 +68,38 @@ err:
 	pr_err("No memory, cannot continue\n");
 	while (1);
 }
+
+const void *fdt_device_get_match_data(const void *fdt, const char *nodepath,
+				      const struct fdt_device_id ids[])
+{
+	int node, length;
+	const char *list, *end;
+	const struct fdt_device_id *id;
+
+	node = fdt_path_offset(fdt, nodepath);
+	if (node < 0)
+		return NULL;
+
+	list = fdt_getprop(fdt, node, "compatible", &length);
+	if (!list)
+		return NULL;
+
+	end = list + length;
+
+	while (list < end) {
+		length = strnlen(list, end - list) + 1;
+
+		/* Abort if the last string isn't properly NUL-terminated. */
+		if (list + length > end)
+			return NULL;
+
+		for (id = ids; id->compatible; id++) {
+			if (!strcasecmp(list, id->compatible))
+				return id->data;
+		}
+
+		list += length;
+	}
+
+	return NULL;
+}
diff --git a/pbl/string.c b/pbl/string.c
index e6c0997ebc6d..e96eb99fc22d 100644
--- a/pbl/string.c
+++ b/pbl/string.c
@@ -7,6 +7,7 @@
 #include <linux/types.h>
 #include <linux/string.h>
 #include <linux/compiler.h>
+#include <linux/ctype.h>
 
 void *memcpy(void *__dest, __const void *__src, size_t __n)
 {
@@ -98,6 +99,17 @@ int strcmp(const char *cs, const char *ct)
 	return res;
 }
 
+int strcasecmp(const char *s1, const char *s2)
+{
+	int c1, c2;
+
+	do {
+		c1 = tolower(*s1++);
+		c2 = tolower(*s2++);
+	} while (c1 == c2 && c1 != 0);
+	return c1 - c2;
+}
+
 void *memchr(const void *s, int c, size_t count)
 {
 	const unsigned char *p = s;
-- 
2.30.0


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


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

* [PATCH v2 2/4] RISC-V: debug_ll: ns16550: split off debug_ll from generic parts
  2021-04-10 11:06 [PATCH v2 1/4] PBL: fdt: implement fdt_device_get_match_data Ahmad Fatoum
@ 2021-04-10 11:06 ` Ahmad Fatoum
  2021-04-10 11:06 ` [PATCH v2 3/4] RISC-V: board-dt-2nd: add PBL console support for virt Ahmad Fatoum
  2021-04-10 11:06 ` [PATCH v2 4/4] RISC-V: delete unused mach-virt subdirectory Ahmad Fatoum
  2 siblings, 0 replies; 6+ messages in thread
From: Ahmad Fatoum @ 2021-04-10 11:06 UTC (permalink / raw)
  To: barebox; +Cc: Jules Maselbas, Ahmad Fatoum

The early NS16550 code is written for DEBUG_LL and can't be directly
used with pbl_set_putc if it's disabled. Split off the generic parts
into a new header that can be used by the virt board for PBL console.

DEBUG_LL functionality is unaffected.

Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
---
v1 -> v2:
  - No change
---
 arch/riscv/include/asm/debug_ll_ns16550.h | 49 ++++++++---------------
 arch/riscv/include/asm/ns16550.h          | 48 ++++++++++++++++++++++
 2 files changed, 65 insertions(+), 32 deletions(-)
 create mode 100644 arch/riscv/include/asm/ns16550.h

diff --git a/arch/riscv/include/asm/debug_ll_ns16550.h b/arch/riscv/include/asm/debug_ll_ns16550.h
index 7d6d12df74fe..b09882ddad14 100644
--- a/arch/riscv/include/asm/debug_ll_ns16550.h
+++ b/arch/riscv/include/asm/debug_ll_ns16550.h
@@ -35,19 +35,6 @@
 
 #endif /* CONFIG_DEBUG_LL */
 
-#define UART_THR	(0x0 << DEBUG_LL_UART_SHIFT)
-#define UART_RBR	(0x0 << DEBUG_LL_UART_SHIFT)
-#define UART_DLL	(0x0 << DEBUG_LL_UART_SHIFT)
-#define UART_DLM	(0x1 << DEBUG_LL_UART_SHIFT)
-#define UART_LCR	(0x3 << DEBUG_LL_UART_SHIFT)
-#define UART_LSR	(0x5 << DEBUG_LL_UART_SHIFT)
-
-#define UART_LCR_W	0x07	/* Set UART to 8,N,2 & DLAB = 0 */
-#define UART_LCR_DLAB	0x87	/* Set UART to 8,N,2 & DLAB = 1 */
-
-#define UART_LSR_DR	0x01    /* UART received data present */
-#define UART_LSR_THRE	0x20	/* Xmit holding register empty */
-
 #if defined(DEBUG_LL_UART_IOSIZE32)
 #define UART_REG_L	lw
 #define UART_REG_S	sw
@@ -62,31 +49,29 @@
 #error "Please define DEBUG_LL_UART_IOSIZE{8,32}"
 #endif
 
+#include <asm/ns16550.h>
+
 #ifndef __ASSEMBLY__
 /*
  * C macros
  */
 
-#include <asm/io.h>
-
 static inline void PUTC_LL(char ch)
 {
 #ifdef CONFIG_DEBUG_LL
-	while (!(__uart_read((u8 *)DEBUG_LL_UART_ADDR + UART_LSR) & UART_LSR_THRE))
-		;
-	__uart_write(ch, (u8 *)DEBUG_LL_UART_ADDR + UART_THR);
-#endif /* CONFIG_DEBUG_LL */
+	early_ns16550_putc(ch, DEBUG_LL_UART_ADDR, DEBUG_LL_UART_SHIFT,
+			   __uart_read, __uart_write);
+#endif
 }
 
 static inline void debug_ll_ns16550_init(void)
 {
 #ifdef CONFIG_DEBUG_LL
-	__uart_write(UART_LCR_DLAB, (u8 *)DEBUG_LL_UART_ADDR + UART_LCR);
-	__uart_write(DEBUG_LL_UART_DIVISOR & 0xff, (u8 *)DEBUG_LL_UART_ADDR + UART_DLL);
-	__uart_write((DEBUG_LL_UART_DIVISOR >> 8) & 0xff, (u8 *)DEBUG_LL_UART_ADDR + UART_DLM);
-	__uart_write(UART_LCR_W, (u8 *)DEBUG_LL_UART_ADDR + UART_LCR);
-#endif /* CONFIG_DEBUG_LL */
+	early_ns16550_init(DEBUG_LL_UART_ADDR, DEBUG_LL_UART_DIVISOR,
+			   DEBUG_LL_UART_SHIFT, __uart_write);
+#endif
 }
+
 #else /* __ASSEMBLY__ */
 /*
  * Macros for use in assembly language code
@@ -97,15 +82,15 @@ static inline void debug_ll_ns16550_init(void)
 	li	t0, DEBUG_LL_UART_ADDR
 
 	li	t1, UART_LCR_DLAB		/* DLAB on */
-	UART_REG_S	t1, UART_LCR(t0)		/* Write it out */
+	UART_REG_S	t1, UART_LCR(DEBUG_LL_UART_SHIFT)(t0)	/* Write it out */
 
 	li	t1, \divisor
-	UART_REG_S	t1, UART_DLL(t0)		/* write low order byte */
+	UART_REG_S	t1, UART_DLL(DEBUG_LL_UART_SHIFT)(t0)	/* write low order byte */
 	srl	t1, t1, 8
-	UART_REG_S	t1, UART_DLM(t0)		/* write high order byte */
+	UART_REG_S	t1, UART_DLM(DEBUG_LL_UART_SHIFT)(t0)	/* write high order byte */
 
 	li	t1, UART_LCR_W			/* DLAB off */
-	UART_REG_S	t1, UART_LCR(t0)		/* Write it out */
+	UART_REG_S	t1, UART_LCR(DEBUG_LL_UART_SHIFT)(t0)	/* Write it out */
 #endif /* CONFIG_DEBUG_LL */
 .endm
 
@@ -118,11 +103,11 @@ static inline void debug_ll_ns16550_init(void)
 	li	t0, DEBUG_LL_UART_ADDR
 
 201:
-	UART_REG_L	t1, UART_LSR(t0)	/* get line status */
+	UART_REG_L	t1, UART_LSR(DEBUG_LL_UART_SHIFT)(t0)	/* get line status */
 	andi	t1, t1, UART_LSR_THRE	/* check for transmitter empty */
 	beqz	t1, 201b			/* try again */
 
-	UART_REG_S	a0, UART_THR(t0)	/* write the character */
+	UART_REG_S	a0, UART_THR(DEBUG_LL_UART_SHIFT)(t0)	/* write the character */
 
 #endif /* CONFIG_DEBUG_LL */
 .endm
@@ -158,7 +143,7 @@ static inline void debug_ll_ns16550_init(void)
 	li      t0, DEBUG_LL_UART_ADDR
 
 	/* get line status and check for data present */
-	UART_REG_L	s0, UART_LSR(t0)
+	UART_REG_L	s0, UART_LSR(DEBUG_LL_UART_SHIFT)(t0)
 	andi	s0, s0, UART_LSR_DR
 
 #endif /* CONFIG_DEBUG_LL */
@@ -177,7 +162,7 @@ static inline void debug_ll_ns16550_init(void)
 	beqz	s0, 204b
 
 	/* read a character */
-	UART_REG_L	s0, UART_RBR(t0)
+	UART_REG_L	s0, UART_RBR(DEBUG_LL_UART_SHIFT)(t0)
 
 #endif /* CONFIG_DEBUG_LL */
 .endm
diff --git a/arch/riscv/include/asm/ns16550.h b/arch/riscv/include/asm/ns16550.h
new file mode 100644
index 000000000000..7f56692b77ce
--- /dev/null
+++ b/arch/riscv/include/asm/ns16550.h
@@ -0,0 +1,48 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Copyright (C) 2016, 2017 Antony Pavlov <antonynpavlov@gmail.com>
+ */
+
+/** @file
+ *  This file contains declaration for early output support
+ */
+#ifndef __ASM_NS16550_H__
+#define __ASM_NS16550_H__
+
+#include <linux/kconfig.h>
+
+#define UART_THR(shift)		(0x0 << shift)
+#define UART_RBR(shift)		(0x0 << shift)
+#define UART_DLL(shift)		(0x0 << shift)
+#define UART_DLM(shift)		(0x1 << shift)
+#define UART_LCR(shift)		(0x3 << shift)
+#define UART_LSR(shift)		(0x5 << shift)
+
+#define UART_LCR_W	0x07	/* Set UART to 8,N,2 & DLAB = 0 */
+#define UART_LCR_DLAB	0x87	/* Set UART to 8,N,2 & DLAB = 1 */
+
+#define UART_LSR_DR	0x01    /* UART received data present */
+#define UART_LSR_THRE	0x20	/* Xmit holding register empty */
+
+#ifndef __ASSEMBLY__
+
+#include <asm/io.h>
+
+#define early_ns16550_putc(ch, base, shift, readx, writex) \
+	do { \
+		while (!(readx((u8 *)base + UART_LSR(shift)) & UART_LSR_THRE)) \
+			; \
+		writex(ch, (u8 *)base + UART_THR(shift)); \
+	} while (0)
+
+#define early_ns16550_init(base, divisor, shift, writex) \
+	do { \
+		writex(UART_LCR_DLAB, (u8 *)base + UART_LCR(shift)); \
+		writex(divisor & 0xff, (u8 *)base + UART_DLL(shift)); \
+		writex((divisor >> 8) & 0xff, (u8 *)base + UART_DLM(shift)); \
+		writex(UART_LCR_W, (u8 *)base + UART_LCR(shift)); \
+	} while (0)
+
+#endif
+
+#endif
-- 
2.30.0


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


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

* [PATCH v2 3/4] RISC-V: board-dt-2nd: add PBL console support for virt
  2021-04-10 11:06 [PATCH v2 1/4] PBL: fdt: implement fdt_device_get_match_data Ahmad Fatoum
  2021-04-10 11:06 ` [PATCH v2 2/4] RISC-V: debug_ll: ns16550: split off debug_ll from generic parts Ahmad Fatoum
@ 2021-04-10 11:06 ` Ahmad Fatoum
  2021-04-15  7:15   ` Sascha Hauer
  2021-04-10 11:06 ` [PATCH v2 4/4] RISC-V: delete unused mach-virt subdirectory Ahmad Fatoum
  2 siblings, 1 reply; 6+ messages in thread
From: Ahmad Fatoum @ 2021-04-10 11:06 UTC (permalink / raw)
  To: barebox; +Cc: Jules Maselbas, Ahmad Fatoum

The Virt machine has a ns16550a UART at address 0x10000000. As we reuse
the generic DT image for this platform, we can't use either DEBUG_LL or
pbl_console as we would need to hardcode information on what UART is
available where, which wouldn't be correct for other boards.

However, if we parse the board compatible, we could match it with the
appropriate PBL console implementation without sacrificing portability.
Do so.

Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
---
v1 -> v2:
  - No change
---
 arch/riscv/boot/board-dt-2nd.c | 27 ++++++++++++++++++++++++++-
 1 file changed, 26 insertions(+), 1 deletion(-)

diff --git a/arch/riscv/boot/board-dt-2nd.c b/arch/riscv/boot/board-dt-2nd.c
index be28ea23cd6d..e9810f8add97 100644
--- a/arch/riscv/boot/board-dt-2nd.c
+++ b/arch/riscv/boot/board-dt-2nd.c
@@ -3,7 +3,7 @@
 #include <common.h>
 #include <asm/sections.h>
 #include <linux/sizes.h>
-#include <debug_ll.h>
+#include <asm/ns16550.h>
 #include <pbl.h>
 #include <fdt.h>
 
@@ -22,10 +22,29 @@
 
 #include <asm/barebox-riscv.h>
 
+static void virt_ns16550_putc(void *base, int ch)
+{
+	early_ns16550_putc(ch, base, 0, readb, writeb);
+}
+
+static void virt_ns16550_init(void)
+{
+	void __iomem *base = IOMEM(0x10000000);
+
+	early_ns16550_init(base, 3686400 / CONFIG_BAUDRATE, 0, writeb);
+	pbl_set_putc(virt_ns16550_putc, base);
+}
+
+static const struct fdt_device_id console_ids[] = {
+	{ .compatible = "riscv-virtio", .data = virt_ns16550_init },
+	{ /* sentinel */ }
+};
+
 ENTRY_FUNCTION(start_dt_2nd, a0, _fdt, a2)
 {
 	unsigned long membase, memsize, endmem, endfdt, uncompressed_len;
 	struct fdt_header *fdt = (void *)_fdt;
+	void (*pbl_uart_init)(void);
 
 	if (!fdt)
 		hang();
@@ -33,6 +52,12 @@ ENTRY_FUNCTION(start_dt_2nd, a0, _fdt, a2)
 	relocate_to_current_adr();
 	setup_c();
 
+	pbl_uart_init = fdt_device_get_match_data(fdt, "/", console_ids);
+	if (pbl_uart_init) {
+		pbl_uart_init();
+		putchar('>');
+	}
+
 	fdt_find_mem(fdt, &membase, &memsize);
 	endmem = membase + memsize;
 	endfdt = _fdt + be32_to_cpu(fdt->totalsize);
-- 
2.30.0


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


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

* [PATCH v2 4/4] RISC-V: delete unused mach-virt subdirectory
  2021-04-10 11:06 [PATCH v2 1/4] PBL: fdt: implement fdt_device_get_match_data Ahmad Fatoum
  2021-04-10 11:06 ` [PATCH v2 2/4] RISC-V: debug_ll: ns16550: split off debug_ll from generic parts Ahmad Fatoum
  2021-04-10 11:06 ` [PATCH v2 3/4] RISC-V: board-dt-2nd: add PBL console support for virt Ahmad Fatoum
@ 2021-04-10 11:06 ` Ahmad Fatoum
  2 siblings, 0 replies; 6+ messages in thread
From: Ahmad Fatoum @ 2021-04-10 11:06 UTC (permalink / raw)
  To: barebox; +Cc: Jules Maselbas, Ahmad Fatoum

The code within was unused and was kept only to make patching the
machine for DEBUG_LL easier. Now that we have PBL console support, this
is no longer needed, so remove it.

Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
---
v1 -> v2:
  - No change
---
 arch/riscv/Makefile                          |  1 -
 arch/riscv/mach-virt/Makefile                |  3 ---
 arch/riscv/mach-virt/include/mach/debug_ll.h | 25 --------------------
 3 files changed, 29 deletions(-)
 delete mode 100644 arch/riscv/mach-virt/Makefile
 delete mode 100644 arch/riscv/mach-virt/include/mach/debug_ll.h

diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile
index aba4526bba5a..1a41d15477b5 100644
--- a/arch/riscv/Makefile
+++ b/arch/riscv/Makefile
@@ -20,7 +20,6 @@ cflags-y += $(riscv-cflags-y)
 LDFLAGS_barebox += -nostdlib
 
 machine-$(CONFIG_MACH_ERIZO)	:= erizo
-machine-$(CONFIG_MACH_VIRT)	:= virt
 
 LDFLAGS_barebox += $(riscv-ldflags-y)
 
diff --git a/arch/riscv/mach-virt/Makefile b/arch/riscv/mach-virt/Makefile
deleted file mode 100644
index d9c51e74c379..000000000000
--- a/arch/riscv/mach-virt/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-# just to build a built-in.o. Otherwise compilation fails when no o-files is
-# created.
-obj- += dummy.o
diff --git a/arch/riscv/mach-virt/include/mach/debug_ll.h b/arch/riscv/mach-virt/include/mach/debug_ll.h
deleted file mode 100644
index 056b7a330bdd..000000000000
--- a/arch/riscv/mach-virt/include/mach/debug_ll.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/*
- * Copyright (C) 2017 Antony Pavlov <antonynpavlov@gmail.com>
- */
-
-#ifndef __MACH_VIRT_DEBUG_LL__
-#define __MACH_VIRT_DEBUG_LL__
-
-/** @file
- *  This File contains declaration for early output support
- */
-
-#include <linux/kconfig.h>
-
-#define DEBUG_LL_UART_ADDR	0x10000000
-#define DEBUG_LL_UART_SHIFT	0
-#define DEBUG_LL_UART_IOSIZE8
-
-#define DEBUG_LL_UART_CLK       0x00384000
-#define DEBUG_LL_UART_BPS       CONFIG_BAUDRATE
-#define DEBUG_LL_UART_DIVISOR   (DEBUG_LL_UART_CLK / DEBUG_LL_UART_BPS)
-
-#include <asm/debug_ll_ns16550.h>
-
-#endif /* __MACH_VIRT_DEBUG_LL__ */
-- 
2.30.0


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


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

* Re: [PATCH v2 3/4] RISC-V: board-dt-2nd: add PBL console support for virt
  2021-04-10 11:06 ` [PATCH v2 3/4] RISC-V: board-dt-2nd: add PBL console support for virt Ahmad Fatoum
@ 2021-04-15  7:15   ` Sascha Hauer
  2021-04-15  7:53     ` Ahmad Fatoum
  0 siblings, 1 reply; 6+ messages in thread
From: Sascha Hauer @ 2021-04-15  7:15 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox, Jules Maselbas

On Sat, Apr 10, 2021 at 01:06:37PM +0200, Ahmad Fatoum wrote:
> The Virt machine has a ns16550a UART at address 0x10000000. As we reuse
> the generic DT image for this platform, we can't use either DEBUG_LL or
> pbl_console as we would need to hardcode information on what UART is
> available where, which wouldn't be correct for other boards.
> 
> However, if we parse the board compatible, we could match it with the
> appropriate PBL console implementation without sacrificing portability.
> Do so.
> 
> Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
> ---
> v1 -> v2:
>   - No change
> ---
>  arch/riscv/boot/board-dt-2nd.c | 27 ++++++++++++++++++++++++++-
>  1 file changed, 26 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/riscv/boot/board-dt-2nd.c b/arch/riscv/boot/board-dt-2nd.c
> index be28ea23cd6d..e9810f8add97 100644
> --- a/arch/riscv/boot/board-dt-2nd.c
> +++ b/arch/riscv/boot/board-dt-2nd.c
> @@ -3,7 +3,7 @@
>  #include <common.h>
>  #include <asm/sections.h>
>  #include <linux/sizes.h>
> -#include <debug_ll.h>
> +#include <asm/ns16550.h>
>  #include <pbl.h>
>  #include <fdt.h>
>  
> @@ -22,10 +22,29 @@
>  
>  #include <asm/barebox-riscv.h>
>  
> +static void virt_ns16550_putc(void *base, int ch)
> +{
> +	early_ns16550_putc(ch, base, 0, readb, writeb);
> +}
> +
> +static void virt_ns16550_init(void)
> +{
> +	void __iomem *base = IOMEM(0x10000000);
> +
> +	early_ns16550_init(base, 3686400 / CONFIG_BAUDRATE, 0, writeb);
> +	pbl_set_putc(virt_ns16550_putc, base);
> +}
> +
> +static const struct fdt_device_id console_ids[] = {
> +	{ .compatible = "riscv-virtio", .data = virt_ns16550_init },
> +	{ /* sentinel */ }

This is only board specific. If we go that path of parsing fdt for early
output can't we just do like Linux and establish earlycon?

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 |

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


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

* Re: [PATCH v2 3/4] RISC-V: board-dt-2nd: add PBL console support for virt
  2021-04-15  7:15   ` Sascha Hauer
@ 2021-04-15  7:53     ` Ahmad Fatoum
  0 siblings, 0 replies; 6+ messages in thread
From: Ahmad Fatoum @ 2021-04-15  7:53 UTC (permalink / raw)
  To: Sascha Hauer, Ahmad Fatoum; +Cc: barebox, Jules Maselbas

Hi Sascha,

On 15.04.21 09:15, Sascha Hauer wrote:
>> +static const struct fdt_device_id console_ids[] = {
>> +	{ .compatible = "riscv-virtio", .data = virt_ns16550_init },
>> +	{ /* sentinel */ }
> 
> This is only board specific. If we go that path of parsing fdt for early
> output can't we just do like Linux and establish earlycon?

Yes, we'll get there eventually. What I'd really like to have is to be
able to, at compile time, associate a debug console with a PBL entry point
that would also work prior to relocation. That debug console should be
inherited into barebox proper to be used until a console driver was
initialized.

We are not there yet though and I still didn't figure some stuff out.
So I'd prefer postponing this more generic until a second boards needs it.

Cheers,
Ahmad

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

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


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

end of thread, other threads:[~2021-04-15  7:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-10 11:06 [PATCH v2 1/4] PBL: fdt: implement fdt_device_get_match_data Ahmad Fatoum
2021-04-10 11:06 ` [PATCH v2 2/4] RISC-V: debug_ll: ns16550: split off debug_ll from generic parts Ahmad Fatoum
2021-04-10 11:06 ` [PATCH v2 3/4] RISC-V: board-dt-2nd: add PBL console support for virt Ahmad Fatoum
2021-04-15  7:15   ` Sascha Hauer
2021-04-15  7:53     ` Ahmad Fatoum
2021-04-10 11:06 ` [PATCH v2 4/4] RISC-V: delete unused mach-virt subdirectory Ahmad Fatoum

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