linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: acrux <acrux_it@libero.it>
To: Anatolij Gustschin <agust@denx.de>
Cc: linuxppc-dev@lists.ozlabs.org
Subject: Re: sam460ex, sm501 incorrect device id with kernel >=linux-2.6.39
Date: Fri, 2 Dec 2011 15:48:33 +0100	[thread overview]
Message-ID: <20111202154833.72c75615.acrux_it@libero.it> (raw)
In-Reply-To: <20111128212224.2bd66125@wker>

On Mon, 28 Nov 2011 21:22:24 +0100
Anatolij Gustschin <agust@denx.de> wrote:

> On Mon, 28 Nov 2011 20:56:55 +0100
> acrux <acrux_it@libero.it> 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:
--- 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)


but instead, why am I obliged to read it as little endian to have the correct value? 

thanks for your help,
--nico
-- 
GNU/Linux on Power Architecture
CRUX PPC - http://cruxppc.org/

  reply	other threads:[~2011-12-02 14:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-27 16:37 sam460ex, sm501 incorrect device id with kernel >=linux-2.6.39 acrux
2011-11-28 12:12 ` Josh Boyer
2011-11-28 19:56   ` acrux
2011-11-28 20:22     ` Anatolij Gustschin
2011-12-02 14:48       ` acrux [this message]
2011-12-02 15:35         ` Anatolij Gustschin
  -- strict thread matches above, loose matches on Subject: below --
2011-11-29  1:00 acrux_it

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111202154833.72c75615.acrux_it@libero.it \
    --to=acrux_it@libero.it \
    --cc=agust@denx.de \
    --cc=linuxppc-dev@lists.ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).