Skip to content

Commit f3603b4

Browse files
chleroytrini
authored andcommitted
powerpc: Remove unneccessary #ifdefs in reginfo
reginfo command is calling mpc8xx_reginfo(), mpc85xx_reginfo() or mpc86xx_reginfo() based on CONFIG_ symbol. As those 3 functions can't me defined at the same time, let's rename them print_reginfo() to avoid the #ifdefs The name is kept generic as it is not at all dependent on powerpc arch and any other arch could want to also print such information. In addition, as the Makefile compiles cmd/reginfo.c only when CONFIG_CMD_REGINFO is set, there is no need to enclose the U_BOOT_CMD definition inside a #ifdef CONFIG_CMD_REGINFO Lets all remove the #ifdefs around the U_BOOT_CMD as this file is only compiled when CONFIG_CMD_REGINFO is defined Finally, this is a PowerPC-only command, disable it on a number of non-PowerPC platforms. Signed-off-by: Christophe Leroy <[email protected]> Signed-off-by: Tom Rini <[email protected]>
1 parent f1cd736 commit f3603b4

File tree

22 files changed

+12
-53
lines changed

22 files changed

+12
-53
lines changed

arch/powerpc/cpu/mpc85xx/cpu.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include <post.h>
2424
#include <asm/processor.h>
2525
#include <fsl_ddr_sdram.h>
26+
#include <asm/ppc.h>
2627

2728
DECLARE_GLOBAL_DATA_PTR;
2829

@@ -384,7 +385,7 @@ int cpu_mmc_init(bd_t *bis)
384385
* Currently prints out LAWs, BR0/OR0 for LBC, CSPR/CSOR/Timing
385386
* parameters for IFC and TLBs
386387
*/
387-
void mpc85xx_reginfo(void)
388+
void print_reginfo(void)
388389
{
389390
print_tlbcam();
390391
print_laws();

arch/powerpc/cpu/mpc86xx/cpu.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <asm/mmu.h>
1414
#include <mpc86xx.h>
1515
#include <asm/fsl_law.h>
16+
#include <asm/ppc.h>
1617

1718
DECLARE_GLOBAL_DATA_PTR;
1819

@@ -160,7 +161,7 @@ watchdog_reset(void)
160161
* Print out the state of various machine registers.
161162
* Currently prints out LAWs, BR0/OR0, and BATs
162163
*/
163-
void mpc86xx_reginfo(void)
164+
void print_reginfo(void)
164165
{
165166
print_bats();
166167
print_laws();

arch/powerpc/cpu/mpc8xx/reginfo.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88
#include <common.h>
99
#include <mpc8xx.h>
1010
#include <asm/io.h>
11+
#include <asm/ppc.h>
1112

12-
void mpc8xx_reginfo(void)
13+
void print_reginfo(void)
1314
{
1415
immap_t __iomem *immap = (immap_t __iomem *)CONFIG_SYS_IMMR;
1516
memctl8xx_t __iomem *memctl = &immap->im_memctl;

arch/powerpc/include/asm/ppc.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ static inline void set_msr(unsigned long msr)
110110
asm volatile ("mtmsr %0" : : "r" (msr));
111111
}
112112

113+
#ifdef CONFIG_CMD_REGINFO
114+
void print_reginfo(void);
115+
#endif
116+
113117
#endif /* !__ASSEMBLY__ */
114118

115119
#ifdef CONFIG_PPC

cmd/reginfo.c

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,36 +7,20 @@
77

88
#include <common.h>
99
#include <command.h>
10-
#if defined(CONFIG_8xx)
11-
void mpc8xx_reginfo(void);
12-
#elif defined(CONFIG_MPC86xx)
13-
extern void mpc86xx_reginfo(void);
14-
#elif defined(CONFIG_MPC85xx)
15-
extern void mpc85xx_reginfo(void);
16-
#endif
10+
#include <asm/ppc.h>
1711

1812
static int do_reginfo(cmd_tbl_t *cmdtp, int flag, int argc,
1913
char * const argv[])
2014
{
21-
#if defined(CONFIG_8xx)
22-
mpc8xx_reginfo();
23-
24-
#elif defined(CONFIG_MPC86xx)
25-
mpc86xx_reginfo();
26-
27-
#elif defined(CONFIG_MPC85xx)
28-
mpc85xx_reginfo();
29-
#endif
15+
print_reginfo();
3016

3117
return 0;
3218
}
3319

3420
/**************************************************/
3521

36-
#if defined(CONFIG_CMD_REGINFO)
3722
U_BOOT_CMD(
3823
reginfo, 2, 1, do_reginfo,
3924
"print register information",
4025
""
4126
);
42-
#endif

include/configs/M5208EVBE.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@
2020
#undef CONFIG_WATCHDOG
2121
#define CONFIG_WATCHDOG_TIMEOUT 5000
2222

23-
/* Command line configuration */
24-
#define CONFIG_CMD_REGINFO
25-
2623
#define CONFIG_MCFFEC
2724
#ifdef CONFIG_MCFFEC
2825
# define CONFIG_MII 1

include/configs/M52277EVB.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@
3535
#define CONFIG_BOOTP_GATEWAY
3636
#define CONFIG_BOOTP_HOSTNAME
3737

38-
/* Command line configuration */
39-
#define CONFIG_CMD_REGINFO
40-
4138
#define CONFIG_HOSTNAME M52277EVB
4239
#define CONFIG_SYS_UBOOT_END 0x3FFFF
4340
#define CONFIG_SYS_LOAD_ADDR2 0x40010007

include/configs/M5235EVB.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535

3636
/* Command line configuration */
3737
#define CONFIG_CMD_PCI
38-
#define CONFIG_CMD_REGINFO
3938

4039
#define CONFIG_MCFFEC
4140
#ifdef CONFIG_MCFFEC

include/configs/M53017EVB.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@
2525
#undef CONFIG_WATCHDOG
2626
#define CONFIG_WATCHDOG_TIMEOUT 5000
2727

28-
/* Command line configuration */
29-
#define CONFIG_CMD_REGINFO
30-
3128
#define CONFIG_SYS_UNIFY_CACHE
3229

3330
#define CONFIG_MCFFEC

include/configs/M5329EVB.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@
2525
#undef CONFIG_WATCHDOG
2626
#define CONFIG_WATCHDOG_TIMEOUT 5000 /* timeout in milliseconds, max timeout is 6.71sec */
2727

28-
/* Command line configuration */
29-
#define CONFIG_CMD_REGINFO
30-
3128
#ifdef CONFIG_NANDFLASH_SIZE
3229
# define CONFIG_CMD_NAND
3330
#endif

0 commit comments

Comments
 (0)