mxs: Implement common function to setup VDDx
[oweals/u-boot.git] / arch / arm / cpu / arm926ejs / mxs / spl_boot.c
index 84d4a17d65c83e8f025400dde69ba4c91691a92e..8ea7c36f46f8d94ed5b5953362fead3f431ba254 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.
  */
-#define        HW_DIGCTRL_MICROSECONDS 0x8001c0c0
 void early_delay(int delay)
 {
-       uint32_t st = readl(HW_DIGCTRL_MICROSECONDS);
+       struct mxs_digctl_regs *digctl_regs =
+               (struct mxs_digctl_regs *)MXS_DIGCTL_BASE;
+
+       uint32_t st = readl(&digctl_regs->hw_digctl_microseconds);
        st += delay;
-       while (st > readl(HW_DIGCTRL_MICROSECONDS))
+       while (st > readl(&digctl_regs->hw_digctl_microseconds))
                ;
 }
 
@@ -82,9 +84,9 @@ uint8_t mxs_get_bootmode_index(void)
        bootmode |= (gpio_get_value(MX28_PAD_LCD_D04__GPIO_1_4) ? 1 : 0) << 4;
        bootmode |= (gpio_get_value(MX28_PAD_LCD_D05__GPIO_1_5) ? 1 : 0) << 5;
 
-       for (i = 0; i < ARRAY_SIZE(mx28_boot_modes); i++) {
-               masked = bootmode & mx28_boot_modes[i].boot_mask;
-               if (masked == mx28_boot_modes[i].boot_pads)
+       for (i = 0; i < ARRAY_SIZE(mxs_boot_modes); i++) {
+               masked = bootmode & mxs_boot_modes[i].boot_mask;
+               if (masked == mxs_boot_modes[i].boot_pads)
                        break;
        }
 
@@ -122,10 +124,6 @@ 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)
 {