[U-Boot] [PATCH 10/14] ddr: altera: agilex: Add SDRAM driver for Agilex

Ley Foon Tan lftan.linux at gmail.com
Tue May 14 05:39:52 UTC 2019


On Fri, May 10, 2019 at 8:17 PM Marek Vasut <marex at denx.de> wrote:
>
> On 5/10/19 7:54 AM, Ley Foon Tan wrote:
> > Add SDRAM driver for Agilex SoC.
> >
> > Signed-off-by: Tien Fong Chee <tien.fong.chee at intel.com>
> > Signed-off-by: Ley Foon Tan <ley.foon.tan at intel.com>
> > ---
> >  drivers/ddr/altera/Kconfig        |   6 +-
> >  drivers/ddr/altera/Makefile       |   1 +
> >  drivers/ddr/altera/sdram_agilex.c | 158 ++++++++++++++++++++++++++++++
> >  drivers/ddr/altera/sdram_common.c |   1 +
> >  drivers/ddr/altera/sdram_common.h |   1 +
> >  5 files changed, 164 insertions(+), 3 deletions(-)
> >  create mode 100644 drivers/ddr/altera/sdram_agilex.c
>
> [...]
>
> > +     /* This enables nonsecure access to DDR */
> > +     /* mpuregion0addr_limit */
> > +     FW_MPU_DDR_SCR_WRITEL(gd->ram_size - 1,
> > +                           FW_MPU_DDR_SCR_MPUREGION0ADDR_LIMIT);
> > +     FW_MPU_DDR_SCR_WRITEL(0x1F, FW_MPU_DDR_SCR_MPUREGION0ADDR_LIMITEXT);
>
> Why is the function name in caps?
They are macros, not function.
>
> > +
> > +     /* nonmpuregion0addr_limit */
> > +     FW_MPU_DDR_SCR_WRITEL(gd->ram_size - 1,
> > +                           FW_MPU_DDR_SCR_NONMPUREGION0ADDR_LIMIT);
> > +
> > +     /* Enable mpuregion0enable and nonmpuregion0enable */
> > +     FW_MPU_DDR_SCR_WRITEL(MPUREGION0_ENABLE | NONMPUREGION0_ENABLE,
> > +                           FW_MPU_DDR_SCR_EN_SET);
> > +
> > +     u32 ctrlcfg1 = hmc_readl(plat, CTRLCFG1);
> Doesn't the C compiler warn about variable defined in the middle of code ?
>
No compiler warning.

Regards
Ley Foon


More information about the U-Boot mailing list