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