board.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  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 <plat/gpio-switch.h>
  13. /*
  14. * OMAP35x EVM revision
  15. * Run time detection of EVM revision is done by reading Ethernet
  16. * PHY ID -
  17. * GEN_1 = 0x01150000
  18. * GEN_2 = 0x92200000
  19. */
  20. enum {
  21. OMAP3EVM_BOARD_GEN_1 = 0, /* EVM Rev between A - D */
  22. OMAP3EVM_BOARD_GEN_2, /* EVM Rev >= Rev E */
  23. };
  24. /* Different peripheral ids */
  25. #define OMAP_TAG_CLOCK 0x4f01
  26. #define OMAP_TAG_LCD 0x4f05
  27. #define OMAP_TAG_GPIO_SWITCH 0x4f06
  28. #define OMAP_TAG_FBMEM 0x4f08
  29. #define OMAP_TAG_STI_CONSOLE 0x4f09
  30. #define OMAP_TAG_CAMERA_SENSOR 0x4f0a
  31. #define OMAP_TAG_BOOT_REASON 0x4f80
  32. #define OMAP_TAG_FLASH_PART 0x4f81
  33. #define OMAP_TAG_VERSION_STR 0x4f82
  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. struct omap_serial_console_config {
  39. u8 console_uart;
  40. u32 console_speed;
  41. };
  42. struct omap_sti_console_config {
  43. unsigned enable:1;
  44. u8 channel;
  45. };
  46. struct omap_camera_sensor_config {
  47. u16 reset_gpio;
  48. int (*power_on)(void * data);
  49. int (*power_off)(void * data);
  50. };
  51. struct omap_usb_config {
  52. /* Configure drivers according to the connectors on your board:
  53. * - "A" connector (rectagular)
  54. * ... for host/OHCI use, set "register_host".
  55. * - "B" connector (squarish) or "Mini-B"
  56. * ... for device/gadget use, set "register_dev".
  57. * - "Mini-AB" connector (very similar to Mini-B)
  58. * ... for OTG use as device OR host, initialize "otg"
  59. */
  60. unsigned register_host:1;
  61. unsigned register_dev:1;
  62. u8 otg; /* port number, 1-based: usb1 == 2 */
  63. u8 hmc_mode;
  64. /* implicitly true if otg: host supports remote wakeup? */
  65. u8 rwc;
  66. /* signaling pins used to talk to transceiver on usbN:
  67. * 0 == usbN unused
  68. * 2 == usb0-only, using internal transceiver
  69. * 3 == 3 wire bidirectional
  70. * 4 == 4 wire bidirectional
  71. * 6 == 6 wire unidirectional (or TLL)
  72. */
  73. u8 pins[3];
  74. struct platform_device *udc_device;
  75. struct platform_device *ohci_device;
  76. struct platform_device *otg_device;
  77. u32 (*usb0_init)(unsigned nwires, unsigned is_device);
  78. u32 (*usb1_init)(unsigned nwires);
  79. u32 (*usb2_init)(unsigned nwires, unsigned alt_pingroup);
  80. };
  81. struct omap_lcd_config {
  82. char panel_name[16];
  83. char ctrl_name[16];
  84. s16 nreset_gpio;
  85. u8 data_lines;
  86. };
  87. struct device;
  88. struct fb_info;
  89. struct omap_backlight_config {
  90. int default_intensity;
  91. int (*set_power)(struct device *dev, int state);
  92. };
  93. struct omap_fbmem_config {
  94. u32 start;
  95. u32 size;
  96. };
  97. struct omap_pwm_led_platform_data {
  98. const char *name;
  99. int intensity_timer;
  100. int blink_timer;
  101. void (*set_power)(struct omap_pwm_led_platform_data *self, int on_off);
  102. };
  103. struct omap_uart_config {
  104. /* Bit field of UARTs present; bit 0 --> UART1 */
  105. unsigned int enabled_uarts;
  106. };
  107. struct omap_flash_part_config {
  108. char part_table[0];
  109. };
  110. struct omap_boot_reason_config {
  111. char reason_str[12];
  112. };
  113. struct omap_version_config {
  114. char component[12];
  115. char version[12];
  116. };
  117. struct omap_board_config_entry {
  118. u16 tag;
  119. u16 len;
  120. u8 data[0];
  121. };
  122. struct omap_board_config_kernel {
  123. u16 tag;
  124. const void *data;
  125. };
  126. extern const void *__omap_get_config(u16 tag, size_t len, int nr);
  127. #define omap_get_config(tag, type) \
  128. ((const type *) __omap_get_config((tag), sizeof(type), 0))
  129. #define omap_get_nr_config(tag, type, nr) \
  130. ((const type *) __omap_get_config((tag), sizeof(type), (nr)))
  131. extern const void *omap_get_var_config(u16 tag, size_t *len);
  132. extern struct omap_board_config_kernel *omap_board_config;
  133. extern int omap_board_config_size;
  134. /* for TI reference platforms sharing the same debug card */
  135. extern int debug_card_init(u32 addr, unsigned gpio);
  136. /* OMAP3EVM revision */
  137. #if defined(CONFIG_MACH_OMAP3EVM)
  138. u8 get_omap3_evm_rev(void);
  139. #else
  140. #define get_omap3_evm_rev() (-EINVAL)
  141. #endif
  142. #endif