Message ID | 1512023457-20571-9-git-send-email-rajesh.bhagat@nxp.com |
---|---|
State | Superseded |
Delegated to: | York Sun |
Headers | show |
Series | Add VID support for QDS and RDB platforms | expand |
On 11/29/2017 10:31 PM, Rajesh Bhagat wrote: > When VID feature is supported, check the contents of fuse register > and configure DDR operate at 0.9v. > > Signed-off-by: Ashish Kumar <Ashish.Kumar@nxp.com> > Signed-off-by: Rajesh Bhagat <rajesh.bhagat@nxp.com> > --- > board/freescale/ls1088a/ddr.c | 21 +++++++++++++++++++++ > 1 file changed, 21 insertions(+) > > diff --git a/board/freescale/ls1088a/ddr.c b/board/freescale/ls1088a/ddr.c > index e24bfd5..f3e70b5 100644 > --- a/board/freescale/ls1088a/ddr.c > +++ b/board/freescale/ls1088a/ddr.c > @@ -13,6 +13,23 @@ > > DECLARE_GLOBAL_DATA_PTR; > > +#if defined(CONFIG_VID) && (!defined(CONFIG_SPL) || defined(CONFIG_SPL_BUILD)) > +void fsl_ddr_setup_0v9_volt(memctl_options_t *popts) add "static" if this function is not used externally. > +{ > + int vdd; > + > + vdd = get_core_volt_from_fuse(); > + /* Nothing to do for silicons doesn't support VID */ > + if (vdd < 0) > + return; > + Any guarantee the fuse value is actually the voltage on the board? If you cannot read back the voltage here, you may consider to print a big warning at the point you know voltage adjustment fails. > + if (vdd == 900) { > + popts->ddr_cdr1 |= DDR_CDR1_V0PT9_EN; > + printf("VID: configure DDR to support 900 mV\n"); s/printf/debug > + } > +} > +#endif > + > void fsl_ddr_board_options(memctl_options_t *popts, > dimm_params_t *pdimm, > unsigned int ctrl_num) > @@ -87,6 +104,10 @@ found: > popts->addr_hash = 1; > > popts->ddr_cdr1 = DDR_CDR1_DHC_EN | DDR_CDR1_ODT(DDR_CDR_ODT_60ohm); > +#if defined(CONFIG_VID) && (!defined(CONFIG_SPL) || defined(CONFIG_SPL_BUILD)) > + fsl_ddr_setup_0v9_volt(popts); > +#endif > + > popts->ddr_cdr2 = DDR_CDR2_ODT(DDR_CDR_ODT_60ohm) | > DDR_CDR2_VREF_TRAIN_EN | DDR_CDR2_VREF_RANGE_2; > } > York
diff --git a/board/freescale/ls1088a/ddr.c b/board/freescale/ls1088a/ddr.c index e24bfd5..f3e70b5 100644 --- a/board/freescale/ls1088a/ddr.c +++ b/board/freescale/ls1088a/ddr.c @@ -13,6 +13,23 @@ DECLARE_GLOBAL_DATA_PTR; +#if defined(CONFIG_VID) && (!defined(CONFIG_SPL) || defined(CONFIG_SPL_BUILD)) +void fsl_ddr_setup_0v9_volt(memctl_options_t *popts) +{ + int vdd; + + vdd = get_core_volt_from_fuse(); + /* Nothing to do for silicons doesn't support VID */ + if (vdd < 0) + return; + + if (vdd == 900) { + popts->ddr_cdr1 |= DDR_CDR1_V0PT9_EN; + printf("VID: configure DDR to support 900 mV\n"); + } +} +#endif + void fsl_ddr_board_options(memctl_options_t *popts, dimm_params_t *pdimm, unsigned int ctrl_num) @@ -87,6 +104,10 @@ found: popts->addr_hash = 1; popts->ddr_cdr1 = DDR_CDR1_DHC_EN | DDR_CDR1_ODT(DDR_CDR_ODT_60ohm); +#if defined(CONFIG_VID) && (!defined(CONFIG_SPL) || defined(CONFIG_SPL_BUILD)) + fsl_ddr_setup_0v9_volt(popts); +#endif + popts->ddr_cdr2 = DDR_CDR2_ODT(DDR_CDR_ODT_60ohm) | DDR_CDR2_VREF_TRAIN_EN | DDR_CDR2_VREF_RANGE_2; }