[U-Boot] should there be general setbits function?

Mr. goldenstreet ranberant at gmail.com
Wed May 9 06:46:18 UTC 2018


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/


More information about the U-Boot mailing list