From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60403) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fWpZ7-0002Fr-TX for qemu-devel@nongnu.org; Sat, 23 Jun 2018 16:55:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fWpZ4-00005c-Rh for qemu-devel@nongnu.org; Sat, 23 Jun 2018 16:55:25 -0400 Date: Sat, 23 Jun 2018 22:55:11 +0200 (CEST) From: BALATON Zoltan In-Reply-To: <20180623023420.GA28312@roeck-us.net> Message-ID: References: <1529642871-14214-1-git-send-email-linux@roeck-us.net> <20180622050334.GG612@umbus.fritz.box> <20180623023420.GA28312@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Subject: Re: [Qemu-devel] [PATCH] ppc: Fix sam460ex devicetree when booting the Linux kernel List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Guenter Roeck Cc: Alexander Graf , David Gibson , qemu-ppc@nongnu.org, qemu-devel@nongnu.org On Fri, 22 Jun 2018, Guenter Roeck wrote: > The problem is this (from the kernel diffs provided by aCube): > > #if defined(CONFIG_PPC32) > -#define smc501_readl(addr) ioread32be((addr)) > -#define smc501_writel(val, addr) iowrite32be((val), (addr)) > +#define smc501_readl(addr) ioread32((addr)) > +#define smc501_writel(val, addr) iowrite32((val), (addr)) > #else > #define smc501_readl(addr) readl(addr) > #define smc501_writel(val, addr) writel(val, addr) > > This is a bit fishy since the cpu is big endian and iowrite32be() > should be identical to iowrite32(), but apparently that is not the > case here. I don't think I'll have time to track this down, though. Thanks for finding this, it helps even if you don't have time to track it down completely. Could this be related to using little endian PCI device on a big endian CPU? Not sure which implementation will this use but in arch/powerpc/kernel/iomap.c: unsigned int ioread32(void __iomem *addr) { return readl(addr); } unsigned int ioread32be(void __iomem *addr) { return readl_be(addr); } so they don't look identical.