mt_boot.h 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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) 2017. 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 _MT_BOOT_H_
  32. #define _MT_BOOT_H_
  33. #include "memory_layout.h"
  34. #include <fdt_op.h>
  35. #include <bootimg.h>
  36. #define DTB_MAX_SIZE (512*1024)
  37. #ifndef DUMMY_MEMORY_LAYOUT
  38. #if DTB_MAX_SIZE > LK_DT_MAX_SIZE
  39. #error DTB_MAX_SIZE > LK_DT_MAX_SIZE
  40. #endif
  41. #if KERNEL_DECOMPRESS_SIZE > LK_KERNEL_64_MAX_SIZE
  42. #error KERNEL_DECOMPRESS_SIZE > LK_KERNEL_64_MAX_SIZE
  43. #endif
  44. #if (MEMBASE != LK_LK_BASE)||(MEMSIZE > LK_LK_MAX_SIZE)
  45. #error check LK MEMBASE or MEMSIZE
  46. #endif
  47. #if (SCRATCH_ADDR != LK_DL_BASE)||(SCRATCH_SIZE > LK_DL_MAX_SIZE)
  48. #error check SCRATCH_ADDR or SCRATCH_SIZE
  49. #endif
  50. #endif
  51. #define EXTRACT_UBYTE(x, n) ((uint32_t)((uint8_t *)&x)[n])
  52. void Debug_log_EMI_MPU(void) __attribute__((weak));
  53. #ifdef MTK_AB_OTA_UPDATER
  54. void get_AB_OTA_name(char *part_name, int size);
  55. #endif /* MTK_AB_OTA_UPDATER */
  56. bool get_atm_enable_status(void);
  57. bool cmdline_append(const char *append_string);
  58. void mboot_allocate_bootimg_from_mblock(struct bootimg_hdr *p_boot_hdr);
  59. int bldr_load_dtb(char* boot_load_partition);
  60. void msg_header_error(char *img_name);
  61. void msg_img_error(char *img_name);
  62. #endif // _MT_BOOT_H_