board.h 2.2 KB

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