2003-09-13 12:44:11

by Eyal Lebedinsky

[permalink] [raw]
Subject: Re: Linux 2.4.23-pre4: failed at atyfb_base.c

Marcelo Tosatti wrote:
>
> Hello,
>
> Here goes -pre4, which contains networking update, IA64 update, PPC
> update, USB update, bunch of knfsd fixes, amongst others.
gcc -D__KERNEL__ -I/data2/usr/local/src/linux-2.4-pre/include -Wall
-Wstrict-pro
totypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common
-fomit-frame-pointer
-pipe -mpreferred-stack-boundary=2 -march=i686 -malign-functions=4
-DMODULE -DM
ODVERSIONS -include
/data2/usr/local/src/linux-2.4-pre/include/linux/modversions
.h -nostdinc -iwithprefix include -DKBUILD_BASENAME=atyfb_base
-DEXPORT_SYMTAB
-c atyfb_base.c
atyfb_base.c: In function `aty_set_crtc':
atyfb_base.c:501: warning: passing arg 2 of `aty_st_lcd' makes integer
from pointer without a cast
atyfb_base.c:501: too few arguments to function `aty_st_lcd'
atyfb_base.c:504: warning: passing arg 2 of `aty_st_lcd' makes integer
from pointer without a cast
atyfb_base.c:504: too few arguments to function `aty_st_lcd'
make[3]: *** [atyfb_base.o] Error 1
make[3]: Leaving directory
`/data2/usr/local/src/linux-2.4-pre/drivers/video/aty'

I now disabled CONFIG_FB_ATY_GENERIC_LCD and it builds.

--
Eyal Lebedinsky ([email protected]) <http://samba.org/eyal/>


2003-09-13 14:40:19

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: Linux 2.4.23-pre4: failed at atyfb_base.c

On Sat, 13 Sep 2003, Eyal Lebedinsky wrote:
> Marcelo Tosatti wrote:
> > Here goes -pre4, which contains networking update, IA64 update, PPC
> > update, USB update, bunch of knfsd fixes, amongst others.
> gcc -D__KERNEL__ -I/data2/usr/local/src/linux-2.4-pre/include -Wall
> -Wstrict-pro
> totypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common
> -fomit-frame-pointer
> -pipe -mpreferred-stack-boundary=2 -march=i686 -malign-functions=4
> -DMODULE -DM
> ODVERSIONS -include
> /data2/usr/local/src/linux-2.4-pre/include/linux/modversions
> .h -nostdinc -iwithprefix include -DKBUILD_BASENAME=atyfb_base
> -DEXPORT_SYMTAB
> -c atyfb_base.c
> atyfb_base.c: In function `aty_set_crtc':
> atyfb_base.c:501: warning: passing arg 2 of `aty_st_lcd' makes integer
> from pointer without a cast
> atyfb_base.c:501: too few arguments to function `aty_st_lcd'
> atyfb_base.c:504: warning: passing arg 2 of `aty_st_lcd' makes integer
> from pointer without a cast
> atyfb_base.c:504: too few arguments to function `aty_st_lcd'
> make[3]: *** [atyfb_base.o] Error 1
> make[3]: Leaving directory
> `/data2/usr/local/src/linux-2.4-pre/drivers/video/aty'
>
> I now disabled CONFIG_FB_ATY_GENERIC_LCD and it builds.

Apparently Dani?l didn't sent the latest version to Marcelo?

Here are some fixes:

