| /* | |
| * Copyright (c) 2018 The Fuchsia Authors | |
| * | |
| * SPDX-License-Identifier: BSD-3-Clause | |
| */ | |
| #ifndef _ZIRCON_ZIRCON_H_ | |
| #define _ZIRCON_ZIRCON_H_ | |
| #include <lib/zbi-format/driver-config.h> | |
| #include <zircon/hw/gpt.h> | |
| #include <libavb/libavb.h> | |
| #include <libzbi/zbi.h> | |
| /* called before booting to allow board specific additions to the bootdata */ | |
| int zircon_preboot(zbi_header_t *zbi, size_t capacity, bool is_efi_boot); | |
| AvbIOResult read_rollback_index(AvbOps *ops, size_t rollback_index_location, | |
| uint64_t *out_rollback_index); | |
| AvbIOResult write_rollback_index(AvbOps *ops, size_t rollback_index_location, | |
| uint64_t rollback_index); | |
| AvbIOResult read_is_device_unlocked(AvbOps *ops, bool *out_is_unlocked); | |
| // Add bootloader file items. | |
| zbi_result_t AddBootloaderFiles(const char *name, const void *data, size_t len); | |
| // Loads and verifies an image from RAM. | |
| // | |
| // This will do the normal boot flow validation on the given image and copy | |
| // it into the kernel load buffer described by the "loadaddr"/"loadsize" env | |
| // vars. | |
| // | |
| // If this function succeeds, you may call zircon_ram_boot() to boot the | |
| // loaded image. | |
| // | |
| // Args: | |
| // image: buffer containing the image. | |
| // size: image size. | |
| // | |
| // Returns 0 on success. | |
| int zircon_ram_load(const void *image, size_t size); | |
| // Boots a Zircon image previously loaded via zircon_ram_load(). | |
| // | |
| // This function will not return unless a failure occurs. | |
| void zircon_ram_boot(void); | |
| // Constructs a zbi container containing the Vim3 specific ZBI items. | |
| int get_board_zbi_items_container(void* buffer, size_t capacity); | |
| #endif |