@@ -95,6 +95,8 @@ static void megasas_free_reply_fusion(struct megasas_instance *instance);
95
95
static inline
96
96
void megasas_configure_queue_sizes (struct megasas_instance * instance );
97
97
static void megasas_fusion_crash_dump (struct megasas_instance * instance );
98
+ extern u32 megasas_readl (struct megasas_instance * instance ,
99
+ const volatile void __iomem * addr );
98
100
99
101
/**
100
102
* megasas_check_same_4gb_region - check if allocation
@@ -267,7 +269,8 @@ megasas_fusion_update_can_queue(struct megasas_instance *instance, int fw_boot_c
267
269
/* ventura FW does not fill outbound_scratch_pad_2 with queue depth */
268
270
if (instance -> adapter_type < VENTURA_SERIES )
269
271
cur_max_fw_cmds =
270
- readl (& instance -> reg_set -> outbound_scratch_pad_2 ) & 0x00FFFF ;
272
+ megasas_readl (instance ,
273
+ & instance -> reg_set -> outbound_scratch_pad_2 ) & 0x00FFFF ;
271
274
272
275
if (dual_qdepth_disable || !cur_max_fw_cmds )
273
276
cur_max_fw_cmds = instance -> instancet -> read_fw_status_reg (instance ) & 0x00FFFF ;
@@ -984,8 +987,8 @@ megasas_ioc_init_fusion(struct megasas_instance *instance)
984
987
985
988
cmd = fusion -> ioc_init_cmd ;
986
989
987
- scratch_pad_1 = readl
988
- (& instance -> reg_set -> outbound_scratch_pad_1 );
990
+ scratch_pad_1 = megasas_readl
991
+ (instance , & instance -> reg_set -> outbound_scratch_pad_1 );
989
992
990
993
cur_rdpq_mode = (scratch_pad_1 & MR_RDPQ_MODE_OFFSET ) ? 1 : 0 ;
991
994
@@ -1104,7 +1107,7 @@ megasas_ioc_init_fusion(struct megasas_instance *instance)
1104
1107
instance -> instancet -> disable_intr (instance );
1105
1108
1106
1109
for (i = 0 ; i < (10 * 1000 ); i += 20 ) {
1107
- if (readl ( & instance -> reg_set -> doorbell ) & 1 )
1110
+ if (megasas_readl ( instance , & instance -> reg_set -> doorbell ) & 1 )
1108
1111
msleep (20 );
1109
1112
else
1110
1113
break ;
@@ -1653,7 +1656,8 @@ megasas_init_adapter_fusion(struct megasas_instance *instance)
1653
1656
1654
1657
megasas_configure_queue_sizes (instance );
1655
1658
1656
- scratch_pad_1 = readl (& instance -> reg_set -> outbound_scratch_pad_1 );
1659
+ scratch_pad_1 = megasas_readl (instance ,
1660
+ & instance -> reg_set -> outbound_scratch_pad_1 );
1657
1661
/* If scratch_pad_1 & MEGASAS_MAX_CHAIN_SIZE_UNITS_MASK is set,
1658
1662
* Firmware support extended IO chain frame which is 4 times more than
1659
1663
* legacy Firmware.
@@ -3731,7 +3735,7 @@ megasas_release_fusion(struct megasas_instance *instance)
3731
3735
static u32
3732
3736
megasas_read_fw_status_reg_fusion (struct megasas_instance * instance )
3733
3737
{
3734
- return readl ( & instance -> reg_set -> outbound_scratch_pad_0 );
3738
+ return megasas_readl ( instance , & instance -> reg_set -> outbound_scratch_pad_0 );
3735
3739
}
3736
3740
3737
3741
/**
@@ -3793,11 +3797,12 @@ megasas_adp_reset_fusion(struct megasas_instance *instance,
3793
3797
writel (MPI2_WRSEQ_6TH_KEY_VALUE , & instance -> reg_set -> fusion_seq_offset );
3794
3798
3795
3799
/* Check that the diag write enable (DRWE) bit is on */
3796
- host_diag = readl ( & instance -> reg_set -> fusion_host_diag );
3800
+ host_diag = megasas_readl ( instance , & instance -> reg_set -> fusion_host_diag );
3797
3801
retry = 0 ;
3798
3802
while (!(host_diag & HOST_DIAG_WRITE_ENABLE )) {
3799
3803
msleep (100 );
3800
- host_diag = readl (& instance -> reg_set -> fusion_host_diag );
3804
+ host_diag = megasas_readl (instance ,
3805
+ & instance -> reg_set -> fusion_host_diag );
3801
3806
if (retry ++ == 100 ) {
3802
3807
dev_warn (& instance -> pdev -> dev ,
3803
3808
"Host diag unlock failed from %s %d\n" ,
@@ -3814,11 +3819,12 @@ megasas_adp_reset_fusion(struct megasas_instance *instance,
3814
3819
msleep (3000 );
3815
3820
3816
3821
/* Make sure reset adapter bit is cleared */
3817
- host_diag = readl ( & instance -> reg_set -> fusion_host_diag );
3822
+ host_diag = megasas_readl ( instance , & instance -> reg_set -> fusion_host_diag );
3818
3823
retry = 0 ;
3819
3824
while (host_diag & HOST_DIAG_RESET_ADAPTER ) {
3820
3825
msleep (100 );
3821
- host_diag = readl (& instance -> reg_set -> fusion_host_diag );
3826
+ host_diag = megasas_readl (instance ,
3827
+ & instance -> reg_set -> fusion_host_diag );
3822
3828
if (retry ++ == 1000 ) {
3823
3829
dev_warn (& instance -> pdev -> dev ,
3824
3830
"Diag reset adapter never cleared %s %d\n" ,
@@ -4607,7 +4613,7 @@ int megasas_reset_fusion(struct Scsi_Host *shost, int reason)
4607
4613
dev_info (& instance -> pdev -> dev , "IO/DCMD timeout is detected, "
4608
4614
"forcibly FAULT Firmware\n" );
4609
4615
atomic_set (& instance -> adprecovery , MEGASAS_ADPRESET_SM_INFAULT );
4610
- status_reg = readl ( & instance -> reg_set -> doorbell );
4616
+ status_reg = megasas_readl ( instance , & instance -> reg_set -> doorbell );
4611
4617
writel (status_reg | MFI_STATE_FORCE_OCR ,
4612
4618
& instance -> reg_set -> doorbell );
4613
4619
readl (& instance -> reg_set -> doorbell );
0 commit comments