[U-Boot] [PATCH v3] MC : Report extra reserved memory to Linux
Prabhakar Kushwaha
prabhakar.kushwaha at nxp.com
Sat Mar 23 00:28:47 UTC 2019
> -----Original Message-----
> From: Meenakshi Aggarwal <meenakshi.aggarwal at nxp.com>
> Sent: Wednesday, March 13, 2019 10:41 PM
> To: u-boot at lists.denx.de; Prabhakar Kushwaha
> <prabhakar.kushwaha at nxp.com>
> Cc: Meenakshi Aggarwal <meenakshi.aggarwal at nxp.com>
> Subject: [PATCH v3] MC : Report extra reserved memory to Linux
>
Update subject as
driver: net: mc: Report extra reserved memory to Linux
> For MC, 512 MB DDR is reserved because of MC's alignment requirement.
> But for MC binaries needing 128MB or 256MB DDR memory, rest of the
> memory is a waste. So reporting this extra memory to Linux through dtb
> memory fixup.
>
> Signed-off-by: Meenakshi Aggarwal <meenakshi.aggarwal at nxp.com>
> Reviewed-by: Ashish Kumar <Ashish.Kumar at nxp.com>
> ---
> board/freescale/lx2160a/lx2160a.c | 28 +++++++++++++++++++++++++++-
> drivers/net/fsl-mc/mc.c | 13 +++++++++++++
> include/fsl-mc/fsl_mc.h | 1 +
> 3 files changed, 41 insertions(+), 1 deletion(-)
>
> diff --git a/board/freescale/lx2160a/lx2160a.c
This change should be done for other DPAA2 platform also.
> b/board/freescale/lx2160a/lx2160a.c
> index ad72eed..b763f6d 100644
> --- a/board/freescale/lx2160a/lx2160a.c
> +++ b/board/freescale/lx2160a/lx2160a.c
> @@ -532,8 +532,15 @@ void board_quiesce_devices(void) int
> ft_board_setup(void *blob, bd_t *bd) {
> int i;
> + bool mc_memory_bank = false;
> +
> +#ifdef CONFIG_FSL_MC_ENET
> + u64 base[CONFIG_NR_DRAM_BANKS + 1];
> + u64 size[CONFIG_NR_DRAM_BANKS + 1];
Please don't use magic number. Adding "1"is not providing any info
> +#else
> u64 base[CONFIG_NR_DRAM_BANKS];
> u64 size[CONFIG_NR_DRAM_BANKS];
> +#endif
>
> ft_cpu_setup(blob, bd);
>
> @@ -556,7 +563,26 @@ int ft_board_setup(void *blob, bd_t *bd)
> size[2] = gd->arch.resv_ram - base[2]; #endif
>
> - fdt_fixup_memory_banks(blob, base, size,
> CONFIG_NR_DRAM_BANKS);
> +#ifdef CONFIG_FSL_MC_ENET
> + fdt_fixup_mc_ddr(&base[3], &size[3]);
> +
> + if (base[3] != 0) {
> + for (i = 0; i <= CONFIG_NR_DRAM_BANKS; i++) {
> + if (base[i] == 0 && size[i] == 0) {
> + base[i] = base[3];
> + size[i] = size[3];
> + break;
> + }
> + }
> + if (i == CONFIG_NR_DRAM_BANKS)
> + mc_memory_bank = true;
> + }
> +#endif
> + if (mc_memory_bank)
> + fdt_fixup_memory_banks(
> + blob, base, size, CONFIG_NR_DRAM_BANKS + 1);
> + else
> + fdt_fixup_memory_banks(blob, base, size,
> CONFIG_NR_DRAM_BANKS);
>
Why are you doing fixup? Ideally you should mark it reserved.
--pk
More information about the U-Boot
mailing list