public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Wolfram Sang <w.sang@pengutronix•de>
To: "Albrecht Dreß" <albrecht.dress@arcor•de>
Cc: linuxppc-dev@ozlabs•org
Subject: Re: [PATCH] powerpc/5200: make BestComm gen_bd microcode exchangeable
Date: Sat, 3 Oct 2009 11:44:17 +0200	[thread overview]
Message-ID: <20091003094417.GA24206@pengutronix.de> (raw)
In-Reply-To: <1254426938.3252.1@antares>

[-- Attachment #1: Type: text/plain, Size: 3948 bytes --]

Hi Albrecht,

you wrote your own microcode? :)
approach looks ok to me in general, but this patch is line-wrapped.

On Thu, Oct 01, 2009 at 09:55:38PM +0200, Albrecht Dreß wrote:
> This patch adds a method for defining different microcodes than the  
> pe-defined ones for the MPC52xx processor's BestComm General Buffer  

pre-defined

> Descriptor (gen_db) tasks.  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 efficient than explicitly  
> loading it via bcom_load_image() after each bcom_gen_bd_[rt]x_reset().
>
> Signed-off-by: Albrecht Dreß <albrecht.dress@arcor•de>
>
>
> ---
>
>
> diff -uprN -X linux-2.6.30.3/Documentation/dontdiff  
> linux-2.6.30.3.orig/arch/powerpc/sysdev/bestcomm/gen_bd.c  
> linux-2.6.30.3/arch/powerpc/sysdev/bestcomm/gen_bd.c
> --- linux-2.6.30.3.orig/arch/powerpc/sysdev/bestcomm/gen_bd.c	2009-07-24 
> 23:47:51.000000000 +0200
> +++ linux-2.6.30.3/arch/powerpc/sysdev/bestcomm/gen_bd.c	2009-10-01 
> 14:26:33.000000000 +0200
> @@ -78,6 +78,7 @@ struct bcom_gen_bd_priv {
>  	int		initiator;
>  	int		ipr;
>  	int		maxbufsize;
> +	u32    *microcode;

spaces instead of tabs

>  };
>
>
> @@ -104,6 +105,7 @@ bcom_gen_bd_rx_init(int queue_len, phys_
>  	priv->initiator	= initiator;
>  	priv->ipr	= ipr;
>  	priv->maxbufsize = maxbufsize;
> +	priv->microcode = bcom_gen_bd_rx_task;
>
>  	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 = (struct bcom_gen_bd_rx_var *) bcom_task_var(tsk->tasknum);
>  	inc = (struct bcom_gen_bd_rx_inc *) bcom_task_inc(tsk->tasknum);
>
> -	if (bcom_load_image(tsk->tasknum, bcom_gen_bd_rx_task))
> +	if (bcom_load_image(tsk->tasknum, priv->microcode))
>  		return -1;
>
>  	var->enable	= bcom_eng->regs_base +
> @@ -188,6 +190,7 @@ bcom_gen_bd_tx_init(int queue_len, phys_
>  	priv->fifo	= fifo;
>  	priv->initiator	= initiator;
>  	priv->ipr	= ipr;
> +	priv->microcode = bcom_gen_bd_tx_task;
>
>  	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 = (struct bcom_gen_bd_tx_var *) bcom_task_var(tsk->tasknum);
>  	inc = (struct bcom_gen_bd_tx_inc *) bcom_task_inc(tsk->tasknum);
>
> -	if (bcom_load_image(tsk->tasknum, bcom_gen_bd_tx_task))
> +	if (bcom_load_image(tsk->tasknum, priv->microcode))
>  		return -1;
>
>  	var->enable	= bcom_eng->regs_base +
> @@ -253,6 +256,16 @@ bcom_gen_bd_tx_release(struct bcom_task
>  }
>  EXPORT_SYMBOL_GPL(bcom_gen_bd_tx_release);
>
> +void
> +bcom_gen_bd_set_microcode(struct bcom_task *tsk, u32 *microcode)
> +{
> +	struct bcom_gen_bd_priv *priv = tsk->priv;
> +
> +	priv->microcode = microcode;
> +}
> +EXPORT_SYMBOL_GPL(bcom_gen_bd_set_microcode);
> +
> +

Two empty lines.

>  /*  
> ---------------------------------------------------------------------
>   * PSC support code
>   */
> diff -uprN -X linux-2.6.30.3/Documentation/dontdiff  
> linux-2.6.30.3.orig/arch/powerpc/sysdev/bestcomm/gen_bd.h  
> linux-2.6.30.3/arch/powerpc/sysdev/bestcomm/gen_bd.h
> --- linux-2.6.30.3.orig/arch/powerpc/sysdev/bestcomm/gen_bd.h	2009-07-24 
> 23:47:51.000000000 +0200
> +++ linux-2.6.30.3/arch/powerpc/sysdev/bestcomm/gen_bd.h	2009-10-01 
> 14:26:50.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);
>
> +extern void
> +bcom_gen_bd_set_microcode(struct bcom_task *tsk, u32 *microcode);
> +
>
>  /* PSC support utility wrappers */
>  struct bcom_task * bcom_psc_gen_bd_rx_init(unsigned psc_num, int  
> queue_len,
>

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

  reply	other threads:[~2009-10-03  9:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-01 19:55 [PATCH] powerpc/5200: make BestComm gen_bd microcode exchangeable Albrecht Dreß
2009-10-03  9:44 ` Wolfram Sang [this message]
2009-10-03 13:50   ` Albrecht Dreß
2009-10-03 14:40     ` Wolfram Sang
2009-10-03 15:09       ` Albrecht Dreß

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=20091003094417.GA24206@pengutronix.de \
    --to=w.sang@pengutronix$(echo .)de \
    --cc=albrecht.dress@arcor$(echo .)de \
    --cc=linuxppc-dev@ozlabs$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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