diff options
author | jhibbits <jhibbits@FreeBSD.org> | 2016-02-27 20:39:36 +0000 |
---|---|---|
committer | jhibbits <jhibbits@FreeBSD.org> | 2016-02-27 20:39:36 +0000 |
commit | 0677ff9cefa9d73fbf058b41d01e7b358a4c8678 (patch) | |
tree | d928d1f765dac476468ab1e3f1a45dd369f96ede /sys/powerpc/include | |
parent | cd50f0196723942045f247e8f82245d3d266f9c7 (diff) | |
download | FreeBSD-src-0677ff9cefa9d73fbf058b41d01e7b358a4c8678.zip FreeBSD-src-0677ff9cefa9d73fbf058b41d01e7b358a4c8678.tar.gz |
Implement pmap_change_attr() for PowerPC (Book-E only for now)
Summary:
Some drivers need special memory requirements. X86 solves this with a
pmap_change_attr() API, which DRM uses for changing the mapping of the GART and
other memory regions. Implement the same function for PowerPC. AIM currently
does not need this, but will in the future for DRM, so a default is added for
that, for business as usual. Book-E has some drivers coming down that do
require non-default memory coherency. In this case, the Datapath Acceleration
Architecture (DPAA) based ethernet controller has 2 regions for the buffer
portals: cache-inhibited, and cache-enabled. By default, device memory is
cache-inhibited. If the cache-enabled memory regions are mapped
cache-inhibited, an alignment exception is thrown on access.
Test Plan:
Tested with a new driver to be added after this (DPAA dTSEC ethernet driver).
No alignment exceptions thrown, driver works as expected with this.
Reviewed By: nwhitehorn
Sponsored by: Alex Perez/Inertial Computing
Differential Revision: https://reviews.freebsd.org/D5471
Diffstat (limited to 'sys/powerpc/include')
-rw-r--r-- | sys/powerpc/include/pmap.h | 1 | ||||
-rw-r--r-- | sys/powerpc/include/tlb.h | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/sys/powerpc/include/pmap.h b/sys/powerpc/include/pmap.h index 97c5c79..ea06c08 100644 --- a/sys/powerpc/include/pmap.h +++ b/sys/powerpc/include/pmap.h @@ -238,6 +238,7 @@ void *pmap_mapdev(vm_paddr_t, vm_size_t); void *pmap_mapdev_attr(vm_paddr_t, vm_size_t, vm_memattr_t); void pmap_unmapdev(vm_offset_t, vm_size_t); void pmap_page_set_memattr(vm_page_t, vm_memattr_t); +int pmap_change_attr(vm_offset_t, vm_size_t, vm_memattr_t); void pmap_deactivate(struct thread *); vm_paddr_t pmap_kextract(vm_offset_t); int pmap_dev_direct_mapped(vm_paddr_t, vm_size_t); diff --git a/sys/powerpc/include/tlb.h b/sys/powerpc/include/tlb.h index 4f12c19..8fb7c85 100644 --- a/sys/powerpc/include/tlb.h +++ b/sys/powerpc/include/tlb.h @@ -74,6 +74,7 @@ #define MAS2_M 0x00000004 #define MAS2_G 0x00000002 #define MAS2_E 0x00000001 +#define MAS2_WIMGE_MASK 0x0000001F #define MAS3_RPN 0xFFFFF000 #define MAS3_RPN_SHIFT 12 |