diff options
| author | Cyril Chemparathy <cyril@ti.com> | 2010-05-18 12:51:19 -0400 |
|---|---|---|
| committer | Kevin Hilman <khilman@deeprootsystems.com> | 2010-06-21 15:48:30 -0400 |
| commit | 4d1e78480cc5b5937c9384e47a0b2b0cdf117da4 (patch) | |
| tree | 3773a06c3b3bfe05ea80a10dfdbe3920daa1d1cc | |
| parent | 38db050e0bfc8c483e5d7b85feef23d46069ec18 (diff) | |
Davinci: tnetv107x soc support
TNETV107X is a Texas Instruments SOC that shares a number of common features
with the Davinci architecture. Some of the key differences between
traditional Davincis and this new SOC are as follow:
1. The SOCs clock architecture includes a new spread-spectrum PLL. Some
elements of the clock architecture are reused from Davinci (e.g. LPSC), but
the PLL related code is overridden using existing interfaces in "struct clk".
2. The MMR layout on this SOC is substantially different from Davinci.
Consequently, the fixed I/O map is a whole lot more convoluted (more so than
DA8xx). The net impact here is that IO_ADDRESS() will not work on this SoC,
and therefore all mappings have to be through ioremap().
Signed-off-by: Cyril Chemparathy <cyril@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
| -rw-r--r-- | arch/arm/mach-davinci/Kconfig | 5 | ||||
| -rw-r--r-- | arch/arm/mach-davinci/Makefile | 1 | ||||
| -rw-r--r-- | arch/arm/mach-davinci/devices-tnetv107x.c | 318 | ||||
| -rw-r--r-- | arch/arm/mach-davinci/include/mach/tnetv107x.h | 55 | ||||
| -rw-r--r-- | arch/arm/mach-davinci/tnetv107x.c | 753 |
5 files changed, 1132 insertions, 0 deletions
diff --git a/arch/arm/mach-davinci/Kconfig b/arch/arm/mach-davinci/Kconfig index 0316e201ada0..a67b47b425cd 100644 --- a/arch/arm/mach-davinci/Kconfig +++ b/arch/arm/mach-davinci/Kconfig | |||
| @@ -50,6 +50,11 @@ config ARCH_DAVINCI_DM365 | |||
| 50 | select AINTC | 50 | select AINTC |
| 51 | select ARCH_DAVINCI_DMx | 51 | select ARCH_DAVINCI_DMx |
| 52 | 52 | ||
| 53 | config ARCH_DAVINCI_TNETV107X | ||
| 54 | select CPU_V6 | ||
| 55 | select CP_INTC | ||
| 56 | bool "TNETV107X based system" | ||
| 57 | |||
| 53 | comment "DaVinci Board Type" | 58 | comment "DaVinci Board Type" |
| 54 | 59 | ||
| 55 | config MACH_DAVINCI_EVM | 60 | config MACH_DAVINCI_EVM |
diff --git a/arch/arm/mach-davinci/Makefile b/arch/arm/mach-davinci/Makefile index 6aac880eb794..1c7bcfe122c7 100644 --- a/arch/arm/mach-davinci/Makefile +++ b/arch/arm/mach-davinci/Makefile | |||
| @@ -16,6 +16,7 @@ obj-$(CONFIG_ARCH_DAVINCI_DM646x) += dm646x.o devices.o | |||
| 16 | obj-$(CONFIG_ARCH_DAVINCI_DM365) += dm365.o devices.o | 16 | obj-$(CONFIG_ARCH_DAVINCI_DM365) += dm365.o devices.o |
| 17 | obj-$(CONFIG_ARCH_DAVINCI_DA830) += da830.o devices-da8xx.o | 17 | obj-$(CONFIG_ARCH_DAVINCI_DA830) += da830.o devices-da8xx.o |
| 18 | obj-$(CONFIG_ARCH_DAVINCI_DA850) += da850.o devices-da8xx.o | 18 | obj-$(CONFIG_ARCH_DAVINCI_DA850) += da850.o devices-da8xx.o |
| 19 | obj-$(CONFIG_ARCH_DAVINCI_TNETV107X) += tnetv107x.o devices-tnetv107x.o | ||
| 19 | 20 | ||
| 20 | obj-$(CONFIG_AINTC) += irq.o | 21 | obj-$(CONFIG_AINTC) += irq.o |
| 21 | obj-$(CONFIG_CP_INTC) += cp_intc.o | 22 | obj-$(CONFIG_CP_INTC) += cp_intc.o |
diff --git a/arch/arm/mach-davinci/devices-tnetv107x.c b/arch/arm/mach-davinci/devices-tnetv107x.c new file mode 100644 index 000000000000..4eef6ccdc73e --- /dev/null +++ b/arch/arm/mach-davinci/devices-tnetv107x.c | |||
| @@ -0,0 +1,318 @@ | |||
| 1 | /* | ||
| 2 | * Texas Instruments TNETV107X SoC devices | ||
| 3 | * | ||
| 4 | * Copyright (C) 2010 Texas Instruments | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or | ||
| 7 | * modify it under the terms of the GNU General Public License as | ||
| 8 | * published by the Free Software Foundation version 2. | ||
| 9 | * | ||
| 10 | * This program is distributed "as is" WITHOUT ANY WARRANTY of any | ||
| 11 | * kind, whether express or implied; without even the implied warranty | ||
| 12 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 13 | * GNU General Public License for more details. | ||
| 14 | */ | ||
| 15 | #include <linux/kernel.h> | ||
| 16 | #include <linux/init.h> | ||
| 17 | #include <linux/platform_device.h> | ||
| 18 | #include <linux/dma-mapping.h> | ||
| 19 | #include <linux/clk.h> | ||
| 20 | #include <linux/slab.h> | ||
| 21 | |||
| 22 | #include <mach/common.h> | ||
| 23 | #include <mach/irqs.h> | ||
| 24 | #include <mach/edma.h> | ||
| 25 | #include <mach/tnetv107x.h> | ||
| 26 | |||
| 27 | #include "clock.h" | ||
| 28 | |||
| 29 | /* Base addresses for on-chip devices */ | ||
| 30 | #define TNETV107X_TPCC_BASE 0x01c00000 | ||
| 31 | #define TNETV107X_TPTC0_BASE 0x01c10000 | ||
| 32 | #define TNETV107X_TPTC1_BASE 0x01c10400 | ||
| 33 | #define TNETV107X_WDOG_BASE 0x08086700 | ||
| 34 | #define TNETV107X_SDIO0_BASE 0x08088700 | ||
| 35 | #define TNETV107X_SDIO1_BASE 0x08088800 | ||
| 36 | #define TNETV107X_ASYNC_EMIF_CNTRL_BASE 0x08200000 | ||
| 37 | #define TNETV107X_ASYNC_EMIF_DATA_CE0_BASE 0x30000000 | ||
| 38 | #define TNETV107X_ASYNC_EMIF_DATA_CE1_BASE 0x40000000 | ||
| 39 | #define TNETV107X_ASYNC_EMIF_DATA_CE2_BASE 0x44000000 | ||
| 40 | #define TNETV107X_ASYNC_EMIF_DATA_CE3_BASE 0x48000000 | ||
| 41 | |||
| 42 | /* TNETV107X specific EDMA3 information */ | ||
| 43 | #define EDMA_TNETV107X_NUM_DMACH 64 | ||
| 44 | #define EDMA_TNETV107X_NUM_TCC 64 | ||
| 45 | #define EDMA_TNETV107X_NUM_PARAMENTRY 128 | ||
| 46 | #define EDMA_TNETV107X_NUM_EVQUE 2 | ||
| 47 | #define EDMA_TNETV107X_NUM_TC 2 | ||
| 48 | #define EDMA_TNETV107X_CHMAP_EXIST 0 | ||
| 49 | #define EDMA_TNETV107X_NUM_REGIONS 4 | ||
| 50 | #define TNETV107X_DMACH2EVENT_MAP0 0x3C0CE000u | ||
| 51 | #define TNETV107X_DMACH2EVENT_MAP1 0x000FFFFFu | ||
| 52 | |||
| 53 | #define TNETV107X_DMACH_SDIO0_RX 26 | ||
| 54 | #define TNETV107X_DMACH_SDIO0_TX 27 | ||
| 55 | #define TNETV107X_DMACH_SDIO1_RX 28 | ||
| 56 | #define TNETV107X_DMACH_SDIO1_TX 29 | ||
| 57 | |||
| 58 | static const s8 edma_tc_mapping[][2] = { | ||
| 59 | /* event queue no TC no */ | ||
| 60 | { 0, 0 }, | ||
| 61 | { 1, 1 }, | ||
| 62 | { -1, -1 } | ||
| 63 | }; | ||
| 64 | |||
| 65 | static const s8 edma_priority_mapping[][2] = { | ||
| 66 | /* event queue no Prio */ | ||
| 67 | { 0, 3 }, | ||
| 68 | { 1, 7 }, | ||
| 69 | { -1, -1 } | ||
| 70 | }; | ||
| 71 | |||
| 72 | static struct edma_soc_info edma_info[] = { | ||
| 73 | { | ||
| 74 | .n_channel = EDMA_TNETV107X_NUM_DMACH, | ||
| 75 | .n_region = EDMA_TNETV107X_NUM_REGIONS, | ||
| 76 | .n_slot = EDMA_TNETV107X_NUM_PARAMENTRY, | ||
| 77 | .n_tc = EDMA_TNETV107X_NUM_TC, | ||
| 78 | .n_cc = 1, | ||
| 79 | .queue_tc_mapping = edma_tc_mapping, | ||
| 80 | .queue_priority_mapping = edma_priority_mapping, | ||
| 81 | }, | ||
| 82 | }; | ||
| 83 | |||
| 84 | static struct resource edma_resources[] = { | ||
| 85 | { | ||
| 86 | .name = "edma_cc0", | ||
| 87 | .start = TNETV107X_TPCC_BASE, | ||
| 88 | .end = TNETV107X_TPCC_BASE + SZ_32K - 1, | ||
| 89 | .flags = IORESOURCE_MEM, | ||
| 90 | }, | ||
| 91 | { | ||
| 92 | .name = "edma_tc0", | ||
| 93 | .start = TNETV107X_TPTC0_BASE, | ||
| 94 | .end = TNETV107X_TPTC0_BASE + SZ_1K - 1, | ||
| 95 | .flags = IORESOURCE_MEM, | ||
| 96 | }, | ||
| 97 | { | ||
| 98 | .name = "edma_tc1", | ||
| 99 | .start = TNETV107X_TPTC1_BASE, | ||
| 100 | .end = TNETV107X_TPTC1_BASE + SZ_1K - 1, | ||
| 101 | .flags = IORESOURCE_MEM, | ||
| 102 | }, | ||
| 103 | { | ||
| 104 | .name = "edma0", | ||
| 105 | .start = IRQ_TNETV107X_TPCC, | ||
| 106 | .flags = IORESOURCE_IRQ, | ||
| 107 | }, | ||
| 108 | { | ||
| 109 | .name = "edma0_err", | ||
| 110 | .start = IRQ_TNETV107X_TPCC_ERR, | ||
| 111 | .flags = IORESOURCE_IRQ, | ||
| 112 | }, | ||
| 113 | }; | ||
| 114 | |||
| 115 | static struct platform_device edma_device = { | ||
| 116 | .name = "edma", | ||
| 117 | .id = -1, | ||
| 118 | .num_resources = ARRAY_SIZE(edma_resources), | ||
| 119 | .resource = edma_resources, | ||
| 120 | .dev.platform_data = edma_info, | ||
| 121 | }; | ||
| 122 | |||
| 123 | static struct plat_serial8250_port serial_data[] = { | ||
| 124 | { | ||
| 125 | .mapbase = TNETV107X_UART0_BASE, | ||
| 126 | .irq = IRQ_TNETV107X_UART0, | ||
| 127 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | | ||
| 128 | UPF_FIXED_TYPE | UPF_IOREMAP, | ||
| 129 | .type = PORT_AR7, | ||
| 130 | .iotype = UPIO_MEM32, | ||
| 131 | .regshift = 2, | ||
| 132 | }, | ||
| 133 | { | ||
| 134 | .mapbase = TNETV107X_UART1_BASE, | ||
| 135 | .irq = IRQ_TNETV107X_UART1, | ||
| 136 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | | ||
| 137 | UPF_FIXED_TYPE | UPF_IOREMAP, | ||
| 138 | .type = PORT_AR7, | ||
| 139 | .iotype = UPIO_MEM32, | ||
| 140 | .regshift = 2, | ||
| 141 | }, | ||
| 142 | { | ||
| 143 | .mapbase = TNETV107X_UART2_BASE, | ||
| 144 | .irq = IRQ_TNETV107X_UART2, | ||
| 145 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | | ||
| 146 | UPF_FIXED_TYPE | UPF_IOREMAP, | ||
| 147 | .type = PORT_AR7, | ||
| 148 | .iotype = UPIO_MEM32, | ||
