History log of /freebsd-head/sys/dev/ofw/openfirm.c
Revision Date Author Comments
3308d36a5e2faea7a0284eb62ee256bf17a3c0cf 09-Apr-2018 gonzo <gonzo@FreeBSD.org> Align OF_getencprop_alloc API with OF_getencprop and OF_getprop_alloc

Change OF_getencprop_alloc semantics to be combination of malloc and
OF_getencprop and return size of the property, not number of elements
allocated.

For the use cases where number of elements is preferred introduce
OF_getencprop_alloc_multi helper function that copies semantics
of OF_getencprop_alloc prior to this change.

This is to make OF_getencprop_alloc and OF_getencprop_alloc_multi
function signatures consistent with OF_getencprop_alloc and
OF_getencprop_alloc_multi.

Functionality-wise this patch is mostly rename of OF_getencprop_alloc
to OF_getencprop_alloc_multi except two calls in ofw_bus_setup_iinfo
where 1 was used as a block size.
eb86958de4eb4d7dad6c37478a58d16f00bac3e2 09-Apr-2018 gonzo <gonzo@FreeBSD.org> Make OF_searchencprop signature consistent with OF_getencprop

Use pcell_t* as a destination buffer argument instead of void
pointer to be consistent with OF_getencprop signature.
1252c9346c5d287a42e08197430f905762dae341 08-Apr-2018 gonzo <gonzo@FreeBSD.org> Clean up OF_getprop_alloc API

OF_getprop_alloc takes element size argument and returns number of
elements in the property. There are valid use cases for such behavior
but mostly API consumers pass 1 as element size to get string
properties. What API users would expect from OF_getprop_alloc is to be
a combination of malloc + OF_getprop with the same semantic of return
value. This patch modifies API signature to match these expectations.

For the valid use cases with element size != 1 and to reduce
modification scope new OF_getprop_alloc_multi function has been
introduced that behaves the same way OF_getprop_alloc behaved prior to
this patch.

Reviewed by: ian, manu
Differential Revision: https://reviews.freebsd.org/D14850
52d939886a634e454353a603a6375f7d949a4a65 28-Nov-2017 nwhitehorn <nwhitehorn@FreeBSD.org> Back out OF module installation in the event of failure. PS3 firmware gives
some ancient FDT version (2) that fails the init check in OFW_FDT. It is
still possible to make progress, but not while the OF layer is going crazy.
1537078d8f2e62e82de3c08bdcae0fd79dc35a4a 27-Nov-2017 pfg <pfg@FreeBSD.org> sys/dev: further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.
00d578928eca75be320b36d37543a7e2a4f9fbdb 27-May-2016 grehan <grehan@FreeBSD.org> Create branch for bhyve graphics import.
23a2d5f59362b8a60462708280c89083bb8d1b27 11-May-2016 gonzo <gonzo@FreeBSD.org> Add OF_prop_free function as a counterpart for OF_*prop_alloc

- Introduce new OF API function OF_prop_free to free memory allocated by
OF_getprop_alloc and OF_getencprop_alloc. Current code just calls free(9)
with M_OFWPROP memory class which assumes knowledge about OF_*prop_alloc
functions' internals and leads to unneccessary code coupling

- Convert some of the free(..., M_OFWPROP) instances to OF_prop_free

Files affected by this commit are the ones I was able to test on real
hardware. The rest of free(..., M_OFWPROP) instances will be handled with
idividual maintainers

Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D6315
dfc2b357e6d47744e13bc1235a314bedde6d9115 25-Jan-2016 zbb <zbb@FreeBSD.org> Do not destroy input buffer of the OF_getencprop() function on error

Currently when the OF_getprop() function returns with error,
the caller (OF_getencprop()) still changes the buffer endiannes.
This may destroy the default value passed in the input buffer if
used on a Little Endian platform.

Reviewed by: mmel
Submitted by: Zbigniew Bodek <zbb@semihalf.com>
Obtained from: Semihalf
Sponsored by: Cavium
988b55c72da38231401eded942a2c1a341541681 24-Jan-2016 andrew <andrew@FreeBSD.org> Fix the style of the reading of a nodes xref to make it readable.
ef273b2b34e3cfb0f2f6791b32d7924414392b68 24-May-2015 ian <ian@FreeBSD.org> MFC r279368, r280772, r280848:

