Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1614201 > unrolled thread

[PATCH v23 00/11] acpi, clocksource: add GTDT driver and GTDT support in arm_arch_timer

Started byfu.wei@linaro.org
First post2017-03-31 20:00 +0200
Last post2017-04-04 22:40 +0200
Articles 6 on this page of 26 — 7 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v23 00/11] acpi, clocksource: add GTDT driver and GTDT support in arm_arch_timer fu.wei@linaro.org - 2017-03-31 20:00 +0200
    [PATCH v23 06/11] clocksource: arm_arch_timer: refactor MMIO timer probing. fu.wei@linaro.org - 2017-03-31 20:00 +0200
      Re: [PATCH v23 06/11] clocksource: arm_arch_timer: refactor MMIO  timer probing. Mark Rutland <mark.rutland@arm.com> - 2017-04-05 20:50 +0200
        Re: [PATCH v23 06/11] clocksource: arm_arch_timer: refactor MMIO  timer probing. Fu Wei <fu.wei@linaro.org> - 2017-04-06 12:50 +0200
    [PATCH v23 04/11] clocksource: arm_arch_timer: move arch_timer_needs_of_probing into DT init call fu.wei@linaro.org - 2017-03-31 20:00 +0200
    [PATCH v23 08/11] clocksource: arm_arch_timer: simplify ACPI support code. fu.wei@linaro.org - 2017-03-31 20:00 +0200
    [PATCH v23 09/11] acpi/arm64: Add memory-mapped timer support in GTDT driver fu.wei@linaro.org - 2017-03-31 20:00 +0200
      Re: [PATCH v23 09/11] acpi/arm64: Add memory-mapped timer support in  GTDT driver Will Deacon <will.deacon@arm.com> - 2017-04-03 11:50 +0200
      Re: [PATCH v23 09/11] acpi/arm64: Add memory-mapped timer support in  GTDT driver Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> - 2017-04-03 12:50 +0200
        Re: [PATCH v23 09/11] acpi/arm64: Add memory-mapped timer support in  GTDT driver Fu Wei <fu.wei@linaro.org> - 2017-04-06 19:20 +0200
      Re: [PATCH v23 09/11] acpi/arm64: Add memory-mapped timer support in  GTDT driver Mark Rutland <mark.rutland@arm.com> - 2017-04-05 20:40 +0200
        Re: [PATCH v23 09/11] acpi/arm64: Add memory-mapped timer support in  GTDT driver Mark Rutland <mark.rutland@arm.com> - 2017-04-06 12:10 +0200
        Re: [PATCH v23 09/11] acpi/arm64: Add memory-mapped timer support in  GTDT driver Fu Wei <fu.wei@linaro.org> - 2017-04-06 18:50 +0200
          Re: [PATCH v23 09/11] acpi/arm64: Add memory-mapped timer support in  GTDT driver Mark Rutland <mark.rutland@arm.com> - 2017-04-06 19:30 +0200
            Re: [PATCH v23 09/11] acpi/arm64: Add memory-mapped timer support in  GTDT driver Fu Wei <fu.wei@linaro.org> - 2017-04-06 19:50 +0200
              Re: [PATCH v23 09/11] acpi/arm64: Add memory-mapped timer support in  GTDT driver Mark Rutland <mark.rutland@arm.com> - 2017-04-06 20:00 +0200
                Re: [PATCH v23 09/11] acpi/arm64: Add memory-mapped timer support in  GTDT driver Fu Wei <fu.wei@linaro.org> - 2017-04-06 20:10 +0200
    [PATCH v23 07/11] acpi/arm64: Add GTDT table parse driver fu.wei@linaro.org - 2017-03-31 20:00 +0200
    [PATCH v23 05/11] clocksource: arm_arch_timer: add structs to describe MMIO timer fu.wei@linaro.org - 2017-03-31 20:00 +0200
    [PATCH v23 01/11] clocksource: arm_arch_timer: add MMIO CNTFRQ helper fu.wei@linaro.org - 2017-03-31 20:00 +0200
    [PATCH v23 11/11] acpi/arm64: Add SBSA Generic Watchdog support in GTDT driver fu.wei@linaro.org - 2017-03-31 20:00 +0200
    [PATCH v23 02/11] clocksource: arm_arch_timer: split dt-only rate handling fu.wei@linaro.org - 2017-03-31 20:00 +0200
    [PATCH v23 03/11] clocksource: arm_arch_timer: refactor arch_timer_needs_probing fu.wei@linaro.org - 2017-03-31 20:00 +0200
    Re: [PATCH v23 00/11] acpi, clocksource: add GTDT driver and GTDT  support in arm_arch_timer Xiongfeng Wang <wangxiongfeng2@huawei.com> - 2017-04-01 04:20 +0200
      Re: [PATCH v23 00/11] acpi, clocksource: add GTDT driver and GTDT  support in arm_arch_timer Fu Wei <fu.wei@linaro.org> - 2017-04-01 05:50 +0200
    Re: [PATCH v23 00/11] acpi, clocksource: add GTDT driver and GTDT  support in arm_arch_timer Timur Tabi <timur@codeaurora.org> - 2017-04-04 22:40 +0200

Page 2 of 2 — ← Prev page 1 [2]


#1614223 — [PATCH v23 11/11] acpi/arm64: Add SBSA Generic Watchdog support in GTDT driver

Fromfu.wei@linaro.org
Date2017-03-31 20:00 +0200
Subject[PATCH v23 11/11] acpi/arm64: Add SBSA Generic Watchdog support in GTDT driver
Message-ID<tr907-7Ov-61@gated-at.bofh.it>
In reply to#1614201
From: Fu Wei <fu.wei@linaro.org>

