qos_init_v3m.c 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. /*
  2. * Copyright (c) 2015-2024, Renesas Electronics Corporation
  3. * All rights reserved.
  4. *
  5. * SPDX-License-Identifier: BSD-3-Clause
  6. */
  7. #include <stdint.h>
  8. #include <common/debug.h>
  9. #include "../qos_common.h"
  10. #include "../qos_reg.h"
  11. #include "qos_init_v3m.h"
  12. #define RCAR_QOS_VERSION "rev.0.01"
  13. #include "qos_init_v3m_mstat.h"
  14. struct rcar_gen3_dbsc_qos_settings v3m_qos[] = {
  15. /* BUFCAM settings */
  16. { DBSC_DBCAM0CNF1, 0x00048218U },
  17. { DBSC_DBCAM0CNF2, 0x000000F4 },
  18. { DBSC_DBSCHCNT0, 0x080F003F },
  19. { DBSC_DBSCHCNT1, 0x00001010 },
  20. { DBSC_DBSCHSZ0, 0x00000001 },
  21. { DBSC_DBSCHRW0, 0x22421111 },
  22. { DBSC_DBSCHRW1, 0x00180034 },
  23. { DBSC_SCFCTST0, 0x180B1708 },
  24. { DBSC_SCFCTST1, 0x0808070C },
  25. { DBSC_SCFCTST2, 0x012F1123 },
  26. /* QoS Settings */
  27. { DBSC_DBSCHQOS00, 0x0000F000 },
  28. { DBSC_DBSCHQOS01, 0x0000E000 },
  29. { DBSC_DBSCHQOS02, 0x00007000 },
  30. { DBSC_DBSCHQOS03, 0x00000000 },
  31. { DBSC_DBSCHQOS40, 0x0000F000 },
  32. { DBSC_DBSCHQOS41, 0x0000EFFF },
  33. { DBSC_DBSCHQOS42, 0x0000B000 },
  34. { DBSC_DBSCHQOS43, 0x00000000 },
  35. { DBSC_DBSCHQOS90, 0x0000F000 },
  36. { DBSC_DBSCHQOS91, 0x0000EFFF },
  37. { DBSC_DBSCHQOS92, 0x0000D000 },
  38. { DBSC_DBSCHQOS93, 0x00000000 },
  39. { DBSC_DBSCHQOS130, 0x0000F000 },
  40. { DBSC_DBSCHQOS131, 0x0000EFFF },
  41. { DBSC_DBSCHQOS132, 0x0000E800 },
  42. { DBSC_DBSCHQOS133, 0x00007000 },
  43. { DBSC_DBSCHQOS140, 0x0000F000 },
  44. { DBSC_DBSCHQOS141, 0x0000EFFF },
  45. { DBSC_DBSCHQOS142, 0x0000E800 },
  46. { DBSC_DBSCHQOS143, 0x0000B000 },
  47. { DBSC_DBSCHQOS150, 0x000007D0 },
  48. { DBSC_DBSCHQOS151, 0x000007CF },
  49. { DBSC_DBSCHQOS152, 0x000005D0 },
  50. { DBSC_DBSCHQOS153, 0x000003D0 },
  51. };
  52. void qos_init_v3m(void)
  53. {
  54. return;
  55. rcar_qos_dbsc_setting(v3m_qos, ARRAY_SIZE(v3m_qos), false);
  56. #if !(RCAR_QOS_TYPE == RCAR_QOS_NONE)
  57. #if RCAR_QOS_TYPE == RCAR_QOS_TYPE_DEFAULT
  58. NOTICE("BL2: QoS is default setting(%s)\n", RCAR_QOS_VERSION);
  59. #endif
  60. /* Resource Alloc setting */
  61. io_write_32(QOSCTRL_RAS, 0x00000020U);
  62. io_write_32(QOSCTRL_FIXTH, 0x000F0005U);
  63. io_write_32(QOSCTRL_REGGD, 0x00000004U);
  64. io_write_64(QOSCTRL_DANN, 0x0202020104040200U);
  65. io_write_32(QOSCTRL_DANT, 0x00201008U);
  66. io_write_32(QOSCTRL_EC, 0x00080001U); /* need for H3 ES1 */
  67. io_write_64(QOSCTRL_EMS, 0x0000000000000000U);
  68. io_write_32(QOSCTRL_INSFC, 0x63C20001U);
  69. io_write_32(QOSCTRL_BERR, 0x00000000U);
  70. /* QOSBW setting */
  71. io_write_32(QOSCTRL_SL_INIT, 0x0305007DU);
  72. io_write_32(QOSCTRL_REF_ARS, 0x00330000U);
  73. /* QOSBW SRAM setting */
  74. uint32_t i;
  75. for (i = 0U; i < ARRAY_SIZE(mstat_fix); i++) {
  76. io_write_64(QOSBW_FIX_QOS_BANK0 + i * 8, mstat_fix[i]);
  77. io_write_64(QOSBW_FIX_QOS_BANK1 + i * 8, mstat_fix[i]);
  78. }
  79. for (i = 0U; i < ARRAY_SIZE(mstat_be); i++) {
  80. io_write_64(QOSBW_BE_QOS_BANK0 + i * 8, mstat_be[i]);
  81. io_write_64(QOSBW_BE_QOS_BANK1 + i * 8, mstat_be[i]);
  82. }
  83. /* AXI-IF arbitration setting */
  84. io_write_32(DBSC_AXARB, 0x18010000U);
  85. /* Resource Alloc start */
  86. io_write_32(QOSCTRL_RAEN, 0x00000001U);
  87. /* QOSBW start */
  88. io_write_32(QOSCTRL_STATQC, 0x00000001U);
  89. #else
  90. NOTICE("BL2: QoS is None\n");
  91. #endif /* !(RCAR_QOS_TYPE == RCAR_QOS_NONE) */
  92. }