[15/29] net/sfc/base: add definition of bundle metadata partition

Message ID 1560152324-20538-16-git-send-email-arybchenko@solarflare.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series net/sfc/base: update base driver |

Checks

Context Check Description
ci/Intel-compilation fail Compilation issues
ci/checkpatch warning coding style issues

Commit Message

Andrew Rybchenko June 10, 2019, 7:38 a.m. UTC
  From: Paul Fox <pfox@solarflare.com>

Signed-off-by: Paul Fox <pfox@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 drivers/net/sfc/base/ef10_nvram.c      |  1 +
 drivers/net/sfc/base/ef10_tlv_layout.h | 25 +++++++++++++++++++++++++
 drivers/net/sfc/base/efx.h             |  1 +
 3 files changed, 27 insertions(+)
  

Patch

diff --git a/drivers/net/sfc/base/ef10_nvram.c b/drivers/net/sfc/base/ef10_nvram.c
index ed88e83..8fc8fd9 100644
--- a/drivers/net/sfc/base/ef10_nvram.c
+++ b/drivers/net/sfc/base/ef10_nvram.c
@@ -2344,6 +2344,7 @@  static uint32_t checksum_tlv_partition(
 	PARTN_MAP_ENTRY(DYNCONFIG_DEFAULTS,	ALL,	DYNCONFIG_DEFAULTS),
 	PARTN_MAP_ENTRY(ROMCONFIG_DEFAULTS,	ALL,	ROMCONFIG_DEFAULTS),
 	PARTN_MAP_ENTRY(BUNDLE,			ALL,	BUNDLE),
+	PARTN_MAP_ENTRY(BUNDLE_METADATA,	ALL,	BUNDLE_METADATA),
 };
 
 static	__checkReturn		efx_rc_t
diff --git a/drivers/net/sfc/base/ef10_tlv_layout.h b/drivers/net/sfc/base/ef10_tlv_layout.h
index eaf24c5..bb1539f 100644
--- a/drivers/net/sfc/base/ef10_tlv_layout.h
+++ b/drivers/net/sfc/base/ef10_tlv_layout.h
@@ -41,6 +41,7 @@ 
  *        2: firmware internal use
  *        3: license partition
  *        4: tsa configuration
+ *        5: bundle update
  *
  *   -  TTT is a type, which is just a unique value.  The same type value
  *      might appear in both locations, indicating a relationship between
@@ -86,6 +87,30 @@ 
 #define TLV_TAG_INVALID                 (0xFFFFFFFF)
 
 
+/* TLV start.
+ *
+ * Marks the start of a TLV layout within a partition that may/may-not be
+ * a TLV partition. i.e. if a portion of data (at any offset) within a
+ * partition is expected to be in TLV format, then the first tag in this
+ * layout is expected to be TLV_TAG_START.
+ *
+ * This tag is not used in TLV layouts where the entire partition is TLV.
+ * Please continue using TLV_TAG_PARTITION_HEADER to indicate the start
+ * of TLV layout in such cases.
+ */
+
+#define TLV_TAG_START                   (0xEF10BA5E)
+
+struct tlv_start {
+  uint32_t tag;
+  uint32_t length;
+  /* Length of the TLV structure following this tag - includes length of all tags
+   * within the TLV layout starting with this TLV_TAG_START.
+   * Includes TLV_TAG_END. Does not include TLV_TAG_START
+   */
+  uint32_t tlv_layout_len;
+};
+
 /* TLV partition header.
  *
  * In a TLV partition, this must be the first item in the sequence, at offset
diff --git a/drivers/net/sfc/base/efx.h b/drivers/net/sfc/base/efx.h
index 4385379..6b6538c 100644
--- a/drivers/net/sfc/base/efx.h
+++ b/drivers/net/sfc/base/efx.h
@@ -1605,6 +1605,7 @@  enum {
 	EFX_NVRAM_DYNCONFIG_DEFAULTS,
 	EFX_NVRAM_ROMCONFIG_DEFAULTS,
 	EFX_NVRAM_BUNDLE,
+	EFX_NVRAM_BUNDLE_METADATA,
 	EFX_NVRAM_NTYPES,
 } efx_nvram_type_t;