tegra-cbb.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (c) 2021-2022, NVIDIA CORPORATION. All rights reserved
  4. */
  5. #ifndef TEGRA_CBB_H
  6. #define TEGRA_CBB_H
  7. #include <linux/list.h>
  8. struct tegra_cbb_error {
  9. const char *code;
  10. const char *source;
  11. const char *desc;
  12. };
  13. struct tegra_cbb {
  14. struct device *dev;
  15. const struct tegra_cbb_ops *ops;
  16. struct list_head node;
  17. };
  18. struct tegra_cbb_ops {
  19. int (*debugfs_show)(struct tegra_cbb *cbb, struct seq_file *s, void *v);
  20. int (*interrupt_enable)(struct tegra_cbb *cbb);
  21. void (*error_enable)(struct tegra_cbb *cbb);
  22. void (*fault_enable)(struct tegra_cbb *cbb);
  23. void (*stall_enable)(struct tegra_cbb *cbb);
  24. void (*error_clear)(struct tegra_cbb *cbb);
  25. u32 (*get_status)(struct tegra_cbb *cbb);
  26. };
  27. int tegra_cbb_get_irq(struct platform_device *pdev, unsigned int *nonsec_irq,
  28. unsigned int *sec_irq);
  29. __printf(2, 3)
  30. void tegra_cbb_print_err(struct seq_file *file, const char *fmt, ...);
  31. void tegra_cbb_print_cache(struct seq_file *file, u32 cache);
  32. void tegra_cbb_print_prot(struct seq_file *file, u32 prot);
  33. int tegra_cbb_register(struct tegra_cbb *cbb);
  34. void tegra_cbb_fault_enable(struct tegra_cbb *cbb);
  35. void tegra_cbb_stall_enable(struct tegra_cbb *cbb);
  36. void tegra_cbb_error_clear(struct tegra_cbb *cbb);
  37. u32 tegra_cbb_get_status(struct tegra_cbb *cbb);
  38. #endif /* TEGRA_CBB_H */