8000 Allwinner A10 DTS fix for ARM PMU IRQ and EMAC DMA by Ryzer58 · Pull Request #7567 · armbian/build · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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 15 commits into from
Dec 13, 2024

Conversation

Ryzer58
Copy link
Contributor
@Ryzer58 Ryzer58 commented Dec 12, 2024

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:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes generate no new warnings

@github-actions github-actions bot added size/medium PR with more then 50 and less then 250 lines Needs review Seeking for review Hardware Hardware related like kernel, U-Boot, ... labels Dec 12, 2024
@github-actions github-actions bot added the Patches Patches related to kernel, U-Boot, ... label Dec 12, 2024
@igorpecovnik igorpecovnik added Ready to merge Reviewed, tested and ready for merge 02 Milestone: First quarter release and removed Needs review Seeking for review labels Dec 13, 2024
@igorpecovnik igorpecovnik merged commit a71b867 into armbian:main Dec 13, 2024
The-going added a commit to The-going/armbian-build that referenced this pull request Dec 16, 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
Development

Successfully merging this pull request may close these issues.

2 participants
0