Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 68970 - livecd freeze on a new Imac G5
Summary: livecd freeze on a new Imac G5
Status: VERIFIED FIXED
Alias: None
Product: Gentoo Release Media
Classification: Unclassified
Component: Everything (show other bugs)
Hardware: PPC64 Linux
: High blocker (vote)
Assignee: Gentoo LiveCD Package Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-10-26 05:56 UTC by Jocelyn Mayer
Modified: 2005-03-23 17:00 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
kernel patch to get firewire and ethernet recognized on Imac G5 (linux-2.6.8-gentoo.diff,2.10 KB, patch)
2004-11-05 04:02 UTC, Jocelyn Mayer
Details | Diff
Patch against 2.6.10-rc1 kernel to get Linux boot the Imac G5 (linux-2.6.10-rc1.diff,11.71 KB, patch)
2004-11-11 14:04 UTC, Jocelyn Mayer
Details | Diff
Short list of current open issue for Linux on Imac G5 (IMac-G5.status,379 bytes, text/plain)
2004-11-11 14:05 UTC, Jocelyn Mayer
Details
New patch against linux-2.6.10-rc1.diff (linux-2.6.10-rc1.diff,18.96 KB, patch)
2004-11-14 06:42 UTC, Jocelyn Mayer
Details | Diff
Open issues for Imac G5 (IMac-G5.status,755 bytes, text/plain)
2004-11-14 06:42 UTC, Jocelyn Mayer
Details
Corrected patch for Imac G5 boot with UDMA working on IDE (linux-2.6.10-rc1.diff,19.05 KB, patch)
2004-11-14 07:30 UTC, Jocelyn Mayer
Details | Diff
New patch for Imac G5 support (linux-2.6.10-rc2.diff,38.87 KB, patch)
2004-11-24 04:01 UTC, Jocelyn Mayer
Details | Diff
Status of Linux on Imac G5 (IMac-G5.status,558 bytes, text/plain)
2004-11-24 04:01 UTC, Jocelyn Mayer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jocelyn Mayer 2004-10-26 05:56:01 UTC
I tried several liveCD for PPC64 and they all freeze at the same place during or after the SATA devices probe.
My configuration is:
17" 1.8 Ghz Imac G5, 512 MB RAM with a 160 GB Maxtor SATA 6Y160M0 drive and IDE SuperDrive.
I can see some SATA probe messages. Here they are (when booted with the debug kernel option):
ata1: SATA max UDMA/133 cmd 0xE000000082FEE000 ctl 0xE0000000082FEE020 bmdma 0xE0000000082FEE030 irq 1
ata2: SATA max UDMA/133 cmd 0xE000000082FEE100 ctl 0xE0000000082FEE120 bmdma 0xE0000000082FEE130 irq 1
ata3: SATA max UDMA/133 cmd 0xE000000082FEE200 ctl 0xE0000000082FEE220 bmdma 0xE0000000082FEE230 irq 1
ata4: SATA max UDMA/133 cmd 0xE000000082FEE300 ctl 0xE0000000082FEE320 bmdma 0xE0000000082FEE330 irq 1
ata1: dev0 cfg 49:2f00 82:7869 83:7d09 84:4003 85:7869 86:3c01 87:4003 88:203f
ata1: dev0 ATA, max UDMA/100, 312581808 sectors: lba48

then it freezes.
I took a look to the code, it seems that this disk is well probed and recognized, so I don't know what's going wrong (probe of other SATA channels ?) and what I should see next.
MacOS X (10.3) runs like a charm, so the disk should be all right.

As a kernel developper, I may be able to do more tests if I can get a way to start....

Reproducible: Always
Steps to Reproduce:
1.
2.
3.



Expected Results:  
Feel like it should boot ;-)
Comment 1 Tom Gall (RETIRED) gentoo-dev 2004-10-26 19:53:08 UTC
Here's a dmesg from a booting dual g5.

So this can give you an idea s far as what would be next.

The bad news is that this is a known problem. The imac g5 linux support hasn't been worked on yet. (sorry) No kernel devs has access to this hardware yet.

ata1: SATA max UDMA/133 cmd 0xE000000084400000 ctl 0xE000000084400020 bmdma 0xE000000084400030 irq 0
ata2: SATA max UDMA/133 cmd 0xE000000084400100 ctl 0xE000000084400120 bmdma 0xE000000084400130 irq 0
ata3: SATA max UDMA/133 cmd 0xE000000084400200 ctl 0xE000000084400220 bmdma 0xE000000084400230 irq 0
ata4: SATA max UDMA/133 cmd 0xE000000084400300 ctl 0xE000000084400320 bmdma 0xE000000084400330 irq 0
ata1: dev 0 cfg 49:2f00 82:346b 83:5b01 84:4003 85:3469 86:1801 87:4003 88:007f
ata1: dev 0 ATA, max UDMA/133, 234441648 sectors:
ata1: dev 0 configured for UDMA/133
scsi0 : sata_svw
ata2: dev 0 cfg 49:2f00 82:7c69 83:7f09 84:4003 85:7c69 86:3e01 87:4003 88:407f
ata2: dev 0 ATA, max UDMA/133, 490234752 sectors: lba48
ata2: dev 0 configured for UDMA/133
scsi1 : sata_svw
ata3: no device found (phy stat 00000004)
scsi2 : sata_svw
ata4: no device found (phy stat 00000004)
scsi3 : sata_svw
  Vendor: ATA       Model: ST3120023AS       Rev: 3.01
  Type:   Direct-Access                      ANSI SCSI revision: 05
  Vendor: ATA       Model: Maxtor 6Y250M0    Rev: YAR5
  Type:   Direct-Access                      ANSI SCSI revision: 05
