Yann Gautier | 9aea69e | 2018-07-24 17:13:36 +0200 | [diff] [blame] | 1 | /* |
| 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 Gautier | 69035a8 | 2018-07-05 16:48:16 +0200 | [diff] [blame] | 12 | struct 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 Gautier | 9aea69e | 2018-07-24 17:13:36 +0200 | [diff] [blame] | 20 | /******************************************************************************* |
| 21 | * Function and variable prototypes |
| 22 | ******************************************************************************/ |
| 23 | int dt_open_and_check(void); |
| 24 | int fdt_get_address(void **fdt_addr); |
| 25 | bool fdt_check_node(int node); |
| 26 | bool fdt_check_status(int node); |
| 27 | bool fdt_check_secure_status(int node); |
| 28 | uint32_t fdt_read_uint32_default(int node, const char *prop_name, |
| 29 | uint32_t dflt_value); |
| 30 | int fdt_read_uint32_array(int node, const char *prop_name, |
| 31 | uint32_t *array, uint32_t count); |
Yann Gautier | d0ca7f4 | 2018-07-13 21:33:09 +0200 | [diff] [blame] | 32 | int dt_set_pinctrl_config(int node); |
Yann Gautier | 69035a8 | 2018-07-05 16:48:16 +0200 | [diff] [blame] | 33 | int dt_set_stdout_pinctrl(void); |
| 34 | void dt_fill_device_info(struct dt_node_info *info, int node); |
| 35 | int dt_get_node(struct dt_node_info *info, int offset, const char *compat); |
| 36 | int dt_get_stdout_uart_info(struct dt_node_info *info); |
| 37 | int dt_get_stdout_node_offset(void); |
Yann Gautier | caf575b | 2018-07-24 17:18:19 +0200 | [diff] [blame] | 38 | uint32_t dt_get_ddr_size(void); |
Yann Gautier | 69035a8 | 2018-07-05 16:48:16 +0200 | [diff] [blame] | 39 | const char *dt_get_board_model(void); |
Yann Gautier | 9aea69e | 2018-07-24 17:13:36 +0200 | [diff] [blame] | 40 | |
| 41 | #endif /* __STM32MP1_DT_H__ */ |