From: Eugene Surovegin <ebs@ebshome.net>
To: "Verberk, Bep" <verberk@nortelnetworks.com>
Cc: linuxppc-embedded@lists.linuxppc.org
Subject: Re: mtdcr and mfdcr macros
Date: Wed, 3 Dec 2003 12:02:57 -0800 [thread overview]
Message-ID: <20031203200257.GA30768@gate.ebshome.net> (raw)
In-Reply-To: <Pine.LNX.4.44.0312030959380.3107-100000@localhost.localdomain>
On Wed, Dec 03, 2003 at 10:25:18AM -0500, Verberk, Bep wrote:
>
> I'd like a sanity check on a change I am considering to
> these macros....
>
> I had some difficulty executing these macros
> (found in include/asm/processor.h) in a loop, eg:
>
> #define DMA0_BANKS 4
> #define DCRN_DMA0_BASE 0x100
> #define DCRN_DMA0_CR(bank) (DCRN_DMA0_BASE + (8 * (bank)))
>
> for(i=0;i<DMA0_BANKS;i++){
> dma0_cr = mfdcr(DCRN_DMA0_CR(i));
> CLEARBITS(dma0_cr, DMA0_CR_PCE);
> mtdcr(DCRN_DMA0_CR(i), dma0_cr);
> };
You cannot use mtdcr/mfdcr with DCR number changed on run-time. These
instructions encode DCR number in their body (look at the instruction
format in any 4xx manual).
And, yes this is major PITA.
The only way (I know) to use dynamic DCR numbers is to have a table
with mfdcr/mtdcr instructions for every possible DCR number and jump
on the correct one depending on supplied DCR number.
Eugene.
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
next prev parent reply other threads:[~2003-12-03 20:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-12-03 15:25 mtdcr and mfdcr macros Verberk, Bep
2003-12-03 17:56 ` Verberk, Bep
2003-12-03 20:02 ` Eugene Surovegin [this message]
2003-12-04 14:03 ` Verberk, Bep
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=20031203200257.GA30768@gate.ebshome.net \
--to=ebs@ebshome.net \
--cc=linuxppc-embedded@lists.linuxppc.org \
--cc=verberk@nortelnetworks.com \
/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).