| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Freescale eSDHC controller driver generics for OF and pltfm. |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (c) 2007 Freescale Semiconductor, Inc. |
|---|
| 5 | 6 | * Copyright (c) 2009 MontaVista Software, Inc. |
|---|
| 6 | 7 | * Copyright (c) 2010 Pengutronix e.K. |
|---|
| 7 | | - * Author: Wolfram Sang <w.sang@pengutronix.de> |
|---|
| 8 | | - * |
|---|
| 9 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 10 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 11 | | - * the Free Software Foundation; either version 2 of the License. |
|---|
| 8 | + * Copyright 2020 NXP |
|---|
| 9 | + * Author: Wolfram Sang <kernel@pengutronix.de> |
|---|
| 12 | 10 | */ |
|---|
| 13 | 11 | |
|---|
| 14 | 12 | #ifndef _DRIVERS_MMC_SDHCI_ESDHC_H |
|---|
| .. | .. |
|---|
| 34 | 32 | |
|---|
| 35 | 33 | /* Present State Register */ |
|---|
| 36 | 34 | #define ESDHC_PRSSTAT 0x24 |
|---|
| 35 | +#define ESDHC_CLOCK_GATE_OFF 0x00000080 |
|---|
| 37 | 36 | #define ESDHC_CLOCK_STABLE 0x00000008 |
|---|
| 38 | 37 | |
|---|
| 39 | 38 | /* Protocol Control Register */ |
|---|
| .. | .. |
|---|
| 54 | 53 | #define ESDHC_CLOCK_HCKEN 0x00000002 |
|---|
| 55 | 54 | #define ESDHC_CLOCK_IPGEN 0x00000001 |
|---|
| 56 | 55 | |
|---|
| 56 | +/* System Control 2 Register */ |
|---|
| 57 | +#define ESDHC_SYSTEM_CONTROL_2 0x3c |
|---|
| 58 | +#define ESDHC_SMPCLKSEL 0x00800000 |
|---|
| 59 | +#define ESDHC_EXTN 0x00400000 |
|---|
| 60 | + |
|---|
| 57 | 61 | /* Host Controller Capabilities Register 2 */ |
|---|
| 58 | 62 | #define ESDHC_CAPABILITIES_1 0x114 |
|---|
| 59 | 63 | |
|---|
| 60 | 64 | /* Tuning Block Control Register */ |
|---|
| 61 | 65 | #define ESDHC_TBCTL 0x120 |
|---|
| 66 | +#define ESDHC_HS400_WNDW_ADJUST 0x00000040 |
|---|
| 67 | +#define ESDHC_HS400_MODE 0x00000010 |
|---|
| 62 | 68 | #define ESDHC_TB_EN 0x00000004 |
|---|
| 69 | +#define ESDHC_TB_MODE_MASK 0x00000003 |
|---|
| 70 | +#define ESDHC_TB_MODE_SW 0x00000003 |
|---|
| 71 | +#define ESDHC_TB_MODE_3 0x00000002 |
|---|
| 72 | + |
|---|
| 73 | +#define ESDHC_TBSTAT 0x124 |
|---|
| 74 | + |
|---|
| 75 | +#define ESDHC_TBPTR 0x128 |
|---|
| 76 | +#define ESDHC_WNDW_STRT_PTR_SHIFT 8 |
|---|
| 77 | +#define ESDHC_WNDW_STRT_PTR_MASK (0x7f << 8) |
|---|
| 78 | +#define ESDHC_WNDW_END_PTR_MASK 0x7f |
|---|
| 79 | + |
|---|
| 80 | +/* SD Clock Control Register */ |
|---|
| 81 | +#define ESDHC_SDCLKCTL 0x144 |
|---|
| 82 | +#define ESDHC_LPBK_CLK_SEL 0x80000000 |
|---|
| 83 | +#define ESDHC_CMD_CLK_CTL 0x00008000 |
|---|
| 84 | + |
|---|
| 85 | +/* SD Timing Control Register */ |
|---|
| 86 | +#define ESDHC_SDTIMNGCTL 0x148 |
|---|
| 87 | +#define ESDHC_FLW_CTL_BG 0x00008000 |
|---|
| 88 | + |
|---|
| 89 | +/* DLL Config 0 Register */ |
|---|
| 90 | +#define ESDHC_DLLCFG0 0x160 |
|---|
| 91 | +#define ESDHC_DLL_ENABLE 0x80000000 |
|---|
| 92 | +#define ESDHC_DLL_RESET 0x40000000 |
|---|
| 93 | +#define ESDHC_DLL_FREQ_SEL 0x08000000 |
|---|
| 94 | + |
|---|
| 95 | +/* DLL Config 1 Register */ |
|---|
| 96 | +#define ESDHC_DLLCFG1 0x164 |
|---|
| 97 | +#define ESDHC_DLL_PD_PULSE_STRETCH_SEL 0x80000000 |
|---|
| 98 | + |
|---|
| 99 | +/* DLL Status 0 Register */ |
|---|
| 100 | +#define ESDHC_DLLSTAT0 0x170 |
|---|
| 101 | +#define ESDHC_DLL_STS_SLV_LOCK 0x08000000 |
|---|
| 63 | 102 | |
|---|
| 64 | 103 | /* Control Register for DMA transfer */ |
|---|
| 65 | 104 | #define ESDHC_DMA_SYSCTL 0x40c |
|---|