[PATCH V4 40/44] imx8ulp: move struct mu_type to common header

Peng Fan (OSS) peng.fan at oss.nxp.com
Wed Jul 21 16:17:21 CEST 2021


From: Peng Fan <peng.fan at nxp.com>

Move struct mu_type to common header to make it reusable by upower and
S400

Signed-off-by: Peng Fan <peng.fan at nxp.com>
---
 arch/arm/include/asm/arch-imx8ulp/imx-regs.h | 25 ++++++++++++++++++++
 drivers/misc/imx8ulp/imx8ulp_mu.c            | 19 +--------------
 2 files changed, 26 insertions(+), 18 deletions(-)

diff --git a/arch/arm/include/asm/arch-imx8ulp/imx-regs.h b/arch/arm/include/asm/arch-imx8ulp/imx-regs.h
index 5231155089..af6845cbff 100644
--- a/arch/arm/include/asm/arch-imx8ulp/imx-regs.h
+++ b/arch/arm/include/asm/arch-imx8ulp/imx-regs.h
@@ -63,6 +63,31 @@
 #if !(defined(__KERNEL_STRICT_NAMES) || defined(__ASSEMBLY__))
 #include <asm/types.h>
 
+struct mu_type {
+	u32 ver;
+	u32 par;
+	u32 cr;
+	u32 sr;
+	u32 reserved0[60];
+	u32 fcr;
+	u32 fsr;
+	u32 reserved1[2];
+	u32 gier;
+	u32 gcr;
+	u32 gsr;
+	u32 reserved2;
+	u32 tcr;
+	u32 tsr;
+	u32 rcr;
+	u32 rsr;
+	u32 reserved3[52];
+	u32 tr[16];
+	u32 reserved4[16];
+	u32 rr[16];
+	u32 reserved5[14];
+	u32 mu_attr;
+};
+
 struct usbphy_regs {
 	u32	usbphy_pwd;			/* 0x000 */
 	u32	usbphy_pwd_set;			/* 0x004 */
diff --git a/drivers/misc/imx8ulp/imx8ulp_mu.c b/drivers/misc/imx8ulp/imx8ulp_mu.c
index 913ebe7ad3..333ebdf576 100644
--- a/drivers/misc/imx8ulp/imx8ulp_mu.c
+++ b/drivers/misc/imx8ulp/imx8ulp_mu.c
@@ -10,29 +10,12 @@
 #include <dm/root.h>
 #include <dm/device-internal.h>
 #include <asm/arch/s400_api.h>
+#include <asm/arch/imx-regs.h>
 #include <linux/iopoll.h>
 #include <misc.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
-struct mu_type {
-	u32 ver;
-	u32 par;
-	u32 cr;
-	u32 sr;
-	u32 reserved0[68];
-	u32 tcr;
-	u32 tsr;
-	u32 rcr;
-	u32 rsr;
-	u32 reserved1[52];
-	u32 tr[16];
-	u32 reserved2[16];
-	u32 rr[16];
-	u32 reserved4[14];
-	u32 mu_attr;
-};
-
 struct imx8ulp_mu {
 	struct mu_type *base;
 };
-- 
2.30.0



More information about the U-Boot mailing list