cpuinfo.c (a89988a6e00c5a099ee23619cd91dc8dc7ec9328) cpuinfo.c (23460839b983d5d8d47fe90f341599f66523dd81)
1/*
2 * Copyright (C) 2013 Altera Corporation
3 * Copyright (C) 2011 Tobias Klauser <tklauser@distanz.ch>
4 *
5 * Based on cpuinfo.c from microblaze
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by

--- 53 unchanged lines hidden (view full) ---

62 if (str)
63 strlcpy(cpuinfo.cpu_impl, str, sizeof(cpuinfo.cpu_impl));
64 else
65 strcpy(cpuinfo.cpu_impl, "<unknown>");
66
67 cpuinfo.has_div = of_property_read_bool(cpu, "altr,has-div");
68 cpuinfo.has_mul = of_property_read_bool(cpu, "altr,has-mul");
69 cpuinfo.has_mulx = of_property_read_bool(cpu, "altr,has-mulx");
1/*
2 * Copyright (C) 2013 Altera Corporation
3 * Copyright (C) 2011 Tobias Klauser <tklauser@distanz.ch>
4 *
5 * Based on cpuinfo.c from microblaze
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by

--- 53 unchanged lines hidden (view full) ---

62 if (str)
63 strlcpy(cpuinfo.cpu_impl, str, sizeof(cpuinfo.cpu_impl));
64 else
65 strcpy(cpuinfo.cpu_impl, "<unknown>");
66
67 cpuinfo.has_div = of_property_read_bool(cpu, "altr,has-div");
68 cpuinfo.has_mul = of_property_read_bool(cpu, "altr,has-mul");
69 cpuinfo.has_mulx = of_property_read_bool(cpu, "altr,has-mulx");
70 cpuinfo.has_bmx = of_property_read_bool(cpu, "altr,has-bmx");
70 cpuinfo.mmu = of_property_read_bool(cpu, "altr,has-mmu");
71
72 if (IS_ENABLED(CONFIG_NIOS2_HW_DIV_SUPPORT) && !cpuinfo.has_div)
73 err_cpu("DIV");
74
75 if (IS_ENABLED(CONFIG_NIOS2_HW_MUL_SUPPORT) && !cpuinfo.has_mul)
76 err_cpu("MUL");
77
78 if (IS_ENABLED(CONFIG_NIOS2_HW_MULX_SUPPORT) && !cpuinfo.has_mulx)
79 err_cpu("MULX");
80
71 cpuinfo.mmu = of_property_read_bool(cpu, "altr,has-mmu");
72
73 if (IS_ENABLED(CONFIG_NIOS2_HW_DIV_SUPPORT) && !cpuinfo.has_div)
74 err_cpu("DIV");
75
76 if (IS_ENABLED(CONFIG_NIOS2_HW_MUL_SUPPORT) && !cpuinfo.has_mul)
77 err_cpu("MUL");
78
79 if (IS_ENABLED(CONFIG_NIOS2_HW_MULX_SUPPORT) && !cpuinfo.has_mulx)
80 err_cpu("MULX");
81
82 if (IS_ENABLED(CONFIG_NIOS2_BMX_SUPPORT) && !cpuinfo.has_bmx)
83 err_cpu("BMX");
84
81 cpuinfo.tlb_num_ways = fcpu(cpu, "altr,tlb-num-ways");
82 if (!cpuinfo.tlb_num_ways)
83 panic("altr,tlb-num-ways can't be 0. Please check your hardware "
84 "system\n");
85 cpuinfo.icache_line_size = fcpu(cpu, "icache-line-size");
86 cpuinfo.icache_size = fcpu(cpu, "icache-size");
87 if (CONFIG_NIOS2_ICACHE_SIZE != cpuinfo.icache_size)
88 pr_warn("Warning: icache size configuration mismatch "

--- 49 unchanged lines hidden (view full) ---

138 (loops_per_jiffy * HZ) / 500000,
139 ((loops_per_jiffy * HZ) / 5000) % 100,
140 (loops_per_jiffy * HZ));
141
142 seq_printf(m,
143 "HW:\n"
144 " MUL:\t\t%s\n"
145 " MULX:\t\t%s\n"
85 cpuinfo.tlb_num_ways = fcpu(cpu, "altr,tlb-num-ways");
86 if (!cpuinfo.tlb_num_ways)
87 panic("altr,tlb-num-ways can't be 0. Please check your hardware "
88 "system\n");
89 cpuinfo.icache_line_size = fcpu(cpu, "icache-line-size");
90 cpuinfo.icache_size = fcpu(cpu, "icache-size");
91 if (CONFIG_NIOS2_ICACHE_SIZE != cpuinfo.icache_size)
92 pr_warn("Warning: icache size configuration mismatch "

--- 49 unchanged lines hidden (view full) ---

142 (loops_per_jiffy * HZ) / 500000,
143 ((loops_per_jiffy * HZ) / 5000) % 100,
144 (loops_per_jiffy * HZ));
145
146 seq_printf(m,
147 "HW:\n"
148 " MUL:\t\t%s\n"
149 " MULX:\t\t%s\n"
146 " DIV:\t\t%s\n",
150 " DIV:\t\t%s\n"
151 " BMX:\t\t%s\n",
147 cpuinfo.has_mul ? "yes" : "no",
148 cpuinfo.has_mulx ? "yes" : "no",
152 cpuinfo.has_mul ? "yes" : "no",
153 cpuinfo.has_mulx ? "yes" : "no",
149 cpuinfo.has_div ? "yes" : "no");
154 cpuinfo.has_div ? "yes" : "no",
155 cpuinfo.has_bmx ? "yes" : "no");
150
151 seq_printf(m,
152 "Icache:\t\t%ukB, line length: %u\n",
153 cpuinfo.icache_size >> 10,
154 cpuinfo.icache_line_size);
155
156 seq_printf(m,
157 "Dcache:\t\t%ukB, line length: %u\n",

--- 37 unchanged lines hidden ---
156
157 seq_printf(m,
158 "Icache:\t\t%ukB, line length: %u\n",
159 cpuinfo.icache_size >> 10,
160 cpuinfo.icache_line_size);
161
162 seq_printf(m,
163 "Dcache:\t\t%ukB, line length: %u\n",

--- 37 unchanged lines hidden ---