vendorcode/siemens: Add hwilib for Siemens specific info struct
[coreboot.git] / src / vendorcode / siemens / hwilib / hwilib.h
blobfb0798bc9b9b00355230b657e22eefaf4d0f320e
1 /*
2 * This file is part of the coreboot project.
4 * Copyright (C) 2014 Siemens AG
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
16 #ifndef SIEMENS_HWI_LIB_H_
17 #define SIEMENS_HWI_LIB_H_
19 #include <types.h>
22 /* Declare all supported fields which can be get with hwilib. */
23 typedef enum {
24 HIB_VerID = 0,
25 SIB_VerID,
26 EIB_VerID,
27 HIB_HwRev,
28 SIB_HwRev,
29 UniqueNum,
30 Mac1,
31 Mac1Aux,
32 Mac2,
33 Mac2Aux,
34 Mac3,
35 Mac3Aux,
36 Mac4,
37 Mac4Aux,
38 SPD,
39 FF_FreezeDis,
40 FF_FanReq,
41 BiosFlags,
42 MacMapping1,
43 MacMapping2,
44 MacMapping3,
45 MacMapping4,
46 PF_Color_Depth,
47 PF_DisplType,
48 PF_DisplCon,
49 Edid,
50 VddRef
51 } hwinfo_field_t;
53 /* Define used values in supported fields */
54 #define PF_COLOR_DEPTH_6BIT 0x00
55 #define PF_COLOR_DEPTH_8BIT 0x01
56 #define PF_COLOR_DEPTH_10BIT 0x02
57 #define PF_DISPLCON_LVDS_SINGLE 0x00
58 #define PF_DISPLCON_LVDS_DUAL 0x05
59 #define FF_FREEZE_DISABLE 0x01
60 #define FF_FAN_NEEDED 0x01
62 /* Use this function to find all supported blocks in cbfs. It must be called
63 * once with a valid cbfs file name before hwilib_get_field() can be used.
65 enum cb_err hwilib_find_blocks (const char *hwi_filename);
67 /* Use this function to get fields out of supported info blocks
68 * This function returns the number of copied bytes or 0 on error.
70 uint32_t hwilib_get_field (hwinfo_field_t field, uint8_t *data, uint32_t maxlen);
72 /* This functions needs to be implemented for every mainboard that uses i210. */
73 enum cb_err mainboard_get_mac_address(u16 bus, u8 devfn, u8 mac[6]);
74 #endif /* SIEMENS_HWI_LIB_H_ */