[PATCH 2/2] drm/ast: Support AST2500

Benjamin Herrenschmidt benh at kernel.crashing.org
Thu Feb 16 21:17:02 UTC 2017


On Thu, 2017-02-16 at 17:33 +0000, Emil Velikov wrote:
> > +static bool ast_dram_init_2500(struct ast_private *ast)
> > +{
> > +       u32 data;
> > +       u32 max_tries = 5;
> > +
> > +       do {
> > +               if (max_tries-- == 0)
> > +                       return false;
> > +               set_mpll_2500(ast);
> > +               reset_mmc_2500(ast);
> > +               ddr_init_common_2500(ast);
> > +
> > +               data = ast_mindwm(ast, 0x1E6E2070);
> > +               if (data & 0x01000000)
> > +                       ddr4_init_2500(ast, ast2500_ddr4_1600_timing_table);
> > +               else
> > +                       ddr3_init_2500(ast, ast2500_ddr3_1600_timing_table);
> > +       } while (!ddr_test_2500(ast));
> > +
> > +       ast_moutdwm(ast, 0x1E6E2040, ast_mindwm(ast, 0x1E6E2040) | 0x41);
> > +
> > +       /* Patch code */
> > +       data = ast_mindwm(ast, 0x1E6E200C) & 0xF9FFFFFF;
> > +       ast_moutdwm(ast, 0x1E6E200C, data | 0x10000000);
> > +
> > +       return true;
> 
> Drop the return type - function always returns true ?
> I think there were a few other functions that could do the same.

It's not. I added a timeout with a return false ;-)

Cheers,
Ben.



More information about the dri-devel mailing list