@@ -91,7 +91,7 @@
/* RSCFDnCFDGAFLECTR / RSCFDnGAFLECTR */
#define RCANFD_GAFLECTR_AFLDAE BIT(8)
-#define RCANFD_GAFLECTR_AFLPN(gpriv, x) ((x) & reg_gen4(gpriv, 0x7f, 0x1f))
+#define RCANFD_GAFLECTR_AFLPN(gpriv, page_num) ((page_num) & (gpriv)->info->max_aflpn)
/* RSCFDnCFDGAFLIDj / RSCFDnGAFLIDj */
#define RCANFD_GAFLID_GAFLLB BIT(29)
@@ -503,6 +503,7 @@ struct rcar_canfd_global;
struct rcar_canfd_hw_info {
u8 rnc_field_width;
+ u8 max_aflpn;
u8 max_channels;
u8 postdiv;
/* hardware features */
@@ -580,6 +581,7 @@ static const struct can_bittiming_const rcar_canfd_bittiming_const = {
static const struct rcar_canfd_hw_info rcar_gen3_hw_info = {
.rnc_field_width = 8,
+ .max_aflpn = 31,
.max_channels = 2,
.postdiv = 2,
.shared_global_irqs = 1,
@@ -587,6 +589,7 @@ static const struct rcar_canfd_hw_info rcar_gen3_hw_info = {
static const struct rcar_canfd_hw_info rcar_gen4_hw_info = {
.rnc_field_width = 16,
+ .max_aflpn = 127,
.max_channels = 8,
.postdiv = 2,
.shared_global_irqs = 1,
@@ -594,6 +597,7 @@ static const struct rcar_canfd_hw_info rcar_gen4_hw_info = {
static const struct rcar_canfd_hw_info rzg2l_hw_info = {
.rnc_field_width = 8,
+ .max_aflpn = 31,
.max_channels = 2,
.postdiv = 1,
.multi_channel_irqs = 1,