summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorIlias Apalodimas <[email protected]>2025-02-20 15:54:42 +0200
committerIlias Apalodimas <[email protected]>2025-03-14 13:37:54 +0200
commitec1c6cfb1cfce92909a248f10c36bd8b18894d7e (patch)
treebcf4968fe2ca08b49c50b9844b53f07551ad0c00 /include
parentff0a979fc3591dcfb28585ae97ed4078a3ed5ef4 (diff)
treewide: Add a function to change page permissions
For armv8 we are adding proper page permissions for the relocated U-Boot binary. Add a weak function that can be used across architectures to change the page permissions Tested-by: Neil Armstrong <[email protected]> # on AML-S905X-CC Signed-off-by: Ilias Apalodimas <[email protected]>
Diffstat (limited to 'include')
-rw-r--r--include/cpu_func.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/cpu_func.h b/include/cpu_func.h
index 7e81c4364a7..70a41ead3f7 100644
--- a/include/cpu_func.h
+++ b/include/cpu_func.h
@@ -69,6 +69,23 @@ void flush_dcache_range(unsigned long start, unsigned long stop);
void invalidate_dcache_range(unsigned long start, unsigned long stop);
void invalidate_dcache_all(void);
void invalidate_icache_all(void);
+
+enum pgprot_attrs {
+ MMU_ATTR_RO,
+ MMU_ATTR_RX,
+ MMU_ATTR_RW,
+};
+
+/** pgprot_set_attrs() - Set page table permissions
+ *
+ * @addr: Physical address start
+ * @size: size of memory to change
+ * @perm: New permissions
+ *
+ * Return: 0 on success, error otherwise.
+ **/
+int pgprot_set_attrs(phys_addr_t addr, size_t size, enum pgprot_attrs perm);
+
/**
* noncached_init() - Initialize non-cached memory region
*