Yann Gautier | 9aea69e | 2018-07-24 17:13:36 +0200 | [diff] [blame] | 1 | /* |
Yann Gautier | 038bff2 | 2019-01-17 19:17:47 +0100 | [diff] [blame] | 2 | * Copyright (c) 2017-2019, ARM Limited and Contributors. All rights reserved. |
Yann Gautier | 9aea69e | 2018-07-24 17:13:36 +0200 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
Antonio Nino Diaz | 5eb8837 | 2018-11-08 10:20:19 +0000 | [diff] [blame] | 7 | #ifndef STM32MP1_DT_H |
| 8 | #define STM32MP1_DT_H |
Yann Gautier | 9aea69e | 2018-07-24 17:13:36 +0200 | [diff] [blame] | 9 | |
| 10 | #include <stdbool.h> |
| 11 | |
Yann Gautier | 038bff2 | 2019-01-17 19:17:47 +0100 | [diff] [blame] | 12 | #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 Gautier | 69035a8 | 2018-07-05 16:48:16 +0200 | [diff] [blame] | 17 | struct dt_node_info { |
| 18 | uint32_t base; |
| 19 | int32_t clock; |
| 20 | int32_t reset; |
Yann Gautier | 038bff2 | 2019-01-17 19:17:47 +0100 | [diff] [blame] | 21 | uint32_t status; |
Yann Gautier | 69035a8 | 2018-07-05 16:48:16 +0200 | [diff] [blame] | 22 | }; |
| 23 | |
Yann Gautier | 9aea69e | 2018-07-24 17:13:36 +0200 | [diff] [blame] | 24 | /******************************************************************************* |
| 25 | * Function and variable prototypes |
| 26 | ******************************************************************************/ |
| 27 | int dt_open_and_check(void); |
| 28 | int fdt_get_address(void **fdt_addr); |
| 29 | bool fdt_check_node(int node); |
Yann Gautier | 038bff2 | 2019-01-17 19:17:47 +0100 | [diff] [blame] | 30 | uint32_t fdt_get_status(int node); |
Yann Gautier | 9aea69e | 2018-07-24 17:13:36 +0200 | [diff] [blame] | 31 | uint32_t fdt_read_uint32_default(int node, const char *prop_name, |
| 32 | uint32_t dflt_value); |
| 33 | int fdt_read_uint32_array(int node, const char *prop_name, |
| 34 | uint32_t *array, uint32_t count); |
Yann Gautier | 69035a8 | 2018-07-05 16:48:16 +0200 | [diff] [blame] | 35 | int dt_set_stdout_pinctrl(void); |
| 36 | void dt_fill_device_info(struct dt_node_info *info, int node); |
| 37 | int dt_get_node(struct dt_node_info *info, int offset, const char *compat); |
| 38 | int dt_get_stdout_uart_info(struct dt_node_info *info); |
| 39 | int dt_get_stdout_node_offset(void); |
Yann Gautier | caf575b | 2018-07-24 17:18:19 +0200 | [diff] [blame] | 40 | uint32_t dt_get_ddr_size(void); |
Yann Gautier | 69035a8 | 2018-07-05 16:48:16 +0200 | [diff] [blame] | 41 | const char *dt_get_board_model(void); |
Yann Gautier | 9aea69e | 2018-07-24 17:13:36 +0200 | [diff] [blame] | 42 | |
Antonio Nino Diaz | 5eb8837 | 2018-11-08 10:20:19 +0000 | [diff] [blame] | 43 | #endif /* STM32MP1_DT_H */ |