]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - cpu/nios2/sysid.c
rename CFG_ macros to CONFIG_SYS
[people/ms/u-boot.git] / cpu / nios2 / sysid.c
index 2b7a569cc50151d9edc8773fee1612304a02d505..afd5d83d95de91f113d1f6437c990328470f81ee 100644 (file)
 
 #include <common.h>
 
-#if defined (CFG_NIOS_SYSID_BASE)
+#if defined (CONFIG_SYS_NIOS_SYSID_BASE)
 
 #include <command.h>
-#include <nios2.h>
+#include <asm/io.h>
 #include <nios2-io.h>
 #include <linux/time.h>
 
 void display_sysid (void)
 {
-       struct nios_sysid_t *sysid =
-               (struct nios_sysid_t *)CACHE_BYPASS(CFG_NIOS_SYSID_BASE);
+       struct nios_sysid_t *sysid = (struct nios_sysid_t *)CONFIG_SYS_NIOS_SYSID_BASE;
        struct tm t;
        char asc[32];
+       time_t stamp;
 
-       localtime_r ((time_t *)&sysid->timestamp, &t);
+       stamp = readl (&sysid->timestamp);
+       localtime_r (&stamp, &t);
        asctime_r (&t, asc);
-       printf ("SYSID : %08x, %s", sysid->id, asc);
+       printf ("SYSID : %08lx, %s", readl (&sysid->id), asc);
 
 }
 
@@ -54,4 +55,4 @@ U_BOOT_CMD(
        "sysid   - display Nios-II system id\n\n",
        "\n    - display Nios-II system id\n"
 );
-#endif /* CFG_NIOS_SYSID_BASE */
+#endif /* CONFIG_SYS_NIOS_SYSID_BASE */