From f82e0a0c67621df83458753aef580a3508d5428e Mon Sep 17 00:00:00 2001 From: Graf Yang Date: Wed, 8 Apr 2009 08:30:22 +0000 Subject: Blackfin: fix link failure due to CONFIG_EXCEPTION_L1_SCRATCH Move exception stack mess from entry.S to init.c to fix link failure when CONFIG_EXCEPTION_L1_SCRATCH is in use. Signed-off-by: Graf Yang Signed-off-by: Mike Frysinger Signed-off-by: Bryan Wu --- arch/blackfin/mm/init.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'arch/blackfin/mm/init.c') diff --git a/arch/blackfin/mm/init.c b/arch/blackfin/mm/init.c index 9c3629b9a689..00543c813f4a 100644 --- a/arch/blackfin/mm/init.c +++ b/arch/blackfin/mm/init.c @@ -52,9 +52,14 @@ static unsigned long empty_bad_page_table; static unsigned long empty_bad_page; -unsigned long empty_zero_page; +static unsigned long empty_zero_page; -extern unsigned long exception_stack[NR_CPUS][1024]; +#ifndef CONFIG_EXCEPTION_L1_SCRATCH +#if defined CONFIG_SYSCALL_TAB_L1 +__attribute__((l1_data)) +#endif +static unsigned long exception_stack[NR_CPUS][1024]; +#endif struct blackfin_pda cpu_pda[NR_CPUS]; EXPORT_SYMBOL(cpu_pda); @@ -117,7 +122,12 @@ asmlinkage void __init init_pda(void) cpu_pda[0].next = &cpu_pda[1]; cpu_pda[1].next = &cpu_pda[0]; +#ifdef CONFIG_EXCEPTION_L1_SCRATCH + cpu_pda[cpu].ex_stack = (unsigned long *)(L1_SCRATCH_START + \ + L1_SCRATCH_LENGTH); +#else cpu_pda[cpu].ex_stack = exception_stack[cpu + 1]; +#endif #ifdef CONFIG_SMP cpu_pda[cpu].imask = 0x1f; -- cgit v1.2.3 From d1800fe0e50ed22673cd895f2b0a7c2b79d3010a Mon Sep 17 00:00:00 2001 From: Graf Yang Date: Mon, 25 May 2009 04:27:22 +0000 Subject: Blackfin: drop unused reserve_pda() function The Per-processor Data Area isn't actually reserved by this function, and all it ended up doing was issuing a printk(), so punt it. Signed-off-by: Graf Yang Signed-off-by: Mike Frysinger --- arch/blackfin/include/asm/pda.h | 2 -- arch/blackfin/mach-common/smp.c | 3 --- arch/blackfin/mm/init.c | 10 ---------- 3 files changed, 15 deletions(-) (limited to 'arch/blackfin/mm/init.c') diff --git a/arch/blackfin/include/asm/pda.h b/arch/blackfin/include/asm/pda.h index a67142740df0..b42555c1431c 100644 --- a/arch/blackfin/include/asm/pda.h +++ b/arch/blackfin/include/asm/pda.h @@ -64,8 +64,6 @@ struct blackfin_pda { /* Per-processor Data Area */ extern struct blackfin_pda cpu_pda[]; -void reserve_pda(void); - #endif /* __ASSEMBLY__ */ #endif /* _ASM_BLACKFIN_PDA_H */ diff --git a/arch/blackfin/mach-common/smp.c b/arch/blackfin/mach-common/smp.c index b6695957b065..3b8ebaee77f2 100644 --- a/arch/blackfin/mach-common/smp.c +++ b/arch/blackfin/mach-common/smp.c @@ -369,9 +369,6 @@ static void __cpuinit setup_secondary(unsigned int cpu) bfin_write_ILAT(ilat); CSYNC(); - /* Reserve the PDA space for the secondary CPU. */ - reserve_pda(); - /* Enable interrupt levels IVG7-15. IARs have been already * programmed by the boot CPU. */ bfin_irq_flags |= IMASK_IVG15 | diff --git a/arch/blackfin/mm/init.c b/arch/blackfin/mm/init.c index 00543c813f4a..9a62b300a396 100644 --- a/arch/blackfin/mm/init.c +++ b/arch/blackfin/mm/init.c @@ -134,12 +134,6 @@ asmlinkage void __init init_pda(void) #endif } -void __cpuinit reserve_pda(void) -{ - printk(KERN_INFO "PDA for CPU%u reserved at %p\n", smp_processor_id(), - &cpu_pda[smp_processor_id()]); -} - void __init mem_init(void) { unsigned int codek = 0, datak = 0, initk = 0; @@ -186,10 +180,6 @@ static int __init sram_init(void) /* Initialize the blackfin L1 Memory. */ bfin_sram_init(); - /* Reserve the PDA space for the boot CPU right after we - * initialized the scratch memory allocator. - */ - reserve_pda(); return 0; } pure_initcall(sram_init); -- cgit v1.2.3 From c72aa0794a0ecc0b87ba9d5546215c26c8c80668 Mon Sep 17 00:00:00 2001 From: Graf Yang Date: Mon, 25 May 2009 04:44:00 +0000 Subject: Blackfin: merge sram init functions Now that the sram_init() function exists only to call the bfin_sram_init() after the punting of the reserve_pda() function, simply merge the two to avoid pointless overhead. Signed-off-by: Graf Yang Signed-off-by: Mike Frysinger --- arch/blackfin/mm/blackfin_sram.h | 1 - arch/blackfin/mm/init.c | 9 --------- arch/blackfin/mm/sram-alloc.c | 5 ++++- 3 files changed, 4 insertions(+), 11 deletions(-) (limited to 'arch/blackfin/mm/init.c') diff --git a/arch/blackfin/mm/blackfin_sram.h b/arch/blackfin/mm/blackfin_sram.h index 8cb0945563f9..bc0062884fde 100644 --- a/arch/blackfin/mm/blackfin_sram.h +++ b/arch/blackfin/mm/blackfin_sram.h @@ -30,7 +30,6 @@ #ifndef __BLACKFIN_SRAM_H__ #define __BLACKFIN_SRAM_H__ -extern void bfin_sram_init(void); extern void *l1sram_alloc(size_t); #endif diff --git a/arch/blackfin/mm/init.c b/arch/blackfin/mm/init.c index 9a62b300a396..014a55abd09a 100644 --- a/arch/blackfin/mm/init.c +++ b/arch/blackfin/mm/init.c @@ -175,15 +175,6 @@ void __init mem_init(void) initk, codek, datak, DMA_UNCACHED_REGION >> 10, (reservedpages << (PAGE_SHIFT-10))); } -static int __init sram_init(void) -{ - /* Initialize the blackfin L1 Memory. */ - bfin_sram_init(); - - return 0; -} -pure_initcall(sram_init); - static void __init free_init_pages(const char *what, unsigned long begin, unsigned long end) { unsigned long addr; diff --git a/arch/blackfin/mm/sram-alloc.c b/arch/blackfin/mm/sram-alloc.c index 530d1393a232..36376d8418fa 100644 --- a/arch/blackfin/mm/sram-alloc.c +++ b/arch/blackfin/mm/sram-alloc.c @@ -223,7 +223,7 @@ static void __init l2_sram_init(void) spin_lock_init(&l2_sram_lock); } -void __init bfin_sram_init(void) +static int __init bfin_sram_init(void) { sram_piece_cache = kmem_cache_create("sram_piece_cache", sizeof(struct sram_piece), @@ -233,7 +233,10 @@ void __init bfin_sram_init(void) l1_data_sram_init(); l1_inst_sram_init(); l2_sram_init(); + + return 0; } +pure_initcall(bfin_sram_init); /* SRAM allocate function */ static void *_sram_alloc(size_t size, struct sram_piece *pfree_head, -- cgit v1.2.3