Allow creating subclass of FDT simplebus

Make simplebus a base class of ofwbus.

Fix bug in xrefinfo_find() for 64-bit platforms
861c5f13d020d7891f0d5ccaf93666cfc6577fd5 30-Mar-2015 zbb <zbb@FreeBSD.org> Fix bug in xrefinfo_find() for 64-bit platforms

uintptr_t may be 64-bit on some platforms, therefore when
finding xrefinfo by pointer to device the high word is being
cut off due to cast to phandle_t which is 32-bit long by definition.
Due to that we loose the high word of the address to compare with
xi->dev's address.
To fix that, first argument of xrefinfo_find() is extended to
uintptr_t and is being cast to appropriate type (phandle_t)
when compared.

Submitted by: Zbigniew Bodek <zbb@semihalf.com>
Reviewed by: nwhitehorn
Obtained from: Semihalf
2f964f86f074cf08cf21337faeaa2ce688f8e88a 30-Jan-2015 dim <dim@FreeBSD.org> Merge ^/head r277902 through r277944.
aef5f9f1b801cc4daa87bcea3d98b46b639ffc5c 30-Jan-2015 loos <loos@FreeBSD.org> Do not leak the OFW memory when the result does not satisfy our alignment
requirement.

While here, fix style(9) issues.
af8e847649983ec197b4c4da32127b1864f1c9dd 26-Oct-2014 ian <ian@FreeBSD.org> MFC r270953, r270958, r270960, r271190, r271199, r271202:

Create a mechanism for looking up a device_t associated with an ofw/fdt
xref handle, and for registering that association. Also use the same data
for faster translations between node and xref handles.

Add OF_xref_from_device() so that there's no need to have an intermediate
call to ofw_bus_get_node() to lookup info that's already in the xreflist.

When registering an association between a device and an xref phandle, create
an entry in the xref list if one doesn't already exist for the given handle.
1c8cde378e7386ca86f33d4ce67b360782b6abec 26-Oct-2014 ian <ian@FreeBSD.org> MFC r270945:

Rename OF_xref_phandle() to OF_node_from_xref() and add a new function
that provides the inverse translation, OF_xref_from_node().
d965bce9e023caec1adf61b684c04559fcfc5d38 06-Sep-2014 ian <ian@FreeBSD.org> When registering an association between a device and an xref phandle, create
an entry in the xref list if one doesn't already exist for the given handle.

On a system that uses phandle properties, the init-time scan of the tree
which builds the xref list will pre-create entries for every xref handle
that exists in the data. On systems where the xref and node handles are
synonymous there is no phandle property in referenced nodes, and the xref
list will initialize to an empty state. In the latter case, we still need
to be able to associate a device_t with an xref handle, so we create list
entries on the fly as needed. Since the node and xref handles are
synonymous, we have all the info needed to create a list entry at device
registration time.

The downside to this change is that it basically allows on the fly creation
of xref handles as synonyms of node handles, and the association of a
device_t with them. Whether this is a bug or a feature is in the eye of
the beholder, I guess.
c8e7d833d07614a2884d4a0ca2b7fd41e93acc12 06-Sep-2014 ian <ian@FreeBSD.org> Revert rr271190, it was based on a misunderstanding. The problem of
non-existant device<->xref info needs to be handled by creating the info,
which will come in a subsequent commit.
cd70b067cc30d9b2494dffc0658705e127c96c2c 06-Sep-2014 ian <ian@FreeBSD.org> Add OF_xref_from_node_strict() which returns -1 if there is no xref handle
for the node. The default routine returns the untranslated handle, which
is sometimes useful, but sometimes you really need to know there's no
entry in the xref<->node<->device translation table.
1853fe0f7a3a7677b865cd560e61258b6d358218 02-Sep-2014 ian <ian@FreeBSD.org> Fix typo.

Pointy hat: ian
29ba19b429e334f6eb07025de2ff4a0018e6d583 02-Sep-2014 ian <ian@FreeBSD.org> Add OF_xref_from_device() so that there's no need to have an intermediate
call to ofw_bus_get_node() to lookup info that's already in the xreflist.
c1f3eb16af7730f8b65686792a66831af9b7debd 01-Sep-2014 ian <ian@FreeBSD.org> Create a mechanism for looking up a device_t associated with an ofw/fdt
xref handle, and for registering that association. Also use the same data
for faster translations between node and xref handles.

