ARM: tegra: simplify DEBUG_LL UART selection options
Delete CONFIG_TEGRA_DEBUG_UART_AUTO_SCRATCH; it's not useful any more: * No upstream bootloader currently or will ever support this option. * CONFIG_TEGRA_DEBUG_UART_AUTO_ODMDATA is a much more direct alternative. Merge the fixed and automatic UART selection menus into a single choice for simplicity; now you either pick AUTO_ODMDATA or a single fixed UART, rather than potentially having an AUTO option override whatever fixed option was chosen. Remove TEGRA_DEBUG_UART_NONE; if you don't want a Tegra DEBUG_LL UART, simply don't turn on DEBUG_LL. NONE used to be the default option, so pick AUTO_ODMDATA as the new default. Signed-off-by: Stephen Warren <swarren@nvidia.com>
This commit is contained in:
@@ -139,51 +139,19 @@ int auto_odmdata(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_TEGRA_DEBUG_UART_AUTO_SCRATCH
|
||||
int auto_scratch(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
/*
|
||||
* Look for the first UART that:
|
||||
* a) Is not in reset.
|
||||
* b) Is clocked.
|
||||
* c) Has a 'D' in the scratchpad register.
|
||||
*
|
||||
* Note that on Tegra30, the first two conditions are required, since
|
||||
* if not true, accesses to the UART scratch register will hang.
|
||||
* Tegra20 doesn't have this issue.
|
||||
*
|
||||
* The intent is that the bootloader will tell the kernel which UART
|
||||
* to use by setting up those conditions. If nothing found, we'll fall
|
||||
* back to what's specified in TEGRA_DEBUG_UART_BASE.
|
||||
*/
|
||||
for (i = 0; i < ARRAY_SIZE(uarts); i++) {
|
||||
if (!uart_clocked(i))
|
||||
continue;
|
||||
|
||||
uart = (volatile u8 *)uarts[i].base;
|
||||
if (uart[UART_SCR << DEBUG_UART_SHIFT] != 'D')
|
||||
continue;
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Setup before decompression. This is where we do UART selection for
|
||||
* earlyprintk and init the uart_base register.
|
||||
*/
|
||||
static inline void arch_decomp_setup(void)
|
||||
{
|
||||
int uart_id, auto_uart_id;
|
||||
int uart_id;
|
||||
volatile u32 *apb_misc = (volatile u32 *)TEGRA_APB_MISC_BASE;
|
||||
u32 chip, div;
|
||||
|
||||
#if defined(CONFIG_TEGRA_DEBUG_UARTA)
|
||||
#if defined(CONFIG_TEGRA_DEBUG_UART_AUTO_ODMDATA)
|
||||
uart_id = auto_odmdata();
|
||||
#elif defined(CONFIG_TEGRA_DEBUG_UARTA)
|
||||
uart_id = 0;
|
||||
#elif defined(CONFIG_TEGRA_DEBUG_UARTB)
|
||||
uart_id = 1;
|
||||
@@ -193,20 +161,8 @@ static inline void arch_decomp_setup(void)
|
||||
uart_id = 3;
|
||||
#elif defined(CONFIG_TEGRA_DEBUG_UARTE)
|
||||
uart_id = 4;
|
||||
#else
|
||||
uart_id = -1;
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_TEGRA_DEBUG_UART_AUTO_ODMDATA)
|
||||
auto_uart_id = auto_odmdata();
|
||||
#elif defined(CONFIG_TEGRA_DEBUG_UART_AUTO_SCRATCH)
|
||||
auto_uart_id = auto_scratch();
|
||||
#else
|
||||
auto_uart_id = -1;
|
||||
#endif
|
||||
if (auto_uart_id != -1)
|
||||
uart_id = auto_uart_id;
|
||||
|
||||
if (uart_id < 0 || uart_id >= ARRAY_SIZE(uarts) ||
|
||||
!uart_clocked(uart_id))
|
||||
uart = NULL;
|
||||
|
Reference in New Issue
Block a user