From: Ayan Kumar Halder <ayankuma@amd.com>
To: Julien Grall <julien@xen.org>,
Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
Bertrand Marquis <bertrand.marquis@arm.com>,
Michal Orzel <michal.orzel@amd.com>,
Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: Re: [PATCH v2 1/2] xen/mpu: Map early uart when earlyprintk on
Date: Tue, 3 Dec 2024 19:02:34 +0000 [thread overview]
Message-ID: <048424f0-41ee-4bb7-b585-42ed82a337b4@amd.com> (raw)
In-Reply-To: <f62e511e-40ab-453a-a907-6d27d074adba@xen.org>
Hi Julien and Luca,
(Luca, I will respond to your other comment here)
On 03/12/2024 13:50, Julien Grall wrote:
>
>
> On 03/12/2024 13:34, Ayan Kumar Halder wrote:
>>
>> On 02/12/2024 20:53, Julien Grall wrote:
>>> Hi Ayan,
>> Hi Julien,
>>>
>>> On 27/11/2024 18:39, Ayan Kumar Halder wrote:
>>>> CONFIG_EARLY_UART_SIZE is introduced to let user provide physical
>>>> size of
>>>> early UART. Unlike MMU where we map a page in the virtual address
>>>> space,
>>>> here we need to know the exact physical size to be mapped.
>>>> As VA == PA in case of MPU, the memory layout follows exactly the
>>>> hardware
>>>> configuration. As a consequence, we set EARLY_UART_VIRTUAL_ADDRESS
>>>> as physical
>>>> address.
>>>>
>>>> EARLY_UART_BASE_ADDRESS and EARLY_UART_SIZE should be aligned to
>>>> the minimum
>>>> size of MPU region (ie 64 bits) as per the hardware restrictions.
>>>> Refer ARM
>>>> DDI 0600A.d ID120821 A1.3 "A minimum protection region size of 64
>>>> bytes.".
>>>>
>>>> UART is mapped as nGnRE region (as specified by ATTR=100 , refer
>>>> G1.3.13,
>>>> MAIR_EL2, "---0100 Device memory nGnRE") and Doc ID -
>>>> 102670_0101_02_en
>>>
>>> I can't find the Doc you point online. Do you have a link?
>> https://developer.arm.com/documentation/102670/0101 - Cortex-R82
>> processor TRM
>
> Thanks. But why are you quoting the Cortex-R82 TRM?
> This code is meant to work on any Armv8-R processor.
You mean Armv8-R AArch64 processor.
Actually, I was looking for a reference to tell me if UART is to be
mapped as a nGnRE or nGnRnE. Table 4-3 mentions that nGnRE corresponds
to the device memory. So, I used this. I assumed that this behavior will
apply to all Armv8-R AArch64 processors as it did not mention anything
specific about R82.
To address Luca's comment
>>"on Zephyr, the pl011 is mapped with nGnRnE".
I don't really have a good reason whether we should map it as nGnRnE or
nGnRE other than what I have mentioned before (ie nGnRE corresponds to
device memory). I am happy to change it to make it consistent with
Zephyr and Linux
(https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/include/asm/mpu.h?h=v6.13-rc1#n67
, this is Armv8-R **AArch32** ).
Let me know which one you think is correct.
Other comment from Luca
>>"Anyway, changing that to 0x01 (ATTR=0 EN=1) is giving me a weird
issue in my branch:"
This is due to
https://gitlab.com/xen-project/people/lucafancellu/xen/-/commit/4ec46883b1dffcbafd86c32732d1267102696d84
, |ioremap_cache() in arm/mpu/mm.c . This can be fixed if we choose nGnRnE.|
|- Ayan|
next prev parent reply other threads:[~2024-12-03 19:03 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-27 18:39 [PATCH v2 0/2] Enable early bootup of AArch64 MPU systems (Part 2) Ayan Kumar Halder
2024-11-27 18:39 ` [PATCH v2 1/2] xen/mpu: Map early uart when earlyprintk on Ayan Kumar Halder
2024-12-02 20:53 ` Julien Grall
2024-12-03 13:34 ` Ayan Kumar Halder
2024-12-03 13:50 ` Julien Grall
2024-12-03 19:02 ` Ayan Kumar Halder [this message]
2024-12-03 10:26 ` Luca Fancellu
2024-12-03 15:54 ` Luca Fancellu
2024-12-03 16:49 ` Luca Fancellu
2024-11-27 18:39 ` [PATCH v2 2/2] xen/mmu: enable SMMU subsystem only in MMU Ayan Kumar Halder
2024-12-02 20:54 ` Julien Grall
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=048424f0-41ee-4bb7-b585-42ed82a337b4@amd.com \
--to=ayankuma@amd.com \
--cc=Volodymyr_Babchuk@epam.com \
--cc=ayan.kumar.halder@amd.com \
--cc=bertrand.marquis@arm.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.