+int do_temp_log (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+{
+ int contact_temp;
+ int delay = 0;
+#if (CONFIG_COMMANDS & CFG_CMD_DATE)
+ struct rtc_time tm;
+#endif
+
+ if (argc > 2) {
+ printf ("Usage:\n%s\n", cmdtp->usage);
+ return 1;
+ }
+
+ if (argc > 1) {
+ delay = simple_strtoul(argv[1], NULL, 10);
+ }
+
+ spi_init ();
+ while (1) {
+
+#if (CONFIG_COMMANDS & CFG_CMD_DATE)
+ rtc_get (&tm);
+ printf ("%4d-%02d-%02d %2d:%02d:%02d - ",
+ tm.tm_year, tm.tm_mon, tm.tm_mday,
+ tm.tm_hour, tm.tm_min, tm.tm_sec);
+#endif
+
+ contact_temp = tsc2000_contact_temp();
+ printf ("%d\n", contact_temp) ;
+
+ if (delay != 0)
+ /*
+ * reset timer to avoid timestamp overflow problem
+ * after about 68 minutes of udelay() time.
+ */
+ reset_timer_masked ();
+ sdelay (delay);
+ }
+
+ return 0;
+}
+
+U_BOOT_CMD(
+ tlog, 2, 1, do_temp_log,
+ "tlog - log contact temperature [1/100 C] to console (endlessly)\n",
+ "delay\n"
+ " - contact temperature [1/100 C] is printed endlessly to console\n"
+ " <delay> specifies the seconds to wait between two measurements\n"
+ " For each measurment a timestamp is printeted\n"
+);
+