Skip to contentSkip to conversation

mpc83xx: Kconfig migrations

PATCH Superseded Mario Six 3 participants 30 messages Sep 28, 2018 – Oct 12, 2018

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Mario Six

author
#0 lore raw

cover mpc83xx: Kconfig migrations

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

author
#1 lore raw

PATCH 1/48 mpc83xx: Introduce ARCH_MPC830*

Replace CONFIG_MPC830* with proper CONFIG_ARCH_MPC830* Kconfig options.

---
 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(-)
arch/powerpc/cpu/mpc83xx/Kconfig +17 -0
index 571cf8fc2e..142b924786 100644
@@ -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"
arch/powerpc/cpu/mpc83xx/spd_sdram.c +1 -1
index 328a018eb6..97ef77121b 100644
@@ -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)
arch/powerpc/cpu/mpc83xx/speed.c +19 -19
index 39bc1c5340..d537af5130 100644
@@ -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));
arch/powerpc/include/asm/arch-mpc83xx/gpio.h +1 -1
index 57f783ba14..4e5a352ac6 100644
@@ -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)
arch/powerpc/include/asm/fsl_lbc.h +1 -1
index b076d5e838..cf89e186a6 100644
@@ -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
arch/powerpc/include/asm/global_data.h +3 -3
index d00cee95fb..700e2be0ee 100644
@@ -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;
arch/powerpc/include/asm/immap_83xx.h +5 -5
index afef36f262..b10feb546c 100644
@@ -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 */
arch/powerpc/include/asm/mpc8xxx_spi.h +1 -1
index 432be05469..518d0c388a 100644
@@ -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) || \
board/keymile/km83xx/km83xx.c +1 -1
index 4818a4994a..ce5126aae6 100644
@@ -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 */
drivers/qe/qe.c +1 -1
index 7654df8008..8813dc2ae1 100644
@@ -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,
drivers/ram/mpc83xx_sdram.c +2 -2
index 441baeb6f1..e352329981 100644
@@ -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)) {
include/configs/MPC8308RDB.h +0 -2
index e5a164d4d1..3ea310ad81 100644
@@ -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
include/configs/hrcon.h +0 -2
index c292c258c6..da0b0f5014 100644
@@ -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
include/configs/km/km8309-common.h +0 -2
index 0e0b1b4605..3bd334c515 100644
@@ -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"
 
include/configs/km/km83xx-common.h +1 -1
index 337a9cec66..3868d99b87 100644
@@ -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
include/configs/mpc8308_p1m.h +0 -2
index 6752ef66da..d2140e7302 100644
@@ -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
include/configs/strider.h +0 -2
index 9b89031965..9a025b255f 100644
@@ -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
include/linux/immap_qe.h +1 -1
index 51800096b2..f7bc503ea3 100644
@@ -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
include/mpc83xx.h +12 -12
index a4c5bd3837..e93f50d0b3 100644
@@ -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
Signature · 1 line
2.16.4
#2 lore raw

PATCH 1/48 mpc83xx: Introduce ARCH_MPC830*

Hi Mario,

Quoted 17 lines · Mario Six

Replace CONFIG_MPC830* with proper CONFIG_ARCH_MPC830* Kconfig options.

---
 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 --
Quoted 9 lines
 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(-)

One generic comments, shouldn't we call these CONFIG_SOC_XXX? Arch means architecture, but they are all PowerPC architecture..

Regards,
Bin

author
#3 lore raw

PATCH 1/48 mpc83xx: Introduce ARCH_MPC830*

Hi Bin,

Quoted 31 lines · Bin Meng

Hi Mario,

Quoted 17 lines · Mario Six

Replace CONFIG_MPC830* with proper CONFIG_ARCH_MPC830* Kconfig options.

---
 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 --
Quoted 9 lines
 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(-)
Quoted 3 lines

One generic comments, shouldn't we call these CONFIG_SOC_XXX? Arch means architecture, but they are all PowerPC architecture..

I copied the CONFIG_ARCH_* convention from mpc85xx, and it seems virtually all other architectures use CONFIG_ARCH_* as well (aside from davinci, from what I see, but these are all not even converted to Kconfig, it seems?)

So, I'm not principally against naming the variables CONFIG_SOC_*, but it seems to not be the current consensus, I think?

Quoted 2 lines

Regards,
Bin

Best regards,
Mario

author
#4 lore raw

PATCH 2/48 mpc83xx: Introduce ARCH_MPC831*

In reply to Mario Six

Replace CONFIG_MPC833* with proper CONFIG_ARCH_MPC833* Kconfig options.

---
 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(-)
arch/powerpc/cpu/mpc83xx/Kconfig +15 -0
index 142b924786..20780ba68b 100644
@@ -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"
arch/powerpc/cpu/mpc83xx/cpu.c +1 -1
index b29f271e9b..8a88068fdb 100644
@@ -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
arch/powerpc/cpu/mpc83xx/cpu_init.c +2 -2
index 1555205e06..7d8d5516b4 100644
@@ -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;
 
arch/powerpc/cpu/mpc83xx/fdt.c +3 -3
index 0ecafd708f..cfd391b78a 100644
@@ -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
 }
arch/powerpc/cpu/mpc83xx/spd_sdram.c +1 -1
index 97ef77121b..3f18aadf19 100644
@@ -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)
arch/powerpc/cpu/mpc83xx/speed.c +20 -20
index d537af5130..9f09d2955f 100644
@@ -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
arch/powerpc/include/asm/arch-mpc83xx/gpio.h +2 -2
index 4e5a352ac6..74ba91a469 100644
@@ -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
arch/powerpc/include/asm/global_data.h +4 -4
index 700e2be0ee..0c3a4ade5c 100644
@@ -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)
arch/powerpc/include/asm/immap_83xx.h +2 -2
index b10feb546c..d22d887bab 100644
@@ -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 */
arch/powerpc/include/asm/mpc8xxx_spi.h +2 -2
index 518d0c388a..3edd561007 100644
@@ -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)
 
drivers/ram/mpc83xx_sdram.c +2 -2
index e352329981..58db7948c1 100644
@@ -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",
include/configs/MPC8313ERDB.h +0 -2
index 884dd4125e..d522d21a74 100644
@@ -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
include/configs/MPC8315ERDB.h +0 -2
index 9de3744759..64967f6798 100644
@@ -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 */
 
 /*
include/configs/ids8313.h +0 -3
index afa7e10778..6a222e9757 100644
@@ -14,9 +14,6 @@
 /*
  * High Level Configuration Options
  */
-#define CONFIG_MPC831x
-#define CONFIG_MPC8313
-
 #define CONFIG_FSL_ELBC
 
 #define CONFIG_BOOT_RETRY_TIME		900
