aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/switchtec.h
diff options
context:
space:
mode:
authorLogan Gunthorpe <logang@deltatee.com>2020-01-14 20:56:45 -0700
committerBjorn Helgaas <bhelgaas@google.com>2020-01-15 11:00:38 -0600
commit993d208daaebebc3f3ec211e862a413a90e8d69b (patch)
treea993af82084899162abca599b55b2f276a4ff80e /include/linux/switchtec.h
parentPCI/switchtec: Factor out Gen3 ioctl_flash_part_info() (diff)
downloadlinux-dev-993d208daaebebc3f3ec211e862a413a90e8d69b.tar.xz
linux-dev-993d208daaebebc3f3ec211e862a413a90e8d69b.zip
PCI/switchtec: Separate Gen3 register structures into unions
Since the sys_info and flash_info registers differ significantly in Gen4 hardware, separate out the Gen3 registers into their own structure with a union in the main structure. No functional changes intended. Link: https://lore.kernel.org/r/20200115035648.2578-5-logang@deltatee.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.h41
1 files changed, 27 insertions, 14 deletions
diff --git a/include/linux/switchtec.h b/include/linux/switchtec.h
index d0b5816549ed..32a20d10b02e 100644
--- a/include/linux/switchtec.h
+++ b/include/linux/switchtec.h
@@ -108,10 +108,7 @@ enum {
SWITCHTEC_GEN3_IMG1_RUNNING = 0x07,
};
-struct sys_info_regs {
- u32 device_id;
- u32 device_version;
- u32 firmware_version;
+struct sys_info_regs_gen3 {
u32 reserved1;
u32 vendor_table_revision;
u32 table_format_version;
@@ -128,26 +125,36 @@ struct sys_info_regs {
u8 component_revision;
} __packed;
-struct flash_info_regs {
+struct sys_info_regs {
+ u32 device_id;
+ u32 device_version;
+ u32 firmware_version;
+ union {
+ struct sys_info_regs_gen3 gen3;
+ };
+} __packed;
+
+struct partition_info {
+ u32 address;
+ u32 length;
+};
+
+struct flash_info_regs_gen3 {
u32 flash_part_map_upd_idx;
- struct active_partition_info {
+ struct active_partition_info_gen3 {
u32 address;
u32 build_version;
u32 build_string;
} active_img;
- struct active_partition_info active_cfg;
- struct active_partition_info inactive_img;
- struct active_partition_info inactive_cfg;
+ struct active_partition_info_gen3 active_cfg;
+ struct active_partition_info_gen3 inactive_img;
+ struct active_partition_info_gen3 inactive_cfg;
u32 flash_length;
- struct partition_info {
- u32 address;
- u32 length;
- } cfg0;
-
+ struct partition_info cfg0;
struct partition_info cfg1;
struct partition_info img0;
struct partition_info img1;
@@ -155,6 +162,12 @@ struct flash_info_regs {
struct partition_info vendor[8];
};
+struct flash_info_regs {
+ union {
+ struct flash_info_regs_gen3 gen3;
+ };
+};
+
enum {
SWITCHTEC_NTB_REG_INFO_OFFSET = 0x0000,
SWITCHTEC_NTB_REG_CTRL_OFFSET = 0x4000,