Skip to contentSkip to conversation

powerpc/8xxx: remove 85xx/86xx restrictions from fsl_guts.h

PATCH Superseded Timur Tabi 2 participants 6 messages Feb 16, 2012 – Mar 16, 2012 PowerPC

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Timur Tabi

author
#0 lore raw

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

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.

---
 arch/powerpc/include/asm/fsl_guts.h |   26 +++++++-------------------
 1 files changed, 7 insertions(+), 19 deletions(-)
arch/powerpc/include/asm/fsl_guts.h +7 -19
index bebd124..a880377 100644
@@ -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 */
Signature · 1 line
1.7.3.4
author
#1 lore raw

PATCH v2 2/2 powerpc/fsl: add PAMUBYPENR register definition to fsl_guts.h

Add a defintion of register PAMUBYPENR (offset 0x604) to the global utilities structure.

PAMUBYPENR is the PAMU bypass enable register. It contains control bits for enabling bypass mode on each PAMU.

---
 arch/powerpc/include/asm/fsl_guts.h |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
arch/powerpc/include/asm/fsl_guts.h +3 -1
index a880377..23e483d 100644
@@ -69,7 +69,9 @@ struct ccsr_guts {
 	u8	res0c4[0x224 - 0xc4];
 	__be32  iodelay1;	/* 0x.0224 - IO delay control register 1 */
 	__be32  iodelay2;	/* 0x.0228 - IO delay control register 2 */
-	u8	res22c[0x800 - 0x22c];
+	u8	res22c[0x604 - 0x22c];
+	__be32	pamubypenr;	/* 0x.0604 - PAMU bypass enable register */
+	u8	res608[0x800 - 0x608];
 	__be32	clkdvdr;	/* 0x.0800 - Clock Divide Register */
 	u8	res804[0x900 - 0x804];
 	__be32	ircr;		/* 0x.0900 - Infrared Control Register */
Signature · 1 line
1.7.3.4
#4 lore raw
In reply to Timur Tabi
Quoted 1 line · Timur Tabi

Remove the check for CONFIG_PPC_85xx and CONFIG_PPC_86xx from =

fsl_guts.h.

Quoted 11 lines

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.
=20
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

#2 lore raw

Re: [PATCH 2/2] [v2] powerpc/fsl: add PAMUBYPENR register definition to fsl_guts.h

In reply to Timur Tabi
Quoted 10 lines · Timur Tabi

Add a defintion of register PAMUBYPENR (offset 0x604) to the global utilities structure.
=20
PAMUBYPENR is the PAMU bypass enable register. It contains control bits for enabling bypass mode on each PAMU.
=20

---
arch/powerpc/include/asm/fsl_guts.h | 4 +++-

1 files changed, 3 insertions(+), 1 deletions(-)

Sticking with my original point of not applying this til PAMU driver is = ready as well.

- k=

author
#3 lore raw

Re: [PATCH 2/2] [v2] powerpc/fsl: add PAMUBYPENR register definition to fsl_guts.h

Quoted 1 line · Kumar Gala

Sticking with my original point of not applying this til PAMU driver is ready as well.

Ok.

Signature · 2 lines
Timur Tabi
Linux kernel developer at Freescale
author
#5 lore raw
In reply to Kumar Gala
Quoted 7 lines · Kumar Gala

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?

Signature · 2 lines
Timur Tabi
Linux kernel developer at Freescale