1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright 2016 Freescale Semiconductor, Inc.
9 /* PHY Write Leveling Configuration and Error Status Register (MPWLGCR) */
10 #define MPWLGCR_HW_WL_EN (1 << 0)
12 /* PHY Pre-defined Compare and CA delay-line Configuration (MPPDCMPR2) */
13 #define MPPDCMPR2_MPR_COMPARE_EN (1 << 0)
16 /* MMDC PHY Read DQS gating control register 0 (MPDGCTRL0) */
17 #define AUTO_RD_DQS_GATING_CALIBRATION_EN (1 << 28)
19 /* MMDC PHY Read Delay HW Calibration Control Register (MPRDDLHWCTL) */
20 #define MPRDDLHWCTL_AUTO_RD_CALIBRATION_EN (1 << 4)
22 /* MMDC Core Power Saving Control and Status Register (MMDC_MAPSR) */
23 #define MMDC_MAPSR_PWR_SAV_CTRL_STAT 0x00001067
25 /* MMDC Core Refresh Control Register (MMDC_MDREF) */
26 #define MDREF_START_REFRESH (1 << 0)
28 /* MMDC Core Special Command Register (MDSCR) */
29 #define CMD_ADDR_MSB_MR_OP(x) (x << 24)
30 #define CMD_ADDR_LSB_MR_ADDR(x) (x << 16)
31 #define MDSCR_DISABLE_CFG_REQ (0 << 15)
32 #define MDSCR_ENABLE_CON_REQ (1 << 15)
33 #define MDSCR_CON_ACK (1 << 14)
34 #define MDSCR_WL_EN (1 << 9)
35 #define CMD_NORMAL (0 << 4)
36 #define CMD_PRECHARGE (1 << 4)
37 #define CMD_AUTO_REFRESH (2 << 4)
38 #define CMD_LOAD_MODE_REG (3 << 4)
39 #define CMD_ZQ_CALIBRATION (4 << 4)
40 #define CMD_PRECHARGE_BANK_OPEN (5 << 4)
41 #define CMD_MRR (6 << 4)
42 #define CMD_BANK_ADDR_0 0x0
43 #define CMD_BANK_ADDR_1 0x1
44 #define CMD_BANK_ADDR_2 0x2
45 #define CMD_BANK_ADDR_3 0x3
46 #define CMD_BANK_ADDR_4 0x4
47 #define CMD_BANK_ADDR_5 0x5
48 #define CMD_BANK_ADDR_6 0x6
49 #define CMD_BANK_ADDR_7 0x7
51 /* MMDC Core Control Register (MDCTL) */
52 #define MDCTL_SDE0 (1 << 31)
53 #define MDCTL_SDE1 (1 << 30)
55 /* MMDC PHY ZQ HW control register (MMDC_MPZQHWCTRL) */
56 #define MPZQHWCTRL_ZQ_HW_FORCE (1 << 16)
58 /* MMDC PHY Measure Unit Register (MMDC_MPMUR0) */
59 #define MMDC_MPMUR0_FRC_MSR (1 << 11)
61 /* MMDC PHY Read delay-lines Configuration Register (MMDC_MPRDDLCTL) */
62 /* default 64 for a quarter cycle delay */
63 #define MMDC_MPRDDLCTL_DEFAULT_DELAY 0x40404040
152 struct fsl_mmdc_info {
169 void mmdc_init(const struct fsl_mmdc_info *);
171 #endif /* FSL_MMDC_H */