aboutsummaryrefslogtreecommitdiff
path: root/sys/arm64/cavium
Commit message (Collapse)AuthorAgeFilesLines
* bus_alloc_resource: Pass rid by value to BUS_ALLOC_RESOURCE DEVMETHODJohn Baldwin2025-12-094-9/+9
| | | | | | | | | The wrapper functions such as bus_alloc_resource_any() still support passing the rid by value or pointer, but the underlying implementation now passes by value. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D53402
* newbus: replace leftover device unit wildcardsAhmad Khalifa2025-06-211-1/+1
| | | | | | Reviewed by: imp, jhb Approved by: imp (mentor) Differential Revision: https://reviews.freebsd.org/D50913
* Replace calls to bus_generic_attach with bus_attach_childrenJohn Baldwin2024-12-061-2/+2
| | | | | Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47675
* newbus: globally replace device_add_child(..., -1) with DEVICE_UNIT_ANYWarner Losh2024-07-251-1/+1
| | | | Sponsored by: Netflix
* Retire unused non-PCI_RES_BUS codeJessica Clarke2024-07-181-18/+0
| | | | | | | | All architectures define PCI_RES_BUS unconditionally now that only NEW_PCIB is supported, so we no longer need the legacy code. Reviewed by: jhb, andrew Differential Revision: https://reviews.freebsd.org/D32955
* Retire non-NEW_PCIB code and remove config optionJessica Clarke2024-07-181-9/+9
| | | | | | | | | | | All architectures enable NEW_PCIB in DEFAULTS (arm being the most recent to do so in 121be555997b (arm: Set NEW_PCIB in DEFAULTS rather than a subset of kernel configs")), so it's time we removed the legacy code that no longer sees much testing and has a significant maintenance burden. Reviewed by: jhb, andrew, emaste Differential Revision: https://reviews.freebsd.org/D32954
* cavium/thunder: Use device_set_desc()Mark Johnston2024-06-161-1/+1
| | | | | | No functional change intended. MFC after: 1 week
* new-bus: Remove the 'rid' and 'type' arguments from BUS_RELEASE_RESOURCEJohn Baldwin2024-03-132-16/+12
| | | | | | | | | | The public bus_release_resource() API still accepts both forms, but the internal kobj method no longer passes the arguments. Implementations which need the rid or type now use rman_get_rid() or rman_get_type() to fetch the value from the allocated resource. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D44131
* new-bus: Remove the 'rid' and 'type' arguments from BUS_*ACTIVATE_RESOURCEJohn Baldwin2024-03-131-18/+12
| | | | | | | | | | The public bus_activate/deactivate_resource() API still accepts both forms, but the internal kobj methods no longer pass the arguments. Implementations which need the rid or type now use rman_get_rid() or rman_get_type() to fetch the value from the allocated resource. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D44130
* new-bus: Remove the 'type' argument from BUS_MAP/UNMAP_RESOURCEJohn Baldwin2024-03-131-10/+9
| | | | | | | | | | The public bus_map/unmap_resource() API still accepts both forms, but the internal kobj methods no longer pass the argument. Implementations which need the type now use rman_get_type() to fetch the value from the allocated resource. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D44129
* new-bus: Remove the 'type' argument from BUS_ADJUST_RESOURCEJohn Baldwin2024-03-131-8/+8
| | | | | | | | | | The public bus_adjust_resource() API still accepts both forms, but the internal kobj method no longer passes the argument. Implementations which need the type now use rman_get_type() to fetch the value from the allocated resource. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D44128
* arm64 thunder: Use bus_generic_rman_* in the pcie_pem driverJohn Baldwin2024-01-231-82/+124
| | | | | | | | | | | - Implement bus_map/unmap_resource pulling bits from the previous thunder_pem_activate/deactivate_resource. - Use bus_generic_rman_* in various routines for memory and I/O port resources. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43439
* sys: Automated cleanup of cdefs and other formattingWarner Losh2023-11-271-1/+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
* sys: Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-164-8/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* sys: Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-162-4/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* arm64: fix the LINT-ACPI buildKyle Evans2023-03-071-0/+2
| | | | | | This file uses VM_MEMATTR_DEVICE_NP, which it gets through header pollution somewhere with FDT enabled. Pull in vm/vm.h to make it explicit.
* Map arm64 pci config memory as non-postedAndrew Turner2023-03-051-1/+12
| | | | | | | | | | | 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
* Add fdt to name of a fdt specific functionAndrew Turner2022-05-231-1/+1
| | | | | | | Rename pci_host_generic_attach to pci_host_generic_fdt_attach to be consistant with the acpi attachment. Sponsored by: The FreeBSD Foundation
* arm64 cavium: Remove unused devclass arguments to DRIVER_MODULE.John Baldwin2022-05-093-14/+5
|
* Remove "All Rights Reserved" from FreeBSD Foundation sys/ copyrightsEd Maste2021-08-083-3/+0
| | | | | | | These ones were unambiguous cases where the Foundation was the only listed copyright holder (in the associated license block). Sponsored by: The FreeBSD Foundation
* Remove ThunderX PCIe FDT quirks from pci_host_generic_fdt.cMarcin Wojtas2021-06-081-8/+156
| | | | | | | | | | | ThunderX is the only board known to use them. Move them to the ThunderX PCIe driver. Submitted by: Kornel Duleba <mindal@semihalf.com> Reviewed by: andrew Obtained from: Semihalf Sponsored by: Alstom Group Differential Revision: https://reviews.freebsd.org/D30179
* arm64: clean up empty lines in .c and .h filesMateusz Guzik2020-09-013-4/+0
| | | | Notes: svn path=/head/; revision=365069
* Rename the ThunderX CPU identification macros to include the X. This is theAndrew Turner2018-06-132-2/+2
| | | | | | | | | | name people know the product by, and is consistent with the later SoC ID macros. Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=335052
* If ofw_bus_msimap fails don't try to use the invalid MSI/MSI-X parent node.Andrew Turner2017-03-161-11/+29
| | | | | | | Sponsored by: ABT Systems Ltd Notes: svn path=/head/; revision=315421
* Fix the alloc function the ThunderX PCIe driver calls, the previousAndrew Turner2016-11-301-2/+2
| | | | | | | | | | function may not exist when FDT is removed from the kernel. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=309327
* To allow for an ACPI attachment to the generic PCIe driver split off theAndrew Turner2016-11-212-4/+8
| | | | | | | | | | | | | | | | FDT attachment to a new file. A separate ACPI attachment will then be added to allow arm64 servers with ACPI to use it over FDT. This should also help with merging this with the ofwpci driver, with further work needed to remove restrictions this driver places on resource allocation. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D7319 Notes: svn path=/head/; revision=308931
* Remove the non-INTRNG support from the ThunderX PCIe drivers.Andrew Turner2016-07-141-39/+0
| | | | | | | | | Obtained from: ABT Systems Ltd MFC after: 1 month Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=302852
* Mark the ThunderX and generic PCI drivers as cache-coherent when we knowAndrew Turner2016-05-313-0/+29
| | | | | | | | | | | | this to be the case. This will mean we don't try and handle the cache in bus_dmamap_sync when it is not needed. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D6605 Notes: svn path=/head/; revision=301031
* Handle PCI_RES_BUS on the generic and ThunderX PCIe drivers. This has beenAndrew Turner2016-05-201-0/+14
| | | | | | | | | | | | tested on the Pass 1.1 and 2.0 ThunderX machines in the Netperf cluster. Reviewed by: jhb Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D6453 Notes: svn path=/head/; revision=300290
* Teach the ThunderX PCI PEM driver about intrng. This will be used laterAndrew Turner2016-05-161-0/+55
| | | | | | | | | | when arm64 is supported by intrng. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=299934
* Add a pcib interface for use by interrupt controllers that need toAndrew Turner2016-05-163-0/+92
| | | | | | | | | | | | | translate the pci rid to a controller ID. The translation could be based on the 'msi-map' OFW property, a similar ACPI option, or hard-coded for hardware lacking the above options. Reviewed by: wma Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=299932
* Push the logic to talk with the MSI/MSI-X interrupt controller to the FDTAndrew Turner2016-05-102-11/+76
| | | | | | | | | | | attachment. This is where it will live when we import intrng as it will need to look at either the msi-parent or msi-map FDT properties. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=299370
* Group the ThunderX PCIe PEM newbus methods to help find them.Andrew Turner2016-04-201-3/+6
| | | | | | | | Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=298344
* Pull out the MSI/MSI-X handling calls to simplify future intrngAndrew Turner2016-04-201-5/+48
| | | | | | | | | | integration. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=298343
* Cleanup unnecessary semicolons from the kernel.Pedro F. Giffuni2016-04-101-1/+1
| | | | | | | Found with devel/coccinelle. Notes: svn path=/head/; revision=297793
* Improve ThunderX PEM driver to work on pass2 revisionWojciech Macek2016-03-023-44/+200
| | | | | | | | | | | | | | | | | | | Things changed: * do not allocate 4GB of SLI space, because it's the waste of system resources. Allocate only small portions when needed. * provide own implementation of activate_resource which performs address translation between PCI bus and host PA address space. This is temporary solution, should be replaced by bus_map_resource once implemented. Obtained from: Semihalf Sponsored by: Cavium Approved by: cognet (mentor) Reviewed by: jhb Differential revision: https://reviews.freebsd.org/D5294 Notes: svn path=/head/; revision=296307
* Restore ThunderX Pass1.1 PCI changes removed by r295962Wojciech Macek2016-02-263-1/+67
| | | | | | | | | | | | | | | | If Enhanced Allocation is not used, we can't allocate any random range. All internal devices have hardcoded place where they can be located within PCI address space. Fortunately, we can read this value from BAR. Obtained from: Semihalf Sponsored by: Cavium Approved by: cognet (mentor) Reviewed by: zbb Differential revision: https://reviews.freebsd.org/D5455 Notes: svn path=/head/; revision=296091
* Make pci_host_generic and thunderx_pci commonWojciech Macek2016-02-247-746/+68
| | | | | | | | | | | | | | | * provided OFW interface for pci_host_generic (for handling devices which are present in DTS under the PCI node) * removed support for internal PCI from arm64/cavium * cleaned up and made most of the code common Obtained from: Semihalf Sponsored by: Cavium Approved by: cognet (mentor) Reviewed by: zbb Differential revision: https://reviews.freebsd.org/D5261 Notes: svn path=/head/; revision=295962
* Introduce a RMAN_IS_DEFAULT_RANGE() macro, and use it.Justin Hibbits2016-02-203-3/+3
| | | | | | | | | | | | | | This simplifies checking for default resource range for bus_alloc_resource(), and improves readability. This is part of, and related to, the migration of rman_res_t from u_long to uintmax_t. Discussed with: jhb Suggested by: marcel Notes: svn path=/head/; revision=295832
* Support PEM that is not a PCI endpoint on ThunderXZbigniew Bodek2016-02-164-29/+164
| | | | | | | | | | | | | | Some chip revisions don't have their external PCIe buses behind the internal bridge. Add support for FDT-configurable PEMs but keep ability for PCIe enumeration. Reviewed by: andrew, wma Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D5285 Notes: svn path=/head/; revision=295656
* Fix VNIC enumeration after r294993 and r294990Zbigniew Bodek2016-01-281-2/+2
| | | | | | | | | | | | | ofw_bus_get_node() must be tested against negative values since missing parent bus method will result in calling the default method which simply returns (-1): sys/dev/ofw/ofw_bus_if.m This was lost in the review process. Obtained from: Semihalf Sponsored by: Cavium Notes: svn path=/head/; revision=294998
* Add FDT bus capabilities to ThunderX PCI driverZbigniew Bodek2016-01-284-15/+185
| | | | | | | | | | | | | | New ThunderX firmware incorporates modified DTB that presents different device hierarchy. In the new device tree, MDIO devices are below two additional buses that oddly hang on PCI bridge. Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D5069 Notes: svn path=/head/; revision=294993
* Correct alloc_ and release_resource methods in thunder_pcie driverZbigniew Bodek2016-01-281-2/+2
| | | | | | | | | | | | | | - Avoid using BUS_ macros as bus_generic_ functions should be used instead. - Fix mistaken device_t pointers in thunder_pcie_alloc_resource. Should use dev->parent method and allocate resource for child device Reviewed by: wma Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D5068 Notes: svn path=/head/; revision=294992
* Divide ThunderX PCIe driver to general and FDT partZbigniew Bodek2016-01-284-170/+236
| | | | | | | | | | | | | | - Separate FDT and general PCIe driver parts - Drop some irrelevant printfs that cannot be displayed in FDT attach - Move ranges parsing to FDT portion of PCIe code Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D5067 Notes: svn path=/head/; revision=294991
* Convert rman to use rman_res_t instead of u_longJustin Hibbits2016-01-272-6/+6
| | | | | | | | | | | | | | | | | | | | | | | Summary: Migrate to using the semi-opaque type rman_res_t to specify rman resources. For now, this is still compatible with u_long. This is step one in migrating rman to use uintmax_t for resources instead of u_long. Going forward, this could feasibly be used to specify architecture-specific definitions of resource ranges, rather than baking a specific integer type into the API. This change has been broken out to facilitate MFC'ing drivers back to 10 without breaking ABI. Reviewed By: jhb Sponsored by: Alex Perez/Inertial Computing Differential Revision: https://reviews.freebsd.org/D5075 Notes: svn path=/head/; revision=294883
* Update ThunderX PCIe driver to fit new DTS layoutZbigniew Bodek2016-01-184-12/+12
| | | | | | | | | | | | | In recent EFI the DTS entries changed for PCIe controller. This commit fixes internal PCIe, external is yet TBD. Submitted by: Dominik Ermel <der@semihalf.com> Obtained from: Semihalf Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D4976 Notes: svn path=/head/; revision=294266
* Reduce the numbers of levels of indirection in arm64 pcib drivers by makingAndrew Turner2015-12-103-58/+12
| | | | | | | | | | the MSI & MSI-X handler functions be directly callable from the driver methods. Sponsored by: ABT Systems Ltd Notes: svn path=/head/; revision=292062
* Add support for unspecified ranges on ThunderX systemZbigniew Bodek2015-10-251-3/+39
| | | | | | | | | | | | | | When one tries to allocate a resource with unspecified range, read already configured BAR values (by UEFI or whatever). This is necessary to make VNIC VFs working and to allow them to be properly allocated. Obtained from: Semihalf Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D3752 Notes: svn path=/head/; revision=289966
* arm64 ThunderX PCIe workaround: enumerate only one slot for nowEd Maste2015-09-221-0/+8
| | | | | | | | | | | Otherwise an em(4) NIC is detected 32 times. Submitted by: wma@semihalf.com Obtained from: Semihalf Differential Revision: https://reviews.freebsd.org/D3706 Notes: svn path=/head/; revision=288108
* Add support for external PCIe (PEM) on Cavium's ThunderXZbigniew Bodek2015-08-081-0/+637
| | | | | | | | | | Reviewed by: jhb Obtained from: Semihalf Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3257 Notes: svn path=/head/; revision=286477