Lines Matching +full:host +full:- +full:command

1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * Universal Flash Storage Host controller driver
4 * Copyright (C) 2011-2013 Samsung India Software Operations
5 * Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
16 #include <linux/blk-crypto-profile.h>
17 #include <linux/blk-mq.h>
61 * struct uic_command - UIC command structure
62 * @command: UIC command
63 * @argument1: UIC command argument 1
64 * @argument2: UIC command argument 2
65 * @argument3: UIC command argument 3
66 * @cmd_active: Indicate if UIC command is outstanding
67 * @done: UIC command completion
70 u32 command; member
85 /* Host <-> Device UniPro Link state */
93 #define ufshcd_is_link_off(hba) ((hba)->uic_link_state == UIC_LINK_OFF_STATE)
94 #define ufshcd_is_link_active(hba) ((hba)->uic_link_state == \
96 #define ufshcd_is_link_hibern8(hba) ((hba)->uic_link_state == \
98 #define ufshcd_is_link_broken(hba) ((hba)->uic_link_state == \
100 #define ufshcd_set_link_off(hba) ((hba)->uic_link_state = UIC_LINK_OFF_STATE)
101 #define ufshcd_set_link_active(hba) ((hba)->uic_link_state = \
103 #define ufshcd_set_link_hibern8(hba) ((hba)->uic_link_state = \
105 #define ufshcd_set_link_broken(hba) ((hba)->uic_link_state = \
109 ((h)->curr_dev_pwr_mode = UFS_ACTIVE_PWR_MODE)
111 ((h)->curr_dev_pwr_mode = UFS_SLEEP_PWR_MODE)
113 ((h)->curr_dev_pwr_mode = UFS_POWERDOWN_PWR_MODE)
115 ((h)->curr_dev_pwr_mode = UFS_DEEPSLEEP_PWR_MODE)
117 ((h)->curr_dev_pwr_mode == UFS_ACTIVE_PWR_MODE)
119 ((h)->curr_dev_pwr_mode == UFS_SLEEP_PWR_MODE)
121 ((h)->curr_dev_pwr_mode == UFS_POWERDOWN_PWR_MODE)
123 ((h)->curr_dev_pwr_mode == UFS_DEEPSLEEP_PWR_MODE)
148 * struct ufshcd_lrb - local reference block
149 * @utr_descriptor_ptr: UTRD address of the command
150 * @ucd_req_ptr: UCD address of the command
151 * @ucd_rsp_ptr: Response UPIU address for this command
152 * @ucd_prdt_ptr: PRDT address of the command
157 * @cmd: pointer to SCSI command
158 * @scsi_status: SCSI status of the command
160 * @task_tag: Task tag of the command
161 * @lun: LUN of the command
162 * @intr_cmd: Interrupt command (doesn't participate in interrupt aggregation)
167 * @crypto_key_slot: the key slot to use for inline crypto (-1 if none)
187 u8 lun; /* UPIU LUN id field is only 8-bit wide */
202 * struct ufs_query - holds relevant data structures for query request
214 * struct ufs_dev_cmd - all assosiated fields with device management commands
215 * @type: device management command type - Query, NOP OUT
216 * @lock: lock to allow one command at a time
228 * struct ufs_clk_info - UFS clock related info
229 * @list: list headed by hba->clk_list_head
271 * struct ufs_hba_variant_ops - variant specific callbacks
279 * variant specific Uni-Pro initialization.
281 * to allow variant specific Uni-Pro initialization.
292 * @suspend: called during host controller PM callback
293 * @resume: called during host controller PM callback
349 * struct ufs_clk_gating - UFS clock gating related info
386 * struct ufs_clk_scaling - UFS clock scaling related data
388 * devfreq ->target() function is called then schedule "suspend_work" to
428 * struct ufs_event_hist - keeps history of errors
442 * struct ufs_stats - keeps usage/err statistics
446 * reset this after link-startup.
448 * Clear after the first successful command completion.
461 * enum ufshcd_state - UFS host controller state
462 * @UFSHCD_STATE_RESET: Link is not operational. Postpone SCSI command
464 * @UFSHCD_STATE_OPERATIONAL: The host controller is operational and can process
486 * delay before each dme command is required as the unipro
492 * If UFS host controller is having issue in processing LCC (Line
493 * Control Command) coming from device then enable this quirk.
494 * When this quirk is enabled, host controller driver should disable
508 * This quirk needs to be enabled if the host controller only allows
515 * This quirk needs to be enabled if the host controller doesn't
517 * is enabled, standard UFS host driver will call the vendor specific
528 * This quirk needs to be enabled if host controller doesn't allow
534 * This quirks needs to be enabled if host controller cannot be
540 * This quirk needs to be enabled if the host controller regards
546 * This quirk needs to be enabled if the host controller reports
552 * This quirk needs to be enabled if the host controller has
553 * auto-hibernate capability but it doesn't work.
574 * This quirk needs to be enabled if the host controller does not
575 * support UIC command
580 * This quirk needs to be enabled if the host controller cannot
581 * support physical host configuration.
586 * This quirk needs to be enabled if the host controller has
587 * 64-bit addressing supported capability but it doesn't work.
592 * This quirk needs to be enabled if the host controller has
593 * auto-hibernate capability but it's FASTAUTO only.
612 * This capability allows host controller driver to use the UFS HCI's
619 * This capability allows the device auto-bkops to be always enabled
628 * This capability allows host controller driver to automatically
635 * This capability allows the host controller driver to turn-on
642 * This capability allows the host controller driver to use the
655 * This capability allows the host controller driver to use DeepSleep,
656 * if it is supported by the UFS device. The host controller driver must
657 * support device hardware reset via the hba->device_reset() callback,
663 * This capability allows the host controller driver to use temperature
684 * struct ufshpb_dev_info - UFSHPB device related info
688 * @srgn_size: device reported HPB sub-region size
693 * @control_mode: either host or device
727 * struct ufs_hba - per adapter private structure
729 * @ucdl_base_addr: UFS Command Descriptor base address
732 * @ucdl_dma_addr: UFS Command Descriptor DMA address
735 * @host: Scsi_Host instance of the driver
744 * @ahit: value of Auto-Hibernate Idle Timer register.
765 * @active_uic_cmd: handle of active UIC command
766 * @uic_cmd_mutex: mutex for UIC command
789 * @dev_cmd: ufs device management command information
790 * @last_dme_cmd_tstamp: time stamp of the last completed DME command
795 * @clk_list_head: UFS host controller clocks list node head
817 * @ufshpb_dev: information related to HPB (Host Performance Booster).
845 struct Scsi_Host *host; member
861 /* Auto-Hibernate Idle Timer register value */
926 /* Keeps information of the UFS device connected to this host */
941 /* Control to enable/disable host capabilities */
983 return hba->caps & UFSHCD_CAP_CLK_GATING; in ufshcd_is_clkgating_allowed()
987 return hba->caps & UFSHCD_CAP_HIBERN8_WITH_CLK_GATING; in ufshcd_can_hibern8_during_gating()
991 return hba->caps & UFSHCD_CAP_CLK_SCALING; in ufshcd_is_clkscaling_supported()
995 return hba->caps & UFSHCD_CAP_AUTO_BKOPS_SUSPEND; in ufshcd_can_autobkops_during_suspend()
999 return hba->caps & UFSHCD_CAP_RPM_AUTOSUSPEND; in ufshcd_is_rpm_autosuspend_allowed()
1004 return (hba->caps & UFSHCD_CAP_INTR_AGGR) && in ufshcd_is_intr_aggr_allowed()
1005 !(hba->quirks & UFSHCD_QUIRK_BROKEN_INTR_AGGR); in ufshcd_is_intr_aggr_allowed()
1011 (hba->caps & UFSHCD_CAP_AGGR_POWER_COLLAPSE)); in ufshcd_can_aggressive_pc()
1016 return (hba->capabilities & MASK_AUTO_HIBERN8_SUPPORT) && in ufshcd_is_auto_hibern8_supported()
1017 !(hba->quirks & UFSHCD_QUIRK_BROKEN_AUTO_HIBERN8); in ufshcd_is_auto_hibern8_supported()
1022 return FIELD_GET(UFSHCI_AHIBERN8_TIMER_MASK, hba->ahit); in ufshcd_is_auto_hibern8_enabled()
1027 return hba->caps & UFSHCD_CAP_WB_EN; in ufshcd_is_wb_allowed()
1032 return hba->caps & UFSHCD_CAP_WB_WITH_CLK_SCALING; in ufshcd_enable_wb_if_scaling_up()
1036 writel((val), (hba)->mmio_base + (reg))
1038 readl((hba)->mmio_base + (reg))
1041 * ufshcd_rmwl - perform read/modify/write for a controller register
1079 * ufshcd_set_variant - set variant specific data to the hba
1086 hba->priv = variant; in ufshcd_set_variant()
1090 * ufshcd_get_variant - get variant specific data from the hba
1096 return hba->priv; in ufshcd_get_variant()
1119 /* UIC command interfaces for DME primitives */
1167 return (pwr_info->pwr_rx == FAST_MODE || in ufshcd_is_hs_mode()
1168 pwr_info->pwr_rx == FASTAUTO_MODE) && in ufshcd_is_hs_mode()
1169 (pwr_info->pwr_tx == FAST_MODE || in ufshcd_is_hs_mode()
1170 pwr_info->pwr_tx == FASTAUTO_MODE); in ufshcd_is_hs_mode()
1217 if (hba->vops && hba->vops->init) in ufshcd_vops_init()
1218 return hba->vops->init(hba); in ufshcd_vops_init()
1225 if (hba->vops && hba->vops->phy_initialization) in ufshcd_vops_phy_initialization()
1226 return hba->vops->phy_initialization(hba); in ufshcd_vops_phy_initialization()