aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/kernel/setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/blackfin/kernel/setup.c')
-rw-r--r--arch/blackfin/kernel/setup.c80
1 files changed, 45 insertions, 35 deletions
diff --git a/arch/blackfin/kernel/setup.c b/arch/blackfin/kernel/setup.c
index c202a44d1416..8e2efceb364b 100644
--- a/arch/blackfin/kernel/setup.c
+++ b/arch/blackfin/kernel/setup.c
@@ -178,10 +178,10 @@ void __init bfin_cache_init(void)
178 178
179void __init bfin_relocate_l1_mem(void) 179void __init bfin_relocate_l1_mem(void)
180{ 180{
181 unsigned long l1_code_length; 181 unsigned long text_l1_len = (unsigned long)_text_l1_len;
182 unsigned long l1_data_a_length; 182 unsigned long data_l1_len = (unsigned long)_data_l1_len;
183 unsigned long l1_data_b_length; 183 unsigned long data_b_l1_len = (unsigned long)_data_b_l1_len;
184 unsigned long l2_length; 184 unsigned long l2_len = (unsigned long)_l2_len;
185 185
186 early_shadow_stamp(); 186 early_shadow_stamp();
187 187
@@ -201,31 +201,34 @@ void __init bfin_relocate_l1_mem(void)
201 201
202 blackfin_dma_early_init(); 202 blackfin_dma_early_init();
203 203
204 /* if necessary, copy _stext_l1 to _etext_l1 to L1 instruction SRAM */ 204 /* if necessary, copy L1 text to L1 instruction SRAM */
205 l1_code_length = _etext_l1 - _stext_l1; 205 if (L1_CODE_LENGTH && text_l1_len)
206 if (l1_code_length) 206 early_dma_memcpy(_stext_l1, _text_l1_lma, text_l1_len);
207 early_dma_memcpy(_stext_l1, _l1_lma_start, l1_code_length);
208 207
209 /* if necessary, copy _sdata_l1 to _sbss_l1 to L1 data bank A SRAM */ 208 /* if necessary, copy L1 data to L1 data bank A SRAM */
210 l1_data_a_length = _sbss_l1 - _sdata_l1; 209 if (L1_DATA_A_LENGTH && data_l1_len)
211 if (l1_data_a_length) 210 early_dma_memcpy(_sdata_l1, _data_l1_lma, data_l1_len);
212 early_dma_memcpy(_sdata_l1, _l1_lma_start + l1_code_length, l1_data_a_length);
213 211
214 /* if necessary, copy _sdata_b_l1 to _sbss_b_l1 to L1 data bank B SRAM */ 212 /* if necessary, copy L1 data B to L1 data bank B SRAM */
215 l1_data_b_length = _sbss_b_l1 - _sdata_b_l1; 213 if (L1_DATA_B_LENGTH && data_b_l1_len)
216 if (l1_data_b_length) 214 early_dma_memcpy(_sdata_b_l1, _data_b_l1_lma, data_b_l1_len);
217 early_dma_memcpy(_sdata_b_l1, _l1_lma_start + l1_code_length +
218 l1_data_a_length, l1_data_b_length);
219 215
220 early_dma_memcpy_done(); 216 early_dma_memcpy_done();
221 217
222 /* if necessary, copy _stext_l2 to _edata_l2 to L2 SRAM */ 218 /* if necessary, copy L2 text/data to L2 SRAM */
223 if (L2_LENGTH != 0) { 219 if (L2_LENGTH && l2_len)
224 l2_length = _sbss_l2 - _stext_l2; 220 memcpy(_stext_l2, _l2_lma, l2_len);
225 if (l2_length) 221}
226 memcpy(_stext_l2, _l2_lma_start, l2_length); 222
227 } 223#ifdef CONFIG_ROMKERNEL
224void __init bfin_relocate_xip_data(void)
225{
226 early_shadow_stamp();
227
228 memcpy(_sdata, _data_lma, (unsigned long)_data_len - THREAD_SIZE + sizeof(struct thread_info));
229 memcpy(_sinitdata, _init_data_lma, (unsigned long)_init_data_len);
228} 230}
231#endif
229 232
230/* add_memory_region to memmap */ 233/* add_memory_region to memmap */
231static void __init add_memory_region(unsigned long long start, 234static void __init add_memory_region(unsigned long long start,
@@ -511,7 +514,7 @@ static __init void memory_setup(void)
511#endif 514#endif
512 unsigned long max_mem; 515 unsigned long max_mem;
513 516
514 _rambase = (unsigned long)_stext; 517 _rambase = CONFIG_BOOT_LOAD;
515 _ramstart = (unsigned long)_end; 518 _ramstart = (unsigned long)_end;
516 519
517 if (DMA_UNCACHED_REGION > (_ramend - _ramstart)) { 520 if (DMA_UNCACHED_REGION > (_ramend - _ramstart)) {
@@ -604,13 +607,13 @@ static __init void memory_setup(void)
604 } 607 }
605 608
606#ifdef CONFIG_MPU 609#ifdef CONFIG_MPU
610#if defined(CONFIG_ROMFS_ON_MTD) && defined(CONFIG_MTD_ROM)
611 page_mask_nelts = (((_ramend + ASYNC_BANK3_BASE + ASYNC_BANK3_SIZE -
612 ASYNC_BANK0_BASE) >> PAGE_SHIFT) + 31) / 32;
613#else
607 page_mask_nelts = ((_ramend >> PAGE_SHIFT) + 31) / 32; 614 page_mask_nelts = ((_ramend >> PAGE_SHIFT) + 31) / 32;
608 page_mask_order = get_order(3 * page_mask_nelts * sizeof(long));
609#endif 615#endif
610 616 page_mask_order = get_order(3 * page_mask_nelts * sizeof(long));
611#if !defined(CONFIG_MTD_UCLINUX)
612 /*In case there is no valid CPLB behind memory_end make sure we don't get to close*/
613 memory_end -= SIZE_4K;
614#endif 617#endif
615 618
616 init_mm.start_code = (unsigned long)_stext; 619 init_mm.start_code = (unsigned long)_stext;
@@ -642,7 +645,7 @@ static __init void memory_setup(void)
642 __bss_start, __bss_stop, 645 __bss_start, __bss_stop,
643 _sdata, _edata, 646 _sdata, _edata,
644 (void *)&init_thread_union, 647 (void *)&init_thread_union,
645 (void *)((int)(&init_thread_union) + 0x2000), 648 (void *)((int)(&init_thread_union) + THREAD_SIZE),
646 __init_begin, __init_end, 649 __init_begin, __init_end,
647 (void *)_ramstart, (void *)memory_end 650 (void *)_ramstart, (void *)memory_end
648#ifdef CONFIG_MTD_UCLINUX 651#ifdef CONFIG_MTD_UCLINUX
@@ -804,10 +807,17 @@ static inline int __init get_mem_size(void)
804 BUG(); 807 BUG();
805} 808}
806 809
810__attribute__((weak))
811void __init native_machine_early_platform_add_devices(void)
812{
813}
814
807void __init setup_arch(char **cmdline_p) 815void __init setup_arch(char **cmdline_p)
808{ 816{
809 unsigned long sclk, cclk; 817 unsigned long sclk, cclk;
810 818
819 native_machine_early_platform_add_devices();
820
811 enable_shadow_console(); 821 enable_shadow_console();
812 822
813 /* Check to make sure we are running on the right processor */ 823 /* Check to make sure we are running on the right processor */
@@ -917,7 +927,7 @@ void __init setup_arch(char **cmdline_p)
917 927
918 printk(KERN_INFO "Blackfin support (C) 2004-2009 Analog Devices, Inc.\n"); 928 printk(KERN_INFO "Blackfin support (C) 2004-2009 Analog Devices, Inc.\n");
919 if (bfin_compiled_revid() == 0xffff) 929 if (bfin_compiled_revid() == 0xffff)
920 printk(KERN_INFO "Compiled for ADSP-%s Rev any\n", CPU); 930 printk(KERN_INFO "Compiled for ADSP-%s Rev any, running on 0.%d\n", CPU, bfin_revid());
921 else if (bfin_compiled_revid() == -1) 931 else if (bfin_compiled_revid() == -1)
922 printk(KERN_INFO "Compiled for ADSP-%s Rev none\n", CPU); 932 printk(KERN_INFO "Compiled for ADSP-%s Rev none\n", CPU);
923 else 933 else
@@ -1229,10 +1239,10 @@ static int show_cpuinfo(struct seq_file *m, void *v)
1229 dsup_banks, BFIN_DSUBBANKS, BFIN_DWAYS, 1239 dsup_banks, BFIN_DSUBBANKS, BFIN_DWAYS,
1230 BFIN_DLINES); 1240 BFIN_DLINES);
1231#ifdef __ARCH_SYNC_CORE_DCACHE 1241#ifdef __ARCH_SYNC_CORE_DCACHE
1232 seq_printf(m, "SMP Dcache Flushes\t: %lu\n\n", cpudata->dcache_invld_count); 1242 seq_printf(m, "SMP Dcache Flushes\t: %lu\n\n", dcache_invld_count[cpu_num]);
1233#endif 1243#endif
1234#ifdef __ARCH_SYNC_CORE_ICACHE 1244#ifdef __ARCH_SYNC_CORE_ICACHE
1235 seq_printf(m, "SMP Icache Flushes\t: %lu\n\n", cpudata->icache_invld_count); 1245 seq_printf(m, "SMP Icache Flushes\t: %lu\n\n", icache_invld_count[cpu_num]);
1236#endif 1246#endif
1237 1247
1238 if (cpu_num != num_possible_cpus() - 1) 1248 if (cpu_num != num_possible_cpus() - 1)
@@ -1261,8 +1271,8 @@ static int show_cpuinfo(struct seq_file *m, void *v)
1261 seq_printf(m, "board memory\t: %ld kB (0x%p -> 0x%p)\n", 1271 seq_printf(m, "board memory\t: %ld kB (0x%p -> 0x%p)\n",
1262 physical_mem_end >> 10, (void *)0, (void *)physical_mem_end); 1272 physical_mem_end >> 10, (void *)0, (void *)physical_mem_end);
1263 seq_printf(m, "kernel memory\t: %d kB (0x%p -> 0x%p)\n", 1273 seq_printf(m, "kernel memory\t: %d kB (0x%p -> 0x%p)\n",
1264 ((int)memory_end - (int)_stext) >> 10, 1274 ((int)memory_end - (int)_rambase) >> 10,
1265 _stext, 1275 (void *)_rambase,
1266 (void *)memory_end); 1276 (void *)memory_end);
1267 seq_printf(m, "\n"); 1277 seq_printf(m, "\n");
1268 1278