blob: 6b26ac14c2f468c2b1ff9463ce354b8471238c22 [file] [log] [blame]
Soby Mathewb4c6df42022-11-09 11:13:29 +00001/*
2 * SPDX-License-Identifier: BSD-3-Clause
3 * SPDX-FileCopyrightText: Copyright TF-RMM Contributors.
4 */
5#ifndef PLATFORM_API_H
6#define PLATFORM_API_H
7
8#include <stdint.h>
9
10void plat_warmboot_setup(uint64_t x0, uint64_t x1, uint64_t x2, uint64_t x3);
11void plat_setup(uint64_t x0, uint64_t x1, uint64_t x2, uint64_t x3);
12
13/*
14 * Takes an aligned granule address, validates it and if valid returns the
15 * index in the struct granules array or UINT64_MAX in case of an error.
16 *
17 * This function also validates that the granule address is a valid
18 * page address.
19 */
20unsigned long plat_granule_addr_to_idx(unsigned long addr);
21
22/*
23 * Takes an index in the struct granules array and returns the aligned granule
24 * address. The index must be within the number of granules expected by the
25 * platform.
26 */
27unsigned long plat_granule_idx_to_addr(unsigned long idx);
28
29#endif /* PLATFORM_API_H */