Subject: Re: sam460ex, sm501 incorrect device id with kernel >=linux-2.6.39

From: Anatolij Gustschin <[email-masked]>
Date: Fri, 2 Dec 2011 16:35:18 +0100

Hi,

On Fri, 2 Dec 2011 15:48:33 +0100
acrux <[email-masked]> wrote:
...
> 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? 

The SM502 registers are in little endian format, you access them
over PCI interface, that is the reason. The commit introduced
a regression, I'll try to fix it this weekend. IIRC, there is
a flag to switch to big-endian register format in SM502, but
I'm not sure if it will also affect frame buffer data format.

Anatolij