Device trees

Philip Schulz philip.s.schulz at googlemail.com
Thu Jul 24 12:17:40 UTC 2008


2008/7/24 M. Warner Losh <imp at bsdimp.com>:
> In message: <D33D2388-8237-406D-8162-1DF9013277A2 at jeamland.net>
>            Benno Rice <benno at jeamland.net> writes:
> :
> : On 24/07/2008, at 8:47 AM, M. Warner Losh wrote:
> :
> : > Does FreeBSD/powerpc on the MPC85xx machine use the fake device open
> : > firmware tree stuff from uboot (aka dts in the linux kernel sources)?
> :
> : I've got a machine (Mikrotik RouterBOARD 333, uses MPC8321) that has
> : this.  I've been working with one of the dtc developers to port their
> : code over to FreeBSD.
>
> Cool!
>
> : I'm trying to hide it underneath our existing
> : OpenFirmware stuff.  I've got a few more bugs to get out of it but I
> : can probably send you some patches early next week...
>
> That's basically what Linux does.  They force the boot loader to pass
> in all kinds of information about the system.  This makes a lot of
> sense, I think.
>

Unless I misunderstood what you guys said, I think it should be done
the other way around.

It's my understanding that Linux always uses the FDT internally. If it
finds that it's being booted from a full Open Firmware implementation
with device tree, it will first parse the device tree and convert it
to an FDT. That way, Linux doesn't have to do any client interface
calls once it's past the device tree parsing stage. I think that's
good, see below.

> Are you booting /boot/loader?  Or directly booting the kernel from
> uboot?
>
> In message: <106CEF8A-EA8A-48BC-BAF7-B9C112F58A92 at mac.com>
>            Marcel Moolenaar <xcllnt at mac.com> writes:
> : No, it doesn't.
>
> Is there any reason it doesn't?  Having looked at the dtc stuff, it
> seems to have all the requirements of device enumeration that we
> talked about at BSDcan...
>

Don't know what happened at BSDcan, but... Since the FDT encodes
pretty much all information the full device tree does, but doesn't
provide the methods, I don't see a problem with device enumeration in
FreeBSD. I.e. all devices that appear in the full device tree would
also appear in the FDT, but you can't use their methods. So while this
may be a problem for the FreeBSD loader, it certainly shouldn't be for
the kernel.

I personally think that the Linux design makes a lot of sense and I
think that you should hide the real Open Firmware device tree behind
the flattened device tree (FDT). From my point of view,  doing so will
prepare and strengthen FreeBSD on the embedded PowerPC front and also,
as Nathan noted, simplify ports to other PowerPC-based platforms.

Regards,

Philip


More information about the freebsd-ppc mailing list