]> xenbits.xensource.com Git - people/andrewcoop/xen.git/commitdiff
xen/arm: mpu: Move some of the definitions to common file
authorAyan Kumar Halder <ayan.kumar.halder@amd.com>
Tue, 4 Mar 2025 17:57:07 +0000 (17:57 +0000)
committerMichal Orzel <michal.orzel@amd.com>
Thu, 6 Mar 2025 07:09:29 +0000 (08:09 +0100)
For AArch32, refer to ARM DDI 0568A.c ID110520.
MPU_REGION_SHIFT is same between AArch32 and AArch64 (HPRBAR).
Also, NUM_MPU_REGIONS_SHIFT is same between AArch32 and AArch64
(HMPUIR).

Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
Acked-by: Michal Orzel <michal.orzel@amd.com>
xen/arch/arm/arm64/mpu/head.S
xen/arch/arm/include/asm/arm64/mpu.h [deleted file]
xen/arch/arm/include/asm/early_printk.h
xen/arch/arm/include/asm/mpu.h [new file with mode: 0644]

index e4f2021f45a0fa9762109829be95bea249cb7eaf..4d00de4869afb63c658a5cd96c2b552aaa0d6f4d 100644 (file)
@@ -3,8 +3,8 @@
  * Start-of-day code for an Armv8-R MPU system.
  */
 
-#include <asm/arm64/mpu.h>
 #include <asm/early_printk.h>
+#include <asm/mpu.h>
 
 /* Backgroud region enable/disable */
 #define SCTLR_ELx_BR    BIT(17, UL)
diff --git a/xen/arch/arm/include/asm/arm64/mpu.h b/xen/arch/arm/include/asm/arm64/mpu.h
deleted file mode 100644 (file)
index f8a029f..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * mpu.h: Arm Memory Protection Unit definitions.
- */
-
-#ifndef __ARM64_MPU_H__
-#define __ARM64_MPU_H__
-
-#define MPU_REGION_SHIFT  6
-#define MPU_REGION_ALIGN  (_AC(1, UL) << MPU_REGION_SHIFT)
-#define MPU_REGION_MASK   (~(MPU_REGION_ALIGN - 1))
-
-#define NUM_MPU_REGIONS_SHIFT   8
-#define NUM_MPU_REGIONS         (_AC(1, UL) << NUM_MPU_REGIONS_SHIFT)
-#define NUM_MPU_REGIONS_MASK    (NUM_MPU_REGIONS - 1)
-#endif /* __ARM64_MPU_H__ */
-
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * indent-tabs-mode: nil
- * End:
- */
index 219705a8b68b8a47773adbf349c8d0f00c076af5..a8af5bbd4b60309e4943ca0eaad76faaf74fbec2 100644 (file)
@@ -11,8 +11,8 @@
 #define __ARM_EARLY_PRINTK_H__
 
 #include <xen/page-size.h>
-#include <asm/arm64/mpu.h>
 #include <asm/fixmap.h>
+#include <asm/mpu.h>
 
 #ifdef CONFIG_EARLY_PRINTK
 
diff --git a/xen/arch/arm/include/asm/mpu.h b/xen/arch/arm/include/asm/mpu.h
new file mode 100644 (file)
index 0000000..d4ec424
--- /dev/null
@@ -0,0 +1,26 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * mpu.h: Arm Memory Protection Unit definitions.
+ */
+
+#ifndef __ARM_MPU_H__
+#define __ARM_MPU_H__
+
+#define MPU_REGION_SHIFT  6
+#define MPU_REGION_ALIGN  (_AC(1, UL) << MPU_REGION_SHIFT)
+#define MPU_REGION_MASK   (~(MPU_REGION_ALIGN - 1))
+
+#define NUM_MPU_REGIONS_SHIFT   8
+#define NUM_MPU_REGIONS         (_AC(1, UL) << NUM_MPU_REGIONS_SHIFT)
+#define NUM_MPU_REGIONS_MASK    (NUM_MPU_REGIONS - 1)
+
+#endif /* __ARM_MPU_H__ */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */