[PATCH v4 2/4] ufs: Expose selected UFS functions

Tom Rini trini at konsulko.com
Fri Jun 12 18:35:05 CEST 2026


On Thu, Jun 11, 2026 at 10:49:36AM +0300, Raz Ben Yehuda wrote:
> 
>     Remove the static qualifier from selected functions to allow
>     future reuse. Add flags according to UFS 3.1.
> 
> Signed-off-by: Raz Ben Yehuda <raz.benyehuda at mobileye.com>
> ---
>  drivers/ufs/ufs-uclass.c |  18 +-
>  drivers/ufs/ufs.h        |  52 ----
>  include/ufs.h            | 603 ++++++++++++++++++++++++++++++++++++++++++++++-
>  3 files changed, 610 insertions(+), 63 deletions(-)
> 
> diff --git a/drivers/ufs/ufs-uclass.c b/drivers/ufs/ufs-uclass.c
> index 6a51f337e47..78f6064ddea 100644
> --- a/drivers/ufs/ufs-uclass.c
> +++ b/drivers/ufs/ufs-uclass.c
> @@ -757,7 +757,7 @@ static inline u8 ufshcd_get_upmcrs(struct ufs_hba *hba)
>   *
>   * Flush cache in aligned address..address+size range.
>   */
> -static void ufshcd_cache_flush(void *addr, unsigned long size)
> +void ufshcd_cache_flush(void *addr, unsigned long size)
>  {
>  	uintptr_t start_addr = (uintptr_t)addr & ~(ARCH_DMA_MINALIGN - 1);
>  	uintptr_t end_addr = ALIGN((uintptr_t)addr + size, ARCH_DMA_MINALIGN);

We should be removing the comments here as well, when making these
functions public, so that we don't end up with conflicting descriptions
in the future.

[snip]
> diff --git a/include/ufs.h b/include/ufs.h
> index f6e27d90e43..b8af475661a 100644
> --- a/include/ufs.h
> +++ b/include/ufs.h
> @@ -1,6 +1,64 @@
>  /* SPDX-License-Identifier: GPL-2.0+ */
> -#ifndef _UFS_H
> -#define _UFS_H
> +#ifndef _UFS_CMD_H
> +#define _UFS_CMD_H

Why did you do that?

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20260612/d5821eb0/attachment.sig>


More information about the U-Boot mailing list