diff mbox series

[v3,3/5] lib: sbi: Print timer frequency at boot time

Message ID 20210925043735.686518-4-anup.patel@wdc.com
State Accepted
Headers show
Series Timer based delay loop | expand

Commit Message

Anup Patel Sept. 25, 2021, 4:37 a.m. UTC
We now have frequency in timer device instance provided by platform
so let's print timer frequency as part of the boot prints.

Signed-off-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
---
 lib/sbi/sbi_init.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Xiang W Sept. 25, 2021, 7:28 a.m. UTC | #1
在 2021-09-25星期六的 10:07 +0530,Anup Patel写道:
> We now have frequency in timer device instance provided by platform
> so let's print timer frequency as part of the boot prints.
> 
> Signed-off-by: Anup Patel <anup.patel@wdc.com>
> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Xiang W <wxjstz@126.com>
> ---
>  lib/sbi/sbi_init.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/sbi/sbi_init.c b/lib/sbi/sbi_init.c
> index 6ef8742..f0eb365 100644
> --- a/lib/sbi/sbi_init.c
> +++ b/lib/sbi/sbi_init.c
> @@ -75,8 +75,9 @@ static void sbi_boot_print_general(struct
> sbi_scratch *scratch)
>         sbi_printf("Platform IPI Device       : %s\n",
>                    (idev) ? idev->name : "---");
>         tdev = sbi_timer_get_device();
> -       sbi_printf("Platform Timer Device     : %s\n",
> -                  (tdev) ? tdev->name : "---");
> +       sbi_printf("Platform Timer Device     : %s @ %luHz\n",
> +                  (tdev) ? tdev->name : "---",
> +                  (tdev) ? tdev->timer_freq : 0);
>         cdev = sbi_console_get_device();
>         sbi_printf("Platform Console Device   : %s\n",
>                    (cdev) ? cdev->name : "---");
> -- 
> 2.25.1
> 
>
Anup Patel Sept. 27, 2021, 3:58 a.m. UTC | #2
On Sat, Sep 25, 2021 at 12:59 PM Xiang W <wxjstz@126.com> wrote:
>
> 在 2021-09-25星期六的 10:07 +0530,Anup Patel写道:
> > We now have frequency in timer device instance provided by platform
> > so let's print timer frequency as part of the boot prints.
> >
> > Signed-off-by: Anup Patel <anup.patel@wdc.com>
> > Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
> Reviewed-by: Xiang W <wxjstz@126.com>

Applied this patch to the riscv/opensbi repo

Regards,
Anup

> > ---
> >  lib/sbi/sbi_init.c | 5 +++--
> >  1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/lib/sbi/sbi_init.c b/lib/sbi/sbi_init.c
> > index 6ef8742..f0eb365 100644
> > --- a/lib/sbi/sbi_init.c
> > +++ b/lib/sbi/sbi_init.c
> > @@ -75,8 +75,9 @@ static void sbi_boot_print_general(struct
> > sbi_scratch *scratch)
> >         sbi_printf("Platform IPI Device       : %s\n",
> >                    (idev) ? idev->name : "---");
> >         tdev = sbi_timer_get_device();
> > -       sbi_printf("Platform Timer Device     : %s\n",
> > -                  (tdev) ? tdev->name : "---");
> > +       sbi_printf("Platform Timer Device     : %s @ %luHz\n",
> > +                  (tdev) ? tdev->name : "---",
> > +                  (tdev) ? tdev->timer_freq : 0);
> >         cdev = sbi_console_get_device();
> >         sbi_printf("Platform Console Device   : %s\n",
> >                    (cdev) ? cdev->name : "---");
> > --
> > 2.25.1
> >
> >
>
>
diff mbox series

Patch

diff --git a/lib/sbi/sbi_init.c b/lib/sbi/sbi_init.c
index 6ef8742..f0eb365 100644
--- a/lib/sbi/sbi_init.c
+++ b/lib/sbi/sbi_init.c
@@ -75,8 +75,9 @@  static void sbi_boot_print_general(struct sbi_scratch *scratch)
 	sbi_printf("Platform IPI Device       : %s\n",
 		   (idev) ? idev->name : "---");
 	tdev = sbi_timer_get_device();
-	sbi_printf("Platform Timer Device     : %s\n",
-		   (tdev) ? tdev->name : "---");
+	sbi_printf("Platform Timer Device     : %s @ %luHz\n",
+		   (tdev) ? tdev->name : "---",
+		   (tdev) ? tdev->timer_freq : 0);
 	cdev = sbi_console_get_device();
 	sbi_printf("Platform Console Device   : %s\n",
 		   (cdev) ? cdev->name : "---");