fdt_reset.h 869 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * SPDX-License-Identifier: BSD-2-Clause
  3. *
  4. * Copyright (c) 2020 Western Digital Corporation or its affiliates.
  5. *
  6. * Authors:
  7. * Anup Patel <anup.patel@wdc.com>
  8. */
  9. #ifndef __FDT_RESET_H__
  10. #define __FDT_RESET_H__
  11. #include <sbi/sbi_types.h>
  12. struct fdt_reset {
  13. const struct fdt_match *match_table;
  14. int (*init)(void *fdt, int nodeoff, const struct fdt_match *match);
  15. };
  16. #ifdef CONFIG_FDT_RESET
  17. /**
  18. * fdt_reset_driver_init() - initialize reset driver based on the device-tree
  19. */
  20. int fdt_reset_driver_init(void *fdt, struct fdt_reset *drv);
  21. /**
  22. * fdt_reset_init() - initialize reset drivers based on the device-tree
  23. *
  24. * This function shall be invoked in final init.
  25. */
  26. void fdt_reset_init(void);
  27. #else
  28. static inline int fdt_reset_driver_init(void *fdt, struct fdt_reset *drv)
  29. {
  30. return 0;
  31. }
  32. static inline void fdt_reset_init(void) { }
  33. #endif
  34. #endif