env: Move env_set() to env.h
[oweals/u-boot.git] / board / keymile / kmp204x / kmp204x.c
index eebb47fc21f1cfbcf6aff58e72154c9cc9f5388c..4d1e38aa3a7af12a8ab825494485fed181efed78 100644 (file)
@@ -1,14 +1,14 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * (C) Copyright 2013 Keymile AG
  * Valentin Longchamp <valentin.longchamp@keymile.com>
  *
  * Copyright 2011,2012 Freescale Semiconductor, Inc.
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
 #include <command.h>
+#include <env.h>
 #include <netdev.h>
 #include <linux/compiler.h>
 #include <asm/mmu.h>
@@ -24,8 +24,6 @@
 #include "../common/common.h"
 #include "kmp204x.h"
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static uchar ivm_content[CONFIG_SYS_IVM_EEPROM_MAX_LEN];
 
 int checkboard(void)
@@ -126,7 +124,7 @@ int board_early_init_r(void)
        invalidate_icache();
 
        set_liodns();
-       setup_portals();
+       setup_qbman_portals();
 
        ret = trigger_fpga_config();
        if (ret)
@@ -222,7 +220,7 @@ int last_stage_init(void)
        if (dip_switch != 0) {
                /* start bootloader */
                puts("DIP:   Enabled\n");
-               setenv("actual_bank", "0");
+               env_set("actual_bank", "0");
        }
 #endif
        set_km_env();
@@ -239,7 +237,7 @@ void fdt_fixup_fman_mac_addresses(void *blob)
        unsigned char mac_addr[6];
 
        /* get the mac addr from env */
-       tmp = getenv("ethaddr");
+       tmp = env_get("ethaddr");
        if (!tmp) {
                printf("ethaddr env variable not defined\n");
                return;
@@ -271,13 +269,13 @@ int ft_board_setup(void *blob, bd_t *bd)
 
        ft_cpu_setup(blob, bd);
 
-       base = getenv_bootm_low();
-       size = getenv_bootm_size();
+       base = env_get_bootm_low();
+       size = env_get_bootm_size();
 
        fdt_fixup_memory(blob, (u64)base, (u64)size);
 
 #if defined(CONFIG_HAS_FSL_DR_USB) || defined(CONFIG_HAS_FSL_MPH_USB)
-       fdt_fixup_dr_usb(blob, bd);
+       fsl_fdt_fixup_dr_usb(blob, bd);
 #endif
 
 #ifdef CONFIG_PCI