[PATCH 1/1] arm: imx8m: imx8mm-cl-iot-gate: Add support for detect memory size

Fabio Estevam festevam at gmail.com
Mon Aug 23 13:41:21 CEST 2021


Hi Paul,

Thanks for taking care of this.

On Sun, Aug 22, 2021 at 11:50 PM Ying-Chun Liu <grandpaul at gmail.com> wrote:

> +int board_phys_sdram_size(phys_size_t *size)
> +{
> +       struct lpddr4_tcm_desc *lpddr4_tcm_desc =
> +               (struct lpddr4_tcm_desc *)TCM_DATA_CFG;
> +
> +       switch (lpddr4_tcm_desc->size) {
> +       case 4096:
> +       case 2048:
> +       case 1024:
> +               *size = (1L << 20) * lpddr4_tcm_desc->size;
> +               break;
> +       default:
> +               printf("%s: DRAM size %uM is not supported\n",
> +                      __func__,
> +                      lpddr4_tcm_desc->size);
> +               while (1)
> +                       ;

Shouldn't the while(1) be replaced by hang() instead?

>  #define CONFIG_SYS_SDRAM_BASE          0x40000000
>  #define PHYS_SDRAM                     0x40000000
> -#define PHYS_SDRAM_SIZE                        0x80000000 /* 2GB DDR */
> +#define PHYS_SDRAM_SIZE                        0x40000000 /* 1GB DDR */

This looks like an unnecessary change for me, as the board size is
detected in run-time.


More information about the U-Boot mailing list