cpuinfo.c (23460839b983d5d8d47fe90f341599f66523dd81) | cpuinfo.c (edebea98777d7090ea14bdce2e38e6798557729d) |
---|---|
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 --- 54 unchanged lines hidden (view full) --- 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"); | 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 --- 54 unchanged lines hidden (view full) --- 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"); |
71 cpuinfo.has_cdx = of_property_read_bool(cpu, "altr,has-cdx"); |
|
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 | 72 cpuinfo.mmu = of_property_read_bool(cpu, "altr,has-mmu"); 73 74 if (IS_ENABLED(CONFIG_NIOS2_HW_DIV_SUPPORT) && !cpuinfo.has_div) 75 err_cpu("DIV"); 76 77 if (IS_ENABLED(CONFIG_NIOS2_HW_MUL_SUPPORT) && !cpuinfo.has_mul) 78 err_cpu("MUL"); 79 80 if (IS_ENABLED(CONFIG_NIOS2_HW_MULX_SUPPORT) && !cpuinfo.has_mulx) 81 err_cpu("MULX"); 82 83 if (IS_ENABLED(CONFIG_NIOS2_BMX_SUPPORT) && !cpuinfo.has_bmx) 84 err_cpu("BMX"); 85 |
86 if (IS_ENABLED(CONFIG_NIOS2_CDX_SUPPORT) && !cpuinfo.has_cdx) 87 err_cpu("CDX"); 88 |
|
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 " --- 50 unchanged lines hidden (view full) --- 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" 150 " DIV:\t\t%s\n" | 89 cpuinfo.tlb_num_ways = fcpu(cpu, "altr,tlb-num-ways"); 90 if (!cpuinfo.tlb_num_ways) 91 panic("altr,tlb-num-ways can't be 0. Please check your hardware " 92 "system\n"); 93 cpuinfo.icache_line_size = fcpu(cpu, "icache-line-size"); 94 cpuinfo.icache_size = fcpu(cpu, "icache-size"); 95 if (CONFIG_NIOS2_ICACHE_SIZE != cpuinfo.icache_size) 96 pr_warn("Warning: icache size configuration mismatch " --- 50 unchanged lines hidden (view full) --- 147 ((loops_per_jiffy * HZ) / 5000) % 100, 148 (loops_per_jiffy * HZ)); 149 150 seq_printf(m, 151 "HW:\n" 152 " MUL:\t\t%s\n" 153 " MULX:\t\t%s\n" 154 " DIV:\t\t%s\n" |
151 " BMX:\t\t%s\n", | 155 " BMX:\t\t%s\n" 156 " CDX:\t\t%s\n", |
152 cpuinfo.has_mul ? "yes" : "no", 153 cpuinfo.has_mulx ? "yes" : "no", 154 cpuinfo.has_div ? "yes" : "no", | 157 cpuinfo.has_mul ? "yes" : "no", 158 cpuinfo.has_mulx ? "yes" : "no", 159 cpuinfo.has_div ? "yes" : "no", |
155 cpuinfo.has_bmx ? "yes" : "no"); | 160 cpuinfo.has_bmx ? "yes" : "no", 161 cpuinfo.has_cdx ? "yes" : "no"); |
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 --- | 162 163 seq_printf(m, 164 "Icache:\t\t%ukB, line length: %u\n", 165 cpuinfo.icache_size >> 10, 166 cpuinfo.icache_line_size); 167 168 seq_printf(m, 169 "Dcache:\t\t%ukB, line length: %u\n", --- 37 unchanged lines hidden --- |