hw/net/can/flexcan: Remove RX SMB raw view
Use the existing `rx_smb0` message buffer view for register masks instead of the raw register array. Since all accesses now use the structured view, remove the redundant `rx_smb0_raw` union member. Signed-off-by: Bernhard Beschow <shentey@gmail.com> Tested-by: Pavel Pisa <pisa@fel.cvut.cz> Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com> Message-id: 20260723070059.6332-10-shentey@gmail.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Bernhard Beschow committed
Jul 27, 2026 at 10:28 UTC
62007626ac2d755b859bda231ca0ce8879a13636
2 files changed
+11
-6
hw/net/can/flexcan.c
+10
-2
@@ -106,7 +106,11 @@ static const FlexcanRegs flexcan_regs_write_mask = {
106
.gfwr_mx6 = 0xFFFFFFFF,
107
._reserved6 = {0},
108
._reserved8 = {0},
109
- .rx_smb0_raw = {0, 0, 0, 0},
109
+ .rx_smb0 = {
110
+ .can_ctrl = 0,
111
+ .can_id = 0,
112
+ .data = { 0, 0 },
113
+ },
114
.rx_smb1 = {0, 0, 0, 0},
115
};
116
static const FlexcanRegs flexcan_regs_reset_mask = {
@@ -145,7 +149,11 @@ static const FlexcanRegs flexcan_regs_reset_mask = {
149
.gfwr_mx6 = 0,
150
._reserved6 = {0},
151
._reserved8 = {0},
148
- .rx_smb0_raw = {0, 0, 0, 0},
152
+ .rx_smb0 = {
153
+ .can_ctrl = 0,
154
+ .can_id = 0,
155
+ .data = { 0, 0 },
156
+ },
157
.rx_smb1 = {0, 0, 0, 0},
158
};
159
include/hw/net/flexcan.h
+1
-4
@@ -81,10 +81,7 @@ typedef struct FlexcanRegs {
81
uint32_t _rx14mask; /* 0xAA8 */
82
uint32_t _rx15mask; /* 0xAAC */
83
uint32_t tx_smb[4]; /* 0xAB0 */
84
- union { /* 0xAC0, used for SMB emulation */
85
- uint32_t rx_smb0_raw[4];
86
- FlexcanRegsMessageBuffer rx_smb0;
87
- };
84
+ FlexcanRegsMessageBuffer rx_smb0; /* 0xAC0, used for SMB emulation */
85
uint32_t rx_smb1[4]; /* 0xAD0 */
86
uint32_t mecr; /* 0xAE0 */
87
uint32_t erriar; /* 0xAE4 */