Now when fdt properties contain &othernode references, a driver can find
the device instance that corresponds to &othernode, and thus can use
interfaces provided by that instance.

Reviewed by: nwhitehorn
b149a9e7aec5e222b7dba23fdebc5717058e1c33 01-Sep-2014 ian <ian@FreeBSD.org> Rename OF_xref_phandle() to OF_node_from_xref() and add a new function
that provides the inverse translation, OF_xref_from_node().

Discussed with: nwhitehorn
4c1631c2b15b10939521fa505c7995af4409aefb 13-May-2014 ian <ian@FreeBSD.org> MFC r256932, r256938, r256966, r256953, r256967, r256969, r257015:

Add a new function (OF_getencprop()) that undoes the transformation applied
by encode-int. Specifically, it takes a set of 32-bit cell values and
changes them to host byte order. Most non-string instances of OF_getprop()
should be using this function, which is a no-op on big-endian platforms.

Use the new function all over the place.
eb1a5f8de9f7ea602c373a710f531abbf81141c4 21-Feb-2014 gjb <gjb@FreeBSD.org> Move ^/user/gjb/hacking/release-embedded up one directory, and remove
^/user/gjb/hacking since this is likely to be merged to head/ soon.

Sponsored by: The FreeBSD Foundation
6b01bbf146ab195243a8e7d43bb11f8835c76af8 27-Dec-2013 gjb <gjb@FreeBSD.org> Copy head@r259933 -> user/gjb/hacking/release-embedded for initial
inclusion of (at least) arm builds with the release.

Sponsored by: The FreeBSD Foundation
8843b343e66ad85232a61eb3687ce898616adb6f 12-Dec-2013 andreast <andreast@FreeBSD.org> MFC: r256932, r256938, r256953

r256932:
Add a new function (OF_getencprop()) that undoes the transformation applied
by encode-int. Specifically, it takes a set of 32-bit cell values and
changes them to host byte order. Most non-string instances of OF_getprop()
should be using this function, which is a no-op on big-endian platforms.

r256938:
A few other common cases for encode-int decoding: OF_getencprop_alloc()
and OF_searchencprop(). I thought about using the element size parameter
to OF_getprop_alloc() to do endian-switching automatically, but it breaks
use with structs and a *lot* of FDT code (which can hopefully be moved to
these new APIs).

r256953:
Fix build.
9a7fe80e18a50ce12c6a8fe4992f6cdedee57069 23-Oct-2013 nwhitehorn <nwhitehorn@FreeBSD.org> Make all Open Firmware internal interfaces endian-safe by using the new
OF_getencprop() API. This removes one explicit endianness conversion in
ofw_iicbus.c.
66c25f9661e960cf0a90bd7e8974bf28674a55b5 23-Oct-2013 andreast <andreast@FreeBSD.org> Fix build.
15e1002387b7d7b3cfd66cfd2f22bbdefacbfae3 22-Oct-2013 nwhitehorn <nwhitehorn@FreeBSD.org> A few other common cases for encode-int decoding: OF_getencprop_alloc()
and OF_searchencprop(). I thought about using the element size parameter
to OF_getprop_alloc() to do endian-switching automatically, but it breaks
use with structs and a *lot* of FDT code (which can hopefully be moved to
these new APIs).

MFC after: 2 weeks
f79afef6544806637f37a77e0a14d8e2d70b0d24 22-Oct-2013 nwhitehorn <nwhitehorn@FreeBSD.org> Add a new function (OF_getencprop()) that undoes the transformation applied
by encode-int. Specifically, it takes a set of 32-bit cell values and
changes them to host byte order. Most non-string instances of OF_getprop()
should be using this function, which is a no-op on big-endian platforms.
3b7e4aa267bc7eedadb66a6fa1fac2a227969a41 15-Sep-2013 nwhitehorn <nwhitehorn@FreeBSD.org> Add a kernel interface (OF_xref_phandle()) for systems where phandles
used as cross-references in the device tree and phandles as used by the
Open Firmware client interface are in different namespaces. This include
IBM pSeries hardware as well as FDT systems. FDT certainly abuses
ihandles for this purpose and should be modified to use this API
eventually. This changes no behavior on systems where FreeBSD already
worked.

