board.h 3.7 KB

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