@@ -88,15 +88,6 @@ static struct arm_smmu_option_prop arm_smmu_options[] = {
88
88
{ 0 , NULL },
89
89
};
90
90
91
- static inline void __iomem * arm_smmu_page1_fixup (unsigned long offset ,
92
- struct arm_smmu_device * smmu )
93
- {
94
- if (offset > SZ_64K )
95
- return smmu -> page1 + offset - SZ_64K ;
96
-
97
- return smmu -> base + offset ;
98
- }
99
-
100
91
static void parse_driver_options (struct arm_smmu_device * smmu )
101
92
{
102
93
int i = 0 ;
@@ -2611,6 +2602,7 @@ static struct iommu_ops arm_smmu_ops = {
2611
2602
/* Probing and initialisation functions */
2612
2603
static int arm_smmu_init_one_queue (struct arm_smmu_device * smmu ,
2613
2604
struct arm_smmu_queue * q ,
2605
+ void __iomem * page ,
2614
2606
unsigned long prod_off ,
2615
2607
unsigned long cons_off ,
2616
2608
size_t dwords , const char * name )
@@ -2639,8 +2631,8 @@ static int arm_smmu_init_one_queue(struct arm_smmu_device *smmu,
2639
2631
1 << q -> llq .max_n_shift , name );
2640
2632
}
2641
2633
2642
- q -> prod_reg = arm_smmu_page1_fixup ( prod_off , smmu ) ;
2643
- q -> cons_reg = arm_smmu_page1_fixup ( cons_off , smmu ) ;
2634
+ q -> prod_reg = page + prod_off ;
2635
+ q -> cons_reg = page + cons_off ;
2644
2636
q -> ent_dwords = dwords ;
2645
2637
2646
2638
q -> q_base = Q_BASE_RWA ;
@@ -2684,9 +2676,9 @@ static int arm_smmu_init_queues(struct arm_smmu_device *smmu)
2684
2676
int ret ;
2685
2677
2686
2678
/* cmdq */
2687
- ret = arm_smmu_init_one_queue (smmu , & smmu -> cmdq .q , ARM_SMMU_CMDQ_PROD ,
2688
- ARM_SMMU_CMDQ_CONS , CMDQ_ENT_DWORDS ,
2689
- "cmdq" );
2679
+ ret = arm_smmu_init_one_queue (smmu , & smmu -> cmdq .q , smmu -> base ,
2680
+ ARM_SMMU_CMDQ_PROD , ARM_SMMU_CMDQ_CONS ,
2681
+ CMDQ_ENT_DWORDS , "cmdq" );
2690
2682
if (ret )
2691
2683
return ret ;
2692
2684
@@ -2695,19 +2687,19 @@ static int arm_smmu_init_queues(struct arm_smmu_device *smmu)
2695
2687
return ret ;
2696
2688
2697
2689
/* evtq */
2698
- ret = arm_smmu_init_one_queue (smmu , & smmu -> evtq .q , ARM_SMMU_EVTQ_PROD ,
2699
- ARM_SMMU_EVTQ_CONS , EVTQ_ENT_DWORDS ,
2700
- "evtq" );
2690
+ ret = arm_smmu_init_one_queue (smmu , & smmu -> evtq .q , smmu -> page1 ,
2691
+ ARM_SMMU_EVTQ_PROD , ARM_SMMU_EVTQ_CONS ,
2692
+ EVTQ_ENT_DWORDS , "evtq" );
2701
2693
if (ret )
2702
2694
return ret ;
2703
2695
2704
2696
/* priq */
2705
2697
if (!(smmu -> features & ARM_SMMU_FEAT_PRI ))
2706
2698
return 0 ;
2707
2699
2708
- return arm_smmu_init_one_queue (smmu , & smmu -> priq .q , ARM_SMMU_PRIQ_PROD ,
2709
- ARM_SMMU_PRIQ_CONS , PRIQ_ENT_DWORDS ,
2710
- "priq" );
2700
+ return arm_smmu_init_one_queue (smmu , & smmu -> priq .q , smmu -> page1 ,
2701
+ ARM_SMMU_PRIQ_PROD , ARM_SMMU_PRIQ_CONS ,
2702
+ PRIQ_ENT_DWORDS , "priq" );
2711
2703
}
2712
2704
2713
2705
static int arm_smmu_init_l1_strtab (struct arm_smmu_device * smmu )
@@ -3099,10 +3091,8 @@ static int arm_smmu_device_reset(struct arm_smmu_device *smmu, bool bypass)
3099
3091
3100
3092
/* Event queue */
3101
3093
writeq_relaxed (smmu -> evtq .q .q_base , smmu -> base + ARM_SMMU_EVTQ_BASE );
3102
- writel_relaxed (smmu -> evtq .q .llq .prod ,
3103
- arm_smmu_page1_fixup (ARM_SMMU_EVTQ_PROD , smmu ));
3104
- writel_relaxed (smmu -> evtq .q .llq .cons ,
3105
- arm_smmu_page1_fixup (ARM_SMMU_EVTQ_CONS , smmu ));
3094
+ writel_relaxed (smmu -> evtq .q .llq .prod , smmu -> page1 + ARM_SMMU_EVTQ_PROD );
3095
+ writel_relaxed (smmu -> evtq .q .llq .cons , smmu -> page1 + ARM_SMMU_EVTQ_CONS );
3106
3096
3107
3097
enables |= CR0_EVTQEN ;
3108
3098
ret = arm_smmu_write_reg_sync (smmu , enables , ARM_SMMU_CR0 ,
@@ -3117,9 +3107,9 @@ static int arm_smmu_device_reset(struct arm_smmu_device *smmu, bool bypass)
3117
3107
writeq_relaxed (smmu -> priq .q .q_base ,
3118
3108
smmu -> base + ARM_SMMU_PRIQ_BASE );
3119
3109
writel_relaxed (smmu -> priq .q .llq .prod ,
3120
- arm_smmu_page1_fixup ( ARM_SMMU_PRIQ_PROD , smmu ) );
3110
+ smmu -> page1 + ARM_SMMU_PRIQ_PROD );
3121
3111
writel_relaxed (smmu -> priq .q .llq .cons ,
3122
- arm_smmu_page1_fixup ( ARM_SMMU_PRIQ_CONS , smmu ) );
3112
+ smmu -> page1 + ARM_SMMU_PRIQ_CONS );
3123
3113
3124
3114
enables |= CR0_PRIQEN ;
3125
3115
ret = arm_smmu_write_reg_sync (smmu , enables , ARM_SMMU_CR0 ,
0 commit comments