diff mbox

[1/2] powerpc/8xxx: remove 85xx/86xx restrictions from fsl_guts.h

Message ID 1329412870-16716-1-git-send-email-timur@freescale.com (mailing list archive)
State Changes Requested
Delegated to: Kumar Gala
Headers show

Commit Message

Timur Tabi Feb. 16, 2012, 5:21 p.m. UTC
Remove the check for CONFIG_PPC_85xx and CONFIG_PPC_86xx from fsl_guts.h.
The check was originally intended to allow the same header file to
be used on 85xx and 86xx systems, even though the Global Utilities
register could be different.  It turns out that they're not actually
different, and so the check is not necessary.  In addition, neither
macro is defined for 64-bit e5500 kernels, so that causes a build
break.

To maintain backwards compatibility, we also define macros for
ccsr_guts_85xx and ccsr_guts_86xx.  This eliminates the need to
change all the files that #include fsl_guts.h.  Those files will
be updated at a later time, and then the macros can be deleted.

Signed-off-by: Timur Tabi <timur@freescale.com>
---
 arch/powerpc/include/asm/fsl_guts.h |   26 +++++++-------------------
 1 files changed, 7 insertions(+), 19 deletions(-)

Comments

Kumar Gala March 16, 2012, 7:06 p.m. UTC | #1
On Feb 16, 2012, at 11:21 AM, Timur Tabi wrote:

> Remove the check for CONFIG_PPC_85xx and CONFIG_PPC_86xx from fsl_guts.h.
> The check was originally intended to allow the same header file to
> be used on 85xx and 86xx systems, even though the Global Utilities
> register could be different.  It turns out that they're not actually
> different, and so the check is not necessary.  In addition, neither
> macro is defined for 64-bit e5500 kernels, so that causes a build
> break.
> 
> To maintain backwards compatibility, we also define macros for
> ccsr_guts_85xx and ccsr_guts_86xx.  This eliminates the need to
> change all the files that #include fsl_guts.h.  Those files will
> be updated at a later time, and then the macros can be deleted.

If you are doing this clean, just finish it.  There are only a small handful of users of ccsr_guts_8{5,6}xx:

arch/powerpc/include/asm/fsl_guts.h:static inline void guts_set_dmacr(struct ccsr_guts_86xx __iomem *guts,
arch/powerpc/include/asm/fsl_guts.h:static inline void guts_set_pmuxcr_dma(struct ccsr_guts_86xx __iomem *guts,
arch/powerpc/platforms/86xx/mpc8610_hpcd.c:     struct ccsr_guts_86xx __iomem *guts;
arch/powerpc/platforms/85xx/p1022_ds.c: struct ccsr_guts_85xx __iomem *guts;
arch/powerpc/platforms/85xx/p1022_ds.c: struct ccsr_guts_85xx __iomem *guts;

- k
Timur Tabi March 16, 2012, 7:09 p.m. UTC | #2
Kumar Gala wrote:
> If you are doing this clean, just finish it.  There are only a small handful of users of ccsr_guts_8{5,6}xx:
> 
> arch/powerpc/include/asm/fsl_guts.h:static inline void guts_set_dmacr(struct ccsr_guts_86xx __iomem *guts,
> arch/powerpc/include/asm/fsl_guts.h:static inline void guts_set_pmuxcr_dma(struct ccsr_guts_86xx __iomem *guts,
> arch/powerpc/platforms/86xx/mpc8610_hpcd.c:     struct ccsr_guts_86xx __iomem *guts;
> arch/powerpc/platforms/85xx/p1022_ds.c: struct ccsr_guts_85xx __iomem *guts;
> arch/powerpc/platforms/85xx/p1022_ds.c: struct ccsr_guts_85xx __iomem *guts;

Ok.  Can you push your tree to git.kernel.org, so that I can be sure to
provide a clean patch?
diff mbox

Patch

diff --git a/arch/powerpc/include/asm/fsl_guts.h b/arch/powerpc/include/asm/fsl_guts.h
index bebd124..a880377 100644
--- a/arch/powerpc/include/asm/fsl_guts.h
+++ b/arch/powerpc/include/asm/fsl_guts.h
@@ -16,15 +16,6 @@ 
 #define __ASM_POWERPC_FSL_GUTS_H__
 #ifdef __KERNEL__
 
-/*
- * These #ifdefs are safe because it's not possible to build a kernel that
- * runs on e500 and e600 cores.
- */
-
-#if !defined(CONFIG_PPC_85xx) && !defined(CONFIG_PPC_86xx)
-#error Only 85xx and 86xx SOCs are supported
-#endif
-
 /**
  * Global Utility Registers.
  *
@@ -36,11 +27,7 @@ 
  * different names.  In these cases, one name is chosen to avoid extraneous
  * #ifdefs.
  */
-#ifdef CONFIG_PPC_85xx
-struct ccsr_guts_85xx {
-#else
-struct ccsr_guts_86xx {
-#endif
+struct ccsr_guts {
 	__be32	porpllsr;	/* 0x.0000 - POR PLL Ratio Status Register */
 	__be32	porbmsr;	/* 0x.0004 - POR Boot Mode Status Register */
 	__be32	porimpscr;	/* 0x.0008 - POR I/O Impedance Status and Control Register */
@@ -77,11 +64,8 @@  struct ccsr_guts_86xx {
 	u8	res0a8[0xb0 - 0xa8];
 	__be32	rstcr;		/* 0x.00b0 - Reset Control Register */
 	u8	res0b4[0xc0 - 0xb4];
-#ifdef CONFIG_PPC_85xx
-	__be32  iovselsr;	/* 0x.00c0 - I/O voltage select status register */
-#else
-	__be32	elbcvselcr;	/* 0x.00c0 - eLBC Voltage Select Ctrl Reg */
-#endif
+	__be32  iovselsr;	/* 0x.00c0 - I/O voltage select status register
+				             Called 'elbcvselcr' on 86xx SOCs */
 	u8	res0c4[0x224 - 0xc4];
 	__be32  iodelay1;	/* 0x.0224 - IO delay control register 1 */
 	__be32  iodelay2;	/* 0x.0228 - IO delay control register 2 */
@@ -114,6 +98,10 @@  struct ccsr_guts_86xx {
 	__be32	srds2cr1;	/* 0x.0f44 - SerDes2 Control Register 0 */
 } __attribute__ ((packed));
 
+/* For backwards-compatibility */
+#define ccsr_guts_85xx ccsr_guts
+#define ccsr_guts_86xx ccsr_guts
+
 #ifdef CONFIG_PPC_86xx
 
 #define CCSR_GUTS_DMACR_DEV_SSI	0	/* DMA controller/channel set to SSI */