lkml.org 
[lkml]   [2017]   [Dec]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v4 35/36] clocksource/drivers/atcpit100: VDSO support
    Date
    From: Rick Chen <rickchen36@gmail.com>

    VDSO needs real-time cycle count to ensure the time accuracy.
    Unlike others, nds32 architecture does not define clock source,
    hence VDSO needs atcpit100 offering real-time cycle count
    to derive the correct time.

    Signed-off-by: Vincent Chen <vincentc@andestech.com>
    Signed-off-by: Rick Chen <rickchen36@gmail.com>
    Signed-off-by: Greentime Hu <green.hu@gmail.com>
    ---
    drivers/clocksource/timer-atcpit100.c | 18 ++++++++++++++++++
    1 file changed, 18 insertions(+)

    diff --git a/drivers/clocksource/timer-atcpit100.c b/drivers/clocksource/timer-atcpit100.c
    index 0077fdb..9b2b628 100644
    --- a/drivers/clocksource/timer-atcpit100.c
    +++ b/drivers/clocksource/timer-atcpit100.c
    @@ -29,6 +29,9 @@
    #include <linux/of_irq.h>
    #include <linux/of_platform.h>
    #include "timer-of.h"
    +#ifdef CONFIG_NDS32
    +#include <asm/vdso_timer_info.h>
    +#endif

    /*
    * Definition of register offsets
    @@ -211,6 +214,17 @@ static u64 notrace atcpit100_timer_sched_read(void)
    return ~readl(timer_of_base(&to) + CH1_CNT);
    }

    +#ifdef CONFIG_NDS32
    +static void fill_vdso_need_info(struct device_node *node)
    +{
    + struct resource timer_res;
    + of_address_to_resource(node, 0, &timer_res);
    + timer_info.mapping_base = (unsigned long)timer_res.start;
    + timer_info.cycle_count_down = true;
    + timer_info.cycle_count_reg_offset = CH1_CNT;
    +}
    +#endif
    +
    static int __init atcpit100_timer_init(struct device_node *node)
    {
    int ret;
    @@ -249,6 +263,10 @@ static int __init atcpit100_timer_init(struct device_node *node)
    val = readl(base + INT_EN);
    writel(val | CH0INT0EN, base + INT_EN);

    +#ifdef CONFIG_NDS32
    + fill_vdso_need_info(node);
    +#endif
    +
    return ret;
    }

    --
    1.7.9.5
    \
     
     \ /
      Last update: 2017-12-18 08:15    [W:3.196 / U:0.016 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site