[PATCH u-boot 3/5] aspeed: Added function to calculate APB Clock frequency.

Maxim Sloyko maxims at google.com
Thu Nov 24 04:59:51 AEDT 2016


On Wed, Nov 23, 2016 at 8:24 AM, Simon Glass <sjg at chromium.org> wrote:

> [resend from correct address]
>
> On 23 November 2016 at 09:13, Simon Glass <sjg at google.com> wrote:
> > Hi Maxim,
> >
> > On 22 November 2016 at 16:56,  <maxims at google.com> wrote:
> >> From: Maxim Sloyko <maxims at google.com>
> >>
> >
> > For the subject, 'Add' rather than 'Added' (we use present tense)
>

Done.


> >
> >> This is needed by I2C driver.
> >>
> >> Signed-off-by: Maxim Sloyko <maxims at google.com>
> >> ---
> >>  arch/arm/include/asm/arch-aspeed/ast_scu.h |  1 +
> >>  arch/arm/mach-aspeed/ast-scu.c             | 11 +++++++++++
> >>  2 files changed, 12 insertions(+)
> >>
> >> diff --git a/arch/arm/include/asm/arch-aspeed/ast_scu.h
> b/arch/arm/include/asm/arch-aspeed/ast_scu.h
> >> index d248416..eb5aaa2 100644
> >> --- a/arch/arm/include/asm/arch-aspeed/ast_scu.h
> >> +++ b/arch/arm/include/asm/arch-aspeed/ast_scu.h
> >> @@ -38,6 +38,7 @@ extern void ast_scu_get_who_init_dram(void);
> >>  extern u32 ast_get_clk_source(void);
> >>  extern u32 ast_get_h_pll_clk(void);
> >>  extern u32 ast_get_ahbclk(void);
> >> +extern u32 ast_get_apbclk(void);
> >
> > Please add a comment as to what this does and what it returns.
>

Done.


> >
> >>
> >>  extern u32 ast_scu_get_vga_memsize(void);
> >>
> >> diff --git a/arch/arm/mach-aspeed/ast-scu.c b/arch/arm/mach-aspeed/ast-
> scu.c
> >> index 280c421..e00dbe2 100644
> >> --- a/arch/arm/mach-aspeed/ast-scu.c
> >> +++ b/arch/arm/mach-aspeed/ast-scu.c
> >> @@ -318,6 +318,17 @@ u32 ast_get_ahbclk(void)
> >>
> >>  #endif /* AST_SOC_G5 */
> >>
> >> +u32 ast_get_apbclk(void)
> >> +{
> >> +       u32 h_pll = ast_get_h_pll_clk();
> >
> > Can this be ulong, or is there a reason it has to be exactly 32 bits?
> >
> > blank line here (between declarations and code)
> >
> >> +       /* The formula for converting the bit pattern to divisor is
> >
> > /*
> >  * The formula...
> >  * ...
> >  */
>

Done.


> >
> >> +        * (4 + 4 * DIV), according to datasheet
> >> +        */
> >> +       u32 apb_div = 4 + 4 * SCU_GET_PCLK_DIV(ast_scu_read(
> AST_SCU_CLK_SEL));
> >> +       return h_pll / apb_div;
> >> +}
> >> +
> >> +
> >>  void ast_scu_show_system_info(void)
> >>  {
> >>
> >> --
> >> 2.8.0.rc3.226.g39d4020
> >>
> >
> > Regards,
> > Simon
>



-- 
*M*axim *S*loyko
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20161123/70ae4a09/attachment.html>


More information about the openbmc mailing list