cpuinfo.h 2.0 KB

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