linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Albrecht Dreß" <albrecht.dress@arcor.de>
To: Linux PPC Development <linuxppc-dev@ozlabs.org>,
	grant.likely@secretlab.ca
Subject: [PATCH/v2] powerpc/5200: make BestComm gen_bd microcode exchangeable
Date: Mon, 05 Oct 2009 19:41:07 +0200	[thread overview]
Message-ID: <1254764467.5503.1@antares> (raw)

This patch adds a method for defining different microcodes than the pe-defi=
ned ones for the MPC52xx's BestComm General Buffer Descriptor (gen_db) task=
s.  The default microcode is still the one from bcom_gen_bd_[rt]x_task, but=
 it can be replaced by calling bcom_gen_bd_set_microcode() which is more ef=
ficient than explicitly loading it via bcom_load_image() after each bcom_ge=
n_bd_[rt]x_reset().

Except for a fixed tab vs. space formatting and the transfer format, there =
are no diffierences to the initial attempt.

Signed-off-by: Albrecht Dre=DF <albrecht.dress@arcor.de>


---


diff -uprN -X linux-2.6.32-rc3/Documentation/dontdiff linux-2.6.32-rc3-orig=
/arch/powerpc/sysdev/bestcomm/gen_bd.c linux-2.6.32-rc3/arch/powerpc/sysdev=
/bestcomm/gen_bd.c
--- linux-2.6.32-rc3-orig/arch/powerpc/sysdev/bestcomm/gen_bd.c	2009-10-05 =
02:12:30.000000000 +0200
+++ linux-2.6.32-rc3/arch/powerpc/sysdev/bestcomm/gen_bd.c	2009-10-05 14:52=
:31.000000000 +0200
@@ -78,6 +78,7 @@ struct bcom_gen_bd_priv {
 	int		initiator;
 	int		ipr;
 	int		maxbufsize;
+	u32		*microcode;
 };
=20
=20
@@ -104,6 +105,7 @@ bcom_gen_bd_rx_init(int queue_len, phys_
 	priv->initiator	=3D initiator;
 	priv->ipr	=3D ipr;
 	priv->maxbufsize =3D maxbufsize;
+	priv->microcode =3D bcom_gen_bd_rx_task;
=20
 	if (bcom_gen_bd_rx_reset(tsk)) {
 		bcom_task_free(tsk);
@@ -128,7 +130,7 @@ bcom_gen_bd_rx_reset(struct bcom_task *t
 	var =3D (struct bcom_gen_bd_rx_var *) bcom_task_var(tsk->tasknum);
 	inc =3D (struct bcom_gen_bd_rx_inc *) bcom_task_inc(tsk->tasknum);
=20
-	if (bcom_load_image(tsk->tasknum, bcom_gen_bd_rx_task))
+	if (bcom_load_image(tsk->tasknum, priv->microcode))
 		return -1;
=20
 	var->enable	=3D bcom_eng->regs_base +
@@ -188,6 +190,7 @@ bcom_gen_bd_tx_init(int queue_len, phys_
 	priv->fifo	=3D fifo;
 	priv->initiator	=3D initiator;
 	priv->ipr	=3D ipr;
+	priv->microcode =3D bcom_gen_bd_tx_task;
=20
 	if (bcom_gen_bd_tx_reset(tsk)) {
 		bcom_task_free(tsk);
@@ -212,7 +215,7 @@ bcom_gen_bd_tx_reset(struct bcom_task *t
 	var =3D (struct bcom_gen_bd_tx_var *) bcom_task_var(tsk->tasknum);
 	inc =3D (struct bcom_gen_bd_tx_inc *) bcom_task_inc(tsk->tasknum);
=20
-	if (bcom_load_image(tsk->tasknum, bcom_gen_bd_tx_task))
+	if (bcom_load_image(tsk->tasknum, priv->microcode))
 		return -1;
=20
 	var->enable	=3D bcom_eng->regs_base +
@@ -253,6 +256,15 @@ bcom_gen_bd_tx_release(struct bcom_task=20
 }
 EXPORT_SYMBOL_GPL(bcom_gen_bd_tx_release);
=20
+void
+bcom_gen_bd_set_microcode(struct bcom_task *tsk, u32 *microcode)
+{
+	struct bcom_gen_bd_priv *priv =3D tsk->priv;
+
+	priv->microcode =3D microcode;
+}
+EXPORT_SYMBOL_GPL(bcom_gen_bd_set_microcode);
+
 /* ---------------------------------------------------------------------
  * PSC support code
  */
diff -uprN -X linux-2.6.32-rc3/Documentation/dontdiff linux-2.6.32-rc3-orig=
/arch/powerpc/sysdev/bestcomm/gen_bd.h linux-2.6.32-rc3/arch/powerpc/sysdev=
/bestcomm/gen_bd.h
--- linux-2.6.32-rc3-orig/arch/powerpc/sysdev/bestcomm/gen_bd.h	2009-10-05 =
02:12:30.000000000 +0200
+++ linux-2.6.32-rc3/arch/powerpc/sysdev/bestcomm/gen_bd.h	2009-10-05 14:52=
:31.000000000 +0200
@@ -43,6 +43,9 @@ bcom_gen_bd_tx_reset(struct bcom_task *t
 extern void
 bcom_gen_bd_tx_release(struct bcom_task *tsk);
=20
+extern void
+bcom_gen_bd_set_microcode(struct bcom_task *tsk, u32 *microcode);
+
=20
 /* PSC support utility wrappers */
 struct bcom_task * bcom_psc_gen_bd_rx_init(unsigned psc_num, int queue_len=
,

             reply	other threads:[~2009-10-05 17:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-05 17:41 Albrecht Dreß [this message]
2009-10-05 18:16 ` [PATCH/v2] powerpc/5200: make BestComm gen_bd microcode exchangeable Grant Likely
2009-10-05 19:42   ` Albrecht Dreß
2009-11-01  6:47     ` Grant Likely

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=1254764467.5503.1@antares \
    --to=albrecht.dress@arcor.de \
    --cc=grant.likely@secretlab.ca \
    --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).