blob: d5640c1fd5607c229dd397d26882c83d1f9f2bb3 [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
Antonio Nino Diaz5eb88372018-11-08 10:20:19 +00007#ifndef STM32MP1_DT_H
8#define STM32MP1_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 Gautier038bff22019-01-17 19:17:47 +010030uint32_t fdt_get_status(int node);
Yann Gautier9aea69e2018-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 Gautier69035a82018-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 Gautiercaf575b2018-07-24 17:18:19 +020040uint32_t dt_get_ddr_size(void);
Yann Gautier69035a82018-07-05 16:48:16 +020041const char *dt_get_board_model(void);
Yann Gautier9aea69e2018-07-24 17:13:36 +020042
Antonio Nino Diaz5eb88372018-11-08 10:20:19 +000043#endif /* STM32MP1_DT_H */