summaryrefslogtreecommitdiffstats
path: root/sys/powerpc/powermac
Commit message (Collapse)AuthorAgeFilesLines
* Fix an error that could cause sysctl -a to enter an infinite loop in thenwhitehorn2011-07-301-6/+6
| | | | | | | | event of a broken or busy fan due to returning incorrect error codes from the FCU sysctl handler. Reported by: Path Mather <paul at gromit dot dlib dot vt dot edu>1 Approved by: re (kib)
* Turn the minimum PWM fan speed down to 30 from 40. It turns out the burningnwhitehorn2011-06-261-1/+1
| | | | | | | smell that caused me to turn this up was due to a failed fan burning, not a CPU (plus a healthy dose of paranoia). Submitted by: Paul Mather <paul at gromit dot dlib dot vt dot edu>
* Add new fan controller driver for the G4 MDD PowerMac. Submitted and testedandreast2011-06-041-0/+216
| | | | | | by Justin Hibbits. Approved by: nwhitehorn (mentor)
* - Improve error handling.andreast2011-06-041-30/+60
| | | | | | - Add retry loops for the i2c read/write functions. Approved by: nwhitehorn (mentor)
* - Introduce a define for ZERO_C_TO_K.andreast2011-06-032-3/+6
| | | | | | - Fix the printing of the temperature when we exceed the critical value. Approved by: nwhitehorn (mentor)
* Use kproc_exit() instead of returning from the management function onnwhitehorn2011-05-291-1/+1
| | | | systems with no manageable thermal control devices.
* Add some error handling here: if a sensor returns an error code (a negativenwhitehorn2011-05-291-1/+5
| | | | | | | Kelvin temperature, which is impossible except for some contrived magnetic spin systems), use the previous measurement from that sensor instead of corrupting everything and randomly changing the fans or shutting off the machine.
* Add the next digit of precision to temperatures, which I missed whennwhitehorn2011-05-292-2/+2
| | | | converting the reporting format from degrees C to 0.1 degree K.
* Don't put negative values into the averages.nwhitehorn2011-05-291-0/+2
|
* Update the I2C-based temperature/fan drivers to connect to the Powermacnwhitehorn2011-05-291-51/+78
| | | | | thermal control module. This provides automatic fan management on all G5 PowerMacs and Xserves.
* Adapt smusat(4) to use powermac_thermal. This provides automatic fannwhitehorn2011-05-281-16/+34
| | | | management on dual- and quad-core Powermac G5s, and the last G5 iMacs.
* Require an error instead of a timeout to decide the new-style fannwhitehorn2011-05-281-2/+2
| | | | | | | commands won't work. This prevents a busy system from making smu(4) suddenly decide its fans use the old-style command set. MFC after: 3 days
* Factor out the SMU fan management code into a new module (powermac_thermal)nwhitehorn2011-05-283-135/+290
| | | | | | | that will connect all of the various sensors and fan control modules on Apple hardware with software-controlled fans (e.g. all G5 systems). MFC after: 1 month
* Do not use Open Firmware to open the device and instead program its startnwhitehorn2011-05-062-0/+41
| | | | | | | | on our own. This prevents hangs at boot when using a bm(4) NIC where the cable is not plugged in at boot time. Obtained from: NetBSD MFC after: 1 week
* Don't sleep while setting the clock. This can cause panics whennwhitehorn2011-03-131-2/+2
| | | | | | | periodic_resettodr() calls CLOCK_SETTIME() and smu tries to sleep while running from a callout. Reported by: Torfinn Ingolfsen
* Rename INTR_VEC to MAP_IRQ. From the OFW or FDT we obtain amarcel2011-02-026-14/+14
| | | | | PIC handle with interrupt pin. This we map to the resource called SYS_RES_IRQ.
* Fix the interrupt code, broken 7 months ago. The interrupt frameworkmarcel2011-01-293-31/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | already supported nested PICs, but was limited to having a nested AT-PIC only. With G5 support the need for nested OpenPIC controllers needed to be added. This was done the wrong way and broke the MPC8555 eval system in the process. OFW, as well as FDT, describe the interrupt routing in terms of a controller and an interrupt pin on it. This needs to be mapped to a flat and global resource: the IRQ. The IRQ is the same as the PCI intline and as such needs to be representable in 8 bits. Secondly, ISA support pretty much dictates that IRQ 0-15 should be reserved for ISA interrupts, because of the internal workins of south bridges. Both were broken. This change reverts revision 209298 for a big part and re-implements it simpler. In particular: o The id() method of the PIC I/F is removed again. It's not needed. o The openpic_attach() function has been changed to take the OFW or FDT phandle of the controller as a second argument. All bus attachments that previously used openpic_attach() as the attach method of the device I/F now implement as bus-specific method and pass the phandle_t to the renamed openpic_attach(). o Change powerpc_register_pic() to take a few more arguments. In particular: - Pass the number of IPIs specificly. The number of IRQs carved out for a PIC is the sum of the number of int. pins and IPIs. - Pass a flag indicating whether the PIC is an AT-PIC or not. This tells the interrupt framework whether to assign IRQ 0-15 or some other range. o Until we implement proper multi-pass bus enumeration, we have to handle the case where we need to map from PIC+pin to IRQ *before* the PIC gets registered. This is done in a similar way as before, but rather than carving out 256 IRQs per PIC, we carve out 128 IRQs (124 pins + 4 IPIs). This is supposed to handle the G5 case, but should really be fixed properly using multiple passes. o Have the interrupt framework set root_pic in most cases and not put that burden in PIC drivers (for the most part). o Remove powerpc_ign_lookup() and replace it with powerpc_get_irq(). Remove IGN_SHIFT, INTR_INTLINE and INTR_IGN. Related to the above, fix the Freescale PCI controller driver, broken by the FDT code. Besides not attaching properly, bus numbers were assigned improperly and enumeration was broken in general. This prevented the AT PIC from being discovered and interrupt routing to work properly. Consequently, the ata(4) controller stopped functioning. Fix the driver, and FDT PCI support, enough to get the MPC8555CDS going again. The FDT PCI code needs a whole lot more work. No breakages are expected, but lackiong G5 hardware, it's possible that there are unpleasant side-effects. At least MPC85xx support is back to where it was 7 months ago -- it's amazing how badly support can be broken in just 7 months... Sponsored by: Juniper Networks
* Disable ATAPI DMA unconditionally on Apple Kauai ATA controllers, like itnwhitehorn2011-01-231-5/+6
| | | | | | | | is on the MacIO ones. It appears to be unreliable on all DBDMA-based controllers for unknown reasons, which should be figured out eventually. Tested by: Torfinn Ingolfsen MFC after: 1 week
* Remove unused variables. Spotted by a cppcheckandreast2011-01-201-9/+1
| | | | | | (devel/cppcheck, http://sourceforge.net/projects/cppcheck) run. Approved by: nwhitehorn (mentor)
* Correct parsing of the grackle and uninorthpci ranges property.andreast2011-01-204-4/+10
| | | | Approved by: nwhitehorn (mentor)
* Correct parsing of the cpcht ranges property.nwhitehorn2011-01-201-2/+3
| | | | | Submitted by: andreast MFC after: 2 weeks
* Add new functions, fcu_fan_set_pwm and fcu_fan_get_pwm, to set and getandreast2011-01-111-58/+172
| | | | | | | | | | | | | the pwm values. We can now set the fan's speed of a PWM controlled fan with % numbers between 30 and 100 % instead of trying to model a % number based on rpm. The fcu chip offers both, the dutycycle and the rpm value of the PWM controlled fans. I added the rpm value to the list of information available via sysctl(8). Tested by: Paul Mather <paul at gromit dlib vt edu> Approved by: nwhitehorn (mentor)
* Remove unused variables. Spotted by a cppcheckandreast2011-01-062-5/+0
| | | | | | (devel/cppcheck, http://sourceforge.net/projects/cppcheck) run. Approved by: nwhitehorn (mentor)
* Several chipset drivers alter parameters relevant for the DMA tag creation,marius2010-11-301-2/+1
| | | | | | | | | | | | | i.e. alignment, max_address, max_iosize and segsize (only max_address is thought to have an negative impact regarding this issue though), after calling ata_dmainit() either directly or indirectly so these values have no effect or at least no effect on the DMA tags and the defaults are used for the latter instead. So change the drivers to set these parameters up-front and ata_dmainit() to honor them. This file was missed in r216013. Submitted by: nwhitehorn
* Disabling CPU NAP modes during SMU commands is a hack needed only on U3nwhitehorn2010-11-101-2/+10
| | | | | systems. Don't use it on non-U3 systems to allow cpu_idle() to work correctly.
* Allow access to the HT I/O port space on the IBM CPC9X5 northbridge chips.nwhitehorn2010-10-301-1/+22
| | | | MFC after: 2 weeks
* Add three new drivers for fan control and temperature reading on theandreast2010-10-151-0/+506
| | | | | | | | | | | | | | | | PowerMac7,2. - The fcu driver lets us read and write the fan RPMs for all fans in the PowerMac7,2. This driver is PowerMac specific. - The ds1775 is a driver to read the temperature for the drive bay sensor. - The max6690 is another driver to read temperatures. Here it is used to read the inlet, the backside and the U3 heatsink temperature. An additional driver, the ad7417, will follow later. Thanks to nwhitehorn for guiding me through this driver development. Approved by: nwhitehorn (mentor)
* Increase register access delay to deal with the high-latency I2Candreast2010-09-151-1/+1
| | | | | | chipset found in some models of Powermac G5. Approved by: nwhitehorn (mentor)
* ATAPI DMA does not seem to work completely reliably on Shasta controllers,nwhitehorn2010-09-111-1/+3
| | | | especially in conjunction with ATA_CAM, so disable it for now.
* Restructure how reset and poweroff are handled on PowerPC systems, sincenwhitehorn2010-08-314-0/+358
| | | | | | | | | | | | | | | | | the existing code was very platform specific, and broken for SMP systems trying to reboot from KDB. - Add a new PLATFORM_RESET() method to the platform KOBJ interface, and migrate existing reset functions into platform modules. - Modify the OF_reboot() routine to submit the request by hand to avoid the IPIs involved in the regular openfirmware() routine. This fixes reboot from KDB on SMP machines. - Move non-KDB reset and poweroff functions on the Powermac platform into the relevant power control drivers (cuda, pmu, smu), instead of using them through the Open Firmware backdoor. - Rename platform_chrp to platform_powermac since it has become increasingly Powermac specific. When we gain support for IBM systems, we will grow a new platform_chrp.
* Fix printf specifier to allow 32/64 bit builds.grehan2010-07-121-1/+1
| | | | Obtained from: projects/ppc64
* Move the EOI logic when starting ithreads into intr_machdep instead ofnwhitehorn2010-07-061-3/+0
| | | | | relying on it as a side effect of PIC_MASK() in the PIC drivers, and add an inmplementation of assign_cpu() for the kernel interrupt layer.
* Remove the unneeded header <machine/intr.h>.marcel2010-07-024-4/+0
|
* Configure interrupts on SMP systems to be distributed among all onlinenwhitehorn2010-06-232-0/+2
| | | | | | CPUs by default, and provide a functional version of BUS_BIND_INTR(). While here, fix some potential concurrency problems in the interrupt handling code.
* Add MSI support for PCI devices attached to the CPC925 and CPC945 bridgesnwhitehorn2010-06-181-3/+160
| | | | found in Apple and IBM G5 systems.
* Add support for the Keywest I2C controller in Apple uninorth northbridges.nwhitehorn2010-06-181-2/+7
| | | | | | Although the Keywest registers have only 1 byte of content, they are secretly 4-byte registers, which became apparent from them moving on the big-endian Uninorth version of the controller.
* Change the default interrupt polarity on PowerPC systems from high to low.nwhitehorn2010-06-181-1/+1
| | | | | | On Apple systems at least, all the level interrupts are wired active low. Before this change, our PIC programming only worked because Apple hardware ignores the interrupt polarity bit on all interrupts except IRQ 0.
* Provide for multiple, cascaded PICs on PowerPC systems, and extend thenwhitehorn2010-06-188-19/+70
| | | | | | OFW interrupt map interface to also return the device's interrupt parent. MFC after: 8.1-RELEASE
* Add Open Firmware PNP info strings to GPIOs and Uninorth cells.nwhitehorn2010-06-062-0/+4
| | | | Submitted by: Andreas Tobler
* Add a driver for the CPU temperature sensors attached over I2C on thenwhitehorn2010-06-051-0/+262
| | | | PowerMac 11,2.
* Add support for the I2C busses hanging off Apple system management chips.nwhitehorn2010-06-051-12/+241
|
* Utilize the Keywest I2C combined mode for messages with repeated starts.nwhitehorn2010-06-051-8/+57
|
* Correct a typo.nwhitehorn2010-05-191-1/+1
| | | | Pointy hat to: me
* It is not necessary (and in some cases harmful) to hardcode ata_kauai'snwhitehorn2010-05-161-2/+3
| | | | | | IRQ to 39 on K2 devices, as well as Shasta ones. Reported by: Andreas Tobler
* Enable smu(4) to report fan speeds on late-model Powermac G5s.nwhitehorn2010-05-161-5/+28
|
* Add support for the U4 PCI-Express bridge chipset used in late-generationnwhitehorn2010-05-165-860/+1471
| | | | | | | | | | Powermac G5 systems. MSI and several other things are not presently supported. The U3/U4 internal device support portions of this change were contributed by Andreas Tobler. MFC after: 1 week
* Get nexus(4) out of the RTC business. The interface used by nexus(4)nwhitehorn2010-03-234-2/+190
| | | | | | | | | | in Open Firmware was Apple-specific, and we have complete coverage of Apple system controllers, so move RTC responsibilities into the system controller drivers. This avoids interesting problems from manipulating these devices through Open Firmware behind the backs of their drivers. Obtained from: NetBSD MFC after: 2 weeks
* Let unin(4) attach to U3 controllers found on G5 machines.nwhitehorn2010-03-201-5/+10
| | | | Submitted by: Andreas Tobler
* Rework smu(4) to be asynchronous. It turns out that the combination ofnwhitehorn2010-03-041-73/+181
| | | | | | the automatic fan management and the polling in smu_run_cmd() was putting my system interrupt load at 20%. This change reduces that to 0.4%.
* Add the ability to set SMU-based machines to restart automatically afternwhitehorn2010-02-241-0/+58
| | | | power loss.
OpenPOWER on IntegriCloud