2 * (C) Copyright 2004, Psyent Corporation <www.psyent.com>
3 * Scott McNutt <smcnutt@psyent.com>
5 * SPDX-License-Identifier: GPL-2.0+
10 #if defined (CONFIG_SYS_NIOS_SYSID_BASE)
14 #include <linux/time.h>
16 typedef volatile struct {
17 unsigned id; /* The system build id */
18 unsigned timestamp; /* Timestamp */
21 void display_sysid (void)
23 nios_sysid_t *sysid = (nios_sysid_t *)CONFIG_SYS_NIOS_SYSID_BASE;
28 stamp = readl (&sysid->timestamp);
29 localtime_r (&stamp, &t);
31 printf ("SYSID : %08lx, %s", readl (&sysid->id), asc);
35 int do_sysid (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
42 sysid, 1, 1, do_sysid,
43 "display Nios-II system id",
46 #endif /* CONFIG_SYS_NIOS_SYSID_BASE */