board.h 4.1 KB

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