Commit Graph

20 Commits

Author SHA1 Message Date
Nathan Whitehorn
65d08437ef Move Open Firmware device root on PowerPC, ARM, and MIPS systems to
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
2014-02-05 14:44:22 +00:00
Nathan Whitehorn
7f3d2746af Only check fan type once. Not only is continuously rechecking pointless, a
single random failure can reprogram what control mechanism we try to use.

MFC after:	2 weeks
2013-05-05 22:42:10 +00:00
Andreas Tobler
0cb9915474 Add support for PWM controlled fans. I found these fans on my PowerMac9,1.
These fans are not located under the same node as the the RPM controlled ones,
So I had to adapt the current source to parse and fill the properties correctly.
To control the fans we can set the PWM ratio via sysctl between 20 and 100%.

Tested by:	nwhitehorn
MFC after:	3 weeks
2012-03-04 08:43:33 +00:00
Ed Schouten
d745c852be Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs.
This means that their use is restricted to a single C file.
2011-11-07 06:44:47 +00:00
Nathan Whitehorn
d54e775e1e Add the next digit of precision to temperatures, which I missed when
converting the reporting format from degrees C to 0.1 degree K.
2011-05-29 20:04:02 +00:00
Nathan Whitehorn
ad84e440a6 Require an error instead of a timeout to decide the new-style fan
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
2011-05-28 21:54:18 +00:00
Nathan Whitehorn
84d7767618 Factor out the SMU fan management code into a new module (powermac_thermal)
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
2011-05-28 21:13:22 +00:00
Nathan Whitehorn
f4338dac9f Don't sleep while setting the clock. This can cause panics when
periodic_resettodr() calls CLOCK_SETTIME() and smu tries to sleep while
running from a callout.

Reported by:	Torfinn Ingolfsen
2011-03-13 21:23:25 +00:00
Nathan Whitehorn
a62a5fd29a Disabling CPU NAP modes during SMU commands is a hack needed only on U3
systems. Don't use it on non-U3 systems to allow cpu_idle() to work
correctly.
2010-11-10 20:09:05 +00:00
Nathan Whitehorn
b2a237be5c Restructure how reset and poweroff are handled on PowerPC systems, since
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.
2010-08-31 15:27:46 +00:00
Nathan Whitehorn
45f7ed017f Add support for the I2C busses hanging off Apple system management chips. 2010-06-05 17:50:20 +00:00
Nathan Whitehorn
bf17422a43 Enable smu(4) to report fan speeds on late-model Powermac G5s. 2010-05-16 19:57:38 +00:00
Nathan Whitehorn
3df9e0375a Get nexus(4) out of the RTC business. The interface used by nexus(4)
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
2010-03-23 03:14:44 +00:00
Nathan Whitehorn
98dc296435 Rework smu(4) to be asynchronous. It turns out that the combination of
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%.
2010-03-04 06:36:00 +00:00
Nathan Whitehorn
823d02a093 Add the ability to set SMU-based machines to restart automatically after
power loss.
2010-02-24 01:27:36 +00:00
Nathan Whitehorn
90a1456b12 Provide a new useless feature: an led(4) interface for the system's sleep
LED.
2010-02-22 18:49:43 +00:00
Nathan Whitehorn
f41c8c170f Add a simple fan management callout to the SMU driver. This is designed
such that a fancier thermal management algorithm can be run from user
space, but the kernel will at least ensure your machine does not either
sound like a wind tunnel or catch fire.
2010-02-21 22:13:57 +00:00
Nathan Whitehorn
ddc58b9379 Fix several mistakes in this file, in order to allow individual fan speeds
to be read and set correctly.
2010-02-21 21:03:37 +00:00
Nathan Whitehorn
6abc7eb7f7 Allow the SMU driver to read a variety of hardware sensors (possible
questions on the thermal calibration), and to read and set fan RPMs from
software. While here, fix a number of bugs.

Calibration code from:	OpenBSD
MFC after:	2 weeks
2010-02-19 04:37:54 +00:00
Nathan Whitehorn
1016f143f0 Add cpufreq support on the PowerPC G5, along with a skeleton SMU driver
in order to slew CPU voltage during frequency changes. The OpenBSD SMU
driver was an extremely helpful reference for this.
2009-06-23 04:28:32 +00:00