mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-25 16:31:13 +00:00
2e715fb4fc
Add support for BCM2712 (Raspberry Pi 5).
3bb5880ab3
Patches were generated from the diff between linux kernel branch linux-6.1.y
and rpi-6.1.y from raspberry pi kernel source:
- git format-patch linux-6.1.y...rpi-6.1.y
Build system: x86_64
Build-tested: bcm2708, bcm2709, bcm2710, bcm2711
Run-tested: bcm2710/RPi3B, bcm2711/RPi4B
Signed-off-by: Marty Jones <mj8263788@gmail.com>
[Remove applied and reverted patches, squash patches and config commits]
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
76 lines
2.9 KiB
Diff
76 lines
2.9 KiB
Diff
From cfad3f71fc450639fc259d576d0903e9132fe34a Mon Sep 17 00:00:00 2001
|
|
From: Dom Cobley <popcornmix@gmail.com>
|
|
Date: Thu, 25 May 2023 14:48:28 +0100
|
|
Subject: [PATCH] dmaengine: bcm2835: Rename to_bcm2711_cbaddr to
|
|
to_40bit_cbaddr
|
|
|
|
As the shifted address also applies to bcm2712,
|
|
give the function a more specific name.
|
|
|
|
Signed-off-by: Dom Cobley <popcornmix@gmail.com>
|
|
---
|
|
drivers/dma/bcm2835-dma.c | 16 ++++++++--------
|
|
1 file changed, 8 insertions(+), 8 deletions(-)
|
|
|
|
--- a/drivers/dma/bcm2835-dma.c
|
|
+++ b/drivers/dma/bcm2835-dma.c
|
|
@@ -390,7 +390,7 @@ static inline uint32_t to_bcm2711_dsti(u
|
|
BCM2711_DMA40_BURST_LEN(BCM2835_DMA_GET_BURST_LENGTH(info));
|
|
}
|
|
|
|
-static inline uint32_t to_bcm2711_cbaddr(dma_addr_t addr)
|
|
+static inline uint32_t to_40bit_cbaddr(dma_addr_t addr)
|
|
{
|
|
BUG_ON(addr & 0x1f);
|
|
return (addr >> 5);
|
|
@@ -573,9 +573,9 @@ static struct bcm2835_desc *bcm2835_dma_
|
|
if (frame && c->is_40bit_channel)
|
|
((struct bcm2711_dma40_scb *)
|
|
d->cb_list[frame - 1].cb)->next_cb =
|
|
- to_bcm2711_cbaddr(cb_entry->paddr);
|
|
+ to_40bit_cbaddr(cb_entry->paddr);
|
|
if (frame && !c->is_40bit_channel)
|
|
- d->cb_list[frame - 1].cb->next = to_bcm2711_cbaddr(cb_entry->paddr);
|
|
+ d->cb_list[frame - 1].cb->next = to_40bit_cbaddr(cb_entry->paddr);
|
|
|
|
/* update src and dst and length */
|
|
if (src && (info & BCM2835_DMA_S_INC)) {
|
|
@@ -755,14 +755,14 @@ static void bcm2835_dma_start_desc(struc
|
|
c->desc = d = to_bcm2835_dma_desc(&vd->tx);
|
|
|
|
if (c->is_40bit_channel) {
|
|
- writel(to_bcm2711_cbaddr(d->cb_list[0].paddr),
|
|
+ writel(to_40bit_cbaddr(d->cb_list[0].paddr),
|
|
c->chan_base + BCM2711_DMA40_CB);
|
|
writel(BCM2711_DMA40_ACTIVE | BCM2711_DMA40_PROT | BCM2711_DMA40_CS_FLAGS(c->dreq),
|
|
c->chan_base + BCM2711_DMA40_CS);
|
|
} else {
|
|
writel(BIT(31), c->chan_base + BCM2835_DMA_CS);
|
|
|
|
- writel(to_bcm2711_cbaddr(d->cb_list[0].paddr),
|
|
+ writel(to_40bit_cbaddr(d->cb_list[0].paddr),
|
|
c->chan_base + BCM2835_DMA_ADDR);
|
|
writel(BCM2835_DMA_ACTIVE | BCM2835_DMA_CS_FLAGS(c->dreq),
|
|
c->chan_base + BCM2835_DMA_CS);
|
|
@@ -1130,9 +1130,9 @@ static struct dma_async_tx_descriptor *b
|
|
if (c->is_40bit_channel)
|
|
((struct bcm2711_dma40_scb *)
|
|
d->cb_list[frames - 1].cb)->next_cb =
|
|
- to_bcm2711_cbaddr(d->cb_list[0].paddr);
|
|
+ to_40bit_cbaddr(d->cb_list[0].paddr);
|
|
else
|
|
- d->cb_list[d->frames - 1].cb->next = to_bcm2711_cbaddr(d->cb_list[0].paddr);
|
|
+ d->cb_list[d->frames - 1].cb->next = to_40bit_cbaddr(d->cb_list[0].paddr);
|
|
|
|
return vchan_tx_prep(&c->vc, &d->vd, flags);
|
|
}
|
|
@@ -1252,7 +1252,7 @@ void bcm2711_dma40_memcpy(dma_addr_t dst
|
|
scb->len = size;
|
|
scb->next_cb = 0;
|
|
|
|
- writel(to_bcm2711_cbaddr(memcpy_scb_dma), memcpy_chan + BCM2711_DMA40_CB);
|
|
+ writel(to_40bit_cbaddr(memcpy_scb_dma), memcpy_chan + BCM2711_DMA40_CB);
|
|
writel(BCM2711_DMA40_MEMCPY_FLAGS | BCM2711_DMA40_ACTIVE | BCM2711_DMA40_PROT,
|
|
memcpy_chan + BCM2711_DMA40_CS);
|
|
|