From patchwork Wed Jan 28 12:46:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 5734621 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CA4F89F3CB for ; Thu, 29 Jan 2015 02:13:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EB495201EC for ; Thu, 29 Jan 2015 02:13:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 122B8201BB for ; Thu, 29 Jan 2015 02:13:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756900AbbA2CNu (ORCPT ); Wed, 28 Jan 2015 21:13:50 -0500 Received: from mail-pa0-f53.google.com ([209.85.220.53]:37942 "EHLO mail-pa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756874AbbA2CNt (ORCPT ); Wed, 28 Jan 2015 21:13:49 -0500 Received: by mail-pa0-f53.google.com with SMTP id kx10so32605993pab.12 for ; Wed, 28 Jan 2015 18:13:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:date:message-id:subject; bh=eQVwGA5+imXzfJh4UCudAR4WIZISXuYvSZpLXW6Hgqw=; b=jSkn9KSlJHDHXCvXSkM1fneFeUxkg8ukQWv7RMrOjjgriOeRbKCvOwDsshOHmK5IBj EX5/xm0ZpSI1PGG86IM8RjAXyZNfZHwQ87CmeSespHAJIHSZMLYUg+3cjph5KlGxx2fR IBFvP+ZFZK6+/l2QqtosyCCJiZGm7q9c+ULQcZIoX8fKzfN7BT3YehkIdIv09taLdFq1 xgiz5TaDId4PFl1AC83FVzqska0CeIReipmbMIsQ4cQwrW6KjcozoEzp73oUhK+FzwrO A9xmJ6Qs86jX9I5FlvrBgfTPRol3/CN5gqX1Jb44r0ydDHdFf8P6yPsF65kFnxJtyFNz 6qPw== X-Received: by 10.70.37.166 with SMTP id z6mr5319084pdj.89.1422448833584; Wed, 28 Jan 2015 04:40:33 -0800 (PST) Received: from [127.0.0.1] (s214090.ppp.asahi-net.or.jp. [220.157.214.90]) by mx.google.com with ESMTPSA id j8sm4612669pdo.79.2015.01.28.04.40.30 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Jan 2015 04:40:32 -0800 (PST) From: Magnus Damm To: linux-sh@vger.kernel.org Cc: geert+renesas@glider.be, arnd@arndb.de, marc.zyngier@arm.com, horms@verge.net.au, olof@lixom.net, Magnus Damm Date: Wed, 28 Jan 2015 21:46:45 +0900 Message-Id: <20150128124645.21199.99590.sendpatchset@little-apple> Subject: [PATCH v2] ARM: shmobile: r8a73a4: Instantiate GIC from C board code in legacy builds Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Magnus Damm As of commit 9a1091ef0017c40a ("irqchip: gic: Support hierarchy irq domain."), the APE6EVM legacy board support is known to be broken. The IRQ numbers of the GIC are now virtual, and no longer match the hardcoded hardware IRQ numbers in the legacy platform board code. To fix this issue specific to non-muliplatform r8a73a4 and APE6EVM: 1) Instantiate the GIC from platform board code and also 2) Skip over the DT arch timer as well as 3) Force delay setup based on DT CPU frequency With these 3 fixes in place interrupts on APE6EVM are now unbroken. Partially based on legacy GIC fix by Geert Uytterhoeven, thanks to him for the initial work. Signed-off-by: Magnus Damm --- Suitable as a fix for v3.19-rc6. Initially developed on top of v3.19-rc6 but also seems to apply cleanly to the renesas git repo with tag renesas-devel-20150128-v3.19-rc6. arch/arm/mach-shmobile/board-ape6evm.c | 20 ++++++++++++++++++++ arch/arm/mach-shmobile/timer.c | 7 +++++++ 2 files changed, 27 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- 0001/arch/arm/mach-shmobile/board-ape6evm.c +++ work/arch/arm/mach-shmobile/board-ape6evm.c 2015-01-28 21:31:40.635267889 +0900 @@ -18,6 +18,8 @@ #include #include #include +#include +#include #include #include #include @@ -273,6 +275,22 @@ static void __init ape6evm_add_standard_ sizeof(ape6evm_leds_pdata)); } +static void __init ape6evm_legacy_init_time(void) +{ + /* Do not invoke DT-based timers via clocksource_of_init() */ +} + +static void __init ape6evm_legacy_init_irq(void) +{ + void __iomem *gic_dist_base = ioremap_nocache(0xf1001000, 0x1000); + void __iomem *gic_cpu_base = ioremap_nocache(0xf1002000, 0x1000); + + gic_init(0, 29, gic_dist_base, gic_cpu_base); + + /* Do not invoke DT-based interrupt code via irqchip_init() */ +} + + static const char *ape6evm_boards_compat_dt[] __initdata = { "renesas,ape6evm", NULL, @@ -280,7 +298,9 @@ static const char *ape6evm_boards_compat DT_MACHINE_START(APE6EVM_DT, "ape6evm") .init_early = shmobile_init_delay, + .init_irq = ape6evm_legacy_init_irq, .init_machine = ape6evm_add_standard_devices, .init_late = shmobile_init_late, .dt_compat = ape6evm_boards_compat_dt, + .init_time = ape6evm_legacy_init_time, MACHINE_END --- 0001/arch/arm/mach-shmobile/timer.c +++ work/arch/arm/mach-shmobile/timer.c 2015-01-28 21:19:39.455270480 +0900 @@ -70,6 +70,13 @@ void __init shmobile_init_delay(void) if (!max_freq) return; +#ifdef CONFIG_ARCH_SHMOBILE_LEGACY + /* Non-multiplatform r8a73a4 SoC cannot use arch timer due + * to GIC being initialized from C and arch timer via DT */ + if (of_machine_is_compatible("renesas,r8a73a4")) + has_arch_timer = false; +#endif + if (!has_arch_timer || !IS_ENABLED(CONFIG_ARM_ARCH_TIMER)) { if (is_a7_a8_a9) shmobile_setup_delay_hz(max_freq, 1, 3);