diff options
author | Alex Frid <afrid@nvidia.com> | 2012-01-12 17:39:04 -0800 |
---|---|---|
committer | Varun Colbert <vcolbert@nvidia.com> | 2012-01-30 11:46:12 -0800 |
commit | e43a17627f3e7151170082660040d9679c5fa9b1 (patch) | |
tree | ba43d9fc4ef55c82e8ddc64dc324d2f916c5df3b /arch | |
parent | 53d80238951d9989905acc45d18eeb1110ac8c84 (diff) |
ARM: tegra: clock: Auto-detect PLLP rate in uart init
Tegra3 platform may boot with one of the predefined fixed PLLP
(peripheral PLL) output rates: 216MHz, 408MHz, or 204MHz. This
commit implements auto-detection of PLLP rate, and debug uart
configuration during kernel uart initialization.
Bug 928260
Change-Id: I3fac4c462f28ac3dc1c72c0cc0f8f87fa0a809c4
Reviewed-on: http://git-master/r/75849
Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>
Signed-off-by: Alex Frid <afrid@nvidia.com>
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Reviewed-on: http://git-master/r/77294
Reviewed-by: Automatic_Commit_Validation_User
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-tegra/board-cardhu.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-enterprise.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-tegra/devices.c | 18 | ||||
-rw-r--r-- | arch/arm/mach-tegra/devices.h | 5 |
4 files changed, 28 insertions, 3 deletions
diff --git a/arch/arm/mach-tegra/board-cardhu.c b/arch/arm/mach-tegra/board-cardhu.c index bea6a6f19882..8bf2501c29c6 100644 --- a/arch/arm/mach-tegra/board-cardhu.c +++ b/arch/arm/mach-tegra/board-cardhu.c @@ -1,7 +1,7 @@ /* * arch/arm/mach-tegra/board-cardhu.c * - * Copyright (c) 2011, NVIDIA Corporation. + * Copyright (c) 2011-2012, NVIDIA Corporation. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -346,6 +346,8 @@ static void __init uart_debug_init(void) (board_info.board_id == BOARD_E1257)) debug_port_id = 1; } + + tegra_init_debug_uart_rate(); switch (debug_port_id) { case 0: /* UARTA is the debug port. */ diff --git a/arch/arm/mach-tegra/board-enterprise.c b/arch/arm/mach-tegra/board-enterprise.c index f631c9b93cb2..9e4ab51926c2 100644 --- a/arch/arm/mach-tegra/board-enterprise.c +++ b/arch/arm/mach-tegra/board-enterprise.c @@ -1,7 +1,7 @@ /* * arch/arm/mach-tegra/board-enterprise.c * - * Copyright (c) 2011, NVIDIA Corporation. + * Copyright (c) 2011-2012, NVIDIA Corporation. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -395,6 +395,8 @@ static void __init uart_debug_init(void) unsigned long rate; struct clk *c; + tegra_init_debug_uart_rate(); + /* UARTD is the debug port. */ pr_info("Selecting UARTD as the debug console\n"); enterprise_uart_devices[3] = &debug_uartd_device; diff --git a/arch/arm/mach-tegra/devices.c b/arch/arm/mach-tegra/devices.c index 549db73f1627..39bc04bd2e39 100644 --- a/arch/arm/mach-tegra/devices.c +++ b/arch/arm/mach-tegra/devices.c @@ -27,6 +27,7 @@ #include <linux/platform_data/tegra_usb.h> #include <linux/tegra_avp.h> #include <linux/nvhost.h> +#include <linux/clk.h> #include <asm/pmu.h> #include <mach/irqs.h> #include <mach/iomap.h> @@ -1733,3 +1734,20 @@ struct platform_device tegra_nvmap_device = { .name = "tegra-nvmap", .id = -1, }; + +void tegra_init_debug_uart_rate(void) +{ + unsigned int uartclk; + struct clk *debug_uart_parent = clk_get_sys(NULL, "pll_p"); + + BUG_ON(IS_ERR(debug_uart_parent)); + uartclk = clk_get_rate(debug_uart_parent); + + debug_uarta_platform_data[0].uartclk = uartclk; + debug_uartb_platform_data[0].uartclk = uartclk; + debug_uartc_platform_data[0].uartclk = uartclk; + debug_uartd_platform_data[0].uartclk = uartclk; +#if !defined(CONFIG_ARCH_TEGRA_2x_SOC) + debug_uarte_platform_data[0].uartclk = uartclk; +#endif +} diff --git a/arch/arm/mach-tegra/devices.h b/arch/arm/mach-tegra/devices.h index 6d7c7cab3cdf..ff93216ce292 100644 --- a/arch/arm/mach-tegra/devices.h +++ b/arch/arm/mach-tegra/devices.h @@ -5,7 +5,7 @@ * Colin Cross <ccross@android.com> * Erik Gilling <ccross@android.com> * - * Copyright (C) 2010-2011 NVIDIA Corporation. + * Copyright (C) 2010-2012 NVIDIA Corporation. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and @@ -126,4 +126,7 @@ extern struct platform_device debug_uarte_device; extern struct nvhost_device tegra_disp1_device; extern struct platform_device tegra_nvmap_device; + +void tegra_init_debug_uart_rate(void); + #endif |