Example Folder in Libraries - 2024.1 English

Porting Guide for embeddedsw Components System Device Tree Based Build Flow (UG1647)

Document ID
UG1647
Release Date
2024-06-21
Version
2024.1 English

Changes needed in library examples are similar to that needed for driver examples. Refer to Examples Folder in Drivers.

--- a/lib/sw_services/xilloader/data/xilloader.yaml
+++ b/lib/sw_services/xilloader/data/xilloader.yaml
@@ -25,4 +25,12 @@ depends_libs:
  xilpm: {}
  xilpdi: {}
  xilffs: {}
 
+
+examples:
+  xilloader_add_image_store_pdi_example.c:
+    - supported_platforms:
+      - Versal
+  xilloader_load_pdi_example.c:
+    - supported_platforms:
+      - Versal
+  xilloader_update_multiboot.c:
+    - supported_platforms:
+      - Versal
--- a/lib/sw_services/xilloader/examples/xilloader_add_image_store_pdi_example.c
+++ b/lib/sw_services/xilloader/examples/xilloader_add_image_store_pdi_example.c
@@ -20,6 +20,7 @@
  *       bsv  08/18/2022   Fix typo in CmdId
  * 1.1   sk   03/10/2023   Updated changes to command format
  *       sk   04/18/2023   Added support for versalnet
+ * 1.9   ng   06/21/2023   Added support for system device-tree flow
  */
 #include <stdio.h>
 #include "xil_printf.h"
@@ -27,6 +28,12 @@
 #include "xipipsu.h"
 #include "xil_cache.h"
 
+#ifdef SDT
+#define IOMODULE_DEVICE (XPAR_XIOMODULE_0_BASEADDR)
+#else
+#define IOMODULE_DEVICE (XPAR_IOMODULE_0_DEVICE_ID)
+#endif
+
 #if defined(VERSAL_NET)
 #define TARGET_IPI_INT_MASK    XPAR_XIPIPS_TARGET_PSX_PMC_0_CH0_MASK
 #else
@@ -82,7 +89,7 @@ static int DoIpiTest(void)
        Xil_DCacheDisable();
 
        /* Look Up the config data */
-       IpiCfgPtr = XIpiPsu_LookupConfig(0U);
+       IpiCfgPtr = XIpiPsu_LookupConfig(IOMODULE_DEVICE);
        if (NULL == IpiCfgPtr) {
                goto END;
        }