loader/u-boot: Use FDT serial info to create uart

* drop my fdt tests
* we have to call fdt parsing code *after* cpu_init (why?)
* pass fdt pointer to all FDT support calls to avoid confusion
  once we get into the kernel land
* look for PL011 compatible uart and use it
* Add some saftey checks to serial putc code to avoid null*
* fdt_node_check_compatible returns 0 on success not 1
* fdt_get_device_reg needs to add the SOC base to the result
* fdt_get_device_reg might need to add the second range cell
  instead of reg?
This commit is contained in:
Alexander von Gluck IV
2015-03-28 15:52:16 -05:00
parent 3d02d66b03
commit c6a4fee579
8 changed files with 126 additions and 66 deletions
@@ -0,0 +1,19 @@
/*
* Copyright 2012-2015, Haiku, Inc.
* Distributed under the terms of the MIT License.
*
* Authors
* Alexander von Gluck IV, [email protected]
*/
#ifndef __FDT_SERIAL_H
#define __FDT_SERIAL_H
#include <KernelExport.h>
#include <arch/generic/debug_uart.h>
DebugUART * debug_uart_from_fdt(const void *fdt);
#endif /*__FDT_SERIAL_H*/
@@ -13,11 +13,12 @@
void dump_fdt(const void *fdt);
status_t fdt_get_cell_count(int node, int32 &addressCells, int32 &sizeCells);
status_t fdt_get_cell_count(const void* fdt, int node,
int32 &addressCells, int32 &sizeCells);
phys_addr_t fdt_get_device_reg(int node);
phys_addr_t fdt_get_device_reg_byname(const char* name);
phys_addr_t fdt_get_device_reg_byalias(const char* alias);
phys_addr_t fdt_get_device_reg(const void* fdt, int node);
phys_addr_t fdt_get_device_reg_byname(const void* fdt, const char* name);
phys_addr_t fdt_get_device_reg_byalias(const void* fdt, const char* alias);
#endif /*__FDT_SUPPORT_H*/