ftahbc020s.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * Copyright (C) 2011 Andes Technology Corporation
  3. * Macpaul Lin, Andes Technology Corporation <macpaul@andestech.com>
  4. *
  5. * SPDX-License-Identifier: GPL-2.0+
  6. */
  7. /* FTAHBC020S - AHB Controller (Arbiter/Decoder) definitions */
  8. #ifndef __FTAHBC020S_H
  9. #define __FTAHBC202S_H
  10. /* Registers Offsets */
  11. /*
  12. * AHB Slave BSR, offset: n * 4, n=0~31
  13. */
  14. #ifndef __ASSEMBLY__
  15. struct ftahbc02s {
  16. unsigned int s_bsr[32]; /* 0x00-0x7c - Slave n Base/Size Reg */
  17. unsigned int pcr; /* 0x80 - Priority Ctrl Reg */
  18. unsigned int tcrg; /* 0x84 - Transfer Ctrl Reg */
  19. unsigned int cr; /* 0x88 - Ctrl Reg */
  20. };
  21. #endif /* __ASSEMBLY__ */
  22. /*
  23. * FTAHBC020S_SLAVE_BSR - Slave n Base / Size Register
  24. */
  25. #define FTAHBC020S_SLAVE_BSR_BASE(x) (((x) & 0xfff) << 20)
  26. #define FTAHBC020S_SLAVE_BSR_SIZE(x) (((x) & 0xf) << 16)
  27. /* The value of b(16:19)SLAVE_BSR_SIZE: 1M-2048M, must be power of 2 */
  28. #define FTAHBC020S_BSR_SIZE(x) (ffs(x) - 1) /* size of Addr Space */
  29. /*
  30. * FTAHBC020S_PCR - Priority Control Register
  31. */
  32. #define FTAHBC020S_PCR_PLEVEL_(x) (1 << (x)) /* x: 1-15 */
  33. /*
  34. * FTAHBC020S_CR - Interrupt Control Register
  35. */
  36. #define FTAHBC020S_CR_INTSTS (1 << 24)
  37. #define FTAHBC020S_CR_RESP(x) (((x) & 0x3) << 20)
  38. #define FTAHBC020S_CR_INTSMASK (1 << 16)
  39. #define FTAHBC020S_CR_REMAP (1 << 0)
  40. #endif /* __FTAHBC020S_H */