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

Commit f228be81 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: ipa4: Make AP and modem hdr proc ctx adjacent"

parents fdbc092e 38587935
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2703,9 +2703,9 @@ int _ipa_init_sram_v3(void)
		IPA_MEM_PART(modem_hdr_proc_ctx_ofst));
	if (ipa_get_hw_type() >= IPA_HW_v4_5) {
		ipa3_sram_set_canary(ipa_sram_mmio,
			IPA_MEM_PART(apps_hdr_proc_ctx_ofst) - 4);
			IPA_MEM_PART(nat_tbl_ofst) - 12);
		ipa3_sram_set_canary(ipa_sram_mmio,
			IPA_MEM_PART(apps_hdr_proc_ctx_ofst));
			IPA_MEM_PART(nat_tbl_ofst) - 8);
		ipa3_sram_set_canary(ipa_sram_mmio,
			IPA_MEM_PART(nat_tbl_ofst) - 4);
		ipa3_sram_set_canary(ipa_sram_mmio, IPA_MEM_PART(nat_tbl_ofst));
+4 −4
Original line number Diff line number Diff line
@@ -1761,16 +1761,16 @@ struct ipa3_plat_drv_res {
 * +-------------------------+
 * | MODEM PROC CTX          |
 * +-------------------------+
 * |    CANARY (IPA4.5)      |
 * +-------------------------+
 * |    CANARY (IPA4.5)      |
 * +-------------------------+
 * | APPS PROC CTX           |
 * +-------------------------+
 * |    CANARY               |
 * +-------------------------+
 * |    CANARY               |
 * +-------------------------+
 * |    CANARY (IPA4.5)      |
 * +-------------------------+
 * |    CANARY (IPA4.5)      |
 * +-------------------------+
 * | NAT TABLE (IPA4.5)      |
 * +-------------------------+
 * | NAT IDX TABLE (IPA4.5)  |
+28 −1
Original line number Diff line number Diff line
@@ -2602,7 +2602,7 @@ static struct ipa3_mem_partition ipa_4_5_mem_part = {
	.apps_hdr_size_ddr		= 0x800,
	.modem_hdr_proc_ctx_ofst	= 0xad0,
	.modem_hdr_proc_ctx_size	= 0x200,
	.apps_hdr_proc_ctx_ofst		= 0xcd8,
	.apps_hdr_proc_ctx_ofst		= 0xcd0,
	.apps_hdr_proc_ctx_size		= 0x200,
	.apps_hdr_proc_ctx_size_ddr	= 0x0,
	.nat_tbl_ofst			= 0xee0,
@@ -5155,6 +5155,33 @@ int ipa3_init_mem_partition(enum ipa_hw_type type)
		return -ENODEV;
	}

	/*
	 * Routing rules points to hdr_proc_ctx in 32byte offsets from base.
	 * Base is modem hdr_proc_ctx first address.
	 * AP driver install APPS hdr_proc_ctx starting at the beginning of
	 * apps hdr_proc_ctx part.
	 * So first apps hdr_proc_ctx offset at some routing
	 * rule will be modem_hdr_proc_ctx_size >> 5 (32B).
	 */
	if (IPA_MEM_PART(modem_hdr_proc_ctx_size) & 31) {
		IPAERR("MODEM HDR PROC CTX SIZE 0x%x is not 32B aligned\n",
			IPA_MEM_PART(modem_hdr_proc_ctx_size));
		return -ENODEV;
	}

	/*
	 * AP driver when installing routing rule, it calcs the hdr_proc_ctx
	 * offset by local offset (from base of apps part) +
	 * modem_hdr_proc_ctx_size. This is to get offset from modem part base.
	 * Thus apps part must be adjacent to modem part
	 */
	if (IPA_MEM_PART(apps_hdr_proc_ctx_ofst) !=
		IPA_MEM_PART(modem_hdr_proc_ctx_ofst) +
		IPA_MEM_PART(modem_hdr_proc_ctx_size)) {
		IPAERR("APPS HDR PROC CTX SIZE not adjacent to MODEM one!\n");
		return -ENODEV;
	}

	IPADBG("NAT TBL OFST 0x%x SIZE 0x%x\n",
		IPA_MEM_PART(nat_tbl_ofst),
		IPA_MEM_PART(nat_tbl_size));