include/configs/ve8313.h +0 -2
index 90554dacf8..dfbebee6b2 100644
@@ -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
include/mpc83xx.h +10 -10
index e93f50d0b3..0da271b2f3 100644
@@ -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
Signature · 1 line
2.16.4
author
#5 lore raw

PATCH 3/48 mpc83xx: Introduce ARCH_MPC832*

In reply to Mario Six

Replace CONFIG_MPC832* with proper CONFIG_ARCH_MPC832* Kconfig options.

---
 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(-)
arch/powerpc/cpu/mpc83xx/Kconfig +7 -0
index 20780ba68b..1b9402e024 100644
@@ -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"
arch/powerpc/cpu/mpc83xx/speed.c +5 -5
index 9f09d2955f..ab025af70d 100644
@@ -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
arch/powerpc/include/asm/immap_83xx.h +1 -1
index d22d887bab..318b79d0b8 100644
@@ -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 */
include/configs/MPC8323ERDB.h +0 -1
index 85ea171175..0ef9dadd04 100644
@@ -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
include/configs/MPC832XEMDS.h +0 -1
index e92a8c0148..ff8692e9ca 100644
@@ -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 */
 
 /*
include/configs/km/km8321-common.h +0 -1
index 41b3ba2842..a121a445f7 100644
@@ -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"
include/linux/immap_qe.h +1 -1
index f7bc503ea3..6552d0e3c5 100644
@@ -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
include/mpc83xx.h +3 -3
index 0da271b2f3..0f4466ae89 100644
@@ -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)
Signature · 1 line
2.16.4
author
#6 lore raw

PATCH 4/48 mpc83xx: Introduce ARCH_MPC834*

In reply to Mario Six

Replace CONFIG_MPC834* with proper CONFIG_ARCH_MPC834* Kconfig options.

---
 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(-)
arch/powerpc/cpu/mpc83xx/Kconfig +14 -0
index 1b9402e024..2926472319 100644
@@ -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"
arch/powerpc/cpu/mpc83xx/cpu_init.c +1 -1
index 7d8d5516b4..7c378671fe 100644
@@ -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);
arch/powerpc/cpu/mpc83xx/spd_sdram.c +1 -1
index 3f18aadf19..b3cbf9f882 100644
@@ -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)
arch/powerpc/cpu/mpc83xx/speed.c +11 -11
index ab025af70d..7cb6f3727d 100644
@@ -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
arch/powerpc/include/asm/arch-mpc83xx/gpio.h +1 -1
index 74ba91a469..16997316ff 100644
@@ -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
arch/powerpc/include/asm/fsl_lbc.h +4 -4
index cf89e186a6..0ea4456033 100644
@@ -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)
arch/powerpc/include/asm/global_data.h +3 -3
index 0c3a4ade5c..cd0d76696d 100644
@@ -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
arch/powerpc/include/asm/immap_83xx.h +3 -3
index 318b79d0b8..bf7a4b9250 100644
@@ -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
arch/powerpc/include/asm/mpc8xxx_spi.h +1 -1
index 3edd561007..0c2bdb326b 100644
@@ -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 {
drivers/pci/pci_auto.c +1 -1
index d7237f6eee..a673d8ae13 100644
@@ -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
drivers/pci/pci_auto_old.c +1 -1
index e705a3072e..90c22a08cb 100644
@@ -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
include/configs/MPC8349EMDS.h +0 -2
index cf2a6bda7e..2ceed48ff3 100644
@@ -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
include/configs/MPC8349ITX.h +0 -3
index 77174e3b7e..1b247a3a3e 100644
@@ -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
include/configs/TQM834x.h +0 -2
index fc1fa0c089..d155ac5892 100644
@@ -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
include/configs/sbc8349.h +0 -2
index 9c5d05de3e..f3a72dd804 100644
@@ -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 */
include/configs/vme8349.h +0 -2
index 7fc89e8e71..00939d6d58 100644
@@ -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. */
include/mpc83xx.h +9 -9
index 0f4466ae89..feb8fef601 100644
@@ -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
include/usb/ehci-ci.h +1 -1
index e4579a5bec..efb2eec5ce 100644
@@ -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
Signature · 1 line
2.16.4
author
#7 lore raw

PATCH 5/48 mpc83xx: Introduce ARCH_MPC836*

In reply to Mario Six

Replace CONFIG_MPC836* with proper CONFIG_ARCH_MPC836* Kconfig options.

---
 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(-)
arch/powerpc/cpu/mpc83xx/Kconfig +4 -0
index 2926472319..56a59ae4ef 100644
@@ -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"
arch/powerpc/cpu/mpc83xx/speed.c +5 -5
index 7cb6f3727d..ed77675a8e 100644
@@ -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
arch/powerpc/include/asm/fsl_lbc.h +2 -2
index 0ea4456033..3528acd627 100644
@@ -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 */
arch/powerpc/include/asm/global_data.h +2 -2
index cd0d76696d..cf3ba58822 100644
@@ -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)
arch/powerpc/include/asm/immap_83xx.h +1 -1
index bf7a4b9250..f6721e7b1d 100644
@@ -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 */
board/keymile/km83xx/km83xx.c +2 -2
index ce5126aae6..12044ee0d7 100644
@@ -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
drivers/ram/mpc83xx_sdram.c +4 -4
index 58db7948c1..3e57b13118 100644
@@ -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);
include/configs/km8360.h +0 -1
index feb8a9a16d..7857b83055 100644
@@ -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"
include/linux/immap_qe.h +1 -1
index 6552d0e3c5..022771fff5 100644
@@ -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
include/mpc83xx.h +5 -5
index feb8fef601..94b2816a82 100644
@@ -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
include/post.h +1 -1
index 08a771e405..eb218acde5 100644
@@ -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)
 
Signature · 1 line
2.16.4
author
#8 lore raw

PATCH 6/48 mpc83xx: Introduce ARCH_MPC837X

In reply to Mario Six

Replace CONFIG_MPC837x with a proper CONFIG_ARCH_MPC837X Kconfig option.

---
 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(-)
