]> git.sur5r.net Git - u-boot/blobdiff - board/toradex/apalis_imx6/apalis_imx6.c
SPDX: Convert all of our single license tags to Linux Kernel style
[u-boot] / board / toradex / apalis_imx6 / apalis_imx6.c
index 166b93f0c5288bb1d6a7e6e0cc082da516717e6d..368db9c488c79afc28988346375808cdbf34bae9 100644 (file)
@@ -1,14 +1,14 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright (C) 2010-2013 Freescale Semiconductor, Inc.
  * Copyright (C) 2013, Boundary Devices <info@boundarydevices.com>
  * Copyright (C) 2014-2016, Toradex AG
  * copied from nitrogen6x
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
 #include <dm.h>
+#include <environment.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/crm_regs.h>
 #include <asm/arch/mxc_hdmi.h>
 #include <asm/bootm.h>
 #include <asm/gpio.h>
 #include <asm/io.h>
-#include <asm/imx-common/iomux-v3.h>
-#include <asm/imx-common/mxc_i2c.h>
-#include <asm/imx-common/sata.h>
-#include <asm/imx-common/boot_mode.h>
-#include <asm/imx-common/video.h>
+#include <asm/mach-imx/iomux-v3.h>
+#include <asm/mach-imx/mxc_i2c.h>
+#include <asm/mach-imx/sata.h>
+#include <asm/mach-imx/boot_mode.h>
+#include <asm/mach-imx/video.h>
 #include <dm/platform_data/serial_mxc.h>
 #include <dm/platdata.h>
 #include <fsl_esdhc.h>
 #include <i2c.h>
+#include <input.h>
 #include <imx_thermal.h>
 #include <linux/errno.h>
 #include <malloc.h>
@@ -755,10 +756,6 @@ int board_early_init_f(void)
 #else
        setup_iomux_dce_uart();
 #endif
-
-#if defined(CONFIG_VIDEO_IPUV3)
-       setup_display();
-#endif
        return 0;
 }
 
@@ -780,6 +777,10 @@ int board_init(void)
        setup_i2c(1, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info_loc);
        setup_i2c(2, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info3);
 
+#if defined(CONFIG_VIDEO_IPUV3)
+       setup_display();
+#endif
+
 #ifdef CONFIG_TDX_CMD_IMX_MFGR
        (void) pmic_init();
 #endif
@@ -803,7 +804,7 @@ int board_late_init(void)
 
        rev = get_board_rev();
        snprintf(env_str, ARRAY_SIZE(env_str), "%.4x", rev);
-       setenv("board_rev", env_str);
+       env_set("board_rev", env_str);
 
 #ifndef CONFIG_TDX_APALIS_IMX6_V1_0
        if ((rev & 0xfff0) == 0x0100) {
@@ -813,12 +814,12 @@ int board_late_init(void)
                setup_iomux_dce_uart();
 
                /* if using the default device tree, use version for V1.0 HW */
-               fdt_env = getenv("fdt_file");
+               fdt_env = env_get("fdt_file");
                if ((fdt_env != NULL) && (strcmp(FDT_FILE, fdt_env) == 0)) {
-                       setenv("fdt_file", FDT_FILE_V1_0);
+                       env_set("fdt_file", FDT_FILE_V1_0);
                        printf("patching fdt_file to " FDT_FILE_V1_0 "\n");
 #ifndef CONFIG_ENV_IS_NOWHERE
-                       saveenv();
+                       env_save();
 #endif
                }
        }
@@ -890,7 +891,7 @@ void ldo_mode_set(int ldo_bypass)
 
 #ifdef CONFIG_SPL_BUILD
 #include <spl.h>
-#include <libfdt.h>
+#include <linux/libfdt.h>
 #include "asm/arch/mx6q-ddr.h"
 #include "asm/arch/iomux.h"
 #include "asm/arch/crm_regs.h"
@@ -1158,17 +1159,6 @@ static void ccgr_init(void)
        writel(0x000000FB, &ccm->ccosr);
 }
 
-static void gpr_init(void)
-{
-       struct iomuxc *iomux = (struct iomuxc *)IOMUXC_BASE_ADDR;
-
-       /* enable AXI cache for VDOA/VPU/IPU */
-       writel(0xF00000CF, &iomux->gpr[4]);
-       /* set IPU AXI-id0 Qos=0xf(bypass) AXI-id1 Qos=0x7 */
-       writel(0x007F007F, &iomux->gpr[6]);
-       writel(0x007F007F, &iomux->gpr[7]);
-}
-
 static void ddr_init(int *table, int size)
 {
        int i;