Sudhakar Rajashekhara <[EMAIL PROTECTED]> writes:
> Source: Texas Instruments Inc.
> Type: Enhancement
> Signed-off-by: Sudhakar Rajashekhara <[EMAIL PROTECTED]>
> Description:
> Adds the dm6467 board support.
> ---
> arch/arm/mach-davinci/Kconfig | 19 +++-
> arch/arm/mach-davinci/Makefile | 1 +
> arch/arm/mach-davinci/board-dm6467-evm.c | 224
> ++++++++++++++++++++++++++++++
> 3 files changed, 242 insertions(+), 2 deletions(-)
> create mode 100644 arch/arm/mach-davinci/board-dm6467-evm.c
Please fix checkpatch warnings:
total: 0 errors, 7 warnings, 267 lines checked
> diff --git a/arch/arm/mach-davinci/Kconfig b/arch/arm/mach-davinci/Kconfig
> index 4a95c60..432f529 100644
> --- a/arch/arm/mach-davinci/Kconfig
> +++ b/arch/arm/mach-davinci/Kconfig
> @@ -4,10 +4,17 @@ menu "TI DaVinci Implementations"
>
> comment "DaVinci Core Type"
>
> +choice
> + prompt "DaVinci ARCH type"
> + default ARCH_DAVINCI_DM644x
> +
> config ARCH_DAVINCI644x
> - default y
> bool "DaVinci 644x based system"
>
> +config ARCH_DAVINCI_DM646x
> + bool "DaVinci 646x based system"
> +endchoice
> +
> comment "DaVinci Board Type"
>
> config MACH_DAVINCI_EVM
> @@ -19,10 +26,18 @@ config MACH_DAVINCI_EVM
> Configure this option to specify the whether the board used
> for development is a DaVinci EVM
>
> +config MACH_DAVINCI_DM6467_EVM
> + bool "TI DM646x EVM"
> + default n
> + depends on ARCH_DAVINCI_DM646x && !ARCH_DAVINCI_DM644x
> + help
> + Configure this option to specify the whether the board used
> + for development is a DM646x EVM
> +
Why the !644x here? Please don't add any options which prevent building
a single kernel which supports multiple parts in the DaVinci family.
> config DAVINCI_I2C_EXPANDER
> bool "TI DaVinci I2C Expander"
> default y
> - depends on I2C && ARCH_DAVINCI644x
> + depends on I2C && ARCH_DAVINCI644x || ARCH_DAVINCI_DM646x
> help
> Configure this option to specify whether the board used
> has I2C exapnder with ATA, USB, CF.
> diff --git a/arch/arm/mach-davinci/Makefile b/arch/arm/mach-davinci/Makefile
> index 66c625d..4fe4836 100644
> --- a/arch/arm/mach-davinci/Makefile
> +++ b/arch/arm/mach-davinci/Makefile
> @@ -9,5 +9,6 @@ obj-y := time.o irq.o clock.o
> serial.o io.o id.o psc.o \
>
> # Board specific
> obj-$(CONFIG_MACH_DAVINCI_EVM) += board-evm.o i2c-emac.o
> +obj-$(CONFIG_MACH_DAVINCI_DM6467_EVM) += board-dm6467-evm.o i2c-emac.o
> obj-$(CONFIG_DAVINCI_MCBSP) += mcbsp.o
> obj-$(CONFIG_DAVINCI_I2C_EXPANDER) += i2c-client.o
> diff --git a/arch/arm/mach-davinci/board-dm6467-evm.c
> b/arch/arm/mach-davinci/board-dm6467-evm.c
> new file mode 100644
> index 0000000..fc1dfab
> --- /dev/null
> +++ b/arch/arm/mach-davinci/board-dm6467-evm.c
> @@ -0,0 +1,224 @@
> +/*
> + * TI DaVinci DM6467 EVM board
> + *
> + * Derived from: arch/arm/mach-davinci/board-evm.c
> + * Copyright (C) 2006 Texas Instruments.
> + *
> + * (C) 2007-2008, MontaVista Software, Inc.
> + *
> + * This file is licensed under the terms of the GNU General Public License
> + * version 2. This program is licensed "as is" without any warranty of any
> + * kind, whether express or implied.
> + *
> + */
> +
> +/**************************************************************************
> + * Included Files
> + **************************************************************************/
> +
> +#include <linux/kernel.h>
> +#include <linux/module.h>
> +#include <linux/init.h>
> +#include <linux/fs.h>
> +#include <linux/major.h>
> +#include <linux/root_dev.h>
> +#include <linux/dma-mapping.h>
> +#include <linux/mtd/mtd.h>
> +#include <linux/mtd/partitions.h>
> +#include <linux/serial.h>
> +#include <linux/mtd/nand.h>
> +#include <linux/serial_8250.h>
> +
> +#include <asm/setup.h>
> +#include <asm/io.h>
> +#include <asm/mach-types.h>
> +
> +#include <asm/mach/arch.h>
> +#include <asm/mach/map.h>
> +#include <asm/mach/flash.h>
> +#include <asm/arch/irqs.h>
> +#include <asm/arch/hardware.h>
> +#include <asm/arch/edma.h>
> +#include <asm/arch/cpu.h>
> +#include <asm/arch/mux.h>
> +#include <asm/arch/nand.h>
> +#include <asm/arch/psc.h>
> +#include <asm/arch/serial.h>
> +#include <asm/arch/i2c-client.h>
> +#include "clock.h"
> +
> +/**************************************************************************
> + * Definitions
> + **************************************************************************/
> +#define DAVINCI_DM646X_UART_CLK 24000000
> +
> +static struct plat_serial8250_port serial_platform_data[] = {
> + {
> + .membase = (char *)IO_ADDRESS(DAVINCI_UART0_BASE),
> + .mapbase = (unsigned long)DAVINCI_UART0_BASE,
> + .irq = IRQ_UARTINT0,
> + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
> + .iotype = UPIO_MEM32,
> + .regshift = 2,
> + .uartclk = DAVINCI_DM646X_UART_CLK,
> + },
> + {
> + .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_MEM32,
> + .regshift = 2,
> + .uartclk = DAVINCI_DM646X_UART_CLK,
> + },
> + {
> + .membase = (char *)IO_ADDRESS(DM644X_UART2_BASE),
> + .mapbase = (unsigned long)DM644X_UART2_BASE,
> + .irq = IRQ_UARTINT2,
> + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
> + .iotype = UPIO_MEM32,
> + .regshift = 2,
> + .uartclk = DAVINCI_DM646X_UART_CLK,
> + },
> + {
> + .flags = 0,
> + },
> +};
> +
> +static struct platform_device serial_device = {
> + .name = "serial8250",
> + .id = 0,
> + .dev = {
> + .platform_data = serial_platform_data,
> + },
> +};
> +
> +/**************************************************************************
> + * Public Functions
> + **************************************************************************/
> +extern void davinci_serial_init(struct platform_device *pdev);
> +
> +static struct platform_device *davinci_evm_devices[] __initdata = {
> + &serial_device,
> +};
> +
> +/* FIQ are pri 0-1; otherwise 2-7, with 7 lowest priority */
> +static const u8 dm646x_default_priorities[DAVINCI_N_AINTC_IRQ] = {
> + [IRQ_DM646X_VP_VERTINT0] = 7,
> + [IRQ_DM646X_VP_VERTINT1] = 7,
> + [IRQ_DM646X_VP_VERTINT2] = 7,
> + [IRQ_DM646X_VP_VERTINT3] = 7,
> + [IRQ_DM646X_VP_ERRINT] = 7,
> + [IRQ_DM646X_RESERVED_1] = 7,
> + [IRQ_DM646X_RESERVED_2] = 7,
> + [IRQ_DM646X_WDINT] = 7,
> + [IRQ_DM646X_CRGENINT0] = 7,
> + [IRQ_DM646X_CRGENINT1] = 7,
> + [IRQ_DM646X_TSIFINT0] = 7,
> + [IRQ_DM646X_TSIFINT1] = 7,
> + [IRQ_DM646X_VDCEINT] = 7,
> + [IRQ_DM646X_USBINT] = 7,
> + [IRQ_DM646X_USBDMAINT] = 7,
> + [IRQ_DM646X_PCIINT] = 7,
> + [IRQ_CCINT0] = 7, /* dma */
> + [IRQ_CCERRINT] = 7, /* dma */
> + [IRQ_TCERRINT0] = 7, /* dma */
> + [IRQ_TCERRINT] = 7, /* dma */
> + [IRQ_DM646X_TCERRINT2] = 7,
> + [IRQ_DM646X_TCERRINT3] = 7,
> + [IRQ_DM646X_IDE] = 7,
> + [IRQ_DM646X_HPIINT] = 7,
> + [IRQ_DM646X_EMACRXTHINT] = 7,
> + [IRQ_DM646X_EMACRXINT] = 7,
> + [IRQ_DM646X_EMACTXINT] = 7,
> + [IRQ_DM646X_EMACMISCINT] = 7,
> + [IRQ_DM646X_MCASP0TXINT] = 7,
> + [IRQ_DM646X_MCASP0RXINT] = 7,
> + [IRQ_AEMIFINT] = 7,
> + [IRQ_DM646X_RESERVED_3] = 7,
> + [IRQ_DM646X_MCASP1TXINT] = 7, /* clockevent */
> + [IRQ_TINT0_TINT34] = 7, /* clocksource */
> + [IRQ_TINT1_TINT12] = 7, /* DSP timer */
> + [IRQ_TINT1_TINT34] = 7, /* system tick */
> + [IRQ_PWMINT0] = 7,
> + [IRQ_PWMINT1] = 7,
> + [IRQ_DM646X_VLQINT] = 7,
> + [IRQ_I2C] = 7,
> + [IRQ_UARTINT0] = 7,
> + [IRQ_UARTINT1] = 7,
> + [IRQ_DM646X_UARTINT2] = 7,
> + [IRQ_DM646X_SPINT0] = 7,
> + [IRQ_DM646X_SPINT1] = 7,
> + [IRQ_DM646X_DSP2ARMINT] = 7,
> + [IRQ_DM646X_RESERVED_4] = 7,
> + [IRQ_DM646X_PSCINT] = 7,
> + [IRQ_DM646X_GPIO0] = 7,
> + [IRQ_DM646X_GPIO1] = 7,
> + [IRQ_DM646X_GPIO2] = 7,
> + [IRQ_DM646X_GPIO3] = 7,
> + [IRQ_DM646X_GPIO4] = 7,
> + [IRQ_DM646X_GPIO5] = 7,
> + [IRQ_DM646X_GPIO6] = 7,
> + [IRQ_DM646X_GPIO7] = 7,
> + [IRQ_DM646X_GPIOBNK0] = 7,
> + [IRQ_DM646X_GPIOBNK1] = 7,
> + [IRQ_DM646X_GPIOBNK2] = 7,
> + [IRQ_DM646X_DDRINT] = 7,
> + [IRQ_DM646X_AEMIFINT] = 7,
> + [IRQ_COMMTX] = 7,
> + [IRQ_COMMRX] = 7,
> + [IRQ_EMUINT] = 7,
> +};
> +
> +extern void davinci_psc_config(unsigned int domain, unsigned int id,
> + char enable);
> +
> +static void board_init(void)
> +{
> + davinci_psc_config(DAVINCI_GPSC_ARMDOMAIN,
> + DAVINCI_DM646X_LPSC_AEMIF, 1);
> + davinci_psc_config(DAVINCI_GPSC_ARMDOMAIN,
> + DAVINCI_DM646X_LPSC_GPIO, 1);
> + davinci_serial_init(&serial_device);
> +}
> +
> +extern const u8 *davinci_def_priorities;
> +
> +void __init davinci_map_common_io(void);
> +
> +static void __init davinci_map_io(void)
> +{
> + davinci_def_priorities = dm646x_default_priorities;
> + davinci_map_common_io();
> +
> + /* Initialize the DaVinci EVM board settigs */
> + board_init();
> +}
> +
> +static __init void evm_init(void)
> +{
> +/* TODO FIXME: davinci_gpio_init(); */
> + platform_add_devices(davinci_evm_devices,
> + ARRAY_SIZE(davinci_evm_devices));
> +}
> +
> +extern void davinci_irq_init(void);
> +extern struct sys_timer davinci_timer;
> +extern void __init davinci_init_common_hw(void);
> +
> +static __init void davinci_dm6467_evm_irq_init(void)
> +{
> + davinci_init_common_hw();
> + davinci_irq_init();
> +}
> +
> +MACHINE_START(DAVINCI_DM6467_EVM, "DaVinci DM6467 EVM")
> + .phys_io = IO_PHYS,
> + .io_pg_offst = (io_p2v(IO_PHYS) >> 18) & 0xfffc,
> + .boot_params = (0x80000100),
> + .map_io = davinci_map_io,
> + .init_irq = davinci_dm6467_evm_irq_init,
> + .timer = &davinci_timer,
> + .init_machine = evm_init,
> +MACHINE_END
> +
> --
> 1.5.4.1
>
> _______________________________________________
> Davinci-linux-open-source mailing list
> [email protected]
> http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source