aboutsummaryrefslogtreecommitdiff
path: root/drivers/ufs/ufs.c
AgeCommit message (Collapse)AuthorFilesLines
2024-05-20Restore patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"WIP/20May2024-nextTom Rini1-1/+0
As part of bringing the master branch back in to next, we need to allow for all of these changes to exist here. Reported-by: Jonas Karlman <jonas@kwiboo.se> Signed-off-by: Tom Rini <trini@konsulko.com>
2024-05-19Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet""Tom Rini1-0/+1
When bringing in the series 'arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"' I failed to notice that b4 noticed it was based on next and so took that as the base commit and merged that part of next to master. This reverts commit c8ffd1356d42223cbb8c86280a083cc3c93e6426, reversing changes made to 2ee6f3a5f7550de3599faef9704e166e5dcace35. Reported-by: Jonas Karlman <jonas@kwiboo.se> Signed-off-by: Tom Rini <trini@konsulko.com>
2024-05-07ufs: Remove <common.h> and add needed includesTom Rini1-1/+0
Remove <common.h> from this driver directory and when needed add missing include files directly. Signed-off-by: Tom Rini <trini@konsulko.com>
2023-11-27Merge patch series "ufs: Add a PCI UFS controller support"WIP/27Nov2023-nextTom Rini1-11/+20
To quote the author: This adds a PCI UFS controller support and enables the support on QEMU RISC-V for testing. Requiring QEMU v8.2+.
2023-11-27ufs: Handle UFS 3.1 controllersBin Meng1-1/+2
Extend the version check to handle UFS 3.1 controllers as well. Tested on QEMU emulated UFS 3.1 controller. Signed-off-by: Bin Meng <bmeng@tinylab.org> Reviewed-by: Neha Malcom Francis <n-francis@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-11-27ufs: Allow mmio registers on the PCI busBin Meng1-1/+9
Check if the UFS controller is on the PCI bus, and get its register base address accordingly. Signed-off-by: Bin Meng <bmeng@tinylab.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
2023-11-27ufs: Add a line feed to the end of some dev_xxx() messagesBin Meng1-8/+8
Add a line feed to improve readability of some dev_xxx() messages. Signed-off-by: Bin Meng <bmeng@tinylab.org> Reviewed-by: Neha Malcom Francis <n-francis@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-11-27ufs: Correct the UFS terminlogyBin Meng1-1/+1
UFS stands for Universal Flash Storage, not Subsytem. Signed-off-by: Bin Meng <bmeng@tinylab.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
2023-11-10tree-wide: Replace http:// link with https:// link for ti.comNishanth Menon1-1/+1
Replace instances of http://www.ti.com with https://www.ti.com Signed-off-by: Nishanth Menon <nm@ti.com>
2023-08-24ufs: Implement cache managementWIP/2023-08-24-further-ufs-updatesMarek Vasut1-1/+41
Add function to flush and invalidate cache over request and response queue entries, and perform flush and optional invalidate over block layer data that are passed into the UFS layer. This makes it possible to use UFS with caches enabled. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Bhupesh Sharma <bhupesh.sharma@linaro.org> Tested-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
2023-08-24ufs: Use utp_transfer_req_desc pointer in ufshcd_get_tr_ocsMarek Vasut1-1/+3
Use utp_transfer_req_desc pointer to reference to utrdl queue instead of referencing the queue directly. This makes the code more consistent. No functional change. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Bhupesh Sharma <bhupesh.sharma@linaro.org> Tested-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
2023-08-24ufs: Pass hba pointer to ufshcd_prepare_req_desc_hdr()Marek Vasut1-5/+4
Pass the hba pointer itself to ufshcd_prepare_req_desc_hdr() instead of duplicating utp_transfer_req_desc access at each call site. No functional change. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Bhupesh Sharma <bhupesh.sharma@linaro.org> Tested-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
2023-08-24ufs: Handle UFS 3.0 controllersMarek Vasut1-1/+2
Extend the version check to handle UFS 3.0 controllers as well. Tested on R-Car S4 UFS 3.0 controller. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Bhupesh Sharma <bhupesh.sharma@linaro.org> Tested-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
2023-08-24ufs: Add UFSHCD_QUIRK_HIBERN_FASTAUTOMarek Vasut1-2/+7
Add UFSHCD_QUIRK_HIBERN_FASTAUTO quirk for host controllers which supports auto-hibernate the capability but only FASTAUTO mode. Ported from Linux kernel commit 2f11bbc2c7f3 ("scsi: ufs: core: Add UFSHCD_QUIRK_HIBERN_FASTAUTO") Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Bhupesh Sharma <bhupesh.sharma@linaro.org> Tested-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
2023-08-24ufs: Add UFSHCD_QUIRK_BROKEN_64BIT_ADDRESSMarek Vasut1-0/+26
Add UFSHCD_QUIRK_BROKEN_64BIT_ADDRESS for host controllers which do not support 64-bit addressing. Ported from Linux kernel commit 6554400d6f66 ("scsi: ufs: core: Add UFSHCD_QUIRK_BROKEN_64BIT_ADDRESS") with ufs_scsi_buffer_aligned() based on U-Boot generic bounce buffer. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Bhupesh Sharma <bhupesh.sharma@linaro.org> Tested-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
2023-07-14ufs: Use 'TASK_TAG' to construct the ucd_req_ptr->header.dword_0Bhupesh Sharma1-1/+1
Instead of using the hard-coded value of 0x1f, use 'TASK_TAG' macro instead to construct the ucd_req_ptr->header.dword_0 This is in sync with what the Linux UFS driver does, i.e. set the byte0 equal to TASK_TAG (see [1]). Setting it to a fixed value of 0x1f is wrong as we define TASK_TAG as 0 inside u-boot ufs framework. So, instead we should use the macro value directly. [1]. https://github.com/torvalds/linux/blob/master/drivers/ufs/core/ufshcd.c#L2705 Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
2023-05-06drivers: use dev_read_addr_ptr when cast to pointerJohan Jonker1-1/+1
The fdt_addr_t and phys_addr_t size have been decoupled. A 32bit CPU can expect 64-bit data from the device tree parser, so use dev_read_addr_ptr instead of the dev_read_addr function in the various files in the drivers directory that cast to a pointer. As we are there also streamline the error response to -EINVAL on return. Signed-off-by: Johan Jonker <jbx6244@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-12-13dm: treewide: Rename ..._platdata variables to just ..._platSimon Glass1-1/+1
Try to maintain some consistency between these variables by using _plat as a suffix for them. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-12-13dm: treewide: Rename 'platdata' variables to just 'plat'Simon Glass1-1/+1
We use 'priv' for private data but often use 'platdata' for platform data. We can't really use 'pdata' since that is ambiguous (it could mean private or platform data). Rename some of the latter variables to end with 'plat' for consistency. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-08-03ufs: Drop dm.h header fileSimon Glass1-1/+2
This header file should not be included in other header files. Remove it and use a forward declaration instead. Also drop asm/io.h Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18common: Drop linux/bitops.h from common headerSimon Glass1-0/+1
Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18common: Drop linux/delay.h from common headerSimon Glass1-0/+1
Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18common: Drop log.h from common headerSimon Glass1-0/+1
Move this header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-02-19dma-mapping: move dma_map_(un)single() to <linux/dma-mapping.h>Masahiro Yamada1-1/+1
The implementation of dma_map_single() and dma_unmap_single() is exactly the same for all the architectures that support them. Factor them out to <linux/dma-mapping.h>, and make all drivers to include <linux/dma-mapping.h> instead of <asm/dma-mapping.h>. If we need to differentiate them for some architectures, we can move the generic definitions to <asm-generic/dma-mapping.h>. Add some comments to the helpers. The concept is quite similar to the DMA-API of Linux kernel. Drivers are agnostic about what is going on behind the scene. Just call dma_map_single() before the DMA, and dma_unmap_single() after it. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2020-02-05dm: core: Create a new header file for 'compat' featuresSimon Glass1-0/+1
At present dm/device.h includes the linux-compatible features. This requires including linux/compat.h which in turn includes a lot of headers. One of these is malloc.h which we thus end up including in every file in U-Boot. Apart from the inefficiency of this, it is problematic for sandbox which needs to use the system malloc() in some files. Move the compatibility features into a separate header file. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-02-05dm: core: Require users of devres to include the headerSimon Glass1-0/+1
At present devres.h is included in all files that include dm.h but few make use of it. Also this pulls in linux/compat which adds several more headers. Drop the automatic inclusion and require files to include devres themselves. This provides a good indication of which files use devres. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Anatolij Gustschin <agust@denx.de>
2019-10-23ufs: Add Initial Support for UFS subsystemFaiz Abbas1-0/+1968
Add Support for UFS Host Controller Interface (UFSHCI) for communicating with Universal Flash Storage (UFS) devices. The steps to initialize the host controller interface are the following: - Initiate the Host Controller Initialization process by writing to the Host controller enable register. - Configure the Host Controller base address registers by allocating a host memory space and related data structures. - Unipro link startup procedure - Check for connected device - Configure UFS host controller to process requests Also register this host controller as a SCSI host controller. Taken from Linux Kernel v5.2 (drivers/scsi/ufs/ufshcd.c) and ported to U-boot. Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>