]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
arm: mach-k3: Add a function for printing DM version
authorMoteen Shah <m-shah@ti.com>
Mon, 9 Jun 2025 08:14:33 +0000 (13:44 +0530)
committerTom Rini <trini@konsulko.com>
Wed, 18 Jun 2025 18:20:25 +0000 (12:20 -0600)
Add a function to print version of the DM firmware in use.
The function queries the firmware capabilities first and if
DM split mode bit is set, sends a request to TISCI for
retrieving the version information.

The DM split mode bit indicates that DM is a separate binary
altogether and hence it will have its own versioning.

Signed-off-by: Moteen Shah <m-shah@ti.com>
Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
arch/arm/mach-k3/common.c
arch/arm/mach-k3/common.h

index fc230f180d0e667fa55f9c10cffaa54afdb91424..1b09488b884b0c85f49c0e0e5296171a648688b0 100644 (file)
@@ -68,6 +68,35 @@ void k3_sysfw_print_ver(void)
               ti_sci->version.firmware_revision, fw_desc);
 }
 
+void __maybe_unused k3_dm_print_ver(void)
+{
+       struct ti_sci_handle *ti_sci = get_ti_sci_handle();
+       struct ti_sci_firmware_ops *fw_ops = &ti_sci->ops.fw_ops;
+       struct ti_sci_dm_version_info dm_info = {0};
+       u64 fw_caps;
+       int ret;
+
+       ret = fw_ops->query_dm_cap(ti_sci, &fw_caps);
+       if (ret) {
+               printf("Failed to query DM firmware capability %d\n", ret);
+               return;
+       }
+
+       if (!(fw_caps & TI_SCI_MSG_FLAG_FW_CAP_DM))
+               return;
+
+       ret = fw_ops->get_dm_version(ti_sci, &dm_info);
+       if (ret) {
+               printf("Failed to fetch DM firmware version %d\n", ret);
+               return;
+       }
+
+       printf("DM ABI: %d.%d (firmware ver 0x%04x '%s--%s' "
+              "patch_ver: %d)\n", dm_info.abi_major, dm_info.abi_minor,
+              dm_info.dm_ver, dm_info.sci_server_version,
+              dm_info.rm_pm_hal_version, dm_info.patch_ver);
+}
+
 void mmr_unlock(uintptr_t base, u32 partition)
 {
        /* Translate the base address */
index 02c74731feab84bd0b14375c30538bb7963e8d51..e19ae18dbb14c9a41de530ffba7e68ee631b2846 100644 (file)
@@ -42,6 +42,7 @@ int remove_fwl_region(struct fwl_data *fwl);
 void remove_fwl_configs(struct fwl_data *fwl_data, size_t fwl_data_size);
 int load_firmware(char *name_fw, char *name_loadaddr, u32 *loadaddr);
 void k3_sysfw_print_ver(void);
+void k3_dm_print_ver(void);
 void spl_enable_cache(void);
 void mmr_unlock(uintptr_t base, u32 partition);
 bool is_rom_loaded_sysfw(struct rom_extended_boot_data *data);