From patchwork Fri Dec 2 14:48:33 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: acrux X-Patchwork-Id: 128880 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id D76D4B7238 for ; Sat, 3 Dec 2011 01:48:49 +1100 (EST) Received: from outrelay07.libero.it (outrelay07.libero.it [212.52.84.111]) by ozlabs.org (Postfix) with ESMTP id 53F56B6F64 for ; Sat, 3 Dec 2011 01:48:41 +1100 (EST) X-CTCH-Spam: Unknown X-CTCH-RefID: str=0001.0A0B0201.4ED8E541.0135,ss=1,re=0.000,fgs=0 X-libjamoibt: 1823 Received: from hermes (151.77.242.146) by outrelay07.libero.it (8.5.133) (authenticated as acrux_it@libero.it) id 4DF734C01241C9AC; Fri, 2 Dec 2011 15:48:33 +0100 Date: Fri, 2 Dec 2011 15:48:33 +0100 From: acrux To: Anatolij Gustschin Subject: Re: sam460ex, sm501 incorrect device id with kernel >=linux-2.6.39 Message-Id: <20111202154833.72c75615.acrux_it@libero.it> In-Reply-To: <20111128212224.2bd66125@wker> References: <20111127173748.9f235741.acrux_it@libero.it> <20111128205655.fc4d3249.acrux_it@libero.it> <20111128212224.2bd66125@wker> Organization: CRUX PPC GNU/Linux project - http/cruxppc.org/ X-Mailer: Sylpheed 3.1.2 (GTK+ 2.24.8; powerpc-unknown-linux-gnu) Mime-Version: 1.0 Cc: linuxppc-dev@lists.ozlabs.org X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org On Mon, 28 Nov 2011 21:22:24 +0100 Anatolij Gustschin wrote: > On Mon, 28 Nov 2011 20:56:55 +0100 > acrux wrote: > ... > > it seems to be an endianess issue but i didn't find when it was > > introduced. Really strange this kind of issue was never noticed > > bumping from 2.6.38.x to 2.6.39.x . > > Look at commit bf5f0019046d596d613caf74722ba4994e153899 > (video, sm501: add I/O functions for use on powerpc). > This is the issue, I think. Especially changes in > include/linux/sm501.h by this commit. Since CONFIG_PPC32 is defined > for canyonlands, ioread32be() is used to access the registers at PCI > space which is wrong. The patch was tested on tqm5200 with sm501 > connected on localbus, so using ioread32be() worked there. Your sm502 > is on PCI bus I suppose. This issue needs to be fixed. > well, the commit suggested is this one: http://git.kernel.org/?p=linux/kernel/git/next/linux-next.git;a=commitdiff;h=bf5f0019046d596d613caf74722ba4994e153899 This little hack fix my problem: but instead, why am I obliged to read it as little endian to have the correct value? thanks for your help, --nico --- a/inlcude/linux/sm501.h 2011-12-02 01:11:04.000000000 +0100 +++ b/include/linux/sm501.h 2011-12-02 01:11:09.000000000 +0100 @@ -174,8 +174,8 @@ }; #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)