Hi Eric,

On Mon, Apr 21, 2008 at 2:43 AM, Eric Nelson (Boundary Devices)
<[EMAIL PROTECTED]> wrote:
> Signed-off-by: Eric Nelson (Boundary Devices) <[EMAIL PROTECTED]>
>  ---
>   arch/arm/mach-davinci/Kconfig  |   25 +++++++++++++++++
>   arch/arm/mach-davinci/clock.c  |   18 ++++++++++++-
>   arch/arm/mach-davinci/serial.c |   57 
> +++++++++++++++++++++++++++++++++++-----
>   3 files changed, 92 insertions(+), 8 deletions(-)
>
>  diff --git a/arch/arm/mach-davinci/Kconfig b/arch/arm/mach-davinci/Kconfig
>  index 0514c85..7b58b84 100644
>  --- a/arch/arm/mach-davinci/Kconfig
>  +++ b/arch/arm/mach-davinci/Kconfig
>  @@ -27,6 +27,31 @@ config DAVINCI_I2C_EXPANDER
>           Configure this option to specify whether the board used
>           has I2C exapnder with ATA, USB, CF.
>
>  +config DAVINCI_UART0
>  +       bool "Enable UART0"
>  +       default y if MACH_DAVINCI_EVM
>  +       depends on ARCH_DAVINCI644x
>  +       help
>  +         Choose this to include support for UART0
>  +
>  +config DAVINCI_UART1
>  +       bool "Enable UART1"
>  +       default n if MACH_DAVINCI_EVM
>  +       depends on ARCH_DAVINCI644x
>  +       help
>  +         Choose this to include support for UART1. Note that the
>  +          board-specific startup will need to set up the pin
>  +          multiplexing.
>  +
>  +config DAVINCI_UART2
>  +       bool "Enable UART2"
>  +       default n if MACH_DAVINCI_EVM
>  +       depends on ARCH_DAVINCI644x
>  +       help
>  +         Choose this to include support for UART2. Note that the
>  +          board-specific startup will need to set up the pin
>  +          multiplexing.
>  +
>   config DAVINCI_MCBSP
>         bool
>          prompt "DaVinci McBSP Driver" if SOUND_DAVINCI=n
>  diff --git a/arch/arm/mach-davinci/clock.c b/arch/arm/mach-davinci/clock.c
>  index b3092c1..0446149 100644
>  --- a/arch/arm/mach-davinci/clock.c
>  +++ b/arch/arm/mach-davinci/clock.c
>  @@ -190,11 +190,27 @@ static struct clk davinci_clks[] = {
>                 .lpsc = -1,
>                 .flags = ALWAYS_ENABLED,
>         },
>  +#ifdef CONFIG_DAVINCI_UART0
>         {
>  -               .name = "UART",
>  +               .name = "UART0",
>                 .rate = &fixedrate,
>                 .lpsc = DAVINCI_LPSC_UART0,
>         },
>  +#endif
>  +#ifdef CONFIG_DAVINCI_UART1
>  +       {
>  +               .name = "UART1",
>  +               .rate = &fixedrate,
>  +               .lpsc = DAVINCI_LPSC_UART1,
>  +       },
>  +#endif
>  +#ifdef CONFIG_DAVINCI_UART2
>  +       {
>  +               .name = "UART2",
>  +               .rate = &fixedrate,
>  +               .lpsc = DAVINCI_LPSC_UART2,
>  +       },
>  +#endif
>         {
>                 .name = "EMACCLK",
>                 .rate = &commonrate,
>  diff --git a/arch/arm/mach-davinci/serial.c b/arch/arm/mach-davinci/serial.c
>  index d0e7c52..6684a8f 100644
>  --- a/arch/arm/mach-davinci/serial.c
>  +++ b/arch/arm/mach-davinci/serial.c
>  @@ -50,6 +50,7 @@ static inline void davinci_serial_outp(struct 
> plat_serial8250_port *p,
>   }
>
>   static struct plat_serial8250_port serial_platform_data[] = {
>  +#ifdef CONFIG_DAVINCI_UART0
>         {
>                 .membase        = (char *)IO_ADDRESS(DAVINCI_UART0_BASE),
>                 .mapbase        = (unsigned long)DAVINCI_UART0_BASE,
>  @@ -59,11 +60,48 @@ static struct plat_serial8250_port 
> serial_platform_data[] = {
>                 .regshift       = 2,
>                 .uartclk        = 27000000,
>         },
>  +#endif
>  +#ifdef CONFIG_DAVINCI_UART1
>  +       {
>  +               .membase        = (char *)IO_ADDRESS(DAVINCI_UART1_BASE),
>  +               .mapbase        = (unsigned long)DAVINCI_UART1_BASE,
>  +               .irq            = IRQ_UARTINT1,
>  +               .flags          = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
>  +               .iotype         = UPIO_MEM,
>  +               .regshift       = 2,
>  +               .uartclk        = 27000000,
>  +       },
>  +#endif
>  +#ifdef CONFIG_DAVINCI_UART2
>  +       {
>  +               .membase        = (char *)IO_ADDRESS(DAVINCI_UART2_BASE),
>  +               .mapbase        = (unsigned long)DAVINCI_UART2_BASE,
>  +               .irq            = IRQ_UARTINT2,
>  +               .flags          = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
>  +               .iotype         = UPIO_MEM,
>  +               .regshift       = 2,
>  +               .uartclk        = 27000000,
>  +       },
>  +#endif
>         {
>                 .flags          = 0
>         },
>   };


I am not happy with this #ifdefers here. Instead it should be done
like how we are doing on OMAP. We use pass uart info structure from
board specific file with "enabled uarts" pattern, which can be checked
in serial.c. As no. of UARTS are going to be constant for DaVinci
chip, but which UART is going to be enabled/disabled is based on board
design.

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

Reply via email to