1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright 2013-2014 Freescale Semiconductor, Inc.
5 * Register definitions for Freescale QSPI
11 struct fsl_qspi_regs {
55 #define QSPI_IPCR_SEQID_SHIFT 24
56 #define QSPI_IPCR_SEQID_MASK (0xf << QSPI_IPCR_SEQID_SHIFT)
58 #define QSPI_MCR_END_CFD_SHIFT 2
59 #define QSPI_MCR_END_CFD_MASK (3 << QSPI_MCR_END_CFD_SHIFT)
60 #ifdef CONFIG_SYS_FSL_QSPI_AHB
61 /* AHB needs 64bit operation */
62 #define QSPI_MCR_END_CFD_LE (3 << QSPI_MCR_END_CFD_SHIFT)
64 #define QSPI_MCR_END_CFD_LE (1 << QSPI_MCR_END_CFD_SHIFT)
66 #define QSPI_MCR_DDR_EN_SHIFT 7
67 #define QSPI_MCR_DDR_EN_MASK (1 << QSPI_MCR_DDR_EN_SHIFT)
68 #define QSPI_MCR_CLR_RXF_SHIFT 10
69 #define QSPI_MCR_CLR_RXF_MASK (1 << QSPI_MCR_CLR_RXF_SHIFT)
70 #define QSPI_MCR_CLR_TXF_SHIFT 11
71 #define QSPI_MCR_CLR_TXF_MASK (1 << QSPI_MCR_CLR_TXF_SHIFT)
72 #define QSPI_MCR_MDIS_SHIFT 14
73 #define QSPI_MCR_MDIS_MASK (1 << QSPI_MCR_MDIS_SHIFT)
74 #define QSPI_MCR_RESERVED_SHIFT 16
75 #define QSPI_MCR_RESERVED_MASK (0xf << QSPI_MCR_RESERVED_SHIFT)
76 #define QSPI_MCR_SWRSTHD_SHIFT 1
77 #define QSPI_MCR_SWRSTHD_MASK (1 << QSPI_MCR_SWRSTHD_SHIFT)
78 #define QSPI_MCR_SWRSTSD_SHIFT 0
79 #define QSPI_MCR_SWRSTSD_MASK (1 << QSPI_MCR_SWRSTSD_SHIFT)
81 #define QSPI_SMPR_HSENA_SHIFT 0
82 #define QSPI_SMPR_HSENA_MASK (1 << QSPI_SMPR_HSENA_SHIFT)
83 #define QSPI_SMPR_FSPHS_SHIFT 5
84 #define QSPI_SMPR_FSPHS_MASK (1 << QSPI_SMPR_FSPHS_SHIFT)
85 #define QSPI_SMPR_FSDLY_SHIFT 6
86 #define QSPI_SMPR_FSDLY_MASK (1 << QSPI_SMPR_FSDLY_SHIFT)
87 #define QSPI_SMPR_DDRSMP_SHIFT 16
88 #define QSPI_SMPR_DDRSMP_MASK (7 << QSPI_SMPR_DDRSMP_SHIFT)
90 #define QSPI_BUFXCR_INVALID_MSTRID 0xe
91 #define QSPI_BUF3CR_ALLMST_SHIFT 31
92 #define QSPI_BUF3CR_ALLMST_MASK (1 << QSPI_BUF3CR_ALLMST_SHIFT)
93 #define QSPI_BUF3CR_ADATSZ_SHIFT 8
94 #define QSPI_BUF3CR_ADATSZ_MASK (0xFF << QSPI_BUF3CR_ADATSZ_SHIFT)
96 #define QSPI_BFGENCR_SEQID_SHIFT 12
97 #define QSPI_BFGENCR_SEQID_MASK (0xf << QSPI_BFGENCR_SEQID_SHIFT)
98 #define QSPI_BFGENCR_PAR_EN_SHIFT 16
99 #define QSPI_BFGENCR_PAR_EN_MASK (1 << QSPI_BFGENCR_PAR_EN_SHIFT)
101 #define QSPI_RBSR_RDBFL_SHIFT 8
102 #define QSPI_RBSR_RDBFL_MASK (0x3f << QSPI_RBSR_RDBFL_SHIFT)
104 #define QSPI_RBCT_RXBRD_SHIFT 8
105 #define QSPI_RBCT_RXBRD_USEIPS (1 << QSPI_RBCT_RXBRD_SHIFT)
107 #define QSPI_SR_AHB_ACC_SHIFT 2
108 #define QSPI_SR_AHB_ACC_MASK (1 << QSPI_SR_AHB_ACC_SHIFT)
109 #define QSPI_SR_IP_ACC_SHIFT 1
110 #define QSPI_SR_IP_ACC_MASK (1 << QSPI_SR_IP_ACC_SHIFT)
111 #define QSPI_SR_BUSY_SHIFT 0
112 #define QSPI_SR_BUSY_MASK (1 << QSPI_SR_BUSY_SHIFT)
114 #define QSPI_LCKCR_LOCK 0x1
115 #define QSPI_LCKCR_UNLOCK 0x2
117 #define LUT_KEY_VALUE 0x5af05af0
119 #define OPRND0_SHIFT 0
120 #define OPRND0(x) ((x) << OPRND0_SHIFT)
122 #define PAD0(x) ((x) << PAD0_SHIFT)
123 #define INSTR0_SHIFT 10
124 #define INSTR0(x) ((x) << INSTR0_SHIFT)
125 #define OPRND1_SHIFT 16
126 #define OPRND1(x) ((x) << OPRND1_SHIFT)
127 #define PAD1_SHIFT 24
128 #define PAD1(x) ((x) << PAD1_SHIFT)
129 #define INSTR1_SHIFT 26
130 #define INSTR1(x) ((x) << INSTR1_SHIFT)
142 #define ADDR24BIT 0x18
143 #define ADDR32BIT 0x20
145 #endif /* _FSL_QSPI_H_ */