diff options
author | Simon Glass <sjg@chromium.org> | 2011-05-16 10:57:16 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2011-08-24 10:01:33 -0700 |
commit | 16016e7f644ba2301848f7769af6192cafc45c20 (patch) | |
tree | 8194afb175e3f5bcb278d8c270bc60ede11c1ad6 /include | |
parent | 85ef9e2437c06b70478013ac6203df5daaf79a29 (diff) |
fdt: Use device tree to provide SPI switch details
Rather than having the Seaboard SPI/UART switch in CONFIG options in the
header files, use the device tree to configure this
BUG=chromium-os:11623
TEST=build and boot U-Boot on Seaboard
Change-Id: If3b92b685b5fe31a97ef4bc3578a6aa00208d827
Reviewed-on: http://gerrit.chromium.org/gerrit/1661
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/fdt_decode.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/fdt_decode.h b/include/fdt_decode.h index 303d5a8d332..7f9c1d5821e 100644 --- a/include/fdt_decode.h +++ b/include/fdt_decode.h @@ -28,6 +28,8 @@ * changes to support FDT are minimized. */ +#include <ns16550.h> + /* A typedef for a physical address. We should move it to a generic place */ #ifdef CONFIG_PHYS_64BIT typedef u64 addr_t; @@ -46,6 +48,7 @@ typedef u32 addr_t; */ enum fdt_compat_id { COMPAT_UNKNOWN, + COMPAT_SPI_UART_SWITCH, /* SPI / UART switch */ COMPAT_COUNT, }; @@ -71,6 +74,13 @@ struct fdt_uart { enum fdt_compat_id compat; /* our selected driver */ }; +/* Information about the spi/uart switch */ +struct fdt_spi_uart { + int gpio; /* GPIO to control switch */ + NS16550_t regs; /* Address of UART affected */ + u32 port; /* Port number of UART affected */ +}; + /** * Return information from the FDT about the console UART. This looks for * an alias node called 'console' which must point to a UART. It then reads @@ -115,3 +125,13 @@ void fdt_decode_uart_calc_divisor(struct fdt_uart *uart); * determining which driver will implement the decide described by the node. */ enum fdt_compat_id fdt_decode_lookup(const void *blob, int node); + +/** + * Returns information from the FDT about the SPI / UART switch on tegra + * platforms. + * + * @param blob FDT blob to use + * @param config structure to use to return information + * @returns 0 on success, -ve on error, in which case config is unchanged + */ +int fdt_decode_get_spi_switch(const void *blob, struct fdt_spi_uart *config); |