Thread (56 messages) 56 messages, 6 authors, 2021-11-22

Re: [PATCH v3 09/16] reset: starfive-jh7100: Add StarFive JH7100 reset driver

From: Andy Shevchenko <hidden>
Date: 2021-11-08 09:17:47
Also in: linux-clk, linux-devicetree, linux-gpio, linux-riscv, lkml

On Thu, Nov 04, 2021 at 01:15:46PM +0100, Emil Renner Berthing wrote:
On Tue, 2 Nov 2021 at 22:17, Emil Renner Berthing [off-list ref] wrote:
...
I'd really like to understand your reasoning here. As far as I can
tell reading 2 adjacent 32bit registers with a 64bit read as you're
proposing is exactly what would cause endian issues. Eg. on little
endian you'd get reg0 | reg1 << 32 whereas on big-endian you'd get
reg0 << 32 | reg1.
Nope, it won't. The endianess is a property of both CPU and device.

The I/O accessors, such as readl()/writel() and iowrtieXX()/ioreadXX()
are _always_ LE.

So, writeq() will properly put bits to their places in case device is LE.
And most devices are LE (or should be). Of course there are cases, but then
you have to specify them explicitly.

My motive here is simple as that the device is definitely a set of a few
128-bit bitmaps (in registers) and using bitmap _is_ representing hardware
in the kernel. Using something else will deviate from that (maybe not too
far, but still...).

-- 
With Best Regards,
Andy Shevchenko

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help