Merge git://git.denx.de/u-boot-rockchip
[oweals/u-boot.git] / arch / arm / mach-rockchip / rk322x-board.c
index 63875557ec93d362004709f63678c3832b388446..e71847de8799b4d1bc2bdff26e634c381b8455a5 100644 (file)
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#define GRF_BASE       0x11000000
-
-static void setup_boot_mode(void)
-{
-       struct rk322x_grf *const grf = (void *)GRF_BASE;
-       int boot_mode = readl(&grf->os_reg[4]);
-
-       debug("boot mode %x.\n", boot_mode);
-
-       /* Clear boot mode */
-       writel(BOOT_NORMAL, &grf->os_reg[4]);
-
-       switch (boot_mode) {
-       case BOOT_FASTBOOT:
-               printf("enter fastboot!\n");
-               env_set("preboot", "setenv preboot; fastboot usb0");
-               break;
-       case BOOT_UMS:
-               printf("enter UMS!\n");
-               env_set("preboot", "setenv preboot; ums mmc 0");
-               break;
-       }
-}
-
 __weak int rk_board_late_init(void)
 {
        return 0;
@@ -68,6 +44,14 @@ int board_init(void)
                     CON_IOMUX_UART2SEL_MASK,
                     CON_IOMUX_UART2SEL_21 << CON_IOMUX_UART2SEL_SHIFT);
 
+       /*
+       * The integrated macphy is enabled by default, disable it
+       * for saving power consuming.
+       */
+       rk_clrsetreg(&grf->macphy_con[0],
+                    MACPHY_CFG_ENABLE_MASK,
+                    0 << MACPHY_CFG_ENABLE_SHIFT);
+
        return 0;
 }