Skip to contentSkip to conversation

find the OF boot-device

DISCUSSION Olaf Hering 3 participants 5 messages Feb 1, 2000 – Feb 3, 2000

lore
Share & tools
lore
#0 lore raw

Hi,

we need an app to tell us the OF device path to a file. I'm working on that but I have a strange problem with a G4 400 AGP:

There are 3 entries /proc/device-tree/pci and all of them have the same inode number:

4189 dr-xr-xr-x   3 root     root   0 Feb  1 22:36 openprom/
4215 dr-xr-xr-x   2 root     root   0 Feb  1 22:36 options/
4297 dr-xr-xr-x  21 root     root   0 Feb  1 22:36 packages/
4405 dr-xr-xr-x   4 root     root   0 Feb  1 22:36 pci/
4405 dr-xr-xr-x   4 root     root   0 Feb  1 22:36 pci/
4405 dr-xr-xr-x   4 root     root   0 Feb  1 22:36 pci/
4339 dr-xr-xr-x   4 root     root   0 Feb  1 22:36 psuedo-hid/
4197 dr-xr-xr-x   4 root     root   0 Feb  1 22:36 rom/
4355 dr-xr-xr-x   2 root     root   0 Feb  1 22:36 rtas/

The hd alias ist /pci@f2000000/@d/mac-io@7/ata-4@1f000/disk@0 so I guess there must be something wrong. The first pci directory contains only the AGP card. I'm unable to enter the other directories.

On a newer G4 400 (with gmac ethernet) everything has a symlink:

4207 dr-xr-xr-x   2 root     root     0 Feb  1 22:46 options/
4289 dr-xr-xr-x  21 root     root     0 Feb  1 22:46 packages/
4468 lr-xr-xr-x   1 root     root     0 Feb  1 22:46 pci -> pci@f0000000/
4397 dr-xr-xr-x   4 root     root     0 Feb  1 22:46 pci@f0000000/
4470 dr-xr-xr-x   3 root     root     0 Feb  1 22:46 pci@f2000000/
4897 dr-xr-xr-x   3 root     root     0 Feb  1 22:46 pci@f4000000/
4331 dr-xr-xr-x   4 root     root     0 Feb  1 22:46 psuedo-hid/
4205 lr-xr-xr-x   1 root     root     0 Feb  1 22:46 rom -> rom@ff800000/
4187 dr-xr-xr-x   4 root     root     0 Feb  1 22:46 rom@ff800000/

The kernel is a 2.2.14.
Is there a bug in the OF or in the kernel?

Gruss Olaf

--

 $ man 1 current_release

BUGS
Users never read manuals...

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

#1 lore raw
Quoted 5 lines · Olaf Hering

we need an app to tell us the OF device path to a file. I'm working on that but I have a strange problem with a G4 400 AGP:

There are 3 entries /proc/device-tree/pci and all of them have the same inode number:

It is fixed with the latest Kernel from Benh.

Gruss Olaf

--

 $ man 1 current_release

BUGS
Users never read manuals...

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

#2 lore raw
In reply to Olaf Hering
Quoted 2 lines · Olaf Hering

The kernel is a 2.2.14.
Is there a bug in the OF or in the kernel?

It's a "feature" of MacOS when using BootX. MacOS discards the "@xxxxxxxx" portion of the OF path, so the device tree built by BootX is missing those. They can be rebuilt using the OF "reg" property, I have to figure out the proper algorithm but this could (should) be done in the kernel or in BootX itself before passing the tree to the kernel.

How do you plan to match the device to the OF node ? I've looked into this issue for some time now, but I don't really see a valid way to know that a given Linux device (/dev/xxx) corresponds to a given OF node. Especially when using PCI SCSI cards. Is there a way from userland to retreive PCI infos of a controller from it's /dev/sdXX node ?

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

#3 lore raw
Quoted 6 lines · BenH

On Tue, Feb 1, 2000, Olaf Hering <[email protected]> wrote:
How do you plan to match the device to the OF node ? I've looked into this issue for some time now, but I don't really see a valid way to know that a given Linux device (/dev/xxx) corresponds to a given OF node. Especially when using PCI SCSI cards. Is there a way from userland to retreive PCI infos of a controller from it's /dev/sdXX node ?

It is a little harder. There is no way to see which drive is connected to a controller. If you have an Adaptec you can parse something in /proc/scsi/aic78xxx and scsi. The symbios logic driver gives you no hint. The same problem with the IDE drives.

But what do we really need?

OF can only boot from known devices, I can't boot from an old adaptec 2940 or any symbios logic adapter.
And if you have an PCI IDE controller then the OF won't boot from that unknown device.
This reduces the possible boot-devices:

We can boot from some Adaptec controllers, we can boot from every IDE drive. Maybe there are some other controllers, I don't know.

And we are talking about "colored" Macs.

The drive /dev/hda and /dev/hdb is usualy connected to /pci/*/ata-4/disk{0,1}, so you can search for that. /dev/hdc and /dev/hdd is connected to ata-3.

If you have a supported Adaptec then you can parse /proc/scsi/aic78xxx and /proc/scsi/scsi.

I will implement this in my script, the preview on the ftp server works only with one card right now. I will add the IDE stuff in the next days.

It would be nice to know what I can expect under /proc. There is a little hardware "detection" script ftp://ftp.suse.com/pub/suse/ppc/update/BETA/suse_hw_info.sh

Please start it with . ./suse_hw_info.sh and mail us the tar.gz file. It would be nice to have this for every possible machine, I will make the infos available to the public.

Gruss Olaf

--

 $ man 1 current_release

BUGS
Users never read manuals...

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

#4 lore raw
Quoted 2 lines · Olaf Hering

We can boot from some Adaptec controllers, we can boot from every IDE drive. Maybe there are some other controllers, I don't know.

Some symbios logic cotrollers among others.

Quoted 1 line

And we are talking about "colored" Macs.

MESH for all "uncolored" ones (just to be complete).

Takashi Oe

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/