rpl_acp6x.h 980 B

123456789101112131415161718192021222324252627282930313233343536
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * AMD ACP Driver
  4. *
  5. * Copyright (C) 2021 Advanced Micro Devices, Inc. All rights reserved.
  6. */
  7. #include "rpl_acp6x_chip_offset_byte.h"
  8. #define ACP_DEVICE_ID 0x15E2
  9. #define ACP6x_PHY_BASE_ADDRESS 0x1240000
  10. #define ACP_SOFT_RESET_SOFTRESET_AUDDONE_MASK 0x00010001
  11. #define ACP_PGFSM_CNTL_POWER_ON_MASK 1
  12. #define ACP_PGFSM_CNTL_POWER_OFF_MASK 0
  13. #define ACP_PGFSM_STATUS_MASK 3
  14. #define ACP_POWERED_ON 0
  15. #define ACP_POWER_ON_IN_PROGRESS 1
  16. #define ACP_POWERED_OFF 2
  17. #define ACP_POWER_OFF_IN_PROGRESS 3
  18. #define DELAY_US 5
  19. #define ACP_COUNTER 20000
  20. /* time in ms for runtime suspend delay */
  21. #define ACP_SUSPEND_DELAY_MS 2000
  22. static inline u32 rpl_acp_readl(void __iomem *base_addr)
  23. {
  24. return readl(base_addr - ACP6x_PHY_BASE_ADDRESS);
  25. }
  26. static inline void rpl_acp_writel(u32 val, void __iomem *base_addr)
  27. {
  28. writel(val, base_addr - ACP6x_PHY_BASE_ADDRESS);
  29. }