From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Stefano Manni <stefano.manni@gmail.com>, barebox@lists.infradead.org
Subject: Re: firmwareload fails for cortex-m7 on imx8mp
Date: Fri, 15 Nov 2024 15:02:37 +0100 [thread overview]
Message-ID: <ed999cd8-a8e3-4e19-ba7d-924e393945ab@pengutronix.de> (raw)
In-Reply-To: <CANn9nbiT8J+irgWYQxiTydNyOiTEiXBo_ZLqdVG1EGpHY9eyOA@mail.gmail.com>
Hello Stefano,
On 15.11.24 14:43, Stefano Manni wrote:
> Dear all,
>
> I cannot run an ELF image on the M7 core on the imx8mp soc.
> The ELF comes from zephyr and it runs as expected when I load it from linux,
> but in barebox I encounter this error:
>
> barebox@NXP i.MX8MPlus EVK board:/ tftp zephyr.elf
> [################################################################]
> barebox@NXP i.MX8MPlus EVK board:/ firmwareload zephyr.elf
> remoteproc0: powering up remoteproc-cm7.of
> DABT (current EL) exception (ESR 0x96000061) at 0x00000000007e0004
https://esr.arm64.dev/#0x96000061 decodes this as
"Abort caused by writing to memory" (Alignment fault) with valid FAR.
FAR is the addresss listed here (0x00000000007e0004), which is indeed
not divisible by 8.
> [<ffd826f4>] (__arch_memcpy+0x48/0x13c) from [<ffd82a00>] (memcpy+0xc/0x14)
The optimized memcpy used here expects misalignment not to trap.
> As you can see the exception happens when rproc_elf_load_segments() tries to
> memcpy a segment where the M7 expects it. The ELF has been compiled to run
> from ITCM memory (0x007E0000-0x007FFFFF).
>
> Do you have any idea? Maybe may I have to put a reserved-memory for ITCM?
I think I may have broken this when I changed barebox to map everything outside
main memory as uncached.
I did this, because we 1) don't want to risk the main CPU speculating into I/O
memory and 2) don't want to have to use memory barriers for synchronization.
The flipside is that drivers that access I/O memory must do this via
readl/writel and friends or via memcpy_io/memset_io. This was already required
before, but some drivers that didn't do this were lucky enough to fly under
the radar. At least for remoteproc, this seems no longer the case.
I just Cc'd you on a patch to fix this for remoteproc.
Please let me know with a Tested-by if this resolves your issue.
Cheers,
Ahmad
>
> Thank you.
>
> Best,
> Stefano
>
>
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
next prev parent reply other threads:[~2024-11-15 14:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-15 13:43 Stefano Manni
2024-11-15 14:02 ` Ahmad Fatoum [this message]
2024-11-15 14:47 ` Stefano Manni
2024-11-15 14:49 ` Ahmad Fatoum
2024-11-15 15:01 ` Stefano Manni
2024-11-19 9:03 ` Ahmad Fatoum
2024-11-19 10:40 ` Stefano Manni
2024-11-19 11:29 ` Ahmad Fatoum
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ed999cd8-a8e3-4e19-ba7d-924e393945ab@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=stefano.manni@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox