]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - arch/arm/cpu/arm926ejs/mxs/spl_boot.c
TX6 Release 2013-04-22
[karo-tx-uboot.git] / arch / arm / cpu / arm926ejs / mxs / spl_boot.c
index 1b8502eb9dc03bf3e4edcc1914830db5dc2ed3ef..57da57dd9b9dcc134885ab74ee863fa4b110c1ff 100644 (file)
  * takes a few seconds to roll. The boot doesn't take that long, so to keep the
  * code simple, it doesn't take rolling into consideration.
  */
+/*
+ * There's nothing to be taken into consideration for the rollover.
+ * Two's complement arithmetic used correctly does all the magic automagically.
+ */
 void early_delay(int delay)
 {
        struct mxs_digctl_regs *digctl_regs =
                (struct mxs_digctl_regs *)MXS_DIGCTL_BASE;
+       u32 start = readl(&digctl_regs->hw_digctl_microseconds);
 
-       uint32_t st = readl(&digctl_regs->hw_digctl_microseconds);
-       st += delay;
-       while (st > readl(&digctl_regs->hw_digctl_microseconds))
-               ;
+       while (readl(&digctl_regs->hw_digctl_microseconds) - start < delay);
 }
 
 #define        MUX_CONFIG_BOOTMODE_PAD (MXS_PAD_3V3 | MXS_PAD_4MA | MXS_PAD_NOPULL)
@@ -111,7 +113,7 @@ void mxs_common_spl_init(const iomux_cfg_t *iomux_setup,
        mxs_power_wait_pswitch();
 }
 
-/* Support aparatus */
+/* Support apparatus */
 inline void board_init_f(unsigned long bootflag)
 {
        for (;;)
@@ -124,9 +126,14 @@ inline void board_init_r(gd_t *id, ulong dest_addr)
                ;
 }
 
+#ifndef CONFIG_SPL_SERIAL_SUPPORT
+void serial_putc(const char c) {}
+void serial_puts(const char *s) {}
+#endif
 void hang(void) __attribute__ ((noreturn));
 void hang(void)
 {
+       serial_puts("ERROR: please reset the target\n");
        for (;;)
                ;
 }