heterogeneousDataSynchronization.c 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /*
  2. * linux/arch/alpha/kernel/err_marvel.c
  3. *
  4. * Copyright (C) 2001 Jeff Wiedemeier (Compaq Computer Corporation)
  5. *
  6. */
  7. #include <linux/init.h>
  8. #include <linux/pci.h>
  9. #include <linux/sched.h>
  10. #include <asm/io.h>
  11. #include <asm/console.h>
  12. #include <asm/core_marvel.h>
  13. #include <asm/hwrpb.h>
  14. #include <asm/smp.h>
  15. #include <asm/err_common.h>
  16. #include <asm/err_ev7.h>
  17. #include "err_impl.h"
  18. #include "proto.h"
  19. static void
  20. marvel_print_680_frame(struct ev7_lf_subpackets *lf_subpackets)
  21. {
  22. #ifdef CONFIG_VERBOSE_MCHECK
  23. struct ev7_pal_environmental_subpacket *env;
  24. struct { int type; char *name; } ev_packets[] = {
  25. { EL_TYPE__PAL__ENV__AMBIENT_TEMPERATURE,
  26. "Ambient Temperature" },
  27. { EL_TYPE__PAL__ENV__AIRMOVER_FAN,
  28. "AirMover / Fan" },
  29. { EL_TYPE__PAL__ENV__VOLTAGE,
  30. "Voltage" },
  31. { EL_TYPE__PAL__ENV__INTRUSION,
  32. "Intrusion" },
  33. { EL_TYPE__PAL__ENV__POWER_SUPPLY,
  34. "Power Supply" },
  35. { EL_TYPE__PAL__ENV__LAN,
  36. "LAN" },
  37. { EL_TYPE__PAL__ENV__HOT_PLUG,
  38. "Hot Plug" },
  39. { 0, NULL }
  40. };
  41. int i;
  42. for (i = 0; ev_packets[i].type != 0; i++) {
  43. env = lf_subpackets->env[ev7_lf_env_index(ev_packets[i].type)];
  44. if (!env)
  45. continue;
  46. printk("%s**%s event (cabinet %d, drawer %d)\n",
  47. err_print_prefix,
  48. ev_packets[i].name,
  49. env->cabinet,
  50. env->drawer);
  51. printk("%s Module Type: 0x%x - Unit ID 0x%x - "
  52. "Condition 0x%x\n",
  53. err_print_prefix,
  54. env->module_type,
  55. env->unit_id,
  56. env->condition);
  57. }
  58. #endif /* CONFIG_VERBOSE_MCHECK */
  59. }
  60. static int
  61. marvel_process_680_frame(struct ev7_lf_subpackets *lf_subpackets, int print)
  62. {
  63. int status = MCHK_DISPOSITION_UNKNOWN_ERROR;
  64. int i;
  65. for (i = ev7_lf_env_index(EL_TYPE__PAL__ENV__AMBIENT_TEMPERATURE);
  66. i <= ev7_lf_env_index(EL_TYPE__PAL__ENV__HOT_PLUG);
  67. i++) {
  68. if (lf_subpackets->env[i])
  69. status = MCHK_DISPOSITION_REPORT;
  70. }
  71. if (print)
  72. marvel_print_680_frame(lf_subpackets);
  73. return status;
  74. }
  75. #ifdef CONFIG_VERBOSE_MCHECK
  76. static void
  77. marvel_print_err_cyc(u64 err_cyc)
  78. {
  79. static char *packet_desc[] = {
  80. "No Error",
  81. "UNKNOWN",
  82. "1 cycle (1 or 2 flit packet)",
  83. "2 cycles (3 flit packet)",
  84. "9 cycles (18 flit packet)",
  85. "10 cycles (19 flit packet)",
  86. "UNKNOWN",
  87. "UNKNOWN",
  88. "UNKNOWN"
  89. };
  90. #define IO7__ERR_CYC__ODD_FLT (1UL << 0)
  91. #define IO7__ERR_CYC__EVN_FLT (1UL << 1)
  92. #define IO7__ERR_CYC__PACKET__S (6)
  93. #define IO7__ERR_CYC__PACKET__M (0x7)