aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/cadence
Commit message (Collapse)AuthorAgeFilesLines
* cgem: Cleanup detaching of child miibus deviceJohn Baldwin2025-01-021-6/+1
| | | | | | | Move bus_generic_detach earlier in place of the existing device_delete_child. Differential Revision: https://reviews.freebsd.org/D47964
* net: Remove unneeded NULL check for the allocated ifnetZhenlei Huang2024-06-281-5/+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
* clk: Move clock code in dev/clkEmmanuel Vadot2024-01-101-1/+1
| | | | | | | | | | | 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
* 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
* if_cgem: Rewrite clock partEmmanuel Vadot2023-09-181-32/+86
| | | | | | | | | | | | | - pclk and hclk are mandatory so always try to get them. Don't make it fatal if it fails as some platform (like Zynq) don't have a proper clock driver. - Always use pclk for the reference clock. - Try to get all the possible clocks and enable them. Reviewed-by: mhorne Tested-by: Milan Obuch <bsd@dino.sk> Differential Revision: https://reviews.freebsd.org/D41857 Sponsored by: Beckhoff Automation GmbH & Co. KG
* if_cgem: Cleanup compatible and add new onesEmmanuel Vadot2023-09-181-5/+4
| | | | | | | | | | | | | | | - Remove cdns,gem, it's the generic binding but for all platform that include this one we need specific drivers setup so remove it. - Remove cdns,macb, it's the generic binding for Atmel AT91 which we don't suport - Remove cadence,gem, it's not an official binding and seems to be only used in some obscure ARM11 SoC. - Note that the cdns,zynq* are deprecated - Add the new Xilinx compatible for zynq and zynqmp Reviewed-by: mhorne Tested-by: skibo, Milan Obuch <bsd@dino.sk> Differential Revision: https://reviews.freebsd.org/D41856 Sponsored by: Beckhoff Automation GmbH & Co. KG
* sys: Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-161-2/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* sys: Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-161-2/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-122-2/+2
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* cgem: Remove unused devclass argument to DRIVER_MODULE.John Baldwin2022-05-091-3/+1
|
* Remove unused miibus_devclass and miibus_fdt_devclass.John Baldwin2022-05-061-1/+1
|
* cgem: support SGMII PHY connection modeMilan Obuch2022-04-122-1/+15
| | | | | | | | | | | | | | | | | | As the PolarFire SoC needs SGMII to connect the PHY, check the 'phy-mode' property of device tree node for ethernet and act on it appropriately. Add the compatible strings for the PolarFire SoC device tree. 'microchip,mpfs-mss-gem" is not officially documented but has been observed in the available firmware for this platform, so it is included for now. Also, fix a typo in if_cgem_hw.h. Reviewed by: mhorne MFC after: 1 week Sponsored by: Conclusive Engineering Differential Revision: https://reviews.freebsd.org/D34764
* cgem: rework hardware quirk detectionMilan Obuch2022-04-121-18/+19
| | | | | | | | | | | Rather than doing these checks based on the detected hardware variant, allow quirks to be specified as a set of flags for each compatible string. This simplifies adding support for new compatible hardware. Reviewed by: mhorne MFC after: 1 week Sponsored by: Conclusive Engineering Differential Revision: https://reviews.freebsd.org/D34764
* if_cgem: Make ext_resources non-optionalEmmanuel Vadot2022-02-211-28/+0
| | | | | | | | EXT_RESOURCES have been introduced in 12-CURRENT and all supported releases have it enabled in their kernel config. MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D33825
* cgem: Add support for the SiFive FU740Jessica Clarke2021-07-211-4/+4
| | | | | | | | | | | | | Note that currently Linux's device tree uses the FU540's compatible string, as does upstream U-Boot, but the U-Boot shipped with the board based on an older patch series has the correct FU740 name. Thankfully they are the same, at least as far as software is concerned. Whilst here, fix a style(9) nit. Reviewed by: philip, kp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31034
* cgem: improve usage of busdma(9) KPIMitchell Horne2021-02-181-8/+4
| | | | | | | | | | | | | | | BUS_DMA_NOCACHE should only be used when one needs to guarantee the created mapping has uncached memory attributes, usually as a result of buggy hardware. Normal use cases should pass BUS_DMA_COHERENT, to create an appropriate mapping based on the flags passed to bus_dma_tag_create(). This should have no functional change, since the DMA tags in this driver are created without the BUS_DMA_COHERENT flag. Reported by: mmel Reviewed by: mmel, Thomas Skibo <thomas-bsd@skibo.net> MFC after: 3 days
* cgem: update 64-bit checkMitchell Horne2021-01-111-1/+1
| | | | | | | | | The cgem(4) driver was updated to support 64-bit bus addressing in facdd1cd2045. However, the committed version determines this in an un-idiomatic way. Change the compile-time conditional to check BUS_SPACE_MAXADDR, rather than comparing int and pointer sizes. Reported by: jrtc27
* cgem: add 64-bit supportThomas Skibo2021-01-102-109/+296
| | | | | | | | Add 64-bit address support to Cadence CGEM Ethernet driver for use in other SoCs such as the Zynq UltraScale+ and SiFive HighFive Unleashed. Reviewed by: philip, 0mp (manpages) Differential Revision: https://reviews.freebsd.org/D24304
* cadence: clean up empty lines in .c and .h filesMateusz Guzik2020-09-011-6/+0
| | | | Notes: svn path=/head/; revision=365212
* Cadence GEM ethernet driver style clean-up, no functional changes.Ian Lepore2020-04-022-451/+452
| | | | | | | | | | | | This is mostly indentation whitespace, and reflowing a few multiline comments. This gets a bunch of minor stuff out of the way so that the diffs for style don't clutter up the diffs for some upcoming functional changes. Submitted by: Thomas Skibo Differential Revision: https://reviews.freebsd.org/D24226 Notes: svn path=/head/; revision=359571
* Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)Pawel Biernacki2020-02-261-2/+2
| | | | | | | | | | | | | | | | | | | r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are still not MPSAFE (or already are but aren’t properly marked). Use it in preparation for a general review of all nodes. This is non-functional change that adds annotations to SYSCTL_NODE and SYSCTL_PROC nodes using one of the soon-to-be-required flags. Mark all obvious cases as MPSAFE. All entries that haven't been marked as MPSAFE before are by default marked as NEEDGIANT Approved by: kib (mentor, blanket) Commented by: kib, gallatin, melifaro Differential Revision: https://reviews.freebsd.org/D23718 Notes: svn path=/head/; revision=358333
* cgem: Add another compat string for the SiFive fu540Mitchell Horne2020-01-291-3/+4
| | | | | | | | | | Newer device trees use "sifive,fu540-c000-gem" instead of "cdns,macb". Reviewed by: br, kp Differential Revision: https://reviews.freebsd.org/D23407 Notes: svn path=/head/; revision=357256
* Convert to if_foreach_llmaddr() KPI.Gleb Smirnoff2019-10-211-33/+23
| | | | Notes: svn path=/head/; revision=353838
* Add support for Cadence network controller found in HiFive Unleashed board.Ruslan Bukin2019-04-241-1/+7
| | | | | | | | | Reviewed by: markj Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D19798 Notes: svn path=/head/; revision=346634
* kernel: Fix several typos and minor errorsEitan Adler2017-12-271-1/+1
| | | | | | | | | | | - duplicate words - typos - references to old versions of FreeBSD Reviewed by: imp, benno Notes: svn path=/head/; revision=327231
* sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-272-0/+4
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326255
* Refactor DTS files for Zynq-based SoCsOleksandr Tymoshenko2016-04-261-0/+3
| | | | | | | | | | | | | | - Factor out common part to zynq-7000.dtsi - Fix problem with Zynq interrupts by using interrupt "triples" in .dtsi file to differentiate between edge-triggered and level-triggered interrupts - cgem driver now recognizes "status" property Submitted by: Thomas Skibo <thomasskibo@yahoo.com> Differential Revision: https://reviews.freebsd.org/D6095 Notes: svn path=/head/; revision=298674
* Use the new ifnet API. Also, allocate bus_dma_maps as needed instead ofIan Lepore2015-03-091-97/+134
| | | | | | | | pre-allocating them all at start-up. Also fix a bug in cgem_stop(); before, it wasn't properly unloading dma maps due to a cut-and-paste error. Notes: svn path=/head/; revision=279828
* Mechanically convert to if_inc_counter().Gleb Smirnoff2014-09-191-8/+8
| | | | Notes: svn path=/head/; revision=271849
* Fixes and enhancements for the if_cgem driver...Ian Lepore2014-09-032-114/+515
| | | | | | | | | | | | | | | | | | | | | | - miibus fixes as suggested by Yonghyeon Pyun. - enable VLAN MTU support. - fix a few WITNESS complaints in cgem_attach(). - have cgem_attach() properly init the ifnet struct before calling mii_attach() to fix panic when using e1000phy. - fix ethernet address changing. - fix transmit queue overflow handling. - tweak receive queue handling to reduce receive overflows. - bring out MAC statistic counters to sysctls. - add e1000phy to config file. - implement receive hang work-around described in reference guide. - change device name from if_cgem to cgem to be consistent with other interfaces. Submitted by: Thomas Skibo <ThomasSkibo@sbcglobal.net> Reviewed by: wkoszek, Yonghyeon PYUN <pyunyh@gmail.com> Notes: svn path=/head/; revision=271046
* Fix the Zedboard/Zynq ethernet driver to handle media speed changes soIan Lepore2014-07-141-33/+71
| | | | | | | | | | | | | | | that it can connect to switches at speeds other than 1gb. This requires changing the reference clock speed. Since we still don't have a general clock API that lets a SoC-independant driver manipulate its own clocks, this change includes a weak reference to a routine named cgem_set_ref_clk(). The default implementation is a no-op; SoC-specific code can provide an implementation that actually changes the speed. Submitted by: Thomas Skibo <ThomasSkibo@sbcglobal.net> Notes: svn path=/head/; revision=268633
* Fix teardown of static DMA allocations in various NIC drivers:John Baldwin2014-06-171-4/+12
| | | | | | | | | | | | | | | | | - Add missing calls to bus_dmamap_unload() in et(4). - Check the bus address against 0 to decide when to call bus_dmamap_unload() instead of comparing the bus_dma map against NULL. - Check the virtual address against NULL to decide when to call bus_dmamem_free() instead of comparing the bus_dma map against NULL. - Don't clear bus_dma map pointers to NULL for static allocations. Instead, treat the value as completely opaque. - Pass the correct virtual address to bus_dmamem_free() in wpi(4) instead of trying to free a pointer to the virtual address. Reviewed by: yongari Notes: svn path=/head/; revision=267580
* The r48589 promised to remove implicit inclusion of if_var.h soon. PrepareGleb Smirnoff2013-10-261-0/+1
| | | | | | | | | | | to this event, adding if_var.h to files that do need it. Also, include all includes that now are included due to implicit pollution via if_var.h Sponsored by: Netflix Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=257176
* Bring copyright changes with the agreement of Thomas Skibo.Wojciech A. Koszek2013-04-282-5/+6
| | | | | | | | | | Communication on src-commiters, Sat, 27 Apr 2013 22:09:06 -0700, Subject was: "Re: svn commit: r249997" As I'm here, fix the style main block comments in files' headers. Notes: svn path=/head/; revision=250015
* Add Xilinx Zynq ARM/FPGA SoC support to FreeBSD/arm port.Wojciech A. Koszek2013-04-272-0/+1759
Submitted by: Thomas Skibo <ThomasSkibo (at) sbcglobal.net> Reviewed by: wkoszek, freebsd-arm@ (no objections raised) Notes: svn path=/head/; revision=249997