board.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  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_LCD 0x4f05
  16. #define OMAP_TAG_GPIO_SWITCH 0x4f06
  17. #define OMAP_TAG_FBMEM 0x4f08
  18. #define OMAP_TAG_STI_CONSOLE 0x4f09
  19. #define OMAP_TAG_CAMERA_SENSOR 0x4f0a
  20. #define OMAP_TAG_BOOT_REASON 0x4f80
  21. #define OMAP_TAG_FLASH_PART 0x4f81
  22. #define OMAP_TAG_VERSION_STR 0x4f82
  23. struct omap_clock_config {
  24. /* 0 for 12 MHz, 1 for 13 MHz and 2 for 19.2 MHz */
  25. u8 system_clock_type;
  26. };
  27. struct omap_serial_console_config {
  28. u8 console_uart;
  29. u32 console_speed;
  30. };
  31. struct omap_sti_console_config {
  32. unsigned enable:1;
  33. u8 channel;
  34. };
  35. struct omap_camera_sensor_config {
  36. u16 reset_gpio;
  37. int (*power_on)(void * data);
  38. int (*power_off)(void * data);
  39. };
  40. struct omap_usb_config {
  41. /* Configure drivers according to the connectors on your board:
  42. * - "A" connector (rectagular)
  43. * ... for host/OHCI use, set "register_host".
  44. * - "B" connector (squarish) or "Mini-B"
  45. * ... for device/gadget use, set "register_dev".
  46. * - "Mini-AB" connector (very similar to Mini-B)
  47. * ... for OTG use as device OR host, initialize "otg"
  48. */
  49. unsigned register_host:1;
  50. unsigned register_dev:1;
  51. u8 otg; /* port number, 1-based: usb1 == 2 */
  52. u8 hmc_mode;
  53. /* implicitly true if otg: host supports remote wakeup? */
  54. u8 rwc;
  55. /* signaling pins used to talk to transceiver on usbN:
  56. * 0 == usbN unused
  57. * 2 == usb0-only, using internal transceiver
  58. * 3 == 3 wire bidirectional
  59. * 4 == 4 wire bidirectional
  60. * 6 == 6 wire unidirectional (or TLL)
  61. */
  62. u8 pins[3];
  63. };
  64. struct omap_lcd_config {
  65. char panel_name[16];
  66. char ctrl_name[16];
  67. s16 nreset_gpio;
  68. u8 data_lines;
  69. };
  70. struct device;
  71. struct fb_info;
  72. struct omap_backlight_config {
  73. int default_intensity;
  74. int (*set_power)(struct device *dev, int state);
  75. int (*check_fb)(struct fb_info *fb);
  76. };
  77. struct omap_fbmem_config {
  78. u32 start;
  79. u32 size;
  80. };
  81. struct omap_pwm_led_platform_data {
  82. const char *name;
  83. int intensity_timer;
  84. int blink_timer;
  85. void (*set_power)(struct omap_pwm_led_platform_data *self, int on_off);
  86. };
  87. /* See arch/arm/plat-omap/include/mach/gpio-switch.h for definitions */
  88. struct omap_gpio_switch_config {
  89. char name[12];
  90. u16 gpio;
  91. int flags:4;
  92. int type:4;
  93. int key_code:24; /* Linux key code */
  94. };
  95. struct omap_uart_config {
  96. /* Bit field of UARTs present; bit 0 --> UART1 */
  97. unsigned int enabled_uarts;
  98. };
  99. struct omap_flash_part_config {
  100. char part_table[0];
  101. };
  102. struct omap_boot_reason_config {
  103. char reason_str[12];
  104. };
  105. struct omap_version_config {
  106. char component[12];
  107. char version[12];
  108. };
  109. struct omap_board_config_entry {
  110. u16 tag;
  111. u16 len;
  112. u8 data[0];
  113. };
  114. struct omap_board_config_kernel {
  115. u16 tag;
  116. const void *data;
  117. };
  118. extern const void *__omap_get_config(u16 tag, size_t len, int nr);
  119. #define omap_get_config(tag, type) \
  120. ((const type *) __omap_get_config((tag), sizeof(type), 0))
  121. #define omap_get_nr_config(tag, type, nr) \
  122. ((const type *) __omap_get_config((tag), sizeof(type), (nr)))
  123. extern const void *omap_get_var_config(u16 tag, size_t *len);
  124. extern struct omap_board_config_kernel *omap_board_config;
  125. extern int omap_board_config_size;
  126. /* for TI reference platforms sharing the same debug card */
  127. extern int debug_card_init(u32 addr, unsigned gpio);
  128. #endif