linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Haiying Wang <Haiying.Wang@freescale.com>
To: linuxppc-dev@ozlabs.org, galak@kernel.crashing.org
Cc: Haiying Wang <Haiying.Wang@freescale.com>
Subject: [PATCH 3/6] net/ucc_geth: update riscTx and riscRx in ucc_geth
Date: Wed, 29 Apr 2009 14:14:35 -0400	[thread overview]
Message-ID: <12410288811793-git-send-email-Haiying.Wang@freescale.com> (raw)
In-Reply-To: <12410288792524-git-send-email-Haiying.Wang@freescale.com>

Change the definition of riscTx and riscRx to unsigned integer instead of enum,
and change their values to support 4 risc allocation if the qe has 4 RISC
engines.

Signed-off-by: Haiying Wang <Haiying.Wang@freescale.com>
---
 drivers/net/ucc_geth.c |   14 +++++++++++---
 drivers/net/ucc_geth.h |    4 ++--
 2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index d3f39e8..3e003fe 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -270,7 +270,7 @@ static int fill_init_enet_entries(struct ucc_geth_private *ugeth,
 				  u8 num_entries,
 				  u32 thread_size,
 				  u32 thread_alignment,
-				  enum qe_risc_allocation risc,
+				  unsigned int risc,
 				  int skip_page_for_first_entry)
 {
 	u32 init_enet_offset;
@@ -307,7 +307,7 @@ static int fill_init_enet_entries(struct ucc_geth_private *ugeth,
 static int return_init_enet_entries(struct ucc_geth_private *ugeth,
 				    u32 *p_start,
 				    u8 num_entries,
-				    enum qe_risc_allocation risc,
+				    unsigned int risc,
 				    int skip_page_for_first_entry)
 {
 	u32 init_enet_offset;
@@ -342,7 +342,7 @@ static int dump_init_enet_entries(struct ucc_geth_private *ugeth,
 				  u32 __iomem *p_start,
 				  u8 num_entries,
 				  u32 thread_size,
-				  enum qe_risc_allocation risc,
+				  unsigned int risc,
 				  int skip_page_for_first_entry)
 {
 	u32 init_enet_offset;
@@ -2134,6 +2134,14 @@ static int ucc_struct_init(struct ucc_geth_private *ugeth)
 		return -ENOMEM;
 	}
 
+	/* read the number of risc engines, update the riscTx and riscRx
+	 * if there are 4 riscs in QE
+	 */
+	if (qe_get_num_of_risc() == 4) {
+		ug_info->riscTx = QE_RISC_ALLOCATION_FOUR_RISCS;
+		ug_info->riscRx = QE_RISC_ALLOCATION_FOUR_RISCS;
+	}
+
 	ugeth->ug_regs = ioremap(uf_info->regs, sizeof(*ugeth->ug_regs));
 	if (!ugeth->ug_regs) {
 		if (netif_msg_probe(ugeth))
diff --git a/drivers/net/ucc_geth.h b/drivers/net/ucc_geth.h
index 2f8ee7c..46bb1d2 100644
--- a/drivers/net/ucc_geth.h
+++ b/drivers/net/ucc_geth.h
@@ -1120,8 +1120,8 @@ struct ucc_geth_info {
 	enum ucc_geth_maccfg2_pad_and_crc_mode padAndCrc;
 	enum ucc_geth_num_of_threads numThreadsTx;
 	enum ucc_geth_num_of_threads numThreadsRx;
-	enum qe_risc_allocation riscTx;
-	enum qe_risc_allocation riscRx;
+	unsigned int riscTx;
+	unsigned int riscRx;
 };
 
 /* structure representing UCC GETH */
-- 
1.6.0.2

  reply	other threads:[~2009-04-29 18:14 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-29 18:14 [PATCH 1/6] powerpc/85xx: clean up for mpc8568_mds name Haiying Wang
2009-04-29 18:14 ` [PATCH 2/6] powerpc/qe: update risc allocation for QE Haiying Wang
2009-04-29 18:14   ` Haiying Wang [this message]
2009-04-29 18:14     ` [PATCH 4/6] powerpc/qe: update QE Serial Number Haiying Wang
2009-04-29 18:14       ` [PATCH 5/6] net/ucc_geth: Assign six threads to Rx for UEC Haiying Wang
2009-04-29 18:14         ` [PATCH 6/6] powerpc/85xx: Add MPC8569MDS board support Haiying Wang
2009-04-29 20:25         ` [PATCH 5/6] net/ucc_geth: Assign six threads to Rx for UEC Kumar Gala
2009-04-30  4:35       ` [PATCH 4/6] powerpc/qe: update QE Serial Number Kumar Gala
2009-04-29 20:23     ` [PATCH 3/6] net/ucc_geth: update riscTx and riscRx in ucc_geth Kumar Gala
2009-04-29 21:51       ` David Miller
2009-04-30  4:34   ` [PATCH 2/6] powerpc/qe: update risc allocation for QE Kumar Gala
2009-04-30 11:48   ` Kumar Gala
2009-04-30 11:37 ` [PATCH 1/6] powerpc/85xx: clean up for mpc8568_mds name Kumar Gala

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=12410288811793-git-send-email-Haiying.Wang@freescale.com \
    --to=haiying.wang@freescale.com \
    --cc=galak@kernel.crashing.org \
    --cc=linuxppc-dev@ozlabs.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).