]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
powerpc: Remove unneccessary #ifdefs in reginfo
authorChristophe Leroy <christophe.leroy@c-s.fr>
Thu, 13 Jul 2017 13:09:54 +0000 (15:09 +0200)
committerTom Rini <trini@konsulko.com>
Sun, 23 Jul 2017 02:22:49 +0000 (22:22 -0400)
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 <christophe.leroy@c-s.fr>
Signed-off-by: Tom Rini <trini@konsulko.com>
22 files changed:
arch/powerpc/cpu/mpc85xx/cpu.c
arch/powerpc/cpu/mpc86xx/cpu.c
arch/powerpc/cpu/mpc8xx/reginfo.c
arch/powerpc/include/asm/ppc.h
cmd/reginfo.c
include/configs/M5208EVBE.h
include/configs/M52277EVB.h
include/configs/M5235EVB.h
include/configs/M53017EVB.h
include/configs/M5329EVB.h
include/configs/M5373EVB.h
include/configs/M54418TWR.h
include/configs/M54451EVB.h
include/configs/M54455EVB.h
include/configs/M5475EVB.h
include/configs/M5485EVB.h
include/configs/TQM834x.h
include/configs/astro_mcf5373l.h
include/configs/dragonboard410c.h
include/configs/s5p_goni.h
include/configs/smdkc100.h
include/configs/vct.h

index e3ef4ae816cc669c278f28bacc2db5e18fa7aec8..b3de164bd8f8c3940913c0029a45542493654eac 100644 (file)
@@ -23,6 +23,7 @@
 #include <post.h>
 #include <asm/processor.h>
 #include <fsl_ddr_sdram.h>
+#include <asm/ppc.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -384,7 +385,7 @@ int cpu_mmc_init(bd_t *bis)
  * Currently prints out LAWs, BR0/OR0 for LBC, CSPR/CSOR/Timing
  * parameters for IFC and TLBs
  */
