can: rcar_canfd: Fix R-Car V3U GAFLCFG field accesses
Each Global Acceptance Filter List Configuration Register (GAFLCFG) contains two fields, and stores the number of channel rules for one channel pair. As R-Car V3U and later can have more than 2 channels, the field selection should be based on the LSB (even or odd) of the channel number, instead of on the full channel number. Fixes: 45721c406dcf50d4 ("can: rcar_canfd: Add support for r8a779a0 SoC") Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/all/36bcf0ffb96d6aaed970751f9546b901af638bcf.1674499048.git.geert+renesas@glider.be Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This commit is contained in:
parent
0a016639ef
commit
9be8c55835
@ -92,10 +92,10 @@
|
||||
/* RSCFDnCFDGAFLCFG0 / RSCFDnGAFLCFG0 */
|
||||
#define RCANFD_GAFLCFG_SETRNC(gpriv, n, x) \
|
||||
(((x) & reg_v3u(gpriv, 0x1ff, 0xff)) << \
|
||||
(reg_v3u(gpriv, 16, 24) - (n) * reg_v3u(gpriv, 16, 8)))
|
||||
(reg_v3u(gpriv, 16, 24) - ((n) & 1) * reg_v3u(gpriv, 16, 8)))
|
||||
|
||||
#define RCANFD_GAFLCFG_GETRNC(gpriv, n, x) \
|
||||
(((x) >> (reg_v3u(gpriv, 16, 24) - (n) * reg_v3u(gpriv, 16, 8))) & \
|
||||
(((x) >> (reg_v3u(gpriv, 16, 24) - ((n) & 1) * reg_v3u(gpriv, 16, 8))) & \
|
||||
reg_v3u(gpriv, 0x1ff, 0xff))
|
||||
|
||||
/* RSCFDnCFDGAFLECTR / RSCFDnGAFLECTR */
|
||||
|
Loading…
x
Reference in New Issue
Block a user