aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/dpaa
Commit message (Collapse)AuthorAgeFilesLines
* Replace calls to bus_generic_attach with bus_attach_childrenJohn Baldwin2024-12-063-3/+6
| | | | | Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47675
* net: Remove unneeded NULL check for the allocated ifnetZhenlei Huang2024-06-281-6/+0
| | | | | | | | | | | Change 4787572d0580 made if_alloc_domain() never fail, then also do the wrappers if_alloc(), if_alloc_dev(), and if_gethandle(). No functional change intended. Reviewed by: kp, imp, glebius, stevek MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D45740
* dpaa: uma_zcreate() does not failMark Johnston2024-04-241-4/+0
| | | | | | No functional change intended. MFC after: 1 week
* new-bus: Remove the 'rid' and 'type' arguments from BUS_RELEASE_RESOURCEJohn Baldwin2024-03-132-8/+7
| | | | | | | | | | 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-132-5/+4
| | | | | | | | | | 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
* sys: Set the type of allocated bus resourcesJohn Baldwin2024-03-131-0/+1
| | | | | | | | Use rman_set_type to set the type of allocated resources everywhere rman_set_rid is currently called. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D44123
* sys: Automated cleanup of cdefs and other formattingWarner Losh2023-11-2714-14/+5
| | | | | | | | | | | | | | | | 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
* dtsec(4): Restore IFCAP_JUMBO_MTU lost in IfAPI conversionJustin Hibbits2023-09-021-0/+1
| | | | | | | Also add IFCAP_VLAN_MTU, since it's supported. Fixes: 0083fc5c7 ("Mechanically convert dtsec(4) to IfAPI") MFC after: 1 week
* dtsec: Support multicast receive.Justin Hibbits2023-08-261-1/+32
| | | | | | | | Implemented based on the tsec(4) multicast support. This is the minimum required to support VLANs. The hardware does support vlan tagging, among other acceleration features, which will be added at a later time. MFC after: 2 weeks
* sys: Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-1614-28/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* sys: Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-167-14/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* dtsec: Complete mechanical conversion to IfAPIJustin Hibbits2023-03-113-12/+12
| | | | | | Some changes were missed in 0083fc5c76. Sponsored by: Juniper Networks, Inc.
* mi_switch(): clean up switch types and their usageMitchell Horne2023-02-092-4/+2
| | | | | | | | | | | | | | | | | | | Overall, this is a non-functional change, except for kernels built with SCHED_STATS. However, the switch types are useful for communicating the intent of the caller. 1. Ensure that every caller provides a type. In most cases, we upgrade the basic yield to sched_relinquish() aka SWT_RELINQUISH. 2. The case of sched_bind() is distinct, so add a new switch type SWT_BIND. 3. Remove the two unused types, SWT_PREEMPT and SWT_SLEEPQTIMO. 4. Remove SWT_NONE altogether and assert that callers always provide a type flag. 5. Reference the mi_switch(9) man page in the comments, as these flags will be documented there. Reviewed by: kib, markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D38184
* Mechanically convert dtsec(4) to IfAPIJustin Hibbits2023-01-242-25/+24
| | | | | Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D37815
* dpaa: Don't assume the MDIO is on the same fman as the MACJustin Hibbits2022-11-282-31/+17
| | | | | The P5040 has the MDIO for FMAN2 on FMAN1 for some reason. Instead of trying to manually find the MDIO, use a real xref.
* dpaa: Don't probe disabled devicesJustin Hibbits2022-11-272-0/+6
| | | | Probing disabled devices just adds noise.
* dpaa: Use BUS_PASS_SUPPORTDEV for pqmdioJustin Hibbits2022-11-261-1/+1
| | | | | | | | BUS_PASS_SUPPORTDEV is semantically better than BUS_PASS_RESOURCE, since it's a support device for dtsec, so only needs probed before dtsec, not before interrupts. Suggested by: manu
* dpaa: Probe and attach pqmdio at BUS_PASS_RESOURCEJustin Hibbits2022-11-261-1/+2
| | | | | Avoid the fragile nature of depending on ordering of the devices in the FDT by forcing the MDIO driver to precede the DTSEC driver.
* dpaa: Account for MDIO device not being foundJustin Hibbits2022-11-261-0/+3
| | | | | | | | | It's possible the MDIO device hasn't been and attached, or is incorrect in the device tree so can't probe and attach. In this case, ofw_bus_find_child_device_by_phandle() will fail, and return NULL. Return an error from find_mdio() here to prevent the MAC from attaching, rather than worry about a NULL pointer dereference later on when accessing the PHY.
* dpaa: Go to cleanup exit point on fman attach errorJustin Hibbits2022-11-061-1/+1
| | | | | | | | | If fman_init() fails it can leave things in a state where it cannot attach at all in the future, because it would simply exit without tearing down everything that was already set up. Go to the exit point to clean up on error instead, so that it can try again later. MFC after: 1 week
* dpaa: Remove unused devclass arguments to DRIVER_MODULE.John Baldwin2022-05-105-18/+9
|
* dpaa bman: Remove unused bman_devclass.John Baldwin2022-05-101-2/+0
|
* Remove unused miibus_devclass and miibus_fdt_devclass.John Baldwin2022-05-062-2/+2
|
* dpaa: Remove unused variables.John Baldwin2022-04-132-4/+0
|
* [PowerPC] [Book-E] Remove obsolete interrupt binding workaroundBrandon Bergren2020-02-251-7/+0
| | | | | | | | | | | | | | | | | | Remove an old workaround that is no longer necessary since rS343824. There used to be a problem with FMan interrupts firing on multiple CPUS at the same time. This ended up being due to multicast interrupts being unsupported in the Freescale PIC (so instead of using a selection algorithm, it would do some unspecified action, such as interrupting multiple cpus at random.) Reviewed by: jhibbits Sponsored by: Tag1 Consulting, Inc. Differential Revision: https://reviews.freebsd.org/D23829 Notes: svn path=/head/; revision=358322
* [PowerPC] [Book-E] Fix dpaa interrupt binding.Brandon Bergren2020-02-251-2/+1
| | | | | | | | | | | | | | | | | | | | | | After the network epoch was added, we lost the ability to migrate the ithread in the middle of dispatch, as being in the network epoch will pin the current thread (for safety reasons.) Luckily, we don't actually have to do this workaround in the first place, as we can just bind it to the correct cpu when we preallocate it. Pass dev through to XX_PreallocAndBindIntr() and actually bind it to the cpu like it was supposed to in the first place, instad of leaving it floating and moving it to the correct cpu the first time it fires. This fixes panics while bringing up dtsec on my X5000. Reviewed by: jhibbits Sponsored by: Tag1 Consulting, Inc. Differential Revision: https://reviews.freebsd.org/D23826 Notes: svn path=/head/; revision=358307
* Although most of the NIC drivers are epoch ready, due to peer pressureGleb Smirnoff2020-02-241-1/+1
| | | | | | | | | | | | | | | | | | | switch over to opt-in instead of opt-out for epoch. Instead of IFF_NEEDSEPOCH, provide IFF_KNOWSEPOCH. If driver marks itself with IFF_KNOWSEPOCH, then ether_input() would not enter epoch when processing its packets. Now this will create recursive entrance in epoch in >90% network drivers, but will guarantee safeness of the transition. Mark several tested drivers as IFF_KNOWSEPOCH. Reviewed by: hselasky, jeff, bz, gallatin Differential Revision: https://reviews.freebsd.org/D23674 Notes: svn path=/head/; revision=358301
* Introduce flag IFF_NEEDSEPOCH that marks Ethernet interfaces thatGleb Smirnoff2020-01-231-1/+1
| | | | | | | | | | | supposedly may call into ether_input() without network epoch. They all need to be reviewed before 13.0-RELEASE. Some may need be fixed. The flag is not planned to be used in the kernel for a long time. Notes: svn path=/head/; revision=357010
* schedlock 4/4Jeff Roberson2019-12-152-4/+2
| | | | | | | | | | | | | | | | | | | | | Don't hold the scheduler lock while doing context switches. Instead we unlock after selecting the new thread and switch within a spinlock section leaving interrupts and preemption disabled to prevent local concurrency. This means that mi_switch() is entered with the thread locked but returns without. This dramatically simplifies scheduler locking because we will not hold the schedlock while spinning on blocked lock in switch. This change has not been made to 4BSD but in principle it would be more straightforward. Discussed with: markj Reviewed by: kib Tested by: pho Differential Revision: https://reviews.freebsd.org/D22778 Notes: svn path=/head/; revision=355784
* dpaa: Fix warnings in dtsec(4) found by clangJustin Hibbits2019-08-211-2/+2
| | | | | | | These are all trivial warnings that have no real functional change. Notes: svn path=/head/; revision=351322
* dpaa: Mark BMan and QMan as earlier driver modulesJustin Hibbits2018-10-232-2/+4
| | | | | | | | | | | The BMan softc must exist when dtsec devices are created, else a NULL pointer is dereferenced. QMan likely as well. Until now, we have relied on order within the fdt parsing to attach correctly, but this obviously is not foolproof. Mark these as BUS_PASS_SUPPORTDEV so they're probed and attached explicitly before dtsec devices. Notes: svn path=/head/; revision=339632
* Align OF_getencprop_alloc API with OF_getencprop and OF_getprop_allocOleksandr Tymoshenko2018-04-091-1/+1
| | | | | | | | | | | | | | | | | | | | | Change OF_getencprop_alloc semantics to be combination of malloc and OF_getencprop and return size of the property, not number of elements allocated. For the use cases where number of elements is preferred introduce OF_getencprop_alloc_multi helper function that copies semantics of OF_getencprop_alloc prior to this change. This is to make OF_getencprop_alloc and OF_getencprop_alloc_multi function signatures consistent with OF_getencprop_alloc and OF_getencprop_alloc_multi. Functionality-wise this patch is mostly rename of OF_getencprop_alloc to OF_getencprop_alloc_multi except two calls in ofw_bus_setup_iinfo where 1 was used as a block size. Notes: svn path=/head/; revision=332341
* Allow bman-portals and qman-portals to attach to simple-busJustin Hibbits2017-12-142-7/+25
| | | | | | | | | Official Linux dts's put the individual portals under a simple-bus, rather than under a '*-portals' grouping. This adds a hack to permit that, which gets us closer to using stock device trees for DPAA-based devices. Notes: svn path=/head/; revision=326840
* Eliminate 1 XX_VirtToPhys() and 2 XX_PhysToVirt() calls from if_dtsec(4)Justin Hibbits2017-11-201-6/+6
| | | | | | | | | | | XX_VirtToPhys(), by way of pmap_kextract(), is an expensive operation. Profiling via dtrace during a series of iperf tests I found 16111 / 30432 stack frames were located in mmu_booke_kextract(), so eliminating this expensive call should improve performance slightly. XX_PhysToVirt() is not as expensive, but redundant calls in this context is wasteful. Notes: svn path=/head/; revision=326004
* Add jumbo frame support to dtsec(4)Justin Hibbits2017-11-171-1/+29
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=325927
* Fix interrupt handling for dtsecJustin Hibbits2017-11-023-4/+7
| | | | | | | | | | The macId is the dTSEC unit within the FMan, so use the cell-index, not the unit number, which may not match the cell index. MFC after: 1 week Notes: svn path=/head/; revision=325305
* Remove a singleton in the DPAA driver, to allow multiple fman instancesJustin Hibbits2017-11-014-37/+18
| | | | | | | | | | Some devices (P5040, P4080) have multiple frame managers in their DPAA subsystems. This was prevented by use of a softc singleton in the DPAA driver. Since if_dtsec(4) has moved to be a child of fman, it can access the fman device data via the parent object. Notes: svn path=/head/; revision=325255
* Make DPAA work in 64-bit modeJustin Hibbits2017-10-317-11/+205
| | | | | | | | | | Rework the dTSEC and FMan drivers to be more like a full bus relationship, so that dtsec can use bus_alloc_resource() instead of trying to handle the offset from the dts. This required taking some code from the sparc64 ebus driver to allow subdividing the fman region for the dTSEC devices. Notes: svn path=/head/; revision=325204
* Update DPAA SDK to SDK 2.0Justin Hibbits2017-10-308-10/+14
| | | | | | | | | | | | | This adds some support for ARM as well as 64-bit. 64-bit on PowerPC is currently not working, and ARM support has not been completed or tested on the FreeBSD side. As this was imported from a Linux tree, it includes some Linux-isms (ioread/iowrite), so compile with the LinuxKPI for now. This may change in the future. Notes: svn path=/head/; revision=325118
* Fix build after r324446.Gleb Smirnoff2017-10-121-1/+1
| | | | Notes: svn path=/head/; revision=324569
* Shorten list of arguments to mbuf external storage freeing function.Gleb Smirnoff2017-10-091-2/+4
| | | | | | | | | | | | | | | | | | | | All of these arguments are stored in m_ext, so there is no reason to pass them in the argument list. Not all functions need the second argument, some don't even need the first one. The second argument lives in next cache line, so not dereferencing it is a performance gain. This was discovered in sendfile(2), which will be covered by next commits. The second goal of this commit is to bring even more flexibility to m_ext mbufs, allowing to create more fields in m_ext, opaque to the generic mbuf code, and potentially set and dereferenced by subsystems. Reviewed by: gallatin, kbowling Differential Revision: https://reviews.freebsd.org/D12615 Notes: svn path=/head/; revision=324446
* Use UMA_ALIGN_PTR to specify pointer alignmentJustin Hibbits2017-05-121-1/+1
| | | | | | | Suggested by: jhb Notes: svn path=/head/; revision=318209
* Fix uma_zcreate() align argument, now that the constraint is asserted.Justin Hibbits2017-05-111-2/+2
| | | | | | | | The alignment argument is the mask of low bits to mask off when allocating items in a zone, not the block-size alignment. Notes: svn path=/head/; revision=318171
* Simplify the page tracking for VA<->PA translations.Justin Hibbits2016-11-163-5/+0
| | | | | | | | | | Drop the tracking down to the pmap layer, with optimizations to only track necessary pages. This should give a (slight) performance improvement, as well as a stability improvement, as the tracking is already mostly handled by the pmap layer. Notes: svn path=/head/; revision=308718
* Make dpaa work with only slightly modified Linux device trees.Justin Hibbits2016-11-128-238/+137
| | | | | | | | | | | | | | | | | Linux has a slightly different device tree definition for DPAA than originally done in the FreeBSD driver. This changes the driver to be mostly compatible with the Linux device tree definitions. Currently the differences are: bman-portals: compatible = "fsl,bman-portals" (Linux is "simple-bus") qman-portals: compatible = "fsl,qman-portals" (Linux is "simple-bus") fman: compatible = "fsl,fman" (Linux is "simple-bus") The Linux device tree doesn't specify anything for rgmii in the mdio. This change still requires the device tree to specify the phy-handle, and doesn't yet support tbi. Notes: svn path=/head/; revision=308584
* Use ofw_bus_node_is_compatible() instead of fdt_is_compatible()Justin Hibbits2016-11-113-11/+8
| | | | | | | | | | No need to have two functions that do the same thing, let's let fdt_* go away, and use ofw_bus_* equivalents instead. Requested by: andrew Notes: svn path=/head/; revision=308536
* Use the correct name for the qm_portals class.Justin Hibbits2016-10-231-5/+5
| | | | | | | This file was copy&pasted from bman_fdt, and it still shows. Notes: svn path=/head/; revision=307830
* Initialize the ofw_bus_devinfo on the portals to prevent a crash.Justin Hibbits2016-10-222-2/+2
| | | | | | | | | | If the device tree doesn't contain a cpu-handle field in any bman-portal or qman-portal, it will exit without setting up the devinfo, leaving it uninitialized. This will lead to attempts to free random memory, and ultimately panic. Notes: svn path=/head/; revision=307763
* Remove a hack requiring dtsec0 to always be enabled for mdio.Justin Hibbits2016-10-217-71/+282
| | | | | | | | | | | | | | | | | | | Instead replace it with a different hack, that turns fman into a simplebus subclass, and maps its children within its address space. Since all PHY communication is done through dtsec0's mdio space, the FDT contains a reference to the dtsec0 mdio handle in all nodes that need it. Instead of using Freescale's implementation for MII access, use our own (copied loosely from the eTSEC driver, and could possibly be merged eventually). This lets us access the registers directly rather than needing a full dtsec interface just to access the registers. Future directions will include turning fman into more of a simplebus, and not mapping the region and playing games. This will require changes to the dtsec driver to make it a child of fman, and possibly other drivers as well. Notes: svn path=/head/; revision=307696
* Remove an unnecessary debug printf.Justin Hibbits2016-10-211-1/+0
| | | | Notes: svn path=/head/; revision=307695