#include <asm/global_data.h>
#include <linux/bitops.h>
#include <linux/compiler.h>
+#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/log2.h>
#include <asm/arcregs.h>
__ic_entire_invalidate();
}
+
+int __weak pgprot_set_attrs(phys_addr_t addr, size_t size, enum pgprot_attrs perm)
+{
+ return -ENOSYS;
+}
*/
#include <cpu_func.h>
#include <asm/cache.h>
+#include <linux/errno.h>
#include <linux/types.h>
#if !CONFIG_IS_ENABLED(SYS_DCACHE_OFF)
dcache_enable();
#endif
}
+
+int __weak pgprot_set_attrs(phys_addr_t addr, size_t size, enum pgprot_attrs perm)
+{
+ return -ENOSYS;
+}
*/
#include <cpu_func.h>
#include <asm/cache.h>
+#include <linux/errno.h>
#include <linux/types.h>
#include <asm/armv7.h>
#include <asm/utils.h>
__weak void v7_outer_cache_inval_all(void) {}
__weak void v7_outer_cache_flush_range(u32 start, u32 end) {}
__weak void v7_outer_cache_inval_range(u32 start, u32 end) {}
+
+int __weak pgprot_set_attrs(phys_addr_t addr, size_t size, enum pgprot_attrs perm)
+{
+ return -ENOSYS;
+}
#include <asm/cache.h>
#include <asm/io.h>
#include <linux/bitops.h>
+#include <linux/errno.h>
/* Cache maintenance operation registers */
dcache_enable();
#endif
}
+
+int __weak pgprot_set_attrs(phys_addr_t addr, size_t size, enum pgprot_attrs perm)
+{
+ return -ENOSYS;
+}
#include <asm/global_data.h>
#include <asm/system.h>
#include <asm/armv8/mmu.h>
+#include <linux/errno.h>
DECLARE_GLOBAL_DATA_PTR;
mmu_change_region_attr_nobreak(addr, siz, attrs);
}
+int pgprot_set_attrs(phys_addr_t addr, size_t size, enum pgprot_attrs perm)
+{
+ u64 attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) | PTE_BLOCK_INNER_SHARE | PTE_TYPE_VALID;
+
+ switch (perm) {
+ case MMU_ATTR_RO:
+ attrs |= PTE_BLOCK_PXN | PTE_BLOCK_UXN | PTE_BLOCK_RO;
+ break;
+ case MMU_ATTR_RX:
+ attrs |= PTE_BLOCK_RO;
+ break;
+ case MMU_ATTR_RW:
+ attrs |= PTE_BLOCK_PXN | PTE_BLOCK_UXN;
+ break;
+ default:
+ log_err("Unknown attribute %d\n", perm);
+ return -EINVAL;
+ }
+
+ mmu_change_region_attr_nobreak(addr, size, attrs);
+
+ return 0;
+}
+
#else /* !CONFIG_IS_ENABLED(SYS_DCACHE_OFF) */
/*
#include <malloc.h>
#include <asm/cache.h>
#include <asm/global_data.h>
+#include <linux/errno.h>
DECLARE_GLOBAL_DATA_PTR;
return 0;
}
+
+int __weak pgprot_set_attrs(phys_addr_t addr, size_t size, enum pgprot_attrs perm)
+{
+ return -ENOSYS;
+}
#include <cpu_func.h>
#include <asm/immap.h>
#include <asm/cache.h>
+#include <linux/errno.h>
volatile int *cf_icache_status = (int *)ICACHE_STATUS;
volatile int *cf_dcache_status = (int *)DCACHE_STATUS;
{
/* An empty stub, real implementation should be in platform code */
}
+
+int __weak pgprot_set_attrs(phys_addr_t addr, size_t size, enum pgprot_attrs perm)
+{
+ return -ENOSYS;
+}
#include <cpu_func.h>
#include <asm/cache.h>
#include <asm/global_data.h>
+#include <linux/errno.h>
DECLARE_GLOBAL_DATA_PTR;
{
flush_dcache_all();
}
+
+int __weak pgprot_set_attrs(phys_addr_t addr, size_t size, enum pgprot_attrs perm)
+{
+ return -ENOSYS;
+}
#include <stdio.h>
#include <asm/cache.h>
#include <watchdog.h>
+#include <linux/errno.h>
static ulong maybe_watchdog_reset(ulong flushed)
{
{
puts("No arch specific invalidate_icache_all available!\n");
}
+
+int __weak pgprot_set_attrs(phys_addr_t addr, size_t size, enum pgprot_attrs perm)
+{
+ return -ENOSYS;
+}
#include <dm.h>
#include <asm/insn-def.h>
#include <linux/const.h>
+#include <linux/errno.h>
#define CBO_INVAL(base) \
INSN_I(OPCODE_MISC_MEM, FUNC3(2), __RD(0), \
if (!zicbom_block_size)
log_debug("Zicbom not initialized.\n");
}
+
+int __weak pgprot_set_attrs(phys_addr_t addr, size_t size, enum pgprot_attrs perm)
+{
+ return -ENOSYS;
+}
#include <asm/io.h>
#include <asm/processor.h>
#include <asm/system.h>
+#include <linux/errno.h>
#define CACHE_VALID 1
#define CACHE_UPDATED 2
{
return 0;
}
+
+int __weak pgprot_set_attrs(phys_addr_t addr, size_t size, enum pgprot_attrs perm)
+{
+ return -ENOSYS;
+}
#include <cpu_func.h>
#include <asm/cache.h>
+#include <linux/errno.h>
/*
* We currently run always with caches enabled when running from memory.
{
__invalidate_icache_all();
}
+
+int __weak pgprot_set_attrs(phys_addr_t addr, size_t size, enum pgprot_attrs perm)
+{
+ return -ENOSYS;
+}
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
*