diff for duplicates of <00d101cb2d48$4e99ab20$ebcd0160$@com> diff --git a/a/1.txt b/N1/1.txt index 24052c2..964988b 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -43,7 +43,7 @@ chips. wrote: >>>> From: Changhwan Youn <chaos.youn@samsung.com> >>>> ->>>> This patch adds timer support for S5PV310. Until now, all S5P SoCs +>>>> This patch adds timer support for S5PV310. ?Until now, all S5P SoCs >>>> use CONFIG_ARCH_USES_GETTIMEOFFSET macro as a default configuration. >>>> Instead,S5PV310 implements clocksource and clock_event_device to >>>> support the high resolution timer and tickless system. @@ -56,18 +56,18 @@ wrote: >>>> >>>> - Changes clock source from PWM2 to PWM4 because PWM4 cannot be used >for ->>>> other purpose such as external output function through GPIO. +>>>> ?other purpose such as external output function through GPIO. >>>> ->>>> arch/arm/mach-s5pv310/include/mach/pwm-clock.h | 70 ++++++ ->>>> arch/arm/mach-s5pv310/localtimer.c | 25 ++ ->>>> arch/arm/mach-s5pv310/time.c | 287 +>>>> ?arch/arm/mach-s5pv310/include/mach/pwm-clock.h | ? 70 ++++++ +>>>> ?arch/arm/mach-s5pv310/localtimer.c ? ? ? ? ? ? | ? 25 ++ +>>>> ?arch/arm/mach-s5pv310/time.c ? ? ? ? ? ? ? ? ? | ?287 >>>++++++++++++++++++++++++ ->>>> arch/arm/plat-s5p/include/plat/s5pv310.h | 1 + ->>>> arch/arm/plat-samsung/Makefile | 2 +- ->>>> 5 files changed, 384 insertions(+), 1 deletions(-) ->>>> create mode 100644 arch/arm/mach-s5pv310/include/mach/pwm-clock.h ->>>> create mode 100644 arch/arm/mach-s5pv310/localtimer.c ->>>> create mode 100644 arch/arm/mach-s5pv310/time.c +>>>> ?arch/arm/plat-s5p/include/plat/s5pv310.h ? ? ? | ? ?1 + +>>>> ?arch/arm/plat-samsung/Makefile ? ? ? ? ? ? ? ? | ? ?2 +- +>>>> ?5 files changed, 384 insertions(+), 1 deletions(-) +>>>> ?create mode 100644 arch/arm/mach-s5pv310/include/mach/pwm-clock.h +>>>> ?create mode 100644 arch/arm/mach-s5pv310/localtimer.c +>>>> ?create mode 100644 arch/arm/mach-s5pv310/time.c >>>> >>>> diff --git a/arch/arm/mach-s5pv310/include/mach/pwm-clock.h >>>b/arch/arm/mach-s5pv310/include/mach/pwm-clock.h @@ -79,12 +79,12 @@ wrote: >>>> +/* linux/arch/arm/mach-s5pv310/include/mach/pwm-clock.h >>>> + * >>>> + * Copyright (c) 2010 Samsung Electronics Co., Ltd. ->>>> + * http://www.samsung.com/ +>>>> + * ? ? ? ? ? ? http://www.samsung.com/ >>>> + * >>>> + * Copyright 2008 Openmoko, Inc. >>>> + * Copyright 2008 Simtec Electronics ->>>> + * Ben Dooks <ben@simtec.co.uk> ->>>> + * http://armlinux.simtec.co.uk/ +>>>> + * ? ? ?Ben Dooks <ben@simtec.co.uk> +>>>> + * ? ? ?http://armlinux.simtec.co.uk/ >>>> + * >>>> + * Based on arch/arm/mach-s3c64xx/include/mach/pwm-clock.h >>>> + * @@ -109,7 +109,7 @@ wrote: >>>> + */ >>>> +static inline int pwm_cfg_src_is_tclk(unsigned long tcfg) >>>> +{ ->>>> + return tcfg == S3C64XX_TCFG1_MUX_TCLK; +>>>> + ? ? ? return tcfg == S3C64XX_TCFG1_MUX_TCLK; >>>> +} >>>> + >>>> +/** @@ -121,7 +121,7 @@ wrote: >>>> + */ >>>> +static inline unsigned long tcfg_to_divisor(unsigned long tcfg1) >>>> +{ ->>>> + return 1 << tcfg1; +>>>> + ? ? ? return 1 << tcfg1; >>>> +} >>>> + >>>> +/** @@ -131,7 +131,7 @@ wrote: >>>> + */ >>>> +static inline unsigned int pwm_tdiv_has_div1(void) >>>> +{ ->>>> + return 1; +>>>> + ? ? ? return 1; >>>> +} >>>> + >>>> +/** @@ -142,7 +142,7 @@ wrote: >>>> + */ >>>> +static inline unsigned long pwm_tdiv_div_bits(unsigned int div) >>>> +{ ->>>> + return ilog2(div); +>>>> + ? ? ? return ilog2(div); >>>> +} >>>> + >>>> +#define S3C_TCFG1_MUX_TCLK S3C64XX_TCFG1_MUX_TCLK @@ -159,8 +159,8 @@ wrote: >>>> + * >>>> + * Cloned from linux/arch/arm/mach-realview/localtimer.c >>>> + * ->>>> + * Copyright (C) 2002 ARM Ltd. ->>>> + * All Rights Reserved +>>>> + * ?Copyright (C) 2002 ARM Ltd. +>>>> + * ?All Rights Reserved >>>> + * >>>> + * This program is free software; you can redistribute it and/or >modify @@ -178,8 +178,8 @@ wrote: >>>> + */ >>>> +void __cpuinit local_timer_setup(struct clock_event_device *evt) >>>> +{ ->>>> + evt->irq = IRQ_LOCALTIMER; ->>>> + twd_timer_setup(evt); +>>>> + ? ? ? evt->irq = IRQ_LOCALTIMER; +>>>> + ? ? ? twd_timer_setup(evt); >>>> +} >>>> diff --git a/arch/arm/mach-s5pv310/time.c b/arch/arm/mach- >s5pv310/time.c @@ -191,7 +191,7 @@ wrote: >>>> +/* linux/arch/arm/mach-s5pv310/time.c >>>> + * >>>> + * Copyright (c) 2010 Samsung Electronics Co., Ltd. ->>>> + * http://www.samsung.com +>>>> + * ? ? ? ? ? ? http://www.samsung.com >>>> + * >>>> + * S5PV310 (and compatible) HRT support >>>> + * PWM 2/4 is used for this feature @@ -226,291 +226,291 @@ wrote: >>>> + >>>> +static void s5pv310_pwm_stop(unsigned int pwm_id) >>>> +{ ->>>> + unsigned long tcon; ->>>> + ->>>> + tcon = __raw_readl(S3C2410_TCON); ->>>> + ->>>> + switch (pwm_id) { ->>>> + case 2: ->>>> + tcon &= ~S3C2410_TCON_T2START; ->>>> + break; ->>>> + case 4: ->>>> + tcon &= ~S3C2410_TCON_T4START; ->>>> + break; ->>>> + default: ->>>> + break; ->>>> + } ->>>> + __raw_writel(tcon, S3C2410_TCON); +>>>> + ? ? ? unsigned long tcon; +>>>> + +>>>> + ? ? ? tcon = __raw_readl(S3C2410_TCON); +>>>> + +>>>> + ? ? ? switch (pwm_id) { +>>>> + ? ? ? case 2: +>>>> + ? ? ? ? ? ? ? tcon &= ~S3C2410_TCON_T2START; +>>>> + ? ? ? ? ? ? ? break; +>>>> + ? ? ? case 4: +>>>> + ? ? ? ? ? ? ? tcon &= ~S3C2410_TCON_T4START; +>>>> + ? ? ? ? ? ? ? break; +>>>> + ? ? ? default: +>>>> + ? ? ? ? ? ? ? break; +>>>> + ? ? ? } +>>>> + ? ? ? __raw_writel(tcon, S3C2410_TCON); >>>> +} >>>> + >>>> +static void s5pv310_pwm_init(unsigned int pwm_id, unsigned long tcnt) >>>> +{ ->>>> + unsigned long tcon; +>>>> + ? ? ? unsigned long tcon; >>>> + ->>>> + tcon = __raw_readl(S3C2410_TCON); +>>>> + ? ? ? tcon = __raw_readl(S3C2410_TCON); >>>> + ->>>> + /* timers reload after counting zero, so reduce the count by 1 +>>>> + ? ? ? /* timers reload after counting zero, so reduce the count by 1 >*/ ->>>> + tcnt--; ->>>> + ->>>> + /* ensure timer is stopped... */ ->>>> + switch (pwm_id) { ->>>> + case 2: ->>>> + tcon &= ~(0xf<<12); ->>>> + tcon |= S3C2410_TCON_T2MANUALUPD; ->>>> + ->>>> + __raw_writel(tcnt, S3C2410_TCNTB(2)); ->>>> + __raw_writel(tcnt, S3C2410_TCMPB(2)); ->>>> + __raw_writel(tcon, S3C2410_TCON); ->>>> + ->>>> + break; ->>>> + case 4: ->>>> + tcon &= ~(7<<20); ->>>> + tcon |= S3C2410_TCON_T4MANUALUPD; ->>>> + ->>>> + __raw_writel(tcnt, S3C2410_TCNTB(4)); ->>>> + __raw_writel(tcnt, S3C2410_TCMPB(4)); ->>>> + __raw_writel(tcon, S3C2410_TCON); ->>>> + ->>>> + break; ->>>> + default: ->>>> + break; ->>>> + } +>>>> + ? ? ? tcnt--; +>>>> + +>>>> + ? ? ? /* ensure timer is stopped... */ +>>>> + ? ? ? switch (pwm_id) { +>>>> + ? ? ? case 2: +>>>> + ? ? ? ? ? ? ? tcon &= ~(0xf<<12); +>>>> + ? ? ? ? ? ? ? tcon |= S3C2410_TCON_T2MANUALUPD; +>>>> + +>>>> + ? ? ? ? ? ? ? __raw_writel(tcnt, S3C2410_TCNTB(2)); +>>>> + ? ? ? ? ? ? ? __raw_writel(tcnt, S3C2410_TCMPB(2)); +>>>> + ? ? ? ? ? ? ? __raw_writel(tcon, S3C2410_TCON); +>>>> + +>>>> + ? ? ? ? ? ? ? break; +>>>> + ? ? ? case 4: +>>>> + ? ? ? ? ? ? ? tcon &= ~(7<<20); +>>>> + ? ? ? ? ? ? ? tcon |= S3C2410_TCON_T4MANUALUPD; +>>>> + +>>>> + ? ? ? ? ? ? ? __raw_writel(tcnt, S3C2410_TCNTB(4)); +>>>> + ? ? ? ? ? ? ? __raw_writel(tcnt, S3C2410_TCMPB(4)); +>>>> + ? ? ? ? ? ? ? __raw_writel(tcon, S3C2410_TCON); +>>>> + +>>>> + ? ? ? ? ? ? ? break; +>>>> + ? ? ? default: +>>>> + ? ? ? ? ? ? ? break; +>>>> + ? ? ? } >>>> +} >>>> + >>>> +static inline void s5pv310_pwm_start(unsigned int pwm_id, bool >periodic) >>>> +{ ->>>> + unsigned long tcon; ->>>> + ->>>> + tcon = __raw_readl(S3C2410_TCON); ->>>> + ->>>> + switch (pwm_id) { ->>>> + case 2: ->>>> + tcon |= S3C2410_TCON_T2START; ->>>> + tcon &= ~S3C2410_TCON_T2MANUALUPD; ->>>> + ->>>> + if (periodic) ->>>> + tcon |= S3C2410_TCON_T2RELOAD; ->>>> + else ->>>> + tcon &= ~S3C2410_TCON_T2RELOAD; ->>>> + break; ->>>> + case 4: ->>>> + tcon |= S3C2410_TCON_T4START; ->>>> + tcon &= ~S3C2410_TCON_T4MANUALUPD; ->>>> + ->>>> + if (periodic) ->>>> + tcon |= S3C2410_TCON_T4RELOAD; ->>>> + else ->>>> + tcon &= ~S3C2410_TCON_T4RELOAD; ->>>> + break; ->>>> + default: ->>>> + break; ->>>> + } ->>>> + __raw_writel(tcon, S3C2410_TCON); +>>>> + ? ? ? unsigned long tcon; +>>>> + +>>>> + ? ? ? tcon ?= __raw_readl(S3C2410_TCON); +>>>> + +>>>> + ? ? ? switch (pwm_id) { +>>>> + ? ? ? case 2: +>>>> + ? ? ? ? ? ? ? tcon |= S3C2410_TCON_T2START; +>>>> + ? ? ? ? ? ? ? tcon &= ~S3C2410_TCON_T2MANUALUPD; +>>>> + +>>>> + ? ? ? ? ? ? ? if (periodic) +>>>> + ? ? ? ? ? ? ? ? ? ? ? tcon |= S3C2410_TCON_T2RELOAD; +>>>> + ? ? ? ? ? ? ? else +>>>> + ? ? ? ? ? ? ? ? ? ? ? tcon &= ~S3C2410_TCON_T2RELOAD; +>>>> + ? ? ? ? ? ? ? break; +>>>> + ? ? ? case 4: +>>>> + ? ? ? ? ? ? ? tcon |= S3C2410_TCON_T4START; +>>>> + ? ? ? ? ? ? ? tcon &= ~S3C2410_TCON_T4MANUALUPD; +>>>> + +>>>> + ? ? ? ? ? ? ? if (periodic) +>>>> + ? ? ? ? ? ? ? ? ? ? ? tcon |= S3C2410_TCON_T4RELOAD; +>>>> + ? ? ? ? ? ? ? else +>>>> + ? ? ? ? ? ? ? ? ? ? ? tcon &= ~S3C2410_TCON_T4RELOAD; +>>>> + ? ? ? ? ? ? ? break; +>>>> + ? ? ? default: +>>>> + ? ? ? ? ? ? ? break; +>>>> + ? ? ? } +>>>> + ? ? ? __raw_writel(tcon, S3C2410_TCON); >>>> +} >>>> + >>>> +static int s5pv310_pwm_set_next_event(unsigned long cycles, ->>>> + struct clock_event_device *evt) +>>>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? struct clock_event_device *evt) >>>> +{ ->>>> + s5pv310_pwm_init(2, cycles); ->>>> + s5pv310_pwm_start(2, 0); ->>>> + return 0; +>>>> + ? ? ? s5pv310_pwm_init(2, cycles); +>>>> + ? ? ? s5pv310_pwm_start(2, 0); +>>>> + ? ? ? return 0; >>>> +} >>>> + >>>> +static void s5pv310_pwm_set_mode(enum clock_event_mode mode, ->>>> + struct clock_event_device *evt) +>>>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? struct clock_event_device *evt) >>>> +{ ->>>> + s5pv310_pwm_stop(2); ->>>> + ->>>> + switch (mode) { ->>>> + case CLOCK_EVT_MODE_PERIODIC: ->>>> + s5pv310_pwm_init(2, clock_count_per_tick); ->>>> + s5pv310_pwm_start(2, 1); ->>>> + break; ->>>> + case CLOCK_EVT_MODE_ONESHOT: ->>>> + break; ->>>> + case CLOCK_EVT_MODE_UNUSED: ->>>> + case CLOCK_EVT_MODE_SHUTDOWN: ->>>> + case CLOCK_EVT_MODE_RESUME: ->>>> + break; ->>>> + } +>>>> + ? ? ? s5pv310_pwm_stop(2); +>>>> + +>>>> + ? ? ? switch (mode) { +>>>> + ? ? ? case CLOCK_EVT_MODE_PERIODIC: +>>>> + ? ? ? ? ? ? ? s5pv310_pwm_init(2, clock_count_per_tick); +>>>> + ? ? ? ? ? ? ? s5pv310_pwm_start(2, 1); +>>>> + ? ? ? ? ? ? ? break; +>>>> + ? ? ? case CLOCK_EVT_MODE_ONESHOT: +>>>> + ? ? ? ? ? ? ? break; +>>>> + ? ? ? case CLOCK_EVT_MODE_UNUSED: +>>>> + ? ? ? case CLOCK_EVT_MODE_SHUTDOWN: +>>>> + ? ? ? case CLOCK_EVT_MODE_RESUME: +>>>> + ? ? ? ? ? ? ? break; +>>>> + ? ? ? } >>>> +} >>>> + >>>> +static struct clock_event_device pwm_event_device = { ->>>> + .name = "pwm_timer2", ->>>> + .features = CLOCK_EVT_FEAT_PERIODIC | +>>>> + ? ? ? .name ? ? ? ? ? = "pwm_timer2", +>>>> + ? ? ? .features ? ? ? = CLOCK_EVT_FEAT_PERIODIC | >> CLOCK_EVT_FEAT_ONESHOT, ->>>> + .rating = 200, ->>>> + .shift = 32, ->>>> + .set_next_event = s5pv310_pwm_set_next_event, ->>>> + .set_mode = s5pv310_pwm_set_mode, +>>>> + ? ? ? .rating ? ? ? ? = 200, +>>>> + ? ? ? .shift ? ? ? ? ?= 32, +>>>> + ? ? ? .set_next_event = s5pv310_pwm_set_next_event, +>>>> + ? ? ? .set_mode ? ? ? = s5pv310_pwm_set_mode, >>>> +}; >>>> + >>>> +irqreturn_t s5pv310_clock_event_isr(int irq, void *dev_id) >>>> +{ ->>>> + struct clock_event_device *evt = &pwm_event_device; +>>>> + ? ? ? struct clock_event_device *evt = &pwm_event_device; >>>> + ->>>> + evt->event_handler(evt); +>>>> + ? ? ? evt->event_handler(evt); >>>> + ->>>> + return IRQ_HANDLED; +>>>> + ? ? ? return IRQ_HANDLED; >>>> +} >>>> + >>>> +static struct irqaction s5pv310_clock_event_irq = { ->>>> + .name = "pwm_timer2_irq", ->>>> + .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, ->>>> + .handler = s5pv310_clock_event_isr, +>>>> + ? ? ? .name ? ? ? ? ? = "pwm_timer2_irq", +>>>> + ? ? ? .flags ? ? ? ? ?= IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, +>>>> + ? ? ? .handler ? ? ? ?= s5pv310_clock_event_isr, >>>> +}; >>>> + >>>> +static void __init s5pv310_clockevent_init(void) >>>> +{ ->>>> + unsigned long pclk; ->>>> + unsigned long clock_rate; ->>>> + struct clk *tscaler; +>>>> + ? ? ? unsigned long pclk; +>>>> + ? ? ? unsigned long clock_rate; +>>>> + ? ? ? struct clk *tscaler; >>>> + ->>>> + pclk = clk_get_rate(timerclk); +>>>> + ? ? ? pclk = clk_get_rate(timerclk); >>>> + ->>>> + /* configure clock tick */ +>>>> + ? ? ? /* configure clock tick */ >>>> + ->>>> + tscaler = clk_get_parent(tdiv2); +>>>> + ? ? ? tscaler = clk_get_parent(tdiv2); >>>> + ->>>> + clk_set_rate(tscaler, pclk / 2); ->>>> + clk_set_rate(tdiv2, pclk / 2); ->>>> + clk_set_parent(tin2, tdiv2); +>>>> + ? ? ? clk_set_rate(tscaler, pclk / 2); +>>>> + ? ? ? clk_set_rate(tdiv2, pclk / 2); +>>>> + ? ? ? clk_set_parent(tin2, tdiv2); >>>> + ->>>> + clock_rate = clk_get_rate(tin2); +>>>> + ? ? ? clock_rate = clk_get_rate(tin2); >>>> + ->>>> + clock_count_per_tick = clock_rate / HZ; +>>>> + ? ? ? clock_count_per_tick = clock_rate / HZ; >>>> + ->>>> + pwm_event_device.mult = ->>>> + div_sc(clock_rate, NSEC_PER_SEC, +>>>> + ? ? ? pwm_event_device.mult = +>>>> + ? ? ? ? ? ? ? div_sc(clock_rate, NSEC_PER_SEC, pwm_event_device.shift); ->>>> + pwm_event_device.max_delta_ns = ->>>> + clockevent_delta2ns(-1, &pwm_event_device); ->>>> + pwm_event_device.min_delta_ns = ->>>> + clockevent_delta2ns(1, &pwm_event_device); +>>>> + ? ? ? pwm_event_device.max_delta_ns = +>>>> + ? ? ? ? ? ? ? clockevent_delta2ns(-1, &pwm_event_device); +>>>> + ? ? ? pwm_event_device.min_delta_ns = +>>>> + ? ? ? ? ? ? ? clockevent_delta2ns(1, &pwm_event_device); >>>> + ->>>> + pwm_event_device.cpumask = cpumask_of(0); ->>>> + clockevents_register_device(&pwm_event_device); +>>>> + ? ? ? pwm_event_device.cpumask = cpumask_of(0); +>>>> + ? ? ? clockevents_register_device(&pwm_event_device); >>>> + ->>>> + setup_irq(IRQ_TIMER2, &s5pv310_clock_event_irq); +>>>> + ? ? ? setup_irq(IRQ_TIMER2, &s5pv310_clock_event_irq); >>>> +} >>>> + >>>> +static cycle_t s5pv310_pwm4_read(struct clocksource *cs) >>>> +{ ->>>> + return (cycle_t) ~__raw_readl(S3C_TIMERREG(0x40)); +>>>> + ? ? ? return (cycle_t) ~__raw_readl(S3C_TIMERREG(0x40)); >>>> +} >>>> + >>>> +struct clocksource pwm_clocksource = { ->>>> + .name = "pwm_timer4", ->>>> + .rating = 250, ->>>> + .read = s5pv310_pwm4_read, ->>>> + .mask = CLOCKSOURCE_MASK(32), ->>>> + .shift = 20, ->>>> + .flags = CLOCK_SOURCE_IS_CONTINUOUS , +>>>> + ? ? ? .name ? ? ? ? ? = "pwm_timer4", +>>>> + ? ? ? .rating ? ? ? ? = 250, +>>>> + ? ? ? .read ? ? ? ? ? = s5pv310_pwm4_read, +>>>> + ? ? ? .mask ? ? ? ? ? = CLOCKSOURCE_MASK(32), +>>>> + ? ? ? .shift ? ? ? ? ?= 20, +>>>> + ? ? ? .flags ? ? ? ? ?= CLOCK_SOURCE_IS_CONTINUOUS , >>>> +}; >>>> + >>>> +static void __init s5pv310_clocksource_init(void) >>>> +{ ->>>> + unsigned long pclk; ->>>> + unsigned long clock_rate; +>>>> + ? ? ? unsigned long pclk; +>>>> + ? ? ? unsigned long clock_rate; >>>> + ->>>> + pclk = clk_get_rate(timerclk); +>>>> + ? ? ? pclk = clk_get_rate(timerclk); >>>> + ->>>> + clk_set_rate(tdiv4, pclk / 2); ->>>> + clk_set_parent(tin4, tdiv4); +>>>> + ? ? ? clk_set_rate(tdiv4, pclk / 2); +>>>> + ? ? ? clk_set_parent(tin4, tdiv4); >>>> + ->>>> + clock_rate = clk_get_rate(tin4); +>>>> + ? ? ? clock_rate = clk_get_rate(tin4); >>>> + ->>>> + s5pv310_pwm_init(4, ~0); ->>>> + s5pv310_pwm_start(4, 1); +>>>> + ? ? ? s5pv310_pwm_init(4, ~0); +>>>> + ? ? ? s5pv310_pwm_start(4, 1); >>>> + ->>>> + pwm_clocksource.mult = ->>>> + clocksource_khz2mult(clock_rate/1000, +>>>> + ? ? ? pwm_clocksource.mult = +>>>> + ? ? ? ? ? ? ? clocksource_khz2mult(clock_rate/1000, >>>pwm_clocksource.shift); >>>> + ->>>> + if (clocksource_register(&pwm_clocksource)) ->>>> + panic("%s: can't register clocksource\n", +>>>> + ? ? ? if (clocksource_register(&pwm_clocksource)) +>>>> + ? ? ? ? ? ? ? panic("%s: can't register clocksource\n", >>>pwm_clocksource.name); >>>> +} >>>> + >>>> +static void __init s5pv310_timer_resources(void) >>>> +{ ->>>> + struct platform_device tmpdev; +>>>> + ? ? ? struct platform_device tmpdev; >>>> + ->>>> + tmpdev.dev.bus = &platform_bus_type; +>>>> + ? ? ? tmpdev.dev.bus = &platform_bus_type; >>>> + ->>>> + timerclk = clk_get(NULL, "timers"); ->>>> + if (IS_ERR(timerclk)) ->>>> + panic("failed to get timers clock for system timer"); +>>>> + ? ? ? timerclk = clk_get(NULL, "timers"); +>>>> + ? ? ? if (IS_ERR(timerclk)) +>>>> + ? ? ? ? ? ? ? panic("failed to get timers clock for system timer"); >>>> + ->>>> + clk_enable(timerclk); +>>>> + ? ? ? clk_enable(timerclk); >>>> + ->>>> + tmpdev.id = 2; ->>>> + tin2 = clk_get(&tmpdev.dev, "pwm-tin"); ->>>> + if (IS_ERR(tin2)) ->>>> + panic("failed to get pwm-tin2 clock for system timer"); +>>>> + ? ? ? tmpdev.id = 2; +>>>> + ? ? ? tin2 = clk_get(&tmpdev.dev, "pwm-tin"); +>>>> + ? ? ? if (IS_ERR(tin2)) +>>>> + ? ? ? ? ? ? ? panic("failed to get pwm-tin2 clock for system timer"); >>>> + ->>>> + tdiv2 = clk_get(&tmpdev.dev, "pwm-tdiv"); ->>>> + if (IS_ERR(tdiv2)) ->>>> + panic("failed to get pwm-tdiv2 clock for system +>>>> + ? ? ? tdiv2 = clk_get(&tmpdev.dev, "pwm-tdiv"); +>>>> + ? ? ? if (IS_ERR(tdiv2)) +>>>> + ? ? ? ? ? ? ? panic("failed to get pwm-tdiv2 clock for system timer"); ->>>> + clk_enable(tin2); +>>>> + ? ? ? clk_enable(tin2); >>>> + ->>>> + tmpdev.id = 4; ->>>> + tin4 = clk_get(&tmpdev.dev, "pwm-tin"); ->>>> + if (IS_ERR(tin4)) ->>>> + panic("failed to get pwm-tin4 clock for system timer"); +>>>> + ? ? ? tmpdev.id = 4; +>>>> + ? ? ? tin4 = clk_get(&tmpdev.dev, "pwm-tin"); +>>>> + ? ? ? if (IS_ERR(tin4)) +>>>> + ? ? ? ? ? ? ? panic("failed to get pwm-tin4 clock for system timer"); >>>> + ->>>> + tdiv4 = clk_get(&tmpdev.dev, "pwm-tdiv"); ->>>> + if (IS_ERR(tdiv4)) ->>>> + panic("failed to get pwm-tdiv4 clock for system +>>>> + ? ? ? tdiv4 = clk_get(&tmpdev.dev, "pwm-tdiv"); +>>>> + ? ? ? if (IS_ERR(tdiv4)) +>>>> + ? ? ? ? ? ? ? panic("failed to get pwm-tdiv4 clock for system timer"); >>>> + ->>>> + clk_enable(tin4); +>>>> + ? ? ? clk_enable(tin4); >>>> +} >>>> + >>>> +static void __init s5pv310_timer_init(void) >>>> +{ >>>> +#ifdef CONFIG_LOCAL_TIMERS ->>>> + twd_base = S5P_VA_TWD; +>>>> + ? ? ? twd_base = S5P_VA_TWD; >>>> +#endif >>>> + ->>>> + s5pv310_timer_resources(); ->>>> + s5pv310_clockevent_init(); ->>>> + s5pv310_clocksource_init(); +>>>> + ? ? ? s5pv310_timer_resources(); +>>>> + ? ? ? s5pv310_clockevent_init(); +>>>> + ? ? ? s5pv310_clocksource_init(); >>>> +} >>>> + >>>> +struct sys_timer s5pv310_timer = { ->>>> + .init = s5pv310_timer_init, +>>>> + ? ? ? .init ? ? ? ? ? = s5pv310_timer_init, >>>> +}; >>>> diff --git a/arch/arm/plat-s5p/include/plat/s5pv310.h b/arch/arm/plat- >>>s5p/include/plat/s5pv310.h >>>> index d2f05e1..769c991 100644 >>>> --- a/arch/arm/plat-s5p/include/plat/s5pv310.h >>>> +++ b/arch/arm/plat-s5p/include/plat/s5pv310.h ->>>> @@ -22,6 +22,7 @@ extern int s5pv310_init(void); ->>>> extern void s5pv310_init_irq(void); ->>>> extern void s5pv310_map_io(void); ->>>> extern void s5pv310_init_clocks(int xtal); +>>>> @@ -22,6 +22,7 @@ extern ?int s5pv310_init(void); +>>>> ?extern void s5pv310_init_irq(void); +>>>> ?extern void s5pv310_map_io(void); +>>>> ?extern void s5pv310_init_clocks(int xtal); >>>> +extern struct sys_timer s5pv310_timer; >>>> ->>>> #define s5pv310_init_uarts s5pv310_common_init_uarts +>>>> ?#define s5pv310_init_uarts s5pv310_common_init_uarts >>>> >>>> diff --git a/arch/arm/plat-samsung/Makefile b/arch/arm/plat- >>>samsung/Makefile >>>> index b1d82cc..0d5bf8a 100644 >>>> --- a/arch/arm/plat-samsung/Makefile >>>> +++ b/arch/arm/plat-samsung/Makefile ->>>> @@ -12,7 +12,7 @@ obj- := ->>>> # Objects we always build independent of SoC choice +>>>> @@ -12,7 +12,7 @@ obj- ? ? ? ? ? ? ? ? ? ? ? ? ?:= +>>>> ?# Objects we always build independent of SoC choice >>>> ->>>> obj-y += init.o ->>>> -obj-y += time.o ->>>> +obj-$(CONFIG_ARCH_USES_GETTIMEOFFSET) += time.o ->>>> obj-y += clock.o ->>>> obj-y += pwm-clock.o ->>>> obj-y += gpio.o +>>>> ?obj-y ? ? ? ? ? ? ? ? ? ? ? ? ?+= init.o +>>>> -obj-y ? ? ? ? ? ? ? ? ? ? ? ? ?+= time.o +>>>> +obj-$(CONFIG_ARCH_USES_GETTIMEOFFSET) ? += time.o +>>>> ?obj-y ? ? ? ? ? ? ? ? ? ? ? ? ?+= clock.o +>>>> ?obj-y ? ? ? ? ? ? ? ? ? ? ? ? ?+= pwm-clock.o +>>>> ?obj-y ? ? ? ? ? ? ? ? ? ? ? ? ?+= gpio.o >>>> -- >>>> 1.6.2.5 >>>> @@ -518,23 +518,23 @@ timer"); >>>> To unsubscribe from this list: send the line "unsubscribe linux- >samsung- >>>soc" in ->>>> the body of a message to majordomo@vger.kernel.org ->>>> More majordomo info at http://vger.kernel.org/majordomo-info.html +>>>> the body of a message to majordomo at vger.kernel.org +>>>> More majordomo info at ?http://vger.kernel.org/majordomo-info.html >>>> >>> >>>_______________________________________________ >>>linux-arm-kernel mailing list ->>>linux-arm-kernel@lists.infradead.org +>>>linux-arm-kernel at lists.infradead.org >>>http://lists.infradead.org/mailman/listinfo/linux-arm-kernel >> >> -- >> To unsubscribe from this list: send the line "unsubscribe linux-samsung- >soc" in ->> the body of a message to majordomo@vger.kernel.org ->> More majordomo info at http://vger.kernel.org/majordomo-info.html +>> the body of a message to majordomo at vger.kernel.org +>> More majordomo info at ?http://vger.kernel.org/majordomo-info.html >> >-- >To unsubscribe from this list: send the line "unsubscribe linux-samsung- >soc" in ->the body of a message to majordomo@vger.kernel.org +>the body of a message to majordomo at vger.kernel.org >More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/a/content_digest b/N1/content_digest index 5737c8e..fedb60e 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -2,16 +2,10 @@ "ref\0AANLkTimWqKc24fAE0G06rhupdGTyLJ5HY5rZRh8HOy6r@mail.gmail.com\0" "ref\000ce01cb2d41$e8a913b0$b9fb3b10$@com\0" "ref\0AANLkTimcJUjwtgCmfqip2t-i_f=RMLQb6Q08kJaDyDnj@mail.gmail.com\0" - "From\0Sangbeom Kim <sbkim73@samsung.com>\0" - "Subject\0RE: [PATCH v4 5/8] ARM: S5PV310: Add Timer support\0" + "From\0sbkim73@samsung.com (Sangbeom Kim)\0" + "Subject\0[PATCH v4 5/8] ARM: S5PV310: Add Timer support\0" "Date\0Tue, 27 Jul 2010 13:58:02 +0900\0" - "To\0'Kyungmin Park' <kmpark@infradead.org>\0" - "Cc\0'Kukjin Kim' <kgene.kim@samsung.com>" - 'Hyuk Lee' <hyuk1.lee@samsung.com> - linux-samsung-soc@vger.kernel.org - 'Changhwan Youn' <chaos.youn@samsung.com> - ben-linux@fluff.org - " linux-arm-kernel@lists.infradead.org\0" + "To\0linux-arm-kernel@lists.infradead.org\0" "\00:1\0" "b\0" "Thanks for your answer,\n" @@ -59,7 +53,7 @@ "wrote:\n" ">>>> From: Changhwan Youn <chaos.youn@samsung.com>\n" ">>>>\n" - ">>>> This patch adds timer support for S5PV310. \302\240Until now, all S5P SoCs\n" + ">>>> This patch adds timer support for S5PV310. ?Until now, all S5P SoCs\n" ">>>> use CONFIG_ARCH_USES_GETTIMEOFFSET macro as a default configuration.\n" ">>>> Instead,S5PV310 implements clocksource and clock_event_device to\n" ">>>> support the high resolution timer and tickless system.\n" @@ -72,18 +66,18 @@ ">>>>\n" ">>>> - Changes clock source from PWM2 to PWM4 because PWM4 cannot be used\n" ">for\n" - ">>>> \302\240other purpose such as external output function through GPIO.\n" + ">>>> ?other purpose such as external output function through GPIO.\n" ">>>>\n" - ">>>> \302\240arch/arm/mach-s5pv310/include/mach/pwm-clock.h | \302\240 70 ++++++\n" - ">>>> \302\240arch/arm/mach-s5pv310/localtimer.c \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 | \302\240 25 ++\n" - ">>>> \302\240arch/arm/mach-s5pv310/time.c \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 | \302\240287\n" + ">>>> ?arch/arm/mach-s5pv310/include/mach/pwm-clock.h | ? 70 ++++++\n" + ">>>> ?arch/arm/mach-s5pv310/localtimer.c ? ? ? ? ? ? | ? 25 ++\n" + ">>>> ?arch/arm/mach-s5pv310/time.c ? ? ? ? ? ? ? ? ? | ?287\n" ">>>++++++++++++++++++++++++\n" - ">>>> \302\240arch/arm/plat-s5p/include/plat/s5pv310.h \302\240 \302\240 \302\240 | \302\240 \302\2401 +\n" - ">>>> \302\240arch/arm/plat-samsung/Makefile \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 | \302\240 \302\2402 +-\n" - ">>>> \302\2405 files changed, 384 insertions(+), 1 deletions(-)\n" - ">>>> \302\240create mode 100644 arch/arm/mach-s5pv310/include/mach/pwm-clock.h\n" - ">>>> \302\240create mode 100644 arch/arm/mach-s5pv310/localtimer.c\n" - ">>>> \302\240create mode 100644 arch/arm/mach-s5pv310/time.c\n" + ">>>> ?arch/arm/plat-s5p/include/plat/s5pv310.h ? ? ? | ? ?1 +\n" + ">>>> ?arch/arm/plat-samsung/Makefile ? ? ? ? ? ? ? ? | ? ?2 +-\n" + ">>>> ?5 files changed, 384 insertions(+), 1 deletions(-)\n" + ">>>> ?create mode 100644 arch/arm/mach-s5pv310/include/mach/pwm-clock.h\n" + ">>>> ?create mode 100644 arch/arm/mach-s5pv310/localtimer.c\n" + ">>>> ?create mode 100644 arch/arm/mach-s5pv310/time.c\n" ">>>>\n" ">>>> diff --git a/arch/arm/mach-s5pv310/include/mach/pwm-clock.h\n" ">>>b/arch/arm/mach-s5pv310/include/mach/pwm-clock.h\n" @@ -95,12 +89,12 @@ ">>>> +/* linux/arch/arm/mach-s5pv310/include/mach/pwm-clock.h\n" ">>>> + *\n" ">>>> + * Copyright (c) 2010 Samsung Electronics Co., Ltd.\n" - ">>>> + * \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 http://www.samsung.com/\n" + ">>>> + * ? ? ? ? ? ? http://www.samsung.com/\n" ">>>> + *\n" ">>>> + * Copyright 2008 Openmoko, Inc.\n" ">>>> + * Copyright 2008 Simtec Electronics\n" - ">>>> + * \302\240 \302\240 \302\240Ben Dooks <ben@simtec.co.uk>\n" - ">>>> + * \302\240 \302\240 \302\240http://armlinux.simtec.co.uk/\n" + ">>>> + * ? ? ?Ben Dooks <ben@simtec.co.uk>\n" + ">>>> + * ? ? ?http://armlinux.simtec.co.uk/\n" ">>>> + *\n" ">>>> + * Based on arch/arm/mach-s3c64xx/include/mach/pwm-clock.h\n" ">>>> + *\n" @@ -125,7 +119,7 @@ ">>>> + */\n" ">>>> +static inline int pwm_cfg_src_is_tclk(unsigned long tcfg)\n" ">>>> +{\n" - ">>>> + \302\240 \302\240 \302\240 return tcfg == S3C64XX_TCFG1_MUX_TCLK;\n" + ">>>> + ? ? ? return tcfg == S3C64XX_TCFG1_MUX_TCLK;\n" ">>>> +}\n" ">>>> +\n" ">>>> +/**\n" @@ -137,7 +131,7 @@ ">>>> + */\n" ">>>> +static inline unsigned long tcfg_to_divisor(unsigned long tcfg1)\n" ">>>> +{\n" - ">>>> + \302\240 \302\240 \302\240 return 1 << tcfg1;\n" + ">>>> + ? ? ? return 1 << tcfg1;\n" ">>>> +}\n" ">>>> +\n" ">>>> +/**\n" @@ -147,7 +141,7 @@ ">>>> + */\n" ">>>> +static inline unsigned int pwm_tdiv_has_div1(void)\n" ">>>> +{\n" - ">>>> + \302\240 \302\240 \302\240 return 1;\n" + ">>>> + ? ? ? return 1;\n" ">>>> +}\n" ">>>> +\n" ">>>> +/**\n" @@ -158,7 +152,7 @@ ">>>> + */\n" ">>>> +static inline unsigned long pwm_tdiv_div_bits(unsigned int div)\n" ">>>> +{\n" - ">>>> + \302\240 \302\240 \302\240 return ilog2(div);\n" + ">>>> + ? ? ? return ilog2(div);\n" ">>>> +}\n" ">>>> +\n" ">>>> +#define S3C_TCFG1_MUX_TCLK S3C64XX_TCFG1_MUX_TCLK\n" @@ -175,8 +169,8 @@ ">>>> + *\n" ">>>> + * Cloned from linux/arch/arm/mach-realview/localtimer.c\n" ">>>> + *\n" - ">>>> + * \302\240Copyright (C) 2002 ARM Ltd.\n" - ">>>> + * \302\240All Rights Reserved\n" + ">>>> + * ?Copyright (C) 2002 ARM Ltd.\n" + ">>>> + * ?All Rights Reserved\n" ">>>> + *\n" ">>>> + * This program is free software; you can redistribute it and/or\n" ">modify\n" @@ -194,8 +188,8 @@ ">>>> + */\n" ">>>> +void __cpuinit local_timer_setup(struct clock_event_device *evt)\n" ">>>> +{\n" - ">>>> + \302\240 \302\240 \302\240 evt->irq = IRQ_LOCALTIMER;\n" - ">>>> + \302\240 \302\240 \302\240 twd_timer_setup(evt);\n" + ">>>> + ? ? ? evt->irq = IRQ_LOCALTIMER;\n" + ">>>> + ? ? ? twd_timer_setup(evt);\n" ">>>> +}\n" ">>>> diff --git a/arch/arm/mach-s5pv310/time.c b/arch/arm/mach-\n" ">s5pv310/time.c\n" @@ -207,7 +201,7 @@ ">>>> +/* linux/arch/arm/mach-s5pv310/time.c\n" ">>>> + *\n" ">>>> + * Copyright (c) 2010 Samsung Electronics Co., Ltd.\n" - ">>>> + * \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 http://www.samsung.com\n" + ">>>> + * ? ? ? ? ? ? http://www.samsung.com\n" ">>>> + *\n" ">>>> + * S5PV310 (and compatible) HRT support\n" ">>>> + * PWM 2/4 is used for this feature\n" @@ -242,291 +236,291 @@ ">>>> +\n" ">>>> +static void s5pv310_pwm_stop(unsigned int pwm_id)\n" ">>>> +{\n" - ">>>> + \302\240 \302\240 \302\240 unsigned long tcon;\n" - ">>>> +\n" - ">>>> + \302\240 \302\240 \302\240 tcon = __raw_readl(S3C2410_TCON);\n" - ">>>> +\n" - ">>>> + \302\240 \302\240 \302\240 switch (pwm_id) {\n" - ">>>> + \302\240 \302\240 \302\240 case 2:\n" - ">>>> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 tcon &= ~S3C2410_TCON_T2START;\n" - ">>>> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 break;\n" - ">>>> + \302\240 \302\240 \302\240 case 4:\n" - ">>>> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 tcon &= ~S3C2410_TCON_T4START;\n" - ">>>> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 break;\n" - ">>>> + \302\240 \302\240 \302\240 default:\n" - ">>>> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 break;\n" - ">>>> + \302\240 \302\240 \302\240 }\n" - ">>>> + \302\240 \302\240 \302\240 __raw_writel(tcon, S3C2410_TCON);\n" + ">>>> + ? ? ? unsigned long tcon;\n" + ">>>> +\n" + ">>>> + ? ? ? tcon = __raw_readl(S3C2410_TCON);\n" + ">>>> +\n" + ">>>> + ? ? ? switch (pwm_id) {\n" + ">>>> + ? ? ? case 2:\n" + ">>>> + ? ? ? ? ? ? ? tcon &= ~S3C2410_TCON_T2START;\n" + ">>>> + ? ? ? ? ? ? ? break;\n" + ">>>> + ? ? ? case 4:\n" + ">>>> + ? ? ? ? ? ? ? tcon &= ~S3C2410_TCON_T4START;\n" + ">>>> + ? ? ? ? ? ? ? break;\n" + ">>>> + ? ? ? default:\n" + ">>>> + ? ? ? ? ? ? ? break;\n" + ">>>> + ? ? ? }\n" + ">>>> + ? ? ? __raw_writel(tcon, S3C2410_TCON);\n" ">>>> +}\n" ">>>> +\n" ">>>> +static void s5pv310_pwm_init(unsigned int pwm_id, unsigned long tcnt)\n" ">>>> +{\n" - ">>>> + \302\240 \302\240 \302\240 unsigned long tcon;\n" + ">>>> + ? ? ? unsigned long tcon;\n" ">>>> +\n" - ">>>> + \302\240 \302\240 \302\240 tcon = __raw_readl(S3C2410_TCON);\n" + ">>>> + ? ? ? tcon = __raw_readl(S3C2410_TCON);\n" ">>>> +\n" - ">>>> + \302\240 \302\240 \302\240 /* timers reload after counting zero, so reduce the count by 1\n" + ">>>> + ? ? ? /* timers reload after counting zero, so reduce the count by 1\n" ">*/\n" - ">>>> + \302\240 \302\240 \302\240 tcnt--;\n" - ">>>> +\n" - ">>>> + \302\240 \302\240 \302\240 /* ensure timer is stopped... */\n" - ">>>> + \302\240 \302\240 \302\240 switch (pwm_id) {\n" - ">>>> + \302\240 \302\240 \302\240 case 2:\n" - ">>>> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 tcon &= ~(0xf<<12);\n" - ">>>> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 tcon |= S3C2410_TCON_T2MANUALUPD;\n" - ">>>> +\n" - ">>>> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 __raw_writel(tcnt, S3C2410_TCNTB(2));\n" - ">>>> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 __raw_writel(tcnt, S3C2410_TCMPB(2));\n" - ">>>> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 __raw_writel(tcon, S3C2410_TCON);\n" - ">>>> +\n" - ">>>> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 break;\n" - ">>>> + \302\240 \302\240 \302\240 case 4:\n" - ">>>> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 tcon &= ~(7<<20);\n" - ">>>> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 tcon |= S3C2410_TCON_T4MANUALUPD;\n" - ">>>> +\n" - ">>>> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 __raw_writel(tcnt, S3C2410_TCNTB(4));\n" - ">>>> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 __raw_writel(tcnt, S3C2410_TCMPB(4));\n" - ">>>> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 __raw_writel(tcon, S3C2410_TCON);\n" - ">>>> +\n" - ">>>> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 break;\n" - ">>>> + \302\240 \302\240 \302\240 default:\n" - ">>>> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 break;\n" - ">>>> + \302\240 \302\240 \302\240 }\n" + ">>>> + ? ? ? tcnt--;\n" + ">>>> +\n" + ">>>> + ? ? ? /* ensure timer is stopped... */\n" + ">>>> + ? ? ? switch (pwm_id) {\n" + ">>>> + ? ? ? case 2:\n" + ">>>> + ? ? ? ? ? ? ? tcon &= ~(0xf<<12);\n" + ">>>> + ? ? ? ? ? ? ? tcon |= S3C2410_TCON_T2MANUALUPD;\n" + ">>>> +\n" + ">>>> + ? ? ? ? ? ? ? __raw_writel(tcnt, S3C2410_TCNTB(2));\n" + ">>>> + ? ? ? ? ? ? ? __raw_writel(tcnt, S3C2410_TCMPB(2));\n" + ">>>> + ? ? ? ? ? ? ? __raw_writel(tcon, S3C2410_TCON);\n" + ">>>> +\n" + ">>>> + ? ? ? ? ? ? ? break;\n" + ">>>> + ? ? ? case 4:\n" + ">>>> + ? ? ? ? ? ? ? tcon &= ~(7<<20);\n" + ">>>> + ? ? ? ? ? ? ? tcon |= S3C2410_TCON_T4MANUALUPD;\n" + ">>>> +\n" + ">>>> + ? ? ? ? ? ? ? __raw_writel(tcnt, S3C2410_TCNTB(4));\n" + ">>>> + ? ? ? ? ? ? ? __raw_writel(tcnt, S3C2410_TCMPB(4));\n" + ">>>> + ? ? ? ? ? ? ? __raw_writel(tcon, S3C2410_TCON);\n" + ">>>> +\n" + ">>>> + ? ? ? ? ? ? ? break;\n" + ">>>> + ? ? ? default:\n" + ">>>> + ? ? ? ? ? ? ? break;\n" + ">>>> + ? ? ? }\n" ">>>> +}\n" ">>>> +\n" ">>>> +static inline void s5pv310_pwm_start(unsigned int pwm_id, bool\n" ">periodic)\n" ">>>> +{\n" - ">>>> + \302\240 \302\240 \302\240 unsigned long tcon;\n" - ">>>> +\n" - ">>>> + \302\240 \302\240 \302\240 tcon \302\240= __raw_readl(S3C2410_TCON);\n" - ">>>> +\n" - ">>>> + \302\240 \302\240 \302\240 switch (pwm_id) {\n" - ">>>> + \302\240 \302\240 \302\240 case 2:\n" - ">>>> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 tcon |= S3C2410_TCON_T2START;\n" - ">>>> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 tcon &= ~S3C2410_TCON_T2MANUALUPD;\n" - ">>>> +\n" - ">>>> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 if (periodic)\n" - ">>>> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 tcon |= S3C2410_TCON_T2RELOAD;\n" - ">>>> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 else\n" - ">>>> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 tcon &= ~S3C2410_TCON_T2RELOAD;\n" - ">>>> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 break;\n" - ">>>> + \302\240 \302\240 \302\240 case 4:\n" - ">>>> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 tcon |= S3C2410_TCON_T4START;\n" - ">>>> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 tcon &= ~S3C2410_TCON_T4MANUALUPD;\n" - ">>>> +\n" - ">>>> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 if (periodic)\n" - ">>>> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 tcon |= S3C2410_TCON_T4RELOAD;\n" - ">>>> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 else\n" - ">>>> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 tcon &= ~S3C2410_TCON_T4RELOAD;\n" - ">>>> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 break;\n" - ">>>> + \302\240 \302\240 \302\240 default:\n" - ">>>> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 break;\n" - ">>>> + \302\240 \302\240 \302\240 }\n" - ">>>> + \302\240 \302\240 \302\240 __raw_writel(tcon, S3C2410_TCON);\n" + ">>>> + ? ? ? unsigned long tcon;\n" + ">>>> +\n" + ">>>> + ? ? ? tcon ?= __raw_readl(S3C2410_TCON);\n" + ">>>> +\n" + ">>>> + ? ? ? switch (pwm_id) {\n" + ">>>> + ? ? ? case 2:\n" + ">>>> + ? ? ? ? ? ? ? tcon |= S3C2410_TCON_T2START;\n" + ">>>> + ? ? ? ? ? ? ? tcon &= ~S3C2410_TCON_T2MANUALUPD;\n" + ">>>> +\n" + ">>>> + ? ? ? ? ? ? ? if (periodic)\n" + ">>>> + ? ? ? ? ? ? ? ? ? ? ? tcon |= S3C2410_TCON_T2RELOAD;\n" + ">>>> + ? ? ? ? ? ? ? else\n" + ">>>> + ? ? ? ? ? ? ? ? ? ? ? tcon &= ~S3C2410_TCON_T2RELOAD;\n" + ">>>> + ? ? ? ? ? ? ? break;\n" + ">>>> + ? ? ? case 4:\n" + ">>>> + ? ? ? ? ? ? ? tcon |= S3C2410_TCON_T4START;\n" + ">>>> + ? ? ? ? ? ? ? tcon &= ~S3C2410_TCON_T4MANUALUPD;\n" + ">>>> +\n" + ">>>> + ? ? ? ? ? ? ? if (periodic)\n" + ">>>> + ? ? ? ? ? ? ? ? ? ? ? tcon |= S3C2410_TCON_T4RELOAD;\n" + ">>>> + ? ? ? ? ? ? ? else\n" + ">>>> + ? ? ? ? ? ? ? ? ? ? ? tcon &= ~S3C2410_TCON_T4RELOAD;\n" + ">>>> + ? ? ? ? ? ? ? break;\n" + ">>>> + ? ? ? default:\n" + ">>>> + ? ? ? ? ? ? ? break;\n" + ">>>> + ? ? ? }\n" + ">>>> + ? ? ? __raw_writel(tcon, S3C2410_TCON);\n" ">>>> +}\n" ">>>> +\n" ">>>> +static int s5pv310_pwm_set_next_event(unsigned long cycles,\n" - ">>>> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 struct clock_event_device *evt)\n" + ">>>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? struct clock_event_device *evt)\n" ">>>> +{\n" - ">>>> + \302\240 \302\240 \302\240 s5pv310_pwm_init(2, cycles);\n" - ">>>> + \302\240 \302\240 \302\240 s5pv310_pwm_start(2, 0);\n" - ">>>> + \302\240 \302\240 \302\240 return 0;\n" + ">>>> + ? ? ? s5pv310_pwm_init(2, cycles);\n" + ">>>> + ? ? ? s5pv310_pwm_start(2, 0);\n" + ">>>> + ? ? ? return 0;\n" ">>>> +}\n" ">>>> +\n" ">>>> +static void s5pv310_pwm_set_mode(enum clock_event_mode mode,\n" - ">>>> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 struct clock_event_device *evt)\n" + ">>>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? struct clock_event_device *evt)\n" ">>>> +{\n" - ">>>> + \302\240 \302\240 \302\240 s5pv310_pwm_stop(2);\n" - ">>>> +\n" - ">>>> + \302\240 \302\240 \302\240 switch (mode) {\n" - ">>>> + \302\240 \302\240 \302\240 case CLOCK_EVT_MODE_PERIODIC:\n" - ">>>> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 s5pv310_pwm_init(2, clock_count_per_tick);\n" - ">>>> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 s5pv310_pwm_start(2, 1);\n" - ">>>> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 break;\n" - ">>>> + \302\240 \302\240 \302\240 case CLOCK_EVT_MODE_ONESHOT:\n" - ">>>> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 break;\n" - ">>>> + \302\240 \302\240 \302\240 case CLOCK_EVT_MODE_UNUSED:\n" - ">>>> + \302\240 \302\240 \302\240 case CLOCK_EVT_MODE_SHUTDOWN:\n" - ">>>> + \302\240 \302\240 \302\240 case CLOCK_EVT_MODE_RESUME:\n" - ">>>> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 break;\n" - ">>>> + \302\240 \302\240 \302\240 }\n" + ">>>> + ? ? ? s5pv310_pwm_stop(2);\n" + ">>>> +\n" + ">>>> + ? ? ? switch (mode) {\n" + ">>>> + ? ? ? case CLOCK_EVT_MODE_PERIODIC:\n" + ">>>> + ? ? ? ? ? ? ? s5pv310_pwm_init(2, clock_count_per_tick);\n" + ">>>> + ? ? ? ? ? ? ? s5pv310_pwm_start(2, 1);\n" + ">>>> + ? ? ? ? ? ? ? break;\n" + ">>>> + ? ? ? case CLOCK_EVT_MODE_ONESHOT:\n" + ">>>> + ? ? ? ? ? ? ? break;\n" + ">>>> + ? ? ? case CLOCK_EVT_MODE_UNUSED:\n" + ">>>> + ? ? ? case CLOCK_EVT_MODE_SHUTDOWN:\n" + ">>>> + ? ? ? case CLOCK_EVT_MODE_RESUME:\n" + ">>>> + ? ? ? ? ? ? ? break;\n" + ">>>> + ? ? ? }\n" ">>>> +}\n" ">>>> +\n" ">>>> +static struct clock_event_device pwm_event_device = {\n" - ">>>> + \302\240 \302\240 \302\240 .name \302\240 \302\240 \302\240 \302\240 \302\240 = \"pwm_timer2\",\n" - ">>>> + \302\240 \302\240 \302\240 .features \302\240 \302\240 \302\240 = CLOCK_EVT_FEAT_PERIODIC |\n" + ">>>> + ? ? ? .name ? ? ? ? ? = \"pwm_timer2\",\n" + ">>>> + ? ? ? .features ? ? ? = CLOCK_EVT_FEAT_PERIODIC |\n" ">> CLOCK_EVT_FEAT_ONESHOT,\n" - ">>>> + \302\240 \302\240 \302\240 .rating \302\240 \302\240 \302\240 \302\240 = 200,\n" - ">>>> + \302\240 \302\240 \302\240 .shift \302\240 \302\240 \302\240 \302\240 \302\240= 32,\n" - ">>>> + \302\240 \302\240 \302\240 .set_next_event = s5pv310_pwm_set_next_event,\n" - ">>>> + \302\240 \302\240 \302\240 .set_mode \302\240 \302\240 \302\240 = s5pv310_pwm_set_mode,\n" + ">>>> + ? ? ? .rating ? ? ? ? = 200,\n" + ">>>> + ? ? ? .shift ? ? ? ? ?= 32,\n" + ">>>> + ? ? ? .set_next_event = s5pv310_pwm_set_next_event,\n" + ">>>> + ? ? ? .set_mode ? ? ? = s5pv310_pwm_set_mode,\n" ">>>> +};\n" ">>>> +\n" ">>>> +irqreturn_t s5pv310_clock_event_isr(int irq, void *dev_id)\n" ">>>> +{\n" - ">>>> + \302\240 \302\240 \302\240 struct clock_event_device *evt = &pwm_event_device;\n" + ">>>> + ? ? ? struct clock_event_device *evt = &pwm_event_device;\n" ">>>> +\n" - ">>>> + \302\240 \302\240 \302\240 evt->event_handler(evt);\n" + ">>>> + ? ? ? evt->event_handler(evt);\n" ">>>> +\n" - ">>>> + \302\240 \302\240 \302\240 return IRQ_HANDLED;\n" + ">>>> + ? ? ? return IRQ_HANDLED;\n" ">>>> +}\n" ">>>> +\n" ">>>> +static struct irqaction s5pv310_clock_event_irq = {\n" - ">>>> + \302\240 \302\240 \302\240 .name \302\240 \302\240 \302\240 \302\240 \302\240 = \"pwm_timer2_irq\",\n" - ">>>> + \302\240 \302\240 \302\240 .flags \302\240 \302\240 \302\240 \302\240 \302\240= IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,\n" - ">>>> + \302\240 \302\240 \302\240 .handler \302\240 \302\240 \302\240 \302\240= s5pv310_clock_event_isr,\n" + ">>>> + ? ? ? .name ? ? ? ? ? = \"pwm_timer2_irq\",\n" + ">>>> + ? ? ? .flags ? ? ? ? ?= IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,\n" + ">>>> + ? ? ? .handler ? ? ? ?= s5pv310_clock_event_isr,\n" ">>>> +};\n" ">>>> +\n" ">>>> +static void __init s5pv310_clockevent_init(void)\n" ">>>> +{\n" - ">>>> + \302\240 \302\240 \302\240 unsigned long pclk;\n" - ">>>> + \302\240 \302\240 \302\240 unsigned long clock_rate;\n" - ">>>> + \302\240 \302\240 \302\240 struct clk *tscaler;\n" + ">>>> + ? ? ? unsigned long pclk;\n" + ">>>> + ? ? ? unsigned long clock_rate;\n" + ">>>> + ? ? ? struct clk *tscaler;\n" ">>>> +\n" - ">>>> + \302\240 \302\240 \302\240 pclk = clk_get_rate(timerclk);\n" + ">>>> + ? ? ? pclk = clk_get_rate(timerclk);\n" ">>>> +\n" - ">>>> + \302\240 \302\240 \302\240 /* configure clock tick */\n" + ">>>> + ? ? ? /* configure clock tick */\n" ">>>> +\n" - ">>>> + \302\240 \302\240 \302\240 tscaler = clk_get_parent(tdiv2);\n" + ">>>> + ? ? ? tscaler = clk_get_parent(tdiv2);\n" ">>>> +\n" - ">>>> + \302\240 \302\240 \302\240 clk_set_rate(tscaler, pclk / 2);\n" - ">>>> + \302\240 \302\240 \302\240 clk_set_rate(tdiv2, pclk / 2);\n" - ">>>> + \302\240 \302\240 \302\240 clk_set_parent(tin2, tdiv2);\n" + ">>>> + ? ? ? clk_set_rate(tscaler, pclk / 2);\n" + ">>>> + ? ? ? clk_set_rate(tdiv2, pclk / 2);\n" + ">>>> + ? ? ? clk_set_parent(tin2, tdiv2);\n" ">>>> +\n" - ">>>> + \302\240 \302\240 \302\240 clock_rate = clk_get_rate(tin2);\n" + ">>>> + ? ? ? clock_rate = clk_get_rate(tin2);\n" ">>>> +\n" - ">>>> + \302\240 \302\240 \302\240 clock_count_per_tick = clock_rate / HZ;\n" + ">>>> + ? ? ? clock_count_per_tick = clock_rate / HZ;\n" ">>>> +\n" - ">>>> + \302\240 \302\240 \302\240 pwm_event_device.mult =\n" - ">>>> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 div_sc(clock_rate, NSEC_PER_SEC,\n" + ">>>> + ? ? ? pwm_event_device.mult =\n" + ">>>> + ? ? ? ? ? ? ? div_sc(clock_rate, NSEC_PER_SEC,\n" "pwm_event_device.shift);\n" - ">>>> + \302\240 \302\240 \302\240 pwm_event_device.max_delta_ns =\n" - ">>>> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 clockevent_delta2ns(-1, &pwm_event_device);\n" - ">>>> + \302\240 \302\240 \302\240 pwm_event_device.min_delta_ns =\n" - ">>>> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 clockevent_delta2ns(1, &pwm_event_device);\n" + ">>>> + ? ? ? pwm_event_device.max_delta_ns =\n" + ">>>> + ? ? ? ? ? ? ? clockevent_delta2ns(-1, &pwm_event_device);\n" + ">>>> + ? ? ? pwm_event_device.min_delta_ns =\n" + ">>>> + ? ? ? ? ? ? ? clockevent_delta2ns(1, &pwm_event_device);\n" ">>>> +\n" - ">>>> + \302\240 \302\240 \302\240 pwm_event_device.cpumask = cpumask_of(0);\n" - ">>>> + \302\240 \302\240 \302\240 clockevents_register_device(&pwm_event_device);\n" + ">>>> + ? ? ? pwm_event_device.cpumask = cpumask_of(0);\n" + ">>>> + ? ? ? clockevents_register_device(&pwm_event_device);\n" ">>>> +\n" - ">>>> + \302\240 \302\240 \302\240 setup_irq(IRQ_TIMER2, &s5pv310_clock_event_irq);\n" + ">>>> + ? ? ? setup_irq(IRQ_TIMER2, &s5pv310_clock_event_irq);\n" ">>>> +}\n" ">>>> +\n" ">>>> +static cycle_t s5pv310_pwm4_read(struct clocksource *cs)\n" ">>>> +{\n" - ">>>> + \302\240 \302\240 \302\240 return (cycle_t) ~__raw_readl(S3C_TIMERREG(0x40));\n" + ">>>> + ? ? ? return (cycle_t) ~__raw_readl(S3C_TIMERREG(0x40));\n" ">>>> +}\n" ">>>> +\n" ">>>> +struct clocksource pwm_clocksource = {\n" - ">>>> + \302\240 \302\240 \302\240 .name \302\240 \302\240 \302\240 \302\240 \302\240 = \"pwm_timer4\",\n" - ">>>> + \302\240 \302\240 \302\240 .rating \302\240 \302\240 \302\240 \302\240 = 250,\n" - ">>>> + \302\240 \302\240 \302\240 .read \302\240 \302\240 \302\240 \302\240 \302\240 = s5pv310_pwm4_read,\n" - ">>>> + \302\240 \302\240 \302\240 .mask \302\240 \302\240 \302\240 \302\240 \302\240 = CLOCKSOURCE_MASK(32),\n" - ">>>> + \302\240 \302\240 \302\240 .shift \302\240 \302\240 \302\240 \302\240 \302\240= 20,\n" - ">>>> + \302\240 \302\240 \302\240 .flags \302\240 \302\240 \302\240 \302\240 \302\240= CLOCK_SOURCE_IS_CONTINUOUS ,\n" + ">>>> + ? ? ? .name ? ? ? ? ? = \"pwm_timer4\",\n" + ">>>> + ? ? ? .rating ? ? ? ? = 250,\n" + ">>>> + ? ? ? .read ? ? ? ? ? = s5pv310_pwm4_read,\n" + ">>>> + ? ? ? .mask ? ? ? ? ? = CLOCKSOURCE_MASK(32),\n" + ">>>> + ? ? ? .shift ? ? ? ? ?= 20,\n" + ">>>> + ? ? ? .flags ? ? ? ? ?= CLOCK_SOURCE_IS_CONTINUOUS ,\n" ">>>> +};\n" ">>>> +\n" ">>>> +static void __init s5pv310_clocksource_init(void)\n" ">>>> +{\n" - ">>>> + \302\240 \302\240 \302\240 unsigned long pclk;\n" - ">>>> + \302\240 \302\240 \302\240 unsigned long clock_rate;\n" + ">>>> + ? ? ? unsigned long pclk;\n" + ">>>> + ? ? ? unsigned long clock_rate;\n" ">>>> +\n" - ">>>> + \302\240 \302\240 \302\240 pclk = clk_get_rate(timerclk);\n" + ">>>> + ? ? ? pclk = clk_get_rate(timerclk);\n" ">>>> +\n" - ">>>> + \302\240 \302\240 \302\240 clk_set_rate(tdiv4, pclk / 2);\n" - ">>>> + \302\240 \302\240 \302\240 clk_set_parent(tin4, tdiv4);\n" + ">>>> + ? ? ? clk_set_rate(tdiv4, pclk / 2);\n" + ">>>> + ? ? ? clk_set_parent(tin4, tdiv4);\n" ">>>> +\n" - ">>>> + \302\240 \302\240 \302\240 clock_rate = clk_get_rate(tin4);\n" + ">>>> + ? ? ? clock_rate = clk_get_rate(tin4);\n" ">>>> +\n" - ">>>> + \302\240 \302\240 \302\240 s5pv310_pwm_init(4, ~0);\n" - ">>>> + \302\240 \302\240 \302\240 s5pv310_pwm_start(4, 1);\n" + ">>>> + ? ? ? s5pv310_pwm_init(4, ~0);\n" + ">>>> + ? ? ? s5pv310_pwm_start(4, 1);\n" ">>>> +\n" - ">>>> + \302\240 \302\240 \302\240 pwm_clocksource.mult =\n" - ">>>> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 clocksource_khz2mult(clock_rate/1000,\n" + ">>>> + ? ? ? pwm_clocksource.mult =\n" + ">>>> + ? ? ? ? ? ? ? clocksource_khz2mult(clock_rate/1000,\n" ">>>pwm_clocksource.shift);\n" ">>>> +\n" - ">>>> + \302\240 \302\240 \302\240 if (clocksource_register(&pwm_clocksource))\n" - ">>>> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 panic(\"%s: can't register clocksource\\n\",\n" + ">>>> + ? ? ? if (clocksource_register(&pwm_clocksource))\n" + ">>>> + ? ? ? ? ? ? ? panic(\"%s: can't register clocksource\\n\",\n" ">>>pwm_clocksource.name);\n" ">>>> +}\n" ">>>> +\n" ">>>> +static void __init s5pv310_timer_resources(void)\n" ">>>> +{\n" - ">>>> + \302\240 \302\240 \302\240 struct platform_device tmpdev;\n" + ">>>> + ? ? ? struct platform_device tmpdev;\n" ">>>> +\n" - ">>>> + \302\240 \302\240 \302\240 tmpdev.dev.bus = &platform_bus_type;\n" + ">>>> + ? ? ? tmpdev.dev.bus = &platform_bus_type;\n" ">>>> +\n" - ">>>> + \302\240 \302\240 \302\240 timerclk = clk_get(NULL, \"timers\");\n" - ">>>> + \302\240 \302\240 \302\240 if (IS_ERR(timerclk))\n" - ">>>> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 panic(\"failed to get timers clock for system timer\");\n" + ">>>> + ? ? ? timerclk = clk_get(NULL, \"timers\");\n" + ">>>> + ? ? ? if (IS_ERR(timerclk))\n" + ">>>> + ? ? ? ? ? ? ? panic(\"failed to get timers clock for system timer\");\n" ">>>> +\n" - ">>>> + \302\240 \302\240 \302\240 clk_enable(timerclk);\n" + ">>>> + ? ? ? clk_enable(timerclk);\n" ">>>> +\n" - ">>>> + \302\240 \302\240 \302\240 tmpdev.id = 2;\n" - ">>>> + \302\240 \302\240 \302\240 tin2 = clk_get(&tmpdev.dev, \"pwm-tin\");\n" - ">>>> + \302\240 \302\240 \302\240 if (IS_ERR(tin2))\n" - ">>>> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 panic(\"failed to get pwm-tin2 clock for system timer\");\n" + ">>>> + ? ? ? tmpdev.id = 2;\n" + ">>>> + ? ? ? tin2 = clk_get(&tmpdev.dev, \"pwm-tin\");\n" + ">>>> + ? ? ? if (IS_ERR(tin2))\n" + ">>>> + ? ? ? ? ? ? ? panic(\"failed to get pwm-tin2 clock for system timer\");\n" ">>>> +\n" - ">>>> + \302\240 \302\240 \302\240 tdiv2 = clk_get(&tmpdev.dev, \"pwm-tdiv\");\n" - ">>>> + \302\240 \302\240 \302\240 if (IS_ERR(tdiv2))\n" - ">>>> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 panic(\"failed to get pwm-tdiv2 clock for system\n" + ">>>> + ? ? ? tdiv2 = clk_get(&tmpdev.dev, \"pwm-tdiv\");\n" + ">>>> + ? ? ? if (IS_ERR(tdiv2))\n" + ">>>> + ? ? ? ? ? ? ? panic(\"failed to get pwm-tdiv2 clock for system\n" "timer\");\n" - ">>>> + \302\240 \302\240 \302\240 clk_enable(tin2);\n" + ">>>> + ? ? ? clk_enable(tin2);\n" ">>>> +\n" - ">>>> + \302\240 \302\240 \302\240 tmpdev.id = 4;\n" - ">>>> + \302\240 \302\240 \302\240 tin4 = clk_get(&tmpdev.dev, \"pwm-tin\");\n" - ">>>> + \302\240 \302\240 \302\240 if (IS_ERR(tin4))\n" - ">>>> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 panic(\"failed to get pwm-tin4 clock for system timer\");\n" + ">>>> + ? ? ? tmpdev.id = 4;\n" + ">>>> + ? ? ? tin4 = clk_get(&tmpdev.dev, \"pwm-tin\");\n" + ">>>> + ? ? ? if (IS_ERR(tin4))\n" + ">>>> + ? ? ? ? ? ? ? panic(\"failed to get pwm-tin4 clock for system timer\");\n" ">>>> +\n" - ">>>> + \302\240 \302\240 \302\240 tdiv4 = clk_get(&tmpdev.dev, \"pwm-tdiv\");\n" - ">>>> + \302\240 \302\240 \302\240 if (IS_ERR(tdiv4))\n" - ">>>> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 panic(\"failed to get pwm-tdiv4 clock for system\n" + ">>>> + ? ? ? tdiv4 = clk_get(&tmpdev.dev, \"pwm-tdiv\");\n" + ">>>> + ? ? ? if (IS_ERR(tdiv4))\n" + ">>>> + ? ? ? ? ? ? ? panic(\"failed to get pwm-tdiv4 clock for system\n" "timer\");\n" ">>>> +\n" - ">>>> + \302\240 \302\240 \302\240 clk_enable(tin4);\n" + ">>>> + ? ? ? clk_enable(tin4);\n" ">>>> +}\n" ">>>> +\n" ">>>> +static void __init s5pv310_timer_init(void)\n" ">>>> +{\n" ">>>> +#ifdef CONFIG_LOCAL_TIMERS\n" - ">>>> + \302\240 \302\240 \302\240 twd_base = S5P_VA_TWD;\n" + ">>>> + ? ? ? twd_base = S5P_VA_TWD;\n" ">>>> +#endif\n" ">>>> +\n" - ">>>> + \302\240 \302\240 \302\240 s5pv310_timer_resources();\n" - ">>>> + \302\240 \302\240 \302\240 s5pv310_clockevent_init();\n" - ">>>> + \302\240 \302\240 \302\240 s5pv310_clocksource_init();\n" + ">>>> + ? ? ? s5pv310_timer_resources();\n" + ">>>> + ? ? ? s5pv310_clockevent_init();\n" + ">>>> + ? ? ? s5pv310_clocksource_init();\n" ">>>> +}\n" ">>>> +\n" ">>>> +struct sys_timer s5pv310_timer = {\n" - ">>>> + \302\240 \302\240 \302\240 .init \302\240 \302\240 \302\240 \302\240 \302\240 = s5pv310_timer_init,\n" + ">>>> + ? ? ? .init ? ? ? ? ? = s5pv310_timer_init,\n" ">>>> +};\n" ">>>> diff --git a/arch/arm/plat-s5p/include/plat/s5pv310.h b/arch/arm/plat-\n" ">>>s5p/include/plat/s5pv310.h\n" ">>>> index d2f05e1..769c991 100644\n" ">>>> --- a/arch/arm/plat-s5p/include/plat/s5pv310.h\n" ">>>> +++ b/arch/arm/plat-s5p/include/plat/s5pv310.h\n" - ">>>> @@ -22,6 +22,7 @@ extern \302\240int s5pv310_init(void);\n" - ">>>> \302\240extern void s5pv310_init_irq(void);\n" - ">>>> \302\240extern void s5pv310_map_io(void);\n" - ">>>> \302\240extern void s5pv310_init_clocks(int xtal);\n" + ">>>> @@ -22,6 +22,7 @@ extern ?int s5pv310_init(void);\n" + ">>>> ?extern void s5pv310_init_irq(void);\n" + ">>>> ?extern void s5pv310_map_io(void);\n" + ">>>> ?extern void s5pv310_init_clocks(int xtal);\n" ">>>> +extern struct sys_timer s5pv310_timer;\n" ">>>>\n" - ">>>> \302\240#define s5pv310_init_uarts s5pv310_common_init_uarts\n" + ">>>> ?#define s5pv310_init_uarts s5pv310_common_init_uarts\n" ">>>>\n" ">>>> diff --git a/arch/arm/plat-samsung/Makefile b/arch/arm/plat-\n" ">>>samsung/Makefile\n" ">>>> index b1d82cc..0d5bf8a 100644\n" ">>>> --- a/arch/arm/plat-samsung/Makefile\n" ">>>> +++ b/arch/arm/plat-samsung/Makefile\n" - ">>>> @@ -12,7 +12,7 @@ obj- \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240:=\n" - ">>>> \302\240# Objects we always build independent of SoC choice\n" + ">>>> @@ -12,7 +12,7 @@ obj- ? ? ? ? ? ? ? ? ? ? ? ? ?:=\n" + ">>>> ?# Objects we always build independent of SoC choice\n" ">>>>\n" - ">>>> \302\240obj-y \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240+= init.o\n" - ">>>> -obj-y \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240+= time.o\n" - ">>>> +obj-$(CONFIG_ARCH_USES_GETTIMEOFFSET) \302\240 += time.o\n" - ">>>> \302\240obj-y \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240+= clock.o\n" - ">>>> \302\240obj-y \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240+= pwm-clock.o\n" - ">>>> \302\240obj-y \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240+= gpio.o\n" + ">>>> ?obj-y ? ? ? ? ? ? ? ? ? ? ? ? ?+= init.o\n" + ">>>> -obj-y ? ? ? ? ? ? ? ? ? ? ? ? ?+= time.o\n" + ">>>> +obj-$(CONFIG_ARCH_USES_GETTIMEOFFSET) ? += time.o\n" + ">>>> ?obj-y ? ? ? ? ? ? ? ? ? ? ? ? ?+= clock.o\n" + ">>>> ?obj-y ? ? ? ? ? ? ? ? ? ? ? ? ?+= pwm-clock.o\n" + ">>>> ?obj-y ? ? ? ? ? ? ? ? ? ? ? ? ?+= gpio.o\n" ">>>> --\n" ">>>> 1.6.2.5\n" ">>>>\n" @@ -534,25 +528,25 @@ ">>>> To unsubscribe from this list: send the line \"unsubscribe linux-\n" ">samsung-\n" ">>>soc\" in\n" - ">>>> the body of a message to majordomo@vger.kernel.org\n" - ">>>> More majordomo info at \302\240http://vger.kernel.org/majordomo-info.html\n" + ">>>> the body of a message to majordomo at vger.kernel.org\n" + ">>>> More majordomo info at ?http://vger.kernel.org/majordomo-info.html\n" ">>>>\n" ">>>\n" ">>>_______________________________________________\n" ">>>linux-arm-kernel mailing list\n" - ">>>linux-arm-kernel@lists.infradead.org\n" + ">>>linux-arm-kernel at lists.infradead.org\n" ">>>http://lists.infradead.org/mailman/listinfo/linux-arm-kernel\n" ">>\n" ">> --\n" ">> To unsubscribe from this list: send the line \"unsubscribe linux-samsung-\n" ">soc\" in\n" - ">> the body of a message to majordomo@vger.kernel.org\n" - ">> More majordomo info at \302\240http://vger.kernel.org/majordomo-info.html\n" + ">> the body of a message to majordomo at vger.kernel.org\n" + ">> More majordomo info at ?http://vger.kernel.org/majordomo-info.html\n" ">>\n" ">--\n" ">To unsubscribe from this list: send the line \"unsubscribe linux-samsung-\n" ">soc\" in\n" - ">the body of a message to majordomo@vger.kernel.org\n" + ">the body of a message to majordomo at vger.kernel.org\n" >More majordomo info at http://vger.kernel.org/majordomo-info.html -118c99d3aca826aefe9e605d1f626712077bb13ad77bc689ee7cf75bfc982af1 +b167df3676ade0c5d0e4e44838450968e21c328faa13173a1a21b67df8873548
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.