summaryrefslogtreecommitdiff
path: root/board/toradex/common/tdx-eeprom.h
diff options
context:
space:
mode:
authorIgor Opaniuk <igor.opaniuk@toradex.com>2020-04-06 22:22:16 +0300
committerIgor Opaniuk <igor.opaniuk@toradex.com>2020-05-04 21:42:21 +0300
commit4554a0918af7e74c934a3ad707aba10ef31e111a (patch)
tree5b595365e64bad1a7d7d5f1225fd92d39c619ac5 /board/toradex/common/tdx-eeprom.h
parentc4731c7ad61e1d4f022bfae14345956b07af47bd (diff)
toradex: tdx-cfg-block: add support for EEPROM
This introduces support for EEPROM as a storage for the main Toradex config block and additional config blocks on extra EEPROM chips (on carrier board or video adapters). To enable EEPROM as a storage for the main config block: TDX_HAVE_EEPROM=y. For additional EEPROMs please enable this Kconfig symbol: TDX_CFG_BLOCK_EXTRA=y. Information about existing EEPROM chips is provide via Device Tree using aliases. You can also write configuration for the carrier board using create_carrier subcommand for cfgblock. Example: Verdin iMX8MM # cfgblock create_carrier Supported carrier boards: UNKNOWN CARRIER = [0] Verdin Carrier Board = [1] Choose your carrier board (provide ID): 1 Enter carrier board version (e.g. V1.1B): V1.0A Enter carrier board serial number: 10622780 Also with barcode: cVerdin iMX8MM # cfgblock create carrier -y 0156100010622780 Relates-to: ELB-1402 Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Diffstat (limited to 'board/toradex/common/tdx-eeprom.h')
-rw-r--r--board/toradex/common/tdx-eeprom.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/board/toradex/common/tdx-eeprom.h b/board/toradex/common/tdx-eeprom.h
new file mode 100644
index 0000000000..a6772d2f3f
--- /dev/null
+++ b/board/toradex/common/tdx-eeprom.h
@@ -0,0 +1,14 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (c) 2020 Toradex
+ */
+
+#ifndef _TDX_EEPROM_H
+#define _TDX_EEPROM_H
+
+#include <i2c_eeprom.h>
+
+int read_tdx_eeprom_data(u32 eeprom_id, int offset, uint8_t *buf, int size);
+int write_tdx_eeprom_data(u32 eeprom_id, int offset, uint8_t *buf, int size);
+
+#endif /* _TDX_EEPROM_H */