Sudhakar Rajashekhara <[EMAIL PROTECTED]> writes:

> Fixes UART mis-behavior on dm646x.
>
> Signed-off-by: Sudhakar Rajashekhara <[EMAIL PROTECTED]>
> ---
>  arch/arm/mach-davinci/board-dm646x-evm.c |   14 ++++++++++++++
>  1 files changed, 14 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c 
> b/arch/arm/mach-davinci/board-dm646x-evm.c
> index 9f8dac9..818a676 100644
> --- a/arch/arm/mach-davinci/board-dm646x-evm.c
> +++ b/arch/arm/mach-davinci/board-dm646x-evm.c
> @@ -58,6 +58,20 @@ static void __init evm_init_i2c(void)
>       davinci_init_i2c(&i2c_pdata);
>  }
>  
> +#define UART_DM646X_SCR         (DAVINCI_UART0_BASE + 0x40)
> +/*
> + * Internal UARTs need to be initialized for the 8250 autoconfig to work
> + * properly. Note that the TX watermark initialization may not be needed
> + * once the 8250.c watermark handling code is merged.
> + */
> +static int __init dm646x_serial_reset(void)
> +{
> +     davinci_writel(0x08, UART_DM646X_SCR);
> +
> +     return 0;
> +}
> +late_initcall(dm646x_serial_reset);
> +
>  static void board_init(void)
>  {
>       davinci_psc_config(DAVINCI_GPSC_ARMDOMAIN, DM646X_LPSC_AEMIF, 1);

Sudhakar,

Is this misbehavior specific to the DM6467 EVM or common to any DM6467
board?  The patch description could be a bit more descriptive in the
future.

If it is common to any DM6467, do you have any objections to the patch
below which moves this reset from board-specific code into the common
serial code?  It boots for me on DM6467, but since I don't know what
the original misbehavior was, I'm not sure if its OK.

If this is OK, can you update the patch and replace the hard-coded
constant '0x08' with a symbolic name like 'UART_DM646X_SCR_<name>'
defined just afte rthe UART_DM646X_SCR register in serial.c.

Kevin

>From a529ec56095b1297a95ee166346474c7fd67e0a2 Mon Sep 17 00:00:00 2001
From: Kevin Hilman <[EMAIL PROTECTED]>
Date: Thu, 13 Nov 2008 11:10:04 -0800
Subject: [PATCH] DaVinci: DM646x: move serial reset from board code to chip code

Signed-off-by: Kevin Hilman <[EMAIL PROTECTED]>
---
 arch/arm/mach-davinci/board-dm646x-evm.c |   14 --------------
 arch/arm/mach-davinci/serial.c           |    5 +++++
 2 files changed, 5 insertions(+), 14 deletions(-)

diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c 
b/arch/arm/mach-davinci/board-dm646x-evm.c
index b6a2b22..f311f52 100644
--- a/arch/arm/mach-davinci/board-dm646x-evm.c
+++ b/arch/arm/mach-davinci/board-dm646x-evm.c
@@ -117,20 +117,6 @@ static void __init evm_init_i2c(void)
        i2c_register_board_info(1, i2c_info, ARRAY_SIZE(i2c_info));
 }
 
-#define UART_DM646X_SCR         (DAVINCI_UART0_BASE + 0x40)
-/*
- * Internal UARTs need to be initialized for the 8250 autoconfig to work
- * properly. Note that the TX watermark initialization may not be needed
- * once the 8250.c watermark handling code is merged.
- */
-static int __init dm646x_serial_reset(void)
-{
-       davinci_writel(0x08, UART_DM646X_SCR);
-
-       return 0;
-}
-late_initcall(dm646x_serial_reset);
-
 static void board_init(void)
 {
        davinci_psc_config(DAVINCI_GPSC_ARMDOMAIN, DM646X_LPSC_AEMIF, 1);
diff --git a/arch/arm/mach-davinci/serial.c b/arch/arm/mach-davinci/serial.c
index 1a08ef5..9c8a772 100644
--- a/arch/arm/mach-davinci/serial.c
+++ b/arch/arm/mach-davinci/serial.c
@@ -37,6 +37,8 @@
 #include "clock.h"
 
 #define UART_DAVINCI_PWREMU 0x0c
+#define UART_DM646X_SCR            DAVINCI_UART0_BASE + 0x40
+
 #define DM355_UART2_BASE       (0x01E06000)
 
 static inline unsigned int davinci_serial_in(struct plat_serial8250_port *up,
@@ -114,6 +116,9 @@ static void __init davinci_serial_reset(struct 
plat_serial8250_port *p)
        pwremu |= (0x3 << 13);
        pwremu |= 0x1;
        davinci_serial_outs(p, UART_DAVINCI_PWREMU, pwremu);
+
+       if (cpu_is_davinci_dm646x())
+               davinci_serial_outb(p, UART_DM646X_SCR, 0x8);
 }
 
 void __init davinci_serial_init(void)
-- 
1.6.0.3




_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to