Subject: Re: Console drivers
To: Michael Lorenz <macallan@netbsd.org>
From: Marco Trillo <marcotrillo@gmail.com>
List: port-macppc
Date: 11/10/2006 22:41:00
Hi!

On 11/8/06, Michael Lorenz <macallan@netbsd.org> wrote:
> so, finally the missing pieces to allow using accelerated display
> drivers as console on macppc are in place. Please try them and report
> success or failure.
> [...]
> - - radeonfb. Should support most Radeons, has trouble with R3xx chips
> which I can't fix for lack of hardware and documentation. Works fine on
> my iBook G4. Someone with access to ATI documentation should take care
> of this one.

I managed to build -current so I burned a CD and booted it on a eMac
1.25 / ATI Radeon 9200 (PowerMac6,4).

The first time I booted the GENERIC_MD kernel (netbsd.macppc) the
framebuffer started fine with some light-green letters on white
background.
But radeonfb0 started to print out some debug and error messages and
then the screen went black and the eMac froze  (I suppose, since the
keyboard and mouse were disconnected).

Then I attempted a second time boot, but this time when booted the
kernel, no framebuffer was started: the screen went immediately blank
after the boot command (in case it has any relation with this, this
time the boot  command was not the first command entered on the OF
prompt).

But this time it did not hang and continued the boot process (I
noticed the keyboard lights being activated).
So I blindly typed "S" to get shell and managed to configure the gem0
network, ftp to my other Mac and upload a copy of dmesg:

Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
    The NetBSD Foundation, Inc.  All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
    The Regents of the University of California.  All rights reserved.

NetBSD 4.99.3 (GENERIC_MD) #0: Fri Nov 10 20:09:36 CET 2006
	mtrillo@ununquadium.local:/Volumes/data/netbsd/current/macppc/obj/sys/arch/macppc/compile/GENERIC_MD
total memory = 768 MB
avail memory = 732 MB
timecounter: Timecounters tick every 10.000 msec
init_interrupt: found OpenPIC @ pa 0x80040000, 0x80040000
mainbus0 (root)
cpu0 at mainbus0: 7447A (Revision 1.1), ID 0 (primary)
cpu0: HID0 8450c0bc<EMCP,EICE,NAP,DPM,ICE,DCE,SGE,BTIC,FBIOB,ABE,BHT>,
powersave: 1
cpu0: 1250.00 MHz, 512KB L2 cache
uni_n0 at mainbus0 address 0xf8000000
hw-clock at uni_n0 not configured
ki2c0 at uni_n0 address 0xf8001000
iic0 at ki2c0: I2C bus
cereal at ki2c0 address 0x1c0 not configured
uninorth0 at mainbus0
pci0 at uninorth0 bus 0
pci0: i/o space, memory space enabled
pchb0 at pci0 dev 11 function 0
pchb0: Apple Computer UniNorth AGP Bridge (rev. 0x00)
radeonfb0 at pci0 dev 16 function 0: ATI Technologies Radeon 9200 5962
radeonfb0: unable to map IO registers!
RADEON_BIOS_4_SCRATCH = 00000000
RADEON_FP_GEN_CNTL = 00030148
RADEON_FP2_GEN_CNTL = 00000008
RADEON_TMDS_CNTL = 01000000
RADEON_TMDS_TRANSMITTER_CNTL = 10000082
RADEON_TMDS_PLL_CNTL = 004bffdd
RADEON_LVDS_GEN_CNTL = 00008020
RADEON_FP_HORZ_STRETCH = 00000000
RADEON_FP_VERT_STRETCH = 00000000
radeonfb0: Video BIOS not present
radeonfb0: No video BIOS, using default clocks
no suitable DFP table present
TMDS_PLL dot clock 13000 pll 400f4
TMDS_PLL dot clock 15000 pll 400f7
TMDS_PLL dot clock 0 pll 0
TMDS_PLL dot clock 0 pll 0
radeonfb0: refclk = 27.000 MHz, refdiv = 12 minpll = 125000, maxpll = 350000
No connector info in BIOS!
Port #0:
    conn = 4
    ddc = 2
    dac = 1
    tmds = 0
Port #1:
    conn = 2
    ddc = 3
    dac = 0
    tmds = 1
