MPC8349ea Random Device Generator driver

Timur Tabi timur at freescale.com
Thu Jun 7 08:19:26 EST 2007


Arnd Bergmann wrote:

> The only code that is allowed to dereference an __iomem pointer is the
> implementation of readl/writel and similar functions.
> The code you gave as an example gives you a warning when building with
> make C=1 using sparse, and missed barriers.

Well, that's why I said "or something like that".

Anyway, there's a more fundamental problem.  I can't find any 64-bit versions of the 
in_be/out_be/read/write functions.  Because the registers are big-endian, then we have a 
few choices:

1) Create 64-bit versions of these functions.  Can someone tell me why they don't exist 
already?

2) Do something stupid like u32 v = in_be32(((void *) &rng->rngisr) + 4);

3) Change the struct like this:

struct sec_rng {
	__be32	rngmr_hi;
	__be32	rngmr_lo;
	u8 res1[8];
	__be32 rngdsr_hi;
	__be32 rngdsr_lo;
	__be32 rngrcr_hi;
	__be32 rngrcr_lo;
...

Comments?

-- 
Timur Tabi
Linux Kernel Developer @ Freescale



More information about the Linuxppc-dev mailing list