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

Commit f1d34e2c authored by Sivan Reinstein's avatar Sivan Reinstein
Browse files

msm: ipa3: use vaddr instead of paddr to load IPA FWs



In order to provide an identical ELF file format between MSM
and MDM, the IPA core driver needs to utilize p_vaddr field as the
destination address for the FW loader.

Change-Id: I818fbe37601dbd4250fc428223a4a1b72b91487a
CRs-Fixed: 987522
Acked-by: default avatarDavid Arinzon <darinzon@qti.qualcomm.com>
Signed-off-by: default avatarSivan Reinstein <sivanr@codeaurora.org>
parent 1a970af7
Loading
Loading
Loading
Loading
+3 −7
Original line number Diff line number Diff line
@@ -5114,10 +5114,6 @@ int ipa3_generate_eq_from_hw_rule(
 */
int ipa3_load_fws(const struct firmware *firmware)
{
	/*
	 * TODO: Do we need to use a generic elf_hdr/elf_phdr
	 * so we won't have issues with 64bit systems?
	 */
	const struct elf32_hdr *ehdr;
	const struct elf32_phdr *phdr;
	const uint8_t *elf_phdr_ptr;
@@ -5137,15 +5133,15 @@ int ipa3_load_fws(const struct firmware *firmware)
		phdr = (struct elf32_phdr *)elf_phdr_ptr;

		/*
		 * p_addr will contain the physical address to which the
		 * p_vaddr will contain the starting address to which the
		 * FW needs to be loaded.
		 * p_memsz will contain the size of the IRAM.
		 * p_filesz will contain the size of the FW image.
		 */
		fw_mem_base = ioremap(phdr->p_paddr, phdr->p_memsz);
		fw_mem_base = ioremap(phdr->p_vaddr, phdr->p_memsz);
		if (!fw_mem_base) {
			IPAERR("Failed to map 0x%x for the size of %u\n",
				phdr->p_paddr, phdr->p_memsz);
				phdr->p_vaddr, phdr->p_memsz);
				return -ENOMEM;
		}