cpuinfo.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * Copyright (C) 2011 Tobias Klauser <tklauser@distanz.ch>
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. *
  17. */
  18. #ifndef _ASM_NIOS2_CPUINFO_H
  19. #define _ASM_NIOS2_CPUINFO_H
  20. #include <linux/types.h>
  21. struct cpuinfo {
  22. /* Core CPU configuration */
  23. char cpu_impl[12];
  24. u32 cpu_clock_freq;
  25. bool mmu;
  26. bool has_div;
  27. bool has_mul;
  28. bool has_mulx;
  29. /* CPU caches */
  30. u32 icache_line_size;
  31. u32 icache_size;
  32. u32 dcache_line_size;
  33. u32 dcache_size;
  34. /* TLB */
  35. u32 tlb_pid_num_bits; /* number of bits used for the PID in TLBMISC */
  36. u32 tlb_num_ways;
  37. u32 tlb_num_ways_log2;
  38. u32 tlb_num_entries;
  39. u32 tlb_num_lines;
  40. u32 tlb_ptr_sz;
  41. /* Addresses */
  42. u32 reset_addr;
  43. u32 exception_addr;
  44. u32 fast_tlb_miss_exc_addr;
  45. };
  46. extern struct cpuinfo cpuinfo;
  47. extern void setup_cpuinfo(void);
  48. #endif /* _ASM_NIOS2_CPUINFO_H */