Message ID | 1488819754-23590-2-git-send-email-york.sun@nxp.com |
---|---|
State | Accepted |
Commit | f2ccf7f7aacf75bd9c521459d1d20df07d1ebe41 |
Delegated to: | York Sun |
Headers | show |
On 6 March 2017 at 10:02, York Sun <york.sun@nxp.com> wrote: > Use gd->arch.resv_ram to track reserved memory allocation. > > Signed-off-by: York Sun <york.sun@nxp.com> > > --- > > Changes in v5: > Rename RESV_RAM_TOP to RESV_RAM in Kconfig > Revise "help" message and add comment to explain how RESV_RAM is used. > > Changes in v4: None > Changes in v3: None > Changes in v2: None > > arch/arm/cpu/armv8/fsl-layerscape/Kconfig | 10 ++++++++++ > arch/arm/include/asm/global_data.h | 7 +++++++ > cmd/bdinfo.c | 4 ++++ > 3 files changed, 21 insertions(+) Reviewed-by: Simon Glass <sjg@chromium.org>
diff --git a/arch/arm/cpu/armv8/fsl-layerscape/Kconfig b/arch/arm/cpu/armv8/fsl-layerscape/Kconfig index adccdf1..3f3ccc7 100644 --- a/arch/arm/cpu/armv8/fsl-layerscape/Kconfig +++ b/arch/arm/cpu/armv8/fsl-layerscape/Kconfig @@ -273,6 +273,16 @@ config SYS_FSL_SDHC_CLK_DIV clock, in another word SDHC_clk = Platform_clk / this_divider. endmenu +config RESV_RAM + bool + help + Reserve memory from the top, tracked by gd->arch.resv_ram. This + reserved RAM can be used by special driver that resides in memory + after U-Boot exits. It's up to implementation to allocate and allow + access to this reserved memory. For example, the reserved RAM can + be at the high end of physical memory. The reserve RAM may be + excluded from memory bank(s) passed to OS, or marked as reserved. + config SYS_FSL_ERRATUM_A008336 bool diff --git a/arch/arm/include/asm/global_data.h b/arch/arm/include/asm/global_data.h index aee87cd..dfcbcce 100644 --- a/arch/arm/include/asm/global_data.h +++ b/arch/arm/include/asm/global_data.h @@ -59,6 +59,13 @@ struct arch_global_data { phys_addr_t secure_ram; unsigned long tlb_allocated; #endif +#ifdef CONFIG_RESV_RAM + /* + * Reserved RAM for memory resident, eg. Management Complex (MC) + * driver which continues to run after U-Boot exits. + */ + phys_addr_t resv_ram; +#endif #ifdef CONFIG_ARCH_OMAP2 u32 omap_boot_device; diff --git a/cmd/bdinfo.c b/cmd/bdinfo.c index ae3027a..19b8fd8 100644 --- a/cmd/bdinfo.c +++ b/cmd/bdinfo.c @@ -392,6 +392,10 @@ static int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, gd->arch.secure_ram & MEM_RESERVE_SECURE_ADDR_MASK); } #endif +#ifdef CONFIG_RESV_RAM + if (gd->arch.resv_ram) + print_num("Reserved ram", gd->arch.resv_ram); +#endif #if defined(CONFIG_CMD_NET) && !defined(CONFIG_DM_ETH) print_eths(); #endif
Use gd->arch.resv_ram to track reserved memory allocation. Signed-off-by: York Sun <york.sun@nxp.com> --- Changes in v5: Rename RESV_RAM_TOP to RESV_RAM in Kconfig Revise "help" message and add comment to explain how RESV_RAM is used. Changes in v4: None Changes in v3: None Changes in v2: None arch/arm/cpu/armv8/fsl-layerscape/Kconfig | 10 ++++++++++ arch/arm/include/asm/global_data.h | 7 +++++++ cmd/bdinfo.c | 4 ++++ 3 files changed, 21 insertions(+)