diff options
Diffstat (limited to 'lib/utils/serial')
-rw-r--r-- | lib/utils/serial/fdt_serial_htif.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/utils/serial/fdt_serial_htif.c b/lib/utils/serial/fdt_serial_htif.c index fae55b8..61f66d6 100644 --- a/lib/utils/serial/fdt_serial_htif.c +++ b/lib/utils/serial/fdt_serial_htif.c @@ -19,7 +19,17 @@ static const struct fdt_match serial_htif_match[] = { static int serial_htif_init(void *fdt, int nodeoff, const struct fdt_match *match) { - return htif_serial_init(); + bool custom = false; + uint64_t fromhost_addr = 0, tohost_addr = 0; + + if (!fdt_get_node_addr_size(fdt, nodeoff, 0, &fromhost_addr, NULL)) { + custom = true; + tohost_addr = fromhost_addr + sizeof(uint64_t); + } + + fdt_get_node_addr_size(fdt, nodeoff, 1, &tohost_addr, NULL); + + return htif_serial_init(custom, fromhost_addr, tohost_addr); } struct fdt_serial fdt_serial_htif = { |