aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-davinci/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-08-08 13:00:55 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-08 13:00:55 -0400
commit44d51a029f95d49c5c7ccd7808f81904c20c3abd (patch)
tree41b82695b3bfb73b4146809546c2d79d6eaa4c47 /arch/arm/mach-davinci/include
parent2d53056973079e6c2ffc0d7ae3afbdd3d4f18ae3 (diff)
parentcce3dddb87e4b72b1787527eec6826a43a562e71 (diff)
Merge branch 'davinci-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-davinci
* 'davinci-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-davinci: davinci: dm646x EVM: Specify reserved EDMA channel/slots davinci: da8xx/omapl EVM: Specify reserved channels/slots davinci: support for EDMA resource sharing davinci: edma: provide ability to detect insufficient CC info data davinci: da8xx: sparse cleanup: remove duplicate entries in irq priorities davinci: DM365: fixed second serial port Davinci: tnetv107x evm board initial support Davinci: tnetv107x initial gpio support Davinci: tnetv107x soc support Davinci: tnetv107x decompresser uart definitions Davinci: generalized debug macros
Diffstat (limited to 'arch/arm/mach-davinci/include')
-rw-r--r--arch/arm/mach-davinci/include/mach/da8xx.h3
-rw-r--r--arch/arm/mach-davinci/include/mach/debug-macro.S50
-rw-r--r--arch/arm/mach-davinci/include/mach/dm646x.h1
-rw-r--r--arch/arm/mach-davinci/include/mach/edma.h11
-rw-r--r--arch/arm/mach-davinci/include/mach/gpio.h22
-rw-r--r--arch/arm/mach-davinci/include/mach/serial.h21
-rw-r--r--arch/arm/mach-davinci/include/mach/tnetv107x.h55
-rw-r--r--arch/arm/mach-davinci/include/mach/uncompress.h87
8 files changed, 210 insertions, 40 deletions
diff --git a/arch/arm/mach-davinci/include/mach/da8xx.h b/arch/arm/mach-davinci/include/mach/da8xx.h
index 1b31a9aa8fba..3c07059f526e 100644
--- a/arch/arm/mach-davinci/include/mach/da8xx.h
+++ b/arch/arm/mach-davinci/include/mach/da8xx.h
@@ -67,7 +67,8 @@ extern void __iomem *da8xx_syscfg1_base;
67void __init da830_init(void); 67void __init da830_init(void);
68void __init da850_init(void); 68void __init da850_init(void);
69 69
70int da8xx_register_edma(void); 70int da830_register_edma(struct edma_rsv_info *rsv);
71int da850_register_edma(struct edma_rsv_info *rsv[2]);
71int da8xx_register_i2c(int instance, struct davinci_i2c_platform_data *pdata); 72int da8xx_register_i2c(int instance, struct davinci_i2c_platform_data *pdata);
72int da8xx_register_watchdog(void); 73int da8xx_register_watchdog(void);
73int da8xx_register_usb20(unsigned mA, unsigned potpgt); 74int da8xx_register_usb20(unsigned mA, unsigned potpgt);
diff --git a/arch/arm/mach-davinci/include/mach/debug-macro.S b/arch/arm/mach-davinci/include/mach/debug-macro.S
index 3cd93a801d9b..f761dfdb8689 100644
--- a/arch/arm/mach-davinci/include/mach/debug-macro.S
+++ b/arch/arm/mach-davinci/include/mach/debug-macro.S
@@ -17,22 +17,50 @@
17 */ 17 */
18 18
19#include <linux/serial_reg.h> 19#include <linux/serial_reg.h>
20
21#include <asm/memory.h>
22
23#include <mach/serial.h>
24
20#define UART_SHIFT 2 25#define UART_SHIFT 2
21 26
27 .pushsection .data
28davinci_uart_phys: .word 0
29davinci_uart_virt: .word 0
30 .popsection
31
22 .macro addruart, rx, tmp 32 .macro addruart, rx, tmp
33
34 /* Use davinci_uart_phys/virt if already configured */
3510: mrc p15, 0, \rx, c1, c0
36 tst \rx, #1 @ MMU enabled?
37 ldreq \rx, =__virt_to_phys(davinci_uart_phys)
38 ldrne \rx, =davinci_uart_virt
39 ldr \rx, [\rx]
40 cmp \rx, #0 @ is port configured?
41 bne 99f @ already configured
42
23 mrc p15, 0, \rx, c1, c0 43 mrc p15, 0, \rx, c1, c0
24 tst \rx, #1 @ MMU enabled? 44 tst \rx, #1 @ MMU enabled?
25 moveq \rx, #0x01000000 @ physical base address 45
26 movne \rx, #0xfe000000 @ virtual base 46 /* Copy uart phys address from decompressor uart info */
27#if defined(CONFIG_ARCH_DAVINCI_DA8XX) && defined(CONFIG_ARCH_DAVINCI_DMx) 47 ldreq \tmp, =__virt_to_phys(davinci_uart_phys)
28#error Cannot enable DaVinci and DA8XX platforms concurrently 48 ldrne \tmp, =davinci_uart_phys
29#elif defined(CONFIG_MACH_DAVINCI_DA830_EVM) || \ 49 ldreq \rx, =DAVINCI_UART_INFO
30 defined(CONFIG_MACH_DAVINCI_DA850_EVM) 50 ldrne \rx, =__phys_to_virt(DAVINCI_UART_INFO)
31 orr \rx, \rx, #0x00d00000 @ physical base address 51 ldr \rx, [\rx, #0]
32 orr \rx, \rx, #0x0000d000 @ of UART 2 52 str \rx, [\tmp]
33#else 53
34 orr \rx, \rx, #0x00c20000 @ UART 0 54 /* Copy uart virt address from decompressor uart info */
35#endif 55 ldreq \tmp, =__virt_to_phys(davinci_uart_virt)
56 ldrne \tmp, =davinci_uart_virt
57 ldreq \rx, =DAVINCI_UART_INFO
58 ldrne \rx, =__phys_to_virt(DAVINCI_UART_INFO)
59 ldr \rx, [\rx, #4]
60 str \rx, [\tmp]
61
62 b 10b
6399:
36 .endm 64 .endm
37 65
38 .macro senduart,rd,rx 66 .macro senduart,rd,rx
diff --git a/arch/arm/mach-davinci/include/mach/dm646x.h b/arch/arm/mach-davinci/include/mach/dm646x.h
index add6f794a362..0a27ee9a70e1 100644
--- a/arch/arm/mach-davinci/include/mach/dm646x.h
+++ b/arch/arm/mach-davinci/include/mach/dm646x.h
@@ -32,6 +32,7 @@ void __init dm646x_init(void);
32void __init dm646x_init_mcasp0(struct snd_platform_data *pdata); 32void __init dm646x_init_mcasp0(struct snd_platform_data *pdata);
33void __init dm646x_init_mcasp1(struct snd_platform_data *pdata); 33void __init dm646x_init_mcasp1(struct snd_platform_data *pdata);
34void __init dm646x_board_setup_refclk(struct clk *clk); 34void __init dm646x_board_setup_refclk(struct clk *clk);
35int __init dm646x_init_edma(struct edma_rsv_info *rsv);
35 36
36void dm646x_video_init(void); 37void dm646x_video_init(void);
37 38
diff --git a/arch/arm/mach-davinci/include/mach/edma.h b/arch/arm/mach-davinci/include/mach/edma.h
index ced3092af5ba..dc10ef6cf572 100644
--- a/arch/arm/mach-davinci/include/mach/edma.h
+++ b/arch/arm/mach-davinci/include/mach/edma.h
@@ -230,6 +230,8 @@ enum sync_dimension {
230#define EDMA_CONT_PARAMS_FIXED_EXACT 1002 230#define EDMA_CONT_PARAMS_FIXED_EXACT 1002
231#define EDMA_CONT_PARAMS_FIXED_NOT_EXACT 1003 231#define EDMA_CONT_PARAMS_FIXED_NOT_EXACT 1003
232 232
233#define EDMA_MAX_CC 2
234
233/* alloc/free DMA channels and their dedicated parameter RAM slots */ 235/* alloc/free DMA channels and their dedicated parameter RAM slots */
234int edma_alloc_channel(int channel, 236int edma_alloc_channel(int channel,
235 void (*callback)(unsigned channel, u16 ch_status, void *data), 237 void (*callback)(unsigned channel, u16 ch_status, void *data),
@@ -269,6 +271,12 @@ void edma_clear_event(unsigned channel);
269void edma_pause(unsigned channel); 271void edma_pause(unsigned channel);
270void edma_resume(unsigned channel); 272void edma_resume(unsigned channel);
271 273
274struct edma_rsv_info {
275
276 const s16 (*rsv_chans)[2];
277 const s16 (*rsv_slots)[2];
278};
279
272/* platform_data for EDMA driver */ 280/* platform_data for EDMA driver */
273struct edma_soc_info { 281struct edma_soc_info {
274 282
@@ -280,6 +288,9 @@ struct edma_soc_info {
280 unsigned n_cc; 288 unsigned n_cc;
281 enum dma_event_q default_queue; 289 enum dma_event_q default_queue;
282 290
291 /* Resource reservation for other cores */
292 struct edma_rsv_info *rsv;
293
283 const s8 (*queue_tc_mapping)[2]; 294 const s8 (*queue_tc_mapping)[2];
284 const s8 (*queue_priority_mapping)[2]; 295 const s8 (*queue_priority_mapping)[2];
285}; 296};
diff --git a/arch/arm/mach-davinci/include/mach/gpio.h b/arch/arm/mach-davinci/include/mach/gpio.h
index 504cc180a60b..fbece126c2bf 100644
--- a/arch/arm/mach-davinci/include/mach/gpio.h
+++ b/arch/arm/mach-davinci/include/mach/gpio.h
@@ -25,6 +25,7 @@
25 25
26enum davinci_gpio_type { 26enum davinci_gpio_type {
27 GPIO_TYPE_DAVINCI = 0, 27 GPIO_TYPE_DAVINCI = 0,
28 GPIO_TYPE_TNETV107X,
28}; 29};
29 30
30/* 31/*
@@ -87,9 +88,13 @@ static inline u32 __gpio_mask(unsigned gpio)
87 return 1 << (gpio % 32); 88 return 1 << (gpio % 32);
88} 89}
89 90
90/* The get/set/clear functions will inline when called with constant 91/*
92 * The get/set/clear functions will inline when called with constant
91 * parameters referencing built-in GPIOs, for low-overhead bitbanging. 93 * parameters referencing built-in GPIOs, for low-overhead bitbanging.
92 * 94 *
95 * gpio_set_value() will inline only on traditional Davinci style controllers
96 * with distinct set/clear registers.
97 *
93 * Otherwise, calls with variable parameters or referencing external 98 * Otherwise, calls with variable parameters or referencing external
94 * GPIOs (e.g. on GPIO expander chips) use outlined functions. 99 * GPIOs (e.g. on GPIO expander chips) use outlined functions.
95 */ 100 */
@@ -100,12 +105,15 @@ static inline void gpio_set_value(unsigned gpio, int value)
100 u32 mask; 105 u32 mask;
101 106
102 ctlr = __gpio_to_controller(gpio); 107 ctlr = __gpio_to_controller(gpio);
103 mask = __gpio_mask(gpio); 108
104 if (value) 109 if (ctlr->set_data != ctlr->clr_data) {
105 __raw_writel(mask, ctlr->set_data); 110 mask = __gpio_mask(gpio);
106 else 111 if (value)
107 __raw_writel(mask, ctlr->clr_data); 112 __raw_writel(mask, ctlr->set_data);
108 return; 113 else
114 __raw_writel(mask, ctlr->clr_data);
115 return;
116 }
109 } 117 }
110 118
111 __gpio_set_value(gpio, value); 119 __gpio_set_value(gpio, value);
diff --git a/arch/arm/mach-davinci/include/mach/serial.h b/arch/arm/mach-davinci/include/mach/serial.h
index f6c4f34909a2..8051110b8ac3 100644
--- a/arch/arm/mach-davinci/include/mach/serial.h
+++ b/arch/arm/mach-davinci/include/mach/serial.h
@@ -11,8 +11,19 @@
11#ifndef __ASM_ARCH_SERIAL_H 11#ifndef __ASM_ARCH_SERIAL_H
12#define __ASM_ARCH_SERIAL_H 12#define __ASM_ARCH_SERIAL_H
13 13
14#include <asm/memory.h>
15
14#include <mach/hardware.h> 16#include <mach/hardware.h>
15 17
18/*
19 * Stolen area that contains debug uart physical and virtual addresses. These
20 * addresses are filled in by the uncompress.h code, and are used by the debug
21 * macros in debug-macro.S.
22 *
23 * This area sits just below the page tables (see arch/arm/kernel/head.S).
24 */
25#define DAVINCI_UART_INFO (PHYS_OFFSET + 0x3ff8)
26
16#define DAVINCI_UART0_BASE (IO_PHYS + 0x20000) 27#define DAVINCI_UART0_BASE (IO_PHYS + 0x20000)
17#define DAVINCI_UART1_BASE (IO_PHYS + 0x20400) 28#define DAVINCI_UART1_BASE (IO_PHYS + 0x20400)
18#define DAVINCI_UART2_BASE (IO_PHYS + 0x20800) 29#define DAVINCI_UART2_BASE (IO_PHYS + 0x20800)
@@ -21,16 +32,26 @@
21#define DA8XX_UART1_BASE (IO_PHYS + 0x10c000) 32#define DA8XX_UART1_BASE (IO_PHYS + 0x10c000)
22#define DA8XX_UART2_BASE (IO_PHYS + 0x10d000) 33#define DA8XX_UART2_BASE (IO_PHYS + 0x10d000)
23 34
35#define TNETV107X_UART0_BASE 0x08108100
36#define TNETV107X_UART1_BASE 0x08088400
37#define TNETV107X_UART2_BASE 0x08108300
38
39#define TNETV107X_UART0_VIRT IOMEM(0xfee08100)
40#define TNETV107X_UART1_VIRT IOMEM(0xfed88400)
41#define TNETV107X_UART2_VIRT IOMEM(0xfee08300)
42
24/* DaVinci UART register offsets */ 43/* DaVinci UART register offsets */
25#define UART_DAVINCI_PWREMU 0x0c 44#define UART_DAVINCI_PWREMU 0x0c
26#define UART_DM646X_SCR 0x10 45#define UART_DM646X_SCR 0x10
27#define UART_DM646X_SCR_TX_WATERMARK 0x08 46#define UART_DM646X_SCR_TX_WATERMARK 0x08
28 47
48#ifndef __ASSEMBLY__
29struct davinci_uart_config { 49struct davinci_uart_config {
30 /* Bit field of UARTs present; bit 0 --> UART1 */ 50 /* Bit field of UARTs present; bit 0 --> UART1 */
31 unsigned int enabled_uarts; 51 unsigned int enabled_uarts;
32}; 52};
33 53
34extern int davinci_serial_init(struct davinci_uart_config *); 54extern int davinci_serial_init(struct davinci_uart_config *);
55#endif
35 56
36#endif /* __ASM_ARCH_SERIAL_H */ 57#endif /* __ASM_ARCH_SERIAL_H */
diff --git a/arch/arm/mach-davinci/include/mach/tnetv107x.h b/arch/arm/mach-davinci/include/mach/tnetv107x.h
new file mode 100644
index 000000000000..c72064733123
--- /dev/null
+++ b/arch/arm/mach-davinci/include/mach/tnetv107x.h
@@ -0,0 +1,55 @@
1/*
2 * Texas Instruments TNETV107X SoC Specific Defines
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#ifndef __ASM_ARCH_DAVINCI_TNETV107X_H
16#define __ASM_ARCH_DAVINCI_TNETV107X_H
17
18#include <asm/sizes.h>
19
20#define TNETV107X_DDR_BASE 0x80000000
21
22/*
23 * Fixed mapping for early init starts here. If low-level debug is enabled,
24 * this area also gets mapped via io_pg_offset and io_phys by the boot code.
25 * To fit in with the io_pg_offset calculation, the io base address selected
26 * here _must_ be a multiple of 2^20.
27 */
28#define TNETV107X_IO_BASE 0x08000000
29#define TNETV107X_IO_VIRT (IO_VIRT + SZ_1M)
30
31#define TNETV107X_N_GPIO 65
32
33#ifndef __ASSEMBLY__
34
35#include <linux/serial_8250.h>
36#include <mach/mmc.h>
37#include <mach/nand.h>
38#include <mach/serial.h>
39
40struct tnetv107x_device_info {
41 struct davinci_uart_config *serial_config;
42 struct davinci_mmc_config *mmc_config[2]; /* 2 controllers */
43 struct davinci_nand_pdata *nand_config[4]; /* 4 chipsels */
44};
45
46extern struct platform_device tnetv107x_wdt_device;
47extern struct platform_device tnetv107x_serial_device;
48
49extern void __init tnetv107x_init(void);
50extern void __init tnetv107x_devices_init(struct tnetv107x_device_info *);
51extern void __init tnetv107x_irq_init(void);
52
53#endif
54
55#endif /* __ASM_ARCH_DAVINCI_TNETV107X_H */
diff --git a/arch/arm/mach-davinci/include/mach/uncompress.h b/arch/arm/mach-davinci/include/mach/uncompress.h
index 33796b4db17f..15a6192ad6eb 100644
--- a/arch/arm/mach-davinci/include/mach/uncompress.h
+++ b/arch/arm/mach-davinci/include/mach/uncompress.h
@@ -1,8 +1,17 @@
1/* 1/*
2 * Serial port stubs for kernel decompress status messages 2 * Serial port stubs for kernel decompress status messages
3 * 3 *
4 * Author: Anant Gole 4 * Initially based on:
5 * (C) Copyright (C) 2006, Texas Instruments, Inc 5 * arch/arm/plat-omap/include/mach/uncompress.h
6 *
7 * Original copyrights follow.
8 *
9 * Copyright (C) 2000 RidgeRun, Inc.
10 * Author: Greg Lonnon <glonnon@ridgerun.com>
11 *
12 * Rewritten by:
13 * Author: <source@mvista.com>
14 * 2004 (c) MontaVista Software, Inc.
6 * 15 *
7 * This file is licensed under the terms of the GNU General Public License 16 * This file is licensed under the terms of the GNU General Public License
8 * version 2. This program is licensed "as is" without any warranty of any 17 * version 2. This program is licensed "as is" without any warranty of any
@@ -11,30 +20,17 @@
11 20
12#include <linux/types.h> 21#include <linux/types.h>
13#include <linux/serial_reg.h> 22#include <linux/serial_reg.h>
14#include <mach/serial.h>
15 23
16#include <asm/mach-types.h> 24#include <asm/mach-types.h>
17 25
18extern unsigned int __machine_arch_type; 26#include <mach/serial.h>
19 27
20static u32 *uart; 28static u32 *uart;
21 29static u32 *uart_info = (u32 *)(DAVINCI_UART_INFO);
22static u32 *get_uart_base(void)
23{
24 if (__machine_arch_type == MACH_TYPE_DAVINCI_DA830_EVM ||
25 __machine_arch_type == MACH_TYPE_DAVINCI_DA850_EVM)
26 return (u32 *)DA8XX_UART2_BASE;
27 else
28 return (u32 *)DAVINCI_UART0_BASE;
29}
30 30
31/* PORT_16C550A, in polled non-fifo mode */ 31/* PORT_16C550A, in polled non-fifo mode */
32
33static void putc(char c) 32static void putc(char c)
34{ 33{
35 if (!uart)
36 uart = get_uart_base();
37
38 while (!(uart[UART_LSR] & UART_LSR_THRE)) 34 while (!(uart[UART_LSR] & UART_LSR_THRE))
39 barrier(); 35 barrier();
40 uart[UART_TX] = c; 36 uart[UART_TX] = c;
@@ -42,12 +38,61 @@ static void putc(char c)
42 38
43static inline void flush(void) 39static inline void flush(void)
44{ 40{
45 if (!uart)
46 uart = get_uart_base();
47
48 while (!(uart[UART_LSR] & UART_LSR_THRE)) 41 while (!(uart[UART_LSR] & UART_LSR_THRE))
49 barrier(); 42 barrier();
50} 43}
51 44
52#define arch_decomp_setup() 45static inline void set_uart_info(u32 phys, void * __iomem virt)
46{
47 uart = (u32 *)phys;
48 uart_info[0] = phys;
49 uart_info[1] = (u32)virt;
50}
51
52#define _DEBUG_LL_ENTRY(machine, phys, virt) \
53 if (machine_is_##machine()) { \
54 set_uart_info(phys, virt); \
55 break; \
56 }
57
58#define DEBUG_LL_DAVINCI(machine, port) \
59 _DEBUG_LL_ENTRY(machine, DAVINCI_UART##port##_BASE, \
60 IO_ADDRESS(DAVINCI_UART##port##_BASE))
61
62#define DEBUG_LL_DA8XX(machine, port) \
63 _DEBUG_LL_ENTRY(machine, DA8XX_UART##port##_BASE, \
64 IO_ADDRESS(DA8XX_UART##port##_BASE))
65
66#define DEBUG_LL_TNETV107X(machine, port) \
67 _DEBUG_LL_ENTRY(machine, TNETV107X_UART##port##_BASE, \
68 TNETV107X_UART##port##_VIRT)
69
70static inline void __arch_decomp_setup(unsigned long arch_id)
71{
72 /*
73 * Initialize the port based on the machine ID from the bootloader.
74 * Note that we're using macros here instead of switch statement
75 * as machine_is functions are optimized out for the boards that
76 * are not selected.
77 */
78 do {
79 /* Davinci boards */
80 DEBUG_LL_DAVINCI(davinci_evm, 0);
81 DEBUG_LL_DAVINCI(sffsdr, 0);
82 DEBUG_LL_DAVINCI(neuros_osd2, 0);
83 DEBUG_LL_DAVINCI(davinci_dm355_evm, 0);
84 DEBUG_LL_DAVINCI(dm355_leopard, 0);
85 DEBUG_LL_DAVINCI(davinci_dm6467_evm, 0);
86 DEBUG_LL_DAVINCI(davinci_dm365_evm, 0);
87
88 /* DA8xx boards */
89 DEBUG_LL_DA8XX(davinci_da830_evm, 2);
90 DEBUG_LL_DA8XX(davinci_da850_evm, 2);
91
92 /* TNETV107x boards */
93 DEBUG_LL_TNETV107X(tnetv107x, 1);
94 } while (0);
95}
96
97#define arch_decomp_setup() __arch_decomp_setup(arch_id)
53#define arch_decomp_wdog() 98#define arch_decomp_wdog()