env: Move env_get() to env.h
[platform/kernel/u-boot.git] / board / bluegiga / apx4devkit / apx4devkit.c
index 87f3f35..9268aa0 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Bluegiga APX4 Development Kit
  *
  * Based on m28evk.c:
  * Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com>
  * on behalf of DENX Software Engineering GmbH
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
  */
 
 #include <common.h>
 #include <asm/gpio.h>
 #include <asm/io.h>
+#include <asm/setup.h>
 #include <asm/arch/imx-regs.h>
 #include <asm/arch/iomux-mx28.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/sys_proto.h>
+#include <env.h>
 #include <linux/mii.h>
 #include <miiphy.h>
 #include <netdev.h>
@@ -43,19 +33,19 @@ DECLARE_GLOBAL_DATA_PTR;
 int board_early_init_f(void)
 {
        /* IO0 clock at 480MHz */
-       mx28_set_ioclk(MXC_IOCLK0, 480000);
+       mxs_set_ioclk(MXC_IOCLK0, 480000);
        /* IO1 clock at 480MHz */
-       mx28_set_ioclk(MXC_IOCLK1, 480000);
+       mxs_set_ioclk(MXC_IOCLK1, 480000);
 
        /* SSP0 clock at 96MHz */
-       mx28_set_sspclk(MXC_SSPCLK0, 96000, 0);
+       mxs_set_sspclk(MXC_SSPCLK0, 96000, 0);
 
        return 0;
 }
 
 int dram_init(void)
 {
-       return mx28_dram_init();
+       return mxs_dram_init();
 }
 
 int board_init(void)
@@ -69,7 +59,7 @@ int board_init(void)
 #ifdef CONFIG_CMD_MMC
 int board_mmc_init(bd_t *bis)
 {
-       return mxsmmc_initialize(bis, 0, NULL);
+       return mxsmmc_initialize(bis, 0, NULL, NULL);
 }
 #endif
 
@@ -130,7 +120,7 @@ void get_board_serial(struct tag_serialnr *serialnr)
 
        writel(OCOTP_CTRL_RD_BANK_OPEN, &ocotp_regs->hw_ocotp_ctrl_set);
 
-       if (mx28_wait_mask_clr(&ocotp_regs->hw_ocotp_ctrl_reg, OCOTP_CTRL_BUSY,
+       if (mxs_wait_mask_clr(&ocotp_regs->hw_ocotp_ctrl_reg, OCOTP_CTRL_BUSY,
                MXS_OCOTP_MAX_TIMEOUT)) {
                printf("MXS: Can't get serial number from OCOTP\n");
                return;
@@ -143,8 +133,8 @@ void get_board_serial(struct tag_serialnr *serialnr)
 #ifdef CONFIG_REVISION_TAG
 u32 get_board_rev(void)
 {
-       if (getenv("revision#") != NULL)
-               return simple_strtoul(getenv("revision#"), NULL, 10);
+       if (env_get("revision#") != NULL)
+               return simple_strtoul(env_get("revision#"), NULL, 10);
        return 0;
 }
 #endif