ARM omap3: move board_init to pure_initcall
board_init initializes the mux and sdram. For both there is no need to configure this so early. Move the code to a pure_initcall and remove the surrounding unneeded code. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Tested-by: Sanjeev Premi <premi@ti.com>
This commit is contained in:
parent
af24f306bf
commit
0adce7ec68
|
@ -74,7 +74,6 @@
|
|||
#include <linux/err.h>
|
||||
#include <usb/ehci.h>
|
||||
#include <mach/xload.h>
|
||||
#include <mach/board.h>
|
||||
|
||||
/******************** Board Boot Time *******************/
|
||||
|
||||
|
@ -221,7 +220,7 @@ static void mux_config(void)
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
void omap3_board_init(void)
|
||||
static int beagle_board_init(void)
|
||||
{
|
||||
int in_sdram = running_in_sdram();
|
||||
|
||||
|
@ -229,7 +228,10 @@ void omap3_board_init(void)
|
|||
/* Dont reconfigure SDRAM while running in SDRAM! */
|
||||
if (!in_sdram)
|
||||
sdrc_init();
|
||||
|
||||
return 0;
|
||||
}
|
||||
pure_initcall(beagle_board_init);
|
||||
|
||||
/******************** Board Run Time *******************/
|
||||
|
||||
|
|
|
@ -77,13 +77,16 @@ static void mux_config(void);
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
void omap3_board_init(void)
|
||||
static int sdp343x_board_init(void)
|
||||
{
|
||||
int in_sdram = running_in_sdram();
|
||||
mux_config();
|
||||
if (!in_sdram)
|
||||
sdrc_init();
|
||||
|
||||
return 0;
|
||||
}
|
||||
pure_initcall(sdp343x_board_init);
|
||||
|
||||
/**
|
||||
* @brief Do the SDRC initialization for 128Meg Infenion DDR for CS0
|
||||
|
|
|
@ -196,15 +196,19 @@ static void mux_config(void)
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
void omap3_board_init(void)
|
||||
static int omap3_evm_board_init(void)
|
||||
{
|
||||
int in_sdram = running_in_sdram();
|
||||
|
||||
mux_config();
|
||||
|
||||
/* Dont reconfigure SDRAM while running in SDRAM! */
|
||||
if (!in_sdram)
|
||||
sdrc_init();
|
||||
|
||||
return 0;
|
||||
}
|
||||
pure_initcall(omap3_evm_board_init);
|
||||
|
||||
/*
|
||||
* Run-time initialization(s)
|
||||
|
|
|
@ -108,7 +108,6 @@ choice
|
|||
|
||||
config MACH_OMAP343xSDP
|
||||
bool "Texas Instrument's SDP343x"
|
||||
select MACH_HAS_LOWLEVEL_INIT
|
||||
select OMAP_CLOCK_ALL
|
||||
select HAS_OMAP_NAND
|
||||
depends on ARCH_OMAP3
|
||||
|
@ -117,7 +116,6 @@ config MACH_OMAP343xSDP
|
|||
|
||||
config MACH_BEAGLE
|
||||
bool "Texas Instrument's Beagle Board"
|
||||
select MACH_HAS_LOWLEVEL_INIT
|
||||
select OMAP_CLOCK_ALL
|
||||
select HAVE_NOSHELL
|
||||
select HAS_OMAP_NAND
|
||||
|
@ -127,7 +125,6 @@ config MACH_BEAGLE
|
|||
|
||||
config MACH_OMAP3EVM
|
||||
bool "Texas Instrument's OMAP3 EVM"
|
||||
select MACH_HAS_LOWLEVEL_INIT
|
||||
select OMAP_CLOCK_ALL
|
||||
select HAVE_NOSHELL
|
||||
select HAS_OMAP_NAND
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
# MA 02111-1307 USA
|
||||
#
|
||||
obj-$(CONFIG_ARCH_OMAP) += syslib.o
|
||||
obj-$(CONFIG_OMAP3_LOWLEVEL_INIT) += omap3_platform.o
|
||||
obj-$(CONFIG_OMAP_CLOCK_SOURCE_S32K) += s32k_clksource.o
|
||||
obj-$(CONFIG_ARCH_OMAP3) += omap3_core.o omap3_generic.o
|
||||
obj-$(CONFIG_ARCH_OMAP4) += omap4_generic.o omap4_clock.o
|
||||
|
|
|
@ -1,35 +0,0 @@
|
|||
/**
|
||||
* @file
|
||||
* @brief exported generic APIs which various board files implement
|
||||
*
|
||||
* FileName: arch/arm/boards/omap/board.h
|
||||
*
|
||||
* This file will not contain any board specific implementations.
|
||||
*/
|
||||
/*
|
||||
* (C) Copyright 2008
|
||||
* Texas Instruments, <www.ti.com>
|
||||
* Raghavendra KH <r-khandenahally@ti.com>
|
||||
*
|
||||
* 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; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* 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., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
#ifndef __BOARD_OMAP_H_
|
||||
#define __BOARD_OMAP_H_
|
||||
|
||||
/** Generic Board initialization called from platform.S */
|
||||
void omap3_board_init(void);
|
||||
|
||||
#endif /* __BOARD_OMAP_H_ */
|
|
@ -1,65 +0,0 @@
|
|||
/**
|
||||
* @file
|
||||
* @brief Wrapper to call board level initialization routine
|
||||
*
|
||||
* FileName: arch/arm/boards/omap/platform.S
|
||||
*
|
||||
* board_init_lowlevel is defined here. This calls board_init which
|
||||
* is linked to the binary - the board_init only has a SRAM stack.
|
||||
* so it needs to be careful about the usage of global variables
|
||||
* and the likes. Enabled only if CONFIG_MACH_DO_LOWLEVEL_INIT is
|
||||
* defined
|
||||
*/
|
||||
/*
|
||||
* (C) Copyright 2006-2008
|
||||
* Texas Instruments, <www.ti.com>
|
||||
* Nishanth Menon <x0nishan@ti.com>
|
||||
*
|
||||
* 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; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* 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., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include <mach/silicon.h>
|
||||
|
||||
#ifdef CONFIG_MACH_DO_LOWLEVEL_INIT
|
||||
/**
|
||||
* @fn void board_init_lowlevel(void)
|
||||
*
|
||||
* @brief This provides a assembly wrapper setting up SRAM before calling
|
||||
* board_init
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
.globl board_init_lowlevel
|
||||
board_init_lowlevel:
|
||||
/* Setup a temporary stack so that we can call C functions
|
||||
* Yes. this might have been already done by arch code.
|
||||
* No harm in being a bit redundant to avoid future complications
|
||||
*/
|
||||
ldr sp, SRAM_STACK
|
||||
str ip, [sp] /* stash old link register */
|
||||
str lr, [sp] /* stash current link register */
|
||||
mov ip, lr /* save link reg across call */
|
||||
/* Do the pin muxes, sdram init etc..board-xxx.c */
|
||||
bl omap3_board_init
|
||||
ldr lr, [sp] /* restore current link register */
|
||||
ldr ip, [sp] /* restore save ip */
|
||||
/* back to arch calling code */
|
||||
mov pc, lr
|
||||
SRAM_STACK:
|
||||
.word OMAP_SRAM_STACK
|
||||
|
||||
#endif /* CONFIG_MACH_DO_LOWLEVEL_INIT */
|
Loading…
Reference in New Issue