* [PATCH 0/2] Enable WiFi on Spacemit K3 Pico ITX
@ 2026-07-16 3:21 Anirudh Srinivasan
2026-07-16 3:21 ` [PATCH 1/2] PCI: Move Spacemit vendor and device ID to linux/pci_Ids.h Anirudh Srinivasan
2026-07-16 3:21 ` [PATCH 2/2] wifi: rtw89: pci: enable 36-bit DMA on spacemit K3 Anirudh Srinivasan
0 siblings, 2 replies; 6+ messages in thread
From: Anirudh Srinivasan @ 2026-07-16 3:21 UTC (permalink / raw)
To: Bjorn Helgaas, Yixun Lan, Ping-Ke Shih, Lorenzo Pieralisi,
Krzysztof Wilczyński, Manivannan Sadhasivam, Rob Herring,
Inochi Amaoto
Cc: linux-pci, linux-kernel, linux-riscv, spacemit, linux-wireless,
Anirudh Srinivasan
The Spacemit K3 Pico ITX has a RTL8852BE Wifi card attached via PCIe.
The probe for the rtw89 driver currently fails because driver tries to
allocate a kernel page with GFP_DMA32, and this board has memory only
above the 32 bit range. The rtw89 driver has the ability to use 36 bit
DMA addresses, but this is only enabled for certain PCIe bridge/rootport
that have been validated to work on. Enable this ability for the PCIe
root port. A similar patch seems to exist in the vendor kernel tree.
To test this, you'll need the 3 patch series adding the K3 PCIe RC
Driver[1], K3 PCIe Phy[2] and K3 PCIe DTS[3].I have marked only [1] as
a depedency in b4 because this series doesn't depend on [2] or [3] to be
applied cleanly.
Inochi, Patch 1 could be potentially be merged in with your series [1],
any thougts on this?
One question I had was about whether the IOMMU on the K3 could be used
to do DMA mappings and allow the wifi card to work with a 32 bit virtual
address. The K3's IOMMU isn't supported currently in the kernel DT. It
seems to not be enabled in the vendor kernel too. Even if the IOMMU was
enabled, I'm not sure if it would help with this exact problem. The fix
proposed in this patch works to solve this problem, so I've sent it to
the list.
[1] https://lore.kernel.org/spacemit/20260709040027.958400-1-inochiama@gmail.com/
[2] https://lore.kernel.org/spacemit/20260703021024.495433-1-inochiama@gmail.com/
[3] https://lore.kernel.org/spacemit/20260709040415.977784-1-inochiama@gmail.com/
Signed-off-by: Anirudh Srinivasan <asrinivasan@oss.tenstorrent.com>
---
Anirudh Srinivasan (2):
PCI: Move Spacemit vendor and device ID to linux/pci_Ids.h
wifi: rtw89: pci: enable 36-bit DMA on spacemit K3
drivers/net/wireless/realtek/rtw89/pci.c | 4 ++++
drivers/pci/controller/dwc/pcie-spacemit-k1.c | 4 ----
include/linux/pci_ids.h | 4 ++++
3 files changed, 8 insertions(+), 4 deletions(-)
---
base-commit: 728e68a889bcf257b1e67298b12c360e5c3a13e0
change-id: 20260715-rtw89-spacemit-k3-a37c9771b3c3
prerequisite-message-id: <20260709040027.958400-1-inochiama@gmail.com>
prerequisite-patch-id: ab02c35a752a1e8f0fff9bc06ebcf8961afef933
prerequisite-patch-id: e7cececa9950600cfeee3dc6d73d6c3a7cc16f32
prerequisite-patch-id: 49ba2fa5aa2d2069b8d857bbda6cc4813bfc015f
prerequisite-patch-id: f33c229b37442babb1289af29a33fd2a222304f0
prerequisite-patch-id: c91a780415fe64f11fe921761d213634d042fac7
prerequisite-patch-id: b2bbf0fe6a7d90be354bb266d311982ead5a0e6d
Best regards,
--
Anirudh Srinivasan <asrinivasan@oss.tenstorrent.com>
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH 1/2] PCI: Move Spacemit vendor and device ID to linux/pci_Ids.h
2026-07-16 3:21 [PATCH 0/2] Enable WiFi on Spacemit K3 Pico ITX Anirudh Srinivasan
@ 2026-07-16 3:21 ` Anirudh Srinivasan
2026-07-16 16:43 ` Bjorn Helgaas
2026-07-16 3:21 ` [PATCH 2/2] wifi: rtw89: pci: enable 36-bit DMA on spacemit K3 Anirudh Srinivasan
1 sibling, 1 reply; 6+ messages in thread
From: Anirudh Srinivasan @ 2026-07-16 3:21 UTC (permalink / raw)
To: Bjorn Helgaas, Yixun Lan, Ping-Ke Shih, Lorenzo Pieralisi,
Krzysztof Wilczyński, Manivannan Sadhasivam, Rob Herring,
Inochi Amaoto
Cc: linux-pci, linux-kernel, linux-riscv, spacemit, linux-wireless,
Anirudh Srinivasan
Move the vendor and device IDs for Spacemit PCIe Root Complexes to
include/linux/pci_ids.h so that they can be referenced elsewhere.
Signed-off-by: Anirudh Srinivasan <asrinivasan@oss.tenstorrent.com>
---
drivers/pci/controller/dwc/pcie-spacemit-k1.c | 4 ----
include/linux/pci_ids.h | 4 ++++
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/pci/controller/dwc/pcie-spacemit-k1.c b/drivers/pci/controller/dwc/pcie-spacemit-k1.c
index 680acc93f5395..7b0bc1802954a 100644
--- a/drivers/pci/controller/dwc/pcie-spacemit-k1.c
+++ b/drivers/pci/controller/dwc/pcie-spacemit-k1.c
@@ -21,10 +21,6 @@
#include "pcie-designware.h"
-#define PCI_VENDOR_ID_SPACEMIT 0x201f
-#define PCI_DEVICE_ID_SPACEMIT_K1 0x0001
-#define PCI_DEVICE_ID_SPACEMIT_K3 0x0002
-
/* Offsets and field definitions for link management registers */
#define K1_PHY_AHB_IRQ_EN 0x0000
#define PCIE_INTERRUPT_EN BIT(0)
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 1c9d40e09107d..d6f26cacc8e35 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -2640,6 +2640,10 @@
#define PCI_VENDOR_ID_SUNIX 0x1fd4
#define PCI_DEVICE_ID_SUNIX_1999 0x1999
+#define PCI_VENDOR_ID_SPACEMIT 0x201f
+#define PCI_DEVICE_ID_SPACEMIT_K1 0x0001
+#define PCI_DEVICE_ID_SPACEMIT_K3 0x0002
+
#define PCI_VENDOR_ID_HINT 0x3388
#define PCI_DEVICE_ID_HINT_VXPROII_IDE 0x8013
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] PCI: Move Spacemit vendor and device ID to linux/pci_Ids.h
2026-07-16 3:21 ` [PATCH 1/2] PCI: Move Spacemit vendor and device ID to linux/pci_Ids.h Anirudh Srinivasan
@ 2026-07-16 16:43 ` Bjorn Helgaas
0 siblings, 0 replies; 6+ messages in thread
From: Bjorn Helgaas @ 2026-07-16 16:43 UTC (permalink / raw)
To: Anirudh Srinivasan
Cc: Bjorn Helgaas, Yixun Lan, Ping-Ke Shih, Lorenzo Pieralisi,
Krzysztof Wilczyński, Manivannan Sadhasivam, Rob Herring,
Inochi Amaoto, linux-pci, linux-kernel, linux-riscv, spacemit,
linux-wireless
On Wed, Jul 15, 2026 at 10:21:54PM -0500, Anirudh Srinivasan wrote:
> Move the vendor and device IDs for Spacemit PCIe Root Complexes to
> include/linux/pci_ids.h so that they can be referenced elsewhere.
>
> Signed-off-by: Anirudh Srinivasan <asrinivasan@oss.tenstorrent.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
To help motivate this patch, it would be nice to say specifically
where PCI_VENDOR_ID_SPACEMIT will be used.
In subject line, s/pci_Ids.h/pci_ids.h/
> ---
> drivers/pci/controller/dwc/pcie-spacemit-k1.c | 4 ----
> include/linux/pci_ids.h | 4 ++++
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/pci/controller/dwc/pcie-spacemit-k1.c b/drivers/pci/controller/dwc/pcie-spacemit-k1.c
> index 680acc93f5395..7b0bc1802954a 100644
> --- a/drivers/pci/controller/dwc/pcie-spacemit-k1.c
> +++ b/drivers/pci/controller/dwc/pcie-spacemit-k1.c
> @@ -21,10 +21,6 @@
>
> #include "pcie-designware.h"
>
> -#define PCI_VENDOR_ID_SPACEMIT 0x201f
> -#define PCI_DEVICE_ID_SPACEMIT_K1 0x0001
> -#define PCI_DEVICE_ID_SPACEMIT_K3 0x0002
> -
> /* Offsets and field definitions for link management registers */
> #define K1_PHY_AHB_IRQ_EN 0x0000
> #define PCIE_INTERRUPT_EN BIT(0)
> diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
> index 1c9d40e09107d..d6f26cacc8e35 100644
> --- a/include/linux/pci_ids.h
> +++ b/include/linux/pci_ids.h
> @@ -2640,6 +2640,10 @@
> #define PCI_VENDOR_ID_SUNIX 0x1fd4
> #define PCI_DEVICE_ID_SUNIX_1999 0x1999
>
> +#define PCI_VENDOR_ID_SPACEMIT 0x201f
> +#define PCI_DEVICE_ID_SPACEMIT_K1 0x0001
> +#define PCI_DEVICE_ID_SPACEMIT_K3 0x0002
> +
> #define PCI_VENDOR_ID_HINT 0x3388
> #define PCI_DEVICE_ID_HINT_VXPROII_IDE 0x8013
>
>
> --
> 2.43.0
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 2/2] wifi: rtw89: pci: enable 36-bit DMA on spacemit K3
2026-07-16 3:21 [PATCH 0/2] Enable WiFi on Spacemit K3 Pico ITX Anirudh Srinivasan
2026-07-16 3:21 ` [PATCH 1/2] PCI: Move Spacemit vendor and device ID to linux/pci_Ids.h Anirudh Srinivasan
@ 2026-07-16 3:21 ` Anirudh Srinivasan
2026-07-16 9:22 ` Ping-Ke Shih
2026-07-16 21:34 ` Aurelien Jarno
1 sibling, 2 replies; 6+ messages in thread
From: Anirudh Srinivasan @ 2026-07-16 3:21 UTC (permalink / raw)
To: Bjorn Helgaas, Yixun Lan, Ping-Ke Shih, Lorenzo Pieralisi,
Krzysztof Wilczyński, Manivannan Sadhasivam, Rob Herring,
Inochi Amaoto
Cc: linux-pci, linux-kernel, linux-riscv, spacemit, linux-wireless,
Anirudh Srinivasan
The Spacemit K3 Pico ITX Board has a RTL8852BE pcie card behind a PCIe
root port, but the SoC doesn't have any 32 DMA addreseses which the
rtw89 seems to use by default. Enable 36 bit DMA ability that the driver
has when this particular root port is detected so that the driver can
probe on this SoC.
Signed-off-by: Anirudh Srinivasan <asrinivasan@oss.tenstorrent.com>
---
drivers/net/wireless/realtek/rtw89/pci.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/wireless/realtek/rtw89/pci.c b/drivers/net/wireless/realtek/rtw89/pci.c
index 102bae4881805..c5b82fc46d063 100644
--- a/drivers/net/wireless/realtek/rtw89/pci.c
+++ b/drivers/net/wireless/realtek/rtw89/pci.c
@@ -3326,6 +3326,10 @@ static bool rtw89_pci_is_dac_compatible_bridge(struct rtw89_dev *rtwdev)
if (bridge->device == 0x2806)
return true;
break;
+ case PCI_VENDOR_ID_SPACEMIT:
+ if (bridge->device == PCI_DEVICE_ID_SPACEMIT_K3)
+ return true;
+ break;
}
return false;
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* RE: [PATCH 2/2] wifi: rtw89: pci: enable 36-bit DMA on spacemit K3
2026-07-16 3:21 ` [PATCH 2/2] wifi: rtw89: pci: enable 36-bit DMA on spacemit K3 Anirudh Srinivasan
@ 2026-07-16 9:22 ` Ping-Ke Shih
2026-07-16 21:34 ` Aurelien Jarno
1 sibling, 0 replies; 6+ messages in thread
From: Ping-Ke Shih @ 2026-07-16 9:22 UTC (permalink / raw)
To: Anirudh Srinivasan, Bjorn Helgaas, Yixun Lan, Lorenzo Pieralisi,
Krzysztof Wilczyński, Manivannan Sadhasivam, Rob Herring,
Inochi Amaoto
Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-riscv@lists.infradead.org, spacemit@lists.linux.dev,
linux-wireless@vger.kernel.org
Anirudh Srinivasan <asrinivasan@oss.tenstorrent.com> wrote:
> The Spacemit K3 Pico ITX Board has a RTL8852BE pcie card behind a PCIe
> root port, but the SoC doesn't have any 32 DMA addreseses which the
> rtw89 seems to use by default. Enable 36 bit DMA ability that the driver
> has when this particular root port is detected so that the driver can
> probe on this SoC.
>
> Signed-off-by: Anirudh Srinivasan <asrinivasan@oss.tenstorrent.com>
This patch looks good to me:
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
But I wonder how this patchset goes via which tree. I'm happy to merge
them into rtw tree and then wireless-next tree if people can ack
patch 1/2.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] wifi: rtw89: pci: enable 36-bit DMA on spacemit K3
2026-07-16 3:21 ` [PATCH 2/2] wifi: rtw89: pci: enable 36-bit DMA on spacemit K3 Anirudh Srinivasan
2026-07-16 9:22 ` Ping-Ke Shih
@ 2026-07-16 21:34 ` Aurelien Jarno
1 sibling, 0 replies; 6+ messages in thread
From: Aurelien Jarno @ 2026-07-16 21:34 UTC (permalink / raw)
To: Anirudh Srinivasan
Cc: Bjorn Helgaas, Yixun Lan, Ping-Ke Shih, Lorenzo Pieralisi,
Krzysztof Wilczyński, Manivannan Sadhasivam, Rob Herring,
Inochi Amaoto, linux-pci, linux-kernel, linux-riscv, spacemit,
linux-wireless
On 2026-07-15 22:21, Anirudh Srinivasan wrote:
> The Spacemit K3 Pico ITX Board has a RTL8852BE pcie card behind a PCIe
> root port, but the SoC doesn't have any 32 DMA addreseses which the
> rtw89 seems to use by default. Enable 36 bit DMA ability that the driver
> has when this particular root port is detected so that the driver can
> probe on this SoC.
>
> Signed-off-by: Anirudh Srinivasan <asrinivasan@oss.tenstorrent.com>
> ---
> drivers/net/wireless/realtek/rtw89/pci.c | 4 ++++
> 1 file changed, 4 insertions(+)
Tested-by: Aurelien Jarno <aurelien@aurel32.net>
Note that you probably want the following patch to get the controller to
connect to a WiFi network:
https://lore.kernel.org/spacemit/20260716213314.3027969-5-aurelien@aurel32.net
--
Aurelien Jarno GPG: 4096R/1DDD8C9B
aurelien@aurel32.net http://aurel32.net
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-07-16 21:34 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-16 3:21 [PATCH 0/2] Enable WiFi on Spacemit K3 Pico ITX Anirudh Srinivasan
2026-07-16 3:21 ` [PATCH 1/2] PCI: Move Spacemit vendor and device ID to linux/pci_Ids.h Anirudh Srinivasan
2026-07-16 16:43 ` Bjorn Helgaas
2026-07-16 3:21 ` [PATCH 2/2] wifi: rtw89: pci: enable 36-bit DMA on spacemit K3 Anirudh Srinivasan
2026-07-16 9:22 ` Ping-Ke Shih
2026-07-16 21:34 ` Aurelien Jarno
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox