@@ -230,6 +230,7 @@ uint32_t pal_exerciser_set_param(EXERCISER_PARAM_TYPE Type, uint64_t Value1, uin
230230 uint64_t Base ;
231231 uint64_t Ecam ;
232232 uint32_t bdf ;
233+ uint32_t upper_range , lower_range ;
233234
234235 Base = pal_exerciser_get_ecsr_base (Bdf ,0 );
235236 Ecam = pal_exerciser_get_ecam (Bdf );
@@ -243,8 +244,13 @@ uint32_t pal_exerciser_set_param(EXERCISER_PARAM_TYPE Type, uint64_t Value1, uin
243244 return 0 ;
244245
245246 case DMA_ATTRIBUTES :
246- pal_mmio_write (Base + DMA_BUS_ADDR ,Value1 );// wrting into the DMA Control Register 2
247- pal_mmio_write (Base + DMA_LEN ,Value2 );// writing into the DMA Control Register 3
247+ /* writing into the DMA Control Register 2 */
248+ lower_range = (uint32_t )(Value1 & 0xFFFFFFFF );
249+ upper_range = (uint32_t )((Value1 >> 32 ) & 0xFFFFFFFF );
250+ pal_mmio_write (Base + DMA_BUS_ADDR , lower_range );
251+ pal_mmio_write (Base + DMA_BUS_ADDR + 4 , upper_range );
252+ /* writing into the DMA Control Register 3 */
253+ pal_mmio_write (Base + DMA_LEN , (uint32_t )Value2 );
248254 return 0 ;
249255
250256 case P2P_ATTRIBUTES :
@@ -399,6 +405,7 @@ uint32_t pal_exerciser_get_param(EXERCISER_PARAM_TYPE Type, uint64_t *Value1, ui
399405 uint32_t addr_high = 0 ;
400406 uint32_t data_low = 0 ;
401407 uint32_t data_high = 0 ;
408+ uint32_t upper_range , lower_range ;
402409
403410 Base = pal_exerciser_get_ecsr_base (Bdf ,0 );
404411 switch (Type ) {
@@ -409,8 +416,12 @@ uint32_t pal_exerciser_get_param(EXERCISER_PARAM_TYPE Type, uint64_t *Value1, ui
409416 * Value1 = pal_mmio_read (Base + INTXCTL );
410417 return pal_mmio_read (Base + INTXCTL ) | MASK_BIT ;
411418 case DMA_ATTRIBUTES :
412- * Value1 = pal_mmio_read (Base + DMA_BUS_ADDR ); // Reading the data from DMA Control Register 2
413- * Value2 = pal_mmio_read (Base + DMA_LEN ); // Reading the data from DMA Control Register 3
419+ /* Reading the data from DMA Control Register 2 */
420+ lower_range = pal_mmio_read (Base + DMA_BUS_ADDR );
421+ upper_range = pal_mmio_read (Base + DMA_BUS_ADDR + 4 );
422+ * Value1 = ((uint64_t )upper_range << 32 ) | lower_range ;
423+ /* Reading the data from DMA Control Register 3 */
424+ * Value2 = pal_mmio_read (Base + DMA_LEN );
414425 Temp = pal_mmio_read (Base + DMASTATUS );
415426 Status = Temp & MASK_BIT ;// returning the DMA status
416427 return Status ;
@@ -423,7 +434,9 @@ uint32_t pal_exerciser_get_param(EXERCISER_PARAM_TYPE Type, uint64_t *Value1, ui
423434 * Value1 = pal_mmio_read (Base + MSICTL );
424435 return pal_mmio_read (Base + MSICTL ) | MASK_BIT ;
425436 case ATS_RES_ATTRIBUTES :
426- * Value1 = pal_mmio_read (Base + ATS_ADDR );
437+ lower_range = pal_mmio_read (Base + ATS_ADDR );
438+ upper_range = pal_mmio_read (Base + ATS_ADDR + 4 );
439+ * Value1 = ((uint64_t )upper_range << 32 ) | lower_range ;
427440 return 0 ;
428441 case CFG_TXN_ATTRIBUTES :
429442 case TRANSACTION_TYPE :
@@ -509,6 +522,7 @@ uint32_t pal_exerciser_ops(EXERCISER_OPS Ops, uint64_t Param, uint32_t Bdf)
509522 uint64_t Ecam ;
510523 uint32_t CapabilityOffset = 0 ;
511524 uint32_t data ;
525+ uint32_t upper_range , lower_range ;
512526
513527 Base = pal_exerciser_get_base (Bdf ,0 );
514528 Ecam = pal_exerciser_get_ecam (Bdf ); // Getting the ECAM address
@@ -584,7 +598,10 @@ uint32_t pal_exerciser_ops(EXERCISER_OPS Ops, uint64_t Param, uint32_t Bdf)
584598 return 0 ;
585599
586600 case ATS_TXN_REQ :
587- pal_mmio_write (Base + DMA_BUS_ADDR , Param );
601+ lower_range = (uint32_t )(Param & 0xFFFFFFFF );
602+ upper_range = (uint32_t )((Param >> 32 ) & 0xFFFFFFFF );
603+ pal_mmio_write (Base + DMA_BUS_ADDR , lower_range );
604+ pal_mmio_write (Base + DMA_BUS_ADDR + 4 , upper_range );
588605 pal_mmio_write (Base + ATSCTL , ATS_TRIGGER );
589606 return !(pal_mmio_read (Base + ATSCTL ) & ATS_STATUS );
590607
0 commit comments