aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/mm/init.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-01-07 15:00:25 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-01-07 15:00:25 -0500
commit5bb47b9ff3d16d40f8d45380b373497a545fa280 (patch)
treee13dd34395473342dc75eff5cbaf5b1ea753631c /arch/blackfin/mm/init.c
parent2f2408a88cf8fa43febfd7fb5783e61b2937b0f9 (diff)
parent06af15e086e39a5a2a2413973a64af8e10122f28 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/blackfin-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/blackfin-2.6: (171 commits) Blackfin arch: fix bug - BF527 0.2 silicon has different CPUID (DSPID) value Blackfin arch: Enlarge flash partition for kenel for bf533/bf537 boards Blackfin arch: fix bug: kernel crash when enable SDIO host driver Blackfin arch: Print FP at level KERN_NOTICE Blackfin arch: drop ad73311 test code Blackfin arch: update board default configs Blackfin arch: Set PB4 as the default irq for bf548 board v1.4+. Blackfin arch: fix typo in early printk bit size processing Blackfin arch: enable reprogram cclk and sclk for bf518f-ezbrd Blackfin arch: add SDIO host driver platform data Blackfin arch: fix bug - kernel stops at initial console Blackfin arch: fix bug - kernel crash after config IP for ethernet port Blackfin arch: add sdh support for bf518f-ezbrd Blackfin arch: fix bug - kernel detects BF532 incorrectly Blackfin arch: add () to avoid warnings from gcc Blackfin arch: change HWTRACE Kconfig and set it on default Blackfin arch: Clean oprofile build path for blackfin Blackfin arch: remove hardware PM code, oprofile not use it Blackfin arch: rewrite get_sclk()/get_vco() Blackfin arch: cleanup and unify the ins functions ...
Diffstat (limited to 'arch/blackfin/mm/init.c')
-rw-r--r--arch/blackfin/mm/init.c50
1 files changed, 37 insertions, 13 deletions
diff --git a/arch/blackfin/mm/init.c b/arch/blackfin/mm/init.c
index bc240abb8745..d0532b72bba5 100644
--- a/arch/blackfin/mm/init.c
+++ b/arch/blackfin/mm/init.c
@@ -31,7 +31,8 @@
31#include <linux/bootmem.h> 31#include <linux/bootmem.h>
32#include <linux/uaccess.h> 32#include <linux/uaccess.h>
33#include <asm/bfin-global.h> 33#include <asm/bfin-global.h>
34#include <asm/l1layout.h> 34#include <asm/pda.h>
35#include <asm/cplbinit.h>
35#include "blackfin_sram.h" 36#include "blackfin_sram.h"
36 37
37/* 38/*
@@ -53,6 +54,11 @@ static unsigned long empty_bad_page;
53 54
54unsigned long empty_zero_page; 55unsigned long empty_zero_page;
55 56
57extern unsigned long exception_stack[NR_CPUS][1024];
58
59struct blackfin_pda cpu_pda[NR_CPUS];
60EXPORT_SYMBOL(cpu_pda);
61
56/* 62/*
57 * paging_init() continues the virtual memory environment setup which 63 * paging_init() continues the virtual memory environment setup which
58 * was begun by the code in arch/head.S. 64 * was begun by the code in arch/head.S.
@@ -98,6 +104,32 @@ void __init paging_init(void)
98 } 104 }
99} 105}
100 106
107asmlinkage void init_pda(void)
108{
109 unsigned int cpu = raw_smp_processor_id();
110
111 /* Initialize the PDA fields holding references to other parts
112 of the memory. The content of such memory is still
113 undefined at the time of the call, we are only setting up
114 valid pointers to it. */
115 memset(&cpu_pda[cpu], 0, sizeof(cpu_pda[cpu]));
116
117 cpu_pda[0].next = &cpu_pda[1];
118 cpu_pda[1].next = &cpu_pda[0];
119
120 cpu_pda[cpu].ex_stack = exception_stack[cpu + 1];
121
122#ifdef CONFIG_SMP
123 cpu_pda[cpu].imask = 0x1f;
124#endif
125}
126
127void __cpuinit reserve_pda(void)
128{
129 printk(KERN_INFO "PDA for CPU%u reserved at %p\n", smp_processor_id(),
130 &cpu_pda[smp_processor_id()]);
131}
132
101void __init mem_init(void) 133void __init mem_init(void)
102{ 134{
103 unsigned int codek = 0, datak = 0, initk = 0; 135 unsigned int codek = 0, datak = 0, initk = 0;
@@ -141,21 +173,13 @@ void __init mem_init(void)
141 173
142static int __init sram_init(void) 174static int __init sram_init(void)
143{ 175{
144 unsigned long tmp;
145
146 /* Initialize the blackfin L1 Memory. */ 176 /* Initialize the blackfin L1 Memory. */
147 bfin_sram_init(); 177 bfin_sram_init();
148 178
149 /* Allocate this once; never free it. We assume this gives us a 179 /* Reserve the PDA space for the boot CPU right after we
150 pointer to the start of L1 scratchpad memory; panic if it 180 * initialized the scratch memory allocator.
151 doesn't. */ 181 */
152 tmp = (unsigned long)l1sram_alloc(sizeof(struct l1_scratch_task_info)); 182 reserve_pda();
153 if (tmp != (unsigned long)L1_SCRATCH_TASK_INFO) {
154 printk(KERN_EMERG "mem_init(): Did not get the right address from l1sram_alloc: %08lx != %08lx\n",
155 tmp, (unsigned long)L1_SCRATCH_TASK_INFO);
156 panic("No L1, time to give up\n");
157 }
158
159 return 0; 183 return 0;
160} 184}
161pure_initcall(sram_init); 185pure_initcall(sram_init);