Skip to content

Commit

Permalink
mpc83xx: Introduce ARCH_MPC830*
Browse files Browse the repository at this point in the history
Replace CONFIG_MPC830* with proper CONFIG_ARCH_MPC830* Kconfig options.

Signed-off-by: Mario Six <[email protected]>
  • Loading branch information
si-gdsys committed May 20, 2019
1 parent 748198c commit 4bc97a3
Show file tree
Hide file tree
Showing 20 changed files with 66 additions and 62 deletions.
17 changes: 17 additions & 0 deletions arch/powerpc/cpu/mpc83xx/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ choice

config TARGET_MPC8308_P1M
bool "Support mpc8308_p1m"
select ARCH_MPC8308

config TARGET_SBC8349
bool "Support sbc8349"
Expand All @@ -22,6 +23,7 @@ config TARGET_VME8349

config TARGET_MPC8308RDB
bool "Support MPC8308RDB"
select ARCH_MPC8308
select SYS_FSL_ERRATUM_ESDHC111

config TARGET_MPC8313ERDB
Expand Down Expand Up @@ -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

Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/cpu/mpc83xx/spd_sdram.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
38 changes: 19 additions & 19 deletions arch/powerpc/cpu/mpc83xx/speed.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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)
Expand All @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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
Expand All @@ -558,23 +558,23 @@ 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));
printf(" TSEC2: %-4s MHz\n",
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
#if defined(CONFIG_MPC834x)
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));
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/include/asm/arch-mpc83xx/gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/include/asm/fsl_lbc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions arch/powerpc/include/asm/global_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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;
Expand Down
10 changes: 5 additions & 5 deletions arch/powerpc/include/asm/immap_83xx.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -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 */
Expand Down Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/include/asm/mpc8xxx_spi.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) || \
Expand Down
2 changes: 1 addition & 1 deletion board/keymile/km83xx/km83xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion drivers/qe/qe.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,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,
Expand Down
4 changes: 2 additions & 2 deletions drivers/ram/mpc83xx_sdram.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down Expand Up @@ -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)) {
Expand Down
2 changes: 0 additions & 2 deletions include/configs/MPC8308RDB.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions include/configs/hrcon.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions include/configs/km/km8309-common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion include/configs/km/km83xx-common.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,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
Expand Down
2 changes: 0 additions & 2 deletions include/configs/mpc8308_p1m.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit 4bc97a3

Please sign in to comment.