2aeaace9f619cf79a7de4589ab86c57078d8d580
[project/bcm63xx/atf.git] / include / drivers / partition / partition.h
1 /*
2 * Copyright (c) 2016-2018, ARM Limited and Contributors. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7 #ifndef PARTITION_H
8 #define PARTITION_H
9
10 #include <cassert.h>
11 #include <stdint.h>
12
13 #if !PLAT_PARTITION_MAX_ENTRIES
14 # define PLAT_PARTITION_MAX_ENTRIES 128
15 #endif /* PLAT_PARTITION_MAX_ENTRIES */
16
17 CASSERT(PLAT_PARTITION_MAX_ENTRIES <= 128, assert_plat_partition_max_entries);
18
19 #define PARTITION_BLOCK_SIZE 512
20
21 #define EFI_NAMELEN 36
22
23 typedef struct partition_entry {
24 uint64_t start;
25 uint64_t length;
26 char name[EFI_NAMELEN];
27 } partition_entry_t;
28
29 typedef struct partition_entry_list {
30 partition_entry_t list[PLAT_PARTITION_MAX_ENTRIES];
31 int entry_count;
32 } partition_entry_list_t;
33
34 int load_partition_table(unsigned int image_id);
35 const partition_entry_t *get_partition_entry(const char *name);
36 const partition_entry_list_t *get_partition_entry_list(void);
37 void partition_init(unsigned int image_id);
38
39 #endif /* PARTITION_H */