board.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * board.h
  4. *
  5. * TI AM335x boards information header
  6. *
  7. * Copyright (C) 2011, Texas Instruments, Incorporated - http://www.ti.com/
  8. */
  9. #ifndef _BOARD_H_
  10. #define _BOARD_H_
  11. /**
  12. * AM335X (EMIF_4D) EMIF REG_COS_COUNT_1, REG_COS_COUNT_2, and
  13. * REG_PR_OLD_COUNT values to avoid LCDC DMA FIFO underflows and Frame
  14. * Synchronization Lost errors. The values are the biggest that work
  15. * reliably with offered video modes and the memory subsystem on the
  16. * boards. These register have are briefly documented in "7.3.3.5.2
  17. * Command Starvation" section of AM335x TRM. The REG_COS_COUNT_1 and
  18. * REG_COS_COUNT_2 do not have any effect on current versions of
  19. * AM335x.
  20. */
  21. #define EMIF_OCP_CONFIG_BEAGLEBONE_BLACK 0x00141414
  22. #define EMIF_OCP_CONFIG_AM335X_EVM 0x003d3d3d
  23. static inline int board_is_bone(void)
  24. {
  25. return board_ti_is("A335BONE");
  26. }
  27. static inline int board_is_bone_lt(void)
  28. {
  29. return board_ti_is("A335BNLT");
  30. }
  31. static inline int board_is_pb(void)
  32. {
  33. return board_ti_is("A335PBGL");
  34. }
  35. static inline int board_is_bbg1(void)
  36. {
  37. return board_is_bone_lt() && !strncmp(board_ti_get_rev(), "BBG1", 4);
  38. }
  39. static inline int board_is_bben(void)
  40. {
  41. return board_is_bone_lt() && !strncmp(board_ti_get_rev(), "SE", 2);
  42. }
  43. static inline int board_is_beaglebonex(void)
  44. {
  45. return board_is_pb() || board_is_bone() || board_is_bone_lt() ||
  46. board_is_bbg1() || board_is_bben();
  47. }
  48. static inline int board_is_evm_sk(void)
  49. {
  50. return board_ti_is("A335X_SK");
  51. }
  52. static inline int board_is_idk(void)
  53. {
  54. return !strncmp(board_ti_get_config(), "SKU#02", 6);
  55. }
  56. static inline int board_is_gp_evm(void)
  57. {
  58. return board_ti_is("A33515BB");
  59. }
  60. static inline int board_is_evm_15_or_later(void)
  61. {
  62. return (board_is_gp_evm() &&
  63. strncmp("1.5", board_ti_get_rev(), 3) <= 0);
  64. }
  65. static inline int board_is_icev2(void)
  66. {
  67. return board_ti_is("A335_ICE") && !strncmp("2", board_ti_get_rev(), 1);
  68. }
  69. /*
  70. * We have three pin mux functions that must exist. We must be able to enable
  71. * uart0, for initial output and i2c0 to read the main EEPROM. We then have a
  72. * main pinmux function that can be overridden to enable all other pinmux that
  73. * is required on the board.
  74. */
  75. void enable_uart0_pin_mux(void);
  76. void enable_uart1_pin_mux(void);
  77. void enable_uart2_pin_mux(void);
  78. void enable_uart3_pin_mux(void);
  79. void enable_uart4_pin_mux(void);
  80. void enable_uart5_pin_mux(void);
  81. void enable_i2c0_pin_mux(void);
  82. void enable_board_pin_mux(void);
  83. #endif