Skip to content

Latest commit

 

History

History
214 lines (192 loc) · 6.08 KB

FORMAT.md

File metadata and controls

214 lines (192 loc) · 6.08 KB

MBN File Format

MBN Secure Boot Segment

Header V3

   Byte
    1        2        3        4
+--------+--------+--------+--------+
|             image id              |
+--------+--------+--------+--------+
|           version (= 3)           |
+--------+--------+--------+--------+
|           flash address           |
+--------+--------+--------+--------+
|        destination address        |
+--------+--------+--------+--------+
|           total length            |
+--------+--------+--------+--------+
|            hash length            |
+--------+--------+--------+--------+
|         signature address         |
+--------+--------+--------+--------+
|         signature length          |
+--------+--------+--------+--------+
|     certificate chain address     |
+--------+--------+--------+--------+
|     certificate chain length      |
+--------+--------+--------+--------+

Header V5

   Byte
    1        2        3        4
+--------+--------+--------+--------+
|             image id              |
+--------+--------+--------+--------+
|           version (= 5)           |
+--------+--------+--------+--------+
|      signature size qualcomm      |
+--------+--------+--------+--------+
|  certificate chain size qualcomm  |
+--------+--------+--------+--------+
|           total length            |
+--------+--------+--------+--------+
|            hash length            |
+--------+--------+--------+--------+
|         signature address         |
+--------+--------+--------+--------+
|         signature length          |
+--------+--------+--------+--------+
|     certificate chain address     |
+--------+--------+--------+--------+
|     certificate chain length      |
+--------+--------+--------+--------+

Header V6

   Byte
    1        2        3        4
+--------+--------+--------+--------+
|             image id              |
+--------+--------+--------+--------+
|           version (= 6)           |
+--------+--------+--------+--------+
|      signature size qualcomm      |
+--------+--------+--------+--------+
|  certificate chain size qualcomm  |
+--------+--------+--------+--------+
|           total length            |
+--------+--------+--------+--------+
|            hash length            |
+--------+--------+--------+--------+
|         signature address         |
+--------+--------+--------+--------+
|         signature length          |
+--------+--------+--------+--------+
|     certificate chain address     |
+--------+--------+--------+--------+
|     certificate chain length      |
+--------+--------+--------+--------+
|     qualcomm metadata length      |
+--------+--------+--------+--------+
|          metadata length          |
+--------+--------+--------+--------+

MCFG Segment Format

   Byte
    1        2        3        4
+--------+--------+--------+--------+
|  "M"   |  "C"   |  "F"   |  "G"   |
+--------+--------+--------+--------+
|   format_type   |   config type   |
+--------+--------+--------+--------+
|  number of items in MCFG segment  |
+--------+--------+--------+--------+
|  carrier index  |    reserved     |
+--------+--------+--------+--------+
|   version id    |  version size   |
+--------+--------+--------+--------+
|                                   :
:              version              :
:                                   |
+--------+--------+--------+--------+
|                                   :
:               Items               :
:                                   |
+--------+--------+--------+--------+
|                                   :
:           Trailer Item            :
:                                   |
+--------+--------+--------+--------+

MCFG Item Format

   Byte
    1        2        3        4
+--------+--------+--------+--------+
|              length               |
+--------+--------+--------+--------+
|  type  | attrs  |    reserved     |
+--------+--------+--------+--------+
|                                   :
:               data                :
:                                   |
+--------+--------+--------+--------+

NV Item (Type == 1) Format

   Byte
    1        2        3        4
+--------+--------+--------+--------+
|      NV ID      |     length      |
+--------+--------+--------+--------+
|                                   :
:               data                :
:                                   |
+--------+--------+--------+--------+

NV File Item (Type == 2/4) Format

   Byte
    1        2        3        4
+--------+--------+--------+--------+
|              length               |
+--------+--------+--------+--------+
|  type  | attrs  |    reserved     |
+--------+--------+--------+--------+
|   magic (0x1)   |   path length   |
+--------+--------+--------+--------+
|                                   :
:             file path             :
:                                   |
+--------+--------+--------+--------+
|   magic (0x2)   |     length      |
+--------+--------+--------+--------+
|                                   :
:               data                :
:                                   |
+--------+--------+--------+--------+

MCFG Trailer Format

   Byte
    1        2        3        4
+--------+--------+--------+--------+
|              length               |
+--------+--------+--------+--------+
|   magic (0xa)   |    reserved     |
+--------+--------+--------+--------+
|  magic2 (0xa1)  | content length  |
+--------+--------+--------+--------+
|  "M"   |  "C"   |  "F"   |  "G"   |
+--------+--------+--------+--------+
|  "_"   |  "T"   |  "R"   | "L"    |
+--------+--------+--------+--------+
|                                   :
:           trailer items           :
:                                   |
+--------+--------+--------+--------+

Trailer Item Format

   Byte
    1        2        3        4
+--------+--------+--------+--------+
|  type  |     length      |        :
+--------+--------+--------+        :
|                                   :
:               value               :
:                                   |
+--------+--------+--------+--------+