aboutsummaryrefslogtreecommitdiff
path: root/src/vendorcode/siemens/hwilib/hwilib.h
diff options
context:
space:
mode:
authorWerner Zeh <werner.zeh@siemens.com>2016-04-22 14:14:45 +0200
committerWerner Zeh <werner.zeh@siemens.com>2016-04-28 08:15:47 +0200
commit223498fa16c8de69b2649c669d2fba43ecf364d8 (patch)
tree28556151b37e2c7b73fd294d1a9a542ccf54bbe5 /src/vendorcode/siemens/hwilib/hwilib.h
parent1bd0c0c4971ce50426cbe18e93e2ec9dca320af1 (diff)
vendorcode/siemens: Add hwilib for Siemens specific info struct
Add a library which unifies access to Siemens specific hardware information data. This library is meant to be used with Siemens platforms and can be selected in Kconfig. The needed source of information has to be present in cbfs. This lib can be used in romstage and ramstage. Change-Id: I2c6e003b0c123b4cf6a84906c2b133b8c38c8b1a Signed-off-by: Werner Zeh <werner.zeh@siemens.com> Reviewed-on: https://review.coreboot.org/14505 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Tested-by: build bot (Jenkins)
Diffstat (limited to 'src/vendorcode/siemens/hwilib/hwilib.h')
-rw-r--r--src/vendorcode/siemens/hwilib/hwilib.h74
1 files changed, 74 insertions, 0 deletions
diff --git a/src/vendorcode/siemens/hwilib/hwilib.h b/src/vendorcode/siemens/hwilib/hwilib.h
new file mode 100644
index 0000000000..fb0798bc9b
--- /dev/null
+++ b/src/vendorcode/siemens/hwilib/hwilib.h
@@ -0,0 +1,74 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2014 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_HWI_LIB_H_
+#define SIEMENS_HWI_LIB_H_
+
+#include <types.h>
+
+
+/* Declare all supported fields which can be get with hwilib. */
+typedef enum {
+ HIB_VerID = 0,
+ SIB_VerID,
+ EIB_VerID,
+ HIB_HwRev,
+ SIB_HwRev,
+ UniqueNum,
+ Mac1,
+ Mac1Aux,
+ Mac2,
+ Mac2Aux,
+ Mac3,
+ Mac3Aux,
+ Mac4,
+ Mac4Aux,
+ SPD,
+ FF_FreezeDis,
+ FF_FanReq,
+ BiosFlags,
+ MacMapping1,
+ MacMapping2,
+ MacMapping3,
+ MacMapping4,
+ PF_Color_Depth,
+ PF_DisplType,
+ PF_DisplCon,
+ Edid,
+ VddRef
+} hwinfo_field_t;
+
+/* Define used values in supported fields */
+#define PF_COLOR_DEPTH_6BIT 0x00
+#define PF_COLOR_DEPTH_8BIT 0x01
+#define PF_COLOR_DEPTH_10BIT 0x02
+#define PF_DISPLCON_LVDS_SINGLE 0x00
+#define PF_DISPLCON_LVDS_DUAL 0x05
+#define FF_FREEZE_DISABLE 0x01
+#define FF_FAN_NEEDED 0x01
+
+/* Use this function to find all supported blocks in cbfs. It must be called
+ * once with a valid cbfs file name before hwilib_get_field() can be used.
+ */
+enum cb_err hwilib_find_blocks (const char *hwi_filename);
+
+/* Use this function to get fields out of supported info blocks
+ * This function returns the number of copied bytes or 0 on error.
+ */
+uint32_t hwilib_get_field (hwinfo_field_t field, uint8_t *data, uint32_t maxlen);
+
+/* This functions needs to be implemented for every mainboard that uses i210. */
+enum cb_err mainboard_get_mac_address(u16 bus, u8 devfn, u8 mac[6]);
+#endif /* SIEMENS_HWI_LIB_H_ */