[PATCH 4/5] ufs: add ufs tool the configuration

Raz Ben Yehuda raz.benyehuda at mobileye.com
Mon Jun 1 13:26:04 CEST 2026


Add the ufs tool to the Kconfig and Makefile
Signed-off-by: Raz Ben Yehuda <raz.benyehuda at mobileye.com>
---
 drivers/ufs/Kconfig  | 48 ++++++++++++++++++++++++++++++++++++++++++++
 drivers/ufs/Makefile |  1 +
 2 files changed, 49 insertions(+)

diff --git a/drivers/ufs/Kconfig b/drivers/ufs/Kconfig
index 49472933de3..35ef6bb3860 100644
--- a/drivers/ufs/Kconfig
+++ b/drivers/ufs/Kconfig
@@ -8,6 +8,54 @@ config UFS
 	  This selects support for Universal Flash Subsystem (UFS).
 	  Say Y here if you want UFS Support.
 
+config UFS_TOOL
+	bool "ufs tool"
+	depends on UFS
+	help
+	query [lun] [idn]:
+		(0h) Device desc
+		(7h) Geometry desc
+		(8h) Power desc
+		(2h) Unit desc
+		(1h) Config desc
+
+		set_lun [LUN] [parm]
+			lu_enable, boot_lun_id, lu_write_protect memory_type
+			data_reliability num_allocunits logical_block_size
+			provisioning_type context_capabilities
+			lu_num_write_booster_buffer_allocunits
+
+		set_dev_desc [parm] [value]
+			descriptor_idn, device, device_class
+			device_sub_class, number_lu, boot_enable
+			descr_access_en, init_power_mode, high_priority_lun
+			secure_removal_type, initactive_icc_level
+			queue_depth, write_booster_buffer_preserve_user_space_en
+			write_booster_buffer_type, spec_version, manufacturer_id
+			periodic_rtc_update, device_version, psa_max_data_size
+			extended_ufs_features_support,
+			num_shared_write_booster_buffer_allocunits
+			write_booster_buffer_preserve_user_space_en
+
+		set_cfg_desc [parm] [value]
+			length, descriptor_idn, conf_desc_continue
+			boot_enable, descr_access_en, initpower_mode
+			high_priority_lun, secure_removal_type, init_active_icc_level
+			periodic_rtc_update, reserved_HPB, rpmb_region_enable
+			rpmb_region1_size, rpmb_region2_size, rpmb_region3_size
+			write_booster_buffer_preserve_user_space_en
+			write_booster_buffer_type
+			num_shared_write_booster_buffer_allocunits
+
+		flag [flag name]
+			deviceinit, permanent_wpe, pwr_on_wpe, bkops_en, life_span_mode
+			purge_enable, fphy_resource_removal, busy_rtc
+			permanently_disable_fw_update, write_booster_en
+			wb_buf_flush_en, wb_buf_flush_h8
+
+		luns
+			list the current luns
+
 config UFS_AMD_VERSAL2
 	bool "AMD Versal Gen 2 UFS controller platform driver"
 	depends on UFS && ZYNQMP_FIRMWARE
diff --git a/drivers/ufs/Makefile b/drivers/ufs/Makefile
index e7f3c1d30c4..0e472782261 100644
--- a/drivers/ufs/Makefile
+++ b/drivers/ufs/Makefile
@@ -4,6 +4,7 @@
 #
 
 obj-$(CONFIG_UFS) += ufs-uclass.o
+obj-$(CONFIG_UFS_TOOL) += ufs_tool.o
 obj-$(CONFIG_UFS_AMD_VERSAL2) += ufs-amd-versal2.o ufshcd-dwc.o
 obj-$(CONFIG_UFS_CADENCE) += cdns-platform.o
 obj-$(CONFIG_UFS_MEDIATEK) += ufs-mediatek.o
-- 
2.43.0



More information about the U-Boot mailing list