aboutsummaryrefslogtreecommitdiff
path: root/sys/powerpc/mpc85xx
Commit message (Collapse)AuthorAgeFilesLines
* mpc85xx/msi: Add compat string for T208x/T4xxx SoCsJustin Hibbits2026-04-301-1/+2
|
* kva_alloc/free: Use void * instead of vm_offset_tJohn Baldwin2026-04-231-5/+6
| | | | | | | Effort: CHERI upstreaming Reviewed by: kib Sponsored by: AFRL, DARPA Pull Request: https://github.com/freebsd/freebsd-src/pull/2068
* mpc85xx: Support timebase sync on T-series devicesJustin Hibbits2026-04-161-6/+18
| | | | | Freescale T-series QorIQ devices use a different register to twiddle the timebase enable.
* powerpc/mpc85xx: Fix PCI attach error cleanupJustin Hibbits2026-01-211-2/+17
| | | | | | | | | If an error occurs during attach after ofw_pcib_init() runs, the device is torn down, leaving the rmans embedded in the softc attached to the rman list, thus corrupting the rman list. Fix this by undoing everything that was done by this point. MFC after: 1 week
* powerpc/mpc85xx: Set pc_hwref to the primary thread IDJustin Hibbits2026-01-211-2/+14
| | | | | | On multithreaded cores (e6500) the CPU ID in the device tree (reg[0]) is the primary core, which may not match the cpuid, until Book-E threading is added.
* bus_alloc_resource: Pass rid by value to BUS_ALLOC_RESOURCE DEVMETHODJohn Baldwin2025-12-092-13/+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
* 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-2/+2
| | | | | | | | | | 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
* machine/stdarg.h -> sys/stdarg.hBrooks Davis2025-06-111-1/+1
| | | | | | | | | | | | | Switch to using sys/stdarg.h for va_list type and va_* builtins. Make an attempt to insert the include in a sensible place. Where style(9) was followed this is easy, where it was ignored, aim for the first block of sys/*.h headers and don't get too fussy or try to fix other style bugs. Reviewed by: imp Exp-run by: antoine (PR 286274) Pull Request: https://github.com/freebsd/freebsd-src/pull/1595
* Replace calls to bus_generic_attach with bus_attach_childrenJohn Baldwin2024-12-063-4/+5
| | | | | Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47675
* Check for errors when detaching children first, not lastJohn Baldwin2024-11-051-1/+6
| | | | | | | | | | | | 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: replace -1 in BUS_ADD_CHILD(...-1) with DEVICE_UNIT_ANYWarner Losh2024-07-251-1/+1
| | | | Sponsored by: Netflix
* newbus: globally replace device_add_child(..., -1) with DEVICE_UNIT_ANYWarner Losh2024-07-253-3/+3
| | | | Sponsored by: Netflix
* mpc85xx: 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-14/+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-131-21/+10
| | | | | | | | | | 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-6/+6
| | | | | | | | | | 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-10/+6
| | | | | | | | | | 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
* powerpc mpc85xx: Fix infinite recursion in multiple bus methodsJohn Baldwin2024-02-171-3/+3
| | | | | | | | Similar to 68a3ff041129208ea98a3bd5142061176ab4165e, the default case needs to call bus_generic_* to pass the request up the tree, not bus_* which will just call this method again. Fixes: 5a7e717fb790 powerpc mpc85xx: Use bus_generic_rman_*
* powerpc mpc85xx: Fix infinite recursion in bus_adjust_resource methodJohn Baldwin2024-02-161-1/+2
| | | | | | | | The default case needs to call bus_generic_adjust_resource to pass the request up the tree, not bus_adjust_resource which will just call this method again. Fixes: 5a7e717fb790 powerpc mpc85xx: Use bus_generic_rman_*
* powerpc: Add RF_LITTLEENDIAN resource flagJohn Baldwin2024-01-231-2/+1
| | | | | | | | | | | If this powerpc-specific flag is set on a resource, then the little-endian bus tag is always used when mapping that resource. Make use of this flag in the mpc85xx/fsl_sata driver to avoid setting the SATA BAR's bus tag after bus_alloc_resource. Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D43553
* powerpc mpc85xx: Use bus_generic_rman_*John Baldwin2024-01-231-48/+137
| | | | | | | | | | | | - Consistently map SYS_RES_IOPORT to SYS_RES_MEMORY for bus_activate/deactivate/adjust/release_resource. - Implement bus_map/unmap_resource. - Add an implementation of bus_adjust_resource. Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D43434
* sys: Automated cleanup of cdefs and other formattingWarner Losh2023-11-2714-14/+3
| | | | | | | | | | | | | | | | 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-1615-30/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* sys: Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-166-12/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-1211-11/+11
| | | | | | | | | 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
* powerpc/mpc85xx: Add compat strings for P5040 PCIeJustin Hibbits2022-12-011-0/+2
| | | | | Submitted by: widelec (widelec@morphos.pl) MFC after: 1 week
* pmap_unmapdev/bios: Accept a pointer instead of a vm_offset_t.John Baldwin2022-09-221-1/+2
| | | | | | | | This matches the return type of pmap_mapdev/bios. Reviewed by: kib, markj Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D36548
* powerpc/fsl_sata: Properly clamp maxio to pessimized sizeJustin Hibbits2022-08-051-1/+1
| | | | | | | | | | The CAM 'maxio' is a 'pessimized' size, assuming 4k pages and one page per segment. Since there are at most 63 segments in a transaction with this driver, and one would necessarily be the indirect segment marker, clamp the maxio to the minimum of maxphys (tunable) or (63 - 1) pages (248k). MFC after: 3 days
* mpc85xx/pci: Conditionally reset PCI bridgesJustin Hibbits2022-07-301-12/+16
| | | | | | | | | Sometimes we need to reset a PCIe bus, but sometimes it breaks the downstream device(s). Since, from my testing, this is only needed for Radeon cards installed in the AmigaOne machines because the card was already initialized by firmware, make the reset dependent on a device hint (hint.pcib.X.reset=1). With this, AmigaOne X5000 machines can have other devices in the secondary PCIe slots.
* powerpc mpc85xx: Remove unused devclass arguments to DRIVER_MODULE.John Baldwin2022-05-1012-44/+18
|
* Remove unused iicbus_devclass.John Baldwin2022-05-061-1/+1
|
* powerpc mpc85xx: Remove unused variables.John Baldwin2022-04-132-6/+0
|
* powerpcspe: fix PCI enumeration on ppce500Alfredo Dal'Ava Junior2022-03-211-3/+6
| | | | | | | | | | | | | | This fixes PCI devices not being found on QEMU ppce500. This generic board used to have its first PCI slot at 0x11, like the mpc8544dsi and some real HW. After commit [1], it was changed to 0x1 and our driver wasn't prepared for that. [1] https://gitlab.com/qemu-project/qemu/-/commit/3bb7e02a9725a24e5bf915b35f914f82f5b07a1f Reviewed by: jhibbits, bdragon MFC after: 2 days Sponsored by: Institudo de Pesquisas Eldorado (eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D34621
* Rename ofwpci.c to ofw_pcib.cMarcin Wojtas2021-05-201-3/+3
| | | | | | | | | | | | | | It's a class0 driver that implements some pcib methods and creates a pci bus as its children. The "ofw_pci" name will be used by a new driver that will be a subclass of the pci bus. No functional changes intended. Submitted by: Kornel Duleba <mindal@semihalf.com> Reviewed by: andrew Obtained from: Semihalf Sponsored by: Alstom Group Differential Revision: https://reviews.freebsd.org/D30226
* Merge the QorIQ GPIO drivers between arm and powerpcJustin Hibbits2021-04-051-315/+0
| | | | | | | | | | | | Summary: They're nearly identical, so don't use two copies. Merge the newer driver into the older one, and move it to a common location. Add the Semihalf and associated copyrights in addition to mine, since it's a non-trivial amount of code merged. Reviewed By: mw Differential Revision: https://reviews.freebsd.org/D29520
* Make MAXPHYS tunable. Bump MAXPHYS to 1M.Konstantin Belousov2020-11-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace MAXPHYS by runtime variable maxphys. It is initialized from MAXPHYS by default, but can be also adjusted with the tunable kern.maxphys. Make b_pages[] array in struct buf flexible. Size b_pages[] for buffer cache buffers exactly to atop(maxbcachebuf) (currently it is sized to atop(MAXPHYS)), and b_pages[] for pbufs is sized to atop(maxphys) + 1. The +1 for pbufs allow several pbuf consumers, among them vmapbuf(), to use unaligned buffers still sized to maxphys, esp. when such buffers come from userspace (*). Overall, we save significant amount of otherwise wasted memory in b_pages[] for buffer cache buffers, while bumping MAXPHYS to desired high value. Eliminate all direct uses of the MAXPHYS constant in kernel and driver sources, except a place which initialize maxphys. Some random (and arguably weird) uses of MAXPHYS, e.g. in linuxolator, are converted straight. Some drivers, which use MAXPHYS to size embeded structures, get private MAXPHYS-like constant; their convertion is out of scope for this work. Changes to cam/, dev/ahci, dev/ata, dev/mpr, dev/mpt, dev/mvs, dev/siis, where either submitted by, or based on changes by mav. Suggested by: mav (*) Reviewed by: imp, mav, imp, mckusick, scottl (intermediate versions) Tested by: pho Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D27225 Notes: svn path=/head/; revision=368124
* powerpc: clean up empty lines in .c and .h filesMateusz Guzik2020-09-0113-22/+6
| | | | Notes: svn path=/head/; revision=365073
* powerpc/mpc85xx: Don't use the quantum cache in vmem for MPIC MSIsJustin Hibbits2020-06-101-1/+1
| | | | | | | | | | The qcache is unnecessary for this purpose, it's only needed when there are lots of concurrent allocations. Reported by: markj Notes: svn path=/head/; revision=362002
* powerpc/mpc85xx: Partially revert r356640Justin Hibbits2020-01-131-1/+1
| | | | | | | | The count block was correct before. r356640 caused a read past the end of the tuple. Notes: svn path=/head/; revision=356710
* powerpc/mpc85xx: Fix localbus child reg property decodingJustin Hibbits2020-01-111-2/+2
| | | | | | | | | | r302340, as an attempt to fix the localbus child handling post-rman change, actually broke child resource allocation, due to typos in fdt_lbc_reg_decode(). This went unnoticed because there aren't any drivers currently in tree that use localbus. Notes: svn path=/head/; revision=356640
* powerpc/mpc85xx: Clean up Freescale SATA driver a littleJustin Hibbits2019-12-151-30/+5
| | | | | | | | * Remove unused ATA_IN/OUT macros, they just clutter up the file. * Fix some RID management bits for the channel memory resource. Notes: svn path=/head/; revision=355778
* Use a void * argument to callout handlers instead of timeout_t casts.John Baldwin2019-12-051-5/+6
| | | | | | | | Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D22684 Notes: svn path=/head/; revision=355426
* powerpc/mpc85xx: Add MSI support for Freescale PowerPC SoCsJustin Hibbits2019-11-081-8/+256
| | | | | | | | | | | | | | | Freescale SoCs use a set of IRQs at the high end of the OpenPIC IRQ list, not counted in the NIRQs of the Feature reporting register. Some SoCs include a MSI inbound window in the PCIe controller configuration registers as well, but some don't. Currently, this only handles the SoCs *with* the MSI window. There are 256 MSIs per MSI bank (32 per MSI IRQ, 8 IRQs per MSI bank). The P5020 has 3 banks, yielding up to 768 MSIs; older SoCs have only one bank. Notes: svn path=/head/; revision=354525
* Add support for building Book-E kernels with clang/lld.Brandon Bergren2019-11-021-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | This involved several changes: * Since lld does not like text relocations, replace SMP boot page text relocs in booke/locore.S with position-independent math, and track the virtual base in the SMP boot page header. * As some SPRs are interpreted differently on clang due to the way it handles platform-specific SPRs, switch m*dear and m*esr mnemonics out for regular m*spr. Add both forms of SPR_DEAR to spr.h so the correct encoding is selected. * Change some hardcoded 32 bit things in the boot page to be pointer-sized, and fix alignment. * Fix 64-bit build of booke/pmap.c when enabling pmap debugging. Additionally, I took the opportunity to document how the SMP boot page works. Approved by: jhibbits (mentor) Differential Revision: https://reviews.freebsd.org/D21999 Notes: svn path=/head/; revision=354266
* powerpc/mpc85xx: Set description for the MPC85xx RC bridgeJustin Hibbits2019-11-021-0/+2
| | | | Notes: svn path=/head/; revision=354243
* powerpc/booke: Simplify the MPC85XX PCIe root complex driverJustin Hibbits2019-10-241-140/+14
| | | | | | | | | | | | | | | | | | | | Summary: Due to bugs in the enumeration code, fsl_pcib_init() was not configuring sub-bridges properly, so devices hanging off a separate bridge would not be found. Since the generic PCI code already supports probing child buses, just delete this code and initialize only the device itself, letting the generic code handle all the additional probing and initializing. This also deletes setup for some PCI peripherals found on some MPC85XX evaluation boards. The code can be resurrected if needed, but overly complicated this code in the first place. Reviewed by: bdragon Differential Revision: https://reviews.freebsd.org/D22050 Notes: svn path=/head/; revision=354005
* powerpc/mpc85xx: Replace global PCI config mutex with per-controller mutexJustin Hibbits2019-10-191-16/+11
| | | | | | | | PCI controllers need to enforce exclusive config register access on their own bus, not between all buses. Notes: svn path=/head/; revision=353745
* powerpc/mpc85xx: Fix function type for fsl_pcib_error_intr()Justin Hibbits2019-10-161-4/+2
| | | | | | | | | | Since it's only called as an interrupt handler, fsl_pcib_eror_intr() should just match the driver_intr_t type. Reported by: bdragon Notes: svn path=/head/; revision=353604
* powerpc/mpc85xx: Use the proper (EREF) form of writing to DBCR0Justin Hibbits2019-05-231-5/+4
| | | | | | | | | | | | | | | DBCR0, according to the Freescale EREF, is guaranteed to be updated, and changes take effect, after an isync plus change of MSR[DE] from 0 to 1. Otherwise it's guaranteed to be updated "eventually". Use the expected synchronization sequence to write it for resetting. This prevents "Reset failed" from being printed immediately before the CPU resets. MFC after: 2 weeks Notes: svn path=/head/; revision=348147