blob: 58e10d19adf2017418692c6d9a6a55e6b42f8c04 [file] [log] [blame]
Yann Gautier9aea69e2018-07-24 17:13:36 +02001/*
2 * Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef __STM32MP1_DT_H__
8#define __STM32MP1_DT_H__
9
10#include <stdbool.h>
11
Yann Gautier69035a82018-07-05 16:48:16 +020012struct dt_node_info {
13 uint32_t base;
14 int32_t clock;
15 int32_t reset;
16 bool status;
17 bool sec_status;
18};
19
Yann Gautier9aea69e2018-07-24 17:13:36 +020020/*******************************************************************************
21 * Function and variable prototypes
22 ******************************************************************************/
23int dt_open_and_check(void);
24int fdt_get_address(void **fdt_addr);
25bool fdt_check_node(int node);
26bool fdt_check_status(int node);
27bool fdt_check_secure_status(int node);
28uint32_t fdt_read_uint32_default(int node, const char *prop_name,
29 uint32_t dflt_value);
30int fdt_read_uint32_array(int node, const char *prop_name,
31 uint32_t *array, uint32_t count);
Yann Gautierd0ca7f42018-07-13 21:33:09 +020032int dt_set_pinctrl_config(int node);
Yann Gautier69035a82018-07-05 16:48:16 +020033int dt_set_stdout_pinctrl(void);
34void dt_fill_device_info(struct dt_node_info *info, int node);
35int dt_get_node(struct dt_node_info *info, int offset, const char *compat);
36int dt_get_stdout_uart_info(struct dt_node_info *info);
37int dt_get_stdout_node_offset(void);
Yann Gautiercaf575b2018-07-24 17:18:19 +020038uint32_t dt_get_ddr_size(void);
Yann Gautier69035a82018-07-05 16:48:16 +020039const char *dt_get_board_model(void);
Yann Gautier9aea69e2018-07-24 17:13:36 +020040
41#endif /* __STM32MP1_DT_H__ */