Reviewed by: marius
Approved by: re (kib)
MFC after: 2 weeks
5320d21e5403e54eded0635a6f0ac20db93b0467 18-Aug-2012 hrs <hrs@FreeBSD.org> - Add OF_hasprop() and ofw_bus_has_prop(). These can be used to check
existence of the property.

- Fix ofw_bus_is_compatible{,_strict}() to prevent substring match in the
compatible string.

Reviewed by: raj
44e78d98e4c96c328bed9209b4816da1ab8baa77 27-Jan-2012 marius <marius@FreeBSD.org> Implement OF_printf() using kvprintf() directly, avoiding to use a
buffer and allowing to handle newlines properly
e5b89f2d70c0092ae178473393348aa3de7e2745 02-Dec-2011 jchandra <jchandra@FreeBSD.org> Fix OF_finddevice error return value in case of FDT.

According to the open firmware standard, finddevice call has to return
a phandle with value of -1 in case of error.

This commit is to:
- Fix the FDT implementation of this interface (ofw_fdt_finddevice) to
return (phandle_t)-1 in case of error, instead of 0 as it does now.
- Fix up the callers of OF_finddevice() to compare the return value with
-1 instead of 0 to check for errors.
- Since phandle_t is unsigned, the return value of OF_finddevice should
be checked with '== -1' rather than '<= 0' or '> 0', fix up these cases
as well.

Reported by: nwhitehorn

Reviewed by: raj
Approved by: raj, nwhitehorn
4b6458192ff06c2470fb447cad0f59bf228acf93 15-Nov-2011 marius <marius@FreeBSD.org> As it turns out, r186347 actually is insufficient to avoid the use of the
curthread-accessing part of mtx_{,un}lock(9) when using a r210623-style
curthread implementation on sparc64, crashing the kernel in its early
cycles as PCPU isn't set up, yet (and can't be set up as OFW is one of the
things we need for that, which leads to a chicken-and-egg problem). What
happens is that due to the fact that the idea of r210623 actually is to
allow the compiler to cache invocations of curthread, it factors out
obtaining curthread needed for both mtx_lock(9) and mtx_unlock(9) to
before the branch based on kobj_mutex_inited when compiling the kernel
without the debugging options. So change kobj_class_compile_static(9)
to just never acquire kobj_mtx, effectively restricting it to its
documented use, and add a kobj_init_static(9) for initializing objects
using a class compiled with the former and that also avoids using mutex(9)
(and malloc(9)). Also assert in both of these functions that they are
used in their intended way only.
While at it, inline kobj_register_method() and kobj_unregister_method()
as there wasn't much point for factoring them out in the first place
and so that a reader of the code has to figure out the locking for
fewer functions missing a KOBJ_ASSERT.
Tested on powerpc{,64} by andreast.

Reviewed by: nwhitehorn (earlier version), jhb
MFC after: 3 days
afe737d0dd252afd2265b15771822bbfca5a74bf 09-Nov-2010 nwhitehorn <nwhitehorn@FreeBSD.org> Make all OF client interface calls return the maximum kind of
does-not-exist error when no client interface module is installed instead
of dereferencing NULL pointers. This eases implementation of platforms
that may or may not have Open Firmware.
09f9c897d33c41618ada06fbbcf1a9b3812dee53 19-Oct-2010 jamie <jamie@FreeBSD.org> A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.
0b2ac861b54b90c8db0a69d05d466c2fa101b714 11-Sep-2010 marius <marius@FreeBSD.org> Change OF_interpret() to also take an array of cell_t (missed in r209801).

Reviewed by: nwhitehorn
b85d8a68d9fa34d4f2fe1d4a3b1eb0091b2c9bc3 08-Jul-2010 nwhitehorn <nwhitehorn@FreeBSD.org> Change the argument type to OF_call_method to take an array of cell_t
instead of unsigned longs to prepare for platforms where they are not
the same.
ef99eb110e7dc8e312597e69d22a462e881a05d0 28-May-2010 raj <raj@FreeBSD.org> Prepare and extend OFW layer for FDT support.

o Let OFW_INIT() and OF_init() return status value.

o Provide helper routines for 'compatible' property handling.

