| /* |
| * Copyright (c) 2020 The Fuchsia Authors |
| * |
| * SPDX-License-Identifier: BSD-3-Clause |
| * |
| * The file should be kept in sync with |
| * src/storage/volume_image/ftl/raw_nand_image.h in the |
| * fuchsia repo |
| */ |
| |
| #define FVM_FTL_IMAGE_REQUIRE_WIPE 1 |
| #define FVM_FTL_IMAGE_RAW 0 |
| #define FVM_FTL_IMAGE_ANDROID_SPARSE 1 |
| |
| // Identifies this header. |
| #define FVM_FTL_IMAGE_MAGIC 0x12A17178711A711D |
| |
| // Current major version. |
| #define FVM_FTL_IMAGE_MAJOR 1 |
| |
| // Current minor version. |
| #define FVM_FTL_IMAGE_MANIOR 1 |
| |
| // Header that precedes a block image, whose block data is being |
| // augmented with Out Of Band(OOB) or Spare Area bytes. |
| struct RawNandImageHeader { |
| // 64 bits reserved as an indicator of this prelude. |
| uint64_t magic; |
| |
| // Major version number for the format. |
| // Crossing this version may break backwards compatibility. |
| uint32_t version_major; |
| |
| // Min version number for the format. |
| // Crossing this version will not break backwards compatibility. |
| uint32_t version_minor; |
| |
| // Set of blacks to tweak behaviour during the flashing process. |
| // Values must match |RawNandSparseImageFlag| enum. |
| uint32_t flags; |
| |
| // Format of the content following the RawNandImageHeader. |
| uint32_t format; |
| |
| // Page size used for the data written in the chosen image format. |
| // Must be equal to the target device page size. |
| uint32_t page_size; |
| |
| // Out of band bytes used in data written in the chosen image format. |
| // Must be small or equal to the target device OOB byte size. |
| uint8_t oob_size; |
| |
| // Reserved |
| uint8_t reserved[3]; |
| } __attribute__((packed)); |