aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-omap/include
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-01-22 10:38:37 -0500
committerJonathan Herman <hermanjl@cs.unc.edu>2013-01-22 10:38:37 -0500
commitfcc9d2e5a6c89d22b8b773a64fb4ad21ac318446 (patch)
treea57612d1888735a2ec7972891b68c1ac5ec8faea /arch/arm/plat-omap/include
parent8dea78da5cee153b8af9c07a2745f6c55057fe12 (diff)
Added missing tegra files.HEADmaster
Diffstat (limited to 'arch/arm/plat-omap/include')
-rw-r--r--arch/arm/plat-omap/include/plat/blizzard.h12
-rw-r--r--arch/arm/plat-omap/include/plat/board-ams-delta.h76
-rw-r--r--arch/arm/plat-omap/include/plat/board-sx1.h52
-rw-r--r--arch/arm/plat-omap/include/plat/board-voiceblue.h19
-rw-r--r--arch/arm/plat-omap/include/plat/board.h176
-rw-r--r--arch/arm/plat-omap/include/plat/clkdev_omap.h51
-rw-r--r--arch/arm/plat-omap/include/plat/clock.h316
-rw-r--r--arch/arm/plat-omap/include/plat/common.h104
-rw-r--r--arch/arm/plat-omap/include/plat/dma-44xx.h147
-rw-r--r--arch/arm/plat-omap/include/plat/dma.h538
-rw-r--r--arch/arm/plat-omap/include/plat/dsp.h31
-rw-r--r--arch/arm/plat-omap/include/plat/flash.h17
-rw-r--r--arch/arm/plat-omap/include/plat/fpga.h193
-rw-r--r--arch/arm/plat-omap/include/plat/gpio-switch.h54
-rw-r--r--arch/arm/plat-omap/include/plat/gpio.h262
-rw-r--r--arch/arm/plat-omap/include/plat/gpmc-smc91x.h42
-rw-r--r--arch/arm/plat-omap/include/plat/gpmc-smsc911x.h35
-rw-r--r--arch/arm/plat-omap/include/plat/gpmc.h160
-rw-r--r--arch/arm/plat-omap/include/plat/hardware.h291
-rw-r--r--arch/arm/plat-omap/include/plat/hwa742.h8
-rw-r--r--arch/arm/plat-omap/include/plat/io.h314
-rw-r--r--arch/arm/plat-omap/include/plat/iommu.h180
-rw-r--r--arch/arm/plat-omap/include/plat/iommu2.h96
-rw-r--r--arch/arm/plat-omap/include/plat/iopgtable.h102
-rw-r--r--arch/arm/plat-omap/include/plat/iovmm.h89
-rw-r--r--arch/arm/plat-omap/include/plat/irda.h33
-rw-r--r--arch/arm/plat-omap/include/plat/irqs-44xx.h144
-rw-r--r--arch/arm/plat-omap/include/plat/irqs.h459
-rw-r--r--arch/arm/plat-omap/include/plat/keypad.h50
-rw-r--r--arch/arm/plat-omap/include/plat/l3_2xxx.h20
-rw-r--r--arch/arm/plat-omap/include/plat/l3_3xxx.h20
-rw-r--r--arch/arm/plat-omap/include/plat/l4_2xxx.h24
-rw-r--r--arch/arm/plat-omap/include/plat/l4_3xxx.h34
-rw-r--r--arch/arm/plat-omap/include/plat/lcd_mipid.h29
-rw-r--r--arch/arm/plat-omap/include/plat/led.h24
-rw-r--r--arch/arm/plat-omap/include/plat/mcbsp.h473
-rw-r--r--arch/arm/plat-omap/include/plat/mcspi.h26
-rw-r--r--arch/arm/plat-omap/include/plat/memory.h102
-rw-r--r--arch/arm/plat-omap/include/plat/menelaus.h49
-rw-r--r--arch/arm/plat-omap/include/plat/mmc.h182
-rw-r--r--arch/arm/plat-omap/include/plat/multi.h102
-rw-r--r--arch/arm/plat-omap/include/plat/mux.h454
-rw-r--r--arch/arm/plat-omap/include/plat/nand.h44
-rw-r--r--arch/arm/plat-omap/include/plat/omap-alsa.h123
-rw-r--r--arch/arm/plat-omap/include/plat/omap-pm.h352
-rw-r--r--arch/arm/plat-omap/include/plat/omap-serial.h116
-rw-r--r--arch/arm/plat-omap/include/plat/omap1510.h50
-rw-r--r--arch/arm/plat-omap/include/plat/omap16xx.h202
-rw-r--r--arch/arm/plat-omap/include/plat/omap24xx.h89
-rw-r--r--arch/arm/plat-omap/include/plat/omap34xx.h99
-rw-r--r--arch/arm/plat-omap/include/plat/omap4-keypad.h15
-rw-r--r--arch/arm/plat-omap/include/plat/omap44xx.h61
-rw-r--r--arch/arm/plat-omap/include/plat/omap730.h102
-rw-r--r--arch/arm/plat-omap/include/plat/omap7xx.h107
-rw-r--r--arch/arm/plat-omap/include/plat/omap850.h102
-rw-r--r--arch/arm/plat-omap/include/plat/omap_device.h162
-rw-r--r--arch/arm/plat-omap/include/plat/omap_hwmod.h619
-rw-r--r--arch/arm/plat-omap/include/plat/onenand.h53
-rw-r--r--arch/arm/plat-omap/include/plat/param.h8
-rw-r--r--arch/arm/plat-omap/include/plat/prcm.h37
-rw-r--r--arch/arm/plat-omap/include/plat/sdrc.h165
-rw-r--r--arch/arm/plat-omap/include/plat/serial.h120
-rw-r--r--arch/arm/plat-omap/include/plat/system.h17
-rw-r--r--arch/arm/plat-omap/include/plat/tc.h106
-rw-r--r--arch/arm/plat-omap/include/plat/ti816x.h27
-rw-r--r--arch/arm/plat-omap/include/plat/uncompress.h184
-rw-r--r--arch/arm/plat-omap/include/plat/usb.h296
-rw-r--r--arch/arm/plat-omap/include/plat/vram.h62
-rw-r--r--arch/arm/plat-omap/include/plat/vrfb.h66
69 files changed, 8974 insertions, 0 deletions
diff --git a/arch/arm/plat-omap/include/plat/blizzard.h b/arch/arm/plat-omap/include/plat/blizzard.h
new file mode 100644
index 00000000000..56e7f2e7d12
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/blizzard.h
@@ -0,0 +1,12 @@
1#ifndef _BLIZZARD_H
2#define _BLIZZARD_H
3
4struct blizzard_platform_data {
5 void (*power_up)(struct device *dev);
6 void (*power_down)(struct device *dev);
7 unsigned long (*get_clock_rate)(struct device *dev);
8
9 unsigned te_connected:1;
10};
11
12#endif
diff --git a/arch/arm/plat-omap/include/plat/board-ams-delta.h b/arch/arm/plat-omap/include/plat/board-ams-delta.h
new file mode 100644
index 00000000000..51b102dc906
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/board-ams-delta.h
@@ -0,0 +1,76 @@
1/*
2 * arch/arm/plat-omap/include/mach/board-ams-delta.h
3 *
4 * Copyright (C) 2006 Jonathan McDowell <noodles@earth.li>
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
10 *
11 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
12 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
13 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
14 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
15 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
16 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
17 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
18 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
19 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
20 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21 *
22 * You should have received a copy of the GNU General Public License along
23 * with this program; if not, write to the Free Software Foundation, Inc.,
24 * 675 Mass Ave, Cambridge, MA 02139, USA.
25 */
26#ifndef __ASM_ARCH_OMAP_AMS_DELTA_H
27#define __ASM_ARCH_OMAP_AMS_DELTA_H
28
29#if defined (CONFIG_MACH_AMS_DELTA)
30
31#define AMS_DELTA_LATCH1_PHYS 0x01000000
32#define AMS_DELTA_LATCH1_VIRT 0xEA000000
33#define AMS_DELTA_MODEM_PHYS 0x04000000
34#define AMS_DELTA_MODEM_VIRT 0xEB000000
35#define AMS_DELTA_LATCH2_PHYS 0x08000000
36#define AMS_DELTA_LATCH2_VIRT 0xEC000000
37
38#define AMS_DELTA_LATCH1_LED_CAMERA 0x01
39#define AMS_DELTA_LATCH1_LED_ADVERT 0x02
40#define AMS_DELTA_LATCH1_LED_EMAIL 0x04
41#define AMS_DELTA_LATCH1_LED_HANDSFREE 0x08
42#define AMS_DELTA_LATCH1_LED_VOICEMAIL 0x10
43#define AMS_DELTA_LATCH1_LED_VOICE 0x20
44
45#define AMS_DELTA_LATCH2_LCD_VBLEN 0x0001
46#define AMS_DELTA_LATCH2_LCD_NDISP 0x0002
47#define AMS_DELTA_LATCH2_NAND_NCE 0x0004
48#define AMS_DELTA_LATCH2_NAND_NRE 0x0008
49#define AMS_DELTA_LATCH2_NAND_NWP 0x0010
50#define AMS_DELTA_LATCH2_NAND_NWE 0x0020
51#define AMS_DELTA_LATCH2_NAND_ALE 0x0040
52#define AMS_DELTA_LATCH2_NAND_CLE 0x0080
53#define AMD_DELTA_LATCH2_KEYBRD_PWR 0x0100
54#define AMD_DELTA_LATCH2_KEYBRD_DATA 0x0200
55#define AMD_DELTA_LATCH2_SCARD_RSTIN 0x0400
56#define AMD_DELTA_LATCH2_SCARD_CMDVCC 0x0800
57#define AMS_DELTA_LATCH2_MODEM_NRESET 0x1000
58#define AMS_DELTA_LATCH2_MODEM_CODEC 0x2000
59
60#define AMS_DELTA_GPIO_PIN_KEYBRD_DATA 0
61#define AMS_DELTA_GPIO_PIN_KEYBRD_CLK 1
62#define AMS_DELTA_GPIO_PIN_MODEM_IRQ 2
63#define AMS_DELTA_GPIO_PIN_HOOK_SWITCH 4
64#define AMS_DELTA_GPIO_PIN_SCARD_NOFF 6
65#define AMS_DELTA_GPIO_PIN_SCARD_IO 7
66#define AMS_DELTA_GPIO_PIN_CONFIG 11
67#define AMS_DELTA_GPIO_PIN_NAND_RB 12
68
69#ifndef __ASSEMBLY__
70void ams_delta_latch1_write(u8 mask, u8 value);
71void ams_delta_latch2_write(u16 mask, u16 value);
72#endif
73
74#endif /* CONFIG_MACH_AMS_DELTA */
75
76#endif /* __ASM_ARCH_OMAP_AMS_DELTA_H */
diff --git a/arch/arm/plat-omap/include/plat/board-sx1.h b/arch/arm/plat-omap/include/plat/board-sx1.h
new file mode 100644
index 00000000000..355adbdaae3
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/board-sx1.h
@@ -0,0 +1,52 @@
1/*
2 * Siemens SX1 board definitions
3 *
4 * Copyright: Vovan888 at gmail com
5 *
6 * This package is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
11 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
12 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13 */
14
15#ifndef __ASM_ARCH_SX1_I2C_CHIPS_H
16#define __ASM_ARCH_SX1_I2C_CHIPS_H
17
18#define SOFIA_MAX_LIGHT_VAL 0x2B
19
20#define SOFIA_I2C_ADDR 0x32
21/* Sofia reg 3 bits masks */
22#define SOFIA_POWER1_REG 0x03
23
24#define SOFIA_USB_POWER 0x01
25#define SOFIA_MMC_POWER 0x04
26#define SOFIA_BLUETOOTH_POWER 0x08
27#define SOFIA_MMILIGHT_POWER 0x20
28
29#define SOFIA_POWER2_REG 0x04
30#define SOFIA_BACKLIGHT_REG 0x06
31#define SOFIA_KEYLIGHT_REG 0x07
32#define SOFIA_DIMMING_REG 0x09
33
34
35/* Function Prototypes for SX1 devices control on I2C bus */
36
37int sx1_setbacklight(u8 backlight);
38int sx1_getbacklight(u8 *backlight);
39int sx1_setkeylight(u8 keylight);
40int sx1_getkeylight(u8 *keylight);
41
42int sx1_setmmipower(u8 onoff);
43int sx1_setusbpower(u8 onoff);
44int sx1_i2c_read_byte(u8 devaddr, u8 regoffset, u8 *value);
45int sx1_i2c_write_byte(u8 devaddr, u8 regoffset, u8 value);
46
47/* MMC prototypes */
48
49extern void sx1_mmc_init(void);
50extern void sx1_mmc_slot_cover_handler(void *arg, int state);
51
52#endif /* __ASM_ARCH_SX1_I2C_CHIPS_H */
diff --git a/arch/arm/plat-omap/include/plat/board-voiceblue.h b/arch/arm/plat-omap/include/plat/board-voiceblue.h
new file mode 100644
index 00000000000..27916b210f5
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/board-voiceblue.h
@@ -0,0 +1,19 @@
1/*
2 * Copyright (C) 2004 2N Telekomunikace, Ladislav Michl <michl@2n.cz>
3 *
4 * Hardware definitions for OMAP5910 based VoiceBlue board.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __ASM_ARCH_VOICEBLUE_H
12#define __ASM_ARCH_VOICEBLUE_H
13
14extern void voiceblue_wdt_enable(void);
15extern void voiceblue_wdt_disable(void);
16extern void voiceblue_wdt_ping(void);
17
18#endif /* __ASM_ARCH_VOICEBLUE_H */
19
diff --git a/arch/arm/plat-omap/include/plat/board.h b/arch/arm/plat-omap/include/plat/board.h
new file mode 100644
index 00000000000..97126dfd288
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/board.h
@@ -0,0 +1,176 @@
1/*
2 * arch/arm/plat-omap/include/mach/board.h
3 *
4 * Information structures for board-specific data
5 *
6 * Copyright (C) 2004 Nokia Corporation
7 * Written by Juha Yrjölä <juha.yrjola@nokia.com>
8 */
9
10#ifndef _OMAP_BOARD_H
11#define _OMAP_BOARD_H
12
13#include <linux/types.h>
14
15#include <plat/gpio-switch.h>
16
17/*
18 * OMAP35x EVM revision
19 * Run time detection of EVM revision is done by reading Ethernet
20 * PHY ID -
21 * GEN_1 = 0x01150000
22 * GEN_2 = 0x92200000
23 */
24enum {
25 OMAP3EVM_BOARD_GEN_1 = 0, /* EVM Rev between A - D */
26 OMAP3EVM_BOARD_GEN_2, /* EVM Rev >= Rev E */
27};
28
29/* Different peripheral ids */
30#define OMAP_TAG_CLOCK 0x4f01
31#define OMAP_TAG_LCD 0x4f05
32#define OMAP_TAG_GPIO_SWITCH 0x4f06
33#define OMAP_TAG_FBMEM 0x4f08
34#define OMAP_TAG_STI_CONSOLE 0x4f09
35#define OMAP_TAG_CAMERA_SENSOR 0x4f0a
36
37#define OMAP_TAG_BOOT_REASON 0x4f80
38#define OMAP_TAG_FLASH_PART 0x4f81
39#define OMAP_TAG_VERSION_STR 0x4f82
40
41struct omap_clock_config {
42 /* 0 for 12 MHz, 1 for 13 MHz and 2 for 19.2 MHz */
43 u8 system_clock_type;
44};
45
46struct omap_serial_console_config {
47 u8 console_uart;
48 u32 console_speed;
49};
50
51struct omap_sti_console_config {
52 unsigned enable:1;
53 u8 channel;
54};
55
56struct omap_camera_sensor_config {
57 u16 reset_gpio;
58 int (*power_on)(void * data);
59 int (*power_off)(void * data);
60};
61
62struct omap_usb_config {
63 /* Configure drivers according to the connectors on your board:
64 * - "A" connector (rectagular)
65 * ... for host/OHCI use, set "register_host".
66 * - "B" connector (squarish) or "Mini-B"
67 * ... for device/gadget use, set "register_dev".
68 * - "Mini-AB" connector (very similar to Mini-B)
69 * ... for OTG use as device OR host, initialize "otg"
70 */
71 unsigned register_host:1;
72 unsigned register_dev:1;
73 u8 otg; /* port number, 1-based: usb1 == 2 */
74
75 u8 hmc_mode;
76
77 /* implicitly true if otg: host supports remote wakeup? */
78 u8 rwc;
79
80 /* signaling pins used to talk to transceiver on usbN:
81 * 0 == usbN unused
82 * 2 == usb0-only, using internal transceiver
83 * 3 == 3 wire bidirectional
84 * 4 == 4 wire bidirectional
85 * 6 == 6 wire unidirectional (or TLL)
86 */
87 u8 pins[3];
88
89 struct platform_device *udc_device;
90 struct platform_device *ohci_device;
91 struct platform_device *otg_device;
92
93 u32 (*usb0_init)(unsigned nwires, unsigned is_device);
94 u32 (*usb1_init)(unsigned nwires);
95 u32 (*usb2_init)(unsigned nwires, unsigned alt_pingroup);
96};
97
98struct omap_lcd_config {
99 char panel_name[16];
100 char ctrl_name[16];
101 s16 nreset_gpio;
102 u8 data_lines;
103};
104
105struct device;
106struct fb_info;
107struct omap_backlight_config {
108 int default_intensity;
109 int (*set_power)(struct device *dev, int state);
110};
111
112struct omap_fbmem_config {
113 u32 start;
114 u32 size;
115};
116
117struct omap_pwm_led_platform_data {
118 const char *name;
119 int intensity_timer;
120 int blink_timer;
121 void (*set_power)(struct omap_pwm_led_platform_data *self, int on_off);
122};
123
124struct omap_uart_config {
125 /* Bit field of UARTs present; bit 0 --> UART1 */
126 unsigned int enabled_uarts;
127};
128
129
130struct omap_flash_part_config {
131 char part_table[0];
132};
133
134struct omap_boot_reason_config {
135 char reason_str[12];
136};
137
138struct omap_version_config {
139 char component[12];
140 char version[12];
141};
142
143struct omap_board_config_entry {
144 u16 tag;
145 u16 len;
146 u8 data[0];
147};
148
149struct omap_board_config_kernel {
150 u16 tag;
151 const void *data;
152};
153
154extern const void *__init __omap_get_config(u16 tag, size_t len, int nr);
155
156#define omap_get_config(tag, type) \
157 ((const type *) __omap_get_config((tag), sizeof(type), 0))
158#define omap_get_nr_config(tag, type, nr) \
159 ((const type *) __omap_get_config((tag), sizeof(type), (nr)))
160
161extern const void *__init omap_get_var_config(u16 tag, size_t *len);
162
163extern struct omap_board_config_kernel *omap_board_config;
164extern int omap_board_config_size;
165
166
167/* for TI reference platforms sharing the same debug card */
168extern int debug_card_init(u32 addr, unsigned gpio);
169
170/* OMAP3EVM revision */
171#if defined(CONFIG_MACH_OMAP3EVM)
172u8 get_omap3_evm_rev(void);
173#else
174#define get_omap3_evm_rev() (-EINVAL)
175#endif
176#endif
diff --git a/arch/arm/plat-omap/include/plat/clkdev_omap.h b/arch/arm/plat-omap/include/plat/clkdev_omap.h
new file mode 100644
index 00000000000..387a9638991
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/clkdev_omap.h
@@ -0,0 +1,51 @@
1/*
2 * clkdev <-> OMAP integration
3 *
4 * Russell King <linux@arm.linux.org.uk>
5 *
6 */
7
8#ifndef __ARCH_ARM_PLAT_OMAP_INCLUDE_PLAT_CLKDEV_OMAP_H
9#define __ARCH_ARM_PLAT_OMAP_INCLUDE_PLAT_CLKDEV_OMAP_H
10
11#include <linux/clkdev.h>
12
13struct omap_clk {
14 u16 cpu;
15 struct clk_lookup lk;
16};
17
18#define CLK(dev, con, ck, cp) \
19 { \
20 .cpu = cp, \
21 .lk = { \
22 .dev_id = dev, \
23 .con_id = con, \
24 .clk = ck, \
25 }, \
26 }
27
28/* Platform flags for the clkdev-OMAP integration code */
29#define CK_310 (1 << 0)
30#define CK_7XX (1 << 1) /* 7xx, 850 */
31#define CK_1510 (1 << 2)
32#define CK_16XX (1 << 3) /* 16xx, 17xx, 5912 */
33#define CK_242X (1 << 4)
34#define CK_243X (1 << 5) /* 243x, 253x */
35#define CK_3430ES1 (1 << 6) /* 34xxES1 only */
36#define CK_3430ES2PLUS (1 << 7) /* 34xxES2, ES3, non-Sitara 35xx only */
37#define CK_3505 (1 << 8)
38#define CK_3517 (1 << 9)
39#define CK_36XX (1 << 10) /* 36xx/37xx-specific clocks */
40#define CK_443X (1 << 11)
41#define CK_TI816X (1 << 12)
42#define CK_446X (1 << 13)
43
44
45#define CK_34XX (CK_3430ES1 | CK_3430ES2PLUS)
46#define CK_AM35XX (CK_3505 | CK_3517) /* all Sitara AM35xx */
47#define CK_3XXX (CK_34XX | CK_AM35XX | CK_36XX)
48
49
50#endif
51
diff --git a/arch/arm/plat-omap/include/plat/clock.h b/arch/arm/plat-omap/include/plat/clock.h
new file mode 100644
index 00000000000..df4b9683f17
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/clock.h
@@ -0,0 +1,316 @@
1/*
2 * OMAP clock: data structure definitions, function prototypes, shared macros
3 *
4 * Copyright (C) 2004-2005, 2008-2010 Nokia Corporation
5 * Written by Tuukka Tikkanen <tuukka.tikkanen@elektrobit.com>
6 * Based on clocks.h by Tony Lindgren, Gordon McNutt and RidgeRun, Inc
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#ifndef __ARCH_ARM_OMAP_CLOCK_H
14#define __ARCH_ARM_OMAP_CLOCK_H
15
16#include <linux/list.h>
17
18struct module;
19struct clk;
20struct clockdomain;
21
22/**
23 * struct clkops - some clock function pointers
24 * @enable: fn ptr that enables the current clock in hardware
25 * @disable: fn ptr that enables the current clock in hardware
26 * @find_idlest: function returning the IDLEST register for the clock's IP blk
27 * @find_companion: function returning the "companion" clk reg for the clock
28 * @allow_idle: fn ptr that enables autoidle for the current clock in hardware
29 * @deny_idle: fn ptr that disables autoidle for the current clock in hardware
30 *
31 * A "companion" clk is an accompanying clock to the one being queried
32 * that must be enabled for the IP module connected to the clock to
33 * become accessible by the hardware. Neither @find_idlest nor
34 * @find_companion should be needed; that information is IP
35 * block-specific; the hwmod code has been created to handle this, but
36 * until hwmod data is ready and drivers have been converted to use PM
37 * runtime calls in place of clk_enable()/clk_disable(), @find_idlest and
38 * @find_companion must, unfortunately, remain.
39 */
40struct clkops {
41 int (*enable)(struct clk *);
42 void (*disable)(struct clk *);
43 void (*find_idlest)(struct clk *, void __iomem **,
44 u8 *, u8 *);
45 void (*find_companion)(struct clk *, void __iomem **,
46 u8 *);
47 void (*allow_idle)(struct clk *);
48 void (*deny_idle)(struct clk *);
49};
50
51#ifdef CONFIG_ARCH_OMAP2PLUS
52
53/* struct clksel_rate.flags possibilities */
54#define RATE_IN_242X (1 << 0)
55#define RATE_IN_243X (1 << 1)
56#define RATE_IN_3430ES1 (1 << 2) /* 3430ES1 rates only */
57#define RATE_IN_3430ES2PLUS (1 << 3) /* 3430 ES >= 2 rates only */
58#define RATE_IN_36XX (1 << 4)
59#define RATE_IN_4430 (1 << 5)
60#define RATE_IN_TI816X (1 << 6)
61#define RATE_IN_4460 (1 << 7)
62
63#define RATE_IN_24XX (RATE_IN_242X | RATE_IN_243X)
64#define RATE_IN_34XX (RATE_IN_3430ES1 | RATE_IN_3430ES2PLUS)
65#define RATE_IN_3XXX (RATE_IN_34XX | RATE_IN_36XX)
66#define RATE_IN_44XX (RATE_IN_4430 | RATE_IN_4460)
67
68/* RATE_IN_3430ES2PLUS_36XX includes 34xx/35xx with ES >=2, and all 36xx/37xx */
69#define RATE_IN_3430ES2PLUS_36XX (RATE_IN_3430ES2PLUS | RATE_IN_36XX)
70
71
72/**
73 * struct clksel_rate - register bitfield values corresponding to clk divisors
74 * @val: register bitfield value (shifted to bit 0)
75 * @div: clock divisor corresponding to @val
76 * @flags: (see "struct clksel_rate.flags possibilities" above)
77 *
78 * @val should match the value of a read from struct clk.clksel_reg
79 * AND'ed with struct clk.clksel_mask, shifted right to bit 0.
80 *
81 * @div is the divisor that should be applied to the parent clock's rate
82 * to produce the current clock's rate.
83 *
84 * XXX @flags probably should be replaced with an struct omap_chip.
85 */
86struct clksel_rate {
87 u32 val;
88 u8 div;
89 u8 flags;
90};
91
92/**
93 * struct clksel - available parent clocks, and a pointer to their divisors
94 * @parent: struct clk * to a possible parent clock
95 * @rates: available divisors for this parent clock
96 *
97 * A struct clksel is always associated with one or more struct clks
98 * and one or more struct clksel_rates.
99 */
100struct clksel {
101 struct clk *parent;
102 const struct clksel_rate *rates;
103};
104
105/**
106 * struct dpll_data - DPLL registers and integration data
107 * @mult_div1_reg: register containing the DPLL M and N bitfields
108 * @mult_mask: mask of the DPLL M bitfield in @mult_div1_reg
109 * @div1_mask: mask of the DPLL N bitfield in @mult_div1_reg
110 * @clk_bypass: struct clk pointer to the clock's bypass clock input
111 * @clk_ref: struct clk pointer to the clock's reference clock input
112 * @control_reg: register containing the DPLL mode bitfield
113 * @enable_mask: mask of the DPLL mode bitfield in @control_reg
114 * @last_rounded_rate: cache of the last rate result of omap2_dpll_round_rate()
115 * @last_rounded_m: cache of the last M result of omap2_dpll_round_rate()
116 * @max_multiplier: maximum valid non-bypass multiplier value (actual)
117 * @last_rounded_n: cache of the last N result of omap2_dpll_round_rate()
118 * @min_divider: minimum valid non-bypass divider value (actual)
119 * @max_divider: maximum valid non-bypass divider value (actual)
120 * @modes: possible values of @enable_mask
121 * @autoidle_reg: register containing the DPLL autoidle mode bitfield
122 * @idlest_reg: register containing the DPLL idle status bitfield
123 * @autoidle_mask: mask of the DPLL autoidle mode bitfield in @autoidle_reg
124 * @freqsel_mask: mask of the DPLL jitter correction bitfield in @control_reg
125 * @idlest_mask: mask of the DPLL idle status bitfield in @idlest_reg
126 * @auto_recal_bit: bitshift of the driftguard enable bit in @control_reg
127 * @recal_en_bit: bitshift of the PRM_IRQENABLE_* bit for recalibration IRQs
128 * @recal_st_bit: bitshift of the PRM_IRQSTATUS_* bit for recalibration IRQs
129 * @flags: DPLL type/features (see below)
130 *
131 * Possible values for @flags:
132 * DPLL_J_TYPE: "J-type DPLL" (only some 36xx, 4xxx DPLLs)
133 *
134 * @freqsel_mask is only used on the OMAP34xx family and AM35xx.
135 *
136 * XXX Some DPLLs have multiple bypass inputs, so it's not technically
137 * correct to only have one @clk_bypass pointer.
138 *
139 * XXX The runtime-variable fields (@last_rounded_rate, @last_rounded_m,
140 * @last_rounded_n) should be separated from the runtime-fixed fields
141 * and placed into a different structure, so that the runtime-fixed data
142 * can be placed into read-only space.
143 */
144struct dpll_data {
145 void __iomem *mult_div1_reg;
146 u32 mult_mask;
147 u32 div1_mask;
148 struct clk *clk_bypass;
149 struct clk *clk_ref;
150 void __iomem *control_reg;
151 u32 enable_mask;
152 unsigned long last_rounded_rate;
153 u16 last_rounded_m;
154 u16 max_multiplier;
155 u8 last_rounded_n;
156 u8 min_divider;
157 u16 max_divider;
158 u8 modes;
159#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
160 void __iomem *autoidle_reg;
161 void __iomem *idlest_reg;
162 u32 autoidle_mask;
163 u32 freqsel_mask;
164 u32 idlest_mask;
165 u32 dco_mask;
166 u32 sddiv_mask;
167 u8 auto_recal_bit;
168 u8 recal_en_bit;
169 u8 recal_st_bit;
170 u8 flags;
171# endif
172};
173
174#endif
175
176/*
177 * struct clk.flags possibilities
178 *
179 * XXX document the rest of the clock flags here
180 *
181 * CLOCK_CLKOUTX2: (OMAP4 only) DPLL CLKOUT and CLKOUTX2 GATE_CTRL
182 * bits share the same register. This flag allows the
183 * omap4_dpllmx*() code to determine which GATE_CTRL bit field
184 * should be used. This is a temporary solution - a better approach
185 * would be to associate clock type-specific data with the clock,
186 * similar to the struct dpll_data approach.
187 */
188#define ENABLE_REG_32BIT (1 << 0) /* Use 32-bit access */
189#define CLOCK_IDLE_CONTROL (1 << 1)
190#define CLOCK_NO_IDLE_PARENT (1 << 2)
191#define ENABLE_ON_INIT (1 << 3) /* Enable upon framework init */
192#define INVERT_ENABLE (1 << 4) /* 0 enables, 1 disables */
193#define CLOCK_CLKOUTX2 (1 << 5)
194
195/**
196 * struct clk - OMAP struct clk
197 * @node: list_head connecting this clock into the full clock list
198 * @ops: struct clkops * for this clock
199 * @name: the name of the clock in the hardware (used in hwmod data and debug)
200 * @parent: pointer to this clock's parent struct clk
201 * @children: list_head connecting to the child clks' @sibling list_heads
202 * @sibling: list_head connecting this clk to its parent clk's @children
203 * @rate: current clock rate
204 * @enable_reg: register to write to enable the clock (see @enable_bit)
205 * @recalc: fn ptr that returns the clock's current rate
206 * @set_rate: fn ptr that can change the clock's current rate
207 * @round_rate: fn ptr that can round the clock's current rate
208 * @init: fn ptr to do clock-specific initialization
209 * @enable_bit: bitshift to write to enable/disable the clock (see @enable_reg)
210 * @usecount: number of users that have requested this clock to be enabled
211 * @fixed_div: when > 0, this clock's rate is its parent's rate / @fixed_div
212 * @flags: see "struct clk.flags possibilities" above
213 * @clksel_reg: for clksel clks, register va containing src/divisor select
214 * @clksel_mask: bitmask in @clksel_reg for the src/divisor selector
215 * @clksel: for clksel clks, pointer to struct clksel for this clock
216 * @dpll_data: for DPLLs, pointer to struct dpll_data for this clock
217 * @clkdm_name: clockdomain name that this clock is contained in
218 * @clkdm: pointer to struct clockdomain, resolved from @clkdm_name at runtime
219 * @rate_offset: bitshift for rate selection bitfield (OMAP1 only)
220 * @src_offset: bitshift for source selection bitfield (OMAP1 only)
221 *
222 * XXX @rate_offset, @src_offset should probably be removed and OMAP1
223 * clock code converted to use clksel.
224 *
225 * XXX @usecount is poorly named. It should be "enable_count" or
226 * something similar. "users" in the description refers to kernel
227 * code (core code or drivers) that have called clk_enable() and not
228 * yet called clk_disable(); the usecount of parent clocks is also
229 * incremented by the clock code when clk_enable() is called on child
230 * clocks and decremented by the clock code when clk_disable() is
231 * called on child clocks.
232 *
233 * XXX @clkdm, @usecount, @children, @sibling should be marked for
234 * internal use only.
235 *
236 * @children and @sibling are used to optimize parent-to-child clock
237 * tree traversals. (child-to-parent traversals use @parent.)
238 *
239 * XXX The notion of the clock's current rate probably needs to be
240 * separated from the clock's target rate.
241 */
242struct clk {
243 struct list_head node;
244 const struct clkops *ops;
245 const char *name;
246 struct clk *parent;
247 struct list_head children;
248 struct list_head sibling; /* node for children */
249 unsigned long rate;
250 void __iomem *enable_reg;
251 unsigned long (*recalc)(struct clk *);
252 int (*set_rate)(struct clk *, unsigned long);
253 long (*round_rate)(struct clk *, unsigned long);
254 void (*init)(struct clk *);
255 u8 enable_bit;
256 s8 usecount;
257 u8 fixed_div;
258 u8 flags;
259#ifdef CONFIG_ARCH_OMAP2PLUS
260 void __iomem *clksel_reg;
261 u32 clksel_mask;
262 const struct clksel *clksel;
263 struct dpll_data *dpll_data;
264 const char *clkdm_name;
265 struct clockdomain *clkdm;
266#else
267 u8 rate_offset;
268 u8 src_offset;
269#endif
270#if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS)
271 struct dentry *dent; /* For visible tree hierarchy */
272#endif
273};
274
275struct cpufreq_frequency_table;
276
277struct clk_functions {
278 int (*clk_enable)(struct clk *clk);
279 void (*clk_disable)(struct clk *clk);
280 long (*clk_round_rate)(struct clk *clk, unsigned long rate);
281 int (*clk_set_rate)(struct clk *clk, unsigned long rate);
282 int (*clk_set_parent)(struct clk *clk, struct clk *parent);
283 void (*clk_allow_idle)(struct clk *clk);
284 void (*clk_deny_idle)(struct clk *clk);
285 void (*clk_disable_unused)(struct clk *clk);
286#ifdef CONFIG_CPU_FREQ
287 void (*clk_init_cpufreq_table)(struct cpufreq_frequency_table **);
288 void (*clk_exit_cpufreq_table)(struct cpufreq_frequency_table **);
289#endif
290};
291
292extern int mpurate;
293
294extern int clk_init(struct clk_functions *custom_clocks);
295extern void clk_preinit(struct clk *clk);
296extern int clk_register(struct clk *clk);
297extern void clk_reparent(struct clk *child, struct clk *parent);
298extern void clk_unregister(struct clk *clk);
299extern void propagate_rate(struct clk *clk);
300extern void recalculate_root_clocks(void);
301extern unsigned long followparent_recalc(struct clk *clk);
302extern void clk_enable_init_clocks(void);
303unsigned long omap_fixed_divisor_recalc(struct clk *clk);
304#ifdef CONFIG_CPU_FREQ
305extern void clk_init_cpufreq_table(struct cpufreq_frequency_table **table);
306extern void clk_exit_cpufreq_table(struct cpufreq_frequency_table **table);
307#endif
308extern struct clk *omap_clk_get_by_name(const char *name);
309extern int omap_clk_enable_autoidle_all(void);
310extern int omap_clk_disable_autoidle_all(void);
311
312extern const struct clkops clkops_null;
313
314extern struct clk dummy_ck;
315
316#endif
diff --git a/arch/arm/plat-omap/include/plat/common.h b/arch/arm/plat-omap/include/plat/common.h
new file mode 100644
index 00000000000..4564cc697d7
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/common.h
@@ -0,0 +1,104 @@
1/*
2 * arch/arm/plat-omap/include/mach/common.h
3 *
4 * Header for code common to all OMAP machines.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
10 *
11 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
12 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
13 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
14 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
15 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
16 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
17 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
18 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
19 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
20 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21 *
22 * You should have received a copy of the GNU General Public License along
23 * with this program; if not, write to the Free Software Foundation, Inc.,
24 * 675 Mass Ave, Cambridge, MA 02139, USA.
25 */
26
27#ifndef __ARCH_ARM_MACH_OMAP_COMMON_H
28#define __ARCH_ARM_MACH_OMAP_COMMON_H
29
30#include <linux/delay.h>
31
32#include <plat/i2c.h>
33
34struct sys_timer;
35
36extern void omap_map_common_io(void);
37extern struct sys_timer omap1_timer;
38extern struct sys_timer omap2_timer;
39extern struct sys_timer omap3_timer;
40extern struct sys_timer omap3_secure_timer;
41extern struct sys_timer omap4_timer;
42extern bool omap_32k_timer_init(void);
43extern int __init omap_init_clocksource_32k(void);
44extern unsigned long long notrace omap_32k_sched_clock(void);
45
46extern void omap_reserve(void);
47
48/*
49 * IO bases for various OMAP processors
50 * Except the tap base, rest all the io bases
51 * listed are physical addresses.
52 */
53struct omap_globals {
54 u32 class; /* OMAP class to detect */
55 void __iomem *tap; /* Control module ID code */
56 unsigned long sdrc; /* SDRAM Controller */
57 unsigned long sms; /* SDRAM Memory Scheduler */
58 unsigned long ctrl; /* System Control Module */
59 unsigned long ctrl_pad; /* PAD Control Module */
60 unsigned long prm; /* Power and Reset Management */
61 unsigned long cm; /* Clock Management */
62 unsigned long cm2;
63};
64
65void omap2_set_globals_242x(void);
66void omap2_set_globals_243x(void);
67void omap2_set_globals_3xxx(void);
68void omap2_set_globals_443x(void);
69void omap2_set_globals_ti816x(void);
70
71/* These get called from omap2_set_globals_xxxx(), do not call these */
72void omap2_set_globals_tap(struct omap_globals *);
73void omap2_set_globals_sdrc(struct omap_globals *);
74void omap2_set_globals_control(struct omap_globals *);
75void omap2_set_globals_prcm(struct omap_globals *);
76
77void omap3_map_io(void);
78
79/**
80 * omap_test_timeout - busy-loop, testing a condition
81 * @cond: condition to test until it evaluates to true
82 * @timeout: maximum number of microseconds in the timeout
83 * @index: loop index (integer)
84 *
85 * Loop waiting for @cond to become true or until at least @timeout
86 * microseconds have passed. To use, define some integer @index in the
87 * calling code. After running, if @index == @timeout, then the loop has
88 * timed out.
89 */
90#define omap_test_timeout(cond, timeout, index) \
91({ \
92 for (index = 0; index < timeout; index++) { \
93 if (cond) \
94 break; \
95 udelay(1); \
96 } \
97})
98
99extern struct device *omap2_get_mpuss_device(void);
100extern struct device *omap2_get_iva_device(void);
101extern struct device *omap2_get_l3_device(void);
102extern struct device *omap4_get_dsp_device(void);
103
104#endif /* __ARCH_ARM_MACH_OMAP_COMMON_H */
diff --git a/arch/arm/plat-omap/include/plat/dma-44xx.h b/arch/arm/plat-omap/include/plat/dma-44xx.h
new file mode 100644
index 00000000000..1f767cb2f38
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/dma-44xx.h
@@ -0,0 +1,147 @@
1/*
2 * OMAP4 SDMA channel definitions
3 *
4 * Copyright (C) 2009-2010 Texas Instruments, Inc.
5 * Copyright (C) 2009-2010 Nokia Corporation
6 *
7 * Santosh Shilimkar (santosh.shilimkar@ti.com)
8 * Benoit Cousson (b-cousson@ti.com)
9 * Paul Walmsley (paul@pwsan.com)
10 *
11 * This file is automatically generated from the OMAP hardware databases.
12 * We respectfully ask that any modifications to this file be coordinated
13 * with the public linux-omap@vger.kernel.org mailing list and the
14 * authors above to ensure that the autogeneration scripts are kept
15 * up-to-date with the file contents.
16 *
17 * This program is free software; you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License version 2 as
19 * published by the Free Software Foundation.
20 */
21
22#ifndef __ARCH_ARM_MACH_OMAP2_OMAP44XX_DMA_H
23#define __ARCH_ARM_MACH_OMAP2_OMAP44XX_DMA_H
24
25#define OMAP44XX_DMA_SYS_REQ0 2
26#define OMAP44XX_DMA_SYS_REQ1 3
27#define OMAP44XX_DMA_GPMC 4
28#define OMAP44XX_DMA_DSS_DISPC_REQ 6
29#define OMAP44XX_DMA_SYS_REQ2 7
30#define OMAP44XX_DMA_MCASP1_AXEVT 8
31#define OMAP44XX_DMA_ISS_REQ1 9
32#define OMAP44XX_DMA_ISS_REQ2 10
33#define OMAP44XX_DMA_MCASP1_AREVT 11
34#define OMAP44XX_DMA_ISS_REQ3 12
35#define OMAP44XX_DMA_ISS_REQ4 13
36#define OMAP44XX_DMA_DSS_RFBI_REQ 14
37#define OMAP44XX_DMA_SPI3_TX0 15
38#define OMAP44XX_DMA_SPI3_RX0 16
39#define OMAP44XX_DMA_MCBSP2_TX 17
40#define OMAP44XX_DMA_MCBSP2_RX 18
41#define OMAP44XX_DMA_MCBSP3_TX 19
42#define OMAP44XX_DMA_MCBSP3_RX 20
43#define OMAP44XX_DMA_C2C_SSCM_GPO0 21
44#define OMAP44XX_DMA_C2C_SSCM_GPO1 22
45#define OMAP44XX_DMA_SPI3_TX1 23
46#define OMAP44XX_DMA_SPI3_RX1 24
47#define OMAP44XX_DMA_I2C3_TX 25
48#define OMAP44XX_DMA_I2C3_RX 26
49#define OMAP44XX_DMA_I2C1_TX 27
50#define OMAP44XX_DMA_I2C1_RX 28
51#define OMAP44XX_DMA_I2C2_TX 29
52#define OMAP44XX_DMA_I2C2_RX 30
53#define OMAP44XX_DMA_MCBSP4_TX 31
54#define OMAP44XX_DMA_MCBSP4_RX 32
55#define OMAP44XX_DMA_MCBSP1_TX 33
56#define OMAP44XX_DMA_MCBSP1_RX 34
57#define OMAP44XX_DMA_SPI1_TX0 35
58#define OMAP44XX_DMA_SPI1_RX0 36
59#define OMAP44XX_DMA_SPI1_TX1 37
60#define OMAP44XX_DMA_SPI1_RX1 38
61#define OMAP44XX_DMA_SPI1_TX2 39
62#define OMAP44XX_DMA_SPI1_RX2 40
63#define OMAP44XX_DMA_SPI1_TX3 41
64#define OMAP44XX_DMA_SPI1_RX3 42
65#define OMAP44XX_DMA_SPI2_TX0 43
66#define OMAP44XX_DMA_SPI2_RX0 44
67#define OMAP44XX_DMA_SPI2_TX1 45
68#define OMAP44XX_DMA_SPI2_RX1 46
69#define OMAP44XX_DMA_MMC2_TX 47
70#define OMAP44XX_DMA_MMC2_RX 48
71#define OMAP44XX_DMA_UART1_TX 49
72#define OMAP44XX_DMA_UART1_RX 50
73#define OMAP44XX_DMA_UART2_TX 51
74#define OMAP44XX_DMA_UART2_RX 52
75#define OMAP44XX_DMA_UART3_TX 53
76#define OMAP44XX_DMA_UART3_RX 54
77#define OMAP44XX_DMA_UART4_TX 55
78#define OMAP44XX_DMA_UART4_RX 56
79#define OMAP44XX_DMA_MMC4_TX 57
80#define OMAP44XX_DMA_MMC4_RX 58
81#define OMAP44XX_DMA_MMC5_TX 59
82#define OMAP44XX_DMA_MMC5_RX 60
83#define OMAP44XX_DMA_MMC1_TX 61
84#define OMAP44XX_DMA_MMC1_RX 62
85#define OMAP44XX_DMA_SYS_REQ3 64
86#define OMAP44XX_DMA_MCPDM_UP 65
87#define OMAP44XX_DMA_MCPDM_DL 66
88#define OMAP44XX_DMA_DMIC_REQ 67
89#define OMAP44XX_DMA_C2C_SSCM_GPO2 68
90#define OMAP44XX_DMA_C2C_SSCM_GPO3 69
91#define OMAP44XX_DMA_SPI4_TX0 70
92#define OMAP44XX_DMA_SPI4_RX0 71
93#define OMAP44XX_DMA_DSS_DSI1_REQ0 72
94#define OMAP44XX_DMA_DSS_DSI1_REQ1 73
95#define OMAP44XX_DMA_DSS_DSI1_REQ2 74
96#define OMAP44XX_DMA_DSS_DSI1_REQ3 75
97#define OMAP44XX_DMA_DSS_HDMI_REQ 76
98#define OMAP44XX_DMA_MMC3_TX 77
99#define OMAP44XX_DMA_MMC3_RX 78
100#define OMAP44XX_DMA_USIM_TX 79
101#define OMAP44XX_DMA_USIM_RX 80
102#define OMAP44XX_DMA_DSS_DSI2_REQ0 81
103#define OMAP44XX_DMA_DSS_DSI2_REQ1 82
104#define OMAP44XX_DMA_DSS_DSI2_REQ2 83
105#define OMAP44XX_DMA_DSS_DSI2_REQ3 84
106#define OMAP44XX_DMA_SLIMBUS1_TX0 85
107#define OMAP44XX_DMA_SLIMBUS1_TX1 86
108#define OMAP44XX_DMA_SLIMBUS1_TX2 87
109#define OMAP44XX_DMA_SLIMBUS1_TX3 88
110#define OMAP44XX_DMA_SLIMBUS1_RX0 89
111#define OMAP44XX_DMA_SLIMBUS1_RX1 90
112#define OMAP44XX_DMA_SLIMBUS1_RX2 91
113#define OMAP44XX_DMA_SLIMBUS1_RX3 92
114#define OMAP44XX_DMA_SLIMBUS2_TX0 93
115#define OMAP44XX_DMA_SLIMBUS2_TX1 94
116#define OMAP44XX_DMA_SLIMBUS2_TX2 95
117#define OMAP44XX_DMA_SLIMBUS2_TX3 96
118#define OMAP44XX_DMA_SLIMBUS2_RX0 97
119#define OMAP44XX_DMA_SLIMBUS2_RX1 98
120#define OMAP44XX_DMA_SLIMBUS2_RX2 99
121#define OMAP44XX_DMA_SLIMBUS2_RX3 100
122#define OMAP44XX_DMA_ABE_REQ_0 101
123#define OMAP44XX_DMA_ABE_REQ_1 102
124#define OMAP44XX_DMA_ABE_REQ_2 103
125#define OMAP44XX_DMA_ABE_REQ_3 104
126#define OMAP44XX_DMA_ABE_REQ_4 105
127#define OMAP44XX_DMA_ABE_REQ_5 106
128#define OMAP44XX_DMA_ABE_REQ_6 107
129#define OMAP44XX_DMA_ABE_REQ_7 108
130#define OMAP44XX_DMA_AES1_P_CTX_IN_REQ 109
131#define OMAP44XX_DMA_AES1_P_DATA_IN_REQ 110
132#define OMAP44XX_DMA_AES1_P_DATA_OUT_REQ 111
133#define OMAP44XX_DMA_AES2_P_CTX_IN_REQ 112
134#define OMAP44XX_DMA_AES2_P_DATA_IN_REQ 113
135#define OMAP44XX_DMA_AES2_P_DATA_OUT_REQ 114
136#define OMAP44XX_DMA_DES_P_CTX_IN_REQ 115
137#define OMAP44XX_DMA_DES_P_DATA_IN_REQ 116
138#define OMAP44XX_DMA_DES_P_DATA_OUT_REQ 117
139#define OMAP44XX_DMA_SHA2_CTXIN_P 118
140#define OMAP44XX_DMA_SHA2_DIN_P 119
141#define OMAP44XX_DMA_SHA2_CTXOUT_P 120
142#define OMAP44XX_DMA_AES1_P_CONTEXT_OUT_REQ 121
143#define OMAP44XX_DMA_AES2_P_CONTEXT_OUT_REQ 122
144#define OMAP44XX_DMA_I2C4_TX 124
145#define OMAP44XX_DMA_I2C4_RX 125
146
147#endif
diff --git a/arch/arm/plat-omap/include/plat/dma.h b/arch/arm/plat-omap/include/plat/dma.h
new file mode 100644
index 00000000000..dc562a5c0a8
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/dma.h
@@ -0,0 +1,538 @@
1/*
2 * arch/arm/plat-omap/include/mach/dma.h
3 *
4 * Copyright (C) 2003 Nokia Corporation
5 * Author: Juha Yrjölä <juha.yrjola@nokia.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#ifndef __ASM_ARCH_DMA_H
22#define __ASM_ARCH_DMA_H
23
24#include <linux/platform_device.h>
25
26/*
27 * TODO: These dma channel defines should go away once all
28 * the omap drivers hwmod adapted.
29 */
30
31/* Move omap4 specific defines to dma-44xx.h */
32#include "dma-44xx.h"
33
34/* DMA channels for omap1 */
35#define OMAP_DMA_NO_DEVICE 0
36#define OMAP_DMA_MCSI1_TX 1
37#define OMAP_DMA_MCSI1_RX 2
38#define OMAP_DMA_I2C_RX 3
39#define OMAP_DMA_I2C_TX 4
40#define OMAP_DMA_EXT_NDMA_REQ 5
41#define OMAP_DMA_EXT_NDMA_REQ2 6
42#define OMAP_DMA_UWIRE_TX 7
43#define OMAP_DMA_MCBSP1_TX 8
44#define OMAP_DMA_MCBSP1_RX 9
45#define OMAP_DMA_MCBSP3_TX 10
46#define OMAP_DMA_MCBSP3_RX 11
47#define OMAP_DMA_UART1_TX 12
48#define OMAP_DMA_UART1_RX 13
49#define OMAP_DMA_UART2_TX 14
50#define OMAP_DMA_UART2_RX 15
51#define OMAP_DMA_MCBSP2_TX 16
52#define OMAP_DMA_MCBSP2_RX 17
53#define OMAP_DMA_UART3_TX 18
54#define OMAP_DMA_UART3_RX 19
55#define OMAP_DMA_CAMERA_IF_RX 20
56#define OMAP_DMA_MMC_TX 21
57#define OMAP_DMA_MMC_RX 22
58#define OMAP_DMA_NAND 23
59#define OMAP_DMA_IRQ_LCD_LINE 24
60#define OMAP_DMA_MEMORY_STICK 25
61#define OMAP_DMA_USB_W2FC_RX0 26
62#define OMAP_DMA_USB_W2FC_RX1 27
63#define OMAP_DMA_USB_W2FC_RX2 28
64#define OMAP_DMA_USB_W2FC_TX0 29
65#define OMAP_DMA_USB_W2FC_TX1 30
66#define OMAP_DMA_USB_W2FC_TX2 31
67
68/* These are only for 1610 */
69#define OMAP_DMA_CRYPTO_DES_IN 32
70#define OMAP_DMA_SPI_TX 33
71#define OMAP_DMA_SPI_RX 34
72#define OMAP_DMA_CRYPTO_HASH 35
73#define OMAP_DMA_CCP_ATTN 36
74#define OMAP_DMA_CCP_FIFO_NOT_EMPTY 37
75#define OMAP_DMA_CMT_APE_TX_CHAN_0 38
76#define OMAP_DMA_CMT_APE_RV_CHAN_0 39
77#define OMAP_DMA_CMT_APE_TX_CHAN_1 40
78#define OMAP_DMA_CMT_APE_RV_CHAN_1 41
79#define OMAP_DMA_CMT_APE_TX_CHAN_2 42
80#define OMAP_DMA_CMT_APE_RV_CHAN_2 43
81#define OMAP_DMA_CMT_APE_TX_CHAN_3 44
82#define OMAP_DMA_CMT_APE_RV_CHAN_3 45
83#define OMAP_DMA_CMT_APE_TX_CHAN_4 46
84#define OMAP_DMA_CMT_APE_RV_CHAN_4 47
85#define OMAP_DMA_CMT_APE_TX_CHAN_5 48
86#define OMAP_DMA_CMT_APE_RV_CHAN_5 49
87#define OMAP_DMA_CMT_APE_TX_CHAN_6 50
88#define OMAP_DMA_CMT_APE_RV_CHAN_6 51
89#define OMAP_DMA_CMT_APE_TX_CHAN_7 52
90#define OMAP_DMA_CMT_APE_RV_CHAN_7 53
91#define OMAP_DMA_MMC2_TX 54
92#define OMAP_DMA_MMC2_RX 55
93#define OMAP_DMA_CRYPTO_DES_OUT 56
94
95/* DMA channels for 24xx */
96#define OMAP24XX_DMA_NO_DEVICE 0
97#define OMAP24XX_DMA_XTI_DMA 1 /* S_DMA_0 */
98#define OMAP24XX_DMA_EXT_DMAREQ0 2 /* S_DMA_1 */
99#define OMAP24XX_DMA_EXT_DMAREQ1 3 /* S_DMA_2 */
100#define OMAP24XX_DMA_GPMC 4 /* S_DMA_3 */
101#define OMAP24XX_DMA_GFX 5 /* S_DMA_4 */
102#define OMAP24XX_DMA_DSS 6 /* S_DMA_5 */
103#define OMAP242X_DMA_VLYNQ_TX 7 /* S_DMA_6 */
104#define OMAP24XX_DMA_EXT_DMAREQ2 7 /* S_DMA_6 */
105#define OMAP24XX_DMA_CWT 8 /* S_DMA_7 */
106#define OMAP24XX_DMA_AES_TX 9 /* S_DMA_8 */
107#define OMAP24XX_DMA_AES_RX 10 /* S_DMA_9 */
108#define OMAP24XX_DMA_DES_TX 11 /* S_DMA_10 */
109#define OMAP24XX_DMA_DES_RX 12 /* S_DMA_11 */
110#define OMAP24XX_DMA_SHA1MD5_RX 13 /* S_DMA_12 */
111#define OMAP34XX_DMA_SHA2MD5_RX 13 /* S_DMA_12 */
112#define OMAP242X_DMA_EXT_DMAREQ2 14 /* S_DMA_13 */
113#define OMAP242X_DMA_EXT_DMAREQ3 15 /* S_DMA_14 */
114#define OMAP242X_DMA_EXT_DMAREQ4 16 /* S_DMA_15 */
115#define OMAP242X_DMA_EAC_AC_RD 17 /* S_DMA_16 */
116#define OMAP242X_DMA_EAC_AC_WR 18 /* S_DMA_17 */
117#define OMAP242X_DMA_EAC_MD_UL_RD 19 /* S_DMA_18 */
118#define OMAP242X_DMA_EAC_MD_UL_WR 20 /* S_DMA_19 */
119#define OMAP242X_DMA_EAC_MD_DL_RD 21 /* S_DMA_20 */
120#define OMAP242X_DMA_EAC_MD_DL_WR 22 /* S_DMA_21 */
121#define OMAP242X_DMA_EAC_BT_UL_RD 23 /* S_DMA_22 */
122#define OMAP242X_DMA_EAC_BT_UL_WR 24 /* S_DMA_23 */
123#define OMAP242X_DMA_EAC_BT_DL_RD 25 /* S_DMA_24 */
124#define OMAP242X_DMA_EAC_BT_DL_WR 26 /* S_DMA_25 */
125#define OMAP243X_DMA_EXT_DMAREQ3 14 /* S_DMA_13 */
126#define OMAP24XX_DMA_SPI3_TX0 15 /* S_DMA_14 */
127#define OMAP24XX_DMA_SPI3_RX0 16 /* S_DMA_15 */
128#define OMAP24XX_DMA_MCBSP3_TX 17 /* S_DMA_16 */
129#define OMAP24XX_DMA_MCBSP3_RX 18 /* S_DMA_17 */
130#define OMAP24XX_DMA_MCBSP4_TX 19 /* S_DMA_18 */
131#define OMAP24XX_DMA_MCBSP4_RX 20 /* S_DMA_19 */
132#define OMAP24XX_DMA_MCBSP5_TX 21 /* S_DMA_20 */
133#define OMAP24XX_DMA_MCBSP5_RX 22 /* S_DMA_21 */
134#define OMAP24XX_DMA_SPI3_TX1 23 /* S_DMA_22 */
135#define OMAP24XX_DMA_SPI3_RX1 24 /* S_DMA_23 */
136#define OMAP243X_DMA_EXT_DMAREQ4 25 /* S_DMA_24 */
137#define OMAP243X_DMA_EXT_DMAREQ5 26 /* S_DMA_25 */
138#define OMAP34XX_DMA_I2C3_TX 25 /* S_DMA_24 */
139#define OMAP34XX_DMA_I2C3_RX 26 /* S_DMA_25 */
140#define OMAP24XX_DMA_I2C1_TX 27 /* S_DMA_26 */
141#define OMAP24XX_DMA_I2C1_RX 28 /* S_DMA_27 */
142#define OMAP24XX_DMA_I2C2_TX 29 /* S_DMA_28 */
143#define OMAP24XX_DMA_I2C2_RX 30 /* S_DMA_29 */
144#define OMAP24XX_DMA_MCBSP1_TX 31 /* S_DMA_30 */
145#define OMAP24XX_DMA_MCBSP1_RX 32 /* S_DMA_31 */
146#define OMAP24XX_DMA_MCBSP2_TX 33 /* S_DMA_32 */
147#define OMAP24XX_DMA_MCBSP2_RX 34 /* S_DMA_33 */
148#define OMAP24XX_DMA_SPI1_TX0 35 /* S_DMA_34 */
149#define OMAP24XX_DMA_SPI1_RX0 36 /* S_DMA_35 */
150#define OMAP24XX_DMA_SPI1_TX1 37 /* S_DMA_36 */
151#define OMAP24XX_DMA_SPI1_RX1 38 /* S_DMA_37 */
152#define OMAP24XX_DMA_SPI1_TX2 39 /* S_DMA_38 */
153#define OMAP24XX_DMA_SPI1_RX2 40 /* S_DMA_39 */
154#define OMAP24XX_DMA_SPI1_TX3 41 /* S_DMA_40 */
155#define OMAP24XX_DMA_SPI1_RX3 42 /* S_DMA_41 */
156#define OMAP24XX_DMA_SPI2_TX0 43 /* S_DMA_42 */
157#define OMAP24XX_DMA_SPI2_RX0 44 /* S_DMA_43 */
158#define OMAP24XX_DMA_SPI2_TX1 45 /* S_DMA_44 */
159#define OMAP24XX_DMA_SPI2_RX1 46 /* S_DMA_45 */
160#define OMAP24XX_DMA_MMC2_TX 47 /* S_DMA_46 */
161#define OMAP24XX_DMA_MMC2_RX 48 /* S_DMA_47 */
162#define OMAP24XX_DMA_UART1_TX 49 /* S_DMA_48 */
163#define OMAP24XX_DMA_UART1_RX 50 /* S_DMA_49 */
164#define OMAP24XX_DMA_UART2_TX 51 /* S_DMA_50 */
165#define OMAP24XX_DMA_UART2_RX 52 /* S_DMA_51 */
166#define OMAP24XX_DMA_UART3_TX 53 /* S_DMA_52 */
167#define OMAP24XX_DMA_UART3_RX 54 /* S_DMA_53 */
168#define OMAP24XX_DMA_USB_W2FC_TX0 55 /* S_DMA_54 */
169#define OMAP24XX_DMA_USB_W2FC_RX0 56 /* S_DMA_55 */
170#define OMAP24XX_DMA_USB_W2FC_TX1 57 /* S_DMA_56 */
171#define OMAP24XX_DMA_USB_W2FC_RX1 58 /* S_DMA_57 */
172#define OMAP24XX_DMA_USB_W2FC_TX2 59 /* S_DMA_58 */
173#define OMAP24XX_DMA_USB_W2FC_RX2 60 /* S_DMA_59 */
174#define OMAP24XX_DMA_MMC1_TX 61 /* S_DMA_60 */
175#define OMAP24XX_DMA_MMC1_RX 62 /* S_DMA_61 */
176#define OMAP24XX_DMA_MS 63 /* S_DMA_62 */
177#define OMAP242X_DMA_EXT_DMAREQ5 64 /* S_DMA_63 */
178#define OMAP243X_DMA_EXT_DMAREQ6 64 /* S_DMA_63 */
179#define OMAP34XX_DMA_EXT_DMAREQ3 64 /* S_DMA_63 */
180#define OMAP34XX_DMA_AES2_TX 65 /* S_DMA_64 */
181#define OMAP34XX_DMA_AES2_RX 66 /* S_DMA_65 */
182#define OMAP34XX_DMA_DES2_TX 67 /* S_DMA_66 */
183#define OMAP34XX_DMA_DES2_RX 68 /* S_DMA_67 */
184#define OMAP34XX_DMA_SHA1MD5_RX 69 /* S_DMA_68 */
185#define OMAP34XX_DMA_SPI4_TX0 70 /* S_DMA_69 */
186#define OMAP34XX_DMA_SPI4_RX0 71 /* S_DMA_70 */
187#define OMAP34XX_DSS_DMA0 72 /* S_DMA_71 */
188#define OMAP34XX_DSS_DMA1 73 /* S_DMA_72 */
189#define OMAP34XX_DSS_DMA2 74 /* S_DMA_73 */
190#define OMAP34XX_DSS_DMA3 75 /* S_DMA_74 */
191#define OMAP34XX_DMA_MMC3_TX 77 /* S_DMA_76 */
192#define OMAP34XX_DMA_MMC3_RX 78 /* S_DMA_77 */
193#define OMAP34XX_DMA_USIM_TX 79 /* S_DMA_78 */
194#define OMAP34XX_DMA_USIM_RX 80 /* S_DMA_79 */
195
196#define OMAP36XX_DMA_UART4_TX 81 /* S_DMA_80 */
197#define OMAP36XX_DMA_UART4_RX 82 /* S_DMA_81 */
198
199/* Only for AM35xx */
200#define AM35XX_DMA_UART4_TX 54
201#define AM35XX_DMA_UART4_RX 55
202
203/*----------------------------------------------------------------------------*/
204
205#define OMAP1_DMA_TOUT_IRQ (1 << 0)
206#define OMAP_DMA_DROP_IRQ (1 << 1)
207#define OMAP_DMA_HALF_IRQ (1 << 2)
208#define OMAP_DMA_FRAME_IRQ (1 << 3)
209#define OMAP_DMA_LAST_IRQ (1 << 4)
210#define OMAP_DMA_BLOCK_IRQ (1 << 5)
211#define OMAP1_DMA_SYNC_IRQ (1 << 6)
212#define OMAP2_DMA_PKT_IRQ (1 << 7)
213#define OMAP2_DMA_TRANS_ERR_IRQ (1 << 8)
214#define OMAP2_DMA_SECURE_ERR_IRQ (1 << 9)
215#define OMAP2_DMA_SUPERVISOR_ERR_IRQ (1 << 10)
216#define OMAP2_DMA_MISALIGNED_ERR_IRQ (1 << 11)
217
218#define OMAP_DMA_CCR_EN (1 << 7)
219#define OMAP_DMA_CCR_RD_ACTIVE (1 << 9)
220#define OMAP_DMA_CCR_WR_ACTIVE (1 << 10)
221#define OMAP_DMA_CCR_SEL_SRC_DST_SYNC (1 << 24)
222#define OMAP_DMA_CCR_BUFFERING_DISABLE (1 << 25)
223
224#define OMAP_DMA_DATA_TYPE_S8 0x00
225#define OMAP_DMA_DATA_TYPE_S16 0x01
226#define OMAP_DMA_DATA_TYPE_S32 0x02
227
228#define OMAP_DMA_SYNC_ELEMENT 0x00
229#define OMAP_DMA_SYNC_FRAME 0x01
230#define OMAP_DMA_SYNC_BLOCK 0x02
231#define OMAP_DMA_SYNC_PACKET 0x03
232
233#define OMAP_DMA_DST_SYNC_PREFETCH 0x02
234#define OMAP_DMA_SRC_SYNC 0x01
235#define OMAP_DMA_DST_SYNC 0x00
236
237#define OMAP_DMA_PORT_EMIFF 0x00
238#define OMAP_DMA_PORT_EMIFS 0x01
239#define OMAP_DMA_PORT_OCP_T1 0x02
240#define OMAP_DMA_PORT_TIPB 0x03
241#define OMAP_DMA_PORT_OCP_T2 0x04
242#define OMAP_DMA_PORT_MPUI 0x05
243
244#define OMAP_DMA_AMODE_CONSTANT 0x00
245#define OMAP_DMA_AMODE_POST_INC 0x01
246#define OMAP_DMA_AMODE_SINGLE_IDX 0x02
247#define OMAP_DMA_AMODE_DOUBLE_IDX 0x03
248
249#define DMA_DEFAULT_FIFO_DEPTH 0x10
250#define DMA_DEFAULT_ARB_RATE 0x01
251/* Pass THREAD_RESERVE ORed with THREAD_FIFO for tparams */
252#define DMA_THREAD_RESERVE_NORM (0x00 << 12) /* Def */
253#define DMA_THREAD_RESERVE_ONET (0x01 << 12)
254#define DMA_THREAD_RESERVE_TWOT (0x02 << 12)
255#define DMA_THREAD_RESERVE_THREET (0x03 << 12)
256#define DMA_THREAD_FIFO_NONE (0x00 << 14) /* Def */
257#define DMA_THREAD_FIFO_75 (0x01 << 14)
258#define DMA_THREAD_FIFO_25 (0x02 << 14)
259#define DMA_THREAD_FIFO_50 (0x03 << 14)
260
261/* DMA4_OCP_SYSCONFIG bits */
262#define DMA_SYSCONFIG_MIDLEMODE_MASK (3 << 12)
263#define DMA_SYSCONFIG_CLOCKACTIVITY_MASK (3 << 8)
264#define DMA_SYSCONFIG_EMUFREE (1 << 5)
265#define DMA_SYSCONFIG_SIDLEMODE_MASK (3 << 3)
266#define DMA_SYSCONFIG_SOFTRESET (1 << 2)
267#define DMA_SYSCONFIG_AUTOIDLE (1 << 0)
268
269#define DMA_SYSCONFIG_MIDLEMODE(n) ((n) << 12)
270#define DMA_SYSCONFIG_SIDLEMODE(n) ((n) << 3)
271
272#define DMA_IDLEMODE_SMARTIDLE 0x2
273#define DMA_IDLEMODE_NO_IDLE 0x1
274#define DMA_IDLEMODE_FORCE_IDLE 0x0
275
276/* Chaining modes*/
277#ifndef CONFIG_ARCH_OMAP1
278#define OMAP_DMA_STATIC_CHAIN 0x1
279#define OMAP_DMA_DYNAMIC_CHAIN 0x2
280#define OMAP_DMA_CHAIN_ACTIVE 0x1
281#define OMAP_DMA_CHAIN_INACTIVE 0x0
282#endif
283
284#define DMA_CH_PRIO_HIGH 0x1
285#define DMA_CH_PRIO_LOW 0x0 /* Def */
286
287/* Errata handling */
288#define IS_DMA_ERRATA(id) (errata & (id))
289#define SET_DMA_ERRATA(id) (errata |= (id))
290
291#define DMA_ERRATA_IFRAME_BUFFERING BIT(0x0)
292#define DMA_ERRATA_PARALLEL_CHANNELS BIT(0x1)
293#define DMA_ERRATA_i378 BIT(0x2)
294#define DMA_ERRATA_i541 BIT(0x3)
295#define DMA_ERRATA_i88 BIT(0x4)
296#define DMA_ERRATA_3_3 BIT(0x5)
297#define DMA_ROMCODE_BUG BIT(0x6)
298
299/* Attributes for OMAP DMA Contrller */
300#define DMA_LINKED_LCH BIT(0x0)
301#define GLOBAL_PRIORITY BIT(0x1)
302#define RESERVE_CHANNEL BIT(0x2)
303#define IS_CSSA_32 BIT(0x3)
304#define IS_CDSA_32 BIT(0x4)
305#define IS_RW_PRIORITY BIT(0x5)
306#define ENABLE_1510_MODE BIT(0x6)
307#define SRC_PORT BIT(0x7)
308#define DST_PORT BIT(0x8)
309#define SRC_INDEX BIT(0x9)
310#define DST_INDEX BIT(0xA)
311#define IS_BURST_ONLY4 BIT(0xB)
312#define CLEAR_CSR_ON_READ BIT(0xC)
313#define IS_WORD_16 BIT(0xD)
314
315enum omap_reg_offsets {
316
317GCR, GSCR, GRST1, HW_ID,
318PCH2_ID, PCH0_ID, PCH1_ID, PCHG_ID,
319PCHD_ID, CAPS_0, CAPS_1, CAPS_2,
320CAPS_3, CAPS_4, PCH2_SR, PCH0_SR,
321PCH1_SR, PCHD_SR, REVISION, IRQSTATUS_L0,
322IRQSTATUS_L1, IRQSTATUS_L2, IRQSTATUS_L3, IRQENABLE_L0,
323IRQENABLE_L1, IRQENABLE_L2, IRQENABLE_L3, SYSSTATUS,
324OCP_SYSCONFIG,
325
326/* omap1+ specific */
327CPC, CCR2, LCH_CTRL,
328
329/* Common registers for all omap's */
330CSDP, CCR, CICR, CSR,
331CEN, CFN, CSFI, CSEI,
332CSAC, CDAC, CDEI,
333CDFI, CLNK_CTRL,
334
335/* Channel specific registers */
336CSSA, CDSA, COLOR,
337CCEN, CCFN,
338
339/* omap3630 and omap4 specific */
340CDP, CNDP, CCDN,
341
342};
343
344enum omap_dma_burst_mode {
345 OMAP_DMA_DATA_BURST_DIS = 0,
346 OMAP_DMA_DATA_BURST_4,
347 OMAP_DMA_DATA_BURST_8,
348 OMAP_DMA_DATA_BURST_16,
349};
350
351enum end_type {
352 OMAP_DMA_LITTLE_ENDIAN = 0,
353 OMAP_DMA_BIG_ENDIAN
354};
355
356enum omap_dma_color_mode {
357 OMAP_DMA_COLOR_DIS = 0,
358 OMAP_DMA_CONSTANT_FILL,
359 OMAP_DMA_TRANSPARENT_COPY
360};
361
362enum omap_dma_write_mode {
363 OMAP_DMA_WRITE_NON_POSTED = 0,
364 OMAP_DMA_WRITE_POSTED,
365 OMAP_DMA_WRITE_LAST_NON_POSTED
366};
367
368enum omap_dma_channel_mode {
369 OMAP_DMA_LCH_2D = 0,
370 OMAP_DMA_LCH_G,
371 OMAP_DMA_LCH_P,
372 OMAP_DMA_LCH_PD
373};
374
375struct omap_dma_channel_params {
376 int data_type; /* data type 8,16,32 */
377 int elem_count; /* number of elements in a frame */
378 int frame_count; /* number of frames in a element */
379
380 int src_port; /* Only on OMAP1 REVISIT: Is this needed? */
381 int src_amode; /* constant, post increment, indexed,
382 double indexed */
383 unsigned long src_start; /* source address : physical */
384 int src_ei; /* source element index */
385 int src_fi; /* source frame index */
386
387 int dst_port; /* Only on OMAP1 REVISIT: Is this needed? */
388 int dst_amode; /* constant, post increment, indexed,
389 double indexed */
390 unsigned long dst_start; /* source address : physical */
391 int dst_ei; /* source element index */
392 int dst_fi; /* source frame index */
393
394 int trigger; /* trigger attached if the channel is
395 synchronized */
396 int sync_mode; /* sycn on element, frame , block or packet */
397 int src_or_dst_synch; /* source synch(1) or destination synch(0) */
398
399 int ie; /* interrupt enabled */
400
401 unsigned char read_prio;/* read priority */
402 unsigned char write_prio;/* write priority */
403
404#ifndef CONFIG_ARCH_OMAP1
405 enum omap_dma_burst_mode burst_mode; /* Burst mode 4/8/16 words */
406#endif
407};
408
409struct omap_dma_lch {
410 int next_lch;
411 int dev_id;
412 u16 saved_csr;
413 u16 enabled_irqs;
414 const char *dev_name;
415 void (*callback)(int lch, u16 ch_status, void *data);
416 void *data;
417 long flags;
418 /* required for Dynamic chaining */
419 int prev_linked_ch;
420 int next_linked_ch;
421 int state;
422 int chain_id;
423 int status;
424};
425
426struct omap_dma_dev_attr {
427 u32 dev_caps;
428 u16 lch_count;
429 u16 chan_count;
430 struct omap_dma_lch *chan;
431};
432
433/* System DMA platform data structure */
434struct omap_system_dma_plat_info {
435 struct omap_dma_dev_attr *dma_attr;
436 u32 errata;
437 void (*disable_irq_lch)(int lch);
438 void (*show_dma_caps)(void);
439 void (*clear_lch_regs)(int lch);
440 void (*clear_dma)(int lch);
441 void (*dma_write)(u32 val, int reg, int lch);
442 u32 (*dma_read)(int reg, int lch);
443};
444
445extern void omap_set_dma_priority(int lch, int dst_port, int priority);
446extern int omap_request_dma(int dev_id, const char *dev_name,
447 void (*callback)(int lch, u16 ch_status, void *data),
448 void *data, int *dma_ch);
449extern void omap_enable_dma_irq(int ch, u16 irq_bits);
450extern void omap_disable_dma_irq(int ch, u16 irq_bits);
451extern void omap_free_dma(int ch);
452extern void omap_start_dma(int lch);
453extern void omap_stop_dma(int lch);
454extern void omap_set_dma_transfer_params(int lch, int data_type,
455 int elem_count, int frame_count,
456 int sync_mode,
457 int dma_trigger, int src_or_dst_synch);
458extern void omap_set_dma_color_mode(int lch, enum omap_dma_color_mode mode,
459 u32 color);
460extern void omap_set_dma_write_mode(int lch, enum omap_dma_write_mode mode);
461extern void omap_set_dma_channel_mode(int lch, enum omap_dma_channel_mode mode);
462
463extern void omap_set_dma_src_params(int lch, int src_port, int src_amode,
464 unsigned long src_start,
465 int src_ei, int src_fi);
466extern void omap_set_dma_src_index(int lch, int eidx, int fidx);
467extern void omap_set_dma_src_data_pack(int lch, int enable);
468extern void omap_set_dma_src_burst_mode(int lch,
469 enum omap_dma_burst_mode burst_mode);
470
471extern void omap_set_dma_dest_params(int lch, int dest_port, int dest_amode,
472 unsigned long dest_start,
473 int dst_ei, int dst_fi);
474extern void omap_set_dma_dest_index(int lch, int eidx, int fidx);
475extern void omap_set_dma_dest_data_pack(int lch, int enable);
476extern void omap_set_dma_dest_burst_mode(int lch,
477 enum omap_dma_burst_mode burst_mode);
478
479extern void omap_set_dma_params(int lch,
480 struct omap_dma_channel_params *params);
481
482extern void omap_dma_link_lch(int lch_head, int lch_queue);
483extern void omap_dma_unlink_lch(int lch_head, int lch_queue);
484
485extern int omap_set_dma_callback(int lch,
486 void (*callback)(int lch, u16 ch_status, void *data),
487 void *data);
488extern dma_addr_t omap_get_dma_src_pos(int lch);
489extern dma_addr_t omap_get_dma_dst_pos(int lch);
490extern void omap_clear_dma(int lch);
491extern int omap_get_dma_active_status(int lch);
492extern int omap_dma_running(void);
493extern void omap_dma_set_global_params(int arb_rate, int max_fifo_depth,
494 int tparams);
495extern int omap_dma_set_prio_lch(int lch, unsigned char read_prio,
496 unsigned char write_prio);
497extern void omap_set_dma_dst_endian_type(int lch, enum end_type etype);
498extern void omap_set_dma_src_endian_type(int lch, enum end_type etype);
499extern int omap_get_dma_index(int lch, int *ei, int *fi);
500
501void omap_dma_global_context_save(void);
502void omap_dma_global_context_restore(void);
503
504extern void omap_dma_disable_irq(int lch);
505
506/* Chaining APIs */
507#ifndef CONFIG_ARCH_OMAP1
508extern int omap_request_dma_chain(int dev_id, const char *dev_name,
509 void (*callback) (int lch, u16 ch_status,
510 void *data),
511 int *chain_id, int no_of_chans,
512 int chain_mode,
513 struct omap_dma_channel_params params);
514extern int omap_free_dma_chain(int chain_id);
515extern int omap_dma_chain_a_transfer(int chain_id, int src_start,
516 int dest_start, int elem_count,
517 int frame_count, void *callbk_data);
518extern int omap_start_dma_chain_transfers(int chain_id);
519extern int omap_stop_dma_chain_transfers(int chain_id);
520extern int omap_get_dma_chain_index(int chain_id, int *ei, int *fi);
521extern int omap_get_dma_chain_dst_pos(int chain_id);
522extern int omap_get_dma_chain_src_pos(int chain_id);
523
524extern int omap_modify_dma_chain_params(int chain_id,
525 struct omap_dma_channel_params params);
526extern int omap_dma_chain_status(int chain_id);
527#endif
528
529#if defined(CONFIG_ARCH_OMAP1) && defined(CONFIG_FB_OMAP)
530#include <mach/lcd_dma.h>
531#else
532static inline int omap_lcd_dma_running(void)
533{
534 return 0;
535}
536#endif
537
538#endif /* __ASM_ARCH_DMA_H */
diff --git a/arch/arm/plat-omap/include/plat/dsp.h b/arch/arm/plat-omap/include/plat/dsp.h
new file mode 100644
index 00000000000..9c604b390f9
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/dsp.h
@@ -0,0 +1,31 @@
1#ifndef __OMAP_DSP_H__
2#define __OMAP_DSP_H__
3
4#include <linux/types.h>
5
6struct omap_dsp_platform_data {
7 void (*dsp_set_min_opp) (u8 opp_id);
8 u8 (*dsp_get_opp) (void);
9 void (*cpu_set_freq) (unsigned long f);
10 unsigned long (*cpu_get_freq) (void);
11 unsigned long mpu_speed[6];
12
13 /* functions to write and read PRCM registers */
14 void (*dsp_prm_write)(u32, s16 , u16);
15 u32 (*dsp_prm_read)(s16 , u16);
16 u32 (*dsp_prm_rmw_bits)(u32, u32, s16, s16);
17 void (*dsp_cm_write)(u32, s16 , u16);
18 u32 (*dsp_cm_read)(s16 , u16);
19 u32 (*dsp_cm_rmw_bits)(u32, u32, s16, s16);
20
21 phys_addr_t phys_mempool_base;
22 phys_addr_t phys_mempool_size;
23};
24
25#if defined(CONFIG_TIDSPBRIDGE) || defined(CONFIG_TIDSPBRIDGE_MODULE)
26extern void omap_dsp_reserve_sdram_memblock(void);
27#else
28static inline void omap_dsp_reserve_sdram_memblock(void) { }
29#endif
30
31#endif
diff --git a/arch/arm/plat-omap/include/plat/flash.h b/arch/arm/plat-omap/include/plat/flash.h
new file mode 100644
index 00000000000..0d88499b79e
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/flash.h
@@ -0,0 +1,17 @@
1/*
2 * Flash support for OMAP1
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#ifndef __OMAP_FLASH_H
10#define __OMAP_FLASH_H
11
12#include <linux/mtd/map.h>
13
14struct platform_device;
15extern void omap1_set_vpp(struct platform_device *pdev, int enable);
16
17#endif
diff --git a/arch/arm/plat-omap/include/plat/fpga.h b/arch/arm/plat-omap/include/plat/fpga.h
new file mode 100644
index 00000000000..bd3c6324ae1
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/fpga.h
@@ -0,0 +1,193 @@
1/*
2 * arch/arm/plat-omap/include/mach/fpga.h
3 *
4 * Interrupt handler for OMAP-1510 FPGA
5 *
6 * Copyright (C) 2001 RidgeRun, Inc.
7 * Author: Greg Lonnon <glonnon@ridgerun.com>
8 *
9 * Copyright (C) 2002 MontaVista Software, Inc.
10 *
11 * Separated FPGA interrupts from innovator1510.c and cleaned up for 2.6
12 * Copyright (C) 2004 Nokia Corporation by Tony Lindrgen <tony@atomide.com>
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License version 2 as
16 * published by the Free Software Foundation.
17 */
18
19#ifndef __ASM_ARCH_OMAP_FPGA_H
20#define __ASM_ARCH_OMAP_FPGA_H
21
22extern void omap1510_fpga_init_irq(void);
23
24#define fpga_read(reg) __raw_readb(reg)
25#define fpga_write(val, reg) __raw_writeb(val, reg)
26
27/*
28 * ---------------------------------------------------------------------------
29 * H2/P2 Debug board FPGA
30 * ---------------------------------------------------------------------------
31 */
32/* maps in the FPGA registers and the ETHR registers */
33#define H2P2_DBG_FPGA_BASE 0xE8000000 /* VA */
34#define H2P2_DBG_FPGA_SIZE SZ_4K /* SIZE */
35#define H2P2_DBG_FPGA_START 0x04000000 /* PA */
36
37#define H2P2_DBG_FPGA_ETHR_START (H2P2_DBG_FPGA_START + 0x300)
38#define H2P2_DBG_FPGA_FPGA_REV IOMEM(H2P2_DBG_FPGA_BASE + 0x10) /* FPGA Revision */
39#define H2P2_DBG_FPGA_BOARD_REV IOMEM(H2P2_DBG_FPGA_BASE + 0x12) /* Board Revision */
40#define H2P2_DBG_FPGA_GPIO IOMEM(H2P2_DBG_FPGA_BASE + 0x14) /* GPIO outputs */
41#define H2P2_DBG_FPGA_LEDS IOMEM(H2P2_DBG_FPGA_BASE + 0x16) /* LEDs outputs */
42#define H2P2_DBG_FPGA_MISC_INPUTS IOMEM(H2P2_DBG_FPGA_BASE + 0x18) /* Misc inputs */
43#define H2P2_DBG_FPGA_LAN_STATUS IOMEM(H2P2_DBG_FPGA_BASE + 0x1A) /* LAN Status line */
44#define H2P2_DBG_FPGA_LAN_RESET IOMEM(H2P2_DBG_FPGA_BASE + 0x1C) /* LAN Reset line */
45
46/* NOTE: most boards don't have a static mapping for the FPGA ... */
47struct h2p2_dbg_fpga {
48 /* offset 0x00 */
49 u16 smc91x[8];
50 /* offset 0x10 */
51 u16 fpga_rev;
52 u16 board_rev;
53 u16 gpio_outputs;
54 u16 leds;
55 /* offset 0x18 */
56 u16 misc_inputs;
57 u16 lan_status;
58 u16 lan_reset;
59 u16 reserved0;
60 /* offset 0x20 */
61 u16 ps2_data;
62 u16 ps2_ctrl;
63 /* plus also 4 rs232 ports ... */
64};
65
66/* LEDs definition on debug board (16 LEDs, all physically green) */
67#define H2P2_DBG_FPGA_LED_GREEN (1 << 15)
68#define H2P2_DBG_FPGA_LED_AMBER (1 << 14)
69#define H2P2_DBG_FPGA_LED_RED (1 << 13)
70#define H2P2_DBG_FPGA_LED_BLUE (1 << 12)
71/* cpu0 load-meter LEDs */
72#define H2P2_DBG_FPGA_LOAD_METER (1 << 0) // A bit of fun on our board ...
73#define H2P2_DBG_FPGA_LOAD_METER_SIZE 11
74#define H2P2_DBG_FPGA_LOAD_METER_MASK ((1 << H2P2_DBG_FPGA_LOAD_METER_SIZE) - 1)
75
76#define H2P2_DBG_FPGA_P2_LED_TIMER (1 << 0)
77#define H2P2_DBG_FPGA_P2_LED_IDLE (1 << 1)
78
79/*
80 * ---------------------------------------------------------------------------
81 * OMAP-1510 FPGA
82 * ---------------------------------------------------------------------------
83 */
84#define OMAP1510_FPGA_BASE 0xE8000000 /* VA */
85#define OMAP1510_FPGA_SIZE SZ_4K
86#define OMAP1510_FPGA_START 0x08000000 /* PA */
87
88/* Revision */
89#define OMAP1510_FPGA_REV_LOW IOMEM(OMAP1510_FPGA_BASE + 0x0)
90#define OMAP1510_FPGA_REV_HIGH IOMEM(OMAP1510_FPGA_BASE + 0x1)
91
92#define OMAP1510_FPGA_LCD_PANEL_CONTROL IOMEM(OMAP1510_FPGA_BASE + 0x2)
93#define OMAP1510_FPGA_LED_DIGIT IOMEM(OMAP1510_FPGA_BASE + 0x3)
94#define INNOVATOR_FPGA_HID_SPI IOMEM(OMAP1510_FPGA_BASE + 0x4)
95#define OMAP1510_FPGA_POWER IOMEM(OMAP1510_FPGA_BASE + 0x5)
96
97/* Interrupt status */
98#define OMAP1510_FPGA_ISR_LO IOMEM(OMAP1510_FPGA_BASE + 0x6)
99#define OMAP1510_FPGA_ISR_HI IOMEM(OMAP1510_FPGA_BASE + 0x7)
100
101/* Interrupt mask */
102#define OMAP1510_FPGA_IMR_LO IOMEM(OMAP1510_FPGA_BASE + 0x8)
103#define OMAP1510_FPGA_IMR_HI IOMEM(OMAP1510_FPGA_BASE + 0x9)
104
105/* Reset registers */
106#define OMAP1510_FPGA_HOST_RESET IOMEM(OMAP1510_FPGA_BASE + 0xa)
107#define OMAP1510_FPGA_RST IOMEM(OMAP1510_FPGA_BASE + 0xb)
108
109#define OMAP1510_FPGA_AUDIO IOMEM(OMAP1510_FPGA_BASE + 0xc)
110#define OMAP1510_FPGA_DIP IOMEM(OMAP1510_FPGA_BASE + 0xe)
111#define OMAP1510_FPGA_FPGA_IO IOMEM(OMAP1510_FPGA_BASE + 0xf)
112#define OMAP1510_FPGA_UART1 IOMEM(OMAP1510_FPGA_BASE + 0x14)
113#define OMAP1510_FPGA_UART2 IOMEM(OMAP1510_FPGA_BASE + 0x15)
114#define OMAP1510_FPGA_OMAP1510_STATUS IOMEM(OMAP1510_FPGA_BASE + 0x16)
115#define OMAP1510_FPGA_BOARD_REV IOMEM(OMAP1510_FPGA_BASE + 0x18)
116#define OMAP1510P1_PPT_DATA IOMEM(OMAP1510_FPGA_BASE + 0x100)
117#define OMAP1510P1_PPT_STATUS IOMEM(OMAP1510_FPGA_BASE + 0x101)
118#define OMAP1510P1_PPT_CONTROL IOMEM(OMAP1510_FPGA_BASE + 0x102)
119
120#define OMAP1510_FPGA_TOUCHSCREEN IOMEM(OMAP1510_FPGA_BASE + 0x204)
121
122#define INNOVATOR_FPGA_INFO IOMEM(OMAP1510_FPGA_BASE + 0x205)
123#define INNOVATOR_FPGA_LCD_BRIGHT_LO IOMEM(OMAP1510_FPGA_BASE + 0x206)
124#define INNOVATOR_FPGA_LCD_BRIGHT_HI IOMEM(OMAP1510_FPGA_BASE + 0x207)
125#define INNOVATOR_FPGA_LED_GRN_LO IOMEM(OMAP1510_FPGA_BASE + 0x208)
126#define INNOVATOR_FPGA_LED_GRN_HI IOMEM(OMAP1510_FPGA_BASE + 0x209)
127#define INNOVATOR_FPGA_LED_RED_LO IOMEM(OMAP1510_FPGA_BASE + 0x20a)
128#define INNOVATOR_FPGA_LED_RED_HI IOMEM(OMAP1510_FPGA_BASE + 0x20b)
129#define INNOVATOR_FPGA_CAM_USB_CONTROL IOMEM(OMAP1510_FPGA_BASE + 0x20c)
130#define INNOVATOR_FPGA_EXP_CONTROL IOMEM(OMAP1510_FPGA_BASE + 0x20d)
131#define INNOVATOR_FPGA_ISR2 IOMEM(OMAP1510_FPGA_BASE + 0x20e)
132#define INNOVATOR_FPGA_IMR2 IOMEM(OMAP1510_FPGA_BASE + 0x210)
133
134#define OMAP1510_FPGA_ETHR_START (OMAP1510_FPGA_START + 0x300)
135
136/*
137 * Power up Giga UART driver, turn on HID clock.
138 * Turn off BT power, since we're not using it and it
139 * draws power.
140 */
141#define OMAP1510_FPGA_RESET_VALUE 0x42
142
143#define OMAP1510_FPGA_PCR_IF_PD0 (1 << 7)
144#define OMAP1510_FPGA_PCR_COM2_EN (1 << 6)
145#define OMAP1510_FPGA_PCR_COM1_EN (1 << 5)
146#define OMAP1510_FPGA_PCR_EXP_PD0 (1 << 4)
147#define OMAP1510_FPGA_PCR_EXP_PD1 (1 << 3)
148#define OMAP1510_FPGA_PCR_48MHZ_CLK (1 << 2)
149#define OMAP1510_FPGA_PCR_4MHZ_CLK (1 << 1)
150#define OMAP1510_FPGA_PCR_RSRVD_BIT0 (1 << 0)
151
152/*
153 * Innovator/OMAP1510 FPGA HID register bit definitions
154 */
155#define OMAP1510_FPGA_HID_SCLK (1<<0) /* output */
156#define OMAP1510_FPGA_HID_MOSI (1<<1) /* output */
157#define OMAP1510_FPGA_HID_nSS (1<<2) /* output 0/1 chip idle/select */
158#define OMAP1510_FPGA_HID_nHSUS (1<<3) /* output 0/1 host active/suspended */
159#define OMAP1510_FPGA_HID_MISO (1<<4) /* input */
160#define OMAP1510_FPGA_HID_ATN (1<<5) /* input 0/1 chip idle/ATN */
161#define OMAP1510_FPGA_HID_rsrvd (1<<6)
162#define OMAP1510_FPGA_HID_RESETn (1<<7) /* output - 0/1 USAR reset/run */
163
164/* The FPGA IRQ is cascaded through GPIO_13 */
165#define OMAP1510_INT_FPGA (IH_GPIO_BASE + 13)
166
167/* IRQ Numbers for interrupts muxed through the FPGA */
168#define OMAP1510_INT_FPGA_ATN (OMAP_FPGA_IRQ_BASE + 0)
169#define OMAP1510_INT_FPGA_ACK (OMAP_FPGA_IRQ_BASE + 1)
170#define OMAP1510_INT_FPGA2 (OMAP_FPGA_IRQ_BASE + 2)
171#define OMAP1510_INT_FPGA3 (OMAP_FPGA_IRQ_BASE + 3)
172#define OMAP1510_INT_FPGA4 (OMAP_FPGA_IRQ_BASE + 4)
173#define OMAP1510_INT_FPGA5 (OMAP_FPGA_IRQ_BASE + 5)
174#define OMAP1510_INT_FPGA6 (OMAP_FPGA_IRQ_BASE + 6)
175#define OMAP1510_INT_FPGA7 (OMAP_FPGA_IRQ_BASE + 7)
176#define OMAP1510_INT_FPGA8 (OMAP_FPGA_IRQ_BASE + 8)
177#define OMAP1510_INT_FPGA9 (OMAP_FPGA_IRQ_BASE + 9)
178#define OMAP1510_INT_FPGA10 (OMAP_FPGA_IRQ_BASE + 10)
179#define OMAP1510_INT_FPGA11 (OMAP_FPGA_IRQ_BASE + 11)
180#define OMAP1510_INT_FPGA12 (OMAP_FPGA_IRQ_BASE + 12)
181#define OMAP1510_INT_ETHER (OMAP_FPGA_IRQ_BASE + 13)
182#define OMAP1510_INT_FPGAUART1 (OMAP_FPGA_IRQ_BASE + 14)
183#define OMAP1510_INT_FPGAUART2 (OMAP_FPGA_IRQ_BASE + 15)
184#define OMAP1510_INT_FPGA_TS (OMAP_FPGA_IRQ_BASE + 16)
185#define OMAP1510_INT_FPGA17 (OMAP_FPGA_IRQ_BASE + 17)
186#define OMAP1510_INT_FPGA_CAM (OMAP_FPGA_IRQ_BASE + 18)
187#define OMAP1510_INT_FPGA_RTC_A (OMAP_FPGA_IRQ_BASE + 19)
188#define OMAP1510_INT_FPGA_RTC_B (OMAP_FPGA_IRQ_BASE + 20)
189#define OMAP1510_INT_FPGA_CD (OMAP_FPGA_IRQ_BASE + 21)
190#define OMAP1510_INT_FPGA22 (OMAP_FPGA_IRQ_BASE + 22)
191#define OMAP1510_INT_FPGA23 (OMAP_FPGA_IRQ_BASE + 23)
192
193#endif
diff --git a/arch/arm/plat-omap/include/plat/gpio-switch.h b/arch/arm/plat-omap/include/plat/gpio-switch.h
new file mode 100644
index 00000000000..10da0e07c0c
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/gpio-switch.h
@@ -0,0 +1,54 @@
1/*
2 * GPIO switch definitions
3 *
4 * Copyright (C) 2006 Nokia Corporation
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __ASM_ARCH_OMAP_GPIO_SWITCH_H
12#define __ASM_ARCH_OMAP_GPIO_SWITCH_H
13
14#include <linux/types.h>
15
16/* Cover:
17 * high -> closed
18 * low -> open
19 * Connection:
20 * high -> connected
21 * low -> disconnected
22 * Activity:
23 * high -> active
24 * low -> inactive
25 *
26 */
27#define OMAP_GPIO_SWITCH_TYPE_COVER 0x0000
28#define OMAP_GPIO_SWITCH_TYPE_CONNECTION 0x0001
29#define OMAP_GPIO_SWITCH_TYPE_ACTIVITY 0x0002
30#define OMAP_GPIO_SWITCH_FLAG_INVERTED 0x0001
31#define OMAP_GPIO_SWITCH_FLAG_OUTPUT 0x0002
32
33struct omap_gpio_switch {
34 const char *name;
35 s16 gpio;
36 unsigned flags:4;
37 unsigned type:4;
38
39 /* Time in ms to debounce when transitioning from
40 * inactive state to active state. */
41 u16 debounce_rising;
42 /* Same for transition from active to inactive state. */
43 u16 debounce_falling;
44
45 /* notify board-specific code about state changes */
46 void (* notify)(void *data, int state);
47 void *notify_data;
48};
49
50/* Call at init time only */
51extern void omap_register_gpio_switches(const struct omap_gpio_switch *tbl,
52 int count);
53
54#endif
diff --git a/arch/arm/plat-omap/include/plat/gpio.h b/arch/arm/plat-omap/include/plat/gpio.h
new file mode 100644
index 00000000000..91e8de3db08
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/gpio.h
@@ -0,0 +1,262 @@
1/*
2 * arch/arm/plat-omap/include/mach/gpio.h
3 *
4 * OMAP GPIO handling defines and functions
5 *
6 * Copyright (C) 2003-2005 Nokia Corporation
7 *
8 * Written by Juha Yrjölä <juha.yrjola@nokia.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 *
24 */
25
26#ifndef __ASM_ARCH_OMAP_GPIO_H
27#define __ASM_ARCH_OMAP_GPIO_H
28
29#include <linux/io.h>
30#include <linux/platform_device.h>
31#include <mach/irqs.h>
32
33#define OMAP1_MPUIO_BASE 0xfffb5000
34
35/*
36 * These are the omap15xx/16xx offsets. The omap7xx offset are
37 * OMAP_MPUIO_ / 2 offsets below.
38 */
39#define OMAP_MPUIO_INPUT_LATCH 0x00
40#define OMAP_MPUIO_OUTPUT 0x04
41#define OMAP_MPUIO_IO_CNTL 0x08
42#define OMAP_MPUIO_KBR_LATCH 0x10
43#define OMAP_MPUIO_KBC 0x14
44#define OMAP_MPUIO_GPIO_EVENT_MODE 0x18
45#define OMAP_MPUIO_GPIO_INT_EDGE 0x1c
46#define OMAP_MPUIO_KBD_INT 0x20
47#define OMAP_MPUIO_GPIO_INT 0x24
48#define OMAP_MPUIO_KBD_MASKIT 0x28
49#define OMAP_MPUIO_GPIO_MASKIT 0x2c
50#define OMAP_MPUIO_GPIO_DEBOUNCING 0x30
51#define OMAP_MPUIO_LATCH 0x34
52
53#define OMAP34XX_NR_GPIOS 6
54
55/*
56 * OMAP1510 GPIO registers
57 */
58#define OMAP1510_GPIO_DATA_INPUT 0x00
59#define OMAP1510_GPIO_DATA_OUTPUT 0x04
60#define OMAP1510_GPIO_DIR_CONTROL 0x08
61#define OMAP1510_GPIO_INT_CONTROL 0x0c
62#define OMAP1510_GPIO_INT_MASK 0x10
63#define OMAP1510_GPIO_INT_STATUS 0x14
64#define OMAP1510_GPIO_PIN_CONTROL 0x18
65
66#define OMAP1510_IH_GPIO_BASE 64
67
68/*
69 * OMAP1610 specific GPIO registers
70 */
71#define OMAP1610_GPIO_REVISION 0x0000
72#define OMAP1610_GPIO_SYSCONFIG 0x0010
73#define OMAP1610_GPIO_SYSSTATUS 0x0014
74#define OMAP1610_GPIO_IRQSTATUS1 0x0018
75#define OMAP1610_GPIO_IRQENABLE1 0x001c
76#define OMAP1610_GPIO_WAKEUPENABLE 0x0028
77#define OMAP1610_GPIO_DATAIN 0x002c
78#define OMAP1610_GPIO_DATAOUT 0x0030
79#define OMAP1610_GPIO_DIRECTION 0x0034
80#define OMAP1610_GPIO_EDGE_CTRL1 0x0038
81#define OMAP1610_GPIO_EDGE_CTRL2 0x003c
82#define OMAP1610_GPIO_CLEAR_IRQENABLE1 0x009c
83#define OMAP1610_GPIO_CLEAR_WAKEUPENA 0x00a8
84#define OMAP1610_GPIO_CLEAR_DATAOUT 0x00b0
85#define OMAP1610_GPIO_SET_IRQENABLE1 0x00dc
86#define OMAP1610_GPIO_SET_WAKEUPENA 0x00e8
87#define OMAP1610_GPIO_SET_DATAOUT 0x00f0
88
89/*
90 * OMAP7XX specific GPIO registers
91 */
92#define OMAP7XX_GPIO_DATA_INPUT 0x00
93#define OMAP7XX_GPIO_DATA_OUTPUT 0x04
94#define OMAP7XX_GPIO_DIR_CONTROL 0x08
95#define OMAP7XX_GPIO_INT_CONTROL 0x0c
96#define OMAP7XX_GPIO_INT_MASK 0x10
97#define OMAP7XX_GPIO_INT_STATUS 0x14
98
99/*
100 * omap2+ specific GPIO registers
101 */
102#define OMAP24XX_GPIO_REVISION 0x0000
103#define OMAP24XX_GPIO_IRQSTATUS1 0x0018
104#define OMAP24XX_GPIO_IRQSTATUS2 0x0028
105#define OMAP24XX_GPIO_IRQENABLE2 0x002c
106#define OMAP24XX_GPIO_IRQENABLE1 0x001c
107#define OMAP24XX_GPIO_WAKE_EN 0x0020
108#define OMAP24XX_GPIO_CTRL 0x0030
109#define OMAP24XX_GPIO_OE 0x0034
110#define OMAP24XX_GPIO_DATAIN 0x0038
111#define OMAP24XX_GPIO_DATAOUT 0x003c
112#define OMAP24XX_GPIO_LEVELDETECT0 0x0040
113#define OMAP24XX_GPIO_LEVELDETECT1 0x0044
114#define OMAP24XX_GPIO_RISINGDETECT 0x0048
115#define OMAP24XX_GPIO_FALLINGDETECT 0x004c
116#define OMAP24XX_GPIO_DEBOUNCE_EN 0x0050
117#define OMAP24XX_GPIO_DEBOUNCE_VAL 0x0054
118#define OMAP24XX_GPIO_CLEARIRQENABLE1 0x0060
119#define OMAP24XX_GPIO_SETIRQENABLE1 0x0064
120#define OMAP24XX_GPIO_CLEARWKUENA 0x0080
121#define OMAP24XX_GPIO_SETWKUENA 0x0084
122#define OMAP24XX_GPIO_CLEARDATAOUT 0x0090
123#define OMAP24XX_GPIO_SETDATAOUT 0x0094
124
125#define OMAP4_GPIO_REVISION 0x0000
126#define OMAP4_GPIO_EOI 0x0020
127#define OMAP4_GPIO_IRQSTATUSRAW0 0x0024
128#define OMAP4_GPIO_IRQSTATUSRAW1 0x0028
129#define OMAP4_GPIO_IRQSTATUS0 0x002c
130#define OMAP4_GPIO_IRQSTATUS1 0x0030
131#define OMAP4_GPIO_IRQSTATUSSET0 0x0034
132#define OMAP4_GPIO_IRQSTATUSSET1 0x0038
133#define OMAP4_GPIO_IRQSTATUSCLR0 0x003c
134#define OMAP4_GPIO_IRQSTATUSCLR1 0x0040
135#define OMAP4_GPIO_IRQWAKEN0 0x0044
136#define OMAP4_GPIO_IRQWAKEN1 0x0048
137#define OMAP4_GPIO_IRQENABLE1 0x011c
138#define OMAP4_GPIO_WAKE_EN 0x0120
139#define OMAP4_GPIO_IRQSTATUS2 0x0128
140#define OMAP4_GPIO_IRQENABLE2 0x012c
141#define OMAP4_GPIO_CTRL 0x0130
142#define OMAP4_GPIO_OE 0x0134
143#define OMAP4_GPIO_DATAIN 0x0138
144#define OMAP4_GPIO_DATAOUT 0x013c
145#define OMAP4_GPIO_LEVELDETECT0 0x0140
146#define OMAP4_GPIO_LEVELDETECT1 0x0144
147#define OMAP4_GPIO_RISINGDETECT 0x0148
148#define OMAP4_GPIO_FALLINGDETECT 0x014c
149#define OMAP4_GPIO_DEBOUNCENABLE 0x0150
150#define OMAP4_GPIO_DEBOUNCINGTIME 0x0154
151#define OMAP4_GPIO_CLEARIRQENABLE1 0x0160
152#define OMAP4_GPIO_SETIRQENABLE1 0x0164
153#define OMAP4_GPIO_CLEARWKUENA 0x0180
154#define OMAP4_GPIO_SETWKUENA 0x0184
155#define OMAP4_GPIO_CLEARDATAOUT 0x0190
156#define OMAP4_GPIO_SETDATAOUT 0x0194
157
158#define OMAP_MPUIO(nr) (OMAP_MAX_GPIO_LINES + (nr))
159#define OMAP_GPIO_IS_MPUIO(nr) ((nr) >= OMAP_MAX_GPIO_LINES)
160
161#define OMAP_GPIO_IRQ(nr) (OMAP_GPIO_IS_MPUIO(nr) ? \
162 IH_MPUIO_BASE + ((nr) & 0x0f) : \
163 IH_GPIO_BASE + (nr))
164
165#define METHOD_MPUIO 0
166#define METHOD_GPIO_1510 1
167#define METHOD_GPIO_1610 2
168#define METHOD_GPIO_7XX 3
169#define METHOD_GPIO_24XX 5
170#define METHOD_GPIO_44XX 6
171
172struct omap_gpio_dev_attr {
173 int bank_width; /* GPIO bank width */
174 bool dbck_flag; /* dbck required or not - True for OMAP3&4 */
175};
176
177struct omap_gpio_reg_offs {
178 u16 revision;
179 u16 direction;
180 u16 datain;
181 u16 dataout;
182 u16 set_dataout;
183 u16 clr_dataout;
184 u16 irqstatus;
185 u16 irqstatus2;
186 u16 irqenable;
187 u16 set_irqenable;
188 u16 clr_irqenable;
189 u16 debounce;
190 u16 debounce_en;
191
192 bool irqenable_inv;
193};
194
195struct omap_gpio_platform_data {
196 u16 virtual_irq_start;
197 int bank_type;
198 int bank_width; /* GPIO bank width */
199 int bank_stride; /* Only needed for omap1 MPUIO */
200 bool dbck_flag; /* dbck required or not - True for OMAP3&4 */
201
202 struct omap_gpio_reg_offs *regs;
203};
204
205/* TODO: Analyze removing gpio_bank_count usage from driver code */
206extern int gpio_bank_count;
207
208extern void omap2_gpio_prepare_for_idle(int off_mode);
209extern void omap2_gpio_resume_after_idle(void);
210extern void omap_set_gpio_debounce(int gpio, int enable);
211extern void omap_set_gpio_debounce_time(int gpio, int enable);
212extern void omap_gpio_save_context(void);
213extern void omap_gpio_restore_context(void);
214/*-------------------------------------------------------------------------*/
215
216/* Wrappers for "new style" GPIO calls, using the new infrastructure
217 * which lets us plug in FPGA, I2C, and other implementations.
218 * *
219 * The original OMAP-specific calls should eventually be removed.
220 */
221
222#include <linux/errno.h>
223#include <asm-generic/gpio.h>
224
225static inline int gpio_get_value(unsigned gpio)
226{
227 return __gpio_get_value(gpio);
228}
229
230static inline void gpio_set_value(unsigned gpio, int value)
231{
232 __gpio_set_value(gpio, value);
233}
234
235static inline int gpio_cansleep(unsigned gpio)
236{
237 return __gpio_cansleep(gpio);
238}
239
240static inline int gpio_to_irq(unsigned gpio)
241{
242 return __gpio_to_irq(gpio);
243}
244
245static inline int irq_to_gpio(unsigned irq)
246{
247 int tmp;
248
249 /* omap1 SOC mpuio */
250 if (cpu_class_is_omap1() && (irq < (IH_MPUIO_BASE + 16)))
251 return (irq - IH_MPUIO_BASE) + OMAP_MAX_GPIO_LINES;
252
253 /* SOC gpio */
254 tmp = irq - IH_GPIO_BASE;
255 if (tmp < OMAP_MAX_GPIO_LINES)
256 return tmp;
257
258 /* we don't supply reverse mappings for non-SOC gpios */
259 return -EIO;
260}
261
262#endif
diff --git a/arch/arm/plat-omap/include/plat/gpmc-smc91x.h b/arch/arm/plat-omap/include/plat/gpmc-smc91x.h
new file mode 100644
index 00000000000..b64fbee4d56
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/gpmc-smc91x.h
@@ -0,0 +1,42 @@
1/*
2 * arch/arm/plat-omap/include/mach/gpmc-smc91x.h
3 *
4 * Copyright (C) 2009 Nokia Corporation
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __ASM_ARCH_OMAP_GPMC_SMC91X_H__
12
13#define GPMC_TIMINGS_SMC91C96 (1 << 4)
14#define GPMC_MUX_ADD_DATA (1 << 5) /* GPMC_CONFIG1_MUXADDDATA */
15#define GPMC_READ_MON (1 << 6) /* GPMC_CONFIG1_WAIT_READ_MON */
16#define GPMC_WRITE_MON (1 << 7) /* GPMC_CONFIG1_WAIT_WRITE_MON */
17
18struct omap_smc91x_platform_data {
19 int cs;
20 int gpio_irq;
21 int gpio_pwrdwn;
22 int gpio_reset;
23 int wait_pin; /* Optional GPMC_CONFIG1_WAITPINSELECT */
24 u32 flags;
25 int (*retime)(void);
26};
27
28#if defined(CONFIG_SMC91X) || \
29 defined(CONFIG_SMC91X_MODULE)
30
31extern void gpmc_smc91x_init(struct omap_smc91x_platform_data *d);
32
33#else
34
35#define board_smc91x_data NULL
36
37static inline void gpmc_smc91x_init(struct omap_smc91x_platform_data *d)
38{
39}
40
41#endif
42#endif
diff --git a/arch/arm/plat-omap/include/plat/gpmc-smsc911x.h b/arch/arm/plat-omap/include/plat/gpmc-smsc911x.h
new file mode 100644
index 00000000000..ea6c9c88c72
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/gpmc-smsc911x.h
@@ -0,0 +1,35 @@
1/*
2 * arch/arm/plat-omap/include/plat/gpmc-smsc911x.h
3 *
4 * Copyright (C) 2009 Li-Pro.Net
5 * Stephan Linz <linz@li-pro.net>
6 *
7 * Modified from arch/arm/plat-omap/include/plat/gpmc-smc91x.h
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 */
13
14#ifndef __ASM_ARCH_OMAP_GPMC_SMSC911X_H__
15
16struct omap_smsc911x_platform_data {
17 int id;
18 int cs;
19 int gpio_irq;
20 int gpio_reset;
21 u32 flags;
22};
23
24#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
25
26extern void gpmc_smsc911x_init(struct omap_smsc911x_platform_data *d);
27
28#else
29
30static inline void gpmc_smsc911x_init(struct omap_smsc911x_platform_data *d)
31{
32}
33
34#endif
35#endif
diff --git a/arch/arm/plat-omap/include/plat/gpmc.h b/arch/arm/plat-omap/include/plat/gpmc.h
new file mode 100644
index 00000000000..1527929b445
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/gpmc.h
@@ -0,0 +1,160 @@
1/*
2 * General-Purpose Memory Controller for OMAP2
3 *
4 * Copyright (C) 2005-2006 Nokia Corporation
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __OMAP2_GPMC_H
12#define __OMAP2_GPMC_H
13
14/* Maximum Number of Chip Selects */
15#define GPMC_CS_NUM 8
16
17#define GPMC_CS_CONFIG1 0x00
18#define GPMC_CS_CONFIG2 0x04
19#define GPMC_CS_CONFIG3 0x08
20#define GPMC_CS_CONFIG4 0x0c
21#define GPMC_CS_CONFIG5 0x10
22#define GPMC_CS_CONFIG6 0x14
23#define GPMC_CS_CONFIG7 0x18
24#define GPMC_CS_NAND_COMMAND 0x1c
25#define GPMC_CS_NAND_ADDRESS 0x20
26#define GPMC_CS_NAND_DATA 0x24
27
28/* Control Commands */
29#define GPMC_CONFIG_RDY_BSY 0x00000001
30#define GPMC_CONFIG_DEV_SIZE 0x00000002
31#define GPMC_CONFIG_DEV_TYPE 0x00000003
32#define GPMC_SET_IRQ_STATUS 0x00000004
33#define GPMC_CONFIG_WP 0x00000005
34
35#define GPMC_GET_IRQ_STATUS 0x00000006
36#define GPMC_PREFETCH_FIFO_CNT 0x00000007 /* bytes available in FIFO for r/w */
37#define GPMC_PREFETCH_COUNT 0x00000008 /* remaining bytes to be read/write*/
38#define GPMC_STATUS_BUFFER 0x00000009 /* 1: buffer is available to write */
39
40#define GPMC_NAND_COMMAND 0x0000000a
41#define GPMC_NAND_ADDRESS 0x0000000b
42#define GPMC_NAND_DATA 0x0000000c
43
44#define GPMC_ENABLE_IRQ 0x0000000d
45
46/* ECC commands */
47#define GPMC_ECC_READ 0 /* Reset Hardware ECC for read */
48#define GPMC_ECC_WRITE 1 /* Reset Hardware ECC for write */
49#define GPMC_ECC_READSYN 2 /* Reset before syndrom is read back */
50
51#define GPMC_CONFIG1_WRAPBURST_SUPP (1 << 31)
52#define GPMC_CONFIG1_READMULTIPLE_SUPP (1 << 30)
53#define GPMC_CONFIG1_READTYPE_ASYNC (0 << 29)
54#define GPMC_CONFIG1_READTYPE_SYNC (1 << 29)
55#define GPMC_CONFIG1_WRITEMULTIPLE_SUPP (1 << 28)
56#define GPMC_CONFIG1_WRITETYPE_ASYNC (0 << 27)
57#define GPMC_CONFIG1_WRITETYPE_SYNC (1 << 27)
58#define GPMC_CONFIG1_CLKACTIVATIONTIME(val) ((val & 3) << 25)
59#define GPMC_CONFIG1_PAGE_LEN(val) ((val & 3) << 23)
60#define GPMC_CONFIG1_WAIT_READ_MON (1 << 22)
61#define GPMC_CONFIG1_WAIT_WRITE_MON (1 << 21)
62#define GPMC_CONFIG1_WAIT_MON_IIME(val) ((val & 3) << 18)
63#define GPMC_CONFIG1_WAIT_PIN_SEL(val) ((val & 3) << 16)
64#define GPMC_CONFIG1_DEVICESIZE(val) ((val & 3) << 12)
65#define GPMC_CONFIG1_DEVICESIZE_16 GPMC_CONFIG1_DEVICESIZE(1)
66#define GPMC_CONFIG1_DEVICETYPE(val) ((val & 3) << 10)
67#define GPMC_CONFIG1_DEVICETYPE_NOR GPMC_CONFIG1_DEVICETYPE(0)
68#define GPMC_CONFIG1_MUXADDDATA (1 << 9)
69#define GPMC_CONFIG1_TIME_PARA_GRAN (1 << 4)
70#define GPMC_CONFIG1_FCLK_DIV(val) (val & 3)
71#define GPMC_CONFIG1_FCLK_DIV2 (GPMC_CONFIG1_FCLK_DIV(1))
72#define GPMC_CONFIG1_FCLK_DIV3 (GPMC_CONFIG1_FCLK_DIV(2))
73#define GPMC_CONFIG1_FCLK_DIV4 (GPMC_CONFIG1_FCLK_DIV(3))
74#define GPMC_CONFIG7_CSVALID (1 << 6)
75
76#define GPMC_DEVICETYPE_NOR 0
77#define GPMC_DEVICETYPE_NAND 2
78#define GPMC_CONFIG_WRITEPROTECT 0x00000010
79#define GPMC_STATUS_BUFF_EMPTY 0x00000001
80#define WR_RD_PIN_MONITORING 0x00600000
81#define GPMC_PREFETCH_STATUS_FIFO_CNT(val) ((val >> 24) & 0x7F)
82#define GPMC_PREFETCH_STATUS_COUNT(val) (val & 0x00003fff)
83#define GPMC_IRQ_FIFOEVENTENABLE 0x01
84#define GPMC_IRQ_COUNT_EVENT 0x02
85
86#define PREFETCH_FIFOTHRESHOLD_MAX 0x40
87#define PREFETCH_FIFOTHRESHOLD(val) ((val) << 8)
88
89enum omap_ecc {
90 /* 1-bit ecc: stored at end of spare area */
91 OMAP_ECC_HAMMING_CODE_DEFAULT = 0, /* Default, s/w method */
92 OMAP_ECC_HAMMING_CODE_HW, /* gpmc to detect the error */
93 /* 1-bit ecc: stored at beginning of spare area as romcode */
94 OMAP_ECC_HAMMING_CODE_HW_ROMCODE, /* gpmc method & romcode layout */
95};
96
97/*
98 * Note that all values in this struct are in nanoseconds except sync_clk
99 * (which is in picoseconds), while the register values are in gpmc_fck cycles.
100 */
101struct gpmc_timings {
102 /* Minimum clock period for synchronous mode (in picoseconds) */
103 u32 sync_clk;
104
105 /* Chip-select signal timings corresponding to GPMC_CS_CONFIG2 */
106 u16 cs_on; /* Assertion time */
107 u16 cs_rd_off; /* Read deassertion time */
108 u16 cs_wr_off; /* Write deassertion time */
109
110 /* ADV signal timings corresponding to GPMC_CONFIG3 */
111 u16 adv_on; /* Assertion time */
112 u16 adv_rd_off; /* Read deassertion time */
113 u16 adv_wr_off; /* Write deassertion time */
114
115 /* WE signals timings corresponding to GPMC_CONFIG4 */
116 u16 we_on; /* WE assertion time */
117 u16 we_off; /* WE deassertion time */
118
119 /* OE signals timings corresponding to GPMC_CONFIG4 */
120 u16 oe_on; /* OE assertion time */
121 u16 oe_off; /* OE deassertion time */
122
123 /* Access time and cycle time timings corresponding to GPMC_CONFIG5 */
124 u16 page_burst_access; /* Multiple access word delay */
125 u16 access; /* Start-cycle to first data valid delay */
126 u16 rd_cycle; /* Total read cycle time */
127 u16 wr_cycle; /* Total write cycle time */
128
129 /* The following are only on OMAP3430 */
130 u16 wr_access; /* WRACCESSTIME */
131 u16 wr_data_mux_bus; /* WRDATAONADMUXBUS */
132};
133
134extern unsigned int gpmc_ns_to_ticks(unsigned int time_ns);
135extern unsigned int gpmc_ps_to_ticks(unsigned int time_ps);
136extern unsigned int gpmc_ticks_to_ns(unsigned int ticks);
137extern unsigned int gpmc_round_ns_to_ticks(unsigned int time_ns);
138extern unsigned long gpmc_get_fclk_period(void);
139
140extern void gpmc_cs_write_reg(int cs, int idx, u32 val);
141extern u32 gpmc_cs_read_reg(int cs, int idx);
142extern int gpmc_cs_calc_divider(int cs, unsigned int sync_clk);
143extern int gpmc_cs_set_timings(int cs, const struct gpmc_timings *t);
144extern int gpmc_cs_request(int cs, unsigned long size, unsigned long *base);
145extern void gpmc_cs_free(int cs);
146extern int gpmc_cs_set_reserved(int cs, int reserved);
147extern int gpmc_cs_reserved(int cs);
148extern int gpmc_prefetch_enable(int cs, int fifo_th, int dma_mode,
149 unsigned int u32_count, int is_write);
150extern int gpmc_prefetch_reset(int cs);
151extern void omap3_gpmc_save_context(void);
152extern void omap3_gpmc_restore_context(void);
153extern int gpmc_read_status(int cmd);
154extern int gpmc_cs_configure(int cs, int cmd, int wval);
155extern int gpmc_nand_read(int cs, int cmd);
156extern int gpmc_nand_write(int cs, int cmd, int wval);
157
158int gpmc_enable_hwecc(int cs, int mode, int dev_width, int ecc_size);
159int gpmc_calculate_ecc(int cs, const u_char *dat, u_char *ecc_code);
160#endif
diff --git a/arch/arm/plat-omap/include/plat/hardware.h b/arch/arm/plat-omap/include/plat/hardware.h
new file mode 100644
index 00000000000..e87efe1499b
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/hardware.h
@@ -0,0 +1,291 @@
1/*
2 * arch/arm/plat-omap/include/mach/hardware.h
3 *
4 * Hardware definitions for TI OMAP processors and boards
5 *
6 * NOTE: Please put device driver specific defines into a separate header
7 * file for each driver.
8 *
9 * Copyright (C) 2001 RidgeRun, Inc.
10 * Author: RidgeRun, Inc. Greg Lonnon <glonnon@ridgerun.com>
11 *
12 * Reorganized for Linux-2.6 by Tony Lindgren <tony@atomide.com>
13 * and Dirk Behme <dirk.behme@de.bosch.com>
14 *
15 * This program is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by the
17 * Free Software Foundation; either version 2 of the License, or (at your
18 * option) any later version.
19 *
20 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
21 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
22 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
23 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
24 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
26 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
27 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 *
31 * You should have received a copy of the GNU General Public License along
32 * with this program; if not, write to the Free Software Foundation, Inc.,
33 * 675 Mass Ave, Cambridge, MA 02139, USA.
34 */
35
36#ifndef __ASM_ARCH_OMAP_HARDWARE_H
37#define __ASM_ARCH_OMAP_HARDWARE_H
38
39#include <asm/sizes.h>
40#ifndef __ASSEMBLER__
41#include <asm/types.h>
42#include <plat/cpu.h>
43#endif
44#include <plat/serial.h>
45
46/*
47 * ---------------------------------------------------------------------------
48 * Common definitions for all OMAP processors
49 * NOTE: Put all processor or board specific parts to the special header
50 * files.
51 * ---------------------------------------------------------------------------
52 */
53
54/*
55 * ----------------------------------------------------------------------------
56 * Timers
57 * ----------------------------------------------------------------------------
58 */
59#define OMAP_MPU_TIMER1_BASE (0xfffec500)
60#define OMAP_MPU_TIMER2_BASE (0xfffec600)
61#define OMAP_MPU_TIMER3_BASE (0xfffec700)
62#define MPU_TIMER_FREE (1 << 6)
63#define MPU_TIMER_CLOCK_ENABLE (1 << 5)
64#define MPU_TIMER_AR (1 << 1)
65#define MPU_TIMER_ST (1 << 0)
66
67/*
68 * ----------------------------------------------------------------------------
69 * Clocks
70 * ----------------------------------------------------------------------------
71 */
72#define CLKGEN_REG_BASE (0xfffece00)
73#define ARM_CKCTL (CLKGEN_REG_BASE + 0x0)
74#define ARM_IDLECT1 (CLKGEN_REG_BASE + 0x4)
75#define ARM_IDLECT2 (CLKGEN_REG_BASE + 0x8)
76#define ARM_EWUPCT (CLKGEN_REG_BASE + 0xC)
77#define ARM_RSTCT1 (CLKGEN_REG_BASE + 0x10)
78#define ARM_RSTCT2 (CLKGEN_REG_BASE + 0x14)
79#define ARM_SYSST (CLKGEN_REG_BASE + 0x18)
80#define ARM_IDLECT3 (CLKGEN_REG_BASE + 0x24)
81
82#define CK_RATEF 1
83#define CK_IDLEF 2
84#define CK_ENABLEF 4
85#define CK_SELECTF 8
86#define SETARM_IDLE_SHIFT
87
88/* DPLL control registers */
89#define DPLL_CTL (0xfffecf00)
90
91/* DSP clock control. Must use __raw_readw() and __raw_writew() with these */
92#define DSP_CONFIG_REG_BASE IOMEM(0xe1008000)
93#define DSP_CKCTL (DSP_CONFIG_REG_BASE + 0x0)
94#define DSP_IDLECT1 (DSP_CONFIG_REG_BASE + 0x4)
95#define DSP_IDLECT2 (DSP_CONFIG_REG_BASE + 0x8)
96#define DSP_RSTCT2 (DSP_CONFIG_REG_BASE + 0x14)
97
98/*
99 * ---------------------------------------------------------------------------
100 * UPLD
101 * ---------------------------------------------------------------------------
102 */
103#define ULPD_REG_BASE (0xfffe0800)
104#define ULPD_IT_STATUS (ULPD_REG_BASE + 0x14)
105#define ULPD_SETUP_ANALOG_CELL_3 (ULPD_REG_BASE + 0x24)
106#define ULPD_CLOCK_CTRL (ULPD_REG_BASE + 0x30)
107# define DIS_USB_PVCI_CLK (1 << 5) /* no USB/FAC synch */
108# define USB_MCLK_EN (1 << 4) /* enable W4_USB_CLKO */
109#define ULPD_SOFT_REQ (ULPD_REG_BASE + 0x34)
110# define SOFT_UDC_REQ (1 << 4)
111# define SOFT_USB_CLK_REQ (1 << 3)
112# define SOFT_DPLL_REQ (1 << 0)
113#define ULPD_DPLL_CTRL (ULPD_REG_BASE + 0x3c)
114#define ULPD_STATUS_REQ (ULPD_REG_BASE + 0x40)
115#define ULPD_APLL_CTRL (ULPD_REG_BASE + 0x4c)
116#define ULPD_POWER_CTRL (ULPD_REG_BASE + 0x50)
117#define ULPD_SOFT_DISABLE_REQ_REG (ULPD_REG_BASE + 0x68)
118# define DIS_MMC2_DPLL_REQ (1 << 11)
119# define DIS_MMC1_DPLL_REQ (1 << 10)
120# define DIS_UART3_DPLL_REQ (1 << 9)
121# define DIS_UART2_DPLL_REQ (1 << 8)
122# define DIS_UART1_DPLL_REQ (1 << 7)
123# define DIS_USB_HOST_DPLL_REQ (1 << 6)
124#define ULPD_SDW_CLK_DIV_CTRL_SEL (ULPD_REG_BASE + 0x74)
125#define ULPD_CAM_CLK_CTRL (ULPD_REG_BASE + 0x7c)
126
127/*
128 * ---------------------------------------------------------------------------
129 * Watchdog timer
130 * ---------------------------------------------------------------------------
131 */
132
133/* Watchdog timer within the OMAP3.2 gigacell */
134#define OMAP_MPU_WATCHDOG_BASE (0xfffec800)
135#define OMAP_WDT_TIMER (OMAP_MPU_WATCHDOG_BASE + 0x0)
136#define OMAP_WDT_LOAD_TIM (OMAP_MPU_WATCHDOG_BASE + 0x4)
137#define OMAP_WDT_READ_TIM (OMAP_MPU_WATCHDOG_BASE + 0x4)
138#define OMAP_WDT_TIMER_MODE (OMAP_MPU_WATCHDOG_BASE + 0x8)
139
140/*
141 * ---------------------------------------------------------------------------
142 * Interrupts
143 * ---------------------------------------------------------------------------
144 */
145#ifdef CONFIG_ARCH_OMAP1
146
147/*
148 * XXX: These probably want to be moved to arch/arm/mach-omap/omap1/irq.c
149 * or something similar.. -- PFM.
150 */
151
152#define OMAP_IH1_BASE 0xfffecb00
153#define OMAP_IH2_BASE 0xfffe0000
154
155#define OMAP_IH1_ITR (OMAP_IH1_BASE + 0x00)
156#define OMAP_IH1_MIR (OMAP_IH1_BASE + 0x04)
157#define OMAP_IH1_SIR_IRQ (OMAP_IH1_BASE + 0x10)
158#define OMAP_IH1_SIR_FIQ (OMAP_IH1_BASE + 0x14)
159#define OMAP_IH1_CONTROL (OMAP_IH1_BASE + 0x18)
160#define OMAP_IH1_ILR0 (OMAP_IH1_BASE + 0x1c)
161#define OMAP_IH1_ISR (OMAP_IH1_BASE + 0x9c)
162
163#define OMAP_IH2_ITR (OMAP_IH2_BASE + 0x00)
164#define OMAP_IH2_MIR (OMAP_IH2_BASE + 0x04)
165#define OMAP_IH2_SIR_IRQ (OMAP_IH2_BASE + 0x10)
166#define OMAP_IH2_SIR_FIQ (OMAP_IH2_BASE + 0x14)
167#define OMAP_IH2_CONTROL (OMAP_IH2_BASE + 0x18)
168#define OMAP_IH2_ILR0 (OMAP_IH2_BASE + 0x1c)
169#define OMAP_IH2_ISR (OMAP_IH2_BASE + 0x9c)
170
171#define IRQ_ITR_REG_OFFSET 0x00
172#define IRQ_MIR_REG_OFFSET 0x04
173#define IRQ_SIR_IRQ_REG_OFFSET 0x10
174#define IRQ_SIR_FIQ_REG_OFFSET 0x14
175#define IRQ_CONTROL_REG_OFFSET 0x18
176#define IRQ_ISR_REG_OFFSET 0x9c
177#define IRQ_ILR0_REG_OFFSET 0x1c
178#define IRQ_GMR_REG_OFFSET 0xa0
179
180#endif
181
182/*
183 * ----------------------------------------------------------------------------
184 * System control registers
185 * ----------------------------------------------------------------------------
186 */
187#define MOD_CONF_CTRL_0 0xfffe1080
188#define MOD_CONF_CTRL_1 0xfffe1110
189
190/*
191 * ----------------------------------------------------------------------------
192 * Pin multiplexing registers
193 * ----------------------------------------------------------------------------
194 */
195#define FUNC_MUX_CTRL_0 0xfffe1000
196#define FUNC_MUX_CTRL_1 0xfffe1004
197#define FUNC_MUX_CTRL_2 0xfffe1008
198#define COMP_MODE_CTRL_0 0xfffe100c
199#define FUNC_MUX_CTRL_3 0xfffe1010
200#define FUNC_MUX_CTRL_4 0xfffe1014
201#define FUNC_MUX_CTRL_5 0xfffe1018
202#define FUNC_MUX_CTRL_6 0xfffe101C
203#define FUNC_MUX_CTRL_7 0xfffe1020
204#define FUNC_MUX_CTRL_8 0xfffe1024
205#define FUNC_MUX_CTRL_9 0xfffe1028
206#define FUNC_MUX_CTRL_A 0xfffe102C
207#define FUNC_MUX_CTRL_B 0xfffe1030
208#define FUNC_MUX_CTRL_C 0xfffe1034
209#define FUNC_MUX_CTRL_D 0xfffe1038
210#define PULL_DWN_CTRL_0 0xfffe1040
211#define PULL_DWN_CTRL_1 0xfffe1044
212#define PULL_DWN_CTRL_2 0xfffe1048
213#define PULL_DWN_CTRL_3 0xfffe104c
214#define PULL_DWN_CTRL_4 0xfffe10ac
215
216/* OMAP-1610 specific multiplexing registers */
217#define FUNC_MUX_CTRL_E 0xfffe1090
218#define FUNC_MUX_CTRL_F 0xfffe1094
219#define FUNC_MUX_CTRL_10 0xfffe1098
220#define FUNC_MUX_CTRL_11 0xfffe109c
221#define FUNC_MUX_CTRL_12 0xfffe10a0
222#define PU_PD_SEL_0 0xfffe10b4
223#define PU_PD_SEL_1 0xfffe10b8
224#define PU_PD_SEL_2 0xfffe10bc
225#define PU_PD_SEL_3 0xfffe10c0
226#define PU_PD_SEL_4 0xfffe10c4
227
228/* Timer32K for 1610 and 1710*/
229#define OMAP_TIMER32K_BASE 0xFFFBC400
230
231/*
232 * ---------------------------------------------------------------------------
233 * TIPB bus interface
234 * ---------------------------------------------------------------------------
235 */
236#define TIPB_PUBLIC_CNTL_BASE 0xfffed300
237#define MPU_PUBLIC_TIPB_CNTL (TIPB_PUBLIC_CNTL_BASE + 0x8)
238#define TIPB_PRIVATE_CNTL_BASE 0xfffeca00
239#define MPU_PRIVATE_TIPB_CNTL (TIPB_PRIVATE_CNTL_BASE + 0x8)
240
241/*
242 * ----------------------------------------------------------------------------
243 * MPUI interface
244 * ----------------------------------------------------------------------------
245 */
246#define MPUI_BASE (0xfffec900)
247#define MPUI_CTRL (MPUI_BASE + 0x0)
248#define MPUI_DEBUG_ADDR (MPUI_BASE + 0x4)
249#define MPUI_DEBUG_DATA (MPUI_BASE + 0x8)
250#define MPUI_DEBUG_FLAG (MPUI_BASE + 0xc)
251#define MPUI_STATUS_REG (MPUI_BASE + 0x10)
252#define MPUI_DSP_STATUS (MPUI_BASE + 0x14)
253#define MPUI_DSP_BOOT_CONFIG (MPUI_BASE + 0x18)
254#define MPUI_DSP_API_CONFIG (MPUI_BASE + 0x1c)
255
256/*
257 * ----------------------------------------------------------------------------
258 * LED Pulse Generator
259 * ----------------------------------------------------------------------------
260 */
261#define OMAP_LPG1_BASE 0xfffbd000
262#define OMAP_LPG2_BASE 0xfffbd800
263#define OMAP_LPG1_LCR (OMAP_LPG1_BASE + 0x00)
264#define OMAP_LPG1_PMR (OMAP_LPG1_BASE + 0x04)
265#define OMAP_LPG2_LCR (OMAP_LPG2_BASE + 0x00)
266#define OMAP_LPG2_PMR (OMAP_LPG2_BASE + 0x04)
267
268/*
269 * ----------------------------------------------------------------------------
270 * Pulse-Width Light
271 * ----------------------------------------------------------------------------
272 */
273#define OMAP_PWL_BASE 0xfffb5800
274#define OMAP_PWL_ENABLE (OMAP_PWL_BASE + 0x00)
275#define OMAP_PWL_CLK_ENABLE (OMAP_PWL_BASE + 0x04)
276
277/*
278 * ---------------------------------------------------------------------------
279 * Processor specific defines
280 * ---------------------------------------------------------------------------
281 */
282
283#include <plat/omap7xx.h>
284#include <plat/omap1510.h>
285#include <plat/omap16xx.h>
286#include <plat/omap24xx.h>
287#include <plat/omap34xx.h>
288#include <plat/omap44xx.h>
289#include <plat/ti816x.h>
290
291#endif /* __ASM_ARCH_OMAP_HARDWARE_H */
diff --git a/arch/arm/plat-omap/include/plat/hwa742.h b/arch/arm/plat-omap/include/plat/hwa742.h
new file mode 100644
index 00000000000..886248d32b4
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/hwa742.h
@@ -0,0 +1,8 @@
1#ifndef _HWA742_H
2#define _HWA742_H
3
4struct hwa742_platform_data {
5 unsigned te_connected:1;
6};
7
8#endif
diff --git a/arch/arm/plat-omap/include/plat/io.h b/arch/arm/plat-omap/include/plat/io.h
new file mode 100644
index 00000000000..d72ec85c97e
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/io.h
@@ -0,0 +1,314 @@
1/*
2 * arch/arm/plat-omap/include/mach/io.h
3 *
4 * IO definitions for TI OMAP processors and boards
5 *
6 * Copied from arch/arm/mach-sa1100/include/mach/io.h
7 * Copyright (C) 1997-1999 Russell King
8 *
9 * Copyright (C) 2009 Texas Instruments
10 * Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com>
11 *
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version.
16 *
17 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
18 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
20 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
23 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
24 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * You should have received a copy of the GNU General Public License along
29 * with this program; if not, write to the Free Software Foundation, Inc.,
30 * 675 Mass Ave, Cambridge, MA 02139, USA.
31 *
32 * Modifications:
33 * 06-12-1997 RMK Created.
34 * 07-04-1999 RMK Major cleanup
35 */
36
37#ifndef __ASM_ARM_ARCH_IO_H
38#define __ASM_ARM_ARCH_IO_H
39
40#include <mach/hardware.h>
41
42#define IO_SPACE_LIMIT 0xffffffff
43
44/*
45 * We don't actually have real ISA nor PCI buses, but there is so many
46 * drivers out there that might just work if we fake them...
47 */
48#define __io(a) __typesafe_io(a)
49#define __mem_pci(a) (a)
50
51/*
52 * ----------------------------------------------------------------------------
53 * I/O mapping
54 * ----------------------------------------------------------------------------
55 */
56
57#ifdef __ASSEMBLER__
58#define IOMEM(x) (x)
59#else
60#define IOMEM(x) ((void __force __iomem *)(x))
61#endif
62
63#define OMAP1_IO_OFFSET 0x01000000 /* Virtual IO = 0xfefb0000 */
64#define OMAP1_IO_ADDRESS(pa) IOMEM((pa) - OMAP1_IO_OFFSET)
65
66#define OMAP2_L3_IO_OFFSET 0x90000000
67#define OMAP2_L3_IO_ADDRESS(pa) IOMEM((pa) + OMAP2_L3_IO_OFFSET) /* L3 */
68
69
70#define OMAP2_L4_IO_OFFSET 0xb2000000
71#define OMAP2_L4_IO_ADDRESS(pa) IOMEM((pa) + OMAP2_L4_IO_OFFSET) /* L4 */
72
73#define OMAP4_L3_IO_OFFSET 0xb4000000
74#define OMAP4_L3_IO_ADDRESS(pa) IOMEM((pa) + OMAP4_L3_IO_OFFSET) /* L3 */
75
76#define OMAP4_L3_PER_IO_OFFSET 0xb1100000
77#define OMAP4_L3_PER_IO_ADDRESS(pa) IOMEM((pa) + OMAP4_L3_PER_IO_OFFSET)
78
79#define OMAP4_GPMC_IO_OFFSET 0xa9000000
80#define OMAP4_GPMC_IO_ADDRESS(pa) IOMEM((pa) + OMAP4_GPMC_IO_OFFSET)
81
82#define OMAP2_EMU_IO_OFFSET 0xaa800000 /* Emulation */
83#define OMAP2_EMU_IO_ADDRESS(pa) IOMEM((pa) + OMAP2_EMU_IO_OFFSET)
84
85/*
86 * ----------------------------------------------------------------------------
87 * Omap1 specific IO mapping
88 * ----------------------------------------------------------------------------
89 */
90
91#define OMAP1_IO_PHYS 0xFFFB0000
92#define OMAP1_IO_SIZE 0x40000
93#define OMAP1_IO_VIRT (OMAP1_IO_PHYS - OMAP1_IO_OFFSET)
94
95/*
96 * ----------------------------------------------------------------------------
97 * Omap2 specific IO mapping
98 * ----------------------------------------------------------------------------
99 */
100
101/* We map both L3 and L4 on OMAP2 */
102#define L3_24XX_PHYS L3_24XX_BASE /* 0x68000000 --> 0xf8000000*/
103#define L3_24XX_VIRT (L3_24XX_PHYS + OMAP2_L3_IO_OFFSET)
104#define L3_24XX_SIZE SZ_1M /* 44kB of 128MB used, want 1MB sect */
105#define L4_24XX_PHYS L4_24XX_BASE /* 0x48000000 --> 0xfa000000 */
106#define L4_24XX_VIRT (L4_24XX_PHYS + OMAP2_L4_IO_OFFSET)
107#define L4_24XX_SIZE SZ_1M /* 1MB of 128MB used, want 1MB sect */
108
109#define L4_WK_243X_PHYS L4_WK_243X_BASE /* 0x49000000 --> 0xfb000000 */
110#define L4_WK_243X_VIRT (L4_WK_243X_PHYS + OMAP2_L4_IO_OFFSET)
111#define L4_WK_243X_SIZE SZ_1M
112#define OMAP243X_GPMC_PHYS OMAP243X_GPMC_BASE
113#define OMAP243X_GPMC_VIRT (OMAP243X_GPMC_PHYS + OMAP2_L3_IO_OFFSET)
114 /* 0x6e000000 --> 0xfe000000 */
115#define OMAP243X_GPMC_SIZE SZ_1M
116#define OMAP243X_SDRC_PHYS OMAP243X_SDRC_BASE
117 /* 0x6D000000 --> 0xfd000000 */
118#define OMAP243X_SDRC_VIRT (OMAP243X_SDRC_PHYS + OMAP2_L3_IO_OFFSET)
119#define OMAP243X_SDRC_SIZE SZ_1M
120#define OMAP243X_SMS_PHYS OMAP243X_SMS_BASE
121 /* 0x6c000000 --> 0xfc000000 */
122#define OMAP243X_SMS_VIRT (OMAP243X_SMS_PHYS + OMAP2_L3_IO_OFFSET)
123#define OMAP243X_SMS_SIZE SZ_1M
124
125/* 2420 IVA */
126#define DSP_MEM_2420_PHYS OMAP2420_DSP_MEM_BASE
127 /* 0x58000000 --> 0xfc100000 */
128#define DSP_MEM_2420_VIRT 0xfc100000
129#define DSP_MEM_2420_SIZE 0x28000
130#define DSP_IPI_2420_PHYS OMAP2420_DSP_IPI_BASE
131 /* 0x59000000 --> 0xfc128000 */
132#define DSP_IPI_2420_VIRT 0xfc128000
133#define DSP_IPI_2420_SIZE SZ_4K
134#define DSP_MMU_2420_PHYS OMAP2420_DSP_MMU_BASE
135 /* 0x5a000000 --> 0xfc129000 */
136#define DSP_MMU_2420_VIRT 0xfc129000
137#define DSP_MMU_2420_SIZE SZ_4K
138
139/* 2430 IVA2.1 - currently unmapped */
140
141/*
142 * ----------------------------------------------------------------------------
143 * Omap3 specific IO mapping
144 * ----------------------------------------------------------------------------
145 */
146
147/* We map both L3 and L4 on OMAP3 */
148#define L3_34XX_PHYS L3_34XX_BASE /* 0x68000000 --> 0xf8000000 */
149#define L3_34XX_VIRT (L3_34XX_PHYS + OMAP2_L3_IO_OFFSET)
150#define L3_34XX_SIZE SZ_1M /* 44kB of 128MB used, want 1MB sect */
151
152#define L4_34XX_PHYS L4_34XX_BASE /* 0x48000000 --> 0xfa000000 */
153#define L4_34XX_VIRT (L4_34XX_PHYS + OMAP2_L4_IO_OFFSET)
154#define L4_34XX_SIZE SZ_4M /* 1MB of 128MB used, want 1MB sect */
155
156/*
157 * Need to look at the Size 4M for L4.
158 * VPOM3430 was not working for Int controller
159 */
160
161#define L4_PER_34XX_PHYS L4_PER_34XX_BASE
162 /* 0x49000000 --> 0xfb000000 */
163#define L4_PER_34XX_VIRT (L4_PER_34XX_PHYS + OMAP2_L4_IO_OFFSET)
164#define L4_PER_34XX_SIZE SZ_1M
165
166#define L4_EMU_34XX_PHYS L4_EMU_34XX_BASE
167 /* 0x54000000 --> 0xfe800000 */
168#define L4_EMU_34XX_VIRT (L4_EMU_34XX_PHYS + OMAP2_EMU_IO_OFFSET)
169#define L4_EMU_34XX_SIZE SZ_8M
170
171#define OMAP34XX_GPMC_PHYS OMAP34XX_GPMC_BASE
172 /* 0x6e000000 --> 0xfe000000 */
173#define OMAP34XX_GPMC_VIRT (OMAP34XX_GPMC_PHYS + OMAP2_L3_IO_OFFSET)
174#define OMAP34XX_GPMC_SIZE SZ_1M
175
176#define OMAP343X_SMS_PHYS OMAP343X_SMS_BASE
177 /* 0x6c000000 --> 0xfc000000 */
178#define OMAP343X_SMS_VIRT (OMAP343X_SMS_PHYS + OMAP2_L3_IO_OFFSET)
179#define OMAP343X_SMS_SIZE SZ_1M
180
181#define OMAP343X_SDRC_PHYS OMAP343X_SDRC_BASE
182 /* 0x6D000000 --> 0xfd000000 */
183#define OMAP343X_SDRC_VIRT (OMAP343X_SDRC_PHYS + OMAP2_L3_IO_OFFSET)
184#define OMAP343X_SDRC_SIZE SZ_1M
185
186/* 3430 IVA - currently unmapped */
187
188/*
189 * ----------------------------------------------------------------------------
190 * Omap4 specific IO mapping
191 * ----------------------------------------------------------------------------
192 */
193
194/* We map both L3 and L4 on OMAP4 */
195#define L3_44XX_PHYS L3_44XX_BASE /* 0x44000000 --> 0xf8000000 */
196#define L3_44XX_VIRT (L3_44XX_PHYS + OMAP4_L3_IO_OFFSET)
197#define L3_44XX_SIZE SZ_1M
198
199#define L4_44XX_PHYS L4_44XX_BASE /* 0x4a000000 --> 0xfc000000 */
200#define L4_44XX_VIRT (L4_44XX_PHYS + OMAP2_L4_IO_OFFSET)
201#define L4_44XX_SIZE SZ_4M
202
203#define L4_PER_44XX_PHYS L4_PER_44XX_BASE
204 /* 0x48000000 --> 0xfa000000 */
205#define L4_PER_44XX_VIRT (L4_PER_44XX_PHYS + OMAP2_L4_IO_OFFSET)
206#define L4_PER_44XX_SIZE SZ_4M
207
208#define L4_ABE_44XX_PHYS L4_ABE_44XX_BASE
209 /* 0x49000000 --> 0xfb000000 */
210#define L4_ABE_44XX_VIRT (L4_ABE_44XX_PHYS + OMAP2_L4_IO_OFFSET)
211#define L4_ABE_44XX_SIZE SZ_1M
212
213#define L4_EMU_44XX_PHYS L4_EMU_44XX_BASE
214 /* 0x54000000 --> 0xfe800000 */
215#define L4_EMU_44XX_VIRT (L4_EMU_44XX_PHYS + OMAP2_EMU_IO_OFFSET)
216#define L4_EMU_44XX_SIZE SZ_8M
217
218#define OMAP44XX_GPMC_PHYS OMAP44XX_GPMC_BASE
219 /* 0x50000000 --> 0xf9000000 */
220#define OMAP44XX_GPMC_VIRT (OMAP44XX_GPMC_PHYS + OMAP4_GPMC_IO_OFFSET)
221#define OMAP44XX_GPMC_SIZE SZ_1M
222
223
224#define OMAP44XX_EMIF1_PHYS OMAP44XX_EMIF1_BASE
225 /* 0x4c000000 --> 0xfd100000 */
226#define OMAP44XX_EMIF1_VIRT (OMAP44XX_EMIF1_PHYS + OMAP4_L3_PER_IO_OFFSET)
227#define OMAP44XX_EMIF1_SIZE SZ_1M
228
229#define OMAP44XX_EMIF2_PHYS OMAP44XX_EMIF2_BASE
230 /* 0x4d000000 --> 0xfd200000 */
231#define OMAP44XX_EMIF2_VIRT (OMAP44XX_EMIF2_PHYS + OMAP4_L3_PER_IO_OFFSET)
232#define OMAP44XX_EMIF2_SIZE SZ_1M
233
234#define OMAP44XX_DMM_PHYS OMAP44XX_DMM_BASE
235 /* 0x4e000000 --> 0xfd300000 */
236#define OMAP44XX_DMM_VIRT (OMAP44XX_DMM_PHYS + OMAP4_L3_PER_IO_OFFSET)
237#define OMAP44XX_DMM_SIZE SZ_1M
238/*
239 * ----------------------------------------------------------------------------
240 * Omap specific register access
241 * ----------------------------------------------------------------------------
242 */
243
244#ifndef __ASSEMBLER__
245
246/*
247 * NOTE: Please use ioremap + __raw_read/write where possible instead of these
248 */
249
250extern u8 omap_readb(u32 pa);
251extern u16 omap_readw(u32 pa);
252extern u32 omap_readl(u32 pa);
253extern void omap_writeb(u8 v, u32 pa);
254extern void omap_writew(u16 v, u32 pa);
255extern void omap_writel(u32 v, u32 pa);
256
257struct omap_sdrc_params;
258
259extern void omap1_map_common_io(void);
260extern void omap1_init_common_hw(void);
261
262#ifdef CONFIG_SOC_OMAP2420
263extern void omap242x_map_common_io(void);
264#else
265static inline void omap242x_map_common_io(void)
266{
267}
268#endif
269
270#ifdef CONFIG_SOC_OMAP2430
271extern void omap243x_map_common_io(void);
272#else
273static inline void omap243x_map_common_io(void)
274{
275}
276#endif
277
278#ifdef CONFIG_ARCH_OMAP3
279extern void omap34xx_map_common_io(void);
280#else
281static inline void omap34xx_map_common_io(void)
282{
283}
284#endif
285
286#ifdef CONFIG_SOC_OMAPTI816X
287extern void omapti816x_map_common_io(void);
288#else
289static inline void omapti816x_map_common_io(void)
290{
291}
292#endif
293
294#ifdef CONFIG_ARCH_OMAP4
295extern void omap44xx_map_common_io(void);
296#else
297static inline void omap44xx_map_common_io(void)
298{
299}
300#endif
301
302extern void omap2_init_common_infrastructure(void);
303extern void omap2_init_common_devices(struct omap_sdrc_params *sdrc_cs0,
304 struct omap_sdrc_params *sdrc_cs1);
305
306#define __arch_ioremap omap_ioremap
307#define __arch_iounmap omap_iounmap
308
309void __iomem *omap_ioremap(unsigned long phys, size_t size, unsigned int type);
310void omap_iounmap(volatile void __iomem *addr);
311
312#endif
313
314#endif
diff --git a/arch/arm/plat-omap/include/plat/iommu.h b/arch/arm/plat-omap/include/plat/iommu.h
new file mode 100644
index 00000000000..7a6ec98a08e
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/iommu.h
@@ -0,0 +1,180 @@
1/*
2 * omap iommu: main structures
3 *
4 * Copyright (C) 2008-2009 Nokia Corporation
5 *
6 * Written by Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#ifndef __MACH_IOMMU_H
14#define __MACH_IOMMU_H
15
16struct iotlb_entry {
17 u32 da;
18 u32 pa;
19 u32 pgsz, prsvd, valid;
20 union {
21 u16 ap;
22 struct {
23 u32 endian, elsz, mixed;
24 };
25 };
26};
27
28struct omap_iommu {
29 const char *name;
30 struct module *owner;
31 struct clk *clk;
32 void __iomem *regbase;
33 struct device *dev;
34 void *isr_priv;
35 struct iommu_domain *domain;
36
37 unsigned int refcount;
38 spinlock_t iommu_lock; /* global for this whole object */
39
40 /*
41 * We don't change iopgd for a situation like pgd for a task,
42 * but share it globally for each iommu.
43 */
44 u32 *iopgd;
45 spinlock_t page_table_lock; /* protect iopgd */
46
47 int nr_tlb_entries;
48
49 struct list_head mmap;
50 struct mutex mmap_lock; /* protect mmap */
51
52 void *ctx; /* iommu context: registres saved area */
53 u32 da_start;
54 u32 da_end;
55};
56
57struct cr_regs {
58 union {
59 struct {
60 u16 cam_l;
61 u16 cam_h;
62 };
63 u32 cam;
64 };
65 union {
66 struct {
67 u16 ram_l;
68 u16 ram_h;
69 };
70 u32 ram;
71 };
72};
73
74struct iotlb_lock {
75 short base;
76 short vict;
77};
78
79/* architecture specific functions */
80struct iommu_functions {
81 unsigned long version;
82
83 int (*enable)(struct omap_iommu *obj);
84 void (*disable)(struct omap_iommu *obj);
85 void (*set_twl)(struct omap_iommu *obj, bool on);
86 u32 (*fault_isr)(struct omap_iommu *obj, u32 *ra);
87
88 void (*tlb_read_cr)(struct omap_iommu *obj, struct cr_regs *cr);
89 void (*tlb_load_cr)(struct omap_iommu *obj, struct cr_regs *cr);
90
91 struct cr_regs *(*alloc_cr)(struct omap_iommu *obj,
92 struct iotlb_entry *e);
93 int (*cr_valid)(struct cr_regs *cr);
94 u32 (*cr_to_virt)(struct cr_regs *cr);
95 void (*cr_to_e)(struct cr_regs *cr, struct iotlb_entry *e);
96 ssize_t (*dump_cr)(struct omap_iommu *obj, struct cr_regs *cr,
97 char *buf);
98
99 u32 (*get_pte_attr)(struct iotlb_entry *e);
100
101 void (*save_ctx)(struct omap_iommu *obj);
102 void (*restore_ctx)(struct omap_iommu *obj);
103 ssize_t (*dump_ctx)(struct omap_iommu *obj, char *buf, ssize_t len);
104};
105
106struct iommu_platform_data {
107 const char *name;
108 const char *clk_name;
109 const int nr_tlb_entries;
110 u32 da_start;
111 u32 da_end;
112};
113
114/* IOMMU errors */
115#define OMAP_IOMMU_ERR_TLB_MISS (1 << 0)
116#define OMAP_IOMMU_ERR_TRANS_FAULT (1 << 1)
117#define OMAP_IOMMU_ERR_EMU_MISS (1 << 2)
118#define OMAP_IOMMU_ERR_TBLWALK_FAULT (1 << 3)
119#define OMAP_IOMMU_ERR_MULTIHIT_FAULT (1 << 4)
120
121#if defined(CONFIG_ARCH_OMAP1)
122#error "iommu for this processor not implemented yet"
123#else
124#include <plat/iommu2.h>
125#endif
126
127/*
128 * utilities for super page(16MB, 1MB, 64KB and 4KB)
129 */
130
131#define iopgsz_max(bytes) \
132 (((bytes) >= SZ_16M) ? SZ_16M : \
133 ((bytes) >= SZ_1M) ? SZ_1M : \
134 ((bytes) >= SZ_64K) ? SZ_64K : \
135 ((bytes) >= SZ_4K) ? SZ_4K : 0)
136
137#define bytes_to_iopgsz(bytes) \
138 (((bytes) == SZ_16M) ? MMU_CAM_PGSZ_16M : \
139 ((bytes) == SZ_1M) ? MMU_CAM_PGSZ_1M : \
140 ((bytes) == SZ_64K) ? MMU_CAM_PGSZ_64K : \
141 ((bytes) == SZ_4K) ? MMU_CAM_PGSZ_4K : -1)
142
143#define iopgsz_to_bytes(iopgsz) \
144 (((iopgsz) == MMU_CAM_PGSZ_16M) ? SZ_16M : \
145 ((iopgsz) == MMU_CAM_PGSZ_1M) ? SZ_1M : \
146 ((iopgsz) == MMU_CAM_PGSZ_64K) ? SZ_64K : \
147 ((iopgsz) == MMU_CAM_PGSZ_4K) ? SZ_4K : 0)
148
149#define iopgsz_ok(bytes) (bytes_to_iopgsz(bytes) >= 0)
150
151/*
152 * global functions
153 */
154extern u32 omap_iommu_arch_version(void);
155
156extern void omap_iotlb_cr_to_e(struct cr_regs *cr, struct iotlb_entry *e);
157
158extern int
159omap_iopgtable_store_entry(struct omap_iommu *obj, struct iotlb_entry *e);
160
161extern int omap_iommu_set_isr(const char *name,
162 int (*isr)(struct omap_iommu *obj, u32 da, u32 iommu_errs,
163 void *priv),
164 void *isr_priv);
165
166extern void omap_iommu_save_ctx(struct device *dev);
167extern void omap_iommu_restore_ctx(struct device *dev);
168
169extern int omap_install_iommu_arch(const struct iommu_functions *ops);
170extern void omap_uninstall_iommu_arch(const struct iommu_functions *ops);
171
172extern int omap_foreach_iommu_device(void *data,
173 int (*fn)(struct device *, void *));
174
175extern ssize_t
176omap_iommu_dump_ctx(struct omap_iommu *obj, char *buf, ssize_t len);
177extern size_t
178omap_dump_tlb_entries(struct omap_iommu *obj, char *buf, ssize_t len);
179
180#endif /* __MACH_IOMMU_H */
diff --git a/arch/arm/plat-omap/include/plat/iommu2.h b/arch/arm/plat-omap/include/plat/iommu2.h
new file mode 100644
index 00000000000..d4116b595e4
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/iommu2.h
@@ -0,0 +1,96 @@
1/*
2 * omap iommu: omap2 architecture specific definitions
3 *
4 * Copyright (C) 2008-2009 Nokia Corporation
5 *
6 * Written by Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#ifndef __MACH_IOMMU2_H
14#define __MACH_IOMMU2_H
15
16#include <linux/io.h>
17
18/*
19 * MMU Register offsets
20 */
21#define MMU_REVISION 0x00
22#define MMU_SYSCONFIG 0x10
23#define MMU_SYSSTATUS 0x14
24#define MMU_IRQSTATUS 0x18
25#define MMU_IRQENABLE 0x1c
26#define MMU_WALKING_ST 0x40
27#define MMU_CNTL 0x44
28#define MMU_FAULT_AD 0x48
29#define MMU_TTB 0x4c
30#define MMU_LOCK 0x50
31#define MMU_LD_TLB 0x54
32#define MMU_CAM 0x58
33#define MMU_RAM 0x5c
34#define MMU_GFLUSH 0x60
35#define MMU_FLUSH_ENTRY 0x64
36#define MMU_READ_CAM 0x68
37#define MMU_READ_RAM 0x6c
38#define MMU_EMU_FAULT_AD 0x70
39
40#define MMU_REG_SIZE 256
41
42/*
43 * MMU Register bit definitions
44 */
45#define MMU_LOCK_BASE_SHIFT 10
46#define MMU_LOCK_BASE_MASK (0x1f << MMU_LOCK_BASE_SHIFT)
47#define MMU_LOCK_BASE(x) \
48 ((x & MMU_LOCK_BASE_MASK) >> MMU_LOCK_BASE_SHIFT)
49
50#define MMU_LOCK_VICT_SHIFT 4
51#define MMU_LOCK_VICT_MASK (0x1f << MMU_LOCK_VICT_SHIFT)
52#define MMU_LOCK_VICT(x) \
53 ((x & MMU_LOCK_VICT_MASK) >> MMU_LOCK_VICT_SHIFT)
54
55#define MMU_CAM_VATAG_SHIFT 12
56#define MMU_CAM_VATAG_MASK \
57 ((~0UL >> MMU_CAM_VATAG_SHIFT) << MMU_CAM_VATAG_SHIFT)
58#define MMU_CAM_P (1 << 3)
59#define MMU_CAM_V (1 << 2)
60#define MMU_CAM_PGSZ_MASK 3
61#define MMU_CAM_PGSZ_1M (0 << 0)
62#define MMU_CAM_PGSZ_64K (1 << 0)
63#define MMU_CAM_PGSZ_4K (2 << 0)
64#define MMU_CAM_PGSZ_16M (3 << 0)
65
66#define MMU_RAM_PADDR_SHIFT 12
67#define MMU_RAM_PADDR_MASK \
68 ((~0UL >> MMU_RAM_PADDR_SHIFT) << MMU_RAM_PADDR_SHIFT)
69#define MMU_RAM_ENDIAN_SHIFT 9
70#define MMU_RAM_ENDIAN_MASK (1 << MMU_RAM_ENDIAN_SHIFT)
71#define MMU_RAM_ENDIAN_BIG (1 << MMU_RAM_ENDIAN_SHIFT)
72#define MMU_RAM_ENDIAN_LITTLE (0 << MMU_RAM_ENDIAN_SHIFT)
73#define MMU_RAM_ELSZ_SHIFT 7
74#define MMU_RAM_ELSZ_MASK (3 << MMU_RAM_ELSZ_SHIFT)
75#define MMU_RAM_ELSZ_8 (0 << MMU_RAM_ELSZ_SHIFT)
76#define MMU_RAM_ELSZ_16 (1 << MMU_RAM_ELSZ_SHIFT)
77#define MMU_RAM_ELSZ_32 (2 << MMU_RAM_ELSZ_SHIFT)
78#define MMU_RAM_ELSZ_NONE (3 << MMU_RAM_ELSZ_SHIFT)
79#define MMU_RAM_MIXED_SHIFT 6
80#define MMU_RAM_MIXED_MASK (1 << MMU_RAM_MIXED_SHIFT)
81#define MMU_RAM_MIXED MMU_RAM_MIXED_MASK
82
83/*
84 * register accessors
85 */
86static inline u32 iommu_read_reg(struct omap_iommu *obj, size_t offs)
87{
88 return __raw_readl(obj->regbase + offs);
89}
90
91static inline void iommu_write_reg(struct omap_iommu *obj, u32 val, size_t offs)
92{
93 __raw_writel(val, obj->regbase + offs);
94}
95
96#endif /* __MACH_IOMMU2_H */
diff --git a/arch/arm/plat-omap/include/plat/iopgtable.h b/arch/arm/plat-omap/include/plat/iopgtable.h
new file mode 100644
index 00000000000..e0c56aafc2e
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/iopgtable.h
@@ -0,0 +1,102 @@
1/*
2 * omap iommu: pagetable definitions
3 *
4 * Copyright (C) 2008-2010 Nokia Corporation
5 *
6 * Written by Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#ifndef __PLAT_OMAP_IOMMU_H
14#define __PLAT_OMAP_IOMMU_H
15
16/*
17 * "L2 table" address mask and size definitions.
18 */
19#define IOPGD_SHIFT 20
20#define IOPGD_SIZE (1UL << IOPGD_SHIFT)
21#define IOPGD_MASK (~(IOPGD_SIZE - 1))
22
23/*
24 * "section" address mask and size definitions.
25 */
26#define IOSECTION_SHIFT 20
27#define IOSECTION_SIZE (1UL << IOSECTION_SHIFT)
28#define IOSECTION_MASK (~(IOSECTION_SIZE - 1))
29
30/*
31 * "supersection" address mask and size definitions.
32 */
33#define IOSUPER_SHIFT 24
34#define IOSUPER_SIZE (1UL << IOSUPER_SHIFT)
35#define IOSUPER_MASK (~(IOSUPER_SIZE - 1))
36
37#define PTRS_PER_IOPGD (1UL << (32 - IOPGD_SHIFT))
38#define IOPGD_TABLE_SIZE (PTRS_PER_IOPGD * sizeof(u32))
39
40/*
41 * "small page" address mask and size definitions.
42 */
43#define IOPTE_SHIFT 12
44#define IOPTE_SIZE (1UL << IOPTE_SHIFT)
45#define IOPTE_MASK (~(IOPTE_SIZE - 1))
46
47/*
48 * "large page" address mask and size definitions.
49 */
50#define IOLARGE_SHIFT 16
51#define IOLARGE_SIZE (1UL << IOLARGE_SHIFT)
52#define IOLARGE_MASK (~(IOLARGE_SIZE - 1))
53
54#define PTRS_PER_IOPTE (1UL << (IOPGD_SHIFT - IOPTE_SHIFT))
55#define IOPTE_TABLE_SIZE (PTRS_PER_IOPTE * sizeof(u32))
56
57#define IOPAGE_MASK IOPTE_MASK
58
59/*
60 * some descriptor attributes.
61 */
62#define IOPGD_TABLE (1 << 0)
63#define IOPGD_SECTION (2 << 0)
64#define IOPGD_SUPER (1 << 18 | 2 << 0)
65
66#define iopgd_is_table(x) (((x) & 3) == IOPGD_TABLE)
67
68#define IOPTE_SMALL (2 << 0)
69#define IOPTE_LARGE (1 << 0)
70
71/* to find an entry in a page-table-directory */
72#define iopgd_index(da) (((da) >> IOPGD_SHIFT) & (PTRS_PER_IOPGD - 1))
73#define iopgd_offset(obj, da) ((obj)->iopgd + iopgd_index(da))
74
75#define iopgd_page_paddr(iopgd) (*iopgd & ~((1 << 10) - 1))
76#define iopgd_page_vaddr(iopgd) ((u32 *)phys_to_virt(iopgd_page_paddr(iopgd)))
77
78/* to find an entry in the second-level page table. */
79#define iopte_index(da) (((da) >> IOPTE_SHIFT) & (PTRS_PER_IOPTE - 1))
80#define iopte_offset(iopgd, da) (iopgd_page_vaddr(iopgd) + iopte_index(da))
81
82static inline u32 iotlb_init_entry(struct iotlb_entry *e, u32 da, u32 pa,
83 u32 flags)
84{
85 memset(e, 0, sizeof(*e));
86
87 e->da = da;
88 e->pa = pa;
89 e->valid = 1;
90 /* FIXME: add OMAP1 support */
91 e->pgsz = flags & MMU_CAM_PGSZ_MASK;
92 e->endian = flags & MMU_RAM_ENDIAN_MASK;
93 e->elsz = flags & MMU_RAM_ELSZ_MASK;
94 e->mixed = flags & MMU_RAM_MIXED_MASK;
95
96 return iopgsz_to_bytes(e->pgsz);
97}
98
99#define to_iommu(dev) \
100 (struct omap_iommu *)platform_get_drvdata(to_platform_device(dev))
101
102#endif /* __PLAT_OMAP_IOMMU_H */
diff --git a/arch/arm/plat-omap/include/plat/iovmm.h b/arch/arm/plat-omap/include/plat/iovmm.h
new file mode 100644
index 00000000000..498e57cda6c
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/iovmm.h
@@ -0,0 +1,89 @@
1/*
2 * omap iommu: simple virtual address space management
3 *
4 * Copyright (C) 2008-2009 Nokia Corporation
5 *
6 * Written by Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#ifndef __IOMMU_MMAP_H
14#define __IOMMU_MMAP_H
15
16#include <linux/iommu.h>
17
18struct iovm_struct {
19 struct omap_iommu *iommu; /* iommu object which this belongs to */
20 u32 da_start; /* area definition */
21 u32 da_end;
22 u32 flags; /* IOVMF_: see below */
23 struct list_head list; /* linked in ascending order */
24 const struct sg_table *sgt; /* keep 'page' <-> 'da' mapping */
25 void *va; /* mpu side mapped address */
26};
27
28/*
29 * IOVMF_FLAGS: attribute for iommu virtual memory area(iovma)
30 *
31 * lower 16 bit is used for h/w and upper 16 bit is for s/w.
32 */
33#define IOVMF_SW_SHIFT 16
34
35/*
36 * iovma: h/w flags derived from cam and ram attribute
37 */
38#define IOVMF_CAM_MASK (~((1 << 10) - 1))
39#define IOVMF_RAM_MASK (~IOVMF_CAM_MASK)
40
41#define IOVMF_PGSZ_MASK (3 << 0)
42#define IOVMF_PGSZ_1M MMU_CAM_PGSZ_1M
43#define IOVMF_PGSZ_64K MMU_CAM_PGSZ_64K
44#define IOVMF_PGSZ_4K MMU_CAM_PGSZ_4K
45#define IOVMF_PGSZ_16M MMU_CAM_PGSZ_16M
46
47#define IOVMF_ENDIAN_MASK (1 << 9)
48#define IOVMF_ENDIAN_BIG MMU_RAM_ENDIAN_BIG
49#define IOVMF_ENDIAN_LITTLE MMU_RAM_ENDIAN_LITTLE
50
51#define IOVMF_ELSZ_MASK (3 << 7)
52#define IOVMF_ELSZ_8 MMU_RAM_ELSZ_8
53#define IOVMF_ELSZ_16 MMU_RAM_ELSZ_16
54#define IOVMF_ELSZ_32 MMU_RAM_ELSZ_32
55#define IOVMF_ELSZ_NONE MMU_RAM_ELSZ_NONE
56
57#define IOVMF_MIXED_MASK (1 << 6)
58#define IOVMF_MIXED MMU_RAM_MIXED
59
60/*
61 * iovma: s/w flags, used for mapping and umapping internally.
62 */
63#define IOVMF_MMIO (1 << IOVMF_SW_SHIFT)
64#define IOVMF_ALLOC (2 << IOVMF_SW_SHIFT)
65#define IOVMF_ALLOC_MASK (3 << IOVMF_SW_SHIFT)
66
67/* "superpages" is supported just with physically linear pages */
68#define IOVMF_DISCONT (1 << (2 + IOVMF_SW_SHIFT))
69#define IOVMF_LINEAR (2 << (2 + IOVMF_SW_SHIFT))
70#define IOVMF_LINEAR_MASK (3 << (2 + IOVMF_SW_SHIFT))
71
72#define IOVMF_DA_FIXED (1 << (4 + IOVMF_SW_SHIFT))
73
74
75extern struct iovm_struct *omap_find_iovm_area(struct device *dev, u32 da);
76extern u32
77omap_iommu_vmap(struct iommu_domain *domain, struct device *dev, u32 da,
78 const struct sg_table *sgt, u32 flags);
79extern struct sg_table *omap_iommu_vunmap(struct iommu_domain *domain,
80 struct device *dev, u32 da);
81extern u32
82omap_iommu_vmalloc(struct iommu_domain *domain, struct device *dev,
83 u32 da, size_t bytes, u32 flags);
84extern void
85omap_iommu_vfree(struct iommu_domain *domain, struct device *dev,
86 const u32 da);
87extern void *omap_da_to_va(struct device *dev, u32 da);
88
89#endif /* __IOMMU_MMAP_H */
diff --git a/arch/arm/plat-omap/include/plat/irda.h b/arch/arm/plat-omap/include/plat/irda.h
new file mode 100644
index 00000000000..40f60339d1c
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/irda.h
@@ -0,0 +1,33 @@
1/*
2 * arch/arm/plat-omap/include/mach/irda.h
3 *
4 * Copyright (C) 2005-2006 Komal Shah <komal_shah802003@yahoo.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#ifndef ASMARM_ARCH_IRDA_H
11#define ASMARM_ARCH_IRDA_H
12
13/* board specific transceiver capabilities */
14
15#define IR_SEL 1 /* Selects IrDA */
16#define IR_SIRMODE 2
17#define IR_FIRMODE 4
18#define IR_MIRMODE 8
19
20struct omap_irda_config {
21 int transceiver_cap;
22 int (*transceiver_mode)(struct device *dev, int mode);
23 int (*select_irda)(struct device *dev, int state);
24 int rx_channel;
25 int tx_channel;
26 unsigned long dest_start;
27 unsigned long src_start;
28 int tx_trigger;
29 int rx_trigger;
30 int mode;
31};
32
33#endif
diff --git a/arch/arm/plat-omap/include/plat/irqs-44xx.h b/arch/arm/plat-omap/include/plat/irqs-44xx.h
new file mode 100644
index 00000000000..518322c8011
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/irqs-44xx.h
@@ -0,0 +1,144 @@
1/*
2 * OMAP4 Interrupt lines definitions
3 *
4 * Copyright (C) 2009-2010 Texas Instruments, Inc.
5 *
6 * Santosh Shilimkar (santosh.shilimkar@ti.com)
7 * Benoit Cousson (b-cousson@ti.com)
8 *
9 * This file is automatically generated from the OMAP hardware databases.
10 * We respectfully ask that any modifications to this file be coordinated
11 * with the public linux-omap@vger.kernel.org mailing list and the
12 * authors above to ensure that the autogeneration scripts are kept
13 * up-to-date with the file contents.
14 *
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License version 2 as
17 * published by the Free Software Foundation.
18 */
19
20#ifndef __ARCH_ARM_MACH_OMAP2_OMAP44XX_IRQS_H
21#define __ARCH_ARM_MACH_OMAP2_OMAP44XX_IRQS_H
22
23/* OMAP44XX IRQs numbers definitions */
24#define OMAP44XX_IRQ_LOCALTIMER 29
25#define OMAP44XX_IRQ_LOCALWDT 30
26
27#define OMAP44XX_IRQ_GIC_START 32
28
29#define OMAP44XX_IRQ_PL310 (0 + OMAP44XX_IRQ_GIC_START)
30#define OMAP44XX_IRQ_CTI0 (1 + OMAP44XX_IRQ_GIC_START)
31#define OMAP44XX_IRQ_CTI1 (2 + OMAP44XX_IRQ_GIC_START)
32#define OMAP44XX_IRQ_ELM (4 + OMAP44XX_IRQ_GIC_START)
33#define OMAP44XX_IRQ_SYS_1N (7 + OMAP44XX_IRQ_GIC_START)
34#define OMAP44XX_IRQ_SECURITY_EVENTS (8 + OMAP44XX_IRQ_GIC_START)
35#define OMAP44XX_IRQ_L3_DBG (9 + OMAP44XX_IRQ_GIC_START)
36#define OMAP44XX_IRQ_L3_APP (10 + OMAP44XX_IRQ_GIC_START)
37#define OMAP44XX_IRQ_PRCM (11 + OMAP44XX_IRQ_GIC_START)
38#define OMAP44XX_IRQ_SDMA_0 (12 + OMAP44XX_IRQ_GIC_START)
39#define OMAP44XX_IRQ_SDMA_1 (13 + OMAP44XX_IRQ_GIC_START)
40#define OMAP44XX_IRQ_SDMA_2 (14 + OMAP44XX_IRQ_GIC_START)
41#define OMAP44XX_IRQ_SDMA_3 (15 + OMAP44XX_IRQ_GIC_START)
42#define OMAP44XX_IRQ_MCBSP4 (16 + OMAP44XX_IRQ_GIC_START)
43#define OMAP44XX_IRQ_MCBSP1 (17 + OMAP44XX_IRQ_GIC_START)
44#define OMAP44XX_IRQ_SR_MCU (18 + OMAP44XX_IRQ_GIC_START)
45#define OMAP44XX_IRQ_SR_CORE (19 + OMAP44XX_IRQ_GIC_START)
46#define OMAP44XX_IRQ_GPMC (20 + OMAP44XX_IRQ_GIC_START)
47#define OMAP44XX_IRQ_GFX (21 + OMAP44XX_IRQ_GIC_START)
48#define OMAP44XX_IRQ_MCBSP2 (22 + OMAP44XX_IRQ_GIC_START)
49#define OMAP44XX_IRQ_MCBSP3 (23 + OMAP44XX_IRQ_GIC_START)
50#define OMAP44XX_IRQ_ISS_5 (24 + OMAP44XX_IRQ_GIC_START)
51#define OMAP44XX_IRQ_DSS_DISPC (25 + OMAP44XX_IRQ_GIC_START)
52#define OMAP44XX_IRQ_MAIL_U0 (26 + OMAP44XX_IRQ_GIC_START)
53#define OMAP44XX_IRQ_C2C_SSCM_0 (27 + OMAP44XX_IRQ_GIC_START)
54#define OMAP44XX_IRQ_TESLA_MMU (28 + OMAP44XX_IRQ_GIC_START)
55#define OMAP44XX_IRQ_GPIO1 (29 + OMAP44XX_IRQ_GIC_START)
56#define OMAP44XX_IRQ_GPIO2 (30 + OMAP44XX_IRQ_GIC_START)
57#define OMAP44XX_IRQ_GPIO3 (31 + OMAP44XX_IRQ_GIC_START)
58#define OMAP44XX_IRQ_GPIO4 (32 + OMAP44XX_IRQ_GIC_START)
59#define OMAP44XX_IRQ_GPIO5 (33 + OMAP44XX_IRQ_GIC_START)
60#define OMAP44XX_IRQ_GPIO6 (34 + OMAP44XX_IRQ_GIC_START)
61#define OMAP44XX_IRQ_USIM (35 + OMAP44XX_IRQ_GIC_START)
62#define OMAP44XX_IRQ_WDT3 (36 + OMAP44XX_IRQ_GIC_START)
63#define OMAP44XX_IRQ_GPT1 (37 + OMAP44XX_IRQ_GIC_START)
64#define OMAP44XX_IRQ_GPT2 (38 + OMAP44XX_IRQ_GIC_START)
65#define OMAP44XX_IRQ_GPT3 (39 + OMAP44XX_IRQ_GIC_START)
66#define OMAP44XX_IRQ_GPT4 (40 + OMAP44XX_IRQ_GIC_START)
67#define OMAP44XX_IRQ_GPT5 (41 + OMAP44XX_IRQ_GIC_START)
68#define OMAP44XX_IRQ_GPT6 (42 + OMAP44XX_IRQ_GIC_START)
69#define OMAP44XX_IRQ_GPT7 (43 + OMAP44XX_IRQ_GIC_START)
70#define OMAP44XX_IRQ_GPT8 (44 + OMAP44XX_IRQ_GIC_START)
71#define OMAP44XX_IRQ_GPT9 (45 + OMAP44XX_IRQ_GIC_START)
72#define OMAP44XX_IRQ_GPT10 (46 + OMAP44XX_IRQ_GIC_START)
73#define OMAP44XX_IRQ_GPT11 (47 + OMAP44XX_IRQ_GIC_START)
74#define OMAP44XX_IRQ_SPI4 (48 + OMAP44XX_IRQ_GIC_START)
75#define OMAP44XX_IRQ_SHA1_S (49 + OMAP44XX_IRQ_GIC_START)
76#define OMAP44XX_IRQ_FPKA_SINTREQUEST_S (50 + OMAP44XX_IRQ_GIC_START)
77#define OMAP44XX_IRQ_SHA1_P (51 + OMAP44XX_IRQ_GIC_START)
78#define OMAP44XX_IRQ_RNG (52 + OMAP44XX_IRQ_GIC_START)
79#define OMAP44XX_IRQ_DSS_DSI1 (53 + OMAP44XX_IRQ_GIC_START)
80#define OMAP44XX_IRQ_I2C1 (56 + OMAP44XX_IRQ_GIC_START)
81#define OMAP44XX_IRQ_I2C2 (57 + OMAP44XX_IRQ_GIC_START)
82#define OMAP44XX_IRQ_HDQ (58 + OMAP44XX_IRQ_GIC_START)
83#define OMAP44XX_IRQ_MMC5 (59 + OMAP44XX_IRQ_GIC_START)
84#define OMAP44XX_IRQ_I2C3 (61 + OMAP44XX_IRQ_GIC_START)
85#define OMAP44XX_IRQ_I2C4 (62 + OMAP44XX_IRQ_GIC_START)
86#define OMAP44XX_IRQ_AES2_S (63 + OMAP44XX_IRQ_GIC_START)
87#define OMAP44XX_IRQ_AES2_P (64 + OMAP44XX_IRQ_GIC_START)
88#define OMAP44XX_IRQ_SPI1 (65 + OMAP44XX_IRQ_GIC_START)
89#define OMAP44XX_IRQ_SPI2 (66 + OMAP44XX_IRQ_GIC_START)
90#define OMAP44XX_IRQ_HSI_P1 (67 + OMAP44XX_IRQ_GIC_START)
91#define OMAP44XX_IRQ_HSI_P2 (68 + OMAP44XX_IRQ_GIC_START)
92#define OMAP44XX_IRQ_FDIF_3 (69 + OMAP44XX_IRQ_GIC_START)
93#define OMAP44XX_IRQ_UART4 (70 + OMAP44XX_IRQ_GIC_START)
94#define OMAP44XX_IRQ_HSI_DMA (71 + OMAP44XX_IRQ_GIC_START)
95#define OMAP44XX_IRQ_UART1 (72 + OMAP44XX_IRQ_GIC_START)
96#define OMAP44XX_IRQ_UART2 (73 + OMAP44XX_IRQ_GIC_START)
97#define OMAP44XX_IRQ_UART3 (74 + OMAP44XX_IRQ_GIC_START)
98#define OMAP44XX_IRQ_PBIAS (75 + OMAP44XX_IRQ_GIC_START)
99#define OMAP44XX_IRQ_OHCI (76 + OMAP44XX_IRQ_GIC_START)
100#define OMAP44XX_IRQ_EHCI (77 + OMAP44XX_IRQ_GIC_START)
101#define OMAP44XX_IRQ_TLL (78 + OMAP44XX_IRQ_GIC_START)
102#define OMAP44XX_IRQ_AES1_S (79 + OMAP44XX_IRQ_GIC_START)
103#define OMAP44XX_IRQ_WDT2 (80 + OMAP44XX_IRQ_GIC_START)
104#define OMAP44XX_IRQ_DES_S (81 + OMAP44XX_IRQ_GIC_START)
105#define OMAP44XX_IRQ_DES_P (82 + OMAP44XX_IRQ_GIC_START)
106#define OMAP44XX_IRQ_MMC1 (83 + OMAP44XX_IRQ_GIC_START)
107#define OMAP44XX_IRQ_DSS_DSI2 (84 + OMAP44XX_IRQ_GIC_START)
108#define OMAP44XX_IRQ_AES1_P (85 + OMAP44XX_IRQ_GIC_START)
109#define OMAP44XX_IRQ_MMC2 (86 + OMAP44XX_IRQ_GIC_START)
110#define OMAP44XX_IRQ_MPU_ICR (87 + OMAP44XX_IRQ_GIC_START)
111#define OMAP44XX_IRQ_C2C_SSCM_1 (88 + OMAP44XX_IRQ_GIC_START)
112#define OMAP44XX_IRQ_FSUSB (89 + OMAP44XX_IRQ_GIC_START)
113#define OMAP44XX_IRQ_FSUSB_SMI (90 + OMAP44XX_IRQ_GIC_START)
114#define OMAP44XX_IRQ_SPI3 (91 + OMAP44XX_IRQ_GIC_START)
115#define OMAP44XX_IRQ_HS_USB_MC_N (92 + OMAP44XX_IRQ_GIC_START)
116#define OMAP44XX_IRQ_HS_USB_DMA_N (93 + OMAP44XX_IRQ_GIC_START)
117#define OMAP44XX_IRQ_MMC3 (94 + OMAP44XX_IRQ_GIC_START)
118#define OMAP44XX_IRQ_GPT12 (95 + OMAP44XX_IRQ_GIC_START)
119#define OMAP44XX_IRQ_MMC4 (96 + OMAP44XX_IRQ_GIC_START)
120#define OMAP44XX_IRQ_SLIMBUS1 (97 + OMAP44XX_IRQ_GIC_START)
121#define OMAP44XX_IRQ_SLIMBUS2 (98 + OMAP44XX_IRQ_GIC_START)
122#define OMAP44XX_IRQ_ABE (99 + OMAP44XX_IRQ_GIC_START)
123#define OMAP44XX_IRQ_DUCATI_MMU (100 + OMAP44XX_IRQ_GIC_START)
124#define OMAP44XX_IRQ_DSS_HDMI (101 + OMAP44XX_IRQ_GIC_START)
125#define OMAP44XX_IRQ_SR_IVA (102 + OMAP44XX_IRQ_GIC_START)
126#define OMAP44XX_IRQ_IVA_HD_POSYNCITRPEND_1 (103 + OMAP44XX_IRQ_GIC_START)
127#define OMAP44XX_IRQ_IVA_HD_POSYNCITRPEND_0 (104 + OMAP44XX_IRQ_GIC_START)
128#define OMAP44XX_IRQ_IVA_HD_POMBINTRPEND_0 (107 + OMAP44XX_IRQ_GIC_START)
129#define OMAP44XX_IRQ_MCASP1_AR (108 + OMAP44XX_IRQ_GIC_START)
130#define OMAP44XX_IRQ_MCASP1_AX (109 + OMAP44XX_IRQ_GIC_START)
131#define OMAP44XX_IRQ_EMIF4_1 (110 + OMAP44XX_IRQ_GIC_START)
132#define OMAP44XX_IRQ_EMIF4_2 (111 + OMAP44XX_IRQ_GIC_START)
133#define OMAP44XX_IRQ_MCPDM (112 + OMAP44XX_IRQ_GIC_START)
134#define OMAP44XX_IRQ_DMM (113 + OMAP44XX_IRQ_GIC_START)
135#define OMAP44XX_IRQ_DMIC (114 + OMAP44XX_IRQ_GIC_START)
136#define OMAP44XX_IRQ_CDMA_0 (115 + OMAP44XX_IRQ_GIC_START)
137#define OMAP44XX_IRQ_CDMA_1 (116 + OMAP44XX_IRQ_GIC_START)
138#define OMAP44XX_IRQ_CDMA_2 (117 + OMAP44XX_IRQ_GIC_START)
139#define OMAP44XX_IRQ_CDMA_3 (118 + OMAP44XX_IRQ_GIC_START)
140#define OMAP44XX_IRQ_SYS_2N (119 + OMAP44XX_IRQ_GIC_START)
141#define OMAP44XX_IRQ_KBD_CTL (120 + OMAP44XX_IRQ_GIC_START)
142#define OMAP44XX_IRQ_UNIPRO1 (124 + OMAP44XX_IRQ_GIC_START)
143
144#endif
diff --git a/arch/arm/plat-omap/include/plat/irqs.h b/arch/arm/plat-omap/include/plat/irqs.h
new file mode 100644
index 00000000000..30e10719b77
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/irqs.h
@@ -0,0 +1,459 @@
1/*
2 * arch/arm/plat-omap/include/mach/irqs.h
3 *
4 * Copyright (C) Greg Lonnon 2001
5 * Updated for OMAP-1610 by Tony Lindgren <tony@atomide.com>
6 *
7 * Copyright (C) 2009 Texas Instruments
8 * Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 *
24 * NOTE: The interrupt vectors for the OMAP-1509, OMAP-1510, and OMAP-1610
25 * are different.
26 */
27
28#ifndef __ASM_ARCH_OMAP15XX_IRQS_H
29#define __ASM_ARCH_OMAP15XX_IRQS_H
30
31/* All OMAP4 specific defines are moved to irqs-44xx.h */
32#include "irqs-44xx.h"
33
34/*
35 * IRQ numbers for interrupt handler 1
36 *
37 * NOTE: See also the OMAP-1510 and 1610 specific IRQ numbers below
38 *
39 */
40#define INT_CAMERA 1
41#define INT_FIQ 3
42#define INT_RTDX 6
43#define INT_DSP_MMU_ABORT 7
44#define INT_HOST 8
45#define INT_ABORT 9
46#define INT_BRIDGE_PRIV 13
47#define INT_GPIO_BANK1 14
48#define INT_UART3 15
49#define INT_TIMER3 16
50#define INT_DMA_CH0_6 19
51#define INT_DMA_CH1_7 20
52#define INT_DMA_CH2_8 21
53#define INT_DMA_CH3 22
54#define INT_DMA_CH4 23
55#define INT_DMA_CH5 24
56#define INT_DMA_LCD 25
57#define INT_TIMER1 26
58#define INT_WD_TIMER 27
59#define INT_BRIDGE_PUB 28
60#define INT_TIMER2 30
61#define INT_LCD_CTRL 31
62
63/*
64 * OMAP-1510 specific IRQ numbers for interrupt handler 1
65 */
66#define INT_1510_IH2_IRQ 0
67#define INT_1510_RES2 2
68#define INT_1510_SPI_TX 4
69#define INT_1510_SPI_RX 5
70#define INT_1510_DSP_MAILBOX1 10
71#define INT_1510_DSP_MAILBOX2 11
72#define INT_1510_RES12 12
73#define INT_1510_LB_MMU 17
74#define INT_1510_RES18 18
75#define INT_1510_LOCAL_BUS 29
76
77/*
78 * OMAP-1610 specific IRQ numbers for interrupt handler 1
79 */
80#define INT_1610_IH2_IRQ INT_1510_IH2_IRQ
81#define INT_1610_IH2_FIQ 2
82#define INT_1610_McBSP2_TX 4
83#define INT_1610_McBSP2_RX 5
84#define INT_1610_DSP_MAILBOX1 10
85#define INT_1610_DSP_MAILBOX2 11
86#define INT_1610_LCD_LINE 12
87#define INT_1610_GPTIMER1 17
88#define INT_1610_GPTIMER2 18
89#define INT_1610_SSR_FIFO_0 29
90
91/*
92 * OMAP-7xx specific IRQ numbers for interrupt handler 1
93 */
94#define INT_7XX_IH2_FIQ 0
95#define INT_7XX_IH2_IRQ 1
96#define INT_7XX_USB_NON_ISO 2
97#define INT_7XX_USB_ISO 3
98#define INT_7XX_ICR 4
99#define INT_7XX_EAC 5
100#define INT_7XX_GPIO_BANK1 6
101#define INT_7XX_GPIO_BANK2 7
102#define INT_7XX_GPIO_BANK3 8
103#define INT_7XX_McBSP2TX 10
104#define INT_7XX_McBSP2RX 11
105#define INT_7XX_McBSP2RX_OVF 12
106#define INT_7XX_LCD_LINE 14
107#define INT_7XX_GSM_PROTECT 15
108#define INT_7XX_TIMER3 16
109#define INT_7XX_GPIO_BANK5 17
110#define INT_7XX_GPIO_BANK6 18
111#define INT_7XX_SPGIO_WR 29
112
113/*
114 * IRQ numbers for interrupt handler 2
115 *
116 * NOTE: See also the OMAP-1510 and 1610 specific IRQ numbers below
117 */
118#define IH2_BASE 32
119
120#define INT_KEYBOARD (1 + IH2_BASE)
121#define INT_uWireTX (2 + IH2_BASE)
122#define INT_uWireRX (3 + IH2_BASE)
123#define INT_I2C (4 + IH2_BASE)
124#define INT_MPUIO (5 + IH2_BASE)
125#define INT_USB_HHC_1 (6 + IH2_BASE)
126#define INT_McBSP3TX (10 + IH2_BASE)
127#define INT_McBSP3RX (11 + IH2_BASE)
128#define INT_McBSP1TX (12 + IH2_BASE)
129#define INT_McBSP1RX (13 + IH2_BASE)
130#define INT_UART1 (14 + IH2_BASE)
131#define INT_UART2 (15 + IH2_BASE)
132#define INT_BT_MCSI1TX (16 + IH2_BASE)
133#define INT_BT_MCSI1RX (17 + IH2_BASE)
134#define INT_SOSSI_MATCH (19 + IH2_BASE)
135#define INT_USB_W2FC (20 + IH2_BASE)
136#define INT_1WIRE (21 + IH2_BASE)
137#define INT_OS_TIMER (22 + IH2_BASE)
138#define INT_MMC (23 + IH2_BASE)
139#define INT_GAUGE_32K (24 + IH2_BASE)
140#define INT_RTC_TIMER (25 + IH2_BASE)
141#define INT_RTC_ALARM (26 + IH2_BASE)
142#define INT_MEM_STICK (27 + IH2_BASE)
143
144/*
145 * OMAP-1510 specific IRQ numbers for interrupt handler 2
146 */
147#define INT_1510_DSP_MMU (28 + IH2_BASE)
148#define INT_1510_COM_SPI_RO (31 + IH2_BASE)
149
150/*
151 * OMAP-1610 specific IRQ numbers for interrupt handler 2
152 */
153#define INT_1610_FAC (0 + IH2_BASE)
154#define INT_1610_USB_HHC_2 (7 + IH2_BASE)
155#define INT_1610_USB_OTG (8 + IH2_BASE)
156#define INT_1610_SoSSI (9 + IH2_BASE)
157#define INT_1610_SoSSI_MATCH (19 + IH2_BASE)
158#define INT_1610_DSP_MMU (28 + IH2_BASE)
159#define INT_1610_McBSP2RX_OF (31 + IH2_BASE)
160#define INT_1610_STI (32 + IH2_BASE)
161#define INT_1610_STI_WAKEUP (33 + IH2_BASE)
162#define INT_1610_GPTIMER3 (34 + IH2_BASE)
163#define INT_1610_GPTIMER4 (35 + IH2_BASE)
164#define INT_1610_GPTIMER5 (36 + IH2_BASE)
165#define INT_1610_GPTIMER6 (37 + IH2_BASE)
166#define INT_1610_GPTIMER7 (38 + IH2_BASE)
167#define INT_1610_GPTIMER8 (39 + IH2_BASE)
168#define INT_1610_GPIO_BANK2 (40 + IH2_BASE)
169#define INT_1610_GPIO_BANK3 (41 + IH2_BASE)
170#define INT_1610_MMC2 (42 + IH2_BASE)
171#define INT_1610_CF (43 + IH2_BASE)
172#define INT_1610_WAKE_UP_REQ (46 + IH2_BASE)
173#define INT_1610_GPIO_BANK4 (48 + IH2_BASE)
174#define INT_1610_SPI (49 + IH2_BASE)
175#define INT_1610_DMA_CH6 (53 + IH2_BASE)
176#define INT_1610_DMA_CH7 (54 + IH2_BASE)
177#define INT_1610_DMA_CH8 (55 + IH2_BASE)
178#define INT_1610_DMA_CH9 (56 + IH2_BASE)
179#define INT_1610_DMA_CH10 (57 + IH2_BASE)
180#define INT_1610_DMA_CH11 (58 + IH2_BASE)
181#define INT_1610_DMA_CH12 (59 + IH2_BASE)
182#define INT_1610_DMA_CH13 (60 + IH2_BASE)
183#define INT_1610_DMA_CH14 (61 + IH2_BASE)
184#define INT_1610_DMA_CH15 (62 + IH2_BASE)
185#define INT_1610_NAND (63 + IH2_BASE)
186#define INT_1610_SHA1MD5 (91 + IH2_BASE)
187
188/*
189 * OMAP-7xx specific IRQ numbers for interrupt handler 2
190 */
191#define INT_7XX_HW_ERRORS (0 + IH2_BASE)
192#define INT_7XX_NFIQ_PWR_FAIL (1 + IH2_BASE)
193#define INT_7XX_CFCD (2 + IH2_BASE)
194#define INT_7XX_CFIREQ (3 + IH2_BASE)
195#define INT_7XX_I2C (4 + IH2_BASE)
196#define INT_7XX_PCC (5 + IH2_BASE)
197#define INT_7XX_MPU_EXT_NIRQ (6 + IH2_BASE)
198#define INT_7XX_SPI_100K_1 (7 + IH2_BASE)
199#define INT_7XX_SYREN_SPI (8 + IH2_BASE)
200#define INT_7XX_VLYNQ (9 + IH2_BASE)
201#define INT_7XX_GPIO_BANK4 (10 + IH2_BASE)
202#define INT_7XX_McBSP1TX (11 + IH2_BASE)
203#define INT_7XX_McBSP1RX (12 + IH2_BASE)
204#define INT_7XX_McBSP1RX_OF (13 + IH2_BASE)
205#define INT_7XX_UART_MODEM_IRDA_2 (14 + IH2_BASE)
206#define INT_7XX_UART_MODEM_1 (15 + IH2_BASE)
207#define INT_7XX_MCSI (16 + IH2_BASE)
208#define INT_7XX_uWireTX (17 + IH2_BASE)
209#define INT_7XX_uWireRX (18 + IH2_BASE)
210#define INT_7XX_SMC_CD (19 + IH2_BASE)
211#define INT_7XX_SMC_IREQ (20 + IH2_BASE)
212#define INT_7XX_HDQ_1WIRE (21 + IH2_BASE)
213#define INT_7XX_TIMER32K (22 + IH2_BASE)
214#define INT_7XX_MMC_SDIO (23 + IH2_BASE)
215#define INT_7XX_UPLD (24 + IH2_BASE)
216#define INT_7XX_USB_HHC_1 (27 + IH2_BASE)
217#define INT_7XX_USB_HHC_2 (28 + IH2_BASE)
218#define INT_7XX_USB_GENI (29 + IH2_BASE)
219#define INT_7XX_USB_OTG (30 + IH2_BASE)
220#define INT_7XX_CAMERA_IF (31 + IH2_BASE)
221#define INT_7XX_RNG (32 + IH2_BASE)
222#define INT_7XX_DUAL_MODE_TIMER (33 + IH2_BASE)
223#define INT_7XX_DBB_RF_EN (34 + IH2_BASE)
224#define INT_7XX_MPUIO_KEYPAD (35 + IH2_BASE)
225#define INT_7XX_SHA1_MD5 (36 + IH2_BASE)
226#define INT_7XX_SPI_100K_2 (37 + IH2_BASE)
227#define INT_7XX_RNG_IDLE (38 + IH2_BASE)
228#define INT_7XX_MPUIO (39 + IH2_BASE)
229#define INT_7XX_LLPC_LCD_CTRL_CAN_BE_OFF (40 + IH2_BASE)
230#define INT_7XX_LLPC_OE_FALLING (41 + IH2_BASE)
231#define INT_7XX_LLPC_OE_RISING (42 + IH2_BASE)
232#define INT_7XX_LLPC_VSYNC (43 + IH2_BASE)
233#define INT_7XX_WAKE_UP_REQ (46 + IH2_BASE)
234#define INT_7XX_DMA_CH6 (53 + IH2_BASE)
235#define INT_7XX_DMA_CH7 (54 + IH2_BASE)
236#define INT_7XX_DMA_CH8 (55 + IH2_BASE)
237#define INT_7XX_DMA_CH9 (56 + IH2_BASE)
238#define INT_7XX_DMA_CH10 (57 + IH2_BASE)
239#define INT_7XX_DMA_CH11 (58 + IH2_BASE)
240#define INT_7XX_DMA_CH12 (59 + IH2_BASE)
241#define INT_7XX_DMA_CH13 (60 + IH2_BASE)
242#define INT_7XX_DMA_CH14 (61 + IH2_BASE)
243#define INT_7XX_DMA_CH15 (62 + IH2_BASE)
244#define INT_7XX_NAND (63 + IH2_BASE)
245
246#define INT_24XX_SYS_NIRQ 7
247#define INT_24XX_SDMA_IRQ0 12
248#define INT_24XX_SDMA_IRQ1 13
249#define INT_24XX_SDMA_IRQ2 14
250#define INT_24XX_SDMA_IRQ3 15
251#define INT_24XX_CAM_IRQ 24
252#define INT_24XX_DSS_IRQ 25
253#define INT_24XX_MAIL_U0_MPU 26
254#define INT_24XX_DSP_UMA 27
255#define INT_24XX_DSP_MMU 28
256#define INT_24XX_GPIO_BANK1 29
257#define INT_24XX_GPIO_BANK2 30
258#define INT_24XX_GPIO_BANK3 31
259#define INT_24XX_GPIO_BANK4 32
260#define INT_24XX_GPIO_BANK5 33
261#define INT_24XX_MAIL_U3_MPU 34
262#define INT_24XX_GPTIMER1 37
263#define INT_24XX_GPTIMER2 38
264#define INT_24XX_GPTIMER3 39
265#define INT_24XX_GPTIMER4 40
266#define INT_24XX_GPTIMER5 41
267#define INT_24XX_GPTIMER6 42
268#define INT_24XX_GPTIMER7 43
269#define INT_24XX_GPTIMER8 44
270#define INT_24XX_GPTIMER9 45
271#define INT_24XX_GPTIMER10 46
272#define INT_24XX_GPTIMER11 47
273#define INT_24XX_GPTIMER12 48
274#define INT_24XX_SHA1MD5 51
275#define INT_24XX_MCBSP4_IRQ_TX 54
276#define INT_24XX_MCBSP4_IRQ_RX 55
277#define INT_24XX_I2C1_IRQ 56
278#define INT_24XX_I2C2_IRQ 57
279#define INT_24XX_HDQ_IRQ 58
280#define INT_24XX_MCBSP1_IRQ_TX 59
281#define INT_24XX_MCBSP1_IRQ_RX 60
282#define INT_24XX_MCBSP2_IRQ_TX 62
283#define INT_24XX_MCBSP2_IRQ_RX 63
284#define INT_24XX_SPI1_IRQ 65
285#define INT_24XX_SPI2_IRQ 66
286#define INT_24XX_UART1_IRQ 72
287#define INT_24XX_UART2_IRQ 73
288#define INT_24XX_UART3_IRQ 74
289#define INT_24XX_USB_IRQ_GEN 75
290#define INT_24XX_USB_IRQ_NISO 76
291#define INT_24XX_USB_IRQ_ISO 77
292#define INT_24XX_USB_IRQ_HGEN 78
293#define INT_24XX_USB_IRQ_HSOF 79
294#define INT_24XX_USB_IRQ_OTG 80
295#define INT_24XX_MCBSP5_IRQ_TX 81
296#define INT_24XX_MCBSP5_IRQ_RX 82
297#define INT_24XX_MMC_IRQ 83
298#define INT_24XX_MMC2_IRQ 86
299#define INT_24XX_MCBSP3_IRQ_TX 89
300#define INT_24XX_MCBSP3_IRQ_RX 90
301#define INT_24XX_SPI3_IRQ 91
302
303#define INT_243X_MCBSP2_IRQ 16
304#define INT_243X_MCBSP3_IRQ 17
305#define INT_243X_MCBSP4_IRQ 18
306#define INT_243X_MCBSP5_IRQ 19
307#define INT_243X_MCBSP1_IRQ 64
308#define INT_243X_HS_USB_MC 92
309#define INT_243X_HS_USB_DMA 93
310#define INT_243X_CARKIT_IRQ 94
311
312#define INT_34XX_BENCH_MPU_EMUL 3
313#define INT_34XX_ST_MCBSP2_IRQ 4
314#define INT_34XX_ST_MCBSP3_IRQ 5
315#define INT_34XX_SSM_ABORT_IRQ 6
316#define INT_34XX_SYS_NIRQ 7
317#define INT_34XX_D2D_FW_IRQ 8
318#define INT_34XX_L3_DBG_IRQ 9
319#define INT_34XX_L3_APP_IRQ 10
320#define INT_34XX_PRCM_MPU_IRQ 11
321#define INT_34XX_MCBSP1_IRQ 16
322#define INT_34XX_MCBSP2_IRQ 17
323#define INT_34XX_GPMC_IRQ 20
324#define INT_34XX_MCBSP3_IRQ 22
325#define INT_34XX_MCBSP4_IRQ 23
326#define INT_34XX_CAM_IRQ 24
327#define INT_34XX_MCBSP5_IRQ 27
328#define INT_34XX_GPIO_BANK1 29
329#define INT_34XX_GPIO_BANK2 30
330#define INT_34XX_GPIO_BANK3 31
331#define INT_34XX_GPIO_BANK4 32
332#define INT_34XX_GPIO_BANK5 33
333#define INT_34XX_GPIO_BANK6 34
334#define INT_34XX_USIM_IRQ 35
335#define INT_34XX_WDT3_IRQ 36
336#define INT_34XX_SPI4_IRQ 48
337#define INT_34XX_SHA1MD52_IRQ 49
338#define INT_34XX_FPKA_READY_IRQ 50
339#define INT_34XX_SHA1MD51_IRQ 51
340#define INT_34XX_RNG_IRQ 52
341#define INT_34XX_I2C3_IRQ 61
342#define INT_34XX_FPKA_ERROR_IRQ 64
343#define INT_34XX_PBIAS_IRQ 75
344#define INT_34XX_OHCI_IRQ 76
345#define INT_34XX_EHCI_IRQ 77
346#define INT_34XX_TLL_IRQ 78
347#define INT_34XX_PARTHASH_IRQ 79
348#define INT_34XX_MMC3_IRQ 94
349#define INT_34XX_GPT12_IRQ 95
350
351#define INT_36XX_UART4_IRQ 80
352
353#define INT_35XX_HECC0_IRQ 24
354#define INT_35XX_HECC1_IRQ 28
355#define INT_35XX_EMAC_C0_RXTHRESH_IRQ 67
356#define INT_35XX_EMAC_C0_RX_PULSE_IRQ 68
357#define INT_35XX_EMAC_C0_TX_PULSE_IRQ 69
358#define INT_35XX_EMAC_C0_MISC_PULSE_IRQ 70
359#define INT_35XX_USBOTG_IRQ 71
360#define INT_35XX_UART4 84
361#define INT_35XX_CCDC_VD0_IRQ 88
362#define INT_35XX_CCDC_VD1_IRQ 92
363#define INT_35XX_CCDC_VD2_IRQ 93
364
365/* Max. 128 level 2 IRQs (OMAP1610), 192 GPIOs (OMAP730/850) and
366 * 16 MPUIO lines */
367#define OMAP_MAX_GPIO_LINES 192
368#define IH_GPIO_BASE (128 + IH2_BASE)
369#define IH_MPUIO_BASE (OMAP_MAX_GPIO_LINES + IH_GPIO_BASE)
370#define OMAP_IRQ_END (IH_MPUIO_BASE + 16)
371
372/* External FPGA handles interrupts on Innovator boards */
373#define OMAP_FPGA_IRQ_BASE (OMAP_IRQ_END)
374#ifdef CONFIG_MACH_OMAP_INNOVATOR
375#define OMAP_FPGA_NR_IRQS 24
376#else
377#define OMAP_FPGA_NR_IRQS 0
378#endif
379#define OMAP_FPGA_IRQ_END (OMAP_FPGA_IRQ_BASE + OMAP_FPGA_NR_IRQS)
380
381/* External TWL4030 can handle interrupts on 2430 and 34xx boards */
382#define TWL4030_IRQ_BASE (OMAP_FPGA_IRQ_END)
383#ifdef CONFIG_TWL4030_CORE
384#define TWL4030_BASE_NR_IRQS 8
385#define TWL4030_PWR_NR_IRQS 8
386#else
387#define TWL4030_BASE_NR_IRQS 0
388#define TWL4030_PWR_NR_IRQS 0
389#endif
390#define TWL4030_IRQ_END (TWL4030_IRQ_BASE + TWL4030_BASE_NR_IRQS)
391#define TWL4030_PWR_IRQ_BASE TWL4030_IRQ_END
392#define TWL4030_PWR_IRQ_END (TWL4030_PWR_IRQ_BASE + TWL4030_PWR_NR_IRQS)
393
394/* External TWL4030 gpio interrupts are optional */
395#define TWL4030_GPIO_IRQ_BASE TWL4030_PWR_IRQ_END
396#ifdef CONFIG_GPIO_TWL4030
397#define TWL4030_GPIO_NR_IRQS 18
398#else
399#define TWL4030_GPIO_NR_IRQS 0
400#endif
401#define TWL4030_GPIO_IRQ_END (TWL4030_GPIO_IRQ_BASE + TWL4030_GPIO_NR_IRQS)
402
403#define TWL6030_IRQ_BASE (OMAP_FPGA_IRQ_END)
404#ifdef CONFIG_TWL4030_CORE
405#define TWL6030_BASE_NR_IRQS 20
406#else
407#define TWL6030_BASE_NR_IRQS 0
408#endif
409#define TWL6030_IRQ_END (TWL6030_IRQ_BASE + TWL6030_BASE_NR_IRQS)
410
411#define TWL6040_CODEC_IRQ_BASE TWL6030_IRQ_END
412#ifdef CONFIG_TWL6040_CODEC
413#define TWL6040_CODEC_NR_IRQS 6
414#else
415#define TWL6040_CODEC_NR_IRQS 0
416#endif
417#define TWL6040_CODEC_IRQ_END (TWL6040_CODEC_IRQ_BASE + TWL6040_CODEC_NR_IRQS)
418
419/* Total number of interrupts depends on the enabled blocks above */
420#if (TWL4030_GPIO_IRQ_END > TWL6040_CODEC_IRQ_END)
421#define TWL_IRQ_END TWL4030_GPIO_IRQ_END
422#else
423#define TWL_IRQ_END TWL6040_CODEC_IRQ_END
424#endif
425
426/* GPMC related */
427#define OMAP_GPMC_IRQ_BASE (TWL_IRQ_END)
428#define OMAP_GPMC_NR_IRQS 8
429#define OMAP_GPMC_IRQ_END (OMAP_GPMC_IRQ_BASE + OMAP_GPMC_NR_IRQS)
430
431
432#define NR_IRQS OMAP_GPMC_IRQ_END
433
434#define OMAP_IRQ_BIT(irq) (1 << ((irq) % 32))
435
436#define INTCPS_NR_MIR_REGS 3
437#define INTCPS_NR_IRQS 96
438
439#ifndef __ASSEMBLY__
440extern void __iomem *omap_irq_base;
441void omap1_init_irq(void);
442void omap2_init_irq(void);
443void omap3_init_irq(void);
444void ti816x_init_irq(void);
445extern int omap_irq_pending(void);
446void omap_intc_save_context(void);
447void omap_intc_restore_context(void);
448void omap3_intc_suspend(void);
449void omap3_intc_prepare_idle(void);
450void omap3_intc_resume_idle(void);
451#endif
452
453#include <mach/hardware.h>
454
455#ifdef CONFIG_FIQ
456#define FIQ_START 1024
457#endif
458
459#endif
diff --git a/arch/arm/plat-omap/include/plat/keypad.h b/arch/arm/plat-omap/include/plat/keypad.h
new file mode 100644
index 00000000000..793ce9d5329
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/keypad.h
@@ -0,0 +1,50 @@
1/*
2 * arch/arm/plat-omap/include/mach/keypad.h
3 *
4 * Copyright (C) 2006 Komal Shah <komal_shah802003@yahoo.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#ifndef ASMARM_ARCH_KEYPAD_H
11#define ASMARM_ARCH_KEYPAD_H
12
13#ifndef CONFIG_ARCH_OMAP1
14#warning Please update the board to use matrix-keypad driver
15#endif
16#include <linux/input/matrix_keypad.h>
17
18struct omap_kp_platform_data {
19 int rows;
20 int cols;
21 const struct matrix_keymap_data *keymap_data;
22 bool rep;
23 unsigned long delay;
24 bool dbounce;
25 /* specific to OMAP242x*/
26 unsigned int *row_gpios;
27 unsigned int *col_gpios;
28};
29
30/* Group (0..3) -- when multiple keys are pressed, only the
31 * keys pressed in the same group are considered as pressed. This is
32 * in order to workaround certain crappy HW designs that produce ghost
33 * keypresses. Two free bits, not used by neither row/col nor keynum,
34 * must be available for use as group bits. The below GROUP_SHIFT
35 * macro definition is based on some prior knowledge of the
36 * matrix_keypad defined KEY() macro internals.
37 */
38#define GROUP_SHIFT 14
39#define GROUP_0 (0 << GROUP_SHIFT)
40#define GROUP_1 (1 << GROUP_SHIFT)
41#define GROUP_2 (2 << GROUP_SHIFT)
42#define GROUP_3 (3 << GROUP_SHIFT)
43#define GROUP_MASK GROUP_3
44#if KEY_MAX & GROUP_MASK
45#error Group bits in conflict with keynum bits
46#endif
47
48
49#endif
50
diff --git a/arch/arm/plat-omap/include/plat/l3_2xxx.h b/arch/arm/plat-omap/include/plat/l3_2xxx.h
new file mode 100644
index 00000000000..b8b5641379b
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/l3_2xxx.h
@@ -0,0 +1,20 @@
1/*
2 * arch/arm/plat-omap/include/plat/l3_2xxx.h - L3 firewall definitions
3 *
4 * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
5 * Sumit Semwal
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 */
13#ifndef __ARCH_ARM_PLAT_OMAP_INCLUDE_PLAT_L3_2XXX_H
14#define __ARCH_ARM_PLAT_OMAP_INCLUDE_PLAT_L3_2XXX_H
15
16/* L3 CONNIDs */
17/* Display Sub system (DSS) */
18#define OMAP2_L3_CORE_FW_CONNID_DSS 8
19
20#endif
diff --git a/arch/arm/plat-omap/include/plat/l3_3xxx.h b/arch/arm/plat-omap/include/plat/l3_3xxx.h
new file mode 100644
index 00000000000..cde1938c5f8
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/l3_3xxx.h
@@ -0,0 +1,20 @@
1/*
2 * arch/arm/plat-omap/include/plat/l3_3xxx.h - L3 firewall definitions
3 *
4 * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
5 * Sumit Semwal
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 */
13#ifndef __ARCH_ARM_PLAT_OMAP_INCLUDE_PLAT_L3_3XXX_H
14#define __ARCH_ARM_PLAT_OMAP_INCLUDE_PLAT_L3_3XXX_H
15
16/* L3 Initiator IDs */
17/* Display Sub system (DSS) */
18#define OMAP3_L3_CORE_FW_INIT_ID_DSS 29
19
20#endif
diff --git a/arch/arm/plat-omap/include/plat/l4_2xxx.h b/arch/arm/plat-omap/include/plat/l4_2xxx.h
new file mode 100644
index 00000000000..3f39cf8a35c
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/l4_2xxx.h
@@ -0,0 +1,24 @@
1/*
2 * arch/arm/plat-omap/include/plat/l4_2xxx.h - L4 firewall definitions
3 *
4 * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
5 * Sumit Semwal
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 */
13#ifndef __ARCH_ARM_PLAT_OMAP_INCLUDE_PLAT_L4_2XXX_H
14#define __ARCH_ARM_PLAT_OMAP_INCLUDE_PLAT_L4_2XXX_H
15
16/* L4 CORE */
17/* Display Sub system (DSS) */
18#define OMAP2420_L4_CORE_FW_DSS_CORE_REGION 28
19#define OMAP2420_L4_CORE_FW_DSS_DISPC_REGION 29
20#define OMAP2420_L4_CORE_FW_DSS_RFBI_REGION 30
21#define OMAP2420_L4_CORE_FW_DSS_VENC_REGION 31
22#define OMAP2420_L4_CORE_FW_DSS_TA_REGION 32
23
24#endif
diff --git a/arch/arm/plat-omap/include/plat/l4_3xxx.h b/arch/arm/plat-omap/include/plat/l4_3xxx.h
new file mode 100644
index 00000000000..881a858b1ff
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/l4_3xxx.h
@@ -0,0 +1,34 @@
1/*
2 * arch/arm/plat-omap/include/mach/l4_3xxx.h - L4 firewall definitions
3 *
4 * Copyright (C) 2009 Nokia Corporation
5 * Paul Walmsley
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 */
13#ifndef __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_L4_3XXX_H
14#define __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_L4_3XXX_H
15
16/* L4 CORE */
17#define OMAP3_L4_CORE_FW_I2C1_REGION 21
18#define OMAP3_L4_CORE_FW_I2C1_TA_REGION 22
19#define OMAP3_L4_CORE_FW_I2C2_REGION 23
20#define OMAP3_L4_CORE_FW_I2C2_TA_REGION 24
21#define OMAP3_L4_CORE_FW_I2C3_REGION 73
22#define OMAP3_L4_CORE_FW_I2C3_TA_REGION 74
23
24/* Display Sub system (DSS) */
25#define OMAP3_L4_CORE_FW_DSS_PROT_GROUP 2
26
27#define OMAP3_L4_CORE_FW_DSS_DSI_REGION 104
28#define OMAP3ES1_L4_CORE_FW_DSS_CORE_REGION 3
29#define OMAP3_L4_CORE_FW_DSS_CORE_REGION 4
30#define OMAP3_L4_CORE_FW_DSS_DISPC_REGION 4
31#define OMAP3_L4_CORE_FW_DSS_RFBI_REGION 5
32#define OMAP3_L4_CORE_FW_DSS_VENC_REGION 6
33#define OMAP3_L4_CORE_FW_DSS_TA_REGION 7
34#endif
diff --git a/arch/arm/plat-omap/include/plat/lcd_mipid.h b/arch/arm/plat-omap/include/plat/lcd_mipid.h
new file mode 100644
index 00000000000..8e52c657228
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/lcd_mipid.h
@@ -0,0 +1,29 @@
1#ifndef __LCD_MIPID_H
2#define __LCD_MIPID_H
3
4enum mipid_test_num {
5 MIPID_TEST_RGB_LINES,
6};
7
8enum mipid_test_result {
9 MIPID_TEST_SUCCESS,
10 MIPID_TEST_INVALID,
11 MIPID_TEST_FAILED,
12};
13
14#ifdef __KERNEL__
15
16struct mipid_platform_data {
17 int nreset_gpio;
18 int data_lines;
19
20 void (*shutdown)(struct mipid_platform_data *pdata);
21 void (*set_bklight_level)(struct mipid_platform_data *pdata,
22 int level);
23 int (*get_bklight_level)(struct mipid_platform_data *pdata);
24 int (*get_bklight_max)(struct mipid_platform_data *pdata);
25};
26
27#endif
28
29#endif
diff --git a/arch/arm/plat-omap/include/plat/led.h b/arch/arm/plat-omap/include/plat/led.h
new file mode 100644
index 00000000000..25e451e7e2f
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/led.h
@@ -0,0 +1,24 @@
1/*
2 * arch/arm/plat-omap/include/mach/led.h
3 *
4 * Copyright (C) 2006 Samsung Electronics
5 * Kyungmin Park <kyungmin.park@samsung.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11#ifndef ASMARM_ARCH_LED_H
12#define ASMARM_ARCH_LED_H
13
14struct omap_led_config {
15 struct led_classdev cdev;
16 s16 gpio;
17};
18
19struct omap_led_platform_data {
20 s16 nr_leds;
21 struct omap_led_config *leds;
22};
23
24#endif
diff --git a/arch/arm/plat-omap/include/plat/mcbsp.h b/arch/arm/plat-omap/include/plat/mcbsp.h
new file mode 100644
index 00000000000..9882c657b2d
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/mcbsp.h
@@ -0,0 +1,473 @@
1/*
2 * arch/arm/plat-omap/include/mach/mcbsp.h
3 *
4 * Defines for Multi-Channel Buffered Serial Port
5 *
6 * Copyright (C) 2002 RidgeRun, Inc.
7 * Author: Steve Johnson
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 *
23 */
24#ifndef __ASM_ARCH_OMAP_MCBSP_H
25#define __ASM_ARCH_OMAP_MCBSP_H
26
27#include <linux/spinlock.h>
28
29#include <mach/hardware.h>
30#include <plat/clock.h>
31
32/* macro for building platform_device for McBSP ports */
33#define OMAP_MCBSP_PLATFORM_DEVICE(port_nr) \
34static struct platform_device omap_mcbsp##port_nr = { \
35 .name = "omap-mcbsp-dai", \
36 .id = port_nr - 1, \
37}
38
39#define MCBSP_CONFIG_TYPE2 0x2
40#define MCBSP_CONFIG_TYPE3 0x3
41#define MCBSP_CONFIG_TYPE4 0x4
42
43#define OMAP7XX_MCBSP1_BASE 0xfffb1000
44#define OMAP7XX_MCBSP2_BASE 0xfffb1800
45
46#define OMAP1510_MCBSP1_BASE 0xe1011800
47#define OMAP1510_MCBSP2_BASE 0xfffb1000
48#define OMAP1510_MCBSP3_BASE 0xe1017000
49
50#define OMAP1610_MCBSP1_BASE 0xe1011800
51#define OMAP1610_MCBSP2_BASE 0xfffb1000
52#define OMAP1610_MCBSP3_BASE 0xe1017000
53
54#ifdef CONFIG_ARCH_OMAP1
55
56#define OMAP_MCBSP_REG_DRR2 0x00
57#define OMAP_MCBSP_REG_DRR1 0x02
58#define OMAP_MCBSP_REG_DXR2 0x04
59#define OMAP_MCBSP_REG_DXR1 0x06
60#define OMAP_MCBSP_REG_DRR 0x02
61#define OMAP_MCBSP_REG_DXR 0x06
62#define OMAP_MCBSP_REG_SPCR2 0x08
63#define OMAP_MCBSP_REG_SPCR1 0x0a
64#define OMAP_MCBSP_REG_RCR2 0x0c
65#define OMAP_MCBSP_REG_RCR1 0x0e
66#define OMAP_MCBSP_REG_XCR2 0x10
67#define OMAP_MCBSP_REG_XCR1 0x12
68#define OMAP_MCBSP_REG_SRGR2 0x14
69#define OMAP_MCBSP_REG_SRGR1 0x16
70#define OMAP_MCBSP_REG_MCR2 0x18
71#define OMAP_MCBSP_REG_MCR1 0x1a
72#define OMAP_MCBSP_REG_RCERA 0x1c
73#define OMAP_MCBSP_REG_RCERB 0x1e
74#define OMAP_MCBSP_REG_XCERA 0x20
75#define OMAP_MCBSP_REG_XCERB 0x22
76#define OMAP_MCBSP_REG_PCR0 0x24
77#define OMAP_MCBSP_REG_RCERC 0x26
78#define OMAP_MCBSP_REG_RCERD 0x28
79#define OMAP_MCBSP_REG_XCERC 0x2A
80#define OMAP_MCBSP_REG_XCERD 0x2C
81#define OMAP_MCBSP_REG_RCERE 0x2E
82#define OMAP_MCBSP_REG_RCERF 0x30
83#define OMAP_MCBSP_REG_XCERE 0x32
84#define OMAP_MCBSP_REG_XCERF 0x34
85#define OMAP_MCBSP_REG_RCERG 0x36
86#define OMAP_MCBSP_REG_RCERH 0x38
87#define OMAP_MCBSP_REG_XCERG 0x3A
88#define OMAP_MCBSP_REG_XCERH 0x3C
89
90/* Dummy defines, these are not available on omap1 */
91#define OMAP_MCBSP_REG_XCCR 0x00
92#define OMAP_MCBSP_REG_RCCR 0x00
93
94#else
95
96#define OMAP_MCBSP_REG_DRR2 0x00
97#define OMAP_MCBSP_REG_DRR1 0x04
98#define OMAP_MCBSP_REG_DXR2 0x08
99#define OMAP_MCBSP_REG_DXR1 0x0C
100#define OMAP_MCBSP_REG_DRR 0x00
101#define OMAP_MCBSP_REG_DXR 0x08
102#define OMAP_MCBSP_REG_SPCR2 0x10
103#define OMAP_MCBSP_REG_SPCR1 0x14
104#define OMAP_MCBSP_REG_RCR2 0x18
105#define OMAP_MCBSP_REG_RCR1 0x1C
106#define OMAP_MCBSP_REG_XCR2 0x20
107#define OMAP_MCBSP_REG_XCR1 0x24
108#define OMAP_MCBSP_REG_SRGR2 0x28
109#define OMAP_MCBSP_REG_SRGR1 0x2C
110#define OMAP_MCBSP_REG_MCR2 0x30
111#define OMAP_MCBSP_REG_MCR1 0x34
112#define OMAP_MCBSP_REG_RCERA 0x38
113#define OMAP_MCBSP_REG_RCERB 0x3C
114#define OMAP_MCBSP_REG_XCERA 0x40
115#define OMAP_MCBSP_REG_XCERB 0x44
116#define OMAP_MCBSP_REG_PCR0 0x48
117#define OMAP_MCBSP_REG_RCERC 0x4C
118#define OMAP_MCBSP_REG_RCERD 0x50
119#define OMAP_MCBSP_REG_XCERC 0x54
120#define OMAP_MCBSP_REG_XCERD 0x58
121#define OMAP_MCBSP_REG_RCERE 0x5C
122#define OMAP_MCBSP_REG_RCERF 0x60
123#define OMAP_MCBSP_REG_XCERE 0x64
124#define OMAP_MCBSP_REG_XCERF 0x68
125#define OMAP_MCBSP_REG_RCERG 0x6C
126#define OMAP_MCBSP_REG_RCERH 0x70
127#define OMAP_MCBSP_REG_XCERG 0x74
128#define OMAP_MCBSP_REG_XCERH 0x78
129#define OMAP_MCBSP_REG_SYSCON 0x8C
130#define OMAP_MCBSP_REG_THRSH2 0x90
131#define OMAP_MCBSP_REG_THRSH1 0x94
132#define OMAP_MCBSP_REG_IRQST 0xA0
133#define OMAP_MCBSP_REG_IRQEN 0xA4
134#define OMAP_MCBSP_REG_WAKEUPEN 0xA8
135#define OMAP_MCBSP_REG_XCCR 0xAC
136#define OMAP_MCBSP_REG_RCCR 0xB0
137#define OMAP_MCBSP_REG_XBUFFSTAT 0xB4
138#define OMAP_MCBSP_REG_RBUFFSTAT 0xB8
139#define OMAP_MCBSP_REG_SSELCR 0xBC
140
141#define OMAP_ST_REG_REV 0x00
142#define OMAP_ST_REG_SYSCONFIG 0x10
143#define OMAP_ST_REG_IRQSTATUS 0x18
144#define OMAP_ST_REG_IRQENABLE 0x1C
145#define OMAP_ST_REG_SGAINCR 0x24
146#define OMAP_ST_REG_SFIRCR 0x28
147#define OMAP_ST_REG_SSELCR 0x2C
148
149#endif
150
151/************************** McBSP SPCR1 bit definitions ***********************/
152#define RRST 0x0001
153#define RRDY 0x0002
154#define RFULL 0x0004
155#define RSYNC_ERR 0x0008
156#define RINTM(value) ((value)<<4) /* bits 4:5 */
157#define ABIS 0x0040
158#define DXENA 0x0080
159#define CLKSTP(value) ((value)<<11) /* bits 11:12 */
160#define RJUST(value) ((value)<<13) /* bits 13:14 */
161#define ALB 0x8000
162#define DLB 0x8000
163
164/************************** McBSP SPCR2 bit definitions ***********************/
165#define XRST 0x0001
166#define XRDY 0x0002
167#define XEMPTY 0x0004
168#define XSYNC_ERR 0x0008
169#define XINTM(value) ((value)<<4) /* bits 4:5 */
170#define GRST 0x0040
171#define FRST 0x0080
172#define SOFT 0x0100
173#define FREE 0x0200
174
175/************************** McBSP PCR bit definitions *************************/
176#define CLKRP 0x0001
177#define CLKXP 0x0002
178#define FSRP 0x0004
179#define FSXP 0x0008
180#define DR_STAT 0x0010
181#define DX_STAT 0x0020
182#define CLKS_STAT 0x0040
183#define SCLKME 0x0080
184#define CLKRM 0x0100
185#define CLKXM 0x0200
186#define FSRM 0x0400
187#define FSXM 0x0800
188#define RIOEN 0x1000
189#define XIOEN 0x2000
190#define IDLE_EN 0x4000
191
192/************************** McBSP RCR1 bit definitions ************************/
193#define RWDLEN1(value) ((value)<<5) /* Bits 5:7 */
194#define RFRLEN1(value) ((value)<<8) /* Bits 8:14 */
195
196/************************** McBSP XCR1 bit definitions ************************/
197#define XWDLEN1(value) ((value)<<5) /* Bits 5:7 */
198#define XFRLEN1(value) ((value)<<8) /* Bits 8:14 */
199
200/*************************** McBSP RCR2 bit definitions ***********************/
201#define RDATDLY(value) (value) /* Bits 0:1 */
202#define RFIG 0x0004
203#define RCOMPAND(value) ((value)<<3) /* Bits 3:4 */
204#define RWDLEN2(value) ((value)<<5) /* Bits 5:7 */
205#define RFRLEN2(value) ((value)<<8) /* Bits 8:14 */
206#define RPHASE 0x8000
207
208/*************************** McBSP XCR2 bit definitions ***********************/
209#define XDATDLY(value) (value) /* Bits 0:1 */
210#define XFIG 0x0004
211#define XCOMPAND(value) ((value)<<3) /* Bits 3:4 */
212#define XWDLEN2(value) ((value)<<5) /* Bits 5:7 */
213#define XFRLEN2(value) ((value)<<8) /* Bits 8:14 */
214#define XPHASE 0x8000
215
216/************************* McBSP SRGR1 bit definitions ************************/
217#define CLKGDV(value) (value) /* Bits 0:7 */
218#define FWID(value) ((value)<<8) /* Bits 8:15 */
219
220/************************* McBSP SRGR2 bit definitions ************************/
221#define FPER(value) (value) /* Bits 0:11 */
222#define FSGM 0x1000
223#define CLKSM 0x2000
224#define CLKSP 0x4000
225#define GSYNC 0x8000
226
227/************************* McBSP MCR1 bit definitions *************************/
228#define RMCM 0x0001
229#define RCBLK(value) ((value)<<2) /* Bits 2:4 */
230#define RPABLK(value) ((value)<<5) /* Bits 5:6 */
231#define RPBBLK(value) ((value)<<7) /* Bits 7:8 */
232
233/************************* McBSP MCR2 bit definitions *************************/
234#define XMCM(value) (value) /* Bits 0:1 */
235#define XCBLK(value) ((value)<<2) /* Bits 2:4 */
236#define XPABLK(value) ((value)<<5) /* Bits 5:6 */
237#define XPBBLK(value) ((value)<<7) /* Bits 7:8 */
238
239/*********************** McBSP XCCR bit definitions *************************/
240#define EXTCLKGATE 0x8000
241#define PPCONNECT 0x4000
242#define DXENDLY(value) ((value)<<12) /* Bits 12:13 */
243#define XFULL_CYCLE 0x0800
244#define DILB 0x0020
245#define XDMAEN 0x0008
246#define XDISABLE 0x0001
247
248/********************** McBSP RCCR bit definitions *************************/
249#define RFULL_CYCLE 0x0800
250#define RDMAEN 0x0008
251#define RDISABLE 0x0001
252
253/********************** McBSP SYSCONFIG bit definitions ********************/
254#define CLOCKACTIVITY(value) ((value)<<8)
255#define SIDLEMODE(value) ((value)<<3)
256#define ENAWAKEUP 0x0004
257#define SOFTRST 0x0002
258
259/********************** McBSP SSELCR bit definitions ***********************/
260#define SIDETONEEN 0x0400
261
262/********************** McBSP Sidetone SYSCONFIG bit definitions ***********/
263#define ST_AUTOIDLE 0x0001
264
265/********************** McBSP Sidetone SGAINCR bit definitions *************/
266#define ST_CH1GAIN(value) ((value<<16)) /* Bits 16:31 */
267#define ST_CH0GAIN(value) (value) /* Bits 0:15 */
268
269/********************** McBSP Sidetone SFIRCR bit definitions **************/
270#define ST_FIRCOEFF(value) (value) /* Bits 0:15 */
271
272/********************** McBSP Sidetone SSELCR bit definitions **************/
273#define ST_COEFFWRDONE 0x0004
274#define ST_COEFFWREN 0x0002
275#define ST_SIDETONEEN 0x0001
276
277/********************** McBSP DMA operating modes **************************/
278#define MCBSP_DMA_MODE_ELEMENT 0
279#define MCBSP_DMA_MODE_THRESHOLD 1
280#define MCBSP_DMA_MODE_FRAME 2
281
282/********************** McBSP WAKEUPEN bit definitions *********************/
283#define XEMPTYEOFEN 0x4000
284#define XRDYEN 0x0400
285#define XEOFEN 0x0200
286#define XFSXEN 0x0100
287#define XSYNCERREN 0x0080
288#define RRDYEN 0x0008
289#define REOFEN 0x0004
290#define RFSREN 0x0002
291#define RSYNCERREN 0x0001
292
293/* CLKR signal muxing options */
294#define CLKR_SRC_CLKR 0
295#define CLKR_SRC_CLKX 1
296
297/* FSR signal muxing options */
298#define FSR_SRC_FSR 0
299#define FSR_SRC_FSX 1
300
301/* McBSP functional clock sources */
302#define MCBSP_CLKS_PRCM_SRC 0
303#define MCBSP_CLKS_PAD_SRC 1
304
305/* we don't do multichannel for now */
306struct omap_mcbsp_reg_cfg {
307 u16 spcr2;
308 u16 spcr1;
309 u16 rcr2;
310 u16 rcr1;
311 u16 xcr2;
312 u16 xcr1;
313 u16 srgr2;
314 u16 srgr1;
315 u16 mcr2;
316 u16 mcr1;
317 u16 pcr0;
318 u16 rcerc;
319 u16 rcerd;
320 u16 xcerc;
321 u16 xcerd;
322 u16 rcere;
323 u16 rcerf;
324 u16 xcere;
325 u16 xcerf;
326 u16 rcerg;
327 u16 rcerh;
328 u16 xcerg;
329 u16 xcerh;
330 u16 xccr;
331 u16 rccr;
332};
333
334typedef enum {
335 OMAP_MCBSP_WORD_8 = 0,
336 OMAP_MCBSP_WORD_12,
337 OMAP_MCBSP_WORD_16,
338 OMAP_MCBSP_WORD_20,
339 OMAP_MCBSP_WORD_24,
340 OMAP_MCBSP_WORD_32,
341} omap_mcbsp_word_length;
342
343/* Platform specific configuration */
344struct omap_mcbsp_ops {
345 void (*request)(unsigned int);
346 void (*free)(unsigned int);
347 int (*set_clks_src)(u8, u8);
348};
349
350struct omap_mcbsp_platform_data {
351 unsigned long phys_base;
352 u8 dma_rx_sync, dma_tx_sync;
353 u16 rx_irq, tx_irq;
354 struct omap_mcbsp_ops *ops;
355#ifdef CONFIG_ARCH_OMAP3
356 /* Sidetone block for McBSP 2 and 3 */
357 unsigned long phys_base_st;
358#endif
359 u16 buffer_size;
360 unsigned int mcbsp_config_type;
361};
362
363struct omap_mcbsp_st_data {
364 void __iomem *io_base_st;
365 bool running;
366 bool enabled;
367 s16 taps[128]; /* Sidetone filter coefficients */
368 int nr_taps; /* Number of filter coefficients in use */
369 s16 ch0gain;
370 s16 ch1gain;
371};
372
373struct omap_mcbsp {
374 struct device *dev;
375 unsigned long phys_base;
376 unsigned long phys_dma_base;
377 void __iomem *io_base;
378 u8 id;
379 u8 free;
380
381 int rx_irq;
382 int tx_irq;
383
384 /* DMA stuff */
385 u8 dma_rx_sync;
386 u8 dma_tx_sync;
387
388 /* Protect the field .free, while checking if the mcbsp is in use */
389 spinlock_t lock;
390 struct omap_mcbsp_platform_data *pdata;
391 struct clk *fclk;
392#ifdef CONFIG_ARCH_OMAP3
393 struct omap_mcbsp_st_data *st_data;
394 int dma_op_mode;
395 u16 max_tx_thres;
396 u16 max_rx_thres;
397#endif
398 void *reg_cache;
399 unsigned int mcbsp_config_type;
400};
401
402/**
403 * omap_mcbsp_dev_attr - OMAP McBSP device attributes for omap_hwmod
404 * @sidetone: name of the sidetone device
405 */
406struct omap_mcbsp_dev_attr {
407 const char *sidetone;
408};
409
410extern struct omap_mcbsp **mcbsp_ptr;
411extern int omap_mcbsp_count, omap_mcbsp_cache_size;
412
413#define omap_mcbsp_check_valid_id(id) (id < omap_mcbsp_count)
414#define id_to_mcbsp_ptr(id) mcbsp_ptr[id];
415
416int omap_mcbsp_init(void);
417void omap_mcbsp_register_board_cfg(struct resource *res, int res_count,
418 struct omap_mcbsp_platform_data *config, int size);
419void omap_mcbsp_config(unsigned int id, const struct omap_mcbsp_reg_cfg * config);
420#ifdef CONFIG_ARCH_OMAP3
421void omap_mcbsp_set_tx_threshold(unsigned int id, u16 threshold);
422void omap_mcbsp_set_rx_threshold(unsigned int id, u16 threshold);
423u16 omap_mcbsp_get_max_tx_threshold(unsigned int id);
424u16 omap_mcbsp_get_max_rx_threshold(unsigned int id);
425u16 omap_mcbsp_get_fifo_size(unsigned int id);
426u16 omap_mcbsp_get_tx_delay(unsigned int id);
427u16 omap_mcbsp_get_rx_delay(unsigned int id);
428int omap_mcbsp_get_dma_op_mode(unsigned int id);
429#else
430static inline void omap_mcbsp_set_tx_threshold(unsigned int id, u16 threshold)
431{ }
432static inline void omap_mcbsp_set_rx_threshold(unsigned int id, u16 threshold)
433{ }
434static inline u16 omap_mcbsp_get_max_tx_threshold(unsigned int id) { return 0; }
435static inline u16 omap_mcbsp_get_max_rx_threshold(unsigned int id) { return 0; }
436static inline u16 omap_mcbsp_get_fifo_size(unsigned int id) { return 0; }
437static inline u16 omap_mcbsp_get_tx_delay(unsigned int id) { return 0; }
438static inline u16 omap_mcbsp_get_rx_delay(unsigned int id) { return 0; }
439static inline int omap_mcbsp_get_dma_op_mode(unsigned int id) { return 0; }
440#endif
441int omap_mcbsp_request(unsigned int id);
442void omap_mcbsp_free(unsigned int id);
443void omap_mcbsp_start(unsigned int id, int tx, int rx);
444void omap_mcbsp_stop(unsigned int id, int tx, int rx);
445
446/* McBSP functional clock source changing function */
447extern int omap2_mcbsp_set_clks_src(u8 id, u8 fck_src_id);
448
449/* McBSP signal muxing API */
450void omap2_mcbsp1_mux_clkr_src(u8 mux);
451void omap2_mcbsp1_mux_fsr_src(u8 mux);
452
453int omap_mcbsp_dma_ch_params(unsigned int id, unsigned int stream);
454int omap_mcbsp_dma_reg_params(unsigned int id, unsigned int stream);
455
456#ifdef CONFIG_ARCH_OMAP3
457/* Sidetone specific API */
458int omap_st_set_chgain(unsigned int id, int channel, s16 chgain);
459int omap_st_get_chgain(unsigned int id, int channel, s16 *chgain);
460int omap_st_enable(unsigned int id);
461int omap_st_disable(unsigned int id);
462int omap_st_is_enabled(unsigned int id);
463#else
464static inline int omap_st_set_chgain(unsigned int id, int channel,
465 s16 chgain) { return 0; }
466static inline int omap_st_get_chgain(unsigned int id, int channel,
467 s16 *chgain) { return 0; }
468static inline int omap_st_enable(unsigned int id) { return 0; }
469static inline int omap_st_disable(unsigned int id) { return 0; }
470static inline int omap_st_is_enabled(unsigned int id) { return 0; }
471#endif
472
473#endif
diff --git a/arch/arm/plat-omap/include/plat/mcspi.h b/arch/arm/plat-omap/include/plat/mcspi.h
new file mode 100644
index 00000000000..3d51b18131c
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/mcspi.h
@@ -0,0 +1,26 @@
1#ifndef _OMAP2_MCSPI_H
2#define _OMAP2_MCSPI_H
3
4#define OMAP2_MCSPI_REV 0
5#define OMAP3_MCSPI_REV 1
6#define OMAP4_MCSPI_REV 2
7
8#define OMAP4_MCSPI_REG_OFFSET 0x100
9
10struct omap2_mcspi_platform_config {
11 unsigned short num_cs;
12 unsigned int regs_offset;
13};
14
15struct omap2_mcspi_dev_attr {
16 unsigned short num_chipselect;
17};
18
19struct omap2_mcspi_device_config {
20 unsigned turbo_mode:1;
21
22 /* Do we want one channel enabled at the same time? */
23 unsigned single_channel:1;
24};
25
26#endif
diff --git a/arch/arm/plat-omap/include/plat/memory.h b/arch/arm/plat-omap/include/plat/memory.h
new file mode 100644
index 00000000000..e6720aa2d55
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/memory.h
@@ -0,0 +1,102 @@
1/*
2 * arch/arm/plat-omap/include/mach/memory.h
3 *
4 * Memory map for OMAP-1510 and 1610
5 *
6 * Copyright (C) 2000 RidgeRun, Inc.
7 * Author: Greg Lonnon <glonnon@ridgerun.com>
8 *
9 * This file was derived from arch/arm/mach-intergrator/include/mach/memory.h
10 * Copyright (C) 1999 ARM Limited
11 *
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version.
16 *
17 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
18 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
20 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
23 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
24 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * You should have received a copy of the GNU General Public License along
29 * with this program; if not, write to the Free Software Foundation, Inc.,
30 * 675 Mass Ave, Cambridge, MA 02139, USA.
31 */
32
33#ifndef __ASM_ARCH_MEMORY_H
34#define __ASM_ARCH_MEMORY_H
35
36/*
37 * Physical DRAM offset.
38 */
39#if defined(CONFIG_ARCH_OMAP1)
40#define PLAT_PHYS_OFFSET UL(0x10000000)
41#else
42#define PLAT_PHYS_OFFSET UL(0x80000000)
43#endif
44
45/*
46 * Bus address is physical address, except for OMAP-1510 Local Bus.
47 * OMAP-1510 bus address is translated into a Local Bus address if the
48 * OMAP bus type is lbus. We do the address translation based on the
49 * device overriding the defaults used in the dma-mapping API.
50 * Note that the is_lbus_device() test is not very efficient on 1510
51 * because of the strncmp().
52 */
53#ifdef CONFIG_ARCH_OMAP15XX
54
55/*
56 * OMAP-1510 Local Bus address offset
57 */
58#define OMAP1510_LB_OFFSET UL(0x30000000)
59
60#define virt_to_lbus(x) ((x) - PAGE_OFFSET + OMAP1510_LB_OFFSET)
61#define lbus_to_virt(x) ((x) - OMAP1510_LB_OFFSET + PAGE_OFFSET)
62#define is_lbus_device(dev) (cpu_is_omap15xx() && dev && (strncmp(dev_name(dev), "ohci", 4) == 0))
63
64#define __arch_pfn_to_dma(dev, pfn) \
65 ({ dma_addr_t __dma = __pfn_to_phys(pfn); \
66 if (is_lbus_device(dev)) \
67 __dma = __dma - PHYS_OFFSET + OMAP1510_LB_OFFSET; \
68 __dma; })
69
70#define __arch_dma_to_pfn(dev, addr) \
71 ({ dma_addr_t __dma = addr; \
72 if (is_lbus_device(dev)) \
73 __dma += PHYS_OFFSET - OMAP1510_LB_OFFSET; \
74 __phys_to_pfn(__dma); \
75 })
76
77#define __arch_dma_to_virt(dev, addr) ({ (void *) (is_lbus_device(dev) ? \
78 lbus_to_virt(addr) : \
79 __phys_to_virt(addr)); })
80
81#define __arch_virt_to_dma(dev, addr) ({ unsigned long __addr = (unsigned long)(addr); \
82 (dma_addr_t) (is_lbus_device(dev) ? \
83 virt_to_lbus(__addr) : \
84 __virt_to_phys(__addr)); })
85
86#endif /* CONFIG_ARCH_OMAP15XX */
87
88/* Override the ARM default */
89#ifdef CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE
90
91#if (CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE == 0)
92#undef CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE
93#define CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE 2
94#endif
95
96#define CONSISTENT_DMA_SIZE \
97 (((CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE + 1) & ~1) * 1024 * 1024)
98
99#endif
100
101#endif
102
diff --git a/arch/arm/plat-omap/include/plat/menelaus.h b/arch/arm/plat-omap/include/plat/menelaus.h
new file mode 100644
index 00000000000..4a970ec62dd
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/menelaus.h
@@ -0,0 +1,49 @@
1/*
2 * arch/arm/plat-omap/include/mach/menelaus.h
3 *
4 * Functions to access Menelaus power management chip
5 */
6
7#ifndef __ASM_ARCH_MENELAUS_H
8#define __ASM_ARCH_MENELAUS_H
9
10struct device;
11
12struct menelaus_platform_data {
13 int (* late_init)(struct device *dev);
14};
15
16extern int menelaus_register_mmc_callback(void (*callback)(void *data, u8 card_mask),
17 void *data);
18extern void menelaus_unregister_mmc_callback(void);
19extern int menelaus_set_mmc_opendrain(int slot, int enable);
20extern int menelaus_set_mmc_slot(int slot, int enable, int power, int cd_on);
21
22extern int menelaus_set_vmem(unsigned int mV);
23extern int menelaus_set_vio(unsigned int mV);
24extern int menelaus_set_vmmc(unsigned int mV);
25extern int menelaus_set_vaux(unsigned int mV);
26extern int menelaus_set_vdcdc(int dcdc, unsigned int mV);
27extern int menelaus_set_slot_sel(int enable);
28extern int menelaus_get_slot_pin_states(void);
29extern int menelaus_set_vcore_sw(unsigned int mV);
30extern int menelaus_set_vcore_hw(unsigned int roof_mV, unsigned int floor_mV);
31
32#define EN_VPLL_SLEEP (1 << 7)
33#define EN_VMMC_SLEEP (1 << 6)
34#define EN_VAUX_SLEEP (1 << 5)
35#define EN_VIO_SLEEP (1 << 4)
36#define EN_VMEM_SLEEP (1 << 3)
37#define EN_DC3_SLEEP (1 << 2)
38#define EN_DC2_SLEEP (1 << 1)
39#define EN_VC_SLEEP (1 << 0)
40
41extern int menelaus_set_regulator_sleep(int enable, u32 val);
42
43#if defined(CONFIG_ARCH_OMAP2) && defined(CONFIG_MENELAUS)
44#define omap_has_menelaus() 1
45#else
46#define omap_has_menelaus() 0
47#endif
48
49#endif
diff --git a/arch/arm/plat-omap/include/plat/mmc.h b/arch/arm/plat-omap/include/plat/mmc.h
new file mode 100644
index 00000000000..c7b874186c2
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/mmc.h
@@ -0,0 +1,182 @@
1/*
2 * MMC definitions for OMAP2
3 *
4 * Copyright (C) 2006 Nokia Corporation
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __OMAP2_MMC_H
12#define __OMAP2_MMC_H
13
14#include <linux/types.h>
15#include <linux/device.h>
16#include <linux/mmc/host.h>
17
18#include <plat/board.h>
19
20#define OMAP15XX_NR_MMC 1
21#define OMAP16XX_NR_MMC 2
22#define OMAP1_MMC_SIZE 0x080
23#define OMAP1_MMC1_BASE 0xfffb7800
24#define OMAP1_MMC2_BASE 0xfffb7c00 /* omap16xx only */
25
26#define OMAP24XX_NR_MMC 2
27#define OMAP2420_MMC_SIZE OMAP1_MMC_SIZE
28#define OMAP2_MMC1_BASE 0x4809c000
29
30#define OMAP4_MMC_REG_OFFSET 0x100
31
32#define OMAP_MMC_MAX_SLOTS 2
33
34#define OMAP_HSMMC_SUPPORTS_DUAL_VOLT BIT(1)
35
36struct omap_mmc_dev_attr {
37 u8 flags;
38};
39
40struct omap_mmc_platform_data {
41 /* back-link to device */
42 struct device *dev;
43
44 /* number of slots per controller */
45 unsigned nr_slots:2;
46
47 /* set if your board has components or wiring that limits the
48 * maximum frequency on the MMC bus */
49 unsigned int max_freq;
50
51 /* switch the bus to a new slot */
52 int (*switch_slot)(struct device *dev, int slot);
53 /* initialize board-specific MMC functionality, can be NULL if
54 * not supported */
55 int (*init)(struct device *dev);
56 void (*cleanup)(struct device *dev);
57 void (*shutdown)(struct device *dev);
58
59 /* To handle board related suspend/resume functionality for MMC */
60 int (*suspend)(struct device *dev, int slot);
61 int (*resume)(struct device *dev, int slot);
62
63 /* Return context loss count due to PM states changing */
64 int (*get_context_loss_count)(struct device *dev);
65
66 u64 dma_mask;
67
68 /* Integrating attributes from the omap_hwmod layer */
69 u8 controller_flags;
70
71 /* Register offset deviation */
72 u16 reg_offset;
73
74 struct omap_mmc_slot_data {
75
76 /*
77 * 4/8 wires and any additional host capabilities
78 * need to OR'd all capabilities (ref. linux/mmc/host.h)
79 */
80 u8 wires; /* Used for the MMC driver on omap1 and 2420 */
81 u32 caps; /* Used for the MMC driver on 2430 and later */
82
83 /*
84 * nomux means "standard" muxing is wrong on this board, and
85 * that board-specific code handled it before common init logic.
86 */
87 unsigned nomux:1;
88
89 /* switch pin can be for card detect (default) or card cover */
90 unsigned cover:1;
91
92 /* use the internal clock */
93 unsigned internal_clock:1;
94
95 /* nonremovable e.g. eMMC */
96 unsigned nonremovable:1;
97
98 /* Try to sleep or power off when possible */
99 unsigned power_saving:1;
100
101 /* If using power_saving and the MMC power is not to go off */
102 unsigned no_off:1;
103
104 /* eMMC does not handle power off when not in sleep state */
105 unsigned no_regulator_off_init:1;
106
107 /* Regulator off remapped to sleep */
108 unsigned vcc_aux_disable_is_sleep:1;
109
110 /* we can put the features above into this variable */
111#define HSMMC_HAS_PBIAS (1 << 0)
112#define HSMMC_HAS_UPDATED_RESET (1 << 1)
113 unsigned features;
114
115 int switch_pin; /* gpio (card detect) */
116 int gpio_wp; /* gpio (write protect) */
117
118 int (*set_bus_mode)(struct device *dev, int slot, int bus_mode);
119 int (*set_power)(struct device *dev, int slot,
120 int power_on, int vdd);
121 int (*get_ro)(struct device *dev, int slot);
122 int (*set_sleep)(struct device *dev, int slot, int sleep,
123 int vdd, int cardsleep);
124 void (*remux)(struct device *dev, int slot, int power_on);
125 /* Call back before enabling / disabling regulators */
126 void (*before_set_reg)(struct device *dev, int slot,
127 int power_on, int vdd);
128 /* Call back after enabling / disabling regulators */
129 void (*after_set_reg)(struct device *dev, int slot,
130 int power_on, int vdd);
131 /* if we have special card, init it using this callback */
132 void (*init_card)(struct mmc_card *card);
133
134 /* return MMC cover switch state, can be NULL if not supported.
135 *
136 * possible return values:
137 * 0 - closed
138 * 1 - open
139 */
140 int (*get_cover_state)(struct device *dev, int slot);
141
142 const char *name;
143 u32 ocr_mask;
144
145 /* Card detection IRQs */
146 int card_detect_irq;
147 int (*card_detect)(struct device *dev, int slot);
148
149 unsigned int ban_openended:1;
150
151 } slots[OMAP_MMC_MAX_SLOTS];
152};
153
154/* called from board-specific card detection service routine */
155extern void omap_mmc_notify_cover_event(struct device *dev, int slot,
156 int is_closed);
157
158#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) || \
159 defined(CONFIG_MMC_OMAP_HS) || defined(CONFIG_MMC_OMAP_HS_MODULE)
160void omap1_init_mmc(struct omap_mmc_platform_data **mmc_data,
161 int nr_controllers);
162void omap242x_init_mmc(struct omap_mmc_platform_data **mmc_data);
163int omap_mmc_add(const char *name, int id, unsigned long base,
164 unsigned long size, unsigned int irq,
165 struct omap_mmc_platform_data *data);
166#else
167static inline void omap1_init_mmc(struct omap_mmc_platform_data **mmc_data,
168 int nr_controllers)
169{
170}
171static inline void omap242x_init_mmc(struct omap_mmc_platform_data **mmc_data)
172{
173}
174static inline int omap_mmc_add(const char *name, int id, unsigned long base,
175 unsigned long size, unsigned int irq,
176 struct omap_mmc_platform_data *data)
177{
178 return 0;
179}
180
181#endif
182#endif
diff --git a/arch/arm/plat-omap/include/plat/multi.h b/arch/arm/plat-omap/include/plat/multi.h
new file mode 100644
index 00000000000..999ffba2690
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/multi.h
@@ -0,0 +1,102 @@
1/*
2 * Support for compiling in multiple OMAP processors
3 *
4 * Copyright (C) 2010 Nokia Corporation
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 *
20 */
21
22#ifndef __PLAT_OMAP_MULTI_H
23#define __PLAT_OMAP_MULTI_H
24
25/*
26 * Test if multicore OMAP support is needed
27 */
28#undef MULTI_OMAP1
29#undef MULTI_OMAP2
30#undef OMAP_NAME
31
32#ifdef CONFIG_ARCH_OMAP730
33# ifdef OMAP_NAME
34# undef MULTI_OMAP1
35# define MULTI_OMAP1
36# else
37# define OMAP_NAME omap730
38# endif
39#endif
40#ifdef CONFIG_ARCH_OMAP850
41# ifdef OMAP_NAME
42# undef MULTI_OMAP1
43# define MULTI_OMAP1
44# else
45# define OMAP_NAME omap850
46# endif
47#endif
48#ifdef CONFIG_ARCH_OMAP15XX
49# ifdef OMAP_NAME
50# undef MULTI_OMAP1
51# define MULTI_OMAP1
52# else
53# define OMAP_NAME omap1510
54# endif
55#endif
56#ifdef CONFIG_ARCH_OMAP16XX
57# ifdef OMAP_NAME
58# undef MULTI_OMAP1
59# define MULTI_OMAP1
60# else
61# define OMAP_NAME omap16xx
62# endif
63#endif
64#ifdef CONFIG_ARCH_OMAP2PLUS
65# if (defined(OMAP_NAME) || defined(MULTI_OMAP1))
66# error "OMAP1 and OMAP2PLUS can't be selected at the same time"
67# endif
68#endif
69#ifdef CONFIG_SOC_OMAP2420
70# ifdef OMAP_NAME
71# undef MULTI_OMAP2
72# define MULTI_OMAP2
73# else
74# define OMAP_NAME omap2420
75# endif
76#endif
77#ifdef CONFIG_SOC_OMAP2430
78# ifdef OMAP_NAME
79# undef MULTI_OMAP2
80# define MULTI_OMAP2
81# else
82# define OMAP_NAME omap2430
83# endif
84#endif
85#ifdef CONFIG_ARCH_OMAP3
86# ifdef OMAP_NAME
87# undef MULTI_OMAP2
88# define MULTI_OMAP2
89# else
90# define OMAP_NAME omap3
91# endif
92#endif
93#ifdef CONFIG_ARCH_OMAP4
94# ifdef OMAP_NAME
95# undef MULTI_OMAP2
96# define MULTI_OMAP2
97# else
98# define OMAP_NAME omap4
99# endif
100#endif
101
102#endif /* __PLAT_OMAP_MULTI_H */
diff --git a/arch/arm/plat-omap/include/plat/mux.h b/arch/arm/plat-omap/include/plat/mux.h
new file mode 100644
index 00000000000..aeba71796ad
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/mux.h
@@ -0,0 +1,454 @@
1/*
2 * arch/arm/plat-omap/include/mach/mux.h
3 *
4 * Table of the Omap register configurations for the FUNC_MUX and
5 * PULL_DWN combinations.
6 *
7 * Copyright (C) 2004 - 2008 Texas Instruments Inc.
8 * Copyright (C) 2003 - 2008 Nokia Corporation
9 *
10 * Written by Tony Lindgren
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 *
26 * NOTE: Please use the following naming style for new pin entries.
27 * For example, W8_1610_MMC2_DAT0, where:
28 * - W8 = ball
29 * - 1610 = 1510 or 1610, none if common for both 1510 and 1610
30 * - MMC2_DAT0 = function
31 */
32
33#ifndef __ASM_ARCH_MUX_H
34#define __ASM_ARCH_MUX_H
35
36#define PU_PD_SEL_NA 0 /* No pu_pd reg available */
37#define PULL_DWN_CTRL_NA 0 /* No pull-down control needed */
38
39#ifdef CONFIG_OMAP_MUX_DEBUG
40#define MUX_REG(reg, mode_offset, mode) .mux_reg_name = "FUNC_MUX_CTRL_"#reg, \
41 .mux_reg = FUNC_MUX_CTRL_##reg, \
42 .mask_offset = mode_offset, \
43 .mask = mode,
44
45#define PULL_REG(reg, bit, status) .pull_name = "PULL_DWN_CTRL_"#reg, \
46 .pull_reg = PULL_DWN_CTRL_##reg, \
47 .pull_bit = bit, \
48 .pull_val = status,
49
50#define PU_PD_REG(reg, status) .pu_pd_name = "PU_PD_SEL_"#reg, \
51 .pu_pd_reg = PU_PD_SEL_##reg, \
52 .pu_pd_val = status,
53
54#define MUX_REG_7XX(reg, mode_offset, mode) .mux_reg_name = "OMAP7XX_IO_CONF_"#reg, \
55 .mux_reg = OMAP7XX_IO_CONF_##reg, \
56 .mask_offset = mode_offset, \
57 .mask = mode,
58
59#define PULL_REG_7XX(reg, bit, status) .pull_name = "OMAP7XX_IO_CONF_"#reg, \
60 .pull_reg = OMAP7XX_IO_CONF_##reg, \
61 .pull_bit = bit, \
62 .pull_val = status,
63
64#else
65
66#define MUX_REG(reg, mode_offset, mode) .mux_reg = FUNC_MUX_CTRL_##reg, \
67 .mask_offset = mode_offset, \
68 .mask = mode,
69
70#define PULL_REG(reg, bit, status) .pull_reg = PULL_DWN_CTRL_##reg, \
71 .pull_bit = bit, \
72 .pull_val = status,
73
74#define PU_PD_REG(reg, status) .pu_pd_reg = PU_PD_SEL_##reg, \
75 .pu_pd_val = status,
76
77#define MUX_REG_7XX(reg, mode_offset, mode) \
78 .mux_reg = OMAP7XX_IO_CONF_##reg, \
79 .mask_offset = mode_offset, \
80 .mask = mode,
81
82#define PULL_REG_7XX(reg, bit, status) .pull_reg = OMAP7XX_IO_CONF_##reg, \
83 .pull_bit = bit, \
84 .pull_val = status,
85
86#endif /* CONFIG_OMAP_MUX_DEBUG */
87
88#define MUX_CFG(desc, mux_reg, mode_offset, mode, \
89 pull_reg, pull_bit, pull_status, \
90 pu_pd_reg, pu_pd_status, debug_status) \
91{ \
92 .name = desc, \
93 .debug = debug_status, \
94 MUX_REG(mux_reg, mode_offset, mode) \
95 PULL_REG(pull_reg, pull_bit, pull_status) \
96 PU_PD_REG(pu_pd_reg, pu_pd_status) \
97},
98
99
100/*
101 * OMAP730/850 has a slightly different config for the pin mux.
102 * - config regs are the OMAP7XX_IO_CONF_x regs (see omap730.h) regs and
103 * not the FUNC_MUX_CTRL_x regs from hardware.h
104 * - for pull-up/down, only has one enable bit which is is in the same register
105 * as mux config
106 */
107#define MUX_CFG_7XX(desc, mux_reg, mode_offset, mode, \
108 pull_bit, pull_status, debug_status)\
109{ \
110 .name = desc, \
111 .debug = debug_status, \
112 MUX_REG_7XX(mux_reg, mode_offset, mode) \
113 PULL_REG_7XX(mux_reg, pull_bit, pull_status) \
114 PU_PD_REG(NA, 0) \
115},
116
117struct pin_config {
118 char *name;
119 const unsigned int mux_reg;
120 unsigned char debug;
121
122 const unsigned char mask_offset;
123 const unsigned char mask;
124
125 const char *pull_name;
126 const unsigned int pull_reg;
127 const unsigned char pull_val;
128 const unsigned char pull_bit;
129
130 const char *pu_pd_name;
131 const unsigned int pu_pd_reg;
132 const unsigned char pu_pd_val;
133
134#if defined(CONFIG_OMAP_MUX_DEBUG) || defined(CONFIG_OMAP_MUX_WARNINGS)
135 const char *mux_reg_name;
136#endif
137
138};
139
140enum omap7xx_index {
141 /* OMAP 730 keyboard */
142 E2_7XX_KBR0,
143 J7_7XX_KBR1,
144 E1_7XX_KBR2,
145 F3_7XX_KBR3,
146 D2_7XX_KBR4,
147 C2_7XX_KBC0,
148 D3_7XX_KBC1,
149 E4_7XX_KBC2,
150 F4_7XX_KBC3,
151 E3_7XX_KBC4,
152
153 /* USB */
154 AA17_7XX_USB_DM,
155 W16_7XX_USB_PU_EN,
156 W17_7XX_USB_VBUSI,
157 W18_7XX_USB_DMCK_OUT,
158 W19_7XX_USB_DCRST,
159
160 /* MMC */
161 MMC_7XX_CMD,
162 MMC_7XX_CLK,
163 MMC_7XX_DAT0,
164
165 /* I2C */
166 I2C_7XX_SCL,
167 I2C_7XX_SDA,
168
169 /* SPI */
170 SPI_7XX_1,
171 SPI_7XX_2,
172 SPI_7XX_3,
173 SPI_7XX_4,
174 SPI_7XX_5,
175 SPI_7XX_6,
176
177 /* UART */
178 UART_7XX_1,
179 UART_7XX_2,
180};
181
182enum omap1xxx_index {
183 /* UART1 (BT_UART_GATING)*/
184 UART1_TX = 0,
185 UART1_RTS,
186
187 /* UART2 (COM_UART_GATING)*/
188 UART2_TX,
189 UART2_RX,
190 UART2_CTS,
191 UART2_RTS,
192
193 /* UART3 (GIGA_UART_GATING) */
194 UART3_TX,
195 UART3_RX,
196 UART3_CTS,
197 UART3_RTS,
198 UART3_CLKREQ,
199 UART3_BCLK, /* 12MHz clock out */
200 Y15_1610_UART3_RTS,
201
202 /* PWT & PWL */
203 PWT,
204 PWL,
205
206 /* USB master generic */
207 R18_USB_VBUS,
208 R18_1510_USB_GPIO0,
209 W4_USB_PUEN,
210 W4_USB_CLKO,
211 W4_USB_HIGHZ,
212 W4_GPIO58,
213
214 /* USB1 master */
215 USB1_SUSP,
216 USB1_SEO,
217 W13_1610_USB1_SE0,
218 USB1_TXEN,
219 USB1_TXD,
220 USB1_VP,
221 USB1_VM,
222 USB1_RCV,
223 USB1_SPEED,
224 R13_1610_USB1_SPEED,
225 R13_1710_USB1_SE0,
226
227 /* USB2 master */
228 USB2_SUSP,
229 USB2_VP,
230 USB2_TXEN,
231 USB2_VM,
232 USB2_RCV,
233 USB2_SEO,
234 USB2_TXD,
235
236 /* OMAP-1510 GPIO */
237 R18_1510_GPIO0,
238 R19_1510_GPIO1,
239 M14_1510_GPIO2,
240
241 /* OMAP1610 GPIO */
242 P18_1610_GPIO3,
243 Y15_1610_GPIO17,
244
245 /* OMAP-1710 GPIO */
246 R18_1710_GPIO0,
247 V2_1710_GPIO10,
248 N21_1710_GPIO14,
249 W15_1710_GPIO40,
250
251 /* MPUIO */
252 MPUIO2,
253 N15_1610_MPUIO2,
254 MPUIO4,
255 MPUIO5,
256 T20_1610_MPUIO5,
257 W11_1610_MPUIO6,
258 V10_1610_MPUIO7,
259 W11_1610_MPUIO9,
260 V10_1610_MPUIO10,
261 W10_1610_MPUIO11,
262 E20_1610_MPUIO13,
263 U20_1610_MPUIO14,
264 E19_1610_MPUIO15,
265
266 /* MCBSP2 */
267 MCBSP2_CLKR,
268 MCBSP2_CLKX,
269 MCBSP2_DR,
270 MCBSP2_DX,
271 MCBSP2_FSR,
272 MCBSP2_FSX,
273
274 /* MCBSP3 */
275 MCBSP3_CLKX,
276
277 /* Misc ballouts */
278 BALLOUT_V8_ARMIO3,
279 N20_HDQ,
280
281 /* OMAP-1610 MMC2 */
282 W8_1610_MMC2_DAT0,
283 V8_1610_MMC2_DAT1,
284 W15_1610_MMC2_DAT2,
285 R10_1610_MMC2_DAT3,
286 Y10_1610_MMC2_CLK,
287 Y8_1610_MMC2_CMD,
288 V9_1610_MMC2_CMDDIR,
289 V5_1610_MMC2_DATDIR0,
290 W19_1610_MMC2_DATDIR1,
291 R18_1610_MMC2_CLKIN,
292
293 /* OMAP-1610 External Trace Interface */
294 M19_1610_ETM_PSTAT0,
295 L15_1610_ETM_PSTAT1,
296 L18_1610_ETM_PSTAT2,
297 L19_1610_ETM_D0,
298 J19_1610_ETM_D6,
299 J18_1610_ETM_D7,
300
301 /* OMAP16XX GPIO */
302 P20_1610_GPIO4,
303 V9_1610_GPIO7,
304 W8_1610_GPIO9,
305 N20_1610_GPIO11,
306 N19_1610_GPIO13,
307 P10_1610_GPIO22,
308 V5_1610_GPIO24,
309 AA20_1610_GPIO_41,
310 W19_1610_GPIO48,
311 M7_1610_GPIO62,
312 V14_16XX_GPIO37,
313 R9_16XX_GPIO18,
314 L14_16XX_GPIO49,
315
316 /* OMAP-1610 uWire */
317 V19_1610_UWIRE_SCLK,
318 U18_1610_UWIRE_SDI,
319 W21_1610_UWIRE_SDO,
320 N14_1610_UWIRE_CS0,
321 P15_1610_UWIRE_CS3,
322 N15_1610_UWIRE_CS1,
323
324 /* OMAP-1610 SPI */
325 U19_1610_SPIF_SCK,
326 U18_1610_SPIF_DIN,
327 P20_1610_SPIF_DIN,
328 W21_1610_SPIF_DOUT,
329 R18_1610_SPIF_DOUT,
330 N14_1610_SPIF_CS0,
331 N15_1610_SPIF_CS1,
332 T19_1610_SPIF_CS2,
333 P15_1610_SPIF_CS3,
334
335 /* OMAP-1610 Flash */
336 L3_1610_FLASH_CS2B_OE,
337 M8_1610_FLASH_CS2B_WE,
338
339 /* First MMC */
340 MMC_CMD,
341 MMC_DAT1,
342 MMC_DAT2,
343 MMC_DAT0,
344 MMC_CLK,
345 MMC_DAT3,
346
347 /* OMAP-1710 MMC CMDDIR and DATDIR0 */
348 M15_1710_MMC_CLKI,
349 P19_1710_MMC_CMDDIR,
350 P20_1710_MMC_DATDIR0,
351
352 /* OMAP-1610 USB0 alternate pin configuration */
353 W9_USB0_TXEN,
354 AA9_USB0_VP,
355 Y5_USB0_RCV,
356 R9_USB0_VM,
357 V6_USB0_TXD,
358 W5_USB0_SE0,
359 V9_USB0_SPEED,
360 V9_USB0_SUSP,
361
362 /* USB2 */
363 W9_USB2_TXEN,
364 AA9_USB2_VP,
365 Y5_USB2_RCV,
366 R9_USB2_VM,
367 V6_USB2_TXD,
368 W5_USB2_SE0,
369
370 /* 16XX UART */
371 R13_1610_UART1_TX,
372 V14_16XX_UART1_RX,
373 R14_1610_UART1_CTS,
374 AA15_1610_UART1_RTS,
375 R9_16XX_UART2_RX,
376 L14_16XX_UART3_RX,
377
378 /* I2C OMAP-1610 */
379 I2C_SCL,
380 I2C_SDA,
381
382 /* Keypad */
383 F18_1610_KBC0,
384 D20_1610_KBC1,
385 D19_1610_KBC2,
386 E18_1610_KBC3,
387 C21_1610_KBC4,
388 G18_1610_KBR0,
389 F19_1610_KBR1,
390 H14_1610_KBR2,
391 E20_1610_KBR3,
392 E19_1610_KBR4,
393 N19_1610_KBR5,
394
395 /* Power management */
396 T20_1610_LOW_PWR,
397
398 /* MCLK Settings */
399 V5_1710_MCLK_ON,
400 V5_1710_MCLK_OFF,
401 R10_1610_MCLK_ON,
402 R10_1610_MCLK_OFF,
403
404 /* CompactFlash controller */
405 P11_1610_CF_CD2,
406 R11_1610_CF_IOIS16,
407 V10_1610_CF_IREQ,
408 W10_1610_CF_RESET,
409 W11_1610_CF_CD1,
410
411 /* parallel camera */
412 J15_1610_CAM_LCLK,
413 J18_1610_CAM_D7,
414 J19_1610_CAM_D6,
415 J14_1610_CAM_D5,
416 K18_1610_CAM_D4,
417 K19_1610_CAM_D3,
418 K15_1610_CAM_D2,
419 K14_1610_CAM_D1,
420 L19_1610_CAM_D0,
421 L18_1610_CAM_VS,
422 L15_1610_CAM_HS,
423 M19_1610_CAM_RSTZ,
424 Y15_1610_CAM_OUTCLK,
425
426 /* serial camera */
427 H19_1610_CAM_EXCLK,
428 Y12_1610_CCP_CLKP,
429 W13_1610_CCP_CLKM,
430 W14_1610_CCP_DATAP,
431 Y14_1610_CCP_DATAM,
432
433};
434
435struct omap_mux_cfg {
436 struct pin_config *pins;
437 unsigned long size;
438 int (*cfg_reg)(const struct pin_config *cfg);
439};
440
441#ifdef CONFIG_OMAP_MUX
442/* setup pin muxing in Linux */
443extern int omap1_mux_init(void);
444extern int omap_mux_register(struct omap_mux_cfg *);
445extern int omap_cfg_reg(unsigned long reg_cfg);
446#else
447/* boot loader does it all (no warnings from CONFIG_OMAP_MUX_WARNINGS) */
448static inline int omap1_mux_init(void) { return 0; }
449static inline int omap_cfg_reg(unsigned long reg_cfg) { return 0; }
450#endif
451
452extern int omap2_mux_init(void);
453
454#endif
diff --git a/arch/arm/plat-omap/include/plat/nand.h b/arch/arm/plat-omap/include/plat/nand.h
new file mode 100644
index 00000000000..67fc5060183
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/nand.h
@@ -0,0 +1,44 @@
1/*
2 * arch/arm/plat-omap/include/mach/nand.h
3 *
4 * Copyright (C) 2006 Micron Technology Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#include <plat/gpmc.h>
12#include <linux/mtd/partitions.h>
13
14enum nand_io {
15 NAND_OMAP_PREFETCH_POLLED = 0, /* prefetch polled mode, default */
16 NAND_OMAP_POLLED, /* polled mode, without prefetch */
17 NAND_OMAP_PREFETCH_DMA, /* prefetch enabled sDMA mode */
18 NAND_OMAP_PREFETCH_IRQ /* prefetch enabled irq mode */
19};
20
21struct omap_nand_platform_data {
22 int cs;
23 struct mtd_partition *parts;
24 struct gpmc_timings *gpmc_t;
25 int nr_parts;
26 bool dev_ready;
27 int gpmc_irq;
28 enum nand_io xfer_type;
29 unsigned long phys_base;
30 int devsize;
31 enum omap_ecc ecc_opt;
32};
33
34/* minimum size for IO mapping */
35#define NAND_IO_SIZE 4
36
37#if defined(CONFIG_MTD_NAND_OMAP2) || defined(CONFIG_MTD_NAND_OMAP2_MODULE)
38extern int gpmc_nand_init(struct omap_nand_platform_data *d);
39#else
40static inline int gpmc_nand_init(struct omap_nand_platform_data *d)
41{
42 return 0;
43}
44#endif
diff --git a/arch/arm/plat-omap/include/plat/omap-alsa.h b/arch/arm/plat-omap/include/plat/omap-alsa.h
new file mode 100644
index 00000000000..b53055b390d
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/omap-alsa.h
@@ -0,0 +1,123 @@
1/*
2 * arch/arm/plat-omap/include/mach/omap-alsa.h
3 *
4 * Alsa Driver for AIC23 and TSC2101 codecs on OMAP platform boards.
5 *
6 * Copyright (C) 2006 Mika Laitio <lamikr@cc.jyu.fi>
7 *
8 * Copyright (C) 2005 Instituto Nokia de Tecnologia - INdT - Manaus Brazil
9 * Written by Daniel Petrini, David Cohen, Anderson Briglia
10 * {daniel.petrini, david.cohen, anderson.briglia}@indt.org.br
11 *
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version.
16 *
17 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
18 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
20 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
23 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
24 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * You should have received a copy of the GNU General Public License along
29 * with this program; if not, write to the Free Software Foundation, Inc.,
30 * 675 Mass Ave, Cambridge, MA 02139, USA.
31 *
32 * History
33 * -------
34 *
35 * 2005/07/25 INdT-10LE Kernel Team - Alsa driver for omap osk,
36 * original version based in sa1100 driver
37 * and omap oss driver.
38 */
39
40#ifndef __OMAP_ALSA_H
41#define __OMAP_ALSA_H
42
43#include <plat/dma.h>
44#include <sound/core.h>
45#include <sound/pcm.h>
46#include <plat/mcbsp.h>
47#include <linux/platform_device.h>
48
49#define DMA_BUF_SIZE (1024 * 8)
50
51/*
52 * Buffer management for alsa and dma
53 */
54struct audio_stream {
55 char *id; /* identification string */
56 int stream_id; /* numeric identification */
57 int dma_dev; /* dma number of that device */
58 int *lch; /* Chain of channels this stream is linked to */
59 char started; /* to store if the chain was started or not */
60 int dma_q_head; /* DMA Channel Q Head */
61 int dma_q_tail; /* DMA Channel Q Tail */
62 char dma_q_count; /* DMA Channel Q Count */
63 int active:1; /* we are using this stream for transfer now */
64 int period; /* current transfer period */
65 int periods; /* current count of periods registerd in the DMA engine */
66 spinlock_t dma_lock; /* for locking in DMA operations */
67 struct snd_pcm_substream *stream; /* the pcm stream */
68 unsigned linked:1; /* dma channels linked */
69 int offset; /* store start position of the last period in the alsa buffer */
70 int (*hw_start)(void); /* interface to start HW interface, e.g. McBSP */
71 int (*hw_stop)(void); /* interface to stop HW interface, e.g. McBSP */
72};
73
74/*
75 * Alsa card structure for aic23
76 */
77struct snd_card_omap_codec {
78 struct snd_card *card;
79 struct snd_pcm *pcm;
80 long samplerate;
81 struct audio_stream s[2]; /* playback & capture */
82};
83
84/* Codec specific information and function pointers.
85 * Codec (omap-alsa-aic23.c and omap-alsa-tsc2101.c)
86 * are responsible for defining the function pointers.
87 */
88struct omap_alsa_codec_config {
89 char *name;
90 struct omap_mcbsp_reg_cfg *mcbsp_regs_alsa;
91 struct snd_pcm_hw_constraint_list *hw_constraints_rates;
92 struct snd_pcm_hardware *snd_omap_alsa_playback;
93 struct snd_pcm_hardware *snd_omap_alsa_capture;
94 void (*codec_configure_dev)(void);
95 void (*codec_set_samplerate)(long);
96 void (*codec_clock_setup)(void);
97 int (*codec_clock_on)(void);
98 int (*codec_clock_off)(void);
99 int (*get_default_samplerate)(void);
100};
101
102/*********** Mixer function prototypes *************************/
103int snd_omap_mixer(struct snd_card_omap_codec *);
104void snd_omap_init_mixer(void);
105
106#ifdef CONFIG_PM
107void snd_omap_suspend_mixer(void);
108void snd_omap_resume_mixer(void);
109#endif
110
111int snd_omap_alsa_post_probe(struct platform_device *pdev, struct omap_alsa_codec_config *config);
112int snd_omap_alsa_remove(struct platform_device *pdev);
113#ifdef CONFIG_PM
114int snd_omap_alsa_suspend(struct platform_device *pdev, pm_message_t state);
115int snd_omap_alsa_resume(struct platform_device *pdev);
116#else
117#define snd_omap_alsa_suspend NULL
118#define snd_omap_alsa_resume NULL
119#endif
120
121void callback_omap_alsa_sound_dma(void *);
122
123#endif
diff --git a/arch/arm/plat-omap/include/plat/omap-pm.h b/arch/arm/plat-omap/include/plat/omap-pm.h
new file mode 100644
index 00000000000..0840df813f4
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/omap-pm.h
@@ -0,0 +1,352 @@
1/*
2 * omap-pm.h - OMAP power management interface
3 *
4 * Copyright (C) 2008-2010 Texas Instruments, Inc.
5 * Copyright (C) 2008-2010 Nokia Corporation
6 * Paul Walmsley
7 *
8 * Interface developed by (in alphabetical order): Karthik Dasu, Jouni
9 * Högander, Tony Lindgren, Rajendra Nayak, Sakari Poussa,
10 * Veeramanikandan Raju, Anand Sawant, Igor Stoppa, Paul Walmsley,
11 * Richard Woodruff
12 */
13
14#ifndef ASM_ARM_ARCH_OMAP_OMAP_PM_H
15#define ASM_ARM_ARCH_OMAP_OMAP_PM_H
16
17#include <linux/device.h>
18#include <linux/cpufreq.h>
19#include <linux/clk.h>
20#include <linux/opp.h>
21
22/*
23 * agent_id values for use with omap_pm_set_min_bus_tput():
24 *
25 * OCP_INITIATOR_AGENT is only valid for devices that can act as
26 * initiators -- it represents the device's L3 interconnect
27 * connection. OCP_TARGET_AGENT represents the device's L4
28 * interconnect connection.
29 */
30#define OCP_TARGET_AGENT 1
31#define OCP_INITIATOR_AGENT 2
32
33/**
34 * omap_pm_if_early_init - OMAP PM init code called before clock fw init
35 * @mpu_opp_table: array ptr to struct omap_opp for MPU
36 * @dsp_opp_table: array ptr to struct omap_opp for DSP
37 * @l3_opp_table : array ptr to struct omap_opp for CORE
38 *
39 * Initialize anything that must be configured before the clock
40 * framework starts. The "_if_" is to avoid name collisions with the
41 * PM idle-loop code.
42 */
43int __init omap_pm_if_early_init(void);
44
45/**
46 * omap_pm_if_init - OMAP PM init code called after clock fw init
47 *
48 * The main initialization code. OPP tables are passed in here. The
49 * "_if_" is to avoid name collisions with the PM idle-loop code.
50 */
51int __init omap_pm_if_init(void);
52
53/**
54 * omap_pm_if_exit - OMAP PM exit code
55 *
56 * Exit code; currently unused. The "_if_" is to avoid name
57 * collisions with the PM idle-loop code.
58 */
59void omap_pm_if_exit(void);
60
61/*
62 * Device-driver-originated constraints (via board-*.c files, platform_data)
63 */
64
65
66/**
67 * omap_pm_set_max_mpu_wakeup_lat - set the maximum MPU wakeup latency
68 * @dev: struct device * requesting the constraint
69 * @t: maximum MPU wakeup latency in microseconds
70 *
71 * Request that the maximum interrupt latency for the MPU to be no
72 * greater than @t microseconds. "Interrupt latency" in this case is
73 * defined as the elapsed time from the occurrence of a hardware or
74 * timer interrupt to the time when the device driver's interrupt
75 * service routine has been entered by the MPU.
76 *
77 * It is intended that underlying PM code will use this information to
78 * determine what power state to put the MPU powerdomain into, and
79 * possibly the CORE powerdomain as well, since interrupt handling
80 * code currently runs from SDRAM. Advanced PM or board*.c code may
81 * also configure interrupt controller priorities, OCP bus priorities,
82 * CPU speed(s), etc.
83 *
84 * This function will not affect device wakeup latency, e.g., time
85 * elapsed from when a device driver enables a hardware device with
86 * clk_enable(), to when the device is ready for register access or
87 * other use. To control this device wakeup latency, use
88 * omap_pm_set_max_dev_wakeup_lat()
89 *
90 * Multiple calls to omap_pm_set_max_mpu_wakeup_lat() will replace the
91 * previous t value. To remove the latency target for the MPU, call
92 * with t = -1.
93 *
94 * XXX This constraint will be deprecated soon in favor of the more
95 * general omap_pm_set_max_dev_wakeup_lat()
96 *
97 * Returns -EINVAL for an invalid argument, -ERANGE if the constraint
98 * is not satisfiable, or 0 upon success.
99 */
100int omap_pm_set_max_mpu_wakeup_lat(struct device *dev, long t);
101
102
103/**
104 * omap_pm_set_min_bus_tput - set minimum bus throughput needed by device
105 * @dev: struct device * requesting the constraint
106 * @tbus_id: interconnect to operate on (OCP_{INITIATOR,TARGET}_AGENT)
107 * @r: minimum throughput (in KiB/s)
108 *
109 * Request that the minimum data throughput on the OCP interconnect
110 * attached to device @dev interconnect agent @tbus_id be no less
111 * than @r KiB/s.
112 *
113 * It is expected that the OMAP PM or bus code will use this
114 * information to set the interconnect clock to run at the lowest
115 * possible speed that satisfies all current system users. The PM or
116 * bus code will adjust the estimate based on its model of the bus, so
117 * device driver authors should attempt to specify an accurate
118 * quantity for their device use case, and let the PM or bus code
119 * overestimate the numbers as necessary to handle request/response
120 * latency, other competing users on the system, etc. On OMAP2/3, if
121 * a driver requests a minimum L4 interconnect speed constraint, the
122 * code will also need to add an minimum L3 interconnect speed
123 * constraint,
124 *
125 * Multiple calls to omap_pm_set_min_bus_tput() will replace the
126 * previous rate value for this device. To remove the interconnect
127 * throughput restriction for this device, call with r = 0.
128 *
129 * Returns -EINVAL for an invalid argument, -ERANGE if the constraint
130 * is not satisfiable, or 0 upon success.
131 */
132int omap_pm_set_min_bus_tput(struct device *dev, u8 agent_id, unsigned long r);
133
134
135/**
136 * omap_pm_set_max_dev_wakeup_lat - set the maximum device enable latency
137 * @req_dev: struct device * requesting the constraint, or NULL if none
138 * @dev: struct device * to set the constraint one
139 * @t: maximum device wakeup latency in microseconds
140 *
141 * Request that the maximum amount of time necessary for a device @dev
142 * to become accessible after its clocks are enabled should be no
143 * greater than @t microseconds. Specifically, this represents the
144 * time from when a device driver enables device clocks with
145 * clk_enable(), to when the register reads and writes on the device
146 * will succeed. This function should be called before clk_disable()
147 * is called, since the power state transition decision may be made
148 * during clk_disable().
149 *
150 * It is intended that underlying PM code will use this information to
151 * determine what power state to put the powerdomain enclosing this
152 * device into.
153 *
154 * Multiple calls to omap_pm_set_max_dev_wakeup_lat() will replace the
155 * previous wakeup latency values for this device. To remove the
156 * wakeup latency restriction for this device, call with t = -1.
157 *
158 * Returns -EINVAL for an invalid argument, -ERANGE if the constraint
159 * is not satisfiable, or 0 upon success.
160 */
161int omap_pm_set_max_dev_wakeup_lat(struct device *req_dev, struct device *dev,
162 long t);
163
164
165/**
166 * omap_pm_set_max_sdma_lat - set the maximum system DMA transfer start latency
167 * @dev: struct device *
168 * @t: maximum DMA transfer start latency in microseconds
169 *
170 * Request that the maximum system DMA transfer start latency for this
171 * device 'dev' should be no greater than 't' microseconds. "DMA
172 * transfer start latency" here is defined as the elapsed time from
173 * when a device (e.g., McBSP) requests that a system DMA transfer
174 * start or continue, to the time at which data starts to flow into
175 * that device from the system DMA controller.
176 *
177 * It is intended that underlying PM code will use this information to
178 * determine what power state to put the CORE powerdomain into.
179 *
180 * Since system DMA transfers may not involve the MPU, this function
181 * will not affect MPU wakeup latency. Use set_max_cpu_lat() to do
182 * so. Similarly, this function will not affect device wakeup latency
183 * -- use set_max_dev_wakeup_lat() to affect that.
184 *
185 * Multiple calls to set_max_sdma_lat() will replace the previous t
186 * value for this device. To remove the maximum DMA latency for this
187 * device, call with t = -1.
188 *
189 * Returns -EINVAL for an invalid argument, -ERANGE if the constraint
190 * is not satisfiable, or 0 upon success.
191 */
192int omap_pm_set_max_sdma_lat(struct device *dev, long t);
193
194
195/**
196 * omap_pm_set_min_clk_rate - set minimum clock rate requested by @dev
197 * @dev: struct device * requesting the constraint
198 * @clk: struct clk * to set the minimum rate constraint on
199 * @r: minimum rate in Hz
200 *
201 * Request that the minimum clock rate on the device @dev's clk @clk
202 * be no less than @r Hz.
203 *
204 * It is expected that the OMAP PM code will use this information to
205 * find an OPP or clock setting that will satisfy this clock rate
206 * constraint, along with any other applicable system constraints on
207 * the clock rate or corresponding voltage, etc.
208 *
209 * omap_pm_set_min_clk_rate() differs from the clock code's
210 * clk_set_rate() in that it considers other constraints before taking
211 * any hardware action, and may change a system OPP rather than just a
212 * clock rate. clk_set_rate() is intended to be a low-level
213 * interface.
214 *
215 * omap_pm_set_min_clk_rate() is easily open to abuse. A better API
216 * would be something like "omap_pm_set_min_dev_performance()";
217 * however, there is no easily-generalizable concept of performance
218 * that applies to all devices. Only a device (and possibly the
219 * device subsystem) has both the subsystem-specific knowledge, and
220 * the hardware IP block-specific knowledge, to translate a constraint
221 * on "touchscreen sampling accuracy" or "number of pixels or polygons
222 * rendered per second" to a clock rate. This translation can be
223 * dependent on the hardware IP block's revision, or firmware version,
224 * and the driver is the only code on the system that has this
225 * information and can know how to translate that into a clock rate.
226 *
227 * The intended use-case for this function is for userspace or other
228 * kernel code to communicate a particular performance requirement to
229 * a subsystem; then for the subsystem to communicate that requirement
230 * to something that is meaningful to the device driver; then for the
231 * device driver to convert that requirement to a clock rate, and to
232 * then call omap_pm_set_min_clk_rate().
233 *
234 * Users of this function (such as device drivers) should not simply
235 * call this function with some high clock rate to ensure "high
236 * performance." Rather, the device driver should take a performance
237 * constraint from its subsystem, such as "render at least X polygons
238 * per second," and use some formula or table to convert that into a
239 * clock rate constraint given the hardware type and hardware
240 * revision. Device drivers or subsystems should not assume that they
241 * know how to make a power/performance tradeoff - some device use
242 * cases may tolerate a lower-fidelity device function for lower power
243 * consumption; others may demand a higher-fidelity device function,
244 * no matter what the power consumption.
245 *
246 * Multiple calls to omap_pm_set_min_clk_rate() will replace the
247 * previous rate value for the device @dev. To remove the minimum clock
248 * rate constraint for the device, call with r = 0.
249 *
250 * Returns -EINVAL for an invalid argument, -ERANGE if the constraint
251 * is not satisfiable, or 0 upon success.
252 */
253int omap_pm_set_min_clk_rate(struct device *dev, struct clk *c, long r);
254
255/*
256 * DSP Bridge-specific constraints
257 */
258
259/**
260 * omap_pm_dsp_get_opp_table - get OPP->DSP clock frequency table
261 *
262 * Intended for use by DSPBridge. Returns an array of OPP->DSP clock
263 * frequency entries. The final item in the array should have .rate =
264 * .opp_id = 0.
265 */
266const struct omap_opp *omap_pm_dsp_get_opp_table(void);
267
268/**
269 * omap_pm_dsp_set_min_opp - receive desired OPP target ID from DSP Bridge
270 * @opp_id: target DSP OPP ID
271 *
272 * Set a minimum OPP ID for the DSP. This is intended to be called
273 * only from the DSP Bridge MPU-side driver. Unfortunately, the only
274 * information that code receives from the DSP/BIOS load estimator is the
275 * target OPP ID; hence, this interface. No return value.
276 */
277void omap_pm_dsp_set_min_opp(u8 opp_id);
278
279/**
280 * omap_pm_dsp_get_opp - report the current DSP OPP ID
281 *
282 * Report the current OPP for the DSP. Since on OMAP3, the DSP and
283 * MPU share a single voltage domain, the OPP ID returned back may
284 * represent a higher DSP speed than the OPP requested via
285 * omap_pm_dsp_set_min_opp().
286 *
287 * Returns the current VDD1 OPP ID, or 0 upon error.
288 */
289u8 omap_pm_dsp_get_opp(void);
290
291
292/*
293 * CPUFreq-originated constraint
294 *
295 * In the future, this should be handled by custom OPP clocktype
296 * functions.
297 */
298
299/**
300 * omap_pm_cpu_get_freq_table - return a cpufreq_frequency_table array ptr
301 *
302 * Provide a frequency table usable by CPUFreq for the current chip/board.
303 * Returns a pointer to a struct cpufreq_frequency_table array or NULL
304 * upon error.
305 */
306struct cpufreq_frequency_table **omap_pm_cpu_get_freq_table(void);
307
308/**
309 * omap_pm_cpu_set_freq - set the current minimum MPU frequency
310 * @f: MPU frequency in Hz
311 *
312 * Set the current minimum CPU frequency. The actual CPU frequency
313 * used could end up higher if the DSP requested a higher OPP.
314 * Intended to be called by plat-omap/cpu_omap.c:omap_target(). No
315 * return value.
316 */
317void omap_pm_cpu_set_freq(unsigned long f);
318
319/**
320 * omap_pm_cpu_get_freq - report the current CPU frequency
321 *
322 * Returns the current MPU frequency, or 0 upon error.
323 */
324unsigned long omap_pm_cpu_get_freq(void);
325
326
327/*
328 * Device context loss tracking
329 */
330
331/**
332 * omap_pm_get_dev_context_loss_count - return count of times dev has lost ctx
333 * @dev: struct device *
334 *
335 * This function returns the number of times that the device @dev has
336 * lost its internal context. This generally occurs on a powerdomain
337 * transition to OFF. Drivers use this as an optimization to avoid restoring
338 * context if the device hasn't lost it. To use, drivers should initially
339 * call this in their context save functions and store the result. Early in
340 * the driver's context restore function, the driver should call this function
341 * again, and compare the result to the stored counter. If they differ, the
342 * driver must restore device context. If the number of context losses
343 * exceeds the maximum positive integer, the function will wrap to 0 and
344 * continue counting. Returns the number of context losses for this device,
345 * or zero upon error.
346 */
347u32 omap_pm_get_dev_context_loss_count(struct device *dev);
348
349void omap_pm_enable_off_mode(void);
350void omap_pm_disable_off_mode(void);
351
352#endif
diff --git a/arch/arm/plat-omap/include/plat/omap-serial.h b/arch/arm/plat-omap/include/plat/omap-serial.h
new file mode 100644
index 00000000000..2682043f5a5
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/omap-serial.h
@@ -0,0 +1,116 @@
1/*
2 * Driver for OMAP-UART controller.
3 * Based on drivers/serial/8250.c
4 *
5 * Copyright (C) 2010 Texas Instruments.
6 *
7 * Authors:
8 * Govindraj R <govindraj.raja@ti.com>
9 * Thara Gopinath <thara@ti.com>
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 */
16
17#ifndef __OMAP_SERIAL_H__
18#define __OMAP_SERIAL_H__
19
20#include <linux/serial_core.h>
21#include <linux/platform_device.h>
22
23#include <plat/mux.h>
24
25#define DRIVER_NAME "omap_uart"
26
27/*
28 * Use tty device name as ttyO, [O -> OMAP]
29 * in bootargs we specify as console=ttyO0 if uart1
30 * is used as console uart.
31 */
32#define OMAP_SERIAL_NAME "ttyO"
33
34#define OMAP_MODE13X_SPEED 230400
35
36/* WER = 0x7F
37 * Enable module level wakeup in WER reg
38 */
39#define OMAP_UART_WER_MOD_WKUP 0X7F
40
41/* Enable XON/XOFF flow control on output */
42#define OMAP_UART_SW_TX 0x04
43
44/* Enable XON/XOFF flow control on input */
45#define OMAP_UART_SW_RX 0x04
46
47#define OMAP_UART_SYSC_RESET 0X07
48#define OMAP_UART_TCR_TRIG 0X0F
49#define OMAP_UART_SW_CLR 0XF0
50#define OMAP_UART_FIFO_CLR 0X06
51
52#define OMAP_UART_DMA_CH_FREE -1
53
54#define RX_TIMEOUT (3 * HZ)
55#define OMAP_MAX_HSUART_PORTS 4
56
57#define MSR_SAVE_FLAGS UART_MSR_ANY_DELTA
58
59struct omap_uart_port_info {
60 bool dma_enabled; /* To specify DMA Mode */
61 unsigned int uartclk; /* UART clock rate */
62 void __iomem *membase; /* ioremap cookie or NULL */
63 resource_size_t mapbase; /* resource base */
64 unsigned long irqflags; /* request_irq flags */
65 upf_t flags; /* UPF_* flags */
66};
67
68struct uart_omap_dma {
69 u8 uart_dma_tx;
70 u8 uart_dma_rx;
71 int rx_dma_channel;
72 int tx_dma_channel;
73 dma_addr_t rx_buf_dma_phys;
74 dma_addr_t tx_buf_dma_phys;
75 unsigned int uart_base;
76 /*
77 * Buffer for rx dma.It is not required for tx because the buffer
78 * comes from port structure.
79 */
80 unsigned char *rx_buf;
81 unsigned int prev_rx_dma_pos;
82 int tx_buf_size;
83 int tx_dma_used;
84 int rx_dma_used;
85 spinlock_t tx_lock;
86 spinlock_t rx_lock;
87 /* timer to poll activity on rx dma */
88 struct timer_list rx_timer;
89 int rx_buf_size;
90 int rx_timeout;
91};
92
93struct uart_omap_port {
94 struct uart_port port;
95 struct uart_omap_dma uart_dma;
96 struct platform_device *pdev;
97
98 unsigned char ier;
99 unsigned char lcr;
100 unsigned char mcr;
101 unsigned char fcr;
102 unsigned char efr;
103
104 int use_dma;
105 /*
106 * Some bits in registers are cleared on a read, so they must
107 * be saved whenever the register is read but the bits will not
108 * be immediately processed.
109 */
110 unsigned int lsr_break_flag;
111 unsigned char msr_saved_flags;
112 char name[20];
113 unsigned long port_activity;
114};
115
116#endif /* __OMAP_SERIAL_H__ */
diff --git a/arch/arm/plat-omap/include/plat/omap1510.h b/arch/arm/plat-omap/include/plat/omap1510.h
new file mode 100644
index 00000000000..d2400466813
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/omap1510.h
@@ -0,0 +1,50 @@
1/* arch/arm/plat-omap/include/mach/omap1510.h
2 *
3 * Hardware definitions for TI OMAP1510 processor.
4 *
5 * Cleanup for Linux-2.6 by Dirk Behme <dirk.behme@de.bosch.com>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 *
12 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
13 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
14 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
15 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
17 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
18 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
19 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
20 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
21 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22 *
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 675 Mass Ave, Cambridge, MA 02139, USA.
26 */
27
28#ifndef __ASM_ARCH_OMAP15XX_H
29#define __ASM_ARCH_OMAP15XX_H
30
31/*
32 * ----------------------------------------------------------------------------
33 * Base addresses
34 * ----------------------------------------------------------------------------
35 */
36
37/* Syntax: XX_BASE = Virtual base address, XX_START = Physical base address */
38
39#define OMAP1510_DSP_BASE 0xE0000000
40#define OMAP1510_DSP_SIZE 0x28000
41#define OMAP1510_DSP_START 0xE0000000
42
43#define OMAP1510_DSPREG_BASE 0xE1000000
44#define OMAP1510_DSPREG_SIZE SZ_128K
45#define OMAP1510_DSPREG_START 0xE1000000
46
47#define OMAP1510_DSP_MMU_BASE (0xfffed200)
48
49#endif /* __ASM_ARCH_OMAP15XX_H */
50
diff --git a/arch/arm/plat-omap/include/plat/omap16xx.h b/arch/arm/plat-omap/include/plat/omap16xx.h
new file mode 100644
index 00000000000..e69e1d857b4
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/omap16xx.h
@@ -0,0 +1,202 @@
1/* arch/arm/plat-omap/include/mach/omap16xx.h
2 *
3 * Hardware definitions for TI OMAP1610/5912/1710 processors.
4 *
5 * Cleanup for Linux-2.6 by Dirk Behme <dirk.behme@de.bosch.com>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 *
12 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
13 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
14 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
15 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
17 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
18 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
19 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
20 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
21 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22 *
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 675 Mass Ave, Cambridge, MA 02139, USA.
26 */
27
28#ifndef __ASM_ARCH_OMAP16XX_H
29#define __ASM_ARCH_OMAP16XX_H
30
31/*
32 * ----------------------------------------------------------------------------
33 * Base addresses
34 * ----------------------------------------------------------------------------
35 */
36
37/* Syntax: XX_BASE = Virtual base address, XX_START = Physical base address */
38
39#define OMAP16XX_DSP_BASE 0xE0000000
40#define OMAP16XX_DSP_SIZE 0x28000
41#define OMAP16XX_DSP_START 0xE0000000
42
43#define OMAP16XX_DSPREG_BASE 0xE1000000
44#define OMAP16XX_DSPREG_SIZE SZ_128K
45#define OMAP16XX_DSPREG_START 0xE1000000
46
47#define OMAP16XX_SEC_BASE 0xFFFE4000
48#define OMAP16XX_SEC_DES (OMAP16XX_SEC_BASE + 0x0000)
49#define OMAP16XX_SEC_SHA1MD5 (OMAP16XX_SEC_BASE + 0x0800)
50#define OMAP16XX_SEC_RNG (OMAP16XX_SEC_BASE + 0x1000)
51
52/*
53 * ---------------------------------------------------------------------------
54 * Interrupts
55 * ---------------------------------------------------------------------------
56 */
57#define OMAP_IH2_0_BASE (0xfffe0000)
58#define OMAP_IH2_1_BASE (0xfffe0100)
59#define OMAP_IH2_2_BASE (0xfffe0200)
60#define OMAP_IH2_3_BASE (0xfffe0300)
61
62#define OMAP_IH2_0_ITR (OMAP_IH2_0_BASE + 0x00)
63#define OMAP_IH2_0_MIR (OMAP_IH2_0_BASE + 0x04)
64#define OMAP_IH2_0_SIR_IRQ (OMAP_IH2_0_BASE + 0x10)
65#define OMAP_IH2_0_SIR_FIQ (OMAP_IH2_0_BASE + 0x14)
66#define OMAP_IH2_0_CONTROL (OMAP_IH2_0_BASE + 0x18)
67#define OMAP_IH2_0_ILR0 (OMAP_IH2_0_BASE + 0x1c)
68#define OMAP_IH2_0_ISR (OMAP_IH2_0_BASE + 0x9c)
69
70#define OMAP_IH2_1_ITR (OMAP_IH2_1_BASE + 0x00)
71#define OMAP_IH2_1_MIR (OMAP_IH2_1_BASE + 0x04)
72#define OMAP_IH2_1_SIR_IRQ (OMAP_IH2_1_BASE + 0x10)
73#define OMAP_IH2_1_SIR_FIQ (OMAP_IH2_1_BASE + 0x14)
74#define OMAP_IH2_1_CONTROL (OMAP_IH2_1_BASE + 0x18)
75#define OMAP_IH2_1_ILR1 (OMAP_IH2_1_BASE + 0x1c)
76#define OMAP_IH2_1_ISR (OMAP_IH2_1_BASE + 0x9c)
77
78#define OMAP_IH2_2_ITR (OMAP_IH2_2_BASE + 0x00)
79#define OMAP_IH2_2_MIR (OMAP_IH2_2_BASE + 0x04)
80#define OMAP_IH2_2_SIR_IRQ (OMAP_IH2_2_BASE + 0x10)
81#define OMAP_IH2_2_SIR_FIQ (OMAP_IH2_2_BASE + 0x14)
82#define OMAP_IH2_2_CONTROL (OMAP_IH2_2_BASE + 0x18)
83#define OMAP_IH2_2_ILR2 (OMAP_IH2_2_BASE + 0x1c)
84#define OMAP_IH2_2_ISR (OMAP_IH2_2_BASE + 0x9c)
85
86#define OMAP_IH2_3_ITR (OMAP_IH2_3_BASE + 0x00)
87#define OMAP_IH2_3_MIR (OMAP_IH2_3_BASE + 0x04)
88#define OMAP_IH2_3_SIR_IRQ (OMAP_IH2_3_BASE + 0x10)
89#define OMAP_IH2_3_SIR_FIQ (OMAP_IH2_3_BASE + 0x14)
90#define OMAP_IH2_3_CONTROL (OMAP_IH2_3_BASE + 0x18)
91#define OMAP_IH2_3_ILR3 (OMAP_IH2_3_BASE + 0x1c)
92#define OMAP_IH2_3_ISR (OMAP_IH2_3_BASE + 0x9c)
93
94/*
95 * ----------------------------------------------------------------------------
96 * Clocks
97 * ----------------------------------------------------------------------------
98 */
99#define OMAP16XX_ARM_IDLECT3 (CLKGEN_REG_BASE + 0x24)
100
101/*
102 * ----------------------------------------------------------------------------
103 * Pin configuration registers
104 * ----------------------------------------------------------------------------
105 */
106#define OMAP16XX_CONF_VOLTAGE_VDDSHV6 (1 << 8)
107#define OMAP16XX_CONF_VOLTAGE_VDDSHV7 (1 << 9)
108#define OMAP16XX_CONF_VOLTAGE_VDDSHV8 (1 << 10)
109#define OMAP16XX_CONF_VOLTAGE_VDDSHV9 (1 << 11)
110#define OMAP16XX_SUBLVDS_CONF_VALID (1 << 13)
111
112/*
113 * ----------------------------------------------------------------------------
114 * System control registers
115 * ----------------------------------------------------------------------------
116 */
117#define OMAP1610_RESET_CONTROL 0xfffe1140
118
119/*
120 * ---------------------------------------------------------------------------
121 * TIPB bus interface
122 * ---------------------------------------------------------------------------
123 */
124#define TIPB_SWITCH_BASE (0xfffbc800)
125#define OMAP16XX_MMCSD2_SSW_MPU_CONF (TIPB_SWITCH_BASE + 0x160)
126
127/* UART3 Registers Mapping through MPU bus */
128#define UART3_RHR (OMAP1_UART3_BASE + 0)
129#define UART3_THR (OMAP1_UART3_BASE + 0)
130#define UART3_DLL (OMAP1_UART3_BASE + 0)
131#define UART3_IER (OMAP1_UART3_BASE + 4)
132#define UART3_DLH (OMAP1_UART3_BASE + 4)
133#define UART3_IIR (OMAP1_UART3_BASE + 8)
134#define UART3_FCR (OMAP1_UART3_BASE + 8)
135#define UART3_EFR (OMAP1_UART3_BASE + 8)
136#define UART3_LCR (OMAP1_UART3_BASE + 0x0C)
137#define UART3_MCR (OMAP1_UART3_BASE + 0x10)
138#define UART3_XON1_ADDR1 (OMAP1_UART3_BASE + 0x10)
139#define UART3_XON2_ADDR2 (OMAP1_UART3_BASE + 0x14)
140#define UART3_LSR (OMAP1_UART3_BASE + 0x14)
141#define UART3_TCR (OMAP1_UART3_BASE + 0x18)
142#define UART3_MSR (OMAP1_UART3_BASE + 0x18)
143#define UART3_XOFF1 (OMAP1_UART3_BASE + 0x18)
144#define UART3_XOFF2 (OMAP1_UART3_BASE + 0x1C)
145#define UART3_SPR (OMAP1_UART3_BASE + 0x1C)
146#define UART3_TLR (OMAP1_UART3_BASE + 0x1C)
147#define UART3_MDR1 (OMAP1_UART3_BASE + 0x20)
148#define UART3_MDR2 (OMAP1_UART3_BASE + 0x24)
149#define UART3_SFLSR (OMAP1_UART3_BASE + 0x28)
150#define UART3_TXFLL (OMAP1_UART3_BASE + 0x28)
151#define UART3_RESUME (OMAP1_UART3_BASE + 0x2C)
152#define UART3_TXFLH (OMAP1_UART3_BASE + 0x2C)
153#define UART3_SFREGL (OMAP1_UART3_BASE + 0x30)
154#define UART3_RXFLL (OMAP1_UART3_BASE + 0x30)
155#define UART3_SFREGH (OMAP1_UART3_BASE + 0x34)
156#define UART3_RXFLH (OMAP1_UART3_BASE + 0x34)
157#define UART3_BLR (OMAP1_UART3_BASE + 0x38)
158#define UART3_ACREG (OMAP1_UART3_BASE + 0x3C)
159#define UART3_DIV16 (OMAP1_UART3_BASE + 0x3C)
160#define UART3_SCR (OMAP1_UART3_BASE + 0x40)
161#define UART3_SSR (OMAP1_UART3_BASE + 0x44)
162#define UART3_EBLR (OMAP1_UART3_BASE + 0x48)
163#define UART3_OSC_12M_SEL (OMAP1_UART3_BASE + 0x4C)
164#define UART3_MVR (OMAP1_UART3_BASE + 0x50)
165
166/*
167 * ---------------------------------------------------------------------------
168 * Watchdog timer
169 * ---------------------------------------------------------------------------
170 */
171
172/* 32-bit Watchdog timer in OMAP 16XX */
173#define OMAP_16XX_WATCHDOG_BASE (0xfffeb000)
174#define OMAP_16XX_WIDR (OMAP_16XX_WATCHDOG_BASE + 0x00)
175#define OMAP_16XX_WD_SYSCONFIG (OMAP_16XX_WATCHDOG_BASE + 0x10)
176#define OMAP_16XX_WD_SYSSTATUS (OMAP_16XX_WATCHDOG_BASE + 0x14)
177#define OMAP_16XX_WCLR (OMAP_16XX_WATCHDOG_BASE + 0x24)
178#define OMAP_16XX_WCRR (OMAP_16XX_WATCHDOG_BASE + 0x28)
179#define OMAP_16XX_WLDR (OMAP_16XX_WATCHDOG_BASE + 0x2c)
180#define OMAP_16XX_WTGR (OMAP_16XX_WATCHDOG_BASE + 0x30)
181#define OMAP_16XX_WWPS (OMAP_16XX_WATCHDOG_BASE + 0x34)
182#define OMAP_16XX_WSPR (OMAP_16XX_WATCHDOG_BASE + 0x48)
183
184#define WCLR_PRE_SHIFT 5
185#define WCLR_PTV_SHIFT 2
186
187#define WWPS_W_PEND_WSPR (1 << 4)
188#define WWPS_W_PEND_WTGR (1 << 3)
189#define WWPS_W_PEND_WLDR (1 << 2)
190#define WWPS_W_PEND_WCRR (1 << 1)
191#define WWPS_W_PEND_WCLR (1 << 0)
192
193#define WSPR_ENABLE_0 (0x0000bbbb)
194#define WSPR_ENABLE_1 (0x00004444)
195#define WSPR_DISABLE_0 (0x0000aaaa)
196#define WSPR_DISABLE_1 (0x00005555)
197
198#define OMAP16XX_DSP_MMU_BASE (0xfffed200)
199#define OMAP16XX_MAILBOX_BASE (0xfffcf000)
200
201#endif /* __ASM_ARCH_OMAP16XX_H */
202
diff --git a/arch/arm/plat-omap/include/plat/omap24xx.h b/arch/arm/plat-omap/include/plat/omap24xx.h
new file mode 100644
index 00000000000..92df9e27cc5
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/omap24xx.h
@@ -0,0 +1,89 @@
1/*
2 * arch/arm/plat-omap/include/mach/omap24xx.h
3 *
4 * This file contains the processor specific definitions
5 * of the TI OMAP24XX.
6 *
7 * Copyright (C) 2007 Texas Instruments.
8 * Copyright (C) 2007 Nokia Corporation.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 *
24 */
25
26#ifndef __ASM_ARCH_OMAP2_H
27#define __ASM_ARCH_OMAP2_H
28
29/*
30 * Please place only base defines here and put the rest in device
31 * specific headers. Note also that some of these defines are needed
32 * for omap1 to compile without adding ifdefs.
33 */
34
35#define L4_24XX_BASE 0x48000000
36#define L4_WK_243X_BASE 0x49000000
37#define L3_24XX_BASE 0x68000000
38
39/* interrupt controller */
40#define OMAP24XX_IC_BASE (L4_24XX_BASE + 0xfe000)
41#define OMAP24XX_IVA_INTC_BASE 0x40000000
42
43#define OMAP242X_CTRL_BASE L4_24XX_BASE
44#define OMAP2420_32KSYNCT_BASE (L4_24XX_BASE + 0x4000)
45#define OMAP2420_PRCM_BASE (L4_24XX_BASE + 0x8000)
46#define OMAP2420_CM_BASE (L4_24XX_BASE + 0x8000)
47#define OMAP2420_PRM_BASE OMAP2420_CM_BASE
48#define OMAP2420_SDRC_BASE (L3_24XX_BASE + 0x9000)
49#define OMAP2420_SMS_BASE 0x68008000
50#define OMAP2420_GPMC_BASE 0x6800a000
51
52#define OMAP2430_32KSYNCT_BASE (L4_WK_243X_BASE + 0x20000)
53#define OMAP2430_PRCM_BASE (L4_WK_243X_BASE + 0x6000)
54#define OMAP2430_CM_BASE (L4_WK_243X_BASE + 0x6000)
55#define OMAP2430_PRM_BASE OMAP2430_CM_BASE
56
57#define OMAP243X_SMS_BASE 0x6C000000
58#define OMAP243X_SDRC_BASE 0x6D000000
59#define OMAP243X_GPMC_BASE 0x6E000000
60#define OMAP243X_SCM_BASE (L4_WK_243X_BASE + 0x2000)
61#define OMAP243X_CTRL_BASE OMAP243X_SCM_BASE
62#define OMAP243X_HS_BASE (L4_24XX_BASE + 0x000ac000)
63
64/* DSP SS */
65#define OMAP2420_DSP_BASE 0x58000000
66#define OMAP2420_DSP_MEM_BASE (OMAP2420_DSP_BASE + 0x0)
67#define OMAP2420_DSP_IPI_BASE (OMAP2420_DSP_BASE + 0x1000000)
68#define OMAP2420_DSP_MMU_BASE (OMAP2420_DSP_BASE + 0x2000000)
69
70#define OMAP243X_DSP_BASE 0x5C000000
71#define OMAP243X_DSP_MEM_BASE (OMAP243X_DSP_BASE + 0x0)
72#define OMAP243X_DSP_MMU_BASE (OMAP243X_DSP_BASE + 0x1000000)
73
74/* Mailbox */
75#define OMAP24XX_MAILBOX_BASE (L4_24XX_BASE + 0x94000)
76
77/* Camera */
78#define OMAP24XX_CAMERA_BASE (L4_24XX_BASE + 0x52000)
79
80/* Security */
81#define OMAP24XX_SEC_BASE (L4_24XX_BASE + 0xA0000)
82#define OMAP24XX_SEC_RNG_BASE (OMAP24XX_SEC_BASE + 0x0000)
83#define OMAP24XX_SEC_DES_BASE (OMAP24XX_SEC_BASE + 0x2000)
84#define OMAP24XX_SEC_SHA1MD5_BASE (OMAP24XX_SEC_BASE + 0x4000)
85#define OMAP24XX_SEC_AES_BASE (OMAP24XX_SEC_BASE + 0x6000)
86#define OMAP24XX_SEC_PKA_BASE (OMAP24XX_SEC_BASE + 0x8000)
87
88#endif /* __ASM_ARCH_OMAP2_H */
89
diff --git a/arch/arm/plat-omap/include/plat/omap34xx.h b/arch/arm/plat-omap/include/plat/omap34xx.h
new file mode 100644
index 00000000000..b9e85886b9d
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/omap34xx.h
@@ -0,0 +1,99 @@
1/*
2 * arch/arm/plat-omap/include/mach/omap34xx.h
3 *
4 * This file contains the processor specific definitions of the TI OMAP34XX.
5 *
6 * Copyright (C) 2007 Texas Instruments.
7 * Copyright (C) 2007 Nokia Corporation.
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 */
23
24#ifndef __ASM_ARCH_OMAP3_H
25#define __ASM_ARCH_OMAP3_H
26
27/*
28 * Please place only base defines here and put the rest in device
29 * specific headers.
30 */
31
32#define L4_34XX_BASE 0x48000000
33#define L4_WK_34XX_BASE 0x48300000
34#define L4_PER_34XX_BASE 0x49000000
35#define L4_EMU_34XX_BASE 0x54000000
36#define L3_34XX_BASE 0x68000000
37
38#define OMAP3430_32KSYNCT_BASE 0x48320000
39#define OMAP3430_CM_BASE 0x48004800
40#define OMAP3430_PRM_BASE 0x48306800
41#define OMAP343X_SMS_BASE 0x6C000000
42#define OMAP343X_SDRC_BASE 0x6D000000
43#define OMAP34XX_GPMC_BASE 0x6E000000
44#define OMAP343X_SCM_BASE 0x48002000
45#define OMAP343X_CTRL_BASE OMAP343X_SCM_BASE
46
47#define OMAP34XX_IC_BASE 0x48200000
48
49#define OMAP3430_ISP_BASE (L4_34XX_BASE + 0xBC000)
50#define OMAP3430_ISP_CBUFF_BASE (OMAP3430_ISP_BASE + 0x0100)
51#define OMAP3430_ISP_CCP2_BASE (OMAP3430_ISP_BASE + 0x0400)
52#define OMAP3430_ISP_CCDC_BASE (OMAP3430_ISP_BASE + 0x0600)
53#define OMAP3430_ISP_HIST_BASE (OMAP3430_ISP_BASE + 0x0A00)
54#define OMAP3430_ISP_H3A_BASE (OMAP3430_ISP_BASE + 0x0C00)
55#define OMAP3430_ISP_PREV_BASE (OMAP3430_ISP_BASE + 0x0E00)
56#define OMAP3430_ISP_RESZ_BASE (OMAP3430_ISP_BASE + 0x1000)
57#define OMAP3430_ISP_SBL_BASE (OMAP3430_ISP_BASE + 0x1200)
58#define OMAP3430_ISP_MMU_BASE (OMAP3430_ISP_BASE + 0x1400)
59#define OMAP3430_ISP_CSI2A_REGS1_BASE (OMAP3430_ISP_BASE + 0x1800)
60#define OMAP3430_ISP_CSIPHY2_BASE (OMAP3430_ISP_BASE + 0x1970)
61#define OMAP3630_ISP_CSI2A_REGS2_BASE (OMAP3430_ISP_BASE + 0x19C0)
62#define OMAP3630_ISP_CSI2C_REGS1_BASE (OMAP3430_ISP_BASE + 0x1C00)
63#define OMAP3630_ISP_CSIPHY1_BASE (OMAP3430_ISP_BASE + 0x1D70)
64#define OMAP3630_ISP_CSI2C_REGS2_BASE (OMAP3430_ISP_BASE + 0x1DC0)
65
66#define OMAP3430_ISP_END (OMAP3430_ISP_BASE + 0x06F)
67#define OMAP3430_ISP_CBUFF_END (OMAP3430_ISP_CBUFF_BASE + 0x077)
68#define OMAP3430_ISP_CCP2_END (OMAP3430_ISP_CCP2_BASE + 0x1EF)
69#define OMAP3430_ISP_CCDC_END (OMAP3430_ISP_CCDC_BASE + 0x0A7)
70#define OMAP3430_ISP_HIST_END (OMAP3430_ISP_HIST_BASE + 0x047)
71#define OMAP3430_ISP_H3A_END (OMAP3430_ISP_H3A_BASE + 0x05F)
72#define OMAP3430_ISP_PREV_END (OMAP3430_ISP_PREV_BASE + 0x09F)
73#define OMAP3430_ISP_RESZ_END (OMAP3430_ISP_RESZ_BASE + 0x0AB)
74#define OMAP3430_ISP_SBL_END (OMAP3430_ISP_SBL_BASE + 0x0FB)
75#define OMAP3430_ISP_MMU_END (OMAP3430_ISP_MMU_BASE + 0x06F)
76#define OMAP3430_ISP_CSI2A_REGS1_END (OMAP3430_ISP_CSI2A_REGS1_BASE + 0x16F)
77#define OMAP3430_ISP_CSIPHY2_END (OMAP3430_ISP_CSIPHY2_BASE + 0x00B)
78#define OMAP3630_ISP_CSI2A_REGS2_END (OMAP3630_ISP_CSI2A_REGS2_BASE + 0x3F)
79#define OMAP3630_ISP_CSI2C_REGS1_END (OMAP3630_ISP_CSI2C_REGS1_BASE + 0x16F)
80#define OMAP3630_ISP_CSIPHY1_END (OMAP3630_ISP_CSIPHY1_BASE + 0x00B)
81#define OMAP3630_ISP_CSI2C_REGS2_END (OMAP3630_ISP_CSI2C_REGS2_BASE + 0x3F)
82
83#define OMAP34XX_HSUSB_OTG_BASE (L4_34XX_BASE + 0xAB000)
84#define OMAP34XX_USBTLL_BASE (L4_34XX_BASE + 0x62000)
85#define OMAP34XX_UHH_CONFIG_BASE (L4_34XX_BASE + 0x64000)
86#define OMAP34XX_OHCI_BASE (L4_34XX_BASE + 0x64400)
87#define OMAP34XX_EHCI_BASE (L4_34XX_BASE + 0x64800)
88#define OMAP34XX_SR1_BASE 0x480C9000
89#define OMAP34XX_SR2_BASE 0x480CB000
90
91#define OMAP34XX_MAILBOX_BASE (L4_34XX_BASE + 0x94000)
92
93/* Security */
94#define OMAP34XX_SEC_BASE (L4_34XX_BASE + 0xA0000)
95#define OMAP34XX_SEC_SHA1MD5_BASE (OMAP34XX_SEC_BASE + 0x23000)
96#define OMAP34XX_SEC_AES_BASE (OMAP34XX_SEC_BASE + 0x25000)
97
98#endif /* __ASM_ARCH_OMAP3_H */
99
diff --git a/arch/arm/plat-omap/include/plat/omap4-keypad.h b/arch/arm/plat-omap/include/plat/omap4-keypad.h
new file mode 100644
index 00000000000..9fe6c878323
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/omap4-keypad.h
@@ -0,0 +1,15 @@
1#ifndef ARCH_ARM_PLAT_OMAP4_KEYPAD_H
2#define ARCH_ARM_PLAT_OMAP4_KEYPAD_H
3
4#include <linux/input/matrix_keypad.h>
5
6struct omap4_keypad_platform_data {
7 const struct matrix_keymap_data *keymap_data;
8
9 u8 rows;
10 u8 cols;
11};
12
13extern int omap4_keyboard_init(struct omap4_keypad_platform_data *,
14 struct omap_board_data *);
15#endif
diff --git a/arch/arm/plat-omap/include/plat/omap44xx.h b/arch/arm/plat-omap/include/plat/omap44xx.h
new file mode 100644
index 00000000000..ea2b8a6306e
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/omap44xx.h
@@ -0,0 +1,61 @@
1/*:
2 * Address mappings and base address for OMAP4 interconnects
3 * and peripherals.
4 *
5 * Copyright (C) 2009 Texas Instruments
6 *
7 * Author: Santosh Shilimkar <santosh.shilimkar@ti.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 */
13#ifndef __ASM_ARCH_OMAP44XX_H
14#define __ASM_ARCH_OMAP44XX_H
15
16/*
17 * Please place only base defines here and put the rest in device
18 * specific headers.
19 */
20#define L4_44XX_BASE 0x4a000000
21#define L4_WK_44XX_BASE 0x4a300000
22#define L4_PER_44XX_BASE 0x48000000
23#define L4_EMU_44XX_BASE 0x54000000
24#define L3_44XX_BASE 0x44000000
25#define OMAP44XX_EMIF1_BASE 0x4c000000
26#define OMAP44XX_EMIF2_BASE 0x4d000000
27#define OMAP44XX_DMM_BASE 0x4e000000
28#define OMAP4430_32KSYNCT_BASE 0x4a304000
29#define OMAP4430_CM1_BASE 0x4a004000
30#define OMAP4430_CM_BASE OMAP4430_CM1_BASE
31#define OMAP4430_CM2_BASE 0x4a008000
32#define OMAP4430_PRM_BASE 0x4a306000
33#define OMAP4430_PRCM_MPU_BASE 0x48243000
34#define OMAP44XX_GPMC_BASE 0x50000000
35#define OMAP443X_SCM_BASE 0x4a002000
36#define OMAP443X_CTRL_BASE 0x4a100000
37#define OMAP44XX_IC_BASE 0x48200000
38#define OMAP44XX_IVA_INTC_BASE 0x40000000
39#define IRQ_SIR_IRQ 0x0040
40#define OMAP44XX_GIC_DIST_BASE 0x48241000
41#define OMAP44XX_GIC_CPU_BASE 0x48240100
42#define OMAP44XX_SCU_BASE 0x48240000
43#define OMAP44XX_LOCAL_TWD_BASE 0x48240600
44#define OMAP44XX_L2CACHE_BASE 0x48242000
45#define OMAP44XX_WKUPGEN_BASE 0x48281000
46#define OMAP44XX_MCPDM_BASE 0x40132000
47#define OMAP44XX_MCPDM_L3_BASE 0x49032000
48
49#define OMAP44XX_MAILBOX_BASE (L4_44XX_BASE + 0xF4000)
50#define OMAP44XX_HSUSB_OTG_BASE (L4_44XX_BASE + 0xAB000)
51
52#define OMAP4_MMU1_BASE 0x55082000
53#define OMAP4_MMU2_BASE 0x4A066000
54
55#define OMAP44XX_USBTLL_BASE (L4_44XX_BASE + 0x62000)
56#define OMAP44XX_UHH_CONFIG_BASE (L4_44XX_BASE + 0x64000)
57#define OMAP44XX_HSUSB_OHCI_BASE (L4_44XX_BASE + 0x64800)
58#define OMAP44XX_HSUSB_EHCI_BASE (L4_44XX_BASE + 0x64C00)
59
60#endif /* __ASM_ARCH_OMAP44XX_H */
61
diff --git a/arch/arm/plat-omap/include/plat/omap730.h b/arch/arm/plat-omap/include/plat/omap730.h
new file mode 100644
index 00000000000..14272bc1a6f
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/omap730.h
@@ -0,0 +1,102 @@
1/* arch/arm/plat-omap/include/mach/omap730.h
2 *
3 * Hardware definitions for TI OMAP730 processor.
4 *
5 * Cleanup for Linux-2.6 by Dirk Behme <dirk.behme@de.bosch.com>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 *
12 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
13 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
14 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
15 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
17 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
18 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
19 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
20 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
21 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22 *
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 675 Mass Ave, Cambridge, MA 02139, USA.
26 */
27
28#ifndef __ASM_ARCH_OMAP730_H
29#define __ASM_ARCH_OMAP730_H
30
31/*
32 * ----------------------------------------------------------------------------
33 * Base addresses
34 * ----------------------------------------------------------------------------
35 */
36
37/* Syntax: XX_BASE = Virtual base address, XX_START = Physical base address */
38
39#define OMAP730_DSP_BASE 0xE0000000
40#define OMAP730_DSP_SIZE 0x50000
41#define OMAP730_DSP_START 0xE0000000
42
43#define OMAP730_DSPREG_BASE 0xE1000000
44#define OMAP730_DSPREG_SIZE SZ_128K
45#define OMAP730_DSPREG_START 0xE1000000
46
47/*
48 * ----------------------------------------------------------------------------
49 * OMAP730 specific configuration registers
50 * ----------------------------------------------------------------------------
51 */
52#define OMAP730_CONFIG_BASE 0xfffe1000
53#define OMAP730_IO_CONF_0 0xfffe1070
54#define OMAP730_IO_CONF_1 0xfffe1074
55#define OMAP730_IO_CONF_2 0xfffe1078
56#define OMAP730_IO_CONF_3 0xfffe107c
57#define OMAP730_IO_CONF_4 0xfffe1080
58#define OMAP730_IO_CONF_5 0xfffe1084
59#define OMAP730_IO_CONF_6 0xfffe1088
60#define OMAP730_IO_CONF_7 0xfffe108c
61#define OMAP730_IO_CONF_8 0xfffe1090
62#define OMAP730_IO_CONF_9 0xfffe1094
63#define OMAP730_IO_CONF_10 0xfffe1098
64#define OMAP730_IO_CONF_11 0xfffe109c
65#define OMAP730_IO_CONF_12 0xfffe10a0
66#define OMAP730_IO_CONF_13 0xfffe10a4
67
68#define OMAP730_MODE_1 0xfffe1010
69#define OMAP730_MODE_2 0xfffe1014
70
71/* CSMI specials: in terms of base + offset */
72#define OMAP730_MODE2_OFFSET 0x14
73
74/*
75 * ----------------------------------------------------------------------------
76 * OMAP730 traffic controller configuration registers
77 * ----------------------------------------------------------------------------
78 */
79#define OMAP730_FLASH_CFG_0 0xfffecc10
80#define OMAP730_FLASH_ACFG_0 0xfffecc50
81#define OMAP730_FLASH_CFG_1 0xfffecc14
82#define OMAP730_FLASH_ACFG_1 0xfffecc54
83
84/*
85 * ----------------------------------------------------------------------------
86 * OMAP730 DSP control registers
87 * ----------------------------------------------------------------------------
88 */
89#define OMAP730_ICR_BASE 0xfffbb800
90#define OMAP730_DSP_M_CTL 0xfffbb804
91#define OMAP730_DSP_MMU_BASE 0xfffed200
92
93/*
94 * ----------------------------------------------------------------------------
95 * OMAP730 PCC_UPLD configuration registers
96 * ----------------------------------------------------------------------------
97 */
98#define OMAP730_PCC_UPLD_CTRL_BASE (0xfffe0900)
99#define OMAP730_PCC_UPLD_CTRL (OMAP730_PCC_UPLD_CTRL_BASE + 0x00)
100
101#endif /* __ASM_ARCH_OMAP730_H */
102
diff --git a/arch/arm/plat-omap/include/plat/omap7xx.h b/arch/arm/plat-omap/include/plat/omap7xx.h
new file mode 100644
index 00000000000..48e4757e1e3
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/omap7xx.h
@@ -0,0 +1,107 @@
1/* arch/arm/plat-omap/include/mach/omap7xx.h
2 *
3 * Hardware definitions for TI OMAP7XX processor.
4 *
5 * Cleanup for Linux-2.6 by Dirk Behme <dirk.behme@de.bosch.com>
6 * Adapted for omap850 by Zebediah C. McClure <zmc@lurian.net>
7 * Adapted for omap7xx by Alistair Buxton <a.j.buxton@gmail.com>
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
13 *
14 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
15 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
16 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
17 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
20 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
21 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 *
25 * You should have received a copy of the GNU General Public License along
26 * with this program; if not, write to the Free Software Foundation, Inc.,
27 * 675 Mass Ave, Cambridge, MA 02139, USA.
28 */
29
30#ifndef __ASM_ARCH_OMAP7XX_H
31#define __ASM_ARCH_OMAP7XX_H
32
33/*
34 * ----------------------------------------------------------------------------
35 * Base addresses
36 * ----------------------------------------------------------------------------
37 */
38
39/* Syntax: XX_BASE = Virtual base address, XX_START = Physical base address */
40
41#define OMAP7XX_DSP_BASE 0xE0000000
42#define OMAP7XX_DSP_SIZE 0x50000
43#define OMAP7XX_DSP_START 0xE0000000
44
45#define OMAP7XX_DSPREG_BASE 0xE1000000
46#define OMAP7XX_DSPREG_SIZE SZ_128K
47#define OMAP7XX_DSPREG_START 0xE1000000
48
49#define OMAP7XX_SPI1_BASE 0xfffc0800
50#define OMAP7XX_SPI2_BASE 0xfffc1000
51
52/*
53 * ----------------------------------------------------------------------------
54 * OMAP7XX specific configuration registers
55 * ----------------------------------------------------------------------------
56 */
57#define OMAP7XX_CONFIG_BASE 0xfffe1000
58#define OMAP7XX_IO_CONF_0 0xfffe1070
59#define OMAP7XX_IO_CONF_1 0xfffe1074
60#define OMAP7XX_IO_CONF_2 0xfffe1078
61#define OMAP7XX_IO_CONF_3 0xfffe107c
62#define OMAP7XX_IO_CONF_4 0xfffe1080
63#define OMAP7XX_IO_CONF_5 0xfffe1084
64#define OMAP7XX_IO_CONF_6 0xfffe1088
65#define OMAP7XX_IO_CONF_7 0xfffe108c
66#define OMAP7XX_IO_CONF_8 0xfffe1090
67#define OMAP7XX_IO_CONF_9 0xfffe1094
68#define OMAP7XX_IO_CONF_10 0xfffe1098
69#define OMAP7XX_IO_CONF_11 0xfffe109c
70#define OMAP7XX_IO_CONF_12 0xfffe10a0
71#define OMAP7XX_IO_CONF_13 0xfffe10a4
72
73#define OMAP7XX_MODE_1 0xfffe1010
74#define OMAP7XX_MODE_2 0xfffe1014
75
76/* CSMI specials: in terms of base + offset */
77#define OMAP7XX_MODE2_OFFSET 0x14
78
79/*
80 * ----------------------------------------------------------------------------
81 * OMAP7XX traffic controller configuration registers
82 * ----------------------------------------------------------------------------
83 */
84#define OMAP7XX_FLASH_CFG_0 0xfffecc10
85#define OMAP7XX_FLASH_ACFG_0 0xfffecc50
86#define OMAP7XX_FLASH_CFG_1 0xfffecc14
87#define OMAP7XX_FLASH_ACFG_1 0xfffecc54
88
89/*
90 * ----------------------------------------------------------------------------
91 * OMAP7XX DSP control registers
92 * ----------------------------------------------------------------------------
93 */
94#define OMAP7XX_ICR_BASE 0xfffbb800
95#define OMAP7XX_DSP_M_CTL 0xfffbb804
96#define OMAP7XX_DSP_MMU_BASE 0xfffed200
97
98/*
99 * ----------------------------------------------------------------------------
100 * OMAP7XX PCC_UPLD configuration registers
101 * ----------------------------------------------------------------------------
102 */
103#define OMAP7XX_PCC_UPLD_CTRL_BASE (0xfffe0900)
104#define OMAP7XX_PCC_UPLD_CTRL (OMAP7XX_PCC_UPLD_CTRL_BASE + 0x00)
105
106#endif /* __ASM_ARCH_OMAP7XX_H */
107
diff --git a/arch/arm/plat-omap/include/plat/omap850.h b/arch/arm/plat-omap/include/plat/omap850.h
new file mode 100644
index 00000000000..c33f6798171
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/omap850.h
@@ -0,0 +1,102 @@
1/* arch/arm/plat-omap/include/mach/omap850.h
2 *
3 * Hardware definitions for TI OMAP850 processor.
4 *
5 * Derived from omap730.h by Zebediah C. McClure <zmc@lurian.net>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 *
12 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
13 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
14 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
15 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
17 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
18 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
19 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
20 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
21 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22 *
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 675 Mass Ave, Cambridge, MA 02139, USA.
26 */
27
28#ifndef __ASM_ARCH_OMAP850_H
29#define __ASM_ARCH_OMAP850_H
30
31/*
32 * ----------------------------------------------------------------------------
33 * Base addresses
34 * ----------------------------------------------------------------------------
35 */
36
37/* Syntax: XX_BASE = Virtual base address, XX_START = Physical base address */
38
39#define OMAP850_DSP_BASE 0xE0000000
40#define OMAP850_DSP_SIZE 0x50000
41#define OMAP850_DSP_START 0xE0000000
42
43#define OMAP850_DSPREG_BASE 0xE1000000
44#define OMAP850_DSPREG_SIZE SZ_128K
45#define OMAP850_DSPREG_START 0xE1000000
46
47/*
48 * ----------------------------------------------------------------------------
49 * OMAP850 specific configuration registers
50 * ----------------------------------------------------------------------------
51 */
52#define OMAP850_CONFIG_BASE 0xfffe1000
53#define OMAP850_IO_CONF_0 0xfffe1070
54#define OMAP850_IO_CONF_1 0xfffe1074
55#define OMAP850_IO_CONF_2 0xfffe1078
56#define OMAP850_IO_CONF_3 0xfffe107c
57#define OMAP850_IO_CONF_4 0xfffe1080
58#define OMAP850_IO_CONF_5 0xfffe1084
59#define OMAP850_IO_CONF_6 0xfffe1088
60#define OMAP850_IO_CONF_7 0xfffe108c
61#define OMAP850_IO_CONF_8 0xfffe1090
62#define OMAP850_IO_CONF_9 0xfffe1094
63#define OMAP850_IO_CONF_10 0xfffe1098
64#define OMAP850_IO_CONF_11 0xfffe109c
65#define OMAP850_IO_CONF_12 0xfffe10a0
66#define OMAP850_IO_CONF_13 0xfffe10a4
67
68#define OMAP850_MODE_1 0xfffe1010
69#define OMAP850_MODE_2 0xfffe1014
70
71/* CSMI specials: in terms of base + offset */
72#define OMAP850_MODE2_OFFSET 0x14
73
74/*
75 * ----------------------------------------------------------------------------
76 * OMAP850 traffic controller configuration registers
77 * ----------------------------------------------------------------------------
78 */
79#define OMAP850_FLASH_CFG_0 0xfffecc10
80#define OMAP850_FLASH_ACFG_0 0xfffecc50
81#define OMAP850_FLASH_CFG_1 0xfffecc14
82#define OMAP850_FLASH_ACFG_1 0xfffecc54
83
84/*
85 * ----------------------------------------------------------------------------
86 * OMAP850 DSP control registers
87 * ----------------------------------------------------------------------------
88 */
89#define OMAP850_ICR_BASE 0xfffbb800
90#define OMAP850_DSP_M_CTL 0xfffbb804
91#define OMAP850_DSP_MMU_BASE 0xfffed200
92
93/*
94 * ----------------------------------------------------------------------------
95 * OMAP850 PCC_UPLD configuration registers
96 * ----------------------------------------------------------------------------
97 */
98#define OMAP850_PCC_UPLD_CTRL_BASE (0xfffe0900)
99#define OMAP850_PCC_UPLD_CTRL (OMAP850_PCC_UPLD_CTRL_BASE + 0x00)
100
101#endif /* __ASM_ARCH_OMAP850_H */
102
diff --git a/arch/arm/plat-omap/include/plat/omap_device.h b/arch/arm/plat-omap/include/plat/omap_device.h
new file mode 100644
index 00000000000..ee405b36df4
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/omap_device.h
@@ -0,0 +1,162 @@
1/*
2 * omap_device headers
3 *
4 * Copyright (C) 2009 Nokia Corporation
5 * Paul Walmsley
6 *
7 * Developed in collaboration with (alphabetical order): Benoit
8 * Cousson, Kevin Hilman, Tony Lindgren, Rajendra Nayak, Vikram
9 * Pandita, Sakari Poussa, Anand Sawant, Santosh Shilimkar, Richard
10 * Woodruff
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License version 2 as
14 * published by the Free Software Foundation.
15 *
16 * Eventually this type of functionality should either be
17 * a) implemented via arch-specific pointers in platform_device
18 * or
19 * b) implemented as a proper omap_bus/omap_device in Linux, no more
20 * platform_device
21 *
22 * omap_device differs from omap_hwmod in that it includes external
23 * (e.g., board- and system-level) integration details. omap_hwmod
24 * stores hardware data that is invariant for a given OMAP chip.
25 *
26 * To do:
27 * - GPIO integration
28 * - regulator integration
29 *
30 */
31#ifndef __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_DEVICE_H
32#define __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_DEVICE_H
33
34#include <linux/kernel.h>
35#include <linux/platform_device.h>
36
37#include <plat/omap_hwmod.h>
38
39extern struct device omap_device_parent;
40
41/* omap_device._state values */
42#define OMAP_DEVICE_STATE_UNKNOWN 0
43#define OMAP_DEVICE_STATE_ENABLED 1
44#define OMAP_DEVICE_STATE_IDLE 2
45#define OMAP_DEVICE_STATE_SHUTDOWN 3
46
47/* omap_device.flags values */
48#define OMAP_DEVICE_SUSPENDED BIT(0)
49#define OMAP_DEVICE_NO_IDLE_ON_SUSPEND BIT(1)
50
51/**
52 * struct omap_device - omap_device wrapper for platform_devices
53 * @pdev: platform_device
54 * @hwmods: (one .. many per omap_device)
55 * @hwmods_cnt: ARRAY_SIZE() of @hwmods
56 * @pm_lats: ptr to an omap_device_pm_latency table
57 * @pm_lats_cnt: ARRAY_SIZE() of what is passed to @pm_lats
58 * @pm_lat_level: array index of the last odpl entry executed - -1 if never
59 * @dev_wakeup_lat: dev wakeup latency in nanoseconds
60 * @_dev_wakeup_lat_limit: dev wakeup latency limit in nsec - set by OMAP PM
61 * @_state: one of OMAP_DEVICE_STATE_* (see above)
62 * @flags: device flags
63 *
64 * Integrates omap_hwmod data into Linux platform_device.
65 *
66 * Field names beginning with underscores are for the internal use of
67 * the omap_device code.
68 *
69 */
70struct omap_device {
71 struct platform_device pdev;
72 struct omap_hwmod **hwmods;
73 struct omap_device_pm_latency *pm_lats;
74 u32 dev_wakeup_lat;
75 u32 _dev_wakeup_lat_limit;
76 u8 pm_lats_cnt;
77 s8 pm_lat_level;
78 u8 hwmods_cnt;
79 u8 _state;
80 u8 flags;
81};
82
83/* Device driver interface (call via platform_data fn ptrs) */
84
85int omap_device_enable(struct platform_device *pdev);
86int omap_device_idle(struct platform_device *pdev);
87int omap_device_shutdown(struct platform_device *pdev);
88
89/* Core code interface */
90
91int omap_device_count_resources(struct omap_device *od);
92int omap_device_fill_resources(struct omap_device *od, struct resource *res);
93
94struct omap_device *omap_device_build(const char *pdev_name, int pdev_id,
95 struct omap_hwmod *oh, void *pdata,
96 int pdata_len,
97 struct omap_device_pm_latency *pm_lats,
98 int pm_lats_cnt, int is_early_device);
99
100struct omap_device *omap_device_build_ss(const char *pdev_name, int pdev_id,
101 struct omap_hwmod **oh, int oh_cnt,
102 void *pdata, int pdata_len,
103 struct omap_device_pm_latency *pm_lats,
104 int pm_lats_cnt, int is_early_device);
105
106int omap_device_register(struct omap_device *od);
107int omap_early_device_register(struct omap_device *od);
108
109void __iomem *omap_device_get_rt_va(struct omap_device *od);
110
111/* OMAP PM interface */
112int omap_device_align_pm_lat(struct platform_device *pdev,
113 u32 new_wakeup_lat_limit);
114struct powerdomain *omap_device_get_pwrdm(struct omap_device *od);
115u32 omap_device_get_context_loss_count(struct platform_device *pdev);
116
117/* Other */
118
119int omap_device_idle_hwmods(struct omap_device *od);
120int omap_device_enable_hwmods(struct omap_device *od);
121
122int omap_device_disable_clocks(struct omap_device *od);
123int omap_device_enable_clocks(struct omap_device *od);
124
125static inline void omap_device_disable_idle_on_suspend(struct omap_device *od)
126{
127 od->flags |= OMAP_DEVICE_NO_IDLE_ON_SUSPEND;
128}
129
130/*
131 * Entries should be kept in latency order ascending
132 *
133 * deact_lat is the maximum number of microseconds required to complete
134 * deactivate_func() at the device's slowest OPP.
135 *
136 * act_lat is the maximum number of microseconds required to complete
137 * activate_func() at the device's slowest OPP.
138 *
139 * This will result in some suboptimal power management decisions at fast
140 * OPPs, but avoids having to recompute all device power management decisions
141 * if the system shifts from a fast OPP to a slow OPP (in order to meet
142 * latency requirements).
143 *
144 * XXX should deactivate_func/activate_func() take platform_device pointers
145 * rather than omap_device pointers?
146 */
147struct omap_device_pm_latency {
148 u32 deactivate_lat;
149 u32 deactivate_lat_worst;
150 int (*deactivate_func)(struct omap_device *od);
151 u32 activate_lat;
152 u32 activate_lat_worst;
153 int (*activate_func)(struct omap_device *od);
154 u32 flags;
155};
156
157#define OMAP_DEVICE_LATENCY_AUTO_ADJUST BIT(1)
158
159/* Get omap_device pointer from platform_device pointer */
160#define to_omap_device(x) container_of((x), struct omap_device, pdev)
161
162#endif
diff --git a/arch/arm/plat-omap/include/plat/omap_hwmod.h b/arch/arm/plat-omap/include/plat/omap_hwmod.h
new file mode 100644
index 00000000000..0e329ca88a7
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h
@@ -0,0 +1,619 @@
1/*
2 * omap_hwmod macros, structures
3 *
4 * Copyright (C) 2009-2011 Nokia Corporation
5 * Copyright (C) 2011 Texas Instruments, Inc.
6 * Paul Walmsley
7 *
8 * Created in collaboration with (alphabetical order): Benoît Cousson,
9 * Kevin Hilman, Tony Lindgren, Rajendra Nayak, Vikram Pandita, Sakari
10 * Poussa, Anand Sawant, Santosh Shilimkar, Richard Woodruff
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License version 2 as
14 * published by the Free Software Foundation.
15 *
16 * These headers and macros are used to define OMAP on-chip module
17 * data and their integration with other OMAP modules and Linux.
18 * Copious documentation and references can also be found in the
19 * omap_hwmod code, in arch/arm/mach-omap2/omap_hwmod.c (as of this
20 * writing).
21 *
22 * To do:
23 * - add interconnect error log structures
24 * - add pinmuxing
25 * - init_conn_id_bit (CONNID_BIT_VECTOR)
26 * - implement default hwmod SMS/SDRC flags?
27 * - move Linux-specific data ("non-ROM data") out
28 *
29 */
30#ifndef __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_HWMOD_H
31#define __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_HWMOD_H
32
33#include <linux/kernel.h>
34#include <linux/init.h>
35#include <linux/list.h>
36#include <linux/ioport.h>
37#include <linux/spinlock.h>
38#include <plat/cpu.h>
39
40struct omap_device;
41
42extern struct omap_hwmod_sysc_fields omap_hwmod_sysc_type1;
43extern struct omap_hwmod_sysc_fields omap_hwmod_sysc_type2;
44
45/*
46 * OCP SYSCONFIG bit shifts/masks TYPE1. These are for IPs compliant
47 * with the original PRCM protocol defined for OMAP2420
48 */
49#define SYSC_TYPE1_MIDLEMODE_SHIFT 12
50#define SYSC_TYPE1_MIDLEMODE_MASK (0x3 << SYSC_MIDLEMODE_SHIFT)
51#define SYSC_TYPE1_CLOCKACTIVITY_SHIFT 8
52#define SYSC_TYPE1_CLOCKACTIVITY_MASK (0x3 << SYSC_CLOCKACTIVITY_SHIFT)
53#define SYSC_TYPE1_SIDLEMODE_SHIFT 3
54#define SYSC_TYPE1_SIDLEMODE_MASK (0x3 << SYSC_SIDLEMODE_SHIFT)
55#define SYSC_TYPE1_ENAWAKEUP_SHIFT 2
56#define SYSC_TYPE1_ENAWAKEUP_MASK (1 << SYSC_ENAWAKEUP_SHIFT)
57#define SYSC_TYPE1_SOFTRESET_SHIFT 1
58#define SYSC_TYPE1_SOFTRESET_MASK (1 << SYSC_SOFTRESET_SHIFT)
59#define SYSC_TYPE1_AUTOIDLE_SHIFT 0
60#define SYSC_TYPE1_AUTOIDLE_MASK (1 << SYSC_AUTOIDLE_SHIFT)
61
62/*
63 * OCP SYSCONFIG bit shifts/masks TYPE2. These are for IPs compliant
64 * with the new PRCM protocol defined for new OMAP4 IPs.
65 */
66#define SYSC_TYPE2_SOFTRESET_SHIFT 0
67#define SYSC_TYPE2_SOFTRESET_MASK (1 << SYSC_TYPE2_SOFTRESET_SHIFT)
68#define SYSC_TYPE2_SIDLEMODE_SHIFT 2
69#define SYSC_TYPE2_SIDLEMODE_MASK (0x3 << SYSC_TYPE2_SIDLEMODE_SHIFT)
70#define SYSC_TYPE2_MIDLEMODE_SHIFT 4
71#define SYSC_TYPE2_MIDLEMODE_MASK (0x3 << SYSC_TYPE2_MIDLEMODE_SHIFT)
72
73/* OCP SYSSTATUS bit shifts/masks */
74#define SYSS_RESETDONE_SHIFT 0
75#define SYSS_RESETDONE_MASK (1 << SYSS_RESETDONE_SHIFT)
76
77/* Master standby/slave idle mode flags */
78#define HWMOD_IDLEMODE_FORCE (1 << 0)
79#define HWMOD_IDLEMODE_NO (1 << 1)
80#define HWMOD_IDLEMODE_SMART (1 << 2)
81#define HWMOD_IDLEMODE_SMART_WKUP (1 << 3)
82
83/* modulemode control type (SW or HW) */
84#define MODULEMODE_HWCTRL 1
85#define MODULEMODE_SWCTRL 2
86
87
88/**
89 * struct omap_hwmod_mux_info - hwmod specific mux configuration
90 * @pads: array of omap_device_pad entries
91 * @nr_pads: number of omap_device_pad entries
92 *
93 * Note that this is currently built during init as needed.
94 */
95struct omap_hwmod_mux_info {
96 int nr_pads;
97 struct omap_device_pad *pads;
98 int nr_pads_dynamic;
99 struct omap_device_pad **pads_dynamic;
100 bool enabled;
101};
102
103/**
104 * struct omap_hwmod_irq_info - MPU IRQs used by the hwmod
105 * @name: name of the IRQ channel (module local name)
106 * @irq: IRQ channel ID (should be non-negative except -1 = terminator)
107 *
108 * @name should be something short, e.g., "tx" or "rx". It is for use
109 * by platform_get_resource_byname(). It is defined locally to the
110 * hwmod.
111 */
112struct omap_hwmod_irq_info {
113 const char *name;
114 s16 irq;
115};
116
117/**
118 * struct omap_hwmod_dma_info - DMA channels used by the hwmod
119 * @name: name of the DMA channel (module local name)
120 * @dma_req: DMA request ID (should be non-negative except -1 = terminator)
121 *
122 * @name should be something short, e.g., "tx" or "rx". It is for use
123 * by platform_get_resource_byname(). It is defined locally to the
124 * hwmod.
125 */
126struct omap_hwmod_dma_info {
127 const char *name;
128 s16 dma_req;
129};
130
131/**
132 * struct omap_hwmod_rst_info - IPs reset lines use by hwmod
133 * @name: name of the reset line (module local name)
134 * @rst_shift: Offset of the reset bit
135 * @st_shift: Offset of the reset status bit (OMAP2/3 only)
136 *
137 * @name should be something short, e.g., "cpu0" or "rst". It is defined
138 * locally to the hwmod.
139 */
140struct omap_hwmod_rst_info {
141 const char *name;
142 u8 rst_shift;
143 u8 st_shift;
144};
145
146/**
147 * struct omap_hwmod_opt_clk - optional clocks used by this hwmod
148 * @role: "sys", "32k", "tv", etc -- for use in clk_get()
149 * @clk: opt clock: OMAP clock name
150 * @_clk: pointer to the struct clk (filled in at runtime)
151 *
152 * The module's interface clock and main functional clock should not
153 * be added as optional clocks.
154 */
155struct omap_hwmod_opt_clk {
156 const char *role;
157 const char *clk;
158 struct clk *_clk;
159};
160
161
162/* omap_hwmod_omap2_firewall.flags bits */
163#define OMAP_FIREWALL_L3 (1 << 0)
164#define OMAP_FIREWALL_L4 (1 << 1)
165
166/**
167 * struct omap_hwmod_omap2_firewall - OMAP2/3 device firewall data
168 * @l3_perm_bit: bit shift for L3_PM_*_PERMISSION_*
169 * @l4_fw_region: L4 firewall region ID
170 * @l4_prot_group: L4 protection group ID
171 * @flags: (see omap_hwmod_omap2_firewall.flags macros above)
172 */
173struct omap_hwmod_omap2_firewall {
174 u8 l3_perm_bit;
175 u8 l4_fw_region;
176 u8 l4_prot_group;
177 u8 flags;
178};
179
180
181/*
182 * omap_hwmod_addr_space.flags bits
183 *
184 * ADDR_MAP_ON_INIT: Map this address space during omap_hwmod init.
185 * ADDR_TYPE_RT: Address space contains module register target data.
186 */
187#define ADDR_MAP_ON_INIT (1 << 0) /* XXX does not belong */
188#define ADDR_TYPE_RT (1 << 1)
189
190/**
191 * struct omap_hwmod_addr_space - address space handled by the hwmod
192 * @name: name of the address space
193 * @pa_start: starting physical address
194 * @pa_end: ending physical address
195 * @flags: (see omap_hwmod_addr_space.flags macros above)
196 *
197 * Address space doesn't necessarily follow physical interconnect
198 * structure. GPMC is one example.
199 */
200struct omap_hwmod_addr_space {
201 const char *name;
202 u32 pa_start;
203 u32 pa_end;
204 u8 flags;
205};
206
207
208/*
209 * omap_hwmod_ocp_if.user bits: these indicate the initiators that use this
210 * interface to interact with the hwmod. Used to add sleep dependencies
211 * when the module is enabled or disabled.
212 */
213#define OCP_USER_MPU (1 << 0)
214#define OCP_USER_SDMA (1 << 1)
215
216/* omap_hwmod_ocp_if.flags bits */
217#define OCPIF_SWSUP_IDLE (1 << 0)
218#define OCPIF_CAN_BURST (1 << 1)
219
220/**
221 * struct omap_hwmod_ocp_if - OCP interface data
222 * @master: struct omap_hwmod that initiates OCP transactions on this link
223 * @slave: struct omap_hwmod that responds to OCP transactions on this link
224 * @addr: address space associated with this link
225 * @clk: interface clock: OMAP clock name
226 * @_clk: pointer to the interface struct clk (filled in at runtime)
227 * @fw: interface firewall data
228 * @width: OCP data width
229 * @user: initiators using this interface (see OCP_USER_* macros above)
230 * @flags: OCP interface flags (see OCPIF_* macros above)
231 *
232 * It may also be useful to add a tag_cnt field for OCP2.x devices.
233 *
234 * Parameter names beginning with an underscore are managed internally by
235 * the omap_hwmod code and should not be set during initialization.
236 */
237struct omap_hwmod_ocp_if {
238 struct omap_hwmod *master;
239 struct omap_hwmod *slave;
240 struct omap_hwmod_addr_space *addr;
241 const char *clk;
242 struct clk *_clk;
243 union {
244 struct omap_hwmod_omap2_firewall omap2;
245 } fw;
246 u8 width;
247 u8 user;
248 u8 flags;
249};
250
251
252/* Macros for use in struct omap_hwmod_sysconfig */
253
254/* Flags for use in omap_hwmod_sysconfig.idlemodes */
255#define MASTER_STANDBY_SHIFT 4
256#define SLAVE_IDLE_SHIFT 0
257#define SIDLE_FORCE (HWMOD_IDLEMODE_FORCE << SLAVE_IDLE_SHIFT)
258#define SIDLE_NO (HWMOD_IDLEMODE_NO << SLAVE_IDLE_SHIFT)
259#define SIDLE_SMART (HWMOD_IDLEMODE_SMART << SLAVE_IDLE_SHIFT)
260#define SIDLE_SMART_WKUP (HWMOD_IDLEMODE_SMART_WKUP << SLAVE_IDLE_SHIFT)
261#define MSTANDBY_FORCE (HWMOD_IDLEMODE_FORCE << MASTER_STANDBY_SHIFT)
262#define MSTANDBY_NO (HWMOD_IDLEMODE_NO << MASTER_STANDBY_SHIFT)
263#define MSTANDBY_SMART (HWMOD_IDLEMODE_SMART << MASTER_STANDBY_SHIFT)
264#define MSTANDBY_SMART_WKUP (HWMOD_IDLEMODE_SMART_WKUP << MASTER_STANDBY_SHIFT)
265
266/* omap_hwmod_sysconfig.sysc_flags capability flags */
267#define SYSC_HAS_AUTOIDLE (1 << 0)
268#define SYSC_HAS_SOFTRESET (1 << 1)
269#define SYSC_HAS_ENAWAKEUP (1 << 2)
270#define SYSC_HAS_EMUFREE (1 << 3)
271#define SYSC_HAS_CLOCKACTIVITY (1 << 4)
272#define SYSC_HAS_SIDLEMODE (1 << 5)
273#define SYSC_HAS_MIDLEMODE (1 << 6)
274#define SYSS_HAS_RESET_STATUS (1 << 7)
275#define SYSC_NO_CACHE (1 << 8) /* XXX SW flag, belongs elsewhere */
276#define SYSC_HAS_RESET_STATUS (1 << 9)
277
278/* omap_hwmod_sysconfig.clockact flags */
279#define CLOCKACT_TEST_BOTH 0x0
280#define CLOCKACT_TEST_MAIN 0x1
281#define CLOCKACT_TEST_ICLK 0x2
282#define CLOCKACT_TEST_NONE 0x3
283
284/**
285 * struct omap_hwmod_sysc_fields - hwmod OCP_SYSCONFIG register field offsets.
286 * @midle_shift: Offset of the midle bit
287 * @clkact_shift: Offset of the clockactivity bit
288 * @sidle_shift: Offset of the sidle bit
289 * @enwkup_shift: Offset of the enawakeup bit
290 * @srst_shift: Offset of the softreset bit
291 * @autoidle_shift: Offset of the autoidle bit
292 */
293struct omap_hwmod_sysc_fields {
294 u8 midle_shift;
295 u8 clkact_shift;
296 u8 sidle_shift;
297 u8 enwkup_shift;
298 u8 srst_shift;
299 u8 autoidle_shift;
300};
301
302/**
303 * struct omap_hwmod_class_sysconfig - hwmod class OCP_SYS* data
304 * @rev_offs: IP block revision register offset (from module base addr)
305 * @sysc_offs: OCP_SYSCONFIG register offset (from module base addr)
306 * @syss_offs: OCP_SYSSTATUS register offset (from module base addr)
307 * @idlemodes: One or more of {SIDLE,MSTANDBY}_{OFF,FORCE,SMART}
308 * @sysc_flags: SYS{C,S}_HAS* flags indicating SYSCONFIG bits supported
309 * @clockact: the default value of the module CLOCKACTIVITY bits
310 *
311 * @clockact describes to the module which clocks are likely to be
312 * disabled when the PRCM issues its idle request to the module. Some
313 * modules have separate clockdomains for the interface clock and main
314 * functional clock, and can check whether they should acknowledge the
315 * idle request based on the internal module functionality that has
316 * been associated with the clocks marked in @clockact. This field is
317 * only used if HWMOD_SET_DEFAULT_CLOCKACT is set (see below)
318 *
319 * @sysc_fields: structure containing the offset positions of various bits in
320 * SYSCONFIG register. This can be populated using omap_hwmod_sysc_type1 or
321 * omap_hwmod_sysc_type2 defined in omap_hwmod_common_data.c depending on
322 * whether the device ip is compliant with the original PRCM protocol
323 * defined for OMAP2420 or the new PRCM protocol for new OMAP4 IPs.
324 * If the device follows a different scheme for the sysconfig register ,
325 * then this field has to be populated with the correct offset structure.
326 */
327struct omap_hwmod_class_sysconfig {
328 u16 rev_offs;
329 u16 sysc_offs;
330 u16 syss_offs;
331 u16 sysc_flags;
332 u8 idlemodes;
333 u8 clockact;
334 struct omap_hwmod_sysc_fields *sysc_fields;
335};
336
337/**
338 * struct omap_hwmod_omap2_prcm - OMAP2/3-specific PRCM data
339 * @module_offs: PRCM submodule offset from the start of the PRM/CM
340 * @prcm_reg_id: PRCM register ID (e.g., 3 for CM_AUTOIDLE3)
341 * @module_bit: register bit shift for AUTOIDLE, WKST, WKEN, GRPSEL regs
342 * @idlest_reg_id: IDLEST register ID (e.g., 3 for CM_IDLEST3)
343 * @idlest_idle_bit: register bit shift for CM_IDLEST slave idle bit
344 * @idlest_stdby_bit: register bit shift for CM_IDLEST master standby bit
345 *
346 * @prcm_reg_id and @module_bit are specific to the AUTOIDLE, WKST,
347 * WKEN, GRPSEL registers. In an ideal world, no extra information
348 * would be needed for IDLEST information, but alas, there are some
349 * exceptions, so @idlest_reg_id, @idlest_idle_bit, @idlest_stdby_bit
350 * are needed for the IDLEST registers (c.f. 2430 I2CHS, 3430 USBHOST)
351 */
352struct omap_hwmod_omap2_prcm {
353 s16 module_offs;
354 u8 prcm_reg_id;
355 u8 module_bit;
356 u8 idlest_reg_id;
357 u8 idlest_idle_bit;
358 u8 idlest_stdby_bit;
359};
360
361
362/**
363 * struct omap_hwmod_omap4_prcm - OMAP4-specific PRCM data
364 * @clkctrl_reg: PRCM address of the clock control register
365 * @rstctrl_reg: address of the XXX_RSTCTRL register located in the PRM
366 * @submodule_wkdep_bit: bit shift of the WKDEP range
367 */
368struct omap_hwmod_omap4_prcm {
369 u16 clkctrl_offs;
370 u16 rstctrl_offs;
371 u16 context_offs;
372 u8 submodule_wkdep_bit;
373 u8 modulemode;
374};
375
376
377/*
378 * omap_hwmod.flags definitions
379 *
380 * HWMOD_SWSUP_SIDLE: omap_hwmod code should manually bring module in and out
381 * of idle, rather than relying on module smart-idle
382 * HWMOD_SWSUP_MSTDBY: omap_hwmod code should manually bring module in and out
383 * of standby, rather than relying on module smart-standby
384 * HWMOD_INIT_NO_RESET: don't reset this module at boot - important for
385 * SDRAM controller, etc. XXX probably belongs outside the main hwmod file
386 * XXX Should be HWMOD_SETUP_NO_RESET
387 * HWMOD_INIT_NO_IDLE: don't idle this module at boot - important for SDRAM
388 * controller, etc. XXX probably belongs outside the main hwmod file
389 * XXX Should be HWMOD_SETUP_NO_IDLE
390 * HWMOD_NO_OCP_AUTOIDLE: disable module autoidle (OCP_SYSCONFIG.AUTOIDLE)
391 * when module is enabled, rather than the default, which is to
392 * enable autoidle
393 * HWMOD_SET_DEFAULT_CLOCKACT: program CLOCKACTIVITY bits at startup
394 * HWMOD_NO_IDLEST: this module does not have idle status - this is the case
395 * only for few initiator modules on OMAP2 & 3.
396 * HWMOD_CONTROL_OPT_CLKS_IN_RESET: Enable all optional clocks during reset.
397 * This is needed for devices like DSS that require optional clocks enabled
398 * in order to complete the reset. Optional clocks will be disabled
399 * again after the reset.
400 * HWMOD_16BIT_REG: Module has 16bit registers
401 */
402#define HWMOD_SWSUP_SIDLE (1 << 0)
403#define HWMOD_SWSUP_MSTANDBY (1 << 1)
404#define HWMOD_INIT_NO_RESET (1 << 2)
405#define HWMOD_INIT_NO_IDLE (1 << 3)
406#define HWMOD_NO_OCP_AUTOIDLE (1 << 4)
407#define HWMOD_SET_DEFAULT_CLOCKACT (1 << 5)
408#define HWMOD_NO_IDLEST (1 << 6)
409#define HWMOD_CONTROL_OPT_CLKS_IN_RESET (1 << 7)
410#define HWMOD_16BIT_REG (1 << 8)
411
412/*
413 * omap_hwmod._int_flags definitions
414 * These are for internal use only and are managed by the omap_hwmod code.
415 *
416 * _HWMOD_NO_MPU_PORT: no path exists for the MPU to write to this module
417 * _HWMOD_WAKEUP_ENABLED: set when the omap_hwmod code has enabled ENAWAKEUP
418 * _HWMOD_SYSCONFIG_LOADED: set when the OCP_SYSCONFIG value has been cached
419 */
420#define _HWMOD_NO_MPU_PORT (1 << 0)
421#define _HWMOD_WAKEUP_ENABLED (1 << 1)
422#define _HWMOD_SYSCONFIG_LOADED (1 << 2)
423
424/*
425 * omap_hwmod._state definitions
426 *
427 * INITIALIZED: reset (optionally), initialized, enabled, disabled
428 * (optionally)
429 *
430 *
431 */
432#define _HWMOD_STATE_UNKNOWN 0
433#define _HWMOD_STATE_REGISTERED 1
434#define _HWMOD_STATE_CLKS_INITED 2
435#define _HWMOD_STATE_INITIALIZED 3
436#define _HWMOD_STATE_ENABLED 4
437#define _HWMOD_STATE_IDLE 5
438#define _HWMOD_STATE_DISABLED 6
439
440/**
441 * struct omap_hwmod_class - the type of an IP block
442 * @name: name of the hwmod_class
443 * @sysc: device SYSCONFIG/SYSSTATUS register data
444 * @rev: revision of the IP class
445 * @pre_shutdown: ptr to fn to be executed immediately prior to device shutdown
446 * @reset: ptr to fn to be executed in place of the standard hwmod reset fn
447 *
448 * Represent the class of a OMAP hardware "modules" (e.g. timer,
449 * smartreflex, gpio, uart...)
450 *
451 * @pre_shutdown is a function that will be run immediately before
452 * hwmod clocks are disabled, etc. It is intended for use for hwmods
453 * like the MPU watchdog, which cannot be disabled with the standard
454 * omap_hwmod_shutdown(). The function should return 0 upon success,
455 * or some negative error upon failure. Returning an error will cause
456 * omap_hwmod_shutdown() to abort the device shutdown and return an
457 * error.
458 *
459 * If @reset is defined, then the function it points to will be
460 * executed in place of the standard hwmod _reset() code in
461 * mach-omap2/omap_hwmod.c. This is needed for IP blocks which have
462 * unusual reset sequences - usually processor IP blocks like the IVA.
463 */
464struct omap_hwmod_class {
465 const char *name;
466 struct omap_hwmod_class_sysconfig *sysc;
467 u32 rev;
468 int (*pre_shutdown)(struct omap_hwmod *oh);
469 int (*reset)(struct omap_hwmod *oh);
470};
471
472/**
473 * struct omap_hwmod - integration data for OMAP hardware "modules" (IP blocks)
474 * @name: name of the hwmod
475 * @class: struct omap_hwmod_class * to the class of this hwmod
476 * @od: struct omap_device currently associated with this hwmod (internal use)
477 * @mpu_irqs: ptr to an array of MPU IRQs
478 * @sdma_reqs: ptr to an array of System DMA request IDs
479 * @prcm: PRCM data pertaining to this hwmod
480 * @main_clk: main clock: OMAP clock name
481 * @_clk: pointer to the main struct clk (filled in at runtime)
482 * @opt_clks: other device clocks that drivers can request (0..*)
483 * @vdd_name: voltage domain name
484 * @voltdm: pointer to voltage domain (filled in at runtime)
485 * @masters: ptr to array of OCP ifs that this hwmod can initiate on
486 * @slaves: ptr to array of OCP ifs that this hwmod can respond on
487 * @dev_attr: arbitrary device attributes that can be passed to the driver
488 * @_sysc_cache: internal-use hwmod flags
489 * @_mpu_rt_va: cached register target start address (internal use)
490 * @_mpu_port_index: cached MPU register target slave ID (internal use)
491 * @opt_clks_cnt: number of @opt_clks
492 * @master_cnt: number of @master entries
493 * @slaves_cnt: number of @slave entries
494 * @response_lat: device OCP response latency (in interface clock cycles)
495 * @_int_flags: internal-use hwmod flags
496 * @_state: internal-use hwmod state
497 * @_postsetup_state: internal-use state to leave the hwmod in after _setup()
498 * @flags: hwmod flags (documented below)
499 * @omap_chip: OMAP chips this hwmod is present on
500 * @_lock: spinlock serializing operations on this hwmod
501 * @node: list node for hwmod list (internal use)
502 *
503 * @main_clk refers to this module's "main clock," which for our
504 * purposes is defined as "the functional clock needed for register
505 * accesses to complete." Modules may not have a main clock if the
506 * interface clock also serves as a main clock.
507 *
508 * Parameter names beginning with an underscore are managed internally by
509 * the omap_hwmod code and should not be set during initialization.
510 */
511struct omap_hwmod {
512 const char *name;
513 struct omap_hwmod_class *class;
514 struct omap_device *od;
515 struct omap_hwmod_mux_info *mux;
516 struct omap_hwmod_irq_info *mpu_irqs;
517 struct omap_hwmod_dma_info *sdma_reqs;
518 struct omap_hwmod_rst_info *rst_lines;
519 union {
520 struct omap_hwmod_omap2_prcm omap2;
521 struct omap_hwmod_omap4_prcm omap4;
522 } prcm;
523 const char *main_clk;
524 struct clk *_clk;
525 struct omap_hwmod_opt_clk *opt_clks;
526 char *clkdm_name;
527 struct clockdomain *clkdm;
528 char *vdd_name;
529 struct voltagedomain *voltdm;
530 struct omap_hwmod_ocp_if **masters; /* connect to *_IA */
531 struct omap_hwmod_ocp_if **slaves; /* connect to *_TA */
532 void *dev_attr;
533 u32 _sysc_cache;
534 void __iomem *_mpu_rt_va;
535 spinlock_t _lock;
536 struct list_head node;
537 u16 flags;
538 u8 _mpu_port_index;
539 u8 response_lat;
540 u8 rst_lines_cnt;
541 u8 opt_clks_cnt;
542 u8 masters_cnt;
543 u8 slaves_cnt;
544 u8 hwmods_cnt;
545 u8 _int_flags;
546 u8 _state;
547 u8 _postsetup_state;
548 const struct omap_chip_id omap_chip;
549};
550
551int omap_hwmod_register(struct omap_hwmod **ohs);
552struct omap_hwmod *omap_hwmod_lookup(const char *name);
553int omap_hwmod_for_each(int (*fn)(struct omap_hwmod *oh, void *data),
554 void *data);
555
556int __init omap_hwmod_setup_one(const char *name);
557
558int omap_hwmod_enable(struct omap_hwmod *oh);
559int _omap_hwmod_enable(struct omap_hwmod *oh);
560int omap_hwmod_idle(struct omap_hwmod *oh);
561int _omap_hwmod_idle(struct omap_hwmod *oh);
562int omap_hwmod_shutdown(struct omap_hwmod *oh);
563
564int omap_hwmod_assert_hardreset(struct omap_hwmod *oh, const char *name);
565int omap_hwmod_deassert_hardreset(struct omap_hwmod *oh, const char *name);
566int omap_hwmod_read_hardreset(struct omap_hwmod *oh, const char *name);
567
568int omap_hwmod_enable_clocks(struct omap_hwmod *oh);
569int omap_hwmod_disable_clocks(struct omap_hwmod *oh);
570
571int omap_hwmod_set_slave_idlemode(struct omap_hwmod *oh, u8 idlemode);
572int omap_hwmod_set_ocp_autoidle(struct omap_hwmod *oh, u8 autoidle);
573
574int omap_hwmod_reset(struct omap_hwmod *oh);
575void omap_hwmod_ocp_barrier(struct omap_hwmod *oh);
576
577void omap_hwmod_write(u32 v, struct omap_hwmod *oh, u16 reg_offs);
578u32 omap_hwmod_read(struct omap_hwmod *oh, u16 reg_offs);
579int omap_hwmod_softreset(struct omap_hwmod *oh);
580
581int omap_hwmod_count_resources(struct omap_hwmod *oh);
582int omap_hwmod_fill_resources(struct omap_hwmod *oh, struct resource *res);
583
584struct powerdomain *omap_hwmod_get_pwrdm(struct omap_hwmod *oh);
585void __iomem *omap_hwmod_get_mpu_rt_va(struct omap_hwmod *oh);
586
587int omap_hwmod_add_initiator_dep(struct omap_hwmod *oh,
588 struct omap_hwmod *init_oh);
589int omap_hwmod_del_initiator_dep(struct omap_hwmod *oh,
590 struct omap_hwmod *init_oh);
591
592int omap_hwmod_set_clockact_both(struct omap_hwmod *oh);
593int omap_hwmod_set_clockact_main(struct omap_hwmod *oh);
594int omap_hwmod_set_clockact_iclk(struct omap_hwmod *oh);
595int omap_hwmod_set_clockact_none(struct omap_hwmod *oh);
596
597int omap_hwmod_enable_wakeup(struct omap_hwmod *oh);
598int omap_hwmod_disable_wakeup(struct omap_hwmod *oh);
599
600int omap_hwmod_for_each_by_class(const char *classname,
601 int (*fn)(struct omap_hwmod *oh,
602 void *user),
603 void *user);
604
605int omap_hwmod_set_postsetup_state(struct omap_hwmod *oh, u8 state);
606u32 omap_hwmod_get_context_loss_count(struct omap_hwmod *oh);
607
608int omap_hwmod_no_setup_reset(struct omap_hwmod *oh);
609
610/*
611 * Chip variant-specific hwmod init routines - XXX should be converted
612 * to use initcalls once the initial boot ordering is straightened out
613 */
614extern int omap2420_hwmod_init(void);
615extern int omap2430_hwmod_init(void);
616extern int omap3xxx_hwmod_init(void);
617extern int omap44xx_hwmod_init(void);
618
619#endif
diff --git a/arch/arm/plat-omap/include/plat/onenand.h b/arch/arm/plat-omap/include/plat/onenand.h
new file mode 100644
index 00000000000..2858667d2e4
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/onenand.h
@@ -0,0 +1,53 @@
1/*
2 * arch/arm/plat-omap/include/mach/onenand.h
3 *
4 * Copyright (C) 2006 Nokia Corporation
5 * Author: Juha Yrjola
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#include <linux/mtd/mtd.h>
13#include <linux/mtd/partitions.h>
14
15#define ONENAND_SYNC_READ (1 << 0)
16#define ONENAND_SYNC_READWRITE (1 << 1)
17
18struct onenand_freq_info {
19 u16 maf_id;
20 u16 dev_id;
21 u16 ver_id;
22};
23
24struct omap_onenand_platform_data {
25 int cs;
26 int gpio_irq;
27 struct mtd_partition *parts;
28 int nr_parts;
29 int (*onenand_setup)(void __iomem *, int *freq_ptr);
30 int (*get_freq)(const struct onenand_freq_info *freq_info,
31 bool *clk_dep);
32 int dma_channel;
33 u8 flags;
34 u8 regulator_can_sleep;
35 u8 skip_initial_unlocking;
36};
37
38#define ONENAND_MAX_PARTITIONS 8
39
40#if defined(CONFIG_MTD_ONENAND_OMAP2) || \
41 defined(CONFIG_MTD_ONENAND_OMAP2_MODULE)
42
43extern void gpmc_onenand_init(struct omap_onenand_platform_data *d);
44
45#else
46
47#define board_onenand_data NULL
48
49static inline void gpmc_onenand_init(struct omap_onenand_platform_data *d)
50{
51}
52
53#endif
diff --git a/arch/arm/plat-omap/include/plat/param.h b/arch/arm/plat-omap/include/plat/param.h
new file mode 100644
index 00000000000..1eb4dc32697
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/param.h
@@ -0,0 +1,8 @@
1/*
2 * arch/arm/plat-omap/include/mach/param.h
3 *
4 */
5
6#ifdef CONFIG_OMAP_32K_TIMER_HZ
7#define HZ CONFIG_OMAP_32K_TIMER_HZ
8#endif
diff --git a/arch/arm/plat-omap/include/plat/prcm.h b/arch/arm/plat-omap/include/plat/prcm.h
new file mode 100644
index 00000000000..267f43bb2a4
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/prcm.h
@@ -0,0 +1,37 @@
1/*
2 * arch/arm/plat-omap/include/mach/prcm.h
3 *
4 * Access definations for use in OMAP24XX clock and power management
5 *
6 * Copyright (C) 2005 Texas Instruments, Inc.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 *
22 * XXX This file is deprecated. The PRCM is an OMAP2+-only subsystem,
23 * so this file doesn't belong in plat-omap/include/plat. Please
24 * do not add anything new to this file.
25 */
26
27#ifndef __ASM_ARM_ARCH_OMAP_PRCM_H
28#define __ASM_ARM_ARCH_OMAP_PRCM_H
29
30u32 omap_prcm_get_reset_sources(void);
31int omap2_cm_wait_idlest(void __iomem *reg, u32 mask, u8 idlest,
32 const char *name);
33
34#endif
35
36
37
diff --git a/arch/arm/plat-omap/include/plat/sdrc.h b/arch/arm/plat-omap/include/plat/sdrc.h
new file mode 100644
index 00000000000..925b12b500d
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/sdrc.h
@@ -0,0 +1,165 @@
1#ifndef ____ASM_ARCH_SDRC_H
2#define ____ASM_ARCH_SDRC_H
3
4/*
5 * OMAP2/3 SDRC/SMS register definitions
6 *
7 * Copyright (C) 2007-2008 Texas Instruments, Inc.
8 * Copyright (C) 2007-2008 Nokia Corporation
9 *
10 * Tony Lindgren
11 * Paul Walmsley
12 * Richard Woodruff
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License version 2 as
16 * published by the Free Software Foundation.
17 */
18
19#include <mach/io.h>
20
21/* SDRC register offsets - read/write with sdrc_{read,write}_reg() */
22
23#define SDRC_SYSCONFIG 0x010
24#define SDRC_CS_CFG 0x040
25#define SDRC_SHARING 0x044
26#define SDRC_ERR_TYPE 0x04C
27#define SDRC_DLLA_CTRL 0x060
28#define SDRC_DLLA_STATUS 0x064
29#define SDRC_DLLB_CTRL 0x068
30#define SDRC_DLLB_STATUS 0x06C
31#define SDRC_POWER 0x070
32#define SDRC_MCFG_0 0x080
33#define SDRC_MR_0 0x084
34#define SDRC_EMR2_0 0x08c
35#define SDRC_ACTIM_CTRL_A_0 0x09c
36#define SDRC_ACTIM_CTRL_B_0 0x0a0
37#define SDRC_RFR_CTRL_0 0x0a4
38#define SDRC_MANUAL_0 0x0a8
39#define SDRC_MCFG_1 0x0B0
40#define SDRC_MR_1 0x0B4
41#define SDRC_EMR2_1 0x0BC
42#define SDRC_ACTIM_CTRL_A_1 0x0C4
43#define SDRC_ACTIM_CTRL_B_1 0x0C8
44#define SDRC_RFR_CTRL_1 0x0D4
45#define SDRC_MANUAL_1 0x0D8
46
47#define SDRC_POWER_AUTOCOUNT_SHIFT 8
48#define SDRC_POWER_AUTOCOUNT_MASK (0xffff << SDRC_POWER_AUTOCOUNT_SHIFT)
49#define SDRC_POWER_CLKCTRL_SHIFT 4
50#define SDRC_POWER_CLKCTRL_MASK (0x3 << SDRC_POWER_CLKCTRL_SHIFT)
51#define SDRC_SELF_REFRESH_ON_AUTOCOUNT (0x2 << SDRC_POWER_CLKCTRL_SHIFT)
52
53/*
54 * These values represent the number of memory clock cycles between
55 * autorefresh initiation. They assume 1 refresh per 64 ms (JEDEC), 8192
56 * rows per device, and include a subtraction of a 50 cycle window in the
57 * event that the autorefresh command is delayed due to other SDRC activity.
58 * The '| 1' sets the ARE field to send one autorefresh when the autorefresh
59 * counter reaches 0.
60 *
61 * These represent optimal values for common parts, it won't work for all.
62 * As long as you scale down, most parameters are still work, they just
63 * become sub-optimal. The RFR value goes in the opposite direction. If you
64 * don't adjust it down as your clock period increases the refresh interval
65 * will not be met. Setting all parameters for complete worst case may work,
66 * but may cut memory performance by 2x. Due to errata the DLLs need to be
67 * unlocked and their value needs run time calibration. A dynamic call is
68 * need for that as no single right value exists acorss production samples.
69 *
70 * Only the FULL speed values are given. Current code is such that rate
71 * changes must be made at DPLLoutx2. The actual value adjustment for low
72 * frequency operation will be handled by omap_set_performance()
73 *
74 * By having the boot loader boot up in the fastest L4 speed available likely
75 * will result in something which you can switch between.
76 */
77#define SDRC_RFR_CTRL_165MHz (0x00044c00 | 1)
78#define SDRC_RFR_CTRL_133MHz (0x0003de00 | 1)
79#define SDRC_RFR_CTRL_100MHz (0x0002da01 | 1)
80#define SDRC_RFR_CTRL_110MHz (0x0002da01 | 1) /* Need to calc */
81#define SDRC_RFR_CTRL_BYPASS (0x00005000 | 1) /* Need to calc */
82
83
84/*
85 * SMS register access
86 */
87
88#define OMAP242X_SMS_REGADDR(reg) \
89 (void __iomem *)OMAP2_L3_IO_ADDRESS(OMAP2420_SMS_BASE + reg)
90#define OMAP243X_SMS_REGADDR(reg) \
91 (void __iomem *)OMAP2_L3_IO_ADDRESS(OMAP243X_SMS_BASE + reg)
92#define OMAP343X_SMS_REGADDR(reg) \
93 (void __iomem *)OMAP2_L3_IO_ADDRESS(OMAP343X_SMS_BASE + reg)
94
95/* SMS register offsets - read/write with sms_{read,write}_reg() */
96
97#define SMS_SYSCONFIG 0x010
98#define SMS_ROT_CONTROL(context) (0x180 + 0x10 * context)
99#define SMS_ROT_SIZE(context) (0x184 + 0x10 * context)
100#define SMS_ROT_PHYSICAL_BA(context) (0x188 + 0x10 * context)
101/* REVISIT: fill in other SMS registers here */
102
103
104#ifndef __ASSEMBLER__
105
106/**
107 * struct omap_sdrc_params - SDRC parameters for a given SDRC clock rate
108 * @rate: SDRC clock rate (in Hz)
109 * @actim_ctrla: Value to program to SDRC_ACTIM_CTRLA for this rate
110 * @actim_ctrlb: Value to program to SDRC_ACTIM_CTRLB for this rate
111 * @rfr_ctrl: Value to program to SDRC_RFR_CTRL for this rate
112 * @mr: Value to program to SDRC_MR for this rate
113 *
114 * This structure holds a pre-computed set of register values for the
115 * SDRC for a given SDRC clock rate and SDRAM chip. These are
116 * intended to be pre-computed and specified in an array in the board-*.c
117 * files. The structure is keyed off the 'rate' field.
118 */
119struct omap_sdrc_params {
120 unsigned long rate;
121 u32 actim_ctrla;
122 u32 actim_ctrlb;
123 u32 rfr_ctrl;
124 u32 mr;
125};
126
127#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
128void omap2_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
129 struct omap_sdrc_params *sdrc_cs1);
130#else
131static inline void __init omap2_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
132 struct omap_sdrc_params *sdrc_cs1) {};
133#endif
134
135int omap2_sdrc_get_params(unsigned long r,
136 struct omap_sdrc_params **sdrc_cs0,
137 struct omap_sdrc_params **sdrc_cs1);
138void omap2_sms_save_context(void);
139void omap2_sms_restore_context(void);
140
141void omap2_sms_write_rot_control(u32 val, unsigned ctx);
142void omap2_sms_write_rot_size(u32 val, unsigned ctx);
143void omap2_sms_write_rot_physical_ba(u32 val, unsigned ctx);
144
145#ifdef CONFIG_ARCH_OMAP2
146
147struct memory_timings {
148 u32 m_type; /* ddr = 1, sdr = 0 */
149 u32 dll_mode; /* use lock mode = 1, unlock mode = 0 */
150 u32 slow_dll_ctrl; /* unlock mode, dll value for slow speed */
151 u32 fast_dll_ctrl; /* unlock mode, dll value for fast speed */
152 u32 base_cs; /* base chip select to use for calculations */
153};
154
155extern void omap2xxx_sdrc_init_params(u32 force_lock_to_unlock_mode);
156struct omap_sdrc_params *rx51_get_sdram_timings(void);
157
158u32 omap2xxx_sdrc_dll_is_unlocked(void);
159u32 omap2xxx_sdrc_reprogram(u32 level, u32 force);
160
161#endif /* CONFIG_ARCH_OMAP2 */
162
163#endif /* __ASSEMBLER__ */
164
165#endif
diff --git a/arch/arm/plat-omap/include/plat/serial.h b/arch/arm/plat-omap/include/plat/serial.h
new file mode 100644
index 00000000000..de3b10c1812
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/serial.h
@@ -0,0 +1,120 @@
1/*
2 * arch/arm/plat-omap/include/mach/serial.h
3 *
4 * Copyright (C) 2009 Texas Instruments
5 * Addded OMAP4 support- Santosh Shilimkar <santosh.shilimkar@ti.com>
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 */
12
13#ifndef __ASM_ARCH_SERIAL_H
14#define __ASM_ARCH_SERIAL_H
15
16#include <linux/init.h>
17
18/*
19 * Memory entry used for the DEBUG_LL UART configuration. See also
20 * uncompress.h and debug-macro.S.
21 *
22 * Note that using a memory location for storing the UART configuration
23 * has at least two limitations:
24 *
25 * 1. Kernel uncompress code cannot overlap OMAP_UART_INFO as the
26 * uncompress code could then partially overwrite itself
27 * 2. We assume printascii is called at least once before paging_init,
28 * and addruart has a chance to read OMAP_UART_INFO
29 */
30#define OMAP_UART_INFO (PLAT_PHYS_OFFSET + 0x3ffc)
31
32/* OMAP1 serial ports */
33#define OMAP1_UART1_BASE 0xfffb0000
34#define OMAP1_UART2_BASE 0xfffb0800
35#define OMAP1_UART3_BASE 0xfffb9800
36
37/* OMAP2 serial ports */
38#define OMAP2_UART1_BASE 0x4806a000
39#define OMAP2_UART2_BASE 0x4806c000
40#define OMAP2_UART3_BASE 0x4806e000
41
42/* OMAP3 serial ports */
43#define OMAP3_UART1_BASE OMAP2_UART1_BASE
44#define OMAP3_UART2_BASE OMAP2_UART2_BASE
45#define OMAP3_UART3_BASE 0x49020000
46#define OMAP3_UART4_BASE 0x49042000 /* Only on 36xx */
47
48/* OMAP4 serial ports */
49#define OMAP4_UART1_BASE OMAP2_UART1_BASE
50#define OMAP4_UART2_BASE OMAP2_UART2_BASE
51#define OMAP4_UART3_BASE 0x48020000
52#define OMAP4_UART4_BASE 0x4806e000
53
54/* TI816X serial ports */
55#define TI816X_UART1_BASE 0x48020000
56#define TI816X_UART2_BASE 0x48022000
57#define TI816X_UART3_BASE 0x48024000
58
59/* AM3505/3517 UART4 */
60#define AM35XX_UART4_BASE 0x4809E000 /* Only on AM3505/3517 */
61
62/* External port on Zoom2/3 */
63#define ZOOM_UART_BASE 0x10000000
64#define ZOOM_UART_VIRT 0xfa400000
65
66#define OMAP_PORT_SHIFT 2
67#define OMAP7XX_PORT_SHIFT 0
68#define ZOOM_PORT_SHIFT 1
69
70#define OMAP1510_BASE_BAUD (12000000/16)
71#define OMAP16XX_BASE_BAUD (48000000/16)
72#define OMAP24XX_BASE_BAUD (48000000/16)
73
74/*
75 * DEBUG_LL port encoding stored into the UART1 scratchpad register by
76 * decomp_setup in uncompress.h
77 */
78#define OMAP1UART1 11
79#define OMAP1UART2 12
80#define OMAP1UART3 13
81#define OMAP2UART1 21
82#define OMAP2UART2 22
83#define OMAP2UART3 23
84#define OMAP3UART1 OMAP2UART1
85#define OMAP3UART2 OMAP2UART2
86#define OMAP3UART3 33
87#define OMAP3UART4 34 /* Only on 36xx */
88#define OMAP4UART1 OMAP2UART1
89#define OMAP4UART2 OMAP2UART2
90#define OMAP4UART3 43
91#define OMAP4UART4 44
92#define TI816XUART1 81
93#define TI816XUART2 82
94#define TI816XUART3 83
95#define ZOOM_UART 95 /* Only on zoom2/3 */
96
97/* This is only used by 8250.c for omap1510 */
98#define is_omap_port(pt) ({int __ret = 0; \
99 if ((pt)->port.mapbase == OMAP1_UART1_BASE || \
100 (pt)->port.mapbase == OMAP1_UART2_BASE || \
101 (pt)->port.mapbase == OMAP1_UART3_BASE) \
102 __ret = 1; \
103 __ret; \
104 })
105
106#ifndef __ASSEMBLER__
107
108struct omap_board_data;
109
110extern void omap_serial_init(void);
111extern void omap_serial_init_port(struct omap_board_data *bdata);
112extern int omap_uart_can_sleep(void);
113extern void omap_uart_check_wakeup(void);
114extern void omap_uart_prepare_suspend(void);
115extern void omap_uart_prepare_idle(int num);
116extern void omap_uart_resume_idle(int num);
117extern void omap_uart_enable_irqs(int enable);
118#endif
119
120#endif
diff --git a/arch/arm/plat-omap/include/plat/system.h b/arch/arm/plat-omap/include/plat/system.h
new file mode 100644
index 00000000000..c5fa9e92900
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/system.h
@@ -0,0 +1,17 @@
1/*
2 * Copied from arch/arm/mach-sa1100/include/mach/system.h
3 * Copyright (c) 1999 Nicolas Pitre <nico@fluxnic.net>
4 */
5#ifndef __ASM_ARCH_SYSTEM_H
6#define __ASM_ARCH_SYSTEM_H
7
8#include <asm/proc-fns.h>
9
10static inline void arch_idle(void)
11{
12 cpu_do_idle();
13}
14
15extern void (*arch_reset)(char, const char *);
16
17#endif
diff --git a/arch/arm/plat-omap/include/plat/tc.h b/arch/arm/plat-omap/include/plat/tc.h
new file mode 100644
index 00000000000..d2fcd789bb9
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/tc.h
@@ -0,0 +1,106 @@
1/*
2 * arch/arm/plat-omap/include/mach/tc.h
3 *
4 * OMAP Traffic Controller
5 *
6 * Copyright (C) 2004 Nokia Corporation
7 * Author: Imre Deak <imre.deak@nokia.com>
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 */
23
24#ifndef __ASM_ARCH_TC_H
25#define __ASM_ARCH_TC_H
26
27#define TCMIF_BASE 0xfffecc00
28#define OMAP_TC_OCPT1_PRIOR (TCMIF_BASE + 0x00)
29#define OMAP_TC_EMIFS_PRIOR (TCMIF_BASE + 0x04)
30#define OMAP_TC_EMIFF_PRIOR (TCMIF_BASE + 0x08)
31#define EMIFS_CONFIG (TCMIF_BASE + 0x0c)
32#define EMIFS_CS0_CONFIG (TCMIF_BASE + 0x10)
33#define EMIFS_CS1_CONFIG (TCMIF_BASE + 0x14)
34#define EMIFS_CS2_CONFIG (TCMIF_BASE + 0x18)
35#define EMIFS_CS3_CONFIG (TCMIF_BASE + 0x1c)
36#define EMIFF_SDRAM_CONFIG (TCMIF_BASE + 0x20)
37#define EMIFF_MRS (TCMIF_BASE + 0x24)
38#define TC_TIMEOUT1 (TCMIF_BASE + 0x28)
39#define TC_TIMEOUT2 (TCMIF_BASE + 0x2c)
40#define TC_TIMEOUT3 (TCMIF_BASE + 0x30)
41#define TC_ENDIANISM (TCMIF_BASE + 0x34)
42#define EMIFF_SDRAM_CONFIG_2 (TCMIF_BASE + 0x3c)
43#define EMIF_CFG_DYNAMIC_WS (TCMIF_BASE + 0x40)
44#define EMIFS_ACS0 (TCMIF_BASE + 0x50)
45#define EMIFS_ACS1 (TCMIF_BASE + 0x54)
46#define EMIFS_ACS2 (TCMIF_BASE + 0x58)
47#define EMIFS_ACS3 (TCMIF_BASE + 0x5c)
48#define OMAP_TC_OCPT2_PRIOR (TCMIF_BASE + 0xd0)
49
50/* external EMIFS chipselect regions */
51#define OMAP_CS0_PHYS 0x00000000
52#define OMAP_CS0_SIZE SZ_64M
53
54#define OMAP_CS1_PHYS 0x04000000
55#define OMAP_CS1_SIZE SZ_64M
56
57#define OMAP_CS1A_PHYS OMAP_CS1_PHYS
58#define OMAP_CS1A_SIZE SZ_32M
59
60#define OMAP_CS1B_PHYS (OMAP_CS1A_PHYS + OMAP_CS1A_SIZE)
61#define OMAP_CS1B_SIZE SZ_32M
62
63#define OMAP_CS2_PHYS 0x08000000
64#define OMAP_CS2_SIZE SZ_64M
65
66#define OMAP_CS2A_PHYS OMAP_CS2_PHYS
67#define OMAP_CS2A_SIZE SZ_32M
68
69#define OMAP_CS2B_PHYS (OMAP_CS2A_PHYS + OMAP_CS2A_SIZE)
70#define OMAP_CS2B_SIZE SZ_32M
71
72#define OMAP_CS3_PHYS 0x0c000000
73#define OMAP_CS3_SIZE SZ_64M
74
75#ifndef __ASSEMBLER__
76
77/* EMIF Slow Interface Configuration Register */
78#define OMAP_EMIFS_CONFIG_FR (1 << 4)
79#define OMAP_EMIFS_CONFIG_PDE (1 << 3)
80#define OMAP_EMIFS_CONFIG_PWD_EN (1 << 2)
81#define OMAP_EMIFS_CONFIG_BM (1 << 1)
82#define OMAP_EMIFS_CONFIG_WP (1 << 0)
83
84#define EMIFS_CCS(n) (EMIFS_CS0_CONFIG + (4 * (n)))
85#define EMIFS_ACS(n) (EMIFS_ACS0 + (4 * (n)))
86
87/* Almost all documentation for chip and board memory maps assumes
88 * BM is clear. Most devel boards have a switch to control booting
89 * from NOR flash (using external chipselect 3) rather than mask ROM,
90 * which uses BM to interchange the physical CS0 and CS3 addresses.
91 */
92static inline u32 omap_cs0_phys(void)
93{
94 return (omap_readl(EMIFS_CONFIG) & OMAP_EMIFS_CONFIG_BM)
95 ? OMAP_CS3_PHYS : 0;
96}
97
98static inline u32 omap_cs3_phys(void)
99{
100 return (omap_readl(EMIFS_CONFIG) & OMAP_EMIFS_CONFIG_BM)
101 ? 0 : OMAP_CS3_PHYS;
102}
103
104#endif /* __ASSEMBLER__ */
105
106#endif /* __ASM_ARCH_TC_H */
diff --git a/arch/arm/plat-omap/include/plat/ti816x.h b/arch/arm/plat-omap/include/plat/ti816x.h
new file mode 100644
index 00000000000..50510f5dda1
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/ti816x.h
@@ -0,0 +1,27 @@
1/*
2 * This file contains the address data for various TI816X modules.
3 *
4 * Copyright (C) 2010 Texas Instruments, Inc. - http://www.ti.com/
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
16#ifndef __ASM_ARCH_TI816X_H
17#define __ASM_ARCH_TI816X_H
18
19#define L4_SLOW_TI816X_BASE 0x48000000
20
21#define TI816X_SCM_BASE 0x48140000
22#define TI816X_CTRL_BASE TI816X_SCM_BASE
23#define TI816X_PRCM_BASE 0x48180000
24
25#define TI816X_ARM_INTC_BASE 0x48200000
26
27#endif /* __ASM_ARCH_TI816X_H */
diff --git a/arch/arm/plat-omap/include/plat/uncompress.h b/arch/arm/plat-omap/include/plat/uncompress.h
new file mode 100644
index 00000000000..a067484cc4a
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/uncompress.h
@@ -0,0 +1,184 @@
1/*
2 * arch/arm/plat-omap/include/mach/uncompress.h
3 *
4 * Serial port stubs for kernel decompress status messages
5 *
6 * Initially based on:
7 * linux-2.4.15-rmk1-dsplinux1.6/arch/arm/plat-omap/include/mach1510/uncompress.h
8 * Copyright (C) 2000 RidgeRun, Inc.
9 * Author: Greg Lonnon <glonnon@ridgerun.com>
10 *
11 * Rewritten by:
12 * Author: <source@mvista.com>
13 * 2004 (c) MontaVista Software, Inc.
14 *
15 * This file is licensed under the terms of the GNU General Public License
16 * version 2. This program is licensed "as is" without any warranty of any
17 * kind, whether express or implied.
18 */
19
20#include <linux/types.h>
21#include <linux/serial_reg.h>
22
23#include <asm/memory.h>
24#include <asm/mach-types.h>
25
26#include <plat/serial.h>
27
28#define MDR1_MODE_MASK 0x07
29
30volatile u8 *uart_base;
31int uart_shift;
32
33/*
34 * Store the DEBUG_LL uart number into memory.
35 * See also debug-macro.S, and serial.c for related code.
36 */
37static void set_omap_uart_info(unsigned char port)
38{
39 *(volatile u32 *)OMAP_UART_INFO = port;
40}
41
42static void putc(int c)
43{
44 if (!uart_base)
45 return;
46
47 /* Check for UART 16x mode */
48 if ((uart_base[UART_OMAP_MDR1 << uart_shift] & MDR1_MODE_MASK) != 0)
49 return;
50
51 while (!(uart_base[UART_LSR << uart_shift] & UART_LSR_THRE))
52 barrier();
53 uart_base[UART_TX << uart_shift] = c;
54}
55
56static inline void flush(void)
57{
58}
59
60/*
61 * Macros to configure UART1 and debug UART
62 */
63#define _DEBUG_LL_ENTRY(mach, dbg_uart, dbg_shft, dbg_id) \
64 if (machine_is_##mach()) { \
65 uart_base = (volatile u8 *)(dbg_uart); \
66 uart_shift = (dbg_shft); \
67 port = (dbg_id); \
68 set_omap_uart_info(port); \
69 break; \
70 }
71
72#define DEBUG_LL_OMAP7XX(p, mach) \
73 _DEBUG_LL_ENTRY(mach, OMAP1_UART##p##_BASE, OMAP7XX_PORT_SHIFT, \
74 OMAP1UART##p)
75
76#define DEBUG_LL_OMAP1(p, mach) \
77 _DEBUG_LL_ENTRY(mach, OMAP1_UART##p##_BASE, OMAP_PORT_SHIFT, \
78 OMAP1UART##p)
79
80#define DEBUG_LL_OMAP2(p, mach) \
81 _DEBUG_LL_ENTRY(mach, OMAP2_UART##p##_BASE, OMAP_PORT_SHIFT, \
82 OMAP2UART##p)
83
84#define DEBUG_LL_OMAP3(p, mach) \
85 _DEBUG_LL_ENTRY(mach, OMAP3_UART##p##_BASE, OMAP_PORT_SHIFT, \
86 OMAP3UART##p)
87
88#define DEBUG_LL_OMAP4(p, mach) \
89 _DEBUG_LL_ENTRY(mach, OMAP4_UART##p##_BASE, OMAP_PORT_SHIFT, \
90 OMAP4UART##p)
91
92/* Zoom2/3 shift is different for UART1 and external port */
93#define DEBUG_LL_ZOOM(mach) \
94 _DEBUG_LL_ENTRY(mach, ZOOM_UART_BASE, ZOOM_PORT_SHIFT, ZOOM_UART)
95
96#define DEBUG_LL_TI816X(p, mach) \
97 _DEBUG_LL_ENTRY(mach, TI816X_UART##p##_BASE, OMAP_PORT_SHIFT, \
98 TI816XUART##p)
99
100static inline void __arch_decomp_setup(unsigned long arch_id)
101{
102 int port = 0;
103
104 /*
105 * Initialize the port based on the machine ID from the bootloader.
106 * Note that we're using macros here instead of switch statement
107 * as machine_is functions are optimized out for the boards that
108 * are not selected.
109 */
110 do {
111 /* omap7xx/8xx based boards using UART1 with shift 0 */
112 DEBUG_LL_OMAP7XX(1, herald);
113 DEBUG_LL_OMAP7XX(1, omap_perseus2);
114
115 /* omap15xx/16xx based boards using UART1 */
116 DEBUG_LL_OMAP1(1, ams_delta);
117 DEBUG_LL_OMAP1(1, nokia770);
118 DEBUG_LL_OMAP1(1, omap_h2);
119 DEBUG_LL_OMAP1(1, omap_h3);
120 DEBUG_LL_OMAP1(1, omap_innovator);
121 DEBUG_LL_OMAP1(1, omap_osk);
122 DEBUG_LL_OMAP1(1, omap_palmte);
123 DEBUG_LL_OMAP1(1, omap_palmz71);
124
125 /* omap15xx/16xx based boards using UART2 */
126 DEBUG_LL_OMAP1(2, omap_palmtt);
127
128 /* omap15xx/16xx based boards using UART3 */
129 DEBUG_LL_OMAP1(3, sx1);
130
131 /* omap2 based boards using UART1 */
132 DEBUG_LL_OMAP2(1, omap_2430sdp);
133 DEBUG_LL_OMAP2(1, omap_apollon);
134 DEBUG_LL_OMAP2(1, omap_h4);
135
136 /* omap2 based boards using UART3 */
137 DEBUG_LL_OMAP2(3, nokia_n800);
138 DEBUG_LL_OMAP2(3, nokia_n810);
139 DEBUG_LL_OMAP2(3, nokia_n810_wimax);
140
141 /* omap3 based boards using UART1 */
142 DEBUG_LL_OMAP2(1, omap3evm);
143 DEBUG_LL_OMAP3(1, omap_3430sdp);
144 DEBUG_LL_OMAP3(1, omap_3630sdp);
145 DEBUG_LL_OMAP3(1, omap3530_lv_som);
146 DEBUG_LL_OMAP3(1, omap3_torpedo);
147
148 /* omap3 based boards using UART3 */
149 DEBUG_LL_OMAP3(3, cm_t35);
150 DEBUG_LL_OMAP3(3, cm_t3517);
151 DEBUG_LL_OMAP3(3, cm_t3730);
152 DEBUG_LL_OMAP3(3, craneboard);
153 DEBUG_LL_OMAP3(3, devkit8000);
154 DEBUG_LL_OMAP3(3, igep0020);
155 DEBUG_LL_OMAP3(3, igep0030);
156 DEBUG_LL_OMAP3(3, nokia_rm680);
157 DEBUG_LL_OMAP3(3, nokia_rx51);
158 DEBUG_LL_OMAP3(3, omap3517evm);
159 DEBUG_LL_OMAP3(3, omap3_beagle);
160 DEBUG_LL_OMAP3(3, omap3_pandora);
161 DEBUG_LL_OMAP3(3, omap_ldp);
162 DEBUG_LL_OMAP3(3, overo);
163 DEBUG_LL_OMAP3(3, touchbook);
164
165 /* omap4 based boards using UART3 */
166 DEBUG_LL_OMAP4(3, omap_4430sdp);
167 DEBUG_LL_OMAP4(3, omap4_panda);
168
169 /* zoom2/3 external uart */
170 DEBUG_LL_ZOOM(omap_zoom2);
171 DEBUG_LL_ZOOM(omap_zoom3);
172
173 /* TI8168 base boards using UART3 */
174 DEBUG_LL_TI816X(3, ti8168evm);
175
176 } while (0);
177}
178
179#define arch_decomp_setup() __arch_decomp_setup(arch_id)
180
181/*
182 * nothing to do
183 */
184#define arch_decomp_wdog()
diff --git a/arch/arm/plat-omap/include/plat/usb.h b/arch/arm/plat-omap/include/plat/usb.h
new file mode 100644
index 00000000000..17d3c939775
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/usb.h
@@ -0,0 +1,296 @@
1// include/asm-arm/mach-omap/usb.h
2
3#ifndef __ASM_ARCH_OMAP_USB_H
4#define __ASM_ARCH_OMAP_USB_H
5
6#include <linux/usb/musb.h>
7#include <plat/board.h>
8
9#define OMAP3_HS_USB_PORTS 3
10
11enum usbhs_omap_port_mode {
12 OMAP_USBHS_PORT_MODE_UNUSED,
13 OMAP_EHCI_PORT_MODE_PHY,
14 OMAP_EHCI_PORT_MODE_TLL,
15 OMAP_EHCI_PORT_MODE_HSIC,
16 OMAP_OHCI_PORT_MODE_PHY_6PIN_DATSE0,
17 OMAP_OHCI_PORT_MODE_PHY_6PIN_DPDM,
18 OMAP_OHCI_PORT_MODE_PHY_3PIN_DATSE0,
19 OMAP_OHCI_PORT_MODE_PHY_4PIN_DPDM,
20 OMAP_OHCI_PORT_MODE_TLL_6PIN_DATSE0,
21 OMAP_OHCI_PORT_MODE_TLL_6PIN_DPDM,
22 OMAP_OHCI_PORT_MODE_TLL_3PIN_DATSE0,
23 OMAP_OHCI_PORT_MODE_TLL_4PIN_DPDM,
24 OMAP_OHCI_PORT_MODE_TLL_2PIN_DATSE0,
25 OMAP_OHCI_PORT_MODE_TLL_2PIN_DPDM
26};
27
28struct usbhs_omap_board_data {
29 enum usbhs_omap_port_mode port_mode[OMAP3_HS_USB_PORTS];
30
31 /* have to be valid if phy_reset is true and portx is in phy mode */
32 int reset_gpio_port[OMAP3_HS_USB_PORTS];
33
34 /* Set this to true for ES2.x silicon */
35 unsigned es2_compatibility:1;
36
37 unsigned phy_reset:1;
38
39 /*
40 * Regulators for USB PHYs.
41 * Each PHY can have a separate regulator.
42 */
43 struct regulator *regulator[OMAP3_HS_USB_PORTS];
44};
45
46struct ehci_hcd_omap_platform_data {
47 enum usbhs_omap_port_mode port_mode[OMAP3_HS_USB_PORTS];
48 int reset_gpio_port[OMAP3_HS_USB_PORTS];
49 struct regulator *regulator[OMAP3_HS_USB_PORTS];
50 unsigned phy_reset:1;
51};
52
53struct ohci_hcd_omap_platform_data {
54 enum usbhs_omap_port_mode port_mode[OMAP3_HS_USB_PORTS];
55 unsigned es2_compatibility:1;
56};
57
58struct usbhs_omap_platform_data {
59 enum usbhs_omap_port_mode port_mode[OMAP3_HS_USB_PORTS];
60
61 struct ehci_hcd_omap_platform_data *ehci_data;
62 struct ohci_hcd_omap_platform_data *ohci_data;
63};
64/*-------------------------------------------------------------------------*/
65
66#define OMAP1_OTG_BASE 0xfffb0400
67#define OMAP1_UDC_BASE 0xfffb4000
68#define OMAP1_OHCI_BASE 0xfffba000
69
70#define OMAP2_OHCI_BASE 0x4805e000
71#define OMAP2_UDC_BASE 0x4805e200
72#define OMAP2_OTG_BASE 0x4805e300
73
74#ifdef CONFIG_ARCH_OMAP1
75
76#define OTG_BASE OMAP1_OTG_BASE
77#define UDC_BASE OMAP1_UDC_BASE
78#define OMAP_OHCI_BASE OMAP1_OHCI_BASE
79
80#else
81
82#define OTG_BASE OMAP2_OTG_BASE
83#define UDC_BASE OMAP2_UDC_BASE
84#define OMAP_OHCI_BASE OMAP2_OHCI_BASE
85
86struct omap_musb_board_data {
87 u8 interface_type;
88 u8 mode;
89 u16 power;
90 unsigned extvbus:1;
91 void (*set_phy_power)(u8 on);
92 void (*clear_irq)(void);
93 void (*set_mode)(u8 mode);
94 void (*reset)(void);
95};
96
97enum musb_interface {MUSB_INTERFACE_ULPI, MUSB_INTERFACE_UTMI};
98
99extern void usb_musb_init(struct omap_musb_board_data *board_data);
100
101extern void usbhs_init(const struct usbhs_omap_board_data *pdata);
102
103extern int omap_usbhs_enable(struct device *dev);
104extern void omap_usbhs_disable(struct device *dev);
105
106extern int omap4430_phy_power(struct device *dev, int ID, int on);
107extern int omap4430_phy_set_clk(struct device *dev, int on);
108extern int omap4430_phy_init(struct device *dev);
109extern int omap4430_phy_exit(struct device *dev);
110extern int omap4430_phy_suspend(struct device *dev, int suspend);
111#endif
112
113extern void am35x_musb_reset(void);
114extern void am35x_musb_phy_power(u8 on);
115extern void am35x_musb_clear_irq(void);
116extern void am35x_set_mode(u8 musb_mode);
117
118/*
119 * FIXME correct answer depends on hmc_mode,
120 * as does (on omap1) any nonzero value for config->otg port number
121 */
122#ifdef CONFIG_USB_GADGET_OMAP
123#define is_usb0_device(config) 1
124#else
125#define is_usb0_device(config) 0
126#endif
127
128void omap_otg_init(struct omap_usb_config *config);
129
130#if defined(CONFIG_USB) || defined(CONFIG_USB_MODULE)
131void omap1_usb_init(struct omap_usb_config *pdata);
132#else
133static inline void omap1_usb_init(struct omap_usb_config *pdata)
134{
135}
136#endif
137
138#if defined(CONFIG_ARCH_OMAP_OTG) || defined(CONFIG_ARCH_OMAP_OTG_MODULE)
139void omap2_usbfs_init(struct omap_usb_config *pdata);
140#else
141static inline void omap2_usbfs_init(struct omap_usb_config *pdata)
142{
143}
144#endif
145
146/*-------------------------------------------------------------------------*/
147
148/*
149 * OTG and transceiver registers, for OMAPs starting with ARM926
150 */
151#define OTG_REV (OTG_BASE + 0x00)
152#define OTG_SYSCON_1 (OTG_BASE + 0x04)
153# define USB2_TRX_MODE(w) (((w)>>24)&0x07)
154# define USB1_TRX_MODE(w) (((w)>>20)&0x07)
155# define USB0_TRX_MODE(w) (((w)>>16)&0x07)
156# define OTG_IDLE_EN (1 << 15)
157# define HST_IDLE_EN (1 << 14)
158# define DEV_IDLE_EN (1 << 13)
159# define OTG_RESET_DONE (1 << 2)
160# define OTG_SOFT_RESET (1 << 1)
161#define OTG_SYSCON_2 (OTG_BASE + 0x08)
162# define OTG_EN (1 << 31)
163# define USBX_SYNCHRO (1 << 30)
164# define OTG_MST16 (1 << 29)
165# define SRP_GPDATA (1 << 28)
166# define SRP_GPDVBUS (1 << 27)
167# define SRP_GPUVBUS(w) (((w)>>24)&0x07)
168# define A_WAIT_VRISE(w) (((w)>>20)&0x07)
169# define B_ASE_BRST(w) (((w)>>16)&0x07)
170# define SRP_DPW (1 << 14)
171# define SRP_DATA (1 << 13)
172# define SRP_VBUS (1 << 12)
173# define OTG_PADEN (1 << 10)
174# define HMC_PADEN (1 << 9)
175# define UHOST_EN (1 << 8)
176# define HMC_TLLSPEED (1 << 7)
177# define HMC_TLLATTACH (1 << 6)
178# define OTG_HMC(w) (((w)>>0)&0x3f)
179#define OTG_CTRL (OTG_BASE + 0x0c)
180# define OTG_USB2_EN (1 << 29)
181# define OTG_USB2_DP (1 << 28)
182# define OTG_USB2_DM (1 << 27)
183# define OTG_USB1_EN (1 << 26)
184# define OTG_USB1_DP (1 << 25)
185# define OTG_USB1_DM (1 << 24)
186# define OTG_USB0_EN (1 << 23)
187# define OTG_USB0_DP (1 << 22)
188# define OTG_USB0_DM (1 << 21)
189# define OTG_ASESSVLD (1 << 20)
190# define OTG_BSESSEND (1 << 19)
191# define OTG_BSESSVLD (1 << 18)
192# define OTG_VBUSVLD (1 << 17)
193# define OTG_ID (1 << 16)
194# define OTG_DRIVER_SEL (1 << 15)
195# define OTG_A_SETB_HNPEN (1 << 12)
196# define OTG_A_BUSREQ (1 << 11)
197# define OTG_B_HNPEN (1 << 9)
198# define OTG_B_BUSREQ (1 << 8)
199# define OTG_BUSDROP (1 << 7)
200# define OTG_PULLDOWN (1 << 5)
201# define OTG_PULLUP (1 << 4)
202# define OTG_DRV_VBUS (1 << 3)
203# define OTG_PD_VBUS (1 << 2)
204# define OTG_PU_VBUS (1 << 1)
205# define OTG_PU_ID (1 << 0)
206#define OTG_IRQ_EN (OTG_BASE + 0x10) /* 16-bit */
207# define DRIVER_SWITCH (1 << 15)
208# define A_VBUS_ERR (1 << 13)
209# define A_REQ_TMROUT (1 << 12)
210# define A_SRP_DETECT (1 << 11)
211# define B_HNP_FAIL (1 << 10)
212# define B_SRP_TMROUT (1 << 9)
213# define B_SRP_DONE (1 << 8)
214# define B_SRP_STARTED (1 << 7)
215# define OPRT_CHG (1 << 0)
216#define OTG_IRQ_SRC (OTG_BASE + 0x14) /* 16-bit */
217 // same bits as in IRQ_EN
218#define OTG_OUTCTRL (OTG_BASE + 0x18) /* 16-bit */
219# define OTGVPD (1 << 14)
220# define OTGVPU (1 << 13)
221# define OTGPUID (1 << 12)
222# define USB2VDR (1 << 10)
223# define USB2PDEN (1 << 9)
224# define USB2PUEN (1 << 8)
225# define USB1VDR (1 << 6)
226# define USB1PDEN (1 << 5)
227# define USB1PUEN (1 << 4)
228# define USB0VDR (1 << 2)
229# define USB0PDEN (1 << 1)
230# define USB0PUEN (1 << 0)
231#define OTG_TEST (OTG_BASE + 0x20) /* 16-bit */
232#define OTG_VENDOR_CODE (OTG_BASE + 0xfc) /* 16-bit */
233
234/*-------------------------------------------------------------------------*/
235
236/* OMAP1 */
237#define USB_TRANSCEIVER_CTRL (0xfffe1000 + 0x0064)
238# define CONF_USB2_UNI_R (1 << 8)
239# define CONF_USB1_UNI_R (1 << 7)
240# define CONF_USB_PORT0_R(x) (((x)>>4)&0x7)
241# define CONF_USB0_ISOLATE_R (1 << 3)
242# define CONF_USB_PWRDN_DM_R (1 << 2)
243# define CONF_USB_PWRDN_DP_R (1 << 1)
244
245/* OMAP2 */
246# define USB_UNIDIR 0x0
247# define USB_UNIDIR_TLL 0x1
248# define USB_BIDIR 0x2
249# define USB_BIDIR_TLL 0x3
250# define USBTXWRMODEI(port, x) ((x) << (22 - (port * 2)))
251# define USBT2TLL5PI (1 << 17)
252# define USB0PUENACTLOI (1 << 16)
253# define USBSTANDBYCTRL (1 << 15)
254/* AM35x */
255/* USB 2.0 PHY Control */
256#define CONF2_PHY_GPIOMODE (1 << 23)
257#define CONF2_OTGMODE (3 << 14)
258#define CONF2_NO_OVERRIDE (0 << 14)
259#define CONF2_FORCE_HOST (1 << 14)
260#define CONF2_FORCE_DEVICE (2 << 14)
261#define CONF2_FORCE_HOST_VBUS_LOW (3 << 14)
262#define CONF2_SESENDEN (1 << 13)
263#define CONF2_VBDTCTEN (1 << 12)
264#define CONF2_REFFREQ_24MHZ (2 << 8)
265#define CONF2_REFFREQ_26MHZ (7 << 8)
266#define CONF2_REFFREQ_13MHZ (6 << 8)
267#define CONF2_REFFREQ (0xf << 8)
268#define CONF2_PHYCLKGD (1 << 7)
269#define CONF2_VBUSSENSE (1 << 6)
270#define CONF2_PHY_PLLON (1 << 5)
271#define CONF2_RESET (1 << 4)
272#define CONF2_PHYPWRDN (1 << 3)
273#define CONF2_OTGPWRDN (1 << 2)
274#define CONF2_DATPOL (1 << 1)
275
276#if defined(CONFIG_ARCH_OMAP1) && defined(CONFIG_USB)
277u32 omap1_usb0_init(unsigned nwires, unsigned is_device);
278u32 omap1_usb1_init(unsigned nwires);
279u32 omap1_usb2_init(unsigned nwires, unsigned alt_pingroup);
280#else
281static inline u32 omap1_usb0_init(unsigned nwires, unsigned is_device)
282{
283 return 0;
284}
285static inline u32 omap1_usb1_init(unsigned nwires)
286{
287 return 0;
288
289}
290static inline u32 omap1_usb2_init(unsigned nwires, unsigned alt_pingroup)
291{
292 return 0;
293}
294#endif
295
296#endif /* __ASM_ARCH_OMAP_USB_H */
diff --git a/arch/arm/plat-omap/include/plat/vram.h b/arch/arm/plat-omap/include/plat/vram.h
new file mode 100644
index 00000000000..0aa4ecd12c7
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/vram.h
@@ -0,0 +1,62 @@
1/*
2 * VRAM manager for OMAP
3 *
4 * Copyright (C) 2009 Nokia Corporation
5 * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 */
20
21#ifndef __OMAP_VRAM_H__
22#define __OMAP_VRAM_H__
23
24#include <linux/types.h>
25
26#define OMAP_VRAM_MEMTYPE_SDRAM 0
27#define OMAP_VRAM_MEMTYPE_SRAM 1
28#define OMAP_VRAM_MEMTYPE_MAX 1
29
30extern int omap_vram_add_region(unsigned long paddr, size_t size);
31extern int omap_vram_free(unsigned long paddr, size_t size);
32extern int omap_vram_alloc(int mtype, size_t size, unsigned long *paddr);
33extern int omap_vram_reserve(unsigned long paddr, size_t size);
34extern void omap_vram_get_info(unsigned long *vram, unsigned long *free_vram,
35 unsigned long *largest_free_block);
36
37#ifdef CONFIG_OMAP2_VRAM
38extern void omap_vram_set_sdram_vram(u32 size, u32 start);
39extern void omap_vram_set_sram_vram(u32 size, u32 start);
40
41extern void omap_vram_reserve_sdram_memblock(void);
42extern unsigned long omap_vram_reserve_sram(unsigned long sram_pstart,
43 unsigned long sram_vstart,
44 unsigned long sram_size,
45 unsigned long pstart_avail,
46 unsigned long size_avail);
47#else
48static inline void omap_vram_set_sdram_vram(u32 size, u32 start) { }
49static inline void omap_vram_set_sram_vram(u32 size, u32 start) { }
50
51static inline void omap_vram_reserve_sdram_memblock(void) { }
52static inline unsigned long omap_vram_reserve_sram(unsigned long sram_pstart,
53 unsigned long sram_vstart,
54 unsigned long sram_size,
55 unsigned long pstart_avail,
56 unsigned long size_avail)
57{
58 return 0;
59}
60#endif
61
62#endif
diff --git a/arch/arm/plat-omap/include/plat/vrfb.h b/arch/arm/plat-omap/include/plat/vrfb.h
new file mode 100644
index 00000000000..3792bdea2f6
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/vrfb.h
@@ -0,0 +1,66 @@
1/*
2 * VRFB Rotation Engine
3 *
4 * Copyright (C) 2009 Nokia Corporation
5 * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 */
20
21#ifndef __OMAP_VRFB_H__
22#define __OMAP_VRFB_H__
23
24#define OMAP_VRFB_LINE_LEN 2048
25
26struct vrfb {
27 u8 context;
28 void __iomem *vaddr[4];
29 unsigned long paddr[4];
30 u16 xres;
31 u16 yres;
32 u16 xoffset;
33 u16 yoffset;
34 u8 bytespp;
35 bool yuv_mode;
36};
37
38#ifdef CONFIG_OMAP2_VRFB
39extern int omap_vrfb_request_ctx(struct vrfb *vrfb);
40extern void omap_vrfb_release_ctx(struct vrfb *vrfb);
41extern void omap_vrfb_adjust_size(u16 *width, u16 *height,
42 u8 bytespp);
43extern u32 omap_vrfb_min_phys_size(u16 width, u16 height, u8 bytespp);
44extern u16 omap_vrfb_max_height(u32 phys_size, u16 width, u8 bytespp);
45extern void omap_vrfb_setup(struct vrfb *vrfb, unsigned long paddr,
46 u16 width, u16 height,
47 unsigned bytespp, bool yuv_mode);
48extern int omap_vrfb_map_angle(struct vrfb *vrfb, u16 height, u8 rot);
49extern void omap_vrfb_restore_context(void);
50
51#else
52static inline int omap_vrfb_request_ctx(struct vrfb *vrfb) { return 0; }
53static inline void omap_vrfb_release_ctx(struct vrfb *vrfb) {}
54static inline void omap_vrfb_adjust_size(u16 *width, u16 *height,
55 u8 bytespp) {}
56static inline u32 omap_vrfb_min_phys_size(u16 width, u16 height, u8 bytespp)
57 { return 0; }
58static inline u16 omap_vrfb_max_height(u32 phys_size, u16 width, u8 bytespp)
59 { return 0; }
60static inline void omap_vrfb_setup(struct vrfb *vrfb, unsigned long paddr,
61 u16 width, u16 height, unsigned bytespp, bool yuv_mode) {}
62static inline int omap_vrfb_map_angle(struct vrfb *vrfb, u16 height, u8 rot)
63 { return 0; }
64static inline void omap_vrfb_restore_context(void) {}
65#endif
66#endif /* __VRFB_H */