rz-sysc.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Renesas RZ System Controller
  4. *
  5. * Copyright (C) 2024 Renesas Electronics Corp.
  6. */
  7. #ifndef __SOC_RENESAS_RZ_SYSC_H__
  8. #define __SOC_RENESAS_RZ_SYSC_H__
  9. #include <linux/device.h>
  10. #include <linux/sys_soc.h>
  11. #include <linux/types.h>
  12. /**
  13. * struct rz_syc_soc_id_init_data - RZ SYSC SoC identification initialization data
  14. * @family: RZ SoC family
  15. * @id: RZ SoC expected ID
  16. * @devid_offset: SYSC SoC ID register offset
  17. * @revision_mask: SYSC SoC ID revision mask
  18. * @specific_id_mask: SYSC SoC ID specific ID mask
  19. * @print_id: print SoC-specific extended device identification
  20. */
  21. struct rz_sysc_soc_id_init_data {
  22. const char * const family;
  23. u32 id;
  24. u32 devid_offset;
  25. u32 revision_mask;
  26. u32 specific_id_mask;
  27. void (*print_id)(struct device *dev, void __iomem *sysc_base,
  28. struct soc_device_attribute *soc_dev_attr);
  29. };
  30. /**
  31. * struct rz_sysc_init_data - RZ SYSC initialization data
  32. * @soc_id_init_data: RZ SYSC SoC ID initialization data
  33. * @writeable_reg: Regmap writeable register check function
  34. * @readable_reg: Regmap readable register check function
  35. * @max_register: Maximum SYSC register offset to be used by the regmap config
  36. */
  37. struct rz_sysc_init_data {
  38. const struct rz_sysc_soc_id_init_data *soc_id_init_data;
  39. bool (*writeable_reg)(struct device *dev, unsigned int reg);
  40. bool (*readable_reg)(struct device *dev, unsigned int reg);
  41. u32 max_register;
  42. };
  43. extern const struct rz_sysc_init_data rzg3e_sys_init_data;
  44. extern const struct rz_sysc_init_data rzg3s_sysc_init_data;
  45. extern const struct rz_sysc_init_data rzv2h_sys_init_data;
  46. extern const struct rz_sysc_init_data rzv2n_sys_init_data;
  47. #endif /* __SOC_RENESAS_RZ_SYSC_H__ */