linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Aaro Koskinen <aaro.koskinen@nokia.com>
To: Ralf Baechle <ralf@linux-mips.org>,
	David Daney <ddaney.cavm@gmail.com>,
	linux-mips@linux-mips.org
Cc: Janne Huttunen <janne.huttunen@nokia.com>,
	Aaro Koskinen <aaro.koskinen@nokia.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	devel@driverdev.osuosl.org
Subject: [PATCH 07/14] MIPS/staging: OCTEON: properly enable/disable SSO WQE interrupts
Date: Thu, 13 Aug 2015 16:21:39 +0300	[thread overview]
Message-ID: <1439472106-7750-8-git-send-email-aaro.koskinen@nokia.com> (raw)
In-Reply-To: <1439472106-7750-1-git-send-email-aaro.koskinen@nokia.com>

The Octeon models with SSO instead of POW need to use a different register
for configuring the WQE interrupt thresholds.

Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
---
 drivers/staging/octeon/ethernet-rx.c | 54 ++++++++++++++++++++++++++----------
 drivers/staging/octeon/ethernet.c    |  5 +++-
 2 files changed, 43 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/octeon/ethernet-rx.c b/drivers/staging/octeon/ethernet-rx.c
index 22853d3..1636bd9 100644
--- a/drivers/staging/octeon/ethernet-rx.c
+++ b/drivers/staging/octeon/ethernet-rx.c
@@ -195,12 +195,19 @@ static int cvm_oct_napi_poll(struct napi_struct *napi, int budget)
 		prefetch(work);
 		did_work_request = 0;
 		if (work == NULL) {
-			union cvmx_pow_wq_int wq_int;
+			if (OCTEON_IS_MODEL(OCTEON_CN68XX)) {
+				cvmx_write_csr(CVMX_SSO_WQ_IQ_DIS,
+					       1ull << pow_receive_group);
+				cvmx_write_csr(CVMX_SSO_WQ_INT,
+					       1ull << pow_receive_group);
+			} else {
+				union cvmx_pow_wq_int wq_int;
 
-			wq_int.u64 = 0;
-			wq_int.s.iq_dis = 1 << pow_receive_group;
-			wq_int.s.wq_int = 1 << pow_receive_group;
-			cvmx_write_csr(CVMX_POW_WQ_INT, wq_int.u64);
+				wq_int.u64 = 0;
+				wq_int.s.iq_dis = 1 << pow_receive_group;
+				wq_int.s.wq_int = 1 << pow_receive_group;
+				cvmx_write_csr(CVMX_POW_WQ_INT, wq_int.u64);
+			}
 			break;
 		}
 		pskb = (struct sk_buff **)(cvm_oct_get_buffer_ptr(work->packet_ptr) -
@@ -422,8 +429,6 @@ void cvm_oct_rx_initialize(void)
 {
 	int i;
 	struct net_device *dev_for_napi = NULL;
-	union cvmx_pow_wq_int_thrx int_thr;
-	union cvmx_pow_wq_int_pc int_pc;
 
 	for (i = 0; i < TOTAL_NUMBER_OF_PORTS; i++) {
 		if (cvm_oct_device[i]) {
@@ -449,15 +454,34 @@ void cvm_oct_rx_initialize(void)
 
 	disable_irq_nosync(OCTEON_IRQ_WORKQ0 + pow_receive_group);
 
-	int_thr.u64 = 0;
-	int_thr.s.tc_en = 1;
-	int_thr.s.tc_thr = 1;
 	/* Enable POW interrupt when our port has at least one packet */
-	cvmx_write_csr(CVMX_POW_WQ_INT_THRX(pow_receive_group), int_thr.u64);
-
-	int_pc.u64 = 0;
-	int_pc.s.pc_thr = 5;
-	cvmx_write_csr(CVMX_POW_WQ_INT_PC, int_pc.u64);
+	if (OCTEON_IS_MODEL(OCTEON_CN68XX)) {
+		union cvmx_sso_wq_int_thrx int_thr;
+		union cvmx_pow_wq_int_pc int_pc;
+
+		int_thr.u64 = 0;
+		int_thr.s.tc_en = 1;
+		int_thr.s.tc_thr = 1;
+		cvmx_write_csr(CVMX_SSO_WQ_INT_THRX(pow_receive_group),
+			       int_thr.u64);
+
+		int_pc.u64 = 0;
+		int_pc.s.pc_thr = 5;
+		cvmx_write_csr(CVMX_SSO_WQ_INT_PC, int_pc.u64);
+	} else {
+		union cvmx_pow_wq_int_thrx int_thr;
+		union cvmx_pow_wq_int_pc int_pc;
+
+		int_thr.u64 = 0;
+		int_thr.s.tc_en = 1;
+		int_thr.s.tc_thr = 1;
+		cvmx_write_csr(CVMX_POW_WQ_INT_THRX(pow_receive_group),
+			       int_thr.u64);
+
+		int_pc.u64 = 0;
+		int_pc.s.pc_thr = 5;
+		cvmx_write_csr(CVMX_POW_WQ_INT_PC, int_pc.u64);
+	}
 
 	/* Schedule NAPI now. This will indirectly enable the interrupt. */
 	napi_schedule(&cvm_oct_napi);
diff --git a/drivers/staging/octeon/ethernet.c b/drivers/staging/octeon/ethernet.c
index f9dba23..363742a 100644
--- a/drivers/staging/octeon/ethernet.c
+++ b/drivers/staging/octeon/ethernet.c
@@ -859,7 +859,10 @@ static int cvm_oct_remove(struct platform_device *pdev)
 	int port;
 
 	/* Disable POW interrupt */
-	cvmx_write_csr(CVMX_POW_WQ_INT_THRX(pow_receive_group), 0);
+	if (OCTEON_IS_MODEL(OCTEON_CN68XX))
+		cvmx_write_csr(CVMX_SSO_WQ_INT_THRX(pow_receive_group), 0);
+	else
+		cvmx_write_csr(CVMX_POW_WQ_INT_THRX(pow_receive_group), 0);
 
 	cvmx_ipd_disable();
 
-- 
2.4.3

  parent reply	other threads:[~2015-08-13 13:25 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-13 13:21 [PATCH 00/14] MIPS/staging: OCTEON: enable ethernet/xaui on CN68XX Aaro Koskinen
2015-08-13 13:21 ` [PATCH 01/14] MIPS: OCTEON: fix CN6880 hang on XAUI init Aaro Koskinen
2015-08-13 13:21 ` [PATCH 02/14] MIPS: OCTEON: support additional interfaces on CN68XX Aaro Koskinen
2015-08-13 13:21 ` [PATCH 03/14] MIPS: OCTEON: support all PIP input ports " Aaro Koskinen
2015-08-13 13:21 ` [PATCH 04/14] MIPS: OCTEON: configure XAUI pkinds Aaro Koskinen
2015-08-13 13:21 ` [PATCH 05/14] MIPS: OCTEON: configure minimum PKO packet sizes on CN68XX Aaro Koskinen
2015-08-13 13:21 ` [PATCH 06/14] MIPS: OCTEON: add definitions for setting up SSO Aaro Koskinen
2015-08-13 13:21 ` Aaro Koskinen [this message]
2015-08-13 13:21 ` [PATCH 08/14] MIPS/staging: OCTEON: set SSO group mask properly on CN68XX Aaro Koskinen
2015-08-13 13:21 ` [PATCH 09/14] MIPS/staging: OCTEON: increase output command buffers Aaro Koskinen
2015-08-13 13:21 ` [PATCH 10/14] MIPS/staging: OCTEON: support CN68XX style WQE Aaro Koskinen
2015-08-13 13:21 ` [PATCH 11/14] MIPS: OCTEON: initialize CN68XX PKO Aaro Koskinen
2015-08-13 13:21 ` [PATCH 12/14] MIPS: OCTEON: set up 1:1 mapping between CN68XX PKO queues and ports Aaro Koskinen
2015-08-13 13:21 ` [PATCH 13/14] MIPS: OCTEON: support interfaces 4 and 5 Aaro Koskinen
2015-08-13 13:21 ` [PATCH 14/14] MIPS/staging: OCTEON: use common helpers for determining interface and port Aaro Koskinen
2015-08-13 19:16 ` [PATCH 00/14] MIPS/staging: OCTEON: enable ethernet/xaui on CN68XX David Daney
2015-08-13 19:16   ` David Daney
2015-08-14 13:09   ` Aaro Koskinen
2015-08-14 19:49     ` David Daney
2015-08-14 19:49       ` David Daney
2015-08-19 19:40       ` Ralf Baechle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1439472106-7750-8-git-send-email-aaro.koskinen@nokia.com \
    --to=aaro.koskinen@nokia.com \
    --cc=ddaney.cavm@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=janne.huttunen@nokia.com \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).