--- linux-2.4.23-pre4/drivers/video/aty/atyfb_base.c.orig Sat Sep 13 16:29:48 2003
+++ linux-2.4.23-pre4/drivers/video/aty/atyfb_base.c Fri Sep 12 12:50:36 2003
@@ -313,7 +313,7 @@
int pll, mclk, xclk;
u32 features;
} aty_chips[] __initdata = {
- /* Note to kernel maintainers: Please resfuse any patch to change a clock rate,
+ /* Note to kernel maintainers: Please REFUSE any patch to change a clock rate,
unless someone proves that a value is incorrect for him with a dump of
the driver information table in the BIOS. Patches accepted in the past have
caused chips to be overclocked by as much as 50%!
@@ -498,10 +498,12 @@
* off. It is a Rage Mobility M1, but doesn't happen on these chips
* in general. (Daniel Mantione, 26 june 2003)
*/
- aty_st_lcd(aty_ld_lcd(LCD_GEN_CTRL, info) | SHADOW_RW_EN, info);
+ aty_st_lcd(LCD_GEN_CTRL, aty_ld_lcd(LCD_GEN_CTRL, info) | SHADOW_RW_EN,
+ info);
aty_st_le32(CRTC_H_TOTAL_DISP, crtc->h_tot_disp, info);
aty_st_le32(CRTC_H_SYNC_STRT_WID, crtc->h_sync_strt_wid, info);
- aty_st_lcd(aty_ld_lcd(LCD_GEN_CTRL, info) & ~SHADOW_RW_EN, info);
+ aty_st_lcd(LCD_GEN_CTRL, aty_ld_lcd(LCD_GEN_CTRL, info) & ~SHADOW_RW_EN,
+ info);
/* End hack */
#endif


Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

2003-09-13 17:54:04

by Daniël Mantione

[permalink] [raw]
Subject: Re: Linux 2.4.23-pre4: failed at atyfb_base.c



On Sat, 13 Sep 2003, Geert Uytterhoeven wrote:

> > I now disabled CONFIG_FB_ATY_GENERIC_LCD and it builds.
>
> Apparently Dani?l didn't sent the latest version to Marcelo?

Yes, it was my latest version, but the code was still commented out. I
was in believe that I had corrected it, and simply commented out the hack
before sending it to Marcelo (which was stupid of course). I already sent a
fix to him but Marcelo hasn't applied it yet.

> Here are some fixes:
>
> --- linux-2.4.23-pre4/drivers/video/aty/atyfb_base.c.orig Sat Sep 13 16:29:48 2003
> +++ linux-2.4.23-pre4/drivers/video/aty/atyfb_base.c Fri Sep 12 12:50:36 2003
> @@ -313,7 +313,7 @@
> int pll, mclk, xclk;
> u32 features;
> } aty_chips[] __initdata = {

> - /* Note to kernel maintainers: Please resfuse any patch to change a clock rate,
> + /* Note to kernel maintainers: Please REFUSE any patch to change a clock rate,

Haha! Was it the spelling error or was the message not strong enough? ;-)

Greetings,

Dani?l


2003-09-13 19:16:03

by Marcelo Tosatti

[permalink] [raw]
Subject: Re: Linux 2.4.23-pre4: failed at atyfb_base.c



On Sat, 13 Sep 2003, Geert Uytterhoeven wrote:

> On Sat, 13 Sep 2003, Eyal Lebedinsky wrote:
> > Marcelo Tosatti wrote:
> > > Here goes -pre4, which contains networking update, IA64 update, PPC
> > > update, USB update, bunch of knfsd fixes, amongst others.
> > gcc -D__KERNEL__ -I/data2/usr/local/src/linux-2.4-pre/include -Wall
> > -Wstrict-pro
> > totypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common
> > -fomit-frame-pointer
> > -pipe -mpreferred-stack-boundary=2 -march=i686 -malign-functions=4
> > -DMODULE -DM
> > ODVERSIONS -include
> > /data2/usr/local/src/linux-2.4-pre/include/linux/modversions
> > .h -nostdinc -iwithprefix include -DKBUILD_BASENAME=atyfb_base
> > -DEXPORT_SYMTAB
> > -c atyfb_base.c
> > atyfb_base.c: In function `aty_set_crtc':
> > atyfb_base.c:501: warning: passing arg 2 of `aty_st_lcd' makes integer
> > from pointer without a cast
> > atyfb_base.c:501: too few arguments to function `aty_st_lcd'
> > atyfb_base.c:504: warning: passing arg 2 of `aty_st_lcd' makes integer
> > from pointer without a cast
> > atyfb_base.c:504: too few arguments to function `aty_st_lcd'
> > make[3]: *** [atyfb_base.o] Error 1
> > make[3]: Leaving directory
> > `/data2/usr/local/src/linux-2.4-pre/drivers/video/aty'
> >
> > I now disabled CONFIG_FB_ATY_GENERIC_LCD and it builds.
>
> Apparently Dani?l didn't sent the latest version to Marcelo?
>
> Here are some fixes:

Applied,

Thanks.

2003-09-14 08:46:34

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: Linux 2.4.23-pre4: failed at atyfb_base.c

On Sat, 13 Sep 2003, [ISO-8859-1] Dani?l Mantione wrote:
> On Sat, 13 Sep 2003, Geert Uytterhoeven wrote:
> > --- linux-2.4.23-pre4/drivers/video/aty/atyfb_base.c.orig Sat Sep 13 16:29:48 2003
> > +++ linux-2.4.23-pre4/drivers/video/aty/atyfb_base.c Fri Sep 12 12:50:36 2003
> > @@ -313,7 +313,7 @@
> > int pll, mclk, xclk;
> > u32 features;
> > } aty_chips[] __initdata = {
>
> > - /* Note to kernel maintainers: Please resfuse any patch to change a clock rate,
> > + /* Note to kernel maintainers: Please REFUSE any patch to change a clock rate,
>
> Haha! Was it the spelling error or was the message not strong enough? ;-)

I didn't do that. The capitals were in the latest version you sent me...

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

2003-09-15 21:04:27

by Olaf Hering

[permalink] [raw]
Subject: Re: Linux 2.4.23-pre4: failed at atyfb_base.c


pre4 doesnt work on my ibook1, the xclk value is 125, but should be 50.


Linux version 2.4.20 ([email protected]) (gcc version 3.2.2 20030314 (prerelease) (SuSE Linux)) #2 Tue Mar 18 17:19:27 UTC 2003

atyfb: using auxiliary register aperture
atyfb: 3D RAGE Mobility (AGP) [0x4c4e rev 0x64] 4M WRAM, 14.31818 MHz XTAL, 230 MHz PLL, 50 Mhz MCLK
Registered "ati" backlight controller, level: 15/15
atyfb: monitor sense=0, mode 20
Console: switching to colour frame buffer device 100x37
fb0: ATY Mach64 frame buffer device on PCI

Linux version 2.4.23-pre4-ibook1 (builds@ibook) (gcc version 3.2.3 (SuSE Linux)) #6 Mon Sep 15 21:54:16 CEST 2003

atyfb: using auxiliary register aperture
atyfb: 3D RAGE Mobility (AGP) [0x4c4e rev 0x64] 4M WRAM, 14.31818 MHz XTAL, 230 MHz PLL, 83 Mhz MCLK, 125 Mhz XCLK
atyfb: monitor sense=0, mode 20
Console: switching to colour frame buffer device 100x37
fb0: ATY Mach64 frame buffer device on PCI

mango:~ # lspci
00:0b.0 Host bridge: Apple Computer Inc. UniNorth AGP
00:10.0 VGA compatible controller: ATI Technologies Inc Rage Mobility L AGP 2x (rev 64)
10:0b.0 Host bridge: Apple Computer Inc. UniNorth PCI
10:17.0 Class ff00: Apple Computer Inc. KeyLargo Mac I/O (rev 02)
10:18.0 USB Controller: Apple Computer Inc. KeyLargo USB
10:19.0 USB Controller: Apple Computer Inc. KeyLargo USB
20:0b.0 Host bridge: Apple Computer Inc. UniNorth Internal PCI
20:0f.0 Ethernet controller: Apple Computer Inc. UniNorth GMAC (Sun GEM)
mango:~ # lspci -n
00:0b.0 Class 0600: 106b:0020
00:10.0 Class 0300: 1002:4c4e (rev 64)
10:0b.0 Class 0600: 106b:001f
10:17.0 Class ff00: 106b:0022 (rev 02)
10:18.0 Class 0c03: 106b:0019
10:19.0 Class 0c03: 106b:0019
20:0b.0 Class 0600: 106b:001e
20:0f.0 Class 0200: 106b:0021

(==) ATI(0): Chipset: "ati".
(==) ATI(0): Depth 16, (==) framebuffer bpp 16
(II) ATI(0): BIOS Data: BIOSSize=0x0000, ROMTable=0x0000.
(II) ATI(0): BIOS Data: ClockTable=0x0000, FrequencyTable=0x0000.
(II) ATI(0): BIOS Data: LCDTable=0x0000, LCDPanelInfo=0x0000.
(II) ATI(0): BIOS Data: VideoTable=0x0000, HardwareTable=0x0000.
(II) ATI(0): BIOS Data: I2CType=0x00, Tuner=0x00, Decoder=0x00, Audio=0x0F.
(--) ATI(0): ATI 3D Rage Mobility graphics controller detected.
(--) ATI(0): Chip type 4C4E "LN", version 4, foundry TSMC, class 0, revision 0x01.
(--) ATI(0): AGP bus interface detected.
(--) ATI(0): ATI Mach64 adapter detected.
(!!) ATI(0): For information on using the multimedia capabilities
of this adapter, please see http://gatos.sf.net.
(--) ATI(0): Internal RAMDAC (subtype 1) detected.
(==) ATI(0): RGB weight 565
(==) ATI(0): Default visual is TrueColor
(==) ATI(0): Using gamma correction (1.0, 1.0, 1.0)
(II) ATI(0): Using Mach64 accelerator CRTC.
(--) ATI(0): 800x600 panel detected.
(--) ATI(0): Panel clock is 39.952 MHz.
(II) ATI(0): Using digital flat panel interface.
(II) ATI(0): Storing hardware cursor image at 0x913FFC00.
(II) ATI(0): Using 8 MB linear aperture at 0x91800000.
(!!) ATI(0): Virtual resolutions will be limited to 4095 kB
due to linear aperture size and/or placement of hardware cursor image area.
(II) ATI(0): Using Block 0 MMIO aperture at 0x90000400.
(II) ATI(0): Using Block 1 MMIO aperture at 0x90000000.
(II) ATI(0): MMIO write caching enabled.
(--) ATI(0): 4096 kB of SGRAM (2:1) 32-bit detected (using 4095 kB).
(WW) ATI(0): Cannot shadow an accelerated frame buffer.
(II) ATI(0): Engine XCLK 49.883 MHz; Refresh rate code 2.
(--) ATI(0): Internal programmable clock generator detected.
(--) ATI(0): Reference clock 157.5/11 (14.318) MHz.
(II) ATI(0): Maximum clock: 199.00 MHz


this patch fixes it:


--- ../../linux-2.4.23-pre4/drivers/video/aty/atyfb_base.c 2003-09-13 15:31:31.000000000 +0200
+++ ./drivers/video/aty/atyfb_base.c 2003-09-15 22:53:12.000000000 +0200
@@ -376,7 +376,7 @@ static struct {

/* 3D RAGE Mobility */
{ 0x4c4d, 0x4c4d, 0x00, 0x00, m64n_mob_p, 230, 83, 125, M64F_GT | M64F_INTEGRATED | M64F_RESET_3D | M64F_GTB_DSP | M64F_MOBIL_BUS | M64F_EXTRA_BRIGHT},
- { 0x4c4e, 0x4c4e, 0x00, 0x00, m64n_mob_a, 230, 83, 125, M64F_GT | M64F_INTEGRATED | M64F_RESET_3D | M64F_GTB_DSP | M64F_MOBIL_BUS | M64F_EXTRA_BRIGHT},
+ { 0x4c4e, 0x4c4e, 0x00, 0x00, m64n_mob_a, 230, 83, 50, M64F_GT | M64F_INTEGRATED | M64F_RESET_3D | M64F_GTB_DSP | M64F_MOBIL_BUS | M64F_EXTRA_BRIGHT},
#endif /* CONFIG_FB_ATY_CT */
};



