31
31
32
32
static int edac_mc_idx ;
33
33
34
- static u32 orig_ddr_err_disable ;
35
- static u32 orig_ddr_err_sbe ;
36
- static bool little_endian ;
37
-
38
34
static inline u32 ddr_in32 (struct fsl_mc_pdata * pdata , unsigned int off )
39
35
{
40
36
void __iomem * addr = pdata -> mc_vbase + off ;
41
37
42
- return little_endian ? ioread32 (addr ) : ioread32be (addr );
38
+ return pdata -> little_endian ? ioread32 (addr ) : ioread32be (addr );
43
39
}
44
40
45
41
static inline void ddr_out32 (struct fsl_mc_pdata * pdata , unsigned int off , u32 value )
46
42
{
47
43
void __iomem * addr = pdata -> mc_vbase + off ;
48
44
49
- if (little_endian )
45
+ if (pdata -> little_endian )
50
46
iowrite32 (value , addr );
51
47
else
52
48
iowrite32be (value , addr );
@@ -511,7 +507,7 @@ int fsl_mc_err_probe(struct platform_device *op)
511
507
* Get the endianness of DDR controller registers.
512
508
* Default is big endian.
513
509
*/
514
- little_endian = of_property_read_bool (op -> dev .of_node , "little-endian" );
510
+ pdata -> little_endian = of_property_read_bool (op -> dev .of_node , "little-endian" );
515
511
516
512
res = of_address_to_resource (op -> dev .of_node , 0 , & r );
517
513
if (res ) {
@@ -562,7 +558,7 @@ int fsl_mc_err_probe(struct platform_device *op)
562
558
fsl_ddr_init_csrows (mci );
563
559
564
560
/* store the original error disable bits */
565
- orig_ddr_err_disable = ddr_in32 (pdata , FSL_MC_ERR_DISABLE );
561
+ pdata -> orig_ddr_err_disable = ddr_in32 (pdata , FSL_MC_ERR_DISABLE );
566
562
ddr_out32 (pdata , FSL_MC_ERR_DISABLE , 0 );
567
563
568
564
/* clear all error bits */
@@ -579,8 +575,8 @@ int fsl_mc_err_probe(struct platform_device *op)
579
575
DDR_EIE_MBEE | DDR_EIE_SBEE );
580
576
581
577
/* store the original error management threshold */
582
- orig_ddr_err_sbe = ddr_in32 (pdata ,
583
- FSL_MC_ERR_SBE ) & 0xff0000 ;
578
+ pdata -> orig_ddr_err_sbe = ddr_in32 (pdata ,
579
+ FSL_MC_ERR_SBE ) & 0xff0000 ;
584
580
585
581
/* set threshold to 1 error per interrupt */
586
582
ddr_out32 (pdata , FSL_MC_ERR_SBE , 0x10000 );
@@ -628,8 +624,9 @@ void fsl_mc_err_remove(struct platform_device *op)
628
624
}
629
625
630
626
ddr_out32 (pdata , FSL_MC_ERR_DISABLE ,
631
- orig_ddr_err_disable );
632
- ddr_out32 (pdata , FSL_MC_ERR_SBE , orig_ddr_err_sbe );
627
+ pdata -> orig_ddr_err_disable );
628
+ ddr_out32 (pdata , FSL_MC_ERR_SBE , pdata -> orig_ddr_err_sbe );
629
+
633
630
634
631
edac_mc_del_mc (& op -> dev );
635
632
edac_mc_free (mci );
0 commit comments