From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v1 13/16] arm: socfpga: stratix10: Add timer support for Stratix10 SoC
Date: Thu, 19 Apr 2018 04:59:00 +0200 [thread overview]
Message-ID: <348cf511-cdfd-bb02-9c44-5a166e75ea38@denx.de> (raw)
In-Reply-To: <1524131457-19234-14-git-send-email-ley.foon.tan@intel.com>
On 04/19/2018 11:50 AM, Ley Foon Tan wrote:
> Add timer support for Stratix SoC
Is this really custom timer or is that some armv8 thing you're adding
here ? Don't we already have a generic implementation for that ? If not,
that's what we should do here.
> Signed-off-by: Chin Liang See <chin.liang.see@intel.com>
> Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
> ---
> arch/arm/mach-socfpga/timer.c | 17 ++++++++++++++++-
> 1 files changed, 16 insertions(+), 1 deletions(-)
>
> diff --git a/arch/arm/mach-socfpga/timer.c b/arch/arm/mach-socfpga/timer.c
> index 253cde3..4c90b57 100644
> --- a/arch/arm/mach-socfpga/timer.c
> +++ b/arch/arm/mach-socfpga/timer.c
> @@ -1,5 +1,6 @@
> /*
> - * Copyright (C) 2012 Altera Corporation <www.altera.com>
> + * Copyright (C) 2016-2018 Intel Corporation <www.intel.com>
> + * Copyright (C) 2012-2016 Altera Corporation <www.altera.com>
> *
> * SPDX-License-Identifier: GPL-2.0+
> */
> @@ -10,15 +11,29 @@
>
> #define TIMER_LOAD_VAL 0xFFFFFFFF
>
> +#if !defined(CONFIG_TARGET_SOCFPGA_STRATIX10)
> static const struct socfpga_timer *timer_base = (void *)CONFIG_SYS_TIMERBASE;
> +#endif
>
> /*
> * Timer initialization
> */
> int timer_init(void)
> {
> +#if defined(CONFIG_TARGET_SOCFPGA_STRATIX10)
> + int enable = 0x3; /* timer enable + output signal masked */
> + int loadval = ~0;
> +
> + /* enable system counter */
> + writel(enable, SOCFPGA_GTIMER_SEC_ADDRESS);
> + /* enable processor pysical counter */
> + asm volatile("msr cntp_ctl_el0, %0" : : "r" (enable));
> + asm volatile("msr cntp_tval_el0, %0" : : "r" (loadval));
> +
> +#else
> writel(TIMER_LOAD_VAL, &timer_base->load_val);
> writel(TIMER_LOAD_VAL, &timer_base->curr_val);
> writel(readl(&timer_base->ctrl) | 0x3, &timer_base->ctrl);
> +#endif
> return 0;
> }
>
--
Best regards,
Marek Vasut
next prev parent reply other threads:[~2018-04-19 2:59 UTC|newest]
Thread overview: 62+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-19 9:50 [U-Boot] [PATCH v1 00/16] Add Intel Stratix 10 SoC support Ley Foon Tan
2018-04-19 9:50 ` [U-Boot] [PATCH v1 01/16] arm: socfpga: stratix10: Add base address map for Statix10 SoC Ley Foon Tan
2018-04-19 3:02 ` Marek Vasut
2018-04-20 15:22 ` Ley Foon Tan
2018-04-20 10:59 ` Marek Vasut
2018-04-19 9:50 ` [U-Boot] [PATCH v1 02/16] arm: socfpga: stratix10: Add clock manager driver for Stratix10 SoC Ley Foon Tan
2018-04-19 9:50 ` [U-Boot] [PATCH v1 03/16] arm: socfpga: stratix10: Add reset " Ley Foon Tan
2018-04-19 9:50 ` [U-Boot] [PATCH v1 04/16] arm: socfpga: stratix10: Add pinmux support " Ley Foon Tan
2018-04-19 9:50 ` [U-Boot] [PATCH v1 05/16] arm: socfpga: misc: Add CONFIG_SYS_L2_PL310 switch Ley Foon Tan
2018-04-19 2:47 ` Marek Vasut
2018-04-19 5:15 ` See, Chin Liang
2018-04-19 8:19 ` Marek Vasut
2018-04-20 7:49 ` Ley Foon Tan
2018-04-20 11:00 ` Marek Vasut
2018-04-23 1:31 ` Ley Foon Tan
2018-04-19 9:50 ` [U-Boot] [PATCH v1 06/16] arm: socfpga: misc: Move eth reset to common misc driver Ley Foon Tan
2018-04-19 2:47 ` Marek Vasut
2018-04-19 3:13 ` Ley Foon Tan
2018-04-19 8:20 ` Marek Vasut
2018-04-23 1:31 ` Ley Foon Tan
2018-04-19 9:50 ` [U-Boot] [PATCH v1 07/16] arm: socfpga: stratix10: Add misc support for Stratix10 SoC Ley Foon Tan
2018-04-19 2:49 ` Marek Vasut
2018-04-27 2:10 ` Ley Foon Tan
2018-04-27 7:05 ` Marek Vasut
2018-04-27 8:04 ` Ley Foon Tan
2018-04-27 8:30 ` Marek Vasut
2018-04-19 9:50 ` [U-Boot] [PATCH v1 08/16] arm: socfpga: stratix10: Add mailbox " Ley Foon Tan
2018-04-19 2:53 ` Marek Vasut
2018-05-08 6:49 ` Ley Foon Tan
2018-05-08 9:21 ` Marek Vasut
2018-05-10 8:45 ` Ley Foon Tan
2018-05-10 10:09 ` Marek Vasut
2018-05-11 5:45 ` Ley Foon Tan
2018-05-11 8:44 ` Marek Vasut
2018-05-11 9:25 ` Ley Foon Tan
2018-05-11 9:56 ` Marek Vasut
2018-04-19 9:50 ` [U-Boot] [PATCH v1 09/16] arm: socfpga: stratix10: Add MMU " Ley Foon Tan
2018-04-19 2:53 ` Marek Vasut
2018-04-19 9:50 ` [U-Boot] [PATCH v1 10/16] arm: dts: Add dts " Ley Foon Tan
2018-04-19 2:54 ` Marek Vasut
2018-04-23 2:05 ` Ley Foon Tan
2018-04-19 9:50 ` [U-Boot] [PATCH v1 11/16] arm: socfpga: Restructure the SPL file Ley Foon Tan
2018-04-19 9:50 ` [U-Boot] [PATCH v1 12/16] arm: socfpga: stratix10: Add SPL driver for Stratix10 SoC Ley Foon Tan
2018-04-19 2:58 ` Marek Vasut
2018-04-27 2:14 ` Ley Foon Tan
2018-04-27 7:09 ` Marek Vasut
2018-04-19 9:50 ` [U-Boot] [PATCH v1 13/16] arm: socfpga: stratix10: Add timer support " Ley Foon Tan
2018-04-19 2:59 ` Marek Vasut [this message]
2018-04-19 5:26 ` See, Chin Liang
2018-04-19 8:21 ` Marek Vasut
2018-04-23 1:54 ` Ley Foon Tan
2018-04-23 3:40 ` Marek Vasut
2018-04-23 6:00 ` Ley Foon Tan
2018-04-23 11:59 ` Marek Vasut
2018-04-24 7:03 ` Ley Foon Tan
2018-04-19 9:50 ` [U-Boot] [PATCH v1 14/16] ddr: altera: stratix10: Add DDR " Ley Foon Tan
2018-04-19 3:02 ` Marek Vasut
2018-05-10 7:47 ` Ley Foon Tan
2018-05-10 10:12 ` Marek Vasut
2018-05-11 2:40 ` Ley Foon Tan
2018-04-19 9:50 ` [U-Boot] [PATCH v1 15/16] board: altera: stratix10: Add socdk board " Ley Foon Tan
2018-04-19 9:50 ` [U-Boot] [PATCH v1 16/16] arm: socfpga: stratix10: Enable Stratix10 SoC build Ley Foon Tan
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=348cf511-cdfd-bb02-9c44-5a166e75ea38@denx.de \
--to=marex@denx.de \
--cc=u-boot@lists.denx.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox