setup.c 2.9 KB

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