a0040cd86639452426f7a715e5f9043237fdc5ed
[pandora-kernel.git] / include / asm-arm / arch-omap / board.h
1 /*
2  *  linux/include/asm-arm/arch-omap/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/config.h>
14 #include <linux/types.h>
15
16 /* Different peripheral ids */
17 #define OMAP_TAG_CLOCK          0x4f01
18 #define OMAP_TAG_MMC            0x4f02
19 #define OMAP_TAG_SERIAL_CONSOLE 0x4f03
20 #define OMAP_TAG_USB            0x4f04
21 #define OMAP_TAG_LCD            0x4f05
22 #define OMAP_TAG_GPIO_SWITCH    0x4f06
23 #define OMAP_TAG_UART           0x4f07
24
25 #define OMAP_TAG_BOOT_REASON    0x4f80
26 #define OMAP_TAG_FLASH_PART     0x4f81
27
28 struct omap_clock_config {
29         /* 0 for 12 MHz, 1 for 13 MHz and 2 for 19.2 MHz */
30         u8 system_clock_type;
31 };
32
33 struct omap_mmc_conf {
34         unsigned enabled:1;
35         /* nomux means "standard" muxing is wrong on this board, and that
36          * board-specific code handled it before common init logic.
37          */
38         unsigned nomux:1;
39         /* switch pin can be for card detect (default) or card cover */
40         unsigned cover:1;
41         /* 4 wire signaling is optional, and is only used for SD/SDIO */
42         unsigned wire4:1;
43         s16 power_pin;
44         s16 switch_pin;
45         s16 wp_pin;
46 };
47
48 struct omap_mmc_config {
49         struct omap_mmc_conf mmc[2];
50 };
51
52 struct omap_serial_console_config {
53         u8 console_uart;
54         u32 console_speed;
55 };
56
57 struct omap_usb_config {
58         /* Configure drivers according to the connectors on your board:
59          *  - "A" connector (rectagular)
60          *      ... for host/OHCI use, set "register_host".
61          *  - "B" connector (squarish) or "Mini-B"
62          *      ... for device/gadget use, set "register_dev".
63          *  - "Mini-AB" connector (very similar to Mini-B)
64          *      ... for OTG use as device OR host, initialize "otg"
65          */
66         unsigned        register_host:1;
67         unsigned        register_dev:1;
68         u8              otg;    /* port number, 1-based:  usb1 == 2 */
69
70         u8              hmc_mode;
71
72         /* implicitly true if otg:  host supports remote wakeup? */
73         u8              rwc;
74
75         /* signaling pins used to talk to transceiver on usbN:
76          *  0 == usbN unused
77          *  2 == usb0-only, using internal transceiver
78          *  3 == 3 wire bidirectional
79          *  4 == 4 wire bidirectional
80          *  6 == 6 wire unidirectional (or TLL)
81          */
82         u8              pins[3];
83 };
84
85 struct omap_lcd_config {
86         char panel_name[16];
87         char ctrl_name[16];
88 };
89
90 /* Cover:
91  *      high -> closed
92  *      low  -> open
93  * Connection:
94  *      high -> connected
95  *      low  -> disconnected
96  */
97 #define OMAP_GPIO_SWITCH_TYPE_COVER             0x0000
98 #define OMAP_GPIO_SWITCH_TYPE_CONNECTION        0x0001
99 #define OMAP_GPIO_SWITCH_FLAG_INVERTED          0x0001
100 #define OMAP_GPIO_SWITCH_FLAG_OUTPUT            0x0002
101 struct omap_gpio_switch_config {
102         char name[12];
103         u16 gpio;
104         int flags:4;
105         int type:4;
106         int key_code:24; /* Linux key code */
107 };
108
109 struct omap_flash_part_config {
110         char part_table[0];
111 };
112
113 struct omap_boot_reason_config {
114         char reason_str[12];
115 };
116
117 struct omap_uart_config {
118         /* Bit field of UARTs present; bit 0 --> UART1 */
119         unsigned int enabled_uarts;
120 };
121
122 struct omap_board_config_entry {
123         u16 tag;
124         u16 len;
125         u8  data[0];
126 };
127
128 struct omap_board_config_kernel {
129         u16 tag;
130         const void *data;
131 };
132
133 extern const void *__omap_get_config(u16 tag, size_t len, int nr);
134
135 #define omap_get_config(tag, type) \
136         ((const type *) __omap_get_config((tag), sizeof(type), 0))
137 #define omap_get_nr_config(tag, type, nr) \
138         ((const type *) __omap_get_config((tag), sizeof(type), (nr)))
139
140 extern const void *omap_get_var_config(u16 tag, size_t *len);
141
142 extern struct omap_board_config_kernel *omap_board_config;
143 extern int omap_board_config_size;
144
145 #endif