| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (c) 2014-2016, The Linux Foundation. All rights reserved. |
|---|
| 3 | | - * |
|---|
| 4 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 5 | | - * it under the terms of the GNU General Public License version 2 and |
|---|
| 6 | | - * only version 2 as published by the Free Software Foundation. |
|---|
| 7 | | - * |
|---|
| 8 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 9 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 10 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 11 | | - * GNU General Public License for more details. |
|---|
| 12 | | - * |
|---|
| 13 | 4 | */ |
|---|
| 14 | 5 | |
|---|
| 15 | 6 | #ifndef _UFS_QUIRKS_H_ |
|---|
| .. | .. |
|---|
| 22 | 13 | #define UFS_ANY_MODEL "ANY_MODEL" |
|---|
| 23 | 14 | |
|---|
| 24 | 15 | #define UFS_VENDOR_MICRON 0x12C |
|---|
| 25 | | -#define UFS_VENDOR_TOSHIBA 0x198 |
|---|
| 26 | 16 | #define UFS_VENDOR_SAMSUNG 0x1CE |
|---|
| 27 | 17 | #define UFS_VENDOR_SKHYNIX 0x1AD |
|---|
| 18 | +#define UFS_VENDOR_TOSHIBA 0x198 |
|---|
| 19 | +#define UFS_VENDOR_WDC 0x145 |
|---|
| 28 | 20 | |
|---|
| 29 | 21 | /** |
|---|
| 30 | 22 | * ufs_dev_fix - ufs device quirk info |
|---|
| .. | .. |
|---|
| 32 | 24 | * @quirk: device quirk |
|---|
| 33 | 25 | */ |
|---|
| 34 | 26 | struct ufs_dev_fix { |
|---|
| 35 | | - struct ufs_dev_desc card; |
|---|
| 27 | + u16 wmanufacturerid; |
|---|
| 28 | + u8 *model; |
|---|
| 36 | 29 | unsigned int quirk; |
|---|
| 37 | 30 | }; |
|---|
| 38 | 31 | |
|---|
| 39 | | -#define END_FIX { { 0 }, 0 } |
|---|
| 32 | +#define END_FIX { } |
|---|
| 40 | 33 | |
|---|
| 41 | 34 | /* add specific device quirk */ |
|---|
| 42 | 35 | #define UFS_FIX(_vendor, _model, _quirk) { \ |
|---|
| 43 | | - .card.wmanufacturerid = (_vendor),\ |
|---|
| 44 | | - .card.model = (_model), \ |
|---|
| 36 | + .wmanufacturerid = (_vendor),\ |
|---|
| 37 | + .model = (_model), \ |
|---|
| 45 | 38 | .quirk = (_quirk), \ |
|---|
| 46 | 39 | } |
|---|
| 47 | | - |
|---|
| 48 | | -/* |
|---|
| 49 | | - * If UFS device is having issue in processing LCC (Line Control |
|---|
| 50 | | - * Command) coming from UFS host controller then enable this quirk. |
|---|
| 51 | | - * When this quirk is enabled, host controller driver should disable |
|---|
| 52 | | - * the LCC transmission on UFS host controller (by clearing |
|---|
| 53 | | - * TX_LCC_ENABLE attribute of host to 0). |
|---|
| 54 | | - */ |
|---|
| 55 | | -#define UFS_DEVICE_QUIRK_BROKEN_LCC (1 << 0) |
|---|
| 56 | | - |
|---|
| 57 | | -/* |
|---|
| 58 | | - * Some UFS devices don't need VCCQ rail for device operations. Enabling this |
|---|
| 59 | | - * quirk for such devices will make sure that VCCQ rail is not voted. |
|---|
| 60 | | - */ |
|---|
| 61 | | -#define UFS_DEVICE_NO_VCCQ (1 << 1) |
|---|
| 62 | 40 | |
|---|
| 63 | 41 | /* |
|---|
| 64 | 42 | * Some vendor's UFS device sends back to back NACs for the DL data frames |
|---|
| .. | .. |
|---|
| 86 | 64 | #define UFS_DEVICE_QUIRK_RECOVERY_FROM_DL_NAC_ERRORS (1 << 2) |
|---|
| 87 | 65 | |
|---|
| 88 | 66 | /* |
|---|
| 89 | | - * Some UFS devices may not work properly after resume if the link was kept |
|---|
| 90 | | - * in off state during suspend. Enabling this quirk will not allow the |
|---|
| 91 | | - * link to be kept in off state during suspend. |
|---|
| 92 | | - */ |
|---|
| 93 | | -#define UFS_DEVICE_QUIRK_NO_LINK_OFF (1 << 3) |
|---|
| 94 | | - |
|---|
| 95 | | -/* |
|---|
| 96 | 67 | * Few Toshiba UFS device models advertise RX_MIN_ACTIVATETIME_CAPABILITY as |
|---|
| 97 | 68 | * 600us which may not be enough for reliable hibern8 exit hardware sequence |
|---|
| 98 | 69 | * from UFS device. |
|---|
| .. | .. |
|---|
| 100 | 71 | * if device advertises RX_MIN_ACTIVATETIME_CAPABILITY less than 1ms. |
|---|
| 101 | 72 | */ |
|---|
| 102 | 73 | #define UFS_DEVICE_QUIRK_PA_TACTIVATE (1 << 4) |
|---|
| 103 | | - |
|---|
| 104 | | -/* |
|---|
| 105 | | - * Some UFS memory devices may have really low read/write throughput in |
|---|
| 106 | | - * FAST AUTO mode, enable this quirk to make sure that FAST AUTO mode is |
|---|
| 107 | | - * never enabled for such devices. |
|---|
| 108 | | - */ |
|---|
| 109 | | -#define UFS_DEVICE_NO_FASTAUTO (1 << 5) |
|---|
| 110 | 74 | |
|---|
| 111 | 75 | /* |
|---|
| 112 | 76 | * It seems some UFS devices may keep drawing more than sleep current |
|---|
| .. | .. |
|---|
| 138 | 102 | */ |
|---|
| 139 | 103 | #define UFS_DEVICE_QUIRK_HOST_VS_DEBUGSAVECONFIGTIME (1 << 9) |
|---|
| 140 | 104 | |
|---|
| 105 | +/* |
|---|
| 106 | + * Some pre-3.1 UFS devices can support extended features by upgrading |
|---|
| 107 | + * the firmware. Enable this quirk to make UFS core driver probe and enable |
|---|
| 108 | + * supported features on such devices. |
|---|
| 109 | + */ |
|---|
| 110 | +#define UFS_DEVICE_QUIRK_SUPPORT_EXTENDED_FEATURES (1 << 10) |
|---|
| 111 | + |
|---|
| 112 | +/* |
|---|
| 113 | + * Some UFS devices require delay after VCC power rail is turned-off. |
|---|
| 114 | + * Enable this quirk to introduce 5ms delays after VCC power-off during |
|---|
| 115 | + * suspend flow. |
|---|
| 116 | + */ |
|---|
| 117 | +#define UFS_DEVICE_QUIRK_DELAY_AFTER_LPM (1 << 11) |
|---|
| 118 | + |
|---|
| 119 | +/* |
|---|
| 120 | + * Some UFS devices require L2P entry should be swapped before being sent to the |
|---|
| 121 | + * UFS device for HPB READ command. |
|---|
| 122 | + */ |
|---|
| 123 | +#define UFS_DEVICE_QUIRK_SWAP_L2P_ENTRY_FOR_HPB_READ (1 << 12) |
|---|
| 124 | + |
|---|
| 141 | 125 | #endif /* UFS_QUIRKS_H_ */ |
|---|