aboutsummaryrefslogtreecommitdiff
path: root/src/drivers/secunet/dmi/eeprom.h
diff options
context:
space:
mode:
authorNico Huber <nico.huber@secunet.com>2019-10-24 15:14:42 +0200
committerPatrick Georgi <pgeorgi@google.com>2020-03-25 10:51:10 +0000
commit34d8036333ed1d16d1ef48d3a7c98cc7c7592599 (patch)
tree865ecb72bc17ec418ee64e9ea4c5752ea1005881 /src/drivers/secunet/dmi/eeprom.h
parentdafcc7a26dece2cbd73a6a4f761b3fb3963bd260 (diff)
drivers/secunet: Add driver to read DMI info from I2C EEPROM
The EEPROM layout is rather arbitrary and /just happened/. It needs a 256kbit part at least. Change-Id: Iae5c9138e8404acfc3a43dc2c7b55d47d4147060 Signed-off-by: Nico Huber <nico.huber@secunet.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/36298 Reviewed-by: Patrick Georgi <pgeorgi@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/drivers/secunet/dmi/eeprom.h')
-rw-r--r--src/drivers/secunet/dmi/eeprom.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/src/drivers/secunet/dmi/eeprom.h b/src/drivers/secunet/dmi/eeprom.h
new file mode 100644
index 0000000000..c4cdd4142e
--- /dev/null
+++ b/src/drivers/secunet/dmi/eeprom.h
@@ -0,0 +1,62 @@
+/*
+ * 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 _SECUNET_DMI_EEPROM_H
+#define _SECUNET_DMI_EEPROM_H
+
+#include <stdint.h>
+
+enum bx26_strings {
+ BOARD_MATNR,
+ BOARD_SERIAL_NUMBER,
+ BOARD_VERSION,
+ BOARD_MCTRL_FW_VERSION,
+ BOARD_CCR_FW_VERSION,
+ BOARD_NIC_FW_VERSION,
+ BOARD_LP_VERSION,
+ BOARD_VERSION_ID,
+
+ SYSTEM_PRODUCT_NAME,
+ SYSTEM_VERSION,
+ SYSTEM_SERIAL_NUMBER,
+ SYSTEM_UUID,
+ SYSTEM_MANUFACTURER,
+ SYSTEM_PRODUCTION_DATE,
+ SYSTEM_MLFB,
+ SYSTEM_MATNR,
+};
+
+struct bx26_location {
+ uint16_t offset;
+ uint16_t length;
+};
+
+static const struct bx26_location bx26_locations[] = {
+ [BOARD_MATNR] = { 0x0000, 0x20 },
+ [BOARD_SERIAL_NUMBER] = { 0x0020, 0x20 },
+ [BOARD_VERSION] = { 0x0040, 0x20 },
+ [BOARD_MCTRL_FW_VERSION] = { 0x0060, 0x20 },
+ [BOARD_CCR_FW_VERSION] = { 0x0080, 0x20 },
+ [BOARD_NIC_FW_VERSION] = { 0x00a0, 0x20 },
+ [BOARD_LP_VERSION] = { 0x00c0, 0x20 },
+ [BOARD_VERSION_ID] = { 0x0100, 0x20 },
+
+ [SYSTEM_PRODUCT_NAME] = { 0x4000, 0x20 },
+ [SYSTEM_VERSION] = { 0x4040, 0x10 },
+ [SYSTEM_SERIAL_NUMBER] = { 0x4060, 0x10 },
+ [SYSTEM_UUID] = { 0x4080, 0x24 },
+ [SYSTEM_MANUFACTURER] = { 0x40c0, 0x20 },
+ [SYSTEM_PRODUCTION_DATE] = { 0x4100, 0x20 },
+ [SYSTEM_MLFB] = { 0x4140, 0x20 },
+ [SYSTEM_MATNR] = { 0x4180, 0x20 },
+};
+
+#endif