setup.c 2.9 KB

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