summaryrefslogtreecommitdiff
path: root/lib/utils/serial/fdt_serial.c
AgeCommit message (Collapse)Author
2024-11-28lib: utils/serial: Use fdt_driver for initializationSamuel Holland
The serial driver subsystem does not need any extra data, so it can use `struct fdt_driver` directly. The generic fdt_serial_init() first attempts to match the chosen stdout device, and upon failure matches the first available serial device in the DT. It is a fatal error if no such device is found. This matches the behavior of fdt_driver_init_one(). Signed-off-by: Samuel Holland <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2024-11-28treewide: Make carray arrays const and NULL-terminatedSamuel Holland
This allows the compiler to generate significantly better code, because it does not have to maintain either the loop counter or loop limit. Plus there are half as many symbols to relocate. This also simplifies passing carray arrays to helper functions. Signed-off-by: Samuel Holland <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2024-08-24lib: utils/serial: Pass the FDT to fdt_serial_init()Samuel Holland
Indicate that this function does not modify the FDT blob, and deduplicate the call to fdt_get_address(). Signed-off-by: Samuel Holland <[email protected]> Reviewed-by: Andrew Jones <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2024-08-24lib: utils/serial: Constify FDT pointers in parsing functionsSamuel Holland
Indicate that none of these functions modify the devicetree by constifying the parameter type. Signed-off-by: Samuel Holland <[email protected]> Reviewed-by: Andrew Jones <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2024-06-13lib: utils/serial: Fix fdt_serial to match more dt nodesXiang W
If there are multiple dt nodes, the previous code only tries to match the first one, which may lose initialization. Signed-off-by: Xiang W <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2024-06-13lib: utils/serial: Skip initialize serial when dt is not enabledXiang W
When the dt node has a status property and the value is not ok or okay, skip initializing serial. Signed-off-by: Xiang W <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2023-05-26lib: utils: Improve fdt_serial_initXiang W
A final check of all DT nodes does not necessarily find a match, so SBI_ENODEV needs to be returned. Optimize removal of current_driver. Signed-off-by: Xiang W <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2022-05-13lib: utils/serial: Generate FDT serial driver list at compile-timeAnup Patel
Instead of having FDT serial driver list hard-coded in the C source, we generate it using carray.sh at compile-time. Signed-off-by: Anup Patel <[email protected]> Reviewed-by: Atish Patra <[email protected]>
2022-02-28lib: utils: serial: Initial commit of xlnx-uartliteAlistair Francis
Initial commit of the xlnx-uartlite device and FDT support. This was tested by running OpenSBI on a modified QEMU virt machine using the xlnx-uartlite for serial. Signed-off-by: Alistair Francis <[email protected]> Reviewed-by: Xiang W <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2021-11-18lib: utils: Add LiteX UART supportGabriel Somlo
Add support for the UART provided by the LiteX SoC framework (https://github.com/enjoy-digital/litex), based on its FDT info (described in the Linux tree at Documentation/devicetree/bindings/serial/litex,liteuart.yaml). Signed-off-by: Gabriel Somlo <[email protected]> Reviewed-by: Xiang W <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2021-11-02include: sbi_utils: Introduce an helper to get fdt base addressAlexandre Ghiti
This simply adds an helper to get fdt address which is more explicit than sbi_scratch_thishart_arg1_ptr. Signed-off-by: Alexandre Ghiti <[email protected]> Reviewed-by: Xiang W <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2021-06-02lib: utils: consider ':' in stdout-pathHeinrich Schuchardt
The value of the /chosen/stdout-path devicetree property is used to determine the UART used by openSBI. According to the devicetree specification the value may contain a hyphen, e.g. chosen {                 stdout-path = "/serial@f00:115200";         }; If the character ':' is present, it terminates the path of the device. Signed-off-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Atish Patra <[email protected]>
2021-05-24lib: utils: Try other FDT drivers when we see SBI_ENODEVAnup Patel
We should try other FDT drivers when we see SBI_ENODEV returned by cold_init() of FDT driver. Signed-off-by: Anup Patel <[email protected]> Reviewed-by: Atish Patra <[email protected]> Reviewed-by: Xiang W <[email protected]>
2021-05-06lib: utils/serial: Add support for Gaisler APBUARTDaniel Cederman
This patch adds support for the UART used by the NOEL-V processor. Cobham Gaisler's NOEL-V RISC-V processor IP is available under GPL and commercial license and is described in more detail at https://www.gaisler.com/noelv. Signed-off-by: Daniel Cederman <[email protected]> Reviewed-by: Anup Patel <[email protected]> Reviewed-by: Bin Meng <[email protected]>
2021-04-28lib: sbi: Simplify console platform operationsAnup Patel
Instead of having console_putc() and console_getc() callbacks in platform operations, it will be much simpler for console driver to directly register these operations as device to the sbi_console implementation. Signed-off-by: Anup Patel <[email protected]> Reviewed-by: Alistair Francis <[email protected]> Reviewed-by: Xiang W <[email protected]>
2020-06-19platform: Add support for Shakti C-class SoC from IIT-MVijai Kumar K
C-Class is a member of the SHAKTI family of processors from Indian Institute of Technology - Madras(IIT-M). It is an extremely configurable and commercial-grade 5-stage in-order core supporting the standard RV64GCSUN ISA extensions. https://gitlab.com/shaktiproject/cores/c-class/blob/master/README.md We add OpenSBI support for Shakti C-class SoC. Signed-off-by: Vijai Kumar K <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2020-05-23lib: utils: Extend fdt_find_match() ImplementationAnup Patel
We extend fdt_find_match() implementation by adding node offset parameter which represents the first node to match from. The improved fdt_find_match() can be used to find multiple match nodes. Signed-off-by: Anup Patel <[email protected]> Reviewed-by: Atish Patra <[email protected]>
2020-05-01lib: utils: Add simple FDT serial frameworkAnup Patel
We add simple serial framework which will select and use serial driver based on details in FDT passed by previous booting stage. Signed-off-by: Anup Patel <[email protected]> Reviewed-by: Atish Patra <[email protected]>