arch/powerpc/cpu/mpc83xx/Kconfig +3 -0
index 56a59ae4ef..e41f4d1f9a 100644
@@ -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"
arch/powerpc/cpu/mpc83xx/speed.c +15 -15
index ed77675a8e..668ed27862 100644
@@ -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
arch/powerpc/include/asm/arch-mpc83xx/gpio.h +1 -1
index 16997316ff..b5ec50ba44 100644
@@ -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
arch/powerpc/include/asm/global_data.h +3 -3
index cf3ba58822..b6e4dd6c80 100644
@@ -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)
arch/powerpc/include/asm/immap_83xx.h +1 -1
index f6721e7b1d..30bbd5671b 100644
@@ -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 */
arch/powerpc/include/asm/mpc8xxx_spi.h +1 -1
index 0c2bdb326b..b583a3269d 100644
@@ -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 */
drivers/ram/mpc83xx_sdram.c +4 -4
index 3e57b13118..f03d0428b2 100644
@@ -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;
include/configs/MPC837XEMDS.h +0 -1
index 3fdf34669f..ea009eb094 100644
@@ -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 */
 
 /*
include/configs/MPC837XERDB.h +0 -1
index aae777db95..40824be21e 100644
@@ -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
include/mpc83xx.h +12 -12
index 94b2816a82..c2a185321a 100644
@@ -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
Signature · 1 line
2.16.4
author
#9 lore raw

PATCH 7/48 keymile: Make distinct kmtegr1, kmvect1, suvd3 configs

In reply to 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.

---
 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
arch/powerpc/cpu/mpc83xx/Kconfig +13 -3
index e41f4d1f9a..59e0c9a8d0 100644
@@ -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
 
board/keymile/km83xx/Kconfig +26 -0
index d6c594c96a..d52ee9117b 100644
@@ -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
configs/kmtegr1_defconfig +1 -1
index a3325a7662..528380a110 100644
@@ -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"
configs/kmvect1_defconfig +1 -1
index 927ef9d56e..94bd6ce055 100644
@@ -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"
include/configs/kmtegr1.h new file +190 -0

190 lines not on this page · raw message

include/configs/kmvect1.h new file +190 -0

190 lines not on this page · raw message

Signature · 1 line
2.16.4
author
#10 lore raw

PATCH 8/48 keymile: Simplify kmtegr1, kmvect1, suvd3 configs

In reply to 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.

---
 include/configs/kmtegr1.h | 90 ---------------------------------------------
 include/configs/kmvect1.h | 57 ----------------------------
 include/configs/suvd3.h   | 94 -----------------------------------------------
 3 files changed, 241 deletions(-)
include/configs/kmtegr1.h +0 -90
index 3e88c9000c..69397ae5ae 100644
@@ -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 */
include/configs/kmvect1.h +0 -57

111 lines not on this page · raw message

include/configs/suvd3.h +0 -94

133 lines not on this page · raw message

Signature · 1 line
2.16.4
author
#11 lore raw

PATCH 9/48 keymile: Move config files

In reply to 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.

---
 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%)
include/configs/km8309-common.h renamed from include/configs/km/km8309-common.h +0 -0
similarity index 100%
rename from include/configs/km/km8309-common.h
rename to include/configs/km8309-common.h
include/configs/km8321-common.h renamed from include/configs/km/km8321-common.h +0 -0
similarity index 100%
rename from include/configs/km/km8321-common.h
rename to include/configs/km8321-common.h
include/configs/km8360.h +1 -1
index 7857b83055..08d2ae0cbc 100644
@@ -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
include/configs/km83xx-common.h renamed from include/configs/km/km83xx-common.h +2 -2
similarity index 99%
rename from include/configs/km/km83xx-common.h
rename to include/configs/km83xx-common.h
index 3868d99b87..f817d978e7 100644
@@ -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
include/configs/kmtegr1.h +2 -2
index 69397ae5ae..95a131892d 100644
@@ -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 */
 
include/configs/kmvect1.h +2 -2
index 178e769976..0bbf541aec 100644
@@ -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 */
include/configs/suvd3.h +2 -2
index 2a3f7ff526..98137392ed 100644
@@ -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 */
include/configs/tuxx1.h +1 -1
index f22d73b8d3..0b17084b05 100644
@@ -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 */
Signature · 1 line
2.16.4
author
#12 lore raw

PATCH 10/48 keymile: Unroll includes

In reply to Mario Six

To further simplify config include files, unroll the km/km8309-common.h and km/km8321-common.h include files.

---
 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
include/configs/km8309-common.h deleted +0 -174
deleted file mode 100644
index 3bd334c515..0000000000
@@ -1,174 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * Copyright (C) 2012 Keymile AG
- *                    Gerlando Falauto <[email protected]>
- *
- * 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 */
include/configs/km8321-common.h deleted +0 -139

139 lines not on this page · raw message

include/configs/kmtegr1.h +174 -1

181 lines not on this page · raw message

include/configs/kmvect1.h +173 -1

181 lines not on this page · raw message

include/configs/suvd3.h +138 -1

146 lines not on this page · raw message

include/configs/tuxx1.h +138 -1

146 lines not on this page · raw message

Signature · 1 line
2.16.4
author
#13 lore raw

PATCH 11/48 keymile: Simplify config files

In reply to Mario Six

Simplify the config files in which we recently unrolled the km8309-common.h include file.

---
 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(-)
include/configs/kmtegr1.h +0 -13
index e6ec3488dc..27e3905c2b 100644
@@ -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 <[email protected]>
- *
- * 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 */
 
include/configs/kmvect1.h +0 -12
index e549d20033..5a0fbccade 100644
@@ -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 <[email protected]>
- *
- * 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
include/configs/suvd3.h +0 -25
index d45d6779f4..5fe5f3cc23 100644
@@ -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 <[email protected]>
- *
- * Copyright (C) 2007 Logic Product Development, Inc.
- *                    Peter Barada <[email protected]>
- *
- * Copyright (C) 2007 MontaVista Software, Inc.
- *                    Anton Vorontsov <[email protected]>
- *
- * (C) Copyright 2008
- * Heiko Schocher, DENX Software Engineering, hs at denx.de.
- *
- * (C) Copyright 2010
- * Lukas Roggli, KEYMILE Ltd, lukas.roggli at keymile.com
- *
- * (C) Copyright 2010-2011
- * Thomas Reufer, KEYMILE Ltd, thomas.reufer at keymile.com
- */
-
-#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
include/configs/tuxx1.h +0 -26
index 8692989669..c031661830 100644
@@ -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 <[email protected]>
- *
- * Copyright (C) 2007 Logic Product Development, Inc.
- *                    Peter Barada <[email protected]>
- *
- * Copyright (C) 2007 MontaVista Software, Inc.
- *                    Anton Vorontsov <[email protected]>
- *
- * (C) Copyright 2008
- * Heiko Schocher, DENX Software Engineering, hs at denx.de.
- *
- * (C) Copyright 2010
- * Lukas Roggli, KEYMILE Ltd, lukas.roggli at keymile.com
- *
- * (C) Copyright 2010-2011
- * Thomas Reufer, KEYMILE Ltd, thomas.reufer at keymile.com
- */
-
-#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)
Signature · 1 line
2.16.4
author
#14 lore raw

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

In reply to 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.

---
 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
arch/powerpc/cpu/mpc83xx/Kconfig +24 -0
index 59e0c9a8d0..1ebb092f0b 100644
@@ -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
board/keymile/km83xx/Kconfig +52 -0

