-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Allwinner A10 DTS fix for ARM PMU IRQ and EMAC DMA #7567
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… the Allwinner A10User manual to resolve conflict with Uart 2 which actually uses interrupt source number 3
… support only exist in the driver for the rx channel
Signed-off-by: Ryan L <ryestar101@gmail.com>
Signed-off-by: Ryan L <ryestar101@gmail.com>
Signed-off-by: Ryan L <ryestar101@gmail.com>
Signed-off-by: Ryan L <ryestar101@gmail.com>
igorpecovnik
approved these changes
Dec 13, 2024
The-going
added a commit
to The-going/armbian-build
that referenced
this pull request
Dec 16, 2024
2 tasks
igorpecovnik
pushed a commit
that referenced
this pull request
Dec 18, 2024
CelestialCrafter
pushed a commit
to CelestialCrafter/armbian-build
that referenced
this pull request
May 11, 2025
* Correcting the Perf unit's interrupt source number to 66 as stated in the Allwinner A10User manual to resolve conflict with Uart 2 which actually uses interrupt source number 3 * rename to all lower case and add in sun4i-emac dma support. Note that support only exist in the driver for the rx channel * Ensure that sun4i patches actually implemented Signed-off-by: Ryan L <ryestar101@gmail.com> * Apply performance monitoring unit IRQ number patch to uboot * Add patch for resolving the perf unit irq number to the edge kernel Signed-off-by: Ryan L <ryestar101@gmail.com> * Add sun4i emac ethernet DMA support to the edge kernel Signed-off-by: Ryan L <ryestar101@gmail.com> * Append missing .patch so that our patch is found and works properly Signed-off-by: Ryan L <ryestar101@gmail.com> * Apply EMAC DMA support and PMU fix to edge kernel --------- Signed-off-by: Ryan L <ryestar101@gmail.com>
CelestialCrafter
pushed a commit
to CelestialCrafter/armbian-build
that referenced
this pull request
May 11, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
02
Milestone: First quarter release
Hardware
Hardware related like kernel, U-Boot, ...
Patches
Patches related to kernel, U-Boot, ...
Ready to merge
Reviewed, tested and ready for merge
size/medium
PR with more then 50 and less then 250 lines
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Firstly this a pacth to the Allwinner A10 device tree to enable UART2 to function correctly by resolving conflict with the ARM PMU IRQ. When UART2 is enabled via the UART2 overlay and we are unable to access it and the following error is generated in the kernel log:
genirq: Flags mismatch irq 17. 00000080 (ttyS1) vs. 00090c00 (arm-pmu).
Please note that due to the aliasing currently being incorrectly configured in the overlay, UART2 is registered as ttyS1 rather than ttyS2. This will be addressed in a subsequent patch. Inspecting the device tree revealed that both the performance monitor unit and UART2 share the same irq number. The irq table listed on pages 110 - 112 of the Allwinner A10 user manual, identifies that UART2 correctly set an IRQ of 3. However, it indicates that the performance monitoring unit should be assigned an IRQ of 66, which this patch addresses. This change allows UART2 to be accessed without any conflict.
Additionally a different error relating to the EMAC can also be patched within the device tree. When the sun4i Ethernet controller is initialised, it fails to allocate a DMA channel as noted in the kernel log below:
sun4i-emac 1c0b000.ethernet (unnamed net_device) (uninitialized): failed to request dma channel. dma is disable
sun4i-emac 1c0b000.ethernet (unnamed net_device) (uninitialized): configure dma failed. disable dma.
Upon investigating the error I found that support for DMA on the rx channel had been incorporated into the EMAC driver but no corresponding DMA entry had been made under the EMAC node. This patch adds support for a dedicated DMA Channel. please see here for more details: https://lore.kernel.org/linux-arm-kernel/YdHjK+%2FSzaeI%2FV2Q@Red/
How Has This Been Tested?
Built and tested on the Pcduino2 running Armbian-unofficial_24.2.0-trunk_Pcduino2_jammy_current_6.6.54
With ARM PMU IRQ configured its still mapped to IRQ 17by the kernel but we no longer get the genirq error.
cat /proc/interrupts | grep pmu
17: 0 sun4i_irq 66 Edge arm-pmu
UART2 is not listed here, however we can see from the kernel log that UART2 is mapped to an IRQ of 54:
1c28800.serial: ttyS1 at MMIO 0x1c28800 (irq = 54, base_baud = 1500000) is a 16550A
With EMAC DMA support eanbled, we now get the following lines in the kernel log
sudo dmesg | grep emac
[ 3.937292] sun4i-emac 1c0b000.ethernet (unnamed net_device) (uninitialized): get io resource from device: 0x01c0b000, size = 4096
[ 3.951597] sun4i-emac 1c0b000.ethernet: eth0: at (ptrval), IRQ 55 MAC: 02:92:0c:01:40:86
Checklist: