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

Sebastian Huber sebastian.huber at embedded-brains.de
Tue May 18 18:43:37 UTC 2021


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/


More information about the devel mailing list