55 lines not on this page · raw message

configs/kmopti2_defconfig +1 -2
index 5f68f062dd..43b7e7c62f 100644
@@ -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
configs/kmsupx5_defconfig +1 -2
index 98de2e873a..1b92c6e6a0 100644
@@ -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
configs/kmtepr2_defconfig +1 -2
index 46dcb379cd..f62f7c2f3f 100644
@@ -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
configs/tuge1_defconfig +1 -2
index 1c67bc0c15..e8603888d2 100644
@@ -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
configs/tuxx1_defconfig +0 -1
index de22b0b5ea..40cfe71047 100644
@@ -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
include/configs/kmopti2.h new file +307 -0

307 lines not on this page · raw message

include/configs/kmsupx5.h new file +307 -0

307 lines not on this page · raw message

include/configs/kmtepr2.h new file +307 -0

307 lines not on this page · raw message

include/configs/tuge1.h new file +307 -0

307 lines not on this page · raw message

include/configs/tuxx1.h +9 -9
index c031661830..64d6f21514 100644
@@ -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
Signature · 1 line
2.16.4
author
#15 lore raw

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

In reply to Mario Six

Simplify the kmsupx5, tuge1, kmopti2, and kmtepr2 config files to only include the #ifdefs needed for each board.

---
 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(-)
include/configs/kmopti2.h +0 -73
index 64d6f21514..0621be3928 100644
@@ -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)
include/configs/kmsupx5.h +0 -97

132 lines not on this page · raw message

include/configs/kmtepr2.h +0 -72

119 lines not on this page · raw message

include/configs/tuge1.h +0 -97

132 lines not on this page · raw message

include/configs/tuxx1.h +0 -62

109 lines not on this page · raw message

Signature · 1 line
2.16.4
author
#16 lore raw

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

In reply to Mario Six

Simplify the keymile config files once more by unrolling the km/km83xx-common.h

---
 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(-)
include/configs/km8360.h +299 -1
index 08d2ae0cbc..0d082e6488 100644
@@ -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, hs at denx.de.
+ */
+
+#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
  */
include/configs/kmopti2.h +299 -1

307 lines not on this page · raw message

include/configs/kmsupx5.h +299 -1

307 lines not on this page · raw message

include/configs/kmtegr1.h +299 -1

307 lines not on this page · raw message

include/configs/kmtepr2.h +299 -1

307 lines not on this page · raw message

include/configs/kmvect1.h +299 -1

307 lines not on this page · raw message

include/configs/suvd3.h +299 -1

307 lines not on this page · raw message

include/configs/tuge1.h +299 -1

307 lines not on this page · raw message

include/configs/tuxx1.h +299 -1

307 lines not on this page · raw message

Signature · 1 line
2.16.4
author
#17 lore raw

PATCH 15/48 keymile: Simplify configs after include unroll

In reply to Mario Six

Simplify the keymile configs again after unrolling the km83xx-common.h include file.

---
 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(-)
include/configs/km8360.h +0 -11
index 0d082e6488..b22345bcc2 100644
@@ -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, hs at denx.de.
- */
-
-#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
  */
include/configs/kmopti2.h +0 -13
index 2533d290a1..60f7fd09d9 100644
@@ -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, hs at denx.de.
- */
-
-#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
  */
include/configs/kmsupx5.h +0 -13
index 3dbd554303..4af2903ec2 100644
@@ -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, hs at denx.de.
- */
-
-#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
  */
include/configs/kmtegr1.h +0 -18
index 27f8345708..c731c0666f 100644
@@ -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, hs at denx.de.
- */
-
-#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 */
include/configs/kmtepr2.h +0 -13
index ed70f884c8..ca7a1477e2 100644
@@ -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, hs at denx.de.
- */
-
-#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
  */
include/configs/kmvect1.h +0 -18
index 446161e157..9eae4cdf07 100644
@@ -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, hs at denx.de.
- */
-
-#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 */
include/configs/suvd3.h +0 -15
index 34e97ef9fd..a652343d95 100644
@@ -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, hs at denx.de.
- */
-
-#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
  */
include/configs/tuge1.h +0 -13
index d2e0466cd8..cfd317f6e1 100644
@@ -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, hs at denx.de.
- */
-
-#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
  */
include/configs/tuxx1.h +0 -13
index f1d12e456f..b3bfb7b7c5 100644
@@ -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, hs at denx.de.
- */
-
-#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
  */
Signature · 1 line
2.16.4
author
#18 lore raw

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

In reply to 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.

---
 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
arch/powerpc/cpu/mpc83xx/Kconfig +9 -2
index 1ebb092f0b..29d84f363d 100644
@@ -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
board/keymile/km83xx/Kconfig +15 -2
index 0c4fa0b7fd..fbbbb17034 100644
@@ -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
 
board/keymile/km83xx/km83xx.c +1 -1
index 12044ee0d7..1fd6f91901 100644
@@ -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;
configs/kmcoge5ne_defconfig +1 -2
index 941c1f0b72..649e07c5f4 100644
@@ -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
configs/kmeter1_defconfig +1 -2
index 2d5f284411..cbb74e0022 100644
@@ -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
include/configs/kmcoge5ne.h renamed from include/configs/km8360.h +5 -5
similarity index 98%
rename from include/configs/km8360.h
rename to include/configs/kmcoge5ne.h
index b22345bcc2..29d977b901 100644
@@ -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 | \
include/configs/kmeter1.h new file +557 -0

557 lines not on this page · raw message

Signature · 1 line
2.16.4
author
#19 lore raw

PATCH 17/48 keymile: Simplify kmcoge5ne, kmeter1 configs

In reply to Mario Six

Simplify the kmcoge5ne and kmeter1 configs to only include the #ifdefs necessary for each board.

---
 include/configs/kmcoge5ne.h | 29 --------------
 include/configs/kmeter1.h   | 97 +--------------------------------------------
 2 files changed, 1 insertion(+), 125 deletions(-)
include/configs/kmcoge5ne.h +0 -29
index 29d977b901..87efaa4a7c 100644
@@ -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
 
include/configs/kmeter1.h +1 -96

148 lines not on this page · raw message

Signature · 1 line
2.16.4
author
#20 lore raw

PATCH 18/48 mpc83xx: Make distinct MPC8313ERDB targets

In reply to 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.

---
 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
