* sam460ex, sm501 incorrect device id with kernel >=linux-2.6.39
@ 2011-11-27 16:37 acrux
2011-11-28 12:12 ` Josh Boyer
0 siblings, 1 reply; 7+ messages in thread
From: acrux @ 2011-11-27 16:37 UTC (permalink / raw)
To: linuxppc-dev
Acube Sam460ex has SM502 as onboard video.
I got this with any kernel newer than 2.6.38.x thus the framebuffer is lost too:
root@sam4x0:~# diff dmesg-2.6.38.8 dmesg-2.6.39.4
1,2c1,3
< Using PowerPC 44x Platform machine description
< Linux version 2.6.38.8-Sam460ex (root@sam4x0) (gcc version 4.5.3 (CRUX PPC) ) #1 Fri Nov 11 22:07:53 CET 2011
---
> Using Canyonlands machine description
> Initializing cgroup subsys cpu
> Linux version 2.6.39.4-Sam460ex (root@sam4x0) (gcc version 4.5.3 (CRUX PPC) ) #1 Fri Nov 11 19:06:02 CET 2011
17c18
[cut]
161,179c165,167
< sm501 0001:00:06.0: SM501 At f5480000: Version 050100c0, 64 Mb, IRQ 19
< sm501 0001:00:06.0: setting M1XCLK to 144000000
< sm501 0001:00:06.0: setting MCLK to 72000000
< sm501-usb[0] [mem 0xd84040000-0xd8405ffff]
< sm501-usb[1] [mem 0xd83fc0000-0xd83ffffff]
< sm501-usb[2] [irq 19]
< serial8250.10: ttyS2 at MMIO 0xd84030000 (irq = 19) is a ST16654
< serial8250.10: ttyS3 at MMIO 0xd84030020 (irq = 19) is a ST16654
< sm501-fb[0] [mem 0xd84080000-0xd8408ffff]
< sm501-fb[1] [mem 0xd84100000-0xd8414ffff]
< sm501-fb[2] [mem 0xd80000000-0xd83fbffff]
< sm501-fb[3] [irq 19]
< sm501-fb sm501-fb.80: fb sm501fb-crt disabled at start
< Console: switching to colour frame buffer device 100x37
< sm501-fb sm501-fb.80: fb0: sm501fb-crt frame buffer
< sm501-fb sm501-fb.80: fb sm501fb-panel enabled at start
< sm501-fb sm501-fb.80: fb1: sm501fb-panel frame buffer
< of:sata-dwc 4bffd1000.sata: id 0, controller version 1.82
< of:sata-dwc 4bffd1000.sata: DMA initialized
---
> sm501 0001:00:06.0: incorrect device id c0000105
> sata-dwc 4bffd1000.sata: id 0, controller version 1.82
> sata-dwc 4bffd1000.sata: DMA initialized
181,182c169
< ata1: SATA max UDMA/133 irq 31
< Fixed MDIO Bus: probed
---
> ata1: SATA max UDMA/133 irq 34
[...]
btw, i remember that i also receive a kernel panic if MTD support is enabled with any kernel newer than 2.6.36.x
regards,
--nico
--
acrux <acrux_it@libero.it>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: sam460ex, sm501 incorrect device id with kernel >=linux-2.6.39
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
0 siblings, 1 reply; 7+ messages in thread
From: Josh Boyer @ 2011-11-28 12:12 UTC (permalink / raw)
To: acrux; +Cc: linuxppc-dev
On Sun, Nov 27, 2011 at 11:37 AM, acrux <acrux_it@libero.it> wrote:
>
> Acube Sam460ex has SM502 as onboard video.
> I got this with any kernel newer than 2.6.38.x thus the framebuffer is lost too:
>
> root@sam4x0:~# diff dmesg-2.6.38.8 dmesg-2.6.39.4
> 1,2c1,3
> < Using PowerPC 44x Platform machine description
> < Linux version 2.6.38.8-Sam460ex (root@sam4x0) (gcc version 4.5.3 (CRUX PPC) ) #1 Fri Nov 11 22:07:53 CET 2011
> ---
>> Using Canyonlands machine description
>> Initializing cgroup subsys cpu
You seem to have switched from using the generic PowerPC 44x platform,
to using a Canyonlands kernel and/or DTB. Not sure why that is, but
it's probably not helping your issues at all.
>> Linux version 2.6.39.4-Sam460ex (root@sam4x0) (gcc version 4.5.3 (CRUX PPC) ) #1 Fri Nov 11 19:06:02 CET 2011
> 17c18
> [cut]
> 161,179c165,167
> < sm501 0001:00:06.0: SM501 At f5480000: Version 050100c0, 64 Mb, IRQ 19
> ---
>> sm501 0001:00:06.0: incorrect device id c0000105
Something is reading the device ID in the wrong endian (and probably
everything else).
josh
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: sam460ex, sm501 incorrect device id with kernel >=linux-2.6.39
2011-11-28 12:12 ` Josh Boyer
@ 2011-11-28 19:56 ` acrux
2011-11-28 20:22 ` Anatolij Gustschin
0 siblings, 1 reply; 7+ messages in thread
From: acrux @ 2011-11-28 19:56 UTC (permalink / raw)
To: Josh Boyer; +Cc: linuxppc-dev
On Mon, 28 Nov 2011 07:12:38 -0500
Josh Boyer <jwboyer@gmail.com> wrote:
> On Sun, Nov 27, 2011 at 11:37 AM, acrux <acrux_it@libero.it> wrote:
> >
> > Acube Sam460ex has SM502 as onboard video.
> > I got this with any kernel newer than 2.6.38.x thus the framebuffer
> > is lost too:
> >
> > root@sam4x0:~# diff dmesg-2.6.38.8 dmesg-2.6.39.4
> > 1,2c1,3
> > < Using PowerPC 44x Platform machine description
> > < Linux version 2.6.38.8-Sam460ex (root@sam4x0) (gcc version 4.5.3
> > (CRUX PPC) ) #1 Fri Nov 11 22:07:53 CET 2011
> > ---
> >> Using Canyonlands machine description
> >> Initializing cgroup subsys cpu
>
> You seem to have switched from using the generic PowerPC 44x platform,
> to using a Canyonlands kernel and/or DTB. Not sure why that is, but
> it's probably not helping your issues at all.
>
i think it was only a cosmetic change as it was always used
Canyonlands platform and his own proper dtb.
> >> Linux version 2.6.39.4-Sam460ex (root@sam4x0) (gcc version 4.5.3
> >> (CRUX PPC) ) #1 Fri Nov 11 19:06:02 CET 2011
> > 17c18
> > [cut]
> > 161,179c165,167
> > < sm501 0001:00:06.0: SM501 At f5480000: Version 050100c0, 64 Mb,
> > IRQ 19
>
> > ---
> >> sm501 0001:00:06.0: incorrect device id c0000105
>
> Something is reading the device ID in the wrong endian (and probably
> everything else).
>
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 .
--nico
--
GNU/Linux on Power Architecture
CRUX PPC - http://cruxppc.org/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: sam460ex, sm501 incorrect device id with kernel >=linux-2.6.39
2011-11-28 19:56 ` acrux
@ 2011-11-28 20:22 ` Anatolij Gustschin
2011-12-02 14:48 ` acrux
0 siblings, 1 reply; 7+ messages in thread
From: Anatolij Gustschin @ 2011-11-28 20:22 UTC (permalink / raw)
To: acrux; +Cc: linuxppc-dev
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.
HTH,
Anatolij
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: sam460ex, sm501 incorrect device id with kernel >=linux-2.6.39
2011-11-28 20:22 ` Anatolij Gustschin
@ 2011-12-02 14:48 ` acrux
2011-12-02 15:35 ` Anatolij Gustschin
0 siblings, 1 reply; 7+ messages in thread
From: acrux @ 2011-12-02 14:48 UTC (permalink / raw)
To: Anatolij Gustschin; +Cc: linuxppc-dev
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/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: sam460ex, sm501 incorrect device id with kernel >=linux-2.6.39
2011-12-02 14:48 ` acrux
@ 2011-12-02 15:35 ` Anatolij Gustschin
0 siblings, 0 replies; 7+ messages in thread
From: Anatolij Gustschin @ 2011-12-02 15:35 UTC (permalink / raw)
To: acrux; +Cc: linuxppc-dev
Hi,
On Fri, 2 Dec 2011 15:48:33 +0100
acrux <acrux_it@libero.it> 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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: sam460ex, sm501 incorrect device id with kernel >=linux-2.6.39
@ 2011-11-29 1:00 acrux_it
0 siblings, 0 replies; 7+ messages in thread
From: acrux_it @ 2011-11-29 1:00 UTC (permalink / raw)
To: agust; +Cc: linuxppc-dev
>Da: agust@denx.de
>Data: 28/11/2011 21.22
>A: "acrux"<acrux_it@libero.it>
>Cc: "Josh Boyer"<jwboyer@gmail.com>, <linuxppc-dev@lists.ozlabs.org>
>Ogg: Re: sam460ex, sm501 incorrect device id with kernel >=linux-2.6.39
>
>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.
>
>HTH,
>Anatolij
>
hallo Anatolij,
you are absolutely right altought i don't have a skill to fix it.
Indeed, this SM502 is located on PCI bus. Here a schema:
http://oi39.tinypic.com/34r9mw2.jpg
cheers,
--nico
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2011-12-02 15:35 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2011-12-02 15:35 ` Anatolij Gustschin
-- strict thread matches above, loose matches on Subject: below --
2011-11-29 1:00 acrux_it
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).