mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 15:14:43 +00:00
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 <christophe.leroy@c-s.fr> Signed-off-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
parent
f1cd73674f
commit
f3603b4382
22 changed files with 12 additions and 53 deletions
|
@ -23,6 +23,7 @@
|
||||||
#include <post.h>
|
#include <post.h>
|
||||||
#include <asm/processor.h>
|
#include <asm/processor.h>
|
||||||
#include <fsl_ddr_sdram.h>
|
#include <fsl_ddr_sdram.h>
|
||||||
|
#include <asm/ppc.h>
|
||||||
|
|
||||||
DECLARE_GLOBAL_DATA_PTR;
|
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
|
* Currently prints out LAWs, BR0/OR0 for LBC, CSPR/CSOR/Timing
|
||||||
* parameters for IFC and TLBs
|
* parameters for IFC and TLBs
|
||||||
*/
|
*/
|
||||||
void mpc85xx_reginfo(void)
|
void print_reginfo(void)
|
||||||
{
|
{
|
||||||
print_tlbcam();
|
print_tlbcam();
|
||||||
print_laws();
|
print_laws();
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
#include <asm/mmu.h>
|
#include <asm/mmu.h>
|
||||||
#include <mpc86xx.h>
|
#include <mpc86xx.h>
|
||||||
#include <asm/fsl_law.h>
|
#include <asm/fsl_law.h>
|
||||||
|
#include <asm/ppc.h>
|
||||||
|
|
||||||
DECLARE_GLOBAL_DATA_PTR;
|
DECLARE_GLOBAL_DATA_PTR;
|
||||||
|
|
||||||
|
@ -160,7 +161,7 @@ watchdog_reset(void)
|
||||||
* Print out the state of various machine registers.
|
* Print out the state of various machine registers.
|
||||||
* Currently prints out LAWs, BR0/OR0, and BATs
|
* Currently prints out LAWs, BR0/OR0, and BATs
|
||||||
*/
|
*/
|
||||||
void mpc86xx_reginfo(void)
|
void print_reginfo(void)
|
||||||
{
|
{
|
||||||
print_bats();
|
print_bats();
|
||||||
print_laws();
|
print_laws();
|
||||||
|
|
|
@ -8,8 +8,9 @@
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
#include <mpc8xx.h>
|
#include <mpc8xx.h>
|
||||||
#include <asm/io.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;
|
immap_t __iomem *immap = (immap_t __iomem *)CONFIG_SYS_IMMR;
|
||||||
memctl8xx_t __iomem *memctl = &immap->im_memctl;
|
memctl8xx_t __iomem *memctl = &immap->im_memctl;
|
||||||
|
|
|
@ -110,6 +110,10 @@ static inline void set_msr(unsigned long msr)
|
||||||
asm volatile ("mtmsr %0" : : "r" (msr));
|
asm volatile ("mtmsr %0" : : "r" (msr));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_CMD_REGINFO
|
||||||
|
void print_reginfo(void);
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* !__ASSEMBLY__ */
|
#endif /* !__ASSEMBLY__ */
|
||||||
|
|
||||||
#ifdef CONFIG_PPC
|
#ifdef CONFIG_PPC
|
||||||
|
|
|
@ -7,36 +7,20 @@
|
||||||
|
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
#include <command.h>
|
#include <command.h>
|
||||||
#if defined(CONFIG_8xx)
|
#include <asm/ppc.h>
|
||||||
void mpc8xx_reginfo(void);
|
|
||||||
#elif defined(CONFIG_MPC86xx)
|
|
||||||
extern void mpc86xx_reginfo(void);
|
|
||||||
#elif defined(CONFIG_MPC85xx)
|
|
||||||
extern void mpc85xx_reginfo(void);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static int do_reginfo(cmd_tbl_t *cmdtp, int flag, int argc,
|
static int do_reginfo(cmd_tbl_t *cmdtp, int flag, int argc,
|
||||||
char * const argv[])
|
char * const argv[])
|
||||||
{
|
{
|
||||||
#if defined(CONFIG_8xx)
|
print_reginfo();
|
||||||
mpc8xx_reginfo();
|
|
||||||
|
|
||||||
#elif defined(CONFIG_MPC86xx)
|
|
||||||
mpc86xx_reginfo();
|
|
||||||
|
|
||||||
#elif defined(CONFIG_MPC85xx)
|
|
||||||
mpc85xx_reginfo();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************/
|
/**************************************************/
|
||||||
|
|
||||||
#if defined(CONFIG_CMD_REGINFO)
|
|
||||||
U_BOOT_CMD(
|
U_BOOT_CMD(
|
||||||
reginfo, 2, 1, do_reginfo,
|
reginfo, 2, 1, do_reginfo,
|
||||||
"print register information",
|
"print register information",
|
||||||
""
|
""
|
||||||
);
|
);
|
||||||
#endif
|
|
||||||
|
|
|
@ -20,9 +20,6 @@
|
||||||
#undef CONFIG_WATCHDOG
|
#undef CONFIG_WATCHDOG
|
||||||
#define CONFIG_WATCHDOG_TIMEOUT 5000
|
#define CONFIG_WATCHDOG_TIMEOUT 5000
|
||||||
|
|
||||||
/* Command line configuration */
|
|
||||||
#define CONFIG_CMD_REGINFO
|
|
||||||
|
|
||||||
#define CONFIG_MCFFEC
|
#define CONFIG_MCFFEC
|
||||||
#ifdef CONFIG_MCFFEC
|
#ifdef CONFIG_MCFFEC
|
||||||
# define CONFIG_MII 1
|
# define CONFIG_MII 1
|
||||||
|
|
|
@ -35,9 +35,6 @@
|
||||||
#define CONFIG_BOOTP_GATEWAY
|
#define CONFIG_BOOTP_GATEWAY
|
||||||
#define CONFIG_BOOTP_HOSTNAME
|
#define CONFIG_BOOTP_HOSTNAME
|
||||||
|
|
||||||
/* Command line configuration */
|
|
||||||
#define CONFIG_CMD_REGINFO
|
|
||||||
|
|
||||||
#define CONFIG_HOSTNAME M52277EVB
|
#define CONFIG_HOSTNAME M52277EVB
|
||||||
#define CONFIG_SYS_UBOOT_END 0x3FFFF
|
#define CONFIG_SYS_UBOOT_END 0x3FFFF
|
||||||
#define CONFIG_SYS_LOAD_ADDR2 0x40010007
|
#define CONFIG_SYS_LOAD_ADDR2 0x40010007
|
||||||
|
|
|
@ -35,7 +35,6 @@
|
||||||
|
|
||||||
/* Command line configuration */
|
/* Command line configuration */
|
||||||
#define CONFIG_CMD_PCI
|
#define CONFIG_CMD_PCI
|
||||||
#define CONFIG_CMD_REGINFO
|
|
||||||
|
|
||||||
#define CONFIG_MCFFEC
|
#define CONFIG_MCFFEC
|
||||||
#ifdef CONFIG_MCFFEC
|
#ifdef CONFIG_MCFFEC
|
||||||
|
|
|
@ -25,9 +25,6 @@
|
||||||
#undef CONFIG_WATCHDOG
|
#undef CONFIG_WATCHDOG
|
||||||
#define CONFIG_WATCHDOG_TIMEOUT 5000
|
#define CONFIG_WATCHDOG_TIMEOUT 5000
|
||||||
|
|
||||||
/* Command line configuration */
|
|
||||||
#define CONFIG_CMD_REGINFO
|
|
||||||
|
|
||||||
#define CONFIG_SYS_UNIFY_CACHE
|
#define CONFIG_SYS_UNIFY_CACHE
|
||||||
|
|
||||||
#define CONFIG_MCFFEC
|
#define CONFIG_MCFFEC
|
||||||
|
|
|
@ -25,9 +25,6 @@
|
||||||
#undef CONFIG_WATCHDOG
|
#undef CONFIG_WATCHDOG
|
||||||
#define CONFIG_WATCHDOG_TIMEOUT 5000 /* timeout in milliseconds, max timeout is 6.71sec */
|
#define CONFIG_WATCHDOG_TIMEOUT 5000 /* timeout in milliseconds, max timeout is 6.71sec */
|
||||||
|
|
||||||
/* Command line configuration */
|
|
||||||
#define CONFIG_CMD_REGINFO
|
|
||||||
|
|
||||||
#ifdef CONFIG_NANDFLASH_SIZE
|
#ifdef CONFIG_NANDFLASH_SIZE
|
||||||
# define CONFIG_CMD_NAND
|
# define CONFIG_CMD_NAND
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -25,9 +25,6 @@
|
||||||
#undef CONFIG_WATCHDOG
|
#undef CONFIG_WATCHDOG
|
||||||
#define CONFIG_WATCHDOG_TIMEOUT 3360 /* timeout in ms, max is 3.36 sec */
|
#define CONFIG_WATCHDOG_TIMEOUT 3360 /* timeout in ms, max is 3.36 sec */
|
||||||
|
|
||||||
/* Command line configuration */
|
|
||||||
#define CONFIG_CMD_REGINFO
|
|
||||||
|
|
||||||
#ifdef CONFIG_NANDFLASH_SIZE
|
#ifdef CONFIG_NANDFLASH_SIZE
|
||||||
# define CONFIG_CMD_NAND
|
# define CONFIG_CMD_NAND
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -38,7 +38,6 @@
|
||||||
|
|
||||||
/* Command line configuration */
|
/* Command line configuration */
|
||||||
#undef CONFIG_CMD_NAND
|
#undef CONFIG_CMD_NAND
|
||||||
#define CONFIG_CMD_REGINFO
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* NAND FLASH
|
* NAND FLASH
|
||||||
|
|
|
@ -35,9 +35,6 @@
|
||||||
#define CONFIG_BOOTP_GATEWAY
|
#define CONFIG_BOOTP_GATEWAY
|
||||||
#define CONFIG_BOOTP_HOSTNAME
|
#define CONFIG_BOOTP_HOSTNAME
|
||||||
|
|
||||||
/* Command line configuration */
|
|
||||||
#define CONFIG_CMD_REGINFO
|
|
||||||
|
|
||||||
/* Network configuration */
|
/* Network configuration */
|
||||||
#define CONFIG_MCFFEC
|
#define CONFIG_MCFFEC
|
||||||
#ifdef CONFIG_MCFFEC
|
#ifdef CONFIG_MCFFEC
|
||||||
|
|
|
@ -37,7 +37,6 @@
|
||||||
|
|
||||||
/* Command line configuration */
|
/* Command line configuration */
|
||||||
#undef CONFIG_CMD_PCI
|
#undef CONFIG_CMD_PCI
|
||||||
#define CONFIG_CMD_REGINFO
|
|
||||||
|
|
||||||
/* Network configuration */
|
/* Network configuration */
|
||||||
#define CONFIG_MCFFEC
|
#define CONFIG_MCFFEC
|
||||||
|
|
|
@ -27,7 +27,6 @@
|
||||||
|
|
||||||
/* Command line configuration */
|
/* Command line configuration */
|
||||||
#define CONFIG_CMD_PCI
|
#define CONFIG_CMD_PCI
|
||||||
#define CONFIG_CMD_REGINFO
|
|
||||||
|
|
||||||
#define CONFIG_SLTTMR
|
#define CONFIG_SLTTMR
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,6 @@
|
||||||
|
|
||||||
/* Command line configuration */
|
/* Command line configuration */
|
||||||
#define CONFIG_CMD_PCI
|
#define CONFIG_CMD_PCI
|
||||||
#define CONFIG_CMD_REGINFO
|
|
||||||
|
|
||||||
#define CONFIG_SLTTMR
|
#define CONFIG_SLTTMR
|
||||||
|
|
||||||
|
|
|
@ -273,8 +273,6 @@
|
||||||
/*
|
/*
|
||||||
* Command line configuration.
|
* Command line configuration.
|
||||||
*/
|
*/
|
||||||
#define CONFIG_CMD_REGINFO
|
|
||||||
|
|
||||||
#if defined(CONFIG_PCI)
|
#if defined(CONFIG_PCI)
|
||||||
#define CONFIG_CMD_PCI
|
#define CONFIG_CMD_PCI
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -57,9 +57,6 @@
|
||||||
#define ENABLE_JFFS 1
|
#define ENABLE_JFFS 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Define which commands should be available at u-boot command prompt */
|
|
||||||
|
|
||||||
#define CONFIG_CMD_REGINFO
|
|
||||||
#define CONFIG_CMDLINE_EDITING
|
#define CONFIG_CMDLINE_EDITING
|
||||||
|
|
||||||
#define CONFIG_MCFRTC
|
#define CONFIG_MCFRTC
|
||||||
|
|
|
@ -49,7 +49,6 @@
|
||||||
/* Enable that for switching of boot partitions */
|
/* Enable that for switching of boot partitions */
|
||||||
/* Disabled by default as some sub-commands can brick eMMC */
|
/* Disabled by default as some sub-commands can brick eMMC */
|
||||||
/*#define CONFIG_SUPPORT_EMMC_BOOT */
|
/*#define CONFIG_SUPPORT_EMMC_BOOT */
|
||||||
#define CONFIG_CMD_REGINFO /* Register dump */
|
|
||||||
#define CONFIG_CMD_TFTP
|
#define CONFIG_CMD_TFTP
|
||||||
|
|
||||||
/* Partition table support */
|
/* Partition table support */
|
||||||
|
|
|
@ -51,7 +51,6 @@
|
||||||
/* PWM */
|
/* PWM */
|
||||||
#define CONFIG_PWM 1
|
#define CONFIG_PWM 1
|
||||||
|
|
||||||
#define CONFIG_CMD_REGINFO
|
|
||||||
#define CONFIG_CMD_ONENAND
|
#define CONFIG_CMD_ONENAND
|
||||||
|
|
||||||
/* USB Composite download gadget - g_dnl */
|
/* USB Composite download gadget - g_dnl */
|
||||||
|
|
|
@ -61,7 +61,6 @@
|
||||||
***********************************************************/
|
***********************************************************/
|
||||||
#undef CONFIG_CMD_NAND
|
#undef CONFIG_CMD_NAND
|
||||||
|
|
||||||
#define CONFIG_CMD_REGINFO
|
|
||||||
#define CONFIG_CMD_ONENAND
|
#define CONFIG_CMD_ONENAND
|
||||||
#define CONFIG_CMD_MTDPARTS
|
#define CONFIG_CMD_MTDPARTS
|
||||||
|
|
||||||
|
|
|
@ -252,7 +252,6 @@ int vct_gpio_get(int pin);
|
||||||
* (NOR/OneNAND) usage and Linux kernel booting.
|
* (NOR/OneNAND) usage and Linux kernel booting.
|
||||||
*/
|
*/
|
||||||
#if defined(CONFIG_VCT_SMALL_IMAGE)
|
#if defined(CONFIG_VCT_SMALL_IMAGE)
|
||||||
#undef CONFIG_CMD_REGINFO
|
|
||||||
#undef CONFIG_CMD_STRINGS
|
#undef CONFIG_CMD_STRINGS
|
||||||
#undef CONFIG_CMD_TERMINAL
|
#undef CONFIG_CMD_TERMINAL
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue