ARM64: zynqmp: Record board name as serial number for DFU/FASTBOOT
[platform/kernel/u-boot.git] / board / xilinx / zynqmp / zynqmp.c
index 566b5e8..7e67288 100644 (file)
@@ -86,6 +86,17 @@ static int chip_id(void)
 
        smc_call(&regs);
 
+       /*
+        * SMC returns:
+        * regs[0][31:0]  = status of the operation
+        * regs[0][63:32] = CSU.IDCODE register
+        * regs[1][31:0]  = CSU.version register
+        */
+       regs.regs[0] = upper_32_bits(regs.regs[0]);
+       regs.regs[0] &= ZYNQMP_CSU_IDCODE_DEVICE_CODE_MASK |
+                       ZYNQMP_CSU_IDCODE_SVD_MASK;
+       regs.regs[0] >>= ZYNQMP_CSU_IDCODE_SVD_SHIFT;
+
        return regs.regs[0];
 }
 
@@ -411,6 +422,10 @@ int board_usb_init(int index, enum usb_init_type init)
 {
        debug("%s: index %x\n", __func__, index);
 
+#if defined(CONFIG_USB_GADGET_DOWNLOAD)
+       g_dnl_set_serialnumber(CONFIG_SYS_CONFIG_NAME);
+#endif
+
        switch (index) {
        case 0:
                return dwc3_uboot_init(&dwc3_device_data0);
@@ -427,8 +442,3 @@ int board_usb_cleanup(int index, enum usb_init_type init)
        return 0;
 }
 #endif
-
-void reset_misc(void)
-{
-       psci_system_reset(true);
-}