This driver adds support for parsing SBSA Generic Watchdog timer
in GTDT, parse all info in SBSA Generic Watchdog Structure in GTDT,
and creating a platform device with that information.

This allows the operating system to obtain device data from the
resource of platform device. The platform device named "sbsa-gwdt"
can be used by the ARM SBSA Generic Watchdog driver.

Signed-off-by: Fu Wei <fu.wei@linaro.org>
Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
Tested-by: Xiongfeng Wang <wangxiongfeng2@huawei.com>
Reviewed-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
---
 drivers/acpi/arm64/gtdt.c | 103 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 103 insertions(+)

diff --git a/drivers/acpi/arm64/gtdt.c b/drivers/acpi/arm64/gtdt.c
index 3dd33f3..d73bb16 100644
--- a/drivers/acpi/arm64/gtdt.c
+++ b/drivers/acpi/arm64/gtdt.c
@@ -15,6 +15,7 @@
 #include <linux/init.h>
 #include <linux/irqdomain.h>
 #include <linux/kernel.h>
+#include <linux/platform_device.h>
 
 #include <clocksource/arm_arch_timer.h>
 
@@ -60,6 +61,17 @@ static inline bool is_timer_block(void *platform_timer)
 	return gh->type == ACPI_GTDT_TYPE_TIMER_BLOCK;
 }
 
+static inline bool is_non_secure_watchdog(void *platform_timer)
+{
+	struct acpi_gtdt_header *gh = platform_timer;
+	struct acpi_gtdt_watchdog *wd = platform_timer;
+
+	if (gh->type != ACPI_GTDT_TYPE_WATCHDOG)
+		return false;
+
+	return !(wd->timer_flags & ACPI_GTDT_WATCHDOG_SECURE);
+}
+
 static int __init map_gt_gsi(u32 interrupt, u32 flags)
 {
 	int trigger, polarity;
@@ -301,3 +313,94 @@ int __init acpi_arch_timer_mem_init(struct arch_timer_mem *timer_mem,
 
 	return 0;
 }
+
+/*
+ * Initialize a SBSA generic Watchdog platform device info from GTDT
+ */
+static int __init gtdt_import_sbsa_gwdt(struct acpi_gtdt_watchdog *wd,
+					int index)
+{
+	struct platform_device *pdev;
+	int irq = map_gt_gsi(wd->timer_interrupt, wd->timer_flags);
+
+	/*
+	 * According to SBSA specification the size of refresh and control
+	 * frames of SBSA Generic Watchdog is SZ_4K(Offset 0x000 – 0xFFF).
+	 */
+	struct resource res[] = {
+		DEFINE_RES_MEM(wd->control_frame_address, SZ_4K),
+		DEFINE_RES_MEM(wd->refresh_frame_address, SZ_4K),
+		DEFINE_RES_IRQ(irq),
+	};
+	int nr_res = ARRAY_SIZE(res);
+
+	pr_debug("found a Watchdog (0x%llx/0x%llx gsi:%u flags:0x%x).\n",
+		 wd->refresh_frame_address, wd->control_frame_address,
+		 wd->timer_interrupt, wd->timer_flags);
+
+	if (!(wd->refresh_frame_address && wd->control_frame_address)) {
+		pr_err(FW_BUG "failed to get the Watchdog base address.\n");
+		acpi_unregister_gsi(wd->timer_interrupt);
+		return -EINVAL;
+	}
+
+	if (irq <= 0) {
+		pr_warn("failed to map the Watchdog interrupt.\n");
+		nr_res--;
+	}
+
+	/*
+	 * Add a platform device named "sbsa-gwdt" to match the platform driver.
+	 * "sbsa-gwdt": SBSA(Server Base System Architecture) Generic Watchdog
+	 * The platform driver can get device info below by matching this name.
+	 */
+	pdev = platform_device_register_simple("sbsa-gwdt", index, res, nr_res);
+	if (IS_ERR(pdev)) {
+		acpi_unregister_gsi(wd->timer_interrupt);
+		return PTR_ERR(pdev);
+	}
+
+	return 0;
+}
+
+static int __init gtdt_sbsa_gwdt_init(void)
+{
+	void *platform_timer;
+	struct acpi_table_header *table;
+	int ret, timer_count, gwdt_count = 0;
+
+	if (acpi_disabled)
+		return 0;
+
+	if (ACPI_FAILURE(acpi_get_table(ACPI_SIG_GTDT, 0, &table)))
+		return -EINVAL;
+
+	/*
+	 * Note: Even though the global variable acpi_gtdt_desc has been
+	 * initialized by acpi_gtdt_init() while initializing the arch timers,
+	 * when we call this function to get SBSA watchdogs info from GTDT, the
+	 * pointers stashed in it are stale (since they are early temporary
+	 * mappings carried out before acpi_permanent_mmap is set) and we need
+	 * to re-initialize them with permanent mapped pointer values to let the
+	 * GTDT parsing possible.
+	 */
+	ret = acpi_gtdt_init(table, &timer_count);
+	if (ret || !timer_count)
+		return ret;
+
+	for_each_platform_timer(platform_timer) {
+		if (is_non_secure_watchdog(platform_timer)) {
+			ret = gtdt_import_sbsa_gwdt(platform_timer, gwdt_count);
+			if (ret)
+				break;
+			gwdt_count++;
+		}
+	}
+
+	if (gwdt_count)
+		pr_info("found %d SBSA generic Watchdog(s).\n", gwdt_count);
+
+	return ret;
+}
+
+device_initcall(gtdt_sbsa_gwdt_init);
-- 
2.9.3

[toc] | [prev] | [next] | [standalone]


#1614224 — [PATCH v23 02/11] clocksource: arm_arch_timer: split dt-only rate handling

Fromfu.wei@linaro.org
Date2017-03-31 20:00 +0200
Subject[PATCH v23 02/11] clocksource: arm_arch_timer: split dt-only rate handling
Message-ID<tr907-7Ov-59@gated-at.bofh.it>
In reply to#1614201
From: Fu Wei <fu.wei@linaro.org>

Currently Currently arch_timer_detect_rate() tried to handle both the
sysreg timer and MMIO timer, with DT-specific fallback code. This gets
in the way of implementing deterministic and correct rate probing when
using ACPI.

This patch moves this logic out into the (DT-specific) probe functions,
allowing different logic to be used in the ACPI case, and making it
easier to see which CNTFRQ register is being read in each case.

Signed-off-by: Fu Wei <fu.wei@linaro.org>
[Mark: reword commit message, TODO: rework comments]
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
---
 drivers/clocksource/arm_arch_timer.c | 58 +++++++++++++++++++-----------------
 1 file changed, 30 insertions(+), 28 deletions(-)

diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
index 843f923..1b6a7e6 100644
--- a/drivers/clocksource/arm_arch_timer.c
+++ b/drivers/clocksource/arm_arch_timer.c
@@ -560,30 +560,6 @@ static u32 arch_timer_mem_get_cntfrq(void __iomem *cntbase)
 	return readl_relaxed(cntbase + CNTFRQ);
 }
 
