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.c85
1 files changed, 40 insertions, 45 deletions
diff --git a/arch/blackfin/kernel/setup.c b/arch/blackfin/kernel/setup.c
index 298f023bcc09..6225edae488e 100644
--- a/arch/blackfin/kernel/setup.c
+++ b/arch/blackfin/kernel/setup.c
@@ -168,7 +168,6 @@ void __cpuinit bfin_setup_cpudata(unsigned int cpu)
168 struct blackfin_cpudata *cpudata = &per_cpu(cpu_data, cpu); 168 struct blackfin_cpudata *cpudata = &per_cpu(cpu_data, cpu);
169 169
170 cpudata->idle = current; 170 cpudata->idle = current;
171 cpudata->loops_per_jiffy = loops_per_jiffy;
172 cpudata->imemctl = bfin_read_IMEM_CONTROL(); 171 cpudata->imemctl = bfin_read_IMEM_CONTROL();
173 cpudata->dmemctl = bfin_read_DMEM_CONTROL(); 172 cpudata->dmemctl = bfin_read_DMEM_CONTROL();
174} 173}
@@ -408,13 +407,14 @@ static void __init print_memory_map(char *who)
408 bfin_memmap.map[i].addr + bfin_memmap.map[i].size); 407 bfin_memmap.map[i].addr + bfin_memmap.map[i].size);
409 switch (bfin_memmap.map[i].type) { 408 switch (bfin_memmap.map[i].type) {
410 case BFIN_MEMMAP_RAM: 409 case BFIN_MEMMAP_RAM:
411 printk("(usable)\n"); 410 printk(KERN_CONT "(usable)\n");
412 break; 411 break;
413 case BFIN_MEMMAP_RESERVED: 412 case BFIN_MEMMAP_RESERVED:
414 printk("(reserved)\n"); 413 printk(KERN_CONT "(reserved)\n");
415 break; 414 break;
416 default: printk("type %lu\n", bfin_memmap.map[i].type); 415 default:
417 break; 416 printk(KERN_CONT "type %lu\n", bfin_memmap.map[i].type);
417 break;
418 } 418 }
419 } 419 }
420} 420}
@@ -567,17 +567,23 @@ static __init void memory_setup(void)
567# endif /* ANOMALY_05000263 */ 567# endif /* ANOMALY_05000263 */
568# endif /* CONFIG_ROMFS_FS */ 568# endif /* CONFIG_ROMFS_FS */
569 569
570 memory_end -= mtd_size; 570 /* Since the default MTD_UCLINUX has no magic number, we just blindly
571 571 * read 8 past the end of the kernel's image, and look at it.
572 if (mtd_size == 0) { 572 * When no image is attached, mtd_size is set to a random number
573 console_init(); 573 * Do some basic sanity checks before operating on things
574 panic("Don't boot kernel without rootfs attached."); 574 */
575 if (mtd_size == 0 || memory_end <= mtd_size) {
576 pr_emerg("Could not find valid ram mtd attached.\n");
577 } else {
578 memory_end -= mtd_size;
579
580 /* Relocate MTD image to the top of memory after the uncached memory area */
581 uclinux_ram_map.phys = memory_mtd_start = memory_end;
582 uclinux_ram_map.size = mtd_size;
583 pr_info("Found mtd parition at 0x%p, (len=0x%lx), moving to 0x%p\n",
584 _end, mtd_size, (void *)memory_mtd_start);
585 dma_memcpy((void *)uclinux_ram_map.phys, _end, uclinux_ram_map.size);
575 } 586 }
576
577 /* Relocate MTD image to the top of memory after the uncached memory area */
578 uclinux_ram_map.phys = memory_mtd_start = memory_end;
579 uclinux_ram_map.size = mtd_size;
580 dma_memcpy((void *)uclinux_ram_map.phys, _end, uclinux_ram_map.size);
581#endif /* CONFIG_MTD_UCLINUX */ 587#endif /* CONFIG_MTD_UCLINUX */
582 588
583#if (defined(CONFIG_BFIN_EXTMEM_ICACHEABLE) && ANOMALY_05000263) 589#if (defined(CONFIG_BFIN_EXTMEM_ICACHEABLE) && ANOMALY_05000263)
@@ -614,19 +620,19 @@ static __init void memory_setup(void)
614 printk(KERN_INFO "Kernel Managed Memory: %ldMB\n", _ramend >> 20); 620 printk(KERN_INFO "Kernel Managed Memory: %ldMB\n", _ramend >> 20);
615 621
616 printk(KERN_INFO "Memory map:\n" 622 printk(KERN_INFO "Memory map:\n"
617 KERN_INFO " fixedcode = 0x%p-0x%p\n" 623 " fixedcode = 0x%p-0x%p\n"
618 KERN_INFO " text = 0x%p-0x%p\n" 624 " text = 0x%p-0x%p\n"
619 KERN_INFO " rodata = 0x%p-0x%p\n" 625 " rodata = 0x%p-0x%p\n"
620 KERN_INFO " bss = 0x%p-0x%p\n" 626 " bss = 0x%p-0x%p\n"
621 KERN_INFO " data = 0x%p-0x%p\n" 627 " data = 0x%p-0x%p\n"
622 KERN_INFO " stack = 0x%p-0x%p\n" 628 " stack = 0x%p-0x%p\n"
623 KERN_INFO " init = 0x%p-0x%p\n" 629 " init = 0x%p-0x%p\n"
624 KERN_INFO " available = 0x%p-0x%p\n" 630 " available = 0x%p-0x%p\n"
625#ifdef CONFIG_MTD_UCLINUX 631#ifdef CONFIG_MTD_UCLINUX
626 KERN_INFO " rootfs = 0x%p-0x%p\n" 632 " rootfs = 0x%p-0x%p\n"
627#endif 633#endif
628#if DMA_UNCACHED_REGION > 0 634#if DMA_UNCACHED_REGION > 0
629 KERN_INFO " DMA Zone = 0x%p-0x%p\n" 635 " DMA Zone = 0x%p-0x%p\n"
630#endif 636#endif
631 , (void *)FIXED_CODE_START, (void *)FIXED_CODE_END, 637 , (void *)FIXED_CODE_START, (void *)FIXED_CODE_END,
632 _stext, _etext, 638 _stext, _etext,
@@ -859,20 +865,13 @@ void __init setup_arch(char **cmdline_p)
859#endif 865#endif
860 printk(KERN_INFO "Hardware Trace "); 866 printk(KERN_INFO "Hardware Trace ");
861 if (bfin_read_TBUFCTL() & 0x1) 867 if (bfin_read_TBUFCTL() & 0x1)
862 printk("Active "); 868 printk(KERN_CONT "Active ");
863 else 869 else
864 printk("Off "); 870 printk(KERN_CONT "Off ");
865 if (bfin_read_TBUFCTL() & 0x2) 871 if (bfin_read_TBUFCTL() & 0x2)
866 printk("and Enabled\n"); 872 printk(KERN_CONT "and Enabled\n");
867 else 873 else
868 printk("and Disabled\n"); 874 printk(KERN_CONT "and Disabled\n");
869
870#if defined(CONFIG_CHR_DEV_FLASH) || defined(CONFIG_BLK_DEV_FLASH)
871 /* we need to initialize the Flashrom device here since we might
872 * do things with flash early on in the boot
873 */
874 flash_probe();
875#endif
876 875
877 printk(KERN_INFO "Boot Mode: %i\n", bfin_read_SYSCR() & 0xF); 876 printk(KERN_INFO "Boot Mode: %i\n", bfin_read_SYSCR() & 0xF);
878 877
@@ -937,10 +936,6 @@ void __init setup_arch(char **cmdline_p)
937 CPU, bfin_revid()); 936 CPU, bfin_revid());
938 } 937 }
939 938
940 /* We can't run on BF548-0.1 due to ANOMALY 05000448 */
941 if (bfin_cpuid() == 0x27de && bfin_revid() == 1)
942 panic("You can't run on this processor due to 05000448");
943
944 printk(KERN_INFO "Blackfin Linux support by http://blackfin.uclinux.org/\n"); 939 printk(KERN_INFO "Blackfin Linux support by http://blackfin.uclinux.org/\n");
945 940
946 printk(KERN_INFO "Processor Speed: %lu MHz core clock and %lu MHz System Clock\n", 941 printk(KERN_INFO "Processor Speed: %lu MHz core clock and %lu MHz System Clock\n",
@@ -1163,9 +1158,9 @@ static int show_cpuinfo(struct seq_file *m, void *v)
1163 sclk/1000000, sclk%1000000); 1158 sclk/1000000, sclk%1000000);
1164 seq_printf(m, "bogomips\t: %lu.%02lu\n" 1159 seq_printf(m, "bogomips\t: %lu.%02lu\n"
1165 "Calibration\t: %lu loops\n", 1160 "Calibration\t: %lu loops\n",
1166 (cpudata->loops_per_jiffy * HZ) / 500000, 1161 (loops_per_jiffy * HZ) / 500000,
1167 ((cpudata->loops_per_jiffy * HZ) / 5000) % 100, 1162 ((loops_per_jiffy * HZ) / 5000) % 100,
1168 (cpudata->loops_per_jiffy * HZ)); 1163 (loops_per_jiffy * HZ));
1169 1164
1170 /* Check Cache configutation */ 1165 /* Check Cache configutation */
1171 switch (cpudata->dmemctl & (1 << DMC0_P | 1 << DMC1_P)) { 1166 switch (cpudata->dmemctl & (1 << DMC0_P | 1 << DMC1_P)) {