| /* |
| * Copyright (c) 2018 MediaTek Inc. |
| * |
| * Permission is hereby granted, free of charge, to any person obtaining |
| * a copy of this software and associated documentation files |
| * (the "Software"), to deal in the Software without restriction, |
| * including without limitation the rights to use, copy, modify, merge, |
| * publish, distribute, sublicense, and/or sell copies of the Software, |
| * and to permit persons to whom the Software is furnished to do so, |
| * subject to the following conditions: |
| * |
| * The above copyright notice and this permission notice shall be |
| * included in all copies or substantial portions of the Software. |
| * |
| * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
| * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY |
| * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
| * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
| * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| */ |
| |
| #pragma once |
| |
| #include <stdbool.h> |
| #include <sys/types.h> |
| |
| #define ERR_ADDR (0xffffffff) |
| |
| enum { |
| IMGTYPE_NONE, |
| IMGTYPE_TZ, |
| IMGTYPE_BL33, |
| IMGTYPE_BUILTIN_BL33, |
| IMGTYPE_KERNEL, |
| IMGTYPE_CM4, |
| IMGTYPE_SLAVE_CPU, |
| IMGTYPE_SPM, |
| IMGTYPE_HYPERVISOR, |
| IMGTYPE_DTBO, |
| IMGTYPE_VPD, |
| IMGTYPE_SCPSYS, |
| IMGTYPE_SCPDATA, |
| IMGTYPE_SCPCFG, |
| IMGTYPE_MODEM, |
| IMGTYPE_HSM_OS, |
| }; |
| |
| struct image_load_data { |
| const char *part_name; |
| const char *recovery_part_name; |
| const char *membdev_name; /* for fastboot flash download:xx command */ |
| void *buf; |
| bool has_slot; |
| |
| ulong kernel_entry; |
| ulong dtb_load; |
| ulong trustedos_entry; |
| }; |
| |
| struct imageinfo_t { |
| uint32_t type; |
| struct image_load_data *imgdata; |
| int (*load)(const char *part_name, struct imageinfo_t *img); |
| }; |