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 | SWITCHTEC_GEN3_IMG1_RUNNING = 0x07, | 108 | SWITCHTEC_GEN3_IMG1_RUNNING = 0x07, |
| 109 | }; | 109 | }; |
| 110 | 110 | ||
| 111 | struct sys_info_regs { | 111 | struct sys_info_regs_gen3 { |
| 112 | u32 device_id; | ||
| 113 | u32 device_version; | ||
| 114 | u32 firmware_version; | ||
| 115 | u32 reserved1; | 112 | u32 reserved1; |
| 116 | u32 vendor_table_revision; | 113 | u32 vendor_table_revision; |
| 117 | u32 table_format_version; | 114 | u32 table_format_version; |
| @@ -128,26 +125,36 @@ struct sys_info_regs { · 10 unmodified lines | |||
| 128 | u8 component_revision; | 125 | u8 component_revision; |
| 129 | } __packed; | 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 | u32 flash_part_map_upd_idx; | 143 | u32 flash_part_map_upd_idx; |
| 133 | 144 | ||
| 134 | struct active_partition_info { | 145 | struct active_partition_info_gen3 { |
| 135 | u32 address; | 146 | u32 address; |
| 136 | u32 build_version; | 147 | u32 build_version; |
| 137 | u32 build_string; | 148 | u32 build_string; |
| 138 | } active_img; | 149 | } active_img; |
| 139 | 150 | ||
| 140 | struct active_partition_info active_cfg; | 151 | struct active_partition_info_gen3 active_cfg; |
| 141 | struct active_partition_info inactive_img; | 152 | struct active_partition_info_gen3 inactive_img; |
| 142 | struct active_partition_info inactive_cfg; | 153 | struct active_partition_info_gen3 inactive_cfg; |
| 143 | 154 | ||
| 144 | u32 flash_length; | 155 | u32 flash_length; |
| 145 | 156 | ||
| 146 | struct partition_info { | 157 | struct partition_info cfg0; |
| 147 | u32 address; | ||
| 148 | u32 length; | ||
| 149 | } cfg0; | ||
| 150 | |||
| 151 | struct partition_info cfg1; | 158 | struct partition_info cfg1; |
| 152 | struct partition_info img0; | 159 | struct partition_info img0; |
| 153 | struct partition_info img1; | 160 | struct partition_info img1; |
| @@ -155,6 +162,12 @@ struct flash_info_regs { · 1 unmodified line | |||
| 155 | struct partition_info vendor[8]; | 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 | enum { | 171 | enum { |
| 159 | SWITCHTEC_NTB_REG_INFO_OFFSET = 0x0000, | 172 | SWITCHTEC_NTB_REG_INFO_OFFSET = 0x0000, |
| 160 | SWITCHTEC_NTB_REG_CTRL_OFFSET = 0x4000, | 173 | SWITCHTEC_NTB_REG_CTRL_OFFSET = 0x4000, |