summaryrefslogtreecommitdiff
path: root/include/configs/seaboard.h
diff options
context:
space:
mode:
authorTom Warren <twarren.nvidia@gmail.com>2011-04-28 07:55:13 -0700
committerSimon Glass <sjg@chromium.org>2011-08-24 09:56:21 -0700
commitd1b282db26a73650b51c680a693e707579ea8035 (patch)
treec985d8a611a2d549edd30902b0b4fd048686c455 /include/configs/seaboard.h
parenta14a954f1ed38a92f83a7b2861e438f21d728027 (diff)
Fix Seaboard UART corruption on SPI activity
On Seaboard the UART and SPI interfere with each other. This causes the UART to receive spurious zero bytes after SPI transactions and also means that SPI can corrupt a few output characters when it starts up if they are still in the UART buffer. This hack corrects this by making SPI record that it may have corrupted the UART, and making the UART take evasive action. BUG=chromium-os:13228 TEST=Try developer U-Boot on Seaboard, make sure it auto-boots OK now Review URL: http://codereview.chromium.org/6715017 Change-Id: If2281357f177eeb3a19a170ddea22adbcf5942e9 Reviewed-on: http://gerrit.chromium.org/gerrit/191 Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/configs/seaboard.h')
-rw-r--r--include/configs/seaboard.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/include/configs/seaboard.h b/include/configs/seaboard.h
index b50796334b..b61dc1535b 100644
--- a/include/configs/seaboard.h
+++ b/include/configs/seaboard.h
@@ -36,6 +36,11 @@
#define CONFIG_SERIAL_MULTI
#define CONFIG_TEGRA2_ENABLE_UARTD
#define CONFIG_SYS_NS16550_COM1 NV_PA_APB_UARTD_BASE
+#define CONFIG_NS16550_BUFFER_READS
+
+/* Seaboard SPI activity corrupts the first UART */
+#define CONFIG_SPI_CORRUPTS_UART NV_PA_APB_UARTD_BASE
+#define CONFIG_SPI_CORRUPTS_UART_NR 0
#define CONFIG_MACH_TYPE MACH_TYPE_SEABOARD
#define CONFIG_SYS_BOARD_ODMDATA 0x300d8011 /* lp1, 1GB */
@@ -67,5 +72,25 @@
CONFIG_EXTRA_ENV_SETTINGS_COMMON \
"board=seaboard\0" \
+/* On Seaboard: GPIO_PI3 = Port I = 8, bit = 3 */
+#define UART_DISABLE_GPIO GPIO_PI3
+
+#if defined(CONFIG_SPI_CORRUPTS_UART) && !defined(__ASSEMBLY__)
+
+/* position of the UART/SPI select switch */
+enum spi_uart_switch {
+ SWITCH_UNKNOWN,
+ SWITCH_SPI,
+ SWITCH_UART
+};
+
+/* Move the SPI/UART switch - we can only use one at a time! */
+void seaboard_switch_spi_uart(enum spi_uart_switch new_pos);
+
+static inline void uart_enable(void) { seaboard_switch_spi_uart(SWITCH_UART); }
+static inline void spi_enable(void) { seaboard_switch_spi_uart(SWITCH_SPI); }
+
+#endif
+
#endif /* __CONFIG_H */