board.h 4.55 KB
Newer Older
Linus Torvalds's avatar
Linus Torvalds committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14
/*
 *  linux/include/asm-arm/arch-omap/board.h
 *
 *  Information structures for board-specific data
 *
 *  Copyright (C) 2004	Nokia Corporation
 *  Written by Juha Yrjl <juha.yrjola@nokia.com>
 */

#ifndef _OMAP_BOARD_H
#define _OMAP_BOARD_H

#include <linux/types.h>

15 16
#include <asm/arch/gpio-switch.h>

Linus Torvalds's avatar
Linus Torvalds committed
17 18 19
/* Different peripheral ids */
#define OMAP_TAG_CLOCK		0x4f01
#define OMAP_TAG_MMC		0x4f02
20
#define OMAP_TAG_SERIAL_CONSOLE 0x4f03
Linus Torvalds's avatar
Linus Torvalds committed
21 22 23
#define OMAP_TAG_USB		0x4f04
#define OMAP_TAG_LCD		0x4f05
#define OMAP_TAG_GPIO_SWITCH	0x4f06
24
#define OMAP_TAG_UART		0x4f07
25 26
#define OMAP_TAG_FBMEM		0x4f08
#define OMAP_TAG_STI_CONSOLE	0x4f09
27
#define OMAP_TAG_CAMERA_SENSOR	0x4f0a
28 29 30
#define OMAP_TAG_PARTITION      0x4f0b
#define OMAP_TAG_TEA5761	0x4f10
#define OMAP_TAG_TMP105		0x4f11
Linus Torvalds's avatar
Linus Torvalds committed
31 32

#define OMAP_TAG_BOOT_REASON    0x4f80
33
#define OMAP_TAG_FLASH_PART_STR	0x4f81
34
#define OMAP_TAG_VERSION_STR	0x4f82
Linus Torvalds's avatar
Linus Torvalds committed
35 36 37 38 39 40

struct omap_clock_config {
	/* 0 for 12 MHz, 1 for 13 MHz and 2 for 19.2 MHz */
	u8 system_clock_type;
};

41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
struct omap_mmc_conf {
	unsigned enabled:1;
	/* nomux means "standard" muxing is wrong on this board, and that
	 * board-specific code handled it before common init logic.
	 */
	unsigned nomux:1;
	/* switch pin can be for card detect (default) or card cover */
	unsigned cover:1;
	/* 4 wire signaling is optional, and is only used for SD/SDIO */
	unsigned wire4:1;
	s16 power_pin;
	s16 switch_pin;
	s16 wp_pin;
};

Linus Torvalds's avatar
Linus Torvalds committed
56
struct omap_mmc_config {
57
	struct omap_mmc_conf mmc[2];
Linus Torvalds's avatar
Linus Torvalds committed
58 59
};

60
struct omap_serial_console_config {
Linus Torvalds's avatar
Linus Torvalds committed
61 62 63 64
	u8 console_uart;
	u32 console_speed;
};

65 66 67 68 69
struct omap_sti_console_config {
	unsigned enable:1;
	u8 channel;
};

70 71 72 73 74 75
struct omap_camera_sensor_config {
	u16 reset_gpio;
	int (*power_on)(void * data);
	int (*power_off)(void * data);
};

Linus Torvalds's avatar
Linus Torvalds committed
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
struct omap_usb_config {
	/* Configure drivers according to the connectors on your board:
	 *  - "A" connector (rectagular)
	 *	... for host/OHCI use, set "register_host".
	 *  - "B" connector (squarish) or "Mini-B"
	 *	... for device/gadget use, set "register_dev".
	 *  - "Mini-AB" connector (very similar to Mini-B)
	 *	... for OTG use as device OR host, initialize "otg"
	 */
	unsigned	register_host:1;
	unsigned	register_dev:1;
	u8		otg;	/* port number, 1-based:  usb1 == 2 */

	u8		hmc_mode;

	/* implicitly true if otg:  host supports remote wakeup? */
	u8		rwc;

	/* signaling pins used to talk to transceiver on usbN:
	 *  0 == usbN unused
	 *  2 == usb0-only, using internal transceiver
	 *  3 == 3 wire bidirectional
	 *  4 == 4 wire bidirectional
	 *  6 == 6 wire unidirectional (or TLL)
	 */
	u8		pins[3];
};

struct omap_lcd_config {
	char panel_name[16];
	char ctrl_name[16];
107 108 109 110 111 112 113 114 115 116
	s16  nreset_gpio;
	u8   data_lines;
};

struct device;
struct fb_info;
struct omap_backlight_config {
	int default_intensity;
	int (*set_power)(struct device *dev, int state);
	int (*check_fb)(struct fb_info *fb);
Linus Torvalds's avatar
Linus Torvalds committed
117 118
};

119
struct omap_fbmem_config {
120 121
	u32 start;
	u32 size;
122 123
};

124 125 126 127 128 129 130 131
struct omap_pwm_led_platform_data {
	const char *name;
	int intensity_timer;
	int blink_timer;
	void (*set_power)(struct omap_pwm_led_platform_data *self, int on_off);
};

/* See include/asm-arm/arch-omap/gpio-switch.h for definitions */
Linus Torvalds's avatar
Linus Torvalds committed
132 133 134 135 136 137 138 139
struct omap_gpio_switch_config {
	char name[12];
	u16 gpio;
	int flags:4;
	int type:4;
	int key_code:24; /* Linux key code */
};

140 141 142 143 144
struct omap_uart_config {
	/* Bit field of UARTs present; bit 0 --> UART1 */
	unsigned int enabled_uarts;
};

145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161
struct omap_tea5761_config {
	u16 enable_gpio;
};

/* This cannot be passed from the bootloader */
struct omap_tmp105_config {
	u16 tmp105_irq_pin;
	int (* set_power)(int enable);
};

struct omap_partition_config {
	char name[16];
	unsigned int size;
	unsigned int offset;
	/* same as in include/linux/mtd/partitions.h */
	unsigned int mask_flags;
};
162

163
struct omap_flash_part_str_config {
Linus Torvalds's avatar
Linus Torvalds committed
164 165 166 167 168 169 170
	char part_table[0];
};

struct omap_boot_reason_config {
	char reason_str[12];
};

171 172 173
struct omap_version_config {
	char component[12];
	char version[12];
174
};
Linus Torvalds's avatar
Linus Torvalds committed
175

176 177 178

#include <asm-arm/arch-omap/board-nokia.h>

Linus Torvalds's avatar
Linus Torvalds committed
179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201
struct omap_board_config_entry {
	u16 tag;
	u16 len;
	u8  data[0];
};

struct omap_board_config_kernel {
	u16 tag;
	const void *data;
};

extern const void *__omap_get_config(u16 tag, size_t len, int nr);

#define omap_get_config(tag, type) \
	((const type *) __omap_get_config((tag), sizeof(type), 0))
#define omap_get_nr_config(tag, type, nr) \
	((const type *) __omap_get_config((tag), sizeof(type), (nr)))

extern const void *omap_get_var_config(u16 tag, size_t *len);

extern struct omap_board_config_kernel *omap_board_config;
extern int omap_board_config_size;

202 203 204 205

/* for TI reference platforms sharing the same debug card */
extern int debug_card_init(u32 addr, unsigned gpio);

Linus Torvalds's avatar
Linus Torvalds committed
206
#endif