-void mpc85xx_reginfo(void)
+void print_reginfo(void)
 {
        print_tlbcam();
        print_laws();
index 7a9570c8ec72eb4d4dc3f1573f7b4fbcc4113499..a02e872862bc53b592e7408450c7b70060ac29ce 100644 (file)
@@ -13,6 +13,7 @@
 #include <asm/mmu.h>
 #include <mpc86xx.h>
 #include <asm/fsl_law.h>
+#include <asm/ppc.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -160,7 +161,7 @@ watchdog_reset(void)
  * Print out the state of various machine registers.
  * Currently prints out LAWs, BR0/OR0, and BATs
  */
-void mpc86xx_reginfo(void)
+void print_reginfo(void)
 {
        print_bats();
        print_laws();
index 1ba4d22bdddc353da9ed28748e764ae4810f8e08..277d2753b2590cdce5da04f543c595a1a3e30729 100644 (file)
@@ -8,8 +8,9 @@
 #include <common.h>
 #include <mpc8xx.h>
 #include <asm/io.h>
+#include <asm/ppc.h>
 
-void mpc8xx_reginfo(void)
+void print_reginfo(void)
 {
        immap_t __iomem     *immap  = (immap_t __iomem *)CONFIG_SYS_IMMR;
        memctl8xx_t __iomem *memctl = &immap->im_memctl;
index 89f08eccc7be72240aea4b08e2e0902baa5bee0d..27d3b83e070baaa2711d1bd760f8e74fa326481f 100644 (file)
@@ -110,6 +110,10 @@ static inline void set_msr(unsigned long msr)
        asm volatile ("mtmsr %0" : : "r" (msr));
 }
 
+#ifdef CONFIG_CMD_REGINFO
+void print_reginfo(void);
+#endif
+
 #endif /* !__ASSEMBLY__ */
 
 #ifdef CONFIG_PPC
index b364cc899a00ac55c3d5a44b48a8b3d966bcc674..b23883e4bf540a088ac011b99f03108b28e35a5e 100644 (file)
@@ -7,36 +7,20 @@
 
 #include <common.h>
 #include <command.h>
-#if defined(CONFIG_8xx)
-void mpc8xx_reginfo(void);
-#elif defined(CONFIG_MPC86xx)
-extern void mpc86xx_reginfo(void);
-#elif defined(CONFIG_MPC85xx)
-extern void mpc85xx_reginfo(void);
-#endif
+#include <asm/ppc.h>
 
 static int do_reginfo(cmd_tbl_t *cmdtp, int flag, int argc,
                       char * const argv[])
 {
-#if defined(CONFIG_8xx)
-       mpc8xx_reginfo();
-
-#elif defined(CONFIG_MPC86xx)
-       mpc86xx_reginfo();
-
-#elif defined(CONFIG_MPC85xx)
-       mpc85xx_reginfo();
-#endif
+       print_reginfo();
 
        return 0;
 }
 
  /**************************************************/
 
-#if defined(CONFIG_CMD_REGINFO)
 U_BOOT_CMD(
        reginfo,        2,      1,      do_reginfo,
        "print register information",
        ""
 );
-#endif
index f8b1d4af38e5650985bf0db3f9c75c5dab84b9cf..223439aaab71766d846ac074164bdf00bb7508c1 100644 (file)
@@ -20,9 +20,6 @@
 #undef CONFIG_WATCHDOG
 #define CONFIG_WATCHDOG_TIMEOUT                5000
 
-/* Command line configuration */
-#define CONFIG_CMD_REGINFO
-
 #define CONFIG_MCFFEC
 #ifdef CONFIG_MCFFEC
 #      define CONFIG_MII               1
index fc9b26ff4624675b724cd54c05fe3df382548bc6..e7d99baf2518b71e1d7e1464a36fd65cfa583296 100644 (file)
@@ -35,9 +35,6 @@
 #define CONFIG_BOOTP_GATEWAY
 #define CONFIG_BOOTP_HOSTNAME
 
-/* Command line configuration */
-#define CONFIG_CMD_REGINFO
-
 #define CONFIG_HOSTNAME                        M52277EVB
 #define CONFIG_SYS_UBOOT_END           0x3FFFF
 #define        CONFIG_SYS_LOAD_ADDR2           0x40010007
index 7247111cf5973a4b2ab926804b1cac0c97f21cfa..84d3f3cfa665d6612d860e889d71160fc63dd076 100644 (file)
@@ -35,7 +35,6 @@
 
 /* Command line configuration */
 #define CONFIG_CMD_PCI
-#define CONFIG_CMD_REGINFO
 
 #define CONFIG_MCFFEC
 #ifdef CONFIG_MCFFEC
index b88c3709c601b4f88859b20b4d14bd52f091e4e0..419a0907c4d3539314338a7743187cebb49d4078 100644 (file)
@@ -25,9 +25,6 @@
 #undef CONFIG_WATCHDOG
 #define CONFIG_WATCHDOG_TIMEOUT                5000
 
-/* Command line configuration */
-#define CONFIG_CMD_REGINFO
-
 #define CONFIG_SYS_UNIFY_CACHE
 
 #define CONFIG_MCFFEC
index 999bcd94952939a619f5d4ac1ee62f6d4cca3bdd..8261323d791dc46d104c6217e7a90f0f266b0888 100644 (file)
@@ -25,9 +25,6 @@
 #undef CONFIG_WATCHDOG
 #define CONFIG_WATCHDOG_TIMEOUT        5000    /* timeout in milliseconds, max timeout is 6.71sec */
 
-/* Command line configuration */
-#define CONFIG_CMD_REGINFO
-
 #ifdef CONFIG_NANDFLASH_SIZE
 #      define CONFIG_CMD_NAND
 #endif
index 3a39e5031d3f11c87665febbd069e2fbbfa5c717..68136ad095a2d9372a34d36752b69505b790db77 100644 (file)
@@ -25,9 +25,6 @@
 #undef CONFIG_WATCHDOG
 #define CONFIG_WATCHDOG_TIMEOUT        3360    /* timeout in ms, max is 3.36 sec */
 
-/* Command line configuration */
-#define CONFIG_CMD_REGINFO
-
 #ifdef CONFIG_NANDFLASH_SIZE
 #      define CONFIG_CMD_NAND
 #endif
index f4d970d0d869804953de45e065559d011beb917e..8fb9abd79cb29e8bb8a9948fff19285b5a0f8155 100644 (file)
@@ -38,7 +38,6 @@
 
 /* Command line configuration */
 #undef CONFIG_CMD_NAND
-#define CONFIG_CMD_REGINFO
 
 /*
  * NAND FLASH
index 7d6edda36148cbb8b4cfa9b55a05cfb1717890c8..f20aa6fc3308dd713a4d2a0a86f4c2dde31fb41b 100644 (file)
@@ -35,9 +35,6 @@
 #define CONFIG_BOOTP_GATEWAY
 #define CONFIG_BOOTP_HOSTNAME
 
-/* Command line configuration */
-#define CONFIG_CMD_REGINFO
-
 /* Network configuration */
 #define CONFIG_MCFFEC
 #ifdef CONFIG_MCFFEC
index 39ba94065ab3a95d171092af0b08a5de48fc7923..35604ad489745eb08513947f8d9f803cda124052 100644 (file)
@@ -37,7 +37,6 @@
 
 /* Command line configuration */
 #undef CONFIG_CMD_PCI
-#define CONFIG_CMD_REGINFO
 
 /* Network configuration */
 #define CONFIG_MCFFEC
index cf9d3b8e1b9ea4fdbad33c5252e713e53329aa56..4d250bf2a1cb690f78571bb985e917d4d4ba6c3f 100644 (file)
@@ -27,7 +27,6 @@
 
 /* Command line configuration */
 #define CONFIG_CMD_PCI
-#define CONFIG_CMD_REGINFO
 
 #define CONFIG_SLTTMR
 
index 934c9d8903660318fccb6011f6a0d0f4695658a0..6ed73656d3551d5610271f99b021b6f77b85e034 100644 (file)
@@ -27,7 +27,6 @@
 
 /* Command line configuration */
 #define CONFIG_CMD_PCI
-#define CONFIG_CMD_REGINFO
 
 #define CONFIG_SLTTMR
 
index a79dabef61313073493fde7cba0005f4bf0755e8..e8aa168d72eb8cde09c86dee1a477d2ce5d501db 100644 (file)
 /*
  * Command line configuration.
  */
-#define CONFIG_CMD_REGINFO
-
 #if defined(CONFIG_PCI)
     #define CONFIG_CMD_PCI
 #endif
index 61989d6babe2f1988081e33b6f351bffff419043..e102cba2c97ccf15784c7e16513d4da129c68f50 100644 (file)
@@ -57,9 +57,6 @@
 #define ENABLE_JFFS    1
 #endif
 
-/* Define which commands should be available at u-boot command prompt */
-
-#define CONFIG_CMD_REGINFO
 #define CONFIG_CMDLINE_EDITING
 
 #define CONFIG_MCFRTC
index 11c842d9526e974c3d43099badb6f498901c70cf..712e11725be24e3cfe3289285deca3afc273a1a1 100644 (file)
@@ -49,7 +49,6 @@
 /* Enable that for switching of boot partitions */
 /* Disabled by default as some sub-commands can brick eMMC */
 /*#define CONFIG_SUPPORT_EMMC_BOOT */
-#define CONFIG_CMD_REGINFO     /* Register dump                */
 #define CONFIG_CMD_TFTP
 
 /* Partition table support */
index c328e43dd64f9cb6c77ac49760de6df4eff31c7d..a9431cbd18611db0727e812c807c3ef58a835a27 100644 (file)
@@ -51,7 +51,6 @@
 /* PWM */
 #define CONFIG_PWM                     1
 
-#define CONFIG_CMD_REGINFO
 #define CONFIG_CMD_ONENAND
 
 /* USB Composite download gadget - g_dnl */
index ab755041888cf7d4bda4547c1f6b69711d25e600..c1aace7a80b6c29e535d92ab48daff8322ae4841 100644 (file)
@@ -61,7 +61,6 @@
  ***********************************************************/
 #undef CONFIG_CMD_NAND
 
-#define CONFIG_CMD_REGINFO
 #define CONFIG_CMD_ONENAND
 #define CONFIG_CMD_MTDPARTS
 
index 7b04e65d7010ba8946b3d747dcd9664484377fb8..9792c46bc370634f71f6336291c7bc6447f4d8b0 100644 (file)
@@ -252,7 +252,6 @@ int vct_gpio_get(int pin);
  * (NOR/OneNAND) usage and Linux kernel booting.
  */
 #if defined(CONFIG_VCT_SMALL_IMAGE)
-#undef CONFIG_CMD_REGINFO
 #undef CONFIG_CMD_STRINGS
 #undef CONFIG_CMD_TERMINAL