|  | @@ -104,3 +104,115 @@ marvel_print_err_cyc(u64 err_cyc)
 | 
	
		
			
				|  |  |  #define IO7__ERR_CYC__EVN_FLT	(1UL <<  1)
 | 
	
		
			
				|  |  |  #define IO7__ERR_CYC__PACKET__S	(6)
 | 
	
		
			
				|  |  |  #define IO7__ERR_CYC__PACKET__M	(0x7)
 | 
	
		
			
				|  |  | +#define IO7__ERR_CYC__LOC	(1UL <<  5)
 | 
	
		
			
				|  |  | +#define IO7__ERR_CYC__CYCLE__S	(2)
 | 
	
		
			
				|  |  | +#define IO7__ERR_CYC__CYCLE__M	(0x7)
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	printk("%s        Packet In Error: %s\n"
 | 
	
		
			
				|  |  | +	       "%s        Error in %s, cycle %lld%s%s\n",
 | 
	
		
			
				|  |  | +	       err_print_prefix, 
 | 
	
		
			
				|  |  | +	       packet_desc[EXTRACT(err_cyc, IO7__ERR_CYC__PACKET)],
 | 
	
		
			
				|  |  | +	       err_print_prefix,
 | 
	
		
			
				|  |  | +	       (err_cyc & IO7__ERR_CYC__LOC) ? "DATA" : "HEADER",
 | 
	
		
			
				|  |  | +	       EXTRACT(err_cyc, IO7__ERR_CYC__CYCLE),
 | 
	
		
			
				|  |  | +	       (err_cyc & IO7__ERR_CYC__ODD_FLT) ? " [ODD Flit]": "",
 | 
	
		
			
				|  |  | +	       (err_cyc & IO7__ERR_CYC__EVN_FLT) ? " [Even Flit]": "");
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +static void
 | 
	
		
			
				|  |  | +marvel_print_po7_crrct_sym(u64 crrct_sym)
 | 
	
		
			
				|  |  | +{
 | 
	
		
			
				|  |  | +#define IO7__PO7_CRRCT_SYM__SYN__S	(0)
 | 
	
		
			
				|  |  | +#define IO7__PO7_CRRCT_SYM__SYN__M	(0x7f)
 | 
	
		
			
				|  |  | +#define IO7__PO7_CRRCT_SYM__ERR_CYC__S	(7)   /* ERR_CYC + ODD_FLT + EVN_FLT */
 | 
	
		
			
				|  |  | +#define IO7__PO7_CRRCT_SYM__ERR_CYC__M	(0x1ff)
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	printk("%s      Correctable Error Symptoms:\n"
 | 
	
		
			
				|  |  | +	       "%s        Syndrome: 0x%llx\n",
 | 
	
		
			
				|  |  | +	       err_print_prefix,
 | 
	
		
			
				|  |  | +	       err_print_prefix, EXTRACT(crrct_sym, IO7__PO7_CRRCT_SYM__SYN));
 | 
	
		
			
				|  |  | +	marvel_print_err_cyc(EXTRACT(crrct_sym, IO7__PO7_CRRCT_SYM__ERR_CYC));
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +static void
 | 
	
		
			
				|  |  | +marvel_print_po7_uncrr_sym(u64 uncrr_sym, u64 valid_mask)
 | 
	
		
			
				|  |  | +{
 | 
	
		
			
				|  |  | +	static char *clk_names[] = { "_h[0]", "_h[1]", "_n[0]", "_n[1]" };
 | 
	
		
			
				|  |  | +	static char *clk_decode[] = {
 | 
	
		
			
				|  |  | +		"No Error",
 | 
	
		
			
				|  |  | +		"One extra rising edge",
 | 
	
		
			
				|  |  | +		"Two extra rising edges",
 | 
	
		
			
				|  |  | +		"Lost one clock"
 | 
	
		
			
				|  |  | +	};
 | 
	
		
			
				|  |  | +	static char *port_names[] = { "Port 0", 	"Port 1", 
 | 
	
		
			
				|  |  | +				      "Port 2", 	"Port 3",
 | 
	
		
			
				|  |  | +				      "Unknown Port",	"Unknown Port",
 | 
	
		
			
				|  |  | +				      "Unknown Port",	"Port 7" };
 | 
	
		
			
				|  |  | +	int scratch, i;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +#define IO7__PO7_UNCRR_SYM__SYN__S	    (0)
 | 
	
		
			
				|  |  | +#define IO7__PO7_UNCRR_SYM__SYN__M	    (0x7f)
 | 
	
		
			
				|  |  | +#define IO7__PO7_UNCRR_SYM__ERR_CYC__S	    (7)      /* ERR_CYC + ODD_FLT... */
 | 
	
		
			
				|  |  | +#define IO7__PO7_UNCRR_SYM__ERR_CYC__M	    (0x1ff)  /* ... + EVN_FLT        */
 | 
	
		
			
				|  |  | +#define IO7__PO7_UNCRR_SYM__CLK__S	    (16)
 | 
	
		
			
				|  |  | +#define IO7__PO7_UNCRR_SYM__CLK__M	    (0xff)
 | 
	
		
			
				|  |  | +#define IO7__PO7_UNCRR_SYM__CDT_OVF_TO__REQ (1UL << 24)
 | 
	
		
			
				|  |  | +#define IO7__PO7_UNCRR_SYM__CDT_OVF_TO__RIO (1UL << 25)
 | 
	
		
			
				|  |  | +#define IO7__PO7_UNCRR_SYM__CDT_OVF_TO__WIO (1UL << 26)
 | 
	
		
			
				|  |  | +#define IO7__PO7_UNCRR_SYM__CDT_OVF_TO__BLK (1UL << 27)
 | 
	
		
			
				|  |  | +#define IO7__PO7_UNCRR_SYM__CDT_OVF_TO__NBK (1UL << 28)
 | 
	
		
			
				|  |  | +#define IO7__PO7_UNCRR_SYM__OVF__READIO	    (1UL << 29)
 | 
	
		
			
				|  |  | +#define IO7__PO7_UNCRR_SYM__OVF__WRITEIO    (1UL << 30)
 | 
	
		
			
				|  |  | +#define IO7__PO7_UNCRR_SYM__OVF__FWD        (1UL << 31)
 | 
	
		
			
				|  |  | +#define IO7__PO7_UNCRR_SYM__VICTIM_SP__S    (32)
 | 
	
		
			
				|  |  | +#define IO7__PO7_UNCRR_SYM__VICTIM_SP__M    (0xff)
 | 
	
		
			
				|  |  | +#define IO7__PO7_UNCRR_SYM__DETECT_SP__S    (40)
 | 
	
		
			
				|  |  | +#define IO7__PO7_UNCRR_SYM__DETECT_SP__M    (0xff)
 | 
	
		
			
				|  |  | +#define IO7__PO7_UNCRR_SYM__STRV_VTR__S     (48)
 | 
	
		
			
				|  |  | +#define IO7__PO7_UNCRR_SYM__STRV_VTR__M     (0x3ff)
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +#define IO7__STRV_VTR__LSI__INTX__S	    (0)
 | 
	
		
			
				|  |  | +#define IO7__STRV_VTR__LSI__INTX__M	    (0x3)
 | 
	
		
			
				|  |  | +#define IO7__STRV_VTR__LSI__SLOT__S	    (2)
 | 
	
		
			
				|  |  | +#define IO7__STRV_VTR__LSI__SLOT__M	    (0x7)
 | 
	
		
			
				|  |  | +#define IO7__STRV_VTR__LSI__BUS__S	    (5)
 | 
	
		
			
				|  |  | +#define IO7__STRV_VTR__LSI__BUS__M	    (0x3)
 | 
	
		
			
				|  |  | +#define IO7__STRV_VTR__MSI__INTNUM__S	    (0)
 | 
	
		
			
				|  |  | +#define IO7__STRV_VTR__MSI__INTNUM__M	    (0x1ff)
 | 
	
		
			
				|  |  | +#define IO7__STRV_VTR__IS_MSI		    (1UL << 9)
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	printk("%s      Uncorrectable Error Symptoms:\n", err_print_prefix);
 | 
	
		
			
				|  |  | +	uncrr_sym &= valid_mask;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	if (EXTRACT(valid_mask, IO7__PO7_UNCRR_SYM__SYN))
 | 
	
		
			
				|  |  | +		printk("%s        Syndrome: 0x%llx\n",
 | 
	
		
			
				|  |  | +		       err_print_prefix, 
 | 
	
		
			
				|  |  | +		       EXTRACT(uncrr_sym, IO7__PO7_UNCRR_SYM__SYN));
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	if (EXTRACT(valid_mask, IO7__PO7_UNCRR_SYM__ERR_CYC))
 | 
	
		
			
				|  |  | +		marvel_print_err_cyc(EXTRACT(uncrr_sym, 
 | 
	
		
			
				|  |  | +					     IO7__PO7_UNCRR_SYM__ERR_CYC));
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	scratch = EXTRACT(uncrr_sym, IO7__PO7_UNCRR_SYM__CLK);
 | 
	
		
			
				|  |  | +	for (i = 0; i < 4; i++, scratch >>= 2) {
 | 
	
		
			
				|  |  | +		if (scratch & 0x3)
 | 
	
		
			
				|  |  | +			printk("%s        Clock %s: %s\n",
 | 
	
		
			
				|  |  | +			       err_print_prefix,
 | 
	
		
			
				|  |  | +			       clk_names[i], clk_decode[scratch & 0x3]);
 | 
	
		
			
				|  |  | +	}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	if (uncrr_sym & IO7__PO7_UNCRR_SYM__CDT_OVF_TO__REQ) 
 | 
	
		
			
				|  |  | +		printk("%s       REQ Credit Timeout or Overflow\n",
 | 
	
		
			
				|  |  | +		       err_print_prefix);
 | 
	
		
			
				|  |  | +	if (uncrr_sym & IO7__PO7_UNCRR_SYM__CDT_OVF_TO__RIO) 
 | 
	
		
			
				|  |  | +		printk("%s       RIO Credit Timeout or Overflow\n",
 | 
	
		
			
				|  |  | +		       err_print_prefix);
 | 
	
		
			
				|  |  | +	if (uncrr_sym & IO7__PO7_UNCRR_SYM__CDT_OVF_TO__WIO) 
 | 
	
		
			
				|  |  | +		printk("%s       WIO Credit Timeout or Overflow\n",
 | 
	
		
			
				|  |  | +		       err_print_prefix);
 | 
	
		
			
				|  |  | +	if (uncrr_sym & IO7__PO7_UNCRR_SYM__CDT_OVF_TO__BLK) 
 | 
	
		
			
				|  |  | +		printk("%s       BLK Credit Timeout or Overflow\n",
 | 
	
		
			
				|  |  | +		       err_print_prefix);
 | 
	
		
			
				|  |  | +	if (uncrr_sym & IO7__PO7_UNCRR_SYM__CDT_OVF_TO__NBK) 
 | 
	
		
			
				|  |  | +		printk("%s       NBK Credit Timeout or Overflow\n",
 |