[PATCH 2/7] km/powerpc: migrate to env.txt file
Holger Brunck
holger.brunck at hitachienergy.com
Fri Dec 2 18:22:38 CET 2022
Use already present common.env file and add a powerpc specific env
so that we can move all the environment defines to text files.
Signed-off-by: Holger Brunck <holger.brunck at hitachienergy.com>
---
board/keymile/km83xx/km83xx.env | 21 +++++++++++
configs/kmcoge5ne_defconfig | 2 +-
configs/kmeter1_defconfig | 2 +-
configs/kmopti2_defconfig | 1 +
configs/kmsupx5_defconfig | 1 +
configs/kmtepr2_defconfig | 1 +
configs/tuge1_defconfig | 1 +
configs/tuxx1_defconfig | 1 +
include/configs/km/km-mpc83xx.h | 24 -------------
include/configs/km/km-powerpc.h | 46 -------------------------
include/configs/kmcoge5ne.h | 6 ----
include/configs/kmeter1.h | 4 ---
include/configs/kmopti2.h | 7 ----
include/configs/kmsupx5.h | 7 ----
include/configs/kmtepr2.h | 7 ----
include/configs/tuge1.h | 7 ----
include/configs/tuxx1.h | 7 ----
include/environment/pg-wcom/powerpc.env | 14 ++++++++
18 files changed, 42 insertions(+), 117 deletions(-)
create mode 100644 board/keymile/km83xx/km83xx.env
delete mode 100644 include/configs/km/km-powerpc.h
create mode 100644 include/environment/pg-wcom/powerpc.env
diff --git a/board/keymile/km83xx/km83xx.env b/board/keymile/km83xx/km83xx.env
new file mode 100644
index 0000000000..ed2487c028
--- /dev/null
+++ b/board/keymile/km83xx/km83xx.env
@@ -0,0 +1,21 @@
+#if CONFIG_TARGET_KMCOGE5NE
+#define WCOM_UBI_PARTITION_APP
+hostname=kmcoge5ne
+netdev=eth1
+uimage=ecc_bch_uImage
+#elif CONFIG_TARGET_KMETER1
+hostname=kmeter1
+netdev=eth2
+uimage=uImage
+#else
+hostname=kmeter1
+netdev=eth0
+uimage=uImage
+#endif
+
+#include <environment/pg-wcom/common.env>
+#include <environment/pg-wcom/powerpc.env>
+
+#if CONFIG_TARGET_KMCOGE5NE
+add_default+= eccmode=bch
+#endif
diff --git a/configs/kmcoge5ne_defconfig b/configs/kmcoge5ne_defconfig
index 298ff16b7e..389800795d 100644
--- a/configs/kmcoge5ne_defconfig
+++ b/configs/kmcoge5ne_defconfig
@@ -159,7 +159,6 @@ CONFIG_LCRR_DBYP_PLL_BYPASSED=y
CONFIG_LCRR_EADC_2=y
CONFIG_LCRR_CLKDIV_4=y
CONFIG_83XX_PCICLK=0x3ef1480
-CONFIG_KM_DEF_NETDEV="eth1"
CONFIG_SYS_MONITOR_LEN=786432
CONFIG_OF_BOARD_SETUP=y
CONFIG_OF_STDOUT_VIA_ALIAS=y
@@ -196,6 +195,7 @@ CONFIG_MTDIDS_DEFAULT="nor0=boot,nand0=app"
CONFIG_MTDPARTS_DEFAULT="mtdparts=boot:768k(u-boot),128k(env),128k(envred),-(ubi0);app:-(ubi1);"
CONFIG_CMD_UBI=y
# CONFIG_CMD_UBIFS is not set
+CONFIG_ENV_SOURCE_FILE="km83xx"
CONFIG_ENV_OVERWRITE=y
CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
CONFIG_ENV_ADDR_REDUND=0xF00E0000
diff --git a/configs/kmeter1_defconfig b/configs/kmeter1_defconfig
index 9386f2c512..257b6a4546 100644
--- a/configs/kmeter1_defconfig
+++ b/configs/kmeter1_defconfig
@@ -129,7 +129,6 @@ CONFIG_ACR_PARKM_USB_I2C1_BOOT=y
CONFIG_LCRR_DBYP_PLL_BYPASSED=y
CONFIG_LCRR_EADC_2=y
CONFIG_LCRR_CLKDIV_4=y
-CONFIG_KM_DEF_NETDEV="eth2"
CONFIG_SYS_MONITOR_LEN=786432
CONFIG_OF_BOARD_SETUP=y
CONFIG_OF_STDOUT_VIA_ALIAS=y
@@ -165,6 +164,7 @@ CONFIG_MTDIDS_DEFAULT="nor0=boot"
CONFIG_MTDPARTS_DEFAULT="mtdparts=boot:768k(u-boot),128k(env),128k(envred),-(ubi0);"
CONFIG_CMD_UBI=y
# CONFIG_CMD_UBIFS is not set
+CONFIG_ENV_SOURCE_FILE="km83xx"
CONFIG_ENV_OVERWRITE=y
CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
CONFIG_ENV_ADDR_REDUND=0xF00E0000
diff --git a/configs/kmopti2_defconfig b/configs/kmopti2_defconfig
index 173306668f..53d37fa020 100644
--- a/configs/kmopti2_defconfig
+++ b/configs/kmopti2_defconfig
@@ -177,6 +177,7 @@ CONFIG_MTDIDS_DEFAULT="nor0=boot"
CONFIG_MTDPARTS_DEFAULT="mtdparts=boot:768k(u-boot),128k(env),128k(envred),-(ubi0);"
CONFIG_CMD_UBI=y
# CONFIG_CMD_UBIFS is not set
+CONFIG_ENV_SOURCE_FILE="km83xx"
CONFIG_ENV_OVERWRITE=y
CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
CONFIG_ENV_ADDR_REDUND=0xF00E0000
diff --git a/configs/kmsupx5_defconfig b/configs/kmsupx5_defconfig
index c281611dd4..95b8518bdb 100644
--- a/configs/kmsupx5_defconfig
+++ b/configs/kmsupx5_defconfig
@@ -156,6 +156,7 @@ CONFIG_MTDIDS_DEFAULT="nor0=boot"
CONFIG_MTDPARTS_DEFAULT="mtdparts=boot:768k(u-boot),128k(env),128k(envred),-(ubi0);"
CONFIG_CMD_UBI=y
# CONFIG_CMD_UBIFS is not set
+CONFIG_ENV_SOURCE_FILE="km83xx"
CONFIG_ENV_OVERWRITE=y
CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
CONFIG_ENV_ADDR_REDUND=0xF00E0000
diff --git a/configs/kmtepr2_defconfig b/configs/kmtepr2_defconfig
index e099f74de1..0ebb049cfe 100644
--- a/configs/kmtepr2_defconfig
+++ b/configs/kmtepr2_defconfig
@@ -176,6 +176,7 @@ CONFIG_MTDIDS_DEFAULT="nor0=boot"
CONFIG_MTDPARTS_DEFAULT="mtdparts=boot:768k(u-boot),128k(env),128k(envred),-(ubi0);"
CONFIG_CMD_UBI=y
# CONFIG_CMD_UBIFS is not set
+CONFIG_ENV_SOURCE_FILE="km83xx"
CONFIG_ENV_OVERWRITE=y
CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
CONFIG_ENV_ADDR_REDUND=0xF00E0000
diff --git a/configs/tuge1_defconfig b/configs/tuge1_defconfig
index 3b8560f3e0..6758b59d95 100644
--- a/configs/tuge1_defconfig
+++ b/configs/tuge1_defconfig
@@ -156,6 +156,7 @@ CONFIG_MTDIDS_DEFAULT="nor0=boot"
CONFIG_MTDPARTS_DEFAULT="mtdparts=boot:768k(u-boot),128k(env),128k(envred),-(ubi0);"
CONFIG_CMD_UBI=y
# CONFIG_CMD_UBIFS is not set
+CONFIG_ENV_SOURCE_FILE="km83xx"
CONFIG_ENV_OVERWRITE=y
CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
CONFIG_ENV_ADDR_REDUND=0xF00E0000
diff --git a/configs/tuxx1_defconfig b/configs/tuxx1_defconfig
index 04ce0b3afe..0db4cee27b 100644
--- a/configs/tuxx1_defconfig
+++ b/configs/tuxx1_defconfig
@@ -178,6 +178,7 @@ CONFIG_MTDIDS_DEFAULT="nor0=boot"
CONFIG_MTDPARTS_DEFAULT="mtdparts=boot:768k(u-boot),128k(env),128k(envred),-(ubi0);"
CONFIG_CMD_UBI=y
# CONFIG_CMD_UBIFS is not set
+CONFIG_ENV_SOURCE_FILE="km83xx"
CONFIG_ENV_OVERWRITE=y
CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
CONFIG_ENV_ADDR_REDUND=0xF00E0000
diff --git a/include/configs/km/km-mpc83xx.h b/include/configs/km/km-mpc83xx.h
index 181ed1b8fa..17e596a687 100644
--- a/include/configs/km/km-mpc83xx.h
+++ b/include/configs/km/km-mpc83xx.h
@@ -69,30 +69,6 @@
*/
#define CONFIG_SYS_BOOTMAPSZ (8 << 20)
-/*
- * Environment
- */
-
-/*
- * Environment Configuration
- */
-#ifndef CONFIG_KM_DEF_ENV /* if not set by keymile-common.h */
-#define CONFIG_KM_DEF_ENV "km-common=empty\0"
-#endif
-
-#ifndef CONFIG_KM_DEF_ARCH
-#define CONFIG_KM_DEF_ARCH "arch=ppc_82xx\0"
-#endif
-
-#define CONFIG_EXTRA_ENV_SETTINGS \
- CONFIG_KM_DEF_ENV \
- CONFIG_KM_DEF_ARCH \
- "newenv=" \
- "prot off " __stringify(CONFIG_ENV_ADDR) " +0x40000 && " \
- "era " __stringify(CONFIG_ENV_ADDR) " +0x40000\0" \
- "unlock=yes\0" \
- ""
-
/*
* QE UEC ethernet configuration
*/
diff --git a/include/configs/km/km-powerpc.h b/include/configs/km/km-powerpc.h
deleted file mode 100644
index 424caa0df9..0000000000
--- a/include/configs/km/km-powerpc.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * (C) Copyright 2011
- * Heiko Schocher, DENX Software Engineering, hs at denx.de.
- */
-
-#ifndef __CONFIG_KEYMILE_POWERPC_H
-#define __CONFIG_KEYMILE_POWERPC_H
-
-/* Do boardspecific init for all boards */
-
-/* Increase max size of compressed kernel */
-
-/******************************************************************************
- * (PRAM usage)
- * ... -------------------------------------------------------
- * ... |ROOTFSSIZE | PNVRAM |PHRAM |RESERVED_PRAM | END_OF_RAM
- * ... |<------------------- pram -------------------------->|
- * ... -------------------------------------------------------
- * @END_OF_RAM:
- * @CONFIG_KM_RESERVED_PRAM: reserved pram for special purpose
- * @CONFIG_KM_PHRAM: address for /var
- * @CONFIG_KM_PNVRAM: address for PNVRAM (for the application)
- */
-
-/* set the default PRAM value to at least PNVRAM + PHRAM when pram env variable
- * is not valid yet, which is the case for when u-boot copies itself to RAM */
-#define CONFIG_PRAM ((CONFIG_KM_PNVRAM + CONFIG_KM_PHRAM)>>10)
-
-/* architecture specific default bootargs */
-#define CONFIG_KM_DEF_BOOT_ARGS_CPU ""
-
-#define CONFIG_KM_DEF_ENV_CPU \
- "u-boot="CONFIG_HOSTNAME "/u-boot.bin\0" \
- "update=" \
- "protect off " __stringify(BOOTFLASH_START) " +${filesize} && "\
- "erase " __stringify(BOOTFLASH_START) " +${filesize} && "\
- "cp.b ${load_addr_r} " __stringify(BOOTFLASH_START) \
- " ${filesize} && " \
- "protect on " __stringify(BOOTFLASH_START) " +${filesize}\0"\
- "set_fdthigh=true\0" \
- "checkfdt=true\0" \
- "bootm_mapsize=" __stringify(CONFIG_SYS_BOOTM_LEN) "\0" \
- ""
-
-#endif /* __CONFIG_KEYMILE_POWERPC_H */
diff --git a/include/configs/kmcoge5ne.h b/include/configs/kmcoge5ne.h
index d6b60d8139..bcf4c7345b 100644
--- a/include/configs/kmcoge5ne.h
+++ b/include/configs/kmcoge5ne.h
@@ -8,18 +8,12 @@
#ifndef __CONFIG_H
#define __CONFIG_H
-#define CONFIG_HOSTNAME "kmcoge5ne"
#define CONFIG_NAND_ECC_BCH
#define CONFIG_NAND_KMETER1
#define NAND_MAX_CHIPS 1
#define CONFIG_SYS_NAND_BASE CONFIG_SYS_KMBEC_FPGA_BASE /* PRIO_BASE_ADDRESS */
-#define CONFIG_KM_UBI_PARTITION_NAME_BOOT "ubi0"
-#define CONFIG_KM_UBI_PARTITION_NAME_APP "ubi1"
-
/* include common defines/options for all Keymile boards */
-#include "km/keymile-common.h"
-#include "km/km-powerpc.h"
#include "km/km-mpc83xx.h"
#include "km/km-mpc8360.h"
diff --git a/include/configs/kmeter1.h b/include/configs/kmeter1.h
index 4245875e39..321a187c7d 100644
--- a/include/configs/kmeter1.h
+++ b/include/configs/kmeter1.h
@@ -8,11 +8,7 @@
#ifndef __CONFIG_H
#define __CONFIG_H
-#define CONFIG_HOSTNAME "kmeter1"
-
/* include common defines/options for all Keymile boards */
-#include "km/keymile-common.h"
-#include "km/km-powerpc.h"
#include "km/km-mpc83xx.h"
#include "km/km-mpc8360.h"
diff --git a/include/configs/kmopti2.h b/include/configs/kmopti2.h
index 5050c70303..d6a3844bcc 100644
--- a/include/configs/kmopti2.h
+++ b/include/configs/kmopti2.h
@@ -20,14 +20,7 @@
#ifndef __CONFIG_H
#define __CONFIG_H
-/*
- * High Level Configuration Options
- */
-#define CONFIG_HOSTNAME "kmopti2"
-
/* include common defines/options for all Keymile boards */
-#include "km/keymile-common.h"
-#include "km/km-powerpc.h"
#include "km/km-mpc83xx.h"
#include "km/km-mpc832x.h"
diff --git a/include/configs/kmsupx5.h b/include/configs/kmsupx5.h
index e3de6c61e7..d6a3844bcc 100644
--- a/include/configs/kmsupx5.h
+++ b/include/configs/kmsupx5.h
@@ -20,14 +20,7 @@
#ifndef __CONFIG_H
#define __CONFIG_H
-/*
- * High Level Configuration Options
- */
-#define CONFIG_HOSTNAME "kmsupx5"
-
/* include common defines/options for all Keymile boards */
-#include "km/keymile-common.h"
-#include "km/km-powerpc.h"
#include "km/km-mpc83xx.h"
#include "km/km-mpc832x.h"
diff --git a/include/configs/kmtepr2.h b/include/configs/kmtepr2.h
index a4ceb1c50d..d6a3844bcc 100644
--- a/include/configs/kmtepr2.h
+++ b/include/configs/kmtepr2.h
@@ -20,14 +20,7 @@
#ifndef __CONFIG_H
#define __CONFIG_H
-/*
- * High Level Configuration Options
- */
-#define CONFIG_HOSTNAME "kmtepr2"
-
/* include common defines/options for all Keymile boards */
-#include "km/keymile-common.h"
-#include "km/km-powerpc.h"
#include "km/km-mpc83xx.h"
#include "km/km-mpc832x.h"
diff --git a/include/configs/tuge1.h b/include/configs/tuge1.h
index d43ccbe8dd..d6a3844bcc 100644
--- a/include/configs/tuge1.h
+++ b/include/configs/tuge1.h
@@ -20,14 +20,7 @@
#ifndef __CONFIG_H
#define __CONFIG_H
-/*
- * High Level Configuration Options
- */
-#define CONFIG_HOSTNAME "tuge1"
-
/* include common defines/options for all Keymile boards */
-#include "km/keymile-common.h"
-#include "km/km-powerpc.h"
#include "km/km-mpc83xx.h"
#include "km/km-mpc832x.h"
diff --git a/include/configs/tuxx1.h b/include/configs/tuxx1.h
index 7eed31c35f..d6a3844bcc 100644
--- a/include/configs/tuxx1.h
+++ b/include/configs/tuxx1.h
@@ -20,14 +20,7 @@
#ifndef __CONFIG_H
#define __CONFIG_H
-/*
- * High Level Configuration Options
- */
-#define CONFIG_HOSTNAME "tuxx1"
-
/* include common defines/options for all Keymile boards */
-#include "km/keymile-common.h"
-#include "km/km-powerpc.h"
#include "km/km-mpc83xx.h"
#include "km/km-mpc832x.h"
diff --git a/include/environment/pg-wcom/powerpc.env b/include/environment/pg-wcom/powerpc.env
new file mode 100644
index 0000000000..a57fd93092
--- /dev/null
+++ b/include/environment/pg-wcom/powerpc.env
@@ -0,0 +1,14 @@
+arch=ppc_82xx
+bootm_mapsize=CONFIG_SYS_BOOTM_LEN
+checkfdt=true
+set_fdthigh=true
+
+update=protect off BOOTFLASH_START +${filesize} &&
+ erase BOOTFLASH_START +${filesize} &&
+ cp.b ${load_addr_r} BOOTFLASH_START ${filesize} &&
+ protect on BOOTFLASH_START +${filesize}
+
+newenv=prot off CONFIG_ENV_ADDR +0x40000 &&
+ era CONFIG_ENV_ADDR +0x40000
+
+unlock=yes
--
2.31.1
More information about the U-Boot
mailing list