xref: /openbmc/u-boot/arch/arm/include/asm/arch-mxs/regs-ssp.h (revision 83d290c56fab2d38cd1ab4c4cc7099559c1d5046)
1*83d290c5STom Rini /* SPDX-License-Identifier: GPL-2.0+ */
23a0398d7SOtavio Salvador /*
33a0398d7SOtavio Salvador  * Freescale i.MX28 SSP Register Definitions
43a0398d7SOtavio Salvador  *
53a0398d7SOtavio Salvador  * Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com>
63a0398d7SOtavio Salvador  *
73a0398d7SOtavio Salvador  * Based on code from LTIB:
83a0398d7SOtavio Salvador  * Copyright 2008-2010 Freescale Semiconductor, Inc. All Rights Reserved.
93a0398d7SOtavio Salvador  */
103a0398d7SOtavio Salvador 
113a0398d7SOtavio Salvador #ifndef __MX28_REGS_SSP_H__
123a0398d7SOtavio Salvador #define __MX28_REGS_SSP_H__
133a0398d7SOtavio Salvador 
14552a848eSStefano Babic #include <asm/mach-imx/regs-common.h>
153a0398d7SOtavio Salvador 
163a0398d7SOtavio Salvador #ifndef	__ASSEMBLY__
17f3801e2bSMarek Vasut #if defined(CONFIG_MX23)
18f3801e2bSMarek Vasut struct mxs_ssp_regs {
19f3801e2bSMarek Vasut 	mxs_reg_32(hw_ssp_ctrl0)
20f3801e2bSMarek Vasut 	mxs_reg_32(hw_ssp_cmd0)
21f3801e2bSMarek Vasut 	mxs_reg_32(hw_ssp_cmd1)
22f3801e2bSMarek Vasut 	mxs_reg_32(hw_ssp_compref)
23f3801e2bSMarek Vasut 	mxs_reg_32(hw_ssp_compmask)
24f3801e2bSMarek Vasut 	mxs_reg_32(hw_ssp_timing)
25f3801e2bSMarek Vasut 	mxs_reg_32(hw_ssp_ctrl1)
26f3801e2bSMarek Vasut 	mxs_reg_32(hw_ssp_data)
27f3801e2bSMarek Vasut 	mxs_reg_32(hw_ssp_sdresp0)
28f3801e2bSMarek Vasut 	mxs_reg_32(hw_ssp_sdresp1)
29f3801e2bSMarek Vasut 	mxs_reg_32(hw_ssp_sdresp2)
30f3801e2bSMarek Vasut 	mxs_reg_32(hw_ssp_sdresp3)
31f3801e2bSMarek Vasut 	mxs_reg_32(hw_ssp_status)
32f3801e2bSMarek Vasut 
33f3801e2bSMarek Vasut 	uint32_t	reserved1[12];
34f3801e2bSMarek Vasut 
35f3801e2bSMarek Vasut 	mxs_reg_32(hw_ssp_debug)
36f3801e2bSMarek Vasut 	mxs_reg_32(hw_ssp_version)
37f3801e2bSMarek Vasut };
38f3801e2bSMarek Vasut #elif defined(CONFIG_MX28)
399c471142SOtavio Salvador struct mxs_ssp_regs {
40ddcf13b1SOtavio Salvador 	mxs_reg_32(hw_ssp_ctrl0)
41ddcf13b1SOtavio Salvador 	mxs_reg_32(hw_ssp_cmd0)
42ddcf13b1SOtavio Salvador 	mxs_reg_32(hw_ssp_cmd1)
43ddcf13b1SOtavio Salvador 	mxs_reg_32(hw_ssp_xfer_size)
44ddcf13b1SOtavio Salvador 	mxs_reg_32(hw_ssp_block_size)
45ddcf13b1SOtavio Salvador 	mxs_reg_32(hw_ssp_compref)
46ddcf13b1SOtavio Salvador 	mxs_reg_32(hw_ssp_compmask)
47ddcf13b1SOtavio Salvador 	mxs_reg_32(hw_ssp_timing)
48ddcf13b1SOtavio Salvador 	mxs_reg_32(hw_ssp_ctrl1)
49ddcf13b1SOtavio Salvador 	mxs_reg_32(hw_ssp_data)
50ddcf13b1SOtavio Salvador 	mxs_reg_32(hw_ssp_sdresp0)
51ddcf13b1SOtavio Salvador 	mxs_reg_32(hw_ssp_sdresp1)
52ddcf13b1SOtavio Salvador 	mxs_reg_32(hw_ssp_sdresp2)
53ddcf13b1SOtavio Salvador 	mxs_reg_32(hw_ssp_sdresp3)
54ddcf13b1SOtavio Salvador 	mxs_reg_32(hw_ssp_ddr_ctrl)
55ddcf13b1SOtavio Salvador 	mxs_reg_32(hw_ssp_dll_ctrl)
56ddcf13b1SOtavio Salvador 	mxs_reg_32(hw_ssp_status)
57ddcf13b1SOtavio Salvador 	mxs_reg_32(hw_ssp_dll_sts)
58ddcf13b1SOtavio Salvador 	mxs_reg_32(hw_ssp_debug)
59ddcf13b1SOtavio Salvador 	mxs_reg_32(hw_ssp_version)
603a0398d7SOtavio Salvador };
61f3801e2bSMarek Vasut #endif
6214e26bcfSMarek Vasut 
mxs_ssp_bus_id_valid(int bus)633430e0bdSMarek Vasut static inline int mxs_ssp_bus_id_valid(int bus)
643430e0bdSMarek Vasut {
653430e0bdSMarek Vasut #if defined(CONFIG_MX23)
663430e0bdSMarek Vasut 	const unsigned int mxs_ssp_chan_count = 2;
673430e0bdSMarek Vasut #elif defined(CONFIG_MX28)
683430e0bdSMarek Vasut 	const unsigned int mxs_ssp_chan_count = 4;
693430e0bdSMarek Vasut #endif
703430e0bdSMarek Vasut 
713430e0bdSMarek Vasut 	if (bus >= mxs_ssp_chan_count)
723430e0bdSMarek Vasut 		return 0;
733430e0bdSMarek Vasut 
743430e0bdSMarek Vasut 	if (bus < 0)
753430e0bdSMarek Vasut 		return 0;
763430e0bdSMarek Vasut 
773430e0bdSMarek Vasut 	return 1;
783430e0bdSMarek Vasut }
793430e0bdSMarek Vasut 
mxs_ssp_clock_by_bus(unsigned int clock)803430e0bdSMarek Vasut static inline int mxs_ssp_clock_by_bus(unsigned int clock)
813430e0bdSMarek Vasut {
823430e0bdSMarek Vasut #if defined(CONFIG_MX23)
833430e0bdSMarek Vasut 	return 0;
843430e0bdSMarek Vasut #elif defined(CONFIG_MX28)
853430e0bdSMarek Vasut 	return clock;
863430e0bdSMarek Vasut #endif
873430e0bdSMarek Vasut }
883430e0bdSMarek Vasut 
mxs_ssp_regs_by_bus(unsigned int port)8914e26bcfSMarek Vasut static inline struct mxs_ssp_regs *mxs_ssp_regs_by_bus(unsigned int port)
9014e26bcfSMarek Vasut {
9114e26bcfSMarek Vasut 	switch (port) {
9214e26bcfSMarek Vasut 	case 0:
9314e26bcfSMarek Vasut 		return (struct mxs_ssp_regs *)MXS_SSP0_BASE;
9414e26bcfSMarek Vasut 	case 1:
9514e26bcfSMarek Vasut 		return (struct mxs_ssp_regs *)MXS_SSP1_BASE;
9695e873d6SMarek Vasut #ifdef CONFIG_MX28
9714e26bcfSMarek Vasut 	case 2:
9814e26bcfSMarek Vasut 		return (struct mxs_ssp_regs *)MXS_SSP2_BASE;
9914e26bcfSMarek Vasut 	case 3:
10014e26bcfSMarek Vasut 		return (struct mxs_ssp_regs *)MXS_SSP3_BASE;
10195e873d6SMarek Vasut #endif
10214e26bcfSMarek Vasut 	default:
10314e26bcfSMarek Vasut 		return NULL;
10414e26bcfSMarek Vasut 	}
10514e26bcfSMarek Vasut }
1063a0398d7SOtavio Salvador #endif
1073a0398d7SOtavio Salvador 
1083a0398d7SOtavio Salvador #define	SSP_CTRL0_SFTRST			(1 << 31)
1093a0398d7SOtavio Salvador #define	SSP_CTRL0_CLKGATE			(1 << 30)
1103a0398d7SOtavio Salvador #define	SSP_CTRL0_RUN				(1 << 29)
1113a0398d7SOtavio Salvador #define	SSP_CTRL0_SDIO_IRQ_CHECK		(1 << 28)
1123a0398d7SOtavio Salvador #define	SSP_CTRL0_LOCK_CS			(1 << 27)
1133a0398d7SOtavio Salvador #define	SSP_CTRL0_IGNORE_CRC			(1 << 26)
1143a0398d7SOtavio Salvador #define	SSP_CTRL0_READ				(1 << 25)
1153a0398d7SOtavio Salvador #define	SSP_CTRL0_DATA_XFER			(1 << 24)
1163a0398d7SOtavio Salvador #define	SSP_CTRL0_BUS_WIDTH_MASK		(0x3 << 22)
1173a0398d7SOtavio Salvador #define	SSP_CTRL0_BUS_WIDTH_OFFSET		22
1183a0398d7SOtavio Salvador #define	SSP_CTRL0_BUS_WIDTH_ONE_BIT		(0x0 << 22)
1193a0398d7SOtavio Salvador #define	SSP_CTRL0_BUS_WIDTH_FOUR_BIT		(0x1 << 22)
1203a0398d7SOtavio Salvador #define	SSP_CTRL0_BUS_WIDTH_EIGHT_BIT		(0x2 << 22)
1213a0398d7SOtavio Salvador #define	SSP_CTRL0_WAIT_FOR_IRQ			(1 << 21)
1223a0398d7SOtavio Salvador #define	SSP_CTRL0_WAIT_FOR_CMD			(1 << 20)
1233a0398d7SOtavio Salvador #define	SSP_CTRL0_LONG_RESP			(1 << 19)
1243a0398d7SOtavio Salvador #define	SSP_CTRL0_CHECK_RESP			(1 << 18)
1253a0398d7SOtavio Salvador #define	SSP_CTRL0_GET_RESP			(1 << 17)
1263a0398d7SOtavio Salvador #define	SSP_CTRL0_ENABLE			(1 << 16)
1273a0398d7SOtavio Salvador 
128f3801e2bSMarek Vasut #ifdef CONFIG_MX23
129f3801e2bSMarek Vasut #define	SSP_CTRL0_XFER_COUNT_OFFSET		0
130f3801e2bSMarek Vasut #define	SSP_CTRL0_XFER_COUNT_MASK		0xffff
131f3801e2bSMarek Vasut #endif
132f3801e2bSMarek Vasut 
1333a0398d7SOtavio Salvador #define	SSP_CMD0_SOFT_TERMINATE			(1 << 26)
1343a0398d7SOtavio Salvador #define	SSP_CMD0_DBL_DATA_RATE_EN		(1 << 25)
1353a0398d7SOtavio Salvador #define	SSP_CMD0_PRIM_BOOT_OP_EN		(1 << 24)
1363a0398d7SOtavio Salvador #define	SSP_CMD0_BOOT_ACK_EN			(1 << 23)
1373a0398d7SOtavio Salvador #define	SSP_CMD0_SLOW_CLKING_EN			(1 << 22)
1383a0398d7SOtavio Salvador #define	SSP_CMD0_CONT_CLKING_EN			(1 << 21)
1393a0398d7SOtavio Salvador #define	SSP_CMD0_APPEND_8CYC			(1 << 20)
140f3801e2bSMarek Vasut #if defined(CONFIG_MX23)
141f3801e2bSMarek Vasut #define	SSP_CMD0_BLOCK_SIZE_MASK		(0xf << 16)
142f3801e2bSMarek Vasut #define	SSP_CMD0_BLOCK_SIZE_OFFSET		16
143f3801e2bSMarek Vasut #define	SSP_CMD0_BLOCK_COUNT_MASK		(0xff << 8)
144f3801e2bSMarek Vasut #define	SSP_CMD0_BLOCK_COUNT_OFFSET		8
145f3801e2bSMarek Vasut #endif
1463a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_MASK			0xff
1473a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_OFFSET			0
1483a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_MMC_GO_IDLE_STATE		0x00
1493a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_MMC_SEND_OP_COND		0x01
1503a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_MMC_ALL_SEND_CID		0x02
1513a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_MMC_SET_RELATIVE_ADDR	0x03
1523a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_MMC_SET_DSR		0x04
1533a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_MMC_RESERVED_5		0x05
1543a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_MMC_SWITCH			0x06
1553a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_MMC_SELECT_DESELECT_CARD	0x07
1563a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_MMC_SEND_EXT_CSD		0x08
1573a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_MMC_SEND_CSD		0x09
1583a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_MMC_SEND_CID		0x0a
1593a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_MMC_READ_DAT_UNTIL_STOP	0x0b
1603a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_MMC_STOP_TRANSMISSION	0x0c
1613a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_MMC_SEND_STATUS		0x0d
1623a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_MMC_BUSTEST_R		0x0e
1633a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_MMC_GO_INACTIVE_STATE	0x0f
1643a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_MMC_SET_BLOCKLEN		0x10
1653a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_MMC_READ_SINGLE_BLOCK	0x11
1663a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_MMC_READ_MULTIPLE_BLOCK	0x12
1673a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_MMC_BUSTEST_W		0x13
1683a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_MMC_WRITE_DAT_UNTIL_STOP	0x14
1693a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_MMC_SET_BLOCK_COUNT	0x17
1703a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_MMC_WRITE_BLOCK		0x18
1713a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_MMC_WRITE_MULTIPLE_BLOCK	0x19
1723a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_MMC_PROGRAM_CID		0x1a
1733a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_MMC_PROGRAM_CSD		0x1b
1743a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_MMC_SET_WRITE_PROT		0x1c
1753a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_MMC_CLR_WRITE_PROT		0x1d
1763a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_MMC_SEND_WRITE_PROT	0x1e
1773a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_MMC_ERASE_GROUP_START	0x23
1783a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_MMC_ERASE_GROUP_END	0x24
1793a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_MMC_ERASE			0x26
1803a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_MMC_FAST_IO		0x27
1813a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_MMC_GO_IRQ_STATE		0x28
1823a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_MMC_LOCK_UNLOCK		0x2a
1833a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_MMC_APP_CMD		0x37
1843a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_MMC_GEN_CMD		0x38
1853a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_SD_GO_IDLE_STATE		0x00
1863a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_SD_ALL_SEND_CID		0x02
1873a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_SD_SEND_RELATIVE_ADDR	0x03
1883a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_SD_SET_DSR			0x04
1893a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_SD_IO_SEND_OP_COND		0x05
1903a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_SD_SELECT_DESELECT_CARD	0x07
1913a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_SD_SEND_CSD		0x09
1923a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_SD_SEND_CID		0x0a
1933a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_SD_STOP_TRANSMISSION	0x0c
1943a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_SD_SEND_STATUS		0x0d
1953a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_SD_GO_INACTIVE_STATE	0x0f
1963a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_SD_SET_BLOCKLEN		0x10
1973a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_SD_READ_SINGLE_BLOCK	0x11
1983a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_SD_READ_MULTIPLE_BLOCK	0x12
1993a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_SD_WRITE_BLOCK		0x18
2003a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_SD_WRITE_MULTIPLE_BLOCK	0x19
2013a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_SD_PROGRAM_CSD		0x1b
2023a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_SD_SET_WRITE_PROT		0x1c
2033a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_SD_CLR_WRITE_PROT		0x1d
2043a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_SD_SEND_WRITE_PROT		0x1e
2053a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_SD_ERASE_WR_BLK_START	0x20
2063a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_SD_ERASE_WR_BLK_END	0x21
2073a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_SD_ERASE_GROUP_START	0x23
2083a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_SD_ERASE_GROUP_END		0x24
2093a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_SD_ERASE			0x26
2103a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_SD_LOCK_UNLOCK		0x2a
2113a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_SD_IO_RW_DIRECT		0x34
2123a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_SD_IO_RW_EXTENDED		0x35
2133a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_SD_APP_CMD			0x37
2143a0398d7SOtavio Salvador #define	SSP_CMD0_CMD_SD_GEN_CMD			0x38
2153a0398d7SOtavio Salvador 
2163a0398d7SOtavio Salvador #define	SSP_CMD1_CMD_ARG_MASK			0xffffffff
2173a0398d7SOtavio Salvador #define	SSP_CMD1_CMD_ARG_OFFSET			0
2183a0398d7SOtavio Salvador 
219f3801e2bSMarek Vasut #if defined(CONFIG_MX28)
2203a0398d7SOtavio Salvador #define	SSP_XFER_SIZE_XFER_COUNT_MASK		0xffffffff
2213a0398d7SOtavio Salvador #define	SSP_XFER_SIZE_XFER_COUNT_OFFSET		0
2223a0398d7SOtavio Salvador 
2233a0398d7SOtavio Salvador #define	SSP_BLOCK_SIZE_BLOCK_COUNT_MASK		(0xffffff << 4)
2243a0398d7SOtavio Salvador #define	SSP_BLOCK_SIZE_BLOCK_COUNT_OFFSET	4
2253a0398d7SOtavio Salvador #define	SSP_BLOCK_SIZE_BLOCK_SIZE_MASK		0xf
2263a0398d7SOtavio Salvador #define	SSP_BLOCK_SIZE_BLOCK_SIZE_OFFSET	0
227f3801e2bSMarek Vasut #endif
2283a0398d7SOtavio Salvador 
2293a0398d7SOtavio Salvador #define	SSP_COMPREF_REFERENCE_MASK		0xffffffff
2303a0398d7SOtavio Salvador #define	SSP_COMPREF_REFERENCE_OFFSET		0
2313a0398d7SOtavio Salvador 
2323a0398d7SOtavio Salvador #define	SSP_COMPMASK_MASK_MASK			0xffffffff
2333a0398d7SOtavio Salvador #define	SSP_COMPMASK_MASK_OFFSET		0
2343a0398d7SOtavio Salvador 
2353a0398d7SOtavio Salvador #define	SSP_TIMING_TIMEOUT_MASK			(0xffff << 16)
2363a0398d7SOtavio Salvador #define	SSP_TIMING_TIMEOUT_OFFSET		16
2373a0398d7SOtavio Salvador #define	SSP_TIMING_CLOCK_DIVIDE_MASK		(0xff << 8)
2383a0398d7SOtavio Salvador #define	SSP_TIMING_CLOCK_DIVIDE_OFFSET		8
2393a0398d7SOtavio Salvador #define	SSP_TIMING_CLOCK_RATE_MASK		0xff
2403a0398d7SOtavio Salvador #define	SSP_TIMING_CLOCK_RATE_OFFSET		0
2413a0398d7SOtavio Salvador 
2423a0398d7SOtavio Salvador #define	SSP_CTRL1_SDIO_IRQ			(1 << 31)
2433a0398d7SOtavio Salvador #define	SSP_CTRL1_SDIO_IRQ_EN			(1 << 30)
2443a0398d7SOtavio Salvador #define	SSP_CTRL1_RESP_ERR_IRQ			(1 << 29)
2453a0398d7SOtavio Salvador #define	SSP_CTRL1_RESP_ERR_IRQ_EN		(1 << 28)
2463a0398d7SOtavio Salvador #define	SSP_CTRL1_RESP_TIMEOUT_IRQ		(1 << 27)
2473a0398d7SOtavio Salvador #define	SSP_CTRL1_RESP_TIMEOUT_IRQ_EN		(1 << 26)
2483a0398d7SOtavio Salvador #define	SSP_CTRL1_DATA_TIMEOUT_IRQ		(1 << 25)
2493a0398d7SOtavio Salvador #define	SSP_CTRL1_DATA_TIMEOUT_IRQ_EN		(1 << 24)
2503a0398d7SOtavio Salvador #define	SSP_CTRL1_DATA_CRC_IRQ			(1 << 23)
2513a0398d7SOtavio Salvador #define	SSP_CTRL1_DATA_CRC_IRQ_EN		(1 << 22)
2523a0398d7SOtavio Salvador #define	SSP_CTRL1_FIFO_UNDERRUN_IRQ		(1 << 21)
2533a0398d7SOtavio Salvador #define	SSP_CTRL1_FIFO_UNDERRUN_EN		(1 << 20)
2543a0398d7SOtavio Salvador #define	SSP_CTRL1_CEATA_CCS_ERR_IRQ		(1 << 19)
2553a0398d7SOtavio Salvador #define	SSP_CTRL1_CEATA_CCS_ERR_IRQ_EN		(1 << 18)
2563a0398d7SOtavio Salvador #define	SSP_CTRL1_RECV_TIMEOUT_IRQ		(1 << 17)
2573a0398d7SOtavio Salvador #define	SSP_CTRL1_RECV_TIMEOUT_IRQ_EN		(1 << 16)
2583a0398d7SOtavio Salvador #define	SSP_CTRL1_FIFO_OVERRUN_IRQ		(1 << 15)
2593a0398d7SOtavio Salvador #define	SSP_CTRL1_FIFO_OVERRUN_IRQ_EN		(1 << 14)
2603a0398d7SOtavio Salvador #define	SSP_CTRL1_DMA_ENABLE			(1 << 13)
2613a0398d7SOtavio Salvador #define	SSP_CTRL1_CEATA_CCS_ERR_EN		(1 << 12)
2623a0398d7SOtavio Salvador #define	SSP_CTRL1_SLAVE_OUT_DISABLE		(1 << 11)
2633a0398d7SOtavio Salvador #define	SSP_CTRL1_PHASE				(1 << 10)
2643a0398d7SOtavio Salvador #define	SSP_CTRL1_POLARITY			(1 << 9)
2653a0398d7SOtavio Salvador #define	SSP_CTRL1_SLAVE_MODE			(1 << 8)
2663a0398d7SOtavio Salvador #define	SSP_CTRL1_WORD_LENGTH_MASK		(0xf << 4)
2673a0398d7SOtavio Salvador #define	SSP_CTRL1_WORD_LENGTH_OFFSET		4
2683a0398d7SOtavio Salvador #define	SSP_CTRL1_WORD_LENGTH_RESERVED0		(0x0 << 4)
2693a0398d7SOtavio Salvador #define	SSP_CTRL1_WORD_LENGTH_RESERVED1		(0x1 << 4)
2703a0398d7SOtavio Salvador #define	SSP_CTRL1_WORD_LENGTH_RESERVED2		(0x2 << 4)
2713a0398d7SOtavio Salvador #define	SSP_CTRL1_WORD_LENGTH_FOUR_BITS		(0x3 << 4)
2723a0398d7SOtavio Salvador #define	SSP_CTRL1_WORD_LENGTH_EIGHT_BITS	(0x7 << 4)
2733a0398d7SOtavio Salvador #define	SSP_CTRL1_WORD_LENGTH_SIXTEEN_BITS	(0xf << 4)
2743a0398d7SOtavio Salvador #define	SSP_CTRL1_SSP_MODE_MASK			0xf
2753a0398d7SOtavio Salvador #define	SSP_CTRL1_SSP_MODE_OFFSET		0
2763a0398d7SOtavio Salvador #define	SSP_CTRL1_SSP_MODE_SPI			0x0
2773a0398d7SOtavio Salvador #define	SSP_CTRL1_SSP_MODE_SSI			0x1
2783a0398d7SOtavio Salvador #define	SSP_CTRL1_SSP_MODE_SD_MMC		0x3
2793a0398d7SOtavio Salvador #define	SSP_CTRL1_SSP_MODE_MS			0x4
2803a0398d7SOtavio Salvador 
2813a0398d7SOtavio Salvador #define	SSP_DATA_DATA_MASK			0xffffffff
2823a0398d7SOtavio Salvador #define	SSP_DATA_DATA_OFFSET			0
2833a0398d7SOtavio Salvador 
2843a0398d7SOtavio Salvador #define	SSP_SDRESP0_RESP0_MASK			0xffffffff
2853a0398d7SOtavio Salvador #define	SSP_SDRESP0_RESP0_OFFSET		0
2863a0398d7SOtavio Salvador 
2873a0398d7SOtavio Salvador #define	SSP_SDRESP1_RESP1_MASK			0xffffffff
2883a0398d7SOtavio Salvador #define	SSP_SDRESP1_RESP1_OFFSET		0
2893a0398d7SOtavio Salvador 
2903a0398d7SOtavio Salvador #define	SSP_SDRESP2_RESP2_MASK			0xffffffff
2913a0398d7SOtavio Salvador #define	SSP_SDRESP2_RESP2_OFFSET		0
2923a0398d7SOtavio Salvador 
2933a0398d7SOtavio Salvador #define	SSP_SDRESP3_RESP3_MASK			0xffffffff
2943a0398d7SOtavio Salvador #define	SSP_SDRESP3_RESP3_OFFSET		0
2953a0398d7SOtavio Salvador 
2963a0398d7SOtavio Salvador #define	SSP_DDR_CTRL_DMA_BURST_TYPE_MASK	(0x3 << 30)
2973a0398d7SOtavio Salvador #define	SSP_DDR_CTRL_DMA_BURST_TYPE_OFFSET	30
2983a0398d7SOtavio Salvador #define	SSP_DDR_CTRL_NIBBLE_POS			(1 << 1)
2993a0398d7SOtavio Salvador #define	SSP_DDR_CTRL_TXCLK_DELAY_TYPE		(1 << 0)
3003a0398d7SOtavio Salvador 
3013a0398d7SOtavio Salvador #define	SSP_DLL_CTRL_REF_UPDATE_INT_MASK	(0xf << 28)
3023a0398d7SOtavio Salvador #define	SSP_DLL_CTRL_REF_UPDATE_INT_OFFSET	28
3033a0398d7SOtavio Salvador #define	SSP_DLL_CTRL_SLV_UPDATE_INT_MASK	(0xff << 20)
3043a0398d7SOtavio Salvador #define	SSP_DLL_CTRL_SLV_UPDATE_INT_OFFSET	20
3053a0398d7SOtavio Salvador #define	SSP_DLL_CTRL_SLV_OVERRIDE_VAL_MASK	(0x3f << 10)
3063a0398d7SOtavio Salvador #define	SSP_DLL_CTRL_SLV_OVERRIDE_VAL_OFFSET	10
3073a0398d7SOtavio Salvador #define	SSP_DLL_CTRL_SLV_OVERRIDE		(1 << 9)
3083a0398d7SOtavio Salvador #define	SSP_DLL_CTRL_GATE_UPDATE		(1 << 7)
3093a0398d7SOtavio Salvador #define	SSP_DLL_CTRL_SLV_DLY_TARGET_MASK	(0xf << 3)
3103a0398d7SOtavio Salvador #define	SSP_DLL_CTRL_SLV_DLY_TARGET_OFFSET	3
3113a0398d7SOtavio Salvador #define	SSP_DLL_CTRL_SLV_FORCE_UPD		(1 << 2)
3123a0398d7SOtavio Salvador #define	SSP_DLL_CTRL_RESET			(1 << 1)
3133a0398d7SOtavio Salvador #define	SSP_DLL_CTRL_ENABLE			(1 << 0)
3143a0398d7SOtavio Salvador 
3153a0398d7SOtavio Salvador #define	SSP_STATUS_PRESENT			(1 << 31)
3163a0398d7SOtavio Salvador #define	SSP_STATUS_MS_PRESENT			(1 << 30)
3173a0398d7SOtavio Salvador #define	SSP_STATUS_SD_PRESENT			(1 << 29)
3183a0398d7SOtavio Salvador #define	SSP_STATUS_CARD_DETECT			(1 << 28)
3193a0398d7SOtavio Salvador #define	SSP_STATUS_DMABURST			(1 << 22)
3203a0398d7SOtavio Salvador #define	SSP_STATUS_DMASENSE			(1 << 21)
3213a0398d7SOtavio Salvador #define	SSP_STATUS_DMATERM			(1 << 20)
3223a0398d7SOtavio Salvador #define	SSP_STATUS_DMAREQ			(1 << 19)
3233a0398d7SOtavio Salvador #define	SSP_STATUS_DMAEND			(1 << 18)
3243a0398d7SOtavio Salvador #define	SSP_STATUS_SDIO_IRQ			(1 << 17)
3253a0398d7SOtavio Salvador #define	SSP_STATUS_RESP_CRC_ERR			(1 << 16)
3263a0398d7SOtavio Salvador #define	SSP_STATUS_RESP_ERR			(1 << 15)
3273a0398d7SOtavio Salvador #define	SSP_STATUS_RESP_TIMEOUT			(1 << 14)
3283a0398d7SOtavio Salvador #define	SSP_STATUS_DATA_CRC_ERR			(1 << 13)
3293a0398d7SOtavio Salvador #define	SSP_STATUS_TIMEOUT			(1 << 12)
3303a0398d7SOtavio Salvador #define	SSP_STATUS_RECV_TIMEOUT_STAT		(1 << 11)
3313a0398d7SOtavio Salvador #define	SSP_STATUS_CEATA_CCS_ERR		(1 << 10)
3323a0398d7SOtavio Salvador #define	SSP_STATUS_FIFO_OVRFLW			(1 << 9)
3333a0398d7SOtavio Salvador #define	SSP_STATUS_FIFO_FULL			(1 << 8)
3343a0398d7SOtavio Salvador #define	SSP_STATUS_FIFO_EMPTY			(1 << 5)
3353a0398d7SOtavio Salvador #define	SSP_STATUS_FIFO_UNDRFLW			(1 << 4)
3363a0398d7SOtavio Salvador #define	SSP_STATUS_CMD_BUSY			(1 << 3)
3373a0398d7SOtavio Salvador #define	SSP_STATUS_DATA_BUSY			(1 << 2)
3383a0398d7SOtavio Salvador #define	SSP_STATUS_BUSY				(1 << 0)
3393a0398d7SOtavio Salvador 
3403a0398d7SOtavio Salvador #define	SSP_DLL_STS_REF_SEL_MASK		(0x3f << 8)
3413a0398d7SOtavio Salvador #define	SSP_DLL_STS_REF_SEL_OFFSET		8
3423a0398d7SOtavio Salvador #define	SSP_DLL_STS_SLV_SEL_MASK		(0x3f << 2)
3433a0398d7SOtavio Salvador #define	SSP_DLL_STS_SLV_SEL_OFFSET		2
3443a0398d7SOtavio Salvador #define	SSP_DLL_STS_REF_LOCK			(1 << 1)
3453a0398d7SOtavio Salvador #define	SSP_DLL_STS_SLV_LOCK			(1 << 0)
3463a0398d7SOtavio Salvador 
3473a0398d7SOtavio Salvador #define	SSP_DEBUG_DATACRC_ERR_MASK		(0xf << 28)
3483a0398d7SOtavio Salvador #define	SSP_DEBUG_DATACRC_ERR_OFFSET		28
3493a0398d7SOtavio Salvador #define	SSP_DEBUG_DATA_STALL			(1 << 27)
3503a0398d7SOtavio Salvador #define	SSP_DEBUG_DAT_SM_MASK			(0x7 << 24)
3513a0398d7SOtavio Salvador #define	SSP_DEBUG_DAT_SM_OFFSET			24
3523a0398d7SOtavio Salvador #define	SSP_DEBUG_DAT_SM_DSM_IDLE		(0x0 << 24)
3533a0398d7SOtavio Salvador #define	SSP_DEBUG_DAT_SM_DSM_WORD		(0x2 << 24)
3543a0398d7SOtavio Salvador #define	SSP_DEBUG_DAT_SM_DSM_CRC1		(0x3 << 24)
3553a0398d7SOtavio Salvador #define	SSP_DEBUG_DAT_SM_DSM_CRC2		(0x4 << 24)
3563a0398d7SOtavio Salvador #define	SSP_DEBUG_DAT_SM_DSM_END		(0x5 << 24)
3573a0398d7SOtavio Salvador #define	SSP_DEBUG_MSTK_SM_MASK			(0xf << 20)
3583a0398d7SOtavio Salvador #define	SSP_DEBUG_MSTK_SM_OFFSET		20
3593a0398d7SOtavio Salvador #define	SSP_DEBUG_MSTK_SM_MSTK_IDLE		(0x0 << 20)
3603a0398d7SOtavio Salvador #define	SSP_DEBUG_MSTK_SM_MSTK_CKON		(0x1 << 20)
3613a0398d7SOtavio Salvador #define	SSP_DEBUG_MSTK_SM_MSTK_BS1		(0x2 << 20)
3623a0398d7SOtavio Salvador #define	SSP_DEBUG_MSTK_SM_MSTK_TPC		(0x3 << 20)
3633a0398d7SOtavio Salvador #define	SSP_DEBUG_MSTK_SM_MSTK_BS2		(0x4 << 20)
3643a0398d7SOtavio Salvador #define	SSP_DEBUG_MSTK_SM_MSTK_HDSHK		(0x5 << 20)
3653a0398d7SOtavio Salvador #define	SSP_DEBUG_MSTK_SM_MSTK_BS3		(0x6 << 20)
3663a0398d7SOtavio Salvador #define	SSP_DEBUG_MSTK_SM_MSTK_RW		(0x7 << 20)
3673a0398d7SOtavio Salvador #define	SSP_DEBUG_MSTK_SM_MSTK_CRC1		(0x8 << 20)
3683a0398d7SOtavio Salvador #define	SSP_DEBUG_MSTK_SM_MSTK_CRC2		(0x9 << 20)
3693a0398d7SOtavio Salvador #define	SSP_DEBUG_MSTK_SM_MSTK_BS0		(0xa << 20)
3703a0398d7SOtavio Salvador #define	SSP_DEBUG_MSTK_SM_MSTK_END1		(0xb << 20)
3713a0398d7SOtavio Salvador #define	SSP_DEBUG_MSTK_SM_MSTK_END2W		(0xc << 20)
3723a0398d7SOtavio Salvador #define	SSP_DEBUG_MSTK_SM_MSTK_END2R		(0xd << 20)
3733a0398d7SOtavio Salvador #define	SSP_DEBUG_MSTK_SM_MSTK_DONE		(0xe << 20)
3743a0398d7SOtavio Salvador #define	SSP_DEBUG_CMD_OE			(1 << 19)
3753a0398d7SOtavio Salvador #define	SSP_DEBUG_DMA_SM_MASK			(0x7 << 16)
3763a0398d7SOtavio Salvador #define	SSP_DEBUG_DMA_SM_OFFSET			16
3773a0398d7SOtavio Salvador #define	SSP_DEBUG_DMA_SM_DMA_IDLE		(0x0 << 16)
3783a0398d7SOtavio Salvador #define	SSP_DEBUG_DMA_SM_DMA_DMAREQ		(0x1 << 16)
3793a0398d7SOtavio Salvador #define	SSP_DEBUG_DMA_SM_DMA_DMAACK		(0x2 << 16)
3803a0398d7SOtavio Salvador #define	SSP_DEBUG_DMA_SM_DMA_STALL		(0x3 << 16)
3813a0398d7SOtavio Salvador #define	SSP_DEBUG_DMA_SM_DMA_BUSY		(0x4 << 16)
3823a0398d7SOtavio Salvador #define	SSP_DEBUG_DMA_SM_DMA_DONE		(0x5 << 16)
3833a0398d7SOtavio Salvador #define	SSP_DEBUG_DMA_SM_DMA_COUNT		(0x6 << 16)
3843a0398d7SOtavio Salvador #define	SSP_DEBUG_MMC_SM_MASK			(0xf << 12)
3853a0398d7SOtavio Salvador #define	SSP_DEBUG_MMC_SM_OFFSET			12
3863a0398d7SOtavio Salvador #define	SSP_DEBUG_MMC_SM_MMC_IDLE		(0x0 << 12)
3873a0398d7SOtavio Salvador #define	SSP_DEBUG_MMC_SM_MMC_CMD		(0x1 << 12)
3883a0398d7SOtavio Salvador #define	SSP_DEBUG_MMC_SM_MMC_TRC		(0x2 << 12)
3893a0398d7SOtavio Salvador #define	SSP_DEBUG_MMC_SM_MMC_RESP		(0x3 << 12)
3903a0398d7SOtavio Salvador #define	SSP_DEBUG_MMC_SM_MMC_RPRX		(0x4 << 12)
3913a0398d7SOtavio Salvador #define	SSP_DEBUG_MMC_SM_MMC_TX			(0x5 << 12)
3923a0398d7SOtavio Salvador #define	SSP_DEBUG_MMC_SM_MMC_CTOK		(0x6 << 12)
3933a0398d7SOtavio Salvador #define	SSP_DEBUG_MMC_SM_MMC_RX			(0x7 << 12)
3943a0398d7SOtavio Salvador #define	SSP_DEBUG_MMC_SM_MMC_CCS		(0x8 << 12)
3953a0398d7SOtavio Salvador #define	SSP_DEBUG_MMC_SM_MMC_PUP		(0x9 << 12)
3963a0398d7SOtavio Salvador #define	SSP_DEBUG_MMC_SM_MMC_WAIT		(0xa << 12)
3973a0398d7SOtavio Salvador #define	SSP_DEBUG_CMD_SM_MASK			(0x3 << 10)
3983a0398d7SOtavio Salvador #define	SSP_DEBUG_CMD_SM_OFFSET			10
3993a0398d7SOtavio Salvador #define	SSP_DEBUG_CMD_SM_CSM_IDLE		(0x0 << 10)
4003a0398d7SOtavio Salvador #define	SSP_DEBUG_CMD_SM_CSM_INDEX		(0x1 << 10)
4013a0398d7SOtavio Salvador #define	SSP_DEBUG_CMD_SM_CSM_ARG		(0x2 << 10)
4023a0398d7SOtavio Salvador #define	SSP_DEBUG_CMD_SM_CSM_CRC		(0x3 << 10)
4033a0398d7SOtavio Salvador #define	SSP_DEBUG_SSP_CMD			(1 << 9)
4043a0398d7SOtavio Salvador #define	SSP_DEBUG_SSP_RESP			(1 << 8)
4053a0398d7SOtavio Salvador #define	SSP_DEBUG_SSP_RXD_MASK			0xff
4063a0398d7SOtavio Salvador #define	SSP_DEBUG_SSP_RXD_OFFSET		0
4073a0398d7SOtavio Salvador 
4083a0398d7SOtavio Salvador #define	SSP_VERSION_MAJOR_MASK			(0xff << 24)
4093a0398d7SOtavio Salvador #define	SSP_VERSION_MAJOR_OFFSET		24
4103a0398d7SOtavio Salvador #define	SSP_VERSION_MINOR_MASK			(0xff << 16)
4113a0398d7SOtavio Salvador #define	SSP_VERSION_MINOR_OFFSET		16
4123a0398d7SOtavio Salvador #define	SSP_VERSION_STEP_MASK			0xffff
4133a0398d7SOtavio Salvador #define	SSP_VERSION_STEP_OFFSET			0
4143a0398d7SOtavio Salvador 
4153a0398d7SOtavio Salvador #endif /* __MX28_REGS_SSP_H__ */
416