aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68k/coldfire
diff options
context:
space:
mode:
authorGreg Ungerer <gerg@linux-m68k.org>2016-08-23 02:29:43 -0400
committerGreg Ungerer <gerg@linux-m68k.org>2016-09-25 22:02:57 -0400
commitbc065e4784beefdead3e62c31fa5ff7fbb1d7f9e (patch)
treec2631da8353074c2e9a295fe1523ca83cb8e2822 /arch/m68k/coldfire
parent08895a8b6b06ed2323cd97a36ee40a116b3db8ed (diff)
m68knommu: fix early setup to not access variables
The early setup code for the ColdFire 53xx platform accesses variables before the RAM and other system initialization steps may have taken place. Currently it has 2 global variables that will end up in the bss section that are accessed during this early setup. There is a special static RAM stack setup at this time, but not necessarily the RAM where kernel data sections will end up. Even on system setups where RAM is setup by a boot loader the access to the early setup variables is before the BSS section has been initialized. This can potentially corrupt a ram loaded root filesystem that sits in that memory area before it has been moved. These 2 variables are not used at all after being set, and can just be removed. Reported-by: Christian Gieseler <christiangieseler@yahoo.de> Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
Diffstat (limited to 'arch/m68k/coldfire')
-rw-r--r--arch/m68k/coldfire/m53xx.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/arch/m68k/coldfire/m53xx.c b/arch/m68k/coldfire/m53xx.c
index 80879a7fe3d5..2502f63960bc 100644
--- a/arch/m68k/coldfire/m53xx.c
+++ b/arch/m68k/coldfire/m53xx.c
@@ -271,9 +271,6 @@ void __init config_BSP(char *commandp, int size)
271 271
272#define NAND_FLASH_ADDRESS (0xD0000000) 272#define NAND_FLASH_ADDRESS (0xD0000000)
273 273
274int sys_clk_khz = 0;
275int sys_clk_mhz = 0;
276
277void wtm_init(void); 274void wtm_init(void);
278void scm_init(void); 275void scm_init(void);
279void gpio_init(void); 276void gpio_init(void);
@@ -286,9 +283,8 @@ int get_sys_clock (void);
286 283
287asmlinkage void __init sysinit(void) 284asmlinkage void __init sysinit(void)
288{ 285{
289 sys_clk_khz = clock_pll(0, 0); 286 clock_pll(0, 0);
290 sys_clk_mhz = sys_clk_khz/1000; 287
291
292 wtm_init(); 288 wtm_init();
293 scm_init(); 289 scm_init();
294 gpio_init(); 290 gpio_init();