aperbase = 2550136832
RADEON_MC_FB_LOCATION = 9bff9800
RADEON_MC_AGP_LOCATION = 9bff9c00
RADEON_DAC_CNTL2 = 00000002
RADEON_DAC_CNTL2 = 00000002
RADEON_DAC_CNTL2 = 00000003
RADEON_DISP_HW_DEBUG = 00020020
RADEON_DAC_CNTL = ff000102
RADEON_TV_DAC_CNTL = 00280203
radeonfb0: 64 MB aperture at 0x98000000, 64 KB registers at 0x90000000
dual crtcs!
radeonfb0: display 0: virtual resolution 640x480 at 32 bpp
radeonfb0: port 0: physical 1024x768 60Hz
radeonfb0: port 1: physical 1024x768 60Hz
fpbtr = 0xd4bc0000
init engine
init screen called, existing 1
CRTC_GEN_CNTL = 03000600
RADEON_CRTC_EXT_CNTL = 00008048
CRTC_H_TOTAL_DISP = 007f00a7
FP_H_TOTAL_DISP = 007f00a7
CRTC_H_SYNC_STRT_WID = 00910418
FP_H_SYNC_STRT_WID = 00910418
CRTC_V_TOTAL_DISP = 02ff0325
FP_V_TOTAL_DISP = 02ff0325
CRTC_V_SYNC_STRT_WID = 00860302
FP_V_SYNC_STRT_WID = 00860302
dot clock: 65000
outfreq: 130000
post divider: 2 (mask 10000)
feedback divider: 58
RADEON_PPLL_REF_DIV = 0000000c
RADEON_PPLL_CNTL = 0000bf30
RADEON_CRTC_MORE_CNTL = 00000000
RADEON_CRTC_EXT_CNTL = 00008048
RADEON_CRTC_GEN_CNTL = 03000600
RADEON_CLOCK_CNTL_INDEX = 00000000
CRTC2_GEN_CNTL = 02000680
RADEON_CRTC_EXT_CNTL = 00008048
CRTC2_H_TOTAL_DISP = 007f00a7
FP_H2_TOTAL_DISP = 007f00a7
CRTC2_H_SYNC_STRT_WID = 00910418
FP_H2_SYNC_STRT_WID = 00910418
CRTC2_V_TOTAL_DISP = 02ff0325
FP_V2_TOTAL_DISP = 02ff0325
CRTC2_V_SYNC_STRT_WID = 00860302
FP_V2_SYNC_STRT_WID = 00860302
dot clock: 65000
outfreq: 130000
post divider: 2 (mask 10000)
feedback divider: 58
RADEON_CRTC_MORE_CNTL = 00000000
RADEON_CRTC2_GEN_CNTL = 02000680
wsdisplay0 at radeonfb0 kbdmux 1: console (fb, vt100 emulation)
wsmux1: connecting to wsdisplay0
RADEON_FP_GEN_CNTL = 000301cd
RADEON_FP2_GEN_CNTL = 0000200c
uninorth1 at mainbus0
pci1 at uninorth1 bus 0
pci1: i/o space, memory space enabled
pchb1 at pci1 dev 11 function 0
pchb1: Apple Computer UniNorth Host-PCI Bridge (rev. 0x00)
obio0 at pci1 dev 23 function 0: addr 0x80000000
zsc0 at obio0: irq 22,23
zstty0 at zsc0 channel 0
zstty1 at zsc0 channel 1
snapper0 at obio0 offset 0x10000: irq 30,1,2
adb0 at obio0 offset 0x16000 irq 47: pm_adb_op: timeout. command = 0x0
0 targets
aed0 at adb0 addr 0: ADB Event device
apm0 at adb0: battery flags 0x9, 0% charged
ki2c1 at obio0
iic1 at ki2c1: I2C bus
cereal at ki2c1 address 0x1c0 not configured
deq0 at ki2c1 Apple Digital Equalizer, addr 6a
wdc0 at obio0 offset 0x20000 irq 24: DMA transfer
atabus0 at wdc0 channel 0
ohci0 at pci1 dev 24 function 0: Apple Computer Intrepid USB
Controller (rev. 0x00)
ohci0: can't map mem space
ohci1 at pci1 dev 25 function 0: Apple Computer Intrepid USB
Controller (rev. 0x00)
ohci1: can't map mem space
ohci2 at pci1 dev 26 function 0: Apple Computer Intrepid USB
Controller (rev. 0x00)
ohci2: interrupting at irq 29
ohci2: OHCI version 1.0, legacy support
usb0 at ohci2: USB revision 1.0
uhub0 at usb0
uhub0: Apple Computer OHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
ohci3 at pci1 dev 27 function 0: NEC USB Host Controller (rev. 0x43)
ohci3: interrupting at irq 63
ohci3: OHCI version 1.0
usb1 at ohci3: USB revision 1.0
uhub1 at usb1
uhub1: NEC OHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub1: 3 ports with 3 removable, self powered
ohci4 at pci1 dev 27 function 1: NEC USB Host Controller (rev. 0x43)
ohci4: interrupting at irq 63
ohci4: OHCI version 1.0
usb2 at ohci4: USB revision 1.0
uhub2 at usb2
uhub2: NEC OHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub2: 2 ports with 2 removable, self powered
ehci0 at pci1 dev 27 function 2: NEC USB Host Controller (rev. 0x04)
ehci0: interrupting at irq 63
ehci0: BIOS has given up ownership
ehci0: EHCI version 1.0
ehci0: companion controllers, 3 ports each: ohci3 ohci4
usb3 at ehci0: USB revision 2.0
uhub3 at usb3
uhub3: NEC EHCI root hub, class 9/0, rev 2.00/1.00, addr 1
uhub3: 5 ports with 5 removable, self powered
uninorth2 at mainbus0
pci2 at uninorth2 bus 0
pci2: i/o space, memory space enabled
pchb2 at pci2 dev 11 function 0
pchb2: Apple Computer UniNorth Host-PCI Bridge (rev. 0x00)
wdc1 at pci2 dev 13 function 0: interrupting at irq 39
atabus1 at wdc1 channel 0
fwohci0 at pci2 dev 14 function 0: Apple Computer UniNorth Firewire (rev. 0x81)
fwohci0: interrupting at irq 40
fwohci0: OHCI version 1.10 (ROM=0)
fwohci0: No. of Isochronous channels is 8.
fwohci0: EUI64 00:0d:93:ff:fe:57:39:60
fwohci0: Phy 1394a available S400, 2 ports.
fwohci0: Link S400, max_rec 2048 bytes.
ieee1394if0 at fwohci0: IEEE1394 bus
fwip0 at ieee1394if0: IP over IEEE1394
fwohci0: Initiate bus reset
gem0 at pci2 dev 15 function 0: Apple Computer GMAC Ethernet (rev. 0x80)
gem0: interrupting at irq 41
gem0: Ethernet address 00:0d:93:57:39:60, 10KB RX fifo, 4KB TX fifo
bmtphy0 at gem0 phy 0: BCM5221 10/100 media interface, rev. 4
bmtphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
timecounter: Timecounter "clockinterrupt" frequency 100 Hz quality 0
timecounter: Timecounter "mftb" frequency 41620997 Hz quality 100
fwohci0: node_id=0xc800ffc0, gen=2, CYCLEMASTER mode
ieee1394if0: 1 nodes, maxhop <= 0, cable IRM = 0 (me)
ieee1394if0: bus manager 0 (me)
audio0 at snapper0: full duplex
Kernelized RAIDframe activated
md0: internal 2048 KB image area
atapibus0 at atabus0: 2 targets
cd0 at atapibus0 drive 0: <HL-DT-ST RW/DVD GCC-4481B, , 2.05> cdrom removable
cd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 2 (Ultra/33)
cd0(wdc0:0:0): using PIO mode 4, DMA mode 2 (using DMA)
uhub4 at uhub1 port 1
uhub4: Mitsumi Electric Hub in Apple Extended USB Keyboard, class 9/0,
rev 1.10/4.10, addr 2
uhub4: 3 ports with 2 removable, bus powered
wd0 at atabus1 drive 0: <ST340015A>
wd0: drive supports 16-sector PIO transfers, LBA addressing
wd0: 38166 MB, 77545 cyl, 16 head, 63 sec, 512 bytes/sect x 78165360 sectors
wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 5 (Ultra/100)
wd0(wdc1:0:0): using PIO mode 4, DMA mode 2, Ultra-DMA mode 5
(Ultra/100) (using DMA)
boot device: <unknown>
root on md0a dumps on md0b
root file system type: ffs
uhidev0 at uhub4 port 1 configuration 1 interface 0
uhidev0: Logitech Apple Optical USB Mouse, rev 2.00/3.40, addr 3, iclass 3/1
ums0 at uhidev0: 1 button
wsmouse0 at ums0 mux 0
uhidev1 at uhub4 port 3 configuration 1 interface 0
uhidev1: Mitsumi Electric Apple Extended USB Keyboard, rev 1.10/4.10,
addr 4, iclass 3/1
ukbd0 at uhidev1
wskbd1 at ukbd0 mux 1
wskbd1: connecting to wsdisplay0
uhidev2 at uhub4 port 3 configuration 1 interface 1
uhidev2: Mitsumi Electric Apple Extended USB Keyboard, rev 1.10/4.10,
addr 4, iclass 3/0
uhidev2: 3 report ids
uhid0 at uhidev2 reportid 2: input=1, output=0, feature=0
uhid1 at uhidev2 reportid 3: input=3, output=0, feature=0

Any ideas?
  Thanks!,
  Marco