arch/powerpc/cpu/mpc83xx/Kconfig +8 -2
index 29d84f363d..ede98c70da 100644
@@ -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
board/freescale/mpc8313erdb/Kconfig +15 -2
index 145608feab..b6332a1368 100644
@@ -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
configs/MPC8313ERDB_33_defconfig +1 -1
index ac60840371..e0cdd56273 100644
@@ -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"
configs/MPC8313ERDB_66_defconfig +1 -1
index 8a0784dd2a..b232a3275c 100644
@@ -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"
configs/MPC8313ERDB_NAND_33_defconfig +1 -1
index 141ecb843b..fa8321c587 100644
@@ -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"
configs/MPC8313ERDB_NAND_66_defconfig +1 -1
index 5a3bde4de2..b468b0d34a 100644
@@ -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"
include/configs/MPC8313ERDB_NAND.h renamed from include/configs/MPC8313ERDB.h +0 -0
similarity index 100%
rename from include/configs/MPC8313ERDB.h
rename to include/configs/MPC8313ERDB_NAND.h
include/configs/MPC8313ERDB_NOR.h new file +652 -0

652 lines not on this page · raw message

Signature · 1 line
2.16.4
author
#21 lore raw

PATCH 19/48 mpc83xx: Simplify MPC8313ERDB configs

In reply to Mario Six

Remove all options from the new MPC8313ERDB_{NOR,NAND} configs that are not specific to NOR or NAND.

---
 include/configs/MPC8313ERDB_NAND.h | 61 ++++++++-----------------------
 include/configs/MPC8313ERDB_NOR.h  | 74 +++++---------------------------------
 2 files changed, 23 insertions(+), 112 deletions(-)
include/configs/MPC8313ERDB_NAND.h +15 -46
index d522d21a74..e17c632f3a 100644
@@ -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 */
include/configs/MPC8313ERDB_NOR.h +8 -66

134 lines not on this page · raw message

Signature · 1 line
2.16.4
author
#22 lore raw

PATCH 20/48 VME8349: Migrate to CONFIG_TARGET_VME8349

In reply to Mario Six

CONFIG_TARGET_VME8349 can replace CONFIG_VME8349. Hence, replace CONFIG_VME8349 with CONFIG_TARGET_VME8349, and remove CONFIG_VME8349.

---
 drivers/pci/pci_auto.c     | 2 +-
 drivers/pci/pci_auto_old.c | 2 +-
 include/configs/vme8349.h  | 1 -
 3 files changed, 2 insertions(+), 3 deletions(-)
drivers/pci/pci_auto.c +1 -1
index a673d8ae13..f5e46842bf 100644
@@ -359,7 +359,7 @@ int dm_pciauto_config_device(struct udevice *dev)
 		      PCI_DEV(dm_pci_get_bdf(dev)));
 		break;
 #endif
-#if defined(CONFIG_ARCH_MPC834X) && !defined(CONFIG_VME8349)
+#if defined(CONFIG_ARCH_MPC834X) && !defined(CONFIG_TARGET_VME8349)
 	case PCI_CLASS_BRIDGE_OTHER:
 		/*
 		 * The host/PCI bridge 1 seems broken in 8349 - it presents
drivers/pci/pci_auto_old.c +1 -1
index 90c22a08cb..6ab1b3b43f 100644
@@ -376,7 +376,7 @@ int pciauto_config_device(struct pci_controller *hose, pci_dev_t dev)
 		      PCI_DEV(dev));
 		break;
 #endif
-#if defined(CONFIG_ARCH_MPC834X) && !defined(CONFIG_VME8349)
+#if defined(CONFIG_ARCH_MPC834X) && !defined(CONFIG_TARGET_VME8349)
 	case PCI_CLASS_BRIDGE_OTHER:
 		/*
 		 * The host/PCI bridge 1 seems broken in 8349 - it presents
include/configs/vme8349.h +0 -1
index 00939d6d58..4f2466eecf 100644
@@ -28,7 +28,6 @@
  * High Level Configuration Options
  */
 #define CONFIG_E300		1	/* E300 Family */
-#define CONFIG_VME8349		1	/* ESD VME8349 board specific */
 
 /* Don't enable PCI2 on vme834x - it doesn't exist physically. */
 #undef CONFIG_MPC83XX_PCI2		/* support for 2nd PCI controller */
Signature · 1 line
2.16.4
author
#23 lore raw

PATCH 21/48 mpc83xx: Make distinct caddy2 config

In reply to Mario Six

vme8349.h contains two separate boards: The vme8349 itself, and the caddy2 board. The caddy2 board is chosen by setting certain config variables. Create a proper config file for the caddy2 board to make Kconfig migration easier.

---
 arch/powerpc/cpu/mpc83xx/Kconfig |   4 +
 board/esd/vme8349/Kconfig        |  13 +
 board/esd/vme8349/vme8349.c      |   8 +-
 configs/caddy2_defconfig         |   3 +-
 drivers/pci/pci_auto.c           |   3 +-
 drivers/pci/pci_auto_old.c       |   3 +-
 include/configs/caddy2.h         | 544 +++++++++++++++++++++++++++++++++++++++
 7 files changed, 570 insertions(+), 8 deletions(-)
 create mode 100644 include/configs/caddy2.h
arch/powerpc/cpu/mpc83xx/Kconfig +4 -0
index ede98c70da..65f4583ffe 100644
@@ -24,6 +24,10 @@ config TARGET_VME8349
 	bool "Support vme8349"
 	select ARCH_MPC8349
 
+config TARGET_CADDY2
+	bool "Support caddy2"
+	select ARCH_MPC8349
+
 config TARGET_MPC8308RDB
 	bool "Support MPC8308RDB"
 	select ARCH_MPC8308
board/esd/vme8349/Kconfig +13 -0
index b8d9432dcc..ef2af40f7e 100644
@@ -10,3 +10,16 @@ config SYS_CONFIG_NAME
 	default "vme8349"
 
 endif
+
+if TARGET_CADDY2
+
+config SYS_BOARD
+	default "vme8349"
+
+config SYS_VENDOR
+	default "esd"
+
+config SYS_CONFIG_NAME
+	default "caddy2"
+
+endif
board/esd/vme8349/vme8349.c +4 -4
index 45ad3a83ee..a46d0b6da6 100644
@@ -60,7 +60,7 @@ int dram_init(void)
 
 int checkboard(void)
 {
-#ifdef VME_CADDY2
+#ifdef CONFIG_TARGET_CADDY2
 	puts("Board: esd VME-CADDY/2\n");
 #else
 	puts("Board: esd VME-CPU/8349\n");
@@ -69,7 +69,7 @@ int checkboard(void)
 	return 0;
 }
 
