4e2b270d2c
* refs/heads/tmp-0d3cca0c: UPSTREAM: driver core: Skip unnecessary work when device doesn't have sync_state() Linux 5.4.26 net/smc: cancel event worker during device removal net/smc: check for valid ib_client_data ipv6: restrict IPV6_ADDRFORM operation iommu/amd: Fix IOMMU AVIC not properly update the is_run bit in IRTE i2c: acpi: put device when verifying client fails iommu/vt-d: Ignore devices with out-of-spec domain number iommu/vt-d: Fix the wrong printing in RHSA parsing netfilter: nft_chain_nat: inet family is missing module ownership netfilter: nf_tables: dump NFTA_CHAIN_FLAGS attribute netfilter: nft_tunnel: add missing attribute validation for tunnels netfilter: nft_payload: add missing attribute validation for payload csum flags netfilter: cthelper: add missing attribute validation for cthelper perf bench futex-wake: Restore thread count default to online CPU count nl80211: add missing attribute validation for channel switch nl80211: add missing attribute validation for beacon report scanning nl80211: add missing attribute validation for critical protocol indication i2c: gpio: suppress error on probe defer iommu/vt-d: Fix RCU-list bugs in intel_iommu_init() driver code: clarify and fix platform device DMA mask allocation drm/i915/gvt: Fix unnecessary schedule timer when no vGPU exits pinctrl: core: Remove extra kref_get which blocks hogs being freed drm/i915/gvt: Fix dma-buf display blur issue on CFL virtio_ring: Fix mem leak with vring_new_virtqueue() pinctrl: imx: scu: Align imx sc msg structs to 4 pinctrl: meson-gxl: fix GPIOX sdio pins clk: imx8mn: Fix incorrect clock defines batman-adv: Don't schedule OGM for disabled interface iommu/vt-d: Fix a bug in intel_iommu_iova_to_phys() for huge page iommu/vt-d: Fix RCU list debugging warnings iommu/vt-d: dmar: replace WARN_TAINT with pr_warn + add_taint iommu/dma: Fix MSI reservation allocation x86/mce: Fix logic and comments around MSR_PPIN_CTL perf/amd/uncore: Replace manual sampling check with CAP_NO_INTERRUPT flag mt76: fix array overflow on receiving too many fragments for a packet i2c: designware-pci: Fix BUG_ON during device removal efi: Add a sanity check to efivar_store_raw() efi: Fix a race and a buffer overflow while reading efivars via sysfs x86/ioremap: Map EFI runtime services data as encrypted for SEV macintosh: windfarm: fix MODINFO regression fscrypt: don't evict dirty inodes after removing key blk-iocost: fix incorrect vtime comparison in iocg_is_idle() ipmi_si: Avoid spurious errors for optional IRQs s390/dasd: fix data corruption for thin provisioned devices fuse: fix stack use after return ARC: define __ALIGN_STR and __ALIGN symbols for ARC KVM: nVMX: avoid NULL pointer dereference with incorrect EVMCS GPAs KVM: x86: clear stale x86_emulate_ctxt->intercept value gfs2_atomic_open(): fix O_EXCL|O_CREAT handling on cold dcache cifs_atomic_open(): fix double-put on late allocation failure ktest: Add timeout for ssh sync testing pinctrl: falcon: fix syntax error mmc: sdhci-pci-gli: Enable MSI interrupt for GL975x drm/i915: Defer semaphore priority bumping to a workqueue drm/i915: be more solid in checking the alignment drm/amd/display: remove duplicated assignment to grph_obj_type workqueue: don't use wq_select_unbound_cpu() for bound works netfilter: x_tables: xt_mttg_seq_next should increase position index netfilter: xt_recent: recent_seq_next should increase position index netfilter: synproxy: synproxy_cpu_seq_next should increase position index netfilter: nf_conntrack: ct_cpu_seq_next should increase position index iommu/vt-d: quirk_ioat_snb_local_iommu: replace WARN_TAINT with pr_warn + add_taint virtio-blk: fix hw_queue stopped on arbitrary error iwlwifi: mvm: Do not require PHY_SKU NVM section for 3168 devices netfilter: nf_tables: fix infinite loop when expr is not available cgroup: Iterate tasks that did not finish do_exit() cgroup: cgroup_procs_next should increase position index net: phy: Avoid multiple suspends net: dsa: Don't instantiate phylink for CPU/DSA ports unless needed selftests/net/fib_tests: update addr_metric_test for peer route testing net/ipv6: remove the old peer route if change it to a new one net/ipv6: need update peer route when modify metric net: phy: fix MDIO bus PM PHY resuming net: phy: avoid clearing PHY interrupts twice in irq handler nfc: add missing attribute validation for vendor subcommand nfc: add missing attribute validation for deactivate target nfc: add missing attribute validation for SE API tipc: add missing attribute validation for MTU property team: add missing attribute validation for array index team: add missing attribute validation for port ifindex net: taprio: add missing attribute validation for txtime delay net: fq: add missing attribute validation for orphan mask macsec: add missing attribute validation for port can: add missing attribute validation for termination nl802154: add missing attribute validation for dev_type nl802154: add missing attribute validation fib: add missing attribute validation for tun_id devlink: validate length of region addr/len devlink: validate length of param values net: memcg: fix lockdep splat in inet_csk_accept() net: memcg: late association of sock to memcg cgroup: memcg: net: do not associate sock with unrelated cgroup bnxt_en: fix error handling when flashing from file bnxt_en: reinitialize IRQs when MTU is modified bonding/alb: make sure arp header is pulled before accessing it taprio: Fix sending packets without dequeueing them slip: make slhc_compress() more robust against malicious packets sfc: detach from cb_page in efx_copy_channel() r8152: check disconnect status after long sleep net: systemport: fix index check to avoid an array out of bounds access net: stmmac: dwmac1000: Disable ACS if enhanced descs are not used net: phy: bcm63xx: fix OOPS due to missing driver name net/packet: tpacket_rcv: do not increment ring index on drop net: nfc: fix bounds checking bugs on "pipe" net: macsec: update SCI upon MAC address change. netlink: Use netlink header as base to calculate bad attribute offset net/ipv6: use configured metric when add peer route net: hns3: fix a not link up issue when fibre port supports autoneg net: fec: validate the new settings in fec_enet_set_coalesce() net: dsa: mv88e6xxx: fix lockup on warm boot net: dsa: fix phylink_start()/phylink_stop() calls macvlan: add cond_resched() during multicast processing ipvlan: don't deref eth hdr before checking it's set ipvlan: do not use cond_resched_rcu() in ipvlan_process_multicast() ipvlan: do not add hardware address of master to its unicast filter list ipvlan: add cond_resched_rcu() while processing muticast backlog ipv6/addrconf: call ipv6_mc_up() for non-Ethernet interface inet_diag: return classid for all socket types gre: fix uninit-value in __iptunnel_pull_header cgroup, netclassid: periodically release file_lock on classid updating ALSA: hda/realtek - Fixed one of HP ALC671 platform Headset Mic supported ALSA: hda/realtek - Add Headset Mic supported for HP cPC ALSA: hda/realtek - More constifications virtio_balloon: Adjust label in virtballoon_probe ANDROID: GKI: Revert "mm: unexport free_reserved_area" ANDROID: Export functions to be used with dma_map_ops in modules ANDROID: GKI: add android_kabi.h ANDROID: GKI: update abi due to CONFIG_JUMP_LABEL being enabled ANDROID: GKI: enable CONFIG_JUMP_LABEL ANDROID: Add build.config.gki-debug.x86_64 ANDROID: update the abi signatures ANDROID: Add build.config.gki-debug.aarch64 Revert "ANDROID: drm: edid: add support for additional CEA extension blocks" Revert "ANDROID: drm: Parse Colorimetry data block from EDID" ANDROID: Add build.config files for ARM 32-bit ANDROID: Kconfig.gki: Add FRAME_VECTOR UPSTREAM: cgroup: Iterate tasks that did not finish do_exit() ANDROID: gki_defconfig: Enable more USB_CONFIGFS gadgets Revert "ANDROID: tty: serdev: Fix broken serial console input" ANDROID: serdev: restrict claim of platform devices ANDROID: Add TPM support and the vTPM proxy to Cuttlefish. FROMGIT: ASoC: sprd: Allow the MCDT driver to build into modules FROMGIT: thermal: sprd: Add Spreadtrum thermal driver support FROMGIT: dt-bindings: thermal: sprd: Add the Spreadtrum thermal documentation ANDROID: ABI update due to power supply patches being merged FROMGIT: pinctrl: sprd: Fix the kconfig warning FROMGIT: pinctrl: sprd: Allow the SPRD pinctrl driver building into a module FROMGIT: pinctrl: Export some needed symbols at module load time FROMGIT: power: reset: sc27xx: Allow the SC27XX poweroff driver building into a module FROMGIT: power: reset: sc27xx: Change to use cpu_down() FROMGIT: power: reset: sc27xx: Power off the external subsystems' connection FROMGIT: power: supply: sc27xx: Add POWER_SUPPLY_PROP_CHARGE_NOW attribute UPSTREAM: power: supply: sc27xx: Calibrate the resistance of coulomb counter UPSTREAM: dt-bindings: power: sc27xx: Add a new property to describe the real resistance of coulomb counter chip UPSTREAM: power: supply: sc27xx: Optimize the battery resistance with measuring temperature UPSTREAM: power: supply: core: Add battery internal resistance temperature table support UPSTREAM: dt-bindings: power: Introduce one property to describe the battery resistance with temperature changes ANDROID: abi_gki_aarch64_whitelist: update after whitelist changes ANDROID: update abi_gki_aarch64_cuttlefish_whitelist ANDROID: update abi_gki_aarch64_db845c_whitelist ANDROID: update abi due to interconnect changes UPSTREAM: interconnect: Handle memory allocation errors UPSTREAM: interconnect: Add basic tracepoints UPSTREAM: interconnect: Add a name to struct icc_path UPSTREAM: interconnect: Move internal structs into a separate file Linux 5.4.25 drm/virtio: module_param_named() requires linux/moduleparam.h csky: Implement copy_thread_tls block, bfq: remove ifdefs from around gets/puts of bfq groups block, bfq: get a ref to a group when adding it to a service tree efi: READ_ONCE rng seed size before munmap efi/x86: Handle by-ref arguments covering multiple pages in mixed mode efi/x86: Align GUIDs to their size in the mixed mode runtime wrapper powerpc: fix hardware PMU exception bug on PowerVM compatibility mode systems EDAC/synopsys: Do not print an error with back-to-back snprintf() calls bus: ti-sysc: Fix 1-wire reset quirk arm64: dts: meson: fix gxm-khadas-vim2 wifi dmaengine: coh901318: Fix a double lock bug in dma_tc_handle() dma-buf: free dmabuf->name in dma_buf_release() hwmon: (adt7462) Fix an error return in ADT7462_REG_VOLT() ARM: dts: imx7-colibri: Fix frequency for sd/mmc ARM: dts: dra7xx-clocks: Fixup IPU1 mux clock parent source ARM: dts: am437x-idk-evm: Fix incorrect OPP node names ARM: imx: build v7_cpu_resume() unconditionally IB/hfi1, qib: Ensure RCU is locked when accessing list RMDA/cm: Fix missing ib_cm_destroy_id() in ib_cm_insert_listen() regulator: stm32-vrefbuf: fix a possible overshoot when re-enabling RDMA/core: Fix protection fault in ib_mr_pool_destroy RDMA/iwcm: Fix iwcm work deallocation RDMA/siw: Fix failure handling during device creation RDMA/nldev: Fix crash when set a QP to a new counter but QPN is missing RDMA/rw: Fix error flow during RDMA context initialization Revert "RDMA/cma: Simplify rdma_resolve_addr() error flow" soc: imx-scu: Align imx sc msg structs to 4 firmware: imx: Align imx_sc_msg_req_cpu_start to 4 firmware: imx: scu-pd: Align imx sc msg structs to 4 firmware: imx: misc: Align imx sc msg structs to 4 arm64: dts: imx8qxp-mek: Remove unexisting Ethernet PHY ARM: dts: imx6: phycore-som: fix emmc supply phy: mapphone-mdm6600: Fix write timeouts with shorter GPIO toggle interval phy: mapphone-mdm6600: Fix timeouts by adding wake-up handling drm/i915/selftests: Fix return in assert_mmap_offset() drm/i915: Program MBUS with rmw during initialization drm/sun4i: de2/de3: Remove unsupported VI layer formats drm/sun4i: Fix DE2 VI layer format support drm/sun4i: Add separate DE3 VI layer formats drm: kirin: Revert "Fix for hikey620 display offset problem" drm/panfrost: Don't try to map on error faults spi: atmel-quadspi: fix possible MMIO window size overrun ASoC: dapm: Correct DAPM handling of active widgets during shutdown ASoC: Intel: Skylake: Fix available clock counter incrementation ASoC: pcm512x: Fix unbalanced regulator enable call in probe error path ASoC: pcm: Fix possible buffer overflow in dpcm state sysfs output powerpc/mm: Fix missing KUAP disable in flush_coherent_icache() powerpc: Convert flush_icache_range & friends to C powerpc: define helpers to get L1 icache sizes ASoC: intel: skl: Fix possible buffer overflow in debug outputs ASoC: intel: skl: Fix pin debug prints ASoC: SOF: Fix snd_sof_ipc_stream_posn() ASoC: topology: Fix memleak in soc_tplg_manifest_load() ASoC: topology: Fix memleak in soc_tplg_link_elems_load() drm/virtio: fix resource id creation race drm/virtio: make resource id workaround runtime switchable. spi: bcm63xx-hsspi: Really keep pll clk enabled ARM: dts: ls1021a: Restore MDIO compatible to gianfar arm64: dts: meson-sm1-sei610: add missing interrupt-names dm: fix congested_fn for request-based device dm zoned: Fix reference counter initial value of chunk works dm writecache: verify watermark during resume dm: report suspended device during destroy dm cache: fix a crash due to incorrect work item cancelling dm integrity: fix invalid table returned due to argument count mismatch dm integrity: fix a deadlock due to offloading to an incorrect workqueue dm integrity: fix recalculation when moving from journal mode to bitmap mode dmaengine: tegra-apb: Prevent race conditions of tasklet vs free list dmaengine: tegra-apb: Fix use-after-free dmaengine: imx-sdma: Fix the event id check to include RX event for UART6 dmaengine: imx-sdma: fix context cache s390/mm: fix panic in gup_fast on large pud s390/pci: Fix unexpected write combine on resource x86/pkeys: Manually set X86_FEATURE_OSPKE to preserve existing changes spi: spidev: Fix CS polarity if GPIO descriptors are used perf arm-spe: Fix endless record after being terminated perf cs-etm: Fix endless record after being terminated perf intel-bts: Fix endless record after being terminated perf intel-pt: Fix endless record after being terminated media: v4l2-mem2mem.c: fix broken links media: vicodec: process all 4 components for RGB32 formats media: mc-entity.c: use & to check pad flags, not == media: hantro: Fix broken media controller links vt: selection, push sel_lock up vt: selection, push console lock down vt: selection, close sel_buffer race serial: 8250_exar: add support for ACCES cards tty: serial: fsl_lpuart: free IDs allocated by IDA tty:serial:mvebu-uart:fix a wrong return arm: dts: dra76x: Fix mmc3 max-frequency arm64: dts: socfpga: agilex: Fix gmac compatible btrfs: fix RAID direct I/O reads with alternate csums fat: fix uninit-memory access for partial initialized inode mm, hotplug: fix page online with DEBUG_PAGEALLOC compiled but not enabled mm: fix possible PMD dirty bit lost in set_pmd_migration_entry() mm, numa: fix bad pmd by atomically check for pmd_trans_huge when marking page tables prot_numa vgacon: Fix a UAF in vgacon_invert_region usb: core: port: do error out if usb_autopm_get_interface() fails usb: core: hub: do error out if usb_autopm_get_interface() fails usb: core: hub: fix unhandled return by employing a void function usb: cdns3: gadget: toggle cycle bit before reset endpoint usb: cdns3: gadget: link trb should point to next request usb: dwc3: gadget: Update chain bit correctly when using sg list usb: quirks: add NO_LPM quirk for Logitech Screen Share usb: storage: Add quirk for Samsung Fit flash cifs: fix rename() by ensuring source handle opened with DELETE bit cifs: don't leak -EAGAIN for stat() during reconnect ALSA: hda/realtek - Enable the headset of ASUS B9450FA with ALC294 ALSA: hda/realtek - Fix silent output on Gigabyte X570 Aorus Master ALSA: hda/realtek - Add Headset Button supported for ThinkPad X1 ALSA: hda/realtek - Add Headset Mic supported binder: prevent UAF for binderfs devices II binder: prevent UAF for binderfs devices firmware: imx: scu: Ensure sequential TX selftests: forwarding: vxlan_bridge_1d: use more proper tos value arch/csky: fix some Kconfig typos csky: Fixup compile warning for three unimplemented syscalls csky: Fixup ftrace modify panic csky/smp: Fixup boot failed when CONFIG_SMP csky: Set regs->usp to kernel sp, when the exception is from kernel csky/mm: Fixup export invalid_pte_table symbol net: thunderx: workaround BGX TX Underflow issue x86/xen: Distribute switch variables for initialization ice: Don't tell the OS that link is going down nvme: Fix uninitialized-variable warning s390/qdio: fill SL with absolute addresses x86/boot/compressed: Don't declare __force_order in kaslr_64.c nvme-pci: Use single IRQ vector for old Apple models nvme/pci: Add sleep quirk for Samsung and Toshiba drives iommu/amd: Disable IOMMU on Stoney Ridge systems net/mlx5: DR, Fix matching on vport gvmi efi: Only print errors about failing to get certs if EFI vars are found s390: make 'install' not depend on vmlinux s390/cio: cio_ignore_proc_seq_next should increase position index watchdog: da9062: do not ping the hw during stop() net: ethernet: dm9000: Handle -EPROBE_DEFER in dm9000_parse_dt() net: ks8851-ml: Fix 16-bit IO operation net: ks8851-ml: Fix 16-bit data access net: ks8851-ml: Remove 8-bit bus accessors net: atlantic: check rpc result and wait for rpc address selftests: forwarding: vxlan_bridge_1d: fix tos value selftests: forwarding: use proto icmp for {gretap, ip6gretap}_mac testing drm/msm/dsi/pll: call vco set rate explicitly drm/msm/dsi: save pll state before dsi host is powered off scsi: megaraid_sas: silence a warning drm/modes: Allow DRM_MODE_ROTATE_0 when applying video mode parameters drm/modes: Make sure to parse valid rotation value from cmdline drm: msm: Fix return type of dsi_mgr_connector_mode_valid for kCFI drm/msm/mdp5: rate limit pp done timeout warnings habanalabs: patched cb equals user cb in device memset habanalabs: do not halt CoreSight during hard reset habanalabs: halt the engines before hard-reset usb: gadget: serial: fix Tx stall after buffer overflow usb: gadget: ffs: ffs_aio_cancel(): Save/restore IRQ flags usb: gadget: composite: Support more than 500mA MaxPower selftests: fix too long argument serial: ar933x_uart: set UART_CS_{RX,TX}_READY_ORIDE ALSA: hda: do not override bus codec_mask in link_get() blktrace: fix dereference after null check kprobes: Fix optimize_kprobe()/unoptimize_kprobe() cancellation logic kbuild: fix 'No such file or directory' warning when cleaning RDMA/core: Fix use of logical OR in get_new_pps RDMA/core: Fix pkey and port assignment in get_new_pps dm thin metadata: fix lockdep complaint net: stmmac: fix notifier registration net: dsa: bcm_sf2: Forcibly configure IMP port for 1Gb/sec ALSA: hda/realtek - Fix a regression for mute led on Lenovo Carbon X1 block, bfq: do not insert oom queue into position tree block, bfq: get extra ref to prevent a queue from being freed during a group move FROMGIT: kallsyms: unexport kallsyms_lookup_name() and kallsyms_on_each_symbol() FROMGIT: samples/hw_breakpoint: drop use of kallsyms_lookup_name() FROMGIT: samples/hw_breakpoint: drop HW_BREAKPOINT_R when reporting writes UPSTREAM: fscrypt: don't evict dirty inodes after removing key ANDROID: ABI/Whitelist: update whitelist of unisoc upstream code ANDROID: gki_defconfig: Enable CONFIG_VM_EVENT_COUNTERS ANDROID: gki_defconfig: Enable CONFIG_CLEANCACHE ANDROID: arm64: update the abi with the new gki_defconfig ANDROID: gki_defconfig: disable CONFIG_DEBUG_DEVRES ANDROID: Update the abi xml file ANDROID: GKI: arm64: reserve space in cpu_hwcaps and cpu_hwcap_keys arrays FROMGIT: power: supply: Allow charger manager can be built as a module ANDROID: arm64: gki_defconfig: disable CONFIG_DEBUG_PREEMPT ANDROID: iommu/iova: Fix to use __alloc_and_insert_iova_best_fit ANDROID: enable CONFIG_WATCHDOG_CORE=y ANDROID: kbuild: align UNUSED_KSYMS_WHITELIST with upstream FROMLIST: f2fs: fix wrong check on F2FS_IOC_FSSETXATTR ANDROID: gki_defconfig: enable CONFIG_TYPEC UPSTREAM: scsi: ufs: ufs-mediatek: add waiting time for reference clock UPSTREAM: scsi: ufs: introduce common function to disable host TX LCC UPSTREAM: scsi: ufs: ufs-mediatek: fix TX LCC disabling timing UPSTREAM: scsi: ufs: ufs-mediatek: gate ref-clk during Auto-Hibern8 UPSTREAM: scsi: ufs: fix Auto-Hibern8 error detection UPSTREAM: scsi: ufs: ufs-mediatek: support linkoff state during suspend UPSTREAM: scsi: ufs: ufs-mediatek: ensure UniPro is not powered down before linkup UPSTREAM: scsi: ufs: Move ufshcd_get_max_pwr_mode() to ufshcd_device_params_init() BACKPORT: scsi: ufs: Split ufshcd_probe_hba() based on its called flow FROMGIT: driver core: Reevaluate dev->links.need_for_probe as suppliers are added FROMGIT: driver core: Call sync_state() even if supplier has no consumers ANDROID: cpufreq: times: Remove per-UID time in state tracking Revert "ANDROID: proc: Add /proc/uid directory" Revert "ANDROID: cpufreq: Add time_in_state to /proc/uid directories" ANDROID: cpufreq: times: Remove /proc/uid_concurrent_{active,policy}_time ANDROID: drm: Add support for DP 1.4 Compliance edid corruption test Revert "ANDROID: drm: Add support for DP 1.4 Compliance edid corruption test" ANDROID: staging: ion: Add an in-kernel interface to request heap info. FROMLIST: lib: test_stackinit.c: XFAIL switch variable init tests UPSTREAM: scsi: ufs: Abort gating if clock on request is pending UPSTREAM: scsi: ufs: Fix irq return code UPSTREAM: scsi: ufs: Fix register dump caused sleep in atomic context UPSTREAM: scsi: ufs-qcom: Add reset control support for host controller UPSTREAM: scsi: ufs: Add device reset in link recovery path FROMGIT: scsi: ufs-qcom: Delay specific time before gate ref clk BACKPORT: FROMGIT: scsi: ufs: Add dev ref clock gating wait time support Revert "FROMLIST: scsi: ufs: Add dev ref clock gating wait time support" FROMGIT: scsi: ufs-qcom: Adjust bus bandwidth voting and unvoting Revert "FROMLIST: scsi: ufs-qcom: Adjust bus bandwidth voting and unvoting" ANDROID: CC_FLAGS_CFI add -fno-sanitize-blacklist Conflicts: Documentation/devicetree/bindings Documentation/devicetree/bindings/power/supply/battery.txt Documentation/devicetree/bindings/power/supply/sc27xx-fg.txt drivers/dma-buf/dma-buf.c drivers/interconnect/core.c drivers/interconnect/internal.h drivers/scsi/ufs/ufs-qcom.c drivers/scsi/ufs/ufs-qcom.h drivers/scsi/ufs/ufshcd.h drivers/thermal/Makefile drivers/usb/dwc3/gadget.c drivers/usb/gadget/composite.c drivers/usb/gadget/function/f_fs.c scripts/gen_autoksyms.sh Change-Id: Ic3227858328ceef3f34273428d1c4f81b78757b2 Signed-off-by: Blagovest Kolenichev <bkolenichev@codeaurora.org>
572 lines
16 KiB
C
572 lines
16 KiB
C
/*
|
|
* Universal Flash Storage Host controller driver
|
|
*
|
|
* This code is based on drivers/scsi/ufs/ufshci.h
|
|
* Copyright (C) 2011-2013 Samsung India Software Operations
|
|
*
|
|
* Authors:
|
|
* Santosh Yaraganavi <santosh.sy@samsung.com>
|
|
* Vinayak Holikatti <h.vinayak@samsung.com>
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License
|
|
* as published by the Free Software Foundation; either version 2
|
|
* of the License, or (at your option) any later version.
|
|
* See the COPYING file in the top-level directory or visit
|
|
* <http://www.gnu.org/licenses/gpl-2.0.html>
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* This program is provided "AS IS" and "WITH ALL FAULTS" and
|
|
* without warranty of any kind. You are solely responsible for
|
|
* determining the appropriateness of using and distributing
|
|
* the program and assume all risks associated with your exercise
|
|
* of rights with respect to the program, including but not limited
|
|
* to infringement of third party rights, the risks and costs of
|
|
* program errors, damage to or loss of data, programs or equipment,
|
|
* and unavailability or interruption of operations. Under no
|
|
* circumstances will the contributor of this Program be liable for
|
|
* any damages of any kind arising from your use or distribution of
|
|
* this program.
|
|
*/
|
|
|
|
#ifndef _UFSHCI_H
|
|
#define _UFSHCI_H
|
|
|
|
enum {
|
|
TASK_REQ_UPIU_SIZE_DWORDS = 8,
|
|
TASK_RSP_UPIU_SIZE_DWORDS = 8,
|
|
ALIGNED_UPIU_SIZE = 512,
|
|
};
|
|
|
|
/* UFSHCI Registers */
|
|
enum {
|
|
REG_CONTROLLER_CAPABILITIES = 0x00,
|
|
REG_UFS_VERSION = 0x08,
|
|
REG_CONTROLLER_DEV_ID = 0x10,
|
|
REG_CONTROLLER_PROD_ID = 0x14,
|
|
REG_AUTO_HIBERNATE_IDLE_TIMER = 0x18,
|
|
REG_INTERRUPT_STATUS = 0x20,
|
|
REG_INTERRUPT_ENABLE = 0x24,
|
|
REG_CONTROLLER_STATUS = 0x30,
|
|
REG_CONTROLLER_ENABLE = 0x34,
|
|
REG_UIC_ERROR_CODE_PHY_ADAPTER_LAYER = 0x38,
|
|
REG_UIC_ERROR_CODE_DATA_LINK_LAYER = 0x3C,
|
|
REG_UIC_ERROR_CODE_NETWORK_LAYER = 0x40,
|
|
REG_UIC_ERROR_CODE_TRANSPORT_LAYER = 0x44,
|
|
REG_UIC_ERROR_CODE_DME = 0x48,
|
|
REG_UTP_TRANSFER_REQ_INT_AGG_CONTROL = 0x4C,
|
|
REG_UTP_TRANSFER_REQ_LIST_BASE_L = 0x50,
|
|
REG_UTP_TRANSFER_REQ_LIST_BASE_H = 0x54,
|
|
REG_UTP_TRANSFER_REQ_DOOR_BELL = 0x58,
|
|
REG_UTP_TRANSFER_REQ_LIST_CLEAR = 0x5C,
|
|
REG_UTP_TRANSFER_REQ_LIST_RUN_STOP = 0x60,
|
|
REG_UTP_TASK_REQ_LIST_BASE_L = 0x70,
|
|
REG_UTP_TASK_REQ_LIST_BASE_H = 0x74,
|
|
REG_UTP_TASK_REQ_DOOR_BELL = 0x78,
|
|
REG_UTP_TASK_REQ_LIST_CLEAR = 0x7C,
|
|
REG_UTP_TASK_REQ_LIST_RUN_STOP = 0x80,
|
|
REG_UIC_COMMAND = 0x90,
|
|
REG_UIC_COMMAND_ARG_1 = 0x94,
|
|
REG_UIC_COMMAND_ARG_2 = 0x98,
|
|
REG_UIC_COMMAND_ARG_3 = 0x9C,
|
|
|
|
UFSHCI_REG_SPACE_SIZE = 0xA0,
|
|
|
|
REG_UFS_CCAP = 0x100,
|
|
REG_UFS_CRYPTOCAP = 0x104,
|
|
|
|
UFSHCI_CRYPTO_REG_SPACE_SIZE = 0x400,
|
|
};
|
|
|
|
/* Controller capability masks */
|
|
enum {
|
|
MASK_TRANSFER_REQUESTS_SLOTS = 0x0000001F,
|
|
MASK_TASK_MANAGEMENT_REQUEST_SLOTS = 0x00070000,
|
|
MASK_AUTO_HIBERN8_SUPPORT = 0x00800000,
|
|
MASK_64_ADDRESSING_SUPPORT = 0x01000000,
|
|
MASK_OUT_OF_ORDER_DATA_DELIVERY_SUPPORT = 0x02000000,
|
|
MASK_UIC_DME_TEST_MODE_SUPPORT = 0x04000000,
|
|
MASK_CRYPTO_SUPPORT = 0x10000000,
|
|
};
|
|
|
|
#define UFS_MASK(mask, offset) ((mask) << (offset))
|
|
|
|
/* UFS Version 08h */
|
|
#define MINOR_VERSION_NUM_MASK UFS_MASK(0xFFFF, 0)
|
|
#define MAJOR_VERSION_NUM_MASK UFS_MASK(0xFFFF, 16)
|
|
|
|
/* Controller UFSHCI version */
|
|
enum {
|
|
UFSHCI_VERSION_10 = 0x00010000, /* 1.0 */
|
|
UFSHCI_VERSION_11 = 0x00010100, /* 1.1 */
|
|
UFSHCI_VERSION_20 = 0x00000200, /* 2.0 */
|
|
UFSHCI_VERSION_21 = 0x00000210, /* 2.1 */
|
|
UFSHCI_VERSION_30 = 0x00000300, /* 3.0 */
|
|
};
|
|
|
|
/*
|
|
* HCDDID - Host Controller Identification Descriptor
|
|
* - Device ID and Device Class 10h
|
|
*/
|
|
#define DEVICE_CLASS UFS_MASK(0xFFFF, 0)
|
|
#define DEVICE_ID UFS_MASK(0xFF, 24)
|
|
|
|
/*
|
|
* HCPMID - Host Controller Identification Descriptor
|
|
* - Product/Manufacturer ID 14h
|
|
*/
|
|
#define MANUFACTURE_ID_MASK UFS_MASK(0xFFFF, 0)
|
|
#define PRODUCT_ID_MASK UFS_MASK(0xFFFF, 16)
|
|
|
|
/* AHIT - Auto-Hibernate Idle Timer */
|
|
#define UFSHCI_AHIBERN8_TIMER_MASK GENMASK(9, 0)
|
|
#define UFSHCI_AHIBERN8_SCALE_MASK GENMASK(12, 10)
|
|
#define UFSHCI_AHIBERN8_SCALE_FACTOR 10
|
|
#define UFSHCI_AHIBERN8_MAX (1023 * 100000)
|
|
|
|
/*
|
|
* IS - Interrupt Status - 20h
|
|
*/
|
|
#define UTP_TRANSFER_REQ_COMPL 0x1
|
|
#define UIC_DME_END_PT_RESET 0x2
|
|
#define UIC_ERROR 0x4
|
|
#define UIC_TEST_MODE 0x8
|
|
#define UIC_POWER_MODE 0x10
|
|
#define UIC_HIBERNATE_EXIT 0x20
|
|
#define UIC_HIBERNATE_ENTER 0x40
|
|
#define UIC_LINK_LOST 0x80
|
|
#define UIC_LINK_STARTUP 0x100
|
|
#define UTP_TASK_REQ_COMPL 0x200
|
|
#define UIC_COMMAND_COMPL 0x400
|
|
#define DEVICE_FATAL_ERROR 0x800
|
|
#define CONTROLLER_FATAL_ERROR 0x10000
|
|
#define SYSTEM_BUS_FATAL_ERROR 0x20000
|
|
#define CRYPTO_ENGINE_FATAL_ERROR 0x40000
|
|
|
|
#define UFSHCD_UIC_HIBERN8_MASK (UIC_HIBERNATE_ENTER |\
|
|
UIC_HIBERNATE_EXIT)
|
|
|
|
#define UFSHCD_UIC_PWR_MASK (UFSHCD_UIC_HIBERN8_MASK |\
|
|
UIC_POWER_MODE)
|
|
|
|
#define UFSHCD_UIC_MASK (UIC_COMMAND_COMPL | UFSHCD_UIC_PWR_MASK)
|
|
|
|
#define UFSHCD_ERROR_MASK (UIC_ERROR |\
|
|
DEVICE_FATAL_ERROR |\
|
|
CONTROLLER_FATAL_ERROR |\
|
|
SYSTEM_BUS_FATAL_ERROR |\
|
|
CRYPTO_ENGINE_FATAL_ERROR)
|
|
|
|
#define INT_FATAL_ERRORS (DEVICE_FATAL_ERROR |\
|
|
CONTROLLER_FATAL_ERROR |\
|
|
SYSTEM_BUS_FATAL_ERROR |\
|
|
CRYPTO_ENGINE_FATAL_ERROR)
|
|
|
|
/* HCS - Host Controller Status 30h */
|
|
#define DEVICE_PRESENT 0x1
|
|
#define UTP_TRANSFER_REQ_LIST_READY 0x2
|
|
#define UTP_TASK_REQ_LIST_READY 0x4
|
|
#define UIC_COMMAND_READY 0x8
|
|
#define HOST_ERROR_INDICATOR 0x10
|
|
#define DEVICE_ERROR_INDICATOR 0x20
|
|
#define UIC_POWER_MODE_CHANGE_REQ_STATUS_MASK UFS_MASK(0x7, 8)
|
|
|
|
#define UFSHCD_STATUS_READY (UTP_TRANSFER_REQ_LIST_READY |\
|
|
UTP_TASK_REQ_LIST_READY |\
|
|
UIC_COMMAND_READY)
|
|
|
|
enum {
|
|
PWR_OK = 0x0,
|
|
PWR_LOCAL = 0x01,
|
|
PWR_REMOTE = 0x02,
|
|
PWR_BUSY = 0x03,
|
|
PWR_ERROR_CAP = 0x04,
|
|
PWR_FATAL_ERROR = 0x05,
|
|
};
|
|
|
|
#ifdef CONFIG_SCSI_UFSHCD_QTI
|
|
/* Host UIC error type */
|
|
enum ufshcd_uic_err_type {
|
|
UFS_UIC_ERROR_PA,
|
|
UFS_UIC_ERROR_DL,
|
|
UFS_UIC_ERROR_DME,
|
|
};
|
|
/* Host UIC error code PHY adapter layer */
|
|
enum ufshcd_ec_pa {
|
|
UFS_EC_PA_LANE_0,
|
|
UFS_EC_PA_LANE_1,
|
|
UFS_EC_PA_LANE_2,
|
|
UFS_EC_PA_LANE_3,
|
|
UFS_EC_PA_LINE_RESET,
|
|
UFS_EC_PA_MAX,
|
|
};
|
|
|
|
/* Host UIC error code data link layer */
|
|
enum ufshcd_ec_dl {
|
|
UFS_EC_DL_NAC_RECEIVED,
|
|
UFS_EC_DL_TCx_REPLAY_TIMER_EXPIRED,
|
|
UFS_EC_DL_AFCx_REQUEST_TIMER_EXPIRED,
|
|
UFS_EC_DL_FCx_PROTECT_TIMER_EXPIRED,
|
|
UFS_EC_DL_CRC_ERROR,
|
|
UFS_EC_DL_RX_BUFFER_OVERFLOW,
|
|
UFS_EC_DL_MAX_FRAME_LENGTH_EXCEEDED,
|
|
UFS_EC_DL_WRONG_SEQUENCE_NUMBER,
|
|
UFS_EC_DL_AFC_FRAME_SYNTAX_ERROR,
|
|
UFS_EC_DL_NAC_FRAME_SYNTAX_ERROR,
|
|
UFS_EC_DL_EOF_SYNTAX_ERROR,
|
|
UFS_EC_DL_FRAME_SYNTAX_ERROR,
|
|
UFS_EC_DL_BAD_CTRL_SYMBOL_TYPE,
|
|
UFS_EC_DL_PA_INIT_ERROR,
|
|
UFS_EC_DL_PA_ERROR_IND_RECEIVED,
|
|
UFS_EC_DL_MAX,
|
|
};
|
|
#endif
|
|
|
|
/* HCE - Host Controller Enable 34h */
|
|
#define CONTROLLER_ENABLE 0x1
|
|
#define CONTROLLER_DISABLE 0x0
|
|
#define CRYPTO_GENERAL_ENABLE 0x2
|
|
|
|
/* UECPA - Host UIC Error Code PHY Adapter Layer 38h */
|
|
#define UIC_PHY_ADAPTER_LAYER_ERROR 0x80000000
|
|
#define UIC_PHY_ADAPTER_LAYER_ERROR_CODE_MASK 0x1F
|
|
#define UIC_PHY_ADAPTER_LAYER_LANE_ERR_MASK 0xF
|
|
#ifdef CONFIG_SCSI_UFSHCD_QTI
|
|
#define UIC_PHY_ADAPTER_LAYER_GENERIC_ERROR 0x10
|
|
#endif
|
|
/* UECDL - Host UIC Error Code Data Link Layer 3Ch */
|
|
#define UIC_DATA_LINK_LAYER_ERROR 0x80000000
|
|
#define UIC_DATA_LINK_LAYER_ERROR_CODE_MASK 0xFFFF
|
|
#define UIC_DATA_LINK_LAYER_ERROR_TCX_REP_TIMER_EXP 0x2
|
|
#define UIC_DATA_LINK_LAYER_ERROR_AFCX_REQ_TIMER_EXP 0x4
|
|
#define UIC_DATA_LINK_LAYER_ERROR_FCX_PRO_TIMER_EXP 0x8
|
|
#define UIC_DATA_LINK_LAYER_ERROR_RX_BUF_OF 0x20
|
|
#define UIC_DATA_LINK_LAYER_ERROR_PA_INIT 0x2000
|
|
#define UIC_DATA_LINK_LAYER_ERROR_NAC_RECEIVED 0x0001
|
|
#define UIC_DATA_LINK_LAYER_ERROR_TCx_REPLAY_TIMEOUT 0x0002
|
|
|
|
/* UECN - Host UIC Error Code Network Layer 40h */
|
|
#define UIC_NETWORK_LAYER_ERROR 0x80000000
|
|
#define UIC_NETWORK_LAYER_ERROR_CODE_MASK 0x7
|
|
#define UIC_NETWORK_UNSUPPORTED_HEADER_TYPE 0x1
|
|
#define UIC_NETWORK_BAD_DEVICEID_ENC 0x2
|
|
#define UIC_NETWORK_LHDR_TRAP_PACKET_DROPPING 0x4
|
|
|
|
/* UECT - Host UIC Error Code Transport Layer 44h */
|
|
#define UIC_TRANSPORT_LAYER_ERROR 0x80000000
|
|
#define UIC_TRANSPORT_LAYER_ERROR_CODE_MASK 0x7F
|
|
#define UIC_TRANSPORT_UNSUPPORTED_HEADER_TYPE 0x1
|
|
#define UIC_TRANSPORT_UNKNOWN_CPORTID 0x2
|
|
#define UIC_TRANSPORT_NO_CONNECTION_RX 0x4
|
|
#define UIC_TRANSPORT_CONTROLLED_SEGMENT_DROPPING 0x8
|
|
#define UIC_TRANSPORT_BAD_TC 0x10
|
|
#define UIC_TRANSPORT_E2E_CREDIT_OVERFOW 0x20
|
|
#define UIC_TRANSPORT_SAFETY_VALUE_DROPPING 0x40
|
|
|
|
/* UECDME - Host UIC Error Code DME 48h */
|
|
#define UIC_DME_ERROR 0x80000000
|
|
#define UIC_DME_ERROR_CODE_MASK 0x1
|
|
|
|
/* UTRIACR - Interrupt Aggregation control register - 0x4Ch */
|
|
#define INT_AGGR_TIMEOUT_VAL_MASK 0xFF
|
|
#define INT_AGGR_COUNTER_THRESHOLD_MASK UFS_MASK(0x1F, 8)
|
|
#define INT_AGGR_COUNTER_AND_TIMER_RESET 0x10000
|
|
#define INT_AGGR_STATUS_BIT 0x100000
|
|
#define INT_AGGR_PARAM_WRITE 0x1000000
|
|
#define INT_AGGR_ENABLE 0x80000000
|
|
|
|
/* UTRLRSR - UTP Transfer Request Run-Stop Register 60h */
|
|
#define UTP_TRANSFER_REQ_LIST_RUN_STOP_BIT 0x1
|
|
|
|
/* UTMRLRSR - UTP Task Management Request Run-Stop Register 80h */
|
|
#define UTP_TASK_REQ_LIST_RUN_STOP_BIT 0x1
|
|
|
|
/* UICCMD - UIC Command */
|
|
#define COMMAND_OPCODE_MASK 0xFF
|
|
#define GEN_SELECTOR_INDEX_MASK 0xFFFF
|
|
|
|
#define MIB_ATTRIBUTE_MASK UFS_MASK(0xFFFF, 16)
|
|
#define RESET_LEVEL 0xFF
|
|
|
|
#define ATTR_SET_TYPE_MASK UFS_MASK(0xFF, 16)
|
|
#define CONFIG_RESULT_CODE_MASK 0xFF
|
|
#define GENERIC_ERROR_CODE_MASK 0xFF
|
|
|
|
/* GenSelectorIndex calculation macros for M-PHY attributes */
|
|
#define UIC_ARG_MPHY_TX_GEN_SEL_INDEX(lane) (lane)
|
|
#define UIC_ARG_MPHY_RX_GEN_SEL_INDEX(lane) (PA_MAXDATALANES + (lane))
|
|
|
|
#define UIC_ARG_MIB_SEL(attr, sel) ((((attr) & 0xFFFF) << 16) |\
|
|
((sel) & 0xFFFF))
|
|
#define UIC_ARG_MIB(attr) UIC_ARG_MIB_SEL(attr, 0)
|
|
#define UIC_ARG_ATTR_TYPE(t) (((t) & 0xFF) << 16)
|
|
#define UIC_GET_ATTR_ID(v) (((v) >> 16) & 0xFFFF)
|
|
|
|
/* Link Status*/
|
|
enum link_status {
|
|
UFSHCD_LINK_IS_DOWN = 1,
|
|
UFSHCD_LINK_IS_UP = 2,
|
|
};
|
|
|
|
/* UIC Commands */
|
|
enum uic_cmd_dme {
|
|
UIC_CMD_DME_GET = 0x01,
|
|
UIC_CMD_DME_SET = 0x02,
|
|
UIC_CMD_DME_PEER_GET = 0x03,
|
|
UIC_CMD_DME_PEER_SET = 0x04,
|
|
UIC_CMD_DME_POWERON = 0x10,
|
|
UIC_CMD_DME_POWEROFF = 0x11,
|
|
UIC_CMD_DME_ENABLE = 0x12,
|
|
UIC_CMD_DME_RESET = 0x14,
|
|
UIC_CMD_DME_END_PT_RST = 0x15,
|
|
UIC_CMD_DME_LINK_STARTUP = 0x16,
|
|
UIC_CMD_DME_HIBER_ENTER = 0x17,
|
|
UIC_CMD_DME_HIBER_EXIT = 0x18,
|
|
UIC_CMD_DME_TEST_MODE = 0x1A,
|
|
};
|
|
|
|
/* UIC Config result code / Generic error code */
|
|
enum {
|
|
UIC_CMD_RESULT_SUCCESS = 0x00,
|
|
UIC_CMD_RESULT_INVALID_ATTR = 0x01,
|
|
UIC_CMD_RESULT_FAILURE = 0x01,
|
|
UIC_CMD_RESULT_INVALID_ATTR_VALUE = 0x02,
|
|
UIC_CMD_RESULT_READ_ONLY_ATTR = 0x03,
|
|
UIC_CMD_RESULT_WRITE_ONLY_ATTR = 0x04,
|
|
UIC_CMD_RESULT_BAD_INDEX = 0x05,
|
|
UIC_CMD_RESULT_LOCKED_ATTR = 0x06,
|
|
UIC_CMD_RESULT_BAD_TEST_FEATURE_INDEX = 0x07,
|
|
UIC_CMD_RESULT_PEER_COMM_FAILURE = 0x08,
|
|
UIC_CMD_RESULT_BUSY = 0x09,
|
|
UIC_CMD_RESULT_DME_FAILURE = 0x0A,
|
|
};
|
|
|
|
#define MASK_UIC_COMMAND_RESULT 0xFF
|
|
|
|
#define INT_AGGR_COUNTER_THLD_VAL(c) (((c) & 0x1F) << 8)
|
|
#define INT_AGGR_TIMEOUT_VAL(t) (((t) & 0xFF) << 0)
|
|
|
|
/* Interrupt disable masks */
|
|
enum {
|
|
/* Interrupt disable mask for UFSHCI v1.0 */
|
|
INTERRUPT_MASK_ALL_VER_10 = 0x30FFF,
|
|
INTERRUPT_MASK_RW_VER_10 = 0x30000,
|
|
|
|
/* Interrupt disable mask for UFSHCI v1.1 */
|
|
INTERRUPT_MASK_ALL_VER_11 = 0x31FFF,
|
|
|
|
/* Interrupt disable mask for UFSHCI v2.1 */
|
|
INTERRUPT_MASK_ALL_VER_21 = 0x71FFF,
|
|
};
|
|
|
|
/* CCAP - Crypto Capability 100h */
|
|
union ufs_crypto_capabilities {
|
|
__le32 reg_val;
|
|
struct {
|
|
u8 num_crypto_cap;
|
|
u8 config_count;
|
|
u8 reserved;
|
|
u8 config_array_ptr;
|
|
};
|
|
};
|
|
|
|
enum ufs_crypto_key_size {
|
|
UFS_CRYPTO_KEY_SIZE_INVALID = 0x0,
|
|
UFS_CRYPTO_KEY_SIZE_128 = 0x1,
|
|
UFS_CRYPTO_KEY_SIZE_192 = 0x2,
|
|
UFS_CRYPTO_KEY_SIZE_256 = 0x3,
|
|
UFS_CRYPTO_KEY_SIZE_512 = 0x4,
|
|
};
|
|
|
|
enum ufs_crypto_alg {
|
|
UFS_CRYPTO_ALG_AES_XTS = 0x0,
|
|
UFS_CRYPTO_ALG_BITLOCKER_AES_CBC = 0x1,
|
|
UFS_CRYPTO_ALG_AES_ECB = 0x2,
|
|
UFS_CRYPTO_ALG_ESSIV_AES_CBC = 0x3,
|
|
};
|
|
|
|
/* x-CRYPTOCAP - Crypto Capability X */
|
|
union ufs_crypto_cap_entry {
|
|
__le32 reg_val;
|
|
struct {
|
|
u8 algorithm_id;
|
|
u8 sdus_mask; /* Supported data unit size mask */
|
|
u8 key_size;
|
|
u8 reserved;
|
|
};
|
|
};
|
|
|
|
#define UFS_CRYPTO_CONFIGURATION_ENABLE (1 << 7)
|
|
#define UFS_CRYPTO_KEY_MAX_SIZE 64
|
|
/* x-CRYPTOCFG - Crypto Configuration X */
|
|
union ufs_crypto_cfg_entry {
|
|
__le32 reg_val[32];
|
|
struct {
|
|
u8 crypto_key[UFS_CRYPTO_KEY_MAX_SIZE];
|
|
u8 data_unit_size;
|
|
u8 crypto_cap_idx;
|
|
u8 reserved_1;
|
|
u8 config_enable;
|
|
u8 reserved_multi_host;
|
|
u8 reserved_2;
|
|
u8 vsb[2];
|
|
u8 reserved_3[56];
|
|
};
|
|
};
|
|
|
|
/*
|
|
* Request Descriptor Definitions
|
|
*/
|
|
|
|
/* Transfer request command type */
|
|
enum {
|
|
UTP_CMD_TYPE_SCSI = 0x0,
|
|
UTP_CMD_TYPE_UFS = 0x1,
|
|
UTP_CMD_TYPE_DEV_MANAGE = 0x2,
|
|
};
|
|
|
|
/* To accommodate UFS2.0 required Command type */
|
|
enum {
|
|
UTP_CMD_TYPE_UFS_STORAGE = 0x1,
|
|
};
|
|
|
|
enum {
|
|
UTP_SCSI_COMMAND = 0x00000000,
|
|
UTP_NATIVE_UFS_COMMAND = 0x10000000,
|
|
UTP_DEVICE_MANAGEMENT_FUNCTION = 0x20000000,
|
|
UTP_REQ_DESC_INT_CMD = 0x01000000,
|
|
UTP_REQ_DESC_CRYPTO_ENABLE_CMD = 0x00800000,
|
|
};
|
|
|
|
/* UTP Transfer Request Data Direction (DD) */
|
|
enum {
|
|
UTP_NO_DATA_TRANSFER = 0x00000000,
|
|
UTP_HOST_TO_DEVICE = 0x02000000,
|
|
UTP_DEVICE_TO_HOST = 0x04000000,
|
|
};
|
|
|
|
/* Overall command status values */
|
|
enum {
|
|
OCS_SUCCESS = 0x0,
|
|
OCS_INVALID_CMD_TABLE_ATTR = 0x1,
|
|
OCS_INVALID_PRDT_ATTR = 0x2,
|
|
OCS_MISMATCH_DATA_BUF_SIZE = 0x3,
|
|
OCS_MISMATCH_RESP_UPIU_SIZE = 0x4,
|
|
OCS_PEER_COMM_FAILURE = 0x5,
|
|
OCS_ABORTED = 0x6,
|
|
OCS_FATAL_ERROR = 0x7,
|
|
OCS_DEVICE_FATAL_ERROR = 0x8,
|
|
OCS_INVALID_CRYPTO_CONFIG = 0x9,
|
|
OCS_GENERAL_CRYPTO_ERROR = 0xA,
|
|
OCS_INVALID_COMMAND_STATUS = 0x0F,
|
|
MASK_OCS = 0x0F,
|
|
};
|
|
|
|
/* The maximum length of the data byte count field in the PRDT is 256KB */
|
|
#define PRDT_DATA_BYTE_COUNT_MAX (256 * 1024)
|
|
/* The granularity of the data byte count field in the PRDT is 32-bit */
|
|
#define PRDT_DATA_BYTE_COUNT_PAD 4
|
|
|
|
/**
|
|
* struct ufshcd_sg_entry - UFSHCI PRD Entry
|
|
* @base_addr: Lower 32bit physical address DW-0
|
|
* @upper_addr: Upper 32bit physical address DW-1
|
|
* @reserved: Reserved for future use DW-2
|
|
* @size: size of physical segment DW-3
|
|
*/
|
|
struct ufshcd_sg_entry {
|
|
__le32 base_addr;
|
|
__le32 upper_addr;
|
|
__le32 reserved;
|
|
__le32 size;
|
|
/*
|
|
* followed by variant-specific fields if
|
|
* hba->sg_entry_size != sizeof(struct ufshcd_sg_entry)
|
|
*/
|
|
};
|
|
|
|
/**
|
|
* struct utp_transfer_cmd_desc - UFS Command Descriptor structure
|
|
* @command_upiu: Command UPIU Frame address
|
|
* @response_upiu: Response UPIU Frame address
|
|
* @prd_table: Physical Region Descriptor: an array of SG_ALL struct
|
|
* ufshcd_sg_entry's. Variant-specific fields may be present after each.
|
|
*/
|
|
struct utp_transfer_cmd_desc {
|
|
u8 command_upiu[ALIGNED_UPIU_SIZE];
|
|
u8 response_upiu[ALIGNED_UPIU_SIZE];
|
|
u8 prd_table[];
|
|
};
|
|
|
|
#define sizeof_utp_transfer_cmd_desc(hba) \
|
|
(sizeof(struct utp_transfer_cmd_desc) + SG_ALL * (hba)->sg_entry_size)
|
|
|
|
/**
|
|
* struct request_desc_header - Descriptor Header common to both UTRD and UTMRD
|
|
* @dword0: Descriptor Header DW0
|
|
* @dword1: Descriptor Header DW1
|
|
* @dword2: Descriptor Header DW2
|
|
* @dword3: Descriptor Header DW3
|
|
*/
|
|
struct request_desc_header {
|
|
__le32 dword_0;
|
|
__le32 dword_1;
|
|
__le32 dword_2;
|
|
__le32 dword_3;
|
|
};
|
|
|
|
/**
|
|
* struct utp_transfer_req_desc - UTRD structure
|
|
* @header: UTRD header DW-0 to DW-3
|
|
* @command_desc_base_addr_lo: UCD base address low DW-4
|
|
* @command_desc_base_addr_hi: UCD base address high DW-5
|
|
* @response_upiu_length: response UPIU length DW-6
|
|
* @response_upiu_offset: response UPIU offset DW-6
|
|
* @prd_table_length: Physical region descriptor length DW-7
|
|
* @prd_table_offset: Physical region descriptor offset DW-7
|
|
*/
|
|
struct utp_transfer_req_desc {
|
|
|
|
/* DW 0-3 */
|
|
struct request_desc_header header;
|
|
|
|
/* DW 4-5*/
|
|
__le32 command_desc_base_addr_lo;
|
|
__le32 command_desc_base_addr_hi;
|
|
|
|
/* DW 6 */
|
|
__le16 response_upiu_length;
|
|
__le16 response_upiu_offset;
|
|
|
|
/* DW 7 */
|
|
__le16 prd_table_length;
|
|
__le16 prd_table_offset;
|
|
};
|
|
|
|
/*
|
|
* UTMRD structure.
|
|
*/
|
|
struct utp_task_req_desc {
|
|
/* DW 0-3 */
|
|
struct request_desc_header header;
|
|
|
|
/* DW 4-11 - Task request UPIU structure */
|
|
struct utp_upiu_header req_header;
|
|
__be32 input_param1;
|
|
__be32 input_param2;
|
|
__be32 input_param3;
|
|
__be32 __reserved1[2];
|
|
|
|
/* DW 12-19 - Task Management Response UPIU structure */
|
|
struct utp_upiu_header rsp_header;
|
|
__be32 output_param1;
|
|
__be32 output_param2;
|
|
__be32 __reserved2[3];
|
|
};
|
|
|
|
#endif /* End of Header */
|