diff options
Diffstat (limited to 'chip')
-rw-r--r-- | chip/lm4/gpio.c | 3 | ||||
-rw-r--r-- | chip/lm4/peci.c | 17 |
2 files changed, 15 insertions, 5 deletions
diff --git a/chip/lm4/gpio.c b/chip/lm4/gpio.c index 38b5e7ed46..7bed71bbc6 100644 --- a/chip/lm4/gpio.c +++ b/chip/lm4/gpio.c @@ -47,8 +47,9 @@ void gpio_set_alternate_function(uint32_t port, uint32_t mask, int func) int port_index = find_gpio_port_index(port); int cgmask; + /* Ignore (do nothing for) invalid port values */ if (port_index < 0) - return; /* TODO: assert */ + return; /* Enable the GPIO port in run and sleep. */ cgmask = 1 << port_index; diff --git a/chip/lm4/peci.c b/chip/lm4/peci.c index 7f0d692439..74f081d6c4 100644 --- a/chip/lm4/peci.c +++ b/chip/lm4/peci.c @@ -16,8 +16,13 @@ #include "temp_sensor.h" #include "util.h" -/* Max junction temperature for processor in degrees C */ -/* TODO: read TjMax from processor via PECI */ +/* + * Max junction temperature for processor in degrees C. This is correct for + * Ivy Bridge and Haswell; future chips don't have PECI. + * + * In theory we could read TjMax from the processor via PECI, but that requires + * closed-source Intel PECI commands. + */ #define PECI_TJMAX 105 /* Initial PECI baud rate */ @@ -26,8 +31,12 @@ /* Polling interval for PECI, in ms */ #define PECI_POLL_INTERVAL_MS 250 -/* Internal and external path delays, in ns */ -#define PECI_TD_FET_NS 60 /* Guess; TODO: what is real delay */ +/* + * Internal and external path delays, in ns. The external delay is a + * best-guess measurement, but we're fairly tolerant of a bad guess because + * PECI_BAUD_RATE is slow compared to PECI's actual maximum baud rate. + */ +#define PECI_TD_FET_NS 60 #define PECI_TD_INT_NS 80 /* Number of controller retries. Should be between 0 and 7. */ |