val = u32_encode_bits(granularity, AGGR_GRANULARITY);
iowrite32(val, ipa->reg_virt + IPA_REG_COUNTER_CFG_OFFSET);
- /* Disable hashed IPv4 and IPv6 routing and filtering for IPA v4.2 */
- if (ipa->version == IPA_VERSION_4_2)
- iowrite32(0, ipa->reg_virt + IPA_REG_FILT_ROUT_HASH_EN_OFFSET);
+ /* IPA v4.2 does not support hashed tables, so disable them */
+ if (ipa->version == IPA_VERSION_4_2) {
+ u32 offset = ipa_reg_filt_rout_hash_en_offset(ipa->version);
+
+ iowrite32(0, ipa->reg_virt + offset);
+ }
/* Enable dynamic clock division */
ipa_hardware_dcd_config(ipa);
}
/* ipa->available defines the valid bits in the STATE_AGGR_ACTIVE register */
-/* The next register is present for IPA v4.2 and above */
-#define IPA_REG_FILT_ROUT_HASH_EN_OFFSET 0x00000148
+static inline u32 ipa_reg_filt_rout_hash_en_offset(enum ipa_version version)
+{
+ if (version == IPA_VERSION_3_5_1)
+ return 0x000008c;
+
+ return 0x0000148;
+}
static inline u32 ipa_reg_filt_rout_hash_flush_offset(enum ipa_version version)
{