PL061Gpio.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /** @file
  2. *
  3. * Copyright (c) 2011-2012, ARM Limited. All rights reserved.
  4. *
  5. * SPDX-License-Identifier: BSD-2-Clause-Patent
  6. *
  7. **/
  8. #ifndef __PL061_GPIO_H__
  9. #define __PL061_GPIO_H__
  10. #include <Protocol/EmbeddedGpio.h>
  11. // PL061 GPIO Registers
  12. #define PL061_GPIO_DATA_REG_OFFSET ((UINTN) 0x000)
  13. #define PL061_GPIO_DATA_REG 0x000
  14. #define PL061_GPIO_DIR_REG 0x400
  15. #define PL061_GPIO_IS_REG 0x404
  16. #define PL061_GPIO_IBE_REG 0x408
  17. #define PL061_GPIO_IEV_REG 0x40C
  18. #define PL061_GPIO_IE_REG 0x410
  19. #define PL061_GPIO_RIS_REG 0x414
  20. #define PL061_GPIO_MIS_REG 0x410
  21. #define PL061_GPIO_IC_REG 0x41C
  22. #define PL061_GPIO_AFSEL_REG 0x420
  23. #define PL061_GPIO_PERIPH_ID0 0xFE0
  24. #define PL061_GPIO_PERIPH_ID1 0xFE4
  25. #define PL061_GPIO_PERIPH_ID2 0xFE8
  26. #define PL061_GPIO_PERIPH_ID3 0xFEC
  27. #define PL061_GPIO_PCELL_ID0 0xFF0
  28. #define PL061_GPIO_PCELL_ID1 0xFF4
  29. #define PL061_GPIO_PCELL_ID2 0xFF8
  30. #define PL061_GPIO_PCELL_ID3 0xFFC
  31. #define PL061_GPIO_PINS 8
  32. // All bits low except one bit high, native bit length
  33. #define GPIO_PIN_MASK(Pin) (1UL << ((UINTN)(Pin)))
  34. #endif // __PL061_GPIO_H__