aboutsummaryrefslogtreecommitdiff
path: root/sys/powerpc
Commit message (Collapse)AuthorAgeFilesLines
* oea64 uses 4k pages, too.Justin Hibbits2014-05-151-1/+1
| | | | | | | | MFC after: 1 week X-MFC-with: r266116 Notes: svn path=/head/; revision=266136
* A page mask size is 12-bits, not 11.Justin Hibbits2014-05-151-1/+1
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=266116
* Repair some races in IPI handling:Nathan Whitehorn2014-05-123-2/+23
| | | | | | | | | | | | | | | | | 1. Make sure IPI mask is set before sending the IPI 2. Operate atomically on PS3 PIC outstanding interrupt list 3. Make sure IPIs are EOI'ed before, not after, processing. Without this, a second IPI could be sent partway through processing the first one, get erroneously acknowledge by the EOI to the first, and be lost. In particular in the case of smp_rendezvous(), this can be fatal. In combination, this makes the PS3 boot SMP again. It probably also fixes some latent bugs elsewhere. MFC after: 2 weeks Notes: svn path=/head/; revision=265900
* Fix interrupt allocation after changes to nexus. This makes PS3 bootNathan Whitehorn2014-05-111-2/+12
| | | | | | | | | multiuser again (this commit comes from the PS3 itself). Some problems still exist with SMP, apparently, as I had to boot a non-SMP kernel to get here. Notes: svn path=/head/; revision=265883
* Move the PS3 framebuffer console to use vt instead of syscons and adjustNathan Whitehorn2014-05-112-627/+49
| | | | | | | | | | | GENERIC64 for PowerPC to use vt with it. Much to my chagrin, PS3 support seems to have bitrotted somewhat since the last time I tried it. ehci panics on attach and interrupt handling seems to be faulty. This should be fixed soon... Notes: svn path=/head/; revision=265871
* Use vt(4) by default on 32-bit PowerPC now that it is fully functional andNathan Whitehorn2014-05-111-5/+2
| | | | | | | | fast. 64-bit PowerPC will follow along once the PS3 framebuffer driver is adapted. Notes: svn path=/head/; revision=265868
* Simplify code slightly. Passing an array by &array[0] does work, but isNathan Whitehorn2014-05-101-1/+1
| | | | | | | silly. Notes: svn path=/head/; revision=265823
* Retire smp_active. It was racey and caused demonstrated problems withScott Long2014-04-261-1/+1
| | | | | | | | | | | | | the cpufreq code. Replace its use with smp_started. There's at least one userland tool that still looks at the kern.smp.active sysctl, so preserve it but point it to smp_started as well. Discussed with: peter, jhb MFC after: 3 days Obtained from: Netflix Notes: svn path=/head/; revision=264984
* Small performance optimization. Clobber only cr0, rather than the entire CR.Justin Hibbits2014-04-113-21/+21
| | | | | | | | Discussed with: rdivacky,nwhitehorn MFC after: 3 weeks Notes: svn path=/head/; revision=264338
* Clear the backlight level when it's turned off. Also, reduce the delay times toJustin Hibbits2014-04-061-4/+4
| | | | | | | | | | less conservative values, also found in the radeonkms driver. MFC after: 2 weeks X-MFC-with: r264205 Notes: svn path=/head/; revision=264207
* Fix the ATI backlight driver off/on handling. Now this driver works correctlyJustin Hibbits2014-04-061-6/+61
| | | | | | | | | | | | with the ATI Radeon 9700 in the PowerBook G4 1.67GHz. Code shamelessly taken in spirit from the radeonkms driver, which I hope will make this driver redundant in the future. MFC after: 2 weeks Notes: svn path=/head/; revision=264205
* Correct the SRR1 mask, it's 10-15 not 10-11.Justin Hibbits2014-04-061-1/+1
| | | | | | | X-MFC-with: r263464,r263752 Notes: svn path=/head/; revision=264189
* Rename __wchar_t so it no longer conflicts with __wchar_t from clang 3.4Tijl Coosemans2014-04-011-1/+1
| | | | | | | | | -fms-extensions. MFC after: 2 weeks Notes: svn path=/head/; revision=263998
* Define PSL_SRR1_MASK for BOOK-E too so MPC85XX compiles again.Warner Losh2014-03-251-0/+1
| | | | Notes: svn path=/head/; revision=263752
* Rename global cnt to vm_cnt to avoid shadowing.Bryan Drewery2014-03-224-7/+7
| | | | | | | | | | | | | | | | | To reduce the diff struct pcu.cnt field was not renamed, so PCPU_OP(cnt.field) is still used. pc_cnt and pcpu are also used in kvm(3) and vmstat(8). The goal was to not affect externally used KPI. Bump __FreeBSD_version_ in case some out-of-tree module/code relies on the the global cnt variable. Exp-run revealed no ports using it directly. No objection from: arch@ Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=263620
* Mask out SRR1 bits that aren't exported to the MSR.Justin Hibbits2014-03-211-1/+3
| | | | | | | | | | | | | This appears to fix a strange condition with X on 32-bit PowerBooks I observed, caused by one of these bits getting set in the mcontext, but not set in the thread, which may be a symptom of another problem, more difficult to diagnose. Since these bits aren't exported anyway, this change makes it more explicit that the bits aren't MSR-related in SRR1. MFC after: 3 weeks Notes: svn path=/head/; revision=263464
* In kernel config files, it is supposed to be 'options<space><tab>' notWarner Losh2014-03-184-10/+10
| | | | | | | | 'options<tab><tab>', per long standing (but recently not so strictly enforced) convention. Notes: svn path=/head/; revision=263301
* Update NetBSD Foundation copyrights to 2-clause BSDEd Maste2014-03-185-35/+0
| | | | | | | | | | | | | | The NetBSD Foundation states "Third parties are encouraged to change the license on any files which have a 4-clause license contributed to the NetBSD Foundation to a 2-clause license." This change removes clauses 3 and 4 from copyright / license blocks that list The NetBSD Foundation as the only copyright holder. Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=263289
* Delete stray clause 3 (Advertising clause) and renumber while i'mWarner Losh2014-03-111-1/+1
| | | | | | | | | here. Approved by: alc@ Notes: svn path=/head/; revision=263059
* Correct the order of arguments to mtx_init().Christian Brueffer2014-02-141-1/+1
| | | | | | | | | PR: 186701 Submitted by: Takanori Sawada <tak.swd at gmail.com> MFC after: 2 weeks Notes: svn path=/head/; revision=261884
* Move Open Firmware device root on PowerPC, ARM, and MIPS systems toNathan Whitehorn2014-02-0516-26/+45
| | | | | | | | | | | a sub-node of nexus (ofwbus) rather than direct attach under nexus. This fixes FDT on x86 and will make coexistence with ACPI on ARM systems easier. SPARC is unchanged. Reviewed by: imp, ian Notes: svn path=/head/; revision=261513
* Add driver for the ADT7460/ADT7467 fan controller found in later PowerBooksJustin Hibbits2014-02-031-0/+1
| | | | | | | | | and iBooks. Original work by andreast. MFC after: 1 month Notes: svn path=/head/; revision=261421
* Switch default Book-E scheduler to ULE, which works now, and enableNathan Whitehorn2014-02-012-1/+9
| | | | | | | | | | | CAPABILITIES stuff required to make ssh work. Hopefully, Book-E can eventually be added to GENERIC, which would avoid this kind of issue with bitrot. That will require figuring out how to link Book-E and AIM kernels at the same address, however... Notes: svn path=/head/; revision=261358
* Avoid spurious compiler warning about an uninitialized variable.Nathan Whitehorn2014-02-011-1/+1
| | | | Notes: svn path=/head/; revision=261356
* Fix typo.Nathan Whitehorn2014-02-011-1/+1
| | | | Notes: svn path=/head/; revision=261355
* Open Firmware interrupt specifiers can consist of arbitrary-length byteNathan Whitehorn2014-02-015-37/+28
| | | | | | | | | | | | strings and include arbitrary information (IRQ line/domain/sense). When the ofw_bus_map_intr() API was introduced, it assumed that, as on most systems, these were either 1 cell, containing an interrupt line, or 2, containing a line number plus a sense code. It turns out a non-negligible number of ARM systems use 3 (or even 4!) cells for interrupts, so make this more general. Notes: svn path=/head/; revision=261351
* Add hwpmc(4) support for the PowerPC 970 class processors, direct events.Justin Hibbits2014-02-012-15/+22
| | | | | | | | | | | | | | This also fixes asserts on removal of the module for the mpc74xx. The PowerPC 970 processors have two different types of events: direct events and indirect events. Thus far only direct events are supported. I included some documentation in the driver on how indirect events work, but support is for the future. MFC after: 1 month Notes: svn path=/head/; revision=261342
* Unbreak non-SMP builds. This was broken by r259284. Also, reorganize theJustin Hibbits2014-01-3112-206/+236
| | | | | | | | | | code introduced in that revision a bit. Reviewed by: nwhitehorn MFC after: 3 weeks Notes: svn path=/head/; revision=261309
* Use a loop of dcbz, instead of calling bzero() to zero a page. This matchesJustin Hibbits2014-01-291-6/+4
| | | | | | | | | what is done in mmu_oea64.c. MFC after: 1 month Notes: svn path=/head/; revision=261258
* Fix 32-bit signal handling on ppc64. This was broken when the PSL_USERSTATICJustin Hibbits2014-01-241-0/+1
| | | | | | | | | | | | macro was changed. Since copying 64-bit srr1 into 32-bit srr1 drops the upper 32 bits, any bits set in the context were dropped, meaning the context check fails. Since 32-bit set_context can't change those bits anyway, copy the ones from the current context (td->td_frame) before calling set_context(). MFC after: 3 weeks Notes: svn path=/head/; revision=261095
* Fix the resource information for the i2s-a node on certain G5 PowerMacs.Andreas Tobler2014-01-202-2/+56
| | | | | | | | | | | | | | | This is the first step needed to get the snapper codec working on those machines. The second step is to enable the corresponding I2S device and its clock. Tested on machines where the snapper codec was already working, a G4 PowerBook and a PowerMac9,1 with a Shasta based macio. The PowerMac7,2/7,3 with a K2 based macio can now also play sound. MFC after: 1 month Notes: svn path=/head/; revision=260934
* There's actually no data in the PMU_GET_VERSION command. Don't send any.Justin Hibbits2014-01-191-1/+1
| | | | | | | | | This change now allows the PMU to be used on PowerBook5,8. MFC after: 1 week Notes: svn path=/head/; revision=260872
* Described in the man page but not implemented. Here it comes,Andreas Tobler2014-01-131-0/+37
| | | | | | | | | atomic_swap_32/64. The latter only for powerpc64. MFC after: 1 month Notes: svn path=/head/; revision=260610
* Save and restore the GPIOs on the macio for suspend/resume.Justin Hibbits2014-01-112-2/+48
| | | | Notes: svn path=/head/; revision=260533
* Retire machine/fdt.h as a header used by MI code, as its function is nowNathan Whitehorn2014-01-051-41/+0
| | | | | | | | | | | | | | | | | | obsolete. This involves the following pieces: - Remove it entirely on PowerPC, where it is not used by MD code either - Remove all references to machine/fdt.h in non-architecture-specific code (aside from uart_cpu_fdt.c, shared by ARM and MIPS, and so is somewhat non-arch-specific). - Fix code relying on header pollution from machine/fdt.h includes - Legacy fdtbus.c (still used on x86 FDT systems) now passes resource requests to its parent (nexus). This allows x86 FDT devices to allocate both memory and IO requests and removes the last notionally MI use of fdtbus_bs_tag. - On those architectures that retain a machine/fdt.h, unused bits like FDT_MAP_IRQ and FDT_INTR_MAX have been removed. Notes: svn path=/head/; revision=260327
* Remove TNF license clauses 3 and 4, matching upstreamEd Maste2014-01-011-7/+0
| | | | | | | | Approved by raj@ (Semihalf has a copyright statement in the license block as well). Notes: svn path=/head/; revision=260162
* Set the PMC trapframe macros appropriatelyJustin Hibbits2013-12-221-2/+2
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=259699
* Add suspend/resume state saving for OpenPIC on PowerMac. It's likely thisJustin Hibbits2013-12-216-0/+86
| | | | | | | can be used on the others (cpcht and psim), but that has not been tested. Notes: svn path=/head/; revision=259676
* Add suspend/resume to DBDMA and ATA on PowerMacs.Justin Hibbits2013-12-213-0/+61
| | | | | | | | | This, and several subsequent commits, are suspend/resume for various PowerMac drivers, which will include a change to the global suspend/resume code eventually. Notes: svn path=/head/; revision=259671
* Add suspend/resume handlers for ATI backlight ppc driver.Justin Hibbits2013-12-201-14/+76
| | | | | | | | | | With this, also shut shut off the display (DPMS-style) and disable the clocking when the backlight level is set to 0. This is taken from the radeonkms driver (radeon_legacy_encoders.c) which doesn't yet support PowerPC, and won't for a while, as it's missing full AGP support. Notes: svn path=/head/; revision=259657
* Simplify the ofw_bus_lookup_imap() API slightly: make it allocate maskbufNathan Whitehorn2013-12-172-8/+12
| | | | | | | internally instead of requiring the caller to allocate it. Notes: svn path=/head/; revision=259516
* Configure interrupt sense based on device tree information. This extendsNathan Whitehorn2013-12-171-5/+11
| | | | | | | | the OF interrupt map API to return sense information to the caller and the PowerPC Open Firmware PCI base driver to use it to program the PIC. Notes: svn path=/head/; revision=259513
* Save r3 before using it for the trap check, else we end up saving the new r3,Justin Hibbits2013-12-152-4/+8
| | | | | | | | | | | | | containing the trap instruction encoding (0x7c810808), and restoring it back with the frame on return. This caused it to panic on my ppc32 machine, but somehow my ppc64 machine overlooked it, because I was using such a simple dtrace probe. X-MFC-with: r259245 MFC after: 2 weeks Notes: svn path=/head/; revision=259421
* Set max_lun to zero. This field is ignored unless we are manually probingNathan Whitehorn2013-12-151-1/+1
| | | | | | | | | | LUNs anyway, and we certainly don't want to probe 2^32 values by hand in that case. MFC after: 2 weeks Notes: svn path=/head/; revision=259418
* Rebase the PMC indices at 1, since PMC_SOFT is at 0.Justin Hibbits2013-12-141-2/+2
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=259394
* Some style(9) fixesJustin Hibbits2013-12-131-4/+3
| | | | | | | | MFC after: 1 month X-MFC with: r259284 Notes: svn path=/head/; revision=259287
* Add PMU-based CPU frequency scaling. This method is used on most TitaniumJustin Hibbits2013-12-1313-33/+564
| | | | | | | | | PowerBooks. MFC after: 1 month Notes: svn path=/head/; revision=259284
* FBT now does work fully on PowerPC.Justin Hibbits2013-12-123-6/+26
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=259245
* Make more unsigned ints signed.Justin Hibbits2013-12-071-1/+2
| | | | | | | | Found by: clang (powerpc64) MFC after: 1 week Notes: svn path=/head/; revision=259082
* Fix debug printfs in FPU_EMU to compile on powerpc64 and enable it forJohn Baldwin2013-12-051-8/+13
| | | | | | | | | powerpc64. This fixes the LINT64 kernel config. Approved by: nwhitehorn (the idea, not the actual patch) Notes: svn path=/head/; revision=259010