[U-Boot] [PATCH 32/38] common: powerpc: Move arch-specific headers

Simon Glass sjg at chromium.org
Wed May 17 14:23:05 UTC 2017


Set up a new asm/ppc.h header file to hold this arch-specific stuff. It
should not be in common.h. It probably should be refactored to use
asm/arch instead, but that is a job for the maintainer.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 arch/powerpc/cpu/ppc4xx/4xx_pci.c |  1 +
 arch/powerpc/cpu/ppc4xx/miiphy.c  |  1 +
 arch/powerpc/cpu/ppc4xx/reginfo.c |  1 +
 arch/powerpc/include/asm/ppc.h    | 67 +++++++++++++++++++++++++++++++++++++++
 arch/powerpc/include/asm/u-boot.h |  1 +
 include/common.h                  | 44 +------------------------
 6 files changed, 72 insertions(+), 43 deletions(-)
 create mode 100644 arch/powerpc/include/asm/ppc.h

diff --git a/arch/powerpc/cpu/ppc4xx/4xx_pci.c b/arch/powerpc/cpu/ppc4xx/4xx_pci.c
index bfe48a2ad3..0227a72ae9 100644
--- a/arch/powerpc/cpu/ppc4xx/4xx_pci.c
+++ b/arch/powerpc/cpu/ppc4xx/4xx_pci.c
@@ -56,6 +56,7 @@
 #include <asm/processor.h>
 #include <asm/io.h>
 #include <pci.h>
+#include <asm/ppc4xx.h>
 
 #ifdef CONFIG_PCI
 
diff --git a/arch/powerpc/cpu/ppc4xx/miiphy.c b/arch/powerpc/cpu/ppc4xx/miiphy.c
index f0fc098059..aef267e0a2 100644
--- a/arch/powerpc/cpu/ppc4xx/miiphy.c
+++ b/arch/powerpc/cpu/ppc4xx/miiphy.c
@@ -22,6 +22,7 @@
 #include <asm/io.h>
 #include <ppc_asm.tmpl>
 #include <commproc.h>
+#include <asm/ppc4xx.h>
 #include <asm/ppc4xx-emac.h>
 #include <asm/ppc4xx-mal.h>
 #include <miiphy.h>
diff --git a/arch/powerpc/cpu/ppc4xx/reginfo.c b/arch/powerpc/cpu/ppc4xx/reginfo.c
index a42327eb3d..59de04a2d8 100644
--- a/arch/powerpc/cpu/ppc4xx/reginfo.c
+++ b/arch/powerpc/cpu/ppc4xx/reginfo.c
@@ -14,6 +14,7 @@
 #include <command.h>
 #include <asm/processor.h>
 #include <asm/io.h>
+#include <asm/ppc4xx.h>
 #include <asm/ppc4xx-uic.h>
 #include <asm/ppc4xx-emac.h>
 
