rpi_hw.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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(0xFC000000)
  13. #define RPI_IO_SIZE ULL(0x04000000)
  14. #define RPI_LEGACY_BASE (ULL(0x02000000) + RPI_IO_BASE)
  15. /*
  16. * ARM <-> VideoCore mailboxes
  17. */
  18. #define RPI3_MBOX_OFFSET ULL(0x0000B880)
  19. #define RPI3_MBOX_BASE (RPI_LEGACY_BASE + RPI3_MBOX_OFFSET)
  20. /*
  21. * Power management, reset controller, watchdog.
  22. */
  23. #define RPI3_IO_PM_OFFSET ULL(0x00100000)
  24. #define RPI3_PM_BASE (RPI_LEGACY_BASE + RPI3_IO_PM_OFFSET)
  25. /*
  26. * Hardware random number generator.
  27. */
  28. #define RPI3_IO_RNG_OFFSET ULL(0x00104000)
  29. #define RPI3_RNG_BASE (RPI_LEGACY_BASE + RPI3_IO_RNG_OFFSET)
  30. /*
  31. * Serial ports:
  32. * 'Mini UART' in the BCM docucmentation is the 8250 compatible UART.
  33. * There is also a PL011 UART, multiplexed to the same pins.
  34. */
  35. #define RPI4_IO_MINI_UART_OFFSET ULL(0x00215040)
  36. #define RPI4_MINI_UART_BASE (RPI_LEGACY_BASE + RPI4_IO_MINI_UART_OFFSET)
  37. #define RPI4_IO_PL011_UART_OFFSET ULL(0x00201000)
  38. #define RPI4_PL011_UART_BASE (RPI_LEGACY_BASE + RPI4_IO_PL011_UART_OFFSET)
  39. #define RPI4_PL011_UART_CLOCK ULL(48000000)
  40. /*
  41. * GPIO controller
  42. */
  43. #define RPI3_IO_GPIO_OFFSET ULL(0x00200000)
  44. #define RPI3_GPIO_BASE (RPI_LEGACY_BASE + RPI3_IO_GPIO_OFFSET)
  45. /*
  46. * SDHost controller
  47. */
  48. #define RPI3_IO_SDHOST_OFFSET ULL(0x00202000)
  49. #define RPI3_SDHOST_BASE (RPI_LEGACY_BASE + RPI3_IO_SDHOST_OFFSET)
  50. /*
  51. * GIC interrupt controller
  52. */
  53. #define RPI_HAVE_GIC
  54. #define RPI4_GIC_GICD_BASE ULL(0xff841000)
  55. #define RPI4_GIC_GICC_BASE ULL(0xff842000)
  56. #define RPI4_LOCAL_CONTROL_BASE_ADDRESS ULL(0xff800000)
  57. #define RPI4_LOCAL_CONTROL_PRESCALER ULL(0xff800008)
  58. /*
  59. * PCI Express
  60. */
  61. #define RPI_PCIE_RC_BASES (RPI_IO_BASE + ULL(0x01500000))
  62. #define RPI_PCIE_ECAM_SERROR_QUIRK 1
  63. #endif /* RPI_HW_H */