vha_plat.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /*!
  2. *****************************************************************************
  3. *
  4. * @File vha_plat.h
  5. * ---------------------------------------------------------------------------
  6. *
  7. * Copyright (c) Imagination Technologies Ltd.
  8. *
  9. * The contents of this file are subject to the MIT license as set out below.
  10. *
  11. * Permission is hereby granted, free of charge, to any person obtaining a
  12. * copy of this software and associated documentation files (the "Software"),
  13. * to deal in the Software without restriction, including without limitation
  14. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  15. * and/or sell copies of the Software, and to permit persons to whom the
  16. * Software is furnished to do so, subject to the following conditions:
  17. *
  18. * The above copyright notice and this permission notice shall be included in
  19. * all copies or substantial portions of the Software.
  20. *
  21. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  22. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  23. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  24. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  25. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  26. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  27. * THE SOFTWARE.
  28. *
  29. * Alternatively, the contents of this file may be used under the terms of the
  30. * GNU General Public License Version 2 ("GPL")in which case the provisions of
  31. * GPL are applicable instead of those above.
  32. *
  33. * If you wish to allow use of your version of this file only under the terms
  34. * of GPL, and not to allow others to use your version of this file under the
  35. * terms of the MIT license, indicate your decision by deleting the provisions
  36. * above and replace them with the notice and other provisions required by GPL
  37. * as set out in the file called "GPLHEADER" included in this distribution. If
  38. * you do not delete the provisions above, a recipient may use your version of
  39. * this file under the terms of either the MIT license or GPL.
  40. *
  41. * This License is also included in this distribution in the file called
  42. * "MIT_COPYING".
  43. *
  44. *****************************************************************************/
  45. #ifndef VHA_PLAT_H
  46. #define VHA_PLAT_H
  47. /* Core clock frequency: default 30MHz */
  48. #define VHA_CORE_CLOCK_MHZ 30
  49. /* Core watchdog cycles default value */
  50. #if defined(HW_AX2)
  51. #define VHA_CORE_WDT_CYCLES 0x7fffff
  52. #elif defined(HW_AX3)
  53. /* MMM can transfer any number of bytes at cost of higher cycles, setting it to ~100ms @800MHz */
  54. #define VHA_CORE_WDT_CYCLES 0xfffffff
  55. /* Memory watchdog is set ~1ms @800MHz which is very safe value to avoid any false interrupts */
  56. #define VHA_CORE_MEM_WDT_CYCLES 0xffffffff
  57. #endif
  58. #ifdef CONFIG_HW_MULTICORE
  59. /* System watchdog cycles default values */
  60. #define VHA_SYS_MEM_WDT_CYCLES 0xffffffff
  61. /* WM watchdog cycles default values */
  62. #define VHA_WM_WDT_CYCLES 0xffffffff
  63. #define VHA_WM_IDLE_WDT_CYCLES 0xfffff
  64. #define VHA_WM_SOCIF_WDT_CYCLES 0xfffff
  65. /* Core watchdog cycles default values */
  66. /* MMM can transfer any number of bytes at cost of higher cycles, setting it to ~100ms @800MHz */
  67. #define VHA_CORE_WDT_CYCLES 0xfffffff
  68. /* Memory watchdog is set ~1ms @800MHz which is very safe value to avoid any false interrupts */
  69. #define VHA_CORE_MEM_WDT_CYCLES 0xffffffff
  70. #define VHA_CORE_SYNC_WDT_CYCLES 0xffff
  71. #endif
  72. /* Memory burst size */
  73. #define VHA_CORE_MH_MAX_BURST_LENGTH 128
  74. /* SLC cache policy type (0-use cache, 1-bypass cache) */
  75. #define VHA_CORE_MH_SLC_CACHE_POLICY_TYPE 1
  76. /* GPU pipe coherent type */
  77. #define VHA_CORE_MH_GPU_PIPE_COHERENT_TYPE 1
  78. /* Persistence priority 0-lowest,3-highest */
  79. #define VHA_CORE_MH_PERSISTENCE_PRIO 0
  80. /* Suspend delay in ms after which the
  81. * runtime suspend callback is called */
  82. #define VHA_CORE_SUSPEND_DELAY 10
  83. /* Default OCM start address */
  84. #ifdef CONFIG_HW_MULTICORE
  85. #define VHA_OCM_ADDR_START 0x1000
  86. #else
  87. #define VHA_OCM_ADDR_START (~0)
  88. #endif
  89. /* IO hooks */
  90. uint64_t vha_plat_read64(void *addr);
  91. void vha_plat_write64(void *addr, uint64_t val);
  92. int vha_plat_init(void);
  93. int vha_plat_deinit(void);
  94. #endif /* VHA_PLAT_H */