diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-12 16:14:30 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-12 16:14:30 -0400 |
| commit | 2b10dc45d15150434d7f206264e912eacbff734b (patch) | |
| tree | fc0ec778fbb563a62e573ad1ec76428ce1223c01 /arch/blackfin/kernel/setup.c | |
| parent | 47ea421af7479b90c481c94826f1c716fcf672cf (diff) | |
| parent | bf664c0a3a42683b78d74aca2d7cfb6ccc2aa2c3 (diff) | |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/vapier/blackfin
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/vapier/blackfin: (62 commits)
Blackfin: fix sparseirq/kstat_irqs fallout
Blackfin: fix unused warnings after nommu update
Blackfin: export the last exception cause via debugfs
Blackfin: fix length checking in kgdb_ebin2mem
Blackfin: kgdb: fix up error return values
Blackfin: push access_ok() L1 attribute down
Blackfin: punt duplicated search_exception_table() prototype
Blackfin: add missing access_ok() checks to user functions
Blackfin: convert early_printk EVT init to a loop
Blackfin: document the lsl variants of the L1 allocator
Blackfin: rename Blackfin relocs according to the toolchain
Blackfin: check SIC defines rather than variant names
Blackfin: add SSYNC to set_dma_sg() for descriptor fetching
Blackfin: convert SMP to only use generic time framework
Blackfin: bf548-ezkit/bf537-stamp: add resources for ADXL345/346
Blackfin: override default uClinux MTD addr/size
Blackfin: fix command line corruption with DEBUG_DOUBLEFAULT
Blackfin: fix handling of initial L1 reservation
Blackfin: merge sram init functions
Blackfin: drop unused reserve_pda() function
...
Diffstat (limited to 'arch/blackfin/kernel/setup.c')
| -rw-r--r-- | arch/blackfin/kernel/setup.c | 79 |
1 files changed, 41 insertions, 38 deletions
diff --git a/arch/blackfin/kernel/setup.c b/arch/blackfin/kernel/setup.c index a58687bdee6a..80447f99c2b5 100644 --- a/arch/blackfin/kernel/setup.c +++ b/arch/blackfin/kernel/setup.c | |||
| @@ -18,9 +18,12 @@ | |||
| 18 | #include <linux/tty.h> | 18 | #include <linux/tty.h> |
| 19 | #include <linux/pfn.h> | 19 | #include <linux/pfn.h> |
| 20 | 20 | ||
| 21 | #ifdef CONFIG_MTD_UCLINUX | ||
| 22 | #include <linux/mtd/map.h> | ||
| 21 | #include <linux/ext2_fs.h> | 23 | #include <linux/ext2_fs.h> |
| 22 | #include <linux/cramfs_fs.h> | 24 | #include <linux/cramfs_fs.h> |
| 23 | #include <linux/romfs_fs.h> | 25 | #include <linux/romfs_fs.h> |
| 26 | #endif | ||
| 24 | 27 | ||
| 25 | #include <asm/cplb.h> | 28 | #include <asm/cplb.h> |
| 26 | #include <asm/cacheflush.h> | 29 | #include <asm/cacheflush.h> |
| @@ -45,6 +48,7 @@ EXPORT_SYMBOL(_ramend); | |||
| 45 | EXPORT_SYMBOL(reserved_mem_dcache_on); | 48 | EXPORT_SYMBOL(reserved_mem_dcache_on); |
| 46 | 49 | ||
| 47 | #ifdef CONFIG_MTD_UCLINUX | 50 | #ifdef CONFIG_MTD_UCLINUX |
| 51 | extern struct map_info uclinux_ram_map; | ||
| 48 | unsigned long memory_mtd_end, memory_mtd_start, mtd_size; | 52 | unsigned long memory_mtd_end, memory_mtd_start, mtd_size; |
| 49 | unsigned long _ebss; | 53 | unsigned long _ebss; |
| 50 | EXPORT_SYMBOL(memory_mtd_end); | 54 | EXPORT_SYMBOL(memory_mtd_end); |
| @@ -150,40 +154,45 @@ void __init bfin_relocate_l1_mem(void) | |||
| 150 | unsigned long l1_data_b_length; | 154 | unsigned long l1_data_b_length; |
| 151 | unsigned long l2_length; | 155 | unsigned long l2_length; |
| 152 | 156 | ||
| 157 | /* | ||
| 158 | * due to the ALIGN(4) in the arch/blackfin/kernel/vmlinux.lds.S | ||
| 159 | * we know that everything about l1 text/data is nice and aligned, | ||
| 160 | * so copy by 4 byte chunks, and don't worry about overlapping | ||
| 161 | * src/dest. | ||
| 162 | * | ||
| 163 | * We can't use the dma_memcpy functions, since they can call | ||
| 164 | * scheduler functions which might be in L1 :( and core writes | ||
| 165 | * into L1 instruction cause bad access errors, so we are stuck, | ||
| 166 | * we are required to use DMA, but can't use the common dma | ||
| 167 | * functions. We can't use memcpy either - since that might be | ||
| 168 | * going to be in the relocated L1 | ||
| 169 | */ | ||
| 170 | |||
| 153 | blackfin_dma_early_init(); | 171 | blackfin_dma_early_init(); |
| 154 | 172 | ||
| 173 | /* if necessary, copy _stext_l1 to _etext_l1 to L1 instruction SRAM */ | ||
| 155 | l1_code_length = _etext_l1 - _stext_l1; | 174 | l1_code_length = _etext_l1 - _stext_l1; |
| 156 | if (l1_code_length > L1_CODE_LENGTH) | 175 | if (l1_code_length) |
| 157 | panic("L1 Instruction SRAM Overflow\n"); | 176 | early_dma_memcpy(_stext_l1, _l1_lma_start, l1_code_length); |
| 158 | /* cannot complain as printk is not available as yet. | ||
| 159 | * But we can continue booting and complain later! | ||
| 160 | */ | ||
| 161 | |||
| 162 | /* Copy _stext_l1 to _etext_l1 to L1 instruction SRAM */ | ||
| 163 | dma_memcpy(_stext_l1, _l1_lma_start, l1_code_length); | ||
| 164 | 177 | ||
| 178 | /* if necessary, copy _sdata_l1 to _sbss_l1 to L1 data bank A SRAM */ | ||
| 165 | l1_data_a_length = _sbss_l1 - _sdata_l1; | 179 | l1_data_a_length = _sbss_l1 - _sdata_l1; |
| 166 | if (l1_data_a_length > L1_DATA_A_LENGTH) | 180 | if (l1_data_a_length) |
| 167 | panic("L1 Data SRAM Bank A Overflow\n"); | 181 | early_dma_memcpy(_sdata_l1, _l1_lma_start + l1_code_length, l1_data_a_length); |
| 168 | |||
| 169 | /* Copy _sdata_l1 to _sbss_l1 to L1 data bank A SRAM */ | ||
| 170 | dma_memcpy(_sdata_l1, _l1_lma_start + l1_code_length, l1_data_a_length); | ||
| 171 | 182 | ||
| 183 | /* if necessary, copy _sdata_b_l1 to _sbss_b_l1 to L1 data bank B SRAM */ | ||
| 172 | l1_data_b_length = _sbss_b_l1 - _sdata_b_l1; | 184 | l1_data_b_length = _sbss_b_l1 - _sdata_b_l1; |
| 173 | if (l1_data_b_length > L1_DATA_B_LENGTH) | 185 | if (l1_data_b_length) |
| 174 | panic("L1 Data SRAM Bank B Overflow\n"); | 186 | early_dma_memcpy(_sdata_b_l1, _l1_lma_start + l1_code_length + |
| 175 | |||
| 176 | /* Copy _sdata_b_l1 to _sbss_b_l1 to L1 data bank B SRAM */ | ||
| 177 | dma_memcpy(_sdata_b_l1, _l1_lma_start + l1_code_length + | ||
| 178 | l1_data_a_length, l1_data_b_length); | 187 | l1_data_a_length, l1_data_b_length); |
| 179 | 188 | ||
| 189 | early_dma_memcpy_done(); | ||
| 190 | |||
| 191 | /* if necessary, copy _stext_l2 to _edata_l2 to L2 SRAM */ | ||
| 180 | if (L2_LENGTH != 0) { | 192 | if (L2_LENGTH != 0) { |
| 181 | l2_length = _sbss_l2 - _stext_l2; | 193 | l2_length = _sbss_l2 - _stext_l2; |
| 182 | if (l2_length > L2_LENGTH) | 194 | if (l2_length) |
| 183 | panic("L2 SRAM Overflow\n"); | 195 | memcpy(_stext_l2, _l2_lma_start, l2_length); |
| 184 | |||
| 185 | /* Copy _stext_l2 to _edata_l2 to L2 SRAM */ | ||
| 186 | dma_memcpy(_stext_l2, _l2_lma_start, l2_length); | ||
| 187 | } | 196 | } |
| 188 | } | 197 | } |
| 189 | 198 | ||
| @@ -472,7 +481,7 @@ static __init void memory_setup(void) | |||
| 472 | 481 | ||
| 473 | if (DMA_UNCACHED_REGION > (_ramend - _ramstart)) { | 482 | if (DMA_UNCACHED_REGION > (_ramend - _ramstart)) { |
| 474 | console_init(); | 483 | console_init(); |
| 475 | panic("DMA region exceeds memory limit: %lu.\n", | 484 | panic("DMA region exceeds memory limit: %lu.", |
| 476 | _ramend - _ramstart); | 485 | _ramend - _ramstart); |
| 477 | } | 486 | } |
| 478 | memory_end = _ramend - DMA_UNCACHED_REGION; | 487 | memory_end = _ramend - DMA_UNCACHED_REGION; |
| @@ -526,14 +535,13 @@ static __init void memory_setup(void) | |||
| 526 | 535 | ||
| 527 | if (mtd_size == 0) { | 536 | if (mtd_size == 0) { |
| 528 | console_init(); | 537 | console_init(); |
| 529 | panic("Don't boot kernel without rootfs attached.\n"); | 538 | panic("Don't boot kernel without rootfs attached."); |
| 530 | } | 539 | } |
| 531 | 540 | ||
| 532 | /* Relocate MTD image to the top of memory after the uncached memory area */ | 541 | /* Relocate MTD image to the top of memory after the uncached memory area */ |
| 533 | dma_memcpy((char *)memory_end, _end, mtd_size); | 542 | uclinux_ram_map.phys = memory_mtd_start = memory_end; |
| 534 | 543 | uclinux_ram_map.size = mtd_size; | |
| 535 | memory_mtd_start = memory_end; | 544 | dma_memcpy((void *)uclinux_ram_map.phys, _end, uclinux_ram_map.size); |
| 536 | _ebss = memory_mtd_start; /* define _ebss for compatible */ | ||
| 537 | #endif /* CONFIG_MTD_UCLINUX */ | 545 | #endif /* CONFIG_MTD_UCLINUX */ |
| 538 | 546 | ||
| 539 | #if (defined(CONFIG_BFIN_ICACHE) && ANOMALY_05000263) | 547 | #if (defined(CONFIG_BFIN_ICACHE) && ANOMALY_05000263) |
| @@ -796,10 +804,8 @@ void __init setup_arch(char **cmdline_p) | |||
| 796 | cclk = get_cclk(); | 804 | cclk = get_cclk(); |
| 797 | sclk = get_sclk(); | 805 | sclk = get_sclk(); |
| 798 | 806 | ||
| 799 | #if !defined(CONFIG_BFIN_KERNEL_CLOCK) | 807 | if ((ANOMALY_05000273 || ANOMALY_05000274) && (cclk >> 1) < sclk) |
| 800 | if (ANOMALY_05000273 && cclk == sclk) | 808 | panic("ANOMALY 05000273 or 05000274: CCLK must be >= 2*SCLK"); |
| 801 | panic("ANOMALY 05000273, SCLK can not be same as CCLK"); | ||
| 802 | #endif | ||
| 803 | 809 | ||
| 804 | #ifdef BF561_FAMILY | 810 | #ifdef BF561_FAMILY |
| 805 | if (ANOMALY_05000266) { | 811 | if (ANOMALY_05000266) { |
| @@ -881,7 +887,7 @@ void __init setup_arch(char **cmdline_p) | |||
| 881 | printk(KERN_ERR "Warning: Compiled for Rev %d, but running on Rev %d\n", | 887 | printk(KERN_ERR "Warning: Compiled for Rev %d, but running on Rev %d\n", |
| 882 | bfin_compiled_revid(), bfin_revid()); | 888 | bfin_compiled_revid(), bfin_revid()); |
| 883 | if (bfin_compiled_revid() > bfin_revid()) | 889 | if (bfin_compiled_revid() > bfin_revid()) |
| 884 | panic("Error: you are missing anomaly workarounds for this rev\n"); | 890 | panic("Error: you are missing anomaly workarounds for this rev"); |
| 885 | } | 891 | } |
| 886 | } | 892 | } |
| 887 | if (bfin_revid() < CONFIG_BF_REV_MIN || bfin_revid() > CONFIG_BF_REV_MAX) | 893 | if (bfin_revid() < CONFIG_BF_REV_MIN || bfin_revid() > CONFIG_BF_REV_MAX) |
| @@ -891,16 +897,13 @@ void __init setup_arch(char **cmdline_p) | |||
| 891 | 897 | ||
| 892 | /* We can't run on BF548-0.1 due to ANOMALY 05000448 */ | 898 | /* We can't run on BF548-0.1 due to ANOMALY 05000448 */ |
| 893 | if (bfin_cpuid() == 0x27de && bfin_revid() == 1) | 899 | if (bfin_cpuid() == 0x27de && bfin_revid() == 1) |
| 894 | panic("You can't run on this processor due to 05000448\n"); | 900 | panic("You can't run on this processor due to 05000448"); |
| 895 | 901 | ||
| 896 | printk(KERN_INFO "Blackfin Linux support by http://blackfin.uclinux.org/\n"); | 902 | printk(KERN_INFO "Blackfin Linux support by http://blackfin.uclinux.org/\n"); |
| 897 | 903 | ||
| 898 | printk(KERN_INFO "Processor Speed: %lu MHz core clock and %lu MHz System Clock\n", | 904 | printk(KERN_INFO "Processor Speed: %lu MHz core clock and %lu MHz System Clock\n", |
| 899 | cclk / 1000000, sclk / 1000000); | 905 | cclk / 1000000, sclk / 1000000); |
| 900 | 906 | ||
| 901 | if (ANOMALY_05000273 && (cclk >> 1) <= sclk) | ||
| 902 | printk("\n\n\nANOMALY_05000273: CCLK must be >= 2*SCLK !!!\n\n\n"); | ||
| 903 | |||
| 904 | setup_bootmem_allocator(); | 907 | setup_bootmem_allocator(); |
| 905 | 908 | ||
| 906 | paging_init(); | 909 | paging_init(); |
