blob: a0040cd86639452426f7a715e5f9043237fdc5ed [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
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
Tony Lindgrenaf973d22005-07-10 19:58:06 +010019#define OMAP_TAG_SERIAL_CONSOLE 0x4f03
Linus Torvalds1da177e2005-04-16 15:20:36 -070020#define OMAP_TAG_USB 0x4f04
21#define OMAP_TAG_LCD 0x4f05
22#define OMAP_TAG_GPIO_SWITCH 0x4f06
Tony Lindgrenaf973d22005-07-10 19:58:06 +010023#define OMAP_TAG_UART 0x4f07
Linus Torvalds1da177e2005-04-16 15:20:36 -070024
25#define OMAP_TAG_BOOT_REASON 0x4f80
26#define OMAP_TAG_FLASH_PART 0x4f81
27
28struct 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
Tony Lindgren9839c6b2005-09-07 17:20:27 +010033struct 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
Linus Torvalds1da177e2005-04-16 15:20:36 -070048struct omap_mmc_config {
Tony Lindgren9839c6b2005-09-07 17:20:27 +010049 struct omap_mmc_conf mmc[2];
Linus Torvalds1da177e2005-04-16 15:20:36 -070050};
51
Tony Lindgrenaf973d22005-07-10 19:58:06 +010052struct omap_serial_console_config {
Linus Torvalds1da177e2005-04-16 15:20:36 -070053 u8 console_uart;
54 u32 console_speed;
55};
56
57struct 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
85struct 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
Tony Lindgrenaf973d22005-07-10 19:58:06 +010099#define OMAP_GPIO_SWITCH_FLAG_INVERTED 0x0001
100#define OMAP_GPIO_SWITCH_FLAG_OUTPUT 0x0002
Linus Torvalds1da177e2005-04-16 15:20:36 -0700101struct 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
109struct omap_flash_part_config {
110 char part_table[0];
111};
112
113struct omap_boot_reason_config {
114 char reason_str[12];
115};
116
Tony Lindgrenaf973d22005-07-10 19:58:06 +0100117struct omap_uart_config {
118 /* Bit field of UARTs present; bit 0 --> UART1 */
119 unsigned int enabled_uarts;
120};
Linus Torvalds1da177e2005-04-16 15:20:36 -0700121
122struct omap_board_config_entry {
123 u16 tag;
124 u16 len;
125 u8 data[0];
126};
127
128struct omap_board_config_kernel {
129 u16 tag;
130 const void *data;
131};
132
133extern 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
140extern const void *omap_get_var_config(u16 tag, size_t *len);
141
142extern struct omap_board_config_kernel *omap_board_config;
143extern int omap_board_config_size;
144
145#endif