-#ifdef VME_CADDY2
+#ifdef CONFIG_TARGET_CADDY2
 int board_eth_init(bd_t *bis)
 {
 	return pci_eth_init(bis);
@@ -102,7 +102,7 @@ int misc_init_r()
  * Provide SPD values for spd_sdram(). Both boards (VME-CADDY/2
  * and VME-CADDY/2) have different SDRAM configurations.
  */
-#ifdef VME_CADDY2
+#ifdef CONFIG_TARGET_CADDY2
 #define SMALL_RAM	0xff
 #define LARGE_RAM	0x00
 #else
@@ -165,7 +165,7 @@ static spd_eeprom_t default_spd_eeprom = {
 	SPD_VAL(0x7e, 0x1d),	/* 63 */
 	{ 'e', 's', 'd', '-', 'g', 'm', 'b', 'h' },
 	SPD_VAL(0x00, 0x00),	/* 72 */
-#ifdef VME_CADDY2
+#ifdef CONFIG_TARGET_CADDY2
 	{ "vme-caddy/2 ram   " }
 #else
 	{ "vme-cpu/2 ram     " }
configs/caddy2_defconfig +1 -2
index 4367ed0e6c..1dc30c39dd 100644
@@ -1,10 +1,9 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xFFF00000
 CONFIG_MPC83xx=y
-CONFIG_TARGET_VME8349=y
+CONFIG_TARGET_CADDY2=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
-CONFIG_SYS_EXTRA_OPTIONS="CADDY2"
 CONFIG_BOOTDELAY=6
 CONFIG_MISC_INIT_R=y
 CONFIG_HUSH_PARSER=y
drivers/pci/pci_auto.c +2 -1
index f5e46842bf..1a3bf70834 100644
@@ -359,7 +359,8 @@ int dm_pciauto_config_device(struct udevice *dev)
 		      PCI_DEV(dm_pci_get_bdf(dev)));
 		break;
 #endif
-#if defined(CONFIG_ARCH_MPC834X) && !defined(CONFIG_TARGET_VME8349)
+#if defined(CONFIG_ARCH_MPC834X) && !defined(CONFIG_TARGET_VME8349) && \
+		!defined(CONFIG_TARGET_CADDY2)
 	case PCI_CLASS_BRIDGE_OTHER:
 		/*
 		 * The host/PCI bridge 1 seems broken in 8349 - it presents
drivers/pci/pci_auto_old.c +2 -1
index 6ab1b3b43f..b566705c9d 100644
@@ -376,7 +376,8 @@ int pciauto_config_device(struct pci_controller *hose, pci_dev_t dev)
 		      PCI_DEV(dev));
 		break;
 #endif
-#if defined(CONFIG_ARCH_MPC834X) && !defined(CONFIG_TARGET_VME8349)
+#if defined(CONFIG_ARCH_MPC834X) && !defined(CONFIG_TARGET_VME8349) && \
+		!defined(CONFIG_TARGET_CADDY2)
 	case PCI_CLASS_BRIDGE_OTHER:
 		/*
 		 * The host/PCI bridge 1 seems broken in 8349 - it presents
include/configs/caddy2.h new file +544 -0

544 lines not on this page · raw message

Signature · 1 line
2.16.4
author
#24 lore raw

PATCH 22/48 vme8349/caddy2: Simplify configs

In reply to Mario Six

Simplify the vme8349 and caddy2 configs by keeping only the options necessary for each board.

---
 include/configs/caddy2.h  | 29 -----------------------------
 include/configs/vme8349.h | 29 -----------------------------
 2 files changed, 58 deletions(-)
include/configs/caddy2.h +0 -29
index 4f2466eecf..1ca65f636c 100644
@@ -17,13 +17,6 @@
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
-/*
- * Top level Makefile configuration choices
- */
-#ifdef CONFIG_CADDY2
-#define VME_CADDY2
-#endif
-
 /*
  * High Level Configuration Options
  */
@@ -93,7 +86,6 @@
  */
 #define CONFIG_SYS_FLASH_CFI
 #define CONFIG_FLASH_CFI_DRIVER			        /* use the CFI driver */
-#ifdef VME_CADDY2
 #define CONFIG_SYS_FLASH_BASE		0xffc00000	/* start of FLASH   */
 #define CONFIG_SYS_FLASH_SIZE		4		/* flash size in MB */
 #define CONFIG_SYS_BR0_PRELIM		(CONFIG_SYS_FLASH_BASE | \
@@ -113,27 +105,6 @@
 					/* 0xffc06ff7 */
 #define CONFIG_SYS_LBLAWBAR0_PRELIM	CONFIG_SYS_FLASH_BASE
 #define CONFIG_SYS_LBLAWAR0_PRELIM	(LBLAWAR_EN | LBLAWAR_4MB)
-#else
-#define CONFIG_SYS_FLASH_BASE		0xf8000000	/* start of FLASH   */
-#define CONFIG_SYS_FLASH_SIZE		128		/* flash size in MB */
-#define CONFIG_SYS_BR0_PRELIM		(CONFIG_SYS_FLASH_BASE | \
-					 BR_PS_16 |	/*  16bit */ \
-					 BR_MS_GPCM |	/*  MSEL = GPCM */ \
-					 BR_V)		/* valid */
-
-#define CONFIG_SYS_OR0_PRELIM		(MEG_TO_AM(CONFIG_SYS_FLASH_SIZE) \
-					| OR_GPCM_XAM \
-					| 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)
-					/* 0xf8006ff7 */
-#define CONFIG_SYS_LBLAWBAR0_PRELIM	CONFIG_SYS_FLASH_BASE
-#define CONFIG_SYS_LBLAWAR0_PRELIM	(LBLAWAR_EN | LBLAWAR_128MB)
-#endif
 /* #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE */
 
 #define CONFIG_SYS_WINDOW1_BASE		0xf0000000
include/configs/vme8349.h +0 -29
index 4f2466eecf..d607806b96 100644
@@ -17,13 +17,6 @@
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
-/*
- * Top level Makefile configuration choices
- */
-#ifdef CONFIG_CADDY2
-#define VME_CADDY2
-#endif
-
 /*
  * High Level Configuration Options
  */
@@ -93,27 +86,6 @@
  */
 #define CONFIG_SYS_FLASH_CFI
 #define CONFIG_FLASH_CFI_DRIVER			        /* use the CFI driver */
-#ifdef VME_CADDY2
-#define CONFIG_SYS_FLASH_BASE		0xffc00000	/* start of FLASH   */
-#define CONFIG_SYS_FLASH_SIZE		4		/* flash size in MB */
-#define CONFIG_SYS_BR0_PRELIM		(CONFIG_SYS_FLASH_BASE | \
-					 BR_PS_16 |	/*  16bit */ \
-					 BR_MS_GPCM |	/*  MSEL = GPCM */ \
-					 BR_V)		/* valid */
-
-#define CONFIG_SYS_OR0_PRELIM		(MEG_TO_AM(CONFIG_SYS_FLASH_SIZE) \
-					| OR_GPCM_XAM \
-					| 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)
-					/* 0xffc06ff7 */
-#define CONFIG_SYS_LBLAWBAR0_PRELIM	CONFIG_SYS_FLASH_BASE
-#define CONFIG_SYS_LBLAWAR0_PRELIM	(LBLAWAR_EN | LBLAWAR_4MB)
-#else
 #define CONFIG_SYS_FLASH_BASE		0xf8000000	/* start of FLASH   */
 #define CONFIG_SYS_FLASH_SIZE		128		/* flash size in MB */
 #define CONFIG_SYS_BR0_PRELIM		(CONFIG_SYS_FLASH_BASE | \
