From patchwork Sat May 26 07:20:08 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 161453 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 564BBB6FA0 for ; Sat, 26 May 2012 17:20:25 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751389Ab2EZHUX (ORCPT ); Sat, 26 May 2012 03:20:23 -0400 Received: from smtp.snhosting.dk ([87.238.248.203]:44801 "EHLO smtp.domainteam.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751195Ab2EZHUV (ORCPT ); Sat, 26 May 2012 03:20:21 -0400 Received: from localhost.localdomain (unknown [188.228.89.252]) by smtp.domainteam.dk (Postfix) with ESMTPA id CB8EFF1C38; Sat, 26 May 2012 09:20:20 +0200 (CEST) From: Sam Ravnborg To: "David S. Miller" Cc: sparclinux , Daniel Hellstrom , Konrad Eisele , Sam Ravnborg Subject: [PATCH 04/15] sparc32: introduce sparc32_start_kernel called from head_32.S Date: Sat, 26 May 2012 09:20:08 +0200 Message-Id: <1338016819-22245-4-git-send-email-sam@ravnborg.org> X-Mailer: git-send-email 1.6.0.6 In-Reply-To: <20120526071749.GA22144@merkur.ravnborg.org> References: <20120526071749.GA22144@merkur.ravnborg.org> Sender: sparclinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: sparclinux@vger.kernel.org This gives us a C hook before we call start_kernel() Signed-off-by: Sam Ravnborg --- arch/sparc/kernel/head_32.S | 10 ++-------- arch/sparc/kernel/kernel.h | 3 +++ arch/sparc/kernel/setup_32.c | 10 ++++++++++ 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/arch/sparc/kernel/head_32.S b/arch/sparc/kernel/head_32.S index f22a729..6c6b8c2 100644 --- a/arch/sparc/kernel/head_32.S +++ b/arch/sparc/kernel/head_32.S @@ -661,16 +661,10 @@ continue_boot: wr %g3, PSR_ET, %psr WRITE_PAUSE - /* First we call prom_init() to set up PROMLIB, then - * off to start_kernel(). - */ - + /* Call sparc32_start_kernel(struct linux_romvec *rp) */ sethi %hi(prom_vector_p), %g5 ld [%g5 + %lo(prom_vector_p)], %o0 - call prom_init - nop - - call start_kernel + call sparc32_start_kernel nop /* We should not get here. */ diff --git a/arch/sparc/kernel/kernel.h b/arch/sparc/kernel/kernel.h index a86372d..291bb5d 100644 --- a/arch/sparc/kernel/kernel.h +++ b/arch/sparc/kernel/kernel.h @@ -26,6 +26,9 @@ static inline unsigned long kimage_addr_to_ra(const char *p) #endif #ifdef CONFIG_SPARC32 +/* setup_32.c */ +void sparc32_start_kernel(struct linux_romvec *rp); + /* cpu.c */ extern void cpu_probe(void); diff --git a/arch/sparc/kernel/setup_32.c b/arch/sparc/kernel/setup_32.c index c052313..68dd63d 100644 --- a/arch/sparc/kernel/setup_32.c +++ b/arch/sparc/kernel/setup_32.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -244,6 +245,15 @@ struct tt_entry *sparc_ttable; struct pt_regs fake_swapper_regs; +/* Called from head_32.S - before we have setup anything + * in the kernel. Be very careful with what you do here. + */ +void __init sparc32_start_kernel(struct linux_romvec *rp) +{ + prom_init(rp); + start_kernel(); +} + void __init setup_arch(char **cmdline_p) { int i;