Konstantin Porotchkin | f69ec58 | 2018-06-07 18:31:14 +0300 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2018 Marvell International Ltd. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | * https://spdx.org/licenses |
| 6 | */ |
| 7 | |
Antonio Nino Diaz | 5eb8837 | 2018-11-08 10:20:19 +0000 | [diff] [blame] | 8 | #ifndef MSS_SCP_BL2_FORMAT_H |
| 9 | #define MSS_SCP_BL2_FORMAT_H |
Konstantin Porotchkin | f69ec58 | 2018-06-07 18:31:14 +0300 | [diff] [blame] | 10 | |
Grzegorz Jaszczyk | f618f18 | 2019-04-04 14:38:55 +0200 | [diff] [blame] | 11 | #define MAX_NR_OF_FILES 8 |
Konstantin Porotchkin | f69ec58 | 2018-06-07 18:31:14 +0300 | [diff] [blame] | 12 | #define FILE_MAGIC 0xddd01ff |
| 13 | #define HEADER_VERSION 0x1 |
| 14 | |
| 15 | #define MSS_IDRAM_SIZE 0x10000 /* 64KB */ |
| 16 | #define MG_SRAM_SIZE 0x20000 /* 128KB */ |
| 17 | |
| 18 | /* Types definitions */ |
| 19 | typedef struct file_header { |
| 20 | /* Magic specific for concatenated file (used for validation) */ |
| 21 | uint32_t magic; |
| 22 | uint32_t nr_of_imgs; /* Number of images concatenated */ |
| 23 | } file_header_t; |
| 24 | |
| 25 | /* Types definitions */ |
| 26 | enum cm3_t { |
| 27 | MSS_AP, |
| 28 | MSS_CP0, |
| 29 | MSS_CP1, |
| 30 | MSS_CP2, |
| 31 | MSS_CP3, |
| 32 | MG_CP0, |
| 33 | MG_CP1, |
Grzegorz Jaszczyk | f618f18 | 2019-04-04 14:38:55 +0200 | [diff] [blame] | 34 | MG_CP2, |
Konstantin Porotchkin | f69ec58 | 2018-06-07 18:31:14 +0300 | [diff] [blame] | 35 | }; |
| 36 | |
| 37 | typedef struct img_header { |
| 38 | uint32_t type; /* CM3 type, can be one of cm3_t */ |
| 39 | uint32_t length; /* Image length */ |
| 40 | uint32_t version; /* For sanity checks and future |
| 41 | * extended functionality |
| 42 | */ |
| 43 | } img_header_t; |
| 44 | |
Antonio Nino Diaz | 5eb8837 | 2018-11-08 10:20:19 +0000 | [diff] [blame] | 45 | #endif /* MSS_SCP_BL2_FORMAT_H */ |