[PATCH v3 1/5] firmware: Split RO/RX and RW sections

Anup Patel anup at brainfault.org
Sun Jan 22 20:34:03 PST 2023


On Thu, Jan 19, 2023 at 8:48 PM Himanshu Chauhan
<hchauhan at ventanamicro.com> wrote:
>
> Split the RO/RX and RW sections so that they can have
> independent pmp entries with required permissions. The
> split size is ensured to be a power-of-2 as required by
> pmp.
>
> _fw_rw_offset symbol marks the beginning of the data
> section.
>
> Signed-off-by: Himanshu Chauhan <hchauhan at ventanamicro.com>

This was already reviewed but nevertheless ...

Reviewed-by: Anup Patel <anup at brainfault.org>

Regards,
Anup

> ---
>  firmware/fw_base.ldS | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/firmware/fw_base.ldS b/firmware/fw_base.ldS
> index 563ae25..5411bbd 100644
> --- a/firmware/fw_base.ldS
> +++ b/firmware/fw_base.ldS
> @@ -42,6 +42,14 @@
>
>         . = ALIGN(0x1000); /* Ensure next section is page aligned */
>
> +       /*
> +        * PMP regions must be to be power-of-2. RO/RW will have separate
> +        * regions, so ensure that the split is power-of-2.
> +        */
> +       . = ALIGN(1 << LOG2CEIL(SIZEOF(.rodata) + SIZEOF(.text)));
> +
> +       PROVIDE(_fw_rw_offset = (.  - _fw_start));
> +
>         /* Beginning of the read-write data sections */
>
>         .data :
> --
> 2.39.1
>
>
> --
> opensbi mailing list
> opensbi at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/opensbi



More information about the opensbi mailing list