mirror of
https://github.com/openwrt/openwrt.git
synced 2025-02-21 01:41:41 +00:00
Add support for the Qualcomm IPQ50xx in the QCA NSS dataplane driver. The QCA implementation uses depracated DMA api calls and a downstream SCM call, so convert to proper Linux DMA and SCM api calls. In addition, add fixed-link support to support SGMII which is used to connect the internal IPQ50xx switch to an external switch (ex. QCA8337) Co-developed-by: Ziyang Huang <hzyitc@outlook.com> Signed-off-by: Ziyang Huang <hzyitc@outlook.com> Signed-off-by: George Moussalem <george.moussalem@outlook.com> Link: https://github.com/openwrt/openwrt/pull/17182 Signed-off-by: Robert Marko <robimarko@gmail.com>
47 lines
1.6 KiB
Diff
47 lines
1.6 KiB
Diff
From ba430b1a512dc1972807a1dd5a8d31a78ac572ff Mon Sep 17 00:00:00 2001
|
|
From: Ziyang Huang <hzyitc@outlook.com>
|
|
Date: Mon, 22 Apr 2024 21:49:18 +0800
|
|
Subject: [PATCH] ipq50xx: use corrent scm function to write tcsr
|
|
|
|
QCA leverages its own API function to write to the TCSR register space,
|
|
not available upstream. As such, convert to the upstream qcom SCM IO
|
|
write function.
|
|
|
|
Signed-off-by: Ziyang Huang <hzyitc@outlook.com>
|
|
Signed-off-by: George Moussalem <george.moussalem@outlook.com>
|
|
---
|
|
hal/soc_ops/ipq50xx/nss_ipq50xx.c | 9 ++-------
|
|
1 file changed, 2 insertions(+), 7 deletions(-)
|
|
|
|
diff --git a/hal/soc_ops/ipq50xx/nss_ipq50xx.c b/hal/soc_ops/ipq50xx/nss_ipq50xx.c
|
|
index 3e4491c0..e56de1cc 100644
|
|
--- a/hal/soc_ops/ipq50xx/nss_ipq50xx.c
|
|
+++ b/hal/soc_ops/ipq50xx/nss_ipq50xx.c
|
|
@@ -18,7 +18,7 @@
|
|
|
|
#include <linux/of.h>
|
|
#include <linux/ioport.h>
|
|
-#include <linux/qcom_scm.h>
|
|
+#include <linux/firmware/qcom/qcom_scm.h>
|
|
#include "nss_dp_hal.h"
|
|
|
|
/*
|
|
@@ -78,13 +78,8 @@ static void nss_dp_hal_tcsr_set(void)
|
|
* If TZ is not enabled, we can write to the register directly.
|
|
*/
|
|
if (qcom_scm_is_available()) {
|
|
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0))
|
|
- err = qcom_scm_tcsr_reg_write((tcsr_base + TCSR_GMAC_AXI_CACHE_OVERRIDE_OFFSET),
|
|
+ err = qcom_scm_io_writel((tcsr_base + TCSR_GMAC_AXI_CACHE_OVERRIDE_OFFSET),
|
|
TCSR_GMAC_AXI_CACHE_OVERRIDE_VALUE);
|
|
-#else
|
|
- err = qti_scm_tcsr_reg_write((tcsr_base + TCSR_GMAC_AXI_CACHE_OVERRIDE_OFFSET),
|
|
- TCSR_GMAC_AXI_CACHE_OVERRIDE_VALUE);
|
|
-#endif
|
|
if (err) {
|
|
pr_err("%s: SCM TCSR write error: %d\n", __func__, err);
|
|
}
|
|
--
|
|
2.40.1
|
|
|