From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfgang Denk Date: Thu, 14 May 2009 11:42:12 +0200 Subject: [U-Boot] [PATCH 01/10] mx27: basic cpu support In-Reply-To: <4A0BE30F.9070902@emcraft.com> References: <1241634633-13917-1-git-send-email-yanok@emcraft.com> <1241634633-13917-2-git-send-email-yanok@emcraft.com> <20090506211604.289C483420E8@gemini.denx.de> <4A0B4F9A.8030503@emcraft.com> <20090514081007.AF05C832E416@gemini.denx.de> <4A0BE30F.9070902@emcraft.com> Message-ID: <20090514094212.2E760832E416@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Ilya, in message <4A0BE30F.9070902@emcraft.com> you wrote: > > Well, out_be32() and friends don't convert pointer, you are right. But > these functions are not really generic, they can be found only on couple > of archs. And writel() and friends (which are generic accessor functions > for MMIO) do silent pointer conversion... That's a serious deficiency of the (current) ARM implementation then. Also please keep in mind that, at least in Linux, readl() / writel() and friend are primarily intended to perform PCI memory accesses via an ioremap region, and that they perform little endian accesses. I agree that the current definition: #define __arch_getl(a) (*(volatile unsigned int *)(a)) ... #define readl(a) __arch_getl(a) is indeed horrible and does not perform any of the type checking I supposedit was doing. [Hm.. sometimes I wish I had better knowledge of the ARM code in U-Boot and Linux, but at times like this I am pretty sure that I should be happy that I don't :-( ] > I see. PowerPC in Linux uses C structs too. But there are still a lot of > code that uses registers offsets in Linux, so my arguments are the same: > requirement to convert offsets to C struct brings additional > difficulties to porting (and maintaining already ported) drivers from Linux. I understand your argument, but the decision has been made. We want to get rid of this pointer stuff in U-Boot, and do not accept any new code like this any more. > Ok, we can do that. But for what reason? I don't think this improves > readability... Well, I don't think long lists of address offsets improve readability. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de In the beginning, there was nothing, which exploded. - Terry Pratchett, _Lords and Ladies_