atyfb: using auxiliary register aperture
atyfb: 3D RAGE Mobility (AGP) [0x4c4e rev 0x64] 4M WRAM, 14.31818 MHz XTAL, 230 MHz PLL, 83 Mhz MCLK, 50 Mhz XCLK
atyfb: monitor sense=0, mode 20
Console: switching to colour frame buffer device 100x37
fb0: ATY Mach64 frame buffer device on PCI


why do you think 125 is correct for this card?

--
USB is for mice, FireWire is for men!

sUse lINUX ag, nÜRNBERG

2003-09-15 21:20:22

by Daniël Mantione

[permalink] [raw]
Subject: Re: Linux 2.4.23-pre4: failed at atyfb_base.c



On Mon, 15 Sep 2003, Olaf Hering wrote:

> pre4 doesnt work on my ibook1, the xclk value is 125, but should be 50.

That is not correct. The default xclk for the Rage Mobility M1 is
125 MHz and this is indeed the case, for example on Geert's VAIO.
See also the e-mail below from Vernon Chiang from ATi.

On x86, I usually ask a copy of the video driver to be able to check the
driver information table of that particular implementation. Do you have
something similair from the Open Firmware?

Greetings,

Dani?l Mantione


Date: Mon, 6 May 2002 14:51:47 -0400
From: ATI Developer Relations <[email protected]>
To: 'Dani?l Mantione' <[email protected]>
Subject: RE: Memory clock on Rage mobility
Parts/Attachments:
1 OK ~47 lines Text
2 Shown ~84 lines Text
----------------------------------------


