setup.c 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. /*
  2. *
  3. * linux/arch/cris/arch-v10/kernel/setup.c
  4. *
  5. * Copyright (C) 1995 Linus Torvalds
  6. * Copyright (c) 2001-2002 Axis Communications AB
  7. */
  8. /*
  9. * This file handles the architecture-dependent parts of initialization
  10. */
  11. #include <linux/seq_file.h>
  12. #include <linux/proc_fs.h>
  13. #include <linux/delay.h>
  14. #include <linux/param.h>
  15. #include <arch/system.h>
  16. #ifdef CONFIG_PROC_FS
  17. #define HAS_FPU 0x0001
  18. #define HAS_MMU 0x0002
  19. #define HAS_ETHERNET100 0x0004
  20. #define HAS_TOKENRING 0x0008
  21. #define HAS_SCSI 0x0010
  22. #define HAS_ATA 0x0020
  23. #define HAS_USB 0x0040
  24. #define HAS_IRQ_BUG 0x0080
  25. #define HAS_MMU_BUG 0x0100
  26. static struct cpu_info {
  27. char *model;
  28. unsigned short cache;
  29. unsigned short flags;
  30. } cpu_info[] = {
  31. /* The first four models will never ever run this code and are
  32. only here for display. */
  33. { "ETRAX 1", 0, 0 },
  34. { "ETRAX 2", 0, 0 },
  35. { "ETRAX 3", 0, HAS_TOKENRING },
  36. { "ETRAX 4", 0, HAS_TOKENRING | HAS_SCSI },
  37. { "Unknown", 0, 0 },
  38. { "Unknown", 0, 0 },
  39. { "Unknown", 0, 0 },
  40. { "Simulator", 8, HAS_ETHERNET100 | HAS_SCSI | HAS_ATA },
  41. { "ETRAX 100", 8, HAS_ETHERNET100 | HAS_SCSI | HAS_ATA | HAS_IRQ_BUG },
  42. { "ETRAX 100", 8, HAS_ETHERNET100 | HAS_SCSI | HAS_ATA },
  43. { "ETRAX 100LX", 8, HAS_ETHERNET100 | HAS_SCSI | HAS_ATA | HAS_USB | HAS_MMU | HAS_MMU_BUG },
  44. { "ETRAX 100LX v2", 8, HAS_ETHERNET100 | HAS_SCSI | HAS_ATA | HAS_USB | HAS_MMU },
  45. { "Unknown", 0, 0 } /* This entry MUST be the last */
  46. };
  47. int show_cpuinfo(struct seq_file *m, void *v)
  48. {
  49. unsigned long revision;
  50. struct cpu_info *info;
  51. /* read the version register in the CPU and print some stuff */
  52. revision = rdvr();
  53. if (revision >= ARRAY_SIZE(cpu_info))
  54. info = &cpu_info[ARRAY_SIZE(cpu_info) - 1];
  55. else
  56. info = &cpu_info[revision];
  57. seq_printf(m,
  58. "processor\t: 0\n"
  59. "cpu\t\t: CRIS\n"
  60. "cpu revision\t: %lu\n"
  61. "cpu model\t: %s\n"
  62. "cache size\t: %d kB\n"
  63. "fpu\t\t: %s\n"
  64. "mmu\t\t: %s\n"
  65. "mmu DMA bug\t: %s\n"
  66. "ethernet\t: %s Mbps\n"
  67. "token ring\t: %s\n"
  68. "scsi\t\t: %s\n"
  69. "ata\t\t: %s\n"
  70. "usb\t\t: %s\n"
  71. "bogomips\t: %lu.%02lu\n",
  72. revision,
  73. info->model,
  74. info->cache,
  75. info->flags & HAS_FPU ? "yes" : "no",
  76. info->flags & HAS_MMU ? "yes" : "no",
  77. info->flags & HAS_MMU_BUG ? "yes" : "no",
  78. info->flags & HAS_ETHERNET100 ? "10/100" : "10",
  79. info->flags & HAS_TOKENRING ? "4/16 Mbps" : "no",
  80. info->flags & HAS_SCSI ? "yes" : "no",
  81. info->flags & HAS_ATA ? "yes" : "no",
  82. info->flags & HAS_USB ? "yes" : "no",
  83. (loops_per_jiffy * HZ + 500) / 500000,
  84. ((loops_per_jiffy * HZ + 500) / 5000) % 100);
  85. return 0;
  86. }
  87. #endif /* CONFIG_PROC_FS */
  88. void
  89. show_etrax_copyright(void)
  90. {
  91. printk(KERN_INFO
  92. "Linux/CRIS port on ETRAX 100LX (c) 2001 Axis Communications AB\n");
  93. }