@@ -133,7 +105,6 @@
 					/* 0xf8006ff7 */
 #define CONFIG_SYS_LBLAWBAR0_PRELIM	CONFIG_SYS_FLASH_BASE
 #define CONFIG_SYS_LBLAWAR0_PRELIM	(LBLAWAR_EN | LBLAWAR_128MB)
-#endif
 /* #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE */
 
 #define CONFIG_SYS_WINDOW1_BASE		0xf0000000
Signature · 1 line
2.16.4
author
#25 lore raw

PATCH 23/48 powerpc: Add LSDMR config values

In reply to Mario Six

The LSDMR_* macros are used to configure the system bus on MPC83xx.

A few of the possible LSDMR_* macros were never defined in the respective include files. This renders the SDRAM support on the MPC8349EMDS unusable, because it uses these undefined macros.

To make the SDRAM option work, introduce these macros into the proper config file.

---
 arch/powerpc/include/asm/fsl_lbc.h | 3 +++
 1 file changed, 3 insertions(+)
arch/powerpc/include/asm/fsl_lbc.h +3 -0
index 3528acd627..bf352d9a56 100644
@@ -428,14 +428,17 @@ void lbc_sdram_init(void);
 #define LSDMR_BSMA1516	(3 << (31 - 10))
 #define LSDMR_BSMA1617	(4 << (31 - 10))
 #define LSDMR_RFCR5	(3 << (31 - 16))
+#define LSDMR_RFCR8     (5 << (31 - 16))
 #define LSDMR_RFCR16	(7 << (31 - 16))
 #define LSDMR_PRETOACT3 (3 << (31 - 19))
+#define LSDMR_PRETOACT6 (5 << (31 - 19))
 #define LSDMR_PRETOACT7	(7 << (31 - 19))
 #define LSDMR_ACTTORW3	(3 << (31 - 22))
 #define LSDMR_ACTTORW7	(7 << (31 - 22))
 #define LSDMR_ACTTORW6	(6 << (31 - 22))
 #define LSDMR_BL8	(1 << (31 - 23))
 #define LSDMR_WRC2	(2 << (31 - 27))
+#define LSDMR_WRC3      (3 << (31 - 27))
 #define LSDMR_WRC4	(0 << (31 - 27))
 #define LSDMR_BUFCMD	(1 << (31 - 29))
 #define LSDMR_CL3	(3 << (31 - 31))
Signature · 1 line
2.16.4
author
#26 lore raw

PATCH 24/48 mpc83xx: Make distinct MPC8349EMDS_SDRAM board

In reply to Mario Six

The MPC8349EMDS config file contains config options to enable SDRAM support. To keep this ability after the Kconfig migration, create a new MPC8349EMDS_SDRAM board that enables the SDRAM support.

---
 arch/powerpc/cpu/mpc83xx/Kconfig    |   8 +
 board/freescale/mpc8349emds/Kconfig |  13 +
 configs/MPC8349EMDS_SDRAM_defconfig |  24 ++
 include/configs/MPC8349EMDS_SDRAM.h | 739 ++++++++++++++++++++++++++++++++++++
 4 files changed, 784 insertions(+)
 create mode 100644 configs/MPC8349EMDS_SDRAM_defconfig
 create mode 100644 include/configs/MPC8349EMDS_SDRAM.h
arch/powerpc/cpu/mpc83xx/Kconfig +8 -0
index 65f4583ffe..0ce1aad6d0 100644
@@ -67,6 +67,14 @@ config TARGET_MPC8349EMDS
 	select SYS_FSL_DDR_BE
 	select SYS_FSL_HAS_DDR2
 
+config TARGET_MPC8349EMDS_SDRAM
+	bool "Support MPC8349EMDS_SDRAM"
+	select ARCH_MPC8349
+	select BOARD_EARLY_INIT_F
+	select SYS_FSL_DDR
+	select SYS_FSL_DDR_BE
+	select SYS_FSL_HAS_DDR2
+
 config TARGET_MPC8349ITX
 	bool "Support MPC8349ITX"
 	select ARCH_MPC8349
board/freescale/mpc8349emds/Kconfig +13 -0
index 51f0b34f39..d154118079 100644
@@ -10,3 +10,16 @@ config SYS_CONFIG_NAME
 	default "MPC8349EMDS"
 
 endif
+
+if TARGET_MPC8349EMDS_SDRAM
+
+config SYS_BOARD
+	default "mpc8349emds"
+
+config SYS_VENDOR
+	default "freescale"
+
+config SYS_CONFIG_NAME
+	default "MPC8349EMDS_SDRAM"
+
+endif
configs/MPC8349EMDS_SDRAM_defconfig new file +24 -0
new file mode 100644
index 0000000000..8ec8740839
@@ -0,0 +1,24 @@
+CONFIG_PPC=y
+CONFIG_SYS_TEXT_BASE=0xFE000000
+CONFIG_MPC83xx=y
+CONFIG_TARGET_MPC8349EMDS_SDRAM=y
+CONFIG_OF_BOARD_SETUP=y
+CONFIG_OF_STDOUT_VIA_ALIAS=y
+CONFIG_BOOTDELAY=6
+CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
+CONFIG_CMD_I2C=y
+# CONFIG_CMD_SETEXPR is not set
+CONFIG_CMD_MII=y
+CONFIG_CMD_PING=y
+CONFIG_CMD_DATE=y
+# CONFIG_MMC is not set
+CONFIG_MTD_NOR_FLASH=y
+CONFIG_PHY_MARVELL=y
+CONFIG_NETDEVICES=y
+CONFIG_TSEC_ENET=y
+# CONFIG_PCI is not set
+CONFIG_SYS_NS16550=y
+CONFIG_SPI=y
+CONFIG_MPC8XXX_SPI=y
+CONFIG_OF_LIBFDT=y
include/configs/MPC8349EMDS_SDRAM.h new file +739 -0

739 lines not on this page · raw message

Signature · 1 line
2.16.4
author
#27 lore raw

PATCH 25/48 MPC8349EMDS: Simplify configs

In reply to Mario Six

The SDRAM support now resides in a separate board variant. Hence, remove the SDRAM option from the original board.

