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

Commit bfb580fc authored by Ghanim Fodi's avatar Ghanim Fodi
Browse files

msm: ipa: fix uC descriptor ring IPA SRAM area



uC descriptor IPA SRAM area used for uC descriptors
and its name need to be uc descriptor ram.

CRs-Fixed: 2314865
Change-Id: Id7279322c6f428e253c58b441e12615b5ffaf23f
Signed-off-by: default avatarGhanim Fodi <gfodi@codeaurora.org>
parent 68ab4f70
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2721,14 +2721,14 @@ int _ipa_init_sram_v3(void)
			IPA_MEM_PART(stats_quota_ofst));
	}
	if (ipa_get_hw_type() <= IPA_HW_v3_5 ||
		ipa_get_hw_type() > IPA_HW_v4_0) {
		ipa_get_hw_type() >= IPA_HW_v4_5) {
		ipa3_sram_set_canary(ipa_sram_mmio,
			IPA_MEM_PART(modem_ofst) - 4);
		ipa3_sram_set_canary(ipa_sram_mmio, IPA_MEM_PART(modem_ofst));
	}
	ipa3_sram_set_canary(ipa_sram_mmio,
		(ipa_get_hw_type() >= IPA_HW_v3_5) ?
			IPA_MEM_PART(uc_event_ring_ofst) :
			IPA_MEM_PART(uc_descriptor_ram_ofst) :
			IPA_MEM_PART(end_ofst));

	iounmap(ipa_sram_mmio);
