aboutsummaryrefslogtreecommitdiff
path: root/sys/arm/nvidia
Commit message (Collapse)AuthorAgeFilesLines
* arm/nvidia/tegra: Fix a couple of typos in kernel messagesGordon Bergling2025-10-284-6/+6
| | | | | | | | | - s/intialization/initialization/ - s/Cannott/Cannot/ - s/ivalid/invalid/ - s/wating/waiting/ MFC after: 1 week
* gpio: implement bus_setup_intr and bus_teardown_intrAhmad Khalifa2025-09-301-0/+4
| | | | | | | | | | | Implement bus_setup_intr and bus_teardown_intr as bus_generic_setup_intr and bus_generic_teardown_intr respectively for GPIO drivers that support interrupts. This allows children to setup interrupts. Reported by: Evgenii Ivanov <devivanov@proton.me> Reviewed by: imp MFC after: 1 day Differential Revision: https://reviews.freebsd.org/D52197
* gpio: remove gpiobus_attach_busAhmad Khalifa2025-08-131-1/+2
| | | | | | | | | | | | Since gpiobus_attach_bus can attach the gpiobus child along with its children in the same bus pass, the parent controller's reference to gpiobus might not be set by the time the children need it. Instead, drivers should use gpiobus_add_bus and explicitly call bus_attach_children. Reviewed by: mmel, imp (older version) Approved by: imp (mentor) Differential Revision: https://reviews.freebsd.org/D51578
* gpio: attach gpiobus when the controller is readyAhmad Khalifa2025-07-041-1/+1
| | | | | | | | | | Only attach gpiobus when the controller is fully initialized. Children of gpiobus expect this to be the case. Reviewed by: mmel, imp, andrew Approved by: imp (mentor) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D51088
* gpio: remove redundant calls to bus_attach_childrenAhmad Khalifa2025-07-041-1/+0
| | | | | | | | | gpiobus_attach_bus already calls it. Reviewed by: mmel, imp, andrew Approved by: imp (mentor) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D51108
* newbus: replace leftover device unit wildcardsAhmad Khalifa2025-06-212-4/+4
| | | | | | Reviewed by: imp, jhb Approved by: imp (mentor) Differential Revision: https://reviews.freebsd.org/D50913
* vm_page: make iter_insert() publicDoug Moore2025-05-091-1/+3
| | | | | | | | | In places where vm_page_insert() is used after lookups, or for consecutive pages, use vm_page_iter_insert instead, to exploit locality. Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D50248
* sys: Reduce where we include sys/devmap.hAndrew Turner2025-05-021-1/+0
| | | | | | | | These files don't use it, we can stop including sys/devmap.h. Reviewed by: mhorne Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D50017
* drm2 tegra: Use vm_radix_iter_lookup instead of vm_page_iter_lookupJohn Baldwin2025-03-031-1/+2
| | | | Fixes: 991dbf9f4327 ("vm_page: drop page_iter_lookup")
* Use bus_generic_detach instead of device_delete_children in detachJohn Baldwin2025-01-022-6/+10
| | | | | | | While here, check for errors from bus_generic_detach and move it to the start of detach if necessary. Differential Revision: https://reviews.freebsd.org/D47969
* Check for errors from bus_generic_detach in various driversJohn Baldwin2025-01-021-1/+5
| | | | | | | | In some cases, move the call to bus_generic_detach earlier so that any detach failures from child devices do not leave the parent device partially detached. Differential Revision: https://reviews.freebsd.org/D47966
* bus_generic_detach: Delete children after detaching themJohn Baldwin2025-01-021-2/+0
| | | | | | | | | | | | | | | | | This provides better semantics as a standalone DEVMETHOD for device_attach as bus drivers should remove child devices they created as part of detach cleanup. The implementation calls bus_detach_children() first to permit child devices an opportunity to veto the detach operation. If that succeeds, device_delete_children() is used to delete the child devices. This requires fixing various drivers that were deleting devices explicitly (via a device_t pointer cached in the softc) after calling bus_generic_detach to stop doing that and just rely on bus_generic_detach to remove child devices. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47959
* Use bus_detach_children instead of bus_generic_detachJohn Baldwin2025-01-021-1/+1
| | | | | | | These drivers perform additional teardown steps in between detaching child devices and deleting child devices. Differential Revision: https://reviews.freebsd.org/D47957
* vm_page: pass page to iter_removeDoug Moore2024-12-081-1/+1
| | | | | | | | | Pass the to-be-freed page to vm_page_iter_remove as a parameter, rather than computing it from the iterator parameter, to improve performance. Reviewed by: alc Differential Revision: https://reviews.freebsd.org/D47730
* Replace calls to bus_generic_attach with bus_attach_childrenJohn Baldwin2024-12-0613-13/+25
| | | | | Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47675
* Replace calls to bus_generic_probe with bus_identify_childrenJohn Baldwin2024-12-061-1/+1
| | | | | Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47674
* drm2: Fix the build after commit 38e3125d6df9Mark Johnston2024-11-261-2/+2
| | | | Fixes: 38e3125d6df9 ("device_pager: user iterators to free device pages")
* device_pager: user iterators to free device pagesDoug Moore2024-11-211-2/+4
| | | | | | | | | | | Change cdev_mgtdev_page_free_page to take an iterator, rather than an object and page, so that removing the page from the object radix tree can take advantage of locality with iterators. Define a general-purpose function to free all pages, which can be used in several places. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D47692
* Check for errors when detaching children first, not lastJohn Baldwin2024-11-059-9/+55
| | | | | | | | | | | | These detach routines in these drivers all ended with 'return (bus_generic_detach())' meaning that if any child device failed to detach, the parent driver was left in a mostly destroyed state, but still marked attached. Instead, bus drivers should detach child drivers first and return errors before destroying driver state in the parent. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47387
* newbus: Introduce bus_get_pass() and hide bus_current_passElliott Mitchell2024-11-021-1/+1
| | | | | | | | | There's no reason to write to bus_current_pass outside of the controlled times subr_bus.c does it, so move to an accessor and make bus_current_pass private to newbus. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1457
* dev_pager: define free_page for mgt devicesDoug Moore2024-08-211-1/+1
| | | | | | | | | Callers of cdev_pager_free_page in the kernel always have object->type == OBJT_MGTDEVICE. Define a function for them to call that skips the runtime type check in cdev_pager_free. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D46389
* newbus: globally replace device_add_child(..., -1) with DEVICE_UNIT_ANYWarner Losh2024-07-254-4/+4
| | | | Sponsored by: Netflix
* vm: Retire kmem_arenaAlan Cox2024-07-241-2/+2
| | | | | | | | | It has simply been an alias for the kernel_arena for many years now. Enough time has passed to retire it. Any out-of-tree kernel modules that directly use kmem_arena should switch to kernel_arena. Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D46057
* arm: Convert drivers to use device_set_desc(f)()Mark Johnston2024-06-021-1/+1
| | | | | | No functional change intended. MFC after: 1 week
* uart(4): Honor hardware state of NS8250-class for tsw_busyMarius Strobl2024-01-141-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | In 9750d9e5, I brought the equivalent of the TS_BUSY flag back in a mostly hardware-agnostic way in order to fix tty_drain() and, thus, TIOCDRAIN for UARTs with TX FIFOs. This proved to be sufficient for fixing the regression reported. So in light of the release cycle of FreeBSD 10.3, I decided that this change was be good enough for the time being and opted to go with the smallest possible yet generic (for all UARTs driven by uart(4)) solution addressing the problem at hand. However, at least for the NS8250-class the above isn't a complete fix as these UARTs only trigger an interrupt when the TX FIFO became empty. At this point, there still can be an outstanding character left in the transmit shift register as indicated via the LSR. Thus, this change adds the 3rd (besides the tty(4) and generic uart(4) bits) part I had in my tree ever since, adding a uart_txbusy method to be queried in addition for tsw_busy and hooking it up as appropriate for the NS8250-class. As it turns out, the exact equivalent of this 3rd part later on was implemented for uftdi(4) in 9ad221a5. While at it, explain the rational behind the deliberately missing locking in uart_tty_busy() (also applying to the generic sc_txbusy testing already present).
* phy: Move phy code in dev/phyEmmanuel Vadot2024-01-106-6/+6
| | | | | | | | | | | We've removed kernel option EXT_RESOURCES almost two years ago. While it was ok to have some code under a common 'extres' subdirectory at first, we now have a lot of consumer of it and we made it mandatory so no need to have it under a cryptic name. Reviewed by: emaste, imp Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D43195
* regulator: Move regulator code in dev/regulatorEmmanuel Vadot2024-01-109-9/+9
| | | | | | | | | | | We've removed kernel option EXT_RESOURCES almost two years ago. While it was ok to have some code under a common 'extres' subdirectory at first, we now have a lot of consumer of it and we made it mandatory so no need to have it under a cryptic name. Reviewed by: emaste, imp Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D43194
* hwreset: Move reset code in dev/hwresetEmmanuel Vadot2024-01-1016-16/+16
| | | | | | | | | | | We've removed kernel option EXT_RESOURCES almost two years ago. While it was ok to have some code under a common 'extres' subdirectory at first, we now have a lot of consumer of it and we made it mandatory so no need to have it under a cryptic name. Reviewed by: imp Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D43192
* clk: Move clock code in dev/clkEmmanuel Vadot2024-01-1025-28/+28
| | | | | | | | | | | We've removed kernel option EXT_RESOURCES almost two years ago. While it was ok to have some code under a common 'extres' subdirectory at first, we now have a lot of consumer of it and we made it mandatory so no need to have it under a cryptic name. Reviewed by: mhorne Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D43191
* Avoid waiting on physical allocations that can't possibly be satisfiedJason A. Harmening2023-12-241-3/+6
| | | | | | | | | | | | | | | | | | | | | | | - Change vm_page_reclaim_contig[_domain] to return an errno instead of a boolean. 0 indicates a successful reclaim, ENOMEM indicates lack of available memory to reclaim, with any other error (currently only ERANGE) indicating that reclamation is impossible for the specified address range. Change all callers to only follow up with vm_page_wait* in the ENOMEM case. - Introduce vm_domainset_iter_ignore(), which marks the specified domain as unavailable for further use by the iterator. Use this function to ignore domains that can't possibly satisfy a physical allocation request. Since WAITOK allocations run the iterators repeatedly, this avoids the possibility of infinitely spinning in domain iteration if no available domain can satisfy the allocation request. PR: 274252 Reported by: kevans Tested by: kevans Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D42706
* sys: Automated cleanup of cdefs and other formattingWarner Losh2023-11-2720-20/+0
| | | | | | | | | | | | | | | | Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row. Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/ Sponsored by: Netflix
* arm: Add missing no-ctfconvert for fw_stub.awk targetJessica Clarke2023-08-221-1/+1
| | | | | | | | | | | | | This target produces a C file not an object file, so using ctfconvert on it should not be attempted. This keeps it in sync with all other uses of fw_stub.awk, squashes a warning seen during the build of TEGRA124 on FreeBSD and avoids the same issue failing the build on non-FreeBSD (such errors are #ifdef'ed into being warnings on FreeBSD in ctfconvert, which should be revisited in the future). Reviewed by: manu MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D41542
* sys: Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-165-5/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* sys: Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-1636-72/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* sys: Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-1610-20/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* Map arm64 pci config memory as non-postedAndrew Turner2023-03-051-2/+7
| | | | | | | | | | | On arm64 PCI config memory is expected to be mapped with a non-posted device type. To handle this use the new bus_map_resource support in arm64 to map memory with the new VM_MEMATTR_DEVICE_NP attribute. This memory has already been allocated and activated, it just needs to be mapped. Reviewed by: kevans, mmel Differential Revision: https://reviews.freebsd.org/D30079
* kmem_malloc/free: Use void * instead of vm_offset_t for kernel pointers.John Baldwin2022-09-224-8/+9
| | | | | | Reviewed by: kib, markj Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D36549
* tegra: Fix a typo in a source code commentGordon Bergling2022-06-041-1/+1
| | | | | | - s/Disble/Disable/ MFC after: 3 days
* arm/arm64 nvidia: Remove unused devclass arguments to DRIVER_MODULE.John Baldwin2022-05-0923-64/+30
|
* Remove unused uart_devclass.John Baldwin2022-05-061-2/+1
|
* Remove unused fbd_devclass.John Baldwin2022-05-061-2/+1
|
* Remove unused ahci_devclass.John Baldwin2022-05-061-2/+1
|
* as3722_gpio_pin_setflags: Use computed mode instead of hardcoded PUSHPULL.John Baldwin2022-04-181-1/+1
| | | | | Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D34855
* arm/arm64 nvidia: Remove unused variables.John Baldwin2022-04-0910-39/+5
|
* tegra: Fix a common typo in source code commentsGordon Bergling2022-02-061-1/+1
| | | | | | - s/ajusted/adjusted/ MFC after: 3 days
* tegra/ahci: do not advertise enclosure management facilityMichal Meloun2021-12-241-1/+0
| | | | | | It is not implemented in HW. MFC after: 1 week
* tegra124: Implement new get_gate method for tegra124 clocks.Michal Meloun2021-12-242-0/+34
| | | | MFC after: 1 week
* arm: fix a typo in nvidia/drm2/tegra_bo.cMateusz Guzik2021-10-251-1/+1
| | | | | | Unbreaks building TEGRA124 Sponsored by: Rubicon Communications, LLC ("Netgate")
* Convert consumers to vm_page_alloc_noobj_contig()Mark Johnston2021-10-201-8/+4
| | | | | | | | | Remove now-unneeded page zeroing. No functional change intended. Reviewed by: alc, hselasky, kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32006
* tegra_pcie: use switch instead of if in tegra_pcib_pex_ctrlFerhat Gecdogan2021-07-011-7/+6
| | | | | | | Simplify obtaining per-port data in tegra_pcib_pex_ctrl() routine. Reviewed by: imp, mw Pull Request: https://github.com/freebsd/freebsd-src/pull/481