Patchwork [U-Boot,v3,2/3] tegra: move TEGRA_DEVICE_SETTINGS to tegra-common-post.h

login
register
mail settings
Submitter Allen Martin
Date Oct. 23, 2012, 9:37 p.m.
Message ID <1351028274-30301-2-git-send-email-amartin@nvidia.com>
Download mbox | patch
Permalink /patch/193579/
State Superseded
Delegated to: Marek Vasut
Headers show

Comments

Allen Martin - Oct. 23, 2012, 9:37 p.m.
Move environment settings for stdin/stdout/stderr to
tegra-common-post.h and generate them automaticaly based on input
device selection.

Signed-off-by: Allen Martin <amartin@nvidia.com>
Acked-by: Stephen Warren <swarren@nvidia.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
---
v3: no changes
v2: new patch
---
 include/configs/seaboard.h          |    5 -----
 include/configs/tegra-common-post.h |   19 +++++++++++++++++++
 include/configs/tegra20-common.h    |    4 ----
 3 files changed, 19 insertions(+), 9 deletions(-)

Patch

diff --git a/include/configs/seaboard.h b/include/configs/seaboard.h
index 0727a4c..2cb3ac9 100644
--- a/include/configs/seaboard.h
+++ b/include/configs/seaboard.h
@@ -98,11 +98,6 @@ 
 #define CONFIG_TEGRA_KEYBOARD
 #define CONFIG_KEYBOARD
 
-#undef TEGRA_DEVICE_SETTINGS
-#define TEGRA_DEVICE_SETTINGS	"stdin=serial,tegra-kbc\0" \
-				"stdout=serial\0" \
-				"stderr=serial\0"
-
 #include "tegra-common-post.h"
 
 /* NAND support */
diff --git a/include/configs/tegra-common-post.h b/include/configs/tegra-common-post.h
index 9698c23..8d21d9c 100644
--- a/include/configs/tegra-common-post.h
+++ b/include/configs/tegra-common-post.h
@@ -140,6 +140,25 @@ 
 
 #endif
 
+#ifdef CONFIG_TEGRA_KEYBOARD
+#define STDIN_KBD_KBC ",tegra-kbc"
+#else
+#define STDIN_KBD_KBC ""
+#endif
+
+#ifdef CONFIG_USB_KEYBOARD
+#define STDIN_KBD_USB ",usbkbd"
+#define CONFIG_SYS_USB_EVENT_POLL
+#define CONFIG_PREBOOT			"usb start"
+#else
+#define STDIN_KBD_USB ""
+#endif
+
+#define TEGRA_DEVICE_SETTINGS \
+	"stdin=serial" STDIN_KBD_KBC STDIN_KBD_USB "\0" \
+	"stdout=serial\0" \
+	"stderr=serial\0" \
+
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	TEGRA_DEVICE_SETTINGS \
 	"fdt_load=0x01000000\0" \
diff --git a/include/configs/tegra20-common.h b/include/configs/tegra20-common.h
index dc7444d..ea89d76 100644
--- a/include/configs/tegra20-common.h
+++ b/include/configs/tegra20-common.h
@@ -125,12 +125,8 @@ 
 
 #define CONFIG_SYS_NO_FLASH
 
-/* Environment information, boards can override if required */
 #define CONFIG_CONSOLE_MUX
 #define CONFIG_SYS_CONSOLE_IS_IN_ENV
-#define TEGRA_DEVICE_SETTINGS	"stdin=serial\0" \
-				"stdout=serial\0" \
-				"stderr=serial\0"
 
 #define CONFIG_LOADADDR		0x408000	/* def. location for kernel */
 #define CONFIG_BOOTDELAY	2		/* -1 to disable auto boot */