
On 1/22/19 1:30 AM, Andreas Schwab wrote:
On Jan 21 2019, Anup Patel anup@brainfault.org wrote:
On Mon, Jan 21, 2019 at 10:40 PM Andreas Schwab schwab@suse.de wrote:
On Jan 21 2019, Anup Patel anup@brainfault.org wrote:
There is a fix required in BBL for real board. We have not send this fix to riscv-pk.
Just to clarify, we hacked U-boot to add the serial driver not BBL. Later, we modified the DT directly in OpenSBI to add the required node.
Where can I find the patch?
The fix is to set following DT prop in /chosen DT node: stdout-path = "/soc/serial@10010000:115200"
How can I do that?I cannot find any function in fdt.c to add new nodes.
There are several ways to do the hack.
BBL doesn't have libfdt included by default. Libfdt is included in u-boot. You can try adding that node in u-boot.
or Here is another hack in U-boot until the OpenSBI is available (Early next week).
diff --git a/drivers/serial/serial-uclass.c b/drivers/serial/serial-uclass.c index ffcd6d15..aa5ee2cc 100644 --- a/drivers/serial/serial-uclass.c +++ b/drivers/serial/serial-uclass.c @@ -54,6 +54,16 @@ static int serial_check_stdout(const void *blob, struct udevice **devp) } if (node < 0) node = fdt_path_offset(blob, "console"); + + if (node < 0) { + const char *sname; + sname = fdt_get_alias(blob, "serial0"); + printf("sname = [%s]\n", sname); + if (sname) + node = fdt_path_offset(blob, sname); + printf("node = [%d]\n", node); + } + if (!uclass_get_device_by_of_offset(UCLASS_SERIAL, node, devp)) return 0;
or you can try to edit the DT directly and update the FSBL if you are comfortable with it.
Apologies, for the inconvenience. Sending these patches to U-boot doesn't make any sense its very board specific. In an ideal world, DT should be fixed directly to address these issues.
Regards, Atish
Andreas.