platform_debug.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. /* Copyright Statement:
  2. *
  3. * This software/firmware and related documentation ("MediaTek Software") are
  4. * protected under relevant copyright laws. The information contained herein
  5. * is confidential and proprietary to MediaTek Inc. and/or its licensors.
  6. * Without the prior written permission of MediaTek inc. and/or its licensors,
  7. * any reproduction, modification, use or disclosure of MediaTek Software,
  8. * and information contained herein, in whole or in part, shall be strictly prohibited.
  9. */
  10. /* MediaTek Inc. (C) 2016. All rights reserved.
  11. *
  12. * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
  13. * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
  14. * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON
  15. * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
  16. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
  17. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
  18. * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
  19. * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
  20. * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH
  21. * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES
  22. * THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES
  23. * CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK
  24. * SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
  25. * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND
  26. * CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
  27. * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
  28. * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO
  29. * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
  30. */
  31. #ifndef __PLATFORM_DEBUG_H__
  32. #define __PLATFORM_DEBUG_H__
  33. #include <latch.h>
  34. #include <dfd.h>
  35. const struct plt_cfg_pc_latch cfg_pc_latch = {
  36. .nr_max_core = 8,
  37. .nr_max_big_core = 2,
  38. .anake_core_dbg_sel = 0x0220,
  39. .anake_core_dbg_mon = 0x0224,
  40. .spm_pwr_sts = 0xAB88,
  41. .plat_sram_flag0 = 0x0,
  42. .version = LASTPC_V2,
  43. };
  44. const struct plt_cfg_return_stack cfg_return_stack = {
  45. .nr_max_core = 8,
  46. .nr_max_big = 2,
  47. .nr_entry = 8,
  48. .dump = NULL,
  49. .decode = NULL,
  50. };
  51. int plt_lastbus_is_timeout(const struct plt_cfg_bus_latch *self);
  52. int plt_lastbus_dump(const struct plt_cfg_bus_latch *self, char *buf, int *wp);
  53. void plat_perisys_monitor_init(const struct plt_cfg_bus_latch *self);
  54. void no_need_dump(void);
  55. const struct plt_cfg_bus_latch cfg_bus_latch = {
  56. .supported = 1,
  57. .num_master_port = 3,
  58. .num_slave_port = 5,
  59. .num_perisys_mon = 21,
  60. .num_infrasys_mon = 48,
  61. .mcusys_offsets = {
  62. .bus_mcu_m0 = 0x8320,
  63. .bus_mcu_s1 = 0x8340,
  64. .bus_mcu_m0_m = 0x8240,
  65. .bus_mcu_s1_m = 0x8260,
  66. },
  67. .perisys_offsets = {
  68. .bus_peri_r0 = 0x0500,
  69. .bus_peri_r1 = 0x0504,
  70. .bus_peri_mon = 0x0508,
  71. },
  72. .secure_perisys = 0,
  73. .perisys_enable = 0xc,
  74. .perisys_timeout = 0x3fff,
  75. .perisys_ops = {
  76. .is_timeout = plt_lastbus_is_timeout,
  77. .init = plat_perisys_monitor_init,
  78. .dump = no_need_dump,
  79. },
  80. .infrasys_offsets = {
  81. .bus_infra_ctrl = 0x0d04,
  82. .bus_infra_snapshot = 0x0d08,
  83. .bus_infra_mask_l = 0x0d00,
  84. .bus_infra_mask_h = 0x0df0,
  85. },
  86. .infrasys_config = 0xffff000c,
  87. .infrasys_ops = {
  88. .is_timeout = plt_lastbus_is_timeout,
  89. .dump = plt_lastbus_dump,
  90. },
  91. };
  92. const struct plt_cfg_l2_parity_latch cfg_l2_parity_latch = {
  93. .supported = 0,
  94. .mp0_l2_cache_parity1_rdata = 0x007c,
  95. .mp0_l2_cache_parity2_rdata = 0x0080,
  96. .mp1_l2_cache_parity1_rdata = 0x22d0,
  97. .mp1_l2_cache_parity2_rdata = 0x22d4,
  98. };
  99. const struct plt_cfg_big_core cfg_big_core[] = {
  100. {
  101. .cpuid = 6,
  102. .nr_circular_buffer_entry = 96,
  103. .circular_buffer_addr = 0x0C533400,
  104. },
  105. {
  106. .cpuid = 7,
  107. .nr_circular_buffer_entry = 96,
  108. .circular_buffer_addr = 0x0C533C00,
  109. },
  110. };
  111. struct plt_circular_buffer_op circular_buffer_op = {
  112. .lock = NULL,
  113. .unlock = NULL,
  114. };
  115. #define MCU_ALL_PWR_ON_CTRL (0x0C530B58)
  116. /******* dfd *******/
  117. #include "dfd.h"
  118. const struct plt_cfg_dfd cfg_dfd = {
  119. .version = DFD_V3_0,
  120. .sw_version = DFD_SW_V3,
  121. .nr_header_row = 0,
  122. .buffer_addr = 0x0c600000,
  123. .buffer_length = 0x62000,
  124. .large_buffer_length = 0x500000,
  125. .plat_sram_flag1 = 0,
  126. .plat_sram_flag2 = 0,
  127. .dfd_disable_devinfo_index = 7,
  128. .dfd_disable_bit = 29,
  129. .chip_id_offset = 0x18,
  130. .chip_id = {'6','7','8','5',0,0,0,0},
  131. };
  132. struct plt_dfd_op dfd_op = {
  133. .acquire_ram_control = NULL,
  134. .release_ram_control = NULL,
  135. .setup_dfd_file_name = plt_setup_dfd_file_name,
  136. };
  137. /******* etb *******/
  138. #include "etb.h"
  139. const struct plt_cfg_etb cfg_etb = {
  140. .nr_etb = 0,
  141. };
  142. #endif