aboutsummaryrefslogtreecommitdiff
path: root/sys/powerpc/ps3
Commit message (Collapse)AuthorAgeFilesLines
* bus_alloc_resource: Pass rid by value to BUS_ALLOC_RESOURCE DEVMETHODJohn Baldwin2025-12-091-5/+5
| | | | | | | | | 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-212-2/+2
| | | | | | Reviewed by: imp, jhb Approved by: imp (mentor) Differential Revision: https://reviews.freebsd.org/D50913
* ps3disk.c: Rewrite ps3disk_transferChattrapat Sangmanee2025-01-241-41/+55
| | | | | | | | | | | | | | | | | | | | | This function is bugged since the beginning, but it never hit because its variable doesn't allow. However, since commit a77e1f0f81df5fa3b4a6a38728ebace599cb18a4 it happen now. First, it assume that ds_len will always equal to real user requested size. So it being used for sector count calculation. This is no longer true, and will fail if attempt to read last few sectors. Use bp->bio_length instead. Second, this being a loop is pointless because nsegs will never be > 1 as specified at bus_dma_tag_create() call. And all it doing is to repeat very same command again but with different ds_addr. Since bio_driver2 tag ident pointer are being reused, the result will be discarded at ps3disk_intr(). Signed-off-by: Chattrapat Sangmanee <aomsin27@hotmail.co.th> Reviewed by: imp,mav Pull Request: https://github.com/freebsd/freebsd-src/pull/1414
* Replace calls to bus_generic_attach with bus_attach_childrenJohn Baldwin2024-12-061-1/+2
| | | | | Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47675
* ps3: add elfv2 supportChattrapat Sangmanee2024-09-142-224/+230
| | | | | | | | | | ps3 are broken since we moved to clang/elfv2. Fix this by updating the hypercall glue to the new ABI. Signed-off-by: Chattrapat Sangmanee <aomsin27@hotmail.co.th> Reviewed by: jhibbits MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/1413
* newbus: globally replace device_add_child(..., -1) with DEVICE_UNIT_ANYWarner Losh2024-07-253-5/+5
| | | | Sponsored by: Netflix
* new-bus: Remove the 'type' argument from BUS_MAP/UNMAP_RESOURCEJohn Baldwin2024-03-131-7/+7
| | | | | | | | | | 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
* powerpc ps3bus: Use bus_generic_rman_*John Baldwin2024-01-231-56/+74
| | | | | | | | | | | | | - Split out part of ps3bus_activate_resource into a ps3bus_map_resource method. - Implement ps3bus_unmap_resource via pmap_unmapdev. - Use bus_generic_rman_* to add bus_adjust_resource, bus_deactivate_resource, and bus_release_resource methods. Reviewed by: imp, jhibbits Differential Revision: https://reviews.freebsd.org/D43432
* sys: Automated cleanup of cdefs and other formattingWarner Losh2023-11-276-6/+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
* ehci_ps3: Remove unused struct definition.John Baldwin2023-11-231-5/+0
|
* sys: Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-162-4/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* sys: Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-168-16/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* sys: Remove $FreeBSD$: one-line .c comment patternWarner Losh2023-08-161-1/+0
| | | | Remove /^/[*/]\s*\$FreeBSD\$.*\n/
* sys: Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-168-16/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* ps3: Don't add $FreeBSD$ to generated fileWarner Losh2023-08-161-1/+0
| | | | Sponsored by: Netflix
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-1212-12/+12
| | | | | | | | | 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: fix warning: a function declaration without a prototype is ↵Piotr Kubaj2023-02-261-1/+1
| | | | | | | | | | | deprecated in all versions of C Reviewers: #powerpc Approved by: alfredo Subscribers: imp, jhibbits Differential Revision: https://reviews.freebsd.org/D38787
* Mechanically convert ps3 if_glc(4) to IfAPIJustin Hibbits2023-01-312-54/+52
| | | | | Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D37792
* powerpc ps3: Remove unused devclass arguments to DRIVER_MODULE.John Baldwin2022-05-107-21/+7
|
* ps3fb: Remove unused variable.John Baldwin2022-04-121-3/+0
|
* vt: export RGB offsets with FBIO_GETRGBOFFSLeandro Lupori2021-11-251-1/+1
| | | | | | | | | | | | | | Add a new ioctl to vt to make it possible to export RGB offsets set by vt drivers. This is needed to fix colors on X and Mesa on some machines, especially on modern PowerPC64 BE ones. With the appropriate changes in SCFB, to use this ioctl to find out the correct RGB offsets, this fixes wrong colors on Talos II and Blackbird, when used with their built-in video cards. Reviewed by: alfredo Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D29000
* cam: clear on-stack CCBs in last few driversEdward Tomasz Napierala2021-05-211-0/+1
| | | | | | | | | | This changes ahc(4), ahd(4), hptiop(4), hptnr(4), hptrr(4), and ps3cdrom(4). Reviewed By: imp Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D30305
* powerpc64: Split out DMAP and non-DMAP implementations of some methodsJustin Hibbits2021-05-061-0/+1
| | | | | | | | | | Summary: Some methods are split between DMAP and non-DMAP, conditional on hw_direct_map variable. Rather than checking this variable every time, use it to install different functions via IFUNCs. Reviewed By: luporl Differential Revision: https://reviews.freebsd.org/D30071
* Add CFI start/end proc directives to arm64, i386, and ppcConrad Meyer2020-12-051-1/+90
| | | | | | | | | | | | | | Follow-up to r353959 and r368070: do the same for other architectures. arm32 already seems to use its own .fnstart/.fnend directives, which appear to be ARM-specific variants of the same thing. Likewise, MIPS uses .frame directives. Reviewed by: arichardson Differential Revision: https://reviews.freebsd.org/D27387 Notes: svn path=/head/; revision=368354
* powerpc: clean up empty lines in .c and .h filesMateusz Guzik2020-09-019-26/+15
| | | | Notes: svn path=/head/; revision=365073
* powerpc/mmu: Convert PowerPC pmap drivers to ifunc from kobjJustin Hibbits2020-05-271-28/+34
| | | | | | | | | | | | | With IFUNC support in the kernel, we can finally get rid of our poor-man's ifunc for pmap, utilizing kobj. Since moea64 uses a second tier kobj as well, for its own private methods, this adds a second pmap install function (pmap_mmu_init()) to perform pmap 'post-install pre-bootstrap' initialization, before the IFUNCs get initialized. Reviewed by: bdragon Notes: svn path=/head/; revision=361544
* Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)Pawel Biernacki2020-02-261-3/+3
| | | | | | | | | | | | | | | | | | | 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
* Convert to if_foreach_llmaddr() KPI.Gleb Smirnoff2019-10-211-26/+25
| | | | Notes: svn path=/head/; revision=353866
* powerpc/pmap64: Make moea64 statistics optionalJustin Hibbits2019-07-251-5/+5
| | | | | | | | | | | | | | | | | | Summary: It turns out statistics accounting is very expensive in the pmap driver, and doesn't seem necessary in the common case. Make this optional behind a MOEA64_STATS #define, which one can set if they really need statistics. This saves ~7-8% on buildworld time on a POWER9. Found by bdragon. Reviewed by: luporl Differential Revision: https://reviews.freebsd.org/D20903 Notes: svn path=/head/; revision=350313
* Extract eventfilter declarations to sys/_eventfilter.hConrad Meyer2019-05-201-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | This allows replacing "sys/eventfilter.h" includes with "sys/_eventfilter.h" in other header files (e.g., sys/{bus,conf,cpu}.h) and reduces header pollution substantially. EVENTHANDLER_DECLARE and EVENTHANDLER_LIST_DECLAREs were moved out of .c files into appropriate headers (e.g., sys/proc.h, powernv/opal.h). As a side effect of reduced header pollution, many .c files and headers no longer contain needed definitions. The remainder of the patch addresses adding appropriate includes to fix those files. LOCK_DEBUG and LOCK_FILE_LINE_ARG are moved to sys/_lock.h, as required by sys/mutex.h since r326106 (but silently protected by header pollution prior to this change). No functional change (intended). Of course, any out of tree modules that relied on header pollution for sys/eventhandler.h, sys/lock.h, or sys/mutex.h inclusion need to be fixed. __FreeBSD_version has been bumped. Notes: svn path=/head/; revision=347984
* powerpc: Add opaque 'private data' to interrupt vectorsJustin Hibbits2019-01-121-9/+9
| | | | | | | | | | The XICS and XIVE need extra data beyond irq and vector. Rather than performing a separate search, it's better for the general interrupt facility to hold a private pointer, since the search already must be done anyway at that level. Notes: svn path=/head/; revision=342975
* powerpc: Fix regression introduced in r342771Conrad Meyer2019-01-071-2/+9
| | | | | | | | | | | | | | | | | | | | | In r342771, I introduced a regression in Power by abusing the platform smp_topo() method as a shortcut for providing the MI information needed for the stated sysctls. The smp_topo() method was already called later by sched_ule (under the name cpu_topo()), and initializes a static array of scheduler topology information. I had skimmed the smp_topo_foo() functions and assumed they were idempotent; empirically, they are not (or at least, detect re-initialization and panic). Do the cleaner thing I should have done in the first place and add a platform method specifically for core- and thread-count probing. Reported by: luporl via jhibbits Reviewed by: luporl X-MFC-With: r342771 Differential Revision: https://reviews.freebsd.org/D18777 Notes: svn path=/head/; revision=342852
* Expose threads-per-core and physical core count informationConrad Meyer2019-01-041-0/+2
| | | | | | | | | | | | | | With new sysctls (to the best of our ability do detect them). Restructured smp.4 slightly for clarity (keep relevant stuff closer to the top) while documenting. Reviewed by: markj, jhibbits (ppc parts) MFC after: 3 days Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D18322 Notes: svn path=/head/; revision=342771
* ifnet: Replace if_addr_lock rwlock with epoch + mutexMatt Macy2018-05-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Run on LLNW canaries and tested by pho@ gallatin: Using a 14-core, 28-HTT single socket E5-2697 v3 with a 40GbE MLX5 based ConnectX 4-LX NIC, I see an almost 12% improvement in received packet rate, and a larger improvement in bytes delivered all the way to userspace. When the host receiving 64 streams of netperf -H $DUT -t UDP_STREAM -- -m 1, I see, using nstat -I mce0 1 before the patch: InMpps OMpps InGbs OGbs err TCP Est %CPU syscalls csw irq GBfree 4.98 0.00 4.42 0.00 4235592 33 83.80 4720653 2149771 1235 247.32 4.73 0.00 4.20 0.00 4025260 33 82.99 4724900 2139833 1204 247.32 4.72 0.00 4.20 0.00 4035252 33 82.14 4719162 2132023 1264 247.32 4.71 0.00 4.21 0.00 4073206 33 83.68 4744973 2123317 1347 247.32 4.72 0.00 4.21 0.00 4061118 33 80.82 4713615 2188091 1490 247.32 4.72 0.00 4.21 0.00 4051675 33 85.29 4727399 2109011 1205 247.32 4.73 0.00 4.21 0.00 4039056 33 84.65 4724735 2102603 1053 247.32 After the patch InMpps OMpps InGbs OGbs err TCP Est %CPU syscalls csw irq GBfree 5.43 0.00 4.20 0.00 3313143 33 84.96 5434214 1900162 2656 245.51 5.43 0.00 4.20 0.00 3308527 33 85.24 5439695 1809382 2521 245.51 5.42 0.00 4.19 0.00 3316778 33 87.54 5416028 1805835 2256 245.51 5.42 0.00 4.19 0.00 3317673 33 90.44 5426044 1763056 2332 245.51 5.42 0.00 4.19 0.00 3314839 33 88.11 5435732 1792218 2499 245.52 5.44 0.00 4.19 0.00 3293228 33 91.84 5426301 1668597 2121 245.52 Similarly, netperf reports 230Mb/s before the patch, and 270Mb/s after the patch Reviewed by: gallatin Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D15366 Notes: svn path=/head/; revision=333813
* Move the powerpc64 direct map base address from zero to high memory. ThisNathan Whitehorn2018-03-071-4/+2
| | | | | | | | | | | | | | | | | | | | | | accomplishes a few things: - Makes NULL an invalid address in the kernel, which is useful for catching bugs. - Lays groundwork for radix-tree translation on POWER9, which requires the direct map be at high memory. - Similarly lays groundwork for a direct map on 64-bit Book-E. The new base address is chosen as the base of the fourth radix quadrant (the minimum kernel address in this translation mode) and because all supported CPUs ignore at least the first two bits of addresses in real mode, allowing direct-map addresses to be used in real-mode handlers. This is required by Linux and is part of the architecture standard starting in POWER ISA 3, so can be relied upon. Reviewed by: jhibbits, Breno Leitao Differential Revision: D14499 Notes: svn path=/head/; revision=330610
* Honor physical memory regions marked unavailable in the FDT, when present.Nathan Whitehorn2018-03-031-28/+39
| | | | | | | | The most notable of these is the FDT itself, which it is a bad idea to overwrite. Notes: svn path=/head/; revision=330306
* Remove assumption that all physical memory is available to the kernel andNathan Whitehorn2018-03-031-1/+1
| | | | | | | that the physical and available memory arrays are interchangeable. Notes: svn path=/head/; revision=330305
* Avoid dereferencing random memory when kickstarting DMA.Nathan Whitehorn2018-02-241-1/+2
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=329941
* Merge AIM and Book-E PCPU fieldsJustin Hibbits2018-02-171-1/+1
| | | | | | | | | | This is part of a long-term goal of merging Book-E and AIM into a single GENERIC kernel. As more work is done, the struct may be optimized further. Reviewed by: nwhitehorn Notes: svn path=/head/; revision=329469
* Document places we assume that physical memory is direct-mapped at zero byNathan Whitehorn2018-01-131-1/+1
| | | | | | | | | using a new macro PHYS_TO_DMAP, which deliberately has the same name as the equivalent macro on amd64. This also sets the stage for moving the direct map to another base address. Notes: svn path=/head/; revision=327950
* Fix reversed endianness that crept in at some point. Blue is now blueNathan Whitehorn2018-01-021-1/+1
| | | | | | | | | instead of pink. MFC after: 3 days Notes: svn path=/head/; revision=327484
* Use data from the boot loader to pick the appropriate output graphics modeNathan Whitehorn2017-12-311-3/+49
| | | | | | | | | | | | instead of hard-coding a default. This information is passed implicitly by the PS3 firmware and can be relied upon. Also adjust the default mode, if somehow firmware doesn't pass one, to 1920x1080 from 720x480 since it is 2017. MFC after: 2 weeks Notes: svn path=/head/; revision=327418
* Remove logic for early console with loader.ps3 now that loader.ps3 is dead.Nathan Whitehorn2017-12-301-7/+8
| | | | Notes: svn path=/head/; revision=327389
* Change the way SMP startup works to match the new multi-AP features inNathan Whitehorn2017-12-301-12/+17
| | | | | | | | | locore64.S introduced in r327358. MFC after: 3 weeks Notes: svn path=/head/; revision=327388
* sys/powerpc: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-2712-0/+24
| | | | | | | | | | | | | | | 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=326261
* Always null-terminate ccb_pathinq.(sim_vid|hba_vid|dev_name)Alan Somers2017-01-041-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The sim_vid, hba_vid, and dev_name fields of struct ccb_pathinq are fixed-length strings. AFAICT the only place they're read is in sbin/camcontrol/camcontrol.c, which assumes they'll be null-terminated. However, the kernel doesn't null-terminate them. A bunch of copy-pasted code uses strncpy to write them, and doesn't guarantee null-termination. For at least 4 drivers (mpr, mps, ciss, and hyperv), the hba_vid field actually overflows. You can see the result by doing "camcontrol negotiate da0 -v". This change null-terminates those fields everywhere they're set in the kernel. It also shortens a few strings to ensure they'll fit within the 16-character field. PR: 215474 Reported by: Coverity CID: 1009997 1010000 1010001 1010002 1010003 1010004 1010005 CID: 1331519 1010006 1215097 1010007 1288967 1010008 1306000 CID: 1211924 1010009 1010010 1010011 1010012 1010013 1010014 CID: 1147190 1010017 1010016 1010018 1216435 1010020 1010021 CID: 1010022 1009666 1018185 1010023 1010025 1010026 1010027 CID: 1010028 1010029 1010030 1010031 1010033 1018186 1018187 CID: 1010035 1010036 1010042 1010041 1010040 1010039 Reviewed by: imp, sephe, slm MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D9037 Differential Revision: https://reviews.freebsd.org/D9038 Notes: svn path=/head/; revision=311305
* Fix the resource_list_print_type() calls to use uintmax_t.Justin Hibbits2016-03-221-2/+2
| | | | | | | Missed a bunch from r297000. Notes: svn path=/head/; revision=297199
* As <machine/pmap.h> is included from <vm/pmap.h>, there is no need toSvatopluk Kraus2016-02-226-6/+0
| | | | | | | | | | include it explicitly when <vm/pmap.h> is already included. Reviewed by: alc, kib Differential Revision: https://reviews.freebsd.org/D5373 Notes: svn path=/head/; revision=295880
* Another conversion u_long -> rman_res_tJustin Hibbits2016-02-161-5/+5
| | | | Notes: svn path=/head/; revision=295673
* EHCI: Make core reset and port speed reading more generic.Michal Meloun2016-01-281-1/+12
| | | | | | | | | | | | | | | | | | | | Use driver settable callbacks for handling of: - core post reset - reading actual port speed Typically, OTG enabled EHCI cores wants setting of USBMODE register, but this register is not defined in EHCI specification and different cores can have it on different offset. Also, for cores with TT extension, actual port speed must be determinable. But again, EHCI specification not covers this so this patch provides function for two most common variant of speed bits layout. Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D5088 Notes: svn path=/head/; revision=294989