Home | History | Annotate | Download | only in arch
      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 Yrjl <juha.yrjola (at) nokia.com>
      8  */
      9 
     10 #ifndef _OMAP_BOARD_H
     11 #define _OMAP_BOARD_H
     12 
     13 #include <linux/types.h>
     14 
     15 #include <asm/arch/gpio-switch.h>
     16 
     17 /* Different peripheral ids */
     18 #define OMAP_TAG_CLOCK          0x4f01
     19 #define OMAP_TAG_MMC            0x4f02
     20 #define OMAP_TAG_SERIAL_CONSOLE 0x4f03
     21 #define OMAP_TAG_USB            0x4f04
     22 #define OMAP_TAG_LCD            0x4f05
     23 #define OMAP_TAG_GPIO_SWITCH    0x4f06
     24 #define OMAP_TAG_UART           0x4f07
     25 #define OMAP_TAG_FBMEM          0x4f08
     26 #define OMAP_TAG_STI_CONSOLE    0x4f09
     27 #define OMAP_TAG_CAMERA_SENSOR  0x4f0a
     28 #define OMAP_TAG_BT             0x4f0b
     29 
     30 #define OMAP_TAG_BOOT_REASON    0x4f80
     31 #define OMAP_TAG_FLASH_PART	    0x4f81
     32 #define OMAP_TAG_VERSION_STR    0x4f82
     33 
     34 struct omap_clock_config {
     35 	/* 0 for 12 MHz, 1 for 13 MHz and 2 for 19.2 MHz */
     36 	u8 system_clock_type;
     37 };
     38 
     39 struct omap_mmc_conf {
     40 	unsigned enabled:1;
     41 	/* nomux means "standard" muxing is wrong on this board, and that
     42 	 * board-specific code handled it before common init logic.
     43 	 */
     44 	unsigned nomux:1;
     45 	/* switch pin can be for card detect (default) or card cover */
     46 	unsigned cover:1;
     47 	/* 4 wire signaling is optional, and is only used for SD/SDIO */
     48 	unsigned wire4:1;
     49 	s16 power_pin;
     50 	s16 switch_pin;
     51 	s16 wp_pin;
     52 };
     53 
     54 struct omap_mmc_config {
     55 	struct omap_mmc_conf mmc[2];
     56 };
     57 
     58 struct omap_serial_console_config {
     59 	u8 console_uart;
     60 	u32 console_speed;
     61 };
     62 
     63 struct omap_sti_console_config {
     64 	unsigned enable:1;
     65 	u8 channel;
     66 };
     67 
     68 struct omap_camera_sensor_config {
     69 	u16 reset_gpio;
     70 	int (*power_on)(void * data);
     71 	int (*power_off)(void * data);
     72 };
     73 
     74 struct omap_usb_config {
     75 	/* Configure drivers according to the connectors on your board:
     76 	 *  - "A" connector (rectagular)
     77 	 *	... for host/OHCI use, set "register_host".
     78 	 *  - "B" connector (squarish) or "Mini-B"
     79 	 *	... for device/gadget use, set "register_dev".
     80 	 *  - "Mini-AB" connector (very similar to Mini-B)
     81 	 *	... for OTG use as device OR host, initialize "otg"
     82 	 */
     83 	unsigned	register_host:1;
     84 	unsigned	register_dev:1;
     85 	u8		otg;	/* port number, 1-based:  usb1 == 2 */
     86 
     87 	u8		hmc_mode;
     88 
     89 	/* implicitly true if otg:  host supports remote wakeup? */
     90 	u8		rwc;
     91 
     92 	/* signaling pins used to talk to transceiver on usbN:
     93 	 *  0 == usbN unused
     94 	 *  2 == usb0-only, using internal transceiver
     95 	 *  3 == 3 wire bidirectional
     96 	 *  4 == 4 wire bidirectional
     97 	 *  6 == 6 wire unidirectional (or TLL)
     98 	 */
     99 	u8		pins[3];
    100 };
    101 
    102 struct omap_lcd_config {
    103 	char panel_name[16];
    104 	char ctrl_name[16];
    105 	s16  nreset_gpio;
    106 	u8   data_lines;
    107 };
    108 
    109 struct device;
    110 struct fb_info;
    111 struct omap_backlight_config {
    112 	int default_intensity;
    113 	int (*set_power)(struct device *dev, int state);
    114 	int (*check_fb)(struct fb_info *fb);
    115 };
    116 
    117 struct omap_fbmem_config {
    118 	u32 start;
    119 	u32 size;
    120 };
    121 
    122 struct omap_pwm_led_platform_data {
    123 	const char *name;
    124 	int intensity_timer;
    125 	int blink_timer;
    126 	void (*set_power)(struct omap_pwm_led_platform_data *self, int on_off);
    127 };
    128 
    129 /* See include/asm-arm/arch-omap/gpio-switch.h for definitions */
    130 struct omap_gpio_switch_config {
    131 	char name[12];
    132 	u16 gpio;
    133 	int flags:4;
    134 	int type:4;
    135 	int key_code:24; /* Linux key code */
    136 };
    137 
    138 struct omap_uart_config {
    139 	/* Bit field of UARTs present; bit 0 --> UART1 */
    140 	unsigned int enabled_uarts;
    141 };
    142 
    143 
    144 struct omap_flash_part_config {
    145 	char part_table[0];
    146 };
    147 
    148 struct omap_boot_reason_config {
    149 	char reason_str[12];
    150 };
    151 
    152 struct omap_version_config {
    153 	char component[12];
    154 	char version[12];
    155 };
    156 
    157 struct omap_board_config_entry {
    158 	u16 tag;
    159 	u16 len;
    160 	u8  data[0];
    161 };
    162 
    163 struct omap_board_config_kernel {
    164 	u16 tag;
    165 	const void *data;
    166 };
    167 
    168 struct omap_bluetooth_config {
    169 	u8   chip_type;
    170 	u8   bt_uart;
    171 	u8   bd_addr[6];
    172 	u8   bt_sysclk;
    173 	int  bt_wakeup_gpio;
    174 	int  host_wakeup_gpio;
    175 	int  reset_gpio;
    176 };
    177 
    178 extern const void *__omap_get_config(u16 tag, size_t len, int nr);
    179 
    180 #define omap_get_config(tag, type) \
    181 	((const type *) __omap_get_config((tag), sizeof(type), 0))
    182 #define omap_get_nr_config(tag, type, nr) \
    183 	((const type *) __omap_get_config((tag), sizeof(type), (nr)))
    184 
    185 extern const void *omap_get_var_config(u16 tag, size_t *len);
    186 
    187 extern struct omap_board_config_kernel *omap_board_config;
    188 extern int omap_board_config_size;
    189 
    190 #endif
    191