pmic_wrap_init.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * Copyright (c) 2021-2022, MediaTek Inc. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef PMIC_WRAP_INIT_H
  7. #define PMIC_WRAP_INIT_H
  8. #include <stdint.h>
  9. #include "platform_def.h"
  10. #include <pmic_wrap_init_common.h>
  11. static struct mt8186_pmic_wrap_regs *const mtk_pwrap = (void *)PMIC_WRAP_BASE;
  12. /* timeout setting */
  13. enum {
  14. TIMEOUT_RESET = 50, /* us */
  15. TIMEOUT_READ = 50, /* us */
  16. TIMEOUT_WAIT_IDLE = 50 /* us */
  17. };
  18. /* PMIC_WRAP registers */
  19. struct mt8186_pmic_wrap_regs {
  20. uint32_t unused[776];
  21. uint32_t wacs2_cmd;
  22. uint32_t wacs2_rdata;
  23. uint32_t wacs2_vldclr;
  24. };
  25. enum {
  26. RDATA_WACS_RDATA_SHIFT = 0,
  27. RDATA_WACS_FSM_SHIFT = 16,
  28. RDATA_WACS_REQ_SHIFT = 19,
  29. RDATA_SYNC_IDLE_SHIFT = 20,
  30. RDATA_INIT_DONE_SHIFT = 22,
  31. RDATA_SYS_IDLE_SHIFT = 23,
  32. };
  33. enum {
  34. RDATA_WACS_RDATA_MASK = 0xffff,
  35. RDATA_WACS_FSM_MASK = 0x7,
  36. RDATA_WACS_REQ_MASK = 0x1,
  37. RDATA_SYNC_IDLE_MASK = 0x1,
  38. RDATA_INIT_DONE_MASK = 0x1,
  39. RDATA_SYS_IDLE_MASK = 0x1,
  40. };
  41. /* WACS_FSM */
  42. enum {
  43. WACS_FSM_IDLE = 0x00,
  44. WACS_FSM_REQ = 0x02,
  45. WACS_FSM_WFDLE = 0x04,
  46. WACS_FSM_WFVLDCLR = 0x06,
  47. WACS_INIT_DONE = 0x01,
  48. WACS_SYNC_IDLE = 0x01,
  49. WACS_SYNC_BUSY = 0x00
  50. };
  51. #endif /* PMIC_WRAP_INIT_H */