stm32mp_dt.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * Copyright (c) 2020-2023, STMicroelectronics - All Rights Reserved
  3. * Copyright (c) 2017-2023, Arm Limited and Contributors. All rights reserved.
  4. *
  5. * SPDX-License-Identifier: BSD-3-Clause
  6. */
  7. #ifndef STM32MP_DT_H
  8. #define STM32MP_DT_H
  9. #include <stdbool.h>
  10. #include <stdint.h>
  11. #define DT_DISABLED U(0)
  12. #define DT_NON_SECURE U(1)
  13. #define DT_SECURE U(2)
  14. #define DT_SHARED (DT_NON_SECURE | DT_SECURE)
  15. struct dt_node_info {
  16. uint32_t base;
  17. int32_t clock;
  18. int32_t reset;
  19. uint32_t status;
  20. };
  21. /*******************************************************************************
  22. * Function and variable prototypes
  23. ******************************************************************************/
  24. int dt_open_and_check(uintptr_t dt_addr);
  25. int fdt_get_address(void **fdt_addr);
  26. bool fdt_check_node(int node);
  27. uint8_t fdt_get_status(int node);
  28. int dt_set_stdout_pinctrl(void);
  29. void dt_fill_device_info(struct dt_node_info *info, int node);
  30. int dt_get_node(struct dt_node_info *info, int offset, const char *compat);
  31. int dt_get_stdout_uart_info(struct dt_node_info *info);
  32. int dt_match_instance_by_compatible(const char *compatible, uintptr_t address);
  33. size_t dt_get_ddr_size(void);
  34. uint32_t dt_get_pwr_vdd_voltage(void);
  35. struct rdev *dt_get_vdd_regulator(void);
  36. struct rdev *dt_get_cpu_regulator(void);
  37. const char *dt_get_board_model(void);
  38. int dt_find_otp_name(const char *name, uint32_t *otp, uint32_t *otp_len);
  39. int fdt_get_gpio_bank_pin_count(unsigned int bank);
  40. #endif /* STM32MP_DT_H */