blob: 56357dbff12c19fa170bbcb6f0094ac7b54cc32f [file] [log] [blame]
Yann Gautier7839a052018-07-24 17:13:36 +02001/*
Yann Gautier1fc21302019-01-17 19:17:47 +01002 * Copyright (c) 2017-2019, ARM Limited and Contributors. All rights reserved.
Yann Gautier7839a052018-07-24 17:13:36 +02003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
Yann Gautierc9d75b32019-02-14 11:13:25 +01007#ifndef STM32MP_DT_H
8#define STM32MP_DT_H
Yann Gautier7839a052018-07-24 17:13:36 +02009
10#include <stdbool.h>
11
Yann Gautier1fc21302019-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 Gautier278c34d2018-07-05 16:48:16 +020017struct dt_node_info {
18 uint32_t base;
19 int32_t clock;
20 int32_t reset;
Yann Gautier1fc21302019-01-17 19:17:47 +010021 uint32_t status;
Yann Gautier278c34d2018-07-05 16:48:16 +020022};
23
Yann Gautier7839a052018-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 Gautierc9d75b32019-02-14 11:13:25 +010030uint8_t fdt_get_status(int node);
Yann Gautier7839a052018-07-24 17:13:36 +020031uint32_t fdt_read_uint32_default(int node, const char *prop_name,
32 uint32_t dflt_value);
33int fdt_read_uint32_array(int node, const char *prop_name,
34 uint32_t *array, uint32_t count);
Yann Gautier278c34d2018-07-05 16:48:16 +020035int dt_set_stdout_pinctrl(void);
36void dt_fill_device_info(struct dt_node_info *info, int node);
37int dt_get_node(struct dt_node_info *info, int offset, const char *compat);
38int dt_get_stdout_uart_info(struct dt_node_info *info);
39int dt_get_stdout_node_offset(void);
Yann Gautier10a511c2018-07-24 17:18:19 +020040uint32_t dt_get_ddr_size(void);
Yann Gautier278c34d2018-07-05 16:48:16 +020041const char *dt_get_board_model(void);
Yann Gautier7839a052018-07-24 17:13:36 +020042
Yann Gautierc9d75b32019-02-14 11:13:25 +010043#endif /* STM32MP_DT_H */