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.
Showing the changes to include/linux (1 of 2 files). Show all
Unified · Split
| @@ -108,10 +108,7 @@ enum { · 107 unmodified lines | ||
| 108 | 108 | SWITCHTEC_GEN3_IMG1_RUNNING = 0x07, |
| 109 | 109 | }; |
| 110 | 110 | |
| 111 | −struct sys_info_regs { | |
| 112 | − u32 device_id; | |
| 113 | − u32 device_version; | |
| 114 | − u32 firmware_version; | |
| 111 | +struct sys_info_regs_gen3 { | |
| 115 | 112 | u32 reserved1; |
| 116 | 113 | u32 vendor_table_revision; |
| 117 | 114 | u32 table_format_version; |
| @@ -128,26 +125,36 @@ struct sys_info_regs { · 10 unmodified lines | ||
| 128 | 125 | u8 component_revision; |
| 129 | 126 | } __packed; |
| 130 | 127 | |
| 131 | −struct flash_info_regs { | |
| 128 | +struct sys_info_regs { | |
| 129 | + u32 device_id; | |
| 130 | + u32 device_version; | |
| 131 | + u32 firmware_version; | |
| 132 | + union { | |
| 133 | + struct sys_info_regs_gen3 gen3; | |
| 134 | + }; | |
| 135 | +} __packed; | |
| 136 | + | |
| 137 | +struct partition_info { | |
| 138 | + u32 address; | |
| 139 | + u32 length; | |
| 140 | +}; | |
| 141 | + | |
| 142 | +struct flash_info_regs_gen3 { | |
| 132 | 143 | u32 flash_part_map_upd_idx; |
| 133 | 144 | |
| 134 | − struct active_partition_info { | |
| 145 | + struct active_partition_info_gen3 { | |
| 135 | 146 | u32 address; |
| 136 | 147 | u32 build_version; |
| 137 | 148 | u32 build_string; |
| 138 | 149 | } active_img; |
| 139 | 150 | |
| 140 | − struct active_partition_info active_cfg; | |
| 141 | − struct active_partition_info inactive_img; | |
| 142 | − struct active_partition_info inactive_cfg; | |
| 151 | + struct active_partition_info_gen3 active_cfg; | |
| 152 | + struct active_partition_info_gen3 inactive_img; | |
| 153 | + struct active_partition_info_gen3 inactive_cfg; | |
| 143 | 154 | |
| 144 | 155 | u32 flash_length; |
| 145 | 156 | |
| 146 | − struct partition_info { | |
| 147 | − u32 address; | |
| 148 | − u32 length; | |
| 149 | − } cfg0; | |
| 150 | − | |
| 157 | + struct partition_info cfg0; | |
| 151 | 158 | struct partition_info cfg1; |
| 152 | 159 | struct partition_info img0; |
| 153 | 160 | struct partition_info img1; |
| @@ -155,6 +162,12 @@ struct flash_info_regs { · 1 unmodified line | ||
| 155 | 162 | struct partition_info vendor[8]; |
| 156 | 163 | }; |
| 157 | 164 | |
| 165 | +struct flash_info_regs { | |
| 166 | + union { | |
| 167 | + struct flash_info_regs_gen3 gen3; | |
| 168 | + }; | |
| 169 | +}; | |
| 170 | + | |
| 158 | 171 | enum { |
| 159 | 172 | SWITCHTEC_NTB_REG_INFO_OFFSET = 0x0000, |
| 160 | 173 | SWITCHTEC_NTB_REG_CTRL_OFFSET = 0x4000, |