+5 −5
Original line number Diff line number Diff line
@@ -1801,11 +1801,11 @@ struct ipa3_plat_drv_res {
 * +-------------------------+
 * | MODEM MEM               |
 * +-------------------------+
 * |    CANARY               |
 * +-------------------------+
 * |    Dummy (IPA4.5)       |
 * +-------------------------+
 * | UC EVENT RING (IPA3.5)  |
 * |    CANARY (IPA4.5)      |
 * +-------------------------+
 * | UC DESC RAM (IPA3.5)    |
 * +-------------------------+
 */
struct ipa3_mem_partition {
@@ -1883,8 +1883,8 @@ struct ipa3_mem_partition {
	u32 apps_v6_rt_hash_size;
	u32 apps_v6_rt_nhash_ofst;
	u32 apps_v6_rt_nhash_size;
	u32 uc_event_ring_ofst;
	u32 uc_event_ring_size;
	u32 uc_descriptor_ram_ofst;
	u32 uc_descriptor_ram_size;
	u32 pdn_config_ofst;
	u32 pdn_config_size;
	u32 stats_quota_ofst;
+55 −49
Original line number Diff line number Diff line
@@ -2448,8 +2448,8 @@ static struct ipa3_mem_partition ipa_4_1_mem_part = {
	.apps_v6_rt_hash_size		= 0x0,
	.apps_v6_rt_nhash_ofst		= 0x23fc,
	.apps_v6_rt_nhash_size		= 0x0,
	.uc_event_ring_ofst		= 0x2400,
	.uc_event_ring_size		= 0x400,
	.uc_descriptor_ram_ofst		= 0x2400,
	.uc_descriptor_ram_size		= 0x400,
	.pdn_config_ofst		= 0xbd8,
	.pdn_config_size		= 0x50,
	.stats_quota_ofst		= 0xc30,
@@ -2537,8 +2537,8 @@ static struct ipa3_mem_partition ipa_4_2_mem_part = {
	.apps_v6_rt_hash_size		= 0x0,
	.apps_v6_rt_nhash_ofst		= 0x1bfc,
	.apps_v6_rt_nhash_size		= 0x0,
	.uc_event_ring_ofst		= 0x1c00,
	.uc_event_ring_size		= 0x400,
	.uc_descriptor_ram_ofst		= 0x1c00,
	.uc_descriptor_ram_size		= 0x400,
	.pdn_config_ofst		= 0x9F8,
	.pdn_config_size		= 0x50,
	.stats_quota_ofst		= 0xa50,
@@ -2649,8 +2649,8 @@ static struct ipa3_mem_partition ipa_4_5_mem_part = {
	.apps_v6_rt_hash_size	= 0x0,
	.apps_v6_rt_nhash_ofst	= 0x2718,
	.apps_v6_rt_nhash_size	= 0x0,
	.uc_event_ring_ofst		= 0x3800,
	.uc_event_ring_size		= 0x1000,
	.uc_descriptor_ram_ofst	= 0x3800,
	.uc_descriptor_ram_size	= 0x1000,
	.end_ofst		= 0x4800,
};

@@ -4985,16 +4985,6 @@ int ipa3_init_mem_partition(enum ipa_hw_type type)
		return -EPERM;
	}

	if (IPA_MEM_PART(uc_event_ring_ofst) & 1023) {
		IPAERR("UC EVENT RING OFST 0x%x is unaligned\n",
			IPA_MEM_PART(uc_event_ring_ofst));
		return -ENODEV;
	}

	IPADBG("UC EVENT RING OFST 0x%x SIZE 0x%x\n",
		IPA_MEM_PART(uc_event_ring_ofst),
		IPA_MEM_PART(uc_event_ring_size));

	if (IPA_MEM_PART(uc_info_ofst) & 3) {
		IPAERR("UC INFO OFST 0x%x is unaligned\n",
			IPA_MEM_PART(uc_info_ofst));
@@ -5169,7 +5159,7 @@ int ipa3_init_mem_partition(enum ipa_hw_type type)
		IPA_MEM_PART(nat_tbl_ofst),
		IPA_MEM_PART(nat_tbl_size));

	if (IPA_MEM_PART(nat_tbl_ofst) & 7) {
	if (IPA_MEM_PART(nat_tbl_ofst) & 31) {
		IPAERR("NAT TBL OFST 0x%x is unaligned\n",
			IPA_MEM_PART(nat_tbl_ofst));
		return -ENODEV;
@@ -5179,7 +5169,7 @@ int ipa3_init_mem_partition(enum ipa_hw_type type)
		IPA_MEM_PART(nat_index_tbl_ofst),
		IPA_MEM_PART(nat_index_tbl_size));

	if (IPA_MEM_PART(nat_index_tbl_ofst) & 7) {
	if (IPA_MEM_PART(nat_index_tbl_ofst) & 3) {
		IPAERR("NAT INDEX TBL OFST 0x%x is unaligned\n",
			IPA_MEM_PART(nat_index_tbl_ofst));
		return -ENODEV;
@@ -5189,7 +5179,7 @@ int ipa3_init_mem_partition(enum ipa_hw_type type)
		IPA_MEM_PART(nat_exp_tbl_ofst),
		IPA_MEM_PART(nat_exp_tbl_size));

	if (IPA_MEM_PART(nat_index_tbl_ofst) & 7) {
	if (IPA_MEM_PART(nat_exp_tbl_ofst) & 31) {
		IPAERR("NAT EXP TBL OFST 0x%x is unaligned\n",
			IPA_MEM_PART(nat_exp_tbl_ofst));
		return -ENODEV;
@@ -5199,15 +5189,12 @@ int ipa3_init_mem_partition(enum ipa_hw_type type)
		IPA_MEM_PART(pdn_config_ofst),
		IPA_MEM_PART(pdn_config_size));

	if (IPA_MEM_PART(modem_ofst) & 7) {
		IPAERR("MODEM OFST 0x%x is unaligned\n",
			IPA_MEM_PART(modem_ofst));
	if (IPA_MEM_PART(pdn_config_ofst) & 7) {
		IPAERR("PDN CONFIG OFST 0x%x is unaligned\n",
			IPA_MEM_PART(pdn_config_ofst));
		return -ENODEV;
	}

	IPADBG("MODEM OFST 0x%x SIZE 0x%x\n", IPA_MEM_PART(modem_ofst),
		IPA_MEM_PART(modem_size));

	IPADBG("QUOTA STATS OFST 0x%x SIZE 0x%x\n",
		IPA_MEM_PART(stats_quota_ofst),
		IPA_MEM_PART(stats_quota_size));
@@ -5283,6 +5270,25 @@ int ipa3_init_mem_partition(enum ipa_hw_type type)
		IPA_MEM_PART(apps_v6_rt_nhash_ofst),
		IPA_MEM_PART(apps_v6_rt_nhash_size));

	if (IPA_MEM_PART(modem_ofst) & 7) {
		IPAERR("MODEM OFST 0x%x is unaligned\n",
			IPA_MEM_PART(modem_ofst));
		return -ENODEV;
	}

	IPADBG("MODEM OFST 0x%x SIZE 0x%x\n", IPA_MEM_PART(modem_ofst),
		IPA_MEM_PART(modem_size));

	if (IPA_MEM_PART(uc_descriptor_ram_ofst) & 1023) {
		IPAERR("UC DESCRIPTOR RAM OFST 0x%x is unaligned\n",
			IPA_MEM_PART(uc_descriptor_ram_ofst));
		return -ENODEV;
	}

	IPADBG("UC DESCRIPTOR RAM OFST 0x%x SIZE 0x%x\n",
		IPA_MEM_PART(uc_descriptor_ram_ofst),
		IPA_MEM_PART(uc_descriptor_ram_size));

	return 0;
}