firewall_s10.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. /* SPDX-License-Identifier: GPL-2.0
  2. *
  3. * Copyright (C) 2017-2018 Intel Corporation <www.intel.com>
  4. *
  5. */
  6. #ifndef _FIREWALL_S10_
  7. #define _FIREWALL_S10_
  8. struct socfpga_firwall_l4_per {
  9. u32 nand; /* 0x00 */
  10. u32 nand_data;
  11. u32 _pad_0x8;
  12. u32 usb0;
  13. u32 usb1; /* 0x10 */
  14. u32 _pad_0x14;
  15. u32 _pad_0x18;
  16. u32 spim0;
  17. u32 spim1; /* 0x20 */
  18. u32 spis0;
  19. u32 spis1;
  20. u32 emac0;
  21. u32 emac1; /* 0x30 */
  22. u32 emac2;
  23. u32 _pad_0x38;
  24. u32 _pad_0x3c;
  25. u32 sdmmc; /* 0x40 */
  26. u32 gpio0;
  27. u32 gpio1;
  28. u32 _pad_0x4c;
  29. u32 i2c0; /* 0x50 */
  30. u32 i2c1;
  31. u32 i2c2;
  32. u32 i2c3;
  33. u32 i2c4; /* 0x60 */
  34. u32 timer0;
  35. u32 timer1;
  36. u32 uart0;
  37. u32 uart1; /* 0x70 */
  38. };
  39. struct socfpga_firwall_l4_sys {
  40. u32 _pad_0x00; /* 0x00 */
  41. u32 _pad_0x04;
  42. u32 dma_ecc;
  43. u32 emac0rx_ecc;
  44. u32 emac0tx_ecc; /* 0x10 */
  45. u32 emac1rx_ecc;
  46. u32 emac1tx_ecc;
  47. u32 emac2rx_ecc;
  48. u32 emac2tx_ecc; /* 0x20 */
  49. u32 _pad_0x24;
  50. u32 _pad_0x28;
  51. u32 nand_ecc;
  52. u32 nand_read_ecc; /* 0x30 */
  53. u32 nand_write_ecc;
  54. u32 ocram_ecc;
  55. u32 _pad_0x3c;
  56. u32 sdmmc_ecc; /* 0x40 */
  57. u32 usb0_ecc;
  58. u32 usb1_ecc;
  59. u32 clock_manager;
  60. u32 _pad_0x50; /* 0x50 */
  61. u32 io_manager;
  62. u32 reset_manager;
  63. u32 system_manager;
  64. u32 osc0_timer; /* 0x60 */
  65. u32 osc1_timer;
  66. u32 watchdog0;
  67. u32 watchdog1;
  68. u32 watchdog2; /* 0x70 */
  69. u32 watchdog3;
  70. };
  71. #define FIREWALL_L4_DISABLE_ALL (BIT(0) | BIT(24) | BIT(16))
  72. #define FIREWALL_BRIDGE_DISABLE_ALL (~0)
  73. /* Cache coherency unit (CCU) registers */
  74. #define CCU_CPU0_MPRT_ADBASE_DDRREG 0x4400
  75. #define CCU_CPU0_MPRT_ADBASE_MEMSPACE0 0x45c0
  76. #define CCU_CPU0_MPRT_ADBASE_MEMSPACE1A 0x45e0
  77. #define CCU_CPU0_MPRT_ADBASE_MEMSPACE1B 0x4600
  78. #define CCU_CPU0_MPRT_ADBASE_MEMSPACE1C 0x4620
  79. #define CCU_CPU0_MPRT_ADBASE_MEMSPACE1D 0x4640
  80. #define CCU_CPU0_MPRT_ADBASE_MEMSPACE1E 0x4660
  81. #define CCU_CPU0_MPRT_ADMASK_MEM_RAM0 0x4688
  82. #define CCU_IOM_MPRT_ADBASE_MEMSPACE0 0x18560
  83. #define CCU_IOM_MPRT_ADBASE_MEMSPACE1A 0x18580
  84. #define CCU_IOM_MPRT_ADBASE_MEMSPACE1B 0x185a0
  85. #define CCU_IOM_MPRT_ADBASE_MEMSPACE1C 0x185c0
  86. #define CCU_IOM_MPRT_ADBASE_MEMSPACE1D 0x185e0
  87. #define CCU_IOM_MPRT_ADBASE_MEMSPACE1E 0x18600
  88. #define CCU_IOM_MPRT_ADMASK_MEM_RAM0 0x18628
  89. #define CCU_ADMASK_P_MASK BIT(0)
  90. #define CCU_ADMASK_NS_MASK BIT(1)
  91. #define CCU_ADBASE_DI_MASK BIT(4)
  92. #define CCU_REG_ADDR(reg) \
  93. (SOCFPGA_CCU_ADDRESS + (reg))
  94. /* Firewall MPU DDR SCR registers */
  95. #define FW_MPU_DDR_SCR_EN 0x00
  96. #define FW_MPU_DDR_SCR_EN_SET 0x04
  97. #define FW_MPU_DDR_SCR_MPUREGION0ADDR_LIMIT 0x18
  98. #define FW_MPU_DDR_SCR_MPUREGION0ADDR_LIMITEXT 0x1c
  99. #define FW_MPU_DDR_SCR_NONMPUREGION0ADDR_LIMIT 0x98
  100. #define FW_MPU_DDR_SCR_NONMPUREGION0ADDR_LIMITEXT 0x9c
  101. #define MPUREGION0_ENABLE BIT(0)
  102. #define NONMPUREGION0_ENABLE BIT(8)
  103. #define FW_MPU_DDR_SCR_WRITEL(data, reg) \
  104. writel(data, SOCFPGA_FW_MPU_DDR_SCR_ADDRESS + (reg))
  105. #endif /* _FIREWALL_S10_ */