blob: e79551a3115e5cba5096428adb9024dc5790fa9b [file] [log] [blame]
Yann Gautier9aea69e2018-07-24 17:13:36 +02001/*
Yann Gautier038bff22019-01-17 19:17:47 +01002 * Copyright (c) 2017-2019, ARM Limited and Contributors. All rights reserved.
Yann Gautier9aea69e2018-07-24 17:13:36 +02003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
Yann Gautieree8f5422019-02-14 11:13:25 +01007#ifndef STM32MP_DT_H
8#define STM32MP_DT_H
Yann Gautier9aea69e2018-07-24 17:13:36 +02009
10#include <stdbool.h>
11
Yann Gautier038bff22019-01-17 19:17:47 +010012#define DT_DISABLED U(0)
13#define DT_NON_SECURE U(1)
14#define DT_SECURE U(2)
15#define DT_SHARED (DT_NON_SECURE | DT_SECURE)
16
Yann Gautier69035a82018-07-05 16:48:16 +020017struct dt_node_info {
18 uint32_t base;
19 int32_t clock;
20 int32_t reset;
Yann Gautier038bff22019-01-17 19:17:47 +010021 uint32_t status;
Yann Gautier69035a82018-07-05 16:48:16 +020022};
23
Yann Gautier9aea69e2018-07-24 17:13:36 +020024/*******************************************************************************
25 * Function and variable prototypes
26 ******************************************************************************/
27int dt_open_and_check(void);
28int fdt_get_address(void **fdt_addr);
29bool fdt_check_node(int node);
Yann Gautieree8f5422019-02-14 11:13:25 +010030uint8_t fdt_get_status(int node);
Yann Gautier69035a82018-07-05 16:48:16 +020031int dt_set_stdout_pinctrl(void);
32void dt_fill_device_info(struct dt_node_info *info, int node);
33int dt_get_node(struct dt_node_info *info, int offset, const char *compat);
34int dt_get_stdout_uart_info(struct dt_node_info *info);
Yann Gautiercaf575b2018-07-24 17:18:19 +020035uint32_t dt_get_ddr_size(void);
Yann Gautier3d78a2e2019-02-14 11:01:20 +010036uintptr_t dt_get_ddrctrl_base(void);
37uintptr_t dt_get_ddrphyc_base(void);
38uintptr_t dt_get_pwr_base(void);
Yann Gautier3edc7c32019-05-20 19:17:08 +020039uint32_t dt_get_pwr_vdd_voltage(void);
40uintptr_t dt_get_syscfg_base(void);
Yann Gautier69035a82018-07-05 16:48:16 +020041const char *dt_get_board_model(void);
Yann Gautier9aea69e2018-07-24 17:13:36 +020042
Yann Gautieree8f5422019-02-14 11:13:25 +010043#endif /* STM32MP_DT_H */