aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-omap/include/mach
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2008-12-15 17:13:26 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-12-15 17:13:26 -0500
commit7e1548a597ef7e26d5d62f8be3be6da9e101b26c (patch)
treefe6cbf4d9a3c1afdba04fb276fef0f932403727c /arch/arm/plat-omap/include/mach
parent1f7f569c0ae6e619504095eabf796edd712d943d (diff)
parent2619bc327417f549f1c89d5ef9b4a4aa768f41a2 (diff)
Merge branch 'omap3-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6 into devel
Diffstat (limited to 'arch/arm/plat-omap/include/mach')
-rw-r--r--arch/arm/plat-omap/include/mach/board-apollon.h4
-rw-r--r--arch/arm/plat-omap/include/mach/board-ldp.h5
-rw-r--r--arch/arm/plat-omap/include/mach/cpu.h82
-rw-r--r--arch/arm/plat-omap/include/mach/gpio.h31
-rw-r--r--arch/arm/plat-omap/include/mach/mux.h41
-rw-r--r--arch/arm/plat-omap/include/mach/omapfb.h4
6 files changed, 100 insertions, 67 deletions
diff --git a/arch/arm/plat-omap/include/mach/board-apollon.h b/arch/arm/plat-omap/include/mach/board-apollon.h
index 731c858cf3fe..61bd5e8f09b1 100644
--- a/arch/arm/plat-omap/include/mach/board-apollon.h
+++ b/arch/arm/plat-omap/include/mach/board-apollon.h
@@ -29,12 +29,14 @@
29#ifndef __ASM_ARCH_OMAP_APOLLON_H 29#ifndef __ASM_ARCH_OMAP_APOLLON_H
30#define __ASM_ARCH_OMAP_APOLLON_H 30#define __ASM_ARCH_OMAP_APOLLON_H
31 31
32#include <mach/cpu.h>
33
32extern void apollon_mmc_init(void); 34extern void apollon_mmc_init(void);
33 35
34static inline int apollon_plus(void) 36static inline int apollon_plus(void)
35{ 37{
36 /* The apollon plus has IDCODE revision 5 */ 38 /* The apollon plus has IDCODE revision 5 */
37 return system_rev & 0xc0; 39 return omap_rev() & 0xc0;
38} 40}
39 41
40/* Placeholder for APOLLON specific defines */ 42/* Placeholder for APOLLON specific defines */
diff --git a/arch/arm/plat-omap/include/mach/board-ldp.h b/arch/arm/plat-omap/include/mach/board-ldp.h
index 66e2746c04ca..f23399665212 100644
--- a/arch/arm/plat-omap/include/mach/board-ldp.h
+++ b/arch/arm/plat-omap/include/mach/board-ldp.h
@@ -32,5 +32,8 @@
32extern void twl4030_bci_battery_init(void); 32extern void twl4030_bci_battery_init(void);
33 33
34#define TWL4030_IRQNUM INT_34XX_SYS_NIRQ 34#define TWL4030_IRQNUM INT_34XX_SYS_NIRQ
35 35#define LDP_SMC911X_CS 1
36#define LDP_SMC911X_GPIO 152
37#define DEBUG_BASE 0x08000000
38#define OMAP34XX_ETHR_START DEBUG_BASE
36#endif /* __ASM_ARCH_OMAP_LDP_H */ 39#endif /* __ASM_ARCH_OMAP_LDP_H */
diff --git a/arch/arm/plat-omap/include/mach/cpu.h b/arch/arm/plat-omap/include/mach/cpu.h
index e0464187209d..b2062f1175de 100644
--- a/arch/arm/plat-omap/include/mach/cpu.h
+++ b/arch/arm/plat-omap/include/mach/cpu.h
@@ -28,13 +28,18 @@
28 28
29struct omap_chip_id { 29struct omap_chip_id {
30 u8 oc; 30 u8 oc;
31 u8 type;
31}; 32};
32 33
33#define OMAP_CHIP_INIT(x) { .oc = x } 34#define OMAP_CHIP_INIT(x) { .oc = x }
34 35
35extern unsigned int system_rev; 36/*
36 37 * omap_rev bits:
37#define omap2_cpu_rev() ((system_rev >> 12) & 0x0f) 38 * CPU id bits (0730, 1510, 1710, 2422...) [31:16]
39 * CPU revision (See _REV_ defined in cpu.h) [15:08]
40 * CPU class bits (15xx, 16xx, 24xx, 34xx...) [07:00]
41 */
42unsigned int omap_rev(void);
38 43
39/* 44/*
40 * Test if multicore OMAP support is needed 45 * Test if multicore OMAP support is needed
@@ -108,7 +113,7 @@ extern unsigned int system_rev;
108 * cpu_is_omap243x(): True for OMAP2430 113 * cpu_is_omap243x(): True for OMAP2430
109 * cpu_is_omap343x(): True for OMAP3430 114 * cpu_is_omap343x(): True for OMAP3430
110 */ 115 */
111#define GET_OMAP_CLASS ((system_rev >> 24) & 0xff) 116#define GET_OMAP_CLASS (omap_rev() & 0xff)
112 117
113#define IS_OMAP_CLASS(class, id) \ 118#define IS_OMAP_CLASS(class, id) \
114static inline int is_omap ##class (void) \ 119static inline int is_omap ##class (void) \
@@ -116,7 +121,7 @@ static inline int is_omap ##class (void) \
116 return (GET_OMAP_CLASS == (id)) ? 1 : 0; \ 121 return (GET_OMAP_CLASS == (id)) ? 1 : 0; \
117} 122}
118 123
119#define GET_OMAP_SUBCLASS ((system_rev >> 20) & 0x0fff) 124#define GET_OMAP_SUBCLASS ((omap_rev() >> 20) & 0x0fff)
120 125
121#define IS_OMAP_SUBCLASS(subclass, id) \ 126#define IS_OMAP_SUBCLASS(subclass, id) \
122static inline int is_omap ##subclass (void) \ 127static inline int is_omap ##subclass (void) \
@@ -226,7 +231,7 @@ IS_OMAP_SUBCLASS(343x, 0x343)
226 * cpu_is_omap2430(): True for OMAP2430 231 * cpu_is_omap2430(): True for OMAP2430
227 * cpu_is_omap3430(): True for OMAP3430 232 * cpu_is_omap3430(): True for OMAP3430
228 */ 233 */
229#define GET_OMAP_TYPE ((system_rev >> 16) & 0xffff) 234#define GET_OMAP_TYPE ((omap_rev() >> 16) & 0xffff)
230 235
231#define IS_OMAP_TYPE(type, id) \ 236#define IS_OMAP_TYPE(type, id) \
232static inline int is_omap ##type (void) \ 237static inline int is_omap ##type (void) \
@@ -320,44 +325,20 @@ IS_OMAP_TYPE(3430, 0x3430)
320#define cpu_class_is_omap2() (cpu_is_omap24xx() || cpu_is_omap34xx()) 325#define cpu_class_is_omap2() (cpu_is_omap24xx() || cpu_is_omap34xx())
321 326
322#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) 327#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
323/*
324 * Macros to detect silicon revision of OMAP2/3 processors.
325 * is_sil_rev_greater_than: true if passed cpu type & its rev is greater.
326 * is_sil_rev_lesser_than: true if passed cpu type & its rev is lesser.
327 * is_sil_rev_equal_to: true if passed cpu type & its rev is equal.
328 * get_sil_rev: return the silicon rev value.
329 */
330#define get_sil_omap_type(rev) ((rev & 0xffff0000) >> 16)
331#define get_sil_revision(rev) ((rev & 0x0000f000) >> 12)
332 328
333#define is_sil_rev_greater_than(rev) \ 329/* Various silicon revisions for omap2 */
334 ((get_sil_omap_type(system_rev) == get_sil_omap_type(rev)) && \ 330#define OMAP242X_CLASS 0x24200024
335 (get_sil_revision(system_rev) > get_sil_revision(rev))) 331#define OMAP2420_REV_ES1_0 0x24200024
332#define OMAP2420_REV_ES2_0 0x24201024
336 333
337#define is_sil_rev_less_than(rev) \ 334#define OMAP243X_CLASS 0x24300024
338 ((get_sil_omap_type(system_rev) == get_sil_omap_type(rev)) && \ 335#define OMAP2430_REV_ES1_0 0x24300024
339 (get_sil_revision(system_rev) < get_sil_revision(rev)))
340 336
341#define is_sil_rev_equal_to(rev) \ 337#define OMAP343X_CLASS 0x34300034
342 ((get_sil_omap_type(system_rev) == get_sil_omap_type(rev)) && \ 338#define OMAP3430_REV_ES1_0 0x34300034
343 (get_sil_revision(system_rev) == get_sil_revision(rev))) 339#define OMAP3430_REV_ES2_0 0x34301034
344 340#define OMAP3430_REV_ES2_1 0x34302034
345#define get_sil_rev() \ 341#define OMAP3430_REV_ES3_0 0x34303034
346 get_sil_revision(system_rev)
347
348/* Various silicon macros defined here */
349#define OMAP242X_CLASS 0x24200000
350#define OMAP2420_REV_ES1_0 0x24200000
351#define OMAP2420_REV_ES2_0 0x24201000
352
353#define OMAP243X_CLASS 0x24300000
354#define OMAP2430_REV_ES1_0 0x24300000
355
356#define OMAP343X_CLASS 0x34300000
357#define OMAP3430_REV_ES1_0 0x34300000
358#define OMAP3430_REV_ES2_0 0x34301000
359#define OMAP3430_REV_ES2_1 0x34302000
360#define OMAP3430_REV_ES2_2 0x34303000
361 342
362/* 343/*
363 * omap_chip bits 344 * omap_chip bits
@@ -382,23 +363,16 @@ IS_OMAP_TYPE(3430, 0x3430)
382#define CHIP_IS_OMAP24XX (CHIP_IS_OMAP2420 | CHIP_IS_OMAP2430) 363#define CHIP_IS_OMAP24XX (CHIP_IS_OMAP2420 | CHIP_IS_OMAP2430)
383 364
384int omap_chip_is(struct omap_chip_id oci); 365int omap_chip_is(struct omap_chip_id oci);
385 366int omap_type(void);
386 367
387/* 368/*
388 * Macro to detect device type i.e. EMU/HS/TST/GP/BAD 369 * Macro to detect device type i.e. EMU/HS/TST/GP/BAD
389 */ 370 */
390#define DEVICE_TYPE_TEST 0 371#define OMAP2_DEVICE_TYPE_TEST 0
391#define DEVICE_TYPE_EMU 1 372#define OMAP2_DEVICE_TYPE_EMU 1
392#define DEVICE_TYPE_SEC 2 373#define OMAP2_DEVICE_TYPE_SEC 2
393#define DEVICE_TYPE_GP 3 374#define OMAP2_DEVICE_TYPE_GP 3
394#define DEVICE_TYPE_BAD 4 375#define OMAP2_DEVICE_TYPE_BAD 4
395
396#define get_device_type() ((system_rev & 0x700) >> 8)
397#define is_device_type_test() (get_device_type() == DEVICE_TYPE_TEST)
398#define is_device_type_emu() (get_device_type() == DEVICE_TYPE_EMU)
399#define is_device_type_sec() (get_device_type() == DEVICE_TYPE_SEC)
400#define is_device_type_gp() (get_device_type() == DEVICE_TYPE_GP)
401#define is_device_type_bad() (get_device_type() == DEVICE_TYPE_BAD)
402 376
403void omap2_check_revision(void); 377void omap2_check_revision(void);
404 378
diff --git a/arch/arm/plat-omap/include/mach/gpio.h b/arch/arm/plat-omap/include/mach/gpio.h
index 98e9008b7e9d..04e68e88f134 100644
--- a/arch/arm/plat-omap/include/mach/gpio.h
+++ b/arch/arm/plat-omap/include/mach/gpio.h
@@ -71,11 +71,6 @@
71 IH_GPIO_BASE + (nr)) 71 IH_GPIO_BASE + (nr))
72 72
73extern int omap_gpio_init(void); /* Call from board init only */ 73extern int omap_gpio_init(void); /* Call from board init only */
74extern int omap_request_gpio(int gpio);
75extern void omap_free_gpio(int gpio);
76extern void omap_set_gpio_direction(int gpio, int is_input);
77extern void omap_set_gpio_dataout(int gpio, int enable);
78extern int omap_get_gpio_datain(int gpio);
79extern void omap2_gpio_prepare_for_retention(void); 74extern void omap2_gpio_prepare_for_retention(void);
80extern void omap2_gpio_resume_after_retention(void); 75extern void omap2_gpio_resume_after_retention(void);
81extern void omap_set_gpio_debounce(int gpio, int enable); 76extern void omap_set_gpio_debounce(int gpio, int enable);
@@ -92,6 +87,16 @@ extern void omap_set_gpio_debounce_time(int gpio, int enable);
92#include <linux/errno.h> 87#include <linux/errno.h>
93#include <asm-generic/gpio.h> 88#include <asm-generic/gpio.h>
94 89
90static inline int omap_request_gpio(int gpio)
91{
92 return gpio_request(gpio, "FIXME");
93}
94
95static inline void omap_free_gpio(int gpio)
96{
97 gpio_free(gpio);
98}
99
95static inline int gpio_get_value(unsigned gpio) 100static inline int gpio_get_value(unsigned gpio)
96{ 101{
97 return __gpio_get_value(gpio); 102 return __gpio_get_value(gpio);
@@ -109,16 +114,24 @@ static inline int gpio_cansleep(unsigned gpio)
109 114
110static inline int gpio_to_irq(unsigned gpio) 115static inline int gpio_to_irq(unsigned gpio)
111{ 116{
112 if (gpio < (OMAP_MAX_GPIO_LINES + 16)) 117 return __gpio_to_irq(gpio);
113 return OMAP_GPIO_IRQ(gpio);
114 return -EINVAL;
115} 118}
116 119
117static inline int irq_to_gpio(unsigned irq) 120static inline int irq_to_gpio(unsigned irq)
118{ 121{
122 int tmp;
123
124 /* omap1 SOC mpuio */
119 if (cpu_class_is_omap1() && (irq < (IH_MPUIO_BASE + 16))) 125 if (cpu_class_is_omap1() && (irq < (IH_MPUIO_BASE + 16)))
120 return (irq - IH_MPUIO_BASE) + OMAP_MAX_GPIO_LINES; 126 return (irq - IH_MPUIO_BASE) + OMAP_MAX_GPIO_LINES;
121 return irq - IH_GPIO_BASE; 127
128 /* SOC gpio */
129 tmp = irq - IH_GPIO_BASE;
130 if (tmp < OMAP_MAX_GPIO_LINES)
131 return tmp;
132
133 /* we don't supply reverse mappings for non-SOC gpios */
134 return -EIO;
122} 135}
123 136
124#endif 137#endif
diff --git a/arch/arm/plat-omap/include/mach/mux.h b/arch/arm/plat-omap/include/mach/mux.h
index 6bbf1789bed5..f4362b8682c7 100644
--- a/arch/arm/plat-omap/include/mach/mux.h
+++ b/arch/arm/plat-omap/include/mach/mux.h
@@ -632,6 +632,15 @@ enum omap24xx_index {
632 AC7_2430_USB0HS_DATA7, 632 AC7_2430_USB0HS_DATA7,
633 633
634 /* 2430 McBSP */ 634 /* 2430 McBSP */
635 AD6_2430_MCBSP_CLKS,
636
637 AB2_2430_MCBSP1_CLKR,
638 AD5_2430_MCBSP1_FSR,
639 AA1_2430_MCBSP1_DX,
640 AF3_2430_MCBSP1_DR,
641 AB3_2430_MCBSP1_FSX,
642 Y9_2430_MCBSP1_CLKX,
643
635 AC10_2430_MCBSP2_FSX, 644 AC10_2430_MCBSP2_FSX,
636 AD16_2430_MCBSP2_CLX, 645 AD16_2430_MCBSP2_CLX,
637 AE13_2430_MCBSP2_DX, 646 AE13_2430_MCBSP2_DX,
@@ -641,6 +650,30 @@ enum omap24xx_index {
641 AE13_2430_MCBSP2_DX_OFF, 650 AE13_2430_MCBSP2_DX_OFF,
642 AD13_2430_MCBSP2_DR_OFF, 651 AD13_2430_MCBSP2_DR_OFF,
643 652
653 AC9_2430_MCBSP3_CLKX,
654 AE4_2430_MCBSP3_FSX,
655 AE2_2430_MCBSP3_DR,
656 AF4_2430_MCBSP3_DX,
657
658 N3_2430_MCBSP4_CLKX,
659 AD23_2430_MCBSP4_DR,
660 AB25_2430_MCBSP4_DX,
661 AC25_2430_MCBSP4_FSX,
662
663 AE16_2430_MCBSP5_CLKX,
664 AF12_2430_MCBSP5_FSX,
665 K7_2430_MCBSP5_DX,
666 M1_2430_MCBSP5_DR,
667
668 /* 2430 McSPI*/
669 Y18_2430_MCSPI1_CLK,
670 AD15_2430_MCSPI1_SIMO,
671 AE17_2430_MCSPI1_SOMI,
672 U1_2430_MCSPI1_CS0,
673
674 /* Touchscreen GPIO */
675 AF19_2430_GPIO_85,
676
644}; 677};
645 678
646enum omap34xx_index { 679enum omap34xx_index {
@@ -749,6 +782,14 @@ enum omap34xx_index {
749 AD2_3430_USB3FS_PHY_MM3_TXDAT, 782 AD2_3430_USB3FS_PHY_MM3_TXDAT,
750 AC1_3430_USB3FS_PHY_MM3_TXEN_N, 783 AC1_3430_USB3FS_PHY_MM3_TXEN_N,
751 784
785 /* 34xx GPIO
786 * - normally these are bidirectional, no internal pullup/pulldown
787 * - "_UP" suffix (GPIO3_UP) if internal pullup is configured
788 * - "_DOWN" suffix (GPIO3_DOWN) with internal pulldown
789 * - "_OUT" suffix (GPIO3_OUT) for output-only pins (unlike 24xx)
790 */
791 AH8_34XX_GPIO29,
792 J25_34XX_GPIO170,
752}; 793};
753 794
754struct omap_mux_cfg { 795struct omap_mux_cfg {
diff --git a/arch/arm/plat-omap/include/mach/omapfb.h b/arch/arm/plat-omap/include/mach/omapfb.h
index ec67fb428607..7b74d1255e0b 100644
--- a/arch/arm/plat-omap/include/mach/omapfb.h
+++ b/arch/arm/plat-omap/include/mach/omapfb.h
@@ -353,8 +353,8 @@ struct omapfb_device {
353 u32 pseudo_palette[17]; 353 u32 pseudo_palette[17];
354 354
355 struct lcd_panel *panel; /* LCD panel */ 355 struct lcd_panel *panel; /* LCD panel */
356 struct lcd_ctrl *ctrl; /* LCD controller */ 356 const struct lcd_ctrl *ctrl; /* LCD controller */
357 struct lcd_ctrl *int_ctrl; /* internal LCD ctrl */ 357 const struct lcd_ctrl *int_ctrl; /* internal LCD ctrl */
358 struct lcd_ctrl_extif *ext_if; /* LCD ctrl external 358 struct lcd_ctrl_extif *ext_if; /* LCD ctrl external
359 interface */ 359 interface */
360 struct device *dev; 360 struct device *dev;