-/* $OpenBSD: locore.S,v 1.32 2020/10/19 17:57:40 naddy Exp $ */
+/* $OpenBSD: locore.S,v 1.33 2021/02/16 12:33:22 kettenis Exp $ */
/*-
* Copyright (c) 2012-2014 Andrew Turner
* All rights reserved.
mair:
/* Device | Normal (no cache, write-back, write-through) */
.quad MAIR_ATTR(0x00, 0) | \
- MAIR_ATTR(0x44, 1) | \
- MAIR_ATTR(0xff, 2) | \
- MAIR_ATTR(0x88, 3)
+ MAIR_ATTR(0x04, 1) | \
+ MAIR_ATTR(0x44, 2) | \
+ MAIR_ATTR(0xff, 3) | \
+ MAIR_ATTR(0x88, 4)
tcr:
.quad (TCR_T1SZ(64 - VIRT_BITS) | TCR_T0SZ(64 - 48) | \
TCR_AS | TCR_TG1_4K | TCR_CACHE_ATTRS | TCR_SMP_ATTRS)
-/* $OpenBSD: locore0.S,v 1.5 2019/05/28 20:32:30 patrick Exp $ */
+/* $OpenBSD: locore0.S,v 1.6 2021/02/16 12:33:22 kettenis Exp $ */
/*-
* Copyright (c) 2012-2014 Andrew Turner
* All rights reserved.
#include <machine/pte.h>
#define DEVICE_MEM 0
-#define NORMAL_UNCACHED 1
-#define NORMAL_MEM 2
+#define NORMAL_UNCACHED 2
+#define NORMAL_MEM 3
/*
* We assume:
-/* $OpenBSD: machdep.c,v 1.57 2021/02/11 23:55:48 patrick Exp $ */
+/* $OpenBSD: machdep.c,v 1.58 2021/02/16 12:33:22 kettenis Exp $ */
/*
* Copyright (c) 2014 Patrick Wildt <patrick@blueri.se>
*
for (pa = startpa; pa < endpa; pa += PAGE_SIZE, va += PAGE_SIZE)
pmap_kenter_cache(va, pa, PROT_READ | PROT_WRITE,
- PMAP_CACHE_DEV);
+ PMAP_CACHE_DEV_NGNRNE);
virtual_avail = va;
-/* $OpenBSD: pmap.c,v 1.70 2021/01/25 19:37:17 kettenis Exp $ */
+/* $OpenBSD: pmap.c,v 1.71 2021/02/16 12:33:22 kettenis Exp $ */
/*
* Copyright (c) 2008-2009,2014-2016 Dale Rahn <drahn@dalerahn.com>
*
if (pa & PMAP_NOCACHE)
cache = PMAP_CACHE_CI;
if (pa & PMAP_DEVICE)
- cache = PMAP_CACHE_DEV;
+ cache = PMAP_CACHE_DEV_NGNRNE;
pg = PHYS_TO_VM_PAGE(pa);
pmap_lock(pm);
pmap_pte_insert(pted);
ttlb_flush(pm, va & ~PAGE_MASK);
- if (cache == PMAP_CACHE_CI || cache == PMAP_CACHE_DEV)
+ if (cache == PMAP_CACHE_CI || cache == PMAP_CACHE_DEV_NGNRNE)
cpu_idcache_wbinv_range(va & ~PAGE_MASK, PAGE_SIZE);
}
break;
case PMAP_CACHE_CI:
break;
- case PMAP_CACHE_DEV:
+ case PMAP_CACHE_DEV_NGNRNE:
+ break;
+ case PMAP_CACHE_DEV_NGNRE:
break;
default:
panic("pmap_fill_pte:invalid cache mode");
attr |= ATTR_IDX(PTE_ATTR_CI);
attr |= ATTR_SH(SH_INNER);
break;
- case PMAP_CACHE_DEV:
- attr |= ATTR_IDX(PTE_ATTR_DEV);
+ case PMAP_CACHE_DEV_NGNRNE:
+ attr |= ATTR_IDX(PTE_ATTR_DEV_NGNRNE);
+ attr |= ATTR_SH(SH_INNER);
+ break;
+ case PMAP_CACHE_DEV_NGNRE:
+ attr |= ATTR_IDX(PTE_ATTR_DEV_NGNRE);
attr |= ATTR_SH(SH_INNER);
break;
default:
-/* $OpenBSD: arm64_bus_space.c,v 1.7 2018/08/20 19:38:07 kettenis Exp $ */
+/* $OpenBSD: arm64_bus_space.c,v 1.8 2021/02/16 12:33:22 kettenis Exp $ */
/*
* Copyright (c) 2001-2003 Opsycon AB (www.opsycon.se / www.opsycon.com)
{
u_long startpa, endpa, pa;
vaddr_t va;
- int cache = flags & BUS_SPACE_MAP_CACHEABLE ?
- PMAP_CACHE_WB : PMAP_CACHE_DEV;
+ int cache = PMAP_CACHE_DEV_NGNRNE;
+
+ if (flags & BUS_SPACE_MAP_CACHEABLE)
+ cache = PMAP_CACHE_WB;
+ if (flags & BUS_SPACE_MAP_POSTED)
+ cache = PMAP_CACHE_DEV_NGNRE;
startpa = trunc_page(offs);
endpa = round_page(offs + size);
-/* $OpenBSD: bus.h,v 1.7 2020/04/13 21:34:54 kettenis Exp $ */
+/* $OpenBSD: bus.h,v 1.8 2021/02/16 12:33:22 kettenis Exp $ */
/*
* Copyright (c) 2003-2004 Opsycon AB Sweden. All rights reserved.
*
#define bus_space_subregion(t, h, o, s, p) \
(*(t)->_space_subregion)((t), (h), (o), (s), (p))
-#define BUS_SPACE_MAP_CACHEABLE 0x01
-#define BUS_SPACE_MAP_KSEG0 0x02
-#define BUS_SPACE_MAP_LINEAR 0x04
-#define BUS_SPACE_MAP_PREFETCHABLE 0x08
+#define BUS_SPACE_MAP_CACHEABLE 0x01
+#define BUS_SPACE_MAP_POSTED 0x02
+#define BUS_SPACE_MAP_LINEAR 0x04
+#define BUS_SPACE_MAP_PREFETCHABLE 0x08
#define bus_space_vaddr(t, h) (*(t)->_space_vaddr)((t), (h))
#define bus_space_mmap(t, a, o, p, f) \
-/* $OpenBSD: pmap.h,v 1.15 2021/02/15 20:44:08 kettenis Exp $ */
+/* $OpenBSD: pmap.h,v 1.16 2021/02/16 12:33:22 kettenis Exp $ */
/*
* Copyright (c) 2008,2009,2014 Dale Rahn <drahn@dalerahn.com>
*
#define PMAP_CACHE_CI (PMAP_MD0) /* cache inhibit */
#define PMAP_CACHE_WT (PMAP_MD1) /* writethru */
#define PMAP_CACHE_WB (PMAP_MD1|PMAP_MD0) /* writeback */
-#define PMAP_CACHE_DEV (PMAP_MD2) /* device mapping */
+#define PMAP_CACHE_DEV_NGNRNE (PMAP_MD2) /* device nGnRnE */
+#define PMAP_CACHE_DEV_NGNRE (PMAP_MD2|PMAP_MD0) /* device nGnRE */
#define PMAP_CACHE_BITS (PMAP_MD0|PMAP_MD1|PMAP_MD2)
#define PTED_VA_MANAGED_M (PMAP_MD3)
-/* $OpenBSD: pte.h,v 1.5 2017/04/13 23:29:02 kettenis Exp $ */
+/* $OpenBSD: pte.h,v 1.6 2021/02/16 12:33:22 kettenis Exp $ */
/*
* Copyright (c) 2014 Dale Rahn <drahn@dalerahn.com>
*
#define ATTR_IDX(x) ((x) << 2)
#define ATTR_IDX_MASK (7 << 2)
-#define PTE_ATTR_DEV 0
-#define PTE_ATTR_CI 1
-#define PTE_ATTR_WB 2
-#define PTE_ATTR_WT 3
-
+#define PTE_ATTR_DEV_NGNRNE 0
+#define PTE_ATTR_DEV_NGNRE 1
+#define PTE_ATTR_CI 2
+#define PTE_ATTR_WB 3
+#define PTE_ATTR_WT 4
#define SH_INNER 3
#define SH_OUTER 2