aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-omap/include
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/plat-omap/include')
-rw-r--r--arch/arm/plat-omap/include/plat/board.h8
-rw-r--r--arch/arm/plat-omap/include/plat/clock.h130
-rw-r--r--arch/arm/plat-omap/include/plat/common.h9
-rw-r--r--arch/arm/plat-omap/include/plat/cpu.h17
-rw-r--r--arch/arm/plat-omap/include/plat/dma.h1
-rw-r--r--arch/arm/plat-omap/include/plat/dsp_common.h40
-rw-r--r--arch/arm/plat-omap/include/plat/gpmc.h42
-rw-r--r--arch/arm/plat-omap/include/plat/iommu.h2
-rw-r--r--arch/arm/plat-omap/include/plat/mailbox.h20
-rw-r--r--arch/arm/plat-omap/include/plat/mux.h224
-rw-r--r--arch/arm/plat-omap/include/plat/nand.h6
-rw-r--r--arch/arm/plat-omap/include/plat/omap-pm.h130
-rw-r--r--arch/arm/plat-omap/include/plat/omap_device.h2
-rw-r--r--arch/arm/plat-omap/include/plat/omap_hwmod.h14
-rw-r--r--arch/arm/plat-omap/include/plat/smp.h1
-rw-r--r--arch/arm/plat-omap/include/plat/uncompress.h6
-rw-r--r--arch/arm/plat-omap/include/plat/usb.h49
17 files changed, 351 insertions, 350 deletions
diff --git a/arch/arm/plat-omap/include/plat/board.h b/arch/arm/plat-omap/include/plat/board.h
index 5cd622039da..3cf4fa25ab3 100644
--- a/arch/arm/plat-omap/include/plat/board.h
+++ b/arch/arm/plat-omap/include/plat/board.h
@@ -85,6 +85,14 @@ struct omap_usb_config {
85 * 6 == 6 wire unidirectional (or TLL) 85 * 6 == 6 wire unidirectional (or TLL)
86 */ 86 */
87 u8 pins[3]; 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);
88}; 96};
89 97
90struct omap_lcd_config { 98struct omap_lcd_config {
diff --git a/arch/arm/plat-omap/include/plat/clock.h b/arch/arm/plat-omap/include/plat/clock.h
index dfc472ca0cc..fef4696dcf6 100644
--- a/arch/arm/plat-omap/include/plat/clock.h
+++ b/arch/arm/plat-omap/include/plat/clock.h
@@ -19,6 +19,22 @@ struct module;
19struct clk; 19struct clk;
20struct clockdomain; 20struct clockdomain;
21 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 *
29 * A "companion" clk is an accompanying clock to the one being queried
30 * that must be enabled for the IP module connected to the clock to
31 * become accessible by the hardware. Neither @find_idlest nor
32 * @find_companion should be needed; that information is IP
33 * block-specific; the hwmod code has been created to handle this, but
34 * until hwmod data is ready and drivers have been converted to use PM
35 * runtime calls in place of clk_enable()/clk_disable(), @find_idlest and
36 * @find_companion must, unfortunately, remain.
37 */
22struct clkops { 38struct clkops {
23 int (*enable)(struct clk *); 39 int (*enable)(struct clk *);
24 void (*disable)(struct clk *); 40 void (*disable)(struct clk *);
@@ -30,12 +46,45 @@ struct clkops {
30 46
31#ifdef CONFIG_ARCH_OMAP2PLUS 47#ifdef CONFIG_ARCH_OMAP2PLUS
32 48
49/* struct clksel_rate.flags possibilities */
50#define RATE_IN_242X (1 << 0)
51#define RATE_IN_243X (1 << 1)
52#define RATE_IN_3XXX (1 << 2) /* rates common to all OMAP3 */
53#define RATE_IN_3430ES2 (1 << 3) /* 3430ES2 rates only */
54#define RATE_IN_36XX (1 << 4)
55#define RATE_IN_4430 (1 << 5)
56
57#define RATE_IN_24XX (RATE_IN_242X | RATE_IN_243X)
58#define RATE_IN_3430ES2PLUS (RATE_IN_3430ES2 | RATE_IN_36XX)
59
60/**
61 * struct clksel_rate - register bitfield values corresponding to clk divisors
62 * @val: register bitfield value (shifted to bit 0)
63 * @div: clock divisor corresponding to @val
64 * @flags: (see "struct clksel_rate.flags possibilities" above)
65 *
66 * @val should match the value of a read from struct clk.clksel_reg
67 * AND'ed with struct clk.clksel_mask, shifted right to bit 0.
68 *
69 * @div is the divisor that should be applied to the parent clock's rate
70 * to produce the current clock's rate.
71 *
72 * XXX @flags probably should be replaced with an struct omap_chip.
73 */
33struct clksel_rate { 74struct clksel_rate {
34 u32 val; 75 u32 val;
35 u8 div; 76 u8 div;
36 u8 flags; 77 u8 flags;
37}; 78};
38 79
80/**
81 * struct clksel - available parent clocks, and a pointer to their divisors
82 * @parent: struct clk * to a possible parent clock
83 * @rates: available divisors for this parent clock
84 *
85 * A struct clksel is always associated with one or more struct clks
86 * and one or more struct clksel_rates.
87 */
39struct clksel { 88struct clksel {
40 struct clk *parent; 89 struct clk *parent;
41 const struct clksel_rate *rates; 90 const struct clksel_rate *rates;
@@ -116,6 +165,60 @@ struct dpll_data {
116 165
117#endif 166#endif
118 167
168/* struct clk.flags possibilities */
169#define ENABLE_REG_32BIT (1 << 0) /* Use 32-bit access */
170#define CLOCK_IDLE_CONTROL (1 << 1)
171#define CLOCK_NO_IDLE_PARENT (1 << 2)
172#define ENABLE_ON_INIT (1 << 3) /* Enable upon framework init */
173#define INVERT_ENABLE (1 << 4) /* 0 enables, 1 disables */
174
175/**
176 * struct clk - OMAP struct clk
177 * @node: list_head connecting this clock into the full clock list
178 * @ops: struct clkops * for this clock
179 * @name: the name of the clock in the hardware (used in hwmod data and debug)
180 * @parent: pointer to this clock's parent struct clk
181 * @children: list_head connecting to the child clks' @sibling list_heads
182 * @sibling: list_head connecting this clk to its parent clk's @children
183 * @rate: current clock rate
184 * @enable_reg: register to write to enable the clock (see @enable_bit)
185 * @recalc: fn ptr that returns the clock's current rate
186 * @set_rate: fn ptr that can change the clock's current rate
187 * @round_rate: fn ptr that can round the clock's current rate
188 * @init: fn ptr to do clock-specific initialization
189 * @enable_bit: bitshift to write to enable/disable the clock (see @enable_reg)
190 * @usecount: number of users that have requested this clock to be enabled
191 * @fixed_div: when > 0, this clock's rate is its parent's rate / @fixed_div
192 * @flags: see "struct clk.flags possibilities" above
193 * @clksel_reg: for clksel clks, register va containing src/divisor select
194 * @clksel_mask: bitmask in @clksel_reg for the src/divisor selector
195 * @clksel: for clksel clks, pointer to struct clksel for this clock
196 * @dpll_data: for DPLLs, pointer to struct dpll_data for this clock
197 * @clkdm_name: clockdomain name that this clock is contained in
198 * @clkdm: pointer to struct clockdomain, resolved from @clkdm_name at runtime
199 * @rate_offset: bitshift for rate selection bitfield (OMAP1 only)
200 * @src_offset: bitshift for source selection bitfield (OMAP1 only)
201 *
202 * XXX @rate_offset, @src_offset should probably be removed and OMAP1
203 * clock code converted to use clksel.
204 *
205 * XXX @usecount is poorly named. It should be "enable_count" or
206 * something similar. "users" in the description refers to kernel
207 * code (core code or drivers) that have called clk_enable() and not
208 * yet called clk_disable(); the usecount of parent clocks is also
209 * incremented by the clock code when clk_enable() is called on child
210 * clocks and decremented by the clock code when clk_disable() is
211 * called on child clocks.
212 *
213 * XXX @clkdm, @usecount, @children, @sibling should be marked for
214 * internal use only.
215 *
216 * @children and @sibling are used to optimize parent-to-child clock
217 * tree traversals. (child-to-parent traversals use @parent.)
218 *
219 * XXX The notion of the clock's current rate probably needs to be
220 * separated from the clock's target rate.
221 */
119struct clk { 222struct clk {
120 struct list_head node; 223 struct list_head node;
121 const struct clkops *ops; 224 const struct clkops *ops;
@@ -129,8 +232,8 @@ struct clk {
129 int (*set_rate)(struct clk *, unsigned long); 232 int (*set_rate)(struct clk *, unsigned long);
130 long (*round_rate)(struct clk *, unsigned long); 233 long (*round_rate)(struct clk *, unsigned long);
131 void (*init)(struct clk *); 234 void (*init)(struct clk *);
132 __u8 enable_bit; 235 u8 enable_bit;
133 __s8 usecount; 236 s8 usecount;
134 u8 fixed_div; 237 u8 fixed_div;
135 u8 flags; 238 u8 flags;
136#ifdef CONFIG_ARCH_OMAP2PLUS 239#ifdef CONFIG_ARCH_OMAP2PLUS
@@ -141,8 +244,8 @@ struct clk {
141 const char *clkdm_name; 244 const char *clkdm_name;
142 struct clockdomain *clkdm; 245 struct clockdomain *clkdm;
143#else 246#else
144 __u8 rate_offset; 247 u8 rate_offset;
145 __u8 src_offset; 248 u8 src_offset;
146#endif 249#endif
147#if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS) 250#if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS)
148 struct dentry *dent; /* For visible tree hierarchy */ 251 struct dentry *dent; /* For visible tree hierarchy */
@@ -188,23 +291,4 @@ extern const struct clkops clkops_null;
188 291
189extern struct clk dummy_ck; 292extern struct clk dummy_ck;
190 293
191/* Clock flags */
192#define ENABLE_REG_32BIT (1 << 0) /* Use 32-bit access */
193#define CLOCK_IDLE_CONTROL (1 << 1)
194#define CLOCK_NO_IDLE_PARENT (1 << 2)
195#define ENABLE_ON_INIT (1 << 3) /* Enable upon framework init */
196#define INVERT_ENABLE (1 << 4) /* 0 enables, 1 disables */
197
198/* Clksel_rate flags */
199#define RATE_IN_242X (1 << 0)
200#define RATE_IN_243X (1 << 1)
201#define RATE_IN_3XXX (1 << 2) /* rates common to all OMAP3 */
202#define RATE_IN_3430ES2 (1 << 3) /* 3430ES2 rates only */
203#define RATE_IN_36XX (1 << 4)
204#define RATE_IN_4430 (1 << 5)
205
206#define RATE_IN_24XX (RATE_IN_242X | RATE_IN_243X)
207
208#define RATE_IN_3430ES2PLUS (RATE_IN_3430ES2 | RATE_IN_36XX)
209
210#endif 294#endif
diff --git a/arch/arm/plat-omap/include/plat/common.h b/arch/arm/plat-omap/include/plat/common.h
index 5e4afbee0fd..9776b41ad76 100644
--- a/arch/arm/plat-omap/include/plat/common.h
+++ b/arch/arm/plat-omap/include/plat/common.h
@@ -58,8 +58,7 @@ struct omap_globals {
58 58
59void omap2_set_globals_242x(void); 59void omap2_set_globals_242x(void);
60void omap2_set_globals_243x(void); 60void omap2_set_globals_243x(void);
61void omap2_set_globals_343x(void); 61void omap2_set_globals_3xxx(void);
62void omap2_set_globals_36xx(void);
63void omap2_set_globals_443x(void); 62void omap2_set_globals_443x(void);
64 63
65/* These get called from omap2_set_globals_xxxx(), do not call these */ 64/* These get called from omap2_set_globals_xxxx(), do not call these */
@@ -69,6 +68,8 @@ void omap2_set_globals_control(struct omap_globals *);
69void omap2_set_globals_prcm(struct omap_globals *); 68void omap2_set_globals_prcm(struct omap_globals *);
70void omap2_set_globals_uart(struct omap_globals *); 69void omap2_set_globals_uart(struct omap_globals *);
71 70
71void omap3_map_io(void);
72
72/** 73/**
73 * omap_test_timeout - busy-loop, testing a condition 74 * omap_test_timeout - busy-loop, testing a condition
74 * @cond: condition to test until it evaluates to true 75 * @cond: condition to test until it evaluates to true
@@ -89,4 +90,8 @@ void omap2_set_globals_uart(struct omap_globals *);
89 } \ 90 } \
90}) 91})
91 92
93extern struct device *omap2_get_mpuss_device(void);
94extern struct device *omap2_get_dsp_device(void);
95extern struct device *omap2_get_l3_device(void);
96
92#endif /* __ARCH_ARM_MACH_OMAP_COMMON_H */ 97#endif /* __ARCH_ARM_MACH_OMAP_COMMON_H */
diff --git a/arch/arm/plat-omap/include/plat/cpu.h b/arch/arm/plat-omap/include/plat/cpu.h
index 75141742300..2e2ae530fce 100644
--- a/arch/arm/plat-omap/include/plat/cpu.h
+++ b/arch/arm/plat-omap/include/plat/cpu.h
@@ -66,6 +66,8 @@ unsigned int omap_rev(void);
66 * family. This difference can be handled separately. 66 * family. This difference can be handled separately.
67 */ 67 */
68#define OMAP_REVBITS_00 0x00 68#define OMAP_REVBITS_00 0x00
69#define OMAP_REVBITS_01 0x01
70#define OMAP_REVBITS_02 0x02
69#define OMAP_REVBITS_10 0x10 71#define OMAP_REVBITS_10 0x10
70#define OMAP_REVBITS_20 0x20 72#define OMAP_REVBITS_20 0x20
71#define OMAP_REVBITS_30 0x30 73#define OMAP_REVBITS_30 0x30
@@ -376,6 +378,8 @@ IS_OMAP_TYPE(3517, 0x3517)
376#define OMAP3430_REV_ES3_1_2 0x34305034 378#define OMAP3430_REV_ES3_1_2 0x34305034
377 379
378#define OMAP3630_REV_ES1_0 0x36300034 380#define OMAP3630_REV_ES1_0 0x36300034
381#define OMAP3630_REV_ES1_1 0x36300134
382#define OMAP3630_REV_ES1_2 0x36300234
379 383
380#define OMAP35XX_CLASS 0x35000034 384#define OMAP35XX_CLASS 0x35000034
381#define OMAP3503_REV(v) (OMAP35XX_CLASS | (0x3503 << 16) | (v << 8)) 385#define OMAP3503_REV(v) (OMAP35XX_CLASS | (0x3503 << 16) | (v << 8))
@@ -411,6 +415,8 @@ IS_OMAP_TYPE(3517, 0x3517)
411#define CHIP_IS_OMAP3430ES3_1 (1 << 6) 415#define CHIP_IS_OMAP3430ES3_1 (1 << 6)
412#define CHIP_IS_OMAP3630ES1 (1 << 7) 416#define CHIP_IS_OMAP3630ES1 (1 << 7)
413#define CHIP_IS_OMAP4430ES1 (1 << 8) 417#define CHIP_IS_OMAP4430ES1 (1 << 8)
418#define CHIP_IS_OMAP3630ES1_1 (1 << 9)
419#define CHIP_IS_OMAP3630ES1_2 (1 << 10)
414 420
415#define CHIP_IS_OMAP24XX (CHIP_IS_OMAP2420 | CHIP_IS_OMAP2430) 421#define CHIP_IS_OMAP24XX (CHIP_IS_OMAP2420 | CHIP_IS_OMAP2430)
416 422
@@ -424,11 +430,12 @@ IS_OMAP_TYPE(3517, 0x3517)
424 */ 430 */
425#define CHIP_GE_OMAP3430ES2 (CHIP_IS_OMAP3430ES2 | \ 431#define CHIP_GE_OMAP3430ES2 (CHIP_IS_OMAP3430ES2 | \
426 CHIP_IS_OMAP3430ES3_0 | \ 432 CHIP_IS_OMAP3430ES3_0 | \
427 CHIP_IS_OMAP3430ES3_1 | \ 433 CHIP_GE_OMAP3430ES3_1)
428 CHIP_IS_OMAP3630ES1)
429#define CHIP_GE_OMAP3430ES3_1 (CHIP_IS_OMAP3430ES3_1 | \ 434#define CHIP_GE_OMAP3430ES3_1 (CHIP_IS_OMAP3430ES3_1 | \
430 CHIP_IS_OMAP3630ES1) 435 CHIP_IS_OMAP3630ES1 | \
431 436 CHIP_GE_OMAP3630ES1_1)
437#define CHIP_GE_OMAP3630ES1_1 (CHIP_IS_OMAP3630ES1_1 | \
438 CHIP_IS_OMAP3630ES1_2)
432 439
433int omap_chip_is(struct omap_chip_id oci); 440int omap_chip_is(struct omap_chip_id oci);
434void omap2_check_revision(void); 441void omap2_check_revision(void);
@@ -444,6 +451,7 @@ extern u32 omap3_features;
444#define OMAP3_HAS_NEON BIT(3) 451#define OMAP3_HAS_NEON BIT(3)
445#define OMAP3_HAS_ISP BIT(4) 452#define OMAP3_HAS_ISP BIT(4)
446#define OMAP3_HAS_192MHZ_CLK BIT(5) 453#define OMAP3_HAS_192MHZ_CLK BIT(5)
454#define OMAP3_HAS_IO_WAKEUP BIT(6)
447 455
448#define OMAP3_HAS_FEATURE(feat,flag) \ 456#define OMAP3_HAS_FEATURE(feat,flag) \
449static inline unsigned int omap3_has_ ##feat(void) \ 457static inline unsigned int omap3_has_ ##feat(void) \
@@ -457,5 +465,6 @@ OMAP3_HAS_FEATURE(iva, IVA)
457OMAP3_HAS_FEATURE(neon, NEON) 465OMAP3_HAS_FEATURE(neon, NEON)
458OMAP3_HAS_FEATURE(isp, ISP) 466OMAP3_HAS_FEATURE(isp, ISP)
459OMAP3_HAS_FEATURE(192mhz_clk, 192MHZ_CLK) 467OMAP3_HAS_FEATURE(192mhz_clk, 192MHZ_CLK)
468OMAP3_HAS_FEATURE(io_wakeup, IO_WAKEUP)
460 469
461#endif 470#endif
diff --git a/arch/arm/plat-omap/include/plat/dma.h b/arch/arm/plat-omap/include/plat/dma.h
index 02232ca2c37..af3a03941ad 100644
--- a/arch/arm/plat-omap/include/plat/dma.h
+++ b/arch/arm/plat-omap/include/plat/dma.h
@@ -345,6 +345,7 @@
345#define OMAP_DMA_SYNC_BLOCK 0x02 345#define OMAP_DMA_SYNC_BLOCK 0x02
346#define OMAP_DMA_SYNC_PACKET 0x03 346#define OMAP_DMA_SYNC_PACKET 0x03
347 347
348#define OMAP_DMA_DST_SYNC_PREFETCH 0x02
348#define OMAP_DMA_SRC_SYNC 0x01 349#define OMAP_DMA_SRC_SYNC 0x01
349#define OMAP_DMA_DST_SYNC 0x00 350#define OMAP_DMA_DST_SYNC 0x00
350 351
diff --git a/arch/arm/plat-omap/include/plat/dsp_common.h b/arch/arm/plat-omap/include/plat/dsp_common.h
deleted file mode 100644
index da97736f3ef..00000000000
--- a/arch/arm/plat-omap/include/plat/dsp_common.h
+++ /dev/null
@@ -1,40 +0,0 @@
1/*
2 * This file is part of OMAP DSP driver (DSP Gateway version 3.3.1)
3 *
4 * Copyright (C) 2004-2006 Nokia Corporation. All rights reserved.
5 *
6 * Contact: Toshihiro Kobayashi <toshihiro.kobayashi@nokia.com>
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * version 2 as published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * 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., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA
21 *
22 */
23
24#ifndef ASM_ARCH_DSP_COMMON_H
25#define ASM_ARCH_DSP_COMMON_H
26
27#if defined(CONFIG_ARCH_OMAP1) && defined(CONFIG_OMAP_MMU_FWK)
28extern void omap_dsp_request_mpui(void);
29extern void omap_dsp_release_mpui(void);
30extern int omap_dsp_request_mem(void);
31extern int omap_dsp_release_mem(void);
32#else
33static inline int omap_dsp_request_mem(void)
34{
35 return 0;
36}
37#define omap_dsp_release_mem() do {} while (0)
38#endif
39
40#endif /* ASM_ARCH_DSP_COMMON_H */
diff --git a/arch/arm/plat-omap/include/plat/gpmc.h b/arch/arm/plat-omap/include/plat/gpmc.h
index 145838a81ef..9fd99b9e40a 100644
--- a/arch/arm/plat-omap/include/plat/gpmc.h
+++ b/arch/arm/plat-omap/include/plat/gpmc.h
@@ -25,10 +25,26 @@
25#define GPMC_CS_NAND_ADDRESS 0x20 25#define GPMC_CS_NAND_ADDRESS 0x20
26#define GPMC_CS_NAND_DATA 0x24 26#define GPMC_CS_NAND_DATA 0x24
27 27
28#define GPMC_CONFIG 0x50 28/* Control Commands */
29#define GPMC_STATUS 0x54 29#define GPMC_CONFIG_RDY_BSY 0x00000001
30#define GPMC_CS0_BASE 0x60 30#define GPMC_CONFIG_DEV_SIZE 0x00000002
31#define GPMC_CS_SIZE 0x30 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/* ECC commands */
45#define GPMC_ECC_READ 0 /* Reset Hardware ECC for read */
46#define GPMC_ECC_WRITE 1 /* Reset Hardware ECC for write */
47#define GPMC_ECC_READSYN 2 /* Reset before syndrom is read back */
32 48
33#define GPMC_CONFIG1_WRAPBURST_SUPP (1 << 31) 49#define GPMC_CONFIG1_WRAPBURST_SUPP (1 << 31)
34#define GPMC_CONFIG1_READMULTIPLE_SUPP (1 << 30) 50#define GPMC_CONFIG1_READMULTIPLE_SUPP (1 << 30)
@@ -47,7 +63,6 @@
47#define GPMC_CONFIG1_DEVICESIZE_16 GPMC_CONFIG1_DEVICESIZE(1) 63#define GPMC_CONFIG1_DEVICESIZE_16 GPMC_CONFIG1_DEVICESIZE(1)
48#define GPMC_CONFIG1_DEVICETYPE(val) ((val & 3) << 10) 64#define GPMC_CONFIG1_DEVICETYPE(val) ((val & 3) << 10)
49#define GPMC_CONFIG1_DEVICETYPE_NOR GPMC_CONFIG1_DEVICETYPE(0) 65#define GPMC_CONFIG1_DEVICETYPE_NOR GPMC_CONFIG1_DEVICETYPE(0)
50#define GPMC_CONFIG1_DEVICETYPE_NAND GPMC_CONFIG1_DEVICETYPE(2)
51#define GPMC_CONFIG1_MUXADDDATA (1 << 9) 66#define GPMC_CONFIG1_MUXADDDATA (1 << 9)
52#define GPMC_CONFIG1_TIME_PARA_GRAN (1 << 4) 67#define GPMC_CONFIG1_TIME_PARA_GRAN (1 << 4)
53#define GPMC_CONFIG1_FCLK_DIV(val) (val & 3) 68#define GPMC_CONFIG1_FCLK_DIV(val) (val & 3)
@@ -56,6 +71,14 @@
56#define GPMC_CONFIG1_FCLK_DIV4 (GPMC_CONFIG1_FCLK_DIV(3)) 71#define GPMC_CONFIG1_FCLK_DIV4 (GPMC_CONFIG1_FCLK_DIV(3))
57#define GPMC_CONFIG7_CSVALID (1 << 6) 72#define GPMC_CONFIG7_CSVALID (1 << 6)
58 73
74#define GPMC_DEVICETYPE_NOR 0
75#define GPMC_DEVICETYPE_NAND 2
76#define GPMC_CONFIG_WRITEPROTECT 0x00000010
77#define GPMC_STATUS_BUFF_EMPTY 0x00000001
78#define WR_RD_PIN_MONITORING 0x00600000
79#define GPMC_PREFETCH_STATUS_FIFO_CNT(val) ((val >> 24) & 0x7F)
80#define GPMC_PREFETCH_STATUS_COUNT(val) (val & 0x00003fff)
81
59/* 82/*
60 * Note that all values in this struct are in nanoseconds, while 83 * Note that all values in this struct are in nanoseconds, while
61 * the register values are in gpmc_fck cycles. 84 * the register values are in gpmc_fck cycles.
@@ -108,10 +131,15 @@ extern int gpmc_cs_set_reserved(int cs, int reserved);
108extern int gpmc_cs_reserved(int cs); 131extern int gpmc_cs_reserved(int cs);
109extern int gpmc_prefetch_enable(int cs, int dma_mode, 132extern int gpmc_prefetch_enable(int cs, int dma_mode,
110 unsigned int u32_count, int is_write); 133 unsigned int u32_count, int is_write);
111extern void gpmc_prefetch_reset(void); 134extern int gpmc_prefetch_reset(int cs);
112extern int gpmc_prefetch_status(void);
113extern void omap3_gpmc_save_context(void); 135extern void omap3_gpmc_save_context(void);
114extern void omap3_gpmc_restore_context(void); 136extern void omap3_gpmc_restore_context(void);
115extern void gpmc_init(void); 137extern void gpmc_init(void);
138extern int gpmc_read_status(int cmd);
139extern int gpmc_cs_configure(int cs, int cmd, int wval);
140extern int gpmc_nand_read(int cs, int cmd);
141extern int gpmc_nand_write(int cs, int cmd, int wval);
116 142
143int gpmc_enable_hwecc(int cs, int mode, int dev_width, int ecc_size);
144int gpmc_calculate_ecc(int cs, const u_char *dat, u_char *ecc_code);
117#endif 145#endif
diff --git a/arch/arm/plat-omap/include/plat/iommu.h b/arch/arm/plat-omap/include/plat/iommu.h
index 0752af9d099..33c7d41cb6a 100644
--- a/arch/arm/plat-omap/include/plat/iommu.h
+++ b/arch/arm/plat-omap/include/plat/iommu.h
@@ -80,6 +80,7 @@ struct iommu_functions {
80 80
81 int (*enable)(struct iommu *obj); 81 int (*enable)(struct iommu *obj);
82 void (*disable)(struct iommu *obj); 82 void (*disable)(struct iommu *obj);
83 void (*set_twl)(struct iommu *obj, bool on);
83 u32 (*fault_isr)(struct iommu *obj, u32 *ra); 84 u32 (*fault_isr)(struct iommu *obj, u32 *ra);
84 85
85 void (*tlb_read_cr)(struct iommu *obj, struct cr_regs *cr); 86 void (*tlb_read_cr)(struct iommu *obj, struct cr_regs *cr);
@@ -143,6 +144,7 @@ extern void iotlb_cr_to_e(struct cr_regs *cr, struct iotlb_entry *e);
143extern u32 iotlb_cr_to_virt(struct cr_regs *cr); 144extern u32 iotlb_cr_to_virt(struct cr_regs *cr);
144 145
145extern int load_iotlb_entry(struct iommu *obj, struct iotlb_entry *e); 146extern int load_iotlb_entry(struct iommu *obj, struct iotlb_entry *e);
147extern void iommu_set_twl(struct iommu *obj, bool on);
146extern void flush_iotlb_page(struct iommu *obj, u32 da); 148extern void flush_iotlb_page(struct iommu *obj, u32 da);
147extern void flush_iotlb_range(struct iommu *obj, u32 start, u32 end); 149extern void flush_iotlb_range(struct iommu *obj, u32 start, u32 end);
148extern void flush_iotlb_all(struct iommu *obj); 150extern void flush_iotlb_all(struct iommu *obj);
diff --git a/arch/arm/plat-omap/include/plat/mailbox.h b/arch/arm/plat-omap/include/plat/mailbox.h
index 729166b76a7..99765655210 100644
--- a/arch/arm/plat-omap/include/plat/mailbox.h
+++ b/arch/arm/plat-omap/include/plat/mailbox.h
@@ -3,10 +3,11 @@
3#ifndef MAILBOX_H 3#ifndef MAILBOX_H
4#define MAILBOX_H 4#define MAILBOX_H
5 5
6#include <linux/wait.h> 6#include <linux/spinlock.h>
7#include <linux/workqueue.h> 7#include <linux/workqueue.h>
8#include <linux/blkdev.h>
9#include <linux/interrupt.h> 8#include <linux/interrupt.h>
9#include <linux/device.h>
10#include <linux/kfifo.h>
10 11
11typedef u32 mbox_msg_t; 12typedef u32 mbox_msg_t;
12struct omap_mbox; 13struct omap_mbox;
@@ -42,7 +43,7 @@ struct omap_mbox_ops {
42 43
43struct omap_mbox_queue { 44struct omap_mbox_queue {
44 spinlock_t lock; 45 spinlock_t lock;
45 struct request_queue *queue; 46 struct kfifo fifo;
46 struct work_struct work; 47 struct work_struct work;
47 struct tasklet_struct tasklet; 48 struct tasklet_struct tasklet;
48 int (*callback)(void *); 49 int (*callback)(void *);
@@ -52,19 +53,10 @@ struct omap_mbox_queue {
52struct omap_mbox { 53struct omap_mbox {
53 char *name; 54 char *name;
54 unsigned int irq; 55 unsigned int irq;
55
56 struct omap_mbox_queue *txq, *rxq; 56 struct omap_mbox_queue *txq, *rxq;
57
58 struct omap_mbox_ops *ops; 57 struct omap_mbox_ops *ops;
59
60 mbox_msg_t seq_snd, seq_rcv;
61
62 struct device *dev; 58 struct device *dev;
63
64 struct omap_mbox *next;
65 void *priv; 59 void *priv;
66
67 void (*err_notify)(void);
68}; 60};
69 61
70int omap_mbox_msg_send(struct omap_mbox *, mbox_msg_t msg); 62int omap_mbox_msg_send(struct omap_mbox *, mbox_msg_t msg);
@@ -73,8 +65,8 @@ void omap_mbox_init_seq(struct omap_mbox *);
73struct omap_mbox *omap_mbox_get(const char *); 65struct omap_mbox *omap_mbox_get(const char *);
74void omap_mbox_put(struct omap_mbox *); 66void omap_mbox_put(struct omap_mbox *);
75 67
76int omap_mbox_register(struct device *parent, struct omap_mbox *); 68int omap_mbox_register(struct device *parent, struct omap_mbox **);
77int omap_mbox_unregister(struct omap_mbox *); 69int omap_mbox_unregister(void);
78 70
79static inline void omap_mbox_save_ctx(struct omap_mbox *mbox) 71static inline void omap_mbox_save_ctx(struct omap_mbox *mbox)
80{ 72{
diff --git a/arch/arm/plat-omap/include/plat/mux.h b/arch/arm/plat-omap/include/plat/mux.h
index c7472a28ce2..aeba71796ad 100644
--- a/arch/arm/plat-omap/include/plat/mux.h
+++ b/arch/arm/plat-omap/include/plat/mux.h
@@ -114,28 +114,11 @@
114 PU_PD_REG(NA, 0) \ 114 PU_PD_REG(NA, 0) \
115}, 115},
116 116
117#define MUX_CFG_24XX(desc, reg_offset, mode, \
118 pull_en, pull_mode, dbg) \
119{ \
120 .name = desc, \
121 .debug = dbg, \
122 .mux_reg = reg_offset, \
123 .mask = mode, \
124 .pull_val = pull_en, \
125 .pu_pd_val = pull_mode, \
126},
127
128/* 24xx/34xx mux bit defines */
129#define OMAP2_PULL_ENA (1 << 3)
130#define OMAP2_PULL_UP (1 << 4)
131#define OMAP2_ALTELECTRICALSEL (1 << 5)
132
133struct pin_config { 117struct pin_config {
134 char *name; 118 char *name;
135 const unsigned int mux_reg; 119 const unsigned int mux_reg;
136 unsigned char debug; 120 unsigned char debug;
137 121
138#if defined(CONFIG_ARCH_OMAP1) || defined(CONFIG_ARCH_OMAP2)
139 const unsigned char mask_offset; 122 const unsigned char mask_offset;
140 const unsigned char mask; 123 const unsigned char mask;
141 124
@@ -147,7 +130,6 @@ struct pin_config {
147 const char *pu_pd_name; 130 const char *pu_pd_name;
148 const unsigned int pu_pd_reg; 131 const unsigned int pu_pd_reg;
149 const unsigned char pu_pd_val; 132 const unsigned char pu_pd_val;
150#endif
151 133
152#if defined(CONFIG_OMAP_MUX_DEBUG) || defined(CONFIG_OMAP_MUX_WARNINGS) 134#if defined(CONFIG_OMAP_MUX_DEBUG) || defined(CONFIG_OMAP_MUX_WARNINGS)
153 const char *mux_reg_name; 135 const char *mux_reg_name;
@@ -191,6 +173,10 @@ enum omap7xx_index {
191 SPI_7XX_4, 173 SPI_7XX_4,
192 SPI_7XX_5, 174 SPI_7XX_5,
193 SPI_7XX_6, 175 SPI_7XX_6,
176
177 /* UART */
178 UART_7XX_1,
179 UART_7XX_2,
194}; 180};
195 181
196enum omap1xxx_index { 182enum omap1xxx_index {
@@ -446,208 +432,6 @@ enum omap1xxx_index {
446 432
447}; 433};
448 434
449enum omap24xx_index {
450 /* 24xx I2C */
451 M19_24XX_I2C1_SCL,
452 L15_24XX_I2C1_SDA,
453 J15_24XX_I2C2_SCL,
454 H19_24XX_I2C2_SDA,
455
456 /* 24xx Menelaus interrupt */
457 W19_24XX_SYS_NIRQ,
458
459 /* 24xx clock */
460 W14_24XX_SYS_CLKOUT,
461
462 /* 24xx GPMC chipselects, wait pin monitoring */
463 E2_GPMC_NCS2,
464 L2_GPMC_NCS7,
465 L3_GPMC_WAIT0,
466 N7_GPMC_WAIT1,
467 M1_GPMC_WAIT2,
468 P1_GPMC_WAIT3,
469
470 /* 242X McBSP */
471 Y15_24XX_MCBSP2_CLKX,
472 R14_24XX_MCBSP2_FSX,
473 W15_24XX_MCBSP2_DR,
474 V15_24XX_MCBSP2_DX,
475
476 /* 24xx GPIO */
477 M21_242X_GPIO11,
478 P21_242X_GPIO12,
479 AA10_242X_GPIO13,
480 AA6_242X_GPIO14,
481 AA4_242X_GPIO15,
482 Y11_242X_GPIO16,
483 AA12_242X_GPIO17,
484 AA8_242X_GPIO58,
485 Y20_24XX_GPIO60,
486 W4__24XX_GPIO74,
487 N15_24XX_GPIO85,
488 M15_24XX_GPIO92,
489 P20_24XX_GPIO93,
490 P18_24XX_GPIO95,
491 M18_24XX_GPIO96,
492 L14_24XX_GPIO97,
493 J15_24XX_GPIO99,
494 V14_24XX_GPIO117,
495 P14_24XX_GPIO125,
496
497 /* 242x DBG GPIO */
498 V4_242X_GPIO49,
499 W2_242X_GPIO50,
500 U4_242X_GPIO51,
501 V3_242X_GPIO52,
502 V2_242X_GPIO53,
503 V6_242X_GPIO53,
504 T4_242X_GPIO54,
505 Y4_242X_GPIO54,
506 T3_242X_GPIO55,
507 U2_242X_GPIO56,
508
509 /* 24xx external DMA requests */
510 AA10_242X_DMAREQ0,
511 AA6_242X_DMAREQ1,
512 E4_242X_DMAREQ2,
513 G4_242X_DMAREQ3,
514 D3_242X_DMAREQ4,
515 E3_242X_DMAREQ5,
516
517 /* UART3 */
518 K15_24XX_UART3_TX,
519 K14_24XX_UART3_RX,
520
521 /* MMC/SDIO */
522 G19_24XX_MMC_CLKO,
523 H18_24XX_MMC_CMD,
524 F20_24XX_MMC_DAT0,
525 H14_24XX_MMC_DAT1,
526 E19_24XX_MMC_DAT2,
527 D19_24XX_MMC_DAT3,
528 F19_24XX_MMC_DAT_DIR0,
529 E20_24XX_MMC_DAT_DIR1,
530 F18_24XX_MMC_DAT_DIR2,
531 E18_24XX_MMC_DAT_DIR3,
532 G18_24XX_MMC_CMD_DIR,
533 H15_24XX_MMC_CLKI,
534
535 /* Full speed USB */
536 J20_24XX_USB0_PUEN,
537 J19_24XX_USB0_VP,
538 K20_24XX_USB0_VM,
539 J18_24XX_USB0_RCV,
540 K19_24XX_USB0_TXEN,
541 J14_24XX_USB0_SE0,
542 K18_24XX_USB0_DAT,
543
544 N14_24XX_USB1_SE0,
545 W12_24XX_USB1_SE0,
546 P15_24XX_USB1_DAT,
547 R13_24XX_USB1_DAT,
548 W20_24XX_USB1_TXEN,
549 P13_24XX_USB1_TXEN,
550 V19_24XX_USB1_RCV,
551 V12_24XX_USB1_RCV,
552
553 AA10_24XX_USB2_SE0,
554 Y11_24XX_USB2_DAT,
555 AA12_24XX_USB2_TXEN,
556 AA6_24XX_USB2_RCV,
557 AA4_24XX_USB2_TLLSE0,
558
559 /* Keypad GPIO*/
560 T19_24XX_KBR0,
561 R19_24XX_KBR1,
562 V18_24XX_KBR2,
563 M21_24XX_KBR3,
564 E5__24XX_KBR4,
565 M18_24XX_KBR5,
566 R20_24XX_KBC0,
567 M14_24XX_KBC1,
568 H19_24XX_KBC2,
569 V17_24XX_KBC3,
570 P21_24XX_KBC4,
571 L14_24XX_KBC5,
572 N19_24XX_KBC6,
573
574 /* 24xx Menelaus Keypad GPIO */
575 B3__24XX_KBR5,
576 AA4_24XX_KBC2,
577 B13_24XX_KBC6,
578
579 /* 2430 USB */
580 AD9_2430_USB0_PUEN,
581 Y11_2430_USB0_VP,
582 AD7_2430_USB0_VM,
583 AE7_2430_USB0_RCV,
584 AD4_2430_USB0_TXEN,
585 AF9_2430_USB0_SE0,
586 AE6_2430_USB0_DAT,
587 AD24_2430_USB1_SE0,
588 AB24_2430_USB1_RCV,
589 Y25_2430_USB1_TXEN,
590 AA26_2430_USB1_DAT,
591
592 /* 2430 HS-USB */
593 AD9_2430_USB0HS_DATA3,
594 Y11_2430_USB0HS_DATA4,
595 AD7_2430_USB0HS_DATA5,
596 AE7_2430_USB0HS_DATA6,
597 AD4_2430_USB0HS_DATA2,
598 AF9_2430_USB0HS_DATA0,
599 AE6_2430_USB0HS_DATA1,
600 AE8_2430_USB0HS_CLK,
601 AD8_2430_USB0HS_DIR,
602 AE5_2430_USB0HS_STP,
603 AE9_2430_USB0HS_NXT,
604 AC7_2430_USB0HS_DATA7,
605
606 /* 2430 McBSP */
607 AD6_2430_MCBSP_CLKS,
608
609 AB2_2430_MCBSP1_CLKR,
610 AD5_2430_MCBSP1_FSR,
611 AA1_2430_MCBSP1_DX,
612 AF3_2430_MCBSP1_DR,
613 AB3_2430_MCBSP1_FSX,
614 Y9_2430_MCBSP1_CLKX,
615
616 AC10_2430_MCBSP2_FSX,
617 AD16_2430_MCBSP2_CLX,
618 AE13_2430_MCBSP2_DX,
619 AD13_2430_MCBSP2_DR,
620 AC10_2430_MCBSP2_FSX_OFF,
621 AD16_2430_MCBSP2_CLX_OFF,
622 AE13_2430_MCBSP2_DX_OFF,
623 AD13_2430_MCBSP2_DR_OFF,
624
625 AC9_2430_MCBSP3_CLKX,
626 AE4_2430_MCBSP3_FSX,
627 AE2_2430_MCBSP3_DR,
628 AF4_2430_MCBSP3_DX,
629
630 N3_2430_MCBSP4_CLKX,
631 AD23_2430_MCBSP4_DR,
632 AB25_2430_MCBSP4_DX,
633 AC25_2430_MCBSP4_FSX,
634
635 AE16_2430_MCBSP5_CLKX,
636 AF12_2430_MCBSP5_FSX,
637 K7_2430_MCBSP5_DX,
638 M1_2430_MCBSP5_DR,
639
640 /* 2430 McSPI*/
641 Y18_2430_MCSPI1_CLK,
642 AD15_2430_MCSPI1_SIMO,
643 AE17_2430_MCSPI1_SOMI,
644 U1_2430_MCSPI1_CS0,
645
646 /* Touchscreen GPIO */
647 AF19_2430_GPIO_85,
648
649};
650
651struct omap_mux_cfg { 435struct omap_mux_cfg {
652 struct pin_config *pins; 436 struct pin_config *pins;
653 unsigned long size; 437 unsigned long size;
diff --git a/arch/arm/plat-omap/include/plat/nand.h b/arch/arm/plat-omap/include/plat/nand.h
index f8efd5466b1..6562cd082bb 100644
--- a/arch/arm/plat-omap/include/plat/nand.h
+++ b/arch/arm/plat-omap/include/plat/nand.h
@@ -21,13 +21,11 @@ struct omap_nand_platform_data {
21 int (*dev_ready)(struct omap_nand_platform_data *); 21 int (*dev_ready)(struct omap_nand_platform_data *);
22 int dma_channel; 22 int dma_channel;
23 unsigned long phys_base; 23 unsigned long phys_base;
24 void __iomem *gpmc_cs_baseaddr;
25 void __iomem *gpmc_baseaddr;
26 int devsize; 24 int devsize;
27}; 25};
28 26
29/* size (4 KiB) for IO mapping */ 27/* minimum size for IO mapping */
30#define NAND_IO_SIZE SZ_4K 28#define NAND_IO_SIZE 4
31 29
32#if defined(CONFIG_MTD_NAND_OMAP2) || defined(CONFIG_MTD_NAND_OMAP2_MODULE) 30#if defined(CONFIG_MTD_NAND_OMAP2) || defined(CONFIG_MTD_NAND_OMAP2_MODULE)
33extern int gpmc_nand_init(struct omap_nand_platform_data *d); 31extern int gpmc_nand_init(struct omap_nand_platform_data *d);
diff --git a/arch/arm/plat-omap/include/plat/omap-pm.h b/arch/arm/plat-omap/include/plat/omap-pm.h
index 3ee41d71149..728fbb9dd54 100644
--- a/arch/arm/plat-omap/include/plat/omap-pm.h
+++ b/arch/arm/plat-omap/include/plat/omap-pm.h
@@ -1,8 +1,8 @@
1/* 1/*
2 * omap-pm.h - OMAP power management interface 2 * omap-pm.h - OMAP power management interface
3 * 3 *
4 * Copyright (C) 2008-2009 Texas Instruments, Inc. 4 * Copyright (C) 2008-2010 Texas Instruments, Inc.
5 * Copyright (C) 2008-2009 Nokia Corporation 5 * Copyright (C) 2008-2010 Nokia Corporation
6 * Paul Walmsley 6 * Paul Walmsley
7 * 7 *
8 * Interface developed by (in alphabetical order): Karthik Dasu, Jouni 8 * Interface developed by (in alphabetical order): Karthik Dasu, Jouni
@@ -16,6 +16,7 @@
16 16
17#include <linux/device.h> 17#include <linux/device.h>
18#include <linux/cpufreq.h> 18#include <linux/cpufreq.h>
19#include <linux/clk.h>
19 20
20#include "powerdomain.h" 21#include "powerdomain.h"
21 22
@@ -89,7 +90,7 @@ void omap_pm_if_exit(void);
89 * @t: maximum MPU wakeup latency in microseconds 90 * @t: maximum MPU wakeup latency in microseconds
90 * 91 *
91 * Request that the maximum interrupt latency for the MPU to be no 92 * Request that the maximum interrupt latency for the MPU to be no
92 * greater than 't' microseconds. "Interrupt latency" in this case is 93 * greater than @t microseconds. "Interrupt latency" in this case is
93 * defined as the elapsed time from the occurrence of a hardware or 94 * defined as the elapsed time from the occurrence of a hardware or
94 * timer interrupt to the time when the device driver's interrupt 95 * timer interrupt to the time when the device driver's interrupt
95 * service routine has been entered by the MPU. 96 * service routine has been entered by the MPU.
@@ -105,15 +106,19 @@ void omap_pm_if_exit(void);
105 * elapsed from when a device driver enables a hardware device with 106 * elapsed from when a device driver enables a hardware device with
106 * clk_enable(), to when the device is ready for register access or 107 * clk_enable(), to when the device is ready for register access or
107 * other use. To control this device wakeup latency, use 108 * other use. To control this device wakeup latency, use
108 * set_max_dev_wakeup_lat() 109 * omap_pm_set_max_dev_wakeup_lat()
109 * 110 *
110 * Multiple calls to set_max_mpu_wakeup_lat() will replace the 111 * Multiple calls to omap_pm_set_max_mpu_wakeup_lat() will replace the
111 * previous t value. To remove the latency target for the MPU, call 112 * previous t value. To remove the latency target for the MPU, call
112 * with t = -1. 113 * with t = -1.
113 * 114 *
114 * No return value. 115 * XXX This constraint will be deprecated soon in favor of the more
116 * general omap_pm_set_max_dev_wakeup_lat()
117 *
118 * Returns -EINVAL for an invalid argument, -ERANGE if the constraint
119 * is not satisfiable, or 0 upon success.
115 */ 120 */
116void omap_pm_set_max_mpu_wakeup_lat(struct device *dev, long t); 121int omap_pm_set_max_mpu_wakeup_lat(struct device *dev, long t);
117 122
118 123
119/** 124/**
@@ -123,8 +128,8 @@ void omap_pm_set_max_mpu_wakeup_lat(struct device *dev, long t);
123 * @r: minimum throughput (in KiB/s) 128 * @r: minimum throughput (in KiB/s)
124 * 129 *
125 * Request that the minimum data throughput on the OCP interconnect 130 * Request that the minimum data throughput on the OCP interconnect
126 * attached to device 'dev' interconnect agent 'tbus_id' be no less 131 * attached to device @dev interconnect agent @tbus_id be no less
127 * than 'r' KiB/s. 132 * than @r KiB/s.
128 * 133 *
129 * It is expected that the OMAP PM or bus code will use this 134 * It is expected that the OMAP PM or bus code will use this
130 * information to set the interconnect clock to run at the lowest 135 * information to set the interconnect clock to run at the lowest
@@ -138,40 +143,44 @@ void omap_pm_set_max_mpu_wakeup_lat(struct device *dev, long t);
138 * code will also need to add an minimum L3 interconnect speed 143 * code will also need to add an minimum L3 interconnect speed
139 * constraint, 144 * constraint,
140 * 145 *
141 * Multiple calls to set_min_bus_tput() will replace the previous rate 146 * Multiple calls to omap_pm_set_min_bus_tput() will replace the
142 * value for this device. To remove the interconnect throughput 147 * previous rate value for this device. To remove the interconnect
143 * restriction for this device, call with r = 0. 148 * throughput restriction for this device, call with r = 0.
144 * 149 *
145 * No return value. 150 * Returns -EINVAL for an invalid argument, -ERANGE if the constraint
151 * is not satisfiable, or 0 upon success.
146 */ 152 */
147void omap_pm_set_min_bus_tput(struct device *dev, u8 agent_id, unsigned long r); 153int omap_pm_set_min_bus_tput(struct device *dev, u8 agent_id, unsigned long r);
148 154
149 155
150/** 156/**
151 * omap_pm_set_max_dev_wakeup_lat - set the maximum device enable latency 157 * omap_pm_set_max_dev_wakeup_lat - set the maximum device enable latency
152 * @dev: struct device * 158 * @req_dev: struct device * requesting the constraint, or NULL if none
159 * @dev: struct device * to set the constraint one
153 * @t: maximum device wakeup latency in microseconds 160 * @t: maximum device wakeup latency in microseconds
154 * 161 *
155 * Request that the maximum amount of time necessary for a device to 162 * Request that the maximum amount of time necessary for a device @dev
156 * become accessible after its clocks are enabled should be no greater 163 * to become accessible after its clocks are enabled should be no
157 * than 't' microseconds. Specifically, this represents the time from 164 * greater than @t microseconds. Specifically, this represents the
158 * when a device driver enables device clocks with clk_enable(), to 165 * time from when a device driver enables device clocks with
159 * when the register reads and writes on the device will succeed. 166 * clk_enable(), to when the register reads and writes on the device
160 * This function should be called before clk_disable() is called, 167 * will succeed. This function should be called before clk_disable()
161 * since the power state transition decision may be made during 168 * is called, since the power state transition decision may be made
162 * clk_disable(). 169 * during clk_disable().
163 * 170 *
164 * It is intended that underlying PM code will use this information to 171 * It is intended that underlying PM code will use this information to
165 * determine what power state to put the powerdomain enclosing this 172 * determine what power state to put the powerdomain enclosing this
166 * device into. 173 * device into.
167 * 174 *
168 * Multiple calls to set_max_dev_wakeup_lat() will replace the 175 * Multiple calls to omap_pm_set_max_dev_wakeup_lat() will replace the
169 * previous wakeup latency values for this device. To remove the wakeup 176 * previous wakeup latency values for this device. To remove the
170 * latency restriction for this device, call with t = -1. 177 * wakeup latency restriction for this device, call with t = -1.
171 * 178 *
172 * No return value. 179 * Returns -EINVAL for an invalid argument, -ERANGE if the constraint
180 * is not satisfiable, or 0 upon success.
173 */ 181 */
174void omap_pm_set_max_dev_wakeup_lat(struct device *dev, long t); 182int omap_pm_set_max_dev_wakeup_lat(struct device *req_dev, struct device *dev,
183 long t);
175 184
176 185
177/** 186/**
@@ -198,10 +207,71 @@ void omap_pm_set_max_dev_wakeup_lat(struct device *dev, long t);
198 * value for this device. To remove the maximum DMA latency for this 207 * value for this device. To remove the maximum DMA latency for this
199 * device, call with t = -1. 208 * device, call with t = -1.
200 * 209 *
201 * No return value. 210 * Returns -EINVAL for an invalid argument, -ERANGE if the constraint
211 * is not satisfiable, or 0 upon success.
202 */ 212 */
203void omap_pm_set_max_sdma_lat(struct device *dev, long t); 213int omap_pm_set_max_sdma_lat(struct device *dev, long t);
214
204 215
216/**
217 * omap_pm_set_min_clk_rate - set minimum clock rate requested by @dev
218 * @dev: struct device * requesting the constraint
219 * @clk: struct clk * to set the minimum rate constraint on
220 * @r: minimum rate in Hz
221 *
222 * Request that the minimum clock rate on the device @dev's clk @clk
223 * be no less than @r Hz.
224 *
225 * It is expected that the OMAP PM code will use this information to
226 * find an OPP or clock setting that will satisfy this clock rate
227 * constraint, along with any other applicable system constraints on
228 * the clock rate or corresponding voltage, etc.
229 *
230 * omap_pm_set_min_clk_rate() differs from the clock code's
231 * clk_set_rate() in that it considers other constraints before taking
232 * any hardware action, and may change a system OPP rather than just a
233 * clock rate. clk_set_rate() is intended to be a low-level
234 * interface.
235 *
236 * omap_pm_set_min_clk_rate() is easily open to abuse. A better API
237 * would be something like "omap_pm_set_min_dev_performance()";
238 * however, there is no easily-generalizable concept of performance
239 * that applies to all devices. Only a device (and possibly the
240 * device subsystem) has both the subsystem-specific knowledge, and
241 * the hardware IP block-specific knowledge, to translate a constraint
242 * on "touchscreen sampling accuracy" or "number of pixels or polygons
243 * rendered per second" to a clock rate. This translation can be
244 * dependent on the hardware IP block's revision, or firmware version,
245 * and the driver is the only code on the system that has this
246 * information and can know how to translate that into a clock rate.
247 *
248 * The intended use-case for this function is for userspace or other
249 * kernel code to communicate a particular performance requirement to
250 * a subsystem; then for the subsystem to communicate that requirement
251 * to something that is meaningful to the device driver; then for the
252 * device driver to convert that requirement to a clock rate, and to
253 * then call omap_pm_set_min_clk_rate().
254 *
255 * Users of this function (such as device drivers) should not simply
256 * call this function with some high clock rate to ensure "high
257 * performance." Rather, the device driver should take a performance
258 * constraint from its subsystem, such as "render at least X polygons
259 * per second," and use some formula or table to convert that into a
260 * clock rate constraint given the hardware type and hardware
261 * revision. Device drivers or subsystems should not assume that they
262 * know how to make a power/performance tradeoff - some device use
263 * cases may tolerate a lower-fidelity device function for lower power
264 * consumption; others may demand a higher-fidelity device function,
265 * no matter what the power consumption.
266 *
267 * Multiple calls to omap_pm_set_min_clk_rate() will replace the
268 * previous rate value for the device @dev. To remove the minimum clock
269 * rate constraint for the device, call with r = 0.
270 *
271 * Returns -EINVAL for an invalid argument, -ERANGE if the constraint
272 * is not satisfiable, or 0 upon success.
273 */
274int omap_pm_set_min_clk_rate(struct device *dev, struct clk *c, long r);
205 275
206/* 276/*
207 * DSP Bridge-specific constraints 277 * DSP Bridge-specific constraints
diff --git a/arch/arm/plat-omap/include/plat/omap_device.h b/arch/arm/plat-omap/include/plat/omap_device.h
index 3694b622c4a..25cd9ac3b09 100644
--- a/arch/arm/plat-omap/include/plat/omap_device.h
+++ b/arch/arm/plat-omap/include/plat/omap_device.h
@@ -101,6 +101,8 @@ struct omap_device *omap_device_build_ss(const char *pdev_name, int pdev_id,
101int omap_device_register(struct omap_device *od); 101int omap_device_register(struct omap_device *od);
102int omap_early_device_register(struct omap_device *od); 102int omap_early_device_register(struct omap_device *od);
103 103
104void __iomem *omap_device_get_rt_va(struct omap_device *od);
105
104/* OMAP PM interface */ 106/* OMAP PM interface */
105int omap_device_align_pm_lat(struct platform_device *pdev, 107int omap_device_align_pm_lat(struct platform_device *pdev,
106 u32 new_wakeup_lat_limit); 108 u32 new_wakeup_lat_limit);
diff --git a/arch/arm/plat-omap/include/plat/omap_hwmod.h b/arch/arm/plat-omap/include/plat/omap_hwmod.h
index 0eccc09ac4a..a4e508dfaba 100644
--- a/arch/arm/plat-omap/include/plat/omap_hwmod.h
+++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * omap_hwmod macros, structures 2 * omap_hwmod macros, structures
3 * 3 *
4 * Copyright (C) 2009 Nokia Corporation 4 * Copyright (C) 2009-2010 Nokia Corporation
5 * Paul Walmsley 5 * Paul Walmsley
6 * 6 *
7 * Created in collaboration with (alphabetical order): Benoît Cousson, 7 * Created in collaboration with (alphabetical order): Benoît Cousson,
@@ -419,7 +419,7 @@ struct omap_hwmod_class {
419 * @slaves: ptr to array of OCP ifs that this hwmod can respond on 419 * @slaves: ptr to array of OCP ifs that this hwmod can respond on
420 * @dev_attr: arbitrary device attributes that can be passed to the driver 420 * @dev_attr: arbitrary device attributes that can be passed to the driver
421 * @_sysc_cache: internal-use hwmod flags 421 * @_sysc_cache: internal-use hwmod flags
422 * @_rt_va: cached register target start address (internal use) 422 * @_mpu_rt_va: cached register target start address (internal use)
423 * @_mpu_port_index: cached MPU register target slave ID (internal use) 423 * @_mpu_port_index: cached MPU register target slave ID (internal use)
424 * @msuspendmux_reg_id: CONTROL_MSUSPENDMUX register ID (1-6) 424 * @msuspendmux_reg_id: CONTROL_MSUSPENDMUX register ID (1-6)
425 * @msuspendmux_shift: CONTROL_MSUSPENDMUX register bit shift 425 * @msuspendmux_shift: CONTROL_MSUSPENDMUX register bit shift
@@ -460,7 +460,7 @@ struct omap_hwmod {
460 struct omap_hwmod_ocp_if **slaves; /* connect to *_TA */ 460 struct omap_hwmod_ocp_if **slaves; /* connect to *_TA */
461 void *dev_attr; 461 void *dev_attr;
462 u32 _sysc_cache; 462 u32 _sysc_cache;
463 void __iomem *_rt_va; 463 void __iomem *_mpu_rt_va;
464 struct list_head node; 464 struct list_head node;
465 u16 flags; 465 u16 flags;
466 u8 _mpu_port_index; 466 u8 _mpu_port_index;
@@ -482,11 +482,14 @@ int omap_hwmod_init(struct omap_hwmod **ohs);
482int omap_hwmod_register(struct omap_hwmod *oh); 482int omap_hwmod_register(struct omap_hwmod *oh);
483int omap_hwmod_unregister(struct omap_hwmod *oh); 483int omap_hwmod_unregister(struct omap_hwmod *oh);
484struct omap_hwmod *omap_hwmod_lookup(const char *name); 484struct omap_hwmod *omap_hwmod_lookup(const char *name);
485int omap_hwmod_for_each(int (*fn)(struct omap_hwmod *oh)); 485int omap_hwmod_for_each(int (*fn)(struct omap_hwmod *oh, void *data),
486int omap_hwmod_late_init(void); 486 void *data);
487int omap_hwmod_late_init(u8 skip_setup_idle);
487 488
488int omap_hwmod_enable(struct omap_hwmod *oh); 489int omap_hwmod_enable(struct omap_hwmod *oh);
490int _omap_hwmod_enable(struct omap_hwmod *oh);
489int omap_hwmod_idle(struct omap_hwmod *oh); 491int omap_hwmod_idle(struct omap_hwmod *oh);
492int _omap_hwmod_idle(struct omap_hwmod *oh);
490int omap_hwmod_shutdown(struct omap_hwmod *oh); 493int omap_hwmod_shutdown(struct omap_hwmod *oh);
491 494
492int omap_hwmod_enable_clocks(struct omap_hwmod *oh); 495int omap_hwmod_enable_clocks(struct omap_hwmod *oh);
@@ -504,6 +507,7 @@ int omap_hwmod_count_resources(struct omap_hwmod *oh);
504int omap_hwmod_fill_resources(struct omap_hwmod *oh, struct resource *res); 507int omap_hwmod_fill_resources(struct omap_hwmod *oh, struct resource *res);
505 508
506struct powerdomain *omap_hwmod_get_pwrdm(struct omap_hwmod *oh); 509struct powerdomain *omap_hwmod_get_pwrdm(struct omap_hwmod *oh);
510void __iomem *omap_hwmod_get_mpu_rt_va(struct omap_hwmod *oh);
507 511
508int omap_hwmod_add_initiator_dep(struct omap_hwmod *oh, 512int omap_hwmod_add_initiator_dep(struct omap_hwmod *oh,
509 struct omap_hwmod *init_oh); 513 struct omap_hwmod *init_oh);
diff --git a/arch/arm/plat-omap/include/plat/smp.h b/arch/arm/plat-omap/include/plat/smp.h
index 8983d54c4fd..6a3ff65c030 100644
--- a/arch/arm/plat-omap/include/plat/smp.h
+++ b/arch/arm/plat-omap/include/plat/smp.h
@@ -30,6 +30,7 @@
30extern void omap_secondary_startup(void); 30extern void omap_secondary_startup(void);
31extern u32 omap_modify_auxcoreboot0(u32 set_mask, u32 clear_mask); 31extern u32 omap_modify_auxcoreboot0(u32 set_mask, u32 clear_mask);
32extern void omap_auxcoreboot_addr(u32 cpu_addr); 32extern void omap_auxcoreboot_addr(u32 cpu_addr);
33extern u32 omap_read_auxcoreboot0(void);
33 34
34/* 35/*
35 * We use Soft IRQ1 as the IPI 36 * We use Soft IRQ1 as the IPI
diff --git a/arch/arm/plat-omap/include/plat/uncompress.h b/arch/arm/plat-omap/include/plat/uncompress.h
index bbedd71943f..ddf723be48d 100644
--- a/arch/arm/plat-omap/include/plat/uncompress.h
+++ b/arch/arm/plat-omap/include/plat/uncompress.h
@@ -25,6 +25,8 @@
25 25
26#include <plat/serial.h> 26#include <plat/serial.h>
27 27
28#define MDR1_MODE_MASK 0x07
29
28static volatile u8 *uart_base; 30static volatile u8 *uart_base;
29static int uart_shift; 31static int uart_shift;
30 32
@@ -42,6 +44,10 @@ static void putc(int c)
42 if (!uart_base) 44 if (!uart_base)
43 return; 45 return;
44 46
47 /* Check for UART 16x mode */
48 if ((uart_base[UART_OMAP_MDR1 << uart_shift] & MDR1_MODE_MASK) != 0)
49 return;
50
45 while (!(uart_base[UART_LSR << uart_shift] & UART_LSR_THRE)) 51 while (!(uart_base[UART_LSR << uart_shift] & UART_LSR_THRE))
46 barrier(); 52 barrier();
47 uart_base[UART_TX << uart_shift] = c; 53 uart_base[UART_TX << uart_shift] = c;
diff --git a/arch/arm/plat-omap/include/plat/usb.h b/arch/arm/plat-omap/include/plat/usb.h
index 98eef5360e6..2a9427c8cc4 100644
--- a/arch/arm/plat-omap/include/plat/usb.h
+++ b/arch/arm/plat-omap/include/plat/usb.h
@@ -81,7 +81,34 @@ extern void usb_ohci_init(const struct ohci_hcd_omap_platform_data *pdata);
81 81
82#endif 82#endif
83 83
84void omap_usb_init(struct omap_usb_config *pdata); 84
85/*
86 * FIXME correct answer depends on hmc_mode,
87 * as does (on omap1) any nonzero value for config->otg port number
88 */
89#ifdef CONFIG_USB_GADGET_OMAP
90#define is_usb0_device(config) 1
91#else
92#define is_usb0_device(config) 0
93#endif
94
95void omap_otg_init(struct omap_usb_config *config);
96
97#if defined(CONFIG_USB) || defined(CONFIG_USB_MODULE)
98void omap1_usb_init(struct omap_usb_config *pdata);
99#else
100static inline void omap1_usb_init(struct omap_usb_config *pdata)
101{
102}
103#endif
104
105#if defined(CONFIG_ARCH_OMAP_OTG) || defined(CONFIG_ARCH_OMAP_OTG_MODULE)
106void omap2_usbfs_init(struct omap_usb_config *pdata);
107#else
108static inline omap2_usbfs_init(struct omap_usb_config *pdata)
109{
110}
111#endif
85 112
86/*-------------------------------------------------------------------------*/ 113/*-------------------------------------------------------------------------*/
87 114
@@ -192,4 +219,24 @@ void omap_usb_init(struct omap_usb_config *pdata);
192# define USB0PUENACTLOI (1 << 16) 219# define USB0PUENACTLOI (1 << 16)
193# define USBSTANDBYCTRL (1 << 15) 220# define USBSTANDBYCTRL (1 << 15)
194 221
222#if defined(CONFIG_ARCH_OMAP1) && defined(CONFIG_USB)
223u32 omap1_usb0_init(unsigned nwires, unsigned is_device);
224u32 omap1_usb1_init(unsigned nwires);
225u32 omap1_usb2_init(unsigned nwires, unsigned alt_pingroup);
226#else
227static inline u32 omap1_usb0_init(unsigned nwires, unsigned is_device)
228{
229 return 0;
230}
231static inline u32 omap1_usb1_init(unsigned nwires)
232{
233 return 0;
234
235}
236static inline u32 omap1_usb2_init(unsigned nwires, unsigned alt_pingroup)
237{
238 return 0;
239}
240#endif
241
195#endif /* __ASM_ARCH_OMAP_USB_H */ 242#endif /* __ASM_ARCH_OMAP_USB_H */