diff --git a/arch/powerpc/include/asm/ppc.h b/arch/powerpc/include/asm/ppc.h
new file mode 100644
index 0000000000..545c71d2c4
--- /dev/null
+++ b/arch/powerpc/include/asm/ppc.h
@@ -0,0 +1,67 @@
+/*
+ * Ugly header containing required header files. This could  be adjusted
+ * so that including asm/arch/hardware includes the correct file.
+ *
+ * (C) Copyright 2000-2009
+ * Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#ifndef __ASM_PPC_H
+#define __ASM_PPC_H
+
+#ifndef __ASSEMBLY__
+
+#if defined(CONFIG_8xx)
+#include <asm/8xx_immap.h>
+#if defined(CONFIG_MPC859) || defined(CONFIG_MPC859T) || \
+	defined(CONFIG_MPC866) ||  defined(CONFIG_MPC866P)
+# define CONFIG_MPC866_FAMILY 1
+#elif defined(CONFIG_MPC885)
+# define CONFIG_MPC885_FAMILY   1
+#endif
+#if defined(CONFIG_MPC860) || defined(CONFIG_MPC860T) || \
+	defined(CONFIG_MPC866_FAMILY) || defined(CONFIG_MPC885_FAMILY)
+# define CONFIG_MPC86x 1
+#endif
+#elif defined(CONFIG_5xx)
+#include <asm/5xx_immap.h>
+#elif defined(CONFIG_MPC5xxx)
+#include <mpc5xxx.h>
+#elif defined(CONFIG_MPC512X)
+#include <asm/immap_512x.h>
+#elif defined(CONFIG_MPC8260)
+#if defined(CONFIG_MPC8247) || defined(CONFIG_MPC8272)
+#define CONFIG_MPC8272_FAMILY	1
+#endif
+#include <asm/immap_8260.h>
+#endif
+#ifdef CONFIG_MPC86xx
+#include <mpc86xx.h>
+#include <asm/immap_86xx.h>
+#endif
+#ifdef CONFIG_MPC85xx
+#include <mpc85xx.h>
+#include <asm/immap_85xx.h>
+#endif
+#ifdef CONFIG_MPC83xx
+#include <mpc83xx.h>
+#include <asm/immap_83xx.h>
+#endif
+#ifdef	CONFIG_4xx
+#include <asm/ppc4xx.h>
+#endif
+#ifdef CONFIG_SOC_DA8XX
+#include <asm/arch/hardware.h>
+#endif
+#ifdef CONFIG_FSL_LSCH3
+#include <asm/arch/immap_lsch3.h>
+#endif
+#ifdef CONFIG_FSL_LSCH2
+#include <asm/arch/immap_lsch2.h>
+#endif
+
+#endif /* !__ASSEMBLY__ */
+
+#endif
diff --git a/arch/powerpc/include/asm/u-boot.h b/arch/powerpc/include/asm/u-boot.h
index 74b620294e..34e44e18c2 100644
--- a/arch/powerpc/include/asm/u-boot.h
+++ b/arch/powerpc/include/asm/u-boot.h
@@ -16,6 +16,7 @@
 
 /* Use the generic board which requires a unified bd_info */
 #include <asm-generic/u-boot.h>
+#include <asm/ppc.h>
 
 /* For image.h:image_check_target_arch() */
 #define IH_ARCH_DEFAULT IH_ARCH_PPC
diff --git a/include/common.h b/include/common.h
index 3f6b636fae..ecfd8882af 100644
--- a/include/common.h
+++ b/include/common.h
@@ -30,49 +30,7 @@ typedef volatile unsigned char	vu_char;
 #include <asm/ptrace.h>
 #include <stdarg.h>
 #include <linux/kernel.h>
-#if defined(CONFIG_8xx)
-#include <asm/8xx_immap.h>
-#if defined(CONFIG_MPC859)	|| defined(CONFIG_MPC859T)	|| \
-    defined(CONFIG_MPC866)	|| \
-    defined(CONFIG_MPC866P)
-# define CONFIG_MPC866_FAMILY 1
-#elif defined(CONFIG_MPC885)
-# define CONFIG_MPC885_FAMILY   1
-#endif
-#if   defined(CONFIG_MPC860)	   \
-   || defined(CONFIG_MPC860T)	   \
-   || defined(CONFIG_MPC866_FAMILY) \
-   || defined(CONFIG_MPC885_FAMILY)
-# define CONFIG_MPC86x 1
-#endif
-#elif defined(CONFIG_5xx)
-#include <asm/5xx_immap.h>
-#elif defined(CONFIG_MPC5xxx)
-#include <mpc5xxx.h>
-#elif defined(CONFIG_MPC512X)
-#include <asm/immap_512x.h>
-#elif defined(CONFIG_MPC8260)
-#if   defined(CONFIG_MPC8247) \
-   || defined(CONFIG_MPC8272)
-#define CONFIG_MPC8272_FAMILY	1
-#endif
-#include <asm/immap_8260.h>
-#endif
-#ifdef CONFIG_MPC86xx
-#include <mpc86xx.h>
-#include <asm/immap_86xx.h>
-#endif
-#ifdef CONFIG_MPC85xx
-#include <mpc85xx.h>
-#include <asm/immap_85xx.h>
-#endif
-#ifdef CONFIG_MPC83xx
-#include <mpc83xx.h>
-#include <asm/immap_83xx.h>
-#endif
-#ifdef	CONFIG_4xx
-#include <asm/ppc4xx.h>
-#endif
+
 #ifdef CONFIG_SOC_DA8XX
 #include <asm/arch/hardware.h>
 #endif
-- 
2.13.0.303.g4ebf302169-goog



More information about the U-Boot mailing list