Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7072ea14 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: ipa: driver changes for new IPAv2.5 core design behavior"

parents 3f9cd22b 86d8c17a
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -2505,6 +2505,12 @@ static int ipa_init(const struct ipa_plat_drv_res *resource_p,

	IPADBG("IPA Driver initialization started\n");

	/*
	 * since structure alignment is implementation dependent, add test to
	 * avoid different and incompatible data layouts
	 */
	BUILD_BUG_ON(sizeof(struct ipa_hw_pkt_status) != IPA_PKT_STATUS_SIZE);

	ipa_ctx = kzalloc(sizeof(*ipa_ctx), GFP_KERNEL);
	if (!ipa_ctx) {
		IPAERR(":kzalloc err.\n");
+27 −12
Original line number Diff line number Diff line
@@ -290,7 +290,7 @@ struct ipa_ip_packet_tag_status {
	u32 tag_f_2:32;
};

/*! @brief Struct for the the IPA UL packet status header */
/*! @brief Struct for the IPAv2.0 and IPAv2.5 UL packet status header */
struct ipa_hw_pkt_status {
	u32 status_opcode:8;
	u32 exception:8;
@@ -301,6 +301,8 @@ struct ipa_hw_pkt_status {
	u32 endp_dest_idx:5;
	u32 reserved_2:3;
	u32 metadata:32;
	union {
		struct {
			u32 filt_local:1;
			u32 filt_global:1;
			u32 filt_pipe_idx:5;
@@ -309,6 +311,19 @@ struct ipa_hw_pkt_status {
			u32 ret_hdr:1;
			u32 reserved_3:1;
			u32 tag_f_1:16;

		} ipa_hw_v2_0_pkt_status;
		struct {
			u32 filt_local:1;
			u32 filt_global:1;
			u32 filt_pipe_idx:5;
			u32 ret_hdr:1;
			u32 filt_rule_idx:8;
			u32 tag_f_1:16;

		} ipa_hw_v2_5_pkt_status;
	};

	u32 tag_f_2:32;
	u32 time_day_ctr:32;
	u32 nat_hit:1;
@@ -317,16 +332,16 @@ struct ipa_hw_pkt_status {
	u32 route_local:1;
	u32 route_tbl_idx:5;
	u32 route_match:1;
	u32 reserved_4:1;
	u32 ucp:1;
	u32 route_rule_idx:8;
	u32 hdr_local:1;
	u32 hdr_offset:10;
	u32 frag_hit:1;
	u32 frag_rule:4;
	u32 reserved_5:16;
	u32 reserved_4:16;
};

#define IPA_PKT_STATUS_SIZE sizeof(struct ipa_hw_pkt_status)
#define IPA_PKT_STATUS_SIZE 32

/*! @brief Status header opcodes */
enum ipa_hw_status_opcode {
+1 −1
Original line number Diff line number Diff line
@@ -90,7 +90,7 @@
#define IPA_FL_EQ			BIT(12)
#define IPA_IHL_OFFSET_MEQ32_1		BIT(13)
#define IPA_METADATA_COMPARE		BIT(14)
#define IPA_IPV4_IS_FRAG		BIT(15)
#define IPA_IS_FRAG			BIT(15)

#define IPA_HDR_BIN0 0
#define IPA_HDR_BIN1 1
+7 −0
Original line number Diff line number Diff line
@@ -75,6 +75,13 @@
 * End of IPA 2.0 Registers
 */

/*
 * IPA HW 2.5 Registers
 */
#define IPA_BCR_OFST 0x000005B0
 /*
 * End of IPA 2.5 Registers
 */

/*
Common Registers
+17 −6
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@
#define IPA_TAG_SLEEP_MIN_USEC (1000)
#define IPA_TAG_SLEEP_MAX_USEC (2000)
#define IPA_FORCE_CLOSE_TAG_PROCESS_TIMEOUT (10 * HZ)
#define IPA_BCR_REG_VAL (0xFFFFFFFF)

static const int ipa_ofst_meq32[] = { IPA_OFFSET_MEQ32_0,
					IPA_OFFSET_MEQ32_1, -1 };
@@ -698,6 +699,9 @@ int ipa_init_hw(void)
	if (ipa_version == 0)
		return -EFAULT;

	/* set ipa_bcr to 0xFFFFFFFF for using new IPA behavior */
	ipa_write_reg(ipa_ctx->mmio, IPA_BCR_OFST, IPA_BCR_REG_VAL);

	return 0;
}

@@ -1045,7 +1049,7 @@ int ipa_generate_hw_rule(enum ipa_ip_type ip,
		}

		if (attrib->attrib_mask & IPA_FLT_FRAGMENT) {
			*en_rule |= IPA_IPV4_IS_FRAG;
			*en_rule |= IPA_IS_FRAG;
			*buf = ipa_pad_to_32(*buf);
		}

@@ -1055,8 +1059,7 @@ int ipa_generate_hw_rule(enum ipa_ip_type ip,

		/* error check */
		if (attrib->attrib_mask & IPA_FLT_TOS ||
		    attrib->attrib_mask & IPA_FLT_PROTOCOL ||
		    attrib->attrib_mask & IPA_FLT_FRAGMENT) {
		    attrib->attrib_mask & IPA_FLT_PROTOCOL) {
			IPAERR("v4 attrib's specified for v6 rule\n");
			return -EPERM;
		}
@@ -1263,6 +1266,10 @@ int ipa_generate_hw_rule(enum ipa_ip_type ip,
			*buf = ipa_pad_to_32(*buf);
		}

		if (attrib->attrib_mask & IPA_FLT_FRAGMENT) {
			*en_rule |= IPA_IS_FRAG;
			*buf = ipa_pad_to_32(*buf);
		}
	} else {
		IPAERR("unsupported ip %d\n", ip);
		return -EPERM;
@@ -1476,7 +1483,7 @@ int ipa_generate_flt_eq(enum ipa_ip_type ip,
		}

		if (attrib->attrib_mask & IPA_FLT_FRAGMENT) {
			*en_rule |= IPA_IPV4_IS_FRAG;
			*en_rule |= IPA_IS_FRAG;
			eq_atrb->ipv4_frag_eq_present = 1;
		}
	} else if (ip == IPA_IP_v6) {
@@ -1485,8 +1492,7 @@ int ipa_generate_flt_eq(enum ipa_ip_type ip,

		/* error check */
		if (attrib->attrib_mask & IPA_FLT_TOS ||
		    attrib->attrib_mask & IPA_FLT_PROTOCOL ||
		    attrib->attrib_mask & IPA_FLT_FRAGMENT) {
		    attrib->attrib_mask & IPA_FLT_PROTOCOL) {
			IPAERR("v4 attrib's specified for v6 rule\n");
			return -EPERM;
		}
@@ -1699,6 +1705,11 @@ int ipa_generate_flt_eq(enum ipa_ip_type ip,
			eq_atrb->metadata_meq32.value = attrib->meta_data;
		}

		if (attrib->attrib_mask & IPA_FLT_FRAGMENT) {
			*en_rule |= IPA_IS_FRAG;
			eq_atrb->ipv4_frag_eq_present = 1;
		}

	} else {
		IPAERR("unsupported ip %d\n", ip);
		return -EPERM;
Loading