blob: 047c7ddaa853f8539cbd7e59d942651523fce2bb [file] [log] [blame]
Haojian Zhuang91f56462016-07-28 14:19:36 +08001/*
Antonio Nino Diaz4b32e622018-08-16 16:52:57 +01002 * Copyright (c) 2016-2018, ARM Limited and Contributors. All rights reserved.
Haojian Zhuang91f56462016-07-28 14:19:36 +08003 *
dp-armfa3cf0b2017-05-03 09:38:09 +01004 * SPDX-License-Identifier: BSD-3-Clause
Haojian Zhuang91f56462016-07-28 14:19:36 +08005 */
6
7#ifndef __PARTITION_H__
8#define __PARTITION_H__
9
10#include <cassert.h>
Antonio Nino Diaz4b32e622018-08-16 16:52:57 +010011#include <stdint.h>
Haojian Zhuang91f56462016-07-28 14:19:36 +080012
13#if !PLAT_PARTITION_MAX_ENTRIES
14# define PLAT_PARTITION_MAX_ENTRIES 128
15#endif /* PLAT_PARTITION_MAX_ENTRIES */
16
17CASSERT(PLAT_PARTITION_MAX_ENTRIES <= 128, assert_plat_partition_max_entries);
18
19#define PARTITION_BLOCK_SIZE 512
20
21#define EFI_NAMELEN 36
22
23typedef struct partition_entry {
24 uint64_t start;
25 uint64_t length;
26 char name[EFI_NAMELEN];
27} partition_entry_t;
28
29typedef struct partition_entry_list {
30 partition_entry_t list[PLAT_PARTITION_MAX_ENTRIES];
31 int entry_count;
32} partition_entry_list_t;
33
34int load_partition_table(unsigned int image_id);
35const partition_entry_t *get_partition_entry(const char *name);
36const partition_entry_list_t *get_partition_entry_list(void);
37void partition_init(unsigned int image_id);
38
39#endif /* __PARTITION_H__ */