diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2013-05-07 19:27:46 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2013-05-07 19:27:46 -0400 |
commit | 9b3539e0e545e4c2f338acfc1ce52033a6f5e7f7 (patch) | |
tree | 5c56e4a208dbe7e985e59911e1a421a7c1ee024c /arch/mips/kernel | |
parent | 3d39019a1655d195a60a86ebf38f9da30bd83d03 (diff) | |
parent | 1cd1c049271233deccfcc75123afa7f39a607f5a (diff) |
Merge branch 'mips-next-3.10' of git://git.linux-mips.org/pub/scm/john/linux-john into mips-for-linux-next
Diffstat (limited to 'arch/mips/kernel')
-rw-r--r-- | arch/mips/kernel/Makefile | 29 | ||||
-rw-r--r-- | arch/mips/kernel/cpu-probe.c | 6 | ||||
-rw-r--r-- | arch/mips/kernel/mcount.S | 11 | ||||
-rw-r--r-- | arch/mips/kernel/mips_machine.c | 22 | ||||
-rw-r--r-- | arch/mips/kernel/proc.c | 4 | ||||
-rw-r--r-- | arch/mips/kernel/prom.c | 33 | ||||
-rw-r--r-- | arch/mips/kernel/setup.c | 22 | ||||
-rw-r--r-- | arch/mips/kernel/traps.c | 2 |
8 files changed, 75 insertions, 54 deletions
diff --git a/arch/mips/kernel/Makefile b/arch/mips/kernel/Makefile index f81d98f6184c..cdb87b2a423d 100644 --- a/arch/mips/kernel/Makefile +++ b/arch/mips/kernel/Makefile | |||
@@ -5,7 +5,7 @@ | |||
5 | extra-y := head.o vmlinux.lds | 5 | extra-y := head.o vmlinux.lds |
6 | 6 | ||
7 | obj-y += cpu-probe.o branch.o entry.o genex.o irq.o process.o \ | 7 | obj-y += cpu-probe.o branch.o entry.o genex.o irq.o process.o \ |
8 | ptrace.o reset.o setup.o signal.o syscall.o \ | 8 | prom.o ptrace.o reset.o setup.o signal.o syscall.o \ |
9 | time.o topology.o traps.o unaligned.o watch.o vdso.o | 9 | time.o topology.o traps.o unaligned.o watch.o vdso.o |
10 | 10 | ||
11 | ifdef CONFIG_FUNCTION_TRACER | 11 | ifdef CONFIG_FUNCTION_TRACER |
@@ -86,8 +86,6 @@ obj-$(CONFIG_EARLY_PRINTK) += early_printk.o | |||
86 | obj-$(CONFIG_SPINLOCK_TEST) += spinlock_test.o | 86 | obj-$(CONFIG_SPINLOCK_TEST) += spinlock_test.o |
87 | obj-$(CONFIG_MIPS_MACHINE) += mips_machine.o | 87 | obj-$(CONFIG_MIPS_MACHINE) += mips_machine.o |
88 | 88 | ||
89 | obj-$(CONFIG_OF) += prom.o | ||
90 | |||
91 | CFLAGS_cpu-bugs64.o = $(shell if $(CC) $(KBUILD_CFLAGS) -Wa,-mdaddi -c -o /dev/null -x c /dev/null >/dev/null 2>&1; then echo "-DHAVE_AS_SET_DADDI"; fi) | 89 | CFLAGS_cpu-bugs64.o = $(shell if $(CC) $(KBUILD_CFLAGS) -Wa,-mdaddi -c -o /dev/null -x c /dev/null >/dev/null 2>&1; then echo "-DHAVE_AS_SET_DADDI"; fi) |
92 | 90 | ||
93 | obj-$(CONFIG_HAVE_STD_PC_SERIAL_PORT) += 8250-platform.o | 91 | obj-$(CONFIG_HAVE_STD_PC_SERIAL_PORT) += 8250-platform.o |
@@ -100,29 +98,16 @@ obj-$(CONFIG_HW_PERF_EVENTS) += perf_event_mipsxx.o | |||
100 | obj-$(CONFIG_JUMP_LABEL) += jump_label.o | 98 | obj-$(CONFIG_JUMP_LABEL) += jump_label.o |
101 | 99 | ||
102 | # | 100 | # |
103 | # DSP ASE supported for MIPS32 or MIPS64 Release 2 cores only. It is safe | 101 | # DSP ASE supported for MIPS32 or MIPS64 Release 2 cores only. It is not |
104 | # to enable DSP assembler support here even if the MIPS Release 2 CPU we | 102 | # safe to unconditionnaly use the assembler -mdsp / -mdspr2 switches |
105 | # are targetting does not support DSP because all code-paths making use of | 103 | # here because the compiler may use DSP ASE instructions (such as lwx) in |
106 | # it properly check that the running CPU *actually does* support these | 104 | # code paths where we cannot check that the CPU we are running on supports it. |
107 | # instructions. | 105 | # Proper abstraction using HAVE_AS_DSP and macros is done in |
106 | # arch/mips/include/asm/mipsregs.h. | ||
108 | # | 107 | # |
109 | ifeq ($(CONFIG_CPU_MIPSR2), y) | 108 | ifeq ($(CONFIG_CPU_MIPSR2), y) |
110 | CFLAGS_DSP = -DHAVE_AS_DSP | 109 | CFLAGS_DSP = -DHAVE_AS_DSP |
111 | 110 | ||
112 | # | ||
113 | # Check if assembler supports DSP ASE | ||
114 | # | ||
115 | ifeq ($(call cc-option-yn,-mdsp), y) | ||
116 | CFLAGS_DSP += -mdsp | ||
117 | endif | ||
118 | |||
119 | # | ||
120 | # Check if assembler supports DSP ASE Rev2 | ||
121 | # | ||
122 | ifeq ($(call cc-option-yn,-mdspr2), y) | ||
123 | CFLAGS_DSP += -mdspr2 | ||
124 | endif | ||
125 | |||
126 | CFLAGS_signal.o = $(CFLAGS_DSP) | 111 | CFLAGS_signal.o = $(CFLAGS_DSP) |
127 | CFLAGS_signal32.o = $(CFLAGS_DSP) | 112 | CFLAGS_signal32.o = $(CFLAGS_DSP) |
128 | CFLAGS_process.o = $(CFLAGS_DSP) | 113 | CFLAGS_process.o = $(CFLAGS_DSP) |
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c index d069a19112e8..5fe66a0c3224 100644 --- a/arch/mips/kernel/cpu-probe.c +++ b/arch/mips/kernel/cpu-probe.c | |||
@@ -1227,10 +1227,8 @@ __cpuinit void cpu_probe(void) | |||
1227 | if (c->options & MIPS_CPU_FPU) { | 1227 | if (c->options & MIPS_CPU_FPU) { |
1228 | c->fpu_id = cpu_get_fpu_id(); | 1228 | c->fpu_id = cpu_get_fpu_id(); |
1229 | 1229 | ||
1230 | if (c->isa_level == MIPS_CPU_ISA_M32R1 || | 1230 | if (c->isa_level & (MIPS_CPU_ISA_M32R1 | MIPS_CPU_ISA_M32R2 | |
1231 | c->isa_level == MIPS_CPU_ISA_M32R2 || | 1231 | MIPS_CPU_ISA_M64R1 | MIPS_CPU_ISA_M64R2)) { |
1232 | c->isa_level == MIPS_CPU_ISA_M64R1 || | ||
1233 | c->isa_level == MIPS_CPU_ISA_M64R2) { | ||
1234 | if (c->fpu_id & MIPS_FPIR_3D) | 1232 | if (c->fpu_id & MIPS_FPIR_3D) |
1235 | c->ases |= MIPS_ASE_MIPS3D; | 1233 | c->ases |= MIPS_ASE_MIPS3D; |
1236 | } | 1234 | } |
diff --git a/arch/mips/kernel/mcount.S b/arch/mips/kernel/mcount.S index 165867673357..33d067148e61 100644 --- a/arch/mips/kernel/mcount.S +++ b/arch/mips/kernel/mcount.S | |||
@@ -46,10 +46,9 @@ | |||
46 | PTR_L a5, PT_R9(sp) | 46 | PTR_L a5, PT_R9(sp) |
47 | PTR_L a6, PT_R10(sp) | 47 | PTR_L a6, PT_R10(sp) |
48 | PTR_L a7, PT_R11(sp) | 48 | PTR_L a7, PT_R11(sp) |
49 | #else | ||
50 | PTR_ADDIU sp, PT_SIZE | ||
51 | #endif | 49 | #endif |
52 | .endm | 50 | PTR_ADDIU sp, PT_SIZE |
51 | .endm | ||
53 | 52 | ||
54 | .macro RETURN_BACK | 53 | .macro RETURN_BACK |
55 | jr ra | 54 | jr ra |
@@ -68,7 +67,11 @@ NESTED(ftrace_caller, PT_SIZE, ra) | |||
68 | .globl _mcount | 67 | .globl _mcount |
69 | _mcount: | 68 | _mcount: |
70 | b ftrace_stub | 69 | b ftrace_stub |
71 | addiu sp,sp,8 | 70 | #ifdef CONFIG_32BIT |
71 | addiu sp,sp,8 | ||
72 | #else | ||
73 | nop | ||
74 | #endif | ||
72 | 75 | ||
73 | /* When tracing is activated, it calls ftrace_caller+8 (aka here) */ | 76 | /* When tracing is activated, it calls ftrace_caller+8 (aka here) */ |
74 | lw t1, function_trace_stop | 77 | lw t1, function_trace_stop |
diff --git a/arch/mips/kernel/mips_machine.c b/arch/mips/kernel/mips_machine.c index 411a058d2c53..876097529697 100644 --- a/arch/mips/kernel/mips_machine.c +++ b/arch/mips/kernel/mips_machine.c | |||
@@ -11,9 +11,9 @@ | |||
11 | #include <linux/slab.h> | 11 | #include <linux/slab.h> |
12 | 12 | ||
13 | #include <asm/mips_machine.h> | 13 | #include <asm/mips_machine.h> |
14 | #include <asm/prom.h> | ||
14 | 15 | ||
15 | static struct mips_machine *mips_machine __initdata; | 16 | static struct mips_machine *mips_machine __initdata; |
16 | static char *mips_machine_name = "Unknown"; | ||
17 | 17 | ||
18 | #define for_each_machine(mach) \ | 18 | #define for_each_machine(mach) \ |
19 | for ((mach) = (struct mips_machine *)&__mips_machines_start; \ | 19 | for ((mach) = (struct mips_machine *)&__mips_machines_start; \ |
@@ -21,25 +21,6 @@ static char *mips_machine_name = "Unknown"; | |||
21 | (unsigned long)(mach) < (unsigned long)&__mips_machines_end; \ | 21 | (unsigned long)(mach) < (unsigned long)&__mips_machines_end; \ |
22 | (mach)++) | 22 | (mach)++) |
23 | 23 | ||
24 | __init void mips_set_machine_name(const char *name) | ||
25 | { | ||
26 | char *p; | ||
27 | |||
28 | if (name == NULL) | ||
29 | return; | ||
30 | |||
31 | p = kstrdup(name, GFP_KERNEL); | ||
32 | if (!p) | ||
33 | pr_err("MIPS: no memory for machine_name\n"); | ||
34 | |||
35 | mips_machine_name = p; | ||
36 | } | ||
37 | |||
38 | char *mips_get_machine_name(void) | ||
39 | { | ||
40 | return mips_machine_name; | ||
41 | } | ||
42 | |||
43 | __init int mips_machtype_setup(char *id) | 24 | __init int mips_machtype_setup(char *id) |
44 | { | 25 | { |
45 | struct mips_machine *mach; | 26 | struct mips_machine *mach; |
@@ -79,7 +60,6 @@ __init void mips_machine_setup(void) | |||
79 | return; | 60 | return; |
80 | 61 | ||
81 | mips_set_machine_name(mips_machine->mach_name); | 62 | mips_set_machine_name(mips_machine->mach_name); |
82 | pr_info("MIPS: machine is %s\n", mips_machine_name); | ||
83 | 63 | ||
84 | if (mips_machine->mach_setup) | 64 | if (mips_machine->mach_setup) |
85 | mips_machine->mach_setup(); | 65 | mips_machine->mach_setup(); |
diff --git a/arch/mips/kernel/proc.c b/arch/mips/kernel/proc.c index 135c4aadccbe..1dd137bab5c5 100644 --- a/arch/mips/kernel/proc.c +++ b/arch/mips/kernel/proc.c | |||
@@ -12,7 +12,7 @@ | |||
12 | #include <asm/cpu-features.h> | 12 | #include <asm/cpu-features.h> |
13 | #include <asm/mipsregs.h> | 13 | #include <asm/mipsregs.h> |
14 | #include <asm/processor.h> | 14 | #include <asm/processor.h> |
15 | #include <asm/mips_machine.h> | 15 | #include <asm/prom.h> |
16 | 16 | ||
17 | unsigned int vced_count, vcei_count; | 17 | unsigned int vced_count, vcei_count; |
18 | 18 | ||
@@ -67,7 +67,7 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
67 | if (cpu_has_mips_r) { | 67 | if (cpu_has_mips_r) { |
68 | seq_printf(m, "isa\t\t\t:"); | 68 | seq_printf(m, "isa\t\t\t:"); |
69 | if (cpu_has_mips_1) | 69 | if (cpu_has_mips_1) |
70 | seq_printf(m, "%s", "mips1"); | 70 | seq_printf(m, "%s", " mips1"); |
71 | if (cpu_has_mips_2) | 71 | if (cpu_has_mips_2) |
72 | seq_printf(m, "%s", " mips2"); | 72 | seq_printf(m, "%s", " mips2"); |
73 | if (cpu_has_mips_3) | 73 | if (cpu_has_mips_3) |
diff --git a/arch/mips/kernel/prom.c b/arch/mips/kernel/prom.c index 028f6f837ef9..5712bb532245 100644 --- a/arch/mips/kernel/prom.c +++ b/arch/mips/kernel/prom.c | |||
@@ -23,6 +23,23 @@ | |||
23 | #include <asm/page.h> | 23 | #include <asm/page.h> |
24 | #include <asm/prom.h> | 24 | #include <asm/prom.h> |
25 | 25 | ||
26 | static char mips_machine_name[64] = "Unknown"; | ||
27 | |||
28 | __init void mips_set_machine_name(const char *name) | ||
29 | { | ||
30 | if (name == NULL) | ||
31 | return; | ||
32 | |||
33 | strncpy(mips_machine_name, name, sizeof(mips_machine_name)); | ||
34 | pr_info("MIPS: machine is %s\n", mips_get_machine_name()); | ||
35 | } | ||
36 | |||
37 | char *mips_get_machine_name(void) | ||
38 | { | ||
39 | return mips_machine_name; | ||
40 | } | ||
41 | |||
42 | #ifdef CONFIG_OF | ||
26 | int __init early_init_dt_scan_memory_arch(unsigned long node, | 43 | int __init early_init_dt_scan_memory_arch(unsigned long node, |
27 | const char *uname, int depth, | 44 | const char *uname, int depth, |
28 | void *data) | 45 | void *data) |
@@ -50,6 +67,18 @@ void __init early_init_dt_setup_initrd_arch(unsigned long start, | |||
50 | } | 67 | } |
51 | #endif | 68 | #endif |
52 | 69 | ||
70 | int __init early_init_dt_scan_model(unsigned long node, const char *uname, | ||
71 | int depth, void *data) | ||
72 | { | ||
73 | if (!depth) { | ||
74 | char *model = of_get_flat_dt_prop(node, "model", NULL); | ||
75 | |||
76 | if (model) | ||
77 | mips_set_machine_name(model); | ||
78 | } | ||
79 | return 0; | ||
80 | } | ||
81 | |||
53 | void __init early_init_devtree(void *params) | 82 | void __init early_init_devtree(void *params) |
54 | { | 83 | { |
55 | /* Setup flat device-tree pointer */ | 84 | /* Setup flat device-tree pointer */ |
@@ -65,6 +94,9 @@ void __init early_init_devtree(void *params) | |||
65 | /* Scan memory nodes */ | 94 | /* Scan memory nodes */ |
66 | of_scan_flat_dt(early_init_dt_scan_root, NULL); | 95 | of_scan_flat_dt(early_init_dt_scan_root, NULL); |
67 | of_scan_flat_dt(early_init_dt_scan_memory_arch, NULL); | 96 | of_scan_flat_dt(early_init_dt_scan_memory_arch, NULL); |
97 | |||
98 | /* try to load the mips machine name */ | ||
99 | of_scan_flat_dt(early_init_dt_scan_model, NULL); | ||
68 | } | 100 | } |
69 | 101 | ||
70 | void __init __dt_setup_arch(struct boot_param_header *bph) | 102 | void __init __dt_setup_arch(struct boot_param_header *bph) |
@@ -79,3 +111,4 @@ void __init __dt_setup_arch(struct boot_param_header *bph) | |||
79 | 111 | ||
80 | early_init_devtree(initial_boot_params); | 112 | early_init_devtree(initial_boot_params); |
81 | } | 113 | } |
114 | #endif | ||
diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c index 4c774d5d5087..c7f90519e58c 100644 --- a/arch/mips/kernel/setup.c +++ b/arch/mips/kernel/setup.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/pfn.h> | 23 | #include <linux/pfn.h> |
24 | #include <linux/debugfs.h> | 24 | #include <linux/debugfs.h> |
25 | #include <linux/kexec.h> | 25 | #include <linux/kexec.h> |
26 | #include <linux/sizes.h> | ||
26 | 27 | ||
27 | #include <asm/addrspace.h> | 28 | #include <asm/addrspace.h> |
28 | #include <asm/bootinfo.h> | 29 | #include <asm/bootinfo.h> |
@@ -77,6 +78,8 @@ EXPORT_SYMBOL(mips_io_port_base); | |||
77 | static struct resource code_resource = { .name = "Kernel code", }; | 78 | static struct resource code_resource = { .name = "Kernel code", }; |
78 | static struct resource data_resource = { .name = "Kernel data", }; | 79 | static struct resource data_resource = { .name = "Kernel data", }; |
79 | 80 | ||
81 | static void *detect_magic __initdata = detect_memory_region; | ||
82 | |||
80 | void __init add_memory_region(phys_t start, phys_t size, long type) | 83 | void __init add_memory_region(phys_t start, phys_t size, long type) |
81 | { | 84 | { |
82 | int x = boot_mem_map.nr_map; | 85 | int x = boot_mem_map.nr_map; |
@@ -122,6 +125,25 @@ void __init add_memory_region(phys_t start, phys_t size, long type) | |||
122 | boot_mem_map.nr_map++; | 125 | boot_mem_map.nr_map++; |
123 | } | 126 | } |
124 | 127 | ||
128 | void __init detect_memory_region(phys_t start, phys_t sz_min, phys_t sz_max) | ||
129 | { | ||
130 | void *dm = &detect_magic; | ||
131 | phys_t size; | ||
132 | |||
133 | for (size = sz_min; size < sz_max; size <<= 1) { | ||
134 | if (!memcmp(dm, dm + size, sizeof(detect_magic))) | ||
135 | break; | ||
136 | } | ||
137 | |||
138 | pr_debug("Memory: %lluMB of RAM detected at 0x%llx (min: %lluMB, max: %lluMB)\n", | ||
139 | ((unsigned long long) size) / SZ_1M, | ||
140 | (unsigned long long) start, | ||
141 | ((unsigned long long) sz_min) / SZ_1M, | ||
142 | ((unsigned long long) sz_max) / SZ_1M); | ||
143 | |||
144 | add_memory_region(start, size, BOOT_MEM_RAM); | ||
145 | } | ||
146 | |||
125 | static void __init print_memory_map(void) | 147 | static void __init print_memory_map(void) |
126 | { | 148 | { |
127 | int i; | 149 | int i; |
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index feb42c072384..3b98b7b8487f 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c | |||
@@ -1570,7 +1570,7 @@ void __cpuinit per_cpu_trap_init(bool is_boot_cpu) | |||
1570 | #ifdef CONFIG_64BIT | 1570 | #ifdef CONFIG_64BIT |
1571 | status_set |= ST0_FR|ST0_KX|ST0_SX|ST0_UX; | 1571 | status_set |= ST0_FR|ST0_KX|ST0_SX|ST0_UX; |
1572 | #endif | 1572 | #endif |
1573 | if (current_cpu_data.isa_level == MIPS_CPU_ISA_IV) | 1573 | if (current_cpu_data.isa_level & MIPS_CPU_ISA_IV) |
1574 | status_set |= ST0_XX; | 1574 | status_set |= ST0_XX; |
1575 | if (cpu_has_dsp) | 1575 | if (cpu_has_dsp) |
1576 | status_set |= ST0_MX; | 1576 | status_set |= ST0_MX; |