st: Version 20040403, fixed bufsize 32768, s/g segs 256
SCSI device sda: 234441648 512-byte hdwr sectors (120034 MB)
SCSI device sda: drive cache: write back
 /dev/scsi/host0/bus0/target0/lun0: [mac] p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 p13 p14 p15
Attached scsi disk sda at scsi0, channel 0, id 0, lun 0
SCSI device sdb: 490234752 512-byte hdwr sectors (251000 MB)
SCSI device sdb: drive cache: write back
 /dev/scsi/host1/bus0/target0/lun0: [mac] p1 p2 p3 p4 p5 p6
Attached scsi disk sdb at scsi1, channel 0, id 0, lun 0
Attached scsi generic sg0 at scsi0, channel 0, id 0, lun 0,  type 0
Attached scsi generic sg1 at scsi1, channel 0, id 0, lun 0,  type 0
ieee1394: Initialized config rom entry `ip1394'
Comment 2 Jocelyn Mayer 2004-10-27 03:38:03 UTC
OK, so it seems like it recognizes but can't configure the hard drive.
I'll try with another SATA drive (80 GB) and with no drive to see if the boot goes on.
I'm not afraid about hacking the kernel to make it boot on this machine. I guess that if I get yaboot from the CDROM and install it in a bootstrap partition on a firewire drive I'll be able to build my own kernel with debug messages and try to know what's going wrong. I'll try this next week-end. For now, I'll try to build a Linux kernel under MacOS X, for fun. Could you please send me the kernel sources (with eventual patches) and configuration used to build the one on the live CDROM (at l_indien at magic dot fr) ?
Thanks.
Comment 3 Jocelyn Mayer 2004-10-30 12:05:54 UTC
More news....
I've tried to boot with a 80GB SATA drive inside the IMac, then it still freezes at the same place. The strange thing is that it tries to access the drive in lba48 mode when lba28 would be sufficient.
If I try with the disk unplugged, Linux boots and I can get the shell.
I will now try to bootstrap from here on an external firewire drive and try to figure out where's the bug (lba48 is highly suspect, imho...).
Comment 4 Jocelyn Mayer 2004-11-03 05:11:22 UTC
Next step: I bootstrapped it ;-)
I did compile a kernel on my Ibook with ohci1394 and sbp2 inside and no SATA driver. I had to hack a few files to get it running:
in driver/net/sungem.c I added the correct ident for the device version in the PCI IDs table:
        { PCI_VENDOR_ID_APPLE, 0x0051,                                          
          PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },                                  

in driver/ide/ppc/pmac.c I had to do the same thing
        { PCI_VENDOR_ID_APPLE, 0x0050, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},        

Then, in driver/pci/pci.ids, I added a few strings in the Apple "section" to get a beautiful dump in /proc/pci:

        0050  Shasta IDE
        0051  Shasta (Sun GEM)
        0052  Shasta FireWire
        0053  Shasta PCI Bridge
        0054  Shasta PCI Bridge
        0055  Shasta PCI Bridge
(there is also the U3 memory controler which seems to be identified as a PCI device with ID 106b:004f if I refer to the Linux OF device tree)

then I added this kernel in the live CDROM (I used the 2004.1 version, for this try) and I've been able to boot and execute the bootstrap script on an external firewire disk drive. It's now compiling the system.
It will soon be time to track this SATA problem....
Comment 5 Jocelyn Mayer 2004-11-03 05:39:53 UTC
Ooops.... I forgot to say that the kernel I use is a vanilla 2.6.10-rc1.
Comment 6 Jocelyn Mayer 2004-11-05 04:00:52 UTC
I now have a fonctional system, still on a firewire drive.
I recompiled natively linux-2.6.8-gentoo-r3 and linux-2.6.9.
The Gentoo version don't boot (or maybe just don't have console). I didn't figure why for now.
I attach the cleaned patch to get firewire and ethernet work on the Imac G5.
Comment 7 Jocelyn Mayer 2004-11-05 04:02:17 UTC
Created attachment 43330 [details, diff]
kernel patch to get firewire and ethernet recognized on Imac G5
Comment 8 Tom Gall (RETIRED) gentoo-dev 2004-11-09 07:32:18 UTC
Thanks for you hard work on this.  I tried to package up both your and Benh's patches onto the update1 livecd for pmac but the reports back are that it's still failing in SATA land. 

If you see a new patch for SATA or anything like that feel free to ping me on irc, email or what have you and I'll recreate the livecd!

Thanks!

Tom
Comment 9 Jocelyn Mayer 2004-11-11 14:01:25 UTC
I made a hack to make Linux boot and use SATA on the Imac G5.
The problem comes from the kernel tries to use an invalid IRQ line (0) for the SATA controler.
I made a hack: if the found IRQ is zero, then use 0xA (hardcoded value).
This works but is not a valuable fix and may break all other Apple targets with SATA...
I attach the latest patch I used against linux-2.6.10-rc1 and a short list of open issues.
Comment 10 Jocelyn Mayer 2004-11-11 14:04:51 UTC
Created attachment 43741 [details, diff]
Patch against 2.6.10-rc1 kernel to get Linux boot the Imac G5

This patch contains the previous one, updated, which allowed ethernet and
firewire use,  Benjamin Herrenschmidt SATA initialisation patch, my new hack to
use SATA and a patch to get nvidia frame buffer recognize the graphic card
(with fb mode problem, though).
Comment 11 Jocelyn Mayer 2004-11-11 14:05:32 UTC
Created attachment 43743 [details]
Short list of current open issue for Linux on Imac G5
Comment 12 Tom Gall (RETIRED) gentoo-dev 2004-11-11 19:17:44 UTC
awesome, I'll reroll the livecd! Thank you Jocelyn!
Comment 13 Jocelyn Mayer 2004-11-14 06:41:10 UTC
Hi,

Here's a new patchset for the Imac G5 boot. This one should be safe for all PMACs.
It adds no new feature, but SATA and IDE IRQ initialisation are no more done using a hack.
I also updated my list of open issues.
Comment 14 Jocelyn Mayer 2004-11-14 06:42:05 UTC
Created attachment 43928 [details, diff]
New patch against linux-2.6.10-rc1.diff
Comment 15 Jocelyn Mayer 2004-11-14 06:42:39 UTC
Created attachment 43929 [details]
Open issues for Imac G5
Comment 16 Jocelyn Mayer 2004-11-14 06:45:45 UTC
I forgot one point:
there is, in fact, one new feature in this patchset:
the IDE controler is now recognized and should be able to use UDMA 100 modes
(need more work to run as UDMA 133).
Comment 17 Jocelyn Mayer 2004-11-14 07:30:11 UTC
Created attachment 43930 [details, diff]
Corrected patch for Imac G5 boot with UDMA working on IDE

The previous patch I sent was buggy (missing else statement in IDE controller
type check).
This one fixes this issue: the CDROM drive now run in UDMA2 mode (instead of
MDMA2).
Comment 18 Tom Gall (RETIRED) gentoo-dev 2004-11-15 20:48:24 UTC
Great thanks, I'll spin another new imacg5 livecd so it should be out EOD 11/16
Comment 19 Jocelyn Mayer 2004-11-24 04:01:05 UTC
Created attachment 44628 [details, diff]
New patch for Imac G5 support

New patch for Imac G5 support.
Please note that I added a new driver located in driver/macintosh/smu.c
which is needed to have RTC and shutdown/reboot working.
It appears as "drivers" => "macintosh" => "Support for SMU  based PowerMacs"
option in menuconfig.
Comment 20 Jocelyn Mayer 2004-11-24 04:01:50 UTC
Created attachment 44629 [details]
Status of Linux on Imac G5
Comment 21 Jocelyn Mayer 2004-11-24 04:03:57 UTC
Hi,

I just added a new patch against kernel 2.6.10-rc2 which makes the Imac G5 really usable.
Please note that kernels < 2.6.10-rc2 have some issues that makes a lot of processes end with segfault. This have been corrected in the 2.6.10-rc2, so please don't try to use previous kernel versions on Imac G5.

Enjoy !
Comment 22 Markus Rothe (RETIRED) gentoo-dev 2005-03-01 06:13:54 UTC
does this livecd work for you?

http://dev.gentoo.org/~tgall/install-ppc64-g5-minimal-2004.3-update3.iso.bz2

Markus
Comment 23 Chris L. Mason 2005-03-01 06:20:52 UTC
FWIW, that did work for me.  I think that's the one I used to get it installed
on my iMac G5 a couple months ago.  Btw, patches for the iMac G5 are
expected to go into the main kernel soon, but in the meantime are they
in (or can they be added to) one of the gentoo-dev-sources packages?

Thanks.
Comment 24 Jocelyn Mayer 2005-03-01 14:51:25 UTC
I did try to work on other patches, but nowadays I can't test anything anymore as
my Imac G5 died suddenly: it seems video or mb is broken.
I don't know if I can make it repaired, as the firm that used to repair Macs in Europe did bankrupt...
Then, just wait and hope someone else will work on it...
Comment 25 Markus Rothe (RETIRED) gentoo-dev 2005-03-03 09:21:00 UTC
marking as FIXED as 2004.3-update3 seems to solve this problem.
Comment 26 Markus Rothe (RETIRED) gentoo-dev 2005-03-03 09:23:01 UTC
closing