aboutsummaryrefslogtreecommitdiff
path: root/src/drivers/siemens/nc_fpga/nc_fpga.h
diff options
context:
space:
mode:
authorWerner Zeh <werner.zeh@siemens.com>2016-07-05 07:16:34 +0200
committerStefan Reinauer <stefan.reinauer@coreboot.org>2016-07-06 22:38:58 +0200
commit6c571462e54f702b17737a344dcd3af0be21a294 (patch)
tree1362a825f952fef726df9de2ef91f662f6ba98b4 /src/drivers/siemens/nc_fpga/nc_fpga.h
parent9007ffd3d1b7c079c791e90ec52243eac385979f (diff)
siemens/nc_fpga: Add driver for Siemens NC FPGA
Add driver code to initialize Siemens NC FPGA as PCI device. Beside some glue logic it contains a FAN controller and temperature monitor. Change-Id: I2cb722a60081028ee5a8251f51125f12ed38d824 Signed-off-by: Werner Zeh <werner.zeh@siemens.com> Reviewed-on: https://review.coreboot.org/15543 Tested-by: build bot (Jenkins) Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Diffstat (limited to 'src/drivers/siemens/nc_fpga/nc_fpga.h')
-rw-r--r--src/drivers/siemens/nc_fpga/nc_fpga.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/src/drivers/siemens/nc_fpga/nc_fpga.h b/src/drivers/siemens/nc_fpga/nc_fpga.h
new file mode 100644
index 0000000000..886f3dda05
--- /dev/null
+++ b/src/drivers/siemens/nc_fpga/nc_fpga.h
@@ -0,0 +1,64 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2016 Siemens 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 _SIEMENS_NC_FPGA_H_
+#define _SIEMENS_NC_FPGA_H_
+
+#define NC_MAGIC_OFFSET 0x020
+#define NC_FPGA_MAGIC 0x4E433746
+#define NC_CAP1_OFFSET 0x080
+#define NC_CAP1_FAN_CTRL 0x080
+#define NC_CAP1_TEMP_MON 0x100
+#define NC_FANMON_CTRL_OFFSET 0x400
+
+#define MAX_NUM_SENSORS 4
+
+typedef struct {
+ uint16_t rmin;
+ uint16_t rmax;
+ uint16_t nmin;
+ uint16_t nmax;
+} temp_cc_t;
+
+typedef struct {
+ uint16_t res0;
+ uint8_t sensornum;
+ uint8_t res1;
+ uint32_t sensordelay;
+ uint32_t res2[4];
+ temp_cc_t sensorcfg[8];
+ uint32_t res3[4];
+ uint8_t sensorselect;
+ uint8_t res4[3];
+ uint16_t t_warn;
+ uint16_t t_crit;
+ uint16_t res5;
+ uint8_t res6[2];
+ uint32_t samplingtime;
+ uint16_t setpoint;
+ uint8_t hystctrl;
+ uint8_t res7;
+ uint16_t kp;
+ uint16_t ki;
+ uint16_t kd;
+ uint16_t res8[2];
+ uint16_t fanmax;
+ uint16_t hystval;
+ uint16_t hystthreshold;
+ uint16_t res9[4];
+ uint32_t fanmon;
+} __attribute__ ((packed)) fan_ctrl_t;
+
+#endif /* _SIEMENS_NC_FPGA_H_ */