blob: 4951f8cfd717f646454847dc32e99a705657f8b7 [file] [log] [blame]
Haojian Zhuang91f56462016-07-28 14:19:36 +08001/*
2 * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved.
3 *
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>
11#include <types.h>
12
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__ */