o Only compile OF and OFW code, which is relevant in FDT scenario.

o Other minor cosmetics

Reviewed by: imp
Sponsored by: The FreeBSD Foundation
b7a63fb85cd07072afa8e91201882f5a9c432e55 16-May-2010 nwhitehorn <nwhitehorn@FreeBSD.org> Pull OF_quiesce() out of the MI Open Firmware layer and entirely into
PPC ofw_machdep.c, in recognition of its state as a machine specific hack.

Requested by: marius
5236db452d5b06e3faf03f1827771f70170b6c71 16-May-2010 nwhitehorn <nwhitehorn@FreeBSD.org> On PowerMac11,2 and (presumably) PowerMac12,1, we need to quiesce the
firmware in order to take over control of the SMU. Without doing this,
the firmware background process doing fan control will run amok as we
take over the system and crash the management chip.

This is limited to these two machines because our kernel is heavily
dependent on firmware accesses, and so quiescing firmware can cause
nasty problems.
f1216d1f0ade038907195fc114b7e630623b402c 19-Mar-2010 delphij <delphij@FreeBSD.org> Create a custom branch where I will be able to do the merge.
3961775a2db6be3ae2d269fb4fd4bb0465075f50 14-Jun-2009 marius <marius@FreeBSD.org> Fix style.
aa09259c5bcc6d45a8e5cab2cb09d667d8d3c78e 29-Mar-2009 marius <marius@FreeBSD.org> Unbreak OF_interpret() and its standard implementation after r186347.
4ca12119c31e0cd42b3cb4b28dd898b8218290dc 03-Jan-2009 nwhitehorn <nwhitehorn@FreeBSD.org> Fix the OFW interrupt map parser to use its own idea of the number of interrupt
cells in the map, instead of using a value passed to it and then panicing if it
disagrees. This fixes interrupt map parsing for PCI bridges on some Apple
Uninorth PCI controllers.

Reported by: marcel
Tested on: G4 iBook, Sun Ultra 5
3fcef6d9c20b6c3577c741e4a0fe24807fd08a66 20-Dec-2008 nwhitehorn <nwhitehorn@FreeBSD.org> Modularize the Open Firmware client interface to allow run-time switching
of OFW access semantics, in order to allow future support for real-mode
OF access and flattened device frees. OF client interface modules are
implemented using KOBJ, in a similar way to the PPC PMAP modules.

Because we need Open Firmware to be available before mutexes can be used on
sparc64, changes are also included to allow KOBJ to be used very early in
the boot process by only using the mutex once we know it has been initialized.

Reviewed by: marius, grehan
19b6af98ec71398e77874582eb84ec5310c7156f 22-Nov-2008 dfr <dfr@FreeBSD.org> Clone Kip's Xen on stable/6 tree so that I can work on improving FreeBSD/amd64
performance in Xen's HVM mode.
cf5320822f93810742e3d4a1ac8202db8482e633 19-Oct-2008 lulf <lulf@FreeBSD.org> - Import the HEAD csup code which is the basis for the cvsmode work.
ba90a8eb4f5e3950cf7d5e5383c657172d2b246e 06-Jul-2007 peter <peter@FreeBSD.org> Fix warnings.
nxge: cast page size fragments down to (int). If the vm's demand paging
PAGE_SIZE is ever too big for that, we've got far bigger problems.
ofw: move va_start() a little earlier. gcc-4.2 doesn't like us modifying
the last arg before the va_start().

Approved by: re (rwatson)
6501a244da75c8538f2b7a9007488c4fc615fdd3 16-Jun-2007 marius <marius@FreeBSD.org> In OF_init() check the return value of OF_getprop().

Found with: Coverity Prevent(tm)
CID: 679
1d8fcccf39baa1853feed8bcf07dcbbc33fb8ca8 16-Jun-2007 marius <marius@FreeBSD.org> - Restore the machine independency of sys/dev/ofw/openfirm.{c,h} by
moving OF_set_mmfsa_traptable() (SUNW,set-trap-table with the two
arguments used here is specific to sun4v) to MD code.
- In sys/dev/ofw/openfirm.h remove prototypes for unimplemented
functions and unused Solaris compatibility macros.
128f33dd8aefae83112dfebcc1cb3b63292197d6 16-Jun-2007 marius <marius@FreeBSD.org> Sync the styles of sys/boot/ofw/libofw/openfirm.c and
sys/dev/ofw/openfirm.c with themselves, with each-other
and with style(9).
59e3dc5a09ffb4e02245df42143b8fd56af8659d 11-Oct-2006 kmacy <kmacy@FreeBSD.org> Using the ptr defines broke the powerpc build - convert set_mmfsa to the same
convention as the rest of openfirm.c
65e20bda0996ed88b33ac28272610e8f80624028 09-Oct-2006 kmacy <kmacy@FreeBSD.org> kernel clean up to make the sun4v kernel build

