mrdump_dummy.c 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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. #include <debug.h>
  32. #include <dev/mrdump.h>
  33. #include <memory_layout.h>
  34. #include <platform/boot_mode.h>
  35. int mrdump_detection(void) __attribute__((weak));
  36. int mrdump_detection(void)
  37. {
  38. return 0;
  39. }
  40. void mrdump_reserve_memory(void) __attribute__((weak));
  41. void mrdump_reserve_memory(void)
  42. {
  43. #ifdef PL_DRAMBUF_BASE
  44. if (mblock_query_reserved(&g_boot_arg->mblock_info,
  45. "pl-drambuf", 0)) {
  46. if (mblock_create(&g_boot_arg->mblock_info,
  47. &g_boot_arg->orig_dram_info,
  48. PL_DRAMBUF_BASE, PL_DRAMBUF_MAX_SIZE)) {
  49. dprintf(CRITICAL, "%s: free PL_DRAMBUF_ARG failed\n", __func__);
  50. assert(0);
  51. }
  52. }
  53. #endif /* end of PL_DRAMBUF_BASE */
  54. #ifdef PL_BOOTTAGS_BASE
  55. if (mblock_query_reserved(&g_boot_arg->mblock_info,
  56. "pl-boottag", 0)) {
  57. if (mblock_create(&g_boot_arg->mblock_info,
  58. &g_boot_arg->orig_dram_info,
  59. PL_BOOTTAGS_BASE, PL_BOOTTAGS_MAX_SIZE)) {
  60. dprintf(CRITICAL, "%s: free PL_BOOT_ARG failed\n", __func__);
  61. assert(0);
  62. }
  63. }
  64. #endif /* end of PL_BOOTTAGS_BASE */
  65. #ifdef PL_BOOTARG_BASE
  66. if (mblock_query_reserved(&g_boot_arg->mblock_info,
  67. "pl-bootarg", 0)) {
  68. if (mblock_create(&g_boot_arg->mblock_info,
  69. &g_boot_arg->orig_dram_info,
  70. PL_BOOTARG_BASE, PL_BOOTARG_MAX_SIZE)) {
  71. dprintf(CRITICAL, "%s: free PL_BOOTARG_BASE failed\n", __func__);
  72. assert(0);
  73. }
  74. }
  75. #endif /* end of PL_BOOTARG_BASE */
  76. }
  77. int mrdump_run2(void) __attribute__((weak));
  78. int mrdump_run2(void)
  79. {
  80. return 0;
  81. }
  82. void mrdump_reboot(void) __attribute__((weak));
  83. void mrdump_reboot(void)
  84. {
  85. }
  86. int sLOG(char *fmt, ...) __attribute__((weak));
  87. int sLOG(char *fmt, ...)
  88. {
  89. return 0;
  90. }
  91. void mrdump_init(void *fdt) __attribute__((weak));
  92. void mrdump_init(void *fdt)
  93. {
  94. }
  95. int mrdump_check_enable(void) __attribute__((weak));
  96. int mrdump_check_enable(void)
  97. {
  98. return MRDUMP_ALWAYS_DISABLE;
  99. }