Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F148174330
D29722.id87301.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D29722.id87301.diff
View Options
Index: share/man/man9/bus_space.9
===================================================================
--- share/man/man9/bus_space.9
+++ share/man/man9/bus_space.9
@@ -52,7 +52,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd July 7, 2020
+.Dd April ??, 2021
.Dt BUS_SPACE 9
.Os
.Sh NAME
@@ -876,6 +876,11 @@
If this
flag is not specified, the system may map the space in whatever way is
most convenient.
+.It Dv BUS_SPACE_MAP_NONPOSTED
+Try to map the space using non-posted device memory.
+This is to support buses and devices where mapping with posted device
+memory is unsupported or broken.
+This flag is currently only available on arm64.
.El
.Pp
Not all combinations of flags make sense or are supported with all
Index: sys/arm64/arm64/bus_machdep.c
===================================================================
--- sys/arm64/arm64/bus_machdep.c
+++ sys/arm64/arm64/bus_machdep.c
@@ -99,9 +99,13 @@
generic_bs_map(void *t, bus_addr_t bpa, bus_size_t size, int flags,
bus_space_handle_t *bshp)
{
+ vm_memattr_t ma;
void *va;
- va = pmap_mapdev(bpa, size);
+ ma = VM_MEMATTR_DEVICE;
+ if (flags == BUS_SPACE_MAP_NONPOSTED)
+ ma = VM_MEMATTR_DEVICE_NP;
+ va = pmap_mapdev_attr(bpa, size, VM_MEMATTR_DEVICE);
if (va == NULL)
return (ENOMEM);
*bshp = (bus_space_handle_t)va;
Index: sys/arm64/include/bus.h
===================================================================
--- sys/arm64/include/bus.h
+++ sys/arm64/include/bus.h
@@ -85,6 +85,7 @@
#define BUS_SPACE_MAP_CACHEABLE 0x01
#define BUS_SPACE_MAP_LINEAR 0x02
#define BUS_SPACE_MAP_PREFETCHABLE 0x04
+#define BUS_SPACE_MAP_NONPOSTED 0x08
#define BUS_SPACE_UNRESTRICTED (~0)
Index: sys/arm64/include/vm.h
===================================================================
--- sys/arm64/include/vm.h
+++ sys/arm64/include/vm.h
@@ -37,6 +37,7 @@
#define VM_MEMATTR_DEVICE_nGnRE 4
#define VM_MEMATTR_DEVICE VM_MEMATTR_DEVICE_nGnRnE
+#define VM_MEMATTR_DEVICE_NP VM_MEMATTR_DEVICE_nGnRnE
#ifdef _KERNEL
/* If defined vmstat will try to use both of these in a switch statement */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Mar 17, 6:52 AM (4 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29813207
Default Alt Text
D29722.id87301.diff (2 KB)
Attached To
Mode
D29722: Add a way to map arm64 non-posted device memory
Attached
Detach File
Event Timeline
Log In to Comment