Commit 5aa2d571 authored by Alexandru Elisei's avatar Alexandru Elisei

arm64: Add mmiodev

parent 64a9b49b
Pipeline #67 failed with stage
in 0 seconds
......@@ -30,6 +30,7 @@ OBJDIRS += lib/arm64
tests = $(TEST_DIR)/timer.flat
tests += $(TEST_DIR)/micro-bench.flat
tests += $(TEST_DIR)/cache.flat
tests += $(TEST_DIR)/mmiodev.flat
include $(SRCDIR)/$(TEST_DIR)/Makefile.common
......
#include <libcflat.h>
#include <asm/mmu.h>
#include <asm/pgtable-hwdef.h>
#include <asm/thread_info.h>
#define DEV_ADDR (4UL << 30)
int main(int argc, char **argv)
{
uint8_t *addr = (uint8_t *)DEV_ADDR;
uint8_t val;
mmu_set_range_ptes(current_thread_info()->pgtable, DEV_ADDR, DEV_ADDR,
DEV_ADDR + PAGE_SIZE, __pgprot(PTE_UNCACHED));
val = *addr;
printf("val = 0x%x\n", val);
*addr = 0x42;
val = *addr;
printf("val = 0x%x\n", val);
asm volatile("dc ivac, %0" : : "r" (addr) : "memory");
asm volatile("dc civac, %0" : : "r" (addr) : "memory");
return 0;
}
......@@ -9,6 +9,7 @@
#define PMD_SECT_UNCACHED PMD_ATTRINDX(MT_DEVICE_nGnRE)
#define PTE_WBWA PTE_ATTRINDX(MT_NORMAL)
#define PTE_UNCACHED PTE_ATTRINDX(MT_DEVICE_nGnRE)
static inline void flush_tlb_all(void)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment