From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from az33egw02.freescale.net (az33egw02.freescale.net [192.88.158.103]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "az33egw02.freescale.net", Issuer "Thawte Premium Server CA" (verified OK)) by ozlabs.org (Postfix) with ESMTP id EFD9ADDEF1 for ; Thu, 7 Jun 2007 08:19:35 +1000 (EST) Message-ID: <466732EE.8080306@freescale.com> Date: Wed, 06 Jun 2007 17:19:26 -0500 From: Timur Tabi MIME-Version: 1.0 To: Arnd Bergmann Subject: Re: MPC8349ea Random Device Generator driver References: <20070606220913.GA27820@lixom.net> <46673009.6000109@freescale.com> <200706070011.43347.arnd@arndb.de> In-Reply-To: <200706070011.43347.arnd@arndb.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Cc: Olof Johansson , linuxppc-dev@ozlabs.org, sl@powerlinux.fr, Philippe Lachenal List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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