---
 include/configs/MPC8349EMDS.h       | 76 -------------------------------------
 include/configs/MPC8349EMDS_SDRAM.h |  4 --
 2 files changed, 80 deletions(-)
include/configs/MPC8349EMDS.h +0 -76
index 2ceed48ff3..085b64a6f5 100644
@@ -222,82 +222,6 @@
 #define CONFIG_SYS_LCRR_CLKDIV	LCRR_CLKDIV_4
 #define CONFIG_SYS_LBC_LBCR	0x00000000
 
-/*
- * The MPC834xEA MDS for 834xE rev3.1 may not be assembled SDRAM memory.
- * if board has SRDAM on local bus, you can define CONFIG_SYS_LB_SDRAM
- */
-#undef CONFIG_SYS_LB_SDRAM
-
-#ifdef CONFIG_SYS_LB_SDRAM
-/* Local bus BR2, OR2 definition for SDRAM if soldered on the MDS board */
-/*
- * Base Register 2 and Option Register 2 configure SDRAM.
- * The SDRAM base address, CONFIG_SYS_LBC_SDRAM_BASE, is 0xf0000000.
- *
- * For BR2, need:
- *    Base address of 0xf0000000 = BR[0:16] = 1111 0000 0000 0000 0
- *    port-size = 32-bits = BR2[19:20] = 11
- *    no parity checking = BR2[21:22] = 00
- *    SDRAM for MSEL = BR2[24:26] = 011
- *    Valid = BR[31] = 1
- *
- * 0    4    8    12   16   20   24   28
- * 1111 0000 0000 0000 0001 1000 0110 0001 = F0001861
- */
-
-#define CONFIG_SYS_BR2_PRELIM		(CONFIG_SYS_LBC_SDRAM_BASE \
-					| BR_PS_32	/* 32-bit port */ \
-					| BR_MS_SDRAM	/* MSEL = SDRAM */ \
-					| BR_V)		/* Valid */
-					/* 0xF0001861 */
-#define CONFIG_SYS_LBLAWBAR2_PRELIM	CONFIG_SYS_LBC_SDRAM_BASE
-#define CONFIG_SYS_LBLAWAR2_PRELIM	(LBLAWAR_EN | LBLAWAR_64MB)
-
-/*
- * The SDRAM size in MB, CONFIG_SYS_LBC_SDRAM_SIZE, is 64.
- *
- * For OR2, need:
- *    64MB mask for AM, OR2[0:7] = 1111 1100
- *                 XAM, OR2[17:18] = 11
- *    9 columns OR2[19-21] = 010
- *    13 rows   OR2[23-25] = 100
- *    EAD set for extra time OR[31] = 1
- *
- * 0    4    8    12   16   20   24   28
- * 1111 1100 0000 0000 0110 1001 0000 0001 = FC006901
- */
-
-#define CONFIG_SYS_OR2_PRELIM	(OR_AM_64MB \
-			| OR_SDRAM_XAM \
-			| ((9 - OR_SDRAM_MIN_COLS) << OR_SDRAM_COLS_SHIFT) \
-			| ((13 - OR_SDRAM_MIN_ROWS) << OR_SDRAM_ROWS_SHIFT) \
-			| OR_SDRAM_EAD)
-			/* 0xFC006901 */
-
-				/* LB sdram refresh timer, about 6us */
-#define CONFIG_SYS_LBC_LSRT	0x32000000
-				/* LB refresh timer prescal, 266MHz/32 */
-#define CONFIG_SYS_LBC_MRTPR	0x20000000
-
-#define CONFIG_SYS_LBC_LSDMR_COMMON    (LSDMR_RFEN	\
-				| LSDMR_BSMA1516	\
-				| LSDMR_RFCR8		\
-				| LSDMR_PRETOACT6	\
-				| LSDMR_ACTTORW3	\
-				| LSDMR_BL8		\
-				| LSDMR_WRC3		\
-				| LSDMR_CL3)
-
-/*
- * SDRAM Controller configuration sequence.
- */
-#define CONFIG_SYS_LBC_LSDMR_1	(CONFIG_SYS_LBC_LSDMR_COMMON | LSDMR_OP_PCHALL)
-#define CONFIG_SYS_LBC_LSDMR_2	(CONFIG_SYS_LBC_LSDMR_COMMON | LSDMR_OP_ARFRSH)
-#define CONFIG_SYS_LBC_LSDMR_3	(CONFIG_SYS_LBC_LSDMR_COMMON | LSDMR_OP_ARFRSH)
-#define CONFIG_SYS_LBC_LSDMR_4	(CONFIG_SYS_LBC_LSDMR_COMMON | LSDMR_OP_MRW)
-#define CONFIG_SYS_LBC_LSDMR_5	(CONFIG_SYS_LBC_LSDMR_COMMON | LSDMR_OP_NORMAL)
-#endif
-
 /*
  * Serial Port
  */
include/configs/MPC8349EMDS_SDRAM.h +0 -4
index 2ceed48ff3..b7ed733f6c 100644
@@ -224,11 +224,8 @@
 
 /*
  * The MPC834xEA MDS for 834xE rev3.1 may not be assembled SDRAM memory.
- * if board has SRDAM on local bus, you can define CONFIG_SYS_LB_SDRAM
  */
-#undef CONFIG_SYS_LB_SDRAM
 
-#ifdef CONFIG_SYS_LB_SDRAM
 /* Local bus BR2, OR2 definition for SDRAM if soldered on the MDS board */
 /*
  * Base Register 2 and Option Register 2 configure SDRAM.
@@ -296,7 +293,6 @@
 #define CONFIG_SYS_LBC_LSDMR_3	(CONFIG_SYS_LBC_LSDMR_COMMON | LSDMR_OP_ARFRSH)
 #define CONFIG_SYS_LBC_LSDMR_4	(CONFIG_SYS_LBC_LSDMR_COMMON | LSDMR_OP_MRW)
 #define CONFIG_SYS_LBC_LSDMR_5	(CONFIG_SYS_LBC_LSDMR_COMMON | LSDMR_OP_NORMAL)
-#endif
 
 /*
  * Serial Port
Signature · 1 line
2.16.4
#28 lore raw

cover mpc83xx: Kconfig migrations

In reply to Mario Six
Quoted 6 lines · 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.

Quoted 9 lines

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

Does it make sense to squash the above two patches (and other similar patches)?

York

author
#29 lore raw

cover mpc83xx: Kconfig migrations

Hi York,

Quoted 18 lines · York Sun
Quoted 6 lines · 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.

Quoted 9 lines

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

Quoted 3 lines

Does it make sense to squash the above two patches (and other similar patches)?

It will be harder to read/review the changes, but I can do that, no problem.

Quoted 2 lines

York

Best regards,
Mario