aboutsummaryrefslogtreecommitdiff
path: root/machine/fdt.h
diff options
context:
space:
mode:
authorMichael Panzlaff <michael.panzlaff@fau.de>2019-08-12 15:48:18 +0200
committerMichael Panzlaff <michael.panzlaff@fau.de>2019-08-12 16:26:05 +0200
commitd1ca3b9ebee9c6f3fe447e6ea00816f655678519 (patch)
treeeea44e12545fb78592d599d7a6527f2a8ff11b6b /machine/fdt.h
parentbc944193381840386a00ec37a5c44908c8f16689 (diff)
downloadriscv-pk-d1ca3b9ebee9c6f3fe447e6ea00816f655678519.zip
riscv-pk-d1ca3b9ebee9c6f3fe447e6ea00816f655678519.tar.gz
riscv-pk-d1ca3b9ebee9c6f3fe447e6ea00816f655678519.tar.bz2
allow additional ns16550a config via device tree
This commit makes bbl read some additional fields from the device tree if it detects an ns16550a: - reg-shift - reg-offset - clock-frequency For explanation of these check out the Linux Kernel doc: https://www.kernel.org/doc/Documentation/devicetree/bindings/serial/8250.txt In particular this allows the Xilinx AXI UART 16550 to act as serial console with bbl and the Linux early boot console. This also fixes a bug in which bbl will ignore any other than the first "compatible" string when iterating over the nodes. Previously this line would not have worked: compatible = "xlnx,xps-uart16550-2.00.a", "ns16550a"; Before bbl would have just checked the first field instead of checking all strings in the list.
Diffstat (limited to 'machine/fdt.h')
-rw-r--r--machine/fdt.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/machine/fdt.h b/machine/fdt.h
index 97aa70d..056f292 100644
--- a/machine/fdt.h
+++ b/machine/fdt.h
@@ -54,6 +54,7 @@ uint32_t fdt_size(uintptr_t fdt);
// Extract fields
const uint32_t *fdt_get_address(const struct fdt_scan_node *node, const uint32_t *base, uint64_t *value);
const uint32_t *fdt_get_size(const struct fdt_scan_node *node, const uint32_t *base, uint64_t *value);
+uint32_t fdt_get_value(const struct fdt_scan_prop *prop, uint32_t index);
int fdt_string_list_index(const struct fdt_scan_prop *prop, const char *str); // -1 if not found
// Setup memory+clint+plic