What to set P3041 PAMU window address and window size to

cancel
Showing results for 
Search instead for 
Did you mean: 

What to set P3041 PAMU window address and window size to

1,123 Views
david-snc
Contributor I

We are using a P3041 with an RTOS that enables and configures the PAMU for devices including DMA. We want to DMA from a source address on the ELBC, for example, 0xc0000000, to a destination buffer in RAM (right now its a section aligned by 0x1000 ).  Our transfers do not work. we get a Transfer Error indication from the DMA. We can DMA from RAM to RAM with no problem. We know that the devices on the ELBC are visible to the CPU and other than DMA everything has been working fine. So right now we have to do the transfer using the cpu but we want to use DMA instead.

The RTOS BSP sets the PAMU PAACE structure for DMA0 to windows base 0x00000000 with size of 0x1e (2GB. == ram size). What we don't understand is how the PAMU is told the address of the device on the ELBC. If that even needs to be done. Does the window need to enclose both the source address and the destination address? Or a better question, for the DMA controller, does the PAMU want the window address to be in the destination address in RAM or be the address of the device?

We wish the freescale p3041RM documentation had a better explanation of how to set the PAACE

0 Kudos
3 Replies

674 Views
matevzlangus
Contributor III

Hi NXP,

I wonder whether there is debugfs entry in Linux (5.4.3) for T4240 to dump entire PAMU configuration for all LIODNs?

Or any other code with formatted output?

regards,

Matevz

0 Kudos

759 Views
lunminliang
NXP Employee
NXP Employee

Hello david howard,

To dump the PAMU configurations when Linux is running, with the same steps.

You could read the Linux PAMU driver at  "linux/drivers/iommu/fsl_pamu.c". Usually, the linux kernel will setup a one-to-one mapping for whole address space from IO address to physical address for all the LIODNs.

Have a great day,
Lunmin

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

759 Views
lunminliang
NXP Employee
NXP Employee

Hello david howard,

If you still encounter transfer error after create necessary PAACE entries, please dump the PAMU configuration as follows:

* dump the DMA n Logical I/O Device Number Register (DMAnLIODNR), to get the LIODN number, for example liodn=0xc4

* dump the Primary PAACT Base Address Register for 64-bit physical address of PAACT, for example base=0x28188000

* dump the PACCTs for DMA n at physical address = 0x28188000+0xc4*0x40 = 0x2818b100, make sure both source and destination address are configured correctly

You could compare your configuration with the default configuration on Linux.


Have a great day,
Lunmin

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos