aboutsummaryrefslogtreecommitdiff
path: root/sys/compat/linuxkpi/common/include/linux/io.h
Commit message (Collapse)AuthorAgeFilesLines
* linuxkpi: io.h: Only exclude armv6 and armv7 for asm/set_memory.hEmmanuel Vadot40 hours1-1/+1
| | | | | | | | Other arches like powerpc* needs it. Fixes: d387a1b4b1996 ("linuxkpi: io.h: Do not include asm/set_memory.h for armv6 and armv7") Fixes: 789dbdbb48574 ("linuxkpi: Add arch_io_{reserve,free}_memtype_wc") Sponsored by: Beckhoff Automation GmbH & Co. KG
* linuxkpi: io.h: Do not include asm/set_memory.h for armv6 and armv7Emmanuel Vadot42 hours1-0/+2
| | | | | | | They do not have the same pmap api and this cannot work for those arch. Fixes: 789dbdbb48574 ("linuxkpi: Add arch_io_{reserve,free}_memtype_wc") Sponsored by: Beckhoff Automation GmbH & Co. KG
* linuxkpi: Add arch_io_{reserve,free}_memtype_wcEmmanuel Vadot45 hours1-0/+16
| | | | | | | Reviewed by: hselasky Obtained from: drm-kmod Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D36022
* linuxkpi: Use an inline function for the _ioremap_attr stub.John Baldwin2022-04-131-1/+5
| | | | | This "consumes" variables passed to ioremap*() avoiding set but unused warnings.
* LinuxKPI: Constantly use _LINUXKPI_ prefix in include guardsVladimir Kondratyev2022-01-101-3/+3
| | | | | | MFC after: 1 week Reviewed by: bz, emaste, hselasky, manu Differential Revision: https://reviews.freebsd.org/D33562
* LinuxKPI: Import MTRR support functions from drm-kmodVladimir Kondratyev2022-01-101-0/+8
| | | | | | | | | | | | They are superseded by PAT and mostly useless nowadays but still can be used on Pentium III/IV era processors. Unlike drm-kmod version, this one ignores MTRR if PAT is available that fixes confusing "Failed to add WC MTRR for [0xXXXX-0xYYYY]: 22; performance may suffer" message often appearing during drm-kmod initialization process. MFC after: 1 week Reviewed by: hselasky, manu Differential Revision: https://reviews.freebsd.org/D33561
* LinuxKPI: Implement _ioremap_attr for riscvJessica Clarke2021-10-171-1/+1
| | | | | | | | | | Now that riscv implements pmap_mapdev_attr we can enable the non-stub implementation for riscv, which is needed for drm-kmod to not fail at run time for drivers that need to map I/O regions. Reviewed by: hselasky, bz MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D32446
* LinuxKPI: Add more #ifdef VM_MEMATTR_WRITE_COMBINING guardsJessica Clarke2021-10-031-0/+4
| | | | | | | | | | One of the three uses is already guarded; this guards the remaining ones to support architectures like riscv that do not provide write-combining, and is needed to build drm-kmod on riscv. Reviewed by: hselasky, manu MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31999
* compat: clean up empty lines in .c and .h filesMateusz Guzik2020-09-011-1/+0
| | | | Notes: svn path=/head/; revision=365080
* Fix include file order in io.h in the LinuxKPI.Hans Petter Selasky2020-07-051-1/+2
| | | | | | | | | | | | Make sure sys/types.h is included before machine/vm.h. PR: 247775 Submitted by: pkubaj@ MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=362946
* Use DEVICE memory instead of UNCACHEABLE on aarch64 in ioremap() in the ↵Hans Petter Selasky2019-09-021-4/+13
| | | | | | | | | | | | | | | LinuxKPI. This fixes system hangs on reading device registers on aarch64. Tested with: Marvell MACCHIATObin (Armada8k) + mlx4en, amdgpu Submitted by: Greg V <greg@unrelenting.technology> Differential Revision: https://reviews.freebsd.org/D20789 MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=351693
* Add necessary bits for Linux KPI to work correctly on powerpcJustin Hibbits2019-08-041-33/+73
| | | | | | | | | | | | | | | | | | | | | PowerPC, and possibly other architectures, use different address ranges for PCI space vs physical address space, which is only mapped at resource activation time, when the BAR gets written. The DRM kernel modules do not activate the rman resources, soas not to waste KVA, instead only mapping parts of the PCI memory at a time. This introduces a BUS_TRANSLATE_RESOURCE() method, implemented in the Open Firmware/FDT PCI driver, to perform this necessary translation without activating the resource. In addition to system KPI changes, LinuxKPI is updated to handle a big-endian host, by adding proper endian swaps to the I/O functions. Submitted by: mmacy Reported by: hselasky Differential Revision: https://reviews.freebsd.org/D21096 Notes: svn path=/head/; revision=350570
* Enable ioremap for aarch64 in the LinuxKPIEd Maste2019-04-201-1/+1
| | | | | | | | | | | | Required for Mellanox drivers (e.g. on Ampere eMAG at Packet.com). PR: 237055 Submitted by: Greg V <greg@unrelenting.technology> Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D19987 Notes: svn path=/head/; revision=346445
* Define linuxkpi readq for 64-bit architectures. It is used by drm-kmod.Tijl Coosemans2018-10-221-53/+209
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the compiler picks up the definition in machine/cpufunc.h. Add compiler memory barriers to read* and write*. The Linux x86 implementation of these functions uses inline asm with "memory" clobber. The Linux x86 implementation of read_relaxed* and write_relaxed* uses the same inline asm without "memory" clobber. Implement ioread* and iowrite* in terms of read* and write* so they also have memory barriers. Qualify the addr parameter in write* as volatile. Like Linux, define macros with the same name as the inline functions. Only define 64-bit versions on 64-bit architectures because generally 32-bit architectures can't do atomic 64-bit loads and stores. Regroup the functions a bit and add brief comments explaining what they do: - __raw_read*, __raw_write*: atomic, no barriers, no byte swapping - read_relaxed*, write_relaxed*: atomic, no barriers, little-endian - read*, write*: atomic, with barriers, little-endian Add a comment that says our implementation of ioread* and iowrite* only handles MMIO and does not support port IO. Reviewed by: hselasky MFC after: 3 days Notes: svn path=/head/; revision=339618
* linuxkpi whitespace cleanupEd Maste2018-03-231-4/+4
| | | | | | | | | Reviewed by: hselasky, markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D14807 Notes: svn path=/head/; revision=331433
* Implement writel_relaxed() in the LinuxKPI.Hans Petter Selasky2018-03-041-0/+7
| | | | | | | | | | MFC after: 1 week Submitted by: Johannes Lundberg <johalun0@gmail.com> Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Notes: svn path=/head/; revision=330391
* Implement ioread16be() in the LinuxKPI.Hans Petter Selasky2017-11-011-0/+7
| | | | | | | | MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=325279
* Remove ARM and MIPS from linuxkpi ioremap_attr definitionJustin Hibbits2017-06-081-2/+1
| | | | | | | | | | | | | ARM and MIPS fail universe builds. ARM and MIPS are missing the following: * VM_MEMATTR_WRITE_THROUGH * VM_MEMATTR_WRITE_COMBINING Pointy-hat to: jhibbits Notes: svn path=/head/; revision=319675
* Add more #ifdef arch checks to the linuxkpiJustin Hibbits2017-06-071-1/+2
| | | | | | | | | | | | arm, mips, and powerpc all implement pmap_mapdev_attr() and pmap_unmapdev(), so add those archs to the checks. powerpc also includes the atomic_swap_*() functions, so add that to the supported list as well. Not tested except by compiling powerpc. Reviewed by: markj Notes: svn path=/head/; revision=319656
* Add some miscellaneous definitions to support DRM drivers.Mark Johnston2017-05-301-0/+1
| | | | | | | | | Reviewed by: hselasky MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D10985 Notes: svn path=/head/; revision=319229
* Add __iowrite32_copy() to the Linux kernel compatibility layer.Kevin Lo2016-05-241-7/+12
| | | | | | | Reviewed by: hselasky Notes: svn path=/head/; revision=300594
* Implement "_outb()" to the LinuxKPI for i386 and amd64 only.Hans Petter Selasky2016-05-231-0/+8
| | | | | | | | | Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=300494
* Implement ioremap_wt() and use that in the MEMREMAP_WT case for i386Hans Petter Selasky2016-05-101-1/+3
| | | | | | | | | | | | and amd64. Suggested by: cem @ Discussed with: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=299379
* Add more LinuxKPI I/O functions.Hans Petter Selasky2016-05-101-1/+77
| | | | | | | | | Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=299364
* Build fixes:Hans Petter Selasky2015-11-121-2/+29
| | | | | | | | | | | | | - Add some missing I/O functions for non-i386 and amd64 platforms. - Stub ioremap() to NULL using a macro to ensure non-existing memory attributes are not referred when they do not exist. - Add more header files to linux/list.h to resolve driver compilation issues on Sparc64 and PowerPC platforms. Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=290706
* Make all the LinuxKPI include files compile standalone.Hans Petter Selasky2015-11-031-0/+1
| | | | | | | Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=290335
* Finish process of moving the LinuxKPI module into the default kernel build.Hans Petter Selasky2015-10-291-0/+142
- Move all files related to the LinuxKPI into sys/compat/linuxkpi and its subfolders. - Update sys/conf/files and some Makefiles to use new file locations. - Added description of COMPAT_LINUXKPI to sys/conf/NOTES which in turn adds the LinuxKPI to all LINT builds. - The LinuxKPI can be added to the kernel by setting the COMPAT_LINUXKPI option. The OFED kernel option no longer builds the LinuxKPI into the kernel. This was done to keep the build rules for the LinuxKPI in sys/conf/files simple. - Extend the LinuxKPI module to include support for USB by moving the Linux USB compat from usb.ko to linuxkpi.ko. - Bump the FreeBSD_version. - A universe kernel build has been done. Reviewed by: np @ (cxgb and cxgbe related changes only) Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=290135