From: Mr. goldenstreet <ranberant@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] should there be general setbits function?
Date: Tue, 8 May 2018 23:46:18 -0700 (MST) [thread overview]
Message-ID: <1525848378882-0.post@n7.nabble.com> (raw)
hey,
in some parts of the code set bits operations on registers are implemented
like this:
writel(readl(register) | CONSTANT, register)
i know there are setbits_be/setbits_le functions in io.h, so why isn't there
a general setbits function which checks your architecture and decides which
one of the two to use?
example(/drivers/net/designware.c):
BEFORE:
(line 281)writel(readl(&dma_p->busmode) | DMAMAC_SRST, &dma_p->busmode);
AFTER:
(line 281)setbits(&dma_p->busmode, DMAMAC_SRST)
would really appreciate an answer, thanks :)
--
Sent from: http://u-boot.10912.n7.nabble.com/
reply other threads:[~2018-05-09 6:46 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1525848378882-0.post@n7.nabble.com \
--to=ranberant@gmail.com \
--cc=u-boot@lists.denx.de \
/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