Convert CONFIG_SF_DEFAULT_* to Kconfig
[platform/kernel/u-boot.git] / board / Arcturus / ucp1020 / cmd_arc.c
index fa6b485..9579d52 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
 /*
  * Command for accessing Arcturus factory environment.
  *
@@ -5,8 +6,6 @@
  *           http://www.arcturusnetworks.com/products/ucp1020/
  *           by Oleksandr G Zhadan et al.
  *
- * SPDX-License-Identifier: GPL-2.0+ BSD-3-Clause
- *
  */
 
 #include <common.h>
 
 #include <asm/io.h>
 
-#ifndef CONFIG_SF_DEFAULT_SPEED
-#   define CONFIG_SF_DEFAULT_SPEED     1000000
-#endif
-#ifndef CONFIG_SF_DEFAULT_MODE
-#   define CONFIG_SF_DEFAULT_MODE      SPI_MODE0
-#endif
-#ifndef CONFIG_SF_DEFAULT_CS
-#   define CONFIG_SF_DEFAULT_CS                0
-#endif
-#ifndef CONFIG_SF_DEFAULT_BUS
-#   define CONFIG_SF_DEFAULT_BUS       0
-#endif
-
 #define MAX_SERIAL_SIZE 15
 #define MAX_HWADDR_SIZE 17
 
@@ -138,7 +124,7 @@ int get_arc_info(void)
                        printf("\t<not found>\n");
                } else {
                        printf("\t%s\n", smac[3]);
-                       setenv("SERIAL", smac[3]);
+                       env_set("SERIAL", smac[3]);
                }
        }
 
@@ -149,10 +135,10 @@ int get_arc_info(void)
        if (smac[2][0] == 0xFF) {
                printf("\t<not found>\n");
        } else {
-               char *ret = getenv("ethaddr");
+               char *ret = env_get("ethaddr");
 
                if (strcmp(ret, __stringify(CONFIG_ETHADDR)) == 0) {
-                       setenv("ethaddr", smac[2]);
+                       env_set("ethaddr", smac[2]);
                        printf("\t%s (factory)\n", smac[2]);
                } else {
                        printf("\t%s\n", ret);
@@ -160,8 +146,8 @@ int get_arc_info(void)
        }
 
        if (strcmp(smac[1], "00:00:00:00:00:00") == 0) {
-               setenv("eth1addr", smac[2]);
-               setenv("eth2addr", smac[2]);
+               env_set("eth1addr", smac[2]);
+               env_set("eth2addr", smac[2]);
                return 0;
        }
 
@@ -169,10 +155,10 @@ int get_arc_info(void)
        if (smac[1][0] == 0xFF) {
                printf("\t<not found>\n");
        } else {
-               char *ret = getenv("eth1addr");
+               char *ret = env_get("eth1addr");
 
                if (strcmp(ret, __stringify(CONFIG_ETH1ADDR)) == 0) {
-                       setenv("eth1addr", smac[1]);
+                       env_set("eth1addr", smac[1]);
                        printf("\t%s (factory)\n", smac[1]);
                } else {
                        printf("\t%s\n", ret);
@@ -180,7 +166,7 @@ int get_arc_info(void)
        }
 
        if (strcmp(smac[0], "00:00:00:00:00:00") == 0) {
-               setenv("eth2addr", smac[1]);
+               env_set("eth2addr", smac[1]);
                return 0;
        }
 
@@ -188,10 +174,10 @@ int get_arc_info(void)
        if (smac[0][0] == 0xFF) {
                printf("\t<not found>\n");
        } else {
-               char *ret = getenv("eth2addr");
+               char *ret = env_get("eth2addr");
 
                if (strcmp(ret, __stringify(CONFIG_ETH2ADDR)) == 0) {
-                       setenv("eth2addr", smac[0]);
+                       env_set("eth2addr", smac[0]);
                        printf("\t%s (factory)\n", smac[0]);
                } else {
                        printf("\t%s\n", ret);