summaryrefslogtreecommitdiff
path: root/drivers/net/wwan/iosm/iosm_ipc_devlink.h
diff options
context:
space:
mode:
authorM Chetan Kumar <m.chetan.kumar@linux.intel.com>2021-10-02 17:32:12 +0300
committerDavid S. Miller <davem@davemloft.net>2021-10-02 18:05:20 +0300
commitb8aa16541d73994dc18c5e8789124f26189ed656 (patch)
tree9cc7697ccfb016eb67f908ce342e7766bbec495b /drivers/net/wwan/iosm/iosm_ipc_devlink.h
parente9637775c05f2bbae24f060a91b7f8459bbe2286 (diff)
downloadlinux-b8aa16541d73994dc18c5e8789124f26189ed656.tar.xz
net: wwan: iosm: correct devlink extra params
1. Removed driver specific extra params like download_region, address & region_count. The required information is passed as part of flash API. 2. IOSM Devlink documentation updated to reflect the same. Signed-off-by: M Chetan Kumar <m.chetan.kumar@linux.intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wwan/iosm/iosm_ipc_devlink.h')
-rw-r--r--drivers/net/wwan/iosm/iosm_ipc_devlink.h44
1 files changed, 30 insertions, 14 deletions
diff --git a/drivers/net/wwan/iosm/iosm_ipc_devlink.h b/drivers/net/wwan/iosm/iosm_ipc_devlink.h
index fa2b388a2f8a..35c2d013b9cc 100644
--- a/drivers/net/wwan/iosm/iosm_ipc_devlink.h
+++ b/drivers/net/wwan/iosm/iosm_ipc_devlink.h
@@ -12,6 +12,18 @@
#include "iosm_ipc_imem_ops.h"
#include "iosm_ipc_pcie.h"
+/* Image ext max len */
+#define IOSM_DEVLINK_MAX_IMG_LEN 3
+/* Magic Header */
+#define IOSM_DEVLINK_MAGIC_HEADER "IOSM_DEVLINK_HEADER"
+/* Magic Header len */
+#define IOSM_DEVLINK_MAGIC_HEADER_LEN 20
+/* Devlink image type */
+#define IOSM_DEVLINK_IMG_TYPE 4
+/* Reserve header size */
+#define IOSM_DEVLINK_RESERVED 34
+/* Devlink Image Header size */
+#define IOSM_DEVLINK_HDR_SIZE sizeof(struct iosm_devlink_image)
/* MAX file name length */
#define IOSM_MAX_FILENAME_LEN 32
/* EBL response size */
@@ -32,19 +44,11 @@
* enum iosm_devlink_param_id - Enum type to different devlink params
* @IOSM_DEVLINK_PARAM_ID_BASE: Devlink param base ID
* @IOSM_DEVLINK_PARAM_ID_ERASE_FULL_FLASH: Set if full erase required
- * @IOSM_DEVLINK_PARAM_ID_DOWNLOAD_REGION: Set if fls file to be
- * flashed is Loadmap/region file
- * @IOSM_DEVLINK_PARAM_ID_ADDRESS: Address of the region to be
- * flashed
- * @IOSM_DEVLINK_PARAM_ID_REGION_COUNT: Max region count
*/
enum iosm_devlink_param_id {
IOSM_DEVLINK_PARAM_ID_BASE = DEVLINK_PARAM_GENERIC_ID_MAX,
IOSM_DEVLINK_PARAM_ID_ERASE_FULL_FLASH,
- IOSM_DEVLINK_PARAM_ID_DOWNLOAD_REGION,
- IOSM_DEVLINK_PARAM_ID_ADDRESS,
- IOSM_DEVLINK_PARAM_ID_REGION_COUNT,
};
/**
@@ -94,23 +98,35 @@ struct iosm_devlink_sio {
/**
* struct iosm_flash_params - List of flash params required for flashing
- * @address: Address of the region file to be flashed
- * @region_count: Maximum no of regions for each fls file
- * @download_region: To be set if region is being flashed
* @erase_full_flash: To set the flashing mode
* erase_full_flash = 1; full erase
* erase_full_flash = 0; no erase
* @erase_full_flash_done: Flag to check if it is a full erase
*/
struct iosm_flash_params {
- u32 address;
- u8 region_count;
- u8 download_region;
u8 erase_full_flash;
u8 erase_full_flash_done;
};
/**
+ * struct iosm_devlink_image - Structure with Fls file header info
+ * @magic_header: Header of the firmware image
+ * @image_type: Firmware image type
+ * @region_address: Address of the region to be flashed
+ * @download_region: Field to identify if it is a region
+ * @last_region: Field to identify if it is last region
+ * @reserved: Reserved field
+ */
+struct iosm_devlink_image {
+ char magic_header[IOSM_DEVLINK_MAGIC_HEADER_LEN];
+ char image_type[IOSM_DEVLINK_IMG_TYPE];
+ __le32 region_address;
+ u8 download_region;
+ u8 last_region;
+ u8 reserved[IOSM_DEVLINK_RESERVED];
+} __packed;
+
+/**
* struct iosm_ebl_ctx_data - EBL ctx data used during flashing
* @ebl_sw_info_version: SWID version info obtained from EBL
* @m_ebl_resp: Buffer used to read and write the ebl data