Skip to content

Commit

Permalink
pico-imx8mm: adjust CMA size to 320MB when DRAM capacity is 1GB
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-hu committed Apr 28, 2021
1 parent a78f024 commit 2353504
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
22 changes: 22 additions & 0 deletions board/technexion/pico-imx8mm/pico-imx8mm.c
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,28 @@ int detect_tevi_camera(void)
return 0;
}

#ifdef CONFIG_OF_BOARD_SETUP
int ft_board_setup(void *blob, bd_t *bd)
{
const int *cell;
int offs;
uint32_t cma_size;
char *cmasize;

offs = fdt_path_offset(blob, "/reserved-memory/linux,cma");
cell = fdt_getprop(blob, offs, "size", NULL);
cma_size = fdt32_to_cpu(cell[1]);
cmasize = env_get("cma_size");
if(cmasize || ((uint32_t)(mem_map[DRAM1_INDEX].size >> 1) < cma_size)) {
cma_size = env_get_ulong("cma_size", 10, 320 * 1024 * 1024);
cma_size = min((uint32_t)(mem_map[DRAM1_INDEX].size >> 1), cma_size);
fdt_setprop_u64(blob, offs, "size", (uint64_t)cma_size);
}

return 0;
}
#endif

int board_late_init(void)
{

Expand Down
1 change: 1 addition & 0 deletions configs/pico-imx8mm_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ CONFIG_FIT=y
CONFIG_FIT_EXTERNAL_OFFSET=0x3000
CONFIG_SPL_LOAD_FIT=y
CONFIG_SPL_FIT_GENERATOR="arch/arm/mach-imx/mkimage_fit_atf.sh"
CONFIG_OF_BOARD_SETUP=y
CONFIG_OF_SYSTEM_SETUP=y
CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/imx8m/imximage-8mm-lpddr4.cfg"
CONFIG_DEFAULT_FDT_FILE="imx8mm-pico-pi.dtb"
Expand Down

0 comments on commit 2353504

Please sign in to comment.