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)
15 /* MMDC PHY Read DQS gating control register 0 (MPDGCTRL0) */
16 #define AUTO_RD_DQS_GATING_CALIBRATION_EN (1 << 28)
18 /* MMDC PHY Read Delay HW Calibration Control Register (MPRDDLHWCTL) */
19 #define MPRDDLHWCTL_AUTO_RD_CALIBRATION_EN (1 << 4)
21 /* MMDC Core Power Saving Control and Status Register (MMDC_MAPSR) */
22 #define MMDC_MAPSR_PWR_SAV_CTRL_STAT 0x00001067
24 /* MMDC Core Refresh Control Register (MMDC_MDREF) */
25 #define MDREF_START_REFRESH (1 << 0)
27 /* MMDC Core Special Command Register (MDSCR) */
28 #define CMD_ADDR_MSB_MR_OP(x) (x << 24)
29 #define CMD_ADDR_LSB_MR_ADDR(x) (x << 16)
30 #define MDSCR_DISABLE_CFG_REQ (0 << 15)
31 #define MDSCR_ENABLE_CON_REQ (1 << 15)
32 #define MDSCR_CON_ACK (1 << 14)
33 #define MDSCR_WL_EN (1 << 9)
34 #define CMD_NORMAL (0 << 4)
35 #define CMD_PRECHARGE (1 << 4)
36 #define CMD_AUTO_REFRESH (2 << 4)
37 #define CMD_LOAD_MODE_REG (3 << 4)
38 #define CMD_ZQ_CALIBRATION (4 << 4)
39 #define CMD_PRECHARGE_BANK_OPEN (5 << 4)
40 #define CMD_MRR (6 << 4)
41 #define CMD_BANK_ADDR_0 0x0
42 #define CMD_BANK_ADDR_1 0x1
43 #define CMD_BANK_ADDR_2 0x2
44 #define CMD_BANK_ADDR_3 0x3
45 #define CMD_BANK_ADDR_4 0x4
46 #define CMD_BANK_ADDR_5 0x5
47 #define CMD_BANK_ADDR_6 0x6
48 #define CMD_BANK_ADDR_7 0x7
50 /* MMDC Core Control Register (MDCTL) */
51 #define MDCTL_SDE0 (1 << 31)
52 #define MDCTL_SDE1 (1 << 30)
54 /* MMDC PHY ZQ HW control register (MMDC_MPZQHWCTRL) */
55 #define MPZQHWCTRL_ZQ_HW_FORCE (1 << 16)
57 /* MMDC PHY Measure Unit Register (MMDC_MPMUR0) */
58 #define MMDC_MPMUR0_FRC_MSR (1 << 11)
60 /* MMDC PHY Read delay-lines Configuration Register (MMDC_MPRDDLCTL) */
61 /* default 64 for a quarter cycle delay */
62 #define MMDC_MPRDDLCTL_DEFAULT_DELAY 0x40404040
151 struct fsl_mmdc_info
{
168 void mmdc_init(const struct fsl_mmdc_info
*);
170 #endif /* FSL_MMDC_H */