Reviewed by: jmg
Approved by: rwatson (mentor)
de081fdfb1f76a022d06b493c13e2f05514b894f 22-Nov-2005 marius <marius@FreeBSD.org> Remove unused function and variables.
4b319958e7f00cc908274c4518b7a9c5ed821812 06-Jan-2005 imp <imp@FreeBSD.org> Start each of the license/copyright comments with /*-, minor shuffle of lines
24ad8a984216ddd6cda66a3325a55fe6bd74b88c 16-Aug-2004 marius <marius@FreeBSD.org> Instead of "OpenFirmware", "openfirmware", etc. use the official spelling
"Open Firmware" from IEEE 1275 and OpenFirmware.org (no pun intended).

Ok'ed by: tmm
24c9adb5b9657b024598ffd14ce5b230e7e9ba66 22-May-2004 marius <marius@FreeBSD.org> - Rearrange a comment to fit in 80 chars per line, like the rest of this
file.
- Remove a superfluous ';'.
c63dab466c1f033b389bd6ea609f595059544212 24-Aug-2003 obrien <obrien@FreeBSD.org> Use __FBSDID().
Also some minor style cleanups.
b5d362bc532139b1cd676ee21ec53643aacead85 07-Jun-2003 jake <jake@FreeBSD.org> Implement OF_interpret.

Obtained from: netbsd
cf874b345d0f766fb64cf4737e1c85ccc78d2bee 19-Feb-2003 imp <imp@FreeBSD.org> Back out M_* changes, per decision of the TRB.

Approved by: trb
bf8e8a6e8f0bd9165109f0a258730dd242299815 21-Jan-2003 alfred <alfred@FreeBSD.org> Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.
Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
f90b466a8546d0524d6a6e155053dd4a402050e0 18-Nov-2001 tmm <tmm@FreeBSD.org> 1. Add ofw_pci.h with definitions for the OpenFirmware PCI bindings
2. Add OF_getprop_alloc(), a helper function that will malloc() a sufficient
amount of memory and then retrieve a property value into it.

Approved by: benno
Obtained from: NetBSD (1)
104745ff114499d8f2003702d56c3b969f1b064b 31-Jul-2001 jake <jake@FreeBSD.org> Make the openfirmware functions work on 64 bit architectures by using
a standard cell_t type for the fields of all argument structs. Also
make ihandle_t and phandle_t unsigned to avoid sign extension problems.

Approved by: benno
d07d921cce473b235f15342c4ba1dcbf694cb610 27-Jun-2001 benno <benno@FreeBSD.org> Garbage collect some debug code.
10abd05c149e5b4f7506aa1677cacf87d1747ca6 16-Jun-2001 benno <benno@FreeBSD.org> OpenFirmware kernel support, as used by the PowerPC and hopefully other
ports later on.

This includes the basic MI interface routines as well as a console driver.
The MD code is kept in the MD directories.

Reviewed by: obrien
7d73a3330371286c3b3b0c935dabb9f849aef4d1 10-Nov-2000 benno <benno@FreeBSD.org> OpenFirmware/PowerPC loader, part 2.

As of this patchset, the loader builds (under NetBSD/macppc), boots, interacts
and talks to BOOTP/NFS servers.

(main.c was moved from boot/ofw/libofw to boot/ofw/common but has no revision
history)

Reviewed by: obrien
d84d862cbd66f3f9ab4ce65fe69893664689c73b 16-Oct-2000 obrien <obrien@FreeBSD.org> "Ok, my loader's now up to putting up a prompt. It probes disks partially
but can't boot from them yet."

Thanks to Stephane Potvin for the some of the code in this set.

Submitted by: Benno Rice <benno@jeamland.net>