* [PATCH] powerpc/5200: make BestComm gen_bd microcode exchangeable
@ 2009-10-01 19:55 Albrecht Dreß
2009-10-03 9:44 ` Wolfram Sang
0 siblings, 1 reply; 5+ messages in thread
From: Albrecht Dreß @ 2009-10-01 19:55 UTC (permalink / raw)
To: grant.likely, linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 3391 bytes --]
This patch adds a method for defining different microcodes than the
pe-defined ones for the MPC52xx processor's BestComm General Buffer
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;
};
@@ -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);
+
+
/*
---------------------------------------------------------------------
* 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,
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] powerpc/5200: make BestComm gen_bd microcode exchangeable
2009-10-01 19:55 [PATCH] powerpc/5200: make BestComm gen_bd microcode exchangeable Albrecht Dreß
@ 2009-10-03 9:44 ` Wolfram Sang
2009-10-03 13:50 ` Albrecht Dreß
0 siblings, 1 reply; 5+ messages in thread
From: Wolfram Sang @ 2009-10-03 9:44 UTC (permalink / raw)
To: Albrecht Dreß; +Cc: linuxppc-dev
[-- 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 --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] powerpc/5200: make BestComm gen_bd microcode exchangeable
2009-10-03 9:44 ` Wolfram Sang
@ 2009-10-03 13:50 ` Albrecht Dreß
2009-10-03 14:40 ` Wolfram Sang
0 siblings, 1 reply; 5+ messages in thread
From: Albrecht Dreß @ 2009-10-03 13:50 UTC (permalink / raw)
To: Wolfram Sang; +Cc: linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 1258 bytes --]
Hi Wolfram:
Am 03.10.09 11:44 schrieb(en) Wolfram Sang:
> you wrote your own microcode? :)
I modified the bcom_gen_bd_rx_task for a LPB peripheral as to perform
Endianess swapping during the transfer (works meanwhile :-).
Modifying the standard kernel code for testing seemed to be the wrong
approach for me, so I wrote that patch...
If possible, I would also like to have a crc32 calculation performed by
BestComm, but unfortunately there is no documentation and Freescale
doesn't give any support, so it's all trial and error and error and
error... If you have any idea, pointers would be appreciated!
> approach looks ok to me in general, but this patch is line-wrapped.
I don't think so - the message body is a "format=flowed" (RFC 3676)
text/plain part. Maybe your MUA doesn't display that format correctly
(Outlook?)? Or is '3676 in general not acceptable for patches?
[snip]
> spaces instead of tabs
[snip]
> Two empty lines.
Thanks - will submit a fixed patch next week, stay tuned...
Cheers, Albrecht.
P.S.: Did your mtd-ram/physmap_of patch you submitted a while ago make
it into the stock kernel? I have some pending extra work (16-bit LPB
RAM access) building on top of it...
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] powerpc/5200: make BestComm gen_bd microcode exchangeable
2009-10-03 13:50 ` Albrecht Dreß
@ 2009-10-03 14:40 ` Wolfram Sang
2009-10-03 15:09 ` Albrecht Dreß
0 siblings, 1 reply; 5+ messages in thread
From: Wolfram Sang @ 2009-10-03 14:40 UTC (permalink / raw)
To: Albrecht Dreß; +Cc: linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 1304 bytes --]
> doesn't give any support, so it's all trial and error and error and
> error... If you have any idea, pointers would be appreciated!
Sorry, I hardly know anything about the microcode. From what I know, it
shouldn't be much fun due to various bugs in the Bestcomm engine.
> I don't think so - the message body is a "format=flowed" (RFC 3676)
> text/plain part. Maybe your MUA doesn't display that format correctly
> (Outlook?)?
Hey! No need for insults! ;)
Have to check if my MUA (see headers) supports it. The archives seem to have
split it as well:
http://lists.ozlabs.org/pipermail/linuxppc-dev/2009-October/076236.html
I recall a similar problem, where some archives had the patch correct and some
didn't.
> Or is '3676 in general not acceptable for patches?
Maybe. Could you try without next time, and we will see if it works better?
> P.S.: Did your mtd-ram/physmap_of patch you submitted a while ago make
> it into the stock kernel? I have some pending extra work (16-bit LPB
> RAM access) building on top of it...
Yup, since -rc1. (git log --grep=mtd-ram)
Regards,
Wolfram
--
Pengutronix e.K. | Wolfram Sang |
Industrial Linux Solutions | http://www.pengutronix.de/ |
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] powerpc/5200: make BestComm gen_bd microcode exchangeable
2009-10-03 14:40 ` Wolfram Sang
@ 2009-10-03 15:09 ` Albrecht Dreß
0 siblings, 0 replies; 5+ messages in thread
From: Albrecht Dreß @ 2009-10-03 15:09 UTC (permalink / raw)
To: Wolfram Sang; +Cc: linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 857 bytes --]
Am 03.10.09 16:40 schrieb(en) Wolfram Sang:
> Sorry, I hardly know anything about the microcode. From what I know,
> it shouldn't be much fun due to various bugs in the Bestcomm engine.
Ummm. That's not encouraging! :-/
> Hey! No need for insults! ;)
Sorry, that wasn't my intention, but it's a MUA I *know* it doesn't
understand it... most OSS clients do (like Balsa, Thunderbird, kmail,
etc.).
> > Or is '3676 in general not acceptable for patches?
>
> Maybe. Could you try without next time, and we will see if it works
> better?
Actually, it's in Documentation/email-clients.txt - '3676 must not be
used. Sorry, should have read that before! (However, messages
*without* folding *and* with lines > 78 characters violate RFC2822...)
> Yup, since -rc1. (git log --grep=mtd-ram)
Thanks!
Cheers, Albrecht.
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-10-03 15:09 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-01 19:55 [PATCH] powerpc/5200: make BestComm gen_bd microcode exchangeable Albrecht Dreß
2009-10-03 9:44 ` Wolfram Sang
2009-10-03 13:50 ` Albrecht Dreß
2009-10-03 14:40 ` Wolfram Sang
2009-10-03 15:09 ` Albrecht Dreß
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).