blob: e3b4e597eeb98e3b9e9ab6e80ac68e4ef04fd141 [file] [log] [blame]
Yann Gautier9aea69e2018-07-24 17:13:36 +02001/*
Etienne Carriered81dadf2020-04-25 11:14:45 +02002 * Copyright (c) 2020, STMicroelectronics - All Rights Reserved
Yann Gautier038bff22019-01-17 19:17:47 +01003 * Copyright (c) 2017-2019, ARM Limited and Contributors. All rights reserved.
Yann Gautier9aea69e2018-07-24 17:13:36 +02004 *
5 * SPDX-License-Identifier: BSD-3-Clause
6 */
7
Yann Gautieree8f5422019-02-14 11:13:25 +01008#ifndef STM32MP_DT_H
9#define STM32MP_DT_H
Yann Gautier9aea69e2018-07-24 17:13:36 +020010
11#include <stdbool.h>
12
Yann Gautier038bff22019-01-17 19:17:47 +010013#define DT_DISABLED U(0)
14#define DT_NON_SECURE U(1)
15#define DT_SECURE U(2)
16#define DT_SHARED (DT_NON_SECURE | DT_SECURE)
17
Yann Gautier69035a82018-07-05 16:48:16 +020018struct dt_node_info {
19 uint32_t base;
20 int32_t clock;
21 int32_t reset;
Yann Gautier038bff22019-01-17 19:17:47 +010022 uint32_t status;
Yann Gautier69035a82018-07-05 16:48:16 +020023};
24
Yann Gautier9aea69e2018-07-24 17:13:36 +020025/*******************************************************************************
26 * Function and variable prototypes
27 ******************************************************************************/
28int dt_open_and_check(void);
29int fdt_get_address(void **fdt_addr);
30bool fdt_check_node(int node);
Yann Gautieree8f5422019-02-14 11:13:25 +010031uint8_t fdt_get_status(int node);
Yann Gautier69035a82018-07-05 16:48:16 +020032int dt_set_stdout_pinctrl(void);
33void dt_fill_device_info(struct dt_node_info *info, int node);
34int dt_get_node(struct dt_node_info *info, int offset, const char *compat);
35int dt_get_stdout_uart_info(struct dt_node_info *info);
Yann Gautiercaf575b2018-07-24 17:18:19 +020036uint32_t dt_get_ddr_size(void);
Yann Gautier3edc7c32019-05-20 19:17:08 +020037uint32_t dt_get_pwr_vdd_voltage(void);
Yann Gautier69035a82018-07-05 16:48:16 +020038const char *dt_get_board_model(void);
Etienne Carriered81dadf2020-04-25 11:14:45 +020039int fdt_get_gpio_bank_pin_count(unsigned int bank);
Yann Gautier9aea69e2018-07-24 17:13:36 +020040
Yann Gautieree8f5422019-02-14 11:13:25 +010041#endif /* STM32MP_DT_H */