sbhndarm.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. /*
  2. * Broadcom SiliconBackplane ARM definitions
  3. *
  4. * Portions of this code are copyright (c) 2020 Cypress Semiconductor Corporation
  5. *
  6. * Copyright (C) 1999-2020, Broadcom Corporation
  7. *
  8. * Unless you and Broadcom execute a separate written software license
  9. * agreement governing use of this software, this software is licensed to you
  10. * under the terms of the GNU General Public License version 2 (the "GPL"),
  11. * available at http://www.broadcom.com/licenses/GPLv2.php, with the
  12. * following added to such license:
  13. *
  14. * As a special exception, the copyright holders of this software give you
  15. * permission to link this software with independent modules, and to copy and
  16. * distribute the resulting executable under terms of your choice, provided that
  17. * you also meet, for each linked independent module, the terms and conditions of
  18. * the license of that module. An independent module is a module which is not
  19. * derived from this software. The special exception does not apply to any
  20. * modifications of the software.
  21. *
  22. * Notwithstanding the above, under no circumstances may you combine this
  23. * software in any way with any other Broadcom software provided under a license
  24. * other than the GPL, without Broadcom's express prior written consent.
  25. *
  26. *
  27. * <<Broadcom-WL-IPTag/Open:>>
  28. *
  29. * $Id: sbhndarm.h 699160 2017-05-12 04:50:25Z $
  30. */
  31. #ifndef _sbhndarm_h_
  32. #define _sbhndarm_h_
  33. #ifndef _LANGUAGE_ASSEMBLY
  34. /* cpp contortions to concatenate w/arg prescan */
  35. #ifndef PAD
  36. #define _PADLINE(line) pad ## line
  37. #define _XSTR(line) _PADLINE(line)
  38. #define PAD _XSTR(__LINE__)
  39. #endif /* PAD */
  40. /* cortex-m3 */
  41. typedef volatile struct {
  42. uint32 corecontrol; /* 0x0 */
  43. uint32 corestatus; /* 0x4 */
  44. uint32 PAD[1];
  45. uint32 biststatus; /* 0xc */
  46. uint32 nmiisrst; /* 0x10 */
  47. uint32 nmimask; /* 0x14 */
  48. uint32 isrmask; /* 0x18 */
  49. uint32 PAD[1];
  50. uint32 resetlog; /* 0x20 */
  51. uint32 gpioselect; /* 0x24 */
  52. uint32 gpioenable; /* 0x28 */
  53. uint32 PAD[1];
  54. uint32 bpaddrlo; /* 0x30 */
  55. uint32 bpaddrhi; /* 0x34 */
  56. uint32 bpdata; /* 0x38 */
  57. uint32 bpindaccess; /* 0x3c */
  58. uint32 ovlidx; /* 0x40 */
  59. uint32 ovlmatch; /* 0x44 */
  60. uint32 ovladdr; /* 0x48 */
  61. uint32 PAD[13];
  62. uint32 bwalloc; /* 0x80 */
  63. uint32 PAD[3];
  64. uint32 cyclecnt; /* 0x90 */
  65. uint32 inttimer; /* 0x94 */
  66. uint32 intmask; /* 0x98 */
  67. uint32 intstatus; /* 0x9c */
  68. uint32 PAD[80];
  69. uint32 clk_ctl_st; /* 0x1e0 */
  70. uint32 PAD[1];
  71. uint32 powerctl; /* 0x1e8 */
  72. } cm3regs_t;
  73. #define ARM_CM3_REG(regs, reg) (&((cm3regs_t *)regs)->reg)
  74. /* cortex-R4 */
  75. typedef volatile struct {
  76. uint32 corecontrol; /* 0x0 */
  77. uint32 corecapabilities; /* 0x4 */
  78. uint32 corestatus; /* 0x8 */
  79. uint32 biststatus; /* 0xc */
  80. uint32 nmiisrst; /* 0x10 */
  81. uint32 nmimask; /* 0x14 */
  82. uint32 isrmask; /* 0x18 */
  83. uint32 swintreg; /* 0x1C */
  84. uint32 intstatus; /* 0x20 */
  85. uint32 intmask; /* 0x24 */
  86. uint32 cyclecnt; /* 0x28 */
  87. uint32 inttimer; /* 0x2c */
  88. uint32 gpioselect; /* 0x30 */
  89. uint32 gpioenable; /* 0x34 */
  90. uint32 PAD[2];
  91. uint32 bankidx; /* 0x40 */
  92. uint32 bankinfo; /* 0x44 */
  93. uint32 bankstbyctl; /* 0x48 */
  94. uint32 bankpda; /* 0x4c */
  95. uint32 PAD[6];
  96. uint32 tcampatchctrl; /* 0x68 */
  97. uint32 tcampatchtblbaseaddr; /* 0x6c */
  98. uint32 tcamcmdreg; /* 0x70 */
  99. uint32 tcamdatareg; /* 0x74 */
  100. uint32 tcambankxmaskreg; /* 0x78 */
  101. uint32 PAD[89];
  102. uint32 clk_ctl_st; /* 0x1e0 */
  103. uint32 PAD[1];
  104. uint32 powerctl; /* 0x1e8 */
  105. } cr4regs_t;
  106. #define ARM_CR4_REG(regs, reg) (&((cr4regs_t *)regs)->reg)
  107. /* cortex-A7 */
  108. typedef volatile struct {
  109. uint32 corecontrol; /* 0x0 */
  110. uint32 corecapabilities; /* 0x4 */
  111. uint32 corestatus; /* 0x8 */
  112. uint32 tracecontrol; /* 0xc */
  113. uint32 PAD[8];
  114. uint32 gpioselect; /* 0x30 */
  115. uint32 gpioenable; /* 0x34 */
  116. uint32 PAD[106];
  117. uint32 clk_ctl_st; /* 0x1e0 */
  118. uint32 PAD[1];
  119. uint32 powerctl; /* 0x1e8 */
  120. } ca7regs_t;
  121. #define ARM_CA7_REG(regs, reg) (&((ca7regs_t *)regs)->reg)
  122. #if defined(__ARM_ARCH_7M__)
  123. #define ARMREG(regs, reg) ARM_CM3_REG(regs, reg)
  124. #endif /* __ARM_ARCH_7M__ */
  125. #if defined(__ARM_ARCH_7R__)
  126. #define ARMREG(regs, reg) ARM_CR4_REG(regs, reg)
  127. #endif /* __ARM_ARCH_7R__ */
  128. #if defined(__ARM_ARCH_7A__)
  129. #define ARMREG(regs, reg) ARM_CA7_REG(regs, reg)
  130. #endif /* __ARM_ARCH_7A__ */
  131. #endif /* _LANGUAGE_ASSEMBLY */
  132. #endif /* _sbhndarm_h_ */