[PATCH 00/48] mpc83xx: Kconfig migrations

classic Classic list List threaded Threaded
30 messages Options
12
Reply | Threaded
Open this post in threaded view
|

[PATCH 00/48] mpc83xx: Kconfig migrations

Mario Six
This series converts the first bunch of legacy configuration options to
the Kconfig framework.

Functionality is preserved where possible, and setting configuration
options is made a comfortable as possible.

Mario Six (48):
  mpc83xx: Introduce ARCH_MPC830*
  mpc83xx: Introduce ARCH_MPC831*
  mpc83xx: Introduce ARCH_MPC832*
  mpc83xx: Introduce ARCH_MPC834*
  mpc83xx: Introduce ARCH_MPC836*
  mpc83xx: Introduce ARCH_MPC837X
  keymile: Make distinct kmtegr1, kmvect1, suvd3 configs
  keymile: Simplify kmtegr1, kmvect1, suvd3 configs
  keymile: Move config files
  keymile: Unroll includes
  keymile: Simplify config files
  keymile: Make distinct kmsupx5, tuge1, kmopti2, and kmtepr2 configs
  keymile: Simplify kmsupx5, tuge1, kmopti2, and kmtepr2 configs
  keymile: Unroll km/km83xx-common.h
  keymile: Simplify configs after include unroll
  keymile: Make distinct kmeter1, and kmcoge5ne configs
  keymile: Simplify kmcoge5ne, kmeter1 configs
  mpc83xx: Make distinct MPC8313ERDB targets
  mpc83xx: Simplify MPC8313ERDB configs
  VME8349: Migrate to CONFIG_TARGET_VME8349
  mpc83xx: Make distinct caddy2 config
  vme8349/caddy2: Simplify configs
  powerpc: Add LSDMR config values
  mpc83xx: Make distinct MPC8349EMDS_SDRAM board
  MPC8349EMDS: Simplify configs
  mpc8315erdb: Merge BR/OR settings
  ve8313: Merge BR/OR settings
  MPC832XEMDS: Migrate to CONFIG_TARGET_MPC832XEMDS
  MPC8349ITX: Migrate to CONFIG_TARGET_MPC8349ITX
  hrcom: Migrate to CONFIG_TARGET_HRCON
  strider: Migrate to CONFIG_TARGET_STRIDER
  MPC8313ERDB: Remove CONFIG_MPC8313ERDB
  MPC8315ERDB: Remove CONFIG_MPC8315ERDB
  MPC837XEMDS: Remove CONFIG_MPC837XEMDS
  MPC837XERDB: Remove CONFIG_MPC837XERDB
  mpc83xx: Migrate legacy PCI options to Kconfig
  mpc83xx: Replace CONFIG_83XX_CLKIN in calculations
  mpc83xx: Get rid of CONFIG_83XX_CLKIN
  mpc83xx: Kconfig: Migrate HRCW to Kconfig
  mpc83xx: pcie: Read the clock from registers
  powerpc: Migrate HIGH_BATS to Kconfig
  mpc83xx: Migrate BATS config to Kconfig
  mpc83xx: Migrate LBLAW_* to Kconfig
  mpc83xx: Normalize BR/OR option lines
  tqm834x: Expand CONFIG_SYS_OR_TIMING_FLASH macro
  mpc83xx: Simplify BR,OR lines
  sbc8349: Remove SDRAM functionality
  mpc83xx: Migrate CONFIG_SYS_{BR,OR}*_PRELIM to Kconfig

 Kconfig                                            |    2 +-
 arch/powerpc/Kconfig                               |    6 +
 arch/powerpc/cpu/mpc83xx/Kconfig                   |  225 +++-
 arch/powerpc/cpu/mpc83xx/bats/Kconfig              | 1311 ++++++++++++++++++++
 arch/powerpc/cpu/mpc83xx/bats/bats.h               |  223 ++++
 arch/powerpc/cpu/mpc83xx/cpu.c                     |    2 +-
 arch/powerpc/cpu/mpc83xx/cpu_init.c                |    7 +-
 arch/powerpc/cpu/mpc83xx/elbc/Kconfig              |   32 +
 arch/powerpc/cpu/mpc83xx/elbc/Kconfig.elbc0        |  733 +++++++++++
 arch/powerpc/cpu/mpc83xx/elbc/Kconfig.elbc1        |  733 +++++++++++
 arch/powerpc/cpu/mpc83xx/elbc/Kconfig.elbc2        |  733 +++++++++++
 arch/powerpc/cpu/mpc83xx/elbc/Kconfig.elbc3        |  733 +++++++++++
 arch/powerpc/cpu/mpc83xx/elbc/Kconfig.elbc4        |  733 +++++++++++
 arch/powerpc/cpu/mpc83xx/elbc/elbc.h               |  186 +++
 arch/powerpc/cpu/mpc83xx/fdt.c                     |    6 +-
 arch/powerpc/cpu/mpc83xx/hrcw/Kconfig              |  816 ++++++++++++
 arch/powerpc/cpu/mpc83xx/hrcw/hrcw.h               |   37 +
 arch/powerpc/cpu/mpc83xx/lblaw/Kconfig             |  519 ++++++++
 arch/powerpc/cpu/mpc83xx/lblaw/lblaw.h             |   55 +
 arch/powerpc/cpu/mpc83xx/pcie.c                    |   39 +-
 arch/powerpc/cpu/mpc83xx/spd_sdram.c               |    4 +-
 arch/powerpc/cpu/mpc83xx/speed.c                   |  112 +-
 arch/powerpc/cpu/mpc83xx/spl_minimal.c             |   11 +
 arch/powerpc/cpu/mpc83xx/start.S                   |    3 +
 arch/powerpc/cpu/mpc8xxx/fsl_lbc.c                 |    4 +
 arch/powerpc/include/asm/arch-mpc83xx/gpio.h       |    6 +-
 arch/powerpc/include/asm/fsl_lbc.h                 |   13 +-
 arch/powerpc/include/asm/global_data.h             |   22 +-
 arch/powerpc/include/asm/immap_83xx.h              |   24 +-
 arch/powerpc/include/asm/mpc8xxx_spi.h             |   10 +-
 board/esd/vme8349/Kconfig                          |   13 +
 board/esd/vme8349/vme8349.c                        |    8 +-
 board/freescale/common/pq-mds-pib.c                |    6 +-
 board/freescale/mpc8313erdb/Kconfig                |   17 +-
 board/freescale/mpc8315erdb/MAINTAINERS            |    1 +
 board/freescale/mpc8349emds/Kconfig                |   13 +
 board/freescale/mpc8349emds/MAINTAINERS            |    2 +
 board/freescale/mpc8349emds/pci.c                  |   12 +-
 board/freescale/mpc8349itx/mpc8349itx.c            |    5 +-
 board/freescale/mpc837xemds/MAINTAINERS            |    1 +
 board/freescale/mpc837xerdb/MAINTAINERS            |    1 +
 board/gdsys/common/Makefile                        |    6 +-
 board/gdsys/mpc8308/Makefile                       |    4 +-
 board/keymile/km83xx/Kconfig                       |   95 +-
 board/keymile/km83xx/km83xx.c                      |    8 +-
 board/tqc/tqm834x/pci.c                            |    2 +-
 board/tqc/tqm834x/tqm834x.c                        |    4 +-
 configs/MPC8308RDB_defconfig                       |   94 ++
 configs/MPC8313ERDB_33_defconfig                   |  123 +-
 configs/MPC8313ERDB_66_defconfig                   |  122 +-
 configs/MPC8313ERDB_NAND_33_defconfig              |  123 +-
 configs/MPC8313ERDB_NAND_66_defconfig              |  122 +-
 configs/MPC8315ERDB_defconfig                      |  101 ++
 configs/MPC8323ERDB_defconfig                      |   82 ++
 configs/MPC832XEMDS_ATM_defconfig                  |  119 ++
 configs/MPC832XEMDS_HOST_33_defconfig              |  139 +++
 configs/MPC832XEMDS_HOST_66_defconfig              |  139 +++
 configs/MPC832XEMDS_SLAVE_defconfig                |  136 ++
 configs/MPC832XEMDS_defconfig                      |  119 ++
 configs/MPC8349EMDS_PCI64_defconfig                |   96 ++
 configs/MPC8349EMDS_SDRAM_defconfig                |  107 ++
 configs/MPC8349EMDS_SLAVE_defconfig                |   96 ++
 configs/MPC8349EMDS_defconfig                      |   76 ++
 configs/MPC8349ITXGP_defconfig                     |  143 +++
 configs/MPC8349ITX_LOWBOOT_defconfig               |  143 ++-
 configs/MPC8349ITX_defconfig                       |  142 ++-
 configs/MPC837XEMDS_HOST_defconfig                 |  140 +++
 configs/MPC837XEMDS_SLAVE_defconfig                |  125 ++
 configs/MPC837XEMDS_defconfig                      |  120 ++
 configs/MPC837XERDB_SLAVE_defconfig                |  125 ++
 configs/MPC837XERDB_defconfig                      |  136 ++
 configs/MPC8610HPCD_defconfig                      |    1 +
 configs/MPC8641HPCN_36BIT_defconfig                |    1 +
 configs/MPC8641HPCN_defconfig                      |    1 +
 configs/TQM834x_defconfig                          |  110 ++
 configs/caddy2_defconfig                           |   93 +-
 configs/hrcon_defconfig                            |   77 ++
 configs/hrcon_dh_defconfig                         |   77 ++
 configs/ids8313_defconfig                          |  113 ++
 configs/kmcoge5ne_defconfig                        |  147 ++-
 configs/kmeter1_defconfig                          |  110 +-
 configs/kmopti2_defconfig                          |  135 +-
 configs/kmsupx5_defconfig                          |  113 +-
 configs/kmtegr1_defconfig                          |  109 +-
 configs/kmtepr2_defconfig                          |  135 +-
 configs/kmvect1_defconfig                          |  130 +-
 configs/mpc8308_p1m_defconfig                      |   83 ++
 configs/sbc8349_PCI_33_defconfig                   |   82 ++
 configs/sbc8349_PCI_66_defconfig                   |   82 ++
 configs/sbc8349_defconfig                          |   61 +
 configs/sbc8641d_defconfig                         |    1 +
 configs/strider_con_defconfig                      |   73 ++
 configs/strider_con_dp_defconfig                   |   73 ++
 configs/strider_cpu_defconfig                      |   73 ++
 configs/strider_cpu_dp_defconfig                   |   73 ++
 configs/suvd3_defconfig                            |  127 ++
 configs/tuge1_defconfig                            |  113 +-
 configs/tuxx1_defconfig                            |  136 +-
 configs/ve8313_defconfig                           |  117 ++
 configs/vme8349_defconfig                          |   91 ++
 configs/xpedite517x_defconfig                      |    1 +
 drivers/mtd/nand/fsl_elbc_spl.c                    |    4 +
 drivers/pci/pci_auto.c                             |    3 +-
 drivers/pci/pci_auto_old.c                         |    3 +-
 drivers/qe/qe.c                                    |    2 +-
 drivers/ram/mpc83xx_sdram.c                        |   24 +-
 include/configs/MPC8308RDB.h                       |  124 --
 .../configs/{MPC8313ERDB.h => MPC8313ERDB_NAND.h}  |  244 +---
 include/configs/MPC8313ERDB_NOR.h                  |  406 ++++++
 include/configs/MPC8315ERDB.h                      |  173 +--
 include/configs/MPC8323ERDB.h                      |  148 +--
 include/configs/MPC832XEMDS.h                      |  222 +---
 include/configs/MPC8349EMDS.h                      |  314 +----
 include/configs/MPC8349EMDS_SDRAM.h                |  486 ++++++++
 include/configs/MPC8349ITX.h                       |  204 +--
 include/configs/MPC837XEMDS.h                      |  219 +---
 include/configs/MPC837XERDB.h                      |  213 +---
 include/configs/MPC8610HPCD.h                      |    1 -
 include/configs/MPC8641HPCN.h                      |    1 -
 include/configs/TQM834x.h                          |  161 ---
 include/configs/caddy2.h                           |  357 ++++++
 include/configs/hrcon.h                            |  110 --
 include/configs/ids8313.h                          |  156 +--
 include/configs/km/km8309-common.h                 |  176 ---
 include/configs/km/km8321-common.h                 |  140 ---
 include/configs/km8360.h                           |  271 ----
 include/configs/{km => }/km83xx-common.h           |    6 +-
 include/configs/kmcoge5ne.h                        |  352 ++++++
 include/configs/kmeter1.h                          |  318 +++++
 include/configs/kmopti2.h                          |  358 ++++++
 include/configs/kmsupx5.h                          |  347 ++++++
 include/configs/kmtegr1.h                          |  413 ++++++
 include/configs/kmtepr2.h                          |  350 ++++++
 include/configs/kmvect1.h                          |  430 +++++++
 include/configs/mpc8308_p1m.h                      |  117 +-
 include/configs/sbc8349.h                          |  281 -----
 include/configs/sbc8641d.h                         |    1 -
 include/configs/strider.h                          |  109 --
 include/configs/suvd3.h                            |  416 +++++--
 include/configs/tuge1.h                            |  347 ++++++
 include/configs/tuxx1.h                            |  436 ++++---
 include/configs/ve8313.h                           |  171 +--
 include/configs/vme8349.h                          |  196 +--
 include/configs/xpedite517x.h                      |    1 -
 include/gdsys_fpga.h                               |    2 +-
 include/linux/immap_qe.h                           |    4 +-
 include/mpc83xx.h                                  |   84 +-
 include/post.h                                     |    2 +-
 include/usb/ehci-ci.h                              |    2 +-
 scripts/config_whitelist.txt                       |   16 -
 150 files changed, 17644 insertions(+), 4221 deletions(-)
 create mode 100644 arch/powerpc/cpu/mpc83xx/bats/Kconfig
 create mode 100644 arch/powerpc/cpu/mpc83xx/bats/bats.h
 create mode 100644 arch/powerpc/cpu/mpc83xx/elbc/Kconfig
 create mode 100644 arch/powerpc/cpu/mpc83xx/elbc/Kconfig.elbc0
 create mode 100644 arch/powerpc/cpu/mpc83xx/elbc/Kconfig.elbc1
 create mode 100644 arch/powerpc/cpu/mpc83xx/elbc/Kconfig.elbc2
 create mode 100644 arch/powerpc/cpu/mpc83xx/elbc/Kconfig.elbc3
 create mode 100644 arch/powerpc/cpu/mpc83xx/elbc/Kconfig.elbc4
 create mode 100644 arch/powerpc/cpu/mpc83xx/elbc/elbc.h
 create mode 100644 arch/powerpc/cpu/mpc83xx/hrcw/Kconfig
 create mode 100644 arch/powerpc/cpu/mpc83xx/hrcw/hrcw.h
 create mode 100644 arch/powerpc/cpu/mpc83xx/lblaw/Kconfig
 create mode 100644 arch/powerpc/cpu/mpc83xx/lblaw/lblaw.h
 create mode 100644 configs/MPC8349EMDS_PCI64_defconfig
 create mode 100644 configs/MPC8349EMDS_SDRAM_defconfig
 create mode 100644 configs/MPC8349EMDS_SLAVE_defconfig
 create mode 100644 configs/MPC837XEMDS_SLAVE_defconfig
 create mode 100644 configs/MPC837XERDB_SLAVE_defconfig
 rename include/configs/{MPC8313ERDB.h => MPC8313ERDB_NAND.h} (62%)
 create mode 100644 include/configs/MPC8313ERDB_NOR.h
 create mode 100644 include/configs/MPC8349EMDS_SDRAM.h
 create mode 100644 include/configs/caddy2.h
 delete mode 100644 include/configs/km/km8309-common.h
 delete mode 100644 include/configs/km/km8321-common.h
 delete mode 100644 include/configs/km8360.h
 rename include/configs/{km => }/km83xx-common.h (98%)
 create mode 100644 include/configs/kmcoge5ne.h
 create mode 100644 include/configs/kmeter1.h
 create mode 100644 include/configs/kmopti2.h
 create mode 100644 include/configs/kmsupx5.h
 create mode 100644 include/configs/kmtegr1.h
 create mode 100644 include/configs/kmtepr2.h
 create mode 100644 include/configs/kmvect1.h
 create mode 100644 include/configs/tuge1.h

--
2.16.4

_______________________________________________
U-Boot mailing list
[hidden email]
https://lists.denx.de/listinfo/u-boot
Reply | Threaded
Open this post in threaded view
|

[PATCH 01/48] mpc83xx: Introduce ARCH_MPC830*

Mario Six
Replace CONFIG_MPC830* with proper CONFIG_ARCH_MPC830* Kconfig options.

Signed-off-by: Mario Six <[hidden email]>
---
 arch/powerpc/cpu/mpc83xx/Kconfig             | 17 +++++++++++++
 arch/powerpc/cpu/mpc83xx/spd_sdram.c         |  2 +-
 arch/powerpc/cpu/mpc83xx/speed.c             | 38 ++++++++++++++--------------
 arch/powerpc/include/asm/arch-mpc83xx/gpio.h |  2 +-
 arch/powerpc/include/asm/fsl_lbc.h           |  2 +-
 arch/powerpc/include/asm/global_data.h       |  6 ++---
 arch/powerpc/include/asm/immap_83xx.h        | 10 ++++----
 arch/powerpc/include/asm/mpc8xxx_spi.h       |  2 +-
 board/keymile/km83xx/km83xx.c                |  2 +-
 drivers/qe/qe.c                              |  2 +-
 drivers/ram/mpc83xx_sdram.c                  |  4 +--
 include/configs/MPC8308RDB.h                 |  2 --
 include/configs/hrcon.h                      |  2 --
 include/configs/km/km8309-common.h           |  2 --
 include/configs/km/km83xx-common.h           |  2 +-
 include/configs/mpc8308_p1m.h                |  2 --
 include/configs/strider.h                    |  2 --
 include/linux/immap_qe.h                     |  2 +-
 include/mpc83xx.h                            | 24 +++++++++---------
 19 files changed, 66 insertions(+), 59 deletions(-)

diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig b/arch/powerpc/cpu/mpc83xx/Kconfig
index 571cf8fc2e..142b924786 100644
--- a/arch/powerpc/cpu/mpc83xx/Kconfig
+++ b/arch/powerpc/cpu/mpc83xx/Kconfig
@@ -10,6 +10,7 @@ choice
 
 config TARGET_MPC8308_P1M
  bool "Support mpc8308_p1m"
+ select ARCH_MPC8308
 
 config TARGET_SBC8349
  bool "Support sbc8349"
@@ -22,6 +23,7 @@ config TARGET_VME8349
 
 config TARGET_MPC8308RDB
  bool "Support MPC8308RDB"
+ select ARCH_MPC8308
  select SYS_FSL_ERRATUM_ESDHC111
 
 config TARGET_MPC8313ERDB
@@ -74,6 +76,8 @@ config TARGET_KM8360
 
 config TARGET_SUVD3
  bool "Support suvd3"
+ select ARCH_MPC8309 if SYS_EXTRA_OPTIONS="KMTEGR1"
+ select ARCH_MPC8309 if SYS_EXTRA_OPTIONS="KMVECT1"
  imply CMD_CRAMFS
  imply FS_CRAMFS
 
@@ -87,15 +91,28 @@ config TARGET_TQM834X
 
 config TARGET_HRCON
  bool "Support hrcon"
+ select ARCH_MPC8308
  select SYS_FSL_ERRATUM_ESDHC111
 
 config TARGET_STRIDER
  bool "Support strider"
+ select ARCH_MPC8308
  select SYS_FSL_ERRATUM_ESDHC111
  imply CMD_PCA953X
 
 endchoice
 
+config ARCH_MPC830X
+ bool
+
+config ARCH_MPC8308
+ bool
+ select ARCH_MPC830X
+
+config ARCH_MPC8309
+ bool
+ select ARCH_MPC830X
+
 source "board/esd/vme8349/Kconfig"
 source "board/freescale/mpc8308rdb/Kconfig"
 source "board/freescale/mpc8313erdb/Kconfig"
diff --git a/arch/powerpc/cpu/mpc83xx/spd_sdram.c b/arch/powerpc/cpu/mpc83xx/spd_sdram.c
index 328a018eb6..97ef77121b 100644
--- a/arch/powerpc/cpu/mpc83xx/spd_sdram.c
+++ b/arch/powerpc/cpu/mpc83xx/spd_sdram.c
@@ -31,7 +31,7 @@ void board_add_ram_info(int use_default)
  printf(" (DDR%d", ((ddr->sdram_cfg & SDRAM_CFG_SDRAM_TYPE_MASK)
    >> SDRAM_CFG_SDRAM_TYPE_SHIFT) - 1);
 
-#if defined(CONFIG_MPC8308) || defined(CONFIG_MPC831x)
+#if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_MPC831x)
  if ((ddr->sdram_cfg & SDRAM_CFG_DBW_MASK) == SDRAM_CFG_DBW_16)
  puts(", 16-bit");
  else if ((ddr->sdram_cfg & SDRAM_CFG_DBW_MASK) == SDRAM_CFG_DBW_32)
diff --git a/arch/powerpc/cpu/mpc83xx/speed.c b/arch/powerpc/cpu/mpc83xx/speed.c
index 39bc1c5340..d537af5130 100644
--- a/arch/powerpc/cpu/mpc83xx/speed.c
+++ b/arch/powerpc/cpu/mpc83xx/speed.c
@@ -85,12 +85,12 @@ int get_clocks(void)
  u32 lcrr;
 
  u32 csb_clk;
-#if defined(CONFIG_MPC8308) || defined(CONFIG_MPC831x) || \
+#if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_MPC831x) || \
  defined(CONFIG_MPC834x) || defined(CONFIG_MPC837x)
  u32 tsec1_clk;
  u32 tsec2_clk;
  u32 usbdr_clk;
-#elif defined(CONFIG_MPC8309)
+#elif defined(CONFIG_ARCH_MPC8309)
  u32 usbdr_clk;
 #endif
 #ifdef CONFIG_MPC834x
@@ -107,7 +107,7 @@ int get_clocks(void)
 #if defined(CONFIG_FSL_ESDHC)
  u32 sdhc_clk;
 #endif
-#if !defined(CONFIG_MPC8309)
+#if !defined(CONFIG_ARCH_MPC8309)
  u32 enc_clk;
 #endif
  u32 lbiu_clk;
@@ -122,7 +122,7 @@ int get_clocks(void)
  u32 qe_clk;
  u32 brg_clk;
 #endif
-#if defined(CONFIG_MPC8308) || defined(CONFIG_MPC831x) || \
+#if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_MPC831x) || \
  defined(CONFIG_MPC837x)
  u32 pciexp1_clk;
  u32 pciexp2_clk;
@@ -155,7 +155,7 @@ int get_clocks(void)
 
  sccr = im->clk.sccr;
 
-#if defined(CONFIG_MPC8308) || defined(CONFIG_MPC831x) || \
+#if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_MPC831x) || \
  defined(CONFIG_MPC834x) || defined(CONFIG_MPC837x)
  switch ((sccr & SCCR_TSEC1CM) >> SCCR_TSEC1CM_SHIFT) {
  case 0:
@@ -176,7 +176,7 @@ int get_clocks(void)
  }
 #endif
 
-#if defined(CONFIG_MPC830x) || defined(CONFIG_MPC831x) || \
+#if defined(CONFIG_ARCH_MPC830X) || defined(CONFIG_MPC831x) || \
  defined(CONFIG_MPC834x) || defined(CONFIG_MPC837x)
  switch ((sccr & SCCR_USBDRCM) >> SCCR_USBDRCM_SHIFT) {
  case 0:
@@ -197,7 +197,7 @@ int get_clocks(void)
  }
 #endif
 
-#if defined(CONFIG_MPC8308) || defined(CONFIG_MPC8315) || \
+#if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_MPC8315) || \
  defined(CONFIG_MPC834x) || defined(CONFIG_MPC837x)
  switch ((sccr & SCCR_TSEC2CM) >> SCCR_TSEC2CM_SHIFT) {
  case 0:
@@ -252,7 +252,7 @@ int get_clocks(void)
  return -6;
  }
 #endif
-#if !defined(CONFIG_MPC8309)
+#if !defined(CONFIG_ARCH_MPC8309)
  switch ((sccr & SCCR_ENCCM) >> SCCR_ENCCM_SHIFT) {
  case 0:
  enc_clk = 0;
@@ -317,20 +317,20 @@ int get_clocks(void)
  i2c1_clk = csb_clk;
 #elif defined(CONFIG_MPC832x)
  i2c1_clk = enc_clk;
-#elif defined(CONFIG_MPC8308) || defined(CONFIG_MPC831x)
+#elif defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_MPC831x)
  i2c1_clk = enc_clk;
 #elif defined(CONFIG_FSL_ESDHC)
  i2c1_clk = sdhc_clk;
 #elif defined(CONFIG_MPC837x)
  i2c1_clk = enc_clk;
-#elif defined(CONFIG_MPC8309)
+#elif defined(CONFIG_ARCH_MPC8309)
  i2c1_clk = csb_clk;
 #endif
 #if !defined(CONFIG_MPC832x)
  i2c2_clk = csb_clk; /* i2c-2 clk is equal to csb clk */
 #endif
 
-#if defined(CONFIG_MPC8308) || defined(CONFIG_MPC831x) || \
+#if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_MPC831x) || \
  defined(CONFIG_MPC837x)
  switch ((sccr & SCCR_PCIEXP1CM) >> SCCR_PCIEXP1CM_SHIFT) {
  case 0:
@@ -448,12 +448,12 @@ int get_clocks(void)
 #endif
 
  gd->arch.csb_clk = csb_clk;
-#if defined(CONFIG_MPC8308) || defined(CONFIG_MPC831x) || \
+#if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_MPC831x) || \
  defined(CONFIG_MPC834x) || defined(CONFIG_MPC837x)
  gd->arch.tsec1_clk = tsec1_clk;
  gd->arch.tsec2_clk = tsec2_clk;
  gd->arch.usbdr_clk = usbdr_clk;
-#elif defined(CONFIG_MPC8309)
+#elif defined(CONFIG_ARCH_MPC8309)
  gd->arch.usbdr_clk = usbdr_clk;
 #endif
 #if defined(CONFIG_MPC834x)
@@ -470,7 +470,7 @@ int get_clocks(void)
 #if !defined(CONFIG_MPC832x)
  gd->arch.i2c2_clk = i2c2_clk;
 #endif
-#if !defined(CONFIG_MPC8309)
+#if !defined(CONFIG_ARCH_MPC8309)
  gd->arch.enc_clk = enc_clk;
 #endif
  gd->arch.lbiu_clk = lbiu_clk;
@@ -483,7 +483,7 @@ int get_clocks(void)
  gd->arch.qe_clk = qe_clk;
  gd->arch.brg_clk = brg_clk;
 #endif
-#if defined(CONFIG_MPC8308) || defined(CONFIG_MPC831x) || \
+#if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_MPC831x) || \
  defined(CONFIG_MPC837x)
  gd->arch.pciexp1_clk = pciexp1_clk;
  gd->arch.pciexp2_clk = pciexp2_clk;
@@ -540,7 +540,7 @@ static int do_clocks(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
  printf("  DDR Secondary:       %-4s MHz\n",
        strmhz(buf, gd->arch.mem_sec_clk));
 #endif
-#if !defined(CONFIG_MPC8309)
+#if !defined(CONFIG_ARCH_MPC8309)
  printf("  SEC:                 %-4s MHz\n",
        strmhz(buf, gd->arch.enc_clk));
 #endif
@@ -558,7 +558,7 @@ static int do_clocks(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
  printf("  SDHC:                %-4s MHz\n",
        strmhz(buf, gd->arch.sdhc_clk));
 #endif
-#if defined(CONFIG_MPC8308) || defined(CONFIG_MPC831x) || \
+#if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_MPC831x) || \
  defined(CONFIG_MPC834x) || defined(CONFIG_MPC837x)
  printf("  TSEC1:               %-4s MHz\n",
        strmhz(buf, gd->arch.tsec1_clk));
@@ -566,7 +566,7 @@ static int do_clocks(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        strmhz(buf, gd->arch.tsec2_clk));
  printf("  USB DR:              %-4s MHz\n",
        strmhz(buf, gd->arch.usbdr_clk));
-#elif defined(CONFIG_MPC8309)
+#elif defined(CONFIG_ARCH_MPC8309)
  printf("  USB DR:              %-4s MHz\n",
        strmhz(buf, gd->arch.usbdr_clk));
 #endif
@@ -574,7 +574,7 @@ static int do_clocks(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
  printf("  USB MPH:             %-4s MHz\n",
        strmhz(buf, gd->arch.usbmph_clk));
 #endif
-#if defined(CONFIG_MPC8308) || defined(CONFIG_MPC831x) || \
+#if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_MPC831x) || \
  defined(CONFIG_MPC837x)
  printf("  PCIEXP1:             %-4s MHz\n",
        strmhz(buf, gd->arch.pciexp1_clk));
diff --git a/arch/powerpc/include/asm/arch-mpc83xx/gpio.h b/arch/powerpc/include/asm/arch-mpc83xx/gpio.h
index 57f783ba14..4e5a352ac6 100644
--- a/arch/powerpc/include/asm/arch-mpc83xx/gpio.h
+++ b/arch/powerpc/include/asm/arch-mpc83xx/gpio.h
@@ -6,7 +6,7 @@
 /*
  * The MCP83xx's 1-2 GPIO controllers each with 32 bits.
  */
-#if defined(CONFIG_MPC8313) || defined(CONFIG_MPC8308) || \
+#if defined(CONFIG_MPC8313) || defined(CONFIG_ARCH_MPC8308) || \
  defined(CONFIG_MPC8315)
 #define MPC83XX_GPIO_CTRLRS 1
 #elif defined(CONFIG_MPC834x) || defined(CONFIG_MPC837x)
diff --git a/arch/powerpc/include/asm/fsl_lbc.h b/arch/powerpc/include/asm/fsl_lbc.h
index b076d5e838..cf89e186a6 100644
--- a/arch/powerpc/include/asm/fsl_lbc.h
+++ b/arch/powerpc/include/asm/fsl_lbc.h
@@ -133,7 +133,7 @@ void lbc_sdram_init(void);
 #define OR_GPCM_EHTR_SHIFT 1
 #define OR_GPCM_EHTR_CLEAR 0x00000000
 #define OR_GPCM_EHTR_SET 0x00000002
-#if !defined(CONFIG_MPC8308)
+#if !defined(CONFIG_ARCH_MPC8308)
 #define OR_GPCM_EAD 0x00000001
 #define OR_GPCM_EAD_SHIFT 0
 #endif
diff --git a/arch/powerpc/include/asm/global_data.h b/arch/powerpc/include/asm/global_data.h
index d00cee95fb..700e2be0ee 100644
--- a/arch/powerpc/include/asm/global_data.h
+++ b/arch/powerpc/include/asm/global_data.h
@@ -35,12 +35,12 @@ struct arch_global_data {
 #else
  /* There are other clocks in the MPC83XX */
  u32 csb_clk;
-# if defined(CONFIG_MPC8308) || defined(CONFIG_MPC831x) || \
+# if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_MPC831x) || \
  defined(CONFIG_MPC834x) || defined(CONFIG_MPC837x)
  u32 tsec1_clk;
  u32 tsec2_clk;
  u32 usbdr_clk;
-# elif defined(CONFIG_MPC8309)
+# elif defined(CONFIG_ARCH_MPC8309)
  u32 usbdr_clk;
 # endif
 # if defined(CONFIG_MPC834x)
@@ -53,7 +53,7 @@ struct arch_global_data {
  u32 enc_clk;
  u32 lbiu_clk;
  u32 lclk_clk;
-# if defined(CONFIG_MPC8308) || defined(CONFIG_MPC831x) || \
+# if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_MPC831x) || \
  defined(CONFIG_MPC837x)
  u32 pciexp1_clk;
  u32 pciexp2_clk;
diff --git a/arch/powerpc/include/asm/immap_83xx.h b/arch/powerpc/include/asm/immap_83xx.h
index afef36f262..b10feb546c 100644
--- a/arch/powerpc/include/asm/immap_83xx.h
+++ b/arch/powerpc/include/asm/immap_83xx.h
@@ -59,12 +59,12 @@ typedef struct sysconf83xx {
  u32 obir; /* Output Buffer Impedance Register */
  u8 res8[0xC];
  u32 pecr1; /* PCI Express control register 1 */
-#if defined(CONFIG_MPC830x)
+#if defined(CONFIG_ARCH_MPC830X)
  u32 sdhccr; /* eSDHC Control Registers for MPC830x */
 #else
  u32 pecr2; /* PCI Express control register 2 */
 #endif
-#if defined(CONFIG_MPC8309)
+#if defined(CONFIG_ARCH_MPC8309)
  u32 can_dbg_ctrl;
  u32 res9a;
  u32 gpr1;
@@ -604,7 +604,7 @@ typedef struct serdes83xx {
  * On Chip ROM
  */
 typedef struct rom83xx {
-#if defined(CONFIG_MPC8309)
+#if defined(CONFIG_ARCH_MPC8309)
  u8 mem[0x8000];
 #else
  u8 mem[0x10000];
@@ -714,7 +714,7 @@ typedef struct immap {
  u8 res7[0xC0000];
 } immap_t;
 
-#elif defined(CONFIG_MPC8308) || defined(CONFIG_MPC8315)
+#elif defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_MPC8315)
 typedef struct immap {
  sysconf83xx_t sysconf; /* System configuration */
  wdt83xx_t wdt; /* Watch Dog Timer (WDT) Registers */
@@ -879,7 +879,7 @@ typedef struct immap {
  u8 res8[0xC0000];
  u8 qe[0x100000]; /* QE block */
 } immap_t;
-#elif defined(CONFIG_MPC8309)
+#elif defined(CONFIG_ARCH_MPC8309)
 typedef struct immap {
  sysconf83xx_t sysconf; /* System configuration */
  wdt83xx_t wdt; /* Watch Dog Timer (WDT) Registers */
diff --git a/arch/powerpc/include/asm/mpc8xxx_spi.h b/arch/powerpc/include/asm/mpc8xxx_spi.h
index 432be05469..518d0c388a 100644
--- a/arch/powerpc/include/asm/mpc8xxx_spi.h
+++ b/arch/powerpc/include/asm/mpc8xxx_spi.h
@@ -10,7 +10,7 @@
 
 #include <asm/types.h>
 
-#if defined(CONFIG_MPC8308) || \
+#if defined(CONFIG_ARCH_MPC8308) || \
  defined(CONFIG_MPC8313) || \
  defined(CONFIG_MPC8315) || \
  defined(CONFIG_MPC834x) || \
diff --git a/board/keymile/km83xx/km83xx.c b/board/keymile/km83xx/km83xx.c
index 4818a4994a..ce5126aae6 100644
--- a/board/keymile/km83xx/km83xx.c
+++ b/board/keymile/km83xx/km83xx.c
@@ -56,7 +56,7 @@ const qe_iop_conf_t qe_iop_conf_tab[] = {
  {5,  2, 1, 0, 1}, /* UART2_RTS */
  {5,  3, 2, 0, 2}, /* UART2_SIN */
  {5,  1, 2, 0, 3}, /* UART2_CTS */
-#elif !defined(CONFIG_MPC8309)
+#elif !defined(CONFIG_ARCH_MPC8309)
  /* Local Bus */
  {0, 16, 1, 0, 3}, /* LA00 */
  {0, 17, 1, 0, 3}, /* LA01 */
diff --git a/drivers/qe/qe.c b/drivers/qe/qe.c
index 7654df8008..8813dc2ae1 100644
--- a/drivers/qe/qe.c
+++ b/drivers/qe/qe.c
@@ -116,7 +116,7 @@ static void qe_sdma_init(void)
  */
 static u8 thread_snum[] = {
 /* Evthreads 16-29 are not supported in MPC8309 */
-#if !defined(CONFIG_MPC8309)
+#if !defined(CONFIG_ARCH_MPC8309)
  0x04, 0x05, 0x0c, 0x0d,
  0x14, 0x15, 0x1c, 0x1d,
  0x24, 0x25, 0x2c, 0x2d,
diff --git a/drivers/ram/mpc83xx_sdram.c b/drivers/ram/mpc83xx_sdram.c
index 441baeb6f1..e352329981 100644
--- a/drivers/ram/mpc83xx_sdram.c
+++ b/drivers/ram/mpc83xx_sdram.c
@@ -179,7 +179,7 @@ static int mpc83xx_sdram_static_init(ofnode node, u32 cs, u32 mapaddr, u32 size)
  case ODT_RD_NEVER:
  case ODT_RD_ONLY_CURRENT:
  case ODT_RD_ONLY_OTHER_CS:
- if (!IS_ENABLED(CONFIG_MPC830x) &&
+ if (!IS_ENABLED(CONFIG_ARCH_MPC830X) &&
     !IS_ENABLED(CONFIG_MPC831x) &&
     !IS_ENABLED(CONFIG_MPC8360) &&
     !IS_ENABLED(CONFIG_MPC837x)) {
@@ -210,7 +210,7 @@ static int mpc83xx_sdram_static_init(ofnode node, u32 cs, u32 mapaddr, u32 size)
  case ODT_WR_NEVER:
  case ODT_WR_ONLY_CURRENT:
  case ODT_WR_ONLY_OTHER_CS:
- if (!IS_ENABLED(CONFIG_MPC830x) &&
+ if (!IS_ENABLED(CONFIG_ARCH_MPC830X) &&
     !IS_ENABLED(CONFIG_MPC831x) &&
     !IS_ENABLED(CONFIG_MPC8360) &&
     !IS_ENABLED(CONFIG_MPC837x)) {
diff --git a/include/configs/MPC8308RDB.h b/include/configs/MPC8308RDB.h
index e5a164d4d1..3ea310ad81 100644
--- a/include/configs/MPC8308RDB.h
+++ b/include/configs/MPC8308RDB.h
@@ -12,8 +12,6 @@
  * High Level Configuration Options
  */
 #define CONFIG_E300 1 /* E300 family */
-#define CONFIG_MPC830x 1 /* MPC830x family */
-#define CONFIG_MPC8308 1 /* MPC8308 CPU specific */
 
 #ifdef CONFIG_MMC
 #define CONFIG_SYS_FSL_ESDHC_ADDR CONFIG_SYS_MPC83xx_ESDHC_ADDR
diff --git a/include/configs/hrcon.h b/include/configs/hrcon.h
index c292c258c6..da0b0f5014 100644
--- a/include/configs/hrcon.h
+++ b/include/configs/hrcon.h
@@ -13,8 +13,6 @@
  */
 #define CONFIG_E300 1 /* E300 family */
 #define CONFIG_MPC83xx 1 /* MPC83xx family */
-#define CONFIG_MPC830x 1 /* MPC830x family */
-#define CONFIG_MPC8308 1 /* MPC8308 CPU specific */
 #define CONFIG_HRCON 1 /* HRCON board specific */
 
 #define CONFIG_SYS_FSL_ESDHC_ADDR CONFIG_SYS_MPC83xx_ESDHC_ADDR
diff --git a/include/configs/km/km8309-common.h b/include/configs/km/km8309-common.h
index 0e0b1b4605..3bd334c515 100644
--- a/include/configs/km/km8309-common.h
+++ b/include/configs/km/km8309-common.h
@@ -14,8 +14,6 @@
  */
 #define CONFIG_E300 1 /* E300 family */
 #define CONFIG_QE 1 /* Has QE */
-#define CONFIG_MPC830x 1 /* MPC830x family */
-#define CONFIG_MPC8309 1 /* MPC8309 CPU specific */
 
 #define CONFIG_KM_DEF_ARCH "arch=ppc_82xx\0"
 
diff --git a/include/configs/km/km83xx-common.h b/include/configs/km/km83xx-common.h
index 337a9cec66..3868d99b87 100644
--- a/include/configs/km/km83xx-common.h
+++ b/include/configs/km/km83xx-common.h
@@ -139,7 +139,7 @@
 #define CONFIG_UEC_ETH
 #define CONFIG_ETHPRIME "UEC0"
 
-#if !defined(CONFIG_MPC8309)
+#if !defined(CONFIG_ARCH_MPC8309)
 #define CONFIG_UEC_ETH1 /* GETH1 */
 #define UEC_VERBOSE_DEBUG 1
 #endif
diff --git a/include/configs/mpc8308_p1m.h b/include/configs/mpc8308_p1m.h
index 6752ef66da..d2140e7302 100644
--- a/include/configs/mpc8308_p1m.h
+++ b/include/configs/mpc8308_p1m.h
@@ -12,8 +12,6 @@
  * High Level Configuration Options
  */
 #define CONFIG_E300 1 /* E300 family */
-#define CONFIG_MPC830x 1 /* MPC830x family */
-#define CONFIG_MPC8308 1 /* MPC8308 CPU specific */
 
 /*
  * On-board devices
diff --git a/include/configs/strider.h b/include/configs/strider.h
index 9b89031965..9a025b255f 100644
--- a/include/configs/strider.h
+++ b/include/configs/strider.h
@@ -13,8 +13,6 @@
  */
 #define CONFIG_E300 1 /* E300 family */
 #define CONFIG_MPC83xx 1 /* MPC83xx family */
-#define CONFIG_MPC830x 1 /* MPC830x family */
-#define CONFIG_MPC8308 1 /* MPC8308 CPU specific */
 #define CONFIG_STRIDER 1 /* STRIDER board specific */
 
 #define CONFIG_SYS_FSL_ESDHC_ADDR CONFIG_SYS_MPC83xx_ESDHC_ADDR
diff --git a/include/linux/immap_qe.h b/include/linux/immap_qe.h
index 51800096b2..f7bc503ea3 100644
--- a/include/linux/immap_qe.h
+++ b/include/linux/immap_qe.h
@@ -16,7 +16,7 @@
 #define QE_MURAM_SIZE 0xc000UL
 #define MAX_QE_RISC 2
 #define QE_NUM_OF_SNUM 28
-#elif defined(CONFIG_MPC832x) || defined(CONFIG_MPC8309)
+#elif defined(CONFIG_MPC832x) || defined(CONFIG_ARCH_MPC8309)
 #define QE_MURAM_SIZE 0x4000UL
 #define MAX_QE_RISC 1
 #define QE_NUM_OF_SNUM 28
diff --git a/include/mpc83xx.h b/include/mpc83xx.h
index a4c5bd3837..e93f50d0b3 100644
--- a/include/mpc83xx.h
+++ b/include/mpc83xx.h
@@ -129,7 +129,7 @@
 #define SPCR_TSEC2EP 0x00000003
 #define SPCR_TSEC2EP_SHIFT (31-31)
 
-#elif defined(CONFIG_MPC8308) || defined(CONFIG_MPC831x) || \
+#elif defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_MPC831x) || \
  defined(CONFIG_MPC837x)
 /* SPCR bits - MPC8308, MPC831x and MPC837x specific */
 /* TSEC data priority */
@@ -336,7 +336,7 @@
 #define SICRH_SPI 0x00000003
 #define SICRH_SPI_SD 0x00000001
 
-#elif defined(CONFIG_MPC8308)
+#elif defined(CONFIG_ARCH_MPC8308)
 /* SICRL bits - MPC8308 specific */
 #define SICRL_SPI_PF0 (0 << 28)
 #define SICRL_SPI_PF1 (1 << 28)
@@ -384,7 +384,7 @@
 #define SICRH_TSOBI2_V3P3 (0 << 0)
 #define SICRH_TSOBI2_V2P5 (1 << 0)
 
-#elif defined(CONFIG_MPC8309)
+#elif defined(CONFIG_ARCH_MPC8309)
 /* SICR_1 */
 #define SICR_1_UART1_UART1S (0 << (30-2))
 #define SICR_1_UART1_UART1RTS (1 << (30-2))
@@ -639,7 +639,7 @@
 #define HRCWL_CE_TO_PLL_1X30 0x0000001E
 #define HRCWL_CE_TO_PLL_1X31 0x0000001F
 
-#elif defined(CONFIG_MPC8308) || defined(CONFIG_MPC8315)
+#elif defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_MPC8315)
 #define HRCWL_SVCOD 0x30000000
 #define HRCWL_SVCOD_SHIFT 28
 #define HRCWL_SVCOD_DIV_2 0x00000000
@@ -654,7 +654,7 @@
 #define HRCWL_SVCOD_DIV_8 0x10000000
 #define HRCWL_SVCOD_DIV_2 0x20000000
 #define HRCWL_SVCOD_DIV_1 0x30000000
-#elif defined(CONFIG_MPC8309)
+#elif defined(CONFIG_ARCH_MPC8309)
 
 #define HRCWL_CEVCOD 0x000000C0
 #define HRCWL_CEVCOD_SHIFT 6
@@ -765,7 +765,7 @@
 #define HRCWH_ROM_LOC_LOCAL_16BIT 0x00600000
 #define HRCWH_ROM_LOC_LOCAL_32BIT 0x00700000
 
-#if defined(CONFIG_MPC8308) || defined(CONFIG_MPC831x) || \
+#if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_MPC831x) || \
  defined(CONFIG_MPC837x)
 #define HRCWH_ROM_LOC_NAND_SP_8BIT 0x00100000
 #define HRCWH_ROM_LOC_NAND_SP_16BIT 0x00200000
@@ -818,7 +818,7 @@
 /*
  * RSR - Reset Status Register
  */
-#if defined(CONFIG_MPC8308) || defined(CONFIG_MPC831x) || \
+#if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_MPC831x) || \
  defined(CONFIG_MPC837x)
 #define RSR_RSTSRC 0xF0000000 /* Reset source */
 #define RSR_RSTSRC_SHIFT 28
@@ -986,7 +986,7 @@
 #define SCCR_USBDRCM_2 0x00200000
 #define SCCR_USBDRCM_3 0x00300000
 
-#elif defined(CONFIG_MPC8308) || defined(CONFIG_MPC8315)
+#elif defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_MPC8315)
 /* SCCR bits - MPC8315/MPC8308 specific */
 #define SCCR_TSEC1CM 0xc0000000
 #define SCCR_TSEC1CM_SHIFT 30
@@ -1071,7 +1071,7 @@
 #define SCCR_SATACM_1 0x00000055
 #define SCCR_SATACM_2 0x000000aa
 #define SCCR_SATACM_3 0x000000ff
-#elif defined(CONFIG_MPC8309)
+#elif defined(CONFIG_ARCH_MPC8309)
 /* SCCR bits - MPC8309 specific */
 #define SCCR_SDHCCM 0x0c000000
 #define SCCR_SDHCCM_SHIFT 26
@@ -1117,7 +1117,7 @@
  */
 #define CSCONFIG_EN 0x80000000
 #define CSCONFIG_AP 0x00800000
-#if defined(CONFIG_MPC830x) || defined(CONFIG_MPC831x)
+#if defined(CONFIG_ARCH_MPC830X) || defined(CONFIG_MPC831x)
 #define CSCONFIG_ODT_RD_NEVER 0x00000000
 #define CSCONFIG_ODT_RD_ONLY_CURRENT 0x00100000
 #define CSCONFIG_ODT_RD_ONLY_OTHER_CS 0x00200000
@@ -1239,14 +1239,14 @@
 #define SDRAM_CFG_SDRAM_TYPE_MASK 0x07000000
 #define SDRAM_CFG_SDRAM_TYPE_SHIFT 24
 #define SDRAM_CFG_DYN_PWR 0x00200000
-#if defined(CONFIG_MPC8308) || defined(CONFIG_MPC831x)
+#if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_MPC831x)
 #define SDRAM_CFG_DBW_MASK 0x00180000
 #define SDRAM_CFG_DBW_16 0x00100000
 #define SDRAM_CFG_DBW_32 0x00080000
 #else
 #define SDRAM_CFG_32_BE 0x00080000
 #endif
-#if !defined(CONFIG_MPC8308)
+#if !defined(CONFIG_ARCH_MPC8308)
 #define SDRAM_CFG_8_BE 0x00040000
 #endif
 #define SDRAM_CFG_NCAP 0x00020000
--
2.16.4

_______________________________________________
U-Boot mailing list
[hidden email]
https://lists.denx.de/listinfo/u-boot
Reply | Threaded
Open this post in threaded view
|

[PATCH 02/48] mpc83xx: Introduce ARCH_MPC831*

Mario Six
In reply to this post by Mario Six
Replace CONFIG_MPC833* with proper CONFIG_ARCH_MPC833* Kconfig options.

Signed-off-by: Mario Six <[hidden email]>
---
 arch/powerpc/cpu/mpc83xx/Kconfig             | 15 +++++++++++
 arch/powerpc/cpu/mpc83xx/cpu.c               |  2 +-
 arch/powerpc/cpu/mpc83xx/cpu_init.c          |  4 +--
 arch/powerpc/cpu/mpc83xx/fdt.c               |  6 ++---
 arch/powerpc/cpu/mpc83xx/spd_sdram.c         |  2 +-
 arch/powerpc/cpu/mpc83xx/speed.c             | 40 ++++++++++++++--------------
 arch/powerpc/include/asm/arch-mpc83xx/gpio.h |  4 +--
 arch/powerpc/include/asm/global_data.h       |  8 +++---
 arch/powerpc/include/asm/immap_83xx.h        |  4 +--
 arch/powerpc/include/asm/mpc8xxx_spi.h       |  4 +--
 drivers/ram/mpc83xx_sdram.c                  |  4 +--
 include/configs/MPC8313ERDB.h                |  2 --
 include/configs/MPC8315ERDB.h                |  2 --
 include/configs/ids8313.h                    |  3 ---
 include/configs/ve8313.h                     |  2 --
 include/mpc83xx.h                            | 20 +++++++-------
 16 files changed, 64 insertions(+), 58 deletions(-)

diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig b/arch/powerpc/cpu/mpc83xx/Kconfig
index 142b924786..20780ba68b 100644
--- a/arch/powerpc/cpu/mpc83xx/Kconfig
+++ b/arch/powerpc/cpu/mpc83xx/Kconfig
@@ -17,6 +17,7 @@ config TARGET_SBC8349
 
 config TARGET_VE8313
  bool "Support ve8313"
+ select ARCH_MPC8313
 
 config TARGET_VME8349
  bool "Support vme8349"
@@ -28,11 +29,13 @@ config TARGET_MPC8308RDB
 
 config TARGET_MPC8313ERDB
  bool "Support MPC8313ERDB"
+ select ARCH_MPC8313
  select BOARD_EARLY_INIT_F
  select SUPPORT_SPL
 
 config TARGET_MPC8315ERDB
  bool "Support MPC8315ERDB"
+ select ARCH_MPC8315
  select BOARD_EARLY_INIT_F
 
 config TARGET_MPC8323ERDB
@@ -65,6 +68,7 @@ config TARGET_MPC837XERDB
 
 config TARGET_IDS8313
  bool "Support ids8313"
+ select ARCH_MPC8313
  select DM
  imply CMD_DM
 
@@ -113,6 +117,17 @@ config ARCH_MPC8309
  bool
  select ARCH_MPC830X
 
+config ARCH_MPC831X
+ bool
+
+config ARCH_MPC8313
+ bool
+ select ARCH_MPC831X
+
+config ARCH_MPC8315
+ bool
+ select ARCH_MPC831X
+
 source "board/esd/vme8349/Kconfig"
 source "board/freescale/mpc8308rdb/Kconfig"
 source "board/freescale/mpc8313erdb/Kconfig"
diff --git a/arch/powerpc/cpu/mpc83xx/cpu.c b/arch/powerpc/cpu/mpc83xx/cpu.c
index b29f271e9b..8a88068fdb 100644
--- a/arch/powerpc/cpu/mpc83xx/cpu.c
+++ b/arch/powerpc/cpu/mpc83xx/cpu.c
@@ -18,7 +18,7 @@
 #include <tsec.h>
 #include <netdev.h>
 #include <fsl_esdhc.h>
-#if defined(CONFIG_BOOTCOUNT_LIMIT) && !defined(CONFIG_MPC831x)
+#if defined(CONFIG_BOOTCOUNT_LIMIT) && !defined(CONFIG_ARCH_MPC831X)
 #include <linux/immap_qe.h>
 #include <asm/io.h>
 #endif
diff --git a/arch/powerpc/cpu/mpc83xx/cpu_init.c b/arch/powerpc/cpu/mpc83xx/cpu_init.c
index 1555205e06..7d8d5516b4 100644
--- a/arch/powerpc/cpu/mpc83xx/cpu_init.c
+++ b/arch/powerpc/cpu/mpc83xx/cpu_init.c
@@ -240,7 +240,7 @@ void cpu_init_f (volatile immap_t * im)
 
  /* System General Purpose Register */
 #ifdef CONFIG_SYS_SICRH
-#if defined(CONFIG_MPC834x) || defined(CONFIG_MPC8313)
+#if defined(CONFIG_MPC834x) || defined(CONFIG_ARCH_MPC8313)
  /* regarding to MPC34x manual rev.1 bits 28..29 must be preserved */
  __raw_writel((im->sysconf.sicrh & 0x0000000C) | CONFIG_SYS_SICRH,
      &im->sysconf.sicrh);
@@ -312,7 +312,7 @@ void cpu_init_f (volatile immap_t * im)
  im->gpio[1].dat = CONFIG_SYS_GPIO2_DAT;
  im->gpio[1].dir = CONFIG_SYS_GPIO2_DIR;
 #endif
-#if defined(CONFIG_USB_EHCI_FSL) && defined(CONFIG_MPC831x)
+#if defined(CONFIG_USB_EHCI_FSL) && defined(CONFIG_ARCH_MPC831X)
  uint32_t temp;
  struct usb_ehci *ehci = (struct usb_ehci *)CONFIG_SYS_FSL_USB1_ADDR;
 
diff --git a/arch/powerpc/cpu/mpc83xx/fdt.c b/arch/powerpc/cpu/mpc83xx/fdt.c
index 0ecafd708f..cfd391b78a 100644
--- a/arch/powerpc/cpu/mpc83xx/fdt.c
+++ b/arch/powerpc/cpu/mpc83xx/fdt.c
@@ -16,7 +16,7 @@ extern void ft_qe_setup(void *blob);
 DECLARE_GLOBAL_DATA_PTR;
 
 #if defined(CONFIG_BOOTCOUNT_LIMIT) && \
- (defined(CONFIG_QE) && !defined(CONFIG_MPC831x))
+ (defined(CONFIG_QE) && !defined(CONFIG_ARCH_MPC831X))
 #include <linux/immap_qe.h>
 
 void fdt_fixup_muram (void *blob)
@@ -52,7 +52,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
 #if defined(CONFIG_HAS_ETH0) || defined(CONFIG_HAS_ETH1) ||\
     defined(CONFIG_HAS_ETH2) || defined(CONFIG_HAS_ETH3) ||\
     defined(CONFIG_HAS_ETH4) || defined(CONFIG_HAS_ETH5)
-#ifdef CONFIG_MPC8313
+#ifdef CONFIG_ARCH_MPC8313
  /*
  * mpc8313e erratum IPIC1 swapped TSEC interrupt ID numbers on rev. 1
  * h/w (see AN3545).  The base device tree in use has rev. 1 ID numbers,
@@ -123,7 +123,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
  fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
 
 #if defined(CONFIG_BOOTCOUNT_LIMIT) && \
- (defined(CONFIG_QE) && !defined(CONFIG_MPC831x))
+ (defined(CONFIG_QE) && !defined(CONFIG_ARCH_MPC831X))
  fdt_fixup_muram (blob);
 #endif
 }
diff --git a/arch/powerpc/cpu/mpc83xx/spd_sdram.c b/arch/powerpc/cpu/mpc83xx/spd_sdram.c
index 97ef77121b..3f18aadf19 100644
--- a/arch/powerpc/cpu/mpc83xx/spd_sdram.c
+++ b/arch/powerpc/cpu/mpc83xx/spd_sdram.c
@@ -31,7 +31,7 @@ void board_add_ram_info(int use_default)
  printf(" (DDR%d", ((ddr->sdram_cfg & SDRAM_CFG_SDRAM_TYPE_MASK)
    >> SDRAM_CFG_SDRAM_TYPE_SHIFT) - 1);
 
-#if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_MPC831x)
+#if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC831X)
  if ((ddr->sdram_cfg & SDRAM_CFG_DBW_MASK) == SDRAM_CFG_DBW_16)
  puts(", 16-bit");
  else if ((ddr->sdram_cfg & SDRAM_CFG_DBW_MASK) == SDRAM_CFG_DBW_32)
diff --git a/arch/powerpc/cpu/mpc83xx/speed.c b/arch/powerpc/cpu/mpc83xx/speed.c
index d537af5130..9f09d2955f 100644
--- a/arch/powerpc/cpu/mpc83xx/speed.c
+++ b/arch/powerpc/cpu/mpc83xx/speed.c
@@ -85,7 +85,7 @@ int get_clocks(void)
  u32 lcrr;
 
  u32 csb_clk;
-#if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_MPC831x) || \
+#if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC831X) || \
  defined(CONFIG_MPC834x) || defined(CONFIG_MPC837x)
  u32 tsec1_clk;
  u32 tsec2_clk;
@@ -101,7 +101,7 @@ int get_clocks(void)
 #if !defined(CONFIG_MPC832x)
  u32 i2c2_clk;
 #endif
-#if defined(CONFIG_MPC8315)
+#if defined(CONFIG_ARCH_MPC8315)
  u32 tdm_clk;
 #endif
 #if defined(CONFIG_FSL_ESDHC)
@@ -122,12 +122,12 @@ int get_clocks(void)
  u32 qe_clk;
  u32 brg_clk;
 #endif
-#if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_MPC831x) || \
+#if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC831X) || \
  defined(CONFIG_MPC837x)
  u32 pciexp1_clk;
  u32 pciexp2_clk;
 #endif
-#if defined(CONFIG_MPC837x) || defined(CONFIG_MPC8315)
+#if defined(CONFIG_MPC837x) || defined(CONFIG_ARCH_MPC8315)
  u32 sata_clk;
 #endif
 
@@ -155,7 +155,7 @@ int get_clocks(void)
 
  sccr = im->clk.sccr;
 
-#if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_MPC831x) || \
+#if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC831X) || \
  defined(CONFIG_MPC834x) || defined(CONFIG_MPC837x)
  switch ((sccr & SCCR_TSEC1CM) >> SCCR_TSEC1CM_SHIFT) {
  case 0:
@@ -176,7 +176,7 @@ int get_clocks(void)
  }
 #endif
 
-#if defined(CONFIG_ARCH_MPC830X) || defined(CONFIG_MPC831x) || \
+#if defined(CONFIG_ARCH_MPC830X) || defined(CONFIG_ARCH_MPC831X) || \
  defined(CONFIG_MPC834x) || defined(CONFIG_MPC837x)
  switch ((sccr & SCCR_USBDRCM) >> SCCR_USBDRCM_SHIFT) {
  case 0:
@@ -197,7 +197,7 @@ int get_clocks(void)
  }
 #endif
 
-#if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_MPC8315) || \
+#if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC8315) || \
  defined(CONFIG_MPC834x) || defined(CONFIG_MPC837x)
  switch ((sccr & SCCR_TSEC2CM) >> SCCR_TSEC2CM_SHIFT) {
  case 0:
@@ -216,7 +216,7 @@ int get_clocks(void)
  /* unknown SCCR_TSEC2CM value */
  return -4;
  }
-#elif defined(CONFIG_MPC8313)
+#elif defined(CONFIG_ARCH_MPC8313)
  tsec2_clk = tsec1_clk;
 
  if (!(sccr & SCCR_TSEC1ON))
@@ -291,7 +291,7 @@ int get_clocks(void)
  return -8;
  }
 #endif
-#if defined(CONFIG_MPC8315)
+#if defined(CONFIG_ARCH_MPC8315)
  switch ((sccr & SCCR_TDMCM) >> SCCR_TDMCM_SHIFT) {
  case 0:
  tdm_clk = 0;
@@ -317,7 +317,7 @@ int get_clocks(void)
  i2c1_clk = csb_clk;
 #elif defined(CONFIG_MPC832x)
  i2c1_clk = enc_clk;
-#elif defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_MPC831x)
+#elif defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC831X)
  i2c1_clk = enc_clk;
 #elif defined(CONFIG_FSL_ESDHC)
  i2c1_clk = sdhc_clk;
@@ -330,7 +330,7 @@ int get_clocks(void)
  i2c2_clk = csb_clk; /* i2c-2 clk is equal to csb clk */
 #endif
 
-#if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_MPC831x) || \
+#if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC831X) || \
  defined(CONFIG_MPC837x)
  switch ((sccr & SCCR_PCIEXP1CM) >> SCCR_PCIEXP1CM_SHIFT) {
  case 0:
@@ -369,7 +369,7 @@ int get_clocks(void)
  }
 #endif
 
-#if defined(CONFIG_MPC837x) || defined(CONFIG_MPC8315)
+#if defined(CONFIG_MPC837x) || defined(CONFIG_ARCH_MPC8315)
  switch ((sccr & SCCR_SATA1CM) >> SCCR_SATA1CM_SHIFT) {
  case 0:
  sata_clk = 0;
@@ -448,7 +448,7 @@ int get_clocks(void)
 #endif
 
  gd->arch.csb_clk = csb_clk;
-#if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_MPC831x) || \
+#if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC831X) || \
  defined(CONFIG_MPC834x) || defined(CONFIG_MPC837x)
  gd->arch.tsec1_clk = tsec1_clk;
  gd->arch.tsec2_clk = tsec2_clk;
@@ -459,7 +459,7 @@ int get_clocks(void)
 #if defined(CONFIG_MPC834x)
  gd->arch.usbmph_clk = usbmph_clk;
 #endif
-#if defined(CONFIG_MPC8315)
+#if defined(CONFIG_ARCH_MPC8315)
  gd->arch.tdm_clk = tdm_clk;
 #endif
 #if defined(CONFIG_FSL_ESDHC)
@@ -483,12 +483,12 @@ int get_clocks(void)
  gd->arch.qe_clk = qe_clk;
  gd->arch.brg_clk = brg_clk;
 #endif
-#if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_MPC831x) || \
+#if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC831X) || \
  defined(CONFIG_MPC837x)
  gd->arch.pciexp1_clk = pciexp1_clk;
  gd->arch.pciexp2_clk = pciexp2_clk;
 #endif
-#if defined(CONFIG_MPC837x) || defined(CONFIG_MPC8315)
+#if defined(CONFIG_MPC837x) || defined(CONFIG_ARCH_MPC8315)
  gd->arch.sata_clk = sata_clk;
 #endif
  gd->pci_clk = pci_sync_in;
@@ -550,7 +550,7 @@ static int do_clocks(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
  printf("  I2C2:                %-4s MHz\n",
        strmhz(buf, gd->arch.i2c2_clk));
 #endif
-#if defined(CONFIG_MPC8315)
+#if defined(CONFIG_ARCH_MPC8315)
  printf("  TDM:                 %-4s MHz\n",
        strmhz(buf, gd->arch.tdm_clk));
 #endif
@@ -558,7 +558,7 @@ static int do_clocks(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
  printf("  SDHC:                %-4s MHz\n",
        strmhz(buf, gd->arch.sdhc_clk));
 #endif
-#if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_MPC831x) || \
+#if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC831X) || \
  defined(CONFIG_MPC834x) || defined(CONFIG_MPC837x)
  printf("  TSEC1:               %-4s MHz\n",
        strmhz(buf, gd->arch.tsec1_clk));
@@ -574,14 +574,14 @@ static int do_clocks(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
  printf("  USB MPH:             %-4s MHz\n",
        strmhz(buf, gd->arch.usbmph_clk));
 #endif
-#if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_MPC831x) || \
+#if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC831X) || \
  defined(CONFIG_MPC837x)
  printf("  PCIEXP1:             %-4s MHz\n",
        strmhz(buf, gd->arch.pciexp1_clk));
  printf("  PCIEXP2:             %-4s MHz\n",
        strmhz(buf, gd->arch.pciexp2_clk));
 #endif
-#if defined(CONFIG_MPC837x) || defined(CONFIG_MPC8315)
+#if defined(CONFIG_MPC837x) || defined(CONFIG_ARCH_MPC8315)
  printf("  SATA:                %-4s MHz\n",
        strmhz(buf, gd->arch.sata_clk));
 #endif
diff --git a/arch/powerpc/include/asm/arch-mpc83xx/gpio.h b/arch/powerpc/include/asm/arch-mpc83xx/gpio.h
index 4e5a352ac6..74ba91a469 100644
--- a/arch/powerpc/include/asm/arch-mpc83xx/gpio.h
+++ b/arch/powerpc/include/asm/arch-mpc83xx/gpio.h
@@ -6,8 +6,8 @@
 /*
  * The MCP83xx's 1-2 GPIO controllers each with 32 bits.
  */
-#if defined(CONFIG_MPC8313) || defined(CONFIG_ARCH_MPC8308) || \
- defined(CONFIG_MPC8315)
+#if defined(CONFIG_ARCH_MPC8313) || defined(CONFIG_ARCH_MPC8308) || \
+ defined(CONFIG_ARCH_MPC8315)
 #define MPC83XX_GPIO_CTRLRS 1
 #elif defined(CONFIG_MPC834x) || defined(CONFIG_MPC837x)
 #define MPC83XX_GPIO_CTRLRS 2
diff --git a/arch/powerpc/include/asm/global_data.h b/arch/powerpc/include/asm/global_data.h
index 700e2be0ee..0c3a4ade5c 100644
--- a/arch/powerpc/include/asm/global_data.h
+++ b/arch/powerpc/include/asm/global_data.h
@@ -35,7 +35,7 @@ struct arch_global_data {
 #else
  /* There are other clocks in the MPC83XX */
  u32 csb_clk;
-# if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_MPC831x) || \
+# if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC831X) || \
  defined(CONFIG_MPC834x) || defined(CONFIG_MPC837x)
  u32 tsec1_clk;
  u32 tsec2_clk;
@@ -46,19 +46,19 @@ struct arch_global_data {
 # if defined(CONFIG_MPC834x)
  u32 usbmph_clk;
 # endif /* CONFIG_MPC834x */
-# if defined(CONFIG_MPC8315)
+# if defined(CONFIG_ARCH_MPC8315)
  u32 tdm_clk;
 # endif
  u32 core_clk;
  u32 enc_clk;
  u32 lbiu_clk;
  u32 lclk_clk;
-# if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_MPC831x) || \
+# if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC831X) || \
  defined(CONFIG_MPC837x)
  u32 pciexp1_clk;
  u32 pciexp2_clk;
 # endif
-# if defined(CONFIG_MPC837x) || defined(CONFIG_MPC8315)
+# if defined(CONFIG_MPC837x) || defined(CONFIG_ARCH_MPC8315)
  u32 sata_clk;
 # endif
 # if defined(CONFIG_MPC8360)
diff --git a/arch/powerpc/include/asm/immap_83xx.h b/arch/powerpc/include/asm/immap_83xx.h
index b10feb546c..d22d887bab 100644
--- a/arch/powerpc/include/asm/immap_83xx.h
+++ b/arch/powerpc/include/asm/immap_83xx.h
@@ -679,7 +679,7 @@ typedef struct immap {
 #define CONFIG_SYS_MPC83xx_USB2_OFFSET  0x23000
 #endif
 
-#elif defined(CONFIG_MPC8313)
+#elif defined(CONFIG_ARCH_MPC8313)
 typedef struct immap {
  sysconf83xx_t sysconf; /* System configuration */
  wdt83xx_t wdt; /* Watch Dog Timer (WDT) Registers */
@@ -714,7 +714,7 @@ typedef struct immap {
  u8 res7[0xC0000];
 } immap_t;
 
-#elif defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_MPC8315)
+#elif defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC8315)
 typedef struct immap {
  sysconf83xx_t sysconf; /* System configuration */
  wdt83xx_t wdt; /* Watch Dog Timer (WDT) Registers */
diff --git a/arch/powerpc/include/asm/mpc8xxx_spi.h b/arch/powerpc/include/asm/mpc8xxx_spi.h
index 518d0c388a..3edd561007 100644
--- a/arch/powerpc/include/asm/mpc8xxx_spi.h
+++ b/arch/powerpc/include/asm/mpc8xxx_spi.h
@@ -11,8 +11,8 @@
 #include <asm/types.h>
 
 #if defined(CONFIG_ARCH_MPC8308) || \
- defined(CONFIG_MPC8313) || \
- defined(CONFIG_MPC8315) || \
+ defined(CONFIG_ARCH_MPC8313) || \
+ defined(CONFIG_ARCH_MPC8315) || \
  defined(CONFIG_MPC834x) || \
  defined(CONFIG_MPC837x)
 
diff --git a/drivers/ram/mpc83xx_sdram.c b/drivers/ram/mpc83xx_sdram.c
index e352329981..58db7948c1 100644
--- a/drivers/ram/mpc83xx_sdram.c
+++ b/drivers/ram/mpc83xx_sdram.c
@@ -180,7 +180,7 @@ static int mpc83xx_sdram_static_init(ofnode node, u32 cs, u32 mapaddr, u32 size)
  case ODT_RD_ONLY_CURRENT:
  case ODT_RD_ONLY_OTHER_CS:
  if (!IS_ENABLED(CONFIG_ARCH_MPC830X) &&
-    !IS_ENABLED(CONFIG_MPC831x) &&
+    !IS_ENABLED(CONFIG_ARCH_MPC831X) &&
     !IS_ENABLED(CONFIG_MPC8360) &&
     !IS_ENABLED(CONFIG_MPC837x)) {
  debug("%s: odt_rd_cfg value %d invalid.\n",
@@ -211,7 +211,7 @@ static int mpc83xx_sdram_static_init(ofnode node, u32 cs, u32 mapaddr, u32 size)
  case ODT_WR_ONLY_CURRENT:
  case ODT_WR_ONLY_OTHER_CS:
  if (!IS_ENABLED(CONFIG_ARCH_MPC830X) &&
-    !IS_ENABLED(CONFIG_MPC831x) &&
+    !IS_ENABLED(CONFIG_ARCH_MPC831X) &&
     !IS_ENABLED(CONFIG_MPC8360) &&
     !IS_ENABLED(CONFIG_MPC837x)) {
  debug("%s: odt_wr_cfg value %d invalid.\n",
diff --git a/include/configs/MPC8313ERDB.h b/include/configs/MPC8313ERDB.h
index 884dd4125e..d522d21a74 100644
--- a/include/configs/MPC8313ERDB.h
+++ b/include/configs/MPC8313ERDB.h
@@ -13,8 +13,6 @@
  * High Level Configuration Options
  */
 #define CONFIG_E300 1
-#define CONFIG_MPC831x 1
-#define CONFIG_MPC8313 1
 #define CONFIG_MPC8313ERDB 1
 
 #ifdef CONFIG_NAND
diff --git a/include/configs/MPC8315ERDB.h b/include/configs/MPC8315ERDB.h
index 9de3744759..64967f6798 100644
--- a/include/configs/MPC8315ERDB.h
+++ b/include/configs/MPC8315ERDB.h
@@ -22,8 +22,6 @@
  * High Level Configuration Options
  */
 #define CONFIG_E300 1 /* E300 family */
-#define CONFIG_MPC831x 1 /* MPC831x CPU family */
-#define CONFIG_MPC8315 1 /* MPC8315 CPU specific */
 #define CONFIG_MPC8315ERDB 1 /* MPC8315ERDB board specific */
 
 /*
diff --git a/include/configs/ids8313.h b/include/configs/ids8313.h
index afa7e10778..6a222e9757 100644
--- a/include/configs/ids8313.h
+++ b/include/configs/ids8313.h
@@ -14,9 +14,6 @@
 /*
  * High Level Configuration Options
  */
-#define CONFIG_MPC831x
-#define CONFIG_MPC8313
-
 #define CONFIG_FSL_ELBC
 
 #define CONFIG_BOOT_RETRY_TIME 900
diff --git a/include/configs/ve8313.h b/include/configs/ve8313.h
index 90554dacf8..dfbebee6b2 100644
--- a/include/configs/ve8313.h
+++ b/include/configs/ve8313.h
@@ -16,8 +16,6 @@
  * High Level Configuration Options
  */
 #define CONFIG_E300 1
-#define CONFIG_MPC831x 1
-#define CONFIG_MPC8313 1
 
 #define CONFIG_PCI_INDIRECT_BRIDGE 1
 #define CONFIG_FSL_ELBC 1
diff --git a/include/mpc83xx.h b/include/mpc83xx.h
index e93f50d0b3..0da271b2f3 100644
--- a/include/mpc83xx.h
+++ b/include/mpc83xx.h
@@ -129,7 +129,7 @@
 #define SPCR_TSEC2EP 0x00000003
 #define SPCR_TSEC2EP_SHIFT (31-31)
 
-#elif defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_MPC831x) || \
+#elif defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC831X) || \
  defined(CONFIG_MPC837x)
 /* SPCR bits - MPC8308, MPC831x and MPC837x specific */
 /* TSEC data priority */
@@ -216,7 +216,7 @@
 #define SICRL_URT_CTPR 0x06000000
 #define SICRL_IRQ_CTPR 0x00C00000
 
-#elif defined(CONFIG_MPC8313)
+#elif defined(CONFIG_ARCH_MPC8313)
 /* SICRL bits - MPC8313 specific */
 #define SICRL_LBC 0x30000000
 #define SICRL_UART 0x0C000000
@@ -248,7 +248,7 @@
 #define SICRH_TSOBI1 0x00000002
 #define SICRH_TSOBI2 0x00000001
 
-#elif defined(CONFIG_MPC8315)
+#elif defined(CONFIG_ARCH_MPC8315)
 /* SICRL bits - MPC8315 specific */
 #define SICRL_DMA_CH0 0xc0000000
 #define SICRL_DMA_SPI 0x30000000
@@ -639,7 +639,7 @@
 #define HRCWL_CE_TO_PLL_1X30 0x0000001E
 #define HRCWL_CE_TO_PLL_1X31 0x0000001F
 
-#elif defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_MPC8315)
+#elif defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC8315)
 #define HRCWL_SVCOD 0x30000000
 #define HRCWL_SVCOD_SHIFT 28
 #define HRCWL_SVCOD_DIV_2 0x00000000
@@ -765,7 +765,7 @@
 #define HRCWH_ROM_LOC_LOCAL_16BIT 0x00600000
 #define HRCWH_ROM_LOC_LOCAL_32BIT 0x00700000
 
-#if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_MPC831x) || \
+#if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC831X) || \
  defined(CONFIG_MPC837x)
 #define HRCWH_ROM_LOC_NAND_SP_8BIT 0x00100000
 #define HRCWH_ROM_LOC_NAND_SP_16BIT 0x00200000
@@ -818,7 +818,7 @@
 /*
  * RSR - Reset Status Register
  */
-#if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_MPC831x) || \
+#if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC831X) || \
  defined(CONFIG_MPC837x)
 #define RSR_RSTSRC 0xF0000000 /* Reset source */
 #define RSR_RSTSRC_SHIFT 28
@@ -965,7 +965,7 @@
 #define SCCR_USBCM_2 0x00A00000
 #define SCCR_USBCM_3 0x00F00000
 
-#elif defined(CONFIG_MPC8313)
+#elif defined(CONFIG_ARCH_MPC8313)
 /* TSEC1 bits are for TSEC2 as well */
 #define SCCR_TSEC1CM 0xc0000000
 #define SCCR_TSEC1CM_SHIFT 30
@@ -986,7 +986,7 @@
 #define SCCR_USBDRCM_2 0x00200000
 #define SCCR_USBDRCM_3 0x00300000
 
-#elif defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_MPC8315)
+#elif defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC8315)
 /* SCCR bits - MPC8315/MPC8308 specific */
 #define SCCR_TSEC1CM 0xc0000000
 #define SCCR_TSEC1CM_SHIFT 30
@@ -1117,7 +1117,7 @@
  */
 #define CSCONFIG_EN 0x80000000
 #define CSCONFIG_AP 0x00800000
-#if defined(CONFIG_ARCH_MPC830X) || defined(CONFIG_MPC831x)
+#if defined(CONFIG_ARCH_MPC830X) || defined(CONFIG_ARCH_MPC831X)
 #define CSCONFIG_ODT_RD_NEVER 0x00000000
 #define CSCONFIG_ODT_RD_ONLY_CURRENT 0x00100000
 #define CSCONFIG_ODT_RD_ONLY_OTHER_CS 0x00200000
@@ -1239,7 +1239,7 @@
 #define SDRAM_CFG_SDRAM_TYPE_MASK 0x07000000
 #define SDRAM_CFG_SDRAM_TYPE_SHIFT 24
 #define SDRAM_CFG_DYN_PWR 0x00200000
-#if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_MPC831x)
+#if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC831X)
 #define SDRAM_CFG_DBW_MASK 0x00180000
 #define SDRAM_CFG_DBW_16 0x00100000
 #define SDRAM_CFG_DBW_32 0x00080000
--
2.16.4

_______________________________________________
U-Boot mailing list
[hidden email]
https://lists.denx.de/listinfo/u-boot
Reply | Threaded
Open this post in threaded view
|

[PATCH 03/48] mpc83xx: Introduce ARCH_MPC832*

Mario Six
In reply to this post by Mario Six
Replace CONFIG_MPC832* with proper CONFIG_ARCH_MPC832* Kconfig options.

Signed-off-by: Mario Six <[hidden email]>
---
 arch/powerpc/cpu/mpc83xx/Kconfig      |  7 +++++++
 arch/powerpc/cpu/mpc83xx/speed.c      | 10 +++++-----
 arch/powerpc/include/asm/immap_83xx.h |  2 +-
 include/configs/MPC8323ERDB.h         |  1 -
 include/configs/MPC832XEMDS.h         |  1 -
 include/configs/km/km8321-common.h    |  1 -
 include/linux/immap_qe.h              |  2 +-
 include/mpc83xx.h                     |  6 +++---
 8 files changed, 17 insertions(+), 13 deletions(-)

diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig b/arch/powerpc/cpu/mpc83xx/Kconfig
index 20780ba68b..1b9402e024 100644
--- a/arch/powerpc/cpu/mpc83xx/Kconfig
+++ b/arch/powerpc/cpu/mpc83xx/Kconfig
@@ -40,9 +40,11 @@ config TARGET_MPC8315ERDB
 
 config TARGET_MPC8323ERDB
  bool "Support MPC8323ERDB"
+ select ARCH_MPC832X
 
 config TARGET_MPC832XEMDS
  bool "Support MPC832XEMDS"
+ select ARCH_MPC832X
  select BOARD_EARLY_INIT_F
 
 config TARGET_MPC8349EMDS
@@ -82,11 +84,13 @@ config TARGET_SUVD3
  bool "Support suvd3"
  select ARCH_MPC8309 if SYS_EXTRA_OPTIONS="KMTEGR1"
  select ARCH_MPC8309 if SYS_EXTRA_OPTIONS="KMVECT1"
+ select ARCH_MPC832X if SYS_EXTRA_OPTIONS="SUVD3"
  imply CMD_CRAMFS
  imply FS_CRAMFS
 
 config TARGET_TUXX1
  bool "Support tuxx1"
+ select ARCH_MPC832X
  imply CMD_CRAMFS
  imply FS_CRAMFS
 
@@ -128,6 +132,9 @@ config ARCH_MPC8315
  bool
  select ARCH_MPC831X
 
+config ARCH_MPC832X
+ bool
+
 source "board/esd/vme8349/Kconfig"
 source "board/freescale/mpc8308rdb/Kconfig"
 source "board/freescale/mpc8313erdb/Kconfig"
diff --git a/arch/powerpc/cpu/mpc83xx/speed.c b/arch/powerpc/cpu/mpc83xx/speed.c
index 9f09d2955f..ab025af70d 100644
--- a/arch/powerpc/cpu/mpc83xx/speed.c
+++ b/arch/powerpc/cpu/mpc83xx/speed.c
@@ -98,7 +98,7 @@ int get_clocks(void)
 #endif
  u32 core_clk;
  u32 i2c1_clk;
-#if !defined(CONFIG_MPC832x)
+#if !defined(CONFIG_ARCH_MPC832X)
  u32 i2c2_clk;
 #endif
 #if defined(CONFIG_ARCH_MPC8315)
@@ -315,7 +315,7 @@ int get_clocks(void)
  i2c1_clk = tsec2_clk;
 #elif defined(CONFIG_MPC8360)
  i2c1_clk = csb_clk;
-#elif defined(CONFIG_MPC832x)
+#elif defined(CONFIG_ARCH_MPC832X)
  i2c1_clk = enc_clk;
 #elif defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC831X)
  i2c1_clk = enc_clk;
@@ -326,7 +326,7 @@ int get_clocks(void)
 #elif defined(CONFIG_ARCH_MPC8309)
  i2c1_clk = csb_clk;
 #endif
-#if !defined(CONFIG_MPC832x)
+#if !defined(CONFIG_ARCH_MPC832X)
  i2c2_clk = csb_clk; /* i2c-2 clk is equal to csb clk */
 #endif
 
@@ -467,7 +467,7 @@ int get_clocks(void)
 #endif
  gd->arch.core_clk = core_clk;
  gd->arch.i2c1_clk = i2c1_clk;
-#if !defined(CONFIG_MPC832x)
+#if !defined(CONFIG_ARCH_MPC832X)
  gd->arch.i2c2_clk = i2c2_clk;
 #endif
 #if !defined(CONFIG_ARCH_MPC8309)
@@ -546,7 +546,7 @@ static int do_clocks(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 #endif
  printf("  I2C1:                %-4s MHz\n",
        strmhz(buf, gd->arch.i2c1_clk));
-#if !defined(CONFIG_MPC832x)
+#if !defined(CONFIG_ARCH_MPC832X)
  printf("  I2C2:                %-4s MHz\n",
        strmhz(buf, gd->arch.i2c2_clk));
 #endif
diff --git a/arch/powerpc/include/asm/immap_83xx.h b/arch/powerpc/include/asm/immap_83xx.h
index d22d887bab..318b79d0b8 100644
--- a/arch/powerpc/include/asm/immap_83xx.h
+++ b/arch/powerpc/include/asm/immap_83xx.h
@@ -843,7 +843,7 @@ typedef struct immap {
  u8 qe[0x100000]; /* QE block */
 } immap_t;
 
-#elif defined(CONFIG_MPC832x)
+#elif defined(CONFIG_ARCH_MPC832X)
 typedef struct immap {
  sysconf83xx_t sysconf; /* System configuration */
  wdt83xx_t wdt; /* Watch Dog Timer (WDT) Registers */
diff --git a/include/configs/MPC8323ERDB.h b/include/configs/MPC8323ERDB.h
index 85ea171175..0ef9dadd04 100644
--- a/include/configs/MPC8323ERDB.h
+++ b/include/configs/MPC8323ERDB.h
@@ -14,7 +14,6 @@
  */
 #define CONFIG_E300 1 /* E300 family */
 #define CONFIG_QE 1 /* Has QE */
-#define CONFIG_MPC832x 1 /* MPC832x CPU specific */
 
 /*
  * System Clock Setup
diff --git a/include/configs/MPC832XEMDS.h b/include/configs/MPC832XEMDS.h
index e92a8c0148..ff8692e9ca 100644
--- a/include/configs/MPC832XEMDS.h
+++ b/include/configs/MPC832XEMDS.h
@@ -11,7 +11,6 @@
  */
 #define CONFIG_E300 1 /* E300 family */
 #define CONFIG_QE 1 /* Has QE */
-#define CONFIG_MPC832x 1 /* MPC832x CPU specific */
 #define CONFIG_MPC832XEMDS 1 /* MPC832XEMDS board specific */
 
 /*
diff --git a/include/configs/km/km8321-common.h b/include/configs/km/km8321-common.h
index 41b3ba2842..a121a445f7 100644
--- a/include/configs/km/km8321-common.h
+++ b/include/configs/km/km8321-common.h
@@ -26,7 +26,6 @@
  * High Level Configuration Options
  */
 #define CONFIG_QE /* Has QE */
-#define CONFIG_MPC832x /* MPC832x CPU specific */
 #define CONFIG_KM8321 /* Keymile PBEC8321 board specific */
 
 #define CONFIG_KM_DEF_ARCH "arch=ppc_8xx\0"
diff --git a/include/linux/immap_qe.h b/include/linux/immap_qe.h
index f7bc503ea3..6552d0e3c5 100644
--- a/include/linux/immap_qe.h
+++ b/include/linux/immap_qe.h
@@ -16,7 +16,7 @@
 #define QE_MURAM_SIZE 0xc000UL
 #define MAX_QE_RISC 2
 #define QE_NUM_OF_SNUM 28
-#elif defined(CONFIG_MPC832x) || defined(CONFIG_ARCH_MPC8309)
+#elif defined(CONFIG_ARCH_MPC832X) || defined(CONFIG_ARCH_MPC8309)
 #define QE_MURAM_SIZE 0x4000UL
 #define MAX_QE_RISC 1
 #define QE_NUM_OF_SNUM 28
diff --git a/include/mpc83xx.h b/include/mpc83xx.h
index 0da271b2f3..0f4466ae89 100644
--- a/include/mpc83xx.h
+++ b/include/mpc83xx.h
@@ -208,7 +208,7 @@
 #define SICRH_UC2E1OBI 0x00000002
 #define SICRH_UC2E2OBI 0x00000001
 
-#elif defined(CONFIG_MPC832x)
+#elif defined(CONFIG_ARCH_MPC832X)
 /* SICRL bits - MPC832x specific */
 #define SICRL_LDP_LCS_A 0x80000000
 #define SICRL_IRQ_CKS 0x20000000
@@ -593,7 +593,7 @@
 #define HRCWL_CORE_TO_CSB_2_5X1 0x00050000
 #define HRCWL_CORE_TO_CSB_3X1 0x00060000
 
-#if defined(CONFIG_MPC8360) || defined(CONFIG_MPC832x)
+#if defined(CONFIG_MPC8360) || defined(CONFIG_ARCH_MPC832X)
 #define HRCWL_CEVCOD 0x000000C0
 #define HRCWL_CEVCOD_SHIFT 6
 #define HRCWL_CE_PLL_VCO_DIV_4 0x00000000
@@ -1126,7 +1126,7 @@
 #define CSCONFIG_ODT_WR_ONLY_CURRENT 0x00010000
 #define CSCONFIG_ODT_WR_ONLY_OTHER_CS 0x00020000
 #define CSCONFIG_ODT_WR_ALL 0x00040000
-#elif defined(CONFIG_MPC832x)
+#elif defined(CONFIG_ARCH_MPC832X)
 #define CSCONFIG_ODT_RD_CFG 0x00400000
 #define CSCONFIG_ODT_WR_CFG 0x00040000
 #elif defined(CONFIG_MPC8360) || defined(CONFIG_MPC837x)
--
2.16.4

_______________________________________________
U-Boot mailing list
[hidden email]
https://lists.denx.de/listinfo/u-boot
Reply | Threaded
Open this post in threaded view
|

[PATCH 04/48] mpc83xx: Introduce ARCH_MPC834*

Mario Six
In reply to this post by Mario Six
Replace CONFIG_MPC834* with proper CONFIG_ARCH_MPC834* Kconfig options.

Signed-off-by: Mario Six <[hidden email]>
---
 arch/powerpc/cpu/mpc83xx/Kconfig             | 14 ++++++++++++++
 arch/powerpc/cpu/mpc83xx/cpu_init.c          |  2 +-
 arch/powerpc/cpu/mpc83xx/spd_sdram.c         |  2 +-
 arch/powerpc/cpu/mpc83xx/speed.c             | 22 +++++++++++-----------
 arch/powerpc/include/asm/arch-mpc83xx/gpio.h |  2 +-
 arch/powerpc/include/asm/fsl_lbc.h           |  8 ++++----
 arch/powerpc/include/asm/global_data.h       |  6 +++---
 arch/powerpc/include/asm/immap_83xx.h        |  6 +++---
 arch/powerpc/include/asm/mpc8xxx_spi.h       |  2 +-
 drivers/pci/pci_auto.c                       |  2 +-
 drivers/pci/pci_auto_old.c                   |  2 +-
 include/configs/MPC8349EMDS.h                |  2 --
 include/configs/MPC8349ITX.h                 |  3 ---
 include/configs/TQM834x.h                    |  2 --
 include/configs/sbc8349.h                    |  2 --
 include/configs/vme8349.h                    |  2 --
 include/mpc83xx.h                            | 18 +++++++++---------
 include/usb/ehci-ci.h                        |  2 +-
 18 files changed, 51 insertions(+), 48 deletions(-)

diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig b/arch/powerpc/cpu/mpc83xx/Kconfig
index 1b9402e024..2926472319 100644
--- a/arch/powerpc/cpu/mpc83xx/Kconfig
+++ b/arch/powerpc/cpu/mpc83xx/Kconfig
@@ -14,6 +14,7 @@ config TARGET_MPC8308_P1M
 
 config TARGET_SBC8349
  bool "Support sbc8349"
+ select ARCH_MPC8349
 
 config TARGET_VE8313
  bool "Support ve8313"
@@ -21,6 +22,7 @@ config TARGET_VE8313
 
 config TARGET_VME8349
  bool "Support vme8349"
+ select ARCH_MPC8349
 
 config TARGET_MPC8308RDB
  bool "Support MPC8308RDB"
@@ -49,6 +51,7 @@ config TARGET_MPC832XEMDS
 
 config TARGET_MPC8349EMDS
  bool "Support MPC8349EMDS"
+ select ARCH_MPC8349
  select BOARD_EARLY_INIT_F
  select SYS_FSL_DDR
  select SYS_FSL_DDR_BE
@@ -56,16 +59,19 @@ config TARGET_MPC8349EMDS
 
 config TARGET_MPC8349ITX
  bool "Support MPC8349ITX"
+ select ARCH_MPC8349
  imply CMD_IRQ
 
 config TARGET_MPC837XEMDS
  bool "Support MPC837XEMDS"
+ select ARCH_MPC837X
  select BOARD_EARLY_INIT_F
  imply CMD_SATA
  imply FSL_SATA
 
 config TARGET_MPC837XERDB
  bool "Support MPC837XERDB"
+ select ARCH_MPC837X
  select BOARD_EARLY_INIT_F
 
 config TARGET_IDS8313
@@ -96,6 +102,7 @@ config TARGET_TUXX1
 
 config TARGET_TQM834X
  bool "Support TQM834x"
+ select ARCH_MPC8349
 
 config TARGET_HRCON
  bool "Support hrcon"
@@ -135,6 +142,13 @@ config ARCH_MPC8315
 config ARCH_MPC832X
  bool
 
+config ARCH_MPC834X
+ bool
+
+config ARCH_MPC8349
+ bool
+ select ARCH_MPC834X
+
 source "board/esd/vme8349/Kconfig"
 source "board/freescale/mpc8308rdb/Kconfig"
 source "board/freescale/mpc8313erdb/Kconfig"
diff --git a/arch/powerpc/cpu/mpc83xx/cpu_init.c b/arch/powerpc/cpu/mpc83xx/cpu_init.c
index 7d8d5516b4..7c378671fe 100644
--- a/arch/powerpc/cpu/mpc83xx/cpu_init.c
+++ b/arch/powerpc/cpu/mpc83xx/cpu_init.c
@@ -240,7 +240,7 @@ void cpu_init_f (volatile immap_t * im)
 
  /* System General Purpose Register */
 #ifdef CONFIG_SYS_SICRH
-#if defined(CONFIG_MPC834x) || defined(CONFIG_ARCH_MPC8313)
+#if defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_ARCH_MPC8313)
  /* regarding to MPC34x manual rev.1 bits 28..29 must be preserved */
  __raw_writel((im->sysconf.sicrh & 0x0000000C) | CONFIG_SYS_SICRH,
      &im->sysconf.sicrh);
diff --git a/arch/powerpc/cpu/mpc83xx/spd_sdram.c b/arch/powerpc/cpu/mpc83xx/spd_sdram.c
index 3f18aadf19..b3cbf9f882 100644
--- a/arch/powerpc/cpu/mpc83xx/spd_sdram.c
+++ b/arch/powerpc/cpu/mpc83xx/spd_sdram.c
@@ -426,7 +426,7 @@ long int spd_sdram()
 
  /*
  * Errata DDR6 work around: input enable 2 cycles earlier.
- * including MPC834x Rev1.0/1.1 and MPC8360 Rev1.1/1.2.
+ * including MPC834X Rev1.0/1.1 and MPC8360 Rev1.1/1.2.
  */
  if(PVR_MAJ(pvr) <= 1 && spd.mem_type == SPD_MEMTYPE_DDR){
  if (caslat == 2)
diff --git a/arch/powerpc/cpu/mpc83xx/speed.c b/arch/powerpc/cpu/mpc83xx/speed.c
index ab025af70d..7cb6f3727d 100644
--- a/arch/powerpc/cpu/mpc83xx/speed.c
+++ b/arch/powerpc/cpu/mpc83xx/speed.c
@@ -86,14 +86,14 @@ int get_clocks(void)
 
  u32 csb_clk;
 #if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC831X) || \
- defined(CONFIG_MPC834x) || defined(CONFIG_MPC837x)
+ defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_MPC837x)
  u32 tsec1_clk;
  u32 tsec2_clk;
  u32 usbdr_clk;
 #elif defined(CONFIG_ARCH_MPC8309)
  u32 usbdr_clk;
 #endif
-#ifdef CONFIG_MPC834x
+#ifdef CONFIG_ARCH_MPC834X
  u32 usbmph_clk;
 #endif
  u32 core_clk;
@@ -156,7 +156,7 @@ int get_clocks(void)
  sccr = im->clk.sccr;
 
 #if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC831X) || \
- defined(CONFIG_MPC834x) || defined(CONFIG_MPC837x)
+ defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_MPC837x)
  switch ((sccr & SCCR_TSEC1CM) >> SCCR_TSEC1CM_SHIFT) {
  case 0:
  tsec1_clk = 0;
@@ -177,7 +177,7 @@ int get_clocks(void)
 #endif
 
 #if defined(CONFIG_ARCH_MPC830X) || defined(CONFIG_ARCH_MPC831X) || \
- defined(CONFIG_MPC834x) || defined(CONFIG_MPC837x)
+ defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_MPC837x)
  switch ((sccr & SCCR_USBDRCM) >> SCCR_USBDRCM_SHIFT) {
  case 0:
  usbdr_clk = 0;
@@ -198,7 +198,7 @@ int get_clocks(void)
 #endif
 
 #if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC8315) || \
- defined(CONFIG_MPC834x) || defined(CONFIG_MPC837x)
+ defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_MPC837x)
  switch ((sccr & SCCR_TSEC2CM) >> SCCR_TSEC2CM_SHIFT) {
  case 0:
  tsec2_clk = 0;
@@ -225,7 +225,7 @@ int get_clocks(void)
  tsec2_clk = 0;
 #endif
 
-#if defined(CONFIG_MPC834x)
+#if defined(CONFIG_ARCH_MPC834X)
  switch ((sccr & SCCR_USBMPHCM) >> SCCR_USBMPHCM_SHIFT) {
  case 0:
  usbmph_clk = 0;
@@ -311,7 +311,7 @@ int get_clocks(void)
  }
 #endif
 
-#if defined(CONFIG_MPC834x)
+#if defined(CONFIG_ARCH_MPC834X)
  i2c1_clk = tsec2_clk;
 #elif defined(CONFIG_MPC8360)
  i2c1_clk = csb_clk;
@@ -449,14 +449,14 @@ int get_clocks(void)
 
  gd->arch.csb_clk = csb_clk;
 #if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC831X) || \
- defined(CONFIG_MPC834x) || defined(CONFIG_MPC837x)
+ defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_MPC837x)
  gd->arch.tsec1_clk = tsec1_clk;
  gd->arch.tsec2_clk = tsec2_clk;
  gd->arch.usbdr_clk = usbdr_clk;
 #elif defined(CONFIG_ARCH_MPC8309)
  gd->arch.usbdr_clk = usbdr_clk;
 #endif
-#if defined(CONFIG_MPC834x)
+#if defined(CONFIG_ARCH_MPC834X)
  gd->arch.usbmph_clk = usbmph_clk;
 #endif
 #if defined(CONFIG_ARCH_MPC8315)
@@ -559,7 +559,7 @@ static int do_clocks(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        strmhz(buf, gd->arch.sdhc_clk));
 #endif
 #if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC831X) || \
- defined(CONFIG_MPC834x) || defined(CONFIG_MPC837x)
+ defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_MPC837x)
  printf("  TSEC1:               %-4s MHz\n",
        strmhz(buf, gd->arch.tsec1_clk));
  printf("  TSEC2:               %-4s MHz\n",
@@ -570,7 +570,7 @@ static int do_clocks(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
  printf("  USB DR:              %-4s MHz\n",
        strmhz(buf, gd->arch.usbdr_clk));
 #endif
-#if defined(CONFIG_MPC834x)
+#if defined(CONFIG_ARCH_MPC834X)
  printf("  USB MPH:             %-4s MHz\n",
        strmhz(buf, gd->arch.usbmph_clk));
 #endif
diff --git a/arch/powerpc/include/asm/arch-mpc83xx/gpio.h b/arch/powerpc/include/asm/arch-mpc83xx/gpio.h
index 74ba91a469..16997316ff 100644
--- a/arch/powerpc/include/asm/arch-mpc83xx/gpio.h
+++ b/arch/powerpc/include/asm/arch-mpc83xx/gpio.h
@@ -9,7 +9,7 @@
 #if defined(CONFIG_ARCH_MPC8313) || defined(CONFIG_ARCH_MPC8308) || \
  defined(CONFIG_ARCH_MPC8315)
 #define MPC83XX_GPIO_CTRLRS 1
-#elif defined(CONFIG_MPC834x) || defined(CONFIG_MPC837x)
+#elif defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_MPC837x)
 #define MPC83XX_GPIO_CTRLRS 2
 #else
 #define MPC83XX_GPIO_CTRLRS 0
diff --git a/arch/powerpc/include/asm/fsl_lbc.h b/arch/powerpc/include/asm/fsl_lbc.h
index cf89e186a6..0ea4456033 100644
--- a/arch/powerpc/include/asm/fsl_lbc.h
+++ b/arch/powerpc/include/asm/fsl_lbc.h
@@ -43,10 +43,10 @@ void lbc_sdram_init(void);
 #define BR_MSEL 0x000000E0
 #define BR_MSEL_SHIFT 5
 #define BR_MS_GPCM 0x00000000 /* GPCM */
-#if !defined(CONFIG_MPC834x) && !defined(CONFIG_MPC8360)
+#if !defined(CONFIG_ARCH_MPC834X) && !defined(CONFIG_MPC8360)
 #define BR_MS_FCM 0x00000020 /* FCM */
 #endif
-#if defined(CONFIG_MPC834x) || defined(CONFIG_MPC8360)
+#if defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_MPC8360)
 #define BR_MS_SDRAM 0x00000060 /* SDRAM */
 #elif defined(CONFIG_MPC85xx)
 #define BR_MS_SDRAM 0x00000000 /* SDRAM */
@@ -54,7 +54,7 @@ void lbc_sdram_init(void);
 #define BR_MS_UPMA 0x00000080 /* UPMA */
 #define BR_MS_UPMB 0x000000A0 /* UPMB */
 #define BR_MS_UPMC 0x000000C0 /* UPMC */
-#if !defined(CONFIG_MPC834x)
+#if !defined(CONFIG_ARCH_MPC834X)
 #define BR_ATOM 0x0000000C
 #define BR_ATOM_SHIFT 2
 #endif
@@ -67,7 +67,7 @@ void lbc_sdram_init(void);
 #define UPMB 1
 #define UPMC 2
 
-#if defined(CONFIG_MPC834x)
+#if defined(CONFIG_ARCH_MPC834X)
 #define BR_RES ~(BR_BA | BR_PS | BR_DECC | BR_WP | BR_MSEL | BR_V)
 #else
 #define BR_RES ~(BR_BA | BR_PS | BR_DECC | BR_WP | BR_MSEL | BR_ATOM | BR_V)
diff --git a/arch/powerpc/include/asm/global_data.h b/arch/powerpc/include/asm/global_data.h
index 0c3a4ade5c..cd0d76696d 100644
--- a/arch/powerpc/include/asm/global_data.h
+++ b/arch/powerpc/include/asm/global_data.h
@@ -36,16 +36,16 @@ struct arch_global_data {
  /* There are other clocks in the MPC83XX */
  u32 csb_clk;
 # if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC831X) || \
- defined(CONFIG_MPC834x) || defined(CONFIG_MPC837x)
+ defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_MPC837x)
  u32 tsec1_clk;
  u32 tsec2_clk;
  u32 usbdr_clk;
 # elif defined(CONFIG_ARCH_MPC8309)
  u32 usbdr_clk;
 # endif
-# if defined(CONFIG_MPC834x)
+# if defined(CONFIG_ARCH_MPC834X)
  u32 usbmph_clk;
-# endif /* CONFIG_MPC834x */
+# endif /* CONFIG_ARCH_MPC834X */
 # if defined(CONFIG_ARCH_MPC8315)
  u32 tdm_clk;
 # endif
diff --git a/arch/powerpc/include/asm/immap_83xx.h b/arch/powerpc/include/asm/immap_83xx.h
index 318b79d0b8..bf7a4b9250 100644
--- a/arch/powerpc/include/asm/immap_83xx.h
+++ b/arch/powerpc/include/asm/immap_83xx.h
@@ -625,7 +625,7 @@ typedef struct tdmdmac83xx {
  u8 fixme[0x2000];
 } tdmdmac83xx_t;
 
-#if defined(CONFIG_MPC834x)
+#if defined(CONFIG_ARCH_MPC834X)
 typedef struct immap {
  sysconf83xx_t sysconf; /* System configuration */
  wdt83xx_t wdt; /* Watch Dog Timer (WDT) Registers */
@@ -666,7 +666,7 @@ typedef struct immap {
  u8 res7[0xC0000];
 } immap_t;
 
-#ifndef CONFIG_MPC834x
+#ifndef CONFIG_ARCH_MPC834X
 #ifdef CONFIG_HAS_FSL_MPH_USB
 #define CONFIG_SYS_MPC83xx_USB1_OFFSET  0x22000 /* use the MPH controller */
 #define CONFIG_SYS_MPC83xx_USB2_OFFSET 0
@@ -946,7 +946,7 @@ typedef struct immap {
 #endif
 #define CONFIG_SYS_MPC83xx_USB1_ADDR \
  (CONFIG_SYS_IMMR + CONFIG_SYS_MPC83xx_USB1_OFFSET)
-#if defined(CONFIG_MPC834x)
+#if defined(CONFIG_ARCH_MPC834X)
 #define CONFIG_SYS_MPC83xx_USB2_ADDR \
  (CONFIG_SYS_IMMR + CONFIG_SYS_MPC83xx_USB2_OFFSET)
 #endif
diff --git a/arch/powerpc/include/asm/mpc8xxx_spi.h b/arch/powerpc/include/asm/mpc8xxx_spi.h
index 3edd561007..0c2bdb326b 100644
--- a/arch/powerpc/include/asm/mpc8xxx_spi.h
+++ b/arch/powerpc/include/asm/mpc8xxx_spi.h
@@ -13,7 +13,7 @@
 #if defined(CONFIG_ARCH_MPC8308) || \
  defined(CONFIG_ARCH_MPC8313) || \
  defined(CONFIG_ARCH_MPC8315) || \
- defined(CONFIG_MPC834x) || \
+ defined(CONFIG_ARCH_MPC834X) || \
  defined(CONFIG_MPC837x)
 
 typedef struct spi8xxx {
diff --git a/drivers/pci/pci_auto.c b/drivers/pci/pci_auto.c
index d7237f6eee..a673d8ae13 100644
--- a/drivers/pci/pci_auto.c
+++ b/drivers/pci/pci_auto.c
@@ -359,7 +359,7 @@ int dm_pciauto_config_device(struct udevice *dev)
       PCI_DEV(dm_pci_get_bdf(dev)));
  break;
 #endif
-#if defined(CONFIG_MPC834x) && !defined(CONFIG_VME8349)
+#if defined(CONFIG_ARCH_MPC834X) && !defined(CONFIG_VME8349)
  case PCI_CLASS_BRIDGE_OTHER:
  /*
  * The host/PCI bridge 1 seems broken in 8349 - it presents
diff --git a/drivers/pci/pci_auto_old.c b/drivers/pci/pci_auto_old.c
index e705a3072e..90c22a08cb 100644
--- a/drivers/pci/pci_auto_old.c
+++ b/drivers/pci/pci_auto_old.c
@@ -376,7 +376,7 @@ int pciauto_config_device(struct pci_controller *hose, pci_dev_t dev)
       PCI_DEV(dev));
  break;
 #endif
-#if defined(CONFIG_MPC834x) && !defined(CONFIG_VME8349)
+#if defined(CONFIG_ARCH_MPC834X) && !defined(CONFIG_VME8349)
  case PCI_CLASS_BRIDGE_OTHER:
  /*
  * The host/PCI bridge 1 seems broken in 8349 - it presents
diff --git a/include/configs/MPC8349EMDS.h b/include/configs/MPC8349EMDS.h
index cf2a6bda7e..2ceed48ff3 100644
--- a/include/configs/MPC8349EMDS.h
+++ b/include/configs/MPC8349EMDS.h
@@ -16,8 +16,6 @@
  * High Level Configuration Options
  */
 #define CONFIG_E300 1 /* E300 Family */
-#define CONFIG_MPC834x 1 /* MPC834x family */
-#define CONFIG_MPC8349 1 /* MPC8349 specific */
 
 #define CONFIG_PCI_66M
 #ifdef CONFIG_PCI_66M
diff --git a/include/configs/MPC8349ITX.h b/include/configs/MPC8349ITX.h
index 77174e3b7e..1b247a3a3e 100644
--- a/include/configs/MPC8349ITX.h
+++ b/include/configs/MPC8349ITX.h
@@ -46,9 +46,6 @@
 /*
  * High Level Configuration Options
  */
-#define CONFIG_MPC834x /* MPC834x family (8343, 8347, 8349) */
-#define CONFIG_MPC8349 /* MPC8349 specific */
-
 #define CONFIG_SYS_IMMR 0xE0000000 /* The IMMR is relocated to here */
 
 #define CONFIG_MISC_INIT_F
diff --git a/include/configs/TQM834x.h b/include/configs/TQM834x.h
index fc1fa0c089..d155ac5892 100644
--- a/include/configs/TQM834x.h
+++ b/include/configs/TQM834x.h
@@ -15,8 +15,6 @@
  * High Level Configuration Options
  */
 #define CONFIG_E300 1 /* E300 Family */
-#define CONFIG_MPC834x 1 /* MPC834x specific */
-#define CONFIG_MPC8349 1 /* MPC8349 specific */
 
 /* IMMR Base Address Register, use Freescale default: 0xff400000 */
 #define CONFIG_SYS_IMMR 0xff400000
diff --git a/include/configs/sbc8349.h b/include/configs/sbc8349.h
index 9c5d05de3e..f3a72dd804 100644
--- a/include/configs/sbc8349.h
+++ b/include/configs/sbc8349.h
@@ -18,8 +18,6 @@
  * High Level Configuration Options
  */
 #define CONFIG_E300 1 /* E300 Family */
-#define CONFIG_MPC834x 1 /* MPC834x family */
-#define CONFIG_MPC8349 1 /* MPC8349 specific */
 
 /* Don't enable PCI2 on sbc834x - it doesn't exist physically. */
 #undef CONFIG_MPC83XX_PCI2 /* support for 2nd PCI controller */
diff --git a/include/configs/vme8349.h b/include/configs/vme8349.h
index 7fc89e8e71..00939d6d58 100644
--- a/include/configs/vme8349.h
+++ b/include/configs/vme8349.h
@@ -28,8 +28,6 @@
  * High Level Configuration Options
  */
 #define CONFIG_E300 1 /* E300 Family */
-#define CONFIG_MPC834x 1 /* MPC834x family */
-#define CONFIG_MPC8349 1 /* MPC8349 specific */
 #define CONFIG_VME8349 1 /* ESD VME8349 board specific */
 
 /* Don't enable PCI2 on vme834x - it doesn't exist physically. */
diff --git a/include/mpc83xx.h b/include/mpc83xx.h
index 0f4466ae89..feb8fef601 100644
--- a/include/mpc83xx.h
+++ b/include/mpc83xx.h
@@ -55,7 +55,7 @@
 #define SPRIDR_PARTID 0xFFFF0000 /* Part Id */
 #define SPRIDR_REVID 0x0000FFFF /* Revision Id */
 
-#if defined(CONFIG_MPC834x)
+#if defined(CONFIG_ARCH_MPC834X)
 #define REVID_MAJOR(spridr) ((spridr & 0x0000FF00) >> 8)
 #define REVID_MINOR(spridr) (spridr & 0x000000FF)
 #else
@@ -108,7 +108,7 @@
 #define SPCR_COREPR 0x00300000
 #define SPCR_COREPR_SHIFT (31-11)
 
-#if defined(CONFIG_MPC834x)
+#if defined(CONFIG_ARCH_MPC834X)
 /* SPCR bits - MPC8349 specific */
 /* TSEC1 data priority */
 #define SPCR_TSEC1DP 0x00003000
@@ -145,7 +145,7 @@
 
 /* SICRL/H - System I/O Configuration Register Low/High
  */
-#if defined(CONFIG_MPC834x)
+#if defined(CONFIG_ARCH_MPC834X)
 /* SICRL bits - MPC8349 specific */
 #define SICRL_LDP_A 0x80000000
 #define SICRL_USB1 0x40000000
@@ -720,7 +720,7 @@
 #define HRCWH_PCI_HOST_SHIFT 31
 #define HRCWH_PCI_AGENT 0x00000000
 
-#if defined(CONFIG_MPC834x)
+#if defined(CONFIG_ARCH_MPC834X)
 #define HRCWH_32_BIT_PCI 0x00000000
 #define HRCWH_64_BIT_PCI 0x40000000
 #endif
@@ -731,7 +731,7 @@
 #define HRCWH_PCI_ARBITER_DISABLE 0x00000000
 #define HRCWH_PCI_ARBITER_ENABLE 0x20000000
 
-#if defined(CONFIG_MPC834x)
+#if defined(CONFIG_ARCH_MPC834X)
 #define HRCWH_PCI2_ARBITER_DISABLE 0x00000000
 #define HRCWH_PCI2_ARBITER_ENABLE 0x10000000
 
@@ -755,7 +755,7 @@
 
 #define HRCWH_ROM_LOC_DDR_SDRAM 0x00000000
 #define HRCWH_ROM_LOC_PCI1 0x00100000
-#if defined(CONFIG_MPC834x)
+#if defined(CONFIG_ARCH_MPC834X)
 #define HRCWH_ROM_LOC_PCI2 0x00200000
 #endif
 #if defined(CONFIG_MPC837x)
@@ -790,7 +790,7 @@
 #define HRCWH_TSEC2M_IN_SGMII 0x00001800
 #endif
 
-#if defined(CONFIG_MPC834x)
+#if defined(CONFIG_ARCH_MPC834X)
 #define HRCWH_TSEC1M_IN_RGMII 0x00000000
 #define HRCWH_TSEC1M_IN_RTBI 0x00004000
 #define HRCWH_TSEC1M_IN_GMII 0x00008000
@@ -937,8 +937,8 @@
 #define SCCR_PCICM 0x00010000
 #define SCCR_PCICM_SHIFT 16
 
-#if defined(CONFIG_MPC834x)
-/* SCCR bits - MPC834x specific */
+#if defined(CONFIG_ARCH_MPC834X)
+/* SCCR bits - MPC834X specific */
 #define SCCR_TSEC1CM 0xc0000000
 #define SCCR_TSEC1CM_SHIFT 30
 #define SCCR_TSEC1CM_0 0x00000000
diff --git a/include/usb/ehci-ci.h b/include/usb/ehci-ci.h
index e4579a5bec..efb2eec5ce 100644
--- a/include/usb/ehci-ci.h
+++ b/include/usb/ehci-ci.h
@@ -147,7 +147,7 @@
 
 #if defined(CONFIG_MPC83xx)
 #define CONFIG_SYS_FSL_USB1_ADDR CONFIG_SYS_MPC83xx_USB1_ADDR
-#if defined(CONFIG_MPC834x)
+#if defined(CONFIG_ARCH_MPC834X)
 #define CONFIG_SYS_FSL_USB2_ADDR CONFIG_SYS_MPC83xx_USB2_ADDR
 #else
 #define CONFIG_SYS_FSL_USB2_ADDR 0
--
2.16.4

_______________________________________________
U-Boot mailing list
[hidden email]
https://lists.denx.de/listinfo/u-boot
Reply | Threaded
Open this post in threaded view
|

[PATCH 05/48] mpc83xx: Introduce ARCH_MPC836*

Mario Six
In reply to this post by Mario Six
Replace CONFIG_MPC836* with proper CONFIG_ARCH_MPC836* Kconfig options.

Signed-off-by: Mario Six <[hidden email]>
---
 arch/powerpc/cpu/mpc83xx/Kconfig       |  4 ++++
 arch/powerpc/cpu/mpc83xx/speed.c       | 10 +++++-----
 arch/powerpc/include/asm/fsl_lbc.h     |  4 ++--
 arch/powerpc/include/asm/global_data.h |  4 ++--
 arch/powerpc/include/asm/immap_83xx.h  |  2 +-
 board/keymile/km83xx/km83xx.c          |  4 ++--
 drivers/ram/mpc83xx_sdram.c            |  8 ++++----
 include/configs/km8360.h               |  1 -
 include/linux/immap_qe.h               |  2 +-
 include/mpc83xx.h                      | 10 +++++-----
 include/post.h                         |  2 +-
 11 files changed, 27 insertions(+), 24 deletions(-)

diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig b/arch/powerpc/cpu/mpc83xx/Kconfig
index 2926472319..56a59ae4ef 100644
--- a/arch/powerpc/cpu/mpc83xx/Kconfig
+++ b/arch/powerpc/cpu/mpc83xx/Kconfig
@@ -82,6 +82,7 @@ config TARGET_IDS8313
 
 config TARGET_KM8360
  bool "Support km8360"
+ select ARCH_MPC8360
  imply CMD_CRAMFS
  imply CMD_DIAG
  imply FS_CRAMFS
@@ -149,6 +150,9 @@ config ARCH_MPC8349
  bool
  select ARCH_MPC834X
 
+config ARCH_MPC8360
+ bool
+
 source "board/esd/vme8349/Kconfig"
 source "board/freescale/mpc8308rdb/Kconfig"
 source "board/freescale/mpc8313erdb/Kconfig"
diff --git a/arch/powerpc/cpu/mpc83xx/speed.c b/arch/powerpc/cpu/mpc83xx/speed.c
index 7cb6f3727d..ed77675a8e 100644
--- a/arch/powerpc/cpu/mpc83xx/speed.c
+++ b/arch/powerpc/cpu/mpc83xx/speed.c
@@ -113,7 +113,7 @@ int get_clocks(void)
  u32 lbiu_clk;
  u32 lclk_clk;
  u32 mem_clk;
-#if defined(CONFIG_MPC8360)
+#if defined(CONFIG_ARCH_MPC8360)
  u32 mem_sec_clk;
 #endif
 #if defined(CONFIG_QE)
@@ -313,7 +313,7 @@ int get_clocks(void)
 
 #if defined(CONFIG_ARCH_MPC834X)
  i2c1_clk = tsec2_clk;
-#elif defined(CONFIG_MPC8360)
+#elif defined(CONFIG_ARCH_MPC8360)
  i2c1_clk = csb_clk;
 #elif defined(CONFIG_ARCH_MPC832X)
  i2c1_clk = enc_clk;
@@ -407,7 +407,7 @@ int get_clocks(void)
   (1 + ((im->clk.spmr & SPMR_DDRCM) >> SPMR_DDRCM_SHIFT));
  corepll = (im->clk.spmr & SPMR_COREPLL) >> SPMR_COREPLL_SHIFT;
 
-#if defined(CONFIG_MPC8360)
+#if defined(CONFIG_ARCH_MPC8360)
  mem_sec_clk = csb_clk * (1 +
        ((im->clk.spmr & SPMR_LBIUCM) >> SPMR_LBIUCM_SHIFT));
 #endif
@@ -476,7 +476,7 @@ int get_clocks(void)
  gd->arch.lbiu_clk = lbiu_clk;
  gd->arch.lclk_clk = lclk_clk;
  gd->mem_clk = mem_clk;
-#if defined(CONFIG_MPC8360)
+#if defined(CONFIG_ARCH_MPC8360)
  gd->arch.mem_sec_clk = mem_sec_clk;
 #endif
 #if defined(CONFIG_QE)
@@ -536,7 +536,7 @@ static int do_clocks(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
  printf("  Local Bus:           %-4s MHz\n",
        strmhz(buf, gd->arch.lclk_clk));
  printf("  DDR:                 %-4s MHz\n", strmhz(buf, gd->mem_clk));
-#if defined(CONFIG_MPC8360)
+#if defined(CONFIG_ARCH_MPC8360)
  printf("  DDR Secondary:       %-4s MHz\n",
        strmhz(buf, gd->arch.mem_sec_clk));
 #endif
diff --git a/arch/powerpc/include/asm/fsl_lbc.h b/arch/powerpc/include/asm/fsl_lbc.h
index 0ea4456033..3528acd627 100644
--- a/arch/powerpc/include/asm/fsl_lbc.h
+++ b/arch/powerpc/include/asm/fsl_lbc.h
@@ -43,10 +43,10 @@ void lbc_sdram_init(void);
 #define BR_MSEL 0x000000E0
 #define BR_MSEL_SHIFT 5
 #define BR_MS_GPCM 0x00000000 /* GPCM */
-#if !defined(CONFIG_ARCH_MPC834X) && !defined(CONFIG_MPC8360)
+#if !defined(CONFIG_ARCH_MPC834X) && !defined(CONFIG_ARCH_MPC8360)
 #define BR_MS_FCM 0x00000020 /* FCM */
 #endif
-#if defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_MPC8360)
+#if defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_ARCH_MPC8360)
 #define BR_MS_SDRAM 0x00000060 /* SDRAM */
 #elif defined(CONFIG_MPC85xx)
 #define BR_MS_SDRAM 0x00000000 /* SDRAM */
diff --git a/arch/powerpc/include/asm/global_data.h b/arch/powerpc/include/asm/global_data.h
index cd0d76696d..cf3ba58822 100644
--- a/arch/powerpc/include/asm/global_data.h
+++ b/arch/powerpc/include/asm/global_data.h
@@ -61,9 +61,9 @@ struct arch_global_data {
 # if defined(CONFIG_MPC837x) || defined(CONFIG_ARCH_MPC8315)
  u32 sata_clk;
 # endif
-# if defined(CONFIG_MPC8360)
+# if defined(CONFIG_ARCH_MPC8360)
  u32 mem_sec_clk;
-# endif /* CONFIG_MPC8360 */
+# endif /* CONFIG_ARCH_MPC8360 */
 #endif
 #endif
 #if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx)
diff --git a/arch/powerpc/include/asm/immap_83xx.h b/arch/powerpc/include/asm/immap_83xx.h
index bf7a4b9250..f6721e7b1d 100644
--- a/arch/powerpc/include/asm/immap_83xx.h
+++ b/arch/powerpc/include/asm/immap_83xx.h
@@ -803,7 +803,7 @@ typedef struct immap {
  rom83xx_t rom; /* On Chip ROM */
 } immap_t;
 
-#elif defined(CONFIG_MPC8360)
+#elif defined(CONFIG_ARCH_MPC8360)
 typedef struct immap {
  sysconf83xx_t sysconf; /* System configuration */
  wdt83xx_t wdt; /* Watch Dog Timer (WDT) Registers */
diff --git a/board/keymile/km83xx/km83xx.c b/board/keymile/km83xx/km83xx.c
index ce5126aae6..12044ee0d7 100644
--- a/board/keymile/km83xx/km83xx.c
+++ b/board/keymile/km83xx/km83xx.c
@@ -33,7 +33,7 @@ static uchar ivm_content[CONFIG_SYS_IVM_EEPROM_MAX_LEN];
 
 const qe_iop_conf_t qe_iop_conf_tab[] = {
  /* port pin dir open_drain assign */
-#if defined(CONFIG_MPC8360)
+#if defined(CONFIG_ARCH_MPC8360)
  /* MDIO */
  {0,  1, 3, 0, 2}, /* MDIO */
  {0,  2, 1, 0, 1}, /* MDC */
@@ -148,7 +148,7 @@ int board_early_init_r(void)
  u32 *mxmr = &lbc->mamr;
 #endif
 
-#if defined(CONFIG_MPC8360)
+#if defined(CONFIG_ARCH_MPC8360)
  unsigned short svid;
  /*
  * Because of errata in the UCCs, we have to write to the reserved
diff --git a/drivers/ram/mpc83xx_sdram.c b/drivers/ram/mpc83xx_sdram.c
index 58db7948c1..3e57b13118 100644
--- a/drivers/ram/mpc83xx_sdram.c
+++ b/drivers/ram/mpc83xx_sdram.c
@@ -169,7 +169,7 @@ static int mpc83xx_sdram_static_init(ofnode node, u32 cs, u32 mapaddr, u32 size)
  odt_rd_cfg = ofnode_read_u32_default(node, "odt_rd_cfg", 0);
  switch (odt_rd_cfg) {
  case ODT_RD_ONLY_OTHER_DIMM:
- if (!IS_ENABLED(CONFIG_MPC8360) &&
+ if (!IS_ENABLED(CONFIG_ARCH_MPC8360) &&
     !IS_ENABLED(CONFIG_MPC837x)) {
  debug("%s: odt_rd_cfg value %d invalid.\n",
       ofnode_get_name(node), odt_rd_cfg);
@@ -181,7 +181,7 @@ static int mpc83xx_sdram_static_init(ofnode node, u32 cs, u32 mapaddr, u32 size)
  case ODT_RD_ONLY_OTHER_CS:
  if (!IS_ENABLED(CONFIG_ARCH_MPC830X) &&
     !IS_ENABLED(CONFIG_ARCH_MPC831X) &&
-    !IS_ENABLED(CONFIG_MPC8360) &&
+    !IS_ENABLED(CONFIG_ARCH_MPC8360) &&
     !IS_ENABLED(CONFIG_MPC837x)) {
  debug("%s: odt_rd_cfg value %d invalid.\n",
       ofnode_get_name(node), odt_rd_cfg);
@@ -200,7 +200,7 @@ static int mpc83xx_sdram_static_init(ofnode node, u32 cs, u32 mapaddr, u32 size)
  odt_wr_cfg = ofnode_read_u32_default(node, "odt_wr_cfg", 0);
  switch (odt_wr_cfg) {
  case ODT_WR_ONLY_OTHER_DIMM:
- if (!IS_ENABLED(CONFIG_MPC8360) &&
+ if (!IS_ENABLED(CONFIG_ARCH_MPC8360) &&
     !IS_ENABLED(CONFIG_MPC837x)) {
  debug("%s: odt_wr_cfg value %d invalid.\n",
       ofnode_get_name(node), odt_wr_cfg);
@@ -212,7 +212,7 @@ static int mpc83xx_sdram_static_init(ofnode node, u32 cs, u32 mapaddr, u32 size)
  case ODT_WR_ONLY_OTHER_CS:
  if (!IS_ENABLED(CONFIG_ARCH_MPC830X) &&
     !IS_ENABLED(CONFIG_ARCH_MPC831X) &&
-    !IS_ENABLED(CONFIG_MPC8360) &&
+    !IS_ENABLED(CONFIG_ARCH_MPC8360) &&
     !IS_ENABLED(CONFIG_MPC837x)) {
  debug("%s: odt_wr_cfg value %d invalid.\n",
       ofnode_get_name(node), odt_wr_cfg);
diff --git a/include/configs/km8360.h b/include/configs/km8360.h
index feb8a9a16d..7857b83055 100644
--- a/include/configs/km8360.h
+++ b/include/configs/km8360.h
@@ -36,7 +36,6 @@
  * High Level Configuration Options
  */
 #define CONFIG_QE /* Has QE */
-#define CONFIG_MPC8360 /* MPC8360 CPU specific */
 
 /* include common defines/options for all 83xx Keymile boards */
 #include "km/km83xx-common.h"
diff --git a/include/linux/immap_qe.h b/include/linux/immap_qe.h
index 6552d0e3c5..022771fff5 100644
--- a/include/linux/immap_qe.h
+++ b/include/linux/immap_qe.h
@@ -12,7 +12,7 @@
 #define __IMMAP_QE_H__
 
 #ifdef CONFIG_MPC83xx
-#if defined(CONFIG_MPC8360)
+#if defined(CONFIG_ARCH_MPC8360)
 #define QE_MURAM_SIZE 0xc000UL
 #define MAX_QE_RISC 2
 #define QE_NUM_OF_SNUM 28
diff --git a/include/mpc83xx.h b/include/mpc83xx.h
index feb8fef601..94b2816a82 100644
--- a/include/mpc83xx.h
+++ b/include/mpc83xx.h
@@ -191,7 +191,7 @@
 #define SICRH_TSOBI1 0x00000002
 #define SICRH_TSOBI2 0x00000001
 
-#elif defined(CONFIG_MPC8360)
+#elif defined(CONFIG_ARCH_MPC8360)
 /* SICRL bits - MPC8360 specific */
 #define SICRL_LDP_A 0xC0000000
 #define SICRL_LCLK_1 0x10000000
@@ -593,7 +593,7 @@
 #define HRCWL_CORE_TO_CSB_2_5X1 0x00050000
 #define HRCWL_CORE_TO_CSB_3X1 0x00060000
 
-#if defined(CONFIG_MPC8360) || defined(CONFIG_ARCH_MPC832X)
+#if defined(CONFIG_ARCH_MPC8360) || defined(CONFIG_ARCH_MPC832X)
 #define HRCWL_CEVCOD 0x000000C0
 #define HRCWL_CEVCOD_SHIFT 6
 #define HRCWL_CE_PLL_VCO_DIV_4 0x00000000
@@ -735,7 +735,7 @@
 #define HRCWH_PCI2_ARBITER_DISABLE 0x00000000
 #define HRCWH_PCI2_ARBITER_ENABLE 0x10000000
 
-#elif defined(CONFIG_MPC8360)
+#elif defined(CONFIG_ARCH_MPC8360)
 #define HRCWH_PCICKDRV_DISABLE 0x00000000
 #define HRCWH_PCICKDRV_ENABLE 0x10000000
 #endif
@@ -801,7 +801,7 @@
 #define HRCWH_TSEC2M_IN_TBI 0x00003000
 #endif
 
-#if defined(CONFIG_MPC8360)
+#if defined(CONFIG_ARCH_MPC8360)
 #define HRCWH_SECONDARY_DDR_DISABLE 0x00000000
 #define HRCWH_SECONDARY_DDR_ENABLE 0x00000010
 #endif
@@ -1129,7 +1129,7 @@
 #elif defined(CONFIG_ARCH_MPC832X)
 #define CSCONFIG_ODT_RD_CFG 0x00400000
 #define CSCONFIG_ODT_WR_CFG 0x00040000
-#elif defined(CONFIG_MPC8360) || defined(CONFIG_MPC837x)
+#elif defined(CONFIG_ARCH_MPC8360) || defined(CONFIG_MPC837x)
 #define CSCONFIG_ODT_RD_NEVER 0x00000000
 #define CSCONFIG_ODT_RD_ONLY_CURRENT 0x00100000
 #define CSCONFIG_ODT_RD_ONLY_OTHER_CS 0x00200000
diff --git a/include/post.h b/include/post.h
index 08a771e405..eb218acde5 100644
--- a/include/post.h
+++ b/include/post.h
@@ -21,7 +21,7 @@
 #define _POST_WORD_ADDR CONFIG_SYS_POST_WORD_ADDR
 #else
 
-#if defined(CONFIG_MPC8360)
+#if defined(CONFIG_ARCH_MPC8360)
 #include <linux/immap_qe.h>
 #define _POST_WORD_ADDR (CONFIG_SYS_IMMR + CPM_POST_WORD_ADDR)
 
--
2.16.4

_______________________________________________
U-Boot mailing list
[hidden email]
https://lists.denx.de/listinfo/u-boot
Reply | Threaded
Open this post in threaded view
|

[PATCH 06/48] mpc83xx: Introduce ARCH_MPC837X

Mario Six
In reply to this post by Mario Six
Replace CONFIG_MPC837x with a proper CONFIG_ARCH_MPC837X Kconfig option.

Signed-off-by: Mario Six <[hidden email]>
---
 arch/powerpc/cpu/mpc83xx/Kconfig             |  3 +++
 arch/powerpc/cpu/mpc83xx/speed.c             | 30 ++++++++++++++--------------
 arch/powerpc/include/asm/arch-mpc83xx/gpio.h |  2 +-
 arch/powerpc/include/asm/global_data.h       |  6 +++---
 arch/powerpc/include/asm/immap_83xx.h        |  2 +-
 arch/powerpc/include/asm/mpc8xxx_spi.h       |  2 +-
 drivers/ram/mpc83xx_sdram.c                  |  8 ++++----
 include/configs/MPC837XEMDS.h                |  1 -
 include/configs/MPC837XERDB.h                |  1 -
 include/mpc83xx.h                            | 24 +++++++++++-----------
 10 files changed, 40 insertions(+), 39 deletions(-)

diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig b/arch/powerpc/cpu/mpc83xx/Kconfig
index 56a59ae4ef..e41f4d1f9a 100644
--- a/arch/powerpc/cpu/mpc83xx/Kconfig
+++ b/arch/powerpc/cpu/mpc83xx/Kconfig
@@ -153,6 +153,9 @@ config ARCH_MPC8349
 config ARCH_MPC8360
  bool
 
+config ARCH_MPC837X
+ bool
+
 source "board/esd/vme8349/Kconfig"
 source "board/freescale/mpc8308rdb/Kconfig"
 source "board/freescale/mpc8313erdb/Kconfig"
diff --git a/arch/powerpc/cpu/mpc83xx/speed.c b/arch/powerpc/cpu/mpc83xx/speed.c
index ed77675a8e..668ed27862 100644
--- a/arch/powerpc/cpu/mpc83xx/speed.c
+++ b/arch/powerpc/cpu/mpc83xx/speed.c
@@ -86,7 +86,7 @@ int get_clocks(void)
 
  u32 csb_clk;
 #if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC831X) || \
- defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_MPC837x)
+ defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_ARCH_MPC837X)
  u32 tsec1_clk;
  u32 tsec2_clk;
  u32 usbdr_clk;
@@ -123,11 +123,11 @@ int get_clocks(void)
  u32 brg_clk;
 #endif
 #if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC831X) || \
- defined(CONFIG_MPC837x)
+ defined(CONFIG_ARCH_MPC837X)
  u32 pciexp1_clk;
  u32 pciexp2_clk;
 #endif
-#if defined(CONFIG_MPC837x) || defined(CONFIG_ARCH_MPC8315)
+#if defined(CONFIG_ARCH_MPC837X) || defined(CONFIG_ARCH_MPC8315)
  u32 sata_clk;
 #endif
 
@@ -156,7 +156,7 @@ int get_clocks(void)
  sccr = im->clk.sccr;
 
 #if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC831X) || \
- defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_MPC837x)
+ defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_ARCH_MPC837X)
  switch ((sccr & SCCR_TSEC1CM) >> SCCR_TSEC1CM_SHIFT) {
  case 0:
  tsec1_clk = 0;
@@ -177,7 +177,7 @@ int get_clocks(void)
 #endif
 
 #if defined(CONFIG_ARCH_MPC830X) || defined(CONFIG_ARCH_MPC831X) || \
- defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_MPC837x)
+ defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_ARCH_MPC837X)
  switch ((sccr & SCCR_USBDRCM) >> SCCR_USBDRCM_SHIFT) {
  case 0:
  usbdr_clk = 0;
@@ -198,7 +198,7 @@ int get_clocks(void)
 #endif
 
 #if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC8315) || \
- defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_MPC837x)
+ defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_ARCH_MPC837X)
  switch ((sccr & SCCR_TSEC2CM) >> SCCR_TSEC2CM_SHIFT) {
  case 0:
  tsec2_clk = 0;
@@ -321,7 +321,7 @@ int get_clocks(void)
  i2c1_clk = enc_clk;
 #elif defined(CONFIG_FSL_ESDHC)
  i2c1_clk = sdhc_clk;
-#elif defined(CONFIG_MPC837x)
+#elif defined(CONFIG_ARCH_MPC837X)
  i2c1_clk = enc_clk;
 #elif defined(CONFIG_ARCH_MPC8309)
  i2c1_clk = csb_clk;
@@ -331,7 +331,7 @@ int get_clocks(void)
 #endif
 
 #if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC831X) || \
- defined(CONFIG_MPC837x)
+ defined(CONFIG_ARCH_MPC837X)
  switch ((sccr & SCCR_PCIEXP1CM) >> SCCR_PCIEXP1CM_SHIFT) {
  case 0:
  pciexp1_clk = 0;
@@ -369,7 +369,7 @@ int get_clocks(void)
  }
 #endif
 
-#if defined(CONFIG_MPC837x) || defined(CONFIG_ARCH_MPC8315)
+#if defined(CONFIG_ARCH_MPC837X) || defined(CONFIG_ARCH_MPC8315)
  switch ((sccr & SCCR_SATA1CM) >> SCCR_SATA1CM_SHIFT) {
  case 0:
  sata_clk = 0;
@@ -449,7 +449,7 @@ int get_clocks(void)
 
  gd->arch.csb_clk = csb_clk;
 #if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC831X) || \
- defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_MPC837x)
+ defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_ARCH_MPC837X)
  gd->arch.tsec1_clk = tsec1_clk;
  gd->arch.tsec2_clk = tsec2_clk;
  gd->arch.usbdr_clk = usbdr_clk;
@@ -484,11 +484,11 @@ int get_clocks(void)
  gd->arch.brg_clk = brg_clk;
 #endif
 #if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC831X) || \
- defined(CONFIG_MPC837x)
+ defined(CONFIG_ARCH_MPC837X)
  gd->arch.pciexp1_clk = pciexp1_clk;
  gd->arch.pciexp2_clk = pciexp2_clk;
 #endif
-#if defined(CONFIG_MPC837x) || defined(CONFIG_ARCH_MPC8315)
+#if defined(CONFIG_ARCH_MPC837X) || defined(CONFIG_ARCH_MPC8315)
  gd->arch.sata_clk = sata_clk;
 #endif
  gd->pci_clk = pci_sync_in;
@@ -559,7 +559,7 @@ static int do_clocks(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        strmhz(buf, gd->arch.sdhc_clk));
 #endif
 #if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC831X) || \
- defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_MPC837x)
+ defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_ARCH_MPC837X)
  printf("  TSEC1:               %-4s MHz\n",
        strmhz(buf, gd->arch.tsec1_clk));
  printf("  TSEC2:               %-4s MHz\n",
@@ -575,13 +575,13 @@ static int do_clocks(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        strmhz(buf, gd->arch.usbmph_clk));
 #endif
 #if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC831X) || \
- defined(CONFIG_MPC837x)
+ defined(CONFIG_ARCH_MPC837X)
  printf("  PCIEXP1:             %-4s MHz\n",
        strmhz(buf, gd->arch.pciexp1_clk));
  printf("  PCIEXP2:             %-4s MHz\n",
        strmhz(buf, gd->arch.pciexp2_clk));
 #endif
-#if defined(CONFIG_MPC837x) || defined(CONFIG_ARCH_MPC8315)
+#if defined(CONFIG_ARCH_MPC837X) || defined(CONFIG_ARCH_MPC8315)
  printf("  SATA:                %-4s MHz\n",
        strmhz(buf, gd->arch.sata_clk));
 #endif
diff --git a/arch/powerpc/include/asm/arch-mpc83xx/gpio.h b/arch/powerpc/include/asm/arch-mpc83xx/gpio.h
index 16997316ff..b5ec50ba44 100644
--- a/arch/powerpc/include/asm/arch-mpc83xx/gpio.h
+++ b/arch/powerpc/include/asm/arch-mpc83xx/gpio.h
@@ -9,7 +9,7 @@
 #if defined(CONFIG_ARCH_MPC8313) || defined(CONFIG_ARCH_MPC8308) || \
  defined(CONFIG_ARCH_MPC8315)
 #define MPC83XX_GPIO_CTRLRS 1
-#elif defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_MPC837x)
+#elif defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_ARCH_MPC837X)
 #define MPC83XX_GPIO_CTRLRS 2
 #else
 #define MPC83XX_GPIO_CTRLRS 0
diff --git a/arch/powerpc/include/asm/global_data.h b/arch/powerpc/include/asm/global_data.h
index cf3ba58822..b6e4dd6c80 100644
--- a/arch/powerpc/include/asm/global_data.h
+++ b/arch/powerpc/include/asm/global_data.h
@@ -36,7 +36,7 @@ struct arch_global_data {
  /* There are other clocks in the MPC83XX */
  u32 csb_clk;
 # if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC831X) || \
- defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_MPC837x)
+ defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_ARCH_MPC837X)
  u32 tsec1_clk;
  u32 tsec2_clk;
  u32 usbdr_clk;
@@ -54,11 +54,11 @@ struct arch_global_data {
  u32 lbiu_clk;
  u32 lclk_clk;
 # if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC831X) || \
- defined(CONFIG_MPC837x)
+ defined(CONFIG_ARCH_MPC837X)
  u32 pciexp1_clk;
  u32 pciexp2_clk;
 # endif
-# if defined(CONFIG_MPC837x) || defined(CONFIG_ARCH_MPC8315)
+# if defined(CONFIG_ARCH_MPC837X) || defined(CONFIG_ARCH_MPC8315)
  u32 sata_clk;
 # endif
 # if defined(CONFIG_ARCH_MPC8360)
diff --git a/arch/powerpc/include/asm/immap_83xx.h b/arch/powerpc/include/asm/immap_83xx.h
index f6721e7b1d..30bbd5671b 100644
--- a/arch/powerpc/include/asm/immap_83xx.h
+++ b/arch/powerpc/include/asm/immap_83xx.h
@@ -759,7 +759,7 @@ typedef struct immap {
  u8 res12[0x1CF00];
 } immap_t;
 
-#elif defined(CONFIG_MPC837x)
+#elif defined(CONFIG_ARCH_MPC837X)
 typedef struct immap {
  sysconf83xx_t sysconf; /* System configuration */
  wdt83xx_t wdt; /* Watch Dog Timer (WDT) Registers */
diff --git a/arch/powerpc/include/asm/mpc8xxx_spi.h b/arch/powerpc/include/asm/mpc8xxx_spi.h
index 0c2bdb326b..b583a3269d 100644
--- a/arch/powerpc/include/asm/mpc8xxx_spi.h
+++ b/arch/powerpc/include/asm/mpc8xxx_spi.h
@@ -14,7 +14,7 @@
  defined(CONFIG_ARCH_MPC8313) || \
  defined(CONFIG_ARCH_MPC8315) || \
  defined(CONFIG_ARCH_MPC834X) || \
- defined(CONFIG_MPC837x)
+ defined(CONFIG_ARCH_MPC837X)
 
 typedef struct spi8xxx {
  u8 res0[0x20]; /* 0x0-0x01f reserved */
diff --git a/drivers/ram/mpc83xx_sdram.c b/drivers/ram/mpc83xx_sdram.c
index 3e57b13118..f03d0428b2 100644
--- a/drivers/ram/mpc83xx_sdram.c
+++ b/drivers/ram/mpc83xx_sdram.c
@@ -170,7 +170,7 @@ static int mpc83xx_sdram_static_init(ofnode node, u32 cs, u32 mapaddr, u32 size)
  switch (odt_rd_cfg) {
  case ODT_RD_ONLY_OTHER_DIMM:
  if (!IS_ENABLED(CONFIG_ARCH_MPC8360) &&
-    !IS_ENABLED(CONFIG_MPC837x)) {
+    !IS_ENABLED(CONFIG_ARCH_MPC837X)) {
  debug("%s: odt_rd_cfg value %d invalid.\n",
       ofnode_get_name(node), odt_rd_cfg);
  return -EINVAL;
@@ -182,7 +182,7 @@ static int mpc83xx_sdram_static_init(ofnode node, u32 cs, u32 mapaddr, u32 size)
  if (!IS_ENABLED(CONFIG_ARCH_MPC830X) &&
     !IS_ENABLED(CONFIG_ARCH_MPC831X) &&
     !IS_ENABLED(CONFIG_ARCH_MPC8360) &&
-    !IS_ENABLED(CONFIG_MPC837x)) {
+    !IS_ENABLED(CONFIG_ARCH_MPC837X)) {
  debug("%s: odt_rd_cfg value %d invalid.\n",
       ofnode_get_name(node), odt_rd_cfg);
  return -EINVAL;
@@ -201,7 +201,7 @@ static int mpc83xx_sdram_static_init(ofnode node, u32 cs, u32 mapaddr, u32 size)
  switch (odt_wr_cfg) {
  case ODT_WR_ONLY_OTHER_DIMM:
  if (!IS_ENABLED(CONFIG_ARCH_MPC8360) &&
-    !IS_ENABLED(CONFIG_MPC837x)) {
+    !IS_ENABLED(CONFIG_ARCH_MPC837X)) {
  debug("%s: odt_wr_cfg value %d invalid.\n",
       ofnode_get_name(node), odt_wr_cfg);
  return -EINVAL;
@@ -213,7 +213,7 @@ static int mpc83xx_sdram_static_init(ofnode node, u32 cs, u32 mapaddr, u32 size)
  if (!IS_ENABLED(CONFIG_ARCH_MPC830X) &&
     !IS_ENABLED(CONFIG_ARCH_MPC831X) &&
     !IS_ENABLED(CONFIG_ARCH_MPC8360) &&
-    !IS_ENABLED(CONFIG_MPC837x)) {
+    !IS_ENABLED(CONFIG_ARCH_MPC837X)) {
  debug("%s: odt_wr_cfg value %d invalid.\n",
       ofnode_get_name(node), odt_wr_cfg);
  return -EINVAL;
diff --git a/include/configs/MPC837XEMDS.h b/include/configs/MPC837XEMDS.h
index 3fdf34669f..ea009eb094 100644
--- a/include/configs/MPC837XEMDS.h
+++ b/include/configs/MPC837XEMDS.h
@@ -11,7 +11,6 @@
  * High Level Configuration Options
  */
 #define CONFIG_E300 1 /* E300 family */
-#define CONFIG_MPC837x 1 /* MPC837x CPU specific */
 #define CONFIG_MPC837XEMDS 1 /* MPC837XEMDS board specific */
 
 /*
diff --git a/include/configs/MPC837XERDB.h b/include/configs/MPC837XERDB.h
index aae777db95..40824be21e 100644
--- a/include/configs/MPC837XERDB.h
+++ b/include/configs/MPC837XERDB.h
@@ -12,7 +12,6 @@
  * High Level Configuration Options
  */
 #define CONFIG_E300 1 /* E300 family */
-#define CONFIG_MPC837x 1 /* MPC837x CPU specific */
 #define CONFIG_MPC837XERDB 1
 
 #define CONFIG_HWCONFIG
diff --git a/include/mpc83xx.h b/include/mpc83xx.h
index 94b2816a82..c2a185321a 100644
--- a/include/mpc83xx.h
+++ b/include/mpc83xx.h
@@ -130,8 +130,8 @@
 #define SPCR_TSEC2EP_SHIFT (31-31)
 
 #elif defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC831X) || \
- defined(CONFIG_MPC837x)
-/* SPCR bits - MPC8308, MPC831x and MPC837x specific */
+ defined(CONFIG_ARCH_MPC837X)
+/* SPCR bits - MPC8308, MPC831x and MPC837X specific */
 /* TSEC data priority */
 #define SPCR_TSECDP 0x00003000
 #define SPCR_TSECDP_SHIFT (31-19)
@@ -283,8 +283,8 @@
 #define SICRH_TSOBI1 0x00000002
 #define SICRH_TSOBI2 0x00000001
 
-#elif defined(CONFIG_MPC837x)
-/* SICRL bits - MPC837x specific */
+#elif defined(CONFIG_ARCH_MPC837X)
+/* SICRL bits - MPC837X specific */
 #define SICRL_USB_A 0xC0000000
 #define SICRL_USB_B 0x30000000
 #define SICRL_USB_B_SD 0x20000000
@@ -314,7 +314,7 @@
 #define SICRL_LDP_A 0x00000002
 #define SICRL_LDP_B 0x00000001
 
-/* SICRH bits - MPC837x specific */
+/* SICRH bits - MPC837X specific */
 #define SICRH_DDR 0x80000000
 #define SICRH_TSEC1_A 0x10000000
 #define SICRH_TSEC1_B 0x08000000
@@ -647,7 +647,7 @@
 #define HRCWL_SVCOD_DIV_8 0x20000000
 #define HRCWL_SVCOD_DIV_1 0x30000000
 
-#elif defined(CONFIG_MPC837x)
+#elif defined(CONFIG_ARCH_MPC837X)
 #define HRCWL_SVCOD 0x30000000
 #define HRCWL_SVCOD_SHIFT 28
 #define HRCWL_SVCOD_DIV_4 0x00000000
@@ -758,7 +758,7 @@
 #if defined(CONFIG_ARCH_MPC834X)
 #define HRCWH_ROM_LOC_PCI2 0x00200000
 #endif
-#if defined(CONFIG_MPC837x)
+#if defined(CONFIG_ARCH_MPC837X)
 #define HRCWH_ROM_LOC_ON_CHIP_ROM 0x00300000
 #endif
 #define HRCWH_ROM_LOC_LOCAL_8BIT 0x00500000
@@ -766,7 +766,7 @@
 #define HRCWH_ROM_LOC_LOCAL_32BIT 0x00700000
 
 #if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC831X) || \
- defined(CONFIG_MPC837x)
+ defined(CONFIG_ARCH_MPC837X)
 #define HRCWH_ROM_LOC_NAND_SP_8BIT 0x00100000
 #define HRCWH_ROM_LOC_NAND_SP_16BIT 0x00200000
 #define HRCWH_ROM_LOC_NAND_LP_8BIT 0x00500000
@@ -819,7 +819,7 @@
  * RSR - Reset Status Register
  */
 #if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC831X) || \
- defined(CONFIG_MPC837x)
+ defined(CONFIG_ARCH_MPC837X)
 #define RSR_RSTSRC 0xF0000000 /* Reset source */
 #define RSR_RSTSRC_SHIFT 28
 #else
@@ -1032,8 +1032,8 @@
 #define SCCR_TDMCM_2 0x00000020
 #define SCCR_TDMCM_3 0x00000030
 
-#elif defined(CONFIG_MPC837x)
-/* SCCR bits - MPC837x specific */
+#elif defined(CONFIG_ARCH_MPC837X)
+/* SCCR bits - MPC837X specific */
 #define SCCR_TSEC1CM 0xc0000000
 #define SCCR_TSEC1CM_SHIFT 30
 #define SCCR_TSEC1CM_0 0x00000000
@@ -1129,7 +1129,7 @@
 #elif defined(CONFIG_ARCH_MPC832X)
 #define CSCONFIG_ODT_RD_CFG 0x00400000
 #define CSCONFIG_ODT_WR_CFG 0x00040000
-#elif defined(CONFIG_ARCH_MPC8360) || defined(CONFIG_MPC837x)
+#elif defined(CONFIG_ARCH_MPC8360) || defined(CONFIG_ARCH_MPC837X)
 #define CSCONFIG_ODT_RD_NEVER 0x00000000
 #define CSCONFIG_ODT_RD_ONLY_CURRENT 0x00100000
 #define CSCONFIG_ODT_RD_ONLY_OTHER_CS 0x00200000
--
2.16.4

_______________________________________________
U-Boot mailing list
[hidden email]
https://lists.denx.de/listinfo/u-boot
Reply | Threaded
Open this post in threaded view
|

[PATCH 07/48] keymile: Make distinct kmtegr1, kmvect1, suvd3 configs

Mario Six
In reply to this post by Mario Six
The kmtegr1, kmvect1, and suvd3 boards all use the same config include
file with lots of #ifdefs in it.

The Kconfig migation will become easier if we get rid of these #ifdefs
first.

Hence, create distinct config include files for these boards. These
configs will be copies of the suvd3 for now; we will simplify them in
another patch.

Signed-off-by: Mario Six <[hidden email]>
---
 arch/powerpc/cpu/mpc83xx/Kconfig |  16 +++-
 board/keymile/km83xx/Kconfig     |  26 ++++++
 configs/kmtegr1_defconfig        |   2 +-
 configs/kmvect1_defconfig        |   2 +-
 include/configs/kmtegr1.h        | 190 +++++++++++++++++++++++++++++++++++++++
 include/configs/kmvect1.h        | 190 +++++++++++++++++++++++++++++++++++++++
 6 files changed, 421 insertions(+), 5 deletions(-)
 create mode 100644 include/configs/kmtegr1.h
 create mode 100644 include/configs/kmvect1.h

diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig b/arch/powerpc/cpu/mpc83xx/Kconfig
index e41f4d1f9a..59e0c9a8d0 100644
--- a/arch/powerpc/cpu/mpc83xx/Kconfig
+++ b/arch/powerpc/cpu/mpc83xx/Kconfig
@@ -89,9 +89,19 @@ config TARGET_KM8360
 
 config TARGET_SUVD3
  bool "Support suvd3"
- select ARCH_MPC8309 if SYS_EXTRA_OPTIONS="KMTEGR1"
- select ARCH_MPC8309 if SYS_EXTRA_OPTIONS="KMVECT1"
- select ARCH_MPC832X if SYS_EXTRA_OPTIONS="SUVD3"
+ select ARCH_MPC832X
+ imply CMD_CRAMFS
+ imply FS_CRAMFS
+
+config TARGET_KMVECT1
+ bool "Support kmvect1"
+ select ARCH_MPC8309
+ imply CMD_CRAMFS
+ imply FS_CRAMFS
+
+config TARGET_KMTEGR1
+ bool "Support kmtegr1"
+ select ARCH_MPC8309
  imply CMD_CRAMFS
  imply FS_CRAMFS
 
diff --git a/board/keymile/km83xx/Kconfig b/board/keymile/km83xx/Kconfig
index d6c594c96a..d52ee9117b 100644
--- a/board/keymile/km83xx/Kconfig
+++ b/board/keymile/km83xx/Kconfig
@@ -11,6 +11,32 @@ config SYS_CONFIG_NAME
 
 endif
 
+if TARGET_KMVECT1
+
+config SYS_BOARD
+ default "km83xx"
+
+config SYS_VENDOR
+ default "keymile"
+
+config SYS_CONFIG_NAME
+ default "kmvect1"
+
+endif
+
+if TARGET_KMTEGR1
+
+config SYS_BOARD
+ default "km83xx"
+
+config SYS_VENDOR
+ default "keymile"
+
+config SYS_CONFIG_NAME
+ default "kmtegr1"
+
+endif
+
 if TARGET_SUVD3
 
 config SYS_BOARD
diff --git a/configs/kmtegr1_defconfig b/configs/kmtegr1_defconfig
index a3325a7662..528380a110 100644
--- a/configs/kmtegr1_defconfig
+++ b/configs/kmtegr1_defconfig
@@ -1,7 +1,7 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xF0000000
 CONFIG_MPC83xx=y
-CONFIG_TARGET_SUVD3=y
+CONFIG_TARGET_KMTEGR1=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_SYS_EXTRA_OPTIONS="KMTEGR1"
diff --git a/configs/kmvect1_defconfig b/configs/kmvect1_defconfig
index 927ef9d56e..94bd6ce055 100644
--- a/configs/kmvect1_defconfig
+++ b/configs/kmvect1_defconfig
@@ -1,7 +1,7 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xF0000000
 CONFIG_MPC83xx=y
-CONFIG_TARGET_SUVD3=y
+CONFIG_TARGET_KMVECT1=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_SYS_EXTRA_OPTIONS="KMVECT1"
diff --git a/include/configs/kmtegr1.h b/include/configs/kmtegr1.h
new file mode 100644
index 0000000000..3e88c9000c
--- /dev/null
+++ b/include/configs/kmtegr1.h
@@ -0,0 +1,190 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2006 Freescale Semiconductor, Inc.
+ *                    Dave Liu <[hidden email]>
+ *
+ * Copyright (C) 2007 Logic Product Development, Inc.
+ *                    Peter Barada <[hidden email]>
+ *
+ * Copyright (C) 2007 MontaVista Software, Inc.
+ *                    Anton Vorontsov <[hidden email]>
+ *
+ * (C) Copyright 2010
+ * Heiko Schocher, DENX Software Engineering, [hidden email].
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+/*
+ * High Level Configuration Options
+ */
+
+/* This needs to be set prior to including km/km83xx-common.h */
+
+#if defined(CONFIG_SUVD3) /* SUVD3 board specific */
+#define CONFIG_HOSTNAME "suvd3"
+#define CONFIG_KM_BOARD_NAME   "suvd3"
+/* include common defines/options for all 8321 Keymile boards */
+#include "km/km8321-common.h"
+
+#elif defined(CONFIG_KMVECT1)   /* VECT1 board specific */
+#define CONFIG_HOSTNAME "kmvect1"
+#define CONFIG_KM_BOARD_NAME   "kmvect1"
+/* at end of uboot partition, before env */
+#define CONFIG_SYS_QE_FW_ADDR   0xF00B0000
+/* include common defines/options for all 8309 Keymile boards */
+#include "km/km8309-common.h"
+
+#elif defined(CONFIG_KMTEGR1)   /* TEGR1 board specific */
+#define CONFIG_HOSTNAME   "kmtegr1"
+#define CONFIG_KM_BOARD_NAME   "kmtegr1"
+#define CONFIG_KM_UBI_PARTITION_NAME_BOOT "ubi0"
+#define CONFIG_KM_UBI_PARTITION_NAME_APP "ubi1"
+
+#define CONFIG_ENV_ADDR 0xF0100000
+#define CONFIG_ENV_OFFSET 0x100000
+
+#define CONFIG_NAND_ECC_BCH
+#define CONFIG_NAND_KMETER1
+#define CONFIG_SYS_MAX_NAND_DEVICE 1
+#define NAND_MAX_CHIPS 1
+
+/* include common defines/options for all 8309 Keymile boards */
+#include "km/km8309-common.h"
+/* must be after the include because KMBEC_FPGA is otherwise undefined */
+#define CONFIG_SYS_NAND_BASE CONFIG_SYS_KMBEC_FPGA_BASE /* PRIO_BASE_ADDRESS */
+
+#else
+#error Supported boards are: SUVD3, KMVECT1, KMTEGR1
+#endif
+
+#define CONFIG_SYS_APP1_BASE 0xA0000000
+#define CONFIG_SYS_APP1_SIZE 256 /* Megabytes */
+#define CONFIG_SYS_APP2_BASE 0xB0000000
+#define CONFIG_SYS_APP2_SIZE 256 /* Megabytes */
+
+/* EEprom support */
+#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
+
+/*
+ * Init Local Bus Memory Controller:
+ *
+ * Bank Bus     Machine PortSz  Size  Device
+ * ---- ---     ------- ------  -----  ------
+ *  2   Local   UPMA    16 bit  256MB APP1
+ *  3   Local   GPCM    16 bit  256MB APP2
+ *
+ */
+
+#if defined(CONFIG_SUVD3) || defined(CONFIG_KMVECT1)
+/*
+ * APP1 on the local bus CS2
+ */
+#define CONFIG_SYS_LBLAWBAR2_PRELIM CONFIG_SYS_APP1_BASE
+#define CONFIG_SYS_LBLAWAR2_PRELIM (LBLAWAR_EN | LBLAWAR_256MB)
+
+#define CONFIG_SYS_BR2_PRELIM (CONFIG_SYS_APP1_BASE | \
+ BR_PS_16 | \
+ BR_MS_UPMA | \
+ BR_V)
+#define CONFIG_SYS_OR2_PRELIM (MEG_TO_AM(CONFIG_SYS_APP1_SIZE))
+
+#define CONFIG_SYS_BR3_PRELIM (CONFIG_SYS_APP2_BASE | \
+ BR_PS_16 | \
+ BR_V)
+
+#define CONFIG_SYS_OR3_PRELIM (MEG_TO_AM(CONFIG_SYS_APP2_SIZE) | \
+ OR_GPCM_CSNT | \
+ OR_GPCM_ACS_DIV4 | \
+ OR_GPCM_SCY_3 | \
+ OR_GPCM_TRLX_SET)
+
+#define CONFIG_SYS_MAMR (MxMR_GPL_x4DIS | \
+ 0x0000c000 | \
+ MxMR_WLFx_2X)
+
+#elif defined(CONFIG_KMTEGR1)
+#define CONFIG_SYS_BR3_PRELIM (CONFIG_SYS_APP2_BASE | \
+ BR_PS_16 | \
+ BR_MS_GPCM | \
+ BR_V)
+
+#define CONFIG_SYS_OR3_PRELIM (MEG_TO_AM(CONFIG_SYS_APP2_SIZE) | \
+ OR_GPCM_SCY_5 | \
+ OR_GPCM_TRLX_CLEAR | \
+ OR_GPCM_EHTR_CLEAR)
+
+#endif /* CONFIG_KMTEGR1 */
+
+#define CONFIG_SYS_LBLAWBAR3_PRELIM CONFIG_SYS_APP2_BASE
+#define CONFIG_SYS_LBLAWAR3_PRELIM (LBLAWAR_EN | LBLAWAR_256MB)
+
+/*
+ * MMU Setup
+ */
+#if defined(CONFIG_SUVD3) || defined(CONFIG_KMVECT1)
+/* APP1:  icache cacheable, but dcache-inhibit and guarded */
+#define CONFIG_SYS_IBAT5L (CONFIG_SYS_APP1_BASE | BATL_PP_RW | \
+ BATL_MEMCOHERENCE)
+#define CONFIG_SYS_IBAT5U (CONFIG_SYS_APP1_BASE | BATU_BL_256M | \
+ BATU_VS | BATU_VP)
+#define CONFIG_SYS_DBAT5L (CONFIG_SYS_APP1_BASE | BATL_PP_RW | \
+ BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_DBAT5U CONFIG_SYS_IBAT5U
+
+#elif defined(CONFIG_KMTEGR1)
+#define CONFIG_SYS_IBAT5L (0)
+#define CONFIG_SYS_IBAT5U (0)
+#define CONFIG_SYS_DBAT5L CONFIG_SYS_IBAT5L
+#define CONFIG_SYS_DBAT5U CONFIG_SYS_IBAT5U
+#endif /* CONFIG_KMTEGR1 */
+
+#define CONFIG_SYS_IBAT6L (CONFIG_SYS_APP2_BASE | BATL_PP_RW | \
+ BATL_MEMCOHERENCE)
+#define CONFIG_SYS_IBAT6U (CONFIG_SYS_APP2_BASE | BATU_BL_256M | \
+ BATU_VS | BATU_VP)
+#define CONFIG_SYS_DBAT6L (CONFIG_SYS_APP2_BASE | BATL_PP_RW | \
+ BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_DBAT6U CONFIG_SYS_IBAT6U
+
+/*
+ * QE UEC ethernet configuration
+ */
+#if defined(CONFIG_KMVECT1)
+#define CONFIG_MV88E6352_SWITCH
+#define CONFIG_KM_MVEXTSW_ADDR 0x10
+
+/* ethernet port connected to simple switch 88e6122 (UEC0) */
+#define CONFIG_UEC_ETH1
+#define CONFIG_SYS_UEC1_UCC_NUM 0 /* UCC1 */
+#define CONFIG_SYS_UEC1_RX_CLK QE_CLK9
+#define CONFIG_SYS_UEC1_TX_CLK QE_CLK10
+
+#define CONFIG_FIXED_PHY 0xFFFFFFFF
+#define CONFIG_SYS_FIXED_PHY_ADDR 0x1E /* unused address */
+#define CONFIG_SYS_FIXED_PHY_PORT(devnum, speed, duplex) \
+ {devnum, speed, duplex}
+#define CONFIG_SYS_FIXED_PHY_PORTS \
+ CONFIG_SYS_FIXED_PHY_PORT("UEC0", SPEED_100, DUPLEX_FULL)
+
+#define CONFIG_SYS_UEC1_ETH_TYPE FAST_ETH
+#define CONFIG_SYS_UEC1_PHY_ADDR CONFIG_SYS_FIXED_PHY_ADDR
+#define CONFIG_SYS_UEC1_INTERFACE_TYPE PHY_INTERFACE_MODE_MII
+#define CONFIG_SYS_UEC1_INTERFACE_SPEED 100
+#endif /* CONFIG_KMVECT1 */
+
+#if defined(CONFIG_KMVECT1) || defined(CONFIG_KMTEGR1)
+/* ethernet port connected to piggy (UEC2) */
+#define CONFIG_HAS_ETH1
+#define CONFIG_UEC_ETH2
+#define CONFIG_SYS_UEC2_UCC_NUM 2       /* UCC3 */
+#define CONFIG_SYS_UEC2_RX_CLK QE_CLK_NONE /* not used in RMII Mode */
+#define CONFIG_SYS_UEC2_TX_CLK QE_CLK12
+#define CONFIG_SYS_UEC2_ETH_TYPE FAST_ETH
+#define CONFIG_SYS_UEC2_PHY_ADDR 0
+#define CONFIG_SYS_UEC2_INTERFACE_TYPE PHY_INTERFACE_MODE_RMII
+#define CONFIG_SYS_UEC2_INTERFACE_SPEED 100
+#endif /* CONFIG_KMVECT1 || CONFIG_KMTEGR1 */
+
+#endif /* __CONFIG_H */
diff --git a/include/configs/kmvect1.h b/include/configs/kmvect1.h
new file mode 100644
index 0000000000..3e88c9000c
--- /dev/null
+++ b/include/configs/kmvect1.h
@@ -0,0 +1,190 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2006 Freescale Semiconductor, Inc.
+ *                    Dave Liu <[hidden email]>
+ *
+ * Copyright (C) 2007 Logic Product Development, Inc.
+ *                    Peter Barada <[hidden email]>
+ *
+ * Copyright (C) 2007 MontaVista Software, Inc.
+ *                    Anton Vorontsov <[hidden email]>
+ *
+ * (C) Copyright 2010
+ * Heiko Schocher, DENX Software Engineering, [hidden email].
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+/*
+ * High Level Configuration Options
+ */
+
+/* This needs to be set prior to including km/km83xx-common.h */
+
+#if defined(CONFIG_SUVD3) /* SUVD3 board specific */
+#define CONFIG_HOSTNAME "suvd3"
+#define CONFIG_KM_BOARD_NAME   "suvd3"
+/* include common defines/options for all 8321 Keymile boards */
+#include "km/km8321-common.h"
+
+#elif defined(CONFIG_KMVECT1)   /* VECT1 board specific */
+#define CONFIG_HOSTNAME "kmvect1"
+#define CONFIG_KM_BOARD_NAME   "kmvect1"
+/* at end of uboot partition, before env */
+#define CONFIG_SYS_QE_FW_ADDR   0xF00B0000
+/* include common defines/options for all 8309 Keymile boards */
+#include "km/km8309-common.h"
+
+#elif defined(CONFIG_KMTEGR1)   /* TEGR1 board specific */
+#define CONFIG_HOSTNAME   "kmtegr1"
+#define CONFIG_KM_BOARD_NAME   "kmtegr1"
+#define CONFIG_KM_UBI_PARTITION_NAME_BOOT "ubi0"
+#define CONFIG_KM_UBI_PARTITION_NAME_APP "ubi1"
+
+#define CONFIG_ENV_ADDR 0xF0100000
+#define CONFIG_ENV_OFFSET 0x100000
+
+#define CONFIG_NAND_ECC_BCH
+#define CONFIG_NAND_KMETER1
+#define CONFIG_SYS_MAX_NAND_DEVICE 1
+#define NAND_MAX_CHIPS 1
+
+/* include common defines/options for all 8309 Keymile boards */
+#include "km/km8309-common.h"
+/* must be after the include because KMBEC_FPGA is otherwise undefined */
+#define CONFIG_SYS_NAND_BASE CONFIG_SYS_KMBEC_FPGA_BASE /* PRIO_BASE_ADDRESS */
+
+#else
+#error Supported boards are: SUVD3, KMVECT1, KMTEGR1
+#endif
+
+#define CONFIG_SYS_APP1_BASE 0xA0000000
+#define CONFIG_SYS_APP1_SIZE 256 /* Megabytes */
+#define CONFIG_SYS_APP2_BASE 0xB0000000
+#define CONFIG_SYS_APP2_SIZE 256 /* Megabytes */
+
+/* EEprom support */
+#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
+
+/*
+ * Init Local Bus Memory Controller:
+ *
+ * Bank Bus     Machine PortSz  Size  Device
+ * ---- ---     ------- ------  -----  ------
+ *  2   Local   UPMA    16 bit  256MB APP1
+ *  3   Local   GPCM    16 bit  256MB APP2
+ *
+ */
+
+#if defined(CONFIG_SUVD3) || defined(CONFIG_KMVECT1)
+/*
+ * APP1 on the local bus CS2
+ */
+#define CONFIG_SYS_LBLAWBAR2_PRELIM CONFIG_SYS_APP1_BASE
+#define CONFIG_SYS_LBLAWAR2_PRELIM (LBLAWAR_EN | LBLAWAR_256MB)
+
+#define CONFIG_SYS_BR2_PRELIM (CONFIG_SYS_APP1_BASE | \
+ BR_PS_16 | \
+ BR_MS_UPMA | \
+ BR_V)
+#define CONFIG_SYS_OR2_PRELIM (MEG_TO_AM(CONFIG_SYS_APP1_SIZE))
+
+#define CONFIG_SYS_BR3_PRELIM (CONFIG_SYS_APP2_BASE | \
+ BR_PS_16 | \
+ BR_V)
+
+#define CONFIG_SYS_OR3_PRELIM (MEG_TO_AM(CONFIG_SYS_APP2_SIZE) | \
+ OR_GPCM_CSNT | \
+ OR_GPCM_ACS_DIV4 | \
+ OR_GPCM_SCY_3 | \
+ OR_GPCM_TRLX_SET)
+
+#define CONFIG_SYS_MAMR (MxMR_GPL_x4DIS | \
+ 0x0000c000 | \
+ MxMR_WLFx_2X)
+
+#elif defined(CONFIG_KMTEGR1)
+#define CONFIG_SYS_BR3_PRELIM (CONFIG_SYS_APP2_BASE | \
+ BR_PS_16 | \
+ BR_MS_GPCM | \
+ BR_V)
+
+#define CONFIG_SYS_OR3_PRELIM (MEG_TO_AM(CONFIG_SYS_APP2_SIZE) | \
+ OR_GPCM_SCY_5 | \
+ OR_GPCM_TRLX_CLEAR | \
+ OR_GPCM_EHTR_CLEAR)
+
+#endif /* CONFIG_KMTEGR1 */
+
+#define CONFIG_SYS_LBLAWBAR3_PRELIM CONFIG_SYS_APP2_BASE
+#define CONFIG_SYS_LBLAWAR3_PRELIM (LBLAWAR_EN | LBLAWAR_256MB)
+
+/*
+ * MMU Setup
+ */
+#if defined(CONFIG_SUVD3) || defined(CONFIG_KMVECT1)
+/* APP1:  icache cacheable, but dcache-inhibit and guarded */
+#define CONFIG_SYS_IBAT5L (CONFIG_SYS_APP1_BASE | BATL_PP_RW | \
+ BATL_MEMCOHERENCE)
+#define CONFIG_SYS_IBAT5U (CONFIG_SYS_APP1_BASE | BATU_BL_256M | \
+ BATU_VS | BATU_VP)
+#define CONFIG_SYS_DBAT5L (CONFIG_SYS_APP1_BASE | BATL_PP_RW | \
+ BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_DBAT5U CONFIG_SYS_IBAT5U
+
+#elif defined(CONFIG_KMTEGR1)
+#define CONFIG_SYS_IBAT5L (0)
+#define CONFIG_SYS_IBAT5U (0)
+#define CONFIG_SYS_DBAT5L CONFIG_SYS_IBAT5L
+#define CONFIG_SYS_DBAT5U CONFIG_SYS_IBAT5U
+#endif /* CONFIG_KMTEGR1 */
+
+#define CONFIG_SYS_IBAT6L (CONFIG_SYS_APP2_BASE | BATL_PP_RW | \
+ BATL_MEMCOHERENCE)
+#define CONFIG_SYS_IBAT6U (CONFIG_SYS_APP2_BASE | BATU_BL_256M | \
+ BATU_VS | BATU_VP)
+#define CONFIG_SYS_DBAT6L (CONFIG_SYS_APP2_BASE | BATL_PP_RW | \
+ BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_DBAT6U CONFIG_SYS_IBAT6U
+
+/*
+ * QE UEC ethernet configuration
+ */
+#if defined(CONFIG_KMVECT1)
+#define CONFIG_MV88E6352_SWITCH
+#define CONFIG_KM_MVEXTSW_ADDR 0x10
+
+/* ethernet port connected to simple switch 88e6122 (UEC0) */
+#define CONFIG_UEC_ETH1
+#define CONFIG_SYS_UEC1_UCC_NUM 0 /* UCC1 */
+#define CONFIG_SYS_UEC1_RX_CLK QE_CLK9
+#define CONFIG_SYS_UEC1_TX_CLK QE_CLK10
+
+#define CONFIG_FIXED_PHY 0xFFFFFFFF
+#define CONFIG_SYS_FIXED_PHY_ADDR 0x1E /* unused address */
+#define CONFIG_SYS_FIXED_PHY_PORT(devnum, speed, duplex) \
+ {devnum, speed, duplex}
+#define CONFIG_SYS_FIXED_PHY_PORTS \
+ CONFIG_SYS_FIXED_PHY_PORT("UEC0", SPEED_100, DUPLEX_FULL)
+
+#define CONFIG_SYS_UEC1_ETH_TYPE FAST_ETH
+#define CONFIG_SYS_UEC1_PHY_ADDR CONFIG_SYS_FIXED_PHY_ADDR
+#define CONFIG_SYS_UEC1_INTERFACE_TYPE PHY_INTERFACE_MODE_MII
+#define CONFIG_SYS_UEC1_INTERFACE_SPEED 100
+#endif /* CONFIG_KMVECT1 */
+
+#if defined(CONFIG_KMVECT1) || defined(CONFIG_KMTEGR1)
+/* ethernet port connected to piggy (UEC2) */
+#define CONFIG_HAS_ETH1
+#define CONFIG_UEC_ETH2
+#define CONFIG_SYS_UEC2_UCC_NUM 2       /* UCC3 */
+#define CONFIG_SYS_UEC2_RX_CLK QE_CLK_NONE /* not used in RMII Mode */
+#define CONFIG_SYS_UEC2_TX_CLK QE_CLK12
+#define CONFIG_SYS_UEC2_ETH_TYPE FAST_ETH
+#define CONFIG_SYS_UEC2_PHY_ADDR 0
+#define CONFIG_SYS_UEC2_INTERFACE_TYPE PHY_INTERFACE_MODE_RMII
+#define CONFIG_SYS_UEC2_INTERFACE_SPEED 100
+#endif /* CONFIG_KMVECT1 || CONFIG_KMTEGR1 */
+
+#endif /* __CONFIG_H */
--
2.16.4

_______________________________________________
U-Boot mailing list
[hidden email]
https://lists.denx.de/listinfo/u-boot
Reply | Threaded
Open this post in threaded view
|

[PATCH 08/48] keymile: Simplify kmtegr1, kmvect1, suvd3 configs

Mario Six
In reply to this post by Mario Six
The kmtegr1, kmvect1, and suvd3 boards now have separate config files,
which were all copied from the suvd3.

Unwind the #ifdef logic in these config files to only include the
options necessary for each board.

Signed-off-by: Mario Six <[hidden email]>
---
 include/configs/kmtegr1.h | 90 ---------------------------------------------
 include/configs/kmvect1.h | 57 ----------------------------
 include/configs/suvd3.h   | 94 -----------------------------------------------
 3 files changed, 241 deletions(-)

diff --git a/include/configs/kmtegr1.h b/include/configs/kmtegr1.h
index 3e88c9000c..69397ae5ae 100644
--- a/include/configs/kmtegr1.h
+++ b/include/configs/kmtegr1.h
@@ -22,21 +22,6 @@
 
 /* This needs to be set prior to including km/km83xx-common.h */
 
-#if defined(CONFIG_SUVD3) /* SUVD3 board specific */
-#define CONFIG_HOSTNAME "suvd3"
-#define CONFIG_KM_BOARD_NAME   "suvd3"
-/* include common defines/options for all 8321 Keymile boards */
-#include "km/km8321-common.h"
-
-#elif defined(CONFIG_KMVECT1)   /* VECT1 board specific */
-#define CONFIG_HOSTNAME "kmvect1"
-#define CONFIG_KM_BOARD_NAME   "kmvect1"
-/* at end of uboot partition, before env */
-#define CONFIG_SYS_QE_FW_ADDR   0xF00B0000
-/* include common defines/options for all 8309 Keymile boards */
-#include "km/km8309-common.h"
-
-#elif defined(CONFIG_KMTEGR1)   /* TEGR1 board specific */
 #define CONFIG_HOSTNAME   "kmtegr1"
 #define CONFIG_KM_BOARD_NAME   "kmtegr1"
 #define CONFIG_KM_UBI_PARTITION_NAME_BOOT "ubi0"
@@ -55,10 +40,6 @@
 /* must be after the include because KMBEC_FPGA is otherwise undefined */
 #define CONFIG_SYS_NAND_BASE CONFIG_SYS_KMBEC_FPGA_BASE /* PRIO_BASE_ADDRESS */
 
-#else
-#error Supported boards are: SUVD3, KMVECT1, KMTEGR1
-#endif
-
 #define CONFIG_SYS_APP1_BASE 0xA0000000
 #define CONFIG_SYS_APP1_SIZE 256 /* Megabytes */
 #define CONFIG_SYS_APP2_BASE 0xB0000000
@@ -77,34 +58,6 @@
  *
  */
 
-#if defined(CONFIG_SUVD3) || defined(CONFIG_KMVECT1)
-/*
- * APP1 on the local bus CS2
- */
-#define CONFIG_SYS_LBLAWBAR2_PRELIM CONFIG_SYS_APP1_BASE
-#define CONFIG_SYS_LBLAWAR2_PRELIM (LBLAWAR_EN | LBLAWAR_256MB)
-
-#define CONFIG_SYS_BR2_PRELIM (CONFIG_SYS_APP1_BASE | \
- BR_PS_16 | \
- BR_MS_UPMA | \
- BR_V)
-#define CONFIG_SYS_OR2_PRELIM (MEG_TO_AM(CONFIG_SYS_APP1_SIZE))
-
-#define CONFIG_SYS_BR3_PRELIM (CONFIG_SYS_APP2_BASE | \
- BR_PS_16 | \
- BR_V)
-
-#define CONFIG_SYS_OR3_PRELIM (MEG_TO_AM(CONFIG_SYS_APP2_SIZE) | \
- OR_GPCM_CSNT | \
- OR_GPCM_ACS_DIV4 | \
- OR_GPCM_SCY_3 | \
- OR_GPCM_TRLX_SET)
-
-#define CONFIG_SYS_MAMR (MxMR_GPL_x4DIS | \
- 0x0000c000 | \
- MxMR_WLFx_2X)
-
-#elif defined(CONFIG_KMTEGR1)
 #define CONFIG_SYS_BR3_PRELIM (CONFIG_SYS_APP2_BASE | \
  BR_PS_16 | \
  BR_MS_GPCM | \
@@ -115,31 +68,16 @@
  OR_GPCM_TRLX_CLEAR | \
  OR_GPCM_EHTR_CLEAR)
 
-#endif /* CONFIG_KMTEGR1 */
-
 #define CONFIG_SYS_LBLAWBAR3_PRELIM CONFIG_SYS_APP2_BASE
 #define CONFIG_SYS_LBLAWAR3_PRELIM (LBLAWAR_EN | LBLAWAR_256MB)
 
 /*
  * MMU Setup
  */
-#if defined(CONFIG_SUVD3) || defined(CONFIG_KMVECT1)
-/* APP1:  icache cacheable, but dcache-inhibit and guarded */
-#define CONFIG_SYS_IBAT5L (CONFIG_SYS_APP1_BASE | BATL_PP_RW | \
- BATL_MEMCOHERENCE)
-#define CONFIG_SYS_IBAT5U (CONFIG_SYS_APP1_BASE | BATU_BL_256M | \
- BATU_VS | BATU_VP)
-#define CONFIG_SYS_DBAT5L (CONFIG_SYS_APP1_BASE | BATL_PP_RW | \
- BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
-#define CONFIG_SYS_DBAT5U CONFIG_SYS_IBAT5U
-
-#elif defined(CONFIG_KMTEGR1)
 #define CONFIG_SYS_IBAT5L (0)
 #define CONFIG_SYS_IBAT5U (0)
 #define CONFIG_SYS_DBAT5L CONFIG_SYS_IBAT5L
 #define CONFIG_SYS_DBAT5U CONFIG_SYS_IBAT5U
-#endif /* CONFIG_KMTEGR1 */
-
 #define CONFIG_SYS_IBAT6L (CONFIG_SYS_APP2_BASE | BATL_PP_RW | \
  BATL_MEMCOHERENCE)
 #define CONFIG_SYS_IBAT6U (CONFIG_SYS_APP2_BASE | BATU_BL_256M | \
@@ -148,33 +86,6 @@
  BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
 #define CONFIG_SYS_DBAT6U CONFIG_SYS_IBAT6U
 
-/*
- * QE UEC ethernet configuration
- */
-#if defined(CONFIG_KMVECT1)
-#define CONFIG_MV88E6352_SWITCH
-#define CONFIG_KM_MVEXTSW_ADDR 0x10
-
-/* ethernet port connected to simple switch 88e6122 (UEC0) */
-#define CONFIG_UEC_ETH1
-#define CONFIG_SYS_UEC1_UCC_NUM 0 /* UCC1 */
-#define CONFIG_SYS_UEC1_RX_CLK QE_CLK9
-#define CONFIG_SYS_UEC1_TX_CLK QE_CLK10
-
-#define CONFIG_FIXED_PHY 0xFFFFFFFF
-#define CONFIG_SYS_FIXED_PHY_ADDR 0x1E /* unused address */
-#define CONFIG_SYS_FIXED_PHY_PORT(devnum, speed, duplex) \
- {devnum, speed, duplex}
-#define CONFIG_SYS_FIXED_PHY_PORTS \
- CONFIG_SYS_FIXED_PHY_PORT("UEC0", SPEED_100, DUPLEX_FULL)
-
-#define CONFIG_SYS_UEC1_ETH_TYPE FAST_ETH
-#define CONFIG_SYS_UEC1_PHY_ADDR CONFIG_SYS_FIXED_PHY_ADDR
-#define CONFIG_SYS_UEC1_INTERFACE_TYPE PHY_INTERFACE_MODE_MII
-#define CONFIG_SYS_UEC1_INTERFACE_SPEED 100
-#endif /* CONFIG_KMVECT1 */
-
-#if defined(CONFIG_KMVECT1) || defined(CONFIG_KMTEGR1)
 /* ethernet port connected to piggy (UEC2) */
 #define CONFIG_HAS_ETH1
 #define CONFIG_UEC_ETH2
@@ -185,6 +96,5 @@
 #define CONFIG_SYS_UEC2_PHY_ADDR 0
 #define CONFIG_SYS_UEC2_INTERFACE_TYPE PHY_INTERFACE_MODE_RMII
 #define CONFIG_SYS_UEC2_INTERFACE_SPEED 100
-#endif /* CONFIG_KMVECT1 || CONFIG_KMTEGR1 */
 
 #endif /* __CONFIG_H */
diff --git a/include/configs/kmvect1.h b/include/configs/kmvect1.h
index 3e88c9000c..178e769976 100644
--- a/include/configs/kmvect1.h
+++ b/include/configs/kmvect1.h
@@ -22,13 +22,6 @@
 
 /* This needs to be set prior to including km/km83xx-common.h */
 
-#if defined(CONFIG_SUVD3) /* SUVD3 board specific */
-#define CONFIG_HOSTNAME "suvd3"
-#define CONFIG_KM_BOARD_NAME   "suvd3"
-/* include common defines/options for all 8321 Keymile boards */
-#include "km/km8321-common.h"
-
-#elif defined(CONFIG_KMVECT1)   /* VECT1 board specific */
 #define CONFIG_HOSTNAME "kmvect1"
 #define CONFIG_KM_BOARD_NAME   "kmvect1"
 /* at end of uboot partition, before env */
@@ -36,29 +29,6 @@
 /* include common defines/options for all 8309 Keymile boards */
 #include "km/km8309-common.h"
 
-#elif defined(CONFIG_KMTEGR1)   /* TEGR1 board specific */
-#define CONFIG_HOSTNAME   "kmtegr1"
-#define CONFIG_KM_BOARD_NAME   "kmtegr1"
-#define CONFIG_KM_UBI_PARTITION_NAME_BOOT "ubi0"
-#define CONFIG_KM_UBI_PARTITION_NAME_APP "ubi1"
-
-#define CONFIG_ENV_ADDR 0xF0100000
-#define CONFIG_ENV_OFFSET 0x100000
-
-#define CONFIG_NAND_ECC_BCH
-#define CONFIG_NAND_KMETER1
-#define CONFIG_SYS_MAX_NAND_DEVICE 1
-#define NAND_MAX_CHIPS 1
-
-/* include common defines/options for all 8309 Keymile boards */
-#include "km/km8309-common.h"
-/* must be after the include because KMBEC_FPGA is otherwise undefined */
-#define CONFIG_SYS_NAND_BASE CONFIG_SYS_KMBEC_FPGA_BASE /* PRIO_BASE_ADDRESS */
-
-#else
-#error Supported boards are: SUVD3, KMVECT1, KMTEGR1
-#endif
-
 #define CONFIG_SYS_APP1_BASE 0xA0000000
 #define CONFIG_SYS_APP1_SIZE 256 /* Megabytes */
 #define CONFIG_SYS_APP2_BASE 0xB0000000
@@ -77,7 +47,6 @@
  *
  */
 
-#if defined(CONFIG_SUVD3) || defined(CONFIG_KMVECT1)
 /*
  * APP1 on the local bus CS2
  */
@@ -104,26 +73,12 @@
  0x0000c000 | \
  MxMR_WLFx_2X)
 
-#elif defined(CONFIG_KMTEGR1)
-#define CONFIG_SYS_BR3_PRELIM (CONFIG_SYS_APP2_BASE | \
- BR_PS_16 | \
- BR_MS_GPCM | \
- BR_V)
-
-#define CONFIG_SYS_OR3_PRELIM (MEG_TO_AM(CONFIG_SYS_APP2_SIZE) | \
- OR_GPCM_SCY_5 | \
- OR_GPCM_TRLX_CLEAR | \
- OR_GPCM_EHTR_CLEAR)
-
-#endif /* CONFIG_KMTEGR1 */
-
 #define CONFIG_SYS_LBLAWBAR3_PRELIM CONFIG_SYS_APP2_BASE
 #define CONFIG_SYS_LBLAWAR3_PRELIM (LBLAWAR_EN | LBLAWAR_256MB)
 
 /*
  * MMU Setup
  */
-#if defined(CONFIG_SUVD3) || defined(CONFIG_KMVECT1)
 /* APP1:  icache cacheable, but dcache-inhibit and guarded */
 #define CONFIG_SYS_IBAT5L (CONFIG_SYS_APP1_BASE | BATL_PP_RW | \
  BATL_MEMCOHERENCE)
@@ -132,14 +87,6 @@
 #define CONFIG_SYS_DBAT5L (CONFIG_SYS_APP1_BASE | BATL_PP_RW | \
  BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
 #define CONFIG_SYS_DBAT5U CONFIG_SYS_IBAT5U
-
-#elif defined(CONFIG_KMTEGR1)
-#define CONFIG_SYS_IBAT5L (0)
-#define CONFIG_SYS_IBAT5U (0)
-#define CONFIG_SYS_DBAT5L CONFIG_SYS_IBAT5L
-#define CONFIG_SYS_DBAT5U CONFIG_SYS_IBAT5U
-#endif /* CONFIG_KMTEGR1 */
-
 #define CONFIG_SYS_IBAT6L (CONFIG_SYS_APP2_BASE | BATL_PP_RW | \
  BATL_MEMCOHERENCE)
 #define CONFIG_SYS_IBAT6U (CONFIG_SYS_APP2_BASE | BATU_BL_256M | \
@@ -151,7 +98,6 @@
 /*
  * QE UEC ethernet configuration
  */
-#if defined(CONFIG_KMVECT1)
 #define CONFIG_MV88E6352_SWITCH
 #define CONFIG_KM_MVEXTSW_ADDR 0x10
 
@@ -172,9 +118,7 @@
 #define CONFIG_SYS_UEC1_PHY_ADDR CONFIG_SYS_FIXED_PHY_ADDR
 #define CONFIG_SYS_UEC1_INTERFACE_TYPE PHY_INTERFACE_MODE_MII
 #define CONFIG_SYS_UEC1_INTERFACE_SPEED 100
-#endif /* CONFIG_KMVECT1 */
 
-#if defined(CONFIG_KMVECT1) || defined(CONFIG_KMTEGR1)
 /* ethernet port connected to piggy (UEC2) */
 #define CONFIG_HAS_ETH1
 #define CONFIG_UEC_ETH2
@@ -185,6 +129,5 @@
 #define CONFIG_SYS_UEC2_PHY_ADDR 0
 #define CONFIG_SYS_UEC2_INTERFACE_TYPE PHY_INTERFACE_MODE_RMII
 #define CONFIG_SYS_UEC2_INTERFACE_SPEED 100
-#endif /* CONFIG_KMVECT1 || CONFIG_KMTEGR1 */
 
 #endif /* __CONFIG_H */
diff --git a/include/configs/suvd3.h b/include/configs/suvd3.h
index 3e88c9000c..2a3f7ff526 100644
--- a/include/configs/suvd3.h
+++ b/include/configs/suvd3.h
@@ -22,43 +22,11 @@
 
 /* This needs to be set prior to including km/km83xx-common.h */
 
-#if defined(CONFIG_SUVD3) /* SUVD3 board specific */
 #define CONFIG_HOSTNAME "suvd3"
 #define CONFIG_KM_BOARD_NAME   "suvd3"
 /* include common defines/options for all 8321 Keymile boards */
 #include "km/km8321-common.h"
 
-#elif defined(CONFIG_KMVECT1)   /* VECT1 board specific */
-#define CONFIG_HOSTNAME "kmvect1"
-#define CONFIG_KM_BOARD_NAME   "kmvect1"
-/* at end of uboot partition, before env */
-#define CONFIG_SYS_QE_FW_ADDR   0xF00B0000
-/* include common defines/options for all 8309 Keymile boards */
-#include "km/km8309-common.h"
-
-#elif defined(CONFIG_KMTEGR1)   /* TEGR1 board specific */
-#define CONFIG_HOSTNAME   "kmtegr1"
-#define CONFIG_KM_BOARD_NAME   "kmtegr1"
-#define CONFIG_KM_UBI_PARTITION_NAME_BOOT "ubi0"
-#define CONFIG_KM_UBI_PARTITION_NAME_APP "ubi1"
-
-#define CONFIG_ENV_ADDR 0xF0100000
-#define CONFIG_ENV_OFFSET 0x100000
-
-#define CONFIG_NAND_ECC_BCH
-#define CONFIG_NAND_KMETER1
-#define CONFIG_SYS_MAX_NAND_DEVICE 1
-#define NAND_MAX_CHIPS 1
-
-/* include common defines/options for all 8309 Keymile boards */
-#include "km/km8309-common.h"
-/* must be after the include because KMBEC_FPGA is otherwise undefined */
-#define CONFIG_SYS_NAND_BASE CONFIG_SYS_KMBEC_FPGA_BASE /* PRIO_BASE_ADDRESS */
-
-#else
-#error Supported boards are: SUVD3, KMVECT1, KMTEGR1
-#endif
-
 #define CONFIG_SYS_APP1_BASE 0xA0000000
 #define CONFIG_SYS_APP1_SIZE 256 /* Megabytes */
 #define CONFIG_SYS_APP2_BASE 0xB0000000
@@ -77,7 +45,6 @@
  *
  */
 
-#if defined(CONFIG_SUVD3) || defined(CONFIG_KMVECT1)
 /*
  * APP1 on the local bus CS2
  */
@@ -104,26 +71,12 @@
  0x0000c000 | \
  MxMR_WLFx_2X)
 
-#elif defined(CONFIG_KMTEGR1)
-#define CONFIG_SYS_BR3_PRELIM (CONFIG_SYS_APP2_BASE | \
- BR_PS_16 | \
- BR_MS_GPCM | \
- BR_V)
-
-#define CONFIG_SYS_OR3_PRELIM (MEG_TO_AM(CONFIG_SYS_APP2_SIZE) | \
- OR_GPCM_SCY_5 | \
- OR_GPCM_TRLX_CLEAR | \
- OR_GPCM_EHTR_CLEAR)
-
-#endif /* CONFIG_KMTEGR1 */
-
 #define CONFIG_SYS_LBLAWBAR3_PRELIM CONFIG_SYS_APP2_BASE
 #define CONFIG_SYS_LBLAWAR3_PRELIM (LBLAWAR_EN | LBLAWAR_256MB)
 
 /*
  * MMU Setup
  */
-#if defined(CONFIG_SUVD3) || defined(CONFIG_KMVECT1)
 /* APP1:  icache cacheable, but dcache-inhibit and guarded */
 #define CONFIG_SYS_IBAT5L (CONFIG_SYS_APP1_BASE | BATL_PP_RW | \
  BATL_MEMCOHERENCE)
@@ -132,14 +85,6 @@
 #define CONFIG_SYS_DBAT5L (CONFIG_SYS_APP1_BASE | BATL_PP_RW | \
  BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
 #define CONFIG_SYS_DBAT5U CONFIG_SYS_IBAT5U
-
-#elif defined(CONFIG_KMTEGR1)
-#define CONFIG_SYS_IBAT5L (0)
-#define CONFIG_SYS_IBAT5U (0)
-#define CONFIG_SYS_DBAT5L CONFIG_SYS_IBAT5L
-#define CONFIG_SYS_DBAT5U CONFIG_SYS_IBAT5U
-#endif /* CONFIG_KMTEGR1 */
-
 #define CONFIG_SYS_IBAT6L (CONFIG_SYS_APP2_BASE | BATL_PP_RW | \
  BATL_MEMCOHERENCE)
 #define CONFIG_SYS_IBAT6U (CONFIG_SYS_APP2_BASE | BATU_BL_256M | \
@@ -148,43 +93,4 @@
  BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
 #define CONFIG_SYS_DBAT6U CONFIG_SYS_IBAT6U
 
-/*
- * QE UEC ethernet configuration
- */
-#if defined(CONFIG_KMVECT1)
-#define CONFIG_MV88E6352_SWITCH
-#define CONFIG_KM_MVEXTSW_ADDR 0x10
-
-/* ethernet port connected to simple switch 88e6122 (UEC0) */
-#define CONFIG_UEC_ETH1
-#define CONFIG_SYS_UEC1_UCC_NUM 0 /* UCC1 */
-#define CONFIG_SYS_UEC1_RX_CLK QE_CLK9
-#define CONFIG_SYS_UEC1_TX_CLK QE_CLK10
-
-#define CONFIG_FIXED_PHY 0xFFFFFFFF
-#define CONFIG_SYS_FIXED_PHY_ADDR 0x1E /* unused address */
-#define CONFIG_SYS_FIXED_PHY_PORT(devnum, speed, duplex) \
- {devnum, speed, duplex}
-#define CONFIG_SYS_FIXED_PHY_PORTS \
- CONFIG_SYS_FIXED_PHY_PORT("UEC0", SPEED_100, DUPLEX_FULL)
-
-#define CONFIG_SYS_UEC1_ETH_TYPE FAST_ETH
-#define CONFIG_SYS_UEC1_PHY_ADDR CONFIG_SYS_FIXED_PHY_ADDR
-#define CONFIG_SYS_UEC1_INTERFACE_TYPE PHY_INTERFACE_MODE_MII
-#define CONFIG_SYS_UEC1_INTERFACE_SPEED 100
-#endif /* CONFIG_KMVECT1 */
-
-#if defined(CONFIG_KMVECT1) || defined(CONFIG_KMTEGR1)
-/* ethernet port connected to piggy (UEC2) */
-#define CONFIG_HAS_ETH1
-#define CONFIG_UEC_ETH2
-#define CONFIG_SYS_UEC2_UCC_NUM 2       /* UCC3 */
-#define CONFIG_SYS_UEC2_RX_CLK QE_CLK_NONE /* not used in RMII Mode */
-#define CONFIG_SYS_UEC2_TX_CLK QE_CLK12
-#define CONFIG_SYS_UEC2_ETH_TYPE FAST_ETH
-#define CONFIG_SYS_UEC2_PHY_ADDR 0
-#define CONFIG_SYS_UEC2_INTERFACE_TYPE PHY_INTERFACE_MODE_RMII
-#define CONFIG_SYS_UEC2_INTERFACE_SPEED 100
-#endif /* CONFIG_KMVECT1 || CONFIG_KMTEGR1 */
-
 #endif /* __CONFIG_H */
--
2.16.4

_______________________________________________
U-Boot mailing list
[hidden email]
https://lists.denx.de/listinfo/u-boot
Reply | Threaded
Open this post in threaded view
|

[PATCH 09/48] keymile: Move config files

Mario Six
In reply to this post by Mario Six
We want to unroll several include files, while keeping include
statements consistent.

To make it easier to not break the include statements, move the include
files to the main configs directory. All three include files moved will
be unrolled, so they won't pollute the directory for long.

Signed-off-by: Mario Six <[hidden email]>
---
 include/configs/{km => }/km8309-common.h | 0
 include/configs/{km => }/km8321-common.h | 0
 include/configs/km8360.h                 | 2 +-
 include/configs/{km => }/km83xx-common.h | 4 ++--
 include/configs/kmtegr1.h                | 4 ++--
 include/configs/kmvect1.h                | 4 ++--
 include/configs/suvd3.h                  | 4 ++--
 include/configs/tuxx1.h                  | 2 +-
 8 files changed, 10 insertions(+), 10 deletions(-)
 rename include/configs/{km => }/km8309-common.h (100%)
 rename include/configs/{km => }/km8321-common.h (100%)
 rename include/configs/{km => }/km83xx-common.h (99%)

diff --git a/include/configs/km/km8309-common.h b/include/configs/km8309-common.h
similarity index 100%
rename from include/configs/km/km8309-common.h
rename to include/configs/km8309-common.h
diff --git a/include/configs/km/km8321-common.h b/include/configs/km8321-common.h
similarity index 100%
rename from include/configs/km/km8321-common.h
rename to include/configs/km8321-common.h
diff --git a/include/configs/km8360.h b/include/configs/km8360.h
index 7857b83055..08d2ae0cbc 100644
--- a/include/configs/km8360.h
+++ b/include/configs/km8360.h
@@ -38,7 +38,7 @@
 #define CONFIG_QE /* Has QE */
 
 /* include common defines/options for all 83xx Keymile boards */
-#include "km/km83xx-common.h"
+#include "km83xx-common.h"
 
 /*
  * System IO Setup
diff --git a/include/configs/km/km83xx-common.h b/include/configs/km83xx-common.h
similarity index 99%
rename from include/configs/km/km83xx-common.h
rename to include/configs/km83xx-common.h
index 3868d99b87..f817d978e7 100644
--- a/include/configs/km/km83xx-common.h
+++ b/include/configs/km83xx-common.h
@@ -8,8 +8,8 @@
 #define __CONFIG_KM83XX_H
 
 /* include common defines/options for all Keymile boards */
-#include "keymile-common.h"
-#include "km-powerpc.h"
+#include "km/keymile-common.h"
+#include "km/km-powerpc.h"
 
 /*
  * System Clock Setup
diff --git a/include/configs/kmtegr1.h b/include/configs/kmtegr1.h
index 69397ae5ae..95a131892d 100644
--- a/include/configs/kmtegr1.h
+++ b/include/configs/kmtegr1.h
@@ -20,7 +20,7 @@
  * High Level Configuration Options
  */
 
-/* This needs to be set prior to including km/km83xx-common.h */
+/* This needs to be set prior to including km83xx-common.h */
 
 #define CONFIG_HOSTNAME   "kmtegr1"
 #define CONFIG_KM_BOARD_NAME   "kmtegr1"
@@ -36,7 +36,7 @@
 #define NAND_MAX_CHIPS 1
 
 /* include common defines/options for all 8309 Keymile boards */
-#include "km/km8309-common.h"
+#include "km8309-common.h"
 /* must be after the include because KMBEC_FPGA is otherwise undefined */
 #define CONFIG_SYS_NAND_BASE CONFIG_SYS_KMBEC_FPGA_BASE /* PRIO_BASE_ADDRESS */
 
diff --git a/include/configs/kmvect1.h b/include/configs/kmvect1.h
index 178e769976..0bbf541aec 100644
--- a/include/configs/kmvect1.h
+++ b/include/configs/kmvect1.h
@@ -20,14 +20,14 @@
  * High Level Configuration Options
  */
 
-/* This needs to be set prior to including km/km83xx-common.h */
+/* This needs to be set prior to including km83xx-common.h */
 
 #define CONFIG_HOSTNAME "kmvect1"
 #define CONFIG_KM_BOARD_NAME   "kmvect1"
 /* at end of uboot partition, before env */
 #define CONFIG_SYS_QE_FW_ADDR   0xF00B0000
 /* include common defines/options for all 8309 Keymile boards */
-#include "km/km8309-common.h"
+#include "km8309-common.h"
 
 #define CONFIG_SYS_APP1_BASE 0xA0000000
 #define CONFIG_SYS_APP1_SIZE 256 /* Megabytes */
diff --git a/include/configs/suvd3.h b/include/configs/suvd3.h
index 2a3f7ff526..98137392ed 100644
--- a/include/configs/suvd3.h
+++ b/include/configs/suvd3.h
@@ -20,12 +20,12 @@
  * High Level Configuration Options
  */
 
-/* This needs to be set prior to including km/km83xx-common.h */
+/* This needs to be set prior to including km83xx-common.h */
 
 #define CONFIG_HOSTNAME "suvd3"
 #define CONFIG_KM_BOARD_NAME   "suvd3"
 /* include common defines/options for all 8321 Keymile boards */
-#include "km/km8321-common.h"
+#include "km8321-common.h"
 
 #define CONFIG_SYS_APP1_BASE 0xA0000000
 #define CONFIG_SYS_APP1_SIZE 256 /* Megabytes */
diff --git a/include/configs/tuxx1.h b/include/configs/tuxx1.h
index f22d73b8d3..0b17084b05 100644
--- a/include/configs/tuxx1.h
+++ b/include/configs/tuxx1.h
@@ -43,7 +43,7 @@
 #endif
 
 /* include common defines/options for all 8321 Keymile boards */
-#include "km/km8321-common.h"
+#include "km8321-common.h"
 
 #define CONFIG_SYS_APP1_BASE 0xA0000000    /* PAXG */
 #define CONFIG_SYS_APP1_SIZE 256 /* Megabytes */
--
2.16.4

_______________________________________________
U-Boot mailing list
[hidden email]
https://lists.denx.de/listinfo/u-boot
Reply | Threaded
Open this post in threaded view
|

[PATCH 10/48] keymile: Unroll includes

Mario Six
In reply to this post by Mario Six
To further simplify config include files, unroll the km/km8309-common.h
and km/km8321-common.h include files.

Signed-off-by: Mario Six <[hidden email]>
---
 include/configs/km8309-common.h | 174 ---------------------------------------
 include/configs/km8321-common.h | 139 -------------------------------
 include/configs/kmtegr1.h       | 175 +++++++++++++++++++++++++++++++++++++++-
 include/configs/kmvect1.h       | 174 ++++++++++++++++++++++++++++++++++++++-
 include/configs/suvd3.h         | 139 ++++++++++++++++++++++++++++++-
 include/configs/tuxx1.h         | 139 ++++++++++++++++++++++++++++++-
 6 files changed, 623 insertions(+), 317 deletions(-)
 delete mode 100644 include/configs/km8309-common.h
 delete mode 100644 include/configs/km8321-common.h

diff --git a/include/configs/km8309-common.h b/include/configs/km8309-common.h
deleted file mode 100644
index 3bd334c515..0000000000
--- a/include/configs/km8309-common.h
+++ /dev/null
@@ -1,174 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * Copyright (C) 2012 Keymile AG
- *                    Gerlando Falauto <[hidden email]>
- *
- * Based on km8321-common.h, see respective copyright notice for credits
- */
-
-#ifndef __CONFIG_KM8309_COMMON_H
-#define __CONFIG_KM8309_COMMON_H
-
-/*
- * High Level Configuration Options
- */
-#define CONFIG_E300 1 /* E300 family */
-#define CONFIG_QE 1 /* Has QE */
-
-#define CONFIG_KM_DEF_ARCH "arch=ppc_82xx\0"
-
-/* include common defines/options for all 83xx Keymile boards */
-#include "km83xx-common.h"
-
-/* QE microcode/firmware address */
-#define CONFIG_SYS_QE_FMAN_FW_IN_NOR
-/* between the u-boot partition and env */
-#ifndef CONFIG_SYS_QE_FW_ADDR
-#define CONFIG_SYS_QE_FW_ADDR   0xF00C0000
-#endif
-
-/*
- * System IO Config
- */
-/* 0x14000180 SICR_1 */
-#define CONFIG_SYS_SICRL (0 \
- | SICR_1_UART1_UART1RTS \
- | SICR_1_I2C_CKSTOP \
- | SICR_1_IRQ_A_IRQ \
- | SICR_1_IRQ_B_IRQ \
- | SICR_1_GPIO_A_GPIO \
- | SICR_1_GPIO_B_GPIO \
- | SICR_1_GPIO_C_GPIO \
- | SICR_1_GPIO_D_GPIO \
- | SICR_1_GPIO_E_GPIO \
- | SICR_1_GPIO_F_GPIO \
- | SICR_1_USB_A_UART2S \
- | SICR_1_USB_B_UART2RTS \
- | SICR_1_FEC1_FEC1 \
- | SICR_1_FEC2_FEC2 \
- )
-
-/* 0x00080400 SICR_2 */
-#define CONFIG_SYS_SICRH (0 \
- | SICR_2_FEC3_FEC3 \
- | SICR_2_HDLC1_A_HDLC1 \
- | SICR_2_ELBC_A_LA \
- | SICR_2_ELBC_B_LCLK \
- | SICR_2_HDLC2_A_HDLC2 \
- | SICR_2_USB_D_GPIO \
- | SICR_2_PCI_PCI \
- | SICR_2_HDLC1_B_HDLC1 \
- | SICR_2_HDLC1_C_HDLC1 \
- | SICR_2_HDLC2_B_GPIO \
- | SICR_2_HDLC2_C_HDLC2 \
- | SICR_2_QUIESCE_B \
- )
-
-/* GPR_1 */
-#define CONFIG_SYS_GPR1  0x50008060
-
-#define CONFIG_SYS_GP1DIR 0x00000000
-#define CONFIG_SYS_GP1ODR 0x00000000
-#define CONFIG_SYS_GP2DIR 0xFF000000
-#define CONFIG_SYS_GP2ODR 0x00000000
-
-/*
- * Hardware Reset Configuration Word
- */
-#define CONFIG_SYS_HRCW_LOW (\
- HRCWL_LCL_BUS_TO_SCB_CLK_1X1 | \
- HRCWL_DDR_TO_SCB_CLK_2X1 | \
- HRCWL_CSB_TO_CLKIN_2X1 | \
- HRCWL_CORE_TO_CSB_2X1 | \
- HRCWL_CE_PLL_VCO_DIV_2 | \
- HRCWL_CE_TO_PLL_1X3)
-
-#define CONFIG_SYS_HRCW_HIGH (\
- HRCWH_PCI_AGENT | \
- HRCWH_PCI_ARBITER_DISABLE | \
- HRCWH_CORE_ENABLE | \
- HRCWH_FROM_0X00000100 | \
- HRCWH_BOOTSEQ_DISABLE | \
- HRCWH_SW_WATCHDOG_DISABLE | \
- HRCWH_ROM_LOC_LOCAL_16BIT | \
- HRCWH_BIG_ENDIAN | \
- HRCWH_LALE_NORMAL)
-
-#define CONFIG_SYS_DDRCDR (\
- DDRCDR_EN | \
- DDRCDR_PZ_MAXZ | \
- DDRCDR_NZ_MAXZ | \
- DDRCDR_M_ODR)
-
-#define CONFIG_SYS_DDR_CS0_BNDS 0x0000007f
-#define CONFIG_SYS_DDR_SDRAM_CFG (SDRAM_CFG_SDRAM_TYPE_DDR2 | \
- SDRAM_CFG_32_BE | \
- SDRAM_CFG_SREN | \
- SDRAM_CFG_HSE)
-
-#define CONFIG_SYS_DDR_SDRAM_CFG2 0x00401000
-#define CONFIG_SYS_DDR_CLK_CNTL (DDR_SDRAM_CLK_CNTL_CLK_ADJUST_05)
-#define CONFIG_SYS_DDR_INTERVAL ((0x064 << SDRAM_INTERVAL_BSTOPRE_SHIFT) | \
- (0x200 << SDRAM_INTERVAL_REFINT_SHIFT))
-
-#define CONFIG_SYS_DDR_CS0_CONFIG (CSCONFIG_EN | CSCONFIG_AP | \
- CSCONFIG_ODT_RD_NEVER | \
- CSCONFIG_ODT_WR_ONLY_CURRENT | \
- CSCONFIG_ROW_BIT_13 | \
- CSCONFIG_COL_BIT_10)
-
-#define CONFIG_SYS_DDR_MODE 0x47860242
-#define CONFIG_SYS_DDR_MODE2 0x8080c000
-
-#define CONFIG_SYS_DDR_TIMING_0 ((2 << TIMING_CFG0_MRS_CYC_SHIFT) | \
- (8 << TIMING_CFG0_ODT_PD_EXIT_SHIFT) | \
- (2 << TIMING_CFG0_PRE_PD_EXIT_SHIFT) | \
- (2 << TIMING_CFG0_ACT_PD_EXIT_SHIFT) | \
- (0 << TIMING_CFG0_WWT_SHIFT) | \
- (0 << TIMING_CFG0_RRT_SHIFT) | \
- (0 << TIMING_CFG0_WRT_SHIFT) | \
- (0 << TIMING_CFG0_RWT_SHIFT))
-
-#define CONFIG_SYS_DDR_TIMING_1 ((TIMING_CFG1_CASLAT_40) | \
- (2 << TIMING_CFG1_WRTORD_SHIFT) | \
- (2 << TIMING_CFG1_ACTTOACT_SHIFT) | \
- (3 << TIMING_CFG1_WRREC_SHIFT) | \
- (7 << TIMING_CFG1_REFREC_SHIFT) | \
- (3 << TIMING_CFG1_ACTTORW_SHIFT) | \
- (7 << TIMING_CFG1_ACTTOPRE_SHIFT) | \
- (3 << TIMING_CFG1_PRETOACT_SHIFT))
-
-#define CONFIG_SYS_DDR_TIMING_2 ((8 << TIMING_CFG2_FOUR_ACT_SHIFT) | \
- (3 << TIMING_CFG2_CKE_PLS_SHIFT) | \
- (2 << TIMING_CFG2_WR_DATA_DELAY_SHIFT) | \
- (2 << TIMING_CFG2_RD_TO_PRE_SHIFT) | \
- (3 << TIMING_CFG2_WR_LAT_DELAY_SHIFT) | \
- (0 << TIMING_CFG2_ADD_LAT_SHIFT) | \
- (5 << TIMING_CFG2_CPO_SHIFT))
-
-#define CONFIG_SYS_DDR_TIMING_3 0x00000000
-
-#define CONFIG_SYS_KMBEC_FPGA_BASE 0xE8000000
-#define CONFIG_SYS_KMBEC_FPGA_SIZE 128
-
-/* EEprom support */
-#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
-
-/*
- * Local Bus Configuration & Clock Setup
- */
-#define CONFIG_SYS_LCRR_DBYP 0x80000000
-#define CONFIG_SYS_LCRR_EADC 0x00010000
-#define CONFIG_SYS_LCRR_CLKDIV 0x00000002
-
-#define CONFIG_SYS_LBC_LBCR 0x00000000
-
-/*
- * MMU Setup
- */
-#define CONFIG_SYS_IBAT7L (0)
-#define CONFIG_SYS_IBAT7U (0)
-#define CONFIG_SYS_DBAT7L CONFIG_SYS_IBAT7L
-#define CONFIG_SYS_DBAT7U CONFIG_SYS_IBAT7U
-
-#endif /* __CONFIG_KM8309_COMMON_H */
diff --git a/include/configs/km8321-common.h b/include/configs/km8321-common.h
deleted file mode 100644
index a121a445f7..0000000000
--- a/include/configs/km8321-common.h
+++ /dev/null
@@ -1,139 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * Copyright (C) 2006 Freescale Semiconductor, Inc.
- *                    Dave Liu <[hidden email]>
- *
- * Copyright (C) 2007 Logic Product Development, Inc.
- *                    Peter Barada <[hidden email]>
- *
- * Copyright (C) 2007 MontaVista Software, Inc.
- *                    Anton Vorontsov <[hidden email]>
- *
- * (C) Copyright 2008
- * Heiko Schocher, DENX Software Engineering, [hidden email].
- *
- * (C) Copyright 2010
- * Lukas Roggli, KEYMILE Ltd, [hidden email]
- *
- * (C) Copyright 2010-2011
- * Thomas Reufer, KEYMILE Ltd, [hidden email]
- */
-
-#ifndef __CONFIG_KM8321_COMMON_H
-#define __CONFIG_KM8321_COMMON_H
-
-/*
- * High Level Configuration Options
- */
-#define CONFIG_QE /* Has QE */
-#define CONFIG_KM8321 /* Keymile PBEC8321 board specific */
-
-#define CONFIG_KM_DEF_ARCH "arch=ppc_8xx\0"
-
-/* include common defines/options for all 83xx Keymile boards */
-#include "km83xx-common.h"
-
-/*
- * System IO Config
- */
-#define CONFIG_SYS_SICRL SICRL_IRQ_CKS
-
-/*
- * Hardware Reset Configuration Word
- */
-#define CONFIG_SYS_HRCW_LOW (\
- HRCWL_LCL_BUS_TO_SCB_CLK_1X1 | \
- HRCWL_DDR_TO_SCB_CLK_2X1 | \
- HRCWL_CSB_TO_CLKIN_2X1 | \
- HRCWL_CORE_TO_CSB_2_5X1 | \
- HRCWL_CE_PLL_VCO_DIV_2 | \
- HRCWL_CE_TO_PLL_1X3)
-
-#define CONFIG_SYS_HRCW_HIGH (\
- HRCWH_PCI_AGENT | \
- HRCWH_PCI_ARBITER_DISABLE | \
- HRCWH_CORE_ENABLE | \
- HRCWH_FROM_0X00000100 | \
- HRCWH_BOOTSEQ_DISABLE | \
- HRCWH_SW_WATCHDOG_DISABLE | \
- HRCWH_ROM_LOC_LOCAL_16BIT | \
- HRCWH_BIG_ENDIAN | \
- HRCWH_LALE_NORMAL)
-
-#define CONFIG_SYS_DDRCDR (\
- DDRCDR_EN | \
- DDRCDR_PZ_MAXZ | \
- DDRCDR_NZ_MAXZ | \
- DDRCDR_M_ODR)
-
-#define CONFIG_SYS_DDR_CS0_BNDS 0x0000007f
-#define CONFIG_SYS_DDR_SDRAM_CFG (SDRAM_CFG_SDRAM_TYPE_DDR2 | \
- SDRAM_CFG_32_BE | \
- SDRAM_CFG_SREN | \
- SDRAM_CFG_HSE)
-
-#define CONFIG_SYS_DDR_SDRAM_CFG2 0x00401000
-#define CONFIG_SYS_DDR_CLK_CNTL (DDR_SDRAM_CLK_CNTL_CLK_ADJUST_05)
-#define CONFIG_SYS_DDR_INTERVAL ((0x064 << SDRAM_INTERVAL_BSTOPRE_SHIFT) | \
- (0x200 << SDRAM_INTERVAL_REFINT_SHIFT))
-
-#define CONFIG_SYS_DDR_CS0_CONFIG (CSCONFIG_EN | CSCONFIG_AP | \
- CSCONFIG_ODT_WR_CFG | \
- CSCONFIG_ROW_BIT_13 | \
- CSCONFIG_COL_BIT_10)
-
-#define CONFIG_SYS_DDR_MODE 0x47860242
-#define CONFIG_SYS_DDR_MODE2 0x8080c000
-
-#define CONFIG_SYS_DDR_TIMING_0 ((2 << TIMING_CFG0_MRS_CYC_SHIFT) | \
- (8 << TIMING_CFG0_ODT_PD_EXIT_SHIFT) | \
- (2 << TIMING_CFG0_PRE_PD_EXIT_SHIFT) | \
- (2 << TIMING_CFG0_ACT_PD_EXIT_SHIFT) | \
- (0 << TIMING_CFG0_WWT_SHIFT) | \
- (0 << TIMING_CFG0_RRT_SHIFT) | \
- (0 << TIMING_CFG0_WRT_SHIFT) | \
- (0 << TIMING_CFG0_RWT_SHIFT))
-
-#define CONFIG_SYS_DDR_TIMING_1 ((TIMING_CFG1_CASLAT_40) | \
- (2 << TIMING_CFG1_WRTORD_SHIFT) | \
- (2 << TIMING_CFG1_ACTTOACT_SHIFT) | \
- (3 << TIMING_CFG1_WRREC_SHIFT) | \
- (7 << TIMING_CFG1_REFREC_SHIFT) | \
- (3 << TIMING_CFG1_ACTTORW_SHIFT) | \
- (7 << TIMING_CFG1_ACTTOPRE_SHIFT) | \
- (3 << TIMING_CFG1_PRETOACT_SHIFT))
-
-#define CONFIG_SYS_DDR_TIMING_2 ((8 << TIMING_CFG2_FOUR_ACT_SHIFT) | \
- (3 << TIMING_CFG2_CKE_PLS_SHIFT) | \
- (2 << TIMING_CFG2_WR_DATA_DELAY_SHIFT) | \
- (2 << TIMING_CFG2_RD_TO_PRE_SHIFT) | \
- (3 << TIMING_CFG2_WR_LAT_DELAY_SHIFT) | \
- (0 << TIMING_CFG2_ADD_LAT_SHIFT) | \
- (5 << TIMING_CFG2_CPO_SHIFT))
-
-#define CONFIG_SYS_DDR_TIMING_3 0x00000000
-
-#define CONFIG_SYS_KMBEC_FPGA_BASE 0xE8000000
-#define CONFIG_SYS_KMBEC_FPGA_SIZE 128
-
-/* EEprom support */
-#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
-
-/*
- * Local Bus Configuration & Clock Setup
- */
-#define CONFIG_SYS_LCRR_DBYP 0x80000000
-#define CONFIG_SYS_LCRR_EADC 0x00010000
-#define CONFIG_SYS_LCRR_CLKDIV 0x00000002
-
-#define CONFIG_SYS_LBC_LBCR 0x00000000
-
-/*
- * MMU Setup
- */
-#define CONFIG_SYS_IBAT7L (0)
-#define CONFIG_SYS_IBAT7U (0)
-#define CONFIG_SYS_DBAT7L CONFIG_SYS_IBAT7L
-#define CONFIG_SYS_DBAT7U CONFIG_SYS_IBAT7U
-
-#endif /* __CONFIG_KM8321_COMMON_H */
diff --git a/include/configs/kmtegr1.h b/include/configs/kmtegr1.h
index 95a131892d..e6ec3488dc 100644
--- a/include/configs/kmtegr1.h
+++ b/include/configs/kmtegr1.h
@@ -36,7 +36,180 @@
 #define NAND_MAX_CHIPS 1
 
 /* include common defines/options for all 8309 Keymile boards */
-#include "km8309-common.h"
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2012 Keymile AG
+ *                    Gerlando Falauto <[hidden email]>
+ *
+ * Based on km8321-common.h, see respective copyright notice for credits
+ */
+
+#ifndef __CONFIG_KM8309_COMMON_H
+#define __CONFIG_KM8309_COMMON_H
+
+/*
+ * High Level Configuration Options
+ */
+#define CONFIG_E300 1 /* E300 family */
+#define CONFIG_QE 1 /* Has QE */
+
+#define CONFIG_KM_DEF_ARCH "arch=ppc_82xx\0"
+
+/* include common defines/options for all 83xx Keymile boards */
+#include "km83xx-common.h"
+
+/* QE microcode/firmware address */
+#define CONFIG_SYS_QE_FMAN_FW_IN_NOR
+/* between the u-boot partition and env */
+#ifndef CONFIG_SYS_QE_FW_ADDR
+#define CONFIG_SYS_QE_FW_ADDR   0xF00C0000
+#endif
+
+/*
+ * System IO Config
+ */
+/* 0x14000180 SICR_1 */
+#define CONFIG_SYS_SICRL (0 \
+ | SICR_1_UART1_UART1RTS \
+ | SICR_1_I2C_CKSTOP \
+ | SICR_1_IRQ_A_IRQ \
+ | SICR_1_IRQ_B_IRQ \
+ | SICR_1_GPIO_A_GPIO \
+ | SICR_1_GPIO_B_GPIO \
+ | SICR_1_GPIO_C_GPIO \
+ | SICR_1_GPIO_D_GPIO \
+ | SICR_1_GPIO_E_GPIO \
+ | SICR_1_GPIO_F_GPIO \
+ | SICR_1_USB_A_UART2S \
+ | SICR_1_USB_B_UART2RTS \
+ | SICR_1_FEC1_FEC1 \
+ | SICR_1_FEC2_FEC2 \
+ )
+
+/* 0x00080400 SICR_2 */
+#define CONFIG_SYS_SICRH (0 \
+ | SICR_2_FEC3_FEC3 \
+ | SICR_2_HDLC1_A_HDLC1 \
+ | SICR_2_ELBC_A_LA \
+ | SICR_2_ELBC_B_LCLK \
+ | SICR_2_HDLC2_A_HDLC2 \
+ | SICR_2_USB_D_GPIO \
+ | SICR_2_PCI_PCI \
+ | SICR_2_HDLC1_B_HDLC1 \
+ | SICR_2_HDLC1_C_HDLC1 \
+ | SICR_2_HDLC2_B_GPIO \
+ | SICR_2_HDLC2_C_HDLC2 \
+ | SICR_2_QUIESCE_B \
+ )
+
+/* GPR_1 */
+#define CONFIG_SYS_GPR1  0x50008060
+
+#define CONFIG_SYS_GP1DIR 0x00000000
+#define CONFIG_SYS_GP1ODR 0x00000000
+#define CONFIG_SYS_GP2DIR 0xFF000000
+#define CONFIG_SYS_GP2ODR 0x00000000
+
+/*
+ * Hardware Reset Configuration Word
+ */
+#define CONFIG_SYS_HRCW_LOW (\
+ HRCWL_LCL_BUS_TO_SCB_CLK_1X1 | \
+ HRCWL_DDR_TO_SCB_CLK_2X1 | \
+ HRCWL_CSB_TO_CLKIN_2X1 | \
+ HRCWL_CORE_TO_CSB_2X1 | \
+ HRCWL_CE_PLL_VCO_DIV_2 | \
+ HRCWL_CE_TO_PLL_1X3)
+
+#define CONFIG_SYS_HRCW_HIGH (\
+ HRCWH_PCI_AGENT | \
+ HRCWH_PCI_ARBITER_DISABLE | \
+ HRCWH_CORE_ENABLE | \
+ HRCWH_FROM_0X00000100 | \
+ HRCWH_BOOTSEQ_DISABLE | \
+ HRCWH_SW_WATCHDOG_DISABLE | \
+ HRCWH_ROM_LOC_LOCAL_16BIT | \
+ HRCWH_BIG_ENDIAN | \
+ HRCWH_LALE_NORMAL)
+
+#define CONFIG_SYS_DDRCDR (\
+ DDRCDR_EN | \
+ DDRCDR_PZ_MAXZ | \
+ DDRCDR_NZ_MAXZ | \
+ DDRCDR_M_ODR)
+
+#define CONFIG_SYS_DDR_CS0_BNDS 0x0000007f
+#define CONFIG_SYS_DDR_SDRAM_CFG (SDRAM_CFG_SDRAM_TYPE_DDR2 | \
+ SDRAM_CFG_32_BE | \
+ SDRAM_CFG_SREN | \
+ SDRAM_CFG_HSE)
+
+#define CONFIG_SYS_DDR_SDRAM_CFG2 0x00401000
+#define CONFIG_SYS_DDR_CLK_CNTL (DDR_SDRAM_CLK_CNTL_CLK_ADJUST_05)
+#define CONFIG_SYS_DDR_INTERVAL ((0x064 << SDRAM_INTERVAL_BSTOPRE_SHIFT) | \
+ (0x200 << SDRAM_INTERVAL_REFINT_SHIFT))
+
+#define CONFIG_SYS_DDR_CS0_CONFIG (CSCONFIG_EN | CSCONFIG_AP | \
+ CSCONFIG_ODT_RD_NEVER | \
+ CSCONFIG_ODT_WR_ONLY_CURRENT | \
+ CSCONFIG_ROW_BIT_13 | \
+ CSCONFIG_COL_BIT_10)
+
+#define CONFIG_SYS_DDR_MODE 0x47860242
+#define CONFIG_SYS_DDR_MODE2 0x8080c000
+
+#define CONFIG_SYS_DDR_TIMING_0 ((2 << TIMING_CFG0_MRS_CYC_SHIFT) | \
+ (8 << TIMING_CFG0_ODT_PD_EXIT_SHIFT) | \
+ (2 << TIMING_CFG0_PRE_PD_EXIT_SHIFT) | \
+ (2 << TIMING_CFG0_ACT_PD_EXIT_SHIFT) | \
+ (0 << TIMING_CFG0_WWT_SHIFT) | \
+ (0 << TIMING_CFG0_RRT_SHIFT) | \
+ (0 << TIMING_CFG0_WRT_SHIFT) | \
+ (0 << TIMING_CFG0_RWT_SHIFT))
+
+#define CONFIG_SYS_DDR_TIMING_1 ((TIMING_CFG1_CASLAT_40) | \
+ (2 << TIMING_CFG1_WRTORD_SHIFT) | \
+ (2 << TIMING_CFG1_ACTTOACT_SHIFT) | \
+ (3 << TIMING_CFG1_WRREC_SHIFT) | \
+ (7 << TIMING_CFG1_REFREC_SHIFT) | \
+ (3 << TIMING_CFG1_ACTTORW_SHIFT) | \
+ (7 << TIMING_CFG1_ACTTOPRE_SHIFT) | \
+ (3 << TIMING_CFG1_PRETOACT_SHIFT))
+
+#define CONFIG_SYS_DDR_TIMING_2 ((8 << TIMING_CFG2_FOUR_ACT_SHIFT) | \
+ (3 << TIMING_CFG2_CKE_PLS_SHIFT) | \
+ (2 << TIMING_CFG2_WR_DATA_DELAY_SHIFT) | \
+ (2 << TIMING_CFG2_RD_TO_PRE_SHIFT) | \
+ (3 << TIMING_CFG2_WR_LAT_DELAY_SHIFT) | \
+ (0 << TIMING_CFG2_ADD_LAT_SHIFT) | \
+ (5 << TIMING_CFG2_CPO_SHIFT))
+
+#define CONFIG_SYS_DDR_TIMING_3 0x00000000
+
+#define CONFIG_SYS_KMBEC_FPGA_BASE 0xE8000000
+#define CONFIG_SYS_KMBEC_FPGA_SIZE 128
+
+/* EEprom support */
+#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
+
+/*
+ * Local Bus Configuration & Clock Setup
+ */
+#define CONFIG_SYS_LCRR_DBYP 0x80000000
+#define CONFIG_SYS_LCRR_EADC 0x00010000
+#define CONFIG_SYS_LCRR_CLKDIV 0x00000002
+
+#define CONFIG_SYS_LBC_LBCR 0x00000000
+
+/*
+ * MMU Setup
+ */
+#define CONFIG_SYS_IBAT7L (0)
+#define CONFIG_SYS_IBAT7U (0)
+#define CONFIG_SYS_DBAT7L CONFIG_SYS_IBAT7L
+#define CONFIG_SYS_DBAT7U CONFIG_SYS_IBAT7U
+
+#endif /* __CONFIG_KM8309_COMMON_H */
 /* must be after the include because KMBEC_FPGA is otherwise undefined */
 #define CONFIG_SYS_NAND_BASE CONFIG_SYS_KMBEC_FPGA_BASE /* PRIO_BASE_ADDRESS */
 
diff --git a/include/configs/kmvect1.h b/include/configs/kmvect1.h
index 0bbf541aec..e549d20033 100644
--- a/include/configs/kmvect1.h
+++ b/include/configs/kmvect1.h
@@ -27,8 +27,180 @@
 /* at end of uboot partition, before env */
 #define CONFIG_SYS_QE_FW_ADDR   0xF00B0000
 /* include common defines/options for all 8309 Keymile boards */
-#include "km8309-common.h"
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2012 Keymile AG
+ *                    Gerlando Falauto <[hidden email]>
+ *
+ * Based on km8321-common.h, see respective copyright notice for credits
+ */
+
+#ifndef __CONFIG_KM8309_COMMON_H
+#define __CONFIG_KM8309_COMMON_H
+
+/*
+ * High Level Configuration Options
+ */
+#define CONFIG_E300 1 /* E300 family */
+#define CONFIG_QE 1 /* Has QE */
+
+#define CONFIG_KM_DEF_ARCH "arch=ppc_82xx\0"
+
+/* include common defines/options for all 83xx Keymile boards */
+#include "km83xx-common.h"
+
+/* QE microcode/firmware address */
+#define CONFIG_SYS_QE_FMAN_FW_IN_NOR
+/* between the u-boot partition and env */
+#ifndef CONFIG_SYS_QE_FW_ADDR
+#define CONFIG_SYS_QE_FW_ADDR   0xF00C0000
+#endif
+
+/*
+ * System IO Config
+ */
+/* 0x14000180 SICR_1 */
+#define CONFIG_SYS_SICRL (0 \
+ | SICR_1_UART1_UART1RTS \
+ | SICR_1_I2C_CKSTOP \
+ | SICR_1_IRQ_A_IRQ \
+ | SICR_1_IRQ_B_IRQ \
+ | SICR_1_GPIO_A_GPIO \
+ | SICR_1_GPIO_B_GPIO \
+ | SICR_1_GPIO_C_GPIO \
+ | SICR_1_GPIO_D_GPIO \
+ | SICR_1_GPIO_E_GPIO \
+ | SICR_1_GPIO_F_GPIO \
+ | SICR_1_USB_A_UART2S \
+ | SICR_1_USB_B_UART2RTS \
+ | SICR_1_FEC1_FEC1 \
+ | SICR_1_FEC2_FEC2 \
+ )
+
+/* 0x00080400 SICR_2 */
+#define CONFIG_SYS_SICRH (0 \
+ | SICR_2_FEC3_FEC3 \
+ | SICR_2_HDLC1_A_HDLC1 \
+ | SICR_2_ELBC_A_LA \
+ | SICR_2_ELBC_B_LCLK \
+ | SICR_2_HDLC2_A_HDLC2 \
+ | SICR_2_USB_D_GPIO \
+ | SICR_2_PCI_PCI \
+ | SICR_2_HDLC1_B_HDLC1 \
+ | SICR_2_HDLC1_C_HDLC1 \
+ | SICR_2_HDLC2_B_GPIO \
+ | SICR_2_HDLC2_C_HDLC2 \
+ | SICR_2_QUIESCE_B \
+ )
+
+/* GPR_1 */
+#define CONFIG_SYS_GPR1  0x50008060
+
+#define CONFIG_SYS_GP1DIR 0x00000000
+#define CONFIG_SYS_GP1ODR 0x00000000
+#define CONFIG_SYS_GP2DIR 0xFF000000
+#define CONFIG_SYS_GP2ODR 0x00000000
+
+/*
+ * Hardware Reset Configuration Word
+ */
+#define CONFIG_SYS_HRCW_LOW (\
+ HRCWL_LCL_BUS_TO_SCB_CLK_1X1 | \
+ HRCWL_DDR_TO_SCB_CLK_2X1 | \
+ HRCWL_CSB_TO_CLKIN_2X1 | \
+ HRCWL_CORE_TO_CSB_2X1 | \
+ HRCWL_CE_PLL_VCO_DIV_2 | \
+ HRCWL_CE_TO_PLL_1X3)
+
+#define CONFIG_SYS_HRCW_HIGH (\
+ HRCWH_PCI_AGENT | \
+ HRCWH_PCI_ARBITER_DISABLE | \
+ HRCWH_CORE_ENABLE | \
+ HRCWH_FROM_0X00000100 | \
+ HRCWH_BOOTSEQ_DISABLE | \
+ HRCWH_SW_WATCHDOG_DISABLE | \
+ HRCWH_ROM_LOC_LOCAL_16BIT | \
+ HRCWH_BIG_ENDIAN | \
+ HRCWH_LALE_NORMAL)
+
+#define CONFIG_SYS_DDRCDR (\
+ DDRCDR_EN | \
+ DDRCDR_PZ_MAXZ | \
+ DDRCDR_NZ_MAXZ | \
+ DDRCDR_M_ODR)
+
+#define CONFIG_SYS_DDR_CS0_BNDS 0x0000007f
+#define CONFIG_SYS_DDR_SDRAM_CFG (SDRAM_CFG_SDRAM_TYPE_DDR2 | \
+ SDRAM_CFG_32_BE | \
+ SDRAM_CFG_SREN | \
+ SDRAM_CFG_HSE)
+
+#define CONFIG_SYS_DDR_SDRAM_CFG2 0x00401000
+#define CONFIG_SYS_DDR_CLK_CNTL (DDR_SDRAM_CLK_CNTL_CLK_ADJUST_05)
+#define CONFIG_SYS_DDR_INTERVAL ((0x064 << SDRAM_INTERVAL_BSTOPRE_SHIFT) | \
+ (0x200 << SDRAM_INTERVAL_REFINT_SHIFT))
+
+#define CONFIG_SYS_DDR_CS0_CONFIG (CSCONFIG_EN | CSCONFIG_AP | \
+ CSCONFIG_ODT_RD_NEVER | \
+ CSCONFIG_ODT_WR_ONLY_CURRENT | \
+ CSCONFIG_ROW_BIT_13 | \
+ CSCONFIG_COL_BIT_10)
+
+#define CONFIG_SYS_DDR_MODE 0x47860242
+#define CONFIG_SYS_DDR_MODE2 0x8080c000
+
+#define CONFIG_SYS_DDR_TIMING_0 ((2 << TIMING_CFG0_MRS_CYC_SHIFT) | \
+ (8 << TIMING_CFG0_ODT_PD_EXIT_SHIFT) | \
+ (2 << TIMING_CFG0_PRE_PD_EXIT_SHIFT) | \
+ (2 << TIMING_CFG0_ACT_PD_EXIT_SHIFT) | \
+ (0 << TIMING_CFG0_WWT_SHIFT) | \
+ (0 << TIMING_CFG0_RRT_SHIFT) | \
+ (0 << TIMING_CFG0_WRT_SHIFT) | \
+ (0 << TIMING_CFG0_RWT_SHIFT))
+
+#define CONFIG_SYS_DDR_TIMING_1 ((TIMING_CFG1_CASLAT_40) | \
+ (2 << TIMING_CFG1_WRTORD_SHIFT) | \
+ (2 << TIMING_CFG1_ACTTOACT_SHIFT) | \
+ (3 << TIMING_CFG1_WRREC_SHIFT) | \
+ (7 << TIMING_CFG1_REFREC_SHIFT) | \
+ (3 << TIMING_CFG1_ACTTORW_SHIFT) | \
+ (7 << TIMING_CFG1_ACTTOPRE_SHIFT) | \
+ (3 << TIMING_CFG1_PRETOACT_SHIFT))
+
+#define CONFIG_SYS_DDR_TIMING_2 ((8 << TIMING_CFG2_FOUR_ACT_SHIFT) | \
+ (3 << TIMING_CFG2_CKE_PLS_SHIFT) | \
+ (2 << TIMING_CFG2_WR_DATA_DELAY_SHIFT) | \
+ (2 << TIMING_CFG2_RD_TO_PRE_SHIFT) | \
+ (3 << TIMING_CFG2_WR_LAT_DELAY_SHIFT) | \
+ (0 << TIMING_CFG2_ADD_LAT_SHIFT) | \
+ (5 << TIMING_CFG2_CPO_SHIFT))
+
+#define CONFIG_SYS_DDR_TIMING_3 0x00000000
+
+#define CONFIG_SYS_KMBEC_FPGA_BASE 0xE8000000
+#define CONFIG_SYS_KMBEC_FPGA_SIZE 128
+
+/* EEprom support */
+#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
+
+/*
+ * Local Bus Configuration & Clock Setup
+ */
+#define CONFIG_SYS_LCRR_DBYP 0x80000000
+#define CONFIG_SYS_LCRR_EADC 0x00010000
+#define CONFIG_SYS_LCRR_CLKDIV 0x00000002
+
+#define CONFIG_SYS_LBC_LBCR 0x00000000
+
+/*
+ * MMU Setup
+ */
+#define CONFIG_SYS_IBAT7L (0)
+#define CONFIG_SYS_IBAT7U (0)
+#define CONFIG_SYS_DBAT7L CONFIG_SYS_IBAT7L
+#define CONFIG_SYS_DBAT7U CONFIG_SYS_IBAT7U
 
+#endif /* __CONFIG_KM8309_COMMON_H */
 #define CONFIG_SYS_APP1_BASE 0xA0000000
 #define CONFIG_SYS_APP1_SIZE 256 /* Megabytes */
 #define CONFIG_SYS_APP2_BASE 0xB0000000
diff --git a/include/configs/suvd3.h b/include/configs/suvd3.h
index 98137392ed..d45d6779f4 100644
--- a/include/configs/suvd3.h
+++ b/include/configs/suvd3.h
@@ -25,8 +25,145 @@
 #define CONFIG_HOSTNAME "suvd3"
 #define CONFIG_KM_BOARD_NAME   "suvd3"
 /* include common defines/options for all 8321 Keymile boards */
-#include "km8321-common.h"
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2006 Freescale Semiconductor, Inc.
+ *                    Dave Liu <[hidden email]>
+ *
+ * Copyright (C) 2007 Logic Product Development, Inc.
+ *                    Peter Barada <[hidden email]>
+ *
+ * Copyright (C) 2007 MontaVista Software, Inc.
+ *                    Anton Vorontsov <[hidden email]>
+ *
+ * (C) Copyright 2008
+ * Heiko Schocher, DENX Software Engineering, [hidden email].
+ *
+ * (C) Copyright 2010
+ * Lukas Roggli, KEYMILE Ltd, [hidden email]
+ *
+ * (C) Copyright 2010-2011
+ * Thomas Reufer, KEYMILE Ltd, [hidden email]
+ */
+
+#ifndef __CONFIG_KM8321_COMMON_H
+#define __CONFIG_KM8321_COMMON_H
+
+/*
+ * High Level Configuration Options
+ */
+#define CONFIG_QE /* Has QE */
+#define CONFIG_KM8321 /* Keymile PBEC8321 board specific */
+
+#define CONFIG_KM_DEF_ARCH "arch=ppc_8xx\0"
+
+/* include common defines/options for all 83xx Keymile boards */
+#include "km83xx-common.h"
+
+/*
+ * System IO Config
+ */
+#define CONFIG_SYS_SICRL SICRL_IRQ_CKS
+
+/*
+ * Hardware Reset Configuration Word
+ */
+#define CONFIG_SYS_HRCW_LOW (\
+ HRCWL_LCL_BUS_TO_SCB_CLK_1X1 | \
+ HRCWL_DDR_TO_SCB_CLK_2X1 | \
+ HRCWL_CSB_TO_CLKIN_2X1 | \
+ HRCWL_CORE_TO_CSB_2_5X1 | \
+ HRCWL_CE_PLL_VCO_DIV_2 | \
+ HRCWL_CE_TO_PLL_1X3)
+
+#define CONFIG_SYS_HRCW_HIGH (\
+ HRCWH_PCI_AGENT | \
+ HRCWH_PCI_ARBITER_DISABLE | \
+ HRCWH_CORE_ENABLE | \
+ HRCWH_FROM_0X00000100 | \
+ HRCWH_BOOTSEQ_DISABLE | \
+ HRCWH_SW_WATCHDOG_DISABLE | \
+ HRCWH_ROM_LOC_LOCAL_16BIT | \
+ HRCWH_BIG_ENDIAN | \
+ HRCWH_LALE_NORMAL)
+
+#define CONFIG_SYS_DDRCDR (\
+ DDRCDR_EN | \
+ DDRCDR_PZ_MAXZ | \
+ DDRCDR_NZ_MAXZ | \
+ DDRCDR_M_ODR)
+
+#define CONFIG_SYS_DDR_CS0_BNDS 0x0000007f
+#define CONFIG_SYS_DDR_SDRAM_CFG (SDRAM_CFG_SDRAM_TYPE_DDR2 | \
+ SDRAM_CFG_32_BE | \
+ SDRAM_CFG_SREN | \
+ SDRAM_CFG_HSE)
+
+#define CONFIG_SYS_DDR_SDRAM_CFG2 0x00401000
+#define CONFIG_SYS_DDR_CLK_CNTL (DDR_SDRAM_CLK_CNTL_CLK_ADJUST_05)
+#define CONFIG_SYS_DDR_INTERVAL ((0x064 << SDRAM_INTERVAL_BSTOPRE_SHIFT) | \
+ (0x200 << SDRAM_INTERVAL_REFINT_SHIFT))
+
+#define CONFIG_SYS_DDR_CS0_CONFIG (CSCONFIG_EN | CSCONFIG_AP | \
+ CSCONFIG_ODT_WR_CFG | \
+ CSCONFIG_ROW_BIT_13 | \
+ CSCONFIG_COL_BIT_10)
+
+#define CONFIG_SYS_DDR_MODE 0x47860242
+#define CONFIG_SYS_DDR_MODE2 0x8080c000
+
+#define CONFIG_SYS_DDR_TIMING_0 ((2 << TIMING_CFG0_MRS_CYC_SHIFT) | \
+ (8 << TIMING_CFG0_ODT_PD_EXIT_SHIFT) | \
+ (2 << TIMING_CFG0_PRE_PD_EXIT_SHIFT) | \
+ (2 << TIMING_CFG0_ACT_PD_EXIT_SHIFT) | \
+ (0 << TIMING_CFG0_WWT_SHIFT) | \
+ (0 << TIMING_CFG0_RRT_SHIFT) | \
+ (0 << TIMING_CFG0_WRT_SHIFT) | \
+ (0 << TIMING_CFG0_RWT_SHIFT))
+
+#define CONFIG_SYS_DDR_TIMING_1 ((TIMING_CFG1_CASLAT_40) | \
+ (2 << TIMING_CFG1_WRTORD_SHIFT) | \
+ (2 << TIMING_CFG1_ACTTOACT_SHIFT) | \
+ (3 << TIMING_CFG1_WRREC_SHIFT) | \
+ (7 << TIMING_CFG1_REFREC_SHIFT) | \
+ (3 << TIMING_CFG1_ACTTORW_SHIFT) | \
+ (7 << TIMING_CFG1_ACTTOPRE_SHIFT) | \
+ (3 << TIMING_CFG1_PRETOACT_SHIFT))
+
+#define CONFIG_SYS_DDR_TIMING_2 ((8 << TIMING_CFG2_FOUR_ACT_SHIFT) | \
+ (3 << TIMING_CFG2_CKE_PLS_SHIFT) | \
+ (2 << TIMING_CFG2_WR_DATA_DELAY_SHIFT) | \
+ (2 << TIMING_CFG2_RD_TO_PRE_SHIFT) | \
+ (3 << TIMING_CFG2_WR_LAT_DELAY_SHIFT) | \
+ (0 << TIMING_CFG2_ADD_LAT_SHIFT) | \
+ (5 << TIMING_CFG2_CPO_SHIFT))
+
+#define CONFIG_SYS_DDR_TIMING_3 0x00000000
+
+#define CONFIG_SYS_KMBEC_FPGA_BASE 0xE8000000
+#define CONFIG_SYS_KMBEC_FPGA_SIZE 128
+
+/* EEprom support */
+#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
+
+/*
+ * Local Bus Configuration & Clock Setup
+ */
+#define CONFIG_SYS_LCRR_DBYP 0x80000000
+#define CONFIG_SYS_LCRR_EADC 0x00010000
+#define CONFIG_SYS_LCRR_CLKDIV 0x00000002
+
+#define CONFIG_SYS_LBC_LBCR 0x00000000
+
+/*
+ * MMU Setup
+ */
+#define CONFIG_SYS_IBAT7L (0)
+#define CONFIG_SYS_IBAT7U (0)
+#define CONFIG_SYS_DBAT7L CONFIG_SYS_IBAT7L
+#define CONFIG_SYS_DBAT7U CONFIG_SYS_IBAT7U
 
+#endif /* __CONFIG_KM8321_COMMON_H */
 #define CONFIG_SYS_APP1_BASE 0xA0000000
 #define CONFIG_SYS_APP1_SIZE 256 /* Megabytes */
 #define CONFIG_SYS_APP2_BASE 0xB0000000
diff --git a/include/configs/tuxx1.h b/include/configs/tuxx1.h
index 0b17084b05..8692989669 100644
--- a/include/configs/tuxx1.h
+++ b/include/configs/tuxx1.h
@@ -43,8 +43,145 @@
 #endif
 
 /* include common defines/options for all 8321 Keymile boards */
-#include "km8321-common.h"
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2006 Freescale Semiconductor, Inc.
+ *                    Dave Liu <[hidden email]>
+ *
+ * Copyright (C) 2007 Logic Product Development, Inc.
+ *                    Peter Barada <[hidden email]>
+ *
+ * Copyright (C) 2007 MontaVista Software, Inc.
+ *                    Anton Vorontsov <[hidden email]>
+ *
+ * (C) Copyright 2008
+ * Heiko Schocher, DENX Software Engineering, [hidden email].
+ *
+ * (C) Copyright 2010
+ * Lukas Roggli, KEYMILE Ltd, [hidden email]
+ *
+ * (C) Copyright 2010-2011
+ * Thomas Reufer, KEYMILE Ltd, [hidden email]
+ */
+
+#ifndef __CONFIG_KM8321_COMMON_H
+#define __CONFIG_KM8321_COMMON_H
+
+/*
+ * High Level Configuration Options
+ */
+#define CONFIG_QE /* Has QE */
+#define CONFIG_KM8321 /* Keymile PBEC8321 board specific */
+
+#define CONFIG_KM_DEF_ARCH "arch=ppc_8xx\0"
+
+/* include common defines/options for all 83xx Keymile boards */
+#include "km83xx-common.h"
+
+/*
+ * System IO Config
+ */
+#define CONFIG_SYS_SICRL SICRL_IRQ_CKS
+
+/*
+ * Hardware Reset Configuration Word
+ */
+#define CONFIG_SYS_HRCW_LOW (\
+ HRCWL_LCL_BUS_TO_SCB_CLK_1X1 | \
+ HRCWL_DDR_TO_SCB_CLK_2X1 | \
+ HRCWL_CSB_TO_CLKIN_2X1 | \
+ HRCWL_CORE_TO_CSB_2_5X1 | \
+ HRCWL_CE_PLL_VCO_DIV_2 | \
+ HRCWL_CE_TO_PLL_1X3)
+
+#define CONFIG_SYS_HRCW_HIGH (\
+ HRCWH_PCI_AGENT | \
+ HRCWH_PCI_ARBITER_DISABLE | \
+ HRCWH_CORE_ENABLE | \
+ HRCWH_FROM_0X00000100 | \
+ HRCWH_BOOTSEQ_DISABLE | \
+ HRCWH_SW_WATCHDOG_DISABLE | \
+ HRCWH_ROM_LOC_LOCAL_16BIT | \
+ HRCWH_BIG_ENDIAN | \
+ HRCWH_LALE_NORMAL)
+
+#define CONFIG_SYS_DDRCDR (\
+ DDRCDR_EN | \
+ DDRCDR_PZ_MAXZ | \
+ DDRCDR_NZ_MAXZ | \
+ DDRCDR_M_ODR)
+
+#define CONFIG_SYS_DDR_CS0_BNDS 0x0000007f
+#define CONFIG_SYS_DDR_SDRAM_CFG (SDRAM_CFG_SDRAM_TYPE_DDR2 | \
+ SDRAM_CFG_32_BE | \
+ SDRAM_CFG_SREN | \
+ SDRAM_CFG_HSE)
+
+#define CONFIG_SYS_DDR_SDRAM_CFG2 0x00401000
+#define CONFIG_SYS_DDR_CLK_CNTL (DDR_SDRAM_CLK_CNTL_CLK_ADJUST_05)
+#define CONFIG_SYS_DDR_INTERVAL ((0x064 << SDRAM_INTERVAL_BSTOPRE_SHIFT) | \
+ (0x200 << SDRAM_INTERVAL_REFINT_SHIFT))
+
+#define CONFIG_SYS_DDR_CS0_CONFIG (CSCONFIG_EN | CSCONFIG_AP | \
+ CSCONFIG_ODT_WR_CFG | \
+ CSCONFIG_ROW_BIT_13 | \
+ CSCONFIG_COL_BIT_10)
+
+#define CONFIG_SYS_DDR_MODE 0x47860242
+#define CONFIG_SYS_DDR_MODE2 0x8080c000
+
+#define CONFIG_SYS_DDR_TIMING_0 ((2 << TIMING_CFG0_MRS_CYC_SHIFT) | \
+ (8 << TIMING_CFG0_ODT_PD_EXIT_SHIFT) | \
+ (2 << TIMING_CFG0_PRE_PD_EXIT_SHIFT) | \
+ (2 << TIMING_CFG0_ACT_PD_EXIT_SHIFT) | \
+ (0 << TIMING_CFG0_WWT_SHIFT) | \
+ (0 << TIMING_CFG0_RRT_SHIFT) | \
+ (0 << TIMING_CFG0_WRT_SHIFT) | \
+ (0 << TIMING_CFG0_RWT_SHIFT))
+
+#define CONFIG_SYS_DDR_TIMING_1 ((TIMING_CFG1_CASLAT_40) | \
+ (2 << TIMING_CFG1_WRTORD_SHIFT) | \
+ (2 << TIMING_CFG1_ACTTOACT_SHIFT) | \
+ (3 << TIMING_CFG1_WRREC_SHIFT) | \
+ (7 << TIMING_CFG1_REFREC_SHIFT) | \
+ (3 << TIMING_CFG1_ACTTORW_SHIFT) | \
+ (7 << TIMING_CFG1_ACTTOPRE_SHIFT) | \
+ (3 << TIMING_CFG1_PRETOACT_SHIFT))
+
+#define CONFIG_SYS_DDR_TIMING_2 ((8 << TIMING_CFG2_FOUR_ACT_SHIFT) | \
+ (3 << TIMING_CFG2_CKE_PLS_SHIFT) | \
+ (2 << TIMING_CFG2_WR_DATA_DELAY_SHIFT) | \
+ (2 << TIMING_CFG2_RD_TO_PRE_SHIFT) | \
+ (3 << TIMING_CFG2_WR_LAT_DELAY_SHIFT) | \
+ (0 << TIMING_CFG2_ADD_LAT_SHIFT) | \
+ (5 << TIMING_CFG2_CPO_SHIFT))
+
+#define CONFIG_SYS_DDR_TIMING_3 0x00000000
+
+#define CONFIG_SYS_KMBEC_FPGA_BASE 0xE8000000
+#define CONFIG_SYS_KMBEC_FPGA_SIZE 128
+
+/* EEprom support */
+#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
+
+/*
+ * Local Bus Configuration & Clock Setup
+ */
+#define CONFIG_SYS_LCRR_DBYP 0x80000000
+#define CONFIG_SYS_LCRR_EADC 0x00010000
+#define CONFIG_SYS_LCRR_CLKDIV 0x00000002
+
+#define CONFIG_SYS_LBC_LBCR 0x00000000
+
+/*
+ * MMU Setup
+ */
+#define CONFIG_SYS_IBAT7L (0)
+#define CONFIG_SYS_IBAT7U (0)
+#define CONFIG_SYS_DBAT7L CONFIG_SYS_IBAT7L
+#define CONFIG_SYS_DBAT7U CONFIG_SYS_IBAT7U
 
+#endif /* __CONFIG_KM8321_COMMON_H */
 #define CONFIG_SYS_APP1_BASE 0xA0000000    /* PAXG */
 #define CONFIG_SYS_APP1_SIZE 256 /* Megabytes */
 #if defined(CONFIG_TUXX1) || defined(CONFIG_KMOPTI2) || defined(CONFIG_KMTEPR2)
--
2.16.4

_______________________________________________
U-Boot mailing list
[hidden email]
https://lists.denx.de/listinfo/u-boot
Reply | Threaded
Open this post in threaded view
|

[PATCH 11/48] keymile: Simplify config files

Mario Six
In reply to this post by Mario Six
Simplify the config files in which we recently unrolled the
km8309-common.h include file.

Signed-off-by: Mario Six <[hidden email]>
---
 include/configs/kmtegr1.h | 13 -------------
 include/configs/kmvect1.h | 12 ------------
 include/configs/suvd3.h   | 25 -------------------------
 include/configs/tuxx1.h   | 26 --------------------------
 4 files changed, 76 deletions(-)

diff --git a/include/configs/kmtegr1.h b/include/configs/kmtegr1.h
index e6ec3488dc..27e3905c2b 100644
--- a/include/configs/kmtegr1.h
+++ b/include/configs/kmtegr1.h
@@ -35,18 +35,6 @@
 #define CONFIG_SYS_MAX_NAND_DEVICE 1
 #define NAND_MAX_CHIPS 1
 
-/* include common defines/options for all 8309 Keymile boards */
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * Copyright (C) 2012 Keymile AG
- *                    Gerlando Falauto <[hidden email]>
- *
- * Based on km8321-common.h, see respective copyright notice for credits
- */
-
-#ifndef __CONFIG_KM8309_COMMON_H
-#define __CONFIG_KM8309_COMMON_H
-
 /*
  * High Level Configuration Options
  */
@@ -209,7 +197,6 @@
 #define CONFIG_SYS_DBAT7L CONFIG_SYS_IBAT7L
 #define CONFIG_SYS_DBAT7U CONFIG_SYS_IBAT7U
 
-#endif /* __CONFIG_KM8309_COMMON_H */
 /* must be after the include because KMBEC_FPGA is otherwise undefined */
 #define CONFIG_SYS_NAND_BASE CONFIG_SYS_KMBEC_FPGA_BASE /* PRIO_BASE_ADDRESS */
 
diff --git a/include/configs/kmvect1.h b/include/configs/kmvect1.h
index e549d20033..5a0fbccade 100644
--- a/include/configs/kmvect1.h
+++ b/include/configs/kmvect1.h
@@ -26,17 +26,6 @@
 #define CONFIG_KM_BOARD_NAME   "kmvect1"
 /* at end of uboot partition, before env */
 #define CONFIG_SYS_QE_FW_ADDR   0xF00B0000
-/* include common defines/options for all 8309 Keymile boards */
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * Copyright (C) 2012 Keymile AG
- *                    Gerlando Falauto <[hidden email]>
- *
- * Based on km8321-common.h, see respective copyright notice for credits
- */
-
-#ifndef __CONFIG_KM8309_COMMON_H
-#define __CONFIG_KM8309_COMMON_H
 
 /*
  * High Level Configuration Options
@@ -200,7 +189,6 @@
 #define CONFIG_SYS_DBAT7L CONFIG_SYS_IBAT7L
 #define CONFIG_SYS_DBAT7U CONFIG_SYS_IBAT7U
 
-#endif /* __CONFIG_KM8309_COMMON_H */
 #define CONFIG_SYS_APP1_BASE 0xA0000000
 #define CONFIG_SYS_APP1_SIZE 256 /* Megabytes */
 #define CONFIG_SYS_APP2_BASE 0xB0000000
diff --git a/include/configs/suvd3.h b/include/configs/suvd3.h
index d45d6779f4..5fe5f3cc23 100644
--- a/include/configs/suvd3.h
+++ b/include/configs/suvd3.h
@@ -24,30 +24,6 @@
 
 #define CONFIG_HOSTNAME "suvd3"
 #define CONFIG_KM_BOARD_NAME   "suvd3"
-/* include common defines/options for all 8321 Keymile boards */
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * Copyright (C) 2006 Freescale Semiconductor, Inc.
- *                    Dave Liu <[hidden email]>
- *
- * Copyright (C) 2007 Logic Product Development, Inc.
- *                    Peter Barada <[hidden email]>
- *
- * Copyright (C) 2007 MontaVista Software, Inc.
- *                    Anton Vorontsov <[hidden email]>
- *
- * (C) Copyright 2008
- * Heiko Schocher, DENX Software Engineering, [hidden email].
- *
- * (C) Copyright 2010
- * Lukas Roggli, KEYMILE Ltd, [hidden email]
- *
- * (C) Copyright 2010-2011
- * Thomas Reufer, KEYMILE Ltd, [hidden email]
- */
-
-#ifndef __CONFIG_KM8321_COMMON_H
-#define __CONFIG_KM8321_COMMON_H
 
 /*
  * High Level Configuration Options
@@ -163,7 +139,6 @@
 #define CONFIG_SYS_DBAT7L CONFIG_SYS_IBAT7L
 #define CONFIG_SYS_DBAT7U CONFIG_SYS_IBAT7U
 
-#endif /* __CONFIG_KM8321_COMMON_H */
 #define CONFIG_SYS_APP1_BASE 0xA0000000
 #define CONFIG_SYS_APP1_SIZE 256 /* Megabytes */
 #define CONFIG_SYS_APP2_BASE 0xB0000000
diff --git a/include/configs/tuxx1.h b/include/configs/tuxx1.h
index 8692989669..c031661830 100644
--- a/include/configs/tuxx1.h
+++ b/include/configs/tuxx1.h
@@ -42,31 +42,6 @@
 #error ("Board not supported")
 #endif
 
-/* include common defines/options for all 8321 Keymile boards */
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * Copyright (C) 2006 Freescale Semiconductor, Inc.
- *                    Dave Liu <[hidden email]>
- *
- * Copyright (C) 2007 Logic Product Development, Inc.
- *                    Peter Barada <[hidden email]>
- *
- * Copyright (C) 2007 MontaVista Software, Inc.
- *                    Anton Vorontsov <[hidden email]>
- *
- * (C) Copyright 2008
- * Heiko Schocher, DENX Software Engineering, [hidden email].
- *
- * (C) Copyright 2010
- * Lukas Roggli, KEYMILE Ltd, [hidden email]
- *
- * (C) Copyright 2010-2011
- * Thomas Reufer, KEYMILE Ltd, [hidden email]
- */
-
-#ifndef __CONFIG_KM8321_COMMON_H
-#define __CONFIG_KM8321_COMMON_H
-
 /*
  * High Level Configuration Options
  */
@@ -181,7 +156,6 @@
 #define CONFIG_SYS_DBAT7L CONFIG_SYS_IBAT7L
 #define CONFIG_SYS_DBAT7U CONFIG_SYS_IBAT7U
 
-#endif /* __CONFIG_KM8321_COMMON_H */
 #define CONFIG_SYS_APP1_BASE 0xA0000000    /* PAXG */
 #define CONFIG_SYS_APP1_SIZE 256 /* Megabytes */
 #if defined(CONFIG_TUXX1) || defined(CONFIG_KMOPTI2) || defined(CONFIG_KMTEPR2)
--
2.16.4

_______________________________________________
U-Boot mailing list
[hidden email]
https://lists.denx.de/listinfo/u-boot
Reply | Threaded
Open this post in threaded view
|

[PATCH 12/48] keymile: Make distinct kmsupx5, tuge1, kmopti2, and kmtepr2 configs

Mario Six
In reply to this post by Mario Six
The kmsupx5, tuge1, kmopti2, and kmtepr2 boards all build from the same
include config file with lots of #ifdef logic.

To ease Kconfig migration, create new config include files for these
boards, and resolve the #ifdef logic as needed.

Signed-off-by: Mario Six <[hidden email]>
---
 arch/powerpc/cpu/mpc83xx/Kconfig |  24 +++
 board/keymile/km83xx/Kconfig     |  52 +++++++
 configs/kmopti2_defconfig        |   3 +-
 configs/kmsupx5_defconfig        |   3 +-
 configs/kmtepr2_defconfig        |   3 +-
 configs/tuge1_defconfig          |   3 +-
 configs/tuxx1_defconfig          |   1 -
 include/configs/kmopti2.h        | 307 +++++++++++++++++++++++++++++++++++++++
 include/configs/kmsupx5.h        | 307 +++++++++++++++++++++++++++++++++++++++
 include/configs/kmtepr2.h        | 307 +++++++++++++++++++++++++++++++++++++++
 include/configs/tuge1.h          | 307 +++++++++++++++++++++++++++++++++++++++
 include/configs/tuxx1.h          |  18 +--
 12 files changed, 1317 insertions(+), 18 deletions(-)
 create mode 100644 include/configs/kmopti2.h
 create mode 100644 include/configs/kmsupx5.h
 create mode 100644 include/configs/kmtepr2.h
 create mode 100644 include/configs/tuge1.h

diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig b/arch/powerpc/cpu/mpc83xx/Kconfig
index 59e0c9a8d0..1ebb092f0b 100644
--- a/arch/powerpc/cpu/mpc83xx/Kconfig
+++ b/arch/powerpc/cpu/mpc83xx/Kconfig
@@ -111,6 +111,30 @@ config TARGET_TUXX1
  imply CMD_CRAMFS
  imply FS_CRAMFS
 
+config TARGET_KMSUPX5
+ bool "Support kmsupx5"
+ select ARCH_MPC832X
+ imply CMD_CRAMFS
+ imply FS_CRAMFS
+
+config TARGET_TUGE1
+ bool "Support tuge1"
+ select ARCH_MPC832X
+ imply CMD_CRAMFS
+ imply FS_CRAMFS
+
+config TARGET_KMOPTI2
+ bool "Support kmopti2"
+ select ARCH_MPC832X
+ imply CMD_CRAMFS
+ imply FS_CRAMFS
+
+config TARGET_KMTEPR2
+ bool "Support kmtepr2"
+ select ARCH_MPC832X
+ imply CMD_CRAMFS
+ imply FS_CRAMFS
+
 config TARGET_TQM834X
  bool "Support TQM834x"
  select ARCH_MPC8349
diff --git a/board/keymile/km83xx/Kconfig b/board/keymile/km83xx/Kconfig
index d52ee9117b..0c4fa0b7fd 100644
--- a/board/keymile/km83xx/Kconfig
+++ b/board/keymile/km83xx/Kconfig
@@ -62,3 +62,55 @@ config SYS_CONFIG_NAME
  default "tuxx1"
 
 endif
+
+if TARGET_KMSUPX5
+
+config SYS_BOARD
+ default "km83xx"
+
+config SYS_VENDOR
+ default "keymile"
+
+config SYS_CONFIG_NAME
+ default "kmsupx5"
+
+endif
+
+if TARGET_TUGE1
+
+config SYS_BOARD
+ default "km83xx"
+
+config SYS_VENDOR
+ default "keymile"
+
+config SYS_CONFIG_NAME
+ default "tuge1"
+
+endif
+
+if TARGET_KMOPTI2
+
+config SYS_BOARD
+ default "km83xx"
+
+config SYS_VENDOR
+ default "keymile"
+
+config SYS_CONFIG_NAME
+ default "kmopti2"
+
+endif
+
+if TARGET_KMTEPR2
+
+config SYS_BOARD
+ default "km83xx"
+
+config SYS_VENDOR
+ default "keymile"
+
+config SYS_CONFIG_NAME
+ default "kmtepr2"
+
+endif
diff --git a/configs/kmopti2_defconfig b/configs/kmopti2_defconfig
index 5f68f062dd..43b7e7c62f 100644
--- a/configs/kmopti2_defconfig
+++ b/configs/kmopti2_defconfig
@@ -1,10 +1,9 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xF0000000
 CONFIG_MPC83xx=y
-CONFIG_TARGET_TUXX1=y
+CONFIG_TARGET_KMOPTI2=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
-CONFIG_SYS_EXTRA_OPTIONS="KMOPTI2"
 CONFIG_MISC_INIT_R=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_BOARD_EARLY_INIT_R=y
diff --git a/configs/kmsupx5_defconfig b/configs/kmsupx5_defconfig
index 98de2e873a..1b92c6e6a0 100644
--- a/configs/kmsupx5_defconfig
+++ b/configs/kmsupx5_defconfig
@@ -1,10 +1,9 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xF0000000
 CONFIG_MPC83xx=y
-CONFIG_TARGET_TUXX1=y
+CONFIG_TARGET_KMSUPX5=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
-CONFIG_SYS_EXTRA_OPTIONS="KMSUPX5"
 CONFIG_MISC_INIT_R=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_BOARD_EARLY_INIT_R=y
diff --git a/configs/kmtepr2_defconfig b/configs/kmtepr2_defconfig
index 46dcb379cd..f62f7c2f3f 100644
--- a/configs/kmtepr2_defconfig
+++ b/configs/kmtepr2_defconfig
@@ -1,10 +1,9 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xF0000000
 CONFIG_MPC83xx=y
-CONFIG_TARGET_TUXX1=y
+CONFIG_TARGET_KMTEPR2=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
-CONFIG_SYS_EXTRA_OPTIONS="KMTEPR2"
 CONFIG_MISC_INIT_R=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_BOARD_EARLY_INIT_R=y
diff --git a/configs/tuge1_defconfig b/configs/tuge1_defconfig
index 1c67bc0c15..e8603888d2 100644
--- a/configs/tuge1_defconfig
+++ b/configs/tuge1_defconfig
@@ -1,10 +1,9 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xF0000000
 CONFIG_MPC83xx=y
-CONFIG_TARGET_TUXX1=y
+CONFIG_TARGET_TUGE1=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
-CONFIG_SYS_EXTRA_OPTIONS="TUGE1"
 CONFIG_MISC_INIT_R=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_BOARD_EARLY_INIT_R=y
diff --git a/configs/tuxx1_defconfig b/configs/tuxx1_defconfig
index de22b0b5ea..40cfe71047 100644
--- a/configs/tuxx1_defconfig
+++ b/configs/tuxx1_defconfig
@@ -4,7 +4,6 @@ CONFIG_MPC83xx=y
 CONFIG_TARGET_TUXX1=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
-CONFIG_SYS_EXTRA_OPTIONS="TUXX1"
 CONFIG_MISC_INIT_R=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_BOARD_EARLY_INIT_R=y
diff --git a/include/configs/kmopti2.h b/include/configs/kmopti2.h
new file mode 100644
index 0000000000..64d6f21514
--- /dev/null
+++ b/include/configs/kmopti2.h
@@ -0,0 +1,307 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2006 Freescale Semiconductor, Inc.
+ *                    Dave Liu <[hidden email]>
+ *
+ * Copyright (C) 2007 Logic Product Development, Inc.
+ *                    Peter Barada <[hidden email]>
+ *
+ * Copyright (C) 2007 MontaVista Software, Inc.
+ *                    Anton Vorontsov <[hidden email]>
+ *
+ * (C) Copyright 2008
+ * Heiko Schocher, DENX Software Engineering, [hidden email].
+ *
+ * (C) Copyright 2010-2013
+ * Lukas Roggli, KEYMILE Ltd, [hidden email]
+ * Holger Brunck,  Keymile GmbH, [hidden email]
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+/*
+ * High Level Configuration Options
+ */
+#if defined(CONFIG_TARGET_KMSUPX5)
+#define CONFIG_KM_BOARD_NAME "kmsupx5"
+#define CONFIG_HOSTNAME "kmsupx5"
+#elif defined(CONFIG_TARGET_TUGE1)
+#define CONFIG_KM_BOARD_NAME "tuge1"
+#define CONFIG_HOSTNAME "tuge1"
+#elif defined(CONFIG_TARGET_TUXX1) /* TUXX1 board (tuxa1/tuda1) specific */
+#define CONFIG_KM_BOARD_NAME "tuxx1"
+#define CONFIG_HOSTNAME "tuxx1"
+#elif defined(CONFIG_TARGET_KMOPTI2)
+#define CONFIG_KM_BOARD_NAME "kmopti2"
+#define CONFIG_HOSTNAME "kmopti2"
+#elif defined(CONFIG_TARGET_KMTEPR2)
+#define CONFIG_KM_BOARD_NAME    "kmtepr2"
+#define CONFIG_HOSTNAME         "kmtepr2"
+#else
+#error ("Board not supported")
+#endif
+
+/*
+ * High Level Configuration Options
+ */
+#define CONFIG_QE /* Has QE */
+#define CONFIG_KM8321 /* Keymile PBEC8321 board specific */
+
+#define CONFIG_KM_DEF_ARCH "arch=ppc_8xx\0"
+
+/* include common defines/options for all 83xx Keymile boards */
+#include "km83xx-common.h"
+
+/*
+ * System IO Config
+ */
+#define CONFIG_SYS_SICRL SICRL_IRQ_CKS
+
+/*
+ * Hardware Reset Configuration Word
+ */
+#define CONFIG_SYS_HRCW_LOW (\
+ HRCWL_LCL_BUS_TO_SCB_CLK_1X1 | \
+ HRCWL_DDR_TO_SCB_CLK_2X1 | \
+ HRCWL_CSB_TO_CLKIN_2X1 | \
+ HRCWL_CORE_TO_CSB_2_5X1 | \
+ HRCWL_CE_PLL_VCO_DIV_2 | \
+ HRCWL_CE_TO_PLL_1X3)
+
+#define CONFIG_SYS_HRCW_HIGH (\
+ HRCWH_PCI_AGENT | \
+ HRCWH_PCI_ARBITER_DISABLE | \
+ HRCWH_CORE_ENABLE | \
+ HRCWH_FROM_0X00000100 | \
+ HRCWH_BOOTSEQ_DISABLE | \
+ HRCWH_SW_WATCHDOG_DISABLE | \
+ HRCWH_ROM_LOC_LOCAL_16BIT | \
+ HRCWH_BIG_ENDIAN | \
+ HRCWH_LALE_NORMAL)
+
+#define CONFIG_SYS_DDRCDR (\
+ DDRCDR_EN | \
+ DDRCDR_PZ_MAXZ | \
+ DDRCDR_NZ_MAXZ | \
+ DDRCDR_M_ODR)
+
+#define CONFIG_SYS_DDR_CS0_BNDS 0x0000007f
+#define CONFIG_SYS_DDR_SDRAM_CFG (SDRAM_CFG_SDRAM_TYPE_DDR2 | \
+ SDRAM_CFG_32_BE | \
+ SDRAM_CFG_SREN | \
+ SDRAM_CFG_HSE)
+
+#define CONFIG_SYS_DDR_SDRAM_CFG2 0x00401000
+#define CONFIG_SYS_DDR_CLK_CNTL (DDR_SDRAM_CLK_CNTL_CLK_ADJUST_05)
+#define CONFIG_SYS_DDR_INTERVAL ((0x064 << SDRAM_INTERVAL_BSTOPRE_SHIFT) | \
+ (0x200 << SDRAM_INTERVAL_REFINT_SHIFT))
+
+#define CONFIG_SYS_DDR_CS0_CONFIG (CSCONFIG_EN | CSCONFIG_AP | \
+ CSCONFIG_ODT_WR_CFG | \
+ CSCONFIG_ROW_BIT_13 | \
+ CSCONFIG_COL_BIT_10)
+
+#define CONFIG_SYS_DDR_MODE 0x47860242
+#define CONFIG_SYS_DDR_MODE2 0x8080c000
+
+#define CONFIG_SYS_DDR_TIMING_0 ((2 << TIMING_CFG0_MRS_CYC_SHIFT) | \
+ (8 << TIMING_CFG0_ODT_PD_EXIT_SHIFT) | \
+ (2 << TIMING_CFG0_PRE_PD_EXIT_SHIFT) | \
+ (2 << TIMING_CFG0_ACT_PD_EXIT_SHIFT) | \
+ (0 << TIMING_CFG0_WWT_SHIFT) | \
+ (0 << TIMING_CFG0_RRT_SHIFT) | \
+ (0 << TIMING_CFG0_WRT_SHIFT) | \
+ (0 << TIMING_CFG0_RWT_SHIFT))
+
+#define CONFIG_SYS_DDR_TIMING_1 ((TIMING_CFG1_CASLAT_40) | \
+ (2 << TIMING_CFG1_WRTORD_SHIFT) | \
+ (2 << TIMING_CFG1_ACTTOACT_SHIFT) | \
+ (3 << TIMING_CFG1_WRREC_SHIFT) | \
+ (7 << TIMING_CFG1_REFREC_SHIFT) | \
+ (3 << TIMING_CFG1_ACTTORW_SHIFT) | \
+ (7 << TIMING_CFG1_ACTTOPRE_SHIFT) | \
+ (3 << TIMING_CFG1_PRETOACT_SHIFT))
+
+#define CONFIG_SYS_DDR_TIMING_2 ((8 << TIMING_CFG2_FOUR_ACT_SHIFT) | \
+ (3 << TIMING_CFG2_CKE_PLS_SHIFT) | \
+ (2 << TIMING_CFG2_WR_DATA_DELAY_SHIFT) | \
+ (2 << TIMING_CFG2_RD_TO_PRE_SHIFT) | \
+ (3 << TIMING_CFG2_WR_LAT_DELAY_SHIFT) | \
+ (0 << TIMING_CFG2_ADD_LAT_SHIFT) | \
+ (5 << TIMING_CFG2_CPO_SHIFT))
+
+#define CONFIG_SYS_DDR_TIMING_3 0x00000000
+
+#define CONFIG_SYS_KMBEC_FPGA_BASE 0xE8000000
+#define CONFIG_SYS_KMBEC_FPGA_SIZE 128
+
+/* EEprom support */
+#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
+
+/*
+ * Local Bus Configuration & Clock Setup
+ */
+#define CONFIG_SYS_LCRR_DBYP 0x80000000
+#define CONFIG_SYS_LCRR_EADC 0x00010000
+#define CONFIG_SYS_LCRR_CLKDIV 0x00000002
+
+#define CONFIG_SYS_LBC_LBCR 0x00000000
+
+/*
+ * MMU Setup
+ */
+#define CONFIG_SYS_IBAT7L (0)
+#define CONFIG_SYS_IBAT7U (0)
+#define CONFIG_SYS_DBAT7L CONFIG_SYS_IBAT7L
+#define CONFIG_SYS_DBAT7U CONFIG_SYS_IBAT7U
+
+#define CONFIG_SYS_APP1_BASE 0xA0000000    /* PAXG */
+#define CONFIG_SYS_APP1_SIZE 256 /* Megabytes */
+#if defined(CONFIG_TARGET_TUXX1) || defined(CONFIG_TARGET_KMOPTI2) || defined(CONFIG_TARGET_KMTEPR2)
+#define CONFIG_SYS_APP2_BASE 0xB0000000    /* PINC3 */
+#define CONFIG_SYS_APP2_SIZE 256 /* Megabytes */
+#endif
+
+/*
+ * Init Local Bus Memory Controller:
+ *      Device on board
+ * Bank Bus     Machine PortSz Size   TUDA1  TUXA1  TUGE1   KMSUPX4 KMOPTI2
+ * -----------------------------------------------------------------------------
+ *  2   Local   GPCM    8 bit  256MB  PAXG   LPXF   PAXI    LPXF    PAXE
+ *  3   Local   GPCM    8 bit  256MB  PINC3  PINC2  unused  unused  OPI2(16 bit)
+ *
+ *      Device on board (continued)
+ * Bank Bus     Machine PortSz Size   KMTEPR2
+ * -----------------------------------------------------------------------------
+ *  2   Local   GPCM    8 bit  256MB  NVRAM
+ *  3   Local   GPCM    8 bit  256MB  TEP2 (16 bit)
+ */
+
+#if defined(CONFIG_KMTEPRO2)
+/*
+ * Configuration for C2 (NVRAM) on the local bus
+ */
+#define CONFIG_SYS_LBLAWBAR2_PRELIM    CONFIG_SYS_APP1_BASE
+#define CONFIG_SYS_LBLAWAR2_PRELIM     (LBLAWAR_EN | LBLAWAR_256MB)
+#define CONFIG_SYS_BR2_PRELIM  (CONFIG_SYS_APP1_BASE | \
+ BR_PS_8 | \
+ BR_MS_GPCM | \
+ BR_V)
+#define CONFIG_SYS_OR2_PRELIM  (MEG_TO_AM(CONFIG_SYS_APP1_SIZE) | \
+ OR_GPCM_CSNT | \
+ OR_GPCM_ACS_DIV2 | \
+ OR_GPCM_XACS | \
+ OR_GPCM_SCY_2 | \
+ OR_GPCM_TRLX_SET | \
+ OR_GPCM_EHTR_SET | \
+ OR_GPCM_EAD)
+#else
+/*
+ * Configuration for C2 on the local bus
+ */
+/* Window base at flash base */
+#define CONFIG_SYS_LBLAWBAR2_PRELIM CONFIG_SYS_APP1_BASE
+/* Window size: 256 MB */
+#define CONFIG_SYS_LBLAWAR2_PRELIM (LBLAWAR_EN | LBLAWAR_256MB)
+
+#define CONFIG_SYS_BR2_PRELIM (CONFIG_SYS_APP1_BASE | \
+ BR_PS_8 | \
+ BR_MS_GPCM | \
+ BR_V)
+
+#define CONFIG_SYS_OR2_PRELIM (MEG_TO_AM(CONFIG_SYS_APP1_SIZE) | \
+ OR_GPCM_CSNT | \
+ OR_GPCM_ACS_DIV4 | \
+ OR_GPCM_SCY_2 | \
+ OR_GPCM_TRLX_SET | \
+ OR_GPCM_EHTR_CLEAR | \
+ OR_GPCM_EAD)
+#endif
+
+#if defined(CONFIG_TARGET_TUXX1)
+/*
+ * Configuration for C3 on the local bus
+ */
+/* Access window base at PINC3 base */
+#define CONFIG_SYS_LBLAWBAR3_PRELIM CONFIG_SYS_APP2_BASE
+/* Window size: 256 MB */
+#define CONFIG_SYS_LBLAWAR3_PRELIM (LBLAWAR_EN | LBLAWAR_256MB)
+
+#define CONFIG_SYS_BR3_PRELIM (CONFIG_SYS_APP2_BASE | \
+ BR_PS_8 | \
+ BR_MS_GPCM | \
+ BR_V)
+
+#define CONFIG_SYS_OR3_PRELIM (MEG_TO_AM(CONFIG_SYS_APP2_SIZE) | \
+ OR_GPCM_CSNT | \
+ OR_GPCM_ACS_DIV2 | \
+ OR_GPCM_SCY_2 | \
+ OR_GPCM_TRLX_SET | \
+ OR_GPCM_EHTR_CLEAR)
+
+#define CONFIG_SYS_MAMR (MxMR_GPL_x4DIS | \
+ 0x0000c000 | \
+ MxMR_WLFx_2X)
+#endif
+
+#if defined(CONFIG_TARGET_KMOPTI2) || defined(CONFIG_TARGET_KMTEPR2)
+/*
+ * Configuration for C3 on the local bus
+ */
+#define CONFIG_SYS_LBLAWBAR3_PRELIM CONFIG_SYS_APP2_BASE
+#define CONFIG_SYS_LBLAWAR3_PRELIM (LBLAWAR_EN | LBLAWAR_256MB)
+#define CONFIG_SYS_BR3_PRELIM (CONFIG_SYS_APP2_BASE | \
+ BR_PS_16 | \
+ BR_MS_GPCM | \
+ BR_V)
+#define CONFIG_SYS_OR3_PRELIM (MEG_TO_AM(CONFIG_SYS_APP2_SIZE) | \
+ OR_GPCM_SCY_4 | \
+ OR_GPCM_TRLX_CLEAR | \
+ OR_GPCM_EHTR_CLEAR)
+#endif
+
+/*
+ * MMU Setup
+ */
+/* APP1: icache cacheable, but dcache-inhibit and guarded */
+#define CONFIG_SYS_IBAT5L (CONFIG_SYS_APP1_BASE | \
+ BATL_PP_RW | \
+ BATL_MEMCOHERENCE)
+/* 512M should also include APP2... */
+#define CONFIG_SYS_IBAT5U (CONFIG_SYS_APP1_BASE | \
+ BATU_BL_256M | \
+ BATU_VS | \
+ BATU_VP)
+#define CONFIG_SYS_DBAT5L (CONFIG_SYS_APP1_BASE | \
+ BATL_PP_RW | \
+ BATL_CACHEINHIBIT | \
+ BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_DBAT5U CONFIG_SYS_IBAT5U
+
+#if defined(CONFIG_TARGET_TUGE1) || defined(CONFIG_TARGET_KMSUPX5)
+#define CONFIG_SYS_IBAT6L (0)
+#define CONFIG_SYS_IBAT6U (0)
+#define CONFIG_SYS_DBAT6L CONFIG_SYS_IBAT6L
+#else
+/* APP2:  icache cacheable, but dcache-inhibit and guarded */
+#define CONFIG_SYS_IBAT6L (CONFIG_SYS_APP2_BASE | \
+ BATL_PP_RW | \
+ BATL_MEMCOHERENCE)
+#define CONFIG_SYS_IBAT6U (CONFIG_SYS_APP2_BASE | \
+ BATU_BL_256M | \
+ BATU_VS | \
+ BATU_VP)
+#define CONFIG_SYS_DBAT6L (CONFIG_SYS_APP2_BASE | \
+ BATL_PP_RW | \
+ BATL_CACHEINHIBIT | \
+ BATL_GUARDEDSTORAGE)
+#endif
+#define CONFIG_SYS_DBAT6U CONFIG_SYS_IBAT6U
+
+#define CONFIG_SYS_IBAT7L (0)
+#define CONFIG_SYS_IBAT7U (0)
+#define CONFIG_SYS_DBAT7L CONFIG_SYS_IBAT7L
+#define CONFIG_SYS_DBAT7U CONFIG_SYS_IBAT7U
+
+#endif /* __CONFIG_H */
diff --git a/include/configs/kmsupx5.h b/include/configs/kmsupx5.h
new file mode 100644
index 0000000000..64d6f21514
--- /dev/null
+++ b/include/configs/kmsupx5.h
@@ -0,0 +1,307 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2006 Freescale Semiconductor, Inc.
+ *                    Dave Liu <[hidden email]>
+ *
+ * Copyright (C) 2007 Logic Product Development, Inc.
+ *                    Peter Barada <[hidden email]>
+ *
+ * Copyright (C) 2007 MontaVista Software, Inc.
+ *                    Anton Vorontsov <[hidden email]>
+ *
+ * (C) Copyright 2008
+ * Heiko Schocher, DENX Software Engineering, [hidden email].
+ *
+ * (C) Copyright 2010-2013
+ * Lukas Roggli, KEYMILE Ltd, [hidden email]
+ * Holger Brunck,  Keymile GmbH, [hidden email]
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+/*
+ * High Level Configuration Options
+ */
+#if defined(CONFIG_TARGET_KMSUPX5)
+#define CONFIG_KM_BOARD_NAME "kmsupx5"
+#define CONFIG_HOSTNAME "kmsupx5"
+#elif defined(CONFIG_TARGET_TUGE1)
+#define CONFIG_KM_BOARD_NAME "tuge1"
+#define CONFIG_HOSTNAME "tuge1"
+#elif defined(CONFIG_TARGET_TUXX1) /* TUXX1 board (tuxa1/tuda1) specific */
+#define CONFIG_KM_BOARD_NAME "tuxx1"
+#define CONFIG_HOSTNAME "tuxx1"
+#elif defined(CONFIG_TARGET_KMOPTI2)
+#define CONFIG_KM_BOARD_NAME "kmopti2"
+#define CONFIG_HOSTNAME "kmopti2"
+#elif defined(CONFIG_TARGET_KMTEPR2)
+#define CONFIG_KM_BOARD_NAME    "kmtepr2"
+#define CONFIG_HOSTNAME         "kmtepr2"
+#else
+#error ("Board not supported")
+#endif
+
+/*
+ * High Level Configuration Options
+ */
+#define CONFIG_QE /* Has QE */
+#define CONFIG_KM8321 /* Keymile PBEC8321 board specific */
+
+#define CONFIG_KM_DEF_ARCH "arch=ppc_8xx\0"
+
+/* include common defines/options for all 83xx Keymile boards */
+#include "km83xx-common.h"
+
+/*
+ * System IO Config
+ */
+#define CONFIG_SYS_SICRL SICRL_IRQ_CKS
+
+/*
+ * Hardware Reset Configuration Word
+ */
+#define CONFIG_SYS_HRCW_LOW (\
+ HRCWL_LCL_BUS_TO_SCB_CLK_1X1 | \
+ HRCWL_DDR_TO_SCB_CLK_2X1 | \
+ HRCWL_CSB_TO_CLKIN_2X1 | \
+ HRCWL_CORE_TO_CSB_2_5X1 | \
+ HRCWL_CE_PLL_VCO_DIV_2 | \
+ HRCWL_CE_TO_PLL_1X3)
+
+#define CONFIG_SYS_HRCW_HIGH (\
+ HRCWH_PCI_AGENT | \
+ HRCWH_PCI_ARBITER_DISABLE | \
+ HRCWH_CORE_ENABLE | \
+ HRCWH_FROM_0X00000100 | \
+ HRCWH_BOOTSEQ_DISABLE | \
+ HRCWH_SW_WATCHDOG_DISABLE | \
+ HRCWH_ROM_LOC_LOCAL_16BIT | \
+ HRCWH_BIG_ENDIAN | \
+ HRCWH_LALE_NORMAL)
+
+#define CONFIG_SYS_DDRCDR (\
+ DDRCDR_EN | \
+ DDRCDR_PZ_MAXZ | \
+ DDRCDR_NZ_MAXZ | \
+ DDRCDR_M_ODR)
+
+#define CONFIG_SYS_DDR_CS0_BNDS 0x0000007f
+#define CONFIG_SYS_DDR_SDRAM_CFG (SDRAM_CFG_SDRAM_TYPE_DDR2 | \
+ SDRAM_CFG_32_BE | \
+ SDRAM_CFG_SREN | \
+ SDRAM_CFG_HSE)
+
+#define CONFIG_SYS_DDR_SDRAM_CFG2 0x00401000
+#define CONFIG_SYS_DDR_CLK_CNTL (DDR_SDRAM_CLK_CNTL_CLK_ADJUST_05)
+#define CONFIG_SYS_DDR_INTERVAL ((0x064 << SDRAM_INTERVAL_BSTOPRE_SHIFT) | \
+ (0x200 << SDRAM_INTERVAL_REFINT_SHIFT))
+
+#define CONFIG_SYS_DDR_CS0_CONFIG (CSCONFIG_EN | CSCONFIG_AP | \
+ CSCONFIG_ODT_WR_CFG | \
+ CSCONFIG_ROW_BIT_13 | \
+ CSCONFIG_COL_BIT_10)
+
+#define CONFIG_SYS_DDR_MODE 0x47860242
+#define CONFIG_SYS_DDR_MODE2 0x8080c000
+
+#define CONFIG_SYS_DDR_TIMING_0 ((2 << TIMING_CFG0_MRS_CYC_SHIFT) | \
+ (8 << TIMING_CFG0_ODT_PD_EXIT_SHIFT) | \
+ (2 << TIMING_CFG0_PRE_PD_EXIT_SHIFT) | \
+ (2 << TIMING_CFG0_ACT_PD_EXIT_SHIFT) | \
+ (0 << TIMING_CFG0_WWT_SHIFT) | \
+ (0 << TIMING_CFG0_RRT_SHIFT) | \
+ (0 << TIMING_CFG0_WRT_SHIFT) | \
+ (0 << TIMING_CFG0_RWT_SHIFT))
+
+#define CONFIG_SYS_DDR_TIMING_1 ((TIMING_CFG1_CASLAT_40) | \
+ (2 << TIMING_CFG1_WRTORD_SHIFT) | \
+ (2 << TIMING_CFG1_ACTTOACT_SHIFT) | \
+ (3 << TIMING_CFG1_WRREC_SHIFT) | \
+ (7 << TIMING_CFG1_REFREC_SHIFT) | \
+ (3 << TIMING_CFG1_ACTTORW_SHIFT) | \
+ (7 << TIMING_CFG1_ACTTOPRE_SHIFT) | \
+ (3 << TIMING_CFG1_PRETOACT_SHIFT))
+
+#define CONFIG_SYS_DDR_TIMING_2 ((8 << TIMING_CFG2_FOUR_ACT_SHIFT) | \
+ (3 << TIMING_CFG2_CKE_PLS_SHIFT) | \
+ (2 << TIMING_CFG2_WR_DATA_DELAY_SHIFT) | \
+ (2 << TIMING_CFG2_RD_TO_PRE_SHIFT) | \
+ (3 << TIMING_CFG2_WR_LAT_DELAY_SHIFT) | \
+ (0 << TIMING_CFG2_ADD_LAT_SHIFT) | \
+ (5 << TIMING_CFG2_CPO_SHIFT))
+
+#define CONFIG_SYS_DDR_TIMING_3 0x00000000
+
+#define CONFIG_SYS_KMBEC_FPGA_BASE 0xE8000000
+#define CONFIG_SYS_KMBEC_FPGA_SIZE 128
+
+/* EEprom support */
+#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
+
+/*
+ * Local Bus Configuration & Clock Setup
+ */
+#define CONFIG_SYS_LCRR_DBYP 0x80000000
+#define CONFIG_SYS_LCRR_EADC 0x00010000
+#define CONFIG_SYS_LCRR_CLKDIV 0x00000002
+
+#define CONFIG_SYS_LBC_LBCR 0x00000000
+
+/*
+ * MMU Setup
+ */
+#define CONFIG_SYS_IBAT7L (0)
+#define CONFIG_SYS_IBAT7U (0)
+#define CONFIG_SYS_DBAT7L CONFIG_SYS_IBAT7L
+#define CONFIG_SYS_DBAT7U CONFIG_SYS_IBAT7U
+
+#define CONFIG_SYS_APP1_BASE 0xA0000000    /* PAXG */
+#define CONFIG_SYS_APP1_SIZE 256 /* Megabytes */
+#if defined(CONFIG_TARGET_TUXX1) || defined(CONFIG_TARGET_KMOPTI2) || defined(CONFIG_TARGET_KMTEPR2)
+#define CONFIG_SYS_APP2_BASE 0xB0000000    /* PINC3 */
+#define CONFIG_SYS_APP2_SIZE 256 /* Megabytes */
+#endif
+
+/*
+ * Init Local Bus Memory Controller:
+ *      Device on board
+ * Bank Bus     Machine PortSz Size   TUDA1  TUXA1  TUGE1   KMSUPX4 KMOPTI2
+ * -----------------------------------------------------------------------------
+ *  2   Local   GPCM    8 bit  256MB  PAXG   LPXF   PAXI    LPXF    PAXE
+ *  3   Local   GPCM    8 bit  256MB  PINC3  PINC2  unused  unused  OPI2(16 bit)
+ *
+ *      Device on board (continued)
+ * Bank Bus     Machine PortSz Size   KMTEPR2
+ * -----------------------------------------------------------------------------
+ *  2   Local   GPCM    8 bit  256MB  NVRAM
+ *  3   Local   GPCM    8 bit  256MB  TEP2 (16 bit)
+ */
+
+#if defined(CONFIG_KMTEPRO2)
+/*
+ * Configuration for C2 (NVRAM) on the local bus
+ */
+#define CONFIG_SYS_LBLAWBAR2_PRELIM    CONFIG_SYS_APP1_BASE
+#define CONFIG_SYS_LBLAWAR2_PRELIM     (LBLAWAR_EN | LBLAWAR_256MB)
+#define CONFIG_SYS_BR2_PRELIM  (CONFIG_SYS_APP1_BASE | \
+ BR_PS_8 | \
+ BR_MS_GPCM | \
+ BR_V)
+#define CONFIG_SYS_OR2_PRELIM  (MEG_TO_AM(CONFIG_SYS_APP1_SIZE) | \
+ OR_GPCM_CSNT | \
+ OR_GPCM_ACS_DIV2 | \
+ OR_GPCM_XACS | \
+ OR_GPCM_SCY_2 | \
+ OR_GPCM_TRLX_SET | \
+ OR_GPCM_EHTR_SET | \
+ OR_GPCM_EAD)
+#else
+/*
+ * Configuration for C2 on the local bus
+ */
+/* Window base at flash base */
+#define CONFIG_SYS_LBLAWBAR2_PRELIM CONFIG_SYS_APP1_BASE
+/* Window size: 256 MB */
+#define CONFIG_SYS_LBLAWAR2_PRELIM (LBLAWAR_EN | LBLAWAR_256MB)
+
+#define CONFIG_SYS_BR2_PRELIM (CONFIG_SYS_APP1_BASE | \
+ BR_PS_8 | \
+ BR_MS_GPCM | \
+ BR_V)
+
+#define CONFIG_SYS_OR2_PRELIM (MEG_TO_AM(CONFIG_SYS_APP1_SIZE) | \
+ OR_GPCM_CSNT | \
+ OR_GPCM_ACS_DIV4 | \
+ OR_GPCM_SCY_2 | \
+ OR_GPCM_TRLX_SET | \
+ OR_GPCM_EHTR_CLEAR | \
+ OR_GPCM_EAD)
+#endif
+
+#if defined(CONFIG_TARGET_TUXX1)
+/*
+ * Configuration for C3 on the local bus
+ */
+/* Access window base at PINC3 base */
+#define CONFIG_SYS_LBLAWBAR3_PRELIM CONFIG_SYS_APP2_BASE
+/* Window size: 256 MB */
+#define CONFIG_SYS_LBLAWAR3_PRELIM (LBLAWAR_EN | LBLAWAR_256MB)
+
+#define CONFIG_SYS_BR3_PRELIM (CONFIG_SYS_APP2_BASE | \
+ BR_PS_8 | \
+ BR_MS_GPCM | \
+ BR_V)
+
+#define CONFIG_SYS_OR3_PRELIM (MEG_TO_AM(CONFIG_SYS_APP2_SIZE) | \
+ OR_GPCM_CSNT | \
+ OR_GPCM_ACS_DIV2 | \
+ OR_GPCM_SCY_2 | \
+ OR_GPCM_TRLX_SET | \
+ OR_GPCM_EHTR_CLEAR)
+
+#define CONFIG_SYS_MAMR (MxMR_GPL_x4DIS | \
+ 0x0000c000 | \
+ MxMR_WLFx_2X)
+#endif
+
+#if defined(CONFIG_TARGET_KMOPTI2) || defined(CONFIG_TARGET_KMTEPR2)
+/*
+ * Configuration for C3 on the local bus
+ */
+#define CONFIG_SYS_LBLAWBAR3_PRELIM CONFIG_SYS_APP2_BASE
+#define CONFIG_SYS_LBLAWAR3_PRELIM (LBLAWAR_EN | LBLAWAR_256MB)
+#define CONFIG_SYS_BR3_PRELIM (CONFIG_SYS_APP2_BASE | \
+ BR_PS_16 | \
+ BR_MS_GPCM | \
+ BR_V)
+#define CONFIG_SYS_OR3_PRELIM (MEG_TO_AM(CONFIG_SYS_APP2_SIZE) | \
+ OR_GPCM_SCY_4 | \
+ OR_GPCM_TRLX_CLEAR | \
+ OR_GPCM_EHTR_CLEAR)
+#endif
+
+/*
+ * MMU Setup
+ */
+/* APP1: icache cacheable, but dcache-inhibit and guarded */
+#define CONFIG_SYS_IBAT5L (CONFIG_SYS_APP1_BASE | \
+ BATL_PP_RW | \
+ BATL_MEMCOHERENCE)
+/* 512M should also include APP2... */
+#define CONFIG_SYS_IBAT5U (CONFIG_SYS_APP1_BASE | \
+ BATU_BL_256M | \
+ BATU_VS | \
+ BATU_VP)
+#define CONFIG_SYS_DBAT5L (CONFIG_SYS_APP1_BASE | \
+ BATL_PP_RW | \
+ BATL_CACHEINHIBIT | \
+ BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_DBAT5U CONFIG_SYS_IBAT5U
+
+#if defined(CONFIG_TARGET_TUGE1) || defined(CONFIG_TARGET_KMSUPX5)
+#define CONFIG_SYS_IBAT6L (0)
+#define CONFIG_SYS_IBAT6U (0)
+#define CONFIG_SYS_DBAT6L CONFIG_SYS_IBAT6L
+#else
+/* APP2:  icache cacheable, but dcache-inhibit and guarded */
+#define CONFIG_SYS_IBAT6L (CONFIG_SYS_APP2_BASE | \
+ BATL_PP_RW | \
+ BATL_MEMCOHERENCE)
+#define CONFIG_SYS_IBAT6U (CONFIG_SYS_APP2_BASE | \
+ BATU_BL_256M | \
+ BATU_VS | \
+ BATU_VP)
+#define CONFIG_SYS_DBAT6L (CONFIG_SYS_APP2_BASE | \
+ BATL_PP_RW | \
+ BATL_CACHEINHIBIT | \
+ BATL_GUARDEDSTORAGE)
+#endif
+#define CONFIG_SYS_DBAT6U CONFIG_SYS_IBAT6U
+
+#define CONFIG_SYS_IBAT7L (0)
+#define CONFIG_SYS_IBAT7U (0)
+#define CONFIG_SYS_DBAT7L CONFIG_SYS_IBAT7L
+#define CONFIG_SYS_DBAT7U CONFIG_SYS_IBAT7U
+
+#endif /* __CONFIG_H */
diff --git a/include/configs/kmtepr2.h b/include/configs/kmtepr2.h
new file mode 100644
index 0000000000..64d6f21514
--- /dev/null
+++ b/include/configs/kmtepr2.h
@@ -0,0 +1,307 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2006 Freescale Semiconductor, Inc.
+ *                    Dave Liu <[hidden email]>
+ *
+ * Copyright (C) 2007 Logic Product Development, Inc.
+ *                    Peter Barada <[hidden email]>
+ *
+ * Copyright (C) 2007 MontaVista Software, Inc.
+ *                    Anton Vorontsov <[hidden email]>
+ *
+ * (C) Copyright 2008
+ * Heiko Schocher, DENX Software Engineering, [hidden email].
+ *
+ * (C) Copyright 2010-2013
+ * Lukas Roggli, KEYMILE Ltd, [hidden email]
+ * Holger Brunck,  Keymile GmbH, [hidden email]
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+/*
+ * High Level Configuration Options
+ */
+#if defined(CONFIG_TARGET_KMSUPX5)
+#define CONFIG_KM_BOARD_NAME "kmsupx5"
+#define CONFIG_HOSTNAME "kmsupx5"
+#elif defined(CONFIG_TARGET_TUGE1)
+#define CONFIG_KM_BOARD_NAME "tuge1"
+#define CONFIG_HOSTNAME "tuge1"
+#elif defined(CONFIG_TARGET_TUXX1) /* TUXX1 board (tuxa1/tuda1) specific */
+#define CONFIG_KM_BOARD_NAME "tuxx1"
+#define CONFIG_HOSTNAME "tuxx1"
+#elif defined(CONFIG_TARGET_KMOPTI2)
+#define CONFIG_KM_BOARD_NAME "kmopti2"
+#define CONFIG_HOSTNAME "kmopti2"
+#elif defined(CONFIG_TARGET_KMTEPR2)
+#define CONFIG_KM_BOARD_NAME    "kmtepr2"
+#define CONFIG_HOSTNAME         "kmtepr2"
+#else
+#error ("Board not supported")
+#endif
+
+/*
+ * High Level Configuration Options
+ */
+#define CONFIG_QE /* Has QE */
+#define CONFIG_KM8321 /* Keymile PBEC8321 board specific */
+
+#define CONFIG_KM_DEF_ARCH "arch=ppc_8xx\0"
+
+/* include common defines/options for all 83xx Keymile boards */
+#include "km83xx-common.h"
+
+/*
+ * System IO Config
+ */
+#define CONFIG_SYS_SICRL SICRL_IRQ_CKS
+
+/*
+ * Hardware Reset Configuration Word
+ */
+#define CONFIG_SYS_HRCW_LOW (\
+ HRCWL_LCL_BUS_TO_SCB_CLK_1X1 | \
+ HRCWL_DDR_TO_SCB_CLK_2X1 | \
+ HRCWL_CSB_TO_CLKIN_2X1 | \
+ HRCWL_CORE_TO_CSB_2_5X1 | \
+ HRCWL_CE_PLL_VCO_DIV_2 | \
+ HRCWL_CE_TO_PLL_1X3)
+
+#define CONFIG_SYS_HRCW_HIGH (\
+ HRCWH_PCI_AGENT | \
+ HRCWH_PCI_ARBITER_DISABLE | \
+ HRCWH_CORE_ENABLE | \
+ HRCWH_FROM_0X00000100 | \
+ HRCWH_BOOTSEQ_DISABLE | \
+ HRCWH_SW_WATCHDOG_DISABLE | \
+ HRCWH_ROM_LOC_LOCAL_16BIT | \
+ HRCWH_BIG_ENDIAN | \
+ HRCWH_LALE_NORMAL)
+
+#define CONFIG_SYS_DDRCDR (\
+ DDRCDR_EN | \
+ DDRCDR_PZ_MAXZ | \
+ DDRCDR_NZ_MAXZ | \
+ DDRCDR_M_ODR)
+
+#define CONFIG_SYS_DDR_CS0_BNDS 0x0000007f
+#define CONFIG_SYS_DDR_SDRAM_CFG (SDRAM_CFG_SDRAM_TYPE_DDR2 | \
+ SDRAM_CFG_32_BE | \
+ SDRAM_CFG_SREN | \
+ SDRAM_CFG_HSE)
+
+#define CONFIG_SYS_DDR_SDRAM_CFG2 0x00401000
+#define CONFIG_SYS_DDR_CLK_CNTL (DDR_SDRAM_CLK_CNTL_CLK_ADJUST_05)
+#define CONFIG_SYS_DDR_INTERVAL ((0x064 << SDRAM_INTERVAL_BSTOPRE_SHIFT) | \
+ (0x200 << SDRAM_INTERVAL_REFINT_SHIFT))
+
+#define CONFIG_SYS_DDR_CS0_CONFIG (CSCONFIG_EN | CSCONFIG_AP | \
+ CSCONFIG_ODT_WR_CFG | \
+ CSCONFIG_ROW_BIT_13 | \
+ CSCONFIG_COL_BIT_10)
+
+#define CONFIG_SYS_DDR_MODE 0x47860242
+#define CONFIG_SYS_DDR_MODE2 0x8080c000
+
+#define CONFIG_SYS_DDR_TIMING_0 ((2 << TIMING_CFG0_MRS_CYC_SHIFT) | \
+ (8 << TIMING_CFG0_ODT_PD_EXIT_SHIFT) | \
+ (2 << TIMING_CFG0_PRE_PD_EXIT_SHIFT) | \
+ (2 << TIMING_CFG0_ACT_PD_EXIT_SHIFT) | \
+ (0 << TIMING_CFG0_WWT_SHIFT) | \
+ (0 << TIMING_CFG0_RRT_SHIFT) | \
+ (0 << TIMING_CFG0_WRT_SHIFT) | \
+ (0 << TIMING_CFG0_RWT_SHIFT))
+
+#define CONFIG_SYS_DDR_TIMING_1 ((TIMING_CFG1_CASLAT_40) | \
+ (2 << TIMING_CFG1_WRTORD_SHIFT) | \
+ (2 << TIMING_CFG1_ACTTOACT_SHIFT) | \
+ (3 << TIMING_CFG1_WRREC_SHIFT) | \
+ (7 << TIMING_CFG1_REFREC_SHIFT) | \
+ (3 << TIMING_CFG1_ACTTORW_SHIFT) | \
+ (7 << TIMING_CFG1_ACTTOPRE_SHIFT) | \
+ (3 << TIMING_CFG1_PRETOACT_SHIFT))
+
+#define CONFIG_SYS_DDR_TIMING_2 ((8 << TIMING_CFG2_FOUR_ACT_SHIFT) | \
+ (3 << TIMING_CFG2_CKE_PLS_SHIFT) | \
+ (2 << TIMING_CFG2_WR_DATA_DELAY_SHIFT) | \
+ (2 << TIMING_CFG2_RD_TO_PRE_SHIFT) | \
+ (3 << TIMING_CFG2_WR_LAT_DELAY_SHIFT) | \
+ (0 << TIMING_CFG2_ADD_LAT_SHIFT) | \
+ (5 << TIMING_CFG2_CPO_SHIFT))
+
+#define CONFIG_SYS_DDR_TIMING_3 0x00000000
+
+#define CONFIG_SYS_KMBEC_FPGA_BASE 0xE8000000
+#define CONFIG_SYS_KMBEC_FPGA_SIZE 128
+
+/* EEprom support */
+#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
+
+/*
+ * Local Bus Configuration & Clock Setup
+ */
+#define CONFIG_SYS_LCRR_DBYP 0x80000000
+#define CONFIG_SYS_LCRR_EADC 0x00010000
+#define CONFIG_SYS_LCRR_CLKDIV 0x00000002
+
+#define CONFIG_SYS_LBC_LBCR 0x00000000
+
+/*
+ * MMU Setup
+ */
+#define CONFIG_SYS_IBAT7L (0)
+#define CONFIG_SYS_IBAT7U (0)
+#define CONFIG_SYS_DBAT7L CONFIG_SYS_IBAT7L
+#define CONFIG_SYS_DBAT7U CONFIG_SYS_IBAT7U
+
+#define CONFIG_SYS_APP1_BASE 0xA0000000    /* PAXG */
+#define CONFIG_SYS_APP1_SIZE 256 /* Megabytes */
+#if defined(CONFIG_TARGET_TUXX1) || defined(CONFIG_TARGET_KMOPTI2) || defined(CONFIG_TARGET_KMTEPR2)
+#define CONFIG_SYS_APP2_BASE 0xB0000000    /* PINC3 */
+#define CONFIG_SYS_APP2_SIZE 256 /* Megabytes */
+#endif
+
+/*
+ * Init Local Bus Memory Controller:
+ *      Device on board
+ * Bank Bus     Machine PortSz Size   TUDA1  TUXA1  TUGE1   KMSUPX4 KMOPTI2
+ * -----------------------------------------------------------------------------
+ *  2   Local   GPCM    8 bit  256MB  PAXG   LPXF   PAXI    LPXF    PAXE
+ *  3   Local   GPCM    8 bit  256MB  PINC3  PINC2  unused  unused  OPI2(16 bit)
+ *
+ *      Device on board (continued)
+ * Bank Bus     Machine PortSz Size   KMTEPR2
+ * -----------------------------------------------------------------------------
+ *  2   Local   GPCM    8 bit  256MB  NVRAM
+ *  3   Local   GPCM    8 bit  256MB  TEP2 (16 bit)
+ */
+
+#if defined(CONFIG_KMTEPRO2)
+/*
+ * Configuration for C2 (NVRAM) on the local bus
+ */
+#define CONFIG_SYS_LBLAWBAR2_PRELIM    CONFIG_SYS_APP1_BASE
+#define CONFIG_SYS_LBLAWAR2_PRELIM     (LBLAWAR_EN | LBLAWAR_256MB)
+#define CONFIG_SYS_BR2_PRELIM  (CONFIG_SYS_APP1_BASE | \
+ BR_PS_8 | \
+ BR_MS_GPCM | \
+ BR_V)
+#define CONFIG_SYS_OR2_PRELIM  (MEG_TO_AM(CONFIG_SYS_APP1_SIZE) | \
+ OR_GPCM_CSNT | \
+ OR_GPCM_ACS_DIV2 | \
+ OR_GPCM_XACS | \
+ OR_GPCM_SCY_2 | \
+ OR_GPCM_TRLX_SET | \
+ OR_GPCM_EHTR_SET | \
+ OR_GPCM_EAD)
+#else
+/*
+ * Configuration for C2 on the local bus
+ */
+/* Window base at flash base */
+#define CONFIG_SYS_LBLAWBAR2_PRELIM CONFIG_SYS_APP1_BASE
+/* Window size: 256 MB */
+#define CONFIG_SYS_LBLAWAR2_PRELIM (LBLAWAR_EN | LBLAWAR_256MB)
+
+#define CONFIG_SYS_BR2_PRELIM (CONFIG_SYS_APP1_BASE | \
+ BR_PS_8 | \
+ BR_MS_GPCM | \
+ BR_V)
+
+#define CONFIG_SYS_OR2_PRELIM (MEG_TO_AM(CONFIG_SYS_APP1_SIZE) | \
+ OR_GPCM_CSNT | \
+ OR_GPCM_ACS_DIV4 | \
+ OR_GPCM_SCY_2 | \
+ OR_GPCM_TRLX_SET | \
+ OR_GPCM_EHTR_CLEAR | \
+ OR_GPCM_EAD)
+#endif
+
+#if defined(CONFIG_TARGET_TUXX1)
+/*
+ * Configuration for C3 on the local bus
+ */
+/* Access window base at PINC3 base */
+#define CONFIG_SYS_LBLAWBAR3_PRELIM CONFIG_SYS_APP2_BASE
+/* Window size: 256 MB */
+#define CONFIG_SYS_LBLAWAR3_PRELIM (LBLAWAR_EN | LBLAWAR_256MB)
+
+#define CONFIG_SYS_BR3_PRELIM (CONFIG_SYS_APP2_BASE | \
+ BR_PS_8 | \
+ BR_MS_GPCM | \
+ BR_V)
+
+#define CONFIG_SYS_OR3_PRELIM (MEG_TO_AM(CONFIG_SYS_APP2_SIZE) | \
+ OR_GPCM_CSNT | \
+ OR_GPCM_ACS_DIV2 | \
+ OR_GPCM_SCY_2 | \
+ OR_GPCM_TRLX_SET | \
+ OR_GPCM_EHTR_CLEAR)
+
+#define CONFIG_SYS_MAMR (MxMR_GPL_x4DIS | \
+ 0x0000c000 | \
+ MxMR_WLFx_2X)
+#endif
+
+#if defined(CONFIG_TARGET_KMOPTI2) || defined(CONFIG_TARGET_KMTEPR2)
+/*
+ * Configuration for C3 on the local bus
+ */
+#define CONFIG_SYS_LBLAWBAR3_PRELIM CONFIG_SYS_APP2_BASE
+#define CONFIG_SYS_LBLAWAR3_PRELIM (LBLAWAR_EN | LBLAWAR_256MB)
+#define CONFIG_SYS_BR3_PRELIM (CONFIG_SYS_APP2_BASE | \
+ BR_PS_16 | \
+ BR_MS_GPCM | \
+ BR_V)
+#define CONFIG_SYS_OR3_PRELIM (MEG_TO_AM(CONFIG_SYS_APP2_SIZE) | \
+ OR_GPCM_SCY_4 | \
+ OR_GPCM_TRLX_CLEAR | \
+ OR_GPCM_EHTR_CLEAR)
+#endif
+
+/*
+ * MMU Setup
+ */
+/* APP1: icache cacheable, but dcache-inhibit and guarded */
+#define CONFIG_SYS_IBAT5L (CONFIG_SYS_APP1_BASE | \
+ BATL_PP_RW | \
+ BATL_MEMCOHERENCE)
+/* 512M should also include APP2... */
+#define CONFIG_SYS_IBAT5U (CONFIG_SYS_APP1_BASE | \
+ BATU_BL_256M | \
+ BATU_VS | \
+ BATU_VP)
+#define CONFIG_SYS_DBAT5L (CONFIG_SYS_APP1_BASE | \
+ BATL_PP_RW | \
+ BATL_CACHEINHIBIT | \
+ BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_DBAT5U CONFIG_SYS_IBAT5U
+
+#if defined(CONFIG_TARGET_TUGE1) || defined(CONFIG_TARGET_KMSUPX5)
+#define CONFIG_SYS_IBAT6L (0)
+#define CONFIG_SYS_IBAT6U (0)
+#define CONFIG_SYS_DBAT6L CONFIG_SYS_IBAT6L
+#else
+/* APP2:  icache cacheable, but dcache-inhibit and guarded */
+#define CONFIG_SYS_IBAT6L (CONFIG_SYS_APP2_BASE | \
+ BATL_PP_RW | \
+ BATL_MEMCOHERENCE)
+#define CONFIG_SYS_IBAT6U (CONFIG_SYS_APP2_BASE | \
+ BATU_BL_256M | \
+ BATU_VS | \
+ BATU_VP)
+#define CONFIG_SYS_DBAT6L (CONFIG_SYS_APP2_BASE | \
+ BATL_PP_RW | \
+ BATL_CACHEINHIBIT | \
+ BATL_GUARDEDSTORAGE)
+#endif
+#define CONFIG_SYS_DBAT6U CONFIG_SYS_IBAT6U
+
+#define CONFIG_SYS_IBAT7L (0)
+#define CONFIG_SYS_IBAT7U (0)
+#define CONFIG_SYS_DBAT7L CONFIG_SYS_IBAT7L
+#define CONFIG_SYS_DBAT7U CONFIG_SYS_IBAT7U
+
+#endif /* __CONFIG_H */
diff --git a/include/configs/tuge1.h b/include/configs/tuge1.h
new file mode 100644
index 0000000000..64d6f21514
--- /dev/null
+++ b/include/configs/tuge1.h
@@ -0,0 +1,307 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2006 Freescale Semiconductor, Inc.
+ *                    Dave Liu <[hidden email]>
+ *
+ * Copyright (C) 2007 Logic Product Development, Inc.
+ *                    Peter Barada <[hidden email]>
+ *
+ * Copyright (C) 2007 MontaVista Software, Inc.
+ *                    Anton Vorontsov <[hidden email]>
+ *
+ * (C) Copyright 2008
+ * Heiko Schocher, DENX Software Engineering, [hidden email].
+ *
+ * (C) Copyright 2010-2013
+ * Lukas Roggli, KEYMILE Ltd, [hidden email]
+ * Holger Brunck,  Keymile GmbH, [hidden email]
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+/*
+ * High Level Configuration Options
+ */
+#if defined(CONFIG_TARGET_KMSUPX5)
+#define CONFIG_KM_BOARD_NAME "kmsupx5"
+#define CONFIG_HOSTNAME "kmsupx5"
+#elif defined(CONFIG_TARGET_TUGE1)
+#define CONFIG_KM_BOARD_NAME "tuge1"
+#define CONFIG_HOSTNAME "tuge1"
+#elif defined(CONFIG_TARGET_TUXX1) /* TUXX1 board (tuxa1/tuda1) specific */
+#define CONFIG_KM_BOARD_NAME "tuxx1"
+#define CONFIG_HOSTNAME "tuxx1"
+#elif defined(CONFIG_TARGET_KMOPTI2)
+#define CONFIG_KM_BOARD_NAME "kmopti2"
+#define CONFIG_HOSTNAME "kmopti2"
+#elif defined(CONFIG_TARGET_KMTEPR2)
+#define CONFIG_KM_BOARD_NAME    "kmtepr2"
+#define CONFIG_HOSTNAME         "kmtepr2"
+#else
+#error ("Board not supported")
+#endif
+
+/*
+ * High Level Configuration Options
+ */
+#define CONFIG_QE /* Has QE */
+#define CONFIG_KM8321 /* Keymile PBEC8321 board specific */
+
+#define CONFIG_KM_DEF_ARCH "arch=ppc_8xx\0"
+
+/* include common defines/options for all 83xx Keymile boards */
+#include "km83xx-common.h"
+
+/*
+ * System IO Config
+ */
+#define CONFIG_SYS_SICRL SICRL_IRQ_CKS
+
+/*
+ * Hardware Reset Configuration Word
+ */
+#define CONFIG_SYS_HRCW_LOW (\
+ HRCWL_LCL_BUS_TO_SCB_CLK_1X1 | \
+ HRCWL_DDR_TO_SCB_CLK_2X1 | \
+ HRCWL_CSB_TO_CLKIN_2X1 | \
+ HRCWL_CORE_TO_CSB_2_5X1 | \
+ HRCWL_CE_PLL_VCO_DIV_2 | \
+ HRCWL_CE_TO_PLL_1X3)
+
+#define CONFIG_SYS_HRCW_HIGH (\
+ HRCWH_PCI_AGENT | \
+ HRCWH_PCI_ARBITER_DISABLE | \
+ HRCWH_CORE_ENABLE | \
+ HRCWH_FROM_0X00000100 | \
+ HRCWH_BOOTSEQ_DISABLE | \
+ HRCWH_SW_WATCHDOG_DISABLE | \
+ HRCWH_ROM_LOC_LOCAL_16BIT | \
+ HRCWH_BIG_ENDIAN | \
+ HRCWH_LALE_NORMAL)
+
+#define CONFIG_SYS_DDRCDR (\
+ DDRCDR_EN | \
+ DDRCDR_PZ_MAXZ | \
+ DDRCDR_NZ_MAXZ | \
+ DDRCDR_M_ODR)
+
+#define CONFIG_SYS_DDR_CS0_BNDS 0x0000007f
+#define CONFIG_SYS_DDR_SDRAM_CFG (SDRAM_CFG_SDRAM_TYPE_DDR2 | \
+ SDRAM_CFG_32_BE | \
+ SDRAM_CFG_SREN | \
+ SDRAM_CFG_HSE)
+
+#define CONFIG_SYS_DDR_SDRAM_CFG2 0x00401000
+#define CONFIG_SYS_DDR_CLK_CNTL (DDR_SDRAM_CLK_CNTL_CLK_ADJUST_05)
+#define CONFIG_SYS_DDR_INTERVAL ((0x064 << SDRAM_INTERVAL_BSTOPRE_SHIFT) | \
+ (0x200 << SDRAM_INTERVAL_REFINT_SHIFT))
+
+#define CONFIG_SYS_DDR_CS0_CONFIG (CSCONFIG_EN | CSCONFIG_AP | \
+ CSCONFIG_ODT_WR_CFG | \
+ CSCONFIG_ROW_BIT_13 | \
+ CSCONFIG_COL_BIT_10)
+
+#define CONFIG_SYS_DDR_MODE 0x47860242
+#define CONFIG_SYS_DDR_MODE2 0x8080c000
+
+#define CONFIG_SYS_DDR_TIMING_0 ((2 << TIMING_CFG0_MRS_CYC_SHIFT) | \
+ (8 << TIMING_CFG0_ODT_PD_EXIT_SHIFT) | \
+ (2 << TIMING_CFG0_PRE_PD_EXIT_SHIFT) | \
+ (2 << TIMING_CFG0_ACT_PD_EXIT_SHIFT) | \
+ (0 << TIMING_CFG0_WWT_SHIFT) | \
+ (0 << TIMING_CFG0_RRT_SHIFT) | \
+ (0 << TIMING_CFG0_WRT_SHIFT) | \
+ (0 << TIMING_CFG0_RWT_SHIFT))
+
+#define CONFIG_SYS_DDR_TIMING_1 ((TIMING_CFG1_CASLAT_40) | \
+ (2 << TIMING_CFG1_WRTORD_SHIFT) | \
+ (2 << TIMING_CFG1_ACTTOACT_SHIFT) | \
+ (3 << TIMING_CFG1_WRREC_SHIFT) | \
+ (7 << TIMING_CFG1_REFREC_SHIFT) | \
+ (3 << TIMING_CFG1_ACTTORW_SHIFT) | \
+ (7 << TIMING_CFG1_ACTTOPRE_SHIFT) | \
+ (3 << TIMING_CFG1_PRETOACT_SHIFT))
+
+#define CONFIG_SYS_DDR_TIMING_2 ((8 << TIMING_CFG2_FOUR_ACT_SHIFT) | \
+ (3 << TIMING_CFG2_CKE_PLS_SHIFT) | \
+ (2 << TIMING_CFG2_WR_DATA_DELAY_SHIFT) | \
+ (2 << TIMING_CFG2_RD_TO_PRE_SHIFT) | \
+ (3 << TIMING_CFG2_WR_LAT_DELAY_SHIFT) | \
+ (0 << TIMING_CFG2_ADD_LAT_SHIFT) | \
+ (5 << TIMING_CFG2_CPO_SHIFT))
+
+#define CONFIG_SYS_DDR_TIMING_3 0x00000000
+
+#define CONFIG_SYS_KMBEC_FPGA_BASE 0xE8000000
+#define CONFIG_SYS_KMBEC_FPGA_SIZE 128
+
+/* EEprom support */
+#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
+
+/*
+ * Local Bus Configuration & Clock Setup
+ */
+#define CONFIG_SYS_LCRR_DBYP 0x80000000
+#define CONFIG_SYS_LCRR_EADC 0x00010000
+#define CONFIG_SYS_LCRR_CLKDIV 0x00000002
+
+#define CONFIG_SYS_LBC_LBCR 0x00000000
+
+/*
+ * MMU Setup
+ */
+#define CONFIG_SYS_IBAT7L (0)
+#define CONFIG_SYS_IBAT7U (0)
+#define CONFIG_SYS_DBAT7L CONFIG_SYS_IBAT7L
+#define CONFIG_SYS_DBAT7U CONFIG_SYS_IBAT7U
+
+#define CONFIG_SYS_APP1_BASE 0xA0000000    /* PAXG */
+#define CONFIG_SYS_APP1_SIZE 256 /* Megabytes */
+#if defined(CONFIG_TARGET_TUXX1) || defined(CONFIG_TARGET_KMOPTI2) || defined(CONFIG_TARGET_KMTEPR2)
+#define CONFIG_SYS_APP2_BASE 0xB0000000    /* PINC3 */
+#define CONFIG_SYS_APP2_SIZE 256 /* Megabytes */
+#endif
+
+/*
+ * Init Local Bus Memory Controller:
+ *      Device on board
+ * Bank Bus     Machine PortSz Size   TUDA1  TUXA1  TUGE1   KMSUPX4 KMOPTI2
+ * -----------------------------------------------------------------------------
+ *  2   Local   GPCM    8 bit  256MB  PAXG   LPXF   PAXI    LPXF    PAXE
+ *  3   Local   GPCM    8 bit  256MB  PINC3  PINC2  unused  unused  OPI2(16 bit)
+ *
+ *      Device on board (continued)
+ * Bank Bus     Machine PortSz Size   KMTEPR2
+ * -----------------------------------------------------------------------------
+ *  2   Local   GPCM    8 bit  256MB  NVRAM
+ *  3   Local   GPCM    8 bit  256MB  TEP2 (16 bit)
+ */
+
+#if defined(CONFIG_KMTEPRO2)
+/*
+ * Configuration for C2 (NVRAM) on the local bus
+ */
+#define CONFIG_SYS_LBLAWBAR2_PRELIM    CONFIG_SYS_APP1_BASE
+#define CONFIG_SYS_LBLAWAR2_PRELIM     (LBLAWAR_EN | LBLAWAR_256MB)
+#define CONFIG_SYS_BR2_PRELIM  (CONFIG_SYS_APP1_BASE | \
+ BR_PS_8 | \
+ BR_MS_GPCM | \
+ BR_V)
+#define CONFIG_SYS_OR2_PRELIM  (MEG_TO_AM(CONFIG_SYS_APP1_SIZE) | \
+ OR_GPCM_CSNT | \
+ OR_GPCM_ACS_DIV2 | \
+ OR_GPCM_XACS | \
+ OR_GPCM_SCY_2 | \
+ OR_GPCM_TRLX_SET | \
+ OR_GPCM_EHTR_SET | \
+ OR_GPCM_EAD)
+#else
+/*
+ * Configuration for C2 on the local bus
+ */
+/* Window base at flash base */
+#define CONFIG_SYS_LBLAWBAR2_PRELIM CONFIG_SYS_APP1_BASE
+/* Window size: 256 MB */
+#define CONFIG_SYS_LBLAWAR2_PRELIM (LBLAWAR_EN | LBLAWAR_256MB)
+
+#define CONFIG_SYS_BR2_PRELIM (CONFIG_SYS_APP1_BASE | \
+ BR_PS_8 | \
+ BR_MS_GPCM | \
+ BR_V)
+
+#define CONFIG_SYS_OR2_PRELIM (MEG_TO_AM(CONFIG_SYS_APP1_SIZE) | \
+ OR_GPCM_CSNT | \
+ OR_GPCM_ACS_DIV4 | \
+ OR_GPCM_SCY_2 | \
+ OR_GPCM_TRLX_SET | \
+ OR_GPCM_EHTR_CLEAR | \
+ OR_GPCM_EAD)
+#endif
+
+#if defined(CONFIG_TARGET_TUXX1)
+/*
+ * Configuration for C3 on the local bus
+ */
+/* Access window base at PINC3 base */
+#define CONFIG_SYS_LBLAWBAR3_PRELIM CONFIG_SYS_APP2_BASE
+/* Window size: 256 MB */
+#define CONFIG_SYS_LBLAWAR3_PRELIM (LBLAWAR_EN | LBLAWAR_256MB)
+
+#define CONFIG_SYS_BR3_PRELIM (CONFIG_SYS_APP2_BASE | \
+ BR_PS_8 | \
+ BR_MS_GPCM | \
+ BR_V)
+
+#define CONFIG_SYS_OR3_PRELIM (MEG_TO_AM(CONFIG_SYS_APP2_SIZE) | \
+ OR_GPCM_CSNT | \
+ OR_GPCM_ACS_DIV2 | \
+ OR_GPCM_SCY_2 | \
+ OR_GPCM_TRLX_SET | \
+ OR_GPCM_EHTR_CLEAR)
+
+#define CONFIG_SYS_MAMR (MxMR_GPL_x4DIS | \
+ 0x0000c000 | \
+ MxMR_WLFx_2X)
+#endif
+
+#if defined(CONFIG_TARGET_KMOPTI2) || defined(CONFIG_TARGET_KMTEPR2)
+/*
+ * Configuration for C3 on the local bus
+ */
+#define CONFIG_SYS_LBLAWBAR3_PRELIM CONFIG_SYS_APP2_BASE
+#define CONFIG_SYS_LBLAWAR3_PRELIM (LBLAWAR_EN | LBLAWAR_256MB)
+#define CONFIG_SYS_BR3_PRELIM (CONFIG_SYS_APP2_BASE | \
+ BR_PS_16 | \
+ BR_MS_GPCM | \
+ BR_V)
+#define CONFIG_SYS_OR3_PRELIM (MEG_TO_AM(CONFIG_SYS_APP2_SIZE) | \
+ OR_GPCM_SCY_4 | \
+ OR_GPCM_TRLX_CLEAR | \
+ OR_GPCM_EHTR_CLEAR)
+#endif
+
+/*
+ * MMU Setup
+ */
+/* APP1: icache cacheable, but dcache-inhibit and guarded */
+#define CONFIG_SYS_IBAT5L (CONFIG_SYS_APP1_BASE | \
+ BATL_PP_RW | \
+ BATL_MEMCOHERENCE)
+/* 512M should also include APP2... */
+#define CONFIG_SYS_IBAT5U (CONFIG_SYS_APP1_BASE | \
+ BATU_BL_256M | \
+ BATU_VS | \
+ BATU_VP)
+#define CONFIG_SYS_DBAT5L (CONFIG_SYS_APP1_BASE | \
+ BATL_PP_RW | \
+ BATL_CACHEINHIBIT | \
+ BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_DBAT5U CONFIG_SYS_IBAT5U
+
+#if defined(CONFIG_TARGET_TUGE1) || defined(CONFIG_TARGET_KMSUPX5)
+#define CONFIG_SYS_IBAT6L (0)
+#define CONFIG_SYS_IBAT6U (0)
+#define CONFIG_SYS_DBAT6L CONFIG_SYS_IBAT6L
+#else
+/* APP2:  icache cacheable, but dcache-inhibit and guarded */
+#define CONFIG_SYS_IBAT6L (CONFIG_SYS_APP2_BASE | \
+ BATL_PP_RW | \
+ BATL_MEMCOHERENCE)
+#define CONFIG_SYS_IBAT6U (CONFIG_SYS_APP2_BASE | \
+ BATU_BL_256M | \
+ BATU_VS | \
+ BATU_VP)
+#define CONFIG_SYS_DBAT6L (CONFIG_SYS_APP2_BASE | \
+ BATL_PP_RW | \
+ BATL_CACHEINHIBIT | \
+ BATL_GUARDEDSTORAGE)
+#endif
+#define CONFIG_SYS_DBAT6U CONFIG_SYS_IBAT6U
+
+#define CONFIG_SYS_IBAT7L (0)
+#define CONFIG_SYS_IBAT7U (0)
+#define CONFIG_SYS_DBAT7L CONFIG_SYS_IBAT7L
+#define CONFIG_SYS_DBAT7U CONFIG_SYS_IBAT7U
+
+#endif /* __CONFIG_H */
diff --git a/include/configs/tuxx1.h b/include/configs/tuxx1.h
index c031661830..64d6f21514 100644
--- a/include/configs/tuxx1.h
+++ b/include/configs/tuxx1.h
@@ -23,19 +23,19 @@
 /*
  * High Level Configuration Options
  */
-#if defined(CONFIG_KMSUPX5)
+#if defined(CONFIG_TARGET_KMSUPX5)
 #define CONFIG_KM_BOARD_NAME "kmsupx5"
 #define CONFIG_HOSTNAME "kmsupx5"
-#elif defined(CONFIG_TUGE1)
+#elif defined(CONFIG_TARGET_TUGE1)
 #define CONFIG_KM_BOARD_NAME "tuge1"
 #define CONFIG_HOSTNAME "tuge1"
-#elif defined(CONFIG_TUXX1) /* TUXX1 board (tuxa1/tuda1) specific */
+#elif defined(CONFIG_TARGET_TUXX1) /* TUXX1 board (tuxa1/tuda1) specific */
 #define CONFIG_KM_BOARD_NAME "tuxx1"
 #define CONFIG_HOSTNAME "tuxx1"
-#elif defined(CONFIG_KMOPTI2)
+#elif defined(CONFIG_TARGET_KMOPTI2)
 #define CONFIG_KM_BOARD_NAME "kmopti2"
 #define CONFIG_HOSTNAME "kmopti2"
-#elif defined(CONFIG_KMTEPR2)
+#elif defined(CONFIG_TARGET_KMTEPR2)
 #define CONFIG_KM_BOARD_NAME    "kmtepr2"
 #define CONFIG_HOSTNAME         "kmtepr2"
 #else
@@ -158,7 +158,7 @@
 
 #define CONFIG_SYS_APP1_BASE 0xA0000000    /* PAXG */
 #define CONFIG_SYS_APP1_SIZE 256 /* Megabytes */
-#if defined(CONFIG_TUXX1) || defined(CONFIG_KMOPTI2) || defined(CONFIG_KMTEPR2)
+#if defined(CONFIG_TARGET_TUXX1) || defined(CONFIG_TARGET_KMOPTI2) || defined(CONFIG_TARGET_KMTEPR2)
 #define CONFIG_SYS_APP2_BASE 0xB0000000    /* PINC3 */
 #define CONFIG_SYS_APP2_SIZE 256 /* Megabytes */
 #endif
@@ -219,7 +219,7 @@
  OR_GPCM_EAD)
 #endif
 
-#if defined(CONFIG_TUXX1)
+#if defined(CONFIG_TARGET_TUXX1)
 /*
  * Configuration for C3 on the local bus
  */
@@ -245,7 +245,7 @@
  MxMR_WLFx_2X)
 #endif
 
-#if defined(CONFIG_KMOPTI2) || defined(CONFIG_KMTEPR2)
+#if defined(CONFIG_TARGET_KMOPTI2) || defined(CONFIG_TARGET_KMTEPR2)
 /*
  * Configuration for C3 on the local bus
  */
@@ -279,7 +279,7 @@
  BATL_GUARDEDSTORAGE)
 #define CONFIG_SYS_DBAT5U CONFIG_SYS_IBAT5U
 
-#if defined(CONFIG_TUGE1) || defined(CONFIG_KMSUPX5)
+#if defined(CONFIG_TARGET_TUGE1) || defined(CONFIG_TARGET_KMSUPX5)
 #define CONFIG_SYS_IBAT6L (0)
 #define CONFIG_SYS_IBAT6U (0)
 #define CONFIG_SYS_DBAT6L CONFIG_SYS_IBAT6L
--
2.16.4

_______________________________________________
U-Boot mailing list
[hidden email]
https://lists.denx.de/listinfo/u-boot
Reply | Threaded
Open this post in threaded view
|

[PATCH 13/48] keymile: Simplify kmsupx5, tuge1, kmopti2, and kmtepr2 configs

Mario Six
In reply to this post by Mario Six
Simplify the kmsupx5, tuge1, kmopti2, and kmtepr2 config files to only
include the #ifdefs needed for each board.

Signed-off-by: Mario Six <[hidden email]>
---
 include/configs/kmopti2.h | 73 -----------------------------------
 include/configs/kmsupx5.h | 97 -----------------------------------------------
 include/configs/kmtepr2.h | 72 -----------------------------------
 include/configs/tuge1.h   | 97 -----------------------------------------------
 include/configs/tuxx1.h   | 62 ------------------------------
 5 files changed, 401 deletions(-)

diff --git a/include/configs/kmopti2.h b/include/configs/kmopti2.h
index 64d6f21514..0621be3928 100644
--- a/include/configs/kmopti2.h
+++ b/include/configs/kmopti2.h
@@ -23,24 +23,8 @@
 /*
  * High Level Configuration Options
  */
-#if defined(CONFIG_TARGET_KMSUPX5)
-#define CONFIG_KM_BOARD_NAME "kmsupx5"
-#define CONFIG_HOSTNAME "kmsupx5"
-#elif defined(CONFIG_TARGET_TUGE1)
-#define CONFIG_KM_BOARD_NAME "tuge1"
-#define CONFIG_HOSTNAME "tuge1"
-#elif defined(CONFIG_TARGET_TUXX1) /* TUXX1 board (tuxa1/tuda1) specific */
-#define CONFIG_KM_BOARD_NAME "tuxx1"
-#define CONFIG_HOSTNAME "tuxx1"
-#elif defined(CONFIG_TARGET_KMOPTI2)
 #define CONFIG_KM_BOARD_NAME "kmopti2"
 #define CONFIG_HOSTNAME "kmopti2"
-#elif defined(CONFIG_TARGET_KMTEPR2)
-#define CONFIG_KM_BOARD_NAME    "kmtepr2"
-#define CONFIG_HOSTNAME         "kmtepr2"
-#else
-#error ("Board not supported")
-#endif
 
 /*
  * High Level Configuration Options
@@ -158,10 +142,8 @@
 
 #define CONFIG_SYS_APP1_BASE 0xA0000000    /* PAXG */
 #define CONFIG_SYS_APP1_SIZE 256 /* Megabytes */
-#if defined(CONFIG_TARGET_TUXX1) || defined(CONFIG_TARGET_KMOPTI2) || defined(CONFIG_TARGET_KMTEPR2)
 #define CONFIG_SYS_APP2_BASE 0xB0000000    /* PINC3 */
 #define CONFIG_SYS_APP2_SIZE 256 /* Megabytes */
-#endif
 
 /*
  * Init Local Bus Memory Controller:
@@ -178,25 +160,6 @@
  *  3   Local   GPCM    8 bit  256MB  TEP2 (16 bit)
  */
 
-#if defined(CONFIG_KMTEPRO2)
-/*
- * Configuration for C2 (NVRAM) on the local bus
- */
-#define CONFIG_SYS_LBLAWBAR2_PRELIM    CONFIG_SYS_APP1_BASE
-#define CONFIG_SYS_LBLAWAR2_PRELIM     (LBLAWAR_EN | LBLAWAR_256MB)
-#define CONFIG_SYS_BR2_PRELIM  (CONFIG_SYS_APP1_BASE | \
- BR_PS_8 | \
- BR_MS_GPCM | \
- BR_V)
-#define CONFIG_SYS_OR2_PRELIM  (MEG_TO_AM(CONFIG_SYS_APP1_SIZE) | \
- OR_GPCM_CSNT | \
- OR_GPCM_ACS_DIV2 | \
- OR_GPCM_XACS | \
- OR_GPCM_SCY_2 | \
- OR_GPCM_TRLX_SET | \
- OR_GPCM_EHTR_SET | \
- OR_GPCM_EAD)
-#else
 /*
  * Configuration for C2 on the local bus
  */
@@ -217,35 +180,7 @@
  OR_GPCM_TRLX_SET | \
  OR_GPCM_EHTR_CLEAR | \
  OR_GPCM_EAD)
-#endif
-
-#if defined(CONFIG_TARGET_TUXX1)
-/*
- * Configuration for C3 on the local bus
- */
-/* Access window base at PINC3 base */
-#define CONFIG_SYS_LBLAWBAR3_PRELIM CONFIG_SYS_APP2_BASE
-/* Window size: 256 MB */
-#define CONFIG_SYS_LBLAWAR3_PRELIM (LBLAWAR_EN | LBLAWAR_256MB)
-
-#define CONFIG_SYS_BR3_PRELIM (CONFIG_SYS_APP2_BASE | \
- BR_PS_8 | \
- BR_MS_GPCM | \
- BR_V)
-
-#define CONFIG_SYS_OR3_PRELIM (MEG_TO_AM(CONFIG_SYS_APP2_SIZE) | \
- OR_GPCM_CSNT | \
- OR_GPCM_ACS_DIV2 | \
- OR_GPCM_SCY_2 | \
- OR_GPCM_TRLX_SET | \
- OR_GPCM_EHTR_CLEAR)
 
-#define CONFIG_SYS_MAMR (MxMR_GPL_x4DIS | \
- 0x0000c000 | \
- MxMR_WLFx_2X)
-#endif
-
-#if defined(CONFIG_TARGET_KMOPTI2) || defined(CONFIG_TARGET_KMTEPR2)
 /*
  * Configuration for C3 on the local bus
  */
@@ -259,8 +194,6 @@
  OR_GPCM_SCY_4 | \
  OR_GPCM_TRLX_CLEAR | \
  OR_GPCM_EHTR_CLEAR)
-#endif
-
 /*
  * MMU Setup
  */
@@ -279,11 +212,6 @@
  BATL_GUARDEDSTORAGE)
 #define CONFIG_SYS_DBAT5U CONFIG_SYS_IBAT5U
 
-#if defined(CONFIG_TARGET_TUGE1) || defined(CONFIG_TARGET_KMSUPX5)
-#define CONFIG_SYS_IBAT6L (0)
-#define CONFIG_SYS_IBAT6U (0)
-#define CONFIG_SYS_DBAT6L CONFIG_SYS_IBAT6L
-#else
 /* APP2:  icache cacheable, but dcache-inhibit and guarded */
 #define CONFIG_SYS_IBAT6L (CONFIG_SYS_APP2_BASE | \
  BATL_PP_RW | \
@@ -296,7 +224,6 @@
  BATL_PP_RW | \
  BATL_CACHEINHIBIT | \
  BATL_GUARDEDSTORAGE)
-#endif
 #define CONFIG_SYS_DBAT6U CONFIG_SYS_IBAT6U
 
 #define CONFIG_SYS_IBAT7L (0)
diff --git a/include/configs/kmsupx5.h b/include/configs/kmsupx5.h
index 64d6f21514..be93b7ce89 100644
--- a/include/configs/kmsupx5.h
+++ b/include/configs/kmsupx5.h
@@ -23,24 +23,8 @@
 /*
  * High Level Configuration Options
  */
-#if defined(CONFIG_TARGET_KMSUPX5)
 #define CONFIG_KM_BOARD_NAME "kmsupx5"
 #define CONFIG_HOSTNAME "kmsupx5"
-#elif defined(CONFIG_TARGET_TUGE1)
-#define CONFIG_KM_BOARD_NAME "tuge1"
-#define CONFIG_HOSTNAME "tuge1"
-#elif defined(CONFIG_TARGET_TUXX1) /* TUXX1 board (tuxa1/tuda1) specific */
-#define CONFIG_KM_BOARD_NAME "tuxx1"
-#define CONFIG_HOSTNAME "tuxx1"
-#elif defined(CONFIG_TARGET_KMOPTI2)
-#define CONFIG_KM_BOARD_NAME "kmopti2"
-#define CONFIG_HOSTNAME "kmopti2"
-#elif defined(CONFIG_TARGET_KMTEPR2)
-#define CONFIG_KM_BOARD_NAME    "kmtepr2"
-#define CONFIG_HOSTNAME         "kmtepr2"
-#else
-#error ("Board not supported")
-#endif
 
 /*
  * High Level Configuration Options
@@ -158,10 +142,6 @@
 
 #define CONFIG_SYS_APP1_BASE 0xA0000000    /* PAXG */
 #define CONFIG_SYS_APP1_SIZE 256 /* Megabytes */
-#if defined(CONFIG_TARGET_TUXX1) || defined(CONFIG_TARGET_KMOPTI2) || defined(CONFIG_TARGET_KMTEPR2)
-#define CONFIG_SYS_APP2_BASE 0xB0000000    /* PINC3 */
-#define CONFIG_SYS_APP2_SIZE 256 /* Megabytes */
-#endif
 
 /*
  * Init Local Bus Memory Controller:
@@ -178,25 +158,6 @@
  *  3   Local   GPCM    8 bit  256MB  TEP2 (16 bit)
  */
 
-#if defined(CONFIG_KMTEPRO2)
-/*
- * Configuration for C2 (NVRAM) on the local bus
- */
-#define CONFIG_SYS_LBLAWBAR2_PRELIM    CONFIG_SYS_APP1_BASE
-#define CONFIG_SYS_LBLAWAR2_PRELIM     (LBLAWAR_EN | LBLAWAR_256MB)
-#define CONFIG_SYS_BR2_PRELIM  (CONFIG_SYS_APP1_BASE | \
- BR_PS_8 | \
- BR_MS_GPCM | \
- BR_V)
-#define CONFIG_SYS_OR2_PRELIM  (MEG_TO_AM(CONFIG_SYS_APP1_SIZE) | \
- OR_GPCM_CSNT | \
- OR_GPCM_ACS_DIV2 | \
- OR_GPCM_XACS | \
- OR_GPCM_SCY_2 | \
- OR_GPCM_TRLX_SET | \
- OR_GPCM_EHTR_SET | \
- OR_GPCM_EAD)
-#else
 /*
  * Configuration for C2 on the local bus
  */
@@ -217,49 +178,6 @@
  OR_GPCM_TRLX_SET | \
  OR_GPCM_EHTR_CLEAR | \
  OR_GPCM_EAD)
-#endif
-
-#if defined(CONFIG_TARGET_TUXX1)
-/*
- * Configuration for C3 on the local bus
- */
-/* Access window base at PINC3 base */
-#define CONFIG_SYS_LBLAWBAR3_PRELIM CONFIG_SYS_APP2_BASE
-/* Window size: 256 MB */
-#define CONFIG_SYS_LBLAWAR3_PRELIM (LBLAWAR_EN | LBLAWAR_256MB)
-
-#define CONFIG_SYS_BR3_PRELIM (CONFIG_SYS_APP2_BASE | \
- BR_PS_8 | \
- BR_MS_GPCM | \
- BR_V)
-
-#define CONFIG_SYS_OR3_PRELIM (MEG_TO_AM(CONFIG_SYS_APP2_SIZE) | \
- OR_GPCM_CSNT | \
- OR_GPCM_ACS_DIV2 | \
- OR_GPCM_SCY_2 | \
- OR_GPCM_TRLX_SET | \
- OR_GPCM_EHTR_CLEAR)
-
-#define CONFIG_SYS_MAMR (MxMR_GPL_x4DIS | \
- 0x0000c000 | \
- MxMR_WLFx_2X)
-#endif
-
-#if defined(CONFIG_TARGET_KMOPTI2) || defined(CONFIG_TARGET_KMTEPR2)
-/*
- * Configuration for C3 on the local bus
- */
-#define CONFIG_SYS_LBLAWBAR3_PRELIM CONFIG_SYS_APP2_BASE
-#define CONFIG_SYS_LBLAWAR3_PRELIM (LBLAWAR_EN | LBLAWAR_256MB)
-#define CONFIG_SYS_BR3_PRELIM (CONFIG_SYS_APP2_BASE | \
- BR_PS_16 | \
- BR_MS_GPCM | \
- BR_V)
-#define CONFIG_SYS_OR3_PRELIM (MEG_TO_AM(CONFIG_SYS_APP2_SIZE) | \
- OR_GPCM_SCY_4 | \
- OR_GPCM_TRLX_CLEAR | \
- OR_GPCM_EHTR_CLEAR)
-#endif
 
 /*
  * MMU Setup
@@ -279,24 +197,9 @@
  BATL_GUARDEDSTORAGE)
 #define CONFIG_SYS_DBAT5U CONFIG_SYS_IBAT5U
 
-#if defined(CONFIG_TARGET_TUGE1) || defined(CONFIG_TARGET_KMSUPX5)
 #define CONFIG_SYS_IBAT6L (0)
 #define CONFIG_SYS_IBAT6U (0)
 #define CONFIG_SYS_DBAT6L CONFIG_SYS_IBAT6L
-#else
-/* APP2:  icache cacheable, but dcache-inhibit and guarded */
-#define CONFIG_SYS_IBAT6L (CONFIG_SYS_APP2_BASE | \
- BATL_PP_RW | \
- BATL_MEMCOHERENCE)
-#define CONFIG_SYS_IBAT6U (CONFIG_SYS_APP2_BASE | \
- BATU_BL_256M | \
- BATU_VS | \
- BATU_VP)
-#define CONFIG_SYS_DBAT6L (CONFIG_SYS_APP2_BASE | \
- BATL_PP_RW | \
- BATL_CACHEINHIBIT | \
- BATL_GUARDEDSTORAGE)
-#endif
 #define CONFIG_SYS_DBAT6U CONFIG_SYS_IBAT6U
 
 #define CONFIG_SYS_IBAT7L (0)
diff --git a/include/configs/kmtepr2.h b/include/configs/kmtepr2.h
index 64d6f21514..f3504e5a81 100644
--- a/include/configs/kmtepr2.h
+++ b/include/configs/kmtepr2.h
@@ -23,24 +23,8 @@
 /*
  * High Level Configuration Options
  */
-#if defined(CONFIG_TARGET_KMSUPX5)
-#define CONFIG_KM_BOARD_NAME "kmsupx5"
-#define CONFIG_HOSTNAME "kmsupx5"
-#elif defined(CONFIG_TARGET_TUGE1)
-#define CONFIG_KM_BOARD_NAME "tuge1"
-#define CONFIG_HOSTNAME "tuge1"
-#elif defined(CONFIG_TARGET_TUXX1) /* TUXX1 board (tuxa1/tuda1) specific */
-#define CONFIG_KM_BOARD_NAME "tuxx1"
-#define CONFIG_HOSTNAME "tuxx1"
-#elif defined(CONFIG_TARGET_KMOPTI2)
-#define CONFIG_KM_BOARD_NAME "kmopti2"
-#define CONFIG_HOSTNAME "kmopti2"
-#elif defined(CONFIG_TARGET_KMTEPR2)
 #define CONFIG_KM_BOARD_NAME    "kmtepr2"
 #define CONFIG_HOSTNAME         "kmtepr2"
-#else
-#error ("Board not supported")
-#endif
 
 /*
  * High Level Configuration Options
@@ -158,10 +142,8 @@
 
 #define CONFIG_SYS_APP1_BASE 0xA0000000    /* PAXG */
 #define CONFIG_SYS_APP1_SIZE 256 /* Megabytes */
-#if defined(CONFIG_TARGET_TUXX1) || defined(CONFIG_TARGET_KMOPTI2) || defined(CONFIG_TARGET_KMTEPR2)
 #define CONFIG_SYS_APP2_BASE 0xB0000000    /* PINC3 */
 #define CONFIG_SYS_APP2_SIZE 256 /* Megabytes */
-#endif
 
 /*
  * Init Local Bus Memory Controller:
@@ -178,25 +160,6 @@
  *  3   Local   GPCM    8 bit  256MB  TEP2 (16 bit)
  */
 
-#if defined(CONFIG_KMTEPRO2)
-/*
- * Configuration for C2 (NVRAM) on the local bus
- */
-#define CONFIG_SYS_LBLAWBAR2_PRELIM    CONFIG_SYS_APP1_BASE
-#define CONFIG_SYS_LBLAWAR2_PRELIM     (LBLAWAR_EN | LBLAWAR_256MB)
-#define CONFIG_SYS_BR2_PRELIM  (CONFIG_SYS_APP1_BASE | \
- BR_PS_8 | \
- BR_MS_GPCM | \
- BR_V)
-#define CONFIG_SYS_OR2_PRELIM  (MEG_TO_AM(CONFIG_SYS_APP1_SIZE) | \
- OR_GPCM_CSNT | \
- OR_GPCM_ACS_DIV2 | \
- OR_GPCM_XACS | \
- OR_GPCM_SCY_2 | \
- OR_GPCM_TRLX_SET | \
- OR_GPCM_EHTR_SET | \
- OR_GPCM_EAD)
-#else
 /*
  * Configuration for C2 on the local bus
  */
@@ -217,35 +180,7 @@
  OR_GPCM_TRLX_SET | \
  OR_GPCM_EHTR_CLEAR | \
  OR_GPCM_EAD)
-#endif
-
-#if defined(CONFIG_TARGET_TUXX1)
-/*
- * Configuration for C3 on the local bus
- */
-/* Access window base at PINC3 base */
-#define CONFIG_SYS_LBLAWBAR3_PRELIM CONFIG_SYS_APP2_BASE
-/* Window size: 256 MB */
-#define CONFIG_SYS_LBLAWAR3_PRELIM (LBLAWAR_EN | LBLAWAR_256MB)
-
-#define CONFIG_SYS_BR3_PRELIM (CONFIG_SYS_APP2_BASE | \
- BR_PS_8 | \
- BR_MS_GPCM | \
- BR_V)
-
-#define CONFIG_SYS_OR3_PRELIM (MEG_TO_AM(CONFIG_SYS_APP2_SIZE) | \
- OR_GPCM_CSNT | \
- OR_GPCM_ACS_DIV2 | \
- OR_GPCM_SCY_2 | \
- OR_GPCM_TRLX_SET | \
- OR_GPCM_EHTR_CLEAR)
-
-#define CONFIG_SYS_MAMR (MxMR_GPL_x4DIS | \
- 0x0000c000 | \
- MxMR_WLFx_2X)
-#endif
 
-#if defined(CONFIG_TARGET_KMOPTI2) || defined(CONFIG_TARGET_KMTEPR2)
 /*
  * Configuration for C3 on the local bus
  */
@@ -259,7 +194,6 @@
  OR_GPCM_SCY_4 | \
  OR_GPCM_TRLX_CLEAR | \
  OR_GPCM_EHTR_CLEAR)
-#endif
 
 /*
  * MMU Setup
@@ -279,11 +213,6 @@
  BATL_GUARDEDSTORAGE)
 #define CONFIG_SYS_DBAT5U CONFIG_SYS_IBAT5U
 
-#if defined(CONFIG_TARGET_TUGE1) || defined(CONFIG_TARGET_KMSUPX5)
-#define CONFIG_SYS_IBAT6L (0)
-#define CONFIG_SYS_IBAT6U (0)
-#define CONFIG_SYS_DBAT6L CONFIG_SYS_IBAT6L
-#else
 /* APP2:  icache cacheable, but dcache-inhibit and guarded */
 #define CONFIG_SYS_IBAT6L (CONFIG_SYS_APP2_BASE | \
  BATL_PP_RW | \
@@ -296,7 +225,6 @@
  BATL_PP_RW | \
  BATL_CACHEINHIBIT | \
  BATL_GUARDEDSTORAGE)
-#endif
 #define CONFIG_SYS_DBAT6U CONFIG_SYS_IBAT6U
 
 #define CONFIG_SYS_IBAT7L (0)
diff --git a/include/configs/tuge1.h b/include/configs/tuge1.h
index 64d6f21514..85f8e9cd30 100644
--- a/include/configs/tuge1.h
+++ b/include/configs/tuge1.h
@@ -23,24 +23,8 @@
 /*
  * High Level Configuration Options
  */
-#if defined(CONFIG_TARGET_KMSUPX5)
-#define CONFIG_KM_BOARD_NAME "kmsupx5"
-#define CONFIG_HOSTNAME "kmsupx5"
-#elif defined(CONFIG_TARGET_TUGE1)
 #define CONFIG_KM_BOARD_NAME "tuge1"
 #define CONFIG_HOSTNAME "tuge1"
-#elif defined(CONFIG_TARGET_TUXX1) /* TUXX1 board (tuxa1/tuda1) specific */
-#define CONFIG_KM_BOARD_NAME "tuxx1"
-#define CONFIG_HOSTNAME "tuxx1"
-#elif defined(CONFIG_TARGET_KMOPTI2)
-#define CONFIG_KM_BOARD_NAME "kmopti2"
-#define CONFIG_HOSTNAME "kmopti2"
-#elif defined(CONFIG_TARGET_KMTEPR2)
-#define CONFIG_KM_BOARD_NAME    "kmtepr2"
-#define CONFIG_HOSTNAME         "kmtepr2"
-#else
-#error ("Board not supported")
-#endif
 
 /*
  * High Level Configuration Options
@@ -158,10 +142,6 @@
 
 #define CONFIG_SYS_APP1_BASE 0xA0000000    /* PAXG */
 #define CONFIG_SYS_APP1_SIZE 256 /* Megabytes */
-#if defined(CONFIG_TARGET_TUXX1) || defined(CONFIG_TARGET_KMOPTI2) || defined(CONFIG_TARGET_KMTEPR2)
-#define CONFIG_SYS_APP2_BASE 0xB0000000    /* PINC3 */
-#define CONFIG_SYS_APP2_SIZE 256 /* Megabytes */
-#endif
 
 /*
  * Init Local Bus Memory Controller:
@@ -178,25 +158,6 @@
  *  3   Local   GPCM    8 bit  256MB  TEP2 (16 bit)
  */
 
-#if defined(CONFIG_KMTEPRO2)
-/*
- * Configuration for C2 (NVRAM) on the local bus
- */
-#define CONFIG_SYS_LBLAWBAR2_PRELIM    CONFIG_SYS_APP1_BASE
-#define CONFIG_SYS_LBLAWAR2_PRELIM     (LBLAWAR_EN | LBLAWAR_256MB)
-#define CONFIG_SYS_BR2_PRELIM  (CONFIG_SYS_APP1_BASE | \
- BR_PS_8 | \
- BR_MS_GPCM | \
- BR_V)
-#define CONFIG_SYS_OR2_PRELIM  (MEG_TO_AM(CONFIG_SYS_APP1_SIZE) | \
- OR_GPCM_CSNT | \
- OR_GPCM_ACS_DIV2 | \
- OR_GPCM_XACS | \
- OR_GPCM_SCY_2 | \
- OR_GPCM_TRLX_SET | \
- OR_GPCM_EHTR_SET | \
- OR_GPCM_EAD)
-#else
 /*
  * Configuration for C2 on the local bus
  */
@@ -217,49 +178,6 @@
  OR_GPCM_TRLX_SET | \
  OR_GPCM_EHTR_CLEAR | \
  OR_GPCM_EAD)
-#endif
-
-#if defined(CONFIG_TARGET_TUXX1)
-/*
- * Configuration for C3 on the local bus
- */
-/* Access window base at PINC3 base */
-#define CONFIG_SYS_LBLAWBAR3_PRELIM CONFIG_SYS_APP2_BASE
-/* Window size: 256 MB */
-#define CONFIG_SYS_LBLAWAR3_PRELIM (LBLAWAR_EN | LBLAWAR_256MB)
-
-#define CONFIG_SYS_BR3_PRELIM (CONFIG_SYS_APP2_BASE | \
- BR_PS_8 | \
- BR_MS_GPCM | \
- BR_V)
-
-#define CONFIG_SYS_OR3_PRELIM (MEG_TO_AM(CONFIG_SYS_APP2_SIZE) | \
- OR_GPCM_CSNT | \
- OR_GPCM_ACS_DIV2 | \
- OR_GPCM_SCY_2 | \
- OR_GPCM_TRLX_SET | \
- OR_GPCM_EHTR_CLEAR)
-
-#define CONFIG_SYS_MAMR (MxMR_GPL_x4DIS | \
- 0x0000c000 | \
- MxMR_WLFx_2X)
-#endif
-
-#if defined(CONFIG_TARGET_KMOPTI2) || defined(CONFIG_TARGET_KMTEPR2)
-/*
- * Configuration for C3 on the local bus
- */
-#define CONFIG_SYS_LBLAWBAR3_PRELIM CONFIG_SYS_APP2_BASE
-#define CONFIG_SYS_LBLAWAR3_PRELIM (LBLAWAR_EN | LBLAWAR_256MB)
-#define CONFIG_SYS_BR3_PRELIM (CONFIG_SYS_APP2_BASE | \
- BR_PS_16 | \
- BR_MS_GPCM | \
- BR_V)
-#define CONFIG_SYS_OR3_PRELIM (MEG_TO_AM(CONFIG_SYS_APP2_SIZE) | \
- OR_GPCM_SCY_4 | \
- OR_GPCM_TRLX_CLEAR | \
- OR_GPCM_EHTR_CLEAR)
-#endif
 
 /*
  * MMU Setup
@@ -279,24 +197,9 @@
  BATL_GUARDEDSTORAGE)
 #define CONFIG_SYS_DBAT5U CONFIG_SYS_IBAT5U
 
-#if defined(CONFIG_TARGET_TUGE1) || defined(CONFIG_TARGET_KMSUPX5)
 #define CONFIG_SYS_IBAT6L (0)
 #define CONFIG_SYS_IBAT6U (0)
 #define CONFIG_SYS_DBAT6L CONFIG_SYS_IBAT6L
-#else
-/* APP2:  icache cacheable, but dcache-inhibit and guarded */
-#define CONFIG_SYS_IBAT6L (CONFIG_SYS_APP2_BASE | \
- BATL_PP_RW | \
- BATL_MEMCOHERENCE)
-#define CONFIG_SYS_IBAT6U (CONFIG_SYS_APP2_BASE | \
- BATU_BL_256M | \
- BATU_VS | \
- BATU_VP)
-#define CONFIG_SYS_DBAT6L (CONFIG_SYS_APP2_BASE | \
- BATL_PP_RW | \
- BATL_CACHEINHIBIT | \
- BATL_GUARDEDSTORAGE)
-#endif
 #define CONFIG_SYS_DBAT6U CONFIG_SYS_IBAT6U
 
 #define CONFIG_SYS_IBAT7L (0)
diff --git a/include/configs/tuxx1.h b/include/configs/tuxx1.h
index 64d6f21514..b42221a430 100644
--- a/include/configs/tuxx1.h
+++ b/include/configs/tuxx1.h
@@ -23,24 +23,8 @@
 /*
  * High Level Configuration Options
  */
-#if defined(CONFIG_TARGET_KMSUPX5)
-#define CONFIG_KM_BOARD_NAME "kmsupx5"
-#define CONFIG_HOSTNAME "kmsupx5"
-#elif defined(CONFIG_TARGET_TUGE1)
-#define CONFIG_KM_BOARD_NAME "tuge1"
-#define CONFIG_HOSTNAME "tuge1"
-#elif defined(CONFIG_TARGET_TUXX1) /* TUXX1 board (tuxa1/tuda1) specific */
 #define CONFIG_KM_BOARD_NAME "tuxx1"
 #define CONFIG_HOSTNAME "tuxx1"
-#elif defined(CONFIG_TARGET_KMOPTI2)
-#define CONFIG_KM_BOARD_NAME "kmopti2"
-#define CONFIG_HOSTNAME "kmopti2"
-#elif defined(CONFIG_TARGET_KMTEPR2)
-#define CONFIG_KM_BOARD_NAME    "kmtepr2"
-#define CONFIG_HOSTNAME         "kmtepr2"
-#else
-#error ("Board not supported")
-#endif
 
 /*
  * High Level Configuration Options
@@ -158,10 +142,8 @@
 
 #define CONFIG_SYS_APP1_BASE 0xA0000000    /* PAXG */
 #define CONFIG_SYS_APP1_SIZE 256 /* Megabytes */
-#if defined(CONFIG_TARGET_TUXX1) || defined(CONFIG_TARGET_KMOPTI2) || defined(CONFIG_TARGET_KMTEPR2)
 #define CONFIG_SYS_APP2_BASE 0xB0000000    /* PINC3 */
 #define CONFIG_SYS_APP2_SIZE 256 /* Megabytes */
-#endif
 
 /*
  * Init Local Bus Memory Controller:
@@ -178,25 +160,6 @@
  *  3   Local   GPCM    8 bit  256MB  TEP2 (16 bit)
  */
 
-#if defined(CONFIG_KMTEPRO2)
-/*
- * Configuration for C2 (NVRAM) on the local bus
- */
-#define CONFIG_SYS_LBLAWBAR2_PRELIM    CONFIG_SYS_APP1_BASE
-#define CONFIG_SYS_LBLAWAR2_PRELIM     (LBLAWAR_EN | LBLAWAR_256MB)
-#define CONFIG_SYS_BR2_PRELIM  (CONFIG_SYS_APP1_BASE | \
- BR_PS_8 | \
- BR_MS_GPCM | \
- BR_V)
-#define CONFIG_SYS_OR2_PRELIM  (MEG_TO_AM(CONFIG_SYS_APP1_SIZE) | \
- OR_GPCM_CSNT | \
- OR_GPCM_ACS_DIV2 | \
- OR_GPCM_XACS | \
- OR_GPCM_SCY_2 | \
- OR_GPCM_TRLX_SET | \
- OR_GPCM_EHTR_SET | \
- OR_GPCM_EAD)
-#else
 /*
  * Configuration for C2 on the local bus
  */
@@ -217,9 +180,7 @@
  OR_GPCM_TRLX_SET | \
  OR_GPCM_EHTR_CLEAR | \
  OR_GPCM_EAD)
-#endif
 
-#if defined(CONFIG_TARGET_TUXX1)
 /*
  * Configuration for C3 on the local bus
  */
@@ -243,23 +204,6 @@
 #define CONFIG_SYS_MAMR (MxMR_GPL_x4DIS | \
  0x0000c000 | \
  MxMR_WLFx_2X)
-#endif
-
-#if defined(CONFIG_TARGET_KMOPTI2) || defined(CONFIG_TARGET_KMTEPR2)
-/*
- * Configuration for C3 on the local bus
- */
-#define CONFIG_SYS_LBLAWBAR3_PRELIM CONFIG_SYS_APP2_BASE
-#define CONFIG_SYS_LBLAWAR3_PRELIM (LBLAWAR_EN | LBLAWAR_256MB)
-#define CONFIG_SYS_BR3_PRELIM (CONFIG_SYS_APP2_BASE | \
- BR_PS_16 | \
- BR_MS_GPCM | \
- BR_V)
-#define CONFIG_SYS_OR3_PRELIM (MEG_TO_AM(CONFIG_SYS_APP2_SIZE) | \
- OR_GPCM_SCY_4 | \
- OR_GPCM_TRLX_CLEAR | \
- OR_GPCM_EHTR_CLEAR)
-#endif
 
 /*
  * MMU Setup
@@ -279,11 +223,6 @@
  BATL_GUARDEDSTORAGE)
 #define CONFIG_SYS_DBAT5U CONFIG_SYS_IBAT5U
 
-#if defined(CONFIG_TARGET_TUGE1) || defined(CONFIG_TARGET_KMSUPX5)
-#define CONFIG_SYS_IBAT6L (0)
-#define CONFIG_SYS_IBAT6U (0)
-#define CONFIG_SYS_DBAT6L CONFIG_SYS_IBAT6L
-#else
 /* APP2:  icache cacheable, but dcache-inhibit and guarded */
 #define CONFIG_SYS_IBAT6L (CONFIG_SYS_APP2_BASE | \
  BATL_PP_RW | \
@@ -296,7 +235,6 @@
  BATL_PP_RW | \
  BATL_CACHEINHIBIT | \
  BATL_GUARDEDSTORAGE)
-#endif
 #define CONFIG_SYS_DBAT6U CONFIG_SYS_IBAT6U
 
 #define CONFIG_SYS_IBAT7L (0)
--
2.16.4

_______________________________________________
U-Boot mailing list
[hidden email]
https://lists.denx.de/listinfo/u-boot
Reply | Threaded
Open this post in threaded view
|

[PATCH 14/48] keymile: Unroll km/km83xx-common.h

Mario Six
In reply to this post by Mario Six
Simplify the keymile config files once more by unrolling the km/km83xx-common.h

Signed-off-by: Mario Six <[hidden email]>
---
 include/configs/km8360.h  | 300 +++++++++++++++++++++++++++++++++++++++++++++-
 include/configs/kmopti2.h | 300 +++++++++++++++++++++++++++++++++++++++++++++-
 include/configs/kmsupx5.h | 300 +++++++++++++++++++++++++++++++++++++++++++++-
 include/configs/kmtegr1.h | 300 +++++++++++++++++++++++++++++++++++++++++++++-
 include/configs/kmtepr2.h | 300 +++++++++++++++++++++++++++++++++++++++++++++-
 include/configs/kmvect1.h | 300 +++++++++++++++++++++++++++++++++++++++++++++-
 include/configs/suvd3.h   | 300 +++++++++++++++++++++++++++++++++++++++++++++-
 include/configs/tuge1.h   | 300 +++++++++++++++++++++++++++++++++++++++++++++-
 include/configs/tuxx1.h   | 300 +++++++++++++++++++++++++++++++++++++++++++++-
 9 files changed, 2691 insertions(+), 9 deletions(-)

diff --git a/include/configs/km8360.h b/include/configs/km8360.h
index 08d2ae0cbc..0d082e6488 100644
--- a/include/configs/km8360.h
+++ b/include/configs/km8360.h
@@ -38,8 +38,306 @@
 #define CONFIG_QE /* Has QE */
 
 /* include common defines/options for all 83xx Keymile boards */
-#include "km83xx-common.h"
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * (C) Copyright 2010
+ * Heiko Schocher, DENX Software Engineering, [hidden email].
+ */
+
+#ifndef __CONFIG_KM83XX_H
+#define __CONFIG_KM83XX_H
+
+/* include common defines/options for all Keymile boards */
+#include "km/keymile-common.h"
+#include "km/km-powerpc.h"
+
+/*
+ * System Clock Setup
+ */
+#define CONFIG_83XX_CLKIN 66000000
+#define CONFIG_SYS_CLK_FREQ 66000000
+#define CONFIG_83XX_PCICLK 66000000
+
+/*
+ * IMMR new address
+ */
+#define CONFIG_SYS_IMMR 0xE0000000
+
+/*
+ * Bus Arbitration Configuration Register (ACR)
+ */
+#define CONFIG_SYS_ACR_PIPE_DEP 3       /* pipeline depth 4 transactions */
+#define CONFIG_SYS_ACR_RPTCNT   3       /* 4 consecutive transactions */
+#define CONFIG_SYS_ACR_APARK    0       /* park bus to master (below) */
+#define CONFIG_SYS_ACR_PARKM    3       /* parking master = QuiccEngine */
+
+/*
+ * DDR Setup
+ */
+#define CONFIG_SYS_DDR_BASE 0x00000000 /* DDR is system memory */
+#define CONFIG_SYS_SDRAM_BASE CONFIG_SYS_DDR_BASE
+#define CONFIG_SYS_SDRAM_BASE2 (CONFIG_SYS_SDRAM_BASE + 0x10000000) /* +256M */
+
+#define CONFIG_SYS_DDR_SDRAM_BASE CONFIG_SYS_DDR_BASE
+#define CONFIG_SYS_DDR_SDRAM_CLK_CNTL (DDR_SDRAM_CLK_CNTL_SS_EN | \
+ DDR_SDRAM_CLK_CNTL_CLK_ADJUST_05)
+
+#define CFG_83XX_DDR_USES_CS0
+
+/*
+ * Manually set up DDR parameters
+ */
+#define CONFIG_DDR_II
+#define CONFIG_SYS_DDR_SIZE 2048 /* MB */
+
+/*
+ * The reserved memory
+ */
+#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE /* start of monitor */
+#define CONFIG_SYS_FLASH_BASE 0xF0000000
+
+#if (CONFIG_SYS_MONITOR_BASE < CONFIG_SYS_FLASH_BASE)
+#define CONFIG_SYS_RAMBOOT
+#endif
+
+/* Reserve 768 kB for Mon */
+#define CONFIG_SYS_MONITOR_LEN (768 * 1024)
+
+/*
+ * Initial RAM Base Address Setup
+ */
+#define CONFIG_SYS_INIT_RAM_LOCK
+#define CONFIG_SYS_INIT_RAM_ADDR 0xE6000000 /* Initial RAM address */
+#define CONFIG_SYS_INIT_RAM_SIZE 0x1000 /* End of used area in RAM */
+#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_SIZE - \
+ GENERATED_GBL_DATA_SIZE)
+
+/*
+ * Init Local Bus Memory Controller:
+ *
+ * Bank Bus     Machine PortSz  Size  Device
+ * ---- ---     ------- ------  -----  ------
+ *  0   Local   GPCM    16 bit  256MB FLASH
+ *  1   Local   GPCM     8 bit  128MB GPIO/PIGGY
+ *
+ */
+/*
+ * FLASH on the Local Bus
+ */
+#define CONFIG_SYS_FLASH_CFI /* use the Common Flash Interface */
+#define CONFIG_FLASH_CFI_DRIVER /* use the CFI driver */
+#define CONFIG_SYS_FLASH_SIZE 256 /* max FLASH size is 256M */
+#define CONFIG_SYS_FLASH_PROTECTION
+#define CONFIG_SYS_FLASH_USE_BUFFER_WRITE
+
+#define CONFIG_SYS_LBLAWBAR0_PRELIM CONFIG_SYS_FLASH_BASE
+#define CONFIG_SYS_LBLAWAR0_PRELIM (LBLAWAR_EN | LBLAWAR_256MB)
+
+#define CONFIG_SYS_BR0_PRELIM (CONFIG_SYS_FLASH_BASE | \
+ BR_PS_16 | /* 16 bit port size */ \
+ BR_MS_GPCM | /* MSEL = GPCM */ \
+ BR_V)
+
+#define CONFIG_SYS_OR0_PRELIM (MEG_TO_AM(CONFIG_SYS_FLASH_SIZE) | \
+ OR_GPCM_CSNT | OR_GPCM_ACS_DIV2 | \
+ OR_GPCM_SCY_5 | \
+ OR_GPCM_TRLX_SET | OR_GPCM_EAD)
+
+#define CONFIG_SYS_MAX_FLASH_BANKS 1   /* max num of flash banks */
+#define CONFIG_SYS_MAX_FLASH_SECT 512 /* max num of sects on one chip */
+#define CONFIG_SYS_FLASH_BANKS_LIST { CONFIG_SYS_FLASH_BASE }
+
+/*
+ * PRIO1/PIGGY on the local bus CS1
+ */
+/* Window base at flash base */
+#define CONFIG_SYS_LBLAWBAR1_PRELIM CONFIG_SYS_KMBEC_FPGA_BASE
+#define CONFIG_SYS_LBLAWAR1_PRELIM (LBLAWAR_EN | LBLAWAR_128MB)
+
+#define CONFIG_SYS_BR1_PRELIM (CONFIG_SYS_KMBEC_FPGA_BASE | \
+ BR_PS_8 | /* 8 bit port size */ \
+ BR_MS_GPCM | /* MSEL = GPCM */ \
+ BR_V)
+#define CONFIG_SYS_OR1_PRELIM (MEG_TO_AM(CONFIG_SYS_KMBEC_FPGA_SIZE) | \
+ OR_GPCM_CSNT | OR_GPCM_ACS_DIV2 | \
+ OR_GPCM_SCY_2 | \
+ OR_GPCM_TRLX_SET | OR_GPCM_EAD)
+
+/*
+ * Serial Port
+ */
+#define CONFIG_SYS_NS16550_SERIAL
+#define CONFIG_SYS_NS16550_REG_SIZE 1
+#define CONFIG_SYS_NS16550_CLK get_bus_freq(0)
+
+#define CONFIG_SYS_NS16550_COM1 (CONFIG_SYS_IMMR+0x4500)
+#define CONFIG_SYS_NS16550_COM2 (CONFIG_SYS_IMMR+0x4600)
+
+/*
+ * QE UEC ethernet configuration
+ */
+#define CONFIG_UEC_ETH
+#define CONFIG_ETHPRIME "UEC0"
+
+#if !defined(CONFIG_ARCH_MPC8309)
+#define CONFIG_UEC_ETH1 /* GETH1 */
+#define UEC_VERBOSE_DEBUG 1
+#endif
+
+#ifdef CONFIG_UEC_ETH1
+#define CONFIG_SYS_UEC1_UCC_NUM 3 /* UCC4 */
+#define CONFIG_SYS_UEC1_RX_CLK QE_CLK_NONE /* not used in RMII Mode */
+#define CONFIG_SYS_UEC1_TX_CLK QE_CLK17
+#define CONFIG_SYS_UEC1_ETH_TYPE FAST_ETH
+#define CONFIG_SYS_UEC1_PHY_ADDR 0
+#define CONFIG_SYS_UEC1_INTERFACE_TYPE PHY_INTERFACE_MODE_RMII
+#define CONFIG_SYS_UEC1_INTERFACE_SPEED 100
+#endif
+
+/*
+ * Environment
+ */
+
+#ifndef CONFIG_SYS_RAMBOOT
+#ifndef CONFIG_ENV_ADDR
+#define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE + \
+ CONFIG_SYS_MONITOR_LEN)
+#endif
+#define CONFIG_ENV_SECT_SIZE 0x20000 /* 128K(one sector) for env */
+#ifndef CONFIG_ENV_OFFSET
+#define CONFIG_ENV_OFFSET (CONFIG_SYS_MONITOR_LEN)
+#endif
+
+/* Address and size of Redundant Environment Sector */
+#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + \
+ CONFIG_ENV_SECT_SIZE)
+#define CONFIG_ENV_SIZE_REDUND (CONFIG_ENV_SIZE)
+
+#else /* CFG_SYS_RAMBOOT */
+#define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE - 0x1000)
+#define CONFIG_ENV_SIZE 0x2000
+#endif /* CFG_SYS_RAMBOOT */
+
+/* I2C */
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_NUM_I2C_BUSES 4
+#define CONFIG_SYS_I2C_MAX_HOPS 1
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED 200000
+#define CONFIG_SYS_FSL_I2C_SLAVE 0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET 0x3000
+#define CONFIG_SYS_I2C_OFFSET 0x3000
+#define CONFIG_SYS_FSL_I2C2_SPEED 200000
+#define CONFIG_SYS_FSL_I2C2_SLAVE 0x7F
+#define CONFIG_SYS_FSL_I2C2_OFFSET 0x3100
+#define CONFIG_SYS_I2C_BUSES {{0, {I2C_NULL_HOP} }, \
+ {0, {{I2C_MUX_PCA9547, 0x70, 2} } }, \
+ {0, {{I2C_MUX_PCA9547, 0x70, 1} } }, \
+ {1, {I2C_NULL_HOP} } }
+
+#define CONFIG_KM_IVM_BUS 2 /* I2C2 (Mux-Port 1)*/
+
+#if defined(CONFIG_CMD_NAND)
+#define CONFIG_NAND_KMETER1
+#define CONFIG_SYS_MAX_NAND_DEVICE 1
+#define CONFIG_SYS_NAND_BASE CONFIG_SYS_KMBEC_FPGA_BASE
+#endif
+
+/*
+ * For booting Linux, the board info and command line data
+ * have to be in the first 8 MB of memory, since this is
+ * the maximum mapped by the Linux kernel during initialization.
+ */
+#define CONFIG_SYS_BOOTMAPSZ (8 << 20)
+
+/*
+ * Core HID Setup
+ */
+#define CONFIG_SYS_HID0_INIT 0x000000000
+#define CONFIG_SYS_HID0_FINAL (HID0_ENABLE_MACHINE_CHECK | \
+ HID0_ENABLE_INSTRUCTION_CACHE)
+#define CONFIG_SYS_HID2 HID2_HBE
+
+/*
+ * MMU Setup
+ */
+
+#define CONFIG_HIGH_BATS 1 /* High BATs supported */
+
+/* DDR: cache cacheable */
+#define CONFIG_SYS_IBAT0L (CONFIG_SYS_SDRAM_BASE | BATL_PP_RW | \
+ BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_IBAT0U (CONFIG_SYS_SDRAM_BASE | BATU_BL_256M | \
+ BATU_VS | BATU_VP)
+#define CONFIG_SYS_DBAT0L CONFIG_SYS_IBAT0L
+#define CONFIG_SYS_DBAT0U CONFIG_SYS_IBAT0U
+
+/* IMMRBAR & PCI IO: cache-inhibit and guarded */
+#define CONFIG_SYS_IBAT1L (CONFIG_SYS_IMMR | BATL_PP_RW | \
+ BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_IBAT1U (CONFIG_SYS_IMMR | BATU_BL_4M | BATU_VS \
+ | BATU_VP)
+#define CONFIG_SYS_DBAT1L CONFIG_SYS_IBAT1L
+#define CONFIG_SYS_DBAT1U CONFIG_SYS_IBAT1U
+
+/* PRIO1, PIGGY:  icache cacheable, but dcache-inhibit and guarded */
+#define CONFIG_SYS_IBAT2L (CONFIG_SYS_KMBEC_FPGA_BASE | BATL_PP_RW | \
+ BATL_MEMCOHERENCE)
+#define CONFIG_SYS_IBAT2U (CONFIG_SYS_KMBEC_FPGA_BASE | BATU_BL_128M | \
+ BATU_VS | BATU_VP)
+#define CONFIG_SYS_DBAT2L (CONFIG_SYS_KMBEC_FPGA_BASE | BATL_PP_RW | \
+ BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_DBAT2U CONFIG_SYS_IBAT2U
+
+/* FLASH: icache cacheable, but dcache-inhibit and guarded */
+#define CONFIG_SYS_IBAT3L (CONFIG_SYS_FLASH_BASE | BATL_PP_RW | \
+ BATL_MEMCOHERENCE)
+#define CONFIG_SYS_IBAT3U (CONFIG_SYS_FLASH_BASE | BATU_BL_256M | \
+ BATU_VS | BATU_VP)
+#define CONFIG_SYS_DBAT3L (CONFIG_SYS_FLASH_BASE | BATL_PP_RW | \
+ BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_DBAT3U CONFIG_SYS_IBAT3U
+
+/* Stack in dcache: cacheable, no memory coherence */
+#define CONFIG_SYS_IBAT4L (CONFIG_SYS_INIT_RAM_ADDR | BATL_PP_RW)
+#define CONFIG_SYS_IBAT4U (CONFIG_SYS_INIT_RAM_ADDR | BATU_BL_128K | \
+ BATU_VS | BATU_VP)
+#define CONFIG_SYS_DBAT4L CONFIG_SYS_IBAT4L
+#define CONFIG_SYS_DBAT4U CONFIG_SYS_IBAT4U
+
+/*
+ * Internal Definitions
+ */
+#define BOOTFLASH_START 0xF0000000
+
+#define CONFIG_KM_CONSOLE_TTY "ttyS0"
+
+/*
+ * Environment Configuration
+ */
+#define CONFIG_ENV_OVERWRITE
+#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" \
+ ""
+
+#if defined(CONFIG_UEC_ETH)
+#define CONFIG_HAS_ETH0
+#endif
 
+#endif /* __CONFIG_KM83XX_H */
 /*
  * System IO Setup
  */
diff --git a/include/configs/kmopti2.h b/include/configs/kmopti2.h
index 0621be3928..2533d290a1 100644
--- a/include/configs/kmopti2.h
+++ b/include/configs/kmopti2.h
@@ -35,8 +35,306 @@
 #define CONFIG_KM_DEF_ARCH "arch=ppc_8xx\0"
 
 /* include common defines/options for all 83xx Keymile boards */
-#include "km83xx-common.h"
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * (C) Copyright 2010
+ * Heiko Schocher, DENX Software Engineering, [hidden email].
+ */
+
+#ifndef __CONFIG_KM83XX_H
+#define __CONFIG_KM83XX_H
+
+/* include common defines/options for all Keymile boards */
+#include "km/keymile-common.h"
+#include "km/km-powerpc.h"
+
+/*
+ * System Clock Setup
+ */
+#define CONFIG_83XX_CLKIN 66000000
+#define CONFIG_SYS_CLK_FREQ 66000000
+#define CONFIG_83XX_PCICLK 66000000
+
+/*
+ * IMMR new address
+ */
+#define CONFIG_SYS_IMMR 0xE0000000
+
+/*
+ * Bus Arbitration Configuration Register (ACR)
+ */
+#define CONFIG_SYS_ACR_PIPE_DEP 3       /* pipeline depth 4 transactions */
+#define CONFIG_SYS_ACR_RPTCNT   3       /* 4 consecutive transactions */
+#define CONFIG_SYS_ACR_APARK    0       /* park bus to master (below) */
+#define CONFIG_SYS_ACR_PARKM    3       /* parking master = QuiccEngine */
+
+/*
+ * DDR Setup
+ */
+#define CONFIG_SYS_DDR_BASE 0x00000000 /* DDR is system memory */
+#define CONFIG_SYS_SDRAM_BASE CONFIG_SYS_DDR_BASE
+#define CONFIG_SYS_SDRAM_BASE2 (CONFIG_SYS_SDRAM_BASE + 0x10000000) /* +256M */
+
+#define CONFIG_SYS_DDR_SDRAM_BASE CONFIG_SYS_DDR_BASE
+#define CONFIG_SYS_DDR_SDRAM_CLK_CNTL (DDR_SDRAM_CLK_CNTL_SS_EN | \
+ DDR_SDRAM_CLK_CNTL_CLK_ADJUST_05)
+
+#define CFG_83XX_DDR_USES_CS0
+
+/*
+ * Manually set up DDR parameters
+ */
+#define CONFIG_DDR_II
+#define CONFIG_SYS_DDR_SIZE 2048 /* MB */
+
+/*
+ * The reserved memory
+ */
+#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE /* start of monitor */
+#define CONFIG_SYS_FLASH_BASE 0xF0000000
+
+#if (CONFIG_SYS_MONITOR_BASE < CONFIG_SYS_FLASH_BASE)
+#define CONFIG_SYS_RAMBOOT
+#endif
+
+/* Reserve 768 kB for Mon */
+#define CONFIG_SYS_MONITOR_LEN (768 * 1024)
+
+/*
+ * Initial RAM Base Address Setup
+ */
+#define CONFIG_SYS_INIT_RAM_LOCK
+#define CONFIG_SYS_INIT_RAM_ADDR 0xE6000000 /* Initial RAM address */
+#define CONFIG_SYS_INIT_RAM_SIZE 0x1000 /* End of used area in RAM */
+#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_SIZE - \
+ GENERATED_GBL_DATA_SIZE)
+
+/*
+ * Init Local Bus Memory Controller:
+ *
+ * Bank Bus     Machine PortSz  Size  Device
+ * ---- ---     ------- ------  -----  ------
+ *  0   Local   GPCM    16 bit  256MB FLASH
+ *  1   Local   GPCM     8 bit  128MB GPIO/PIGGY
+ *
+ */
+/*
+ * FLASH on the Local Bus
+ */
+#define CONFIG_SYS_FLASH_CFI /* use the Common Flash Interface */
+#define CONFIG_FLASH_CFI_DRIVER /* use the CFI driver */
+#define CONFIG_SYS_FLASH_SIZE 256 /* max FLASH size is 256M */
+#define CONFIG_SYS_FLASH_PROTECTION
+#define CONFIG_SYS_FLASH_USE_BUFFER_WRITE
+
+#define CONFIG_SYS_LBLAWBAR0_PRELIM CONFIG_SYS_FLASH_BASE
+#define CONFIG_SYS_LBLAWAR0_PRELIM (LBLAWAR_EN | LBLAWAR_256MB)
+
+#define CONFIG_SYS_BR0_PRELIM (CONFIG_SYS_FLASH_BASE | \
+ BR_PS_16 | /* 16 bit port size */ \
+ BR_MS_GPCM | /* MSEL = GPCM */ \
+ BR_V)
+
+#define CONFIG_SYS_OR0_PRELIM (MEG_TO_AM(CONFIG_SYS_FLASH_SIZE) | \
+ OR_GPCM_CSNT | OR_GPCM_ACS_DIV2 | \
+ OR_GPCM_SCY_5 | \
+ OR_GPCM_TRLX_SET | OR_GPCM_EAD)
+
+#define CONFIG_SYS_MAX_FLASH_BANKS 1   /* max num of flash banks */
+#define CONFIG_SYS_MAX_FLASH_SECT 512 /* max num of sects on one chip */
+#define CONFIG_SYS_FLASH_BANKS_LIST { CONFIG_SYS_FLASH_BASE }
+
+/*
+ * PRIO1/PIGGY on the local bus CS1
+ */
+/* Window base at flash base */
+#define CONFIG_SYS_LBLAWBAR1_PRELIM CONFIG_SYS_KMBEC_FPGA_BASE
+#define CONFIG_SYS_LBLAWAR1_PRELIM (LBLAWAR_EN | LBLAWAR_128MB)
+
+#define CONFIG_SYS_BR1_PRELIM (CONFIG_SYS_KMBEC_FPGA_BASE | \
+ BR_PS_8 | /* 8 bit port size */ \
+ BR_MS_GPCM | /* MSEL = GPCM */ \
+ BR_V)
+#define CONFIG_SYS_OR1_PRELIM (MEG_TO_AM(CONFIG_SYS_KMBEC_FPGA_SIZE) | \
+ OR_GPCM_CSNT | OR_GPCM_ACS_DIV2 | \
+ OR_GPCM_SCY_2 | \
+ OR_GPCM_TRLX_SET | OR_GPCM_EAD)
+
+/*
+ * Serial Port
+ */
+#define CONFIG_SYS_NS16550_SERIAL
+#define CONFIG_SYS_NS16550_REG_SIZE 1
+#define CONFIG_SYS_NS16550_CLK get_bus_freq(0)
+
+#define CONFIG_SYS_NS16550_COM1 (CONFIG_SYS_IMMR+0x4500)
+#define CONFIG_SYS_NS16550_COM2 (CONFIG_SYS_IMMR+0x4600)
+
+/*
+ * QE UEC ethernet configuration
+ */
+#define CONFIG_UEC_ETH
+#define CONFIG_ETHPRIME "UEC0"
+
+#if !defined(CONFIG_ARCH_MPC8309)
+#define CONFIG_UEC_ETH1 /* GETH1 */
+#define UEC_VERBOSE_DEBUG 1
+#endif
+
+#ifdef CONFIG_UEC_ETH1
+#define CONFIG_SYS_UEC1_UCC_NUM 3 /* UCC4 */
+#define CONFIG_SYS_UEC1_RX_CLK QE_CLK_NONE /* not used in RMII Mode */
+#define CONFIG_SYS_UEC1_TX_CLK QE_CLK17
+#define CONFIG_SYS_UEC1_ETH_TYPE FAST_ETH
+#define CONFIG_SYS_UEC1_PHY_ADDR 0
+#define CONFIG_SYS_UEC1_INTERFACE_TYPE PHY_INTERFACE_MODE_RMII
+#define CONFIG_SYS_UEC1_INTERFACE_SPEED 100
+#endif
+
+/*
+ * Environment
+ */
+
+#ifndef CONFIG_SYS_RAMBOOT
+#ifndef CONFIG_ENV_ADDR
+#define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE + \
+ CONFIG_SYS_MONITOR_LEN)
+#endif
+#define CONFIG_ENV_SECT_SIZE 0x20000 /* 128K(one sector) for env */
+#ifndef CONFIG_ENV_OFFSET
+#define CONFIG_ENV_OFFSET (CONFIG_SYS_MONITOR_LEN)
+#endif
+
+/* Address and size of Redundant Environment Sector */
+#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + \
+ CONFIG_ENV_SECT_SIZE)
+#define CONFIG_ENV_SIZE_REDUND (CONFIG_ENV_SIZE)
+
+#else /* CFG_SYS_RAMBOOT */
+#define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE - 0x1000)
+#define CONFIG_ENV_SIZE 0x2000
+#endif /* CFG_SYS_RAMBOOT */
+
+/* I2C */
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_NUM_I2C_BUSES 4
+#define CONFIG_SYS_I2C_MAX_HOPS 1
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED 200000
+#define CONFIG_SYS_FSL_I2C_SLAVE 0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET 0x3000
+#define CONFIG_SYS_I2C_OFFSET 0x3000
+#define CONFIG_SYS_FSL_I2C2_SPEED 200000
+#define CONFIG_SYS_FSL_I2C2_SLAVE 0x7F
+#define CONFIG_SYS_FSL_I2C2_OFFSET 0x3100
+#define CONFIG_SYS_I2C_BUSES {{0, {I2C_NULL_HOP} }, \
+ {0, {{I2C_MUX_PCA9547, 0x70, 2} } }, \
+ {0, {{I2C_MUX_PCA9547, 0x70, 1} } }, \
+ {1, {I2C_NULL_HOP} } }
+
+#define CONFIG_KM_IVM_BUS 2 /* I2C2 (Mux-Port 1)*/
+
+#if defined(CONFIG_CMD_NAND)
+#define CONFIG_NAND_KMETER1
+#define CONFIG_SYS_MAX_NAND_DEVICE 1
+#define CONFIG_SYS_NAND_BASE CONFIG_SYS_KMBEC_FPGA_BASE
+#endif
+
+/*
+ * For booting Linux, the board info and command line data
+ * have to be in the first 8 MB of memory, since this is
+ * the maximum mapped by the Linux kernel during initialization.
+ */
+#define CONFIG_SYS_BOOTMAPSZ (8 << 20)
+
+/*
+ * Core HID Setup
+ */
+#define CONFIG_SYS_HID0_INIT 0x000000000
+#define CONFIG_SYS_HID0_FINAL (HID0_ENABLE_MACHINE_CHECK | \
+ HID0_ENABLE_INSTRUCTION_CACHE)
+#define CONFIG_SYS_HID2 HID2_HBE
+
+/*
+ * MMU Setup
+ */
+
+#define CONFIG_HIGH_BATS 1 /* High BATs supported */
+
+/* DDR: cache cacheable */
+#define CONFIG_SYS_IBAT0L (CONFIG_SYS_SDRAM_BASE | BATL_PP_RW | \
+ BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_IBAT0U (CONFIG_SYS_SDRAM_BASE | BATU_BL_256M | \
+ BATU_VS | BATU_VP)
+#define CONFIG_SYS_DBAT0L CONFIG_SYS_IBAT0L
+#define CONFIG_SYS_DBAT0U CONFIG_SYS_IBAT0U
+
+/* IMMRBAR & PCI IO: cache-inhibit and guarded */
+#define CONFIG_SYS_IBAT1L (CONFIG_SYS_IMMR | BATL_PP_RW | \
+ BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_IBAT1U (CONFIG_SYS_IMMR | BATU_BL_4M | BATU_VS \
+ | BATU_VP)
+#define CONFIG_SYS_DBAT1L CONFIG_SYS_IBAT1L
+#define CONFIG_SYS_DBAT1U CONFIG_SYS_IBAT1U
+
+/* PRIO1, PIGGY:  icache cacheable, but dcache-inhibit and guarded */
+#define CONFIG_SYS_IBAT2L (CONFIG_SYS_KMBEC_FPGA_BASE | BATL_PP_RW | \
+ BATL_MEMCOHERENCE)
+#define CONFIG_SYS_IBAT2U (CONFIG_SYS_KMBEC_FPGA_BASE | BATU_BL_128M | \
+ BATU_VS | BATU_VP)
+#define CONFIG_SYS_DBAT2L (CONFIG_SYS_KMBEC_FPGA_BASE | BATL_PP_RW | \
+ BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_DBAT2U CONFIG_SYS_IBAT2U
+
+/* FLASH: icache cacheable, but dcache-inhibit and guarded */
+#define CONFIG_SYS_IBAT3L (CONFIG_SYS_FLASH_BASE | BATL_PP_RW | \
+ BATL_MEMCOHERENCE)
+#define CONFIG_SYS_IBAT3U (CONFIG_SYS_FLASH_BASE | BATU_BL_256M | \
+ BATU_VS | BATU_VP)
+#define CONFIG_SYS_DBAT3L (CONFIG_SYS_FLASH_BASE | BATL_PP_RW | \
+ BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_DBAT3U CONFIG_SYS_IBAT3U
+
+/* Stack in dcache: cacheable, no memory coherence */
+#define CONFIG_SYS_IBAT4L (CONFIG_SYS_INIT_RAM_ADDR | BATL_PP_RW)
+#define CONFIG_SYS_IBAT4U (CONFIG_SYS_INIT_RAM_ADDR | BATU_BL_128K | \
+ BATU_VS | BATU_VP)
+#define CONFIG_SYS_DBAT4L CONFIG_SYS_IBAT4L
+#define CONFIG_SYS_DBAT4U CONFIG_SYS_IBAT4U
+
+/*
+ * Internal Definitions
+ */
+#define BOOTFLASH_START 0xF0000000
+
+#define CONFIG_KM_CONSOLE_TTY "ttyS0"
+
+/*
+ * Environment Configuration
+ */
+#define CONFIG_ENV_OVERWRITE
+#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" \
+ ""
+
+#if defined(CONFIG_UEC_ETH)
+#define CONFIG_HAS_ETH0
+#endif
 
+#endif /* __CONFIG_KM83XX_H */
 /*
  * System IO Config
  */
diff --git a/include/configs/kmsupx5.h b/include/configs/kmsupx5.h
index be93b7ce89..3dbd554303 100644
--- a/include/configs/kmsupx5.h
+++ b/include/configs/kmsupx5.h
@@ -35,8 +35,306 @@
 #define CONFIG_KM_DEF_ARCH "arch=ppc_8xx\0"
 
 /* include common defines/options for all 83xx Keymile boards */
-#include "km83xx-common.h"
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * (C) Copyright 2010
+ * Heiko Schocher, DENX Software Engineering, [hidden email].
+ */
+
+#ifndef __CONFIG_KM83XX_H
+#define __CONFIG_KM83XX_H
+
+/* include common defines/options for all Keymile boards */
+#include "km/keymile-common.h"
+#include "km/km-powerpc.h"
+
+/*
+ * System Clock Setup
+ */
+#define CONFIG_83XX_CLKIN 66000000
+#define CONFIG_SYS_CLK_FREQ 66000000
+#define CONFIG_83XX_PCICLK 66000000
+
+/*
+ * IMMR new address
+ */
+#define CONFIG_SYS_IMMR 0xE0000000
+
+/*
+ * Bus Arbitration Configuration Register (ACR)
+ */
+#define CONFIG_SYS_ACR_PIPE_DEP 3       /* pipeline depth 4 transactions */
+#define CONFIG_SYS_ACR_RPTCNT   3       /* 4 consecutive transactions */
+#define CONFIG_SYS_ACR_APARK    0       /* park bus to master (below) */
+#define CONFIG_SYS_ACR_PARKM    3       /* parking master = QuiccEngine */
+
+/*
+ * DDR Setup
+ */
+#define CONFIG_SYS_DDR_BASE 0x00000000 /* DDR is system memory */
+#define CONFIG_SYS_SDRAM_BASE CONFIG_SYS_DDR_BASE
+#define CONFIG_SYS_SDRAM_BASE2 (CONFIG_SYS_SDRAM_BASE + 0x10000000) /* +256M */
+
+#define CONFIG_SYS_DDR_SDRAM_BASE CONFIG_SYS_DDR_BASE
+#define CONFIG_SYS_DDR_SDRAM_CLK_CNTL (DDR_SDRAM_CLK_CNTL_SS_EN | \
+ DDR_SDRAM_CLK_CNTL_CLK_ADJUST_05)
+
+#define CFG_83XX_DDR_USES_CS0
+
+/*
+ * Manually set up DDR parameters
+ */
+#define CONFIG_DDR_II
+#define CONFIG_SYS_DDR_SIZE 2048 /* MB */
+
+/*
+ * The reserved memory
+ */
+#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE /* start of monitor */
+#define CONFIG_SYS_FLASH_BASE 0xF0000000
+
+#if (CONFIG_SYS_MONITOR_BASE < CONFIG_SYS_FLASH_BASE)
+#define CONFIG_SYS_RAMBOOT
+#endif
+
+/* Reserve 768 kB for Mon */
+#define CONFIG_SYS_MONITOR_LEN (768 * 1024)
+
+/*
+ * Initial RAM Base Address Setup
+ */
+#define CONFIG_SYS_INIT_RAM_LOCK
+#define CONFIG_SYS_INIT_RAM_ADDR 0xE6000000 /* Initial RAM address */
+#define CONFIG_SYS_INIT_RAM_SIZE 0x1000 /* End of used area in RAM */
+#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_SIZE - \
+ GENERATED_GBL_DATA_SIZE)
+
+/*
+ * Init Local Bus Memory Controller:
+ *
+ * Bank Bus     Machine PortSz  Size  Device
+ * ---- ---     ------- ------  -----  ------
+ *  0   Local   GPCM    16 bit  256MB FLASH
+ *  1   Local   GPCM     8 bit  128MB GPIO/PIGGY
+ *
+ */
+/*
+ * FLASH on the Local Bus
+ */
+#define CONFIG_SYS_FLASH_CFI /* use the Common Flash Interface */
+#define CONFIG_FLASH_CFI_DRIVER /* use the CFI driver */
+#define CONFIG_SYS_FLASH_SIZE 256 /* max FLASH size is 256M */
+#define CONFIG_SYS_FLASH_PROTECTION
+#define CONFIG_SYS_FLASH_USE_BUFFER_WRITE
+
+#define CONFIG_SYS_LBLAWBAR0_PRELIM CONFIG_SYS_FLASH_BASE
+#define CONFIG_SYS_LBLAWAR0_PRELIM (LBLAWAR_EN | LBLAWAR_256MB)
+
+#define CONFIG_SYS_BR0_PRELIM (CONFIG_SYS_FLASH_BASE | \
+ BR_PS_16 | /* 16 bit port size */ \
+ BR_MS_GPCM | /* MSEL = GPCM */ \
+ BR_V)
+
+#define CONFIG_SYS_OR0_PRELIM (MEG_TO_AM(CONFIG_SYS_FLASH_SIZE) | \
+ OR_GPCM_CSNT | OR_GPCM_ACS_DIV2 | \
+ OR_GPCM_SCY_5 | \
+ OR_GPCM_TRLX_SET | OR_GPCM_EAD)
+
+#define CONFIG_SYS_MAX_FLASH_BANKS 1   /* max num of flash banks */
+#define CONFIG_SYS_MAX_FLASH_SECT 512 /* max num of sects on one chip */
+#define CONFIG_SYS_FLASH_BANKS_LIST { CONFIG_SYS_FLASH_BASE }
+
+/*
+ * PRIO1/PIGGY on the local bus CS1
+ */
+/* Window base at flash base */
+#define CONFIG_SYS_LBLAWBAR1_PRELIM CONFIG_SYS_KMBEC_FPGA_BASE
+#define CONFIG_SYS_LBLAWAR1_PRELIM (LBLAWAR_EN | LBLAWAR_128MB)
+
+#define CONFIG_SYS_BR1_PRELIM (CONFIG_SYS_KMBEC_FPGA_BASE | \
+ BR_PS_8 | /* 8 bit port size */ \
+ BR_MS_GPCM | /* MSEL = GPCM */ \
+ BR_V)
+#define CONFIG_SYS_OR1_PRELIM (MEG_TO_AM(CONFIG_SYS_KMBEC_FPGA_SIZE) | \
+ OR_GPCM_CSNT | OR_GPCM_ACS_DIV2 | \
+ OR_GPCM_SCY_2 | \
+ OR_GPCM_TRLX_SET | OR_GPCM_EAD)
+
+/*
+ * Serial Port
+ */
+#define CONFIG_SYS_NS16550_SERIAL
+#define CONFIG_SYS_NS16550_REG_SIZE 1
+#define CONFIG_SYS_NS16550_CLK get_bus_freq(0)
+
+#define CONFIG_SYS_NS16550_COM1 (CONFIG_SYS_IMMR+0x4500)
+#define CONFIG_SYS_NS16550_COM2 (CONFIG_SYS_IMMR+0x4600)
+
+/*
+ * QE UEC ethernet configuration
+ */
+#define CONFIG_UEC_ETH
+#define CONFIG_ETHPRIME "UEC0"
+
+#if !defined(CONFIG_ARCH_MPC8309)
+#define CONFIG_UEC_ETH1 /* GETH1 */
+#define UEC_VERBOSE_DEBUG 1
+#endif
+
+#ifdef CONFIG_UEC_ETH1
+#define CONFIG_SYS_UEC1_UCC_NUM 3 /* UCC4 */
+#define CONFIG_SYS_UEC1_RX_CLK QE_CLK_NONE /* not used in RMII Mode */
+#define CONFIG_SYS_UEC1_TX_CLK QE_CLK17
+#define CONFIG_SYS_UEC1_ETH_TYPE FAST_ETH
+#define CONFIG_SYS_UEC1_PHY_ADDR 0
+#define CONFIG_SYS_UEC1_INTERFACE_TYPE PHY_INTERFACE_MODE_RMII
+#define CONFIG_SYS_UEC1_INTERFACE_SPEED 100
+#endif
+
+/*
+ * Environment
+ */
+
+#ifndef CONFIG_SYS_RAMBOOT
+#ifndef CONFIG_ENV_ADDR
+#define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE + \
+ CONFIG_SYS_MONITOR_LEN)
+#endif
+#define CONFIG_ENV_SECT_SIZE 0x20000 /* 128K(one sector) for env */
+#ifndef CONFIG_ENV_OFFSET
+#define CONFIG_ENV_OFFSET (CONFIG_SYS_MONITOR_LEN)
+#endif
+
+/* Address and size of Redundant Environment Sector */
+#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + \
+ CONFIG_ENV_SECT_SIZE)
+#define CONFIG_ENV_SIZE_REDUND (CONFIG_ENV_SIZE)
+
+#else /* CFG_SYS_RAMBOOT */
+#define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE - 0x1000)
+#define CONFIG_ENV_SIZE 0x2000
+#endif /* CFG_SYS_RAMBOOT */
+
+/* I2C */
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_NUM_I2C_BUSES 4
+#define CONFIG_SYS_I2C_MAX_HOPS 1
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED 200000
+#define CONFIG_SYS_FSL_I2C_SLAVE 0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET 0x3000
+#define CONFIG_SYS_I2C_OFFSET 0x3000
+#define CONFIG_SYS_FSL_I2C2_SPEED 200000
+#define CONFIG_SYS_FSL_I2C2_SLAVE 0x7F
+#define CONFIG_SYS_FSL_I2C2_OFFSET 0x3100
+#define CONFIG_SYS_I2C_BUSES {{0, {I2C_NULL_HOP} }, \
+ {0, {{I2C_MUX_PCA9547, 0x70, 2} } }, \
+ {0, {{I2C_MUX_PCA9547, 0x70, 1} } }, \
+ {1, {I2C_NULL_HOP} } }
+
+#define CONFIG_KM_IVM_BUS 2 /* I2C2 (Mux-Port 1)*/
+
+#if defined(CONFIG_CMD_NAND)
+#define CONFIG_NAND_KMETER1
+#define CONFIG_SYS_MAX_NAND_DEVICE 1
+#define CONFIG_SYS_NAND_BASE CONFIG_SYS_KMBEC_FPGA_BASE
+#endif
+
+/*
+ * For booting Linux, the board info and command line data
+ * have to be in the first 8 MB of memory, since this is
+ * the maximum mapped by the Linux kernel during initialization.
+ */
+#define CONFIG_SYS_BOOTMAPSZ (8 << 20)
+
+/*
+ * Core HID Setup
+ */
+#define CONFIG_SYS_HID0_INIT 0x000000000
+#define CONFIG_SYS_HID0_FINAL (HID0_ENABLE_MACHINE_CHECK | \
+ HID0_ENABLE_INSTRUCTION_CACHE)
+#define CONFIG_SYS_HID2 HID2_HBE
+
+/*
+ * MMU Setup
+ */
+
+#define CONFIG_HIGH_BATS 1 /* High BATs supported */
+
+/* DDR: cache cacheable */
+#define CONFIG_SYS_IBAT0L (CONFIG_SYS_SDRAM_BASE | BATL_PP_RW | \
+ BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_IBAT0U (CONFIG_SYS_SDRAM_BASE | BATU_BL_256M | \
+ BATU_VS | BATU_VP)
+#define CONFIG_SYS_DBAT0L CONFIG_SYS_IBAT0L
+#define CONFIG_SYS_DBAT0U CONFIG_SYS_IBAT0U
+
+/* IMMRBAR & PCI IO: cache-inhibit and guarded */
+#define CONFIG_SYS_IBAT1L (CONFIG_SYS_IMMR | BATL_PP_RW | \
+ BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_IBAT1U (CONFIG_SYS_IMMR | BATU_BL_4M | BATU_VS \
+ | BATU_VP)
+#define CONFIG_SYS_DBAT1L CONFIG_SYS_IBAT1L
+#define CONFIG_SYS_DBAT1U CONFIG_SYS_IBAT1U
+
+/* PRIO1, PIGGY:  icache cacheable, but dcache-inhibit and guarded */
+#define CONFIG_SYS_IBAT2L (CONFIG_SYS_KMBEC_FPGA_BASE | BATL_PP_RW | \
+ BATL_MEMCOHERENCE)
+#define CONFIG_SYS_IBAT2U (CONFIG_SYS_KMBEC_FPGA_BASE | BATU_BL_128M | \
+ BATU_VS | BATU_VP)
+#define CONFIG_SYS_DBAT2L (CONFIG_SYS_KMBEC_FPGA_BASE | BATL_PP_RW | \
+ BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_DBAT2U CONFIG_SYS_IBAT2U
+
+/* FLASH: icache cacheable, but dcache-inhibit and guarded */
+#define CONFIG_SYS_IBAT3L (CONFIG_SYS_FLASH_BASE | BATL_PP_RW | \
+ BATL_MEMCOHERENCE)
+#define CONFIG_SYS_IBAT3U (CONFIG_SYS_FLASH_BASE | BATU_BL_256M | \
+ BATU_VS | BATU_VP)
+#define CONFIG_SYS_DBAT3L (CONFIG_SYS_FLASH_BASE | BATL_PP_RW | \
+ BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_DBAT3U CONFIG_SYS_IBAT3U
+
+/* Stack in dcache: cacheable, no memory coherence */
+#define CONFIG_SYS_IBAT4L (CONFIG_SYS_INIT_RAM_ADDR | BATL_PP_RW)
+#define CONFIG_SYS_IBAT4U (CONFIG_SYS_INIT_RAM_ADDR | BATU_BL_128K | \
+ BATU_VS | BATU_VP)
+#define CONFIG_SYS_DBAT4L CONFIG_SYS_IBAT4L
+#define CONFIG_SYS_DBAT4U CONFIG_SYS_IBAT4U
+
+/*
+ * Internal Definitions
+ */
+#define BOOTFLASH_START 0xF0000000
+
+#define CONFIG_KM_CONSOLE_TTY "ttyS0"
+
+/*
+ * Environment Configuration
+ */
+#define CONFIG_ENV_OVERWRITE
+#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" \
+ ""
+
+#if defined(CONFIG_UEC_ETH)
+#define CONFIG_HAS_ETH0
+#endif
 
+#endif /* __CONFIG_KM83XX_H */
 /*
  * System IO Config
  */
diff --git a/include/configs/kmtegr1.h b/include/configs/kmtegr1.h
index 27e3905c2b..27f8345708 100644
--- a/include/configs/kmtegr1.h
+++ b/include/configs/kmtegr1.h
@@ -44,8 +44,306 @@
 #define CONFIG_KM_DEF_ARCH "arch=ppc_82xx\0"
 
 /* include common defines/options for all 83xx Keymile boards */
-#include "km83xx-common.h"
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * (C) Copyright 2010
+ * Heiko Schocher, DENX Software Engineering, [hidden email].
+ */
+
+#ifndef __CONFIG_KM83XX_H
+#define __CONFIG_KM83XX_H
+
+/* include common defines/options for all Keymile boards */
+#include "km/keymile-common.h"
+#include "km/km-powerpc.h"
+
+/*
+ * System Clock Setup
+ */
+#define CONFIG_83XX_CLKIN 66000000
+#define CONFIG_SYS_CLK_FREQ 66000000
+#define CONFIG_83XX_PCICLK 66000000
+
+/*
+ * IMMR new address
+ */
+#define CONFIG_SYS_IMMR 0xE0000000
+
+/*
+ * Bus Arbitration Configuration Register (ACR)
+ */
+#define CONFIG_SYS_ACR_PIPE_DEP 3       /* pipeline depth 4 transactions */
+#define CONFIG_SYS_ACR_RPTCNT   3       /* 4 consecutive transactions */
+#define CONFIG_SYS_ACR_APARK    0       /* park bus to master (below) */
+#define CONFIG_SYS_ACR_PARKM    3       /* parking master = QuiccEngine */
+
+/*
+ * DDR Setup
+ */
+#define CONFIG_SYS_DDR_BASE 0x00000000 /* DDR is system memory */
+#define CONFIG_SYS_SDRAM_BASE CONFIG_SYS_DDR_BASE
+#define CONFIG_SYS_SDRAM_BASE2 (CONFIG_SYS_SDRAM_BASE + 0x10000000) /* +256M */
+
+#define CONFIG_SYS_DDR_SDRAM_BASE CONFIG_SYS_DDR_BASE
+#define CONFIG_SYS_DDR_SDRAM_CLK_CNTL (DDR_SDRAM_CLK_CNTL_SS_EN | \
+ DDR_SDRAM_CLK_CNTL_CLK_ADJUST_05)
+
+#define CFG_83XX_DDR_USES_CS0
+
+/*
+ * Manually set up DDR parameters
+ */
+#define CONFIG_DDR_II
+#define CONFIG_SYS_DDR_SIZE 2048 /* MB */
+
+/*
+ * The reserved memory
+ */
+#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE /* start of monitor */
+#define CONFIG_SYS_FLASH_BASE 0xF0000000
+
+#if (CONFIG_SYS_MONITOR_BASE < CONFIG_SYS_FLASH_BASE)
+#define CONFIG_SYS_RAMBOOT
+#endif
+
+/* Reserve 768 kB for Mon */
+#define CONFIG_SYS_MONITOR_LEN (768 * 1024)
+
+/*
+ * Initial RAM Base Address Setup
+ */
+#define CONFIG_SYS_INIT_RAM_LOCK
+#define CONFIG_SYS_INIT_RAM_ADDR 0xE6000000 /* Initial RAM address */
+#define CONFIG_SYS_INIT_RAM_SIZE 0x1000 /* End of used area in RAM */
+#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_SIZE - \
+ GENERATED_GBL_DATA_SIZE)
+
+/*
+ * Init Local Bus Memory Controller:
+ *
+ * Bank Bus     Machine PortSz  Size  Device
+ * ---- ---     ------- ------  -----  ------
+ *  0   Local   GPCM    16 bit  256MB FLASH
+ *  1   Local   GPCM     8 bit  128MB GPIO/PIGGY
+ *
+ */
+/*
+ * FLASH on the Local Bus
+ */
+#define CONFIG_SYS_FLASH_CFI /* use the Common Flash Interface */
+#define CONFIG_FLASH_CFI_DRIVER /* use the CFI driver */
+#define CONFIG_SYS_FLASH_SIZE 256 /* max FLASH size is 256M */
+#define CONFIG_SYS_FLASH_PROTECTION
+#define CONFIG_SYS_FLASH_USE_BUFFER_WRITE
+
+#define CONFIG_SYS_LBLAWBAR0_PRELIM CONFIG_SYS_FLASH_BASE
+#define CONFIG_SYS_LBLAWAR0_PRELIM (LBLAWAR_EN | LBLAWAR_256MB)
+
+#define CONFIG_SYS_BR0_PRELIM (CONFIG_SYS_FLASH_BASE | \
+ BR_PS_16 | /* 16 bit port size */ \
+ BR_MS_GPCM | /* MSEL = GPCM */ \
+ BR_V)
+
+#define CONFIG_SYS_OR0_PRELIM (MEG_TO_AM(CONFIG_SYS_FLASH_SIZE) | \
+ OR_GPCM_CSNT | OR_GPCM_ACS_DIV2 | \
+ OR_GPCM_SCY_5 | \
+ OR_GPCM_TRLX_SET | OR_GPCM_EAD)
+
+#define CONFIG_SYS_MAX_FLASH_BANKS 1   /* max num of flash banks */
+#define CONFIG_SYS_MAX_FLASH_SECT 512 /* max num of sects on one chip */
+#define CONFIG_SYS_FLASH_BANKS_LIST { CONFIG_SYS_FLASH_BASE }
+
+/*
+ * PRIO1/PIGGY on the local bus CS1
+ */
+/* Window base at flash base */
+#define CONFIG_SYS_LBLAWBAR1_PRELIM CONFIG_SYS_KMBEC_FPGA_BASE
+#define CONFIG_SYS_LBLAWAR1_PRELIM (LBLAWAR_EN | LBLAWAR_128MB)
+
+#define CONFIG_SYS_BR1_PRELIM (CONFIG_SYS_KMBEC_FPGA_BASE | \
+ BR_PS_8 | /* 8 bit port size */ \
+ BR_MS_GPCM | /* MSEL = GPCM */ \
+ BR_V)
+#define CONFIG_SYS_OR1_PRELIM (MEG_TO_AM(CONFIG_SYS_KMBEC_FPGA_SIZE) | \
+ OR_GPCM_CSNT | OR_GPCM_ACS_DIV2 | \
+ OR_GPCM_SCY_2 | \
+ OR_GPCM_TRLX_SET | OR_GPCM_EAD)
+
+/*
+ * Serial Port
+ */
+#define CONFIG_SYS_NS16550_SERIAL
+#define CONFIG_SYS_NS16550_REG_SIZE 1
+#define CONFIG_SYS_NS16550_CLK get_bus_freq(0)
+
+#define CONFIG_SYS_NS16550_COM1 (CONFIG_SYS_IMMR+0x4500)
+#define CONFIG_SYS_NS16550_COM2 (CONFIG_SYS_IMMR+0x4600)
+
+/*
+ * QE UEC ethernet configuration
+ */
+#define CONFIG_UEC_ETH
+#define CONFIG_ETHPRIME "UEC0"
+
+#if !defined(CONFIG_ARCH_MPC8309)
+#define CONFIG_UEC_ETH1 /* GETH1 */
+#define UEC_VERBOSE_DEBUG 1
+#endif
+
+#ifdef CONFIG_UEC_ETH1
+#define CONFIG_SYS_UEC1_UCC_NUM 3 /* UCC4 */
+#define CONFIG_SYS_UEC1_RX_CLK QE_CLK_NONE /* not used in RMII Mode */
+#define CONFIG_SYS_UEC1_TX_CLK QE_CLK17
+#define CONFIG_SYS_UEC1_ETH_TYPE FAST_ETH
+#define CONFIG_SYS_UEC1_PHY_ADDR 0
+#define CONFIG_SYS_UEC1_INTERFACE_TYPE PHY_INTERFACE_MODE_RMII
+#define CONFIG_SYS_UEC1_INTERFACE_SPEED 100
+#endif
+
+/*
+ * Environment
+ */
+
+#ifndef CONFIG_SYS_RAMBOOT
+#ifndef CONFIG_ENV_ADDR
+#define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE + \
+ CONFIG_SYS_MONITOR_LEN)
+#endif
+#define CONFIG_ENV_SECT_SIZE 0x20000 /* 128K(one sector) for env */
+#ifndef CONFIG_ENV_OFFSET
+#define CONFIG_ENV_OFFSET (CONFIG_SYS_MONITOR_LEN)
+#endif
+
+/* Address and size of Redundant Environment Sector */
+#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + \
+ CONFIG_ENV_SECT_SIZE)
+#define CONFIG_ENV_SIZE_REDUND (CONFIG_ENV_SIZE)
+
+#else /* CFG_SYS_RAMBOOT */
+#define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE - 0x1000)
+#define CONFIG_ENV_SIZE 0x2000
+#endif /* CFG_SYS_RAMBOOT */
+
+/* I2C */
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_NUM_I2C_BUSES 4
+#define CONFIG_SYS_I2C_MAX_HOPS 1
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED 200000
+#define CONFIG_SYS_FSL_I2C_SLAVE 0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET 0x3000
+#define CONFIG_SYS_I2C_OFFSET 0x3000
+#define CONFIG_SYS_FSL_I2C2_SPEED 200000
+#define CONFIG_SYS_FSL_I2C2_SLAVE 0x7F
+#define CONFIG_SYS_FSL_I2C2_OFFSET 0x3100
+#define CONFIG_SYS_I2C_BUSES {{0, {I2C_NULL_HOP} }, \
+ {0, {{I2C_MUX_PCA9547, 0x70, 2} } }, \
+ {0, {{I2C_MUX_PCA9547, 0x70, 1} } }, \
+ {1, {I2C_NULL_HOP} } }
+
+#define CONFIG_KM_IVM_BUS 2 /* I2C2 (Mux-Port 1)*/
+
+#if defined(CONFIG_CMD_NAND)
+#define CONFIG_NAND_KMETER1
+#define CONFIG_SYS_MAX_NAND_DEVICE 1
+#define CONFIG_SYS_NAND_BASE CONFIG_SYS_KMBEC_FPGA_BASE
+#endif
+
+/*
+ * For booting Linux, the board info and command line data
+ * have to be in the first 8 MB of memory, since this is
+ * the maximum mapped by the Linux kernel during initialization.
+ */
+#define CONFIG_SYS_BOOTMAPSZ (8 << 20)
+
+/*
+ * Core HID Setup
+ */
+#define CONFIG_SYS_HID0_INIT 0x000000000
+#define CONFIG_SYS_HID0_FINAL (HID0_ENABLE_MACHINE_CHECK | \
+ HID0_ENABLE_INSTRUCTION_CACHE)
+#define CONFIG_SYS_HID2 HID2_HBE
+
+/*
+ * MMU Setup
+ */
+
+#define CONFIG_HIGH_BATS 1 /* High BATs supported */
+
+/* DDR: cache cacheable */
+#define CONFIG_SYS_IBAT0L (CONFIG_SYS_SDRAM_BASE | BATL_PP_RW | \
+ BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_IBAT0U (CONFIG_SYS_SDRAM_BASE | BATU_BL_256M | \
+ BATU_VS | BATU_VP)
+#define CONFIG_SYS_DBAT0L CONFIG_SYS_IBAT0L
+#define CONFIG_SYS_DBAT0U CONFIG_SYS_IBAT0U
+
+/* IMMRBAR & PCI IO: cache-inhibit and guarded */
+#define CONFIG_SYS_IBAT1L (CONFIG_SYS_IMMR | BATL_PP_RW | \
+ BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_IBAT1U (CONFIG_SYS_IMMR | BATU_BL_4M | BATU_VS \
+ | BATU_VP)
+#define CONFIG_SYS_DBAT1L CONFIG_SYS_IBAT1L
+#define CONFIG_SYS_DBAT1U CONFIG_SYS_IBAT1U
+
+/* PRIO1, PIGGY:  icache cacheable, but dcache-inhibit and guarded */
+#define CONFIG_SYS_IBAT2L (CONFIG_SYS_KMBEC_FPGA_BASE | BATL_PP_RW | \
+ BATL_MEMCOHERENCE)
+#define CONFIG_SYS_IBAT2U (CONFIG_SYS_KMBEC_FPGA_BASE | BATU_BL_128M | \
+ BATU_VS | BATU_VP)
+#define CONFIG_SYS_DBAT2L (CONFIG_SYS_KMBEC_FPGA_BASE | BATL_PP_RW | \
+ BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_DBAT2U CONFIG_SYS_IBAT2U
+
+/* FLASH: icache cacheable, but dcache-inhibit and guarded */
+#define CONFIG_SYS_IBAT3L (CONFIG_SYS_FLASH_BASE | BATL_PP_RW | \
+ BATL_MEMCOHERENCE)
+#define CONFIG_SYS_IBAT3U (CONFIG_SYS_FLASH_BASE | BATU_BL_256M | \
+ BATU_VS | BATU_VP)
+#define CONFIG_SYS_DBAT3L (CONFIG_SYS_FLASH_BASE | BATL_PP_RW | \
+ BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_DBAT3U CONFIG_SYS_IBAT3U
+
+/* Stack in dcache: cacheable, no memory coherence */
+#define CONFIG_SYS_IBAT4L (CONFIG_SYS_INIT_RAM_ADDR | BATL_PP_RW)
+#define CONFIG_SYS_IBAT4U (CONFIG_SYS_INIT_RAM_ADDR | BATU_BL_128K | \
+ BATU_VS | BATU_VP)
+#define CONFIG_SYS_DBAT4L CONFIG_SYS_IBAT4L
+#define CONFIG_SYS_DBAT4U CONFIG_SYS_IBAT4U
+
+/*
+ * Internal Definitions
+ */
+#define BOOTFLASH_START 0xF0000000
+
+#define CONFIG_KM_CONSOLE_TTY "ttyS0"
+
+/*
+ * Environment Configuration
+ */
+#define CONFIG_ENV_OVERWRITE
+#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" \
+ ""
+
+#if defined(CONFIG_UEC_ETH)
+#define CONFIG_HAS_ETH0
+#endif
 
+#endif /* __CONFIG_KM83XX_H */
 /* QE microcode/firmware address */
 #define CONFIG_SYS_QE_FMAN_FW_IN_NOR
 /* between the u-boot partition and env */
diff --git a/include/configs/kmtepr2.h b/include/configs/kmtepr2.h
index f3504e5a81..ed70f884c8 100644
--- a/include/configs/kmtepr2.h
+++ b/include/configs/kmtepr2.h
@@ -35,8 +35,306 @@
 #define CONFIG_KM_DEF_ARCH "arch=ppc_8xx\0"
 
 /* include common defines/options for all 83xx Keymile boards */
-#include "km83xx-common.h"
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * (C) Copyright 2010
+ * Heiko Schocher, DENX Software Engineering, [hidden email].
+ */
+
+#ifndef __CONFIG_KM83XX_H
+#define __CONFIG_KM83XX_H
+
+/* include common defines/options for all Keymile boards */
+#include "km/keymile-common.h"
+#include "km/km-powerpc.h"
+
+/*
+ * System Clock Setup
+ */
+#define CONFIG_83XX_CLKIN 66000000
+#define CONFIG_SYS_CLK_FREQ 66000000
+#define CONFIG_83XX_PCICLK 66000000
+
+/*
+ * IMMR new address
+ */
+#define CONFIG_SYS_IMMR 0xE0000000
+
+/*
+ * Bus Arbitration Configuration Register (ACR)
+ */
+#define CONFIG_SYS_ACR_PIPE_DEP 3       /* pipeline depth 4 transactions */
+#define CONFIG_SYS_ACR_RPTCNT   3       /* 4 consecutive transactions */
+#define CONFIG_SYS_ACR_APARK    0       /* park bus to master (below) */
+#define CONFIG_SYS_ACR_PARKM    3       /* parking master = QuiccEngine */
+
+/*
+ * DDR Setup
+ */
+#define CONFIG_SYS_DDR_BASE 0x00000000 /* DDR is system memory */
+#define CONFIG_SYS_SDRAM_BASE CONFIG_SYS_DDR_BASE
+#define CONFIG_SYS_SDRAM_BASE2 (CONFIG_SYS_SDRAM_BASE + 0x10000000) /* +256M */
+
+#define CONFIG_SYS_DDR_SDRAM_BASE CONFIG_SYS_DDR_BASE
+#define CONFIG_SYS_DDR_SDRAM_CLK_CNTL (DDR_SDRAM_CLK_CNTL_SS_EN | \
+ DDR_SDRAM_CLK_CNTL_CLK_ADJUST_05)
 
+#define CFG_83XX_DDR_USES_CS0
+
+/*
+ * Manually set up DDR parameters
+ */
+#define CONFIG_DDR_II
+#define CONFIG_SYS_DDR_SIZE 2048 /* MB */
+
+/*
+ * The reserved memory
+ */
+#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE /* start of monitor */
+#define CONFIG_SYS_FLASH_BASE 0xF0000000
+
+#if (CONFIG_SYS_MONITOR_BASE < CONFIG_SYS_FLASH_BASE)
+#define CONFIG_SYS_RAMBOOT
+#endif
+
+/* Reserve 768 kB for Mon */
+#define CONFIG_SYS_MONITOR_LEN (768 * 1024)
+
+/*
+ * Initial RAM Base Address Setup
+ */
+#define CONFIG_SYS_INIT_RAM_LOCK
+#define CONFIG_SYS_INIT_RAM_ADDR 0xE6000000 /* Initial RAM address */
+#define CONFIG_SYS_INIT_RAM_SIZE 0x1000 /* End of used area in RAM */
+#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_SIZE - \
+ GENERATED_GBL_DATA_SIZE)
+
+/*
+ * Init Local Bus Memory Controller:
+ *
+ * Bank Bus     Machine PortSz  Size  Device
+ * ---- ---     ------- ------  -----  ------
+ *  0   Local   GPCM    16 bit  256MB FLASH
+ *  1   Local   GPCM     8 bit  128MB GPIO/PIGGY
+ *
+ */
+/*
+ * FLASH on the Local Bus
+ */
+#define CONFIG_SYS_FLASH_CFI /* use the Common Flash Interface */
+#define CONFIG_FLASH_CFI_DRIVER /* use the CFI driver */
+#define CONFIG_SYS_FLASH_SIZE 256 /* max FLASH size is 256M */
+#define CONFIG_SYS_FLASH_PROTECTION
+#define CONFIG_SYS_FLASH_USE_BUFFER_WRITE
+
+#define CONFIG_SYS_LBLAWBAR0_PRELIM CONFIG_SYS_FLASH_BASE
+#define CONFIG_SYS_LBLAWAR0_PRELIM (LBLAWAR_EN | LBLAWAR_256MB)
+
+#define CONFIG_SYS_BR0_PRELIM (CONFIG_SYS_FLASH_BASE | \
+ BR_PS_16 | /* 16 bit port size */ \
+ BR_MS_GPCM | /* MSEL = GPCM */ \
+ BR_V)
+
+#define CONFIG_SYS_OR0_PRELIM (MEG_TO_AM(CONFIG_SYS_FLASH_SIZE) | \
+ OR_GPCM_CSNT | OR_GPCM_ACS_DIV2 | \
+ OR_GPCM_SCY_5 | \
+ OR_GPCM_TRLX_SET | OR_GPCM_EAD)
+
+#define CONFIG_SYS_MAX_FLASH_BANKS 1   /* max num of flash banks */
+#define CONFIG_SYS_MAX_FLASH_SECT 512 /* max num of sects on one chip */
+#define CONFIG_SYS_FLASH_BANKS_LIST { CONFIG_SYS_FLASH_BASE }
+
+/*
+ * PRIO1/PIGGY on the local bus CS1
+ */
+/* Window base at flash base */
+#define CONFIG_SYS_LBLAWBAR1_PRELIM CONFIG_SYS_KMBEC_FPGA_BASE
+#define CONFIG_SYS_LBLAWAR1_PRELIM (LBLAWAR_EN | LBLAWAR_128MB)
+
+#define CONFIG_SYS_BR1_PRELIM (CONFIG_SYS_KMBEC_FPGA_BASE | \
+ BR_PS_8 | /* 8 bit port size */ \
+ BR_MS_GPCM | /* MSEL = GPCM */ \
+ BR_V)
+#define CONFIG_SYS_OR1_PRELIM (MEG_TO_AM(CONFIG_SYS_KMBEC_FPGA_SIZE) | \
+ OR_GPCM_CSNT | OR_GPCM_ACS_DIV2 | \
+ OR_GPCM_SCY_2 | \
+ OR_GPCM_TRLX_SET | OR_GPCM_EAD)
+
+/*
+ * Serial Port
+ */
+#define CONFIG_SYS_NS16550_SERIAL
+#define CONFIG_SYS_NS16550_REG_SIZE 1
+#define CONFIG_SYS_NS16550_CLK get_bus_freq(0)
+
+#define CONFIG_SYS_NS16550_COM1 (CONFIG_SYS_IMMR+0x4500)
+#define CONFIG_SYS_NS16550_COM2 (CONFIG_SYS_IMMR+0x4600)
+
+/*
+ * QE UEC ethernet configuration
+ */
+#define CONFIG_UEC_ETH
+#define CONFIG_ETHPRIME "UEC0"
+
+#if !defined(CONFIG_ARCH_MPC8309)
+#define CONFIG_UEC_ETH1 /* GETH1 */
+#define UEC_VERBOSE_DEBUG 1
+#endif
+
+#ifdef CONFIG_UEC_ETH1
+#define CONFIG_SYS_UEC1_UCC_NUM 3 /* UCC4 */
+#define CONFIG_SYS_UEC1_RX_CLK QE_CLK_NONE /* not used in RMII Mode */
+#define CONFIG_SYS_UEC1_TX_CLK QE_CLK17
+#define CONFIG_SYS_UEC1_ETH_TYPE FAST_ETH
+#define CONFIG_SYS_UEC1_PHY_ADDR 0
+#define CONFIG_SYS_UEC1_INTERFACE_TYPE PHY_INTERFACE_MODE_RMII
+#define CONFIG_SYS_UEC1_INTERFACE_SPEED 100
+#endif
+
+/*
+ * Environment
+ */
+
+#ifndef CONFIG_SYS_RAMBOOT
+#ifndef CONFIG_ENV_ADDR
+#define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE + \
+ CONFIG_SYS_MONITOR_LEN)
+#endif
+#define CONFIG_ENV_SECT_SIZE 0x20000 /* 128K(one sector) for env */
+#ifndef CONFIG_ENV_OFFSET
+#define CONFIG_ENV_OFFSET (CONFIG_SYS_MONITOR_LEN)
+#endif
+
+/* Address and size of Redundant Environment Sector */
+#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + \
+ CONFIG_ENV_SECT_SIZE)
+#define CONFIG_ENV_SIZE_REDUND (CONFIG_ENV_SIZE)
+
+#else /* CFG_SYS_RAMBOOT */
+#define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE - 0x1000)
+#define CONFIG_ENV_SIZE 0x2000
+#endif /* CFG_SYS_RAMBOOT */
+
+/* I2C */
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_NUM_I2C_BUSES 4
+#define CONFIG_SYS_I2C_MAX_HOPS 1
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED 200000
+#define CONFIG_SYS_FSL_I2C_SLAVE 0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET 0x3000
+#define CONFIG_SYS_I2C_OFFSET 0x3000
+#define CONFIG_SYS_FSL_I2C2_SPEED 200000
+#define CONFIG_SYS_FSL_I2C2_SLAVE 0x7F
+#define CONFIG_SYS_FSL_I2C2_OFFSET 0x3100
+#define CONFIG_SYS_I2C_BUSES {{0, {I2C_NULL_HOP} }, \
+ {0, {{I2C_MUX_PCA9547, 0x70, 2} } }, \
+ {0, {{I2C_MUX_PCA9547, 0x70, 1} } }, \
+ {1, {I2C_NULL_HOP} } }
+
+#define CONFIG_KM_IVM_BUS 2 /* I2C2 (Mux-Port 1)*/
+
+#if defined(CONFIG_CMD_NAND)
+#define CONFIG_NAND_KMETER1
+#define CONFIG_SYS_MAX_NAND_DEVICE 1
+#define CONFIG_SYS_NAND_BASE CONFIG_SYS_KMBEC_FPGA_BASE
+#endif
+
+/*
+ * For booting Linux, the board info and command line data
+ * have to be in the first 8 MB of memory, since this is
+ * the maximum mapped by the Linux kernel during initialization.
+ */
+#define CONFIG_SYS_BOOTMAPSZ (8 << 20)
+
+/*
+ * Core HID Setup
+ */
+#define CONFIG_SYS_HID0_INIT 0x000000000
+#define CONFIG_SYS_HID0_FINAL (HID0_ENABLE_MACHINE_CHECK | \
+ HID0_ENABLE_INSTRUCTION_CACHE)
+#define CONFIG_SYS_HID2 HID2_HBE
+
+/*
+ * MMU Setup
+ */
+
+#define CONFIG_HIGH_BATS 1 /* High BATs supported */
+
+/* DDR: cache cacheable */
+#define CONFIG_SYS_IBAT0L (CONFIG_SYS_SDRAM_BASE | BATL_PP_RW | \
+ BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_IBAT0U (CONFIG_SYS_SDRAM_BASE | BATU_BL_256M | \
+ BATU_VS | BATU_VP)
+#define CONFIG_SYS_DBAT0L CONFIG_SYS_IBAT0L
+#define CONFIG_SYS_DBAT0U CONFIG_SYS_IBAT0U
+
+/* IMMRBAR & PCI IO: cache-inhibit and guarded */
+#define CONFIG_SYS_IBAT1L (CONFIG_SYS_IMMR | BATL_PP_RW | \
+ BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_IBAT1U (CONFIG_SYS_IMMR | BATU_BL_4M | BATU_VS \
+ | BATU_VP)
+#define CONFIG_SYS_DBAT1L CONFIG_SYS_IBAT1L
+#define CONFIG_SYS_DBAT1U CONFIG_SYS_IBAT1U
+
+/* PRIO1, PIGGY:  icache cacheable, but dcache-inhibit and guarded */
+#define CONFIG_SYS_IBAT2L (CONFIG_SYS_KMBEC_FPGA_BASE | BATL_PP_RW | \
+ BATL_MEMCOHERENCE)
+#define CONFIG_SYS_IBAT2U (CONFIG_SYS_KMBEC_FPGA_BASE | BATU_BL_128M | \
+ BATU_VS | BATU_VP)
+#define CONFIG_SYS_DBAT2L (CONFIG_SYS_KMBEC_FPGA_BASE | BATL_PP_RW | \
+ BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_DBAT2U CONFIG_SYS_IBAT2U
+
+/* FLASH: icache cacheable, but dcache-inhibit and guarded */
+#define CONFIG_SYS_IBAT3L (CONFIG_SYS_FLASH_BASE | BATL_PP_RW | \
+ BATL_MEMCOHERENCE)
+#define CONFIG_SYS_IBAT3U (CONFIG_SYS_FLASH_BASE | BATU_BL_256M | \
+ BATU_VS | BATU_VP)
+#define CONFIG_SYS_DBAT3L (CONFIG_SYS_FLASH_BASE | BATL_PP_RW | \
+ BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_DBAT3U CONFIG_SYS_IBAT3U
+
+/* Stack in dcache: cacheable, no memory coherence */
+#define CONFIG_SYS_IBAT4L (CONFIG_SYS_INIT_RAM_ADDR | BATL_PP_RW)
+#define CONFIG_SYS_IBAT4U (CONFIG_SYS_INIT_RAM_ADDR | BATU_BL_128K | \
+ BATU_VS | BATU_VP)
+#define CONFIG_SYS_DBAT4L CONFIG_SYS_IBAT4L
+#define CONFIG_SYS_DBAT4U CONFIG_SYS_IBAT4U
+
+/*
+ * Internal Definitions
+ */
+#define BOOTFLASH_START 0xF0000000
+
+#define CONFIG_KM_CONSOLE_TTY "ttyS0"
+
+/*
+ * Environment Configuration
+ */
+#define CONFIG_ENV_OVERWRITE
+#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" \
+ ""
+
+#if defined(CONFIG_UEC_ETH)
+#define CONFIG_HAS_ETH0
+#endif
+
+#endif /* __CONFIG_KM83XX_H */
 /*
  * System IO Config
  */
diff --git a/include/configs/kmvect1.h b/include/configs/kmvect1.h
index 5a0fbccade..446161e157 100644
--- a/include/configs/kmvect1.h
+++ b/include/configs/kmvect1.h
@@ -36,8 +36,306 @@
 #define CONFIG_KM_DEF_ARCH "arch=ppc_82xx\0"
 
 /* include common defines/options for all 83xx Keymile boards */
-#include "km83xx-common.h"
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * (C) Copyright 2010
+ * Heiko Schocher, DENX Software Engineering, [hidden email].
+ */
+
+#ifndef __CONFIG_KM83XX_H
+#define __CONFIG_KM83XX_H
+
+/* include common defines/options for all Keymile boards */
+#include "km/keymile-common.h"
+#include "km/km-powerpc.h"
+
+/*
+ * System Clock Setup
+ */
+#define CONFIG_83XX_CLKIN 66000000
+#define CONFIG_SYS_CLK_FREQ 66000000
+#define CONFIG_83XX_PCICLK 66000000
+
+/*
+ * IMMR new address
+ */
+#define CONFIG_SYS_IMMR 0xE0000000
+
+/*
+ * Bus Arbitration Configuration Register (ACR)
+ */
+#define CONFIG_SYS_ACR_PIPE_DEP 3       /* pipeline depth 4 transactions */
+#define CONFIG_SYS_ACR_RPTCNT   3       /* 4 consecutive transactions */
+#define CONFIG_SYS_ACR_APARK    0       /* park bus to master (below) */
+#define CONFIG_SYS_ACR_PARKM    3       /* parking master = QuiccEngine */
+
+/*
+ * DDR Setup
+ */
+#define CONFIG_SYS_DDR_BASE 0x00000000 /* DDR is system memory */
+#define CONFIG_SYS_SDRAM_BASE CONFIG_SYS_DDR_BASE
+#define CONFIG_SYS_SDRAM_BASE2 (CONFIG_SYS_SDRAM_BASE + 0x10000000) /* +256M */
+
+#define CONFIG_SYS_DDR_SDRAM_BASE CONFIG_SYS_DDR_BASE
+#define CONFIG_SYS_DDR_SDRAM_CLK_CNTL (DDR_SDRAM_CLK_CNTL_SS_EN | \
+ DDR_SDRAM_CLK_CNTL_CLK_ADJUST_05)
+
+#define CFG_83XX_DDR_USES_CS0
+
+/*
+ * Manually set up DDR parameters
+ */
+#define CONFIG_DDR_II
+#define CONFIG_SYS_DDR_SIZE 2048 /* MB */
+
+/*
+ * The reserved memory
+ */
+#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE /* start of monitor */
+#define CONFIG_SYS_FLASH_BASE 0xF0000000
+
+#if (CONFIG_SYS_MONITOR_BASE < CONFIG_SYS_FLASH_BASE)
+#define CONFIG_SYS_RAMBOOT
+#endif
+
+/* Reserve 768 kB for Mon */
+#define CONFIG_SYS_MONITOR_LEN (768 * 1024)
+
+/*
+ * Initial RAM Base Address Setup
+ */
+#define CONFIG_SYS_INIT_RAM_LOCK
+#define CONFIG_SYS_INIT_RAM_ADDR 0xE6000000 /* Initial RAM address */
+#define CONFIG_SYS_INIT_RAM_SIZE 0x1000 /* End of used area in RAM */
+#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_SIZE - \
+ GENERATED_GBL_DATA_SIZE)
+
+/*
+ * Init Local Bus Memory Controller:
+ *
+ * Bank Bus     Machine PortSz  Size  Device
+ * ---- ---     ------- ------  -----  ------
+ *  0   Local   GPCM    16 bit  256MB FLASH
+ *  1   Local   GPCM     8 bit  128MB GPIO/PIGGY
+ *
+ */
+/*
+ * FLASH on the Local Bus
+ */
+#define CONFIG_SYS_FLASH_CFI /* use the Common Flash Interface */
+#define CONFIG_FLASH_CFI_DRIVER /* use the CFI driver */
+#define CONFIG_SYS_FLASH_SIZE 256 /* max FLASH size is 256M */
+#define CONFIG_SYS_FLASH_PROTECTION
+#define CONFIG_SYS_FLASH_USE_BUFFER_WRITE
+
+#define CONFIG_SYS_LBLAWBAR0_PRELIM CONFIG_SYS_FLASH_BASE
+#define CONFIG_SYS_LBLAWAR0_PRELIM (LBLAWAR_EN | LBLAWAR_256MB)
+
+#define CONFIG_SYS_BR0_PRELIM (CONFIG_SYS_FLASH_BASE | \
+ BR_PS_16 | /* 16 bit port size */ \
+ BR_MS_GPCM | /* MSEL = GPCM */ \
+ BR_V)
+
+#define CONFIG_SYS_OR0_PRELIM (MEG_TO_AM(CONFIG_SYS_FLASH_SIZE) | \
+ OR_GPCM_CSNT | OR_GPCM_ACS_DIV2 | \
+ OR_GPCM_SCY_5 | \
+ OR_GPCM_TRLX_SET | OR_GPCM_EAD)
+
+#define CONFIG_SYS_MAX_FLASH_BANKS 1   /* max num of flash banks */
+#define CONFIG_SYS_MAX_FLASH_SECT 512 /* max num of sects on one chip */
+#define CONFIG_SYS_FLASH_BANKS_LIST { CONFIG_SYS_FLASH_BASE }
+
+/*
+ * PRIO1/PIGGY on the local bus CS1
+ */
+/* Window base at flash base */
+#define CONFIG_SYS_LBLAWBAR1_PRELIM CONFIG_SYS_KMBEC_FPGA_BASE
+#define CONFIG_SYS_LBLAWAR1_PRELIM (LBLAWAR_EN | LBLAWAR_128MB)
+
+#define CONFIG_SYS_BR1_PRELIM (CONFIG_SYS_KMBEC_FPGA_BASE | \
+ BR_PS_8 | /* 8 bit port size */ \
+ BR_MS_GPCM | /* MSEL = GPCM */ \
+ BR_V)
+#define CONFIG_SYS_OR1_PRELIM (MEG_TO_AM(CONFIG_SYS_KMBEC_FPGA_SIZE) | \
+ OR_GPCM_CSNT | OR_GPCM_ACS_DIV2 | \
+ OR_GPCM_SCY_2 | \
+ OR_GPCM_TRLX_SET | OR_GPCM_EAD)
+
+/*
+ * Serial Port
+ */
+#define CONFIG_SYS_NS16550_SERIAL
+#define CONFIG_SYS_NS16550_REG_SIZE 1
+#define CONFIG_SYS_NS16550_CLK get_bus_freq(0)
+
+#define CONFIG_SYS_NS16550_COM1 (CONFIG_SYS_IMMR+0x4500)
+#define CONFIG_SYS_NS16550_COM2 (CONFIG_SYS_IMMR+0x4600)
+
+/*
+ * QE UEC ethernet configuration
+ */
+#define CONFIG_UEC_ETH
+#define CONFIG_ETHPRIME "UEC0"
+
+#if !defined(CONFIG_ARCH_MPC8309)
+#define CONFIG_UEC_ETH1 /* GETH1 */
+#define UEC_VERBOSE_DEBUG 1
+#endif
+
+#ifdef CONFIG_UEC_ETH1
+#define CONFIG_SYS_UEC1_UCC_NUM 3 /* UCC4 */
+#define CONFIG_SYS_UEC1_RX_CLK QE_CLK_NONE /* not used in RMII Mode */
+#define CONFIG_SYS_UEC1_TX_CLK QE_CLK17
+#define CONFIG_SYS_UEC1_ETH_TYPE FAST_ETH
+#define CONFIG_SYS_UEC1_PHY_ADDR 0
+#define CONFIG_SYS_UEC1_INTERFACE_TYPE PHY_INTERFACE_MODE_RMII
+#define CONFIG_SYS_UEC1_INTERFACE_SPEED 100
+#endif
+
+/*
+ * Environment
+ */
+
+#ifndef CONFIG_SYS_RAMBOOT
+#ifndef CONFIG_ENV_ADDR
+#define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE + \
+ CONFIG_SYS_MONITOR_LEN)
+#endif
+#define CONFIG_ENV_SECT_SIZE 0x20000 /* 128K(one sector) for env */
+#ifndef CONFIG_ENV_OFFSET
+#define CONFIG_ENV_OFFSET (CONFIG_SYS_MONITOR_LEN)
+#endif
+
+/* Address and size of Redundant Environment Sector */
+#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + \
+ CONFIG_ENV_SECT_SIZE)
+#define CONFIG_ENV_SIZE_REDUND (CONFIG_ENV_SIZE)
+
+#else /* CFG_SYS_RAMBOOT */
+#define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE - 0x1000)
+#define CONFIG_ENV_SIZE 0x2000
+#endif /* CFG_SYS_RAMBOOT */
+
+/* I2C */
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_NUM_I2C_BUSES 4
+#define CONFIG_SYS_I2C_MAX_HOPS 1
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED 200000
+#define CONFIG_SYS_FSL_I2C_SLAVE 0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET 0x3000
+#define CONFIG_SYS_I2C_OFFSET 0x3000
+#define CONFIG_SYS_FSL_I2C2_SPEED 200000
+#define CONFIG_SYS_FSL_I2C2_SLAVE 0x7F
+#define CONFIG_SYS_FSL_I2C2_OFFSET 0x3100
+#define CONFIG_SYS_I2C_BUSES {{0, {I2C_NULL_HOP} }, \
+ {0, {{I2C_MUX_PCA9547, 0x70, 2} } }, \
+ {0, {{I2C_MUX_PCA9547, 0x70, 1} } }, \
+ {1, {I2C_NULL_HOP} } }
+
+#define CONFIG_KM_IVM_BUS 2 /* I2C2 (Mux-Port 1)*/
+
+#if defined(CONFIG_CMD_NAND)
+#define CONFIG_NAND_KMETER1
+#define CONFIG_SYS_MAX_NAND_DEVICE 1
+#define CONFIG_SYS_NAND_BASE CONFIG_SYS_KMBEC_FPGA_BASE
+#endif
+
+/*
+ * For booting Linux, the board info and command line data
+ * have to be in the first 8 MB of memory, since this is
+ * the maximum mapped by the Linux kernel during initialization.
+ */
+#define CONFIG_SYS_BOOTMAPSZ (8 << 20)
+
+/*
+ * Core HID Setup
+ */
+#define CONFIG_SYS_HID0_INIT 0x000000000
+#define CONFIG_SYS_HID0_FINAL (HID0_ENABLE_MACHINE_CHECK | \
+ HID0_ENABLE_INSTRUCTION_CACHE)
+#define CONFIG_SYS_HID2 HID2_HBE
+
+/*
+ * MMU Setup
+ */
+
+#define CONFIG_HIGH_BATS 1 /* High BATs supported */
+
+/* DDR: cache cacheable */
+#define CONFIG_SYS_IBAT0L (CONFIG_SYS_SDRAM_BASE | BATL_PP_RW | \
+ BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_IBAT0U (CONFIG_SYS_SDRAM_BASE | BATU_BL_256M | \
+ BATU_VS | BATU_VP)
+#define CONFIG_SYS_DBAT0L CONFIG_SYS_IBAT0L
+#define CONFIG_SYS_DBAT0U CONFIG_SYS_IBAT0U
+
+/* IMMRBAR & PCI IO: cache-inhibit and guarded */
+#define CONFIG_SYS_IBAT1L (CONFIG_SYS_IMMR | BATL_PP_RW | \
+ BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_IBAT1U (CONFIG_SYS_IMMR | BATU_BL_4M | BATU_VS \
+ | BATU_VP)
+#define CONFIG_SYS_DBAT1L CONFIG_SYS_IBAT1L
+#define CONFIG_SYS_DBAT1U CONFIG_SYS_IBAT1U
+
+/* PRIO1, PIGGY:  icache cacheable, but dcache-inhibit and guarded */
+#define CONFIG_SYS_IBAT2L (CONFIG_SYS_KMBEC_FPGA_BASE | BATL_PP_RW | \
+ BATL_MEMCOHERENCE)
+#define CONFIG_SYS_IBAT2U (CONFIG_SYS_KMBEC_FPGA_BASE | BATU_BL_128M | \
+ BATU_VS | BATU_VP)
+#define CONFIG_SYS_DBAT2L (CONFIG_SYS_KMBEC_FPGA_BASE | BATL_PP_RW | \
+ BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_DBAT2U CONFIG_SYS_IBAT2U
+
+/* FLASH: icache cacheable, but dcache-inhibit and guarded */
+#define CONFIG_SYS_IBAT3L (CONFIG_SYS_FLASH_BASE | BATL_PP_RW | \
+ BATL_MEMCOHERENCE)
+#define CONFIG_SYS_IBAT3U (CONFIG_SYS_FLASH_BASE | BATU_BL_256M | \
+ BATU_VS | BATU_VP)
+#define CONFIG_SYS_DBAT3L (CONFIG_SYS_FLASH_BASE | BATL_PP_RW | \
+ BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_DBAT3U CONFIG_SYS_IBAT3U
+
+/* Stack in dcache: cacheable, no memory coherence */
+#define CONFIG_SYS_IBAT4L (CONFIG_SYS_INIT_RAM_ADDR | BATL_PP_RW)
+#define CONFIG_SYS_IBAT4U (CONFIG_SYS_INIT_RAM_ADDR | BATU_BL_128K | \
+ BATU_VS | BATU_VP)
+#define CONFIG_SYS_DBAT4L CONFIG_SYS_IBAT4L
+#define CONFIG_SYS_DBAT4U CONFIG_SYS_IBAT4U
+
+/*
+ * Internal Definitions
+ */
+#define BOOTFLASH_START 0xF0000000
+
+#define CONFIG_KM_CONSOLE_TTY "ttyS0"
+
+/*
+ * Environment Configuration
+ */
+#define CONFIG_ENV_OVERWRITE
+#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" \
+ ""
+
+#if defined(CONFIG_UEC_ETH)
+#define CONFIG_HAS_ETH0
+#endif
 
+#endif /* __CONFIG_KM83XX_H */
 /* QE microcode/firmware address */
 #define CONFIG_SYS_QE_FMAN_FW_IN_NOR
 /* between the u-boot partition and env */
diff --git a/include/configs/suvd3.h b/include/configs/suvd3.h
index 5fe5f3cc23..34e97ef9fd 100644
--- a/include/configs/suvd3.h
+++ b/include/configs/suvd3.h
@@ -34,8 +34,306 @@
 #define CONFIG_KM_DEF_ARCH "arch=ppc_8xx\0"
 
 /* include common defines/options for all 83xx Keymile boards */
-#include "km83xx-common.h"
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * (C) Copyright 2010
+ * Heiko Schocher, DENX Software Engineering, [hidden email].
+ */
+
+#ifndef __CONFIG_KM83XX_H
+#define __CONFIG_KM83XX_H
+
+/* include common defines/options for all Keymile boards */
+#include "km/keymile-common.h"
+#include "km/km-powerpc.h"
+
+/*
+ * System Clock Setup
+ */
+#define CONFIG_83XX_CLKIN 66000000
+#define CONFIG_SYS_CLK_FREQ 66000000
+#define CONFIG_83XX_PCICLK 66000000
+
+/*
+ * IMMR new address
+ */
+#define CONFIG_SYS_IMMR 0xE0000000
+
+/*
+ * Bus Arbitration Configuration Register (ACR)
+ */
+#define CONFIG_SYS_ACR_PIPE_DEP 3       /* pipeline depth 4 transactions */
+#define CONFIG_SYS_ACR_RPTCNT   3       /* 4 consecutive transactions */
+#define CONFIG_SYS_ACR_APARK    0       /* park bus to master (below) */
+#define CONFIG_SYS_ACR_PARKM    3       /* parking master = QuiccEngine */
+
+/*
+ * DDR Setup
+ */
+#define CONFIG_SYS_DDR_BASE 0x00000000 /* DDR is system memory */
+#define CONFIG_SYS_SDRAM_BASE CONFIG_SYS_DDR_BASE
+#define CONFIG_SYS_SDRAM_BASE2 (CONFIG_SYS_SDRAM_BASE + 0x10000000) /* +256M */
+
+#define CONFIG_SYS_DDR_SDRAM_BASE CONFIG_SYS_DDR_BASE
+#define CONFIG_SYS_DDR_SDRAM_CLK_CNTL (DDR_SDRAM_CLK_CNTL_SS_EN | \
+ DDR_SDRAM_CLK_CNTL_CLK_ADJUST_05)
+
+#define CFG_83XX_DDR_USES_CS0
+
+/*
+ * Manually set up DDR parameters
+ */
+#define CONFIG_DDR_II
+#define CONFIG_SYS_DDR_SIZE 2048 /* MB */
+
+/*
+ * The reserved memory
+ */
+#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE /* start of monitor */
+#define CONFIG_SYS_FLASH_BASE 0xF0000000
+
+#if (CONFIG_SYS_MONITOR_BASE < CONFIG_SYS_FLASH_BASE)
+#define CONFIG_SYS_RAMBOOT
+#endif
+
+/* Reserve 768 kB for Mon */
+#define CONFIG_SYS_MONITOR_LEN (768 * 1024)
+
+/*
+ * Initial RAM Base Address Setup
+ */
+#define CONFIG_SYS_INIT_RAM_LOCK
+#define CONFIG_SYS_INIT_RAM_ADDR 0xE6000000 /* Initial RAM address */
+#define CONFIG_SYS_INIT_RAM_SIZE 0x1000 /* End of used area in RAM */
+#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_SIZE - \
+ GENERATED_GBL_DATA_SIZE)
+
+/*
+ * Init Local Bus Memory Controller:
+ *
+ * Bank Bus     Machine PortSz  Size  Device
+ * ---- ---     ------- ------  -----  ------
+ *  0   Local   GPCM    16 bit  256MB FLASH
+ *  1   Local   GPCM     8 bit  128MB GPIO/PIGGY
+ *
+ */
+/*
+ * FLASH on the Local Bus
+ */
+#define CONFIG_SYS_FLASH_CFI /* use the Common Flash Interface */
+#define CONFIG_FLASH_CFI_DRIVER /* use the CFI driver */
+#define CONFIG_SYS_FLASH_SIZE 256 /* max FLASH size is 256M */
+#define CONFIG_SYS_FLASH_PROTECTION
+#define CONFIG_SYS_FLASH_USE_BUFFER_WRITE
+
+#define CONFIG_SYS_LBLAWBAR0_PRELIM CONFIG_SYS_FLASH_BASE
+#define CONFIG_SYS_LBLAWAR0_PRELIM (LBLAWAR_EN | LBLAWAR_256MB)
+
+#define CONFIG_SYS_BR0_PRELIM (CONFIG_SYS_FLASH_BASE | \
+ BR_PS_16 | /* 16 bit port size */ \
+ BR_MS_GPCM | /* MSEL = GPCM */ \
+ BR_V)
+
+#define CONFIG_SYS_OR0_PRELIM (MEG_TO_AM(CONFIG_SYS_FLASH_SIZE) | \
+ OR_GPCM_CSNT | OR_GPCM_ACS_DIV2 | \
+ OR_GPCM_SCY_5 | \
+ OR_GPCM_TRLX_SET | OR_GPCM_EAD)
+
+#define CONFIG_SYS_MAX_FLASH_BANKS 1   /* max num of flash banks */
+#define CONFIG_SYS_MAX_FLASH_SECT 512 /* max num of sects on one chip */
+#define CONFIG_SYS_FLASH_BANKS_LIST { CONFIG_SYS_FLASH_BASE }
+
+/*
+ * PRIO1/PIGGY on the local bus CS1
+ */
+/* Window base at flash base */
+#define CONFIG_SYS_LBLAWBAR1_PRELIM CONFIG_SYS_KMBEC_FPGA_BASE
+#define CONFIG_SYS_LBLAWAR1_PRELIM (LBLAWAR_EN | LBLAWAR_128MB)
+
+#define CONFIG_SYS_BR1_PRELIM (CONFIG_SYS_KMBEC_FPGA_BASE | \
+ BR_PS_8 | /* 8 bit port size */ \
+ BR_MS_GPCM | /* MSEL = GPCM */ \
+ BR_V)
+#define CONFIG_SYS_OR1_PRELIM (MEG_TO_AM(CONFIG_SYS_KMBEC_FPGA_SIZE) | \
+ OR_GPCM_CSNT | OR_GPCM_ACS_DIV2 | \
+ OR_GPCM_SCY_2 | \
+ OR_GPCM_TRLX_SET | OR_GPCM_EAD)
+
+/*
+ * Serial Port
+ */
+#define CONFIG_SYS_NS16550_SERIAL
+#define CONFIG_SYS_NS16550_REG_SIZE 1
+#define CONFIG_SYS_NS16550_CLK get_bus_freq(0)
+
+#define CONFIG_SYS_NS16550_COM1 (CONFIG_SYS_IMMR+0x4500)
+#define CONFIG_SYS_NS16550_COM2 (CONFIG_SYS_IMMR+0x4600)
+
+/*
+ * QE UEC ethernet configuration
+ */
+#define CONFIG_UEC_ETH
+#define CONFIG_ETHPRIME "UEC0"
+
+#if !defined(CONFIG_ARCH_MPC8309)
+#define CONFIG_UEC_ETH1 /* GETH1 */
+#define UEC_VERBOSE_DEBUG 1
+#endif
+
+#ifdef CONFIG_UEC_ETH1
+#define CONFIG_SYS_UEC1_UCC_NUM 3 /* UCC4 */
+#define CONFIG_SYS_UEC1_RX_CLK QE_CLK_NONE /* not used in RMII Mode */
+#define CONFIG_SYS_UEC1_TX_CLK QE_CLK17
+#define CONFIG_SYS_UEC1_ETH_TYPE FAST_ETH
+#define CONFIG_SYS_UEC1_PHY_ADDR 0
+#define CONFIG_SYS_UEC1_INTERFACE_TYPE PHY_INTERFACE_MODE_RMII
+#define CONFIG_SYS_UEC1_INTERFACE_SPEED 100
+#endif
+
+/*
+ * Environment
+ */
+
+#ifndef CONFIG_SYS_RAMBOOT
+#ifndef CONFIG_ENV_ADDR
+#define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE + \
+ CONFIG_SYS_MONITOR_LEN)
+#endif
+#define CONFIG_ENV_SECT_SIZE 0x20000 /* 128K(one sector) for env */
+#ifndef CONFIG_ENV_OFFSET
+#define CONFIG_ENV_OFFSET (CONFIG_SYS_MONITOR_LEN)
+#endif
+
+/* Address and size of Redundant Environment Sector */
+#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + \
+ CONFIG_ENV_SECT_SIZE)
+#define CONFIG_ENV_SIZE_REDUND (CONFIG_ENV_SIZE)
+
+#else /* CFG_SYS_RAMBOOT */
+#define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE - 0x1000)
+#define CONFIG_ENV_SIZE 0x2000
+#endif /* CFG_SYS_RAMBOOT */
+
+/* I2C */
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_NUM_I2C_BUSES 4
+#define CONFIG_SYS_I2C_MAX_HOPS 1
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED 200000
+#define CONFIG_SYS_FSL_I2C_SLAVE 0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET 0x3000
+#define CONFIG_SYS_I2C_OFFSET 0x3000
+#define CONFIG_SYS_FSL_I2C2_SPEED 200000
+#define CONFIG_SYS_FSL_I2C2_SLAVE 0x7F
+#define CONFIG_SYS_FSL_I2C2_OFFSET 0x3100
+#define CONFIG_SYS_I2C_BUSES {{0, {I2C_NULL_HOP} }, \
+ {0, {{I2C_MUX_PCA9547, 0x70, 2} } }, \
+ {0, {{I2C_MUX_PCA9547, 0x70, 1} } }, \
+ {1, {I2C_NULL_HOP} } }
+
+#define CONFIG_KM_IVM_BUS 2 /* I2C2 (Mux-Port 1)*/
+
+#if defined(CONFIG_CMD_NAND)
+#define CONFIG_NAND_KMETER1
+#define CONFIG_SYS_MAX_NAND_DEVICE 1
+#define CONFIG_SYS_NAND_BASE CONFIG_SYS_KMBEC_FPGA_BASE
+#endif
 
+/*
+ * For booting Linux, the board info and command line data
+ * have to be in the first 8 MB of memory, since this is
+ * the maximum mapped by the Linux kernel during initialization.
+ */
+#define CONFIG_SYS_BOOTMAPSZ (8 << 20)
+
+/*
+ * Core HID Setup
+ */
+#define CONFIG_SYS_HID0_INIT 0x000000000
+#define CONFIG_SYS_HID0_FINAL (HID0_ENABLE_MACHINE_CHECK | \
+ HID0_ENABLE_INSTRUCTION_CACHE)
+#define CONFIG_SYS_HID2 HID2_HBE
+
+/*
+ * MMU Setup
+ */
+
+#define CONFIG_HIGH_BATS 1 /* High BATs supported */
+
+/* DDR: cache cacheable */
+#define CONFIG_SYS_IBAT0L (CONFIG_SYS_SDRAM_BASE | BATL_PP_RW | \
+ BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_IBAT0U (CONFIG_SYS_SDRAM_BASE | BATU_BL_256M | \
+ BATU_VS | BATU_VP)
+#define CONFIG_SYS_DBAT0L CONFIG_SYS_IBAT0L
+#define CONFIG_SYS_DBAT0U CONFIG_SYS_IBAT0U
+
+/* IMMRBAR & PCI IO: cache-inhibit and guarded */
+#define CONFIG_SYS_IBAT1L (CONFIG_SYS_IMMR | BATL_PP_RW | \
+ BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_IBAT1U (CONFIG_SYS_IMMR | BATU_BL_4M | BATU_VS \
+ | BATU_VP)
+#define CONFIG_SYS_DBAT1L CONFIG_SYS_IBAT1L
+#define CONFIG_SYS_DBAT1U CONFIG_SYS_IBAT1U
+
+/* PRIO1, PIGGY:  icache cacheable, but dcache-inhibit and guarded */
+#define CONFIG_SYS_IBAT2L (CONFIG_SYS_KMBEC_FPGA_BASE | BATL_PP_RW | \
+ BATL_MEMCOHERENCE)
+#define CONFIG_SYS_IBAT2U (CONFIG_SYS_KMBEC_FPGA_BASE | BATU_BL_128M | \
+ BATU_VS | BATU_VP)
+#define CONFIG_SYS_DBAT2L (CONFIG_SYS_KMBEC_FPGA_BASE | BATL_PP_RW | \
+ BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_DBAT2U CONFIG_SYS_IBAT2U
+
+/* FLASH: icache cacheable, but dcache-inhibit and guarded */
+#define CONFIG_SYS_IBAT3L (CONFIG_SYS_FLASH_BASE | BATL_PP_RW | \
+ BATL_MEMCOHERENCE)
+#define CONFIG_SYS_IBAT3U (CONFIG_SYS_FLASH_BASE | BATU_BL_256M | \
+ BATU_VS | BATU_VP)
+#define CONFIG_SYS_DBAT3L (CONFIG_SYS_FLASH_BASE | BATL_PP_RW | \
+ BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_DBAT3U CONFIG_SYS_IBAT3U
+
+/* Stack in dcache: cacheable, no memory coherence */
+#define CONFIG_SYS_IBAT4L (CONFIG_SYS_INIT_RAM_ADDR | BATL_PP_RW)
+#define CONFIG_SYS_IBAT4U (CONFIG_SYS_INIT_RAM_ADDR | BATU_BL_128K | \
+ BATU_VS | BATU_VP)
+#define CONFIG_SYS_DBAT4L CONFIG_SYS_IBAT4L
+#define CONFIG_SYS_DBAT4U CONFIG_SYS_IBAT4U
+
+/*
+ * Internal Definitions
+ */
+#define BOOTFLASH_START 0xF0000000
+
+#define CONFIG_KM_CONSOLE_TTY "ttyS0"
+
+/*
+ * Environment Configuration
+ */
+#define CONFIG_ENV_OVERWRITE
+#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" \
+ ""
+
+#if defined(CONFIG_UEC_ETH)
+#define CONFIG_HAS_ETH0
+#endif
+
+#endif /* __CONFIG_KM83XX_H */
 /*
  * System IO Config
  */
diff --git a/include/configs/tuge1.h b/include/configs/tuge1.h
index 85f8e9cd30..d2e0466cd8 100644
--- a/include/configs/tuge1.h
+++ b/include/configs/tuge1.h
@@ -35,8 +35,306 @@
 #define CONFIG_KM_DEF_ARCH "arch=ppc_8xx\0"
 
 /* include common defines/options for all 83xx Keymile boards */
-#include "km83xx-common.h"
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * (C) Copyright 2010
+ * Heiko Schocher, DENX Software Engineering, [hidden email].
+ */
+
+#ifndef __CONFIG_KM83XX_H
+#define __CONFIG_KM83XX_H
+
+/* include common defines/options for all Keymile boards */
+#include "km/keymile-common.h"
+#include "km/km-powerpc.h"
+
+/*
+ * System Clock Setup
+ */
+#define CONFIG_83XX_CLKIN 66000000
+#define CONFIG_SYS_CLK_FREQ 66000000
+#define CONFIG_83XX_PCICLK 66000000
+
+/*
+ * IMMR new address
+ */
+#define CONFIG_SYS_IMMR 0xE0000000
+
+/*
+ * Bus Arbitration Configuration Register (ACR)
+ */
+#define CONFIG_SYS_ACR_PIPE_DEP 3       /* pipeline depth 4 transactions */
+#define CONFIG_SYS_ACR_RPTCNT   3       /* 4 consecutive transactions */
+#define CONFIG_SYS_ACR_APARK    0       /* park bus to master (below) */
+#define CONFIG_SYS_ACR_PARKM    3       /* parking master = QuiccEngine */
+
+/*
+ * DDR Setup
+ */
+#define CONFIG_SYS_DDR_BASE 0x00000000 /* DDR is system memory */
+#define CONFIG_SYS_SDRAM_BASE CONFIG_SYS_DDR_BASE
+#define CONFIG_SYS_SDRAM_BASE2 (CONFIG_SYS_SDRAM_BASE + 0x10000000) /* +256M */
+
+#define CONFIG_SYS_DDR_SDRAM_BASE CONFIG_SYS_DDR_BASE
+#define CONFIG_SYS_DDR_SDRAM_CLK_CNTL (DDR_SDRAM_CLK_CNTL_SS_EN | \
+ DDR_SDRAM_CLK_CNTL_CLK_ADJUST_05)
+
+#define CFG_83XX_DDR_USES_CS0
+
+/*
+ * Manually set up DDR parameters
+ */
+#define CONFIG_DDR_II
+#define CONFIG_SYS_DDR_SIZE 2048 /* MB */
+
+/*
+ * The reserved memory
+ */
+#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE /* start of monitor */
+#define CONFIG_SYS_FLASH_BASE 0xF0000000
+
+#if (CONFIG_SYS_MONITOR_BASE < CONFIG_SYS_FLASH_BASE)
+#define CONFIG_SYS_RAMBOOT
+#endif
+
+/* Reserve 768 kB for Mon */
+#define CONFIG_SYS_MONITOR_LEN (768 * 1024)
+
+/*
+ * Initial RAM Base Address Setup
+ */
+#define CONFIG_SYS_INIT_RAM_LOCK
+#define CONFIG_SYS_INIT_RAM_ADDR 0xE6000000 /* Initial RAM address */
+#define CONFIG_SYS_INIT_RAM_SIZE 0x1000 /* End of used area in RAM */
+#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_SIZE - \
+ GENERATED_GBL_DATA_SIZE)
+
+/*
+ * Init Local Bus Memory Controller:
+ *
+ * Bank Bus     Machine PortSz  Size  Device
+ * ---- ---     ------- ------  -----  ------
+ *  0   Local   GPCM    16 bit  256MB FLASH
+ *  1   Local   GPCM     8 bit  128MB GPIO/PIGGY
+ *
+ */
+/*
+ * FLASH on the Local Bus
+ */
+#define CONFIG_SYS_FLASH_CFI /* use the Common Flash Interface */
+#define CONFIG_FLASH_CFI_DRIVER /* use the CFI driver */
+#define CONFIG_SYS_FLASH_SIZE 256 /* max FLASH size is 256M */
+#define CONFIG_SYS_FLASH_PROTECTION
+#define CONFIG_SYS_FLASH_USE_BUFFER_WRITE
+
+#define CONFIG_SYS_LBLAWBAR0_PRELIM CONFIG_SYS_FLASH_BASE
+#define CONFIG_SYS_LBLAWAR0_PRELIM (LBLAWAR_EN | LBLAWAR_256MB)
+
+#define CONFIG_SYS_BR0_PRELIM (CONFIG_SYS_FLASH_BASE | \
+ BR_PS_16 | /* 16 bit port size */ \
+ BR_MS_GPCM | /* MSEL = GPCM */ \
+ BR_V)
+
+#define CONFIG_SYS_OR0_PRELIM (MEG_TO_AM(CONFIG_SYS_FLASH_SIZE) | \
+ OR_GPCM_CSNT | OR_GPCM_ACS_DIV2 | \
+ OR_GPCM_SCY_5 | \
+ OR_GPCM_TRLX_SET | OR_GPCM_EAD)
+
+#define CONFIG_SYS_MAX_FLASH_BANKS 1   /* max num of flash banks */
+#define CONFIG_SYS_MAX_FLASH_SECT 512 /* max num of sects on one chip */
+#define CONFIG_SYS_FLASH_BANKS_LIST { CONFIG_SYS_FLASH_BASE }
+
+/*
+ * PRIO1/PIGGY on the local bus CS1
+ */
+/* Window base at flash base */
+#define CONFIG_SYS_LBLAWBAR1_PRELIM CONFIG_SYS_KMBEC_FPGA_BASE
+#define CONFIG_SYS_LBLAWAR1_PRELIM (LBLAWAR_EN | LBLAWAR_128MB)
+
+#define CONFIG_SYS_BR1_PRELIM (CONFIG_SYS_KMBEC_FPGA_BASE | \
+ BR_PS_8 | /* 8 bit port size */ \
+ BR_MS_GPCM | /* MSEL = GPCM */ \
+ BR_V)
+#define CONFIG_SYS_OR1_PRELIM (MEG_TO_AM(CONFIG_SYS_KMBEC_FPGA_SIZE) | \
+ OR_GPCM_CSNT | OR_GPCM_ACS_DIV2 | \
+ OR_GPCM_SCY_2 | \
+ OR_GPCM_TRLX_SET | OR_GPCM_EAD)
+
+/*
+ * Serial Port
+ */
+#define CONFIG_SYS_NS16550_SERIAL
+#define CONFIG_SYS_NS16550_REG_SIZE 1
+#define CONFIG_SYS_NS16550_CLK get_bus_freq(0)
+
+#define CONFIG_SYS_NS16550_COM1 (CONFIG_SYS_IMMR+0x4500)
+#define CONFIG_SYS_NS16550_COM2 (CONFIG_SYS_IMMR+0x4600)
+
+/*
+ * QE UEC ethernet configuration
+ */
+#define CONFIG_UEC_ETH
+#define CONFIG_ETHPRIME "UEC0"
+
+#if !defined(CONFIG_ARCH_MPC8309)
+#define CONFIG_UEC_ETH1 /* GETH1 */
+#define UEC_VERBOSE_DEBUG 1
+#endif
+
+#ifdef CONFIG_UEC_ETH1
+#define CONFIG_SYS_UEC1_UCC_NUM 3 /* UCC4 */
+#define CONFIG_SYS_UEC1_RX_CLK QE_CLK_NONE /* not used in RMII Mode */
+#define CONFIG_SYS_UEC1_TX_CLK QE_CLK17
+#define CONFIG_SYS_UEC1_ETH_TYPE FAST_ETH
+#define CONFIG_SYS_UEC1_PHY_ADDR 0
+#define CONFIG_SYS_UEC1_INTERFACE_TYPE PHY_INTERFACE_MODE_RMII
+#define CONFIG_SYS_UEC1_INTERFACE_SPEED 100
+#endif
+
+/*
+ * Environment
+ */
+
+#ifndef CONFIG_SYS_RAMBOOT
+#ifndef CONFIG_ENV_ADDR
+#define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE + \
+ CONFIG_SYS_MONITOR_LEN)
+#endif
+#define CONFIG_ENV_SECT_SIZE 0x20000 /* 128K(one sector) for env */
+#ifndef CONFIG_ENV_OFFSET
+#define CONFIG_ENV_OFFSET (CONFIG_SYS_MONITOR_LEN)
+#endif
+
+/* Address and size of Redundant Environment Sector */
+#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + \
+ CONFIG_ENV_SECT_SIZE)
+#define CONFIG_ENV_SIZE_REDUND (CONFIG_ENV_SIZE)
+
+#else /* CFG_SYS_RAMBOOT */
+#define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE - 0x1000)
+#define CONFIG_ENV_SIZE 0x2000
+#endif /* CFG_SYS_RAMBOOT */
+
+/* I2C */
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_NUM_I2C_BUSES 4
+#define CONFIG_SYS_I2C_MAX_HOPS 1
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED 200000
+#define CONFIG_SYS_FSL_I2C_SLAVE 0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET 0x3000
+#define CONFIG_SYS_I2C_OFFSET 0x3000
+#define CONFIG_SYS_FSL_I2C2_SPEED 200000
+#define CONFIG_SYS_FSL_I2C2_SLAVE 0x7F
+#define CONFIG_SYS_FSL_I2C2_OFFSET 0x3100
+#define CONFIG_SYS_I2C_BUSES {{0, {I2C_NULL_HOP} }, \
+ {0, {{I2C_MUX_PCA9547, 0x70, 2} } }, \
+ {0, {{I2C_MUX_PCA9547, 0x70, 1} } }, \
+ {1, {I2C_NULL_HOP} } }
+
+#define CONFIG_KM_IVM_BUS 2 /* I2C2 (Mux-Port 1)*/
+
+#if defined(CONFIG_CMD_NAND)
+#define CONFIG_NAND_KMETER1
+#define CONFIG_SYS_MAX_NAND_DEVICE 1
+#define CONFIG_SYS_NAND_BASE CONFIG_SYS_KMBEC_FPGA_BASE
+#endif
+
+/*
+ * For booting Linux, the board info and command line data
+ * have to be in the first 8 MB of memory, since this is
+ * the maximum mapped by the Linux kernel during initialization.
+ */
+#define CONFIG_SYS_BOOTMAPSZ (8 << 20)
+
+/*
+ * Core HID Setup
+ */
+#define CONFIG_SYS_HID0_INIT 0x000000000
+#define CONFIG_SYS_HID0_FINAL (HID0_ENABLE_MACHINE_CHECK | \
+ HID0_ENABLE_INSTRUCTION_CACHE)
+#define CONFIG_SYS_HID2 HID2_HBE
+
+/*
+ * MMU Setup
+ */
+
+#define CONFIG_HIGH_BATS 1 /* High BATs supported */
+
+/* DDR: cache cacheable */
+#define CONFIG_SYS_IBAT0L (CONFIG_SYS_SDRAM_BASE | BATL_PP_RW | \
+ BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_IBAT0U (CONFIG_SYS_SDRAM_BASE | BATU_BL_256M | \
+ BATU_VS | BATU_VP)
+#define CONFIG_SYS_DBAT0L CONFIG_SYS_IBAT0L
+#define CONFIG_SYS_DBAT0U CONFIG_SYS_IBAT0U
+
+/* IMMRBAR & PCI IO: cache-inhibit and guarded */
+#define CONFIG_SYS_IBAT1L (CONFIG_SYS_IMMR | BATL_PP_RW | \
+ BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_IBAT1U (CONFIG_SYS_IMMR | BATU_BL_4M | BATU_VS \
+ | BATU_VP)
+#define CONFIG_SYS_DBAT1L CONFIG_SYS_IBAT1L
+#define CONFIG_SYS_DBAT1U CONFIG_SYS_IBAT1U
+
+/* PRIO1, PIGGY:  icache cacheable, but dcache-inhibit and guarded */
+#define CONFIG_SYS_IBAT2L (CONFIG_SYS_KMBEC_FPGA_BASE | BATL_PP_RW | \
+ BATL_MEMCOHERENCE)
+#define CONFIG_SYS_IBAT2U (CONFIG_SYS_KMBEC_FPGA_BASE | BATU_BL_128M | \
+ BATU_VS | BATU_VP)
+#define CONFIG_SYS_DBAT2L (CONFIG_SYS_KMBEC_FPGA_BASE | BATL_PP_RW | \
+ BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_DBAT2U CONFIG_SYS_IBAT2U
+
+/* FLASH: icache cacheable, but dcache-inhibit and guarded */
+#define CONFIG_SYS_IBAT3L (CONFIG_SYS_FLASH_BASE | BATL_PP_RW | \
+ BATL_MEMCOHERENCE)
+#define CONFIG_SYS_IBAT3U (CONFIG_SYS_FLASH_BASE | BATU_BL_256M | \
+ BATU_VS | BATU_VP)
+#define CONFIG_SYS_DBAT3L (CONFIG_SYS_FLASH_BASE | BATL_PP_RW | \
+ BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_DBAT3U CONFIG_SYS_IBAT3U
+
+/* Stack in dcache: cacheable, no memory coherence */
+#define CONFIG_SYS_IBAT4L (CONFIG_SYS_INIT_RAM_ADDR | BATL_PP_RW)
+#define CONFIG_SYS_IBAT4U (CONFIG_SYS_INIT_RAM_ADDR | BATU_BL_128K | \
+ BATU_VS | BATU_VP)
+#define CONFIG_SYS_DBAT4L CONFIG_SYS_IBAT4L
+#define CONFIG_SYS_DBAT4U CONFIG_SYS_IBAT4U
+
+/*
+ * Internal Definitions
+ */
+#define BOOTFLASH_START 0xF0000000
+
+#define CONFIG_KM_CONSOLE_TTY "ttyS0"
+
+/*
+ * Environment Configuration
+ */
+#define CONFIG_ENV_OVERWRITE
+#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" \
+ ""
+
+#if defined(CONFIG_UEC_ETH)
+#define CONFIG_HAS_ETH0
+#endif
 
+#endif /* __CONFIG_KM83XX_H */
 /*
  * System IO Config
  */
diff --git a/include/configs/tuxx1.h b/include/configs/tuxx1.h
index b42221a430..f1d12e456f 100644
--- a/include/configs/tuxx1.h
+++ b/include/configs/tuxx1.h
@@ -35,8 +35,306 @@
 #define CONFIG_KM_DEF_ARCH "arch=ppc_8xx\0"
 
 /* include common defines/options for all 83xx Keymile boards */
-#include "km83xx-common.h"
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * (C) Copyright 2010
+ * Heiko Schocher, DENX Software Engineering, [hidden email].
+ */
+
+#ifndef __CONFIG_KM83XX_H
+#define __CONFIG_KM83XX_H
+
+/* include common defines/options for all Keymile boards */
+#include "km/keymile-common.h"
+#include "km/km-powerpc.h"
+
+/*
+ * System Clock Setup
+ */
+#define CONFIG_83XX_CLKIN 66000000
+#define CONFIG_SYS_CLK_FREQ 66000000
+#define CONFIG_83XX_PCICLK 66000000
+
+/*
+ * IMMR new address
+ */
+#define CONFIG_SYS_IMMR 0xE0000000
+
+/*
+ * Bus Arbitration Configuration Register (ACR)
+ */
+#define CONFIG_SYS_ACR_PIPE_DEP 3       /* pipeline depth 4 transactions */
+#define CONFIG_SYS_ACR_RPTCNT   3       /* 4 consecutive transactions */
+#define CONFIG_SYS_ACR_APARK    0       /* park bus to master (below) */
+#define CONFIG_SYS_ACR_PARKM    3       /* parking master = QuiccEngine */
+
+/*
+ * DDR Setup
+ */
+#define CONFIG_SYS_DDR_BASE 0x00000000 /* DDR is system memory */
+#define CONFIG_SYS_SDRAM_BASE CONFIG_SYS_DDR_BASE
+#define CONFIG_SYS_SDRAM_BASE2 (CONFIG_SYS_SDRAM_BASE + 0x10000000) /* +256M */
+
+#define CONFIG_SYS_DDR_SDRAM_BASE CONFIG_SYS_DDR_BASE
+#define CONFIG_SYS_DDR_SDRAM_CLK_CNTL (DDR_SDRAM_CLK_CNTL_SS_EN | \
+ DDR_SDRAM_CLK_CNTL_CLK_ADJUST_05)
 
+#define CFG_83XX_DDR_USES_CS0
+
+/*
+ * Manually set up DDR parameters
+ */
+#define CONFIG_DDR_II
+#define CONFIG_SYS_DDR_SIZE 2048 /* MB */
+
+/*
+ * The reserved memory
+ */
+#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE /* start of monitor */
+#define CONFIG_SYS_FLASH_BASE 0xF0000000
+
+#if (CONFIG_SYS_MONITOR_BASE < CONFIG_SYS_FLASH_BASE)
+#define CONFIG_SYS_RAMBOOT
+#endif
+
+/* Reserve 768 kB for Mon */
+#define CONFIG_SYS_MONITOR_LEN (768 * 1024)
+
+/*
+ * Initial RAM Base Address Setup
+ */
+#define CONFIG_SYS_INIT_RAM_LOCK
+#define CONFIG_SYS_INIT_RAM_ADDR 0xE6000000 /* Initial RAM address */
+#define CONFIG_SYS_INIT_RAM_SIZE 0x1000 /* End of used area in RAM */
+#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_SIZE - \
+ GENERATED_GBL_DATA_SIZE)
+
+/*
+ * Init Local Bus Memory Controller:
+ *
+ * Bank Bus     Machine PortSz  Size  Device
+ * ---- ---     ------- ------  -----  ------
+ *  0   Local   GPCM    16 bit  256MB FLASH
+ *  1   Local   GPCM     8 bit  128MB GPIO/PIGGY
+ *
+ */
+/*
+ * FLASH on the Local Bus
+ */
+#define CONFIG_SYS_FLASH_CFI /* use the Common Flash Interface */
+#define CONFIG_FLASH_CFI_DRIVER /* use the CFI driver */
+#define CONFIG_SYS_FLASH_SIZE 256 /* max FLASH size is 256M */
+#define CONFIG_SYS_FLASH_PROTECTION
+#define CONFIG_SYS_FLASH_USE_BUFFER_WRITE
+
+#define CONFIG_SYS_LBLAWBAR0_PRELIM CONFIG_SYS_FLASH_BASE
+#define CONFIG_SYS_LBLAWAR0_PRELIM (LBLAWAR_EN | LBLAWAR_256MB)
+
+#define CONFIG_SYS_BR0_PRELIM (CONFIG_SYS_FLASH_BASE | \
+ BR_PS_16 | /* 16 bit port size */ \
+ BR_MS_GPCM | /* MSEL = GPCM */ \
+ BR_V)
+
+#define CONFIG_SYS_OR0_PRELIM (MEG_TO_AM(CONFIG_SYS_FLASH_SIZE) | \
+ OR_GPCM_CSNT | OR_GPCM_ACS_DIV2 | \
+ OR_GPCM_SCY_5 | \
+ OR_GPCM_TRLX_SET | OR_GPCM_EAD)
+
+#define CONFIG_SYS_MAX_FLASH_BANKS 1   /* max num of flash banks */
+#define CONFIG_SYS_MAX_FLASH_SECT 512 /* max num of sects on one chip */
+#define CONFIG_SYS_FLASH_BANKS_LIST { CONFIG_SYS_FLASH_BASE }
+
+/*
+ * PRIO1/PIGGY on the local bus CS1
+ */
+/* Window base at flash base */
+#define CONFIG_SYS_LBLAWBAR1_PRELIM CONFIG_SYS_KMBEC_FPGA_BASE
+#define CONFIG_SYS_LBLAWAR1_PRELIM (LBLAWAR_EN | LBLAWAR_128MB)
+
+#define CONFIG_SYS_BR1_PRELIM (CONFIG_SYS_KMBEC_FPGA_BASE | \
+ BR_PS_8 | /* 8 bit port size */ \
+ BR_MS_GPCM | /* MSEL = GPCM */ \
+ BR_V)
+#define CONFIG_SYS_OR1_PRELIM (MEG_TO_AM(CONFIG_SYS_KMBEC_FPGA_SIZE) | \
+ OR_GPCM_CSNT | OR_GPCM_ACS_DIV2 | \
+ OR_GPCM_SCY_2 | \
+ OR_GPCM_TRLX_SET | OR_GPCM_EAD)
+
+/*
+ * Serial Port
+ */
+#define CONFIG_SYS_NS16550_SERIAL
+#define CONFIG_SYS_NS16550_REG_SIZE 1
+#define CONFIG_SYS_NS16550_CLK get_bus_freq(0)
+
+#define CONFIG_SYS_NS16550_COM1 (CONFIG_SYS_IMMR+0x4500)
+#define CONFIG_SYS_NS16550_COM2 (CONFIG_SYS_IMMR+0x4600)
+
+/*
+ * QE UEC ethernet configuration
+ */
+#define CONFIG_UEC_ETH
+#define CONFIG_ETHPRIME "UEC0"
+
+#if !defined(CONFIG_ARCH_MPC8309)
+#define CONFIG_UEC_ETH1 /* GETH1 */
+#define UEC_VERBOSE_DEBUG 1
+#endif
+
+#ifdef CONFIG_UEC_ETH1
+#define CONFIG_SYS_UEC1_UCC_NUM 3 /* UCC4 */
+#define CONFIG_SYS_UEC1_RX_CLK QE_CLK_NONE /* not used in RMII Mode */
+#define CONFIG_SYS_UEC1_TX_CLK QE_CLK17
+#define CONFIG_SYS_UEC1_ETH_TYPE FAST_ETH
+#define CONFIG_SYS_UEC1_PHY_ADDR 0
+#define CONFIG_SYS_UEC1_INTERFACE_TYPE PHY_INTERFACE_MODE_RMII
+#define CONFIG_SYS_UEC1_INTERFACE_SPEED 100
+#endif
+
+/*
+ * Environment
+ */
+
+#ifndef CONFIG_SYS_RAMBOOT
+#ifndef CONFIG_ENV_ADDR
+#define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE + \
+ CONFIG_SYS_MONITOR_LEN)
+#endif
+#define CONFIG_ENV_SECT_SIZE 0x20000 /* 128K(one sector) for env */
+#ifndef CONFIG_ENV_OFFSET
+#define CONFIG_ENV_OFFSET (CONFIG_SYS_MONITOR_LEN)
+#endif
+
+/* Address and size of Redundant Environment Sector */
+#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + \
+ CONFIG_ENV_SECT_SIZE)
+#define CONFIG_ENV_SIZE_REDUND (CONFIG_ENV_SIZE)
+
+#else /* CFG_SYS_RAMBOOT */
+#define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE - 0x1000)
+#define CONFIG_ENV_SIZE 0x2000
+#endif /* CFG_SYS_RAMBOOT */
+
+/* I2C */
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_NUM_I2C_BUSES 4
+#define CONFIG_SYS_I2C_MAX_HOPS 1
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED 200000
+#define CONFIG_SYS_FSL_I2C_SLAVE 0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET 0x3000
+#define CONFIG_SYS_I2C_OFFSET 0x3000
+#define CONFIG_SYS_FSL_I2C2_SPEED 200000
+#define CONFIG_SYS_FSL_I2C2_SLAVE 0x7F
+#define CONFIG_SYS_FSL_I2C2_OFFSET 0x3100
+#define CONFIG_SYS_I2C_BUSES {{0, {I2C_NULL_HOP} }, \
+ {0, {{I2C_MUX_PCA9547, 0x70, 2} } }, \
+ {0, {{I2C_MUX_PCA9547, 0x70, 1} } }, \
+ {1, {I2C_NULL_HOP} } }
+
+#define CONFIG_KM_IVM_BUS 2 /* I2C2 (Mux-Port 1)*/
+
+#if defined(CONFIG_CMD_NAND)
+#define CONFIG_NAND_KMETER1
+#define CONFIG_SYS_MAX_NAND_DEVICE 1
+#define CONFIG_SYS_NAND_BASE CONFIG_SYS_KMBEC_FPGA_BASE
+#endif
+
+/*
+ * For booting Linux, the board info and command line data
+ * have to be in the first 8 MB of memory, since this is
+ * the maximum mapped by the Linux kernel during initialization.
+ */
+#define CONFIG_SYS_BOOTMAPSZ (8 << 20)
+
+/*
+ * Core HID Setup
+ */
+#define CONFIG_SYS_HID0_INIT 0x000000000
+#define CONFIG_SYS_HID0_FINAL (HID0_ENABLE_MACHINE_CHECK | \
+ HID0_ENABLE_INSTRUCTION_CACHE)
+#define CONFIG_SYS_HID2 HID2_HBE
+
+/*
+ * MMU Setup
+ */
+
+#define CONFIG_HIGH_BATS 1 /* High BATs supported */
+
+/* DDR: cache cacheable */
+#define CONFIG_SYS_IBAT0L (CONFIG_SYS_SDRAM_BASE | BATL_PP_RW | \
+ BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_IBAT0U (CONFIG_SYS_SDRAM_BASE | BATU_BL_256M | \
+ BATU_VS | BATU_VP)
+#define CONFIG_SYS_DBAT0L CONFIG_SYS_IBAT0L
+#define CONFIG_SYS_DBAT0U CONFIG_SYS_IBAT0U
+
+/* IMMRBAR & PCI IO: cache-inhibit and guarded */
+#define CONFIG_SYS_IBAT1L (CONFIG_SYS_IMMR | BATL_PP_RW | \
+ BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_IBAT1U (CONFIG_SYS_IMMR | BATU_BL_4M | BATU_VS \
+ | BATU_VP)
+#define CONFIG_SYS_DBAT1L CONFIG_SYS_IBAT1L
+#define CONFIG_SYS_DBAT1U CONFIG_SYS_IBAT1U
+
+/* PRIO1, PIGGY:  icache cacheable, but dcache-inhibit and guarded */
+#define CONFIG_SYS_IBAT2L (CONFIG_SYS_KMBEC_FPGA_BASE | BATL_PP_RW | \
+ BATL_MEMCOHERENCE)
+#define CONFIG_SYS_IBAT2U (CONFIG_SYS_KMBEC_FPGA_BASE | BATU_BL_128M | \
+ BATU_VS | BATU_VP)
+#define CONFIG_SYS_DBAT2L (CONFIG_SYS_KMBEC_FPGA_BASE | BATL_PP_RW | \
+ BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_DBAT2U CONFIG_SYS_IBAT2U
+
+/* FLASH: icache cacheable, but dcache-inhibit and guarded */
+#define CONFIG_SYS_IBAT3L (CONFIG_SYS_FLASH_BASE | BATL_PP_RW | \
+ BATL_MEMCOHERENCE)
+#define CONFIG_SYS_IBAT3U (CONFIG_SYS_FLASH_BASE | BATU_BL_256M | \
+ BATU_VS | BATU_VP)
+#define CONFIG_SYS_DBAT3L (CONFIG_SYS_FLASH_BASE | BATL_PP_RW | \
+ BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_DBAT3U CONFIG_SYS_IBAT3U
+
+/* Stack in dcache: cacheable, no memory coherence */
+#define CONFIG_SYS_IBAT4L (CONFIG_SYS_INIT_RAM_ADDR | BATL_PP_RW)
+#define CONFIG_SYS_IBAT4U (CONFIG_SYS_INIT_RAM_ADDR | BATU_BL_128K | \
+ BATU_VS | BATU_VP)
+#define CONFIG_SYS_DBAT4L CONFIG_SYS_IBAT4L
+#define CONFIG_SYS_DBAT4U CONFIG_SYS_IBAT4U
+
+/*
+ * Internal Definitions
+ */
+#define BOOTFLASH_START 0xF0000000
+
+#define CONFIG_KM_CONSOLE_TTY "ttyS0"
+
+/*
+ * Environment Configuration
+ */
+#define CONFIG_ENV_OVERWRITE
+#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" \
+ ""
+
+#if defined(CONFIG_UEC_ETH)
+#define CONFIG_HAS_ETH0
+#endif
+
+#endif /* __CONFIG_KM83XX_H */
 /*
  * System IO Config
  */
--
2.16.4

_______________________________________________
U-Boot mailing list
[hidden email]
https://lists.denx.de/listinfo/u-boot
Reply | Threaded
Open this post in threaded view
|

[PATCH 15/48] keymile: Simplify configs after include unroll

Mario Six
In reply to this post by Mario Six
Simplify the keymile configs again after unrolling the km83xx-common.h
include file.

Signed-off-by: Mario Six <[hidden email]>
---
 include/configs/km8360.h  | 11 -----------
 include/configs/kmopti2.h | 13 -------------
 include/configs/kmsupx5.h | 13 -------------
 include/configs/kmtegr1.h | 18 ------------------
 include/configs/kmtepr2.h | 13 -------------
 include/configs/kmvect1.h | 18 ------------------
 include/configs/suvd3.h   | 15 ---------------
 include/configs/tuge1.h   | 13 -------------
 include/configs/tuxx1.h   | 13 -------------
 9 files changed, 127 deletions(-)

diff --git a/include/configs/km8360.h b/include/configs/km8360.h
index 0d082e6488..b22345bcc2 100644
--- a/include/configs/km8360.h
+++ b/include/configs/km8360.h
@@ -37,16 +37,6 @@
  */
 #define CONFIG_QE /* Has QE */
 
-/* include common defines/options for all 83xx Keymile boards */
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * (C) Copyright 2010
- * Heiko Schocher, DENX Software Engineering, [hidden email].
- */
-
-#ifndef __CONFIG_KM83XX_H
-#define __CONFIG_KM83XX_H
-
 /* include common defines/options for all Keymile boards */
 #include "km/keymile-common.h"
 #include "km/km-powerpc.h"
@@ -337,7 +327,6 @@
 #define CONFIG_HAS_ETH0
 #endif
 
-#endif /* __CONFIG_KM83XX_H */
 /*
  * System IO Setup
  */
diff --git a/include/configs/kmopti2.h b/include/configs/kmopti2.h
index 2533d290a1..60f7fd09d9 100644
--- a/include/configs/kmopti2.h
+++ b/include/configs/kmopti2.h
@@ -34,16 +34,6 @@
 
 #define CONFIG_KM_DEF_ARCH "arch=ppc_8xx\0"
 
-/* include common defines/options for all 83xx Keymile boards */
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * (C) Copyright 2010
- * Heiko Schocher, DENX Software Engineering, [hidden email].
- */
-
-#ifndef __CONFIG_KM83XX_H
-#define __CONFIG_KM83XX_H
-
 /* include common defines/options for all Keymile boards */
 #include "km/keymile-common.h"
 #include "km/km-powerpc.h"
@@ -176,10 +166,8 @@
 #define CONFIG_UEC_ETH
 #define CONFIG_ETHPRIME "UEC0"
 
-#if !defined(CONFIG_ARCH_MPC8309)
 #define CONFIG_UEC_ETH1 /* GETH1 */
 #define UEC_VERBOSE_DEBUG 1
-#endif
 
 #ifdef CONFIG_UEC_ETH1
 #define CONFIG_SYS_UEC1_UCC_NUM 3 /* UCC4 */
@@ -334,7 +322,6 @@
 #define CONFIG_HAS_ETH0
 #endif
 
-#endif /* __CONFIG_KM83XX_H */
 /*
  * System IO Config
  */
diff --git a/include/configs/kmsupx5.h b/include/configs/kmsupx5.h
index 3dbd554303..4af2903ec2 100644
--- a/include/configs/kmsupx5.h
+++ b/include/configs/kmsupx5.h
@@ -34,16 +34,6 @@
 
 #define CONFIG_KM_DEF_ARCH "arch=ppc_8xx\0"
 
-/* include common defines/options for all 83xx Keymile boards */
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * (C) Copyright 2010
- * Heiko Schocher, DENX Software Engineering, [hidden email].
- */
-
-#ifndef __CONFIG_KM83XX_H
-#define __CONFIG_KM83XX_H
-
 /* include common defines/options for all Keymile boards */
 #include "km/keymile-common.h"
 #include "km/km-powerpc.h"
@@ -176,10 +166,8 @@
 #define CONFIG_UEC_ETH
 #define CONFIG_ETHPRIME "UEC0"
 
-#if !defined(CONFIG_ARCH_MPC8309)
 #define CONFIG_UEC_ETH1 /* GETH1 */
 #define UEC_VERBOSE_DEBUG 1
-#endif
 
 #ifdef CONFIG_UEC_ETH1
 #define CONFIG_SYS_UEC1_UCC_NUM 3 /* UCC4 */
@@ -334,7 +322,6 @@
 #define CONFIG_HAS_ETH0
 #endif
 
-#endif /* __CONFIG_KM83XX_H */
 /*
  * System IO Config
  */
diff --git a/include/configs/kmtegr1.h b/include/configs/kmtegr1.h
index 27f8345708..c731c0666f 100644
--- a/include/configs/kmtegr1.h
+++ b/include/configs/kmtegr1.h
@@ -20,8 +20,6 @@
  * High Level Configuration Options
  */
 
-/* This needs to be set prior to including km83xx-common.h */
-
 #define CONFIG_HOSTNAME   "kmtegr1"
 #define CONFIG_KM_BOARD_NAME   "kmtegr1"
 #define CONFIG_KM_UBI_PARTITION_NAME_BOOT "ubi0"
@@ -43,16 +41,6 @@
 
 #define CONFIG_KM_DEF_ARCH "arch=ppc_82xx\0"
 
-/* include common defines/options for all 83xx Keymile boards */
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * (C) Copyright 2010
- * Heiko Schocher, DENX Software Engineering, [hidden email].
- */
-
-#ifndef __CONFIG_KM83XX_H
-#define __CONFIG_KM83XX_H
-
 /* include common defines/options for all Keymile boards */
 #include "km/keymile-common.h"
 #include "km/km-powerpc.h"
@@ -185,11 +173,6 @@
 #define CONFIG_UEC_ETH
 #define CONFIG_ETHPRIME "UEC0"
 
-#if !defined(CONFIG_ARCH_MPC8309)
-#define CONFIG_UEC_ETH1 /* GETH1 */
-#define UEC_VERBOSE_DEBUG 1
-#endif
-
 #ifdef CONFIG_UEC_ETH1
 #define CONFIG_SYS_UEC1_UCC_NUM 3 /* UCC4 */
 #define CONFIG_SYS_UEC1_RX_CLK QE_CLK_NONE /* not used in RMII Mode */
@@ -343,7 +326,6 @@
 #define CONFIG_HAS_ETH0
 #endif
 
-#endif /* __CONFIG_KM83XX_H */
 /* QE microcode/firmware address */
 #define CONFIG_SYS_QE_FMAN_FW_IN_NOR
 /* between the u-boot partition and env */
diff --git a/include/configs/kmtepr2.h b/include/configs/kmtepr2.h
index ed70f884c8..ca7a1477e2 100644
--- a/include/configs/kmtepr2.h
+++ b/include/configs/kmtepr2.h
@@ -34,16 +34,6 @@
 
 #define CONFIG_KM_DEF_ARCH "arch=ppc_8xx\0"
 
-/* include common defines/options for all 83xx Keymile boards */
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * (C) Copyright 2010
- * Heiko Schocher, DENX Software Engineering, [hidden email].
- */
-
-#ifndef __CONFIG_KM83XX_H
-#define __CONFIG_KM83XX_H
-
 /* include common defines/options for all Keymile boards */
 #include "km/keymile-common.h"
 #include "km/km-powerpc.h"
@@ -176,10 +166,8 @@
 #define CONFIG_UEC_ETH
 #define CONFIG_ETHPRIME "UEC0"
 
-#if !defined(CONFIG_ARCH_MPC8309)
 #define CONFIG_UEC_ETH1 /* GETH1 */
 #define UEC_VERBOSE_DEBUG 1
-#endif
 
 #ifdef CONFIG_UEC_ETH1
 #define CONFIG_SYS_UEC1_UCC_NUM 3 /* UCC4 */
@@ -334,7 +322,6 @@
 #define CONFIG_HAS_ETH0
 #endif
 
-#endif /* __CONFIG_KM83XX_H */
 /*
  * System IO Config
  */
diff --git a/include/configs/kmvect1.h b/include/configs/kmvect1.h
index 446161e157..9eae4cdf07 100644
--- a/include/configs/kmvect1.h
+++ b/include/configs/kmvect1.h
@@ -20,8 +20,6 @@
  * High Level Configuration Options
  */
 
-/* This needs to be set prior to including km83xx-common.h */
-
 #define CONFIG_HOSTNAME "kmvect1"
 #define CONFIG_KM_BOARD_NAME   "kmvect1"
 /* at end of uboot partition, before env */
@@ -35,16 +33,6 @@
 
 #define CONFIG_KM_DEF_ARCH "arch=ppc_82xx\0"
 
-/* include common defines/options for all 83xx Keymile boards */
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * (C) Copyright 2010
- * Heiko Schocher, DENX Software Engineering, [hidden email].
- */
-
-#ifndef __CONFIG_KM83XX_H
-#define __CONFIG_KM83XX_H
-
 /* include common defines/options for all Keymile boards */
 #include "km/keymile-common.h"
 #include "km/km-powerpc.h"
@@ -177,11 +165,6 @@
 #define CONFIG_UEC_ETH
 #define CONFIG_ETHPRIME "UEC0"
 
-#if !defined(CONFIG_ARCH_MPC8309)
-#define CONFIG_UEC_ETH1 /* GETH1 */
-#define UEC_VERBOSE_DEBUG 1
-#endif
-
 #ifdef CONFIG_UEC_ETH1
 #define CONFIG_SYS_UEC1_UCC_NUM 3 /* UCC4 */
 #define CONFIG_SYS_UEC1_RX_CLK QE_CLK_NONE /* not used in RMII Mode */
@@ -335,7 +318,6 @@
 #define CONFIG_HAS_ETH0
 #endif
 
-#endif /* __CONFIG_KM83XX_H */
 /* QE microcode/firmware address */
 #define CONFIG_SYS_QE_FMAN_FW_IN_NOR
 /* between the u-boot partition and env */
diff --git a/include/configs/suvd3.h b/include/configs/suvd3.h
index 34e97ef9fd..a652343d95 100644
--- a/include/configs/suvd3.h
+++ b/include/configs/suvd3.h
@@ -20,8 +20,6 @@
  * High Level Configuration Options
  */
 
-/* This needs to be set prior to including km83xx-common.h */
-
 #define CONFIG_HOSTNAME "suvd3"
 #define CONFIG_KM_BOARD_NAME   "suvd3"
 
@@ -33,16 +31,6 @@
 
 #define CONFIG_KM_DEF_ARCH "arch=ppc_8xx\0"
 
-/* include common defines/options for all 83xx Keymile boards */
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * (C) Copyright 2010
- * Heiko Schocher, DENX Software Engineering, [hidden email].
- */
-
-#ifndef __CONFIG_KM83XX_H
-#define __CONFIG_KM83XX_H
-
 /* include common defines/options for all Keymile boards */
 #include "km/keymile-common.h"
 #include "km/km-powerpc.h"
@@ -175,10 +163,8 @@
 #define CONFIG_UEC_ETH
 #define CONFIG_ETHPRIME "UEC0"
 
-#if !defined(CONFIG_ARCH_MPC8309)
 #define CONFIG_UEC_ETH1 /* GETH1 */
 #define UEC_VERBOSE_DEBUG 1
-#endif
 
 #ifdef CONFIG_UEC_ETH1
 #define CONFIG_SYS_UEC1_UCC_NUM 3 /* UCC4 */
@@ -333,7 +319,6 @@
 #define CONFIG_HAS_ETH0
 #endif
 
-#endif /* __CONFIG_KM83XX_H */
 /*
  * System IO Config
  */
diff --git a/include/configs/tuge1.h b/include/configs/tuge1.h
index d2e0466cd8..cfd317f6e1 100644
--- a/include/configs/tuge1.h
+++ b/include/configs/tuge1.h
@@ -34,16 +34,6 @@
 
 #define CONFIG_KM_DEF_ARCH "arch=ppc_8xx\0"
 
-/* include common defines/options for all 83xx Keymile boards */
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * (C) Copyright 2010
- * Heiko Schocher, DENX Software Engineering, [hidden email].
- */
-
-#ifndef __CONFIG_KM83XX_H
-#define __CONFIG_KM83XX_H
-
 /* include common defines/options for all Keymile boards */
 #include "km/keymile-common.h"
 #include "km/km-powerpc.h"
@@ -176,10 +166,8 @@
 #define CONFIG_UEC_ETH
 #define CONFIG_ETHPRIME "UEC0"
 
-#if !defined(CONFIG_ARCH_MPC8309)
 #define CONFIG_UEC_ETH1 /* GETH1 */
 #define UEC_VERBOSE_DEBUG 1
-#endif
 
 #ifdef CONFIG_UEC_ETH1
 #define CONFIG_SYS_UEC1_UCC_NUM 3 /* UCC4 */
@@ -334,7 +322,6 @@
 #define CONFIG_HAS_ETH0
 #endif
 
-#endif /* __CONFIG_KM83XX_H */
 /*
  * System IO Config
  */
diff --git a/include/configs/tuxx1.h b/include/configs/tuxx1.h
index f1d12e456f..b3bfb7b7c5 100644
--- a/include/configs/tuxx1.h
+++ b/include/configs/tuxx1.h
@@ -34,16 +34,6 @@
 
 #define CONFIG_KM_DEF_ARCH "arch=ppc_8xx\0"
 
-/* include common defines/options for all 83xx Keymile boards */
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * (C) Copyright 2010
- * Heiko Schocher, DENX Software Engineering, [hidden email].
- */
-
-#ifndef __CONFIG_KM83XX_H
-#define __CONFIG_KM83XX_H
-
 /* include common defines/options for all Keymile boards */
 #include "km/keymile-common.h"
 #include "km/km-powerpc.h"
@@ -176,10 +166,8 @@
 #define CONFIG_UEC_ETH
 #define CONFIG_ETHPRIME "UEC0"
 
-#if !defined(CONFIG_ARCH_MPC8309)
 #define CONFIG_UEC_ETH1 /* GETH1 */
 #define UEC_VERBOSE_DEBUG 1
-#endif
 
 #ifdef CONFIG_UEC_ETH1
 #define CONFIG_SYS_UEC1_UCC_NUM 3 /* UCC4 */
@@ -334,7 +322,6 @@
 #define CONFIG_HAS_ETH0
 #endif
 
-#endif /* __CONFIG_KM83XX_H */
 /*
  * System IO Config
  */
--
2.16.4

_______________________________________________
U-Boot mailing list
[hidden email]
https://lists.denx.de/listinfo/u-boot
Reply | Threaded
Open this post in threaded view
|

[PATCH 16/48] keymile: Make distinct kmeter1, and kmcoge5ne configs

Mario Six
In reply to this post by Mario Six
The kmeter1, and kmcoge5ne boards also build from the same config
file with #ifdef logic.

Create a separate include config for each board with the #ifdef logic
resolved as needed.

Signed-off-by: Mario Six <[hidden email]>
---
 arch/powerpc/cpu/mpc83xx/Kconfig          |  11 +-
 board/keymile/km83xx/Kconfig              |  17 +-
 board/keymile/km83xx/km83xx.c             |   2 +-
 configs/kmcoge5ne_defconfig               |   3 +-
 configs/kmeter1_defconfig                 |   3 +-
 include/configs/{km8360.h => kmcoge5ne.h} |  10 +-
 include/configs/kmeter1.h                 | 557 ++++++++++++++++++++++++++++++
 7 files changed, 589 insertions(+), 14 deletions(-)
 rename include/configs/{km8360.h => kmcoge5ne.h} (98%)
 create mode 100644 include/configs/kmeter1.h

diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig b/arch/powerpc/cpu/mpc83xx/Kconfig
index 1ebb092f0b..29d84f363d 100644
--- a/arch/powerpc/cpu/mpc83xx/Kconfig
+++ b/arch/powerpc/cpu/mpc83xx/Kconfig
@@ -80,8 +80,15 @@ config TARGET_IDS8313
  select DM
  imply CMD_DM
 
-config TARGET_KM8360
- bool "Support km8360"
+config TARGET_KMETER1
+ bool "Support kmeter1"
+ select ARCH_MPC8360
+ imply CMD_CRAMFS
+ imply CMD_DIAG
+ imply FS_CRAMFS
+
+config TARGET_KMCOGE5NE
+ bool "Support kmcoge5ne"
  select ARCH_MPC8360
  imply CMD_CRAMFS
  imply CMD_DIAG
diff --git a/board/keymile/km83xx/Kconfig b/board/keymile/km83xx/Kconfig
index 0c4fa0b7fd..fbbbb17034 100644
--- a/board/keymile/km83xx/Kconfig
+++ b/board/keymile/km83xx/Kconfig
@@ -1,4 +1,4 @@
-if TARGET_KM8360
+if TARGET_KMETER1
 
 config SYS_BOARD
  default "km83xx"
@@ -7,7 +7,20 @@ config SYS_VENDOR
  default "keymile"
 
 config SYS_CONFIG_NAME
- default "km8360"
+ default "kmeter1"
+
+endif
+
+if TARGET_KMCOGE5NE
+
+config SYS_BOARD
+ default "km83xx"
+
+config SYS_VENDOR
+ default "keymile"
+
+config SYS_CONFIG_NAME
+ default "kmcoge5ne"
 
 endif
 
diff --git a/board/keymile/km83xx/km83xx.c b/board/keymile/km83xx/km83xx.c
index 12044ee0d7..1fd6f91901 100644
--- a/board/keymile/km83xx/km83xx.c
+++ b/board/keymile/km83xx/km83xx.c
@@ -271,7 +271,7 @@ int last_stage_init(void)
  }
 #endif
 
-#if defined(CONFIG_KMCOGE5NE)
+#if defined(CONFIG_TARGET_KMCOGE5NE)
  struct bfticu_iomap *base =
  (struct bfticu_iomap *)CONFIG_SYS_BFTIC3_BASE;
  u8 dip_switch = in_8((u8 *)&(base->mswitch)) & BFTICU_DIPSWITCH_MASK;
diff --git a/configs/kmcoge5ne_defconfig b/configs/kmcoge5ne_defconfig
index 941c1f0b72..649e07c5f4 100644
--- a/configs/kmcoge5ne_defconfig
+++ b/configs/kmcoge5ne_defconfig
@@ -1,10 +1,9 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xF0000000
 CONFIG_MPC83xx=y
-CONFIG_TARGET_KM8360=y
+CONFIG_TARGET_KMCOGE5NE=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
-CONFIG_SYS_EXTRA_OPTIONS="KMCOGE5NE"
 CONFIG_MISC_INIT_R=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_BOARD_EARLY_INIT_R=y
diff --git a/configs/kmeter1_defconfig b/configs/kmeter1_defconfig
index 2d5f284411..cbb74e0022 100644
--- a/configs/kmeter1_defconfig
+++ b/configs/kmeter1_defconfig
@@ -1,10 +1,9 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xF0000000
 CONFIG_MPC83xx=y
-CONFIG_TARGET_KM8360=y
+CONFIG_TARGET_KMETER1=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
-CONFIG_SYS_EXTRA_OPTIONS="KMETER1"
 CONFIG_MISC_INIT_R=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_BOARD_EARLY_INIT_R=y
diff --git a/include/configs/km8360.h b/include/configs/kmcoge5ne.h
similarity index 98%
rename from include/configs/km8360.h
rename to include/configs/kmcoge5ne.h
index b22345bcc2..29d977b901 100644
--- a/include/configs/km8360.h
+++ b/include/configs/kmcoge5ne.h
@@ -12,11 +12,11 @@
 #define CONFIG_SYS_KMBEC_FPGA_BASE 0xE8000000
 #define CONFIG_SYS_KMBEC_FPGA_SIZE 64
 
-#if defined CONFIG_KMETER1
+#if defined CONFIG_TARGET_KMETER1
 #define CONFIG_HOSTNAME "kmeter1"
 #define CONFIG_KM_BOARD_NAME   "kmeter1"
 #define CONFIG_KM_DEF_NETDEV "netdev=eth2\0"
-#elif defined CONFIG_KMCOGE5NE
+#elif defined CONFIG_TARGET_KMCOGE5NE
 #define CONFIG_HOSTNAME "kmcoge5ne"
 #define CONFIG_KM_BOARD_NAME "kmcoge5ne"
 #define CONFIG_KM_DEF_NETDEV "netdev=eth1\0"
@@ -361,7 +361,7 @@
 
 #define CONFIG_SYS_DDR_SDRAM_CFG2 0x00401000
 
-#ifdef CONFIG_KMCOGE5NE
+#ifdef CONFIG_TARGET_KMCOGE5NE
 /**
  * KMCOGE5NE has 512 MB RAM
  */
@@ -457,7 +457,7 @@
  OR_GPCM_TRLX | \
  OR_GPCM_EAD)
 
-#ifdef CONFIG_KMCOGE5NE
+#ifdef CONFIG_TARGET_KMCOGE5NE
 /*
  * BFTIC3 on the local bus CS4
  */
@@ -502,7 +502,7 @@
 
 #define CONFIG_SYS_DBAT5U CONFIG_SYS_IBAT5U
 
-#ifdef CONFIG_KMCOGE5NE
+#ifdef CONFIG_TARGET_KMCOGE5NE
 /* BFTIC3:  icache cacheable, but dcache-inhibit and guarded */
 #define CONFIG_SYS_IBAT6L (\
  CONFIG_SYS_BFTIC3_BASE | \
diff --git a/include/configs/kmeter1.h b/include/configs/kmeter1.h
new file mode 100644
index 0000000000..00fb0e2f48
--- /dev/null
+++ b/include/configs/kmeter1.h
@@ -0,0 +1,557 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * (C) Copyright 2012
+ * Holger Brunck, Keymile GmbH Hannover, <[hidden email]>
+ * Christian Herzig, Keymile AG Switzerland, <[hidden email]>
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+/* KMBEC FPGA (PRIO) */
+#define CONFIG_SYS_KMBEC_FPGA_BASE 0xE8000000
+#define CONFIG_SYS_KMBEC_FPGA_SIZE 64
+
+#if defined CONFIG_TARGET_KMETER1
+#define CONFIG_HOSTNAME "kmeter1"
+#define CONFIG_KM_BOARD_NAME   "kmeter1"
+#define CONFIG_KM_DEF_NETDEV "netdev=eth2\0"
+#elif defined CONFIG_TARGET_KMCOGE5NE
+#define CONFIG_HOSTNAME "kmcoge5ne"
+#define CONFIG_KM_BOARD_NAME "kmcoge5ne"
+#define CONFIG_KM_DEF_NETDEV "netdev=eth1\0"
+#define CONFIG_NAND_ECC_BCH
+#define CONFIG_NAND_KMETER1
+#define CONFIG_SYS_MAX_NAND_DEVICE 1
+#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"
+#else
+#error ("Board not supported")
+#endif
+
+/*
+ * High Level Configuration Options
+ */
+#define CONFIG_QE /* Has QE */
+
+/* include common defines/options for all Keymile boards */
+#include "km/keymile-common.h"
+#include "km/km-powerpc.h"
+
+/*
+ * System Clock Setup
+ */
+#define CONFIG_83XX_CLKIN 66000000
+#define CONFIG_SYS_CLK_FREQ 66000000
+#define CONFIG_83XX_PCICLK 66000000
+
+/*
+ * IMMR new address
+ */
+#define CONFIG_SYS_IMMR 0xE0000000
+
+/*
+ * Bus Arbitration Configuration Register (ACR)
+ */
+#define CONFIG_SYS_ACR_PIPE_DEP 3       /* pipeline depth 4 transactions */
+#define CONFIG_SYS_ACR_RPTCNT   3       /* 4 consecutive transactions */
+#define CONFIG_SYS_ACR_APARK    0       /* park bus to master (below) */
+#define CONFIG_SYS_ACR_PARKM    3       /* parking master = QuiccEngine */
+
+/*
+ * DDR Setup
+ */
+#define CONFIG_SYS_DDR_BASE 0x00000000 /* DDR is system memory */
+#define CONFIG_SYS_SDRAM_BASE CONFIG_SYS_DDR_BASE
+#define CONFIG_SYS_SDRAM_BASE2 (CONFIG_SYS_SDRAM_BASE + 0x10000000) /* +256M */
+
+#define CONFIG_SYS_DDR_SDRAM_BASE CONFIG_SYS_DDR_BASE
+#define CONFIG_SYS_DDR_SDRAM_CLK_CNTL (DDR_SDRAM_CLK_CNTL_SS_EN | \
+ DDR_SDRAM_CLK_CNTL_CLK_ADJUST_05)
+
+#define CFG_83XX_DDR_USES_CS0
+
+/*
+ * Manually set up DDR parameters
+ */
+#define CONFIG_DDR_II
+#define CONFIG_SYS_DDR_SIZE 2048 /* MB */
+
+/*
+ * The reserved memory
+ */
+#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE /* start of monitor */
+#define CONFIG_SYS_FLASH_BASE 0xF0000000
+
+#if (CONFIG_SYS_MONITOR_BASE < CONFIG_SYS_FLASH_BASE)
+#define CONFIG_SYS_RAMBOOT
+#endif
+
+/* Reserve 768 kB for Mon */
+#define CONFIG_SYS_MONITOR_LEN (768 * 1024)
+
+/*
+ * Initial RAM Base Address Setup
+ */
+#define CONFIG_SYS_INIT_RAM_LOCK
+#define CONFIG_SYS_INIT_RAM_ADDR 0xE6000000 /* Initial RAM address */
+#define CONFIG_SYS_INIT_RAM_SIZE 0x1000 /* End of used area in RAM */
+#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_SIZE - \
+ GENERATED_GBL_DATA_SIZE)
+
+/*
+ * Init Local Bus Memory Controller:
+ *
+ * Bank Bus     Machine PortSz  Size  Device
+ * ---- ---     ------- ------  -----  ------
+ *  0   Local   GPCM    16 bit  256MB FLASH
+ *  1   Local   GPCM     8 bit  128MB GPIO/PIGGY
+ *
+ */
+/*
+ * FLASH on the Local Bus
+ */
+#define CONFIG_SYS_FLASH_CFI /* use the Common Flash Interface */
+#define CONFIG_FLASH_CFI_DRIVER /* use the CFI driver */
+#define CONFIG_SYS_FLASH_SIZE 256 /* max FLASH size is 256M */
+#define CONFIG_SYS_FLASH_PROTECTION
+#define CONFIG_SYS_FLASH_USE_BUFFER_WRITE
+
+#define CONFIG_SYS_LBLAWBAR0_PRELIM CONFIG_SYS_FLASH_BASE
+#define CONFIG_SYS_LBLAWAR0_PRELIM (LBLAWAR_EN | LBLAWAR_256MB)
+
+#define CONFIG_SYS_BR0_PRELIM (CONFIG_SYS_FLASH_BASE | \
+ BR_PS_16 | /* 16 bit port size */ \
+ BR_MS_GPCM | /* MSEL = GPCM */ \
+ BR_V)
+
+#define CONFIG_SYS_OR0_PRELIM (MEG_TO_AM(CONFIG_SYS_FLASH_SIZE) | \
+ OR_GPCM_CSNT | OR_GPCM_ACS_DIV2 | \
+ OR_GPCM_SCY_5 | \
+ OR_GPCM_TRLX_SET | OR_GPCM_EAD)
+
+#define CONFIG_SYS_MAX_FLASH_BANKS 1   /* max num of flash banks */
+#define CONFIG_SYS_MAX_FLASH_SECT 512 /* max num of sects on one chip */
+#define CONFIG_SYS_FLASH_BANKS_LIST { CONFIG_SYS_FLASH_BASE }
+
+/*
+ * PRIO1/PIGGY on the local bus CS1
+ */
+/* Window base at flash base */
+#define CONFIG_SYS_LBLAWBAR1_PRELIM CONFIG_SYS_KMBEC_FPGA_BASE
+#define CONFIG_SYS_LBLAWAR1_PRELIM (LBLAWAR_EN | LBLAWAR_128MB)
+
+#define CONFIG_SYS_BR1_PRELIM (CONFIG_SYS_KMBEC_FPGA_BASE | \
+ BR_PS_8 | /* 8 bit port size */ \
+ BR_MS_GPCM | /* MSEL = GPCM */ \
+ BR_V)
+#define CONFIG_SYS_OR1_PRELIM (MEG_TO_AM(CONFIG_SYS_KMBEC_FPGA_SIZE) | \
+ OR_GPCM_CSNT | OR_GPCM_ACS_DIV2 | \
+ OR_GPCM_SCY_2 | \
+ OR_GPCM_TRLX_SET | OR_GPCM_EAD)
+
+/*
+ * Serial Port
+ */
+#define CONFIG_SYS_NS16550_SERIAL
+#define CONFIG_SYS_NS16550_REG_SIZE 1
+#define CONFIG_SYS_NS16550_CLK get_bus_freq(0)
+
+#define CONFIG_SYS_NS16550_COM1 (CONFIG_SYS_IMMR+0x4500)
+#define CONFIG_SYS_NS16550_COM2 (CONFIG_SYS_IMMR+0x4600)
+
+/*
+ * QE UEC ethernet configuration
+ */
+#define CONFIG_UEC_ETH
+#define CONFIG_ETHPRIME "UEC0"
+
+#if !defined(CONFIG_MPC8309)
+#define CONFIG_UEC_ETH1 /* GETH1 */
+#define UEC_VERBOSE_DEBUG 1
+#endif
+
+#ifdef CONFIG_UEC_ETH1
+#define CONFIG_SYS_UEC1_UCC_NUM 3 /* UCC4 */
+#define CONFIG_SYS_UEC1_RX_CLK QE_CLK_NONE /* not used in RMII Mode */
+#define CONFIG_SYS_UEC1_TX_CLK QE_CLK17
+#define CONFIG_SYS_UEC1_ETH_TYPE FAST_ETH
+#define CONFIG_SYS_UEC1_PHY_ADDR 0
+#define CONFIG_SYS_UEC1_INTERFACE_TYPE PHY_INTERFACE_MODE_RMII
+#define CONFIG_SYS_UEC1_INTERFACE_SPEED 100
+#endif
+
+/*
+ * Environment
+ */
+
+#ifndef CONFIG_SYS_RAMBOOT
+#ifndef CONFIG_ENV_ADDR
+#define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE + \
+ CONFIG_SYS_MONITOR_LEN)
+#endif
+#define CONFIG_ENV_SECT_SIZE 0x20000 /* 128K(one sector) for env */
+#ifndef CONFIG_ENV_OFFSET
+#define CONFIG_ENV_OFFSET (CONFIG_SYS_MONITOR_LEN)
+#endif
+
+/* Address and size of Redundant Environment Sector */
+#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + \
+ CONFIG_ENV_SECT_SIZE)
+#define CONFIG_ENV_SIZE_REDUND (CONFIG_ENV_SIZE)
+
+#else /* CFG_SYS_RAMBOOT */
+#define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE - 0x1000)
+#define CONFIG_ENV_SIZE 0x2000
+#endif /* CFG_SYS_RAMBOOT */
+
+/* I2C */
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_NUM_I2C_BUSES 4
+#define CONFIG_SYS_I2C_MAX_HOPS 1
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED 200000
+#define CONFIG_SYS_FSL_I2C_SLAVE 0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET 0x3000
+#define CONFIG_SYS_I2C_OFFSET 0x3000
+#define CONFIG_SYS_FSL_I2C2_SPEED 200000
+#define CONFIG_SYS_FSL_I2C2_SLAVE 0x7F
+#define CONFIG_SYS_FSL_I2C2_OFFSET 0x3100
+#define CONFIG_SYS_I2C_BUSES {{0, {I2C_NULL_HOP} }, \
+ {0, {{I2C_MUX_PCA9547, 0x70, 2} } }, \
+ {0, {{I2C_MUX_PCA9547, 0x70, 1} } }, \
+ {1, {I2C_NULL_HOP} } }
+
+#define CONFIG_KM_IVM_BUS 2 /* I2C2 (Mux-Port 1)*/
+
+#if defined(CONFIG_CMD_NAND)
+#define CONFIG_NAND_KMETER1
+#define CONFIG_SYS_MAX_NAND_DEVICE 1
+#define CONFIG_SYS_NAND_BASE CONFIG_SYS_KMBEC_FPGA_BASE
+#endif
+
+/*
+ * For booting Linux, the board info and command line data
+ * have to be in the first 8 MB of memory, since this is
+ * the maximum mapped by the Linux kernel during initialization.
+ */
+#define CONFIG_SYS_BOOTMAPSZ (8 << 20)
+
+/*
+ * Core HID Setup
+ */
+#define CONFIG_SYS_HID0_INIT 0x000000000
+#define CONFIG_SYS_HID0_FINAL (HID0_ENABLE_MACHINE_CHECK | \
+ HID0_ENABLE_INSTRUCTION_CACHE)
+#define CONFIG_SYS_HID2 HID2_HBE
+
+/*
+ * MMU Setup
+ */
+
+#define CONFIG_HIGH_BATS 1 /* High BATs supported */
+
+/* DDR: cache cacheable */
+#define CONFIG_SYS_IBAT0L (CONFIG_SYS_SDRAM_BASE | BATL_PP_RW | \
+ BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_IBAT0U (CONFIG_SYS_SDRAM_BASE | BATU_BL_256M | \
+ BATU_VS | BATU_VP)
+#define CONFIG_SYS_DBAT0L CONFIG_SYS_IBAT0L
+#define CONFIG_SYS_DBAT0U CONFIG_SYS_IBAT0U
+
+/* IMMRBAR & PCI IO: cache-inhibit and guarded */
+#define CONFIG_SYS_IBAT1L (CONFIG_SYS_IMMR | BATL_PP_RW | \
+ BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_IBAT1U (CONFIG_SYS_IMMR | BATU_BL_4M | BATU_VS \
+ | BATU_VP)
+#define CONFIG_SYS_DBAT1L CONFIG_SYS_IBAT1L
+#define CONFIG_SYS_DBAT1U CONFIG_SYS_IBAT1U
+
+/* PRIO1, PIGGY:  icache cacheable, but dcache-inhibit and guarded */
+#define CONFIG_SYS_IBAT2L (CONFIG_SYS_KMBEC_FPGA_BASE | BATL_PP_RW | \
+ BATL_MEMCOHERENCE)
+#define CONFIG_SYS_IBAT2U (CONFIG_SYS_KMBEC_FPGA_BASE | BATU_BL_128M | \
+ BATU_VS | BATU_VP)
+#define CONFIG_SYS_DBAT2L (CONFIG_SYS_KMBEC_FPGA_BASE | BATL_PP_RW | \
+ BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_DBAT2U CONFIG_SYS_IBAT2U
+
+/* FLASH: icache cacheable, but dcache-inhibit and guarded */
+#define CONFIG_SYS_IBAT3L (CONFIG_SYS_FLASH_BASE | BATL_PP_RW | \
+ BATL_MEMCOHERENCE)
+#define CONFIG_SYS_IBAT3U (CONFIG_SYS_FLASH_BASE | BATU_BL_256M | \
+ BATU_VS | BATU_VP)
+#define CONFIG_SYS_DBAT3L (CONFIG_SYS_FLASH_BASE | BATL_PP_RW | \
+ BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_DBAT3U CONFIG_SYS_IBAT3U
+
+/* Stack in dcache: cacheable, no memory coherence */
+#define CONFIG_SYS_IBAT4L (CONFIG_SYS_INIT_RAM_ADDR | BATL_PP_RW)
+#define CONFIG_SYS_IBAT4U (CONFIG_SYS_INIT_RAM_ADDR | BATU_BL_128K | \
+ BATU_VS | BATU_VP)
+#define CONFIG_SYS_DBAT4L CONFIG_SYS_IBAT4L
+#define CONFIG_SYS_DBAT4U CONFIG_SYS_IBAT4U
+
+/*
+ * Internal Definitions
+ */
+#define BOOTFLASH_START 0xF0000000
+
+#define CONFIG_KM_CONSOLE_TTY "ttyS0"
+
+/*
+ * Environment Configuration
+ */
+#define CONFIG_ENV_OVERWRITE
+#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" \
+ ""
+
+#if defined(CONFIG_UEC_ETH)
+#define CONFIG_HAS_ETH0
+#endif
+
+/*
+ * System IO Setup
+ */
+#define CONFIG_SYS_SICRH (SICRH_UC1EOBI | SICRH_UC2E1OBI)
+
+/*
+ * Hardware Reset Configuration Word
+ */
+#define CONFIG_SYS_HRCW_LOW (\
+ HRCWL_CSB_TO_CLKIN_4X1 | \
+ HRCWL_CORE_TO_CSB_2X1 | \
+ HRCWL_CE_PLL_VCO_DIV_2 | \
+ HRCWL_CE_TO_PLL_1X6)
+
+#define CONFIG_SYS_HRCW_HIGH (\
+ HRCWH_CORE_ENABLE | \
+ HRCWH_FROM_0X00000100 | \
+ HRCWH_BOOTSEQ_DISABLE | \
+ HRCWH_SW_WATCHDOG_DISABLE | \
+ HRCWH_ROM_LOC_LOCAL_16BIT | \
+ HRCWH_BIG_ENDIAN | \
+ HRCWH_LALE_EARLY | \
+ HRCWH_LDP_CLEAR)
+
+/**
+ * DDR RAM settings
+ */
+#define CONFIG_SYS_DDR_SDRAM_CFG (\
+ SDRAM_CFG_SDRAM_TYPE_DDR2 | \
+ SDRAM_CFG_SREN | \
+ SDRAM_CFG_HSE)
+
+#define CONFIG_SYS_DDR_SDRAM_CFG2 0x00401000
+
+#ifdef CONFIG_TARGET_KMCOGE5NE
+/**
+ * KMCOGE5NE has 512 MB RAM
+ */
+#define CONFIG_SYS_DDR_CS0_CONFIG (\
+ CSCONFIG_EN | \
+ CSCONFIG_AP | \
+ CSCONFIG_ODT_WR_ONLY_CURRENT | \
+ CSCONFIG_BANK_BIT_3 | \
+ CSCONFIG_ROW_BIT_13 | \
+ CSCONFIG_COL_BIT_10)
+#else
+#define CONFIG_SYS_DDR_CS0_CONFIG (CSCONFIG_EN | CSCONFIG_AP | \
+ CSCONFIG_ROW_BIT_13 | \
+ CSCONFIG_COL_BIT_10 | \
+ CSCONFIG_ODT_WR_ONLY_CURRENT)
+#endif
+
+#define CONFIG_SYS_DDR_CLK_CNTL (\
+ DDR_SDRAM_CLK_CNTL_CLK_ADJUST_05)
+
+#define CONFIG_SYS_DDR_INTERVAL (\
+ (0x080 << SDRAM_INTERVAL_BSTOPRE_SHIFT) | \
+ (0x203 << SDRAM_INTERVAL_REFINT_SHIFT))
+
+#define CONFIG_SYS_DDR_CS0_BNDS 0x0000007f
+
+#define CONFIG_SYS_DDRCDR (\
+ DDRCDR_EN | \
+ DDRCDR_Q_DRN)
+#define CONFIG_SYS_DDR_MODE 0x47860452
+#define CONFIG_SYS_DDR_MODE2 0x8080c000
+
+#define CONFIG_SYS_DDR_TIMING_0 (\
+ (2 << TIMING_CFG0_MRS_CYC_SHIFT) | \
+ (8 << TIMING_CFG0_ODT_PD_EXIT_SHIFT) | \
+ (6 << TIMING_CFG0_PRE_PD_EXIT_SHIFT) | \
+ (2 << TIMING_CFG0_ACT_PD_EXIT_SHIFT) | \
+ (0 << TIMING_CFG0_WWT_SHIFT) | \
+ (0 << TIMING_CFG0_RRT_SHIFT) | \
+ (0 << TIMING_CFG0_WRT_SHIFT) | \
+ (0 << TIMING_CFG0_RWT_SHIFT))
+
+#define CONFIG_SYS_DDR_TIMING_1 ((TIMING_CFG1_CASLAT_50) | \
+ (2 << TIMING_CFG1_WRTORD_SHIFT) | \
+ (2 << TIMING_CFG1_ACTTOACT_SHIFT) | \
+ (3 << TIMING_CFG1_WRREC_SHIFT) | \
+ (7 << TIMING_CFG1_REFREC_SHIFT) | \
+ (3 << TIMING_CFG1_ACTTORW_SHIFT) | \
+ (8 << TIMING_CFG1_ACTTOPRE_SHIFT) | \
+ (3 << TIMING_CFG1_PRETOACT_SHIFT))
+
+#define CONFIG_SYS_DDR_TIMING_2 (\
+ (0xa << TIMING_CFG2_FOUR_ACT_SHIFT) | \
+ (3 << TIMING_CFG2_CKE_PLS_SHIFT) | \
+ (2 << TIMING_CFG2_WR_DATA_DELAY_SHIFT) | \
+ (2 << TIMING_CFG2_RD_TO_PRE_SHIFT) | \
+ (4 << TIMING_CFG2_WR_LAT_DELAY_SHIFT) | \
+ (5 << TIMING_CFG2_CPO_SHIFT) | \
+ (0 << TIMING_CFG2_ADD_LAT_SHIFT))
+
+#define CONFIG_SYS_DDR_TIMING_3 0x00000000
+
+/* EEprom support */
+#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
+
+/*
+ * Local Bus Configuration & Clock Setup
+ */
+#define CONFIG_SYS_LCRR_DBYP LCRR_DBYP
+#define CONFIG_SYS_LCRR_EADC LCRR_EADC_2
+#define CONFIG_SYS_LCRR_CLKDIV LCRR_CLKDIV_4
+
+/*
+ * PAXE on the local bus CS3
+ */
+#define CONFIG_SYS_PAXE_BASE 0xA0000000
+#define CONFIG_SYS_PAXE_SIZE 256
+
+#define CONFIG_SYS_LBLAWBAR3_PRELIM CONFIG_SYS_PAXE_BASE
+
+#define CONFIG_SYS_LBLAWAR3_PRELIM 0x8000001C /* 512MB window size */
+
+#define CONFIG_SYS_BR3_PRELIM (\
+ CONFIG_SYS_PAXE_BASE | \
+ (1 << BR_PS_SHIFT) | \
+ BR_V)
+
+#define CONFIG_SYS_OR3_PRELIM (\
+ MEG_TO_AM(CONFIG_SYS_PAXE_SIZE) | \
+ OR_GPCM_CSNT | \
+ OR_GPCM_ACS_DIV2 | \
+ OR_GPCM_SCY_2 | \
+ OR_GPCM_TRLX | \
+ OR_GPCM_EAD)
+
+#ifdef CONFIG_TARGET_KMCOGE5NE
+/*
+ * BFTIC3 on the local bus CS4
+ */
+#define CONFIG_SYS_BFTIC3_BASE 0xB0000000
+#define CONFIG_SYS_BFTIC3_SIZE 256
+
+#define CONFIG_SYS_BR4_PRELIM (\
+ CONFIG_SYS_BFTIC3_BASE |\
+ (1 << BR_PS_SHIFT) | \
+ BR_V)
+
+#define CONFIG_SYS_OR4_PRELIM (\
+ MEG_TO_AM(CONFIG_SYS_BFTIC3_SIZE) |\
+ OR_GPCM_CSNT | \
+ OR_GPCM_ACS_DIV2 |\
+ OR_GPCM_SCY_2 |\
+ OR_GPCM_TRLX |\
+ OR_GPCM_EAD)
+#endif
+
+/*
+ * MMU Setup
+ */
+
+/* PAXE:  icache cacheable, but dcache-inhibit and guarded */
+#define CONFIG_SYS_IBAT5L (\
+ CONFIG_SYS_PAXE_BASE | \
+ BATL_PP_10 | \
+ BATL_MEMCOHERENCE)
+
+#define CONFIG_SYS_IBAT5U (\
+ CONFIG_SYS_PAXE_BASE | \
+ BATU_BL_256M | \
+ BATU_VS | \
+ BATU_VP)
+
+#define CONFIG_SYS_DBAT5L (\
+ CONFIG_SYS_PAXE_BASE | \
+ BATL_PP_10 | \
+ BATL_CACHEINHIBIT | \
+ BATL_GUARDEDSTORAGE)
+
+#define CONFIG_SYS_DBAT5U CONFIG_SYS_IBAT5U
+
+#ifdef CONFIG_TARGET_KMCOGE5NE
+/* BFTIC3:  icache cacheable, but dcache-inhibit and guarded */
+#define CONFIG_SYS_IBAT6L (\
+ CONFIG_SYS_BFTIC3_BASE | \
+ BATL_PP_10 | \
+ BATL_MEMCOHERENCE)
+
+#define CONFIG_SYS_IBAT6U (\
+ CONFIG_SYS_BFTIC3_BASE | \
+ BATU_BL_256M | \
+ BATU_VS | \
+ BATU_VP)
+
+#define CONFIG_SYS_DBAT6L (\
+ CONFIG_SYS_BFTIC3_BASE | \
+ BATL_PP_10 | \
+ BATL_CACHEINHIBIT | \
+ BATL_GUARDEDSTORAGE)
+
+#define CONFIG_SYS_DBAT6U CONFIG_SYS_IBAT6U
+
+/* DDR/LBC SDRAM next 256M: cacheable */
+#define CONFIG_SYS_IBAT7L (\
+ CONFIG_SYS_SDRAM_BASE2 |\
+ BATL_PP_10 |\
+ BATL_CACHEINHIBIT |\
+ BATL_GUARDEDSTORAGE)
+
+#define CONFIG_SYS_IBAT7U (\
+ CONFIG_SYS_SDRAM_BASE2 |\
+ BATU_BL_256M |\
+ BATU_VS |\
+ BATU_VP)
+/* enable POST tests */
+#define CONFIG_POST (CONFIG_SYS_POST_MEMORY|CONFIG_SYS_POST_MEM_REGIONS)
+#define CONFIG_POST_EXTERNAL_WORD_FUNCS /* use own functions, not generic */
+#define CPM_POST_WORD_ADDR  CONFIG_SYS_MEMTEST_END
+#define CONFIG_TESTPIN_REG  gprt3 /* for kmcoge5ne */
+#define CONFIG_TESTPIN_MASK 0x20 /* for kmcoge5ne */
+
+#else
+#define CONFIG_SYS_IBAT6L (0)
+#define CONFIG_SYS_IBAT6U (0)
+#define CONFIG_SYS_IBAT7L (0)
+#define CONFIG_SYS_IBAT7U (0)
+#define CONFIG_SYS_DBAT6L CONFIG_SYS_IBAT6L
+#define CONFIG_SYS_DBAT6U CONFIG_SYS_IBAT6U
+#endif
+
+#define CONFIG_SYS_DBAT7L CONFIG_SYS_IBAT7L
+#define CONFIG_SYS_DBAT7U CONFIG_SYS_IBAT7U
+
+#endif /* CONFIG */
--
2.16.4

_______________________________________________
U-Boot mailing list
[hidden email]
https://lists.denx.de/listinfo/u-boot
Reply | Threaded
Open this post in threaded view
|

[PATCH 17/48] keymile: Simplify kmcoge5ne, kmeter1 configs

Mario Six
In reply to this post by Mario Six
Simplify the kmcoge5ne and kmeter1 configs to only include the #ifdefs
necessary for each board.

Signed-off-by: Mario Six <[hidden email]>
---
 include/configs/kmcoge5ne.h | 29 --------------
 include/configs/kmeter1.h   | 97 +--------------------------------------------
 2 files changed, 1 insertion(+), 125 deletions(-)

diff --git a/include/configs/kmcoge5ne.h b/include/configs/kmcoge5ne.h
index 29d977b901..87efaa4a7c 100644
--- a/include/configs/kmcoge5ne.h
+++ b/include/configs/kmcoge5ne.h
@@ -12,11 +12,6 @@
 #define CONFIG_SYS_KMBEC_FPGA_BASE 0xE8000000
 #define CONFIG_SYS_KMBEC_FPGA_SIZE 64
 
-#if defined CONFIG_TARGET_KMETER1
-#define CONFIG_HOSTNAME "kmeter1"
-#define CONFIG_KM_BOARD_NAME   "kmeter1"
-#define CONFIG_KM_DEF_NETDEV "netdev=eth2\0"
-#elif defined CONFIG_TARGET_KMCOGE5NE
 #define CONFIG_HOSTNAME "kmcoge5ne"
 #define CONFIG_KM_BOARD_NAME "kmcoge5ne"
 #define CONFIG_KM_DEF_NETDEV "netdev=eth1\0"
@@ -28,9 +23,6 @@
 
 #define CONFIG_KM_UBI_PARTITION_NAME_BOOT "ubi0"
 #define CONFIG_KM_UBI_PARTITION_NAME_APP "ubi1"
-#else
-#error ("Board not supported")
-#endif
 
 /*
  * High Level Configuration Options
@@ -169,10 +161,8 @@
 #define CONFIG_UEC_ETH
 #define CONFIG_ETHPRIME "UEC0"
 
-#if !defined(CONFIG_ARCH_MPC8309)
 #define CONFIG_UEC_ETH1 /* GETH1 */
 #define UEC_VERBOSE_DEBUG 1
-#endif
 
 #ifdef CONFIG_UEC_ETH1
 #define CONFIG_SYS_UEC1_UCC_NUM 3 /* UCC4 */
@@ -361,7 +351,6 @@
 
 #define CONFIG_SYS_DDR_SDRAM_CFG2 0x00401000
 
-#ifdef CONFIG_TARGET_KMCOGE5NE
 /**
  * KMCOGE5NE has 512 MB RAM
  */
@@ -372,12 +361,6 @@
  CSCONFIG_BANK_BIT_3 | \
  CSCONFIG_ROW_BIT_13 | \
  CSCONFIG_COL_BIT_10)
-#else
-#define CONFIG_SYS_DDR_CS0_CONFIG (CSCONFIG_EN | CSCONFIG_AP | \
- CSCONFIG_ROW_BIT_13 | \
- CSCONFIG_COL_BIT_10 | \
- CSCONFIG_ODT_WR_ONLY_CURRENT)
-#endif
 
 #define CONFIG_SYS_DDR_CLK_CNTL (\
  DDR_SDRAM_CLK_CNTL_CLK_ADJUST_05)
@@ -457,7 +440,6 @@
  OR_GPCM_TRLX | \
  OR_GPCM_EAD)
 
-#ifdef CONFIG_TARGET_KMCOGE5NE
 /*
  * BFTIC3 on the local bus CS4
  */
@@ -476,7 +458,6 @@
  OR_GPCM_SCY_2 |\
  OR_GPCM_TRLX |\
  OR_GPCM_EAD)
-#endif
 
 /*
  * MMU Setup
@@ -502,7 +483,6 @@
 
 #define CONFIG_SYS_DBAT5U CONFIG_SYS_IBAT5U
 
-#ifdef CONFIG_TARGET_KMCOGE5NE
 /* BFTIC3:  icache cacheable, but dcache-inhibit and guarded */
 #define CONFIG_SYS_IBAT6L (\
  CONFIG_SYS_BFTIC3_BASE | \
@@ -542,15 +522,6 @@
 #define CONFIG_TESTPIN_REG  gprt3 /* for kmcoge5ne */
 #define CONFIG_TESTPIN_MASK 0x20 /* for kmcoge5ne */
 
-#else
-#define CONFIG_SYS_IBAT6L (0)
-#define CONFIG_SYS_IBAT6U (0)
-#define CONFIG_SYS_IBAT7L (0)
-#define CONFIG_SYS_IBAT7U (0)
-#define CONFIG_SYS_DBAT6L CONFIG_SYS_IBAT6L
-#define CONFIG_SYS_DBAT6U CONFIG_SYS_IBAT6U
-#endif
-
 #define CONFIG_SYS_DBAT7L CONFIG_SYS_IBAT7L
 #define CONFIG_SYS_DBAT7U CONFIG_SYS_IBAT7U
 
diff --git a/include/configs/kmeter1.h b/include/configs/kmeter1.h
index 00fb0e2f48..b4cadd3e0f 100644
--- a/include/configs/kmeter1.h
+++ b/include/configs/kmeter1.h
@@ -12,25 +12,9 @@
 #define CONFIG_SYS_KMBEC_FPGA_BASE 0xE8000000
 #define CONFIG_SYS_KMBEC_FPGA_SIZE 64
 
-#if defined CONFIG_TARGET_KMETER1
 #define CONFIG_HOSTNAME "kmeter1"
 #define CONFIG_KM_BOARD_NAME   "kmeter1"
 #define CONFIG_KM_DEF_NETDEV "netdev=eth2\0"
-#elif defined CONFIG_TARGET_KMCOGE5NE
-#define CONFIG_HOSTNAME "kmcoge5ne"
-#define CONFIG_KM_BOARD_NAME "kmcoge5ne"
-#define CONFIG_KM_DEF_NETDEV "netdev=eth1\0"
-#define CONFIG_NAND_ECC_BCH
-#define CONFIG_NAND_KMETER1
-#define CONFIG_SYS_MAX_NAND_DEVICE 1
-#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"
-#else
-#error ("Board not supported")
-#endif
 
 /*
  * High Level Configuration Options
@@ -156,6 +140,7 @@
 /*
  * Serial Port
  */
+#define CONFIG_CONS_INDEX 1
 #define CONFIG_SYS_NS16550_SERIAL
 #define CONFIG_SYS_NS16550_REG_SIZE 1
 #define CONFIG_SYS_NS16550_CLK get_bus_freq(0)
@@ -169,10 +154,8 @@
 #define CONFIG_UEC_ETH
 #define CONFIG_ETHPRIME "UEC0"
 
-#if !defined(CONFIG_MPC8309)
 #define CONFIG_UEC_ETH1 /* GETH1 */
 #define UEC_VERBOSE_DEBUG 1
-#endif
 
 #ifdef CONFIG_UEC_ETH1
 #define CONFIG_SYS_UEC1_UCC_NUM 3 /* UCC4 */
@@ -361,23 +344,10 @@
 
 #define CONFIG_SYS_DDR_SDRAM_CFG2 0x00401000
 
-#ifdef CONFIG_TARGET_KMCOGE5NE
-/**
- * KMCOGE5NE has 512 MB RAM
- */
-#define CONFIG_SYS_DDR_CS0_CONFIG (\
- CSCONFIG_EN | \
- CSCONFIG_AP | \
- CSCONFIG_ODT_WR_ONLY_CURRENT | \
- CSCONFIG_BANK_BIT_3 | \
- CSCONFIG_ROW_BIT_13 | \
- CSCONFIG_COL_BIT_10)
-#else
 #define CONFIG_SYS_DDR_CS0_CONFIG (CSCONFIG_EN | CSCONFIG_AP | \
  CSCONFIG_ROW_BIT_13 | \
  CSCONFIG_COL_BIT_10 | \
  CSCONFIG_ODT_WR_ONLY_CURRENT)
-#endif
 
 #define CONFIG_SYS_DDR_CLK_CNTL (\
  DDR_SDRAM_CLK_CNTL_CLK_ADJUST_05)
@@ -457,27 +427,6 @@
  OR_GPCM_TRLX | \
  OR_GPCM_EAD)
 
-#ifdef CONFIG_TARGET_KMCOGE5NE
-/*
- * BFTIC3 on the local bus CS4
- */
-#define CONFIG_SYS_BFTIC3_BASE 0xB0000000
-#define CONFIG_SYS_BFTIC3_SIZE 256
-
-#define CONFIG_SYS_BR4_PRELIM (\
- CONFIG_SYS_BFTIC3_BASE |\
- (1 << BR_PS_SHIFT) | \
- BR_V)
-
-#define CONFIG_SYS_OR4_PRELIM (\
- MEG_TO_AM(CONFIG_SYS_BFTIC3_SIZE) |\
- OR_GPCM_CSNT | \
- OR_GPCM_ACS_DIV2 |\
- OR_GPCM_SCY_2 |\
- OR_GPCM_TRLX |\
- OR_GPCM_EAD)
-#endif
-
 /*
  * MMU Setup
  */
@@ -501,56 +450,12 @@
  BATL_GUARDEDSTORAGE)
 
 #define CONFIG_SYS_DBAT5U CONFIG_SYS_IBAT5U
-
-#ifdef CONFIG_TARGET_KMCOGE5NE
-/* BFTIC3:  icache cacheable, but dcache-inhibit and guarded */
-#define CONFIG_SYS_IBAT6L (\
- CONFIG_SYS_BFTIC3_BASE | \
- BATL_PP_10 | \
- BATL_MEMCOHERENCE)
-
-#define CONFIG_SYS_IBAT6U (\
- CONFIG_SYS_BFTIC3_BASE | \
- BATU_BL_256M | \
- BATU_VS | \
- BATU_VP)
-
-#define CONFIG_SYS_DBAT6L (\
- CONFIG_SYS_BFTIC3_BASE | \
- BATL_PP_10 | \
- BATL_CACHEINHIBIT | \
- BATL_GUARDEDSTORAGE)
-
-#define CONFIG_SYS_DBAT6U CONFIG_SYS_IBAT6U
-
-/* DDR/LBC SDRAM next 256M: cacheable */
-#define CONFIG_SYS_IBAT7L (\
- CONFIG_SYS_SDRAM_BASE2 |\
- BATL_PP_10 |\
- BATL_CACHEINHIBIT |\
- BATL_GUARDEDSTORAGE)
-
-#define CONFIG_SYS_IBAT7U (\
- CONFIG_SYS_SDRAM_BASE2 |\
- BATU_BL_256M |\
- BATU_VS |\
- BATU_VP)
-/* enable POST tests */
-#define CONFIG_POST (CONFIG_SYS_POST_MEMORY|CONFIG_SYS_POST_MEM_REGIONS)
-#define CONFIG_POST_EXTERNAL_WORD_FUNCS /* use own functions, not generic */
-#define CPM_POST_WORD_ADDR  CONFIG_SYS_MEMTEST_END
-#define CONFIG_TESTPIN_REG  gprt3 /* for kmcoge5ne */
-#define CONFIG_TESTPIN_MASK 0x20 /* for kmcoge5ne */
-
-#else
 #define CONFIG_SYS_IBAT6L (0)
 #define CONFIG_SYS_IBAT6U (0)
 #define CONFIG_SYS_IBAT7L (0)
 #define CONFIG_SYS_IBAT7U (0)
 #define CONFIG_SYS_DBAT6L CONFIG_SYS_IBAT6L
 #define CONFIG_SYS_DBAT6U CONFIG_SYS_IBAT6U
-#endif
-
 #define CONFIG_SYS_DBAT7L CONFIG_SYS_IBAT7L
 #define CONFIG_SYS_DBAT7U CONFIG_SYS_IBAT7U
 
--
2.16.4

_______________________________________________
U-Boot mailing list
[hidden email]
https://lists.denx.de/listinfo/u-boot
Reply | Threaded
Open this post in threaded view
|

[PATCH 18/48] mpc83xx: Make distinct MPC8313ERDB targets

Mario Six
In reply to this post by Mario Six
MPC8313ERDB has the option of either enabling NOR or NAND boot in its
config file (by commenting out certain #ifdefs). To keep this ability
after migrating options to Kconfig, we introduce two MPC8313ERDB
configs: one for NOR, and one for NAND.

Signed-off-by: Mario Six <[hidden email]>
---
 arch/powerpc/cpu/mpc83xx/Kconfig                   |  10 +-
 board/freescale/mpc8313erdb/Kconfig                |  17 +-
 configs/MPC8313ERDB_33_defconfig                   |   2 +-
 configs/MPC8313ERDB_66_defconfig                   |   2 +-
 configs/MPC8313ERDB_NAND_33_defconfig              |   2 +-
 configs/MPC8313ERDB_NAND_66_defconfig              |   2 +-
 .../configs/{MPC8313ERDB.h => MPC8313ERDB_NAND.h}  |   0
 include/configs/MPC8313ERDB_NOR.h                  | 652 +++++++++++++++++++++
 8 files changed, 679 insertions(+), 8 deletions(-)
 rename include/configs/{MPC8313ERDB.h => MPC8313ERDB_NAND.h} (100%)
 create mode 100644 include/configs/MPC8313ERDB_NOR.h

diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig b/arch/powerpc/cpu/mpc83xx/Kconfig
index 29d84f363d..ede98c70da 100644
--- a/arch/powerpc/cpu/mpc83xx/Kconfig
+++ b/arch/powerpc/cpu/mpc83xx/Kconfig
@@ -29,8 +29,14 @@ config TARGET_MPC8308RDB
  select ARCH_MPC8308
  select SYS_FSL_ERRATUM_ESDHC111
 
-config TARGET_MPC8313ERDB
- bool "Support MPC8313ERDB"
+config TARGET_MPC8313ERDB_NOR
+ bool "Support MPC8313ERDB_NOR"
+ select ARCH_MPC8313
+ select BOARD_EARLY_INIT_F
+ select SUPPORT_SPL
+
+config TARGET_MPC8313ERDB_NAND
+ bool "Support MPC8313ERDB_NAND"
  select ARCH_MPC8313
  select BOARD_EARLY_INIT_F
  select SUPPORT_SPL
diff --git a/board/freescale/mpc8313erdb/Kconfig b/board/freescale/mpc8313erdb/Kconfig
index 145608feab..b6332a1368 100644
--- a/board/freescale/mpc8313erdb/Kconfig
+++ b/board/freescale/mpc8313erdb/Kconfig
@@ -1,4 +1,4 @@
-if TARGET_MPC8313ERDB
+if TARGET_MPC8313ERDB_NOR
 
 config SYS_BOARD
  default "mpc8313erdb"
@@ -7,6 +7,19 @@ config SYS_VENDOR
  default "freescale"
 
 config SYS_CONFIG_NAME
- default "MPC8313ERDB"
+ default "MPC8313ERDB_NOR"
+
+endif
+
+if TARGET_MPC8313ERDB_NAND
+
+config SYS_BOARD
+ default "mpc8313erdb"
+
+config SYS_VENDOR
+ default "freescale"
+
+config SYS_CONFIG_NAME
+ default "MPC8313ERDB_NAND"
 
 endif
diff --git a/configs/MPC8313ERDB_33_defconfig b/configs/MPC8313ERDB_33_defconfig
index ac60840371..e0cdd56273 100644
--- a/configs/MPC8313ERDB_33_defconfig
+++ b/configs/MPC8313ERDB_33_defconfig
@@ -1,7 +1,7 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xFE000000
 CONFIG_MPC83xx=y
-CONFIG_TARGET_MPC8313ERDB=y
+CONFIG_TARGET_MPC8313ERDB_NOR=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_SYS_EXTRA_OPTIONS="SYS_33MHZ"
diff --git a/configs/MPC8313ERDB_66_defconfig b/configs/MPC8313ERDB_66_defconfig
index 8a0784dd2a..b232a3275c 100644
--- a/configs/MPC8313ERDB_66_defconfig
+++ b/configs/MPC8313ERDB_66_defconfig
@@ -1,7 +1,7 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xFE000000
 CONFIG_MPC83xx=y
-CONFIG_TARGET_MPC8313ERDB=y
+CONFIG_TARGET_MPC8313ERDB_NOR=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_SYS_EXTRA_OPTIONS="SYS_66MHZ"
diff --git a/configs/MPC8313ERDB_NAND_33_defconfig b/configs/MPC8313ERDB_NAND_33_defconfig
index 141ecb843b..fa8321c587 100644
--- a/configs/MPC8313ERDB_NAND_33_defconfig
+++ b/configs/MPC8313ERDB_NAND_33_defconfig
@@ -3,7 +3,7 @@ CONFIG_SYS_TEXT_BASE=0x00100000
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL=y
 CONFIG_MPC83xx=y
-CONFIG_TARGET_MPC8313ERDB=y
+CONFIG_TARGET_MPC8313ERDB_NAND=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_SYS_EXTRA_OPTIONS="SYS_33MHZ"
diff --git a/configs/MPC8313ERDB_NAND_66_defconfig b/configs/MPC8313ERDB_NAND_66_defconfig
index 5a3bde4de2..b468b0d34a 100644
--- a/configs/MPC8313ERDB_NAND_66_defconfig
+++ b/configs/MPC8313ERDB_NAND_66_defconfig
@@ -3,7 +3,7 @@ CONFIG_SYS_TEXT_BASE=0x00100000
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL=y
 CONFIG_MPC83xx=y
-CONFIG_TARGET_MPC8313ERDB=y
+CONFIG_TARGET_MPC8313ERDB_NAND=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_SYS_EXTRA_OPTIONS="SYS_66MHZ"
diff --git a/include/configs/MPC8313ERDB.h b/include/configs/MPC8313ERDB_NAND.h
similarity index 100%
rename from include/configs/MPC8313ERDB.h
rename to include/configs/MPC8313ERDB_NAND.h
diff --git a/include/configs/MPC8313ERDB_NOR.h b/include/configs/MPC8313ERDB_NOR.h
new file mode 100644
index 0000000000..d522d21a74
--- /dev/null
+++ b/include/configs/MPC8313ERDB_NOR.h
@@ -0,0 +1,652 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) Freescale Semiconductor, Inc. 2006, 2010.
+ */
+/*
+ * mpc8313epb board configuration file
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+/*
+ * High Level Configuration Options
+ */
+#define CONFIG_E300 1
+#define CONFIG_MPC8313ERDB 1
+
+#ifdef CONFIG_NAND
+#define CONFIG_SPL_INIT_MINIMAL
+#define CONFIG_SPL_FLUSH_IMAGE
+#define CONFIG_SPL_TARGET "u-boot-with-spl.bin"
+#define CONFIG_SPL_MPC83XX_WAIT_FOR_NAND
+
+#ifdef CONFIG_SPL_BUILD
+#define CONFIG_NS16550_MIN_FUNCTIONS
+#endif
+
+#define CONFIG_SYS_TEXT_BASE_SPL 0xfff00000
+#define CONFIG_SPL_MAX_SIZE (4 * 1024)
+#define CONFIG_SPL_PAD_TO 0x4000
+
+#define CONFIG_SYS_NAND_U_BOOT_SIZE  (512 << 10)
+#define CONFIG_SYS_NAND_U_BOOT_DST   0x00100000
+#define CONFIG_SYS_NAND_U_BOOT_START 0x00100100
+#define CONFIG_SYS_NAND_U_BOOT_OFFS  16384
+#define CONFIG_SYS_NAND_U_BOOT_RELOC 0x00010000
+#define CONFIG_SYS_NAND_U_BOOT_RELOC_SP (CONFIG_SYS_NAND_U_BOOT_RELOC + 0x10000)
+
+#ifdef CONFIG_SPL_BUILD
+#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE_SPL /* start of monitor */
+#endif
+
+#endif /* CONFIG_NAND */
+
+#ifndef CONFIG_SYS_MONITOR_BASE
+#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE /* start of monitor */
+#endif
+
+#define CONFIG_PCI_INDIRECT_BRIDGE
+#define CONFIG_FSL_ELBC 1
+
+/*
+ * On-board devices
+ *
+ * TSEC1 is VSC switch
+ * TSEC2 is SoC TSEC
+ */
+#define CONFIG_VSC7385_ENET
+#define CONFIG_TSEC2
+
+#ifdef CONFIG_SYS_66MHZ
+#define CONFIG_83XX_CLKIN 66666667 /* in Hz */
+#elif defined(CONFIG_SYS_33MHZ)
+#define CONFIG_83XX_CLKIN 33333333 /* in Hz */
+#else
+#error Unknown oscillator frequency.
+#endif
+
+#define CONFIG_SYS_CLK_FREQ CONFIG_83XX_CLKIN
+
+#define CONFIG_SYS_IMMR 0xE0000000
+
+#if defined(CONFIG_NAND) && !defined(CONFIG_SPL_BUILD)
+#define CONFIG_DEFAULT_IMMR CONFIG_SYS_IMMR
+#endif
+
+#define CONFIG_SYS_MEMTEST_START 0x00001000
+#define CONFIG_SYS_MEMTEST_END 0x07f00000
+
+/* Early revs of this board will lock up hard when attempting
+ * to access the PMC registers, unless a JTAG debugger is
+ * connected, or some resistor modifications are made.
+ */
+#define CONFIG_SYS_8313ERDB_BROKEN_PMC 1
+
+#define CONFIG_SYS_ACR_PIPE_DEP 3 /* Arbiter pipeline depth (0-3) */
+#define CONFIG_SYS_ACR_RPTCNT 3 /* Arbiter repeat count (0-7) */
+
+/*
+ * Device configurations
+ */
+
+/* Vitesse 7385 */
+
+#ifdef CONFIG_VSC7385_ENET
+
+#define CONFIG_TSEC1
+
+/* The flash address and size of the VSC7385 firmware image */
+#define CONFIG_VSC7385_IMAGE 0xFE7FE000
+#define CONFIG_VSC7385_IMAGE_SIZE 8192
+
+#endif
+
+/*
+ * DDR Setup
+ */
+#define CONFIG_SYS_DDR_BASE 0x00000000 /* DDR is system memory*/
+#define CONFIG_SYS_SDRAM_BASE CONFIG_SYS_DDR_BASE
+#define CONFIG_SYS_DDR_SDRAM_BASE CONFIG_SYS_DDR_BASE
+
+/*
+ * Manually set up DDR parameters, as this board does not
+ * seem to have the SPD connected to I2C.
+ */
+#define CONFIG_SYS_DDR_SIZE 128 /* MB */
+#define CONFIG_SYS_DDR_CS0_CONFIG (CSCONFIG_EN \
+ | CSCONFIG_ODT_RD_NEVER \
+ | CSCONFIG_ODT_WR_ONLY_CURRENT \
+ | CSCONFIG_ROW_BIT_13 \
+ | CSCONFIG_COL_BIT_10)
+ /* 0x80010102 */
+
+#define CONFIG_SYS_DDR_TIMING_3 0x00000000
+#define CONFIG_SYS_DDR_TIMING_0 ((0 << TIMING_CFG0_RWT_SHIFT) \
+ | (0 << TIMING_CFG0_WRT_SHIFT) \
+ | (0 << TIMING_CFG0_RRT_SHIFT) \
+ | (0 << TIMING_CFG0_WWT_SHIFT) \
+ | (2 << TIMING_CFG0_ACT_PD_EXIT_SHIFT) \
+ | (2 << TIMING_CFG0_PRE_PD_EXIT_SHIFT) \
+ | (8 << TIMING_CFG0_ODT_PD_EXIT_SHIFT) \
+ | (2 << TIMING_CFG0_MRS_CYC_SHIFT))
+ /* 0x00220802 */
+#define CONFIG_SYS_DDR_TIMING_1 ((3 << TIMING_CFG1_PRETOACT_SHIFT) \
+ | (8 << TIMING_CFG1_ACTTOPRE_SHIFT) \
+ | (3 << TIMING_CFG1_ACTTORW_SHIFT) \
+ | (5 << TIMING_CFG1_CASLAT_SHIFT) \
+ | (10 << TIMING_CFG1_REFREC_SHIFT) \
+ | (3 << TIMING_CFG1_WRREC_SHIFT) \
+ | (2 << TIMING_CFG1_ACTTOACT_SHIFT) \
+ | (2 << TIMING_CFG1_WRTORD_SHIFT))
+ /* 0x3835a322 */
+#define CONFIG_SYS_DDR_TIMING_2 ((1 << TIMING_CFG2_ADD_LAT_SHIFT) \
+ | (5 << TIMING_CFG2_CPO_SHIFT) \
+ | (2 << TIMING_CFG2_WR_LAT_DELAY_SHIFT) \
+ | (2 << TIMING_CFG2_RD_TO_PRE_SHIFT) \
+ | (2 << TIMING_CFG2_WR_DATA_DELAY_SHIFT) \
+ | (3 << TIMING_CFG2_CKE_PLS_SHIFT) \
+ | (6 << TIMING_CFG2_FOUR_ACT_SHIFT))
+ /* 0x129048c6 */ /* P9-45,may need tuning */
+#define CONFIG_SYS_DDR_INTERVAL ((1296 << SDRAM_INTERVAL_REFINT_SHIFT) \
+ | (1280 << SDRAM_INTERVAL_BSTOPRE_SHIFT))
+ /* 0x05100500 */
+#if defined(CONFIG_DDR_2T_TIMING)
+#define CONFIG_SYS_SDRAM_CFG (SDRAM_CFG_SREN \
+ | SDRAM_CFG_SDRAM_TYPE_DDR2 \
+ | SDRAM_CFG_DBW_32 \
+ | SDRAM_CFG_2T_EN)
+ /* 0x43088000 */
+#else
+#define CONFIG_SYS_SDRAM_CFG (SDRAM_CFG_SREN \
+ | SDRAM_CFG_SDRAM_TYPE_DDR2 \
+ | SDRAM_CFG_DBW_32)
+ /* 0x43080000 */
+#endif
+#define CONFIG_SYS_SDRAM_CFG2 0x00401000
+/* set burst length to 8 for 32-bit data path */
+#define CONFIG_SYS_DDR_MODE ((0x4448 << SDRAM_MODE_ESD_SHIFT) \
+ | (0x0632 << SDRAM_MODE_SD_SHIFT))
+ /* 0x44480632 */
+#define CONFIG_SYS_DDR_MODE_2 0x8000C000
+
+#define CONFIG_SYS_DDR_CLK_CNTL DDR_SDRAM_CLK_CNTL_CLK_ADJUST_05
+ /*0x02000000*/
+#define CONFIG_SYS_DDRCDR_VALUE (DDRCDR_EN \
+ | DDRCDR_PZ_NOMZ \
+ | DDRCDR_NZ_NOMZ \
+ | DDRCDR_M_ODR)
+
+/*
+ * FLASH on the Local Bus
+ */
+#define CONFIG_SYS_FLASH_CFI /* use the Common Flash Interface */
+#define CONFIG_FLASH_CFI_DRIVER /* use the CFI driver */
+#define CONFIG_SYS_FLASH_BASE 0xFE000000 /* start of FLASH   */
+#define CONFIG_SYS_FLASH_SIZE 8 /* flash size in MB */
+#define CONFIG_SYS_FLASH_PROTECTION 1 /* Use h/w Flash protection. */
+#define CONFIG_SYS_FLASH_EMPTY_INFO /* display empty sectors */
+#define CONFIG_SYS_FLASH_USE_BUFFER_WRITE /* buffer up multiple bytes */
+
+#define CONFIG_SYS_NOR_BR_PRELIM (CONFIG_SYS_FLASH_BASE \
+ | BR_PS_16 /* 16 bit port */ \
+ | BR_MS_GPCM /* MSEL = GPCM */ \
+ | BR_V) /* valid */
+#define CONFIG_SYS_NOR_OR_PRELIM (MEG_TO_AM(CONFIG_SYS_FLASH_SIZE) \
+ | OR_GPCM_XACS \
+ | OR_GPCM_SCY_9 \
+ | OR_GPCM_EHTR \
+ | OR_GPCM_EAD)
+ /* 0xFF006FF7 TODO SLOW 16 MB flash size */
+ /* window base at flash base */
+#define CONFIG_SYS_LBLAWBAR0_PRELIM CONFIG_SYS_FLASH_BASE
+ /* 16 MB window size */
+#define CONFIG_SYS_LBLAWAR0_PRELIM (LBLAWAR_EN | LBLAWAR_16MB)
+
+#define CONFIG_SYS_MAX_FLASH_BANKS 1 /* number of banks */
+#define CONFIG_SYS_MAX_FLASH_SECT 135 /* sectors per device */
+
+#define CONFIG_SYS_FLASH_ERASE_TOUT 60000 /* Flash Erase Timeout (ms) */
+#define CONFIG_SYS_FLASH_WRITE_TOUT 500 /* Flash Write Timeout (ms) */
+
+#if (CONFIG_SYS_MONITOR_BASE < CONFIG_SYS_FLASH_BASE) && \
+ !defined(CONFIG_SPL_BUILD)
+#define CONFIG_SYS_RAMBOOT
+#endif
+
+#define CONFIG_SYS_INIT_RAM_LOCK 1
+#define CONFIG_SYS_INIT_RAM_ADDR 0xFD000000 /* Initial RAM addr */
+#define CONFIG_SYS_INIT_RAM_SIZE 0x1000 /* Size of used area in RAM*/
+
+#define CONFIG_SYS_GBL_DATA_OFFSET \
+ (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
+#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_GBL_DATA_OFFSET
+
+/* CONFIG_SYS_MONITOR_LEN must be a multiple of CONFIG_ENV_SECT_SIZE */
+#define CONFIG_SYS_MONITOR_LEN (512 * 1024) /* Reserve 512 kB for Mon */
+#define CONFIG_SYS_MALLOC_LEN (512 * 1024) /* Reserved for malloc */
+
+/*
+ * Local Bus LCRR and LBCR regs
+ */
+#define CONFIG_SYS_LCRR_EADC LCRR_EADC_1
+#define CONFIG_SYS_LCRR_CLKDIV LCRR_CLKDIV_4
+#define CONFIG_SYS_LBC_LBCR (0x00040000 /* TODO */ \
+ | (0xFF << LBCR_BMT_SHIFT) \
+ | 0xF) /* 0x0004ff0f */
+
+ /* LB refresh timer prescal, 266MHz/32 */
+#define CONFIG_SYS_LBC_MRTPR 0x20000000  /*TODO */
+
+/* drivers/mtd/nand/nand.c */
+#if defined(CONFIG_NAND) && defined(CONFIG_SPL_BUILD)
+#define CONFIG_SYS_NAND_BASE 0xFFF00000
+#else
+#define CONFIG_SYS_NAND_BASE 0xE2800000
+#endif
+
+#define CONFIG_MTD_PARTITION
+
+#define CONFIG_SYS_MAX_NAND_DEVICE 1
+#define CONFIG_NAND_FSL_ELBC 1
+#define CONFIG_SYS_NAND_BLOCK_SIZE 16384
+#define CONFIG_SYS_NAND_WINDOW_SIZE (32 * 1024)
+
+#define CONFIG_SYS_NAND_BR_PRELIM (CONFIG_SYS_NAND_BASE \
+ | BR_DECC_CHK_GEN /* Use HW ECC */ \
+ | BR_PS_8 /* 8 bit port */ \
+ | BR_MS_FCM /* MSEL = FCM */ \
+ | BR_V) /* valid */
+#define CONFIG_SYS_NAND_OR_PRELIM \
+ (P2SZ_TO_AM(CONFIG_SYS_NAND_WINDOW_SIZE) \
+ | OR_FCM_CSCT \
+ | OR_FCM_CST \
+ | OR_FCM_CHT \
+ | OR_FCM_SCY_1 \
+ | OR_FCM_TRLX \
+ | OR_FCM_EHTR)
+ /* 0xFFFF8396 */
+
+#ifdef CONFIG_NAND
+#define CONFIG_SYS_BR0_PRELIM CONFIG_SYS_NAND_BR_PRELIM
+#define CONFIG_SYS_OR0_PRELIM CONFIG_SYS_NAND_OR_PRELIM
+#define CONFIG_SYS_BR1_PRELIM CONFIG_SYS_NOR_BR_PRELIM
+#define CONFIG_SYS_OR1_PRELIM CONFIG_SYS_NOR_OR_PRELIM
+#else
+#define CONFIG_SYS_BR0_PRELIM CONFIG_SYS_NOR_BR_PRELIM
+#define CONFIG_SYS_OR0_PRELIM CONFIG_SYS_NOR_OR_PRELIM
+#define CONFIG_SYS_BR1_PRELIM CONFIG_SYS_NAND_BR_PRELIM
+#define CONFIG_SYS_OR1_PRELIM CONFIG_SYS_NAND_OR_PRELIM
+#endif
+
+#define CONFIG_SYS_LBLAWBAR1_PRELIM CONFIG_SYS_NAND_BASE
+#define CONFIG_SYS_LBLAWAR1_PRELIM (LBLAWAR_EN | LBLAWAR_32KB)
+
+#define CONFIG_SYS_NAND_LBLAWBAR_PRELIM CONFIG_SYS_LBLAWBAR1_PRELIM
+#define CONFIG_SYS_NAND_LBLAWAR_PRELIM CONFIG_SYS_LBLAWAR1_PRELIM
+
+/* local bus write LED / read status buffer (BCSR) mapping */
+#define CONFIG_SYS_BCSR_ADDR 0xFA000000
+#define CONFIG_SYS_BCSR_SIZE (32 * 1024) /* 0x00008000 */
+ /* map at 0xFA000000 on LCS3 */
+#define CONFIG_SYS_BR3_PRELIM (CONFIG_SYS_BCSR_ADDR \
+ | BR_PS_8 /* 8 bit port */ \
+ | BR_MS_GPCM /* MSEL = GPCM */ \
+ | BR_V) /* valid */
+ /* 0xFA000801 */
+#define CONFIG_SYS_OR3_PRELIM (P2SZ_TO_AM(CONFIG_SYS_BCSR_SIZE) \
+ | OR_GPCM_CSNT \
+ | OR_GPCM_ACS_DIV2 \
+ | OR_GPCM_XACS \
+ | OR_GPCM_SCY_15 \
+ | OR_GPCM_TRLX_SET \
+ | OR_GPCM_EHTR_SET \
+ | OR_GPCM_EAD)
+ /* 0xFFFF8FF7 */
+#define CONFIG_SYS_LBLAWBAR3_PRELIM CONFIG_SYS_BCSR_ADDR
+#define CONFIG_SYS_LBLAWAR3_PRELIM (LBLAWAR_EN | LBLAWAR_32KB)
+
+/* Vitesse 7385 */
+
+#ifdef CONFIG_VSC7385_ENET
+
+ /* VSC7385 Base address on LCS2 */
+#define CONFIG_SYS_VSC7385_BASE 0xF0000000
+#define CONFIG_SYS_VSC7385_SIZE (128 * 1024) /* 0x00020000 */
+
+#define CONFIG_SYS_BR2_PRELIM (CONFIG_SYS_VSC7385_BASE \
+ | BR_PS_8 /* 8 bit port */ \
+ | BR_MS_GPCM /* MSEL = GPCM */ \
+ | BR_V) /* valid */
+#define CONFIG_SYS_OR2_PRELIM (P2SZ_TO_AM(CONFIG_SYS_VSC7385_SIZE) \
+ | OR_GPCM_CSNT \
+ | OR_GPCM_XACS \
+ | OR_GPCM_SCY_15 \
+ | OR_GPCM_SETA \
+ | OR_GPCM_TRLX_SET \
+ | OR_GPCM_EHTR_SET \
+ | OR_GPCM_EAD)
+ /* 0xFFFE09FF */
+
+ /* Access window base at VSC7385 base */
+#define CONFIG_SYS_LBLAWBAR2_PRELIM CONFIG_SYS_VSC7385_BASE
+#define CONFIG_SYS_LBLAWAR2_PRELIM (LBLAWAR_EN | LBLAWAR_128KB)
+
+#endif
+
+#define CONFIG_MPC83XX_GPIO 1
+
+/*
+ * Serial Port
+ */
+#define CONFIG_SYS_NS16550_SERIAL
+#define CONFIG_SYS_NS16550_REG_SIZE 1
+
+#define CONFIG_SYS_BAUDRATE_TABLE \
+ {300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 115200}
+
+#define CONFIG_SYS_NS16550_COM1 (CONFIG_SYS_IMMR+0x4500)
+#define CONFIG_SYS_NS16550_COM2 (CONFIG_SYS_IMMR+0x4600)
+
+/* I2C */
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_FSL
+#define CONFIG_SYS_FSL_I2C_SPEED 400000
+#define CONFIG_SYS_FSL_I2C_SLAVE 0x7F
+#define CONFIG_SYS_FSL_I2C_OFFSET 0x3000
+#define CONFIG_SYS_FSL_I2C2_SPEED 400000
+#define CONFIG_SYS_FSL_I2C2_SLAVE 0x7F
+#define CONFIG_SYS_FSL_I2C2_OFFSET 0x3100
+#define CONFIG_SYS_I2C_NOPROBES { {0, 0x69} }
+
+/*
+ * General PCI
+ * Addresses are mapped 1-1.
+ */
+#define CONFIG_SYS_PCI1_MEM_BASE 0x80000000
+#define CONFIG_SYS_PCI1_MEM_PHYS CONFIG_SYS_PCI1_MEM_BASE
+#define CONFIG_SYS_PCI1_MEM_SIZE 0x10000000 /* 256M */
+#define CONFIG_SYS_PCI1_MMIO_BASE 0x90000000
+#define CONFIG_SYS_PCI1_MMIO_PHYS CONFIG_SYS_PCI1_MMIO_BASE
+#define CONFIG_SYS_PCI1_MMIO_SIZE 0x10000000 /* 256M */
+#define CONFIG_SYS_PCI1_IO_BASE 0x00000000
+#define CONFIG_SYS_PCI1_IO_PHYS 0xE2000000
+#define CONFIG_SYS_PCI1_IO_SIZE 0x00100000 /* 1M */
+
+#define CONFIG_SYS_PCI_SUBSYS_VENDORID 0x1057 /* Motorola */
+
+/*
+ * TSEC
+ */
+
+#define CONFIG_GMII /* MII PHY management */
+
+#ifdef CONFIG_TSEC1
+#define CONFIG_HAS_ETH0
+#define CONFIG_TSEC1_NAME "TSEC0"
+#define CONFIG_SYS_TSEC1_OFFSET 0x24000
+#define TSEC1_PHY_ADDR 0x1c
+#define TSEC1_FLAGS TSEC_GIGABIT
+#define TSEC1_PHYIDX 0
+#endif
+
+#ifdef CONFIG_TSEC2
+#define CONFIG_HAS_ETH1
+#define CONFIG_TSEC2_NAME "TSEC1"
+#define CONFIG_SYS_TSEC2_OFFSET 0x25000
+#define TSEC2_PHY_ADDR 4
+#define TSEC2_FLAGS TSEC_GIGABIT
+#define TSEC2_PHYIDX 0
+#endif
+
+/* Options are: TSEC[0-1] */
+#define CONFIG_ETHPRIME "TSEC1"
+
+/*
+ * Configure on-board RTC
+ */
+#define CONFIG_RTC_DS1337
+#define CONFIG_SYS_I2C_RTC_ADDR 0x68
+
+/*
+ * Environment
+ */
+#if defined(CONFIG_NAND)
+ #define CONFIG_ENV_OFFSET (512 * 1024)
+ #define CONFIG_ENV_SECT_SIZE CONFIG_SYS_NAND_BLOCK_SIZE
+ #define CONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE
+ #define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
+ #define CONFIG_ENV_RANGE (CONFIG_ENV_SECT_SIZE * 4)
+ #define CONFIG_ENV_OFFSET_REDUND \
+ (CONFIG_ENV_OFFSET + CONFIG_ENV_RANGE)
+#elif !defined(CONFIG_SYS_RAMBOOT)
+ #define CONFIG_ENV_ADDR \
+ (CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN)
+ #define CONFIG_ENV_SECT_SIZE 0x10000 /* 64K(one sector) for env */
+ #define CONFIG_ENV_SIZE 0x2000
+
+/* Address and size of Redundant Environment Sector */
+#else
+ #define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE - 0x1000)
+ #define CONFIG_ENV_SIZE 0x2000
+#endif
+
+#define CONFIG_LOADS_ECHO 1 /* echo on for serial download */
+#define CONFIG_SYS_LOADS_BAUD_CHANGE 1 /* allow baudrate change */
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+
+/*
+ * Command line configuration.
+ */
+
+/*
+ * Miscellaneous configurable options
+ */
+#define CONFIG_SYS_LOAD_ADDR 0x2000000 /* default load address */
+#define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */
+
+ /* Boot Argument Buffer Size */
+#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
+
+/*
+ * For booting Linux, the board info and command line data
+ * have to be in the first 256 MB of memory, since this is
+ * the maximum mapped by the Linux kernel during initialization.
+ */
+ /* Initial Memory map for Linux*/
+#define CONFIG_SYS_BOOTMAPSZ (256 << 20)
+#define CONFIG_SYS_BOOTM_LEN (64 << 20) /* Increase max gunzip size */
+
+#define CONFIG_SYS_RCWH_PCIHOST 0x80000000 /* PCIHOST  */
+
+#ifdef CONFIG_SYS_66MHZ
+
+/* 66MHz IN, 133MHz CSB, 266 DDR, 266 CORE */
+/* 0x62040000 */
+#define CONFIG_SYS_HRCW_LOW (\
+ 0x20000000 /* reserved, must be set */ |\
+ HRCWL_DDRCM |\
+ HRCWL_LCL_BUS_TO_SCB_CLK_1X1 |\
+ HRCWL_DDR_TO_SCB_CLK_2X1 |\
+ HRCWL_CSB_TO_CLKIN_2X1 |\
+ HRCWL_CORE_TO_CSB_2X1)
+
+#define CONFIG_SYS_NS16550_CLK (CONFIG_83XX_CLKIN * 2)
+
+#elif defined(CONFIG_SYS_33MHZ)
+
+/* 33MHz IN, 165MHz CSB, 330 DDR, 330 CORE */
+/* 0x65040000 */
+#define CONFIG_SYS_HRCW_LOW (\
+ 0x20000000 /* reserved, must be set */ |\
+ HRCWL_DDRCM |\
+ HRCWL_LCL_BUS_TO_SCB_CLK_1X1 |\
+ HRCWL_DDR_TO_SCB_CLK_2X1 |\
+ HRCWL_CSB_TO_CLKIN_5X1 |\
+ HRCWL_CORE_TO_CSB_2X1)
+
+#define CONFIG_SYS_NS16550_CLK (CONFIG_83XX_CLKIN * 5)
+
+#endif
+
+#define CONFIG_SYS_HRCW_HIGH_BASE (\
+ HRCWH_PCI_HOST |\
+ HRCWH_PCI1_ARBITER_ENABLE |\
+ HRCWH_CORE_ENABLE |\
+ HRCWH_BOOTSEQ_DISABLE |\
+ HRCWH_SW_WATCHDOG_DISABLE |\
+ HRCWH_TSEC1M_IN_RGMII |\
+ HRCWH_TSEC2M_IN_RGMII |\
+ HRCWH_BIG_ENDIAN)
+
+#ifdef CONFIG_NAND
+#define CONFIG_SYS_HRCW_HIGH (CONFIG_SYS_HRCW_HIGH_BASE |\
+       HRCWH_FROM_0XFFF00100 |\
+       HRCWH_ROM_LOC_NAND_SP_8BIT |\
+       HRCWH_RL_EXT_NAND)
+#else
+#define CONFIG_SYS_HRCW_HIGH (CONFIG_SYS_HRCW_HIGH_BASE |\
+       HRCWH_FROM_0X00000100 |\
+       HRCWH_ROM_LOC_LOCAL_16BIT |\
+       HRCWH_RL_EXT_LEGACY)
+#endif
+
+/* System IO Config */
+#define CONFIG_SYS_SICRH (SICRH_TSOBI1 | SICRH_TSOBI2) /* RGMII */
+ /* Enable Internal USB Phy and GPIO on LCD Connector */
+#define CONFIG_SYS_SICRL (SICRL_USBDR_10 | SICRL_LBC)
+
+#define CONFIG_SYS_HID0_INIT 0x000000000
+#define CONFIG_SYS_HID0_FINAL (HID0_ENABLE_MACHINE_CHECK | \
+ HID0_ENABLE_INSTRUCTION_CACHE | \
+ HID0_ENABLE_DYNAMIC_POWER_MANAGMENT)
+
+#define CONFIG_SYS_HID2 HID2_HBE
+
+#define CONFIG_HIGH_BATS 1 /* High BATs supported */
+
+/* DDR @ 0x00000000 */
+#define CONFIG_SYS_IBAT0L (CONFIG_SYS_SDRAM_BASE | BATL_PP_RW)
+#define CONFIG_SYS_IBAT0U (CONFIG_SYS_SDRAM_BASE \
+ | BATU_BL_256M \
+ | BATU_VS \
+ | BATU_VP)
+
+/* PCI @ 0x80000000 */
+#define CONFIG_SYS_IBAT1L (CONFIG_SYS_PCI1_MEM_BASE | BATL_PP_RW)
+#define CONFIG_SYS_IBAT1U (CONFIG_SYS_PCI1_MEM_BASE \
+ | BATU_BL_256M \
+ | BATU_VS \
+ | BATU_VP)
+#define CONFIG_SYS_IBAT2L (CONFIG_SYS_PCI1_MMIO_BASE \
+ | BATL_PP_RW \
+ | BATL_CACHEINHIBIT \
+ | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_IBAT2U (CONFIG_SYS_PCI1_MMIO_BASE \
+ | BATU_BL_256M \
+ | BATU_VS \
+ | BATU_VP)
+
+/* PCI2 not supported on 8313 */
+#define CONFIG_SYS_IBAT3L (0)
+#define CONFIG_SYS_IBAT3U (0)
+#define CONFIG_SYS_IBAT4L (0)
+#define CONFIG_SYS_IBAT4U (0)
+
+/* IMMRBAR @ 0xE0000000, PCI IO @ 0xE2000000 & BCSR @ 0xE2400000 */
+#define CONFIG_SYS_IBAT5L (CONFIG_SYS_IMMR \
+ | BATL_PP_RW \
+ | BATL_CACHEINHIBIT \
+ | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_IBAT5U (CONFIG_SYS_IMMR \
+ | BATU_BL_256M \
+ | BATU_VS \
+ | BATU_VP)
+
+/* SDRAM @ 0xF0000000, stack in DCACHE 0xFDF00000 & FLASH @ 0xFE000000 */
+#define CONFIG_SYS_IBAT6L (0xF0000000 | BATL_PP_RW | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_IBAT6U (0xF0000000 | BATU_BL_256M | BATU_VS | BATU_VP)
+
+#define CONFIG_SYS_IBAT7L (0)
+#define CONFIG_SYS_IBAT7U (0)
+
+#define CONFIG_SYS_DBAT0L CONFIG_SYS_IBAT0L
+#define CONFIG_SYS_DBAT0U CONFIG_SYS_IBAT0U
+#define CONFIG_SYS_DBAT1L CONFIG_SYS_IBAT1L
+#define CONFIG_SYS_DBAT1U CONFIG_SYS_IBAT1U
+#define CONFIG_SYS_DBAT2L CONFIG_SYS_IBAT2L
+#define CONFIG_SYS_DBAT2U CONFIG_SYS_IBAT2U
+#define CONFIG_SYS_DBAT3L CONFIG_SYS_IBAT3L
+#define CONFIG_SYS_DBAT3U CONFIG_SYS_IBAT3U
+#define CONFIG_SYS_DBAT4L CONFIG_SYS_IBAT4L
+#define CONFIG_SYS_DBAT4U CONFIG_SYS_IBAT4U
+#define CONFIG_SYS_DBAT5L CONFIG_SYS_IBAT5L
+#define CONFIG_SYS_DBAT5U CONFIG_SYS_IBAT5U
+#define CONFIG_SYS_DBAT6L CONFIG_SYS_IBAT6L
+#define CONFIG_SYS_DBAT6U CONFIG_SYS_IBAT6U
+#define CONFIG_SYS_DBAT7L CONFIG_SYS_IBAT7L
+#define CONFIG_SYS_DBAT7U CONFIG_SYS_IBAT7U
+
+/*
+ * Environment Configuration
+ */
+#define CONFIG_ENV_OVERWRITE
+
+#define CONFIG_NETDEV "eth1"
+
+#define CONFIG_HOSTNAME "mpc8313erdb"
+#define CONFIG_ROOTPATH "/nfs/root/path"
+#define CONFIG_BOOTFILE "uImage"
+ /* U-Boot image on TFTP server */
+#define CONFIG_UBOOTPATH "u-boot.bin"
+#define CONFIG_FDTFILE "mpc8313erdb.dtb"
+
+ /* default location for tftp and bootm */
+#define CONFIG_LOADADDR 800000
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+ "netdev=" CONFIG_NETDEV "\0" \
+ "ethprime=TSEC1\0" \
+ "uboot=" CONFIG_UBOOTPATH "\0" \
+ "tftpflash=tftpboot $loadaddr $uboot; " \
+ "protect off " __stringify(CONFIG_SYS_TEXT_BASE) \
+ " +$filesize; " \
+ "erase " __stringify(CONFIG_SYS_TEXT_BASE) \
+ " +$filesize; " \
+ "cp.b $loadaddr " __stringify(CONFIG_SYS_TEXT_BASE) \
+ " $filesize; " \
+ "protect on " __stringify(CONFIG_SYS_TEXT_BASE) \
+ " +$filesize; " \
+ "cmp.b $loadaddr " __stringify(CONFIG_SYS_TEXT_BASE) \
+ " $filesize\0" \
+ "fdtaddr=780000\0" \
+ "fdtfile=" CONFIG_FDTFILE "\0" \
+ "console=ttyS0\0" \
+ "setbootargs=setenv bootargs " \
+ "root=$rootdev rw console=$console,$baudrate $othbootargs\0" \
+ "setipargs=setenv bootargs nfsroot=$serverip:$rootpath " \
+ "ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:"\
+ "$netdev:off " \
+ "root=$rootdev rw console=$console,$baudrate $othbootargs\0"
+
+#define CONFIG_NFSBOOTCOMMAND \
+ "setenv rootdev /dev/nfs;" \
+ "run setbootargs;" \
+ "run setipargs;" \
+ "tftp $loadaddr $bootfile;" \
+ "tftp $fdtaddr $fdtfile;" \
+ "bootm $loadaddr - $fdtaddr"
+
+#define CONFIG_RAMBOOTCOMMAND \
+ "setenv rootdev /dev/ram;" \
+ "run setbootargs;" \
+ "tftp $ramdiskaddr $ramdiskfile;" \
+ "tftp $loadaddr $bootfile;" \
+ "tftp $fdtaddr $fdtfile;" \
+ "bootm $loadaddr $ramdiskaddr $fdtaddr"
+
+#endif /* __CONFIG_H */
--
2.16.4

_______________________________________________
U-Boot mailing list
[hidden email]
https://lists.denx.de/listinfo/u-boot
Reply | Threaded
Open this post in threaded view
|

[PATCH 19/48] mpc83xx: Simplify MPC8313ERDB configs

Mario Six
In reply to this post by Mario Six
Remove all options from the new MPC8313ERDB_{NOR,NAND} configs that are
not specific to NOR or NAND.

Signed-off-by: Mario Six <[hidden email]>
---
 include/configs/MPC8313ERDB_NAND.h | 61 ++++++++-----------------------
 include/configs/MPC8313ERDB_NOR.h  | 74 +++++---------------------------------
 2 files changed, 23 insertions(+), 112 deletions(-)

diff --git a/include/configs/MPC8313ERDB_NAND.h b/include/configs/MPC8313ERDB_NAND.h
index d522d21a74..e17c632f3a 100644
--- a/include/configs/MPC8313ERDB_NAND.h
+++ b/include/configs/MPC8313ERDB_NAND.h
@@ -15,7 +15,6 @@
 #define CONFIG_E300 1
 #define CONFIG_MPC8313ERDB 1
 
-#ifdef CONFIG_NAND
 #define CONFIG_SPL_INIT_MINIMAL
 #define CONFIG_SPL_FLUSH_IMAGE
 #define CONFIG_SPL_TARGET "u-boot-with-spl.bin"
@@ -40,8 +39,6 @@
 #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE_SPL /* start of monitor */
 #endif
 
-#endif /* CONFIG_NAND */
-
 #ifndef CONFIG_SYS_MONITOR_BASE
 #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE /* start of monitor */
 #endif
@@ -70,7 +67,7 @@
 
 #define CONFIG_SYS_IMMR 0xE0000000
 
-#if defined(CONFIG_NAND) && !defined(CONFIG_SPL_BUILD)
+#if !defined(CONFIG_SPL_BUILD)
 #define CONFIG_DEFAULT_IMMR CONFIG_SYS_IMMR
 #endif
 
@@ -188,11 +185,11 @@
 #define CONFIG_SYS_FLASH_EMPTY_INFO /* display empty sectors */
 #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE /* buffer up multiple bytes */
 
-#define CONFIG_SYS_NOR_BR_PRELIM (CONFIG_SYS_FLASH_BASE \
+#define CONFIG_SYS_BR1_PRELIM (CONFIG_SYS_FLASH_BASE \
  | BR_PS_16 /* 16 bit port */ \
  | BR_MS_GPCM /* MSEL = GPCM */ \
  | BR_V) /* valid */
-#define CONFIG_SYS_NOR_OR_PRELIM (MEG_TO_AM(CONFIG_SYS_FLASH_SIZE) \
+#define CONFIG_SYS_OR1_PRELIM (MEG_TO_AM(CONFIG_SYS_FLASH_SIZE) \
  | OR_GPCM_XACS \
  | OR_GPCM_SCY_9 \
  | OR_GPCM_EHTR \
@@ -239,7 +236,7 @@
 #define CONFIG_SYS_LBC_MRTPR 0x20000000  /*TODO */
 
 /* drivers/mtd/nand/nand.c */
-#if defined(CONFIG_NAND) && defined(CONFIG_SPL_BUILD)
+#if defined(CONFIG_SPL_BUILD)
 #define CONFIG_SYS_NAND_BASE 0xFFF00000
 #else
 #define CONFIG_SYS_NAND_BASE 0xE2800000
@@ -252,12 +249,12 @@
 #define CONFIG_SYS_NAND_BLOCK_SIZE 16384
 #define CONFIG_SYS_NAND_WINDOW_SIZE (32 * 1024)
 
-#define CONFIG_SYS_NAND_BR_PRELIM (CONFIG_SYS_NAND_BASE \
+#define CONFIG_SYS_BR0_PRELIM (CONFIG_SYS_NAND_BASE \
  | BR_DECC_CHK_GEN /* Use HW ECC */ \
  | BR_PS_8 /* 8 bit port */ \
  | BR_MS_FCM /* MSEL = FCM */ \
  | BR_V) /* valid */
-#define CONFIG_SYS_NAND_OR_PRELIM \
+#define CONFIG_SYS_OR0_PRELIM \
  (P2SZ_TO_AM(CONFIG_SYS_NAND_WINDOW_SIZE) \
  | OR_FCM_CSCT \
  | OR_FCM_CST \
@@ -267,17 +264,9 @@
  | OR_FCM_EHTR)
  /* 0xFFFF8396 */
 
-#ifdef CONFIG_NAND
-#define CONFIG_SYS_BR0_PRELIM CONFIG_SYS_NAND_BR_PRELIM
-#define CONFIG_SYS_OR0_PRELIM CONFIG_SYS_NAND_OR_PRELIM
-#define CONFIG_SYS_BR1_PRELIM CONFIG_SYS_NOR_BR_PRELIM
-#define CONFIG_SYS_OR1_PRELIM CONFIG_SYS_NOR_OR_PRELIM
-#else
-#define CONFIG_SYS_BR0_PRELIM CONFIG_SYS_NOR_BR_PRELIM
-#define CONFIG_SYS_OR0_PRELIM CONFIG_SYS_NOR_OR_PRELIM
-#define CONFIG_SYS_BR1_PRELIM CONFIG_SYS_NAND_BR_PRELIM
-#define CONFIG_SYS_OR1_PRELIM CONFIG_SYS_NAND_OR_PRELIM
-#endif
+/* Still needed for spl_minimal.c */
+#define CONFIG_SYS_NAND_BR_PRELIM CONFIG_SYS_BR0_PRELIM
+#define CONFIG_SYS_NAND_OR_PRELIM CONFIG_SYS_OR0_PRELIM
 
 #define CONFIG_SYS_LBLAWBAR1_PRELIM CONFIG_SYS_NAND_BASE
 #define CONFIG_SYS_LBLAWAR1_PRELIM (LBLAWAR_EN | LBLAWAR_32KB)
@@ -411,25 +400,12 @@
 /*
  * Environment
  */
-#if defined(CONFIG_NAND)
- #define CONFIG_ENV_OFFSET (512 * 1024)
- #define CONFIG_ENV_SECT_SIZE CONFIG_SYS_NAND_BLOCK_SIZE
- #define CONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE
- #define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
- #define CONFIG_ENV_RANGE (CONFIG_ENV_SECT_SIZE * 4)
- #define CONFIG_ENV_OFFSET_REDUND \
- (CONFIG_ENV_OFFSET + CONFIG_ENV_RANGE)
-#elif !defined(CONFIG_SYS_RAMBOOT)
- #define CONFIG_ENV_ADDR \
- (CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN)
- #define CONFIG_ENV_SECT_SIZE 0x10000 /* 64K(one sector) for env */
- #define CONFIG_ENV_SIZE 0x2000
-
-/* Address and size of Redundant Environment Sector */
-#else
- #define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE - 0x1000)
- #define CONFIG_ENV_SIZE 0x2000
-#endif
+#define CONFIG_ENV_OFFSET (512 * 1024)
+#define CONFIG_ENV_SECT_SIZE CONFIG_SYS_NAND_BLOCK_SIZE
+#define CONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE
+#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
+#define CONFIG_ENV_RANGE (CONFIG_ENV_SECT_SIZE * 4)
+#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_RANGE)
 
 #define CONFIG_LOADS_ECHO 1 /* echo on for serial download */
 #define CONFIG_SYS_LOADS_BAUD_CHANGE 1 /* allow baudrate change */
@@ -503,17 +479,10 @@
  HRCWH_TSEC2M_IN_RGMII |\
  HRCWH_BIG_ENDIAN)
 
-#ifdef CONFIG_NAND
 #define CONFIG_SYS_HRCW_HIGH (CONFIG_SYS_HRCW_HIGH_BASE |\
        HRCWH_FROM_0XFFF00100 |\
        HRCWH_ROM_LOC_NAND_SP_8BIT |\
        HRCWH_RL_EXT_NAND)
-#else
-#define CONFIG_SYS_HRCW_HIGH (CONFIG_SYS_HRCW_HIGH_BASE |\
-       HRCWH_FROM_0X00000100 |\
-       HRCWH_ROM_LOC_LOCAL_16BIT |\
-       HRCWH_RL_EXT_LEGACY)
-#endif
 
 /* System IO Config */
 #define CONFIG_SYS_SICRH (SICRH_TSOBI1 | SICRH_TSOBI2) /* RGMII */
diff --git a/include/configs/MPC8313ERDB_NOR.h b/include/configs/MPC8313ERDB_NOR.h
index d522d21a74..8d8482d00f 100644
--- a/include/configs/MPC8313ERDB_NOR.h
+++ b/include/configs/MPC8313ERDB_NOR.h
@@ -15,33 +15,6 @@
 #define CONFIG_E300 1
 #define CONFIG_MPC8313ERDB 1
 
-#ifdef CONFIG_NAND
-#define CONFIG_SPL_INIT_MINIMAL
-#define CONFIG_SPL_FLUSH_IMAGE
-#define CONFIG_SPL_TARGET "u-boot-with-spl.bin"
-#define CONFIG_SPL_MPC83XX_WAIT_FOR_NAND
-
-#ifdef CONFIG_SPL_BUILD
-#define CONFIG_NS16550_MIN_FUNCTIONS
-#endif
-
-#define CONFIG_SYS_TEXT_BASE_SPL 0xfff00000
-#define CONFIG_SPL_MAX_SIZE (4 * 1024)
-#define CONFIG_SPL_PAD_TO 0x4000
-
-#define CONFIG_SYS_NAND_U_BOOT_SIZE  (512 << 10)
-#define CONFIG_SYS_NAND_U_BOOT_DST   0x00100000
-#define CONFIG_SYS_NAND_U_BOOT_START 0x00100100
-#define CONFIG_SYS_NAND_U_BOOT_OFFS  16384
-#define CONFIG_SYS_NAND_U_BOOT_RELOC 0x00010000
-#define CONFIG_SYS_NAND_U_BOOT_RELOC_SP (CONFIG_SYS_NAND_U_BOOT_RELOC + 0x10000)
-
-#ifdef CONFIG_SPL_BUILD
-#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE_SPL /* start of monitor */
-#endif
-
-#endif /* CONFIG_NAND */
-
 #ifndef CONFIG_SYS_MONITOR_BASE
 #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE /* start of monitor */
 #endif
@@ -70,10 +43,6 @@
 
 #define CONFIG_SYS_IMMR 0xE0000000
 
-#if defined(CONFIG_NAND) && !defined(CONFIG_SPL_BUILD)
-#define CONFIG_DEFAULT_IMMR CONFIG_SYS_IMMR
-#endif
-
 #define CONFIG_SYS_MEMTEST_START 0x00001000
 #define CONFIG_SYS_MEMTEST_END 0x07f00000
 
@@ -188,11 +157,11 @@
 #define CONFIG_SYS_FLASH_EMPTY_INFO /* display empty sectors */
 #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE /* buffer up multiple bytes */
 
-#define CONFIG_SYS_NOR_BR_PRELIM (CONFIG_SYS_FLASH_BASE \
+#define CONFIG_SYS_BR0_PRELIM (CONFIG_SYS_FLASH_BASE \
  | BR_PS_16 /* 16 bit port */ \
  | BR_MS_GPCM /* MSEL = GPCM */ \
  | BR_V) /* valid */
-#define CONFIG_SYS_NOR_OR_PRELIM (MEG_TO_AM(CONFIG_SYS_FLASH_SIZE) \
+#define CONFIG_SYS_OR0_PRELIM (MEG_TO_AM(CONFIG_SYS_FLASH_SIZE) \
  | OR_GPCM_XACS \
  | OR_GPCM_SCY_9 \
  | OR_GPCM_EHTR \
@@ -239,11 +208,7 @@
 #define CONFIG_SYS_LBC_MRTPR 0x20000000  /*TODO */
 
 /* drivers/mtd/nand/nand.c */
-#if defined(CONFIG_NAND) && defined(CONFIG_SPL_BUILD)
-#define CONFIG_SYS_NAND_BASE 0xFFF00000
-#else
 #define CONFIG_SYS_NAND_BASE 0xE2800000
-#endif
 
 #define CONFIG_MTD_PARTITION
 
@@ -252,12 +217,12 @@
 #define CONFIG_SYS_NAND_BLOCK_SIZE 16384
 #define CONFIG_SYS_NAND_WINDOW_SIZE (32 * 1024)
 
-#define CONFIG_SYS_NAND_BR_PRELIM (CONFIG_SYS_NAND_BASE \
+#define CONFIG_SYS_BR1_PRELIM (CONFIG_SYS_NAND_BASE \
  | BR_DECC_CHK_GEN /* Use HW ECC */ \
  | BR_PS_8 /* 8 bit port */ \
  | BR_MS_FCM /* MSEL = FCM */ \
  | BR_V) /* valid */
-#define CONFIG_SYS_NAND_OR_PRELIM \
+#define CONFIG_SYS_OR1_PRELIM \
  (P2SZ_TO_AM(CONFIG_SYS_NAND_WINDOW_SIZE) \
  | OR_FCM_CSCT \
  | OR_FCM_CST \
@@ -267,17 +232,9 @@
  | OR_FCM_EHTR)
  /* 0xFFFF8396 */
 
-#ifdef CONFIG_NAND
-#define CONFIG_SYS_BR0_PRELIM CONFIG_SYS_NAND_BR_PRELIM
-#define CONFIG_SYS_OR0_PRELIM CONFIG_SYS_NAND_OR_PRELIM
-#define CONFIG_SYS_BR1_PRELIM CONFIG_SYS_NOR_BR_PRELIM
-#define CONFIG_SYS_OR1_PRELIM CONFIG_SYS_NOR_OR_PRELIM
-#else
-#define CONFIG_SYS_BR0_PRELIM CONFIG_SYS_NOR_BR_PRELIM
-#define CONFIG_SYS_OR0_PRELIM CONFIG_SYS_NOR_OR_PRELIM
-#define CONFIG_SYS_BR1_PRELIM CONFIG_SYS_NAND_BR_PRELIM
-#define CONFIG_SYS_OR1_PRELIM CONFIG_SYS_NAND_OR_PRELIM
-#endif
+/* Still needed for spl_minimal.c */
+#define CONFIG_SYS_NAND_BR_PRELIM CONFIG_SYS_BR1_PRELIM
+#define CONFIG_SYS_NAND_OR_PRELIM CONFIG_SYS_OR1_PRELIM
 
 #define CONFIG_SYS_LBLAWBAR1_PRELIM CONFIG_SYS_NAND_BASE
 #define CONFIG_SYS_LBLAWAR1_PRELIM (LBLAWAR_EN | LBLAWAR_32KB)
@@ -411,15 +368,7 @@
 /*
  * Environment
  */
-#if defined(CONFIG_NAND)
- #define CONFIG_ENV_OFFSET (512 * 1024)
- #define CONFIG_ENV_SECT_SIZE CONFIG_SYS_NAND_BLOCK_SIZE
- #define CONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE
- #define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
- #define CONFIG_ENV_RANGE (CONFIG_ENV_SECT_SIZE * 4)
- #define CONFIG_ENV_OFFSET_REDUND \
- (CONFIG_ENV_OFFSET + CONFIG_ENV_RANGE)
-#elif !defined(CONFIG_SYS_RAMBOOT)
+#if !defined(CONFIG_SYS_RAMBOOT)
  #define CONFIG_ENV_ADDR \
  (CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN)
  #define CONFIG_ENV_SECT_SIZE 0x10000 /* 64K(one sector) for env */
@@ -503,17 +452,10 @@
  HRCWH_TSEC2M_IN_RGMII |\
  HRCWH_BIG_ENDIAN)
 
-#ifdef CONFIG_NAND
-#define CONFIG_SYS_HRCW_HIGH (CONFIG_SYS_HRCW_HIGH_BASE |\
-       HRCWH_FROM_0XFFF00100 |\
-       HRCWH_ROM_LOC_NAND_SP_8BIT |\
-       HRCWH_RL_EXT_NAND)
-#else
 #define CONFIG_SYS_HRCW_HIGH (CONFIG_SYS_HRCW_HIGH_BASE |\
        HRCWH_FROM_0X00000100 |\
        HRCWH_ROM_LOC_LOCAL_16BIT |\
        HRCWH_RL_EXT_LEGACY)
-#endif
 
 /* System IO Config */
 #define CONFIG_SYS_SICRH (SICRH_TSOBI1 | SICRH_TSOBI2) /* RGMII */
--
2.16.4

_______________________________________________
U-Boot mailing list
[hidden email]
https://lists.denx.de/listinfo/u-boot
12