summaryrefslogtreecommitdiff
path: root/src/drivers/i2c/lm96000/lm96000.h
diff options
context:
space:
mode:
authorNico Huber <nico.h@gmx.de>2017-08-24 23:30:44 +0200
committerNico Huber <nico.h@gmx.de>2019-03-14 18:31:53 +0000
commitffea237038f05823796570554f6a84c1f898d900 (patch)
treec2e03fedcb0039a1950f1881f3e1dfc7ed73b462 /src/drivers/i2c/lm96000/lm96000.h
parenta3f643a3c0b350703d2531bb54530b102fe68caf (diff)
drivers/i2c/lm96000: Add new hardware-monitoring IC
LM96000 is the successor of the famous LM85. Change-Id: Ie7df3107bffb7f8e45e71c4c1fbe4eb0a9e3cd03 Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/21194 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Diffstat (limited to 'src/drivers/i2c/lm96000/lm96000.h')
-rw-r--r--src/drivers/i2c/lm96000/lm96000.h65
1 files changed, 65 insertions, 0 deletions
diff --git a/src/drivers/i2c/lm96000/lm96000.h b/src/drivers/i2c/lm96000/lm96000.h
new file mode 100644
index 0000000000..6df4fdeef3
--- /dev/null
+++ b/src/drivers/i2c/lm96000/lm96000.h
@@ -0,0 +1,65 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2017 secunet Security Networks AG
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef DRIVERS_I2C_LM96000_H
+#define DRIVERS_I2C_LM96000_H
+
+#include "chip.h"
+
+#define LM96000_CONFIG 0x40
+#define LM96000_READY (0x1 << 2)
+#define LM96000_START (0x1 << 0)
+
+#define LM96000_VIN(v) (0x20 + (v))
+#define LM96000_VIN_LOW_LIMIT(v) (0x44 + (v) * 2)
+#define LM96000_VIN_HIGH_LIMIT(v) (0x45 + (v) * 2)
+
+#define LM96000_TEMP_IN(temp) (0x25 + (temp))
+#define LM96000_TEMP_LOW_LIMIT(temp) (0x4e + (temp) * 2)
+#define LM96000_TEMP_HIGH_LIMIT(temp) (0x4f + (temp) * 2)
+
+/* 2B, little endian, MSB is latched upon LSB read */
+#define LM96000_FAN_IN(fan) (0x28 + (fan) * 2)
+#define LM96000_FAN_LOW_LIMIT(fan) (0x54 + (fan) * 2)
+
+#define LM96000_FAN_DUTY(fan) (0x30 + (fan))
+#define LM96000_FAN_CFG(fan) (0x5c + (fan))
+#define LM96000_FAN_CFG_MODE_SHIFT 5
+#define LM96000_FAN_CFG_MODE_MASK (0x7 << LM96000_FAN_CFG_MODE_SHIFT)
+#define LM96000_FAN_CFG_PWM_INVERT (0x1 << 4)
+#define LM96000_FAN_CFG_SPINUP_MASK (0x7 << 0)
+#define LM96000_FAN_FREQ(fan) (0x5f + (fan))
+#define LM96000_FAN_FREQ_MASK (0xf << 0)
+#define LM96000_FAN_MIN_OFF 0x62
+#define LM96000_FAN_MIN(fan) (1 << ((fan) + 5))
+#define LM96000_FAN_MIN_PWM(fan) (0x64 + (fan))
+#define LM96000_TACH_MONITOR_MODE 0x74
+#define LM96000_TACH_MODE_FAN_SHIFT(f) ((f) * 2)
+#define LM96000_TACH_MODE_FAN_MASK(f) (0x3 << LM96000_TACH_MODE_FAN_SHIFT(f))
+
+#define LM96000_ZONE_RANGE(zone) (0x5f + (zone))
+#define LM96000_ZONE_RANGE_SHIFT 4
+#define LM96000_ZONE_RANGE_MASK (0xf << LM96000_ZONE_RANGE_SHIFT)
+#define LM96000_ZONE_SMOOTH(zone) (0x62 + ((zone) + 1) / 2)
+#define LM96000_ZONE_SMOOTH_EN(zone) (1 << (((zone) % 2) * 4 + 3))
+#define LM96000_ZONE_SMOOTH_SHFT(zone) (((zone) % 2) * 4)
+#define LM96000_ZONE_SMOOTH_MASK(zone) (0x7 << LM96000_ZONE_SMOOTH_SHFT(zone))
+#define LM96000_ZONE_TEMP_LOW(zone) (0x67 + (zone))
+#define LM96000_ZONE_TEMP_PANIC(zone) (0x6a + (zone))
+#define LM96000_ZONE_HYSTERESIS(zone) (0x6d + (zone) / 2)
+#define LM96000_ZONE_HYST_SHIFT(zone) (4 - ((zone) % 2) * 4)
+#define LM96000_ZONE_HYST_MASK(zone) (0xf << LM96000_ZONE_HYST_SHIFT(zone))
+
+#endif /* DRIVERS_I2C_LM96000_H */