@@ -178,6 +178,13 @@ config DA850_UI_RMII
endchoice
+config MACH_TNETV107X
+ bool "TI TNETV107X Reference Platform"
+ default ARCH_DAVINCI_TNETV107X
+ depends on ARCH_DAVINCI_TNETV107X
+ help
+ Say Y here to select the TI TNETV107X Evaluation Module.
+
config DAVINCI_MUX
bool "DAVINCI multiplexing support"
depends on ARCH_DAVINCI
@@ -32,6 +32,7 @@ obj-$(CONFIG_MACH_DAVINCI_DM6467_EVM) += board-dm646x-evm.o cdce949.o
obj-$(CONFIG_MACH_DAVINCI_DM365_EVM) += board-dm365-evm.o
obj-$(CONFIG_MACH_DAVINCI_DA830_EVM) += board-da830-evm.o
obj-$(CONFIG_MACH_DAVINCI_DA850_EVM) += board-da850-evm.o
+obj-$(CONFIG_MACH_TNETV107X) += board-tnetv107x-evm.o
# Power Management
obj-$(CONFIG_CPU_FREQ) += cpufreq.o
new file mode 100644
@@ -0,0 +1,281 @@
+/*
+ * TI TNETV107X EVM board
+ *
+ * Author: Cyril Chemparathy <cyril@ti.com>
+ * Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * Derived from: arch/arm/mach-davinci/board-da830-evm.c
+ * Original copyrights follow.
+ *
+ * 2007, 2009 (c) 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.
+ */
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/console.h>
+#include <linux/dma-mapping.h>
+#include <linux/interrupt.h>
+#include <linux/gpio.h>
+#include <linux/delay.h>
+#include <linux/serial_8250.h>
+#include <linux/platform_device.h>
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/partitions.h>
+#include <linux/mtd/physmap.h>
+#include <asm/mach/arch.h>
+#include <asm/mach-types.h>
+
+#include <mach/irqs.h>
+#include <mach/edma.h>
+#include <mach/mmc.h>
+#include <mach/serial.h>
+#include <mach/mux.h>
+#include <mach/nand.h>
+#include <mach/tnetv107x.h>
+
+/* Base addresses for on-chip devices */
+#define TNETV107X_SDIO1_BASE 0x08088800
+#define TNETV107X_ASYNC_EMIF_CNTRL_BASE 0x08200000
+#define TNETV107X_ASYNC_EMIF_DATA_CE0_BASE 0x30000000
+#define TNETV107X_DDR_BASE 0x80000000
+
+#define TNETV107X_DMACH_SDIO1_RX 28
+#define TNETV107X_DMACH_SDIO1_TX 29
+
+#define TNETV107X_EVM_MMC_WP_GPIO 21
+#define TNETV107X_EVM_MMC_CD_GPIO 24
+
+static struct plat_serial8250_port tnetv107x_serial_pdata[] = {
+ {
+ .mapbase = TNETV107X_UART0_BASE,
+ .irq = IRQ_TNETV107X_UART0,
+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
+ UPF_FIXED_TYPE | UPF_IOREMAP,
+ .type = PORT_AR7,
+ .iotype = UPIO_MEM32,
+ .regshift = 2,
+ },
+ {
+ .mapbase = TNETV107X_UART1_BASE,
+ .irq = IRQ_TNETV107X_UART1,
+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
+ UPF_FIXED_TYPE | UPF_IOREMAP,
+ .type = PORT_AR7,
+ .iotype = UPIO_MEM32,
+ .regshift = 2,
+ },
+ {
+ .flags = 0,
+ },
+};
+
+static struct platform_device tnetv107x_serial_device = {
+ .name = "serial8250",
+ .id = PLAT8250_DEV_PLATFORM,
+ .dev = {
+ .platform_data = tnetv107x_serial_pdata,
+ },
+};
+
+static int tnetv107x_evm_mmc_get_ro(int index)
+{
+ return gpio_get_value(TNETV107X_EVM_MMC_WP_GPIO);
+}
+
+static int tnetv107x_evm_mmc_get_cd(int index)
+{
+ return !gpio_get_value(TNETV107X_EVM_MMC_CD_GPIO);
+}
+
+static struct resource tnetv107x_evm_mmc_resources[] = {
+ { /* Memory mapped registers */
+ .start = TNETV107X_SDIO1_BASE,
+ .end = TNETV107X_SDIO1_BASE + 0x0ff,
+ .flags = IORESOURCE_MEM
+ },
+ { /* MMC interrupt */
+ .start = IRQ_TNETV107X_MMC1,
+ .flags = IORESOURCE_IRQ
+ },
+ { /* SDIO interrupt */
+ .start = IRQ_TNETV107X_SDIO1,
+ .flags = IORESOURCE_IRQ
+ },
+ { /* DMA RX */
+ .start = EDMA_CTLR_CHAN(0, TNETV107X_DMACH_SDIO1_RX),
+ .flags = IORESOURCE_DMA
+ },
+ { /* DMA TX */
+ .start = EDMA_CTLR_CHAN(0, TNETV107X_DMACH_SDIO1_TX),
+ .flags = IORESOURCE_DMA
+ },
+};
+
+static struct davinci_mmc_config tnetv107x_evm_mmc_config = {
+ .get_cd = tnetv107x_evm_mmc_get_cd,
+ .get_ro = tnetv107x_evm_mmc_get_ro,
+ .wires = 4,
+ .max_freq = 50000000,
+ .caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED,
+ .version = MMC_CTLR_VERSION_1,
+};
+
+static u64 tnetv107x_evm_mmc_dma_mask = DMA_BIT_MASK(32);
+
+static struct platform_device tnetv107x_evm_mmc_device = {
+ .name = "davinci_mmc",
+ .id = 1,
+ .dev = {
+ .dma_mask = &tnetv107x_evm_mmc_dma_mask,
+ .coherent_dma_mask = DMA_BIT_MASK(32),
+ .platform_data = &tnetv107x_evm_mmc_config,
+ },
+ .num_resources = ARRAY_SIZE(tnetv107x_evm_mmc_resources),
+ .resource = tnetv107x_evm_mmc_resources
+};
+
+static const short tnetv107x_sdio1_pins[] = {
+ TNETV107X_SDIO1_CLK_1, TNETV107X_SDIO1_CMD_1,
+ TNETV107X_SDIO1_DATA0_1, TNETV107X_SDIO1_DATA1_1,
+ TNETV107X_SDIO1_DATA2_1, TNETV107X_SDIO1_DATA3_1,
+ -1
+};
+
+const short tnetv107x_uart1_pins[] = {
+ TNETV107X_UART1_RD, TNETV107X_UART1_TD,
+ -1
+};
+
+static const short tnetv107x_gpio_pins[] = {
+ TNETV107X_GPIO21, TNETV107X_GPIO24, TNETV107X_GPIO23,
+ -1
+};
+
+static struct mtd_partition tnetv107x_evm_nand_partitions[] = {
+ /* bootloader (U-Boot, etc) in first 12 sectors */
+ {
+ .name = "bootloader",
+ .offset = 0,
+ .size = (12*SZ_128K),
+ .mask_flags = MTD_WRITEABLE, /* force read-only */
+ },
+ /* bootloader params in the next sector */
+ {
+ .name = "params",
+ .offset = MTDPART_OFS_NXTBLK,
+ .size = SZ_128K,
+ .mask_flags = MTD_WRITEABLE, /* force read-only */
+ },
+ /* kernel */
+ {
+ .name = "kernel",
+ .offset = MTDPART_OFS_NXTBLK,
+ .size = SZ_4M,
+ .mask_flags = 0,
+ },
+ /* file system */
+ {
+ .name = "filesystem",
+ .offset = MTDPART_OFS_NXTBLK,
+ .size = MTDPART_SIZ_FULL,
+ .mask_flags = 0,
+ }
+};
+
+static struct davinci_nand_pdata tnetv107x_evm_nand_data = {
+ .mask_cle = 0x4000,
+ .mask_ale = 0x2000,
+ .parts = tnetv107x_evm_nand_partitions,
+ .nr_parts = ARRAY_SIZE(tnetv107x_evm_nand_partitions),
+ .ecc_mode = NAND_ECC_HW,
+};
+
+static struct resource tnetv107x_evm_nand_resources[] = {
+ {
+ .start = TNETV107X_ASYNC_EMIF_DATA_CE0_BASE,
+ .end = TNETV107X_ASYNC_EMIF_DATA_CE0_BASE +
+ SZ_32K - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .start = TNETV107X_ASYNC_EMIF_CNTRL_BASE,
+ .end = TNETV107X_ASYNC_EMIF_CNTRL_BASE +
+ SZ_4K - 1,
+ .flags = IORESOURCE_MEM,
+ },
+};
+
+static struct platform_device tnetv107x_evm_nand_device = {
+ .name = "davinci_nand",
+ .id = 0, /* chip select 0 */
+ .dev = {
+ .platform_data = &tnetv107x_evm_nand_data,
+ },
+ .num_resources = ARRAY_SIZE(tnetv107x_evm_nand_resources),
+ .resource = tnetv107x_evm_nand_resources,
+};
+
+static struct platform_device *tnetv107x_evm_devices[] __initdata = {
+ &tnetv107x_serial_device,
+ &tnetv107x_evm_nand_device,
+ &tnetv107x_evm_mmc_device,
+};
+
+static __init void tnetv107x_evm_board_init(void)
+{
+ int status;
+
+ davinci_cfg_reg_list(tnetv107x_sdio1_pins);
+ davinci_cfg_reg_list(tnetv107x_uart1_pins);
+ davinci_cfg_reg_list(tnetv107x_gpio_pins);
+
+ tnetv107x_edma_init();
+ tnetv107x_watchdog_init();
+ tnetv107x_serial_init(tnetv107x_serial_pdata);
+
+ status = gpio_request(TNETV107X_EVM_MMC_WP_GPIO, "MMC WP\n");
+ if (status < 0) {
+ printk(KERN_ERR "cannot open mmcsd write protect gpio %d\n",
+ TNETV107X_EVM_MMC_WP_GPIO);
+ tnetv107x_evm_mmc_config.get_ro = NULL;
+ } else {
+ gpio_direction_input(TNETV107X_EVM_MMC_WP_GPIO);
+ }
+
+ status = gpio_request(TNETV107X_EVM_MMC_CD_GPIO, "MMC CD\n");
+ if (status < 0) {
+ printk(KERN_ERR "cannot open mmcsd card detect gpio %d\n",
+ TNETV107X_EVM_MMC_CD_GPIO);
+ tnetv107x_evm_mmc_config.get_cd = NULL;
+ } else {
+ gpio_direction_input(TNETV107X_EVM_MMC_CD_GPIO);
+ }
+
+ platform_add_devices(tnetv107x_evm_devices,
+ ARRAY_SIZE(tnetv107x_evm_devices));
+}
+
+#ifdef CONFIG_SERIAL_8250_CONSOLE
+static int __init tnetv107x_evm_console_init(void)
+{
+ return add_preferred_console("ttyS", 1, "115200");
+}
+console_initcall(tnetv107x_evm_console_init);
+#endif
+
+static void __init map_io(void)
+{
+ tnetv107x_init();
+}
+
+MACHINE_START(TNETV107X, "TNETV107X EVM")
+ .phys_io = TNETV107X_IO_BASE,
+ .io_pg_offst = (TNETV107X_IO_VIRT >> 18) & 0xfffc,
+ .boot_params = (TNETV107X_DDR_BASE + 0x100),
+ .map_io = map_io,
+ .init_irq = tnetv107x_irq_init,
+ .timer = &davinci_timer,
+ .init_machine = tnetv107x_evm_board_init,
+MACHINE_END