From b93651bb2ab90cd41f08ca98f8cd5e76fd918375 Mon Sep 17 00:00:00 2001 From: Gary King Date: Thu, 7 Jan 2010 20:41:47 -0800 Subject: tegra: allow native serial driver uarts to be registered init_common was using a preprocessor conditional to compile-out the uart platform device registration code, but was only checking for the ddk-based uart driver (CONFIG_SERIAL_TEGRA_DDK), not the native one (CONFIG_SERIAL_TEGRA). Furthermore, the registration was registering all controllers on the chip, not the number of valid UARTs on the system. Change-Id: I49b96412c27deed1afe039cfecf2bede681cf320 --- arch/arm/mach-tegra/init_common.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-tegra/init_common.c b/arch/arm/mach-tegra/init_common.c index 33c13b035a13..fa87882fc45e 100644 --- a/arch/arm/mach-tegra/init_common.c +++ b/arch/arm/mach-tegra/init_common.c @@ -377,7 +377,7 @@ static void __init tegra_register_i2c(void) } #endif -#if !defined(CONFIG_SERIAL_TEGRA_DDK) +#if !(defined(CONFIG_SERIAL_TEGRA_DDK) || defined(CONFIG_SERIAL_TEGRA)) #define tegra_register_uart() do {} while (0) #else @@ -390,11 +390,16 @@ void __init tegra_register_uart(void) NvU32 i; NvOdmDebugConsole Console; NvU32 Port = ~0; + const NvU32 *pPinMuxes; + NvU32 NumPinMuxes; + NvU32 Cnt = 0; Console = NvOdmQueryDebugConsole(); NumberOfUarts = NvRmModuleGetNumInstances(s_hRmGlobal, NvRmModuleID_Uart); + NvOdmQueryPinMux(NvOdmIoModule_Uart, &pPinMuxes, &NumPinMuxes); + /* Skip the UART port used as a debug console */ if (((NvU32)Console >= (NvU32)NvOdmDebugConsole_UartA) && ((NvU32)Console <= (NvU32)NvOdmDebugConsole_UartE)) @@ -402,12 +407,12 @@ void __init tegra_register_uart(void) Port = (NvU32)(Console - NvOdmDebugConsole_UartA); } - for (i=0; i< NumberOfUarts ; i++) + for (i=0; i