diff options
author | Simon Glass <sjg@chromium.org> | 2011-08-17 15:18:33 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2011-09-13 13:47:08 -0700 |
commit | b7f199f50179894f7ba19820a9f7c7e0a35493f8 (patch) | |
tree | 03330e9dd7847b7d2f1e1eef00fa11915b0d9c70 | |
parent | edd48fd3df33f7a7668d6cb469a3bf0c72637031 (diff) |
fdt: Only support serial if selected by CONFIG
This fixes what would become a build break if a board did not have NS16550
serial support included. T30 needs this change.
Change-Id: I6e06dd7f7fce7e475c0cbe48edae8d068ca5b7e8
Reviewed-on: http://gerrit.chromium.org/gerrit/7637
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
-rw-r--r-- | common/fdt_decode.c | 2 | ||||
-rw-r--r-- | include/fdt_decode.h | 7 |
2 files changed, 9 insertions, 0 deletions
diff --git a/common/fdt_decode.c b/common/fdt_decode.c index 272b47390c0..b22bfd314e7 100644 --- a/common/fdt_decode.c +++ b/common/fdt_decode.c @@ -327,6 +327,7 @@ int fdt_decode_next_alias(const void *blob, const char *name, return err ? -FDT_ERR_MISSING : node; } +#ifdef CONFIG_SYS_NS16550 int fdt_decode_get_spi_switch(const void *blob, struct fdt_spi_uart *config) { int node, uart_node; @@ -350,6 +351,7 @@ int fdt_decode_get_spi_switch(const void *blob, struct fdt_spi_uart *config) config->gpio = fdt32_to_cpu(gpio[1]); return 0; } +#endif int fdt_decode_memory(const void *blob, struct fdt_memory *config) { diff --git a/include/fdt_decode.h b/include/fdt_decode.h index 84179979647..02c452e767d 100644 --- a/include/fdt_decode.h +++ b/include/fdt_decode.h @@ -28,7 +28,10 @@ * changes to support FDT are minimized. */ +#ifdef CONFIG_SYS_NS16550 #include <ns16550.h> +#endif + #include <asm/arch/clock.h> /* A typedef for a physical address. We should move it to a generic place */ @@ -81,12 +84,14 @@ struct fdt_uart { enum fdt_compat_id compat; /* our selected driver */ }; +#ifdef CONFIG_SYS_NS16550 /* 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 */ }; +#endif enum { FDT_GPIO_NONE = 255, /* an invalid GPIO used to end our list */ @@ -339,6 +344,7 @@ int fdt_decode_next_compatible(const void *blob, int node, int fdt_decode_next_alias(const void *blob, const char *name, enum fdt_compat_id id, int *upto); +#ifdef CONFIG_SYS_NS16550 /** * Returns information from the FDT about the SPI / UART switch on tegra * platforms. @@ -348,6 +354,7 @@ int fdt_decode_next_alias(const void *blob, const char *name, * @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); +#endif /** * Decode a single GPIOs from an FDT. |