From patchwork Fri Dec 10 05:58:53 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 397312 X-Patchwork-Delegate: lethal@linux-sh.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oBA5tXXe016888 for ; Fri, 10 Dec 2010 05:55:33 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751016Ab0LJFzX (ORCPT ); Fri, 10 Dec 2010 00:55:23 -0500 Received: from mail-px0-f179.google.com ([209.85.212.179]:48977 "EHLO mail-px0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751291Ab0LJFzU (ORCPT ); Fri, 10 Dec 2010 00:55:20 -0500 Received: by mail-px0-f179.google.com with SMTP id 20so956966pxi.10 for ; Thu, 09 Dec 2010 21:55:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:date:message-id :in-reply-to:references:subject; bh=kqDZfvB/cpp3vPAk5hJE2uVbsBDS/gPsuAkUhg6h2fs=; b=mMptE9lAnKXvpcWih9TFV1o6mWk27NHI1qS28+ZoDQOjtxqDbm+zedO32SN7xKK5m+ PqJWsDG/uPQuZwt96C02dU34HV6mHMs1ziE3Qxm+l9n1CJgq8EY0Ro41ODnWF1/Di3pf +0xpI0/6pHNrlkECp1tMoCk9T5l1J57bvh1lE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:in-reply-to:references:subject; b=rBV9KpU6h1ze4H/PsPKv1ZbD8F/9oQGBO02bbaozqUXu9otMxmxU388d5ZKExtkFGz tCHEDmgTBxAVkzNUGwWtn2cSIPsACqxQZ7a3HcGzWG1ktKu777juRILL273y4v2E95lQ 1tNRGFolQqmG6SzE2LdCdsLSQvZHV8IgfCzTY= Received: by 10.142.163.1 with SMTP id l1mr201453wfe.236.1291960520179; Thu, 09 Dec 2010 21:55:20 -0800 (PST) Received: from [127.0.0.1] (210.253.155.90.customerlink.pwd.ne.jp [210.253.155.90]) by mx.google.com with ESMTPS id w42sm3516415wfh.3.2010.12.09.21.55.17 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 09 Dec 2010 21:55:18 -0800 (PST) From: Magnus Damm To: linux@arm.linux.org.uk Cc: Magnus Damm , eric.y.miao@gmail.com, linux-arm-kernel@lists.infradead.org, linux-sh@vger.kernel.org Date: Fri, 10 Dec 2010 14:58:53 +0900 Message-Id: <20101210055853.8635.83051.sendpatchset@t400s> In-Reply-To: <20101210055835.8635.98614.sendpatchset@t400s> References: <20101210055835.8635.98614.sendpatchset@t400s> Subject: [PATCH 02/02][RFC] ARM: shmobile: Use Subarch IRQ handler for INTC Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Fri, 10 Dec 2010 05:55:33 +0000 (UTC) --- 0001/arch/arm/mach-shmobile/Kconfig +++ work/arch/arm/mach-shmobile/Kconfig 2010-12-09 23:15:46.000000000 +0900 @@ -9,6 +9,7 @@ config ARCH_SH7367 select CLKDEV_LOOKUP select SH_CLK_CPG select GENERIC_CLOCKEVENTS + select MULTI_IRQ_HANDLER config ARCH_SH7377 bool "SH-Mobile G4 (SH7377)" @@ -17,6 +18,7 @@ config ARCH_SH7377 select CLKDEV_LOOKUP select SH_CLK_CPG select GENERIC_CLOCKEVENTS + select MULTI_IRQ_HANDLER config ARCH_SH7372 bool "SH-Mobile AP4 (SH7372)" @@ -25,6 +27,7 @@ config ARCH_SH7372 select CLKDEV_LOOKUP select SH_CLK_CPG select GENERIC_CLOCKEVENTS + select MULTI_IRQ_HANDLER comment "SH-Mobile Board Type" --- 0001/arch/arm/mach-shmobile/Makefile +++ work/arch/arm/mach-shmobile/Makefile 2010-12-09 23:15:46.000000000 +0900 @@ -6,9 +6,15 @@ obj-y := timer.o console.o clock.o pm_runtime.o # CPU objects -obj-$(CONFIG_ARCH_SH7367) += setup-sh7367.o clock-sh7367.o intc-sh7367.o -obj-$(CONFIG_ARCH_SH7377) += setup-sh7377.o clock-sh7377.o intc-sh7377.o -obj-$(CONFIG_ARCH_SH7372) += setup-sh7372.o clock-sh7372.o intc-sh7372.o +obj-$(CONFIG_ARCH_SH7367) += setup-sh7367.o clock-sh7367.o +obj-$(CONFIG_ARCH_SH7377) += setup-sh7377.o clock-sh7377.o +obj-$(CONFIG_ARCH_SH7372) += setup-sh7372.o clock-sh7372.o + +# IRQ objects +irq-$(CONFIG_ARCH_SH7367) += intc-sh7367.o entry-intc.o +irq-$(CONFIG_ARCH_SH7377) += intc-sh7377.o entry-intc.o +irq-$(CONFIG_ARCH_SH7372) += intc-sh7372.o entry-intc.o +obj-y += $(irq-y) # Pinmux setup pfc-$(CONFIG_ARCH_SH7367) := pfc-sh7367.o --- 0001/arch/arm/mach-shmobile/board-ap4evb.c +++ work/arch/arm/mach-shmobile/board-ap4evb.c 2010-12-09 23:15:46.000000000 +0900 @@ -1356,6 +1356,7 @@ static struct sys_timer ap4evb_timer = { MACHINE_START(AP4EVB, "ap4evb") .map_io = ap4evb_map_io, .init_irq = sh7372_init_irq, + .handle_irq = shmobile_handle_irq_intc, .init_machine = ap4evb_init, .timer = &ap4evb_timer, MACHINE_END --- 0001/arch/arm/mach-shmobile/board-g3evm.c +++ work/arch/arm/mach-shmobile/board-g3evm.c 2010-12-09 23:15:46.000000000 +0900 @@ -367,6 +367,7 @@ static struct sys_timer g3evm_timer = { MACHINE_START(G3EVM, "g3evm") .map_io = g3evm_map_io, .init_irq = sh7367_init_irq, + .handle_irq = shmobile_handle_irq_intc, .init_machine = g3evm_init, .timer = &g3evm_timer, MACHINE_END --- 0001/arch/arm/mach-shmobile/board-g4evm.c +++ work/arch/arm/mach-shmobile/board-g4evm.c 2010-12-09 23:15:46.000000000 +0900 @@ -394,6 +394,7 @@ static struct sys_timer g4evm_timer = { MACHINE_START(G4EVM, "g4evm") .map_io = g4evm_map_io, .init_irq = sh7377_init_irq, + .handle_irq = shmobile_handle_irq_intc, .init_machine = g4evm_init, .timer = &g4evm_timer, MACHINE_END --- /dev/null +++ work/arch/arm/mach-shmobile/entry-intc.S 2010-12-09 23:20:52.000000000 +0900 @@ -0,0 +1,30 @@ +/* + * ARM Interrupt demux handler using INTC + * + * Copyright (C) 2010 Magnus Damm + * Copyright (C) 2008 Renesas Solutions Corp. + * + * This file is licensed under the terms of the GNU General Public + * License version 2. This program is licensed "as is" without any + * warranty of any kind, whether express or implied. + */ + +#include + +#define INTFLGA 0xe6980018 + + .macro get_irqnr_preamble, base, tmp + ldr \base, =INTFLGA + .endm + + .macro get_irqnr_and_base, irqnr, irqstat, base, tmp + ldr \irqnr, [\base] + cmp \irqnr, #0 + beq 1000f + /* intevt to irq number */ + lsr \irqnr, \irqnr, #0x5 + subs \irqnr, \irqnr, #16 +1000: + .endm + + arch_irq_handler shmobile_handle_irq_intc --- 0001/arch/arm/mach-shmobile/include/mach/common.h +++ work/arch/arm/mach-shmobile/include/mach/common.h 2010-12-09 23:15:46.000000000 +0900 @@ -5,6 +5,7 @@ extern struct sys_timer shmobile_timer; extern void shmobile_setup_console(void); struct clk; extern int clk_init(void); +extern void shmobile_handle_irq_intc(struct pt_regs *); extern void sh7367_init_irq(void); extern void sh7367_add_early_devices(void); --- 0001/arch/arm/mach-shmobile/include/mach/entry-macro.S +++ work/arch/arm/mach-shmobile/include/mach/entry-macro.S 2010-12-09 23:15:46.000000000 +0900 @@ -1,39 +1,12 @@ -/* - * Copyright (C) 2008 Renesas Solutions Corp. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ -#include -#include .macro disable_fiq .endm .macro get_irqnr_preamble, base, tmp - ldr \base, =INTFLGA .endm .macro arch_ret_to_user, tmp1, tmp2 .endm .macro get_irqnr_and_base, irqnr, irqstat, base, tmp - ldr \irqnr, [\base] - cmp \irqnr, #0 - beq 1000f - /* intevt to irq number */ - lsr \irqnr, \irqnr, #0x5 - subs \irqnr, \irqnr, #16 - -1000: .endm --- 0001/arch/arm/mach-shmobile/include/mach/hardware.h +++ work/arch/arm/mach-shmobile/include/mach/hardware.h 2010-12-09 23:18:37.000000000 +0900 @@ -1,7 +1,4 @@ #ifndef __ASM_MACH_HARDWARE_H #define __ASM_MACH_HARDWARE_H -/* INTFLGA register - used by low level interrupt code in entry-macro.S */ -#define INTFLGA 0xe6980018 - #endif /* __ASM_MACH_HARDWARE_H */