.. | .. |
---|
16 | 16 | #include <linux/export.h> |
---|
17 | 17 | #include <linux/interrupt.h> |
---|
18 | 18 | #include <linux/io.h> |
---|
| 19 | +#include <linux/memblock.h> |
---|
19 | 20 | #include <linux/serial.h> |
---|
20 | 21 | #include <linux/smp.h> |
---|
21 | 22 | #include <linux/types.h> |
---|
.. | .. |
---|
36 | 37 | #include <asm/mipsregs.h> |
---|
37 | 38 | #include <asm/bootinfo.h> |
---|
38 | 39 | #include <asm/sections.h> |
---|
| 40 | +#include <asm/fw/fw.h> |
---|
39 | 41 | #include <asm/setup.h> |
---|
| 42 | +#include <asm/prom.h> |
---|
40 | 43 | #include <asm/time.h> |
---|
41 | 44 | |
---|
42 | 45 | #include <asm/octeon/octeon.h> |
---|
.. | .. |
---|
72 | 75 | DEFINE_SEMAPHORE(octeon_bootbus_sem); |
---|
73 | 76 | EXPORT_SYMBOL(octeon_bootbus_sem); |
---|
74 | 77 | |
---|
75 | | -struct octeon_boot_descriptor *octeon_boot_desc_ptr; |
---|
| 78 | +static struct octeon_boot_descriptor *octeon_boot_desc_ptr; |
---|
76 | 79 | |
---|
77 | 80 | struct cvmx_bootinfo *octeon_bootinfo; |
---|
78 | 81 | EXPORT_SYMBOL(octeon_bootinfo); |
---|
.. | .. |
---|
96 | 99 | " sync \n" |
---|
97 | 100 | " synci ($0) \n"); |
---|
98 | 101 | |
---|
99 | | - relocated_kexec_smp_wait(NULL); |
---|
| 102 | + kexec_reboot(); |
---|
100 | 103 | } |
---|
101 | 104 | #endif |
---|
102 | 105 | |
---|
.. | .. |
---|
351 | 354 | * |
---|
352 | 355 | * @s: String to write |
---|
353 | 356 | */ |
---|
354 | | -void octeon_write_lcd(const char *s) |
---|
| 357 | +static void octeon_write_lcd(const char *s) |
---|
355 | 358 | { |
---|
356 | 359 | if (octeon_bootinfo->led_display_base_addr) { |
---|
357 | 360 | void __iomem *lcd_address = |
---|
358 | | - ioremap_nocache(octeon_bootinfo->led_display_base_addr, |
---|
| 361 | + ioremap(octeon_bootinfo->led_display_base_addr, |
---|
359 | 362 | 8); |
---|
360 | 363 | int i; |
---|
361 | 364 | for (i = 0; i < 8; i++, s++) { |
---|
.. | .. |
---|
373 | 376 | * |
---|
374 | 377 | * Returns uart (0 or 1) |
---|
375 | 378 | */ |
---|
376 | | -int octeon_get_boot_uart(void) |
---|
| 379 | +static int octeon_get_boot_uart(void) |
---|
377 | 380 | { |
---|
378 | 381 | return (octeon_boot_desc_ptr->flags & OCTEON_BL_FLAG_CONSOLE_UART1) ? |
---|
379 | 382 | 1 : 0; |
---|
.. | .. |
---|
842 | 845 | * BIST should always be enabled when doing a soft reset. L2 |
---|
843 | 846 | * Cache locking for instance is not cleared unless BIST is |
---|
844 | 847 | * enabled. Unfortunately due to a chip errata G-200 for |
---|
845 | | - * Cn38XX and CN31XX, BIST msut be disabled on these parts. |
---|
| 848 | + * Cn38XX and CN31XX, BIST must be disabled on these parts. |
---|
846 | 849 | */ |
---|
847 | 850 | if (OCTEON_IS_MODEL(OCTEON_CN38XX_PASS2) || |
---|
848 | 851 | OCTEON_IS_MODEL(OCTEON_CN31XX)) |
---|
.. | .. |
---|
928 | 931 | { |
---|
929 | 932 | if (addr > *mem && addr < *mem + *size) { |
---|
930 | 933 | u64 inc = addr - *mem; |
---|
931 | | - add_memory_region(*mem, inc, BOOT_MEM_RAM); |
---|
| 934 | + memblock_add(*mem, inc); |
---|
932 | 935 | *mem += inc; |
---|
933 | 936 | *size -= inc; |
---|
934 | 937 | } |
---|
.. | .. |
---|
990 | 993 | |
---|
991 | 994 | /* Crashkernel ignores bootmem list. It relies on mem=X@Y option */ |
---|
992 | 995 | #ifdef CONFIG_CRASH_DUMP |
---|
993 | | - add_memory_region(reserve_low_mem, max_memory, BOOT_MEM_RAM); |
---|
| 996 | + memblock_add(reserve_low_mem, max_memory); |
---|
994 | 997 | total += max_memory; |
---|
995 | 998 | #else |
---|
996 | 999 | #ifdef CONFIG_KEXEC |
---|
997 | 1000 | if (crashk_size > 0) { |
---|
998 | | - add_memory_region(crashk_base, crashk_size, BOOT_MEM_RAM); |
---|
| 1001 | + memblock_add(crashk_base, crashk_size); |
---|
999 | 1002 | crashk_end = crashk_base + crashk_size; |
---|
1000 | 1003 | } |
---|
1001 | 1004 | #endif |
---|
1002 | 1005 | /* |
---|
1003 | | - * When allocating memory, we want incrementing addresses from |
---|
1004 | | - * bootmem_alloc so the code in add_memory_region can merge |
---|
1005 | | - * regions next to each other. |
---|
| 1006 | + * When allocating memory, we want incrementing addresses, |
---|
| 1007 | + * which is handled by memblock |
---|
1006 | 1008 | */ |
---|
1007 | 1009 | cvmx_bootmem_lock(); |
---|
1008 | | - while ((boot_mem_map.nr_map < BOOT_MEM_MAP_MAX) |
---|
1009 | | - && (total < max_memory)) { |
---|
| 1010 | + while (total < max_memory) { |
---|
1010 | 1011 | memory = cvmx_bootmem_phy_alloc(mem_alloc_size, |
---|
1011 | 1012 | __pa_symbol(&_end), -1, |
---|
1012 | 1013 | 0x100000, |
---|
.. | .. |
---|
1038 | 1039 | */ |
---|
1039 | 1040 | if (memory < crashk_base && end > crashk_end) { |
---|
1040 | 1041 | /* region is fully in */ |
---|
1041 | | - add_memory_region(memory, |
---|
1042 | | - crashk_base - memory, |
---|
1043 | | - BOOT_MEM_RAM); |
---|
| 1042 | + memblock_add(memory, crashk_base - memory); |
---|
1044 | 1043 | total += crashk_base - memory; |
---|
1045 | | - add_memory_region(crashk_end, |
---|
1046 | | - end - crashk_end, |
---|
1047 | | - BOOT_MEM_RAM); |
---|
| 1044 | + memblock_add(crashk_end, end - crashk_end); |
---|
1048 | 1045 | total += end - crashk_end; |
---|
1049 | 1046 | continue; |
---|
1050 | 1047 | } |
---|
.. | .. |
---|
1072 | 1069 | */ |
---|
1073 | 1070 | mem_alloc_size -= end - crashk_base; |
---|
1074 | 1071 | #endif |
---|
1075 | | - add_memory_region(memory, mem_alloc_size, BOOT_MEM_RAM); |
---|
| 1072 | + memblock_add(memory, mem_alloc_size); |
---|
1076 | 1073 | total += mem_alloc_size; |
---|
1077 | 1074 | /* Recovering mem_alloc_size */ |
---|
1078 | 1075 | mem_alloc_size = 4 << 20; |
---|
.. | .. |
---|
1087 | 1084 | |
---|
1088 | 1085 | /* Adjust for physical offset. */ |
---|
1089 | 1086 | kernel_start &= ~0xffffffff80000000ULL; |
---|
1090 | | - add_memory_region(kernel_start, kernel_size, BOOT_MEM_RAM); |
---|
| 1087 | + memblock_add(kernel_start, kernel_size); |
---|
1091 | 1088 | #endif /* CONFIG_CRASH_DUMP */ |
---|
1092 | 1089 | |
---|
1093 | 1090 | #ifdef CONFIG_CAVIUM_RESERVE32 |
---|
.. | .. |
---|
1125 | 1122 | |
---|
1126 | 1123 | void __init prom_free_prom_memory(void) |
---|
1127 | 1124 | { |
---|
1128 | | - if (CAVIUM_OCTEON_DCACHE_PREFETCH_WAR) { |
---|
| 1125 | + if (OCTEON_IS_MODEL(OCTEON_CN6XXX)) { |
---|
1129 | 1126 | /* Check for presence of Core-14449 fix. */ |
---|
1130 | 1127 | u32 insn; |
---|
1131 | 1128 | u32 *foo; |
---|