sifive: fu540: Enable spi-nor flash support
[platform/kernel/u-boot.git] / drivers / clk / clk_versal.c
index 7e97b0c..d3673a5 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <dm/device_compat.h>
 #include <linux/bitops.h>
 #include <linux/bitfield.h>
 #include <malloc.h>
@@ -13,6 +14,7 @@
 #include <dm.h>
 #include <asm/arch/sys_proto.h>
 #include <zynqmp_firmware.h>
+#include <linux/err.h>
 
 #define MAX_PARENT                     100
 #define MAX_NODES                      6
@@ -569,6 +571,12 @@ static void versal_get_clock_info(void)
                        continue;
 
                clock[i].valid = attr & CLK_VALID_MASK;
+
+               /* skip query for Invalid clock */
+               ret = versal_is_valid_clock(i);
+               if (ret != CLK_VALID_MASK)
+                       continue;
+
                clock[i].type = ((attr >> CLK_TYPE_SHIFT) & 0x1) ?
                                CLK_TYPE_EXTERNAL : CLK_TYPE_OUTPUT;
                nodetype = (attr >> NODE_TYPE_SHIFT) & NODE_CLASS_MASK;