board.h 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. /************************************************************************************
  2. * configs/beaglebone-black/include/board.h
  3. *
  4. * Copyright (C) 2018 Petro Karashchenko. All rights reserved.
  5. * Author: Petro Karashchenko <petro.karashchenko@gmail.com>
  6. *
  7. * Redistribution and use in source and binary forms, with or without
  8. * modification, are permitted provided that the following conditions
  9. * are met:
  10. *
  11. * 1. Redistributions of source code must retain the above copyright
  12. * notice, this list of conditions and the following disclaimer.
  13. * 2. Redistributions in binary form must reproduce the above copyright
  14. * notice, this list of conditions and the following disclaimer in
  15. * the documentation and/or other materials provided with the
  16. * distribution.
  17. * 3. Neither the name NuttX nor the names of its contributors may be
  18. * used to endorse or promote products derived from this software
  19. * without specific prior written permission.
  20. *
  21. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  22. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  23. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  24. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  25. * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  26. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  27. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  28. * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  29. * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  30. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
  31. * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  32. * POSSIBILITY OF SUCH DAMAGE.
  33. *
  34. ************************************************************************************/
  35. #ifndef __CONFIGS_BEAGLEBONE_BLACK_INCLUDE_BOARD_H
  36. #define __CONFIGS_BEAGLEBONE_BLACK_INCLUDE_BOARD_H
  37. /************************************************************************************
  38. * Included Files
  39. ************************************************************************************/
  40. #include <nuttx/config.h>
  41. #include "chip/am335x_pinmux.h"
  42. /************************************************************************************
  43. * Pre-processor Definitions
  44. ************************************************************************************/
  45. /* Clocking *************************************************************************/
  46. /* Since NuttX is booted from a loader on the AM335X, clocking should already be setup
  47. * when NuttX starts.
  48. */
  49. /* LED definitions ******************************************************************/
  50. /* The beaglebone black has four user LEDs; all four can be controlled from software.
  51. * All are tied to ground and, hence, illuminated by driving the output pins to a high
  52. * value:
  53. *
  54. * 1. LED0 GPMC_A5 GPMC_A5/GMII2_TXD0/RGMII2_TD0/RMII2_TXD0/GPMC_A21/PR1_MII1_RXD3/
  55. * eQEP1B_IN/GPIO1_21
  56. * 2. LED1 GPMC_A6 GPMC_A6/GMII2_TXCLK/RGMII2_TCLK/MMC2_DAT4/GPMC_A22/PR1_MII1_RXD2/
  57. * eQEP1_INDEX/GPIO1_22
  58. * 3. LED2 GPMC_A7 GPMC_A7/GMII2_RXCLK/RGMII2_RCLK/MMC2_DAT5/GPMC_A23/PR1_MII1_RXD1/
  59. * eQEP1_STROBE/GPIO1_23
  60. * 4. LED3 GPMC_A8 GPMC_A8/GMII2_RXD3/RGMII2_RD3/MMC2_DAT6/GPMC_A24/PR1_MII1_RXD0/
  61. * MCASP0_ACLKX/GPIO1_24
  62. */
  63. /* LED index values for use with board_userled() */
  64. #define USER_LED0 0
  65. #define USER_LED1 1
  66. #define USER_LED2 2
  67. #define USER_LED3 3
  68. #define BOARD_NLEDS 4
  69. /* LED bits for use with board_userled_all() */
  70. #define BOARD_LED0_BIT (1 << USER_LED0)
  71. #define BOARD_LED1_BIT (1 << USER_LED1)
  72. #define BOARD_LED2_BIT (1 << USER_LED2)
  73. #define BOARD_LED3_BIT (1 << USER_LED3)
  74. /* These LEDs are not used by the board port unless CONFIG_ARCH_LEDS is
  75. * defined. In that case, the usage by the board port is defined in
  76. * include/board.h and src/am335x_leds.c. The LEDs are used to encode OS-related
  77. * events as follows:
  78. *
  79. * SYMBOL Value Meaning LED state
  80. * LED0 LED1 LED2
  81. * ----------------- ----- ----------------------- ---- ---- ------------ */
  82. #define LED_STARTED 0 /* NuttX has been started ON OFF OFF */
  83. #define LED_HEAPALLOCATE 1 /* Heap has been allocated OFF ON OFF */
  84. #define LED_IRQSENABLED 2 /* Interrupts enabled ON ON OFF */
  85. #define LED_STACKCREATED 2 /* Idle stack created ON ON OFF */
  86. #define LED_INIRQ 3 /* In an interrupt N/C N/C Soft glow */
  87. #define LED_SIGNAL 3 /* In a signal handler N/C N/C Soft glow */
  88. #define LED_ASSERTION 3 /* An assertion failed N/C N/C Soft glow */
  89. #define LED_PANIC 3 /* The system has crashed N/C N/C 2Hz Flashing */
  90. /* LED_IDLE --- /* MCU is is sleep mode Not used
  91. *
  92. * After booting, LED0 and 1 are not longer used by the system and can be used for
  93. * other purposes by the application (Of course, all LEDs are available to the
  94. * application if CONFIG_ARCH_LEDS is not defined.
  95. */
  96. /* NAND *****************************************************************************/
  97. /* GPIO pin disambiguation **********************************************************/
  98. /* UARTs ****************************************************************************/
  99. /* One UART connections is available:
  100. *
  101. * 1. UART0 is available on FT2232H USB to Serial Adapter.
  102. *
  103. * FT2232H BDBUS1 Pin UART0-RXD UART0_RXD/SPI1_CS0/DCAN0_TX/I2C2_SDA/
  104. eCAP2_IN_PWM2_OUT/PR1_PRU1_PRU_R30_14/
  105. * PR1_PRU1_PRU_R31_14/GPIO1_10
  106. * FT2232H BDBUS0 Pin UART0-TXD UART0_TXD/SPI1_CS1/DCAN0_RX/I2C2_SCL/
  107. * eCAP1_IN_PWM1_OUT/PR1_PRU1_PRU_R30_15/
  108. * PR1_PRU1_PRU_R31_15/GPIO1_11
  109. */
  110. /************************************************************************************
  111. * Assembly Language Macros
  112. ************************************************************************************/
  113. #ifdef __ASSEMBLY__
  114. .macro config_sdram
  115. .endm
  116. #endif /* __ASSEMBLY__ */
  117. #endif /* __CONFIGS_BEAGLEBONE_BLACK_INCLUDE_BOARD_H */