summaryrefslogtreecommitdiff
path: root/include/linux/switchtec.h
diff options
context:
space:
mode:
authorKelvin Cao <kelvin.cao@microchip.com>2020-01-14 20:56:47 -0700
committerBjorn Helgaas <bhelgaas@google.com>2020-01-15 11:00:39 -0600
commit4efa1d2e36976d7b26f2e67f4c838330fbc91299 (patch)
tree4caab5002d4299e8ed65bcda5de6d65804893801 /include/linux/switchtec.h
parenta3321ca394082f403b447646d81c18ff6b39f4a6 (diff)
PCI/switchtec: Add Gen4 flash information interface support
Add the new flash_info registers struct and the implementation of ioctl_flash_part_info() for the new Gen4 hardware. [logang@deltatee.com: rewrote commit message] Link: https://lore.kernel.org/r/20200115035648.2578-7-logang@deltatee.com Signed-off-by: Kelvin Cao <kelvin.cao@microchip.com> Signed-off-by: Logan Gunthorpe <logang@deltatee.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'include/linux/switchtec.h')
-rw-r--r--include/linux/switchtec.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/include/linux/switchtec.h b/include/linux/switchtec.h
index d012520e5cc5..e85155244135 100644
--- a/include/linux/switchtec.h
+++ b/include/linux/switchtec.h
@@ -109,6 +109,30 @@ enum {
SWITCHTEC_GEN3_IMG1_RUNNING = 0x07,
};
+enum {
+ SWITCHTEC_GEN4_MAP0_RUNNING = 0x00,
+ SWITCHTEC_GEN4_MAP1_RUNNING = 0x01,
+ SWITCHTEC_GEN4_KEY0_RUNNING = 0x02,
+ SWITCHTEC_GEN4_KEY1_RUNNING = 0x03,
+ SWITCHTEC_GEN4_BL2_0_RUNNING = 0x04,
+ SWITCHTEC_GEN4_BL2_1_RUNNING = 0x05,
+ SWITCHTEC_GEN4_CFG0_RUNNING = 0x06,
+ SWITCHTEC_GEN4_CFG1_RUNNING = 0x07,
+ SWITCHTEC_GEN4_IMG0_RUNNING = 0x08,
+ SWITCHTEC_GEN4_IMG1_RUNNING = 0x09,
+};
+
+enum {
+ SWITCHTEC_GEN4_KEY0_ACTIVE = 0,
+ SWITCHTEC_GEN4_KEY1_ACTIVE = 1,
+ SWITCHTEC_GEN4_BL2_0_ACTIVE = 0,
+ SWITCHTEC_GEN4_BL2_1_ACTIVE = 1,
+ SWITCHTEC_GEN4_CFG0_ACTIVE = 0,
+ SWITCHTEC_GEN4_CFG1_ACTIVE = 1,
+ SWITCHTEC_GEN4_IMG0_ACTIVE = 0,
+ SWITCHTEC_GEN4_IMG1_ACTIVE = 1,
+};
+
struct sys_info_regs_gen3 {
u32 reserved1;
u32 vendor_table_revision;
@@ -205,9 +229,37 @@ struct flash_info_regs_gen3 {
struct partition_info vendor[8];
};
+struct flash_info_regs_gen4 {
+ u32 flash_address;
+ u32 flash_length;
+
+ struct active_partition_info_gen4 {
+ unsigned char bl2;
+ unsigned char cfg;
+ unsigned char img;
+ unsigned char key;
+ } active_flag;
+
+ u32 reserved[3];
+
+ struct partition_info map0;
+ struct partition_info map1;
+ struct partition_info key0;
+ struct partition_info key1;
+ struct partition_info bl2_0;
+ struct partition_info bl2_1;
+ struct partition_info cfg0;
+ struct partition_info cfg1;
+ struct partition_info img0;
+ struct partition_info img1;
+ struct partition_info nvlog;
+ struct partition_info vendor[8];
+};
+
struct flash_info_regs {
union {
struct flash_info_regs_gen3 gen3;
+ struct flash_info_regs_gen4 gen4;
};
};