Hi Daniel,

I've gotten confirmation that the Rage Mobility P/M engine/clock setting
should be
125MHz/83MHz.

The ltmodset program is correct.

Thanks.

Regards,

Vernon Chiang
ATI Developer Relations
[email protected]





2003-09-15 21:28:58

by Daniël Mantione

[permalink] [raw]
Subject: Re: Linux 2.4.23-pre4: failed at atyfb_base.c



On Mon, 15 Sep 2003, Dani?l Mantione wrote:

> On x86, I usually ask a copy of the video driver to be able to check the

Correction: on x86 I usually ask a copy of the video bios.

Dani?l

2003-09-15 21:34:36

by Olaf Hering

[permalink] [raw]
Subject: Re: Linux 2.4.23-pre4: failed at atyfb_base.c

On Mon, Sep 15, Daniël Mantione wrote:

>
>
> On Mon, 15 Sep 2003, Olaf Hering wrote:
>
> > pre4 doesnt work on my ibook1, the xclk value is 125, but should be 50.
>
> That is not correct. The default xclk for the Rage Mobility M1 is
> 125 MHz and this is indeed the case, for example on Geert's VAIO.
> See also the e-mail below from Vernon Chiang from ATi.
>
> On x86, I usually ask a copy of the video driver to be able to check the
> driver information table of that particular implementation. Do you have
> something similair from the Open Firmware?

