dw_mmc-exynos.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * Exynos Specific Extensions for Synopsys DW Multimedia Card Interface driver
  4. *
  5. * Copyright (C) 2012-2014 Samsung Electronics Co., Ltd.
  6. */
  7. #ifndef _DW_MMC_EXYNOS_H_
  8. #define _DW_MMC_EXYNOS_H_
  9. #define SDMMC_CLKSEL 0x09C
  10. #define SDMMC_CLKSEL64 0x0A8
  11. /* Extended Register's Offset */
  12. #define SDMMC_HS400_DQS_EN 0x180
  13. #define SDMMC_HS400_ASYNC_FIFO_CTRL 0x184
  14. #define SDMMC_HS400_DLINE_CTRL 0x188
  15. /* CLKSEL register defines */
  16. #define SDMMC_CLKSEL_CCLK_SAMPLE(x) (((x) & 7) << 0)
  17. #define SDMMC_CLKSEL_CCLK_DRIVE(x) (((x) & 7) << 16)
  18. #define SDMMC_CLKSEL_CCLK_DIVIDER(x) (((x) & 7) << 24)
  19. #define SDMMC_CLKSEL_GET_DRV_WD3(x) (((x) >> 16) & 0x7)
  20. #define SDMMC_CLKSEL_GET_DIV(x) (((x) >> 24) & 0x7)
  21. #define SDMMC_CLKSEL_UP_SAMPLE(x, y) (((x) & ~SDMMC_CLKSEL_CCLK_SAMPLE(7)) |\
  22. SDMMC_CLKSEL_CCLK_SAMPLE(y))
  23. #define SDMMC_CLKSEL_TIMING(x, y, z) (SDMMC_CLKSEL_CCLK_SAMPLE(x) | \
  24. SDMMC_CLKSEL_CCLK_DRIVE(y) | \
  25. SDMMC_CLKSEL_CCLK_DIVIDER(z))
  26. #define SDMMC_CLKSEL_TIMING_MASK SDMMC_CLKSEL_TIMING(0x7, 0x7, 0x7)
  27. #define SDMMC_CLKSEL_WAKEUP_INT BIT(11)
  28. /* RCLK_EN register defines */
  29. #define DATA_STROBE_EN BIT(0)
  30. #define AXI_NON_BLOCKING_WR BIT(7)
  31. /* DLINE_CTRL register defines */
  32. #define DQS_CTRL_RD_DELAY(x, y) (((x) & ~0x3FF) | ((y) & 0x3FF))
  33. #define DQS_CTRL_GET_RD_DELAY(x) ((x) & 0x3FF)
  34. /* Protector Register */
  35. #define SDMMC_EMMCP_BASE 0x1000
  36. #define SDMMC_MPSECURITY (SDMMC_EMMCP_BASE + 0x0010)
  37. #define SDMMC_MPSBEGIN0 (SDMMC_EMMCP_BASE + 0x0200)
  38. #define SDMMC_MPSEND0 (SDMMC_EMMCP_BASE + 0x0204)
  39. #define SDMMC_MPSCTRL0 (SDMMC_EMMCP_BASE + 0x020C)
  40. /* SMU control defines */
  41. #define SDMMC_MPSCTRL_SECURE_READ_BIT BIT(7)
  42. #define SDMMC_MPSCTRL_SECURE_WRITE_BIT BIT(6)
  43. #define SDMMC_MPSCTRL_NON_SECURE_READ_BIT BIT(5)
  44. #define SDMMC_MPSCTRL_NON_SECURE_WRITE_BIT BIT(4)
  45. #define SDMMC_MPSCTRL_USE_FUSE_KEY BIT(3)
  46. #define SDMMC_MPSCTRL_ECB_MODE BIT(2)
  47. #define SDMMC_MPSCTRL_ENCRYPTION BIT(1)
  48. #define SDMMC_MPSCTRL_VALID BIT(0)
  49. /* Maximum number of Ending sector */
  50. #define SDMMC_ENDING_SEC_NR_MAX 0xFFFFFFFF
  51. /* Fixed clock divider */
  52. #define EXYNOS4210_FIXED_CIU_CLK_DIV 2
  53. #define EXYNOS4412_FIXED_CIU_CLK_DIV 4
  54. #define HS400_FIXED_CIU_CLK_DIV 1
  55. /* Minimal required clock frequency for cclkin, unit: HZ */
  56. #define EXYNOS_CCLKIN_MIN 50000000
  57. #endif /* _DW_MMC_EXYNOS_H_ */