summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaxman Dewangan <ldewangan@nvidia.com>2011-09-11 10:22:05 +0530
committerVarun Colbert <vcolbert@nvidia.com>2011-09-13 16:01:52 -0700
commit0443b70008d1c7366aecf593c5953bcf615bec0e (patch)
treeadfd684ba49357b25b8cb7b90aa3e70121929db2
parent2233287d9ffb551e359557c052d3d79e93469c92 (diff)
arm: tegra: cardhu: Select debug console from kernel command line
Selecting debug console from linux command line. bug 795847 Change-Id: I00a6447db29251ef4c2a52b742528ff99ea33845 Reviewed-on: http://git-master/r/51847 Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com>
-rw-r--r--arch/arm/mach-tegra/board-cardhu.c89
1 files changed, 68 insertions, 21 deletions
diff --git a/arch/arm/mach-tegra/board-cardhu.c b/arch/arm/mach-tegra/board-cardhu.c
index 9d2c1762ff89..8374a9303d49 100644
--- a/arch/arm/mach-tegra/board-cardhu.c
+++ b/arch/arm/mach-tegra/board-cardhu.c
@@ -560,31 +560,78 @@ static struct tegra_uart_platform_data cardhu_uart_pdata;
static void __init uart_debug_init(void)
{
struct board_info board_info;
+ int debug_port_id;
tegra_get_board_info(&board_info);
- /* UARTB is debug port
- * for SLT - E1186/E1187/PM269
- * for E1256
- */
- if (((board_info.sku & SKU_SLT_ULPI_SUPPORT) &&
- ((board_info.board_id == BOARD_E1186) ||
- (board_info.board_id == BOARD_E1187) ||
- (board_info.board_id == BOARD_PM269))) ||
- (board_info.board_id == BOARD_E1256)) {
- /* UARTB is the debug port. */
- pr_info("Selecting UARTB as the debug console\n");
- cardhu_uart_devices[1] = &debug_uartb_device;
- debug_uart_clk = clk_get_sys("serial8250.0", "uartb");
- debug_uart_port_base = ((struct plat_serial8250_port *)(
- debug_uartb_device.dev.platform_data))->mapbase;
- return;
+ debug_port_id = get_tegra_uart_debug_port_id();
+ if (debug_port_id < 0) {
+ debug_port_id = 0;
+ /* UARTB is debug port
+ * for SLT - E1186/E1187/PM269
+ * for E1256/E1257
+ */
+ if (((board_info.sku & SKU_SLT_ULPI_SUPPORT) &&
+ ((board_info.board_id == BOARD_E1186) ||
+ (board_info.board_id == BOARD_E1187) ||
+ (board_info.board_id == BOARD_PM269))) ||
+ (board_info.board_id == BOARD_E1256))
+ debug_port_id = 1;
}
- /* UARTA is the debug port. */
- pr_info("Selecting UARTA as the debug console\n");
- cardhu_uart_devices[0] = &debug_uarta_device;
- debug_uart_clk = clk_get_sys("serial8250.0", "uarta");
- debug_uart_port_base = ((struct plat_serial8250_port *)(
+ switch (debug_port_id) {
+ case 0:
+ /* UARTA is the debug port. */
+ pr_info("Selecting UARTA as the debug console\n");
+ cardhu_uart_devices[0] = &debug_uarta_device;
+ debug_uart_clk = clk_get_sys("serial8250.0", "uarta");
+ debug_uart_port_base = ((struct plat_serial8250_port *)(
+ debug_uarta_device.dev.platform_data))->mapbase;
+ break;
+
+ case 1:
+ /* UARTB is the debug port. */
+ pr_info("Selecting UARTB as the debug console\n");
+ cardhu_uart_devices[1] = &debug_uartb_device;
+ debug_uart_clk = clk_get_sys("serial8250.0", "uartb");
+ debug_uart_port_base = ((struct plat_serial8250_port *)(
+ debug_uartb_device.dev.platform_data))->mapbase;
+ break;
+
+ case 2:
+ /* UARTC is the debug port. */
+ pr_info("Selecting UARTC as the debug console\n");
+ cardhu_uart_devices[2] = &debug_uartc_device;
+ debug_uart_clk = clk_get_sys("serial8250.0", "uartc");
+ debug_uart_port_base = ((struct plat_serial8250_port *)(
+ debug_uartc_device.dev.platform_data))->mapbase;
+ break;
+
+ case 3:
+ /* UARTD is the debug port. */
+ pr_info("Selecting UARTD as the debug console\n");
+ cardhu_uart_devices[3] = &debug_uartd_device;
+ debug_uart_clk = clk_get_sys("serial8250.0", "uartd");
+ debug_uart_port_base = ((struct plat_serial8250_port *)(
+ debug_uartd_device.dev.platform_data))->mapbase;
+ break;
+
+ case 4:
+ /* UARTE is the debug port. */
+ pr_info("Selecting UARTE as the debug console\n");
+ cardhu_uart_devices[4] = &debug_uarte_device;
+ debug_uart_clk = clk_get_sys("serial8250.0", "uarte");
+ debug_uart_port_base = ((struct plat_serial8250_port *)(
+ debug_uarte_device.dev.platform_data))->mapbase;
+ break;
+
+ default:
+ pr_info("The debug console id %d is invalid, Assuming UARTA", debug_port_id);
+ cardhu_uart_devices[0] = &debug_uarta_device;
+ debug_uart_clk = clk_get_sys("serial8250.0", "uarta");
+ debug_uart_port_base = ((struct plat_serial8250_port *)(
debug_uarta_device.dev.platform_data))->mapbase;
+ break;
+ }
+ return;
}
static void __init cardhu_uart_init(void)