This is in the device tree, not very helpful. I'm not sure where XFree86
gets the value 50. It seems to poke some regs here and there, havent
looked too closely.

olaf@mango:/proc/device-tree/pci@f0000000/ATY,RageM_Lp@10> /sbin/lsprop
vendor-id 00001002 (4098)
device-id 00004c4e (19534)
revision-id 00000064 (100)
class-code 00030000 (196608)
interrupts 00000001
min-grant 00000008
max-latency 00000000
devsel-speed 00000001
fast-back-to-back
ATY,Status 00000000
ATY,Flags 00000180 (384)
width 00000320 (800)
height 00000258 (600)
depth 00000008
linebytes 00000320 (800)
device_type "display"
character-set "ISO8859-1"
iso6429-1983-colors
reg 00008000 00000000 00000000 00000000 00000000
02008030 00000000 00000000 00000000 00020000
02008010 00000000 00000000 00000000 01000000
02008018 00000000 00000000 00000000 00001000
AGP_Address_Range 00000000 ffffffff
AGP_Address_Block 02000000 (33554432)
AGP_Alignment 02000000 (33554432)
AGP_AllowOverlap 00000001
name "ATY,RageM_Lp"
model "ATY,RageMobilityL"
ATY,Rom# "113-XXXXX-110"
backlight-control 00000001 00000000
ATY,Fcode "1.69"
assigned-addresses 82008010 00000000 91000000 00000000 01000000
82008030 00000000 90020000 00000000 00020000
82008018 00000000 90000000 00000000 00001000
AGP_Master
driverID "RageMobility_L 1.0b32"
address 91000000
AAPL,gray-page 00000000
linux,phandle ff93b3f8


All I see is that 50 works, 125 gives black/white stripes and a large
blinking cursor.

--
USB is for mice, FireWire is for men!

sUse lINUX ag, nÜRNBERG

2003-09-15 21:44:42

by Daniël Mantione

[permalink] [raw]
Subject: Re: Linux 2.4.23-pre4: failed at atyfb_base.c



On Mon, 15 Sep 2003, Olaf Hering wrote:

> This is in the device tree, not very helpful. I'm not sure where XFree86
> gets the value 50. It seems to poke some regs here and there, havent
> looked too closely.

XFree86 uses backcalculation. So if Atyfb programs the chip at 50 MHz,
XFree86 will read 50 MHz back. So, 50 MHz is not necessary the right
frequency for your chip.

> [open firmware data]

Hmmm. No clocks here at the first sight.

> All I see is that 50 works, 125 gives black/white stripes and a large
> blinking cursor.

Hmmm. Catch-22; Geert's VAIO malfunctions at 50 MHz :/

We can do two things:

- Check the PLL registers at startup and determine your frequency.
- Ask ATi again.

I propose to do both. Please enable the debug define in atyfb_base.c, so
it will print PLL registers.

I'm going to write an e-mail to ATi devrel now, I will cc to all except
linux-kernel.

Greetings,

Dani?l Mantione