mirror of
https://github.com/breeze303/nss-packages.git
synced 2025-12-16 08:44:52 +00:00
qca-nss-drv: update to 12.4
This commit is contained in:
parent
e6676102f1
commit
f91a55312f
@ -5,9 +5,9 @@ PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE_URL:=https://git.codelinaro.org/clo/qsdk/oss/lklm/nss-drv.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_DATE:=2023-03-23
|
||||
PKG_SOURCE_VERSION:=5b395eb18d38754f4336cbf5e352c5a903d3ff38
|
||||
PKG_MIRROR_HASH:=86dff8ca03559ad6a428fdcdda86d271a6760bc0cc6d9431b314a448a5901263
|
||||
PKG_SOURCE_DATE:=2023-08-06
|
||||
PKG_SOURCE_VERSION:=1ab184034529539f61093184a67d4454cb3eb352
|
||||
PKG_MIRROR_HASH:=6aa081c0853d3e3b6d78eee588a0967e540b2317d15aef3c3f6f7129925653f7
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_FLAGS:=nonshared
|
||||
|
||||
@ -24,7 +24,7 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
@@ -145,7 +145,7 @@ static struct nss_platform_data *__nss_h
|
||||
npd->nphys = res_nphys.start;
|
||||
npd->vphys = res_vphys.start;
|
||||
|
||||
|
||||
- npd->nmap = ioremap_nocache(npd->nphys, resource_size(&res_nphys));
|
||||
+ npd->nmap = ioremap(npd->nphys, resource_size(&res_nphys));
|
||||
if (!npd->nmap) {
|
||||
@ -32,26 +32,26 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
goto out;
|
||||
--- a/nss_hal/ipq50xx/nss_hal_pvt.c
|
||||
+++ b/nss_hal/ipq50xx/nss_hal_pvt.c
|
||||
@@ -184,13 +184,13 @@ static struct nss_platform_data *__nss_h
|
||||
@@ -185,13 +185,13 @@ static struct nss_platform_data *__nss_h
|
||||
npd->nphys = res_nphys.start;
|
||||
npd->qgic_phys = res_qgic_phys.start;
|
||||
|
||||
|
||||
- npd->nmap = ioremap_nocache(npd->nphys, resource_size(&res_nphys));
|
||||
+ npd->nmap = ioremap(npd->nphys, resource_size(&res_nphys));
|
||||
if (!npd->nmap) {
|
||||
nss_info_always("%px: nss%d: ioremap() fail for nphys\n", nss_ctx, nss_ctx->id);
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
- npd->qgic_map = ioremap_nocache(npd->qgic_phys, resource_size(&res_qgic_phys));
|
||||
+ npd->qgic_map = ioremap(npd->qgic_phys, resource_size(&res_qgic_phys));
|
||||
if (!npd->qgic_map) {
|
||||
nss_info_always("%px: nss%d: ioremap() fail for qgic map\n", nss_ctx, nss_ctx->id);
|
||||
goto out;
|
||||
@@ -348,7 +348,7 @@ static int __nss_hal_common_reset(struct
|
||||
|
||||
@@ -349,7 +349,7 @@ static int __nss_hal_common_reset(struct
|
||||
|
||||
of_node_put(cmn);
|
||||
|
||||
|
||||
- nss_misc_reset = ioremap_nocache(res_nss_misc_reset.start, resource_size(&res_nss_misc_reset));
|
||||
+ nss_misc_reset = ioremap(res_nss_misc_reset.start, resource_size(&res_nss_misc_reset));
|
||||
if (!nss_misc_reset) {
|
||||
@ -59,33 +59,33 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
return -EFAULT;
|
||||
--- a/nss_hal/ipq60xx/nss_hal_pvt.c
|
||||
+++ b/nss_hal/ipq60xx/nss_hal_pvt.c
|
||||
@@ -207,13 +207,13 @@ static struct nss_platform_data *__nss_h
|
||||
@@ -208,13 +208,13 @@ static struct nss_platform_data *__nss_h
|
||||
npd->nphys = res_nphys.start;
|
||||
npd->qgic_phys = res_qgic_phys.start;
|
||||
|
||||
|
||||
- npd->nmap = ioremap_nocache(npd->nphys, resource_size(&res_nphys));
|
||||
+ npd->nmap = ioremap(npd->nphys, resource_size(&res_nphys));
|
||||
if (!npd->nmap) {
|
||||
nss_info_always("%px: nss%d: ioremap() fail for nphys\n", nss_ctx, nss_ctx->id);
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
- npd->qgic_map = ioremap_nocache(npd->qgic_phys, resource_size(&res_qgic_phys));
|
||||
+ npd->qgic_map = ioremap(npd->qgic_phys, resource_size(&res_qgic_phys));
|
||||
if (!npd->qgic_map) {
|
||||
nss_info_always("%px: nss%d: ioremap() fail for qgic map\n", nss_ctx, nss_ctx->id);
|
||||
goto out;
|
||||
@@ -433,13 +433,13 @@ static int __nss_hal_common_reset(struct
|
||||
|
||||
@@ -434,13 +434,13 @@ static int __nss_hal_common_reset(struct
|
||||
|
||||
of_node_put(cmn);
|
||||
|
||||
|
||||
- nss_misc_reset = ioremap_nocache(res_nss_misc_reset.start, resource_size(&res_nss_misc_reset));
|
||||
+ nss_misc_reset = ioremap(res_nss_misc_reset.start, resource_size(&res_nss_misc_reset));
|
||||
if (!nss_misc_reset) {
|
||||
pr_err("%px: ioremap fail for nss_misc_reset\n", nss_dev);
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
|
||||
- nss_misc_reset_flag = ioremap_nocache(res_nss_misc_reset_flag.start, resource_size(&res_nss_misc_reset_flag));
|
||||
+ nss_misc_reset_flag = ioremap(res_nss_misc_reset_flag.start, resource_size(&res_nss_misc_reset_flag));
|
||||
if (!nss_misc_reset_flag) {
|
||||
@ -93,19 +93,19 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
return -EFAULT;
|
||||
--- a/nss_hal/ipq806x/nss_hal_pvt.c
|
||||
+++ b/nss_hal/ipq806x/nss_hal_pvt.c
|
||||
@@ -458,7 +458,7 @@ static struct nss_platform_data *__nss_h
|
||||
@@ -461,7 +461,7 @@ static struct nss_platform_data *__nss_h
|
||||
npd->nphys = res_nphys.start;
|
||||
npd->vphys = res_vphys.start;
|
||||
|
||||
|
||||
- npd->nmap = ioremap_nocache(npd->nphys, resource_size(&res_nphys));
|
||||
+ npd->nmap = ioremap(npd->nphys, resource_size(&res_nphys));
|
||||
if (!npd->nmap) {
|
||||
nss_info_always("%px: nss%d: ioremap() fail for nphys\n", nss_ctx, nss_ctx->id);
|
||||
goto out;
|
||||
@@ -711,7 +711,7 @@ static int __nss_hal_common_reset(struct
|
||||
@@ -714,7 +714,7 @@ static int __nss_hal_common_reset(struct
|
||||
}
|
||||
of_node_put(cmn);
|
||||
|
||||
|
||||
- fpb_base = ioremap_nocache(res_nss_fpb_base.start, resource_size(&res_nss_fpb_base));
|
||||
+ fpb_base = ioremap(res_nss_fpb_base.start, resource_size(&res_nss_fpb_base));
|
||||
if (!fpb_base) {
|
||||
@ -113,28 +113,28 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
return -EFAULT;
|
||||
--- a/nss_hal/ipq807x/nss_hal_pvt.c
|
||||
+++ b/nss_hal/ipq807x/nss_hal_pvt.c
|
||||
@@ -234,7 +234,7 @@ static struct nss_platform_data *__nss_h
|
||||
@@ -237,7 +237,7 @@ static struct nss_platform_data *__nss_h
|
||||
npd->vphys = res_vphys.start;
|
||||
npd->qgic_phys = res_qgic_phys.start;
|
||||
|
||||
|
||||
- npd->nmap = ioremap_nocache(npd->nphys, resource_size(&res_nphys));
|
||||
+ npd->nmap = ioremap(npd->nphys, resource_size(&res_nphys));
|
||||
if (!npd->nmap) {
|
||||
nss_info_always("%px: nss%d: ioremap() fail for nphys\n", nss_ctx, nss_ctx->id);
|
||||
goto out;
|
||||
@@ -247,7 +247,7 @@ static struct nss_platform_data *__nss_h
|
||||
@@ -250,7 +250,7 @@ static struct nss_platform_data *__nss_h
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
- npd->qgic_map = ioremap_nocache(npd->qgic_phys, resource_size(&res_qgic_phys));
|
||||
+ npd->qgic_map = ioremap(npd->qgic_phys, resource_size(&res_qgic_phys));
|
||||
if (!npd->qgic_map) {
|
||||
nss_info_always("%px: nss%d: ioremap() fail for qgic map\n", nss_ctx, nss_ctx->id);
|
||||
goto out;
|
||||
@@ -467,7 +467,7 @@ static int __nss_hal_common_reset(struct
|
||||
@@ -470,7 +470,7 @@ static int __nss_hal_common_reset(struct
|
||||
}
|
||||
of_node_put(cmn);
|
||||
|
||||
|
||||
- nss_misc_reset = ioremap_nocache(res_nss_misc_reset.start, resource_size(&res_nss_misc_reset));
|
||||
+ nss_misc_reset = ioremap(res_nss_misc_reset.start, resource_size(&res_nss_misc_reset));
|
||||
if (!nss_misc_reset) {
|
||||
@ -145,7 +145,7 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
@@ -291,7 +291,7 @@ static struct nss_platform_data *__nss_h
|
||||
npd->vphys = res_vphys.start;
|
||||
npd->qgic_phys = res_qgic_phys.start;
|
||||
|
||||
|
||||
- npd->nmap = ioremap_nocache(npd->nphys, resource_size(&res_nphys));
|
||||
+ npd->nmap = ioremap(npd->nphys, resource_size(&res_nphys));
|
||||
if (!npd->nmap) {
|
||||
@ -154,16 +154,16 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
@@ -303,7 +303,7 @@ static struct nss_platform_data *__nss_h
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
- npd->qgic_map = ioremap_nocache(npd->qgic_phys, resource_size(&res_qgic_phys));
|
||||
+ npd->qgic_map = ioremap(npd->qgic_phys, resource_size(&res_qgic_phys));
|
||||
if (!npd->qgic_map) {
|
||||
nss_info_always("%px: nss%d: ioremap() fail for qgic map\n", nss_ctx, nss_ctx->id);
|
||||
goto out;
|
||||
@@ -608,7 +608,7 @@ static int __nss_hal_common_reset(struct
|
||||
|
||||
|
||||
of_node_put(cmn);
|
||||
|
||||
|
||||
- nss_misc_reset = ioremap_nocache(res_nss_misc_reset.start, resource_size(&res_nss_misc_reset));
|
||||
+ nss_misc_reset = ioremap(res_nss_misc_reset.start, resource_size(&res_nss_misc_reset));
|
||||
if (!nss_misc_reset) {
|
||||
@ -173,8 +173,8 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
+++ b/nss_hal/nss_hal.c
|
||||
@@ -81,9 +81,9 @@ int nss_hal_firmware_load(struct nss_ctx
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
- load_mem = ioremap_nocache(npd->load_addr, nss_fw->size);
|
||||
+ load_mem = ioremap(npd->load_addr, nss_fw->size);
|
||||
if (!load_mem) {
|
||||
@ -185,7 +185,7 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
}
|
||||
--- a/nss_meminfo.c
|
||||
+++ b/nss_meminfo.c
|
||||
@@ -735,7 +735,7 @@ bool nss_meminfo_init(struct nss_ctx_ins
|
||||
@@ -736,7 +736,7 @@ bool nss_meminfo_init(struct nss_ctx_ins
|
||||
/*
|
||||
* meminfo_start is the label where the start address of meminfo map is stored.
|
||||
*/
|
||||
|
||||
@ -26,15 +26,15 @@ Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
|
||||
+(((LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(6, 2, 0))))))
|
||||
#error "Check skb recycle code in this file to match Linux version"
|
||||
#endif
|
||||
|
||||
@@ -2658,7 +2659,7 @@ static inline bool nss_core_skb_can_reus
|
||||
|
||||
@@ -2658,7 +2660,7 @@ static inline bool nss_core_skb_can_reus
|
||||
if (unlikely(irqs_disabled()))
|
||||
return false;
|
||||
|
||||
|
||||
- if (unlikely(skb_shinfo(nbuf)->tx_flags & SKBTX_DEV_ZEROCOPY))
|
||||
+ if (unlikely(skb_shinfo(nbuf)->flags & SKBFL_ZEROCOPY_ENABLE))
|
||||
return false;
|
||||
|
||||
|
||||
if (unlikely(skb_is_nonlinear(nbuf)))
|
||||
--- a/nss_coredump.c
|
||||
+++ b/nss_coredump.c
|
||||
@ -49,7 +49,7 @@ Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
|
||||
+#endif
|
||||
#include <linux/jiffies.h> /* for time */
|
||||
#include "nss_tx_rx_common.h"
|
||||
|
||||
|
||||
--- a/nss_hal/nss_hal.c
|
||||
+++ b/nss_hal/nss_hal.c
|
||||
@@ -27,6 +27,7 @@
|
||||
@ -57,6 +57,6 @@ Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
|
||||
#include <linux/of.h>
|
||||
#include <linux/irq.h>
|
||||
+#include <linux/ethtool.h>
|
||||
|
||||
|
||||
#include "nss_hal.h"
|
||||
#include "nss_arch.h"
|
||||
|
||||
@ -17,7 +17,7 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
|
||||
--- a/nss_core.c
|
||||
+++ b/nss_core.c
|
||||
@@ -1659,7 +1659,7 @@ static int32_t nss_core_handle_cause_que
|
||||
@@ -1660,7 +1660,7 @@ static int32_t nss_core_handle_cause_que
|
||||
*
|
||||
*/
|
||||
if (unlikely((buffer_type == N2H_BUFFER_CRYPTO_RESP))) {
|
||||
@ -25,3 +25,4 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
+ dma_unmap_single(nss_ctx->dev, (desc->buffer + desc->payload_offs), desc->payload_len, DMA_FROM_DEVICE);
|
||||
goto consume;
|
||||
}
|
||||
|
||||
|
||||
@ -27,7 +27,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
|
||||
--- a/nss_core.c
|
||||
+++ b/nss_core.c
|
||||
@@ -1471,6 +1471,8 @@ static inline void nss_core_handle_empty
|
||||
@@ -1472,6 +1472,8 @@ static inline void nss_core_handle_empty
|
||||
uint32_t count, uint32_t hlos_index,
|
||||
uint16_t mask)
|
||||
{
|
||||
@ -36,26 +36,26 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
while (count) {
|
||||
/*
|
||||
* Since we only return the primary skb, we have no way to unmap
|
||||
@@ -1524,7 +1526,9 @@ next:
|
||||
@@ -1525,7 +1527,9 @@ next:
|
||||
n2h_desc_ring->hlos_index = hlos_index;
|
||||
if_map->n2h_hlos_index[NSS_IF_N2H_EMPTY_BUFFER_RETURN_QUEUE] = hlos_index;
|
||||
|
||||
|
||||
- NSS_CORE_DMA_CACHE_MAINT((void *)&if_map->n2h_hlos_index[NSS_IF_N2H_EMPTY_BUFFER_RETURN_QUEUE], sizeof(uint32_t), DMA_TO_DEVICE);
|
||||
+ dma_sync_single_for_device(nss_ctx->dev,
|
||||
+ n2h_hlos_index_to_dma(mem_ctx->if_map_dma, NSS_IF_N2H_EMPTY_BUFFER_RETURN_QUEUE),
|
||||
+ sizeof(uint32_t), DMA_TO_DEVICE);
|
||||
NSS_CORE_DSB();
|
||||
}
|
||||
|
||||
@@ -1546,6 +1550,7 @@ static int32_t nss_core_handle_cause_que
|
||||
|
||||
@@ -1547,6 +1551,7 @@ static int32_t nss_core_handle_cause_que
|
||||
struct nss_ctx_instance *nss_ctx = int_ctx->nss_ctx;
|
||||
struct nss_meminfo_ctx *mem_ctx = &nss_ctx->meminfo_ctx;
|
||||
struct nss_if_mem_map *if_map = mem_ctx->if_map;
|
||||
+ int dma_size;
|
||||
|
||||
|
||||
qid = nss_core_cause_to_queue(cause);
|
||||
|
||||
@@ -1557,7 +1562,8 @@ static int32_t nss_core_handle_cause_que
|
||||
|
||||
@@ -1558,7 +1563,8 @@ static int32_t nss_core_handle_cause_que
|
||||
n2h_desc_ring = &nss_ctx->n2h_desc_ring[qid];
|
||||
desc_if = &n2h_desc_ring->desc_ring;
|
||||
desc_ring = desc_if->desc;
|
||||
@ -64,8 +64,8 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
+ sizeof(uint32_t), DMA_FROM_DEVICE);
|
||||
NSS_CORE_DSB();
|
||||
nss_index = if_map->n2h_nss_index[qid];
|
||||
|
||||
@@ -1586,13 +1592,23 @@ static int32_t nss_core_handle_cause_que
|
||||
|
||||
@@ -1587,13 +1593,23 @@ static int32_t nss_core_handle_cause_que
|
||||
start = hlos_index;
|
||||
end = (hlos_index + count) & mask;
|
||||
if (end > start) {
|
||||
@ -90,19 +90,19 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
+ dma_sync_single_for_cpu(nss_ctx->dev, n2h_desc_index_to_dma(if_map, qid, 0), dma_size,
|
||||
+ DMA_FROM_DEVICE);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
@@ -1721,7 +1737,8 @@ next:
|
||||
@@ -1722,7 +1738,8 @@ next:
|
||||
n2h_desc_ring->hlos_index = hlos_index;
|
||||
if_map->n2h_hlos_index[qid] = hlos_index;
|
||||
|
||||
|
||||
- NSS_CORE_DMA_CACHE_MAINT((void *)&if_map->n2h_hlos_index[qid], sizeof(uint32_t), DMA_TO_DEVICE);
|
||||
+ dma_sync_single_for_device(nss_ctx->dev, n2h_hlos_index_to_dma(mem_ctx->if_map_dma, qid),
|
||||
+ sizeof(uint32_t), DMA_TO_DEVICE);
|
||||
NSS_CORE_DSB();
|
||||
|
||||
|
||||
return count;
|
||||
@@ -1733,11 +1750,12 @@ next:
|
||||
@@ -1734,11 +1751,12 @@ next:
|
||||
*/
|
||||
static void nss_core_init_nss(struct nss_ctx_instance *nss_ctx, struct nss_if_mem_map *if_map)
|
||||
{
|
||||
@ -110,13 +110,13 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
struct nss_top_instance *nss_top;
|
||||
int ret;
|
||||
int i;
|
||||
|
||||
|
||||
- NSS_CORE_DMA_CACHE_MAINT((void *)if_map, sizeof(*if_map), DMA_FROM_DEVICE);
|
||||
+ dma_sync_single_for_cpu(nss_ctx->dev, mem_ctx->if_map_dma, sizeof(*if_map), DMA_FROM_DEVICE);
|
||||
NSS_CORE_DSB();
|
||||
|
||||
|
||||
/*
|
||||
@@ -1834,6 +1852,7 @@ static void nss_core_alloc_paged_buffers
|
||||
@@ -1835,6 +1853,7 @@ static void nss_core_alloc_paged_buffers
|
||||
uint16_t count, int16_t mask, int32_t hlos_index, uint32_t alloc_fail_count,
|
||||
uint32_t buffer_type, uint32_t buffer_queue, uint32_t stats_index)
|
||||
{
|
||||
@ -124,7 +124,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
struct sk_buff *nbuf;
|
||||
struct page *npage;
|
||||
struct hlos_h2n_desc_rings *h2n_desc_ring = &nss_ctx->h2n_desc_rings[buffer_queue];
|
||||
@@ -1903,7 +1922,9 @@ static void nss_core_alloc_paged_buffers
|
||||
@@ -1904,7 +1923,9 @@ static void nss_core_alloc_paged_buffers
|
||||
/*
|
||||
* Flush the descriptor
|
||||
*/
|
||||
@ -132,20 +132,20 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
+ dma_sync_single_for_device(nss_ctx->dev,
|
||||
+ h2n_desc_index_to_dma(if_map, buffer_queue, hlos_index),
|
||||
+ sizeof(*desc), DMA_TO_DEVICE);
|
||||
|
||||
|
||||
hlos_index = (hlos_index + 1) & (mask);
|
||||
count--;
|
||||
@@ -1917,7 +1938,8 @@ static void nss_core_alloc_paged_buffers
|
||||
@@ -1918,7 +1939,8 @@ static void nss_core_alloc_paged_buffers
|
||||
h2n_desc_ring->hlos_index = hlos_index;
|
||||
if_map->h2n_hlos_index[buffer_queue] = hlos_index;
|
||||
|
||||
|
||||
- NSS_CORE_DMA_CACHE_MAINT(&if_map->h2n_hlos_index[buffer_queue], sizeof(uint32_t), DMA_TO_DEVICE);
|
||||
+ dma_sync_single_for_device(nss_ctx->dev, h2n_hlos_index_to_dma(mem_ctx->if_map_dma, buffer_queue),
|
||||
+ sizeof(uint32_t), DMA_TO_DEVICE);
|
||||
NSS_CORE_DSB();
|
||||
|
||||
|
||||
NSS_PKT_STATS_INC(&nss_top->stats_drv[stats_index]);
|
||||
@@ -1930,7 +1952,7 @@ static void nss_core_alloc_paged_buffers
|
||||
@@ -1931,7 +1953,7 @@ static void nss_core_alloc_paged_buffers
|
||||
static void nss_core_alloc_jumbo_mru_buffers(struct nss_ctx_instance *nss_ctx, struct nss_if_mem_map *if_map,
|
||||
int jumbo_mru, uint16_t count, int16_t mask, int32_t hlos_index)
|
||||
{
|
||||
@ -154,7 +154,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
struct sk_buff *nbuf;
|
||||
struct hlos_h2n_desc_rings *h2n_desc_ring = &nss_ctx->h2n_desc_rings[NSS_IF_H2N_EMPTY_BUFFER_QUEUE];
|
||||
struct h2n_desc_if_instance *desc_if = &h2n_desc_ring->desc_ring;
|
||||
@@ -1977,7 +1999,9 @@ static void nss_core_alloc_jumbo_mru_buf
|
||||
@@ -1978,7 +2000,9 @@ static void nss_core_alloc_jumbo_mru_buf
|
||||
/*
|
||||
* Flush the descriptor
|
||||
*/
|
||||
@ -162,20 +162,20 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
+ dma_sync_single_for_device(nss_ctx->dev,
|
||||
+ h2n_desc_index_to_dma(if_map, NSS_IF_H2N_EMPTY_BUFFER_QUEUE, hlos_index),
|
||||
+ sizeof(*desc), DMA_TO_DEVICE);
|
||||
|
||||
|
||||
hlos_index = (hlos_index + 1) & (mask);
|
||||
count--;
|
||||
@@ -1991,7 +2015,8 @@ static void nss_core_alloc_jumbo_mru_buf
|
||||
@@ -1992,7 +2016,8 @@ static void nss_core_alloc_jumbo_mru_buf
|
||||
h2n_desc_ring->hlos_index = hlos_index;
|
||||
if_map->h2n_hlos_index[NSS_IF_H2N_EMPTY_BUFFER_QUEUE] = hlos_index;
|
||||
|
||||
|
||||
- NSS_CORE_DMA_CACHE_MAINT(&if_map->h2n_hlos_index[NSS_IF_H2N_EMPTY_BUFFER_QUEUE], sizeof(uint32_t), DMA_TO_DEVICE);
|
||||
+ dma_sync_single_for_device(nss_ctx->dev, h2n_hlos_index_to_dma(mem_ctx->if_map_dma, NSS_IF_H2N_EMPTY_BUFFER_QUEUE),
|
||||
+ sizeof(uint32_t), DMA_TO_DEVICE);
|
||||
NSS_CORE_DSB();
|
||||
|
||||
|
||||
NSS_PKT_STATS_INC(&nss_top->stats_drv[NSS_DRV_STATS_TX_EMPTY]);
|
||||
@@ -2004,6 +2029,7 @@ static void nss_core_alloc_jumbo_mru_buf
|
||||
@@ -2005,6 +2030,7 @@ static void nss_core_alloc_jumbo_mru_buf
|
||||
static void nss_core_alloc_max_avail_size_buffers(struct nss_ctx_instance *nss_ctx, struct nss_if_mem_map *if_map,
|
||||
uint16_t max_buf_size, uint16_t count, int16_t mask, int32_t hlos_index)
|
||||
{
|
||||
@ -183,15 +183,15 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
struct hlos_h2n_desc_rings *h2n_desc_ring = &nss_ctx->h2n_desc_rings[NSS_IF_H2N_EMPTY_BUFFER_QUEUE];
|
||||
struct h2n_desc_if_instance *desc_if = &h2n_desc_ring->desc_ring;
|
||||
struct h2n_descriptor *desc_ring = desc_if->desc;
|
||||
@@ -2011,6 +2037,7 @@ static void nss_core_alloc_max_avail_siz
|
||||
@@ -2012,6 +2038,7 @@ static void nss_core_alloc_max_avail_siz
|
||||
uint16_t payload_len = max_buf_size + NET_SKB_PAD;
|
||||
uint16_t start = hlos_index;
|
||||
uint16_t prev_hlos_index;
|
||||
+ int dma_size;
|
||||
|
||||
|
||||
while (count) {
|
||||
dma_addr_t buffer;
|
||||
@@ -2063,13 +2090,26 @@ static void nss_core_alloc_max_avail_siz
|
||||
@@ -2064,13 +2091,26 @@ static void nss_core_alloc_max_avail_siz
|
||||
* Flush the descriptors, including the descriptor at prev_hlos_index.
|
||||
*/
|
||||
if (prev_hlos_index > start) {
|
||||
@ -219,19 +219,19 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
+ h2n_desc_index_to_dma(if_map, NSS_IF_H2N_EMPTY_BUFFER_QUEUE, 0),
|
||||
+ dma_size, DMA_TO_DEVICE);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
@@ -2080,7 +2120,8 @@ static void nss_core_alloc_max_avail_siz
|
||||
@@ -2081,7 +2121,8 @@ static void nss_core_alloc_max_avail_siz
|
||||
h2n_desc_ring->hlos_index = hlos_index;
|
||||
if_map->h2n_hlos_index[NSS_IF_H2N_EMPTY_BUFFER_QUEUE] = hlos_index;
|
||||
|
||||
|
||||
- NSS_CORE_DMA_CACHE_MAINT(&if_map->h2n_hlos_index[NSS_IF_H2N_EMPTY_BUFFER_QUEUE], sizeof(uint32_t), DMA_TO_DEVICE);
|
||||
+ dma_sync_single_for_device(nss_ctx->dev, h2n_hlos_index_to_dma(mem_ctx->if_map_dma, NSS_IF_H2N_EMPTY_BUFFER_QUEUE),
|
||||
+ sizeof(uint32_t), DMA_TO_DEVICE);
|
||||
NSS_CORE_DSB();
|
||||
|
||||
|
||||
NSS_PKT_STATS_INC(&nss_top->stats_drv[NSS_DRV_STATS_TX_EMPTY]);
|
||||
@@ -2093,6 +2134,7 @@ static void nss_core_alloc_max_avail_siz
|
||||
@@ -2094,6 +2135,7 @@ static void nss_core_alloc_max_avail_siz
|
||||
static inline void nss_core_handle_empty_buffer_sos(struct nss_ctx_instance *nss_ctx,
|
||||
struct nss_if_mem_map *if_map, uint16_t max_buf_size)
|
||||
{
|
||||
@ -239,7 +239,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
uint16_t count, size, mask;
|
||||
int32_t nss_index, hlos_index;
|
||||
struct hlos_h2n_desc_rings *h2n_desc_ring = &nss_ctx->h2n_desc_rings[NSS_IF_H2N_EMPTY_BUFFER_QUEUE];
|
||||
@@ -2103,7 +2145,8 @@ static inline void nss_core_handle_empty
|
||||
@@ -2104,7 +2146,8 @@ static inline void nss_core_handle_empty
|
||||
/*
|
||||
* Check how many empty buffers could be filled in queue
|
||||
*/
|
||||
@ -248,8 +248,8 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
+ sizeof(uint32_t), DMA_FROM_DEVICE);
|
||||
NSS_CORE_DSB();
|
||||
nss_index = if_map->h2n_nss_index[NSS_IF_H2N_EMPTY_BUFFER_QUEUE];
|
||||
|
||||
@@ -2148,6 +2191,7 @@ static inline void nss_core_handle_empty
|
||||
|
||||
@@ -2149,6 +2192,7 @@ static inline void nss_core_handle_empty
|
||||
static inline void nss_core_handle_paged_empty_buffer_sos(struct nss_ctx_instance *nss_ctx,
|
||||
struct nss_if_mem_map *if_map, uint16_t max_buf_size)
|
||||
{
|
||||
@ -257,7 +257,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
uint16_t count, size, mask;
|
||||
int32_t nss_index, hlos_index;
|
||||
struct hlos_h2n_desc_rings *h2n_desc_ring = &nss_ctx->h2n_desc_rings[NSS_IF_H2N_EMPTY_PAGED_BUFFER_QUEUE];
|
||||
@@ -2155,7 +2199,8 @@ static inline void nss_core_handle_paged
|
||||
@@ -2156,7 +2200,8 @@ static inline void nss_core_handle_paged
|
||||
/*
|
||||
* Check how many empty buffers could be filled in queue
|
||||
*/
|
||||
@ -266,8 +266,8 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
+ sizeof(uint32_t), DMA_FROM_DEVICE);
|
||||
NSS_CORE_DSB();
|
||||
nss_index = if_map->h2n_nss_index[NSS_IF_H2N_EMPTY_PAGED_BUFFER_QUEUE];
|
||||
|
||||
@@ -2732,9 +2777,11 @@ void nss_skb_reuse(struct sk_buff *nbuf)
|
||||
|
||||
@@ -2733,9 +2778,11 @@ void nss_skb_reuse(struct sk_buff *nbuf)
|
||||
* Sends one skb to NSS FW
|
||||
*/
|
||||
static inline int32_t nss_core_send_buffer_simple_skb(struct nss_ctx_instance *nss_ctx,
|
||||
@ -281,27 +281,27 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
struct h2n_descriptor *desc_ring = desc_if->desc;
|
||||
struct h2n_descriptor *desc;
|
||||
uint16_t bit_flags;
|
||||
@@ -2788,7 +2835,8 @@ static inline int32_t nss_core_send_buff
|
||||
@@ -2789,7 +2836,8 @@ static inline int32_t nss_core_send_buff
|
||||
(nss_ptr_t)nbuf, (uint16_t)(nbuf->data - nbuf->head), nbuf->len,
|
||||
sz, (uint32_t)nbuf->priority, mss, bit_flags);
|
||||
|
||||
|
||||
- NSS_CORE_DMA_CACHE_MAINT((void *)desc, sizeof(*desc), DMA_TO_DEVICE);
|
||||
+ dma_sync_single_for_device(nss_ctx->dev, h2n_desc_index_to_dma(if_map, qid, hlos_index),
|
||||
+ sizeof(*desc), DMA_TO_DEVICE);
|
||||
|
||||
|
||||
/*
|
||||
* We are done using the skb fields and can reuse it now
|
||||
@@ -2812,7 +2860,8 @@ no_reuse:
|
||||
@@ -2813,7 +2861,8 @@ no_reuse:
|
||||
(nss_ptr_t)nbuf, (uint16_t)(nbuf->data - nbuf->head), nbuf->len,
|
||||
(uint16_t)skb_end_offset(nbuf), (uint32_t)nbuf->priority, mss, bit_flags);
|
||||
|
||||
|
||||
- NSS_CORE_DMA_CACHE_MAINT((void *)desc, sizeof(*desc), DMA_TO_DEVICE);
|
||||
+ dma_sync_single_for_device(nss_ctx->dev, h2n_desc_index_to_dma(if_map, qid, hlos_index),
|
||||
+ sizeof(*desc), DMA_TO_DEVICE);
|
||||
|
||||
|
||||
NSS_PKT_STATS_INC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_TX_SIMPLE]);
|
||||
return 1;
|
||||
@@ -2826,9 +2875,11 @@ no_reuse:
|
||||
@@ -2827,9 +2876,11 @@ no_reuse:
|
||||
* Used to differentiate from FRAGLIST
|
||||
*/
|
||||
static inline int32_t nss_core_send_buffer_nr_frags(struct nss_ctx_instance *nss_ctx,
|
||||
@ -315,37 +315,37 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
struct h2n_descriptor *desc_ring = desc_if->desc;
|
||||
struct h2n_descriptor *desc;
|
||||
const skb_frag_t *frag;
|
||||
@@ -2868,7 +2919,8 @@ static inline int32_t nss_core_send_buff
|
||||
@@ -2869,7 +2920,8 @@ static inline int32_t nss_core_send_buff
|
||||
(nss_ptr_t)NULL, nbuf->data - nbuf->head, nbuf->len - nbuf->data_len,
|
||||
skb_end_offset(nbuf), (uint32_t)nbuf->priority, mss, bit_flags | H2N_BIT_FLAG_FIRST_SEGMENT);
|
||||
|
||||
|
||||
- NSS_CORE_DMA_CACHE_MAINT((void *)desc, sizeof(*desc), DMA_TO_DEVICE);
|
||||
+ dma_sync_single_for_device(nss_ctx->dev, h2n_desc_index_to_dma(if_map, qid, hlos_index),
|
||||
+ sizeof(*desc), DMA_TO_DEVICE);
|
||||
|
||||
|
||||
/*
|
||||
* Now handle rest of the fragments.
|
||||
@@ -2892,7 +2944,8 @@ static inline int32_t nss_core_send_buff
|
||||
@@ -2893,7 +2945,8 @@ static inline int32_t nss_core_send_buff
|
||||
(nss_ptr_t)NULL, 0, skb_frag_size(frag), skb_frag_size(frag),
|
||||
nbuf->priority, mss, bit_flags);
|
||||
|
||||
|
||||
- NSS_CORE_DMA_CACHE_MAINT((void *)desc, sizeof(*desc), DMA_TO_DEVICE);
|
||||
+ dma_sync_single_for_device(nss_ctx->dev, h2n_desc_index_to_dma(if_map, qid, hlos_index),
|
||||
+ sizeof(*desc), DMA_TO_DEVICE);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
@@ -2908,7 +2961,8 @@ static inline int32_t nss_core_send_buff
|
||||
@@ -2909,7 +2962,8 @@ static inline int32_t nss_core_send_buff
|
||||
desc->bit_flags &= ~(H2N_BIT_FLAG_DISCARD);
|
||||
desc->opaque = (nss_ptr_t)nbuf;
|
||||
|
||||
|
||||
- NSS_CORE_DMA_CACHE_MAINT((void *)desc, sizeof(*desc), DMA_TO_DEVICE);
|
||||
+ dma_sync_single_for_device(nss_ctx->dev, h2n_desc_index_to_dma(if_map, qid, hlos_index),
|
||||
+ sizeof(*desc), DMA_TO_DEVICE);
|
||||
|
||||
|
||||
NSS_PKT_STATS_INC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_TX_NR_FRAGS]);
|
||||
return i+1;
|
||||
@@ -2922,9 +2976,11 @@ static inline int32_t nss_core_send_buff
|
||||
@@ -2923,9 +2977,11 @@ static inline int32_t nss_core_send_buff
|
||||
* Used to differentiate from FRAGS
|
||||
*/
|
||||
static inline int32_t nss_core_send_buffer_fraglist(struct nss_ctx_instance *nss_ctx,
|
||||
@ -359,37 +359,37 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
struct h2n_descriptor *desc_ring = desc_if->desc;
|
||||
struct h2n_descriptor *desc;
|
||||
dma_addr_t buffer;
|
||||
@@ -2963,7 +3019,8 @@ static inline int32_t nss_core_send_buff
|
||||
@@ -2964,7 +3020,8 @@ static inline int32_t nss_core_send_buff
|
||||
(nss_ptr_t)nbuf, nbuf->data - nbuf->head, nbuf->len - nbuf->data_len,
|
||||
skb_end_offset(nbuf), (uint32_t)nbuf->priority, mss, bit_flags | H2N_BIT_FLAG_FIRST_SEGMENT);
|
||||
|
||||
|
||||
- NSS_CORE_DMA_CACHE_MAINT((void *)desc, sizeof(*desc), DMA_TO_DEVICE);
|
||||
+ dma_sync_single_for_device(nss_ctx->dev, h2n_desc_index_to_dma(if_map, qid, hlos_index),
|
||||
+ sizeof(*desc), DMA_TO_DEVICE);
|
||||
|
||||
|
||||
/*
|
||||
* Walk the frag_list in nbuf
|
||||
@@ -3016,7 +3073,8 @@ static inline int32_t nss_core_send_buff
|
||||
@@ -3017,7 +3074,8 @@ static inline int32_t nss_core_send_buff
|
||||
(nss_ptr_t)iter, iter->data - iter->head, iter->len - iter->data_len,
|
||||
skb_end_offset(iter), iter->priority, mss, bit_flags);
|
||||
|
||||
|
||||
- NSS_CORE_DMA_CACHE_MAINT((void *)desc, sizeof(*desc), DMA_TO_DEVICE);
|
||||
+ dma_sync_single_for_device(nss_ctx->dev, h2n_desc_index_to_dma(if_map, qid, hlos_index),
|
||||
+ sizeof(*desc), DMA_TO_DEVICE);
|
||||
|
||||
|
||||
i++;
|
||||
}
|
||||
@@ -3035,7 +3093,8 @@ static inline int32_t nss_core_send_buff
|
||||
@@ -3036,7 +3094,8 @@ static inline int32_t nss_core_send_buff
|
||||
* Update bit flag for last descriptor.
|
||||
*/
|
||||
desc->bit_flags |= H2N_BIT_FLAG_LAST_SEGMENT;
|
||||
- NSS_CORE_DMA_CACHE_MAINT((void *)desc, sizeof(*desc), DMA_TO_DEVICE);
|
||||
+ dma_sync_single_for_device(nss_ctx->dev, h2n_desc_index_to_dma(if_map, qid, hlos_index),
|
||||
+ sizeof(*desc), DMA_TO_DEVICE);
|
||||
|
||||
|
||||
NSS_PKT_STATS_INC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_TX_FRAGLIST]);
|
||||
return i+1;
|
||||
@@ -3114,8 +3173,10 @@ int32_t nss_core_send_buffer(struct nss_
|
||||
@@ -3115,8 +3174,10 @@ int32_t nss_core_send_buffer(struct nss_
|
||||
* We need to work out if there's sufficent space in our transmit descriptor
|
||||
* ring to place all the segments of a nbuf.
|
||||
*/
|
||||
@ -401,7 +401,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
nss_index = if_map->h2n_nss_index[qid];
|
||||
h2n_desc_ring->nss_index_local = nss_index;
|
||||
count = ((nss_index - hlos_index - 1) + size) & (mask);
|
||||
@@ -3180,13 +3241,13 @@ int32_t nss_core_send_buffer(struct nss_
|
||||
@@ -3181,13 +3242,13 @@ int32_t nss_core_send_buffer(struct nss_
|
||||
count = 0;
|
||||
if (likely((segments == 0) || is_bounce)) {
|
||||
count = nss_core_send_buffer_simple_skb(nss_ctx, desc_if, if_num,
|
||||
@ -416,23 +416,23 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
- nbuf, hlos_index, flags, buffer_type, mss);
|
||||
+ nbuf, qid, hlos_index, flags, buffer_type, mss);
|
||||
}
|
||||
|
||||
|
||||
if (unlikely(count <= 0)) {
|
||||
@@ -3210,7 +3271,8 @@ int32_t nss_core_send_buffer(struct nss_
|
||||
@@ -3211,7 +3272,8 @@ int32_t nss_core_send_buffer(struct nss_
|
||||
h2n_desc_ring->hlos_index = hlos_index;
|
||||
if_map->h2n_hlos_index[qid] = hlos_index;
|
||||
|
||||
|
||||
- NSS_CORE_DMA_CACHE_MAINT(&if_map->h2n_hlos_index[qid], sizeof(uint32_t), DMA_TO_DEVICE);
|
||||
+ dma_sync_single_for_device(nss_ctx->dev, h2n_hlos_index_to_dma(mem_ctx->if_map_dma, qid),
|
||||
+ sizeof(uint32_t), DMA_TO_DEVICE);
|
||||
NSS_CORE_DSB();
|
||||
|
||||
|
||||
#ifdef CONFIG_DEBUG_KMEMLEAK
|
||||
--- a/nss_core.h
|
||||
+++ b/nss_core.h
|
||||
@@ -105,31 +105,30 @@
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
- * Cache operation
|
||||
+ * DMA Offset helper
|
||||
@ -454,7 +454,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
+#define n2h_nss_index_to_dma(_if_map_addr, _index) (_if_map_addr) + n2h_nss_index_offset + (sizeof(uint32_t) * (_index))
|
||||
+#define h2n_hlos_index_to_dma(_if_map_addr, _index) (_if_map_addr) + h2n_hlos_index_offset + (sizeof(uint32_t) * (_index))
|
||||
+#define n2h_hlos_index_to_dma(_if_map_addr, _index) (_if_map_addr) + n2h_hlos_index_offset + (sizeof(uint32_t) * (_index))
|
||||
|
||||
|
||||
/*
|
||||
- * nss_core_dma_cache_maint()
|
||||
- * Perform the appropriate cache op based on direction
|
||||
@ -479,12 +479,12 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
+#define NSS_CORE_DSB() dsb(sy)
|
||||
+#define NSS_CORE_DMA_CACHE_MAINT(dev, start, size, dir) BUILD_BUG_ON_MSG(1, \
|
||||
+ "NSS_CORE_DMA_CACHE_MAINT is deprecated. Fix the code to use correct dma_sync_* API")
|
||||
|
||||
|
||||
#define NSS_DEVICE_IF_START NSS_PHYSICAL_IF_START
|
||||
|
||||
|
||||
--- a/nss_hal/ipq806x/nss_hal_pvt.c
|
||||
+++ b/nss_hal/ipq806x/nss_hal_pvt.c
|
||||
@@ -474,10 +474,9 @@ static struct nss_platform_data *__nss_h
|
||||
@@ -477,10 +477,9 @@ static struct nss_platform_data *__nss_h
|
||||
/*
|
||||
* Clear TCM memory used by this core
|
||||
*/
|
||||
@ -495,11 +495,11 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
- }
|
||||
+
|
||||
NSS_CORE_DSB();
|
||||
|
||||
|
||||
/*
|
||||
--- a/nss_hal/ipq807x/nss_hal_pvt.c
|
||||
+++ b/nss_hal/ipq807x/nss_hal_pvt.c
|
||||
@@ -256,10 +256,9 @@ static struct nss_platform_data *__nss_h
|
||||
@@ -259,10 +259,9 @@ static struct nss_platform_data *__nss_h
|
||||
/*
|
||||
* Clear TCM memory used by this core
|
||||
*/
|
||||
@ -510,39 +510,39 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
- }
|
||||
+
|
||||
NSS_CORE_DSB();
|
||||
|
||||
|
||||
/*
|
||||
--- a/nss_meminfo.c
|
||||
+++ b/nss_meminfo.c
|
||||
@@ -414,7 +414,6 @@ static bool nss_meminfo_init_block_lists
|
||||
@@ -415,7 +415,6 @@ static bool nss_meminfo_init_block_lists
|
||||
/*
|
||||
* Flush the updated meminfo request.
|
||||
*/
|
||||
- NSS_CORE_DMA_CACHE_MAINT(r, sizeof(struct nss_meminfo_request), DMA_TO_DEVICE);
|
||||
NSS_CORE_DSB();
|
||||
|
||||
|
||||
/*
|
||||
@@ -545,7 +544,7 @@ static bool nss_meminfo_configure_n2h_h2
|
||||
@@ -546,7 +545,7 @@ static bool nss_meminfo_configure_n2h_h2
|
||||
* Bring a fresh copy of if_map from memory in order to read it correctly.
|
||||
*/
|
||||
if_map = mem_ctx->if_map;
|
||||
- NSS_CORE_DMA_CACHE_MAINT((void *)if_map, sizeof(struct nss_if_mem_map), DMA_FROM_DEVICE);
|
||||
+ dma_sync_single_for_cpu(nss_ctx->dev, mem_ctx->if_map_dma, sizeof(struct nss_if_mem_map), DMA_FROM_DEVICE);
|
||||
NSS_CORE_DSB();
|
||||
|
||||
|
||||
if_map->n2h_rings = NSS_N2H_RING_COUNT;
|
||||
@@ -583,7 +582,7 @@ static bool nss_meminfo_configure_n2h_h2
|
||||
@@ -584,7 +583,7 @@ static bool nss_meminfo_configure_n2h_h2
|
||||
/*
|
||||
* Flush the updated nss_if_mem_map.
|
||||
*/
|
||||
- NSS_CORE_DMA_CACHE_MAINT((void *)if_map, sizeof(struct nss_if_mem_map), DMA_TO_DEVICE);
|
||||
+ dma_sync_single_for_device(nss_ctx->dev, mem_ctx->if_map_dma, sizeof(struct nss_if_mem_map), DMA_TO_DEVICE);
|
||||
NSS_CORE_DSB();
|
||||
|
||||
|
||||
return true;
|
||||
--- a/nss_profiler.c
|
||||
+++ b/nss_profiler.c
|
||||
@@ -202,11 +202,12 @@ EXPORT_SYMBOL(nss_profile_dma_deregister
|
||||
@@ -209,11 +209,12 @@ EXPORT_SYMBOL(nss_profile_dma_deregister
|
||||
struct nss_profile_sdma_ctrl *nss_profile_dma_get_ctrl(struct nss_ctx_instance *nss_ctx)
|
||||
{
|
||||
struct nss_profile_sdma_ctrl *ctrl = nss_ctx->meminfo_ctx.sdma_ctrl;
|
||||
@ -550,7 +550,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
if (!ctrl) {
|
||||
return ctrl;
|
||||
}
|
||||
|
||||
|
||||
- dmac_inv_range(ctrl, &ctrl->cidx);
|
||||
+ dma_sync_single_for_cpu(nss_ctx->dev, (dma_addr_t) ctrl, size, DMA_FROM_DEVICE);
|
||||
dsb(sy);
|
||||
|
||||
@ -30,7 +30,7 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
#include <nss_hal.h>
|
||||
#include <net/dst.h>
|
||||
#ifdef CONFIG_BRIDGE_NETFILTER
|
||||
@@ -491,50 +493,38 @@ static void nss_core_handle_crypto_pkt(s
|
||||
@@ -492,50 +494,38 @@ static void nss_core_handle_crypto_pkt(s
|
||||
*/
|
||||
static uint32_t nss_soc_mem_info(void)
|
||||
{
|
||||
@ -73,7 +73,7 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
- if (ppp) {
|
||||
- n_items /= sizeof(ppp[0]);
|
||||
- nss_msize = be32_to_cpup(ppp + addr_cells + size_cells - 1);
|
||||
- nss_info_always("addr/size storage words %d %d # words %d in DTS, ddr size %x\n",
|
||||
- nss_info("addr/size storage words %d %d # words %d in DTS, ddr size %x\n",
|
||||
- addr_cells, size_cells, n_items, nss_msize);
|
||||
+ struct device_node *common_node, *memory_node;
|
||||
+ struct resource r;
|
||||
@ -110,5 +110,5 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
+
|
||||
+ return SZ_8M;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@ -6,6 +6,6 @@
|
||||
int32_t radio_ifnum,
|
||||
- uint32_t radio_priority);
|
||||
+ enum nss_wifili_thread_scheme_priority radio_priority);
|
||||
|
||||
|
||||
/**
|
||||
* nss_wifili_thread_scheme_dealloc
|
||||
|
||||
@ -1,74 +1,75 @@
|
||||
--- a/nss_hal/ipq807x/nss_hal_pvt.c
|
||||
+++ b/nss_hal/ipq807x/nss_hal_pvt.c
|
||||
@@ -656,62 +656,62 @@ static int __nss_hal_request_irq(struct
|
||||
@@ -659,62 +659,62 @@ static int __nss_hal_request_irq(struct
|
||||
irq_set_status_flags(irq, IRQ_DISABLE_UNLAZY);
|
||||
|
||||
|
||||
if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_EMPTY_BUFFER_SOS) {
|
||||
- netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_non_queue, NSS_EMPTY_BUFFER_SOS_PROCESSING_WEIGHT);
|
||||
+ netif_napi_add_weight(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_non_queue, NSS_EMPTY_BUFFER_SOS_PROCESSING_WEIGHT);
|
||||
int_ctx->cause = NSS_N2H_INTR_EMPTY_BUFFERS_SOS;
|
||||
err = request_irq(irq, nss_hal_handle_irq, 0, "nss_empty_buf_sos", int_ctx);
|
||||
}
|
||||
|
||||
|
||||
if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_EMPTY_BUFFER_QUEUE) {
|
||||
- netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_queue, NSS_EMPTY_BUFFER_RETURN_PROCESSING_WEIGHT);
|
||||
+ netif_napi_add_weight(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_queue, NSS_EMPTY_BUFFER_RETURN_PROCESSING_WEIGHT);
|
||||
int_ctx->cause = NSS_N2H_INTR_EMPTY_BUFFER_QUEUE;
|
||||
err = request_irq(irq, nss_hal_handle_irq, 0, "nss_empty_buf_queue", int_ctx);
|
||||
}
|
||||
|
||||
|
||||
if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_TX_UNBLOCKED) {
|
||||
- netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_non_queue, NSS_TX_UNBLOCKED_PROCESSING_WEIGHT);
|
||||
+ netif_napi_add_weight(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_non_queue, NSS_TX_UNBLOCKED_PROCESSING_WEIGHT);
|
||||
int_ctx->cause = NSS_N2H_INTR_TX_UNBLOCKED;
|
||||
err = request_irq(irq, nss_hal_handle_irq, 0, "nss-tx-unblock", int_ctx);
|
||||
}
|
||||
|
||||
|
||||
if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_DATA_QUEUE_0) {
|
||||
- netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_queue, NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT);
|
||||
+ netif_napi_add_weight(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_queue, NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT);
|
||||
int_ctx->cause = NSS_N2H_INTR_DATA_QUEUE_0;
|
||||
err = request_irq(irq, nss_hal_handle_irq, 0, "nss_queue0", int_ctx);
|
||||
}
|
||||
|
||||
|
||||
if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_DATA_QUEUE_1) {
|
||||
int_ctx->cause = NSS_N2H_INTR_DATA_QUEUE_1;
|
||||
- netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_queue, NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT);
|
||||
+ netif_napi_add_weight(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_queue, NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT);
|
||||
err = request_irq(irq, nss_hal_handle_irq, 0, "nss_queue1", int_ctx);
|
||||
}
|
||||
|
||||
|
||||
if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_DATA_QUEUE_2) {
|
||||
int_ctx->cause = NSS_N2H_INTR_DATA_QUEUE_2;
|
||||
- netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_queue, NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT);
|
||||
+ netif_napi_add_weight(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_queue, NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT);
|
||||
err = request_irq(irq, nss_hal_handle_irq, 0, "nss_queue2", int_ctx);
|
||||
}
|
||||
|
||||
|
||||
if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_DATA_QUEUE_3) {
|
||||
int_ctx->cause = NSS_N2H_INTR_DATA_QUEUE_3;
|
||||
- netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_queue, NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT);
|
||||
+ netif_napi_add_weight(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_queue, NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT);
|
||||
err = request_irq(irq, nss_hal_handle_irq, 0, "nss_queue3", int_ctx);
|
||||
}
|
||||
|
||||
|
||||
if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_COREDUMP_COMPLETE) {
|
||||
int_ctx->cause = NSS_N2H_INTR_COREDUMP_COMPLETE;
|
||||
- netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_emergency, NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT);
|
||||
+ netif_napi_add_weight(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_emergency, NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT);
|
||||
err = request_irq(irq, nss_hal_handle_irq, 0, "nss_coredump_complete", int_ctx);
|
||||
}
|
||||
|
||||
|
||||
if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_PAGED_EMPTY_BUFFER_SOS) {
|
||||
- netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_non_queue, NSS_EMPTY_BUFFER_SOS_PROCESSING_WEIGHT);
|
||||
+ netif_napi_add_weight(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_non_queue, NSS_EMPTY_BUFFER_SOS_PROCESSING_WEIGHT);
|
||||
int_ctx->cause = NSS_N2H_INTR_PAGED_EMPTY_BUFFERS_SOS;
|
||||
err = request_irq(irq, nss_hal_handle_irq, 0, "nss_paged_empty_buf_sos", int_ctx);
|
||||
}
|
||||
|
||||
|
||||
if (irq_num == NSS_HAL_N2H_INTR_PURPOSE_PROFILE_DMA) {
|
||||
int_ctx->cause = NSS_N2H_INTR_PROFILE_DMA;
|
||||
- netif_napi_add(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_sdma, NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT);
|
||||
+ netif_napi_add_weight(&nss_ctx->napi_ndev, &int_ctx->napi, nss_core_handle_napi_sdma, NSS_DATA_COMMAND_BUFFER_PROCESSING_WEIGHT);
|
||||
err = request_irq(irq, nss_hal_handle_irq, 0, "nss_profile_dma", int_ctx);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user