[PATCH] riscv/console: console-config.c update

Hesham Almatary hesham.almatary at cl.cam.ac.uk
Wed May 19 09:13:10 UTC 2021


Hello Somesh,

This patch will break other existing BSPs that don't have
"stdout-path" (in your case serial at xxxxx) node part of "/soc" node.
You can either 1) Modify your DTS to have /serial node outside /soc,
or 2) Add a new config for your BSP such as
RISCV_ENABLE_FRDME310ARTY_SUPPORT and use it instead. I am not sure if
 DTS allows having something like /soc/serial at xxxx in the stdout-path.

On Tue, 18 May 2021 at 20:43, Sebastian Huber
<sebastian.huber at embedded-brains.de> wrote:
>
> On 05/05/2021 19:55, Somesh Deshmukh wrote:
> > - Parsing the sub-node should be available generic not specific to Freedom
> >    Arty310 board. If we remove the Freedom Arty macro now, it will lose
> >    backward compatibility.The proposed change will retain the backward
> >    compatibility and also adds the necessary fix for parsing sub-node.
> > ---
> >   bsps/riscv/riscv/console/console-config.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/bsps/riscv/riscv/console/console-config.c b/bsps/riscv/riscv/console/console-config.c
> > index d962a5a418..797506a31b 100644
> > --- a/bsps/riscv/riscv/console/console-config.c
> > +++ b/bsps/riscv/riscv/console/console-config.c
> > @@ -91,7 +91,7 @@ static int riscv_get_console_node(const void *fdt)
> >       stdout_path = "";
> >     }
> >
> > -#if RISCV_ENABLE_FRDME310ARTY_SUPPORT != 0
> > +#if ((RISCV_ENABLE_FRDME310ARTY_SUPPORT != 0) || (RISCV_CONSOLE_MAX_NS16550_DEVICES > 0))
> >     int root;
> >     int soc;
> >     root = fdt_path_offset(fdt, "/");
>
> What is the purpose of this subnode stuff here:
>
> static int riscv_get_console_node(const void *fdt)
> {
>    const char *stdout_path;
>    int node;
>
>    node = fdt_path_offset(fdt, "/chosen");
>
>    stdout_path = fdt_getprop(fdt, node, "stdout-path", NULL);
>    if (stdout_path == NULL) {
>      stdout_path = "";
>    }
>
> #if ((RISCV_ENABLE_FRDME310ARTY_SUPPORT != 0) ||
> (RISCV_CONSOLE_MAX_NS16550_DEVICES > 0))
>    int root;
>    int soc;
>    root = fdt_path_offset(fdt, "/");
>    soc = fdt_subnode_offset(fdt, root, "soc");
>
>    int offset=fdt_subnode_offset(fdt, soc,stdout_path);
>
>    return offset;
> #else
>    return fdt_path_offset(fdt, stdout_path);
> #endif
> }
>
> What is the value of stdout_path in your setup? Can you show the
> relevant parts of the device tree sources?
>
> --
> embedded brains GmbH
> Herr Sebastian HUBER
> Dornierstr. 4
> 82178 Puchheim
> Germany
> email: sebastian.huber at embedded-brains.de
> phone: +49-89-18 94 741 - 16
> fax:   +49-89-18 94 741 - 08
>
> Registergericht: Amtsgericht München
> Registernummer: HRB 157899
> Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
> Unsere Datenschutzerklärung finden Sie hier:
> https://embedded-brains.de/datenschutzerklaerung/
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel


More information about the devel mailing list