cpuinfo.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /*
  2. * Generic support for queying CPU info
  3. *
  4. * Copyright (C) 2007-2009 Michal Simek <monstr@monstr.eu>
  5. * Copyright (C) 2007-2009 PetaLogix
  6. * Copyright (C) 2007 John Williams <jwilliams@itee.uq.edu.au>
  7. *
  8. * This file is subject to the terms and conditions of the GNU General
  9. * Public License. See the file COPYING in the main directory of this
  10. * archive for more details.
  11. */
  12. #ifndef _ASM_MICROBLAZE_CPUINFO_H
  13. #define _ASM_MICROBLAZE_CPUINFO_H
  14. #include <asm/prom.h>
  15. /* CPU Version and FPGA Family code conversion table type */
  16. struct cpu_ver_key {
  17. const char *s;
  18. const unsigned k;
  19. };
  20. extern const struct cpu_ver_key cpu_ver_lookup[];
  21. struct family_string_key {
  22. const char *s;
  23. const unsigned k;
  24. };
  25. extern const struct family_string_key family_string_lookup[];
  26. struct cpuinfo {
  27. /* Core CPU configuration */
  28. u32 use_instr;
  29. u32 use_mult;
  30. u32 use_fpu;
  31. u32 use_exc;
  32. u32 ver_code;
  33. u32 mmu;
  34. u32 mmu_privins;
  35. u32 endian;
  36. /* CPU caches */
  37. u32 use_icache;
  38. u32 icache_tagbits;
  39. u32 icache_write;
  40. u32 icache_line_length;
  41. u32 icache_size;
  42. unsigned long icache_base;
  43. unsigned long icache_high;
  44. u32 use_dcache;
  45. u32 dcache_tagbits;
  46. u32 dcache_write;
  47. u32 dcache_line_length;
  48. u32 dcache_size;
  49. u32 dcache_wb;
  50. unsigned long dcache_base;
  51. unsigned long dcache_high;
  52. /* Bus connections */
  53. u32 use_dopb;
  54. u32 use_iopb;
  55. u32 use_dlmb;
  56. u32 use_ilmb;
  57. u32 num_fsl;
  58. /* CPU interrupt line info */
  59. u32 irq_edge;
  60. u32 irq_positive;
  61. u32 area_optimised;
  62. /* HW debug support */
  63. u32 hw_debug;
  64. u32 num_pc_brk;
  65. u32 num_rd_brk;
  66. u32 num_wr_brk;
  67. u32 cpu_clock_freq; /* store real freq of cpu */
  68. /* FPGA family */
  69. u32 fpga_family_code;
  70. /* User define */
  71. u32 pvr_user1;
  72. u32 pvr_user2;
  73. };
  74. extern struct cpuinfo cpuinfo;
  75. /* fwd declarations of the various CPUinfo populators */
  76. void setup_cpuinfo(void);
  77. void setup_cpuinfo_clk(void);
  78. void set_cpuinfo_static(struct cpuinfo *ci, struct device_node *cpu);
  79. void set_cpuinfo_pvr_full(struct cpuinfo *ci, struct device_node *cpu);
  80. static inline unsigned int fcpu(struct device_node *cpu, char *n)
  81. {
  82. u32 val = 0;
  83. of_property_read_u32(cpu, n, &val);
  84. return val;
  85. }
  86. #endif /* _ASM_MICROBLAZE_CPUINFO_H */