-static void
-arch_timer_detect_rate(void __iomem *cntbase, struct device_node *np)
-{
-	/* Who has more than one independent system counter? */
-	if (arch_timer_rate)
-		return;
-
-	/*
-	 * Try to determine the frequency from the device tree or CNTFRQ,
-	 * if ACPI is enabled, get the frequency from CNTFRQ ONLY.
-	 */
-	if (!acpi_disabled ||
-	    of_property_read_u32(np, "clock-frequency", &arch_timer_rate)) {
-		if (cntbase)
-			arch_timer_rate = arch_timer_mem_get_cntfrq(cntbase);
-		else
-			arch_timer_rate = arch_timer_get_cntfrq();
-	}
-
-	/* Check the timer frequency. */
-	if (arch_timer_rate == 0)
-		pr_warn("frequency not available\n");
-}
-
 static void arch_timer_banner(unsigned type)
 {
 	pr_info("%s%s%s timer(s) running at %lu.%02luMHz (%s%s%s).\n",
@@ -958,7 +934,17 @@ static int __init arch_timer_of_init(struct device_node *np)
 	for (i = ARCH_TIMER_PHYS_SECURE_PPI; i < ARCH_TIMER_MAX_TIMER_PPI; i++)
 		arch_timer_ppi[i] = irq_of_parse_and_map(np, i);
 
-	arch_timer_detect_rate(NULL, np);
+	/*
+	 * Determine the frequency of system counter:
+	 * Try to get the frequency from the device tree.
+	 * If fail, try the sysreg CNTFRQ. Then verify the frequency.
+	 */
+	if (of_property_read_u32(np, "clock-frequency", &arch_timer_rate))
+		arch_timer_rate = arch_timer_get_cntfrq();
+	if (!arch_timer_rate) {
+		pr_err(FW_BUG "frequency not available.\n");
+		return -EINVAL;
+	}
 
 	arch_timer_c3stop = !of_property_read_bool(np, "always-on");
 
@@ -1069,7 +1055,19 @@ static int __init arch_timer_mem_init(struct device_node *np)
 		goto out;
 	}
 
-	arch_timer_detect_rate(base, np);
+	/*
+	 * Try to determine the frequency from the device tree,
+	 * if fail, get the frequency from the CNTFRQ reg of MMIO timer.
+	 */
+	if (!arch_timer_rate &&
+	    of_property_read_u32(np, "clock-frequency", &arch_timer_rate))
+		arch_timer_rate = arch_timer_mem_get_cntfrq(base);
+	if (!arch_timer_rate) {
+		pr_err(FW_BUG "MMIO frequency not available.\n");
+		ret = -EINVAL;
+		goto out;
+	}
+
 	ret = arch_timer_mem_register(base, irq);
 	if (ret)
 		goto out;
@@ -1130,8 +1128,12 @@ static int __init arch_timer_acpi_init(struct acpi_table_header *table)
 		map_generic_timer_interrupt(gtdt->non_secure_el2_interrupt,
 		gtdt->non_secure_el2_flags);
 
-	/* Get the frequency from CNTFRQ */
-	arch_timer_detect_rate(NULL, NULL);
+	/* Get the frequency from the sysreg CNTFRQ */
+	arch_timer_rate = arch_timer_get_cntfrq();
+	if (!arch_timer_rate) {
+		pr_err(FW_BUG "frequency not available.\n");
+		return -EINVAL;
+	}
 
 	arch_timer_uses_ppi = arch_timer_select_ppi();
 	if (!arch_timer_ppi[arch_timer_uses_ppi]) {
-- 
2.9.3

[toc] | [prev] | [next] | [standalone]


#1614226 — [PATCH v23 03/11] clocksource: arm_arch_timer: refactor arch_timer_needs_probing

Fromfu.wei@linaro.org
Date2017-03-31 20:00 +0200
Subject[PATCH v23 03/11] clocksource: arm_arch_timer: refactor arch_timer_needs_probing
Message-ID<tr908-7Ov-63@gated-at.bofh.it>
In reply to#1614201
From: Fu Wei <fu.wei@linaro.org>

When booting with DT, it's possible for timer nodes to be probed in any
order. Some common initialisation needs to occur after all nodes have
been probed, and arch_timer_common_init() has code to detect when this
has happened.

This logic is DT-specific, and it would be best to factor it out of the
common code that will be shared with ACPI.

This patch folds this into the existing arch_timer_needs_probing(),
which is renamed to arch_timer_needs_of_probing(), and no longer takes
any arguments. This is only called when using DT, and not when using
ACPI, which will have a deterministic probe order.

Signed-off-by: Fu Wei <fu.wei@linaro.org>
Reviewed-by: Hanjun Guo <hanjun.guo@linaro.org>
[Mark: reword commit message]
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
---
 drivers/clocksource/arm_arch_timer.c | 34 +++++++++++++++++++---------------
 1 file changed, 19 insertions(+), 15 deletions(-)

diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
index 1b6a7e6..ed215d9 100644
--- a/drivers/clocksource/arm_arch_timer.c
+++ b/drivers/clocksource/arm_arch_timer.c
@@ -839,15 +839,28 @@ static const struct of_device_id arch_timer_mem_of_match[] __initconst = {
 	{},
 };
 
-static bool __init
-arch_timer_needs_probing(int type, const struct of_device_id *matches)
+static bool __init arch_timer_needs_of_probing(void)
 {
 	struct device_node *dn;
 	bool needs_probing = false;
+	unsigned int mask = ARCH_TIMER_TYPE_CP15 | ARCH_TIMER_TYPE_MEM;
 
-	dn = of_find_matching_node(NULL, matches);
-	if (dn && of_device_is_available(dn) && !(arch_timers_present & type))
+	/* We have two timers, and both device-tree nodes are probed. */
+	if ((arch_timers_present & mask) == mask)
+		return false;
+
+	/*
+	 * Only one type of timer is probed,
+	 * check if we have another type of timer node in device-tree.
+	 */
+	if (arch_timers_present & ARCH_TIMER_TYPE_CP15)
+		dn = of_find_matching_node(NULL, arch_timer_mem_of_match);
+	else
+		dn = of_find_matching_node(NULL, arch_timer_of_match);
+
+	if (dn && of_device_is_available(dn))
 		needs_probing = true;
+
 	of_node_put(dn);
 
 	return needs_probing;
@@ -855,17 +868,8 @@ arch_timer_needs_probing(int type, const struct of_device_id *matches)
 
 static int __init arch_timer_common_init(void)
 {
-	unsigned mask = ARCH_TIMER_TYPE_CP15 | ARCH_TIMER_TYPE_MEM;
-
-	/* Wait until both nodes are probed if we have two timers */
-	if ((arch_timers_present & mask) != mask) {
-		if (arch_timer_needs_probing(ARCH_TIMER_TYPE_MEM,
-					     arch_timer_mem_of_match))
-			return 0;
-		if (arch_timer_needs_probing(ARCH_TIMER_TYPE_CP15,
-					     arch_timer_of_match))
-			return 0;
-	}
+	if (acpi_disabled && arch_timer_needs_of_probing())
+		return 0;
 
 	arch_timer_banner(arch_timers_present);
 	arch_counter_register(arch_timers_present);
-- 
2.9.3

[toc] | [prev] | [next] | [standalone]


#1614368 — Re: [PATCH v23 00/11] acpi, clocksource: add GTDT driver and GTDT support in arm_arch_timer

FromXiongfeng Wang <wangxiongfeng2@huawei.com>
Date2017-04-01 04:20 +0200
SubjectRe: [PATCH v23 00/11] acpi, clocksource: add GTDT driver and GTDT support in arm_arch_timer
Message-ID<trgNY-4N2-15@gated-at.bofh.it>
In reply to#1614201

On 2017/4/1 1:50, fu.wei@linaro.org wrote:
> From: Fu Wei <fu.wei@linaro.org>
> 
> This patchset:
>     (1)Preparation for adding GTDT support in arm_arch_timer:
>         1. Introduce a MMIO CNTFRQ helper.
>         2. separate out device-tree code from arch_timer_detect_rate
>         3. remove arch_timer_detect_rate use arch_timer_*get_cntfrq directly
>         4. Refactor arch_timer_needs_probing, and move it into DT init call
>         5. Introduce some new structs and refactor the MMIO timer init code
>         for reusing some common code.
> 
>     (2)Introduce ACPI GTDT parser: drivers/acpi/arm64/acpi_gtdt.c
>     Parse all kinds of timer in GTDT table of ACPI:arch timer,
>     memory-mapped timer and SBSA Generic Watchdog timer.
>     This driver can help to simplify all the relevant timer drivers,
>     and separate all the ACPI GTDT knowledge from them.
> 
>     (3)Simplify ACPI code for arm_arch_timer
> 
>     (4)Add GTDT support for ARM memory-mapped timer.
> 
> This patchset has been tested on the following platforms with ACPI enabled:
>     (1)ARM Foundation v8 model
> 

for arm_arch_timer(not memory-mapped) and sbsa watchdog part,  Tested-by: wangxiongfeng2@huawei.com





Thanks,

Wang Xiongfeng
.

> Changelog:
> v23: https://lkml.org/lkml/2017/3/31/
>      Rebase to git://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git arch-timer/cleanup
>      Improve the data struct of arch_timer_mem and arch_timer_mem_frame to
>      improve the parser of GT blocks and arch_timer_mem initualization.
>      Improve arch_timer_rate detection: sysreg frequency is primary in DT boot
>      Improve some comments in GTDT parser driver.
>      Improve acpi_gtdt_init function, and make a comment for the multiple calls.
>      Improve the unwinding for the irq of timers, when an error occurs.
>      Handle the case of virtual timer GSIV is 0.
> 
> v22: https://lkml.org/lkml/2017/3/21/523
>      Rebase to git://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git arch-timer/cleanup
>      Only Introduce arch_timer_mem_get_cntfrq to get the frequency from mmio.
>      Merged patch 2,3(about arch_timer_detect_rate).
>      Keep arch_timer_rate, do NOT split it for different types of timer.
>      Improve  memory-mapped timer support by comments and variable name:
>          data-->timer_mem
>          frame-->gtdt_frame
>      Delete zero check for SBSA watchdog irq.
>      Skip secure SBSA watchdog in GTDT driver.
>      Delete Kconfig modification for SBSA watchdog driver.
>      Delete no_irq, using nr_res instead.
> 
> v21: https://lkml.org/lkml/2017/2/6/734
>      Introduce two functions to get the frequency from mmio and sysreg.
>      Remove arch_timer_detect_rate use arch_timer_get_*_freq directly
>      Split arch_timer_rate for different types of timer.
>      Skip secure timer frame in GTDT driver.
>      Rebase to git://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git arch-timer/cleanup
>      (The first 6 patches in v20 have been merged into arch-timer/cleanup branch)
> 
> v20: https://lkml.org/lkml/2017/1/18/534
>      Reorder the first 4 patches and split the 4th patches.
>      Leave CNTHCTL_* as they originally were.
>      Fix the bug in arch_timer_select_ppi.
>      Split "Rework counter frequency detection" patch.
>      Rework the arch_timer_detect_rate function.
>      Improve the commit message of "Refactor MMIO timer probing".
>      Rebase to 4.10.0-rc4
> 
> v19: https://lkml.org/lkml/2016/12/21/25
>      Fix a '\n' missing in a error message in arch_timer_mem_init.
>      Add "request_mem_region" for ioremapping cntbase, according to
>      f947ee1 clocksource/drivers/arm_arch_timer: Map frame with of_io_request_and_map()
>      Rebase to 4.9.0-gfb779ff
> 
> v18: https://lkml.org/lkml/2016/12/8/446
>      Fix 8/15 patch problem of "int ret;" in arch_timer_acpi_init.
>      Rebase to 4.9.0-rc8-g9269898
> 
> v17: https://lkml.org/lkml/2016/11/25/140
>      Take out some cleanups from 4/15.
>      Merge 5/15 and 6/15, improve PPI determination code,
>      improve commit message.
>      Rework counter frequency detection.
>      Move arch_timer_needs_of_probing into DT init call.
>      Move Platform Timer scan loop back to timer init call to avoid allocating
>      and free memory.
>      Improve all the exported functions' comment.
> 
> v16: https://lkml.org/lkml/2016/11/16/268
>      Fix patchset problem about static enum ppi_nr of 01/13 in v15.
>      Refactor arch_timer_detect_rate.
>      Refactor arch_timer_needs_probing.
> 
> v15: https://lkml.org/lkml/2016/11/15/366
>      Re-order patches
>      Add arm_arch_timer refactoring patches to prepare for GTDT:
>          1. rename some  enums and defines, and some cleanups
>          2. separate out arch_timer_uses_ppi init code and fix a potential bug
>          3. Improve some new structs, refactor the timer init code.
>      Since the some structs have been changed, GTDT parser for memory-mapped
>      timer and SBSA Generic Watchdog timer have been update.
> 
> v14: https://lkml.org/lkml/2016/9/28/573
>      Separate memory-mapped timer GTDT support into two patches
>          1. Refactor the timer init code to prepare for GTDT
>          2. Add GTDT support for memory-mapped timer
> 
> v13: http://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1231717.html
>      Improve arm_arch_timer code for memory-mapped
>      timer GTDT support, refactor original memory-mapped timer
>      dt support for reusing some common code.
> 
> v12: https://lkml.org/lkml/2016/9/13/250
>      Rebase to latest Linux 4.8-rc6
>      Delete the confusing "skipping" in the error message.
> 
> V11: https://lkml.org/lkml/2016/9/6/354
>      Rebase to latest Linux 4.8-rc5
>      Delete typedef (suggested by checkpatch.pl)
> 
> V10: https://lkml.org/lkml/2016/7/26/215
>      Drop the "readq" patch.
>      Rebase to latest Linux 4.7.
> 
> V9: https://lkml.org/lkml/2016/7/25/345
>     Improve pr_err message in acpi gtdt driver.
>     Update Commit message for 7/9
>     shorten the irq mapping function name
>     Improve GTDT driver for memory-mapped timer
> 
> v8: https://lkml.org/lkml/2016/7/19/660
>     Improve "pr_fmt(fmt)" definition: add "ACPI" in front of "GTDT",
>     and also improve printk message.
>     Simplify is_timer_block and is_watchdog.
>     Merge acpi_gtdt_desc_init and gtdt_arch_timer_init into acpi_gtdt_init();
>     Delete __init in include/linux/acpi.h for GTDT API
>     Make ARM64 select GTDT.
>     Delete "#include <linux/module.h>" from acpi_gtdt.c
>     Simplify GT block parse code.
> 
> v7: https://lkml.org/lkml/2016/7/13/769
>     Move the GTDT driver to drivers/acpi/arm64
>     Add add the ARM64-specific ACPI Support maintainers in MAINTAINERS
>     Merge 3 patches of GTDT parser driver.
>     Fix the for_each_platform_timer bug.
> 
> v6: https://lkml.org/lkml/2016/6/29/580
>     split the GTDT driver to 4 parts: basic, arch_timer, memory-mapped timer,
>     and SBSA Generic Watchdog timer
>     Improve driver by suggestions and example code from Daniel Lezcano
> 
> v5: https://lkml.org/lkml/2016/5/24/356
>     Sorting out all patches, simplify the API of GTDT driver:
>     GTDT driver just fills the data struct for arm_arch_timer driver.
> 
> v4: https://lists.linaro.org/pipermail/linaro-acpi/2016-March/006667.html
>     Delete the kvm relevant patches
>     Separate two patches for sorting out the code for arm_arch_timer.
>     Improve irq info export code to allow missing irq info in GTDT table.
> 
> v3: https://lkml.org/lkml/2016/2/1/658
>     Improve GTDT driver code:
>       (1)improve pr_* by defining pr_fmt(fmt)
>       (2)simplify gtdt_sbsa_gwdt_init
>       (3)improve gtdt_arch_timer_data_init, if table is NULL, it will try
>       to get GTDT table.
>     Move enum ppi_nr to arm_arch_timer.h, and add enum spi_nr.
>     Add arm_arch_timer get ppi from DT and GTDT support for kvm.
> 
> v2: https://lkml.org/lkml/2015/12/2/10
>     Rebase to latest kernel version(4.4-rc3).
>     Fix the bug about the config problem,
>     use CONFIG_ACPI_GTDT instead of CONFIG_ACPI in arm_arch_timer.c
> 
> v1: The first upstreaming version: https://lkml.org/lkml/2015/10/28/553
> 
> Fu Wei (11):
>   clocksource: arm_arch_timer: add MMIO CNTFRQ helper
>   clocksource: arm_arch_timer: split dt-only rate handling
>   clocksource: arm_arch_timer: refactor arch_timer_needs_probing
>   clocksource: arm_arch_timer: move arch_timer_needs_of_probing into DT
>     init call
>   clocksource: arm_arch_timer: add structs to describe MMIO timer
>   clocksource: arm_arch_timer: refactor MMIO timer probing.
>   acpi/arm64: Add GTDT table parse driver
>   clocksource: arm_arch_timer: simplify ACPI support code.
>   acpi/arm64: Add memory-mapped timer support in GTDT driver
>   clocksource: arm_arch_timer: add GTDT support for memory-mapped timer
>   acpi/arm64: Add SBSA Generic Watchdog support in GTDT driver
> 
>  arch/arm64/Kconfig                   |   1 +
>  drivers/acpi/arm64/Kconfig           |   3 +
>  drivers/acpi/arm64/Makefile          |   1 +
>  drivers/acpi/arm64/gtdt.c            | 406 +++++++++++++++++++++++++++++++++++
>  drivers/clocksource/arm_arch_timer.c | 338 ++++++++++++++++++-----------
>  include/clocksource/arm_arch_timer.h |  16 ++
>  include/linux/acpi.h                 |   7 +
>  7 files changed, 648 insertions(+), 124 deletions(-)
>  create mode 100644 drivers/acpi/arm64/gtdt.c
> 

[toc] | [prev] | [next] | [standalone]


#1614388 — Re: [PATCH v23 00/11] acpi, clocksource: add GTDT driver and GTDT support in arm_arch_timer

FromFu Wei <fu.wei@linaro.org>
Date2017-04-01 05:50 +0200
SubjectRe: [PATCH v23 00/11] acpi, clocksource: add GTDT driver and GTDT support in arm_arch_timer
Message-ID<trid3-5zE-3@gated-at.bofh.it>
In reply to#1614368
Hi Xiongfeng Wang,

On 1 April 2017 at 10:14, Xiongfeng Wang <wangxiongfeng2@huawei.com> wrote:
>
>
> On 2017/4/1 1:50, fu.wei@linaro.org wrote:
>> From: Fu Wei <fu.wei@linaro.org>
>>
>> This patchset:
>>     (1)Preparation for adding GTDT support in arm_arch_timer:
>>         1. Introduce a MMIO CNTFRQ helper.
>>         2. separate out device-tree code from arch_timer_detect_rate
>>         3. remove arch_timer_detect_rate use arch_timer_*get_cntfrq directly
>>         4. Refactor arch_timer_needs_probing, and move it into DT init call
>>         5. Introduce some new structs and refactor the MMIO timer init code
>>         for reusing some common code.
>>
>>     (2)Introduce ACPI GTDT parser: drivers/acpi/arm64/acpi_gtdt.c
>>     Parse all kinds of timer in GTDT table of ACPI:arch timer,
>>     memory-mapped timer and SBSA Generic Watchdog timer.
>>     This driver can help to simplify all the relevant timer drivers,
>>     and separate all the ACPI GTDT knowledge from them.
>>
>>     (3)Simplify ACPI code for arm_arch_timer
>>
>>     (4)Add GTDT support for ARM memory-mapped timer.
>>
>> This patchset has been tested on the following platforms with ACPI enabled:
>>     (1)ARM Foundation v8 model
>>
>
> for arm_arch_timer(not memory-mapped) and sbsa watchdog part,  Tested-by: wangxiongfeng2@huawei.com

Great thanks for your testing :-)

>
>
>
>
>
> Thanks,
>
> Wang Xiongfeng
> .
>
>> Changelog:
>> v23: https://lkml.org/lkml/2017/3/31/
>>      Rebase to git://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git arch-timer/cleanup
>>      Improve the data struct of arch_timer_mem and arch_timer_mem_frame to
>>      improve the parser of GT blocks and arch_timer_mem initualization.
>>      Improve arch_timer_rate detection: sysreg frequency is primary in DT boot
>>      Improve some comments in GTDT parser driver.
>>      Improve acpi_gtdt_init function, and make a comment for the multiple calls.
>>      Improve the unwinding for the irq of timers, when an error occurs.
>>      Handle the case of virtual timer GSIV is 0.
>>
>> v22: https://lkml.org/lkml/2017/3/21/523
>>      Rebase to git://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git arch-timer/cleanup
>>      Only Introduce arch_timer_mem_get_cntfrq to get the frequency from mmio.
>>      Merged patch 2,3(about arch_timer_detect_rate).
>>      Keep arch_timer_rate, do NOT split it for different types of timer.
>>      Improve  memory-mapped timer support by comments and variable name:
>>          data-->timer_mem
>>          frame-->gtdt_frame
>>      Delete zero check for SBSA watchdog irq.
>>      Skip secure SBSA watchdog in GTDT driver.
>>      Delete Kconfig modification for SBSA watchdog driver.
>>      Delete no_irq, using nr_res instead.
>>
>> v21: https://lkml.org/lkml/2017/2/6/734
>>      Introduce two functions to get the frequency from mmio and sysreg.
>>      Remove arch_timer_detect_rate use arch_timer_get_*_freq directly
>>      Split arch_timer_rate for different types of timer.
>>      Skip secure timer frame in GTDT driver.
>>      Rebase to git://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git arch-timer/cleanup
>>      (The first 6 patches in v20 have been merged into arch-timer/cleanup branch)
>>
>> v20: https://lkml.org/lkml/2017/1/18/534
>>      Reorder the first 4 patches and split the 4th patches.
>>      Leave CNTHCTL_* as they originally were.
>>      Fix the bug in arch_timer_select_ppi.
>>      Split "Rework counter frequency detection" patch.
>>      Rework the arch_timer_detect_rate function.
>>      Improve the commit message of "Refactor MMIO timer probing".
>>      Rebase to 4.10.0-rc4
>>
>> v19: https://lkml.org/lkml/2016/12/21/25
>>      Fix a '\n' missing in a error message in arch_timer_mem_init.
>>      Add "request_mem_region" for ioremapping cntbase, according to
>>      f947ee1 clocksource/drivers/arm_arch_timer: Map frame with of_io_request_and_map()
>>      Rebase to 4.9.0-gfb779ff
>>
>> v18: https://lkml.org/lkml/2016/12/8/446
>>      Fix 8/15 patch problem of "int ret;" in arch_timer_acpi_init.
>>      Rebase to 4.9.0-rc8-g9269898
>>
>> v17: https://lkml.org/lkml/2016/11/25/140
>>      Take out some cleanups from 4/15.
>>      Merge 5/15 and 6/15, improve PPI determination code,
>>      improve commit message.
>>      Rework counter frequency detection.
>>      Move arch_timer_needs_of_probing into DT init call.
>>      Move Platform Timer scan loop back to timer init call to avoid allocating
>>      and free memory.
>>      Improve all the exported functions' comment.
>>
>> v16: https://lkml.org/lkml/2016/11/16/268
>>      Fix patchset problem about static enum ppi_nr of 01/13 in v15.
>>      Refactor arch_timer_detect_rate.
>>      Refactor arch_timer_needs_probing.
>>
>> v15: https://lkml.org/lkml/2016/11/15/366
>>      Re-order patches
>>      Add arm_arch_timer refactoring patches to prepare for GTDT:
>>          1. rename some  enums and defines, and some cleanups
>>          2. separate out arch_timer_uses_ppi init code and fix a potential bug
>>          3. Improve some new structs, refactor the timer init code.
>>      Since the some structs have been changed, GTDT parser for memory-mapped
>>      timer and SBSA Generic Watchdog timer have been update.
>>
>> v14: https://lkml.org/lkml/2016/9/28/573
>>      Separate memory-mapped timer GTDT support into two patches
>>          1. Refactor the timer init code to prepare for GTDT
>>          2. Add GTDT support for memory-mapped timer
>>
>> v13: http://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1231717.html
>>      Improve arm_arch_timer code for memory-mapped
>>      timer GTDT support, refactor original memory-mapped timer
>>      dt support for reusing some common code.
>>
>> v12: https://lkml.org/lkml/2016/9/13/250
>>      Rebase to latest Linux 4.8-rc6
>>      Delete the confusing "skipping" in the error message.
>>
>> V11: https://lkml.org/lkml/2016/9/6/354
>>      Rebase to latest Linux 4.8-rc5
>>      Delete typedef (suggested by checkpatch.pl)
>>
>> V10: https://lkml.org/lkml/2016/7/26/215
>>      Drop the "readq" patch.
>>      Rebase to latest Linux 4.7.
>>
>> V9: https://lkml.org/lkml/2016/7/25/345
>>     Improve pr_err message in acpi gtdt driver.
>>     Update Commit message for 7/9
>>     shorten the irq mapping function name
>>     Improve GTDT driver for memory-mapped timer
>>
>> v8: https://lkml.org/lkml/2016/7/19/660
>>     Improve "pr_fmt(fmt)" definition: add "ACPI" in front of "GTDT",
>>     and also improve printk message.
>>     Simplify is_timer_block and is_watchdog.
>>     Merge acpi_gtdt_desc_init and gtdt_arch_timer_init into acpi_gtdt_init();
>>     Delete __init in include/linux/acpi.h for GTDT API
>>     Make ARM64 select GTDT.
>>     Delete "#include <linux/module.h>" from acpi_gtdt.c
>>     Simplify GT block parse code.
>>
>> v7: https://lkml.org/lkml/2016/7/13/769
>>     Move the GTDT driver to drivers/acpi/arm64
>>     Add add the ARM64-specific ACPI Support maintainers in MAINTAINERS
>>     Merge 3 patches of GTDT parser driver.
>>     Fix the for_each_platform_timer bug.
>>
>> v6: https://lkml.org/lkml/2016/6/29/580
>>     split the GTDT driver to 4 parts: basic, arch_timer, memory-mapped timer,
>>     and SBSA Generic Watchdog timer
>>     Improve driver by suggestions and example code from Daniel Lezcano
>>
>> v5: https://lkml.org/lkml/2016/5/24/356
>>     Sorting out all patches, simplify the API of GTDT driver:
>>     GTDT driver just fills the data struct for arm_arch_timer driver.
>>
>> v4: https://lists.linaro.org/pipermail/linaro-acpi/2016-March/006667.html
>>     Delete the kvm relevant patches
>>     Separate two patches for sorting out the code for arm_arch_timer.
>>     Improve irq info export code to allow missing irq info in GTDT table.
>>
>> v3: https://lkml.org/lkml/2016/2/1/658
>>     Improve GTDT driver code:
>>       (1)improve pr_* by defining pr_fmt(fmt)
>>       (2)simplify gtdt_sbsa_gwdt_init
>>       (3)improve gtdt_arch_timer_data_init, if table is NULL, it will try
>>       to get GTDT table.
>>     Move enum ppi_nr to arm_arch_timer.h, and add enum spi_nr.
>>     Add arm_arch_timer get ppi from DT and GTDT support for kvm.
>>
>> v2: https://lkml.org/lkml/2015/12/2/10
>>     Rebase to latest kernel version(4.4-rc3).
>>     Fix the bug about the config problem,
>>     use CONFIG_ACPI_GTDT instead of CONFIG_ACPI in arm_arch_timer.c
>>
>> v1: The first upstreaming version: https://lkml.org/lkml/2015/10/28/553
>>
>> Fu Wei (11):
>>   clocksource: arm_arch_timer: add MMIO CNTFRQ helper
>>   clocksource: arm_arch_timer: split dt-only rate handling
>>   clocksource: arm_arch_timer: refactor arch_timer_needs_probing
>>   clocksource: arm_arch_timer: move arch_timer_needs_of_probing into DT
>>     init call
>>   clocksource: arm_arch_timer: add structs to describe MMIO timer
>>   clocksource: arm_arch_timer: refactor MMIO timer probing.
>>   acpi/arm64: Add GTDT table parse driver
>>   clocksource: arm_arch_timer: simplify ACPI support code.
>>   acpi/arm64: Add memory-mapped timer support in GTDT driver
>>   clocksource: arm_arch_timer: add GTDT support for memory-mapped timer
>>   acpi/arm64: Add SBSA Generic Watchdog support in GTDT driver
>>
>>  arch/arm64/Kconfig                   |   1 +
>>  drivers/acpi/arm64/Kconfig           |   3 +
>>  drivers/acpi/arm64/Makefile          |   1 +
>>  drivers/acpi/arm64/gtdt.c            | 406 +++++++++++++++++++++++++++++++++++
>>  drivers/clocksource/arm_arch_timer.c | 338 ++++++++++++++++++-----------
>>  include/clocksource/arm_arch_timer.h |  16 ++
>>  include/linux/acpi.h                 |   7 +
>>  7 files changed, 648 insertions(+), 124 deletions(-)
>>  create mode 100644 drivers/acpi/arm64/gtdt.c
>>
>



-- 
Best regards,

Fu Wei
Software Engineer
Red Hat

[toc] | [prev] | [next] | [standalone]


#1616375 — Re: [PATCH v23 00/11] acpi, clocksource: add GTDT driver and GTDT support in arm_arch_timer

FromTimur Tabi <timur@codeaurora.org>
Date2017-04-04 22:40 +0200
SubjectRe: [PATCH v23 00/11] acpi, clocksource: add GTDT driver and GTDT support in arm_arch_timer
Message-ID<tsDp7-1nT-1@gated-at.bofh.it>
In reply to#1614201
On 03/31/2017 12:50 PM, fu.wei@linaro.org wrote:
> This patchset:
>     (1)Preparation for adding GTDT support in arm_arch_timer:
>         1. Introduce a MMIO CNTFRQ helper.
>         2. separate out device-tree code from arch_timer_detect_rate
>         3. remove arch_timer_detect_rate use arch_timer_*get_cntfrq directly
>         4. Refactor arch_timer_needs_probing, and move it into DT init call
>         5. Introduce some new structs and refactor the MMIO timer init code
>         for reusing some common code.
> 
>     (2)Introduce ACPI GTDT parser: drivers/acpi/arm64/acpi_gtdt.c
>     Parse all kinds of timer in GTDT table of ACPI:arch timer,
>     memory-mapped timer and SBSA Generic Watchdog timer.
>     This driver can help to simplify all the relevant timer drivers,
>     and separate all the ACPI GTDT knowledge from them.
> 
>     (3)Simplify ACPI code for arm_arch_timer
> 
>     (4)Add GTDT support for ARM memory-mapped timer.
> 
> This patchset has been tested on the following platforms with ACPI enabled:
>     (1)ARM Foundation v8 model
> 
> Changelog:
> v23: https://lkml.org/lkml/2017/3/31/

v23:

Tested-by: Timur Tabi <timur@codeaurora.org>

-- 
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm
Technologies, Inc.  Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.

[toc] | [prev] | [standalone]


Page 2 of 2 — ← Prev page 1 [2]

Back to top | Article view | linux.kernel


csiph-web