From patchwork Fri Jun 21 00:35:20 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 2759511 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5C94AC0AB1 for ; Fri, 21 Jun 2013 00:39:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 74C552020D for ; Fri, 21 Jun 2013 00:39:32 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 328CA20202 for ; Fri, 21 Jun 2013 00:39:31 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UppM2-0000jD-Ch; Fri, 21 Jun 2013 00:37:32 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UppLY-0004tW-B6; Fri, 21 Jun 2013 00:37:00 +0000 Received: from mail-ea0-x22b.google.com ([2a00:1450:4013:c01::22b]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UppKn-0004nP-SS for linux-arm-kernel@lists.infradead.org; Fri, 21 Jun 2013 00:36:15 +0000 Received: by mail-ea0-f171.google.com with SMTP id m14so4312151eaj.2 for ; Thu, 20 Jun 2013 17:35:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=3Sk4y1d5xyRsQC1OxYOM4Q3H83ktGnt6pYps9TMGXJk=; b=wKkD+1CnKU7BZZeeUdZOoEdrhj1+7YzFZCnMNI7JIyOLmHFiC4COjAh1rMMJ/7oJHL OS1srzNaZK42W6Tv6AWlvjX2t+1zFqNk/EtE+4ENJwQhaX0vg7nTH0cXkAuFJ2QKbta6 3qVFn4VgAo0eq2ZpkM0+y++Vf0Wg2fjVDoYFfbXELmy7O70isAqKrO1GZfF/fUf0q5n7 rUO1j169pmQyiB9kQGxNb2YXGTv4pbVoD+RkhUwdt0jsBDihDx9rEx6f+8+H9XPucXD8 Dd+u+6rmvcW09v6zOdCN2h7ZpCsbXEYyJUFROVfrImlWRxaD3UKVkl+FWzicibHNEpPS SuQg== X-Received: by 10.14.105.66 with SMTP id j42mr9801670eeg.126.1371774951902; Thu, 20 Jun 2013 17:35:51 -0700 (PDT) Received: from flatron.tomeq (87-207-52-162.dynamic.chello.pl. [87.207.52.162]) by mx.google.com with ESMTPSA id m1sm3910115eex.17.2013.06.20.17.35.49 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Jun 2013 17:35:51 -0700 (PDT) From: Tomasz Figa To: linux-samsung-soc@vger.kernel.org Subject: [PATCH v6 4/8] ARM: Add .init_platform() callback to machine descriptor Date: Fri, 21 Jun 2013 02:35:20 +0200 Message-Id: <1371774924-9224-5-git-send-email-tomasz.figa@gmail.com> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1371774924-9224-1-git-send-email-tomasz.figa@gmail.com> References: <1371774924-9224-1-git-send-email-tomasz.figa@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130620_203614_098390_36187FA9 X-CRM114-Status: GOOD ( 14.74 ) X-Spam-Score: -2.0 (--) Cc: Kukjin Kim , Russell King , Jason Cooper , Arnd Bergmann , Nicolas Pitre , Marc Zyngier , devicetree-discuss@lists.ozlabs.org, Stephen Warren , Will Deacon , linux-kernel@vger.kernel.org, Rob Herring , Tomasz Figa , Grant Likely , Mark Brown , Olof Johansson , Benoit Cousson , Thomas Gleixner , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable 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 Most ARM platforms have parts that should be initialized as early as possible, which usually means as soon as memory management (kmalloc, ioremap) starts to work, However, currently there is no appropriate callback in machine_desc struct to use for such initialization and platforms tend to stuff things up .init_irq() and .init_time() callbacks. Since all the DT-based platforms are going towards generic IRQ and time initialization (using irqchip_init and clocksource_of_init) and current code assumes that if custom callbacks are not provided in machine_desc then generic ones should be used, this problem has become a bit more inconvenient. This patch tries to solve this issue by introducing new callback called .init_platform(), where any custom low level initialization of platform can be done safely. Signed-off-by: Tomasz Figa --- arch/arm/include/asm/mach/arch.h | 1 + arch/arm/kernel/irq.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/arch/arm/include/asm/mach/arch.h b/arch/arm/include/asm/mach/arch.h index 308ad7d..b2f4d11 100644 --- a/arch/arm/include/asm/mach/arch.h +++ b/arch/arm/include/asm/mach/arch.h @@ -46,6 +46,7 @@ struct machine_desc { void (*reserve)(void);/* reserve mem blocks */ void (*map_io)(void);/* IO mapping function */ void (*init_early)(void); + void (*init_platform)(void); void (*init_irq)(void); void (*init_time)(void); void (*init_machine)(void); diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c index 9723d17..61e2000 100644 --- a/arch/arm/kernel/irq.c +++ b/arch/arm/kernel/irq.c @@ -115,6 +115,9 @@ EXPORT_SYMBOL_GPL(set_irq_flags); void __init init_IRQ(void) { + if (machine_desc->init_platform) + machine_desc->init_platform(); + if (IS_ENABLED(CONFIG_OF) && !machine_desc->init_irq) irqchip_init(); else