rjw | 1f88458 | 2022-01-06 17:20:42 +0800 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (c) 2019 MediaTek Inc. |
| 3 | * |
| 4 | * Permission is hereby granted, free of charge, to any person obtaining |
| 5 | * a copy of this software and associated documentation files |
| 6 | * (the "Software"), to deal in the Software without restriction, |
| 7 | * including without limitation the rights to use, copy, modify, merge, |
| 8 | * publish, distribute, sublicense, and/or sell copies of the Software, |
| 9 | * and to permit persons to whom the Software is furnished to do so, |
| 10 | * subject to the following conditions: |
| 11 | * |
| 12 | * The above copyright notice and this permission notice shall be |
| 13 | * included in all copies or substantial portions of the Software. |
| 14 | * |
| 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
| 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY |
| 19 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
| 20 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
| 21 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 22 | */ |
| 23 | |
| 24 | #pragma once |
| 25 | |
| 26 | #include <lib/android_dtbo.h> |
| 27 | #include <stddef.h> |
| 28 | |
| 29 | /* |
| 30 | * plat_start_scpsys() - start scpsys processor |
| 31 | * |
| 32 | * blxboot has only weak imp., override this function if necessary. |
| 33 | */ |
| 34 | void plat_start_scpsys(void); |
| 35 | |
| 36 | /* |
| 37 | * plat_fixup_init() - init platform fixup stuff |
| 38 | * |
| 39 | * blxboot has only weak imp. override this function if necessary. |
| 40 | * |
| 41 | * return: |
| 42 | * NO_ERROR, on success |
| 43 | * otherwise, on failure |
| 44 | */ |
| 45 | int plat_fixup_init(void); |
| 46 | |
| 47 | /* |
| 48 | * plat_fixup_append() - append string for platform fixup |
| 49 | * |
| 50 | * blxboot has only weak imp. override this function if necessary. |
| 51 | * |
| 52 | * @append_str: the string to be appended to kernel command line |
| 53 | */ |
| 54 | void plat_fixup_append(char *append_str); |
| 55 | |
| 56 | /* |
| 57 | * plat_fixup_hook() - platform fixup hook function |
| 58 | * |
| 59 | * blxboot has only weak imp. override this function if necessary. |
| 60 | * |
| 61 | * @boot_mode: current boot mode, one of NORMAL_BOOT, RECOVERY_BOOT and |
| 62 | * FASTBOOT_BOOT |
| 63 | * @ab_suffix: pointer to ab boot suffix string, could be NULL if ab is |
| 64 | * not enabled |
| 65 | * @dtb: pointer to the device tree blob |
| 66 | * @dtb_size: the maximum size of dtb |
| 67 | */ |
| 68 | void plat_fixup_hook(uint32_t boot_mode, const char *ab_suffix, |
| 69 | void *dtb, size_t dtb_size); |
| 70 | |
| 71 | /* |
| 72 | * plat_compare_dtbo_hwinfo() - platform defined dtbo hardware information |
| 73 | * comparison function |
| 74 | * |
| 75 | * blxboot has only weak imp., override this function if necessary. |
| 76 | * |
| 77 | * @dtbo_version: android dtbo format version |
| 78 | * @entry: pointer to the table entry which contains the id, rev, and custom |
| 79 | * information for matching the dtbo to current hardware configuration |
| 80 | * |
| 81 | * return: |
| 82 | * 0, on success (entry selected) |
| 83 | * -1, on failure |
| 84 | */ |
| 85 | int plat_compare_dtbo_hwinfo(uint32_t dtbo_version, |
| 86 | struct dt_table_entry *entry); |