From: "Chanho Park" <chanho61.park@samsung.com>
To: "'Simon Glass'" <sjg@chromium.org>
Cc: "'Rick Chen'" <rick@andestech.com>,
"'Leo'" <ycliang@andestech.com>, <u-boot@lists.denx.de>
Subject: RE: [PATCH v2 3/3] timer: riscv_aclint_timer: add timer_get_boot_us for BOOTSTAGE
Date: Tue, 5 Sep 2023 14:02:19 +0900 [thread overview]
Message-ID: <003001d9dfb6$260f2930$722d7b90$@samsung.com> (raw)
In-Reply-To: <CAPnjgZ2eKzzcyjBG_EKbCLMM_9x4h4O4ABPMgX6vY_ScD=tZUA@mail.gmail.com>
Hi Simon,
> -----Original Message-----
> From: Simon Glass <sjg@chromium.org>
> Sent: Tuesday, September 5, 2023 1:49 AM
> To: Chanho Park <chanho61.park@samsung.com>
> Cc: Rick Chen <rick@andestech.com>; Leo <ycliang@andestech.com>; u-
> boot@lists.denx.de
> Subject: Re: [PATCH v2 3/3] timer: riscv_aclint_timer: add
> timer_get_boot_us for BOOTSTAGE
>
> Hi Chanho,
>
> On Mon, 28 Aug 2023 at 03:50, Chanho Park <chanho61.park@samsung.com>
> wrote:
> >
> > timer_get_boot_us function is required to record the boot stages as
> > us-based timestamp.
> >
> > Signed-off-by: Chanho Park <chanho61.park@samsung.com>
> > ---
> > drivers/timer/riscv_aclint_timer.c | 22 ++++++++++++++++++++++
> > 1 file changed, 22 insertions(+)
> >
> > diff --git a/drivers/timer/riscv_aclint_timer.c
> b/drivers/timer/riscv_aclint_timer.c
> > index e29d527c8d77..8b67745bb4a2 100644
> > --- a/drivers/timer/riscv_aclint_timer.c
> > +++ b/drivers/timer/riscv_aclint_timer.c
> > @@ -6,6 +6,7 @@
> >
> > #include <common.h>
> > #include <clk.h>
> > +#include <div64.h>
> > #include <dm.h>
> > #include <timer.h>
> > #include <asm/io.h>
> > @@ -44,6 +45,27 @@ u64 notrace timer_early_get_count(void)
> > }
> > #endif
> >
> > +#if CONFIG_IS_ENABLED(RISCV_MMODE) && CONFIG_IS_ENABLED(BOOTSTAGE)
>
> Just a nit...you should not need this #if, since if the function is
> not used it will be stripped from the image by the linker.
Thank you for the suggestion.
Without these guards, compile error can be occurred due to multiple timer_get_boot_us definitions.
For risc-v, there are two timers for S-mode and M-mode, respectively.
So, I put them to avoid below build errors.
riscv64-unknown-linux-gnu-ld.bfd: drivers/timer/riscv_aclint_timer.o: in function `timer_get_boot_us':
/data/risc-v/qemu/u-boot/drivers/timer/riscv_aclint_timer.c:49: multiple definition of `timer_get_boot_us'; drivers/timer/riscv_timer.o:/data/risc-v/qemu/u-boot/drivers/timer/riscv_timer.c:55: first defined here
make[1]: *** [scripts/Makefile.spl:527: spl/u-boot-spl] Error 1
Best Regards,
Chanho Park
prev parent reply other threads:[~2023-09-05 5:02 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20230828094952epcas2p31c71a57ef3486cbd75f605057cc8085f@epcas2p3.samsung.com>
2023-08-28 9:49 ` [PATCH v2 0/3] bootstage support for risc-v Chanho Park
2023-08-28 9:49 ` [PATCH v2 1/3] riscv: bootstage: correct bootstage_report guard Chanho Park
2023-09-04 6:41 ` Leo Liang
2023-08-28 9:49 ` [PATCH v2 2/3] riscv: timer: add timer_get_boot_us for BOOTSTAGE Chanho Park
2023-09-04 7:01 ` Leo Liang
2023-09-04 7:41 ` Chanho Park
2023-08-28 9:49 ` [PATCH v2 3/3] timer: riscv_aclint_timer: " Chanho Park
2023-09-04 7:02 ` Leo Liang
2023-09-04 7:42 ` Chanho Park
2023-09-04 16:48 ` Simon Glass
2023-09-05 5:02 ` Chanho Park [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='003001d9dfb6$260f2930$722d7b90$@samsung.com' \
--to=chanho61.park@samsung.com \
--cc=rick@andestech.com \
--cc=sjg@chromium.org \
--cc=u-boot@lists.denx.de \
--cc=ycliang@andestech.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.