Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BACKPORT] Pull iMX9 changes from upstream #249

Merged
merged 7 commits into from
Apr 30, 2024
Merged

[BACKPORT] Pull iMX9 changes from upstream #249

merged 7 commits into from
Apr 30, 2024

Conversation

pussuw
Copy link

@pussuw pussuw commented Apr 30, 2024

DMA support, PLL support, and so forth. Everything is pulled directly from upstream.

pussuw added 7 commits April 25, 2024 10:43
ARMv8.2-A has PSCI -> it also has support for system reset
This driver supports both eDMA3 and eDMA4 (also referred to as DMA0 / DMA1
in some contexts..)

The IP blocks are almost identical, with sufficiently minor differences
to use them via a unified driver. The price is a great amount of code
obfuscation in the hardware description layer.
The frequency LUT idea is not necessary as the PLL output can be calculated
by the CPU. It is better to do this as the clocks are set by the SPL (2nd
stage program loader) which means the NuttX payload would not have access
to such a LUT anyhow.

The mask PLL_DIV_RDIV_MASK is also fixed, as that was simply wrong.

Also add call to imx9_clockconfig (although it does not do anything yet).
This patch adds a way to configure PLL frequencies. The configuration is
given by board logic.

These values should only be modified by the bootloader, but we don't have
that yet so the flag is never activated.
Add a simple allocator for DMA safe memory. It will provide contiguous
blocks of memory with D-Cache line size alignment.

NOTE: The optimal granule size is the D-Cache line size (64), but due
to restrictions in the granule allocator this would result in a maximum
block size of 2K only, thus use 256B granules instead givin 8K max block
size.

Once the granule allocator is fixed this limitation can be removed.
Using user allocated buffers for DMA transfers is not safe for two reasons:
- User space memory is virtual memory, DMA needs physical memory
- User memory buffer alignment cannot be guaranteed -> cache line ops
  are not safe
@pussuw pussuw requested a review from jlaitine April 30, 2024 12:29
@pussuw pussuw merged commit 12f8d51 into master Apr 30, 2024
11 checks passed
@pussuw pussuw deleted the imx9_backport branch April 30, 2024 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant