From patchwork Sun Feb 10 13:20:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 2122271 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 594A53FCA4 for ; Sun, 10 Feb 2013 13:25:51 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1U4WsH-0005FS-AJ; Sun, 10 Feb 2013 13:23:17 +0000 Received: from mail-ea0-f173.google.com ([209.85.215.173]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1U4Wq6-0003vQ-JY for linux-arm-kernel@lists.infradead.org; Sun, 10 Feb 2013 13:21:06 +0000 Received: by mail-ea0-f173.google.com with SMTP id i1so2304938eaa.18 for ; Sun, 10 Feb 2013 05:21:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=lcDbDhb6H9KNz5v92Mv7TrNJ+r18K/KuxuLwVq5SbxU=; b=josm5sAmdadGOizFwOqKw17c4bStUldZrEC4qRcU7YpJqMMXyZ5p9907r5cQT/0X3M 37WFodEV7ZUdXZjsBOmnAQDZyCyiszUpOJ0ZQTUN/0blX4HzkSPmhU22BlxPLI07ruhn sZEukCAJ+BgXFZnyBfMnDVqxU3xf7j5GS6gs6GSmNo1U1bAMAeAhw7rr6sq19wpnUWsq y/H2hBYBtWOyKaUpYIRA7Zewi1z0X32P5gJNVd27W9Axxhx2d8mOH4qkLK/Iojc5ERYw dZYyxnqDmhlIZElHUH0k9YNFKgSAgrgZT7wKO0eR9p1CouV94lcp4eaXXQ0swfeL2Ax/ j9CA== X-Received: by 10.14.206.132 with SMTP id l4mr38376494eeo.38.1360502461474; Sun, 10 Feb 2013 05:21:01 -0800 (PST) Received: from flatron.tomeq (87-207-52-162.dynamic.chello.pl. [87.207.52.162]) by mx.google.com with ESMTPS id 44sm57225596eek.5.2013.02.10.05.20.58 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 10 Feb 2013 05:21:00 -0800 (PST) From: Tomasz Figa To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 10/12] clocksource: samsung-time: Move IRQ mask/ack handling to the driver Date: Sun, 10 Feb 2013 14:20:21 +0100 Message-Id: <1360502423-2246-11-git-send-email-tomasz.figa@gmail.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1360502423-2246-1-git-send-email-tomasz.figa@gmail.com> References: <1360502423-2246-1-git-send-email-tomasz.figa@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130210_082102_998710_9F366CD3 X-CRM114-Status: GOOD ( 18.37 ) X-Spam-Score: 0.3 (/) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (0.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.215.173 listed in list.dnswl.org] 3.0 KHOP_BIG_TO_CC Sent to 10+ recipients instaed of Bcc or a list 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (tomasz.figa[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: arhuaco@freaks-unidos.net, Kukjin Kim , linux@arm.linux.org.uk, kwangwoo.lee@gmail.com, guillaume.gourat@nexvision.tv, bhmin@samsung.com, broonie@opensource.wolfsonmicro.com, mcuelenaere@gmail.com, Tomasz Figa , christer@weinigel.se, danders@amltd.com, kyungmin.park@samsung.com, linux-samsung-soc@vger.kernel.org, buserror@gmail.com, augulis.darius@gmail.com, jacmet@sunsite.dk, Sylwester Nawrocki , ghcstop@gmail.com, linux@simtec.co.uk, jekhor@gmail.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Since the clocksource driver is the only user of PWM timer interrupts, there is no need to create an IRQ chip for handling them. This patch the way of PWM timer interrupt handling to use real VIC/GIC interrupt signals and handle PWM mask/ack register internally in samsung-time driver. Signed-off-by: Tomasz Figa --- arch/arm/mach-exynos/include/mach/irqs.h | 3 +-- arch/arm/mach-exynos/mach-universal_c210.c | 5 +++-- arch/arm/mach-s3c24xx/common.c | 1 + arch/arm/mach-s3c64xx/common.c | 8 +++----- arch/arm/mach-s3c64xx/include/mach/irqs.h | 8 -------- arch/arm/mach-s5p64x0/common.c | 5 +++-- arch/arm/mach-s5p64x0/include/mach/irqs.h | 2 -- arch/arm/mach-s5pc100/common.c | 5 +++-- arch/arm/mach-s5pc100/include/mach/irqs.h | 2 -- arch/arm/mach-s5pv210/common.c | 5 +++-- arch/arm/mach-s5pv210/include/mach/irqs.h | 2 -- arch/arm/plat-samsung/include/plat/irqs.h | 9 --------- arch/arm/plat-samsung/s5p-irq.c | 2 -- drivers/clocksource/samsung-time.c | 10 ++++++++++ include/linux/samsung-time.h | 1 + 15 files changed, 28 insertions(+), 40 deletions(-) diff --git a/arch/arm/mach-exynos/include/mach/irqs.h b/arch/arm/mach-exynos/include/mach/irqs.h index 6794292..98c97be 100644 --- a/arch/arm/mach-exynos/include/mach/irqs.h +++ b/arch/arm/mach-exynos/include/mach/irqs.h @@ -470,10 +470,9 @@ #define S5P_EINT_BASE2 (S5P_EINT_BASE1 + 16) #define S5P_GPIOINT_BASE (S5P_EINT_BASE1 + 32) #define IRQ_GPIO_END (S5P_GPIOINT_BASE + S5P_GPIOINT_COUNT) -#define IRQ_TIMER_BASE (IRQ_GPIO_END + 64) /* Set the default NR_IRQS */ -#define NR_IRQS (IRQ_TIMER_BASE + IRQ_TIMER_COUNT) +#define NR_IRQS (IRQ_GPIO_END + 64) #endif /* __ASM_ARCH_IRQS_H */ diff --git a/arch/arm/mach-exynos/mach-universal_c210.c b/arch/arm/mach-exynos/mach-universal_c210.c index 0573db7..1f4af85 100644 --- a/arch/arm/mach-exynos/mach-universal_c210.c +++ b/arch/arm/mach-exynos/mach-universal_c210.c @@ -1093,12 +1093,13 @@ static struct platform_device *universal_devices[] __initdata = { static const struct samsung_timer_variant universal_timer_variant = { .reg_base = EXYNOS4_PA_TIMER, .irqs = { - IRQ_TIMER0, IRQ_TIMER1, IRQ_TIMER2, - IRQ_TIMER3, IRQ_TIMER4 + IRQ_TIMER0_VIC, IRQ_TIMER1_VIC, IRQ_TIMER2_VIC, + IRQ_TIMER3_VIC, IRQ_TIMER4_VIC }, .bits = 32, .prescale = 2, .divisor = 2, + .has_tint_cstat = true, }; static void __init universal_map_io(void) diff --git a/arch/arm/mach-s3c24xx/common.c b/arch/arm/mach-s3c24xx/common.c index 3344c33..c79307a 100644 --- a/arch/arm/mach-s3c24xx/common.c +++ b/arch/arm/mach-s3c24xx/common.c @@ -228,6 +228,7 @@ static const struct samsung_timer_variant s3c24xx_timer_variant = { .bits = 16, .prescale = 25, .divisor = 50, + .has_tint_cstat = false, }; void __init s3c24xx_init_io(struct map_desc *mach_desc, int size) diff --git a/arch/arm/mach-s3c64xx/common.c b/arch/arm/mach-s3c64xx/common.c index 345d08a..4e1775f 100644 --- a/arch/arm/mach-s3c64xx/common.c +++ b/arch/arm/mach-s3c64xx/common.c @@ -152,12 +152,13 @@ static struct device s3c64xx_dev = { static const struct samsung_timer_variant s3c64xx_timer_variant = { .reg_base = S3C_PA_TIMER, .irqs = { - IRQ_TIMER0, IRQ_TIMER1, IRQ_TIMER2, - IRQ_TIMER3, IRQ_TIMER4 + IRQ_TIMER0_VIC, IRQ_TIMER1_VIC, IRQ_TIMER2_VIC, + IRQ_TIMER3_VIC, IRQ_TIMER4_VIC }, .bits = 32, .prescale = 2, .divisor = 2, + .has_tint_cstat = true, }; /* read cpu identification code */ @@ -202,9 +203,6 @@ void __init s3c64xx_init_irq(u32 vic0_valid, u32 vic1_valid) /* initialise the pair of VICs */ vic_init(VA_VIC0, IRQ_VIC0_BASE, vic0_valid, IRQ_VIC0_RESUME); vic_init(VA_VIC1, IRQ_VIC1_BASE, vic1_valid, IRQ_VIC1_RESUME); - - /* add the timer sub-irqs */ - s3c_init_vic_timer_irq(5, IRQ_TIMER0); } #define eint_offset(irq) ((irq) - IRQ_EINT(0)) diff --git a/arch/arm/mach-s3c64xx/include/mach/irqs.h b/arch/arm/mach-s3c64xx/include/mach/irqs.h index 96d60e0..67bbd1d 100644 --- a/arch/arm/mach-s3c64xx/include/mach/irqs.h +++ b/arch/arm/mach-s3c64xx/include/mach/irqs.h @@ -107,14 +107,6 @@ #define IRQ_TC IRQ_PENDN #define IRQ_ADC S3C64XX_IRQ_VIC1(31) -#define S3C64XX_TIMER_IRQ(x) S3C_IRQ(64 + (x)) - -#define IRQ_TIMER0 S3C64XX_TIMER_IRQ(0) -#define IRQ_TIMER1 S3C64XX_TIMER_IRQ(1) -#define IRQ_TIMER2 S3C64XX_TIMER_IRQ(2) -#define IRQ_TIMER3 S3C64XX_TIMER_IRQ(3) -#define IRQ_TIMER4 S3C64XX_TIMER_IRQ(4) - /* compatibility for device defines */ #define IRQ_IIC1 IRQ_S3C6410_IIC1 diff --git a/arch/arm/mach-s5p64x0/common.c b/arch/arm/mach-s5p64x0/common.c index 911122e..982e2d6 100644 --- a/arch/arm/mach-s5p64x0/common.c +++ b/arch/arm/mach-s5p64x0/common.c @@ -160,12 +160,13 @@ static void s5p64x0_idle(void) static const struct samsung_timer_variant s5p64x0_timer_variant = { .reg_base = S5P_PA_TIMER, .irqs = { - IRQ_TIMER0, IRQ_TIMER1, IRQ_TIMER2, - IRQ_TIMER3, IRQ_TIMER4 + IRQ_TIMER0_VIC, IRQ_TIMER1_VIC, IRQ_TIMER2_VIC, + IRQ_TIMER3_VIC, IRQ_TIMER4_VIC }, .bits = 32, .prescale = 2, .divisor = 2, + .has_tint_cstat = true, }; /* diff --git a/arch/arm/mach-s5p64x0/include/mach/irqs.h b/arch/arm/mach-s5p64x0/include/mach/irqs.h index 5b845e8..53982db 100644 --- a/arch/arm/mach-s5p64x0/include/mach/irqs.h +++ b/arch/arm/mach-s5p64x0/include/mach/irqs.h @@ -141,8 +141,6 @@ #define IRQ_EINT_GROUP(grp, x) (IRQ_EINT_GROUP##grp##_BASE + (x)) -#define IRQ_TIMER_BASE (11) - /* Set the default NR_IRQS */ #define NR_IRQS (IRQ_EINT_GROUP8_BASE + IRQ_EINT_GROUP8_NR + 1) diff --git a/arch/arm/mach-s5pc100/common.c b/arch/arm/mach-s5pc100/common.c index f45b1988..6b5364c 100644 --- a/arch/arm/mach-s5pc100/common.c +++ b/arch/arm/mach-s5pc100/common.c @@ -135,12 +135,13 @@ static struct map_desc s5pc100_iodesc[] __initdata = { static const struct samsung_timer_variant s5pc100_timer_variant = { .reg_base = S5P_PA_TIMER, .irqs = { - IRQ_TIMER0, IRQ_TIMER1, IRQ_TIMER2, - IRQ_TIMER3, IRQ_TIMER4 + IRQ_TIMER0_VIC, IRQ_TIMER1_VIC, IRQ_TIMER2_VIC, + IRQ_TIMER3_VIC, IRQ_TIMER4_VIC }, .bits = 32, .prescale = 2, .divisor = 2, + .has_tint_cstat = true, }; /* diff --git a/arch/arm/mach-s5pc100/include/mach/irqs.h b/arch/arm/mach-s5pc100/include/mach/irqs.h index 2870f12..d2eb475 100644 --- a/arch/arm/mach-s5pc100/include/mach/irqs.h +++ b/arch/arm/mach-s5pc100/include/mach/irqs.h @@ -97,8 +97,6 @@ #define IRQ_SDMFIQ S5P_IRQ_VIC2(31) #define IRQ_VIC_END S5P_IRQ_VIC2(31) -#define IRQ_TIMER_BASE (11) - #define S5P_EINT_BASE1 (S5P_IRQ_VIC0(0)) #define S5P_EINT_BASE2 (IRQ_VIC_END + 1) diff --git a/arch/arm/mach-s5pv210/common.c b/arch/arm/mach-s5pv210/common.c index a3ad2cf..8104bc7 100644 --- a/arch/arm/mach-s5pv210/common.c +++ b/arch/arm/mach-s5pv210/common.c @@ -152,12 +152,13 @@ void s5pv210_restart(char mode, const char *cmd) static const struct samsung_timer_variant s5pv210_timer_variant = { .reg_base = S5P_PA_TIMER, .irqs = { - IRQ_TIMER0, IRQ_TIMER1, IRQ_TIMER2, - IRQ_TIMER3, IRQ_TIMER4 + IRQ_TIMER0_VIC, IRQ_TIMER1_VIC, IRQ_TIMER2_VIC, + IRQ_TIMER3_VIC, IRQ_TIMER4_VIC }, .bits = 32, .prescale = 2, .divisor = 2, + .has_tint_cstat = true, }; /* diff --git a/arch/arm/mach-s5pv210/include/mach/irqs.h b/arch/arm/mach-s5pv210/include/mach/irqs.h index e777e01..5e0de3a 100644 --- a/arch/arm/mach-s5pv210/include/mach/irqs.h +++ b/arch/arm/mach-s5pv210/include/mach/irqs.h @@ -118,8 +118,6 @@ #define IRQ_MDNIE3 S5P_IRQ_VIC3(8) #define IRQ_VIC_END S5P_IRQ_VIC3(31) -#define IRQ_TIMER_BASE (11) - #define S5P_EINT_BASE1 (S5P_IRQ_VIC0(0)) #define S5P_EINT_BASE2 (IRQ_VIC_END + 1) diff --git a/arch/arm/plat-samsung/include/plat/irqs.h b/arch/arm/plat-samsung/include/plat/irqs.h index df46b77..039001c 100644 --- a/arch/arm/plat-samsung/include/plat/irqs.h +++ b/arch/arm/plat-samsung/include/plat/irqs.h @@ -44,15 +44,6 @@ #define S5P_IRQ_VIC2(x) (S5P_VIC2_BASE + (x)) #define S5P_IRQ_VIC3(x) (S5P_VIC3_BASE + (x)) -#define S5P_TIMER_IRQ(x) (IRQ_TIMER_BASE + (x)) - -#define IRQ_TIMER0 S5P_TIMER_IRQ(0) -#define IRQ_TIMER1 S5P_TIMER_IRQ(1) -#define IRQ_TIMER2 S5P_TIMER_IRQ(2) -#define IRQ_TIMER3 S5P_TIMER_IRQ(3) -#define IRQ_TIMER4 S5P_TIMER_IRQ(4) -#define IRQ_TIMER_COUNT (5) - #define IRQ_EINT(x) ((x) < 16 ? ((x) + S5P_EINT_BASE1) \ : ((x) - 16 + S5P_EINT_BASE2)) diff --git a/arch/arm/plat-samsung/s5p-irq.c b/arch/arm/plat-samsung/s5p-irq.c index dfb47d6..a14d8e9 100644 --- a/arch/arm/plat-samsung/s5p-irq.c +++ b/arch/arm/plat-samsung/s5p-irq.c @@ -30,6 +30,4 @@ void __init s5p_init_irq(u32 *vic, u32 num_vic) for (irq = 0; irq < num_vic; irq++) vic_init(VA_VIC(irq), VIC_BASE(irq), vic[irq], 0); #endif - - s3c_init_vic_timer_irq(5, IRQ_TIMER0); } diff --git a/drivers/clocksource/samsung-time.c b/drivers/clocksource/samsung-time.c index 3af3054..19a1c8a 100644 --- a/drivers/clocksource/samsung-time.c +++ b/drivers/clocksource/samsung-time.c @@ -355,6 +355,11 @@ static irqreturn_t samsung_clock_event_isr(int irq, void *dev_id) { struct clock_event_device *evt = dev_id; + if (timer_variant.has_tint_cstat) { + u32 mask = (1 << timer_source.event_id); + writel(mask | (mask << 5), S3C64XX_TINT_CSTAT); + } + evt->event_handler(evt); return IRQ_HANDLED; @@ -390,6 +395,11 @@ static void __init samsung_clockevent_init(void) irq_number = timer_variant.irqs[timer_source.event_id]; setup_irq(irq_number, &samsung_clock_event_irq); + + if (timer_variant.has_tint_cstat) { + u32 mask = (1 << timer_source.event_id); + writel(mask | (mask << 5), S3C64XX_TINT_CSTAT); + } } static void __iomem *samsung_timer_reg(void) diff --git a/include/linux/samsung-time.h b/include/linux/samsung-time.h index 8d8ffe8..45cf87b 100644 --- a/include/linux/samsung-time.h +++ b/include/linux/samsung-time.h @@ -33,6 +33,7 @@ struct samsung_timer_variant { int bits; u16 prescale; u16 divisor; + bool has_tint_cstat; }; extern void __init samsung_set_timer_source(enum samsung_timer_mode event,