Merge tag 'u-boot-imx-20200825' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
[platform/kernel/u-boot.git] / arch / arm / mach-uniphier / board_late_init.c
index 14b61fc..8c5e5bb 100644 (file)
@@ -5,33 +5,15 @@
  *   Author: Masahiro Yamada <yamada.masahiro@socionext.com>
  */
 
-#include <common.h>
 #include <env.h>
+#include <init.h>
 #include <spl.h>
 #include <linux/libfdt.h>
-#include <nand.h>
 #include <stdio.h>
-#include <linux/io.h>
 #include <linux/printk.h>
-#include <../drivers/mtd/nand/raw/denali.h>
 
 #include "init.h"
 
-static void nand_denali_wp_disable(void)
-{
-#ifdef CONFIG_NAND_DENALI
-       /*
-        * Since the boot rom enables the write protection for NAND boot mode,
-        * it must be disabled somewhere for "nand write", "nand erase", etc.
-        * The workaround is here to not disturb the Denali NAND controller
-        * driver just for a really SoC-specific thing.
-        */
-       void __iomem *denali_reg = (void __iomem *)CONFIG_SYS_NAND_REGS_BASE;
-
-       writel(WRITE_PROTECT__FLAG, denali_reg + WRITE_PROTECT);
-#endif
-}
-
 static void uniphier_set_env_fdt_file(void)
 {
        DECLARE_GLOBAL_DATA_PTR;
@@ -69,6 +51,7 @@ fail:
 
 static void uniphier_set_env_addr(const char *env, const char *offset_env)
 {
+       DECLARE_GLOBAL_DATA_PTR;
        unsigned long offset = 0;
        const char *str;
        char *end;
@@ -113,7 +96,6 @@ int board_late_init(void)
        case BOOT_DEVICE_NAND:
                printf("NAND Boot");
                env_set("bootdev", "nand");
-               nand_denali_wp_disable();
                break;
        case BOOT_DEVICE_NOR:
                printf("NOR Boot");