rpi_hw.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * Copyright (c) 2016-2024, Arm Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef RPI_HW_H
  7. #define RPI_HW_H
  8. #include <lib/utils_def.h>
  9. /*
  10. * Peripherals
  11. */
  12. #define RPI_IO_BASE ULL(0x3F000000)
  13. #define RPI_IO_SIZE ULL(0x01000000)
  14. /*
  15. * ARM <-> VideoCore mailboxes
  16. */
  17. #define RPI3_MBOX_OFFSET ULL(0x0000B880)
  18. #define RPI3_MBOX_BASE (RPI_IO_BASE + RPI3_MBOX_OFFSET)
  19. /*
  20. * Power management, reset controller, watchdog.
  21. */
  22. #define RPI3_IO_PM_OFFSET ULL(0x00100000)
  23. #define RPI3_PM_BASE (RPI_IO_BASE + RPI3_IO_PM_OFFSET)
  24. /*
  25. * Hardware random number generator.
  26. */
  27. #define RPI3_IO_RNG_OFFSET ULL(0x00104000)
  28. #define RPI3_RNG_BASE (RPI_IO_BASE + RPI3_IO_RNG_OFFSET)
  29. /*
  30. * Serial ports:
  31. * 'Mini UART' in the BCM docucmentation is the 8250 compatible UART.
  32. * There is also a PL011 UART, multiplexed to the same pins.
  33. */
  34. #define RPI3_IO_MINI_UART_OFFSET ULL(0x00215040)
  35. #define RPI3_MINI_UART_BASE (RPI_IO_BASE + RPI3_IO_MINI_UART_OFFSET)
  36. #define RPI3_IO_PL011_UART_OFFSET ULL(0x00201000)
  37. #define RPI3_PL011_UART_BASE (RPI_IO_BASE + RPI3_IO_PL011_UART_OFFSET)
  38. #define RPI3_PL011_UART_CLOCK ULL(48000000)
  39. /*
  40. * GPIO controller
  41. */
  42. #define RPI3_IO_GPIO_OFFSET ULL(0x00200000)
  43. #define RPI3_GPIO_BASE (RPI_IO_BASE + RPI3_IO_GPIO_OFFSET)
  44. /*
  45. * SDHost controller
  46. */
  47. #define RPI3_IO_SDHOST_OFFSET ULL(0x00202000)
  48. #define RPI3_SDHOST_BASE (RPI_IO_BASE + RPI3_IO_SDHOST_OFFSET)
  49. /*
  50. * Local interrupt controller
  51. */
  52. #define RPI3_INTC_BASE_ADDRESS ULL(0x40000000)
  53. /* Registers on top of RPI3_INTC_BASE_ADDRESS */
  54. #define RPI3_INTC_CONTROL_OFFSET ULL(0x00000000)
  55. #define RPI3_INTC_PRESCALER_OFFSET ULL(0x00000008)
  56. #define RPI3_INTC_MBOX_CONTROL_OFFSET ULL(0x00000050)
  57. #define RPI3_INTC_MBOX_CONTROL_SLOT3_FIQ ULL(0x00000080)
  58. #define RPI3_INTC_PENDING_FIQ_OFFSET ULL(0x00000070)
  59. #define RPI3_INTC_PENDING_FIQ_MBOX3 ULL(0x00000080)
  60. #endif /* RPI_HW_H */