History log of /freebsd-10.1-release/sys/boot/sparc64/
Revision Date Author Comments
272461 03-Oct-2014 gjb

Copy stable/10@r272459 to releng/10.1 as part of
the 10.1-RELEASE process.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


271132 04-Sep-2014 emaste

MFC r263005 by royger: howto_names: unify declaration


263763 26-Mar-2014 dim

MFC r262613:

Merge the projects/clang-sparc64 branch back to head. This brings in
several updates from the llvm and clang trunks to make the sparc64
backend fully functional.

Apart from one patch to sys/sparc64/include/pcpu.h which is still under
discussion, this makes it possible to let clang fully build world and
kernel for sparc64.

Any assistance with testing this on actual sparc64 hardware is greatly
appreciated, as there will unavoidably be bugs left.

Many thanks go to Roman Divacky for his upstream work on getting the
sparc64 backend into shape.

MFC r262985:

Repair a few minor mismerges from r262261 in the clang-sparc64 project
branch. This is also to minimize differences with upstream.


256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


251589 10-Jun-2013 marius

- The method introduced as part of r234898 for not altering the boot path
when booting from ZFS turned out to also cause the boot path not being
adjusted if booting from CD-ROM with firmware versions that do not employ
the "cdrom" alias in that case. So shuffle the code around instead in order
to achieve the original intent. Ideally, we shouldn't fiddle with the boot
path when booting from UFS on a disk either; unfortunately, there doesn't
seem to be an universal way of telling disks and CD-ROMs apart, though. [1]
- Use NULL instead of 0 for pointers.

PR: 179289
MFC after: 1 week


245697 20-Jan-2013 avg

zfs/sparc64 boot: fix booting after r242230

arch_zfs_probe method is supposed to only probe for ZFS vdevs, but it can
not expect that ZFS data is in a ready state yet.
So, move some code from sparc64_zfs_probe to main to meet the constraints.

Reported by: Chris Ross <cross+freebsd@distal.com>
Tested by: Chris Ross <cross+freebsd@distal.com>
MFC after: 4 days


244307 16-Dec-2012 marius

Restore pre-r234898 printing of boot loader and path.

MFC after: 3 days


243305 19-Nov-2012 marius

Fix build after r243245.

Submitted by: trasz


242688 07-Nov-2012 dteske

Hook in new files menusets.4th and manual.

Approved by: adrian (co-mentor) (implicit)


240335 11-Sep-2012 ae

Slightly reduce an overhead for the open() call in the zfsloader.
libstand(3) tries to detect file system in the predefined order,
but zfsloader usually is used for the booting from ZFS, and there is
no need to try detect several file system types for each open() call.


238851 27-Jul-2012 marius

Pull the tier-2 card and change the sparc64 ZFS loader to no longer probe
all diskN aliases for providers (which more or less corresponds to how the
x86 version behaves) but instead probe only those listed in the boot-device
OFW environment variable. This has the following advantages:
- avoids otherwise unavoidable OFW warnings about failures to open disks
for which aliases exist but no actual hardware is connected
- avoids issues due to different diskN naming schemes
- aligns us with Solaris

MFC after: 3 days


236581 04-Jun-2012 marius

The loaddev environment variable is not modifiable once set, so it is not
update for ZFS. It seems that this does not really affect anything except
the help command. Nevertheless, rearrange things so loaddev is set only
once in all cases in order to get it right.
Pointed out by: avg

MFC after: r235364


235988 25-May-2012 gleb

Use 32-bit ufs_ino_t instead of ino_t to keep boot2 small and prevent
unnecessary 64-bit math on 32-bit machines.

Sponsored by: Google Summer of Code 2011


235364 12-May-2012 avg

sparc64/zfs boot: take advantage of new libzfsboot capabilities

Also drop the now unneeded compatibility shims.

Tested by: marius
MFC after: 1 month


235329 12-May-2012 avg

zfsboot/zfsloader: support accessing filesystems within a pool

In zfs loader zfs device name format now is "zfs:pool/fs",
fully qualified file path is "zfs:pool/fs:/path/to/file"
loader allows accessing files from various pools and filesystems as well
as changing currdev to a different pool/filesystem.

zfsboot accepts kernel/loader name in a format pool:fs:path/to/file or,
as before, pool:path/to/file; in the latter case a default filesystem
is used (pool root or bootfs). zfsboot passes guids of the selected
pool and dataset to zfsloader to be used as its defaults.

zfs support should be architecture independent and is provided
in a separate library, but architectures wishing to use this zfs support
still have to provide some glue code and their devdesc should be
compatible with zfs_devdesc.
arch_zfs_probe method is used to discover all disk devices that may
be part of ZFS pool(s).

libi386 unconditionally includes zfs support, but some zfs-specific
functions are stubbed out as weak symbols. The strong definitions
are provided in libzfsboot.
This change mean that the size of i386_devspec becomes larger
to match zfs_devspec.

Backward-compatibility shims are provided for recently added sparc64
zfs boot support. Currently that architecture still works the old
way and does not support the new features.

TODO:
- clear up pool root filesystem vs pool bootfs filesystem distinction
- update sparc64 support
- set vfs.root.mountfrom based on currdev (for zfs)

Mid-future TODO:
- loader sub-menu for selecting alternative boot environment

Distant future TODO:
- support accessing snapshots, using a snapshot as readonly root

Reviewed by: marius (sparc64),
Gavin Mu <gavin.mu@gmail.com> (sparc64)
Tested by: Florian Wagner <florian@wagner-flo.net> (x86),
marius (sparc64)
No objections: fs@, hackers@
MFC after: 1 month


235207 09-May-2012 marius

Use a non-tricky approach for building and installing zfsboot sharing
the Makefile with boot1.

Submitted by: ru


235153 09-May-2012 avg

sys/boot: add common CTASSERT definition


234898 01-May-2012 marius

Add initial support for booting from ZFS on sparc64. At least on Sun Fire
V100, the firmware is known to be broken and not allowing to simultaneously
open disk devices, causing attempts to boot from a mirror or RAIDZ to cause
a crash. This will be worked around later. The firmwares of newer sun4u models
don't seem to exhibit this problem though.

Steps for ZFS booting:

1. create VTOC8 label
# gpart create -s vtoc8 da0

2. add partitions, f.e.:
# gpart add -t freebsd-zfs -s 60g da0
# gpart add -t freebsd-swap da0
resulting in something like:
# gpart show
=> 0 143331930 da0 VTOC8 (68G)
0 125821080 1 freebsd-zfs (60G)
125821080 17510850 2 freebsd-swap (8.4G)

3. create zpool
# zpool create bunker da0a
or for mirror/RAIDZ (after preparing additional disks as in steps 1. + 2.):
# zpool create bunker mirror da0a da1a
# zpool create bunker raidz da0a da1a da2a ...

4. set bootfs
# zpool set bootfs=bunker bunker

5. install zfsboot
# zpool export bunker
# gpart bootcode -p /boot/zfsboot da0

6. write zfsloader to the ZFS Boot Block (so far, there's no dedicated tool
for this, so dd(1) has to be used for this purpose)
When using mirror/RAIDZ, step 4. and the dd(1) invocation should be repeated
for the additional disks in order to be able to boot from another disk in
case of failure.
# sysctl kern.geom.debugflags=0x10
# dd if=/boot/zfsloader of=/dev/da0a bs=512 oseek=1024 conv=notrunc
# zpool import bunker

7. install system on ZFS filesystem
Don't forget to set 'zfs_load="YES"' and vfs.root.mountfrom="zfs:bunker" in
loader.conf as well as 'zfs_enable="YES"'in rc.conf.

8. copy zpool.cache to the ZFS filesystem
cp -p /boot/zfs/zpool.cache /bunker/boot/zfs/zpool.cache

9. set mountpoint
# zfs set mountpoint=/ bunker

10. Now, given that aliases for all disks in the zpool exists (check with
the `devalias` command on the boot monitor prompt) and disk0 corresponds
to da0 (likewise for additional disks), the system can be booted from the
ZFS with:
{1} ok boot disk0

PR: 165025
Submitted by: Gavin Mu


234897 01-May-2012 marius

Add a command for showing the heap usage.

PR: 165025
Submitted by: Gavin Mu
MFC after: 1 week


223719 02-Jul-2011 marius

- For Cheetah- and Zeus-class CPUs don't flush all unlocked entries from
the TLBs in order to get rid of the user mappings but instead traverse
them an flush only the latter like we also do for the Spitfire-class.
Also flushing the unlocked kernel entries can cause instant faults which
when called from within cpu_switch() are handled with the scheduler lock
held which in turn can cause timeouts on the acquisition of the lock by
other CPUs. This was easily seen with a 16-core V890 but occasionally
also happened with 2-way machines.
While at it, move the SPARC64-V support code entirely to zeus.c. This
causes a little bit of duplication but is less confusing than partially
using Cheetah-class bits for these.
- For SPARC64-V ensure that 4-Mbyte page entries are stored in the 1024-
entry, 2-way set associative TLB.
- In {d,i}tlb_get_data_sun4u() turn off the interrupts in order to ensure
that ASI_{D,I}TLB_DATA_ACCESS_REG actually are read twice back-to-back.

Tested by: Peter Jeremy (16-core US-IV), Michael Moll (2-way SPARC64-V)


222472 30-May-2011 julian

Include forgotten framework changes to get some of the new menu files installed correctly on non x86/amd systems.
pointy-hut to devin


222417 28-May-2011 julian

New boot loader menus from Devin Teske.
Discussed on hackers and recommended for inclusion into 9.0 at the devsummit.
All support email to devin dteske at vicor dot ignoreme dot com .

Submitted by: dteske at vicor dot ignoreme dot com
Reviewed by: me and many others


221869 14-May-2011 attilio

Disconnect sun4v architecture from the three.

Some files keep the SUN4V tags as a code reference, for the future,
if any rewamped sun4v support wants to be added again.

Reviewed by: marius
Tested by: sbruno
Approved by: re


220290 03-Apr-2011 marcel

Revert rev 165325. The arch_maphint interface hasn't been in use for
more than 4 years.


214526 29-Oct-2010 marius

Partially revert r203829; as it turns out what the PowerPC OFW loader did
was incorrect as further down the road cons_probe() calls malloc() so the
former can't be called before init_heap() has succeed. Instead just exit
to the firmware in case init_heap() fails like OF_init() does when hitting
a problem as we're then likely running in a very broken environment where
hardly anything can be trusted to work.


212729 16-Sep-2010 marius

Merge from powerpc:
- Change putc_func_t to use a char instead of an int for the character.
- Make functions and variables not used outside of this source file static.
- Remove unused prototypes and variables.
- The OFW read and seek methods take 3 and not 4 input arguments.


208789 03-Jun-2010 ed

Use -Wl,-N instead of the undocumented -N option for GCC.

GCC forwards the -N flag directly to ld. This flag is not documented and
not supported by (for example) Clang. Just use -Wl,-N.

Submitted by: Pawel Worach


207537 02-May-2010 marius

Add support for SPARC64 V (and where it already makes sense for other
HAL/Fujitsu) CPUs. For the most part this consists of fleshing out the
MMU and cache handling, it doesn't add pmap optimizations possible with
these CPU, yet, though.
With these changes FreeBSD runs stable on Fujitsu Siemens PRIMEPOWER 250
and likely also other models based on SPARC64 V like 450, 650 and 850.
Thanks go to Michael Moll for providing access to a PRIMEPOWER 250.


204152 20-Feb-2010 marius

Some machines can not only consist of CPUs running at different speeds
but also of different types, f.e. Sun Fire V890 can be equipped with a
mix of UltraSPARC IV and IV+ CPUs, requiring different MMU initialization
and different workarounds for model specific errata. Therefore move the
CPU implementation number from a global variable to the per-CPU data.
Functions which are called before the latter is available are passed the
implementation number as a parameter now.


203831 13-Feb-2010 marius

Correct the panic strings introduced in r203830 to match their arguments.


203830 13-Feb-2010 marius

Use the SUNW,{d,i}tlb-load methods for entering locked TLB entries like
OpenBSD and OpenSolaris do instead of fiddling with the MMUs ourselves.
Unlike direct access the firmware methods don't automatically use the
next free (?) TLB slot, instead the slot to be used has to be specified.
We allocate the TLB slots for the kernel top-down as OpenSolaris suggests
that the firmware will always allocate the ones for its own use bottom-up.
Besides being simpler, according to OpenBSD using the firmware methods is
required to allow booting on Sun Fire E10K with multi-systemboard domains.


203829 13-Feb-2010 marius

- Assert that HEAPSZ is a multiple of PAGE_SIZE as at least the firmware
of Sun Fire V1280 doesn't round up the size itself but instead lets
claiming of non page-sized amounts of memory fail.
- Change parameters and variables related to the TLB slots to unsigned
which is more appropriate.
- Search the whole OFW device tree instead of only the children of the
root nexus device for the BSP as starting with UltraSPARC IV the 'cpu'
nodes hang off of from 'cmp' (chip multi-threading processor) or 'core'
or combinations thereof. Also in large UltraSPARC III based machines
the 'cpu' nodes hang off of 'ssm' (scalable shared memory) nodes which
group snooping-coherency domains together instead of directly from the
nexus.
- Add support for UltraSPARC IV and IV+ BSPs. Due to the fact that these
are multi-core each CPU has two Fireplane config registers and thus the
module/target ID has to be determined differently so the one specific
to a certain core is used. Similarly, starting with UltraSPARC IV the
individual cores use a different property in the OFW device tree to
indicate the CPU/core ID as it no longer is in coincidence with the
shared slot/socket ID.
While at it additionally distinguish between CPUs with Fireplane and
JBus interconnects as these also use slightly different sizes for the
JBus/agent/module/target IDs.
- Check the return value of init_heap(). This requires moving it after
cons_probe() so we can panic when appropriate. This should be fine as
the PowerPC OFW loader uses that order for quite some time now.


201932 09-Jan-2010 marius

- Add code allowing a network device to only be open and closed once
by keeping it opened after the first open and closing it via the
cleanup handler when NETIF_OPEN_CLOSE_ONCE is defined in order to
avoid the open-close-dance on every file access which with firmware
that for example performs an auto-negotiation on every open causes
netbooting to take horribly long. Basically the behavior with this
knob enabled resembles the one employed between r60506 and r177108
(and for sparc64 also again since r182919) with the addition that
the network device now is closed eventually before entering the
kernel and before rebooting. Actually I think this should be the
desired MI behavior, however the U-Boot loader actually requires
net_close() to be called after every transaction in order for some
local shutdown operations to be performed (and which I think thus
will break on concurrent opens, i.e. when netdev_opens is > 1, like
the loader does at least for disks when LOADER_GZIP_SUPPORT is
enabled).
- Use NETIF_OPEN_CLOSE_ONCE to replace the hack, which artificially
increased netdev_opens for sparc64 in order to keep the network
device opened forever, as at least some firmware versions require
the network device to be closed eventually before entering the
kernel or otherwise will DMA received packets to stale memory.
The powerpc OFW loader probably wants NETIF_OPEN_CLOSE_ONCE to be
set as well for the same reasons.


200946 24-Dec-2009 marius

Execute the cleanup handlers before jumping to the kernel just
like the other architectures do.


200944 24-Dec-2009 marius

Revert r183628 as with the current ata(4) ATAPI DMA with AcerLabs
M5229 appears to be once again fixed. If this happens to return
we probably should disable ATAPI DMA in ataacerlabs(4) instead
just like the Linux libATA does.


191071 14-Apr-2009 marius

Fix masking of TTE bits; the TD_*_MASK macros need shifting via the
corresponding TD_*_SHIFT.

MFC after: 3 days


191012 13-Apr-2009 marius

Fix whitespace.


188895 21-Feb-2009 ru

Fix build when WITH_SSP is set explicitly.

Submitted by: Jeremie Le Hen


188455 10-Feb-2009 marius

- Use the generally more appropriate PROM base rather than the
kernel one as the non-faulting flush address in the loader so
we can can change KERNBASE and VM_MIN_KERNEL_ADDRESS if we
ever want to without needing to worry about using a compatible
loader.
- Correctly check for LOADER_DEBUG.
- Add a missing const for page_sizes[].


183628 05-Oct-2008 marius

Disable ATAPI DMA as it's once again broken in that it causes data
corruption with the on-board AcerLabs M5229 controllers. While at
it, remove the pointless "nothing to autoload yet." message.

MFC after: 3 days


182916 10-Sep-2008 marius

Work around Cheetah+ erratum 34 (USIII+ erratum #10) by relocating
the locked entry in it16 slot 0, which typically is occupied by the
PROM, and manually entering locked entries in slots != 0.

Thanks to Hubert Feyrer for donating the Blade 2000 this change was
developed on.


182877 08-Sep-2008 marius

USIII and beyond CPUs have stricter requirements when it comes
to synchronization needed after stores to internal ASIs in order
to make side-effects visible. This mainly requires the MEMBAR #Sync
after such stores to be replaced with a FLUSH. We use KERNBASE as
the address to FLUSH as it is guaranteed to not trap. Actually,
the USII synchronization rules also already require a FLUSH in
pretty much all of the cases changed.
We're also hitting an additional USIII synchronization rule which
requires stores to AA_IMMU_SFSR to be immediately followed by a DONE,
FLUSH or RETRY. Doing so triggers a RED state exception though so
leave the MEMBAR #Sync. Linux apparently also has gotten away with
doing the same for quite some time now, apart from the fact that
it's not clear to me why we need to clear the valid bit from the
SFSR in the first place.

Reviewed by: nwhitehorn


182766 04-Sep-2008 marius

Ensure interrupts are off while in {d,i}tlb_va_to_pa_sun4u().
I think this is necessary in order to make sure the workarounds
in {d,i}tlb_get_data_sun4u() work correctly.


182478 30-Aug-2008 marius

- Read ASI_{D,I}TLB_DATA_ACCESS_REG twice in order to work around
errata of USIII and beyond (USIII erratum #19, USIII+ erratum #1,
USIIIi erratum #1).
- Use the cheetah PA mask in {d,i}tlb_va_to_pa_sun4u() for USIII
and beyond. This is done so that these functions will still mask
the debug bits of spitfire-class CPUs once we increase TD_PA_BITS
to match the number of bits used for the PA by cheetah-class CPUs.
- Change {d,i}tlb_enter_sun4u() to also set TLB_CTX_KERNEL as the
context of the mappings entered. This is more or less cosmetic as
TLB_CTX_KERNEL is 0.
- Now that we have to distinguish between different sun4u CPUs in
the loader anyway, no longer do trial and error when reading the
portid property.


182020 22-Aug-2008 marius

cosmetic changes and style fixes


181398 07-Aug-2008 marius

- Reimplement {d,i}tlb_enter() and {d,i}tlb_va_to_pa() in C. There's
no particular reason for them to be implemented in assembler and
having them in C allows easier extension as well as using more C
macros and {d,i}tlb_slot_max rather than hard-coding magic (and
actually spitfire-only) values.
- Fix the compilation of pmap_print_tte().
- Change pmap_print_tlb() to use ldxa() rather than re-rolling it
inline as well as TLB_DAR_SLOT and {d,i}tlb_slot_max rather than
hardcoding magic (and actually spitfire-only) values.
- While at it, suffix the above mentioned functions with "_sun4u" to
underline they're architecture-specific.
- Use __FBSDID and macros instead of magic values in locore.S.
- Remove unused includes and smp_stack in locore.S.


180208 03-Jul-2008 peter

Set magic fbsd:nokeywords property that allows files to bypass
keyword expansion. (file-specific replacement for CVSROOT/exclude)


180012 25-Jun-2008 ru

Enable GCC stack protection (aka Propolice) for userland:
- It is opt-out for now so as to give it maximum testing, but it may be
turned opt-in for stable branches depending on the consensus. You
can turn it off with WITHOUT_SSP.
- WITHOUT_SSP was previously used to disable the build of GNU libssp.
It is harmless to steal the knob as SSP symbols have been provided
by libc for a long time, GNU libssp should not have been much used.
- SSP is disabled in a few corners such as system bootstrap programs
(sys/boot), process bootstrap code (rtld, csu) and SSP symbols themselves.
- It should be safe to use -fstack-protector-all to build world, however
libc will be automatically downgraded to -fstack-protector because it
breaks rtld otherwise.
- This option is unavailable on ia64.

Enable GCC stack protection (aka Propolice) for kernel:
- It is opt-out for now so as to give it maximum testing.
- Do not compile your kernel with -fstack-protector-all, it won't work.

Submitted by: Jeremie Le Hen <jeremie@le-hen.org>


170854 17-Jun-2007 marius

- Make better use of the global chosen, memory and mmu handles instead
of obtaining them over and over again and pretending we could do
anything useful without them (for chosen this includes adding a
declaration and initializing it in OF_init()).
- In OF_init() if obtaining the memory or mmu handle fails just call
OF_exit() instead of panic() as the loader hasn't initialized the
console at these early stages yet and trying to print out something
causes a hang. With OF_exit() one at least has a change to get back
to the OFW boot monitor and debug the problem.
- Fix OF_call_method() on 64-bit machines (this is a merge of
sys/dev/ofw/openfirm.c rev 1.6).
- Replace OF_alloc_phys(), OF_claim_virt(), OF_map_phys() and
OF_release_phys() in the MI part of the loader with wrappers around
OF_call_method() in the sparc64. Beside the fact that they duplicate
OF_call_method() the formers should never have been in the MI part
of the loader as contrary to the OFW spec they use two-cell physical
addresses.
- Remove unused functions which are also MD dupes of OF_call_method().
- In sys/boot/sparc64/loader/main.c add __func__ to panic strings as
different functions use otherwise identical panic strings and make
some of the panic strings a tad more user-friendly instead of just
mentioning the name of the function that returned an unexpected
result.


170839 16-Jun-2007 marius

- Remove dupe and unused declarations and prototypes.
- Add missing prototypes.
- Define global variables not used outside of this module as static.
- Replace some outdated hard-coded functions names in panic strings
with __func__.
- Fix some style(9) bugs.


165325 18-Dec-2006 kmacy

add an interface for passing the entire kernel size up front to the
loader so that it can memory can be allocated aligned at the beginning of
the desired large page


164563 23-Nov-2006 kmacy

remove CDDL derive hcall.S


163893 02-Nov-2006 marcel

Don't unconditionally compile-in the bcache code. It's only used on
i386/amd64 and pc98. Remove useless calls to bcache_init() from the
ia64 and sparc64 loaders, as well as from the OFW common code.


163151 09-Oct-2006 kmacy

unbreak sparc64 loader build
re-add accidentally deleted asi value
remove sun4v only header include

Approved by: rwatson (mentor)
Reviewed by: jmg


163145 09-Oct-2006 kmacy

add sun4v support to the sparc64 boot loader

Approved by: rwatson (mentor)
Reviewed by: jmg
Tested by: kris, dwhite, and jmg


156813 17-Mar-2006 ru

Reimplementation of world/kernel build options. For details, see:

http://lists.freebsd.org/pipermail/freebsd-current/2006-March/061725.html

The src.conf(5) manpage is to follow in a few days.

Brought to you by: imp, jhb, kris, phk, ru (all bugs are mine)


150469 22-Sep-2005 ru

Add loader(8) variables for RB_DFLTROOT, RB_MUTE, and RB_PAUSE:
"boot_dfltroot", "boot_mute", and "boot_pause" respectively.


149111 15-Aug-2005 marius

- Change the code that determines whether to use a serial console and
which serial device to use in that case respectively to not rely on
the OFW names of the input/output and stdin/stdout devices. Instead
check whether input and output refers to the same device and is of
type serial (uart(4) was already doing this) and for the fallback
to a serial console in case a keyboard is the selected input device
but unplugged do the same for stdin and stdout in case the input
device is nonexistent (PS/2 and USB keyboards) or has a 'keyboard'
property (RS232 keyboards). Additionally also check whether the OFW
did a fallback to a serial console in the same way in case the
output device is nonexistent. While at it save on some variables
and for sys/boot/sparc64/loader/metadata.c move the code in question
to a new function md_bootserial() so it can be kept in sync with
uart_cpu_getdev_console() more easily.
This fixes selecting a serial console and the appropriate device
when using a device path for the 'input-device' and 'output-device'
OFW environment variables instead of an alias for the serial device
to use or when using a screen alias that additionally denotes a
video mode (like e.g. 'screen:r1024x768x60') but no keyboard is
plugged in (amongst others). It also makes the code select a serial
console in case the OFW did the same due to a misconfiguration like
both 'input-device' and 'output-device' set to 'keyboard' or to a
nonexisting device (whether the OFW does a fallback to a serial
console in case of a misconfiguration or one ends up with just no
console at all highly depends on the OBP version however).
- Reduce the size of buffers that only ever need to hold the string
'serial' accordingly. Double the size of buffers that may need to
hold a device path as e.g. '/pci@8,700000/ebus@5/serial@1,400000:a'
exceeds 32 chars.
- Remove the package handle of the '/options' node from the argument
list of uart_cpu_getdev_dbgport() as it's unused there and future
use is also unlikely.

MFC after: 1 week


139738 05-Jan-2005 imp

Start each of the license/copyright comments with /*-


139123 21-Dec-2004 ru

NOFORTH -> NO_FORTH


139103 21-Dec-2004 ru

Start the dreaded NOFOO -> NO_FOO conversion.

OK'ed by: core


138249 01-Dec-2004 scottl

Remove the last vestiges of the userconfig option. None of this actually
did anything, so this commit should be considered a NO-OP.


134944 08-Sep-2004 kensmith

Back out v1.24. v1.40 of sys/sparc64/sparc64/bus_machdep.c fixes the
problem this hack was put in place for.

MFC to be done if the fix to bus_machdep.c is MFC-ed.


134039 19-Aug-2004 kensmith

Temporary bandaid to help sparc64 systems with ATA disks boot. Recent
changes to the ATA driver cause a kernel crash, no fault of the ATA
code. Work is in progress to add the necessary feature to the sparc64
kernel and this commit will be backed out when it is complete. This
bandaid is being put in mostly in the interests of getting the first
release snapshot done and out the door.

Tested on: Ultra-10 exhibiting the insta-panic.
MFC: Real Soon


133862 16-Aug-2004 marius

Instead of "OpenFirmware", "openfirmware", etc. use the official spelling
"Open Firmware" from IEEE 1275 and OpenFirmware.org (no pun intended).

Ok'ed by: tmm


127826 04-Apr-2004 marcel

To quote the submitter:
"...If "keyboard" is the selected input-device and "screen" the
output-device (both via /options) but the keyboard is unplugged,
OF automatically switches to ttya for the console, it even prints
a line telling so on "screen". Solaris respects this behaviour and
uses ttya as the console in this case and people probably expect
FreeBSD to do the same (it's also very handy to temporarily switch
consoles)..."
"...I changed the comparison of the console device with "ttya" ||
"ttyb" to "tty" because on AXe boards all 4 onboard UARTs end in
SUB-D connectors (ttya and ttyb being 16550 and ttyc and ttyd a
SAB82532) and there's no Sun keyboard connector (but PS/2). If one
plugs a serial card in a box there also can be more than just ttya
and ttyb available for a console..."

Submitted by: Marius Strobl <marius@alchemy.franken.de>
Has no doubt that the change is correct: marcel


125717 11-Feb-2004 ru

_start.S -> _start.s as the latter is pure asm file.

Repocopied by: joe


125674 10-Feb-2004 ru

Since loader(8) on SPARC64 is a pure ELF executable (as opposed
to other architectures), there is no reason not to strip(1) it.

Tested by: kensmith


125622 09-Feb-2004 ru

MFi386.

- Factor out common settings and put them in an upper level Makefile.inc.
- Properly use PROG for real programs, not their products.
- Further reduce diffs to i386 versions.

Tested on: sparc64 (panther)


124139 04-Jan-2004 obrien

Convert to __FBSDID.


122499 11-Nov-2003 jake

Set RB_SERIAL in boothowto if the firmware output-device is ttya or ttyb.
This ensures that uart gets a higher console priority than syscons when
a serial console is being used. Testing against the "console" environment
variable doesn't make sense since we only have one loader console driver.


117448 11-Jul-2003 tmm

NFS support should be conditional on LOADER_NFS_SUPPORT, not
LOADER_NET_SUPPORT.


116415 15-Jun-2003 jake

Remember to release the loader's heap.

Reviewed by: tmm


114386 01-May-2003 peter

Commit a missed change to keep in sync with the MI elf loader.


114338 30-Apr-2003 peter

Also look for an "elf64 kernel" (for sparc64) and "elf32 kernel" (for
powerpc) when building metadata.


113583 16-Apr-2003 phk

Cut&Paste considered far too easy:

Don't include <sys/disklabel.h>


113083 04-Apr-2003 phk

Libdisk does not need to include <sys/diskslice.h> any more.

Move the remaining bits of <sys/diskslice.h> to <i386/include/bootinfo.h>

Move i386/pc98 specific bits from <sys/reboot.h> to
<i386/include/bootinfo.h> as well.

Adjust includes in sys/boot accordingly.


108115 20-Dec-2002 jake

Fix breakage from earlier inadvertant changes.


108100 19-Dec-2002 jake

Renamed the loader's zipfs to gzipfs. zipfs.c was repo-copied to gzipfs.c.


106738 10-Nov-2002 jake

Change the device path representation in libofw to use the full firmware
path, instead of an internal i386 specific one. Don't try to interpret
a disklabel in ofw_disk.c, open the partition's device node directly and
let the firmware do it. This fixes booting from a partition other than 'a'
on sparc64, which is needed to support more installation methods.

No objection: ppc


105427 18-Oct-2002 tmm

Pass the right number of tlb slots to the kernel. The allocation scheme
was changed in r1.4, but I neglected to update most of the code in
metadata.c.

Pointy hat to: tmm


105065 13-Oct-2002 jake

Compile in support for zipfs and bzipfs so we can load the gzipped mfsroot
that releases use.


102829 02-Sep-2002 jake

Remove NOFORTH=yes, it seems to work now thanks to scottl.


102226 21-Aug-2002 robert

- Do not pretend to compile a kernel and remove the definition
of the _KERNEL macro.
- Do not include <sys/pcpu.h> for no reason.

Suggested by: jake


102219 21-Aug-2002 robert

- Define the macro _KERNEL to pretend we are compiling a kernel.
This is required by recent changes to <sys/pcpu.h>, which uses
the #error preprocessor directive to keep non-kernel
applications from using it.
_KERNEL is defined below the #include <stand.h>, because <stand.h>
removes the definition of _KERNEL.
- Move the inclusion of <sys/queue.h> above the inclusion of
<sys/linker.h> to avoid syntax errors.


101287 04-Aug-2002 jake

Print out the strings in vers.o instead of hardcoding the loader banner.


99560 07-Jul-2002 jake

Enable netboot support by default, since it can now coexist with disk and
cdrom support. This avoids having to distribute separate loaders.


99541 07-Jul-2002 jake

Make building with ficl work. Unfortunately booting with it doesn't.


98594 21-Jun-2002 jake

Enable cd9660 support by default.


98472 20-Jun-2002 peter

Add boot_serial and boot_multicons variables to set RB_SERIAL and
RB_MULTIPLE since this seems to be the easiest way to add these flags
for non-forth loaders etc.


97867 05-Jun-2002 phk

Add explicit dependency on ufsread.c


97865 05-Jun-2002 phk

Remove UFS related #includes, they're read in ufsread.c now.


97864 05-Jun-2002 phk

Make sparc64 share ufsread.c with i386.

Sponsored by: DARPA & NAI Labs.


97863 05-Jun-2002 phk

Avoid entering IOCCC with a memcpy turned bcopy.


97510 29-May-2002 jake

Add needed include of queue.h. Remove unneeded include of smp.h.


97445 29-May-2002 jake

Use a contrived 'tlb_entry' structure for passing the mappings for the
kernel text and data from the loader to the kernel, so that the tte format
is not part of the loader->kernel ABI.


97432 28-May-2002 jake

Sync with i386. The loader was being installed before the beforeinstall
target, which conventiently moved it to loader.old, leaving no loader.


96755 16-May-2002 trhodes

More s/file system/filesystem/g


96497 13-May-2002 obrien

Match the default newfs UFS block size.


96428 11-May-2002 jake

Attempt to not crash and burn on UltraSPARC III machines; the cpuid property
is named differently.


96342 10-May-2002 obrien

-ffreestanding is the word.
(also resort some CFLAGS such that the more "important" value are first so
they are easier to see)


95351 24-Apr-2002 jake

Split file system setup code out into a function called mount.
Implement vsnprintf. Implement panic in terms of it.


95346 24-Apr-2002 jake

Add support for loading files other than /boot/loader. Useful if you're
loader is screwed and you want loader.old.
Rewrite the scaled down printf so it actually works right, and add support
for more formats.


95342 24-Apr-2002 jake

Add an exit function.


95341 24-Apr-2002 jake

Add -Wno-unused.


95340 24-Apr-2002 jake

memcpy, memset -> bcopy, bzero.


95339 24-Apr-2002 jake

Clean up elf loading to not make assumptions about the ordering of sections.
Don't load the symbol table; this is only needed for loading kernels and we
load the loader.


95338 24-Apr-2002 jake

Remove xfsread. Just call fsread directly.


95337 24-Apr-2002 jake

Remove a bunch of unused variables, functions and macros. Allocate storage
statically instead of using a faked up malloc.


95172 21-Apr-2002 obrien

o Use our own elf2aout now.
o Generalize a little.


93678 02-Apr-2002 tmm

Do not use semi-fixed TLB slots for the 4M kernel pages any more.


93677 02-Apr-2002 tmm

1.) Rename locore.s to locore.S (by repocopy), to be able to remove
special-case make rule
2.) Cleanups, remove superfluous expicit rules, add -nostdlib to LDFLAGS,
remove -X and -g, remove -g from CFLAGS
3.) Add BINDIR
4.) Build install the loader help file, add an empty help.sparc64
5.) Change the default configuration to only support booting from disk
6.) Get libofw.a from a path relative ${.OBJDIR}, not ${.CURDIR}

Submitted by: jake (1 - 5), obrien (6)


93606 01-Apr-2002 tmm

Add support for booting from CD-ROM. Make it possible to enable UFS
support using make arguments.


93605 01-Apr-2002 tmm

1.) Produce a boot1 disklabel template of the format disklabel(8) expects.
2.) Clean up and change over to using bsd.prog.mk

Submitted by: jake (2)


93313 28-Mar-2002 obrien

was repocopied to ../boot1


93311 28-Mar-2002 obrien

Apparently either gcc or ld, in their infinite wisdom, want to
put a bunch of crap before the code in .text. Since the firmware
doesn't seem to honour the a.out entry point, we need to include
a little assmbler file which jumps to where we want to be in C.

Submitted by: jake


93308 28-Mar-2002 obrien

Opps, bootblock component is no more.


93302 28-Mar-2002 obrien

Add a Makefile for sparc64 at this level.


91696 05-Mar-2002 robert

Change every occurrence of "bootblock" into "boot1" after
the repo-move from "src/sys/boot/sparc64/bootblock".


91678 05-Mar-2002 robert

- Fix seeking for offsets requiring more than 32 bits.
- Add sanity checks to lookup().
- Implement the 'l' modifier in printf().

Submitted by: tmm


91519 01-Mar-2002 jake

Catch up to change in tte format.

Forgetten by: jake
Submitted by: tmm


91295 26-Feb-2002 robert

- Fix indentation and return statements to conform to style(9).
- Use the __FBSDID macro.
- Fix some warnings.

Submitted by: obrien (partly)


91139 23-Feb-2002 jake

Keep track of the ttes used to map the kernel and pass them to it as loader
metadata. Modify tlb handling functions to take a tte, instead of virtual
address, physical address and flags.


91114 23-Feb-2002 jake

Add make variables for fs support and propagate them to CFLAGS. Put
-ffreestanding in CFLAGS. Remove unnecessary LDFLAGS.


91110 23-Feb-2002 jake

Fix fs support ifdefs. Add tftp support. Add physical and virtual
watchpoint support for debugging (under LOADER_DEBUG). Claim the
physical and virtual addresses used to map the kernel from the prom;
we map it ourselves behind the scenes though. Add a reboot command.

Submitted by: tmm


91109 23-Feb-2002 jake

Allocate a frame on our initial stack so that it doesn't run off into
random memory. Disable interrupts while loading the tlb.

Submitted by: tmm


91107 23-Feb-2002 jake

Include <machine/metadata.h>.


90699 15-Feb-2002 robert

Add the FreeBSD/sparc64 bootblock and its make file.


88597 28-Dec-2001 robert

Avoid having the text and data sections merged into one program
header table entry by removing the -N flag from the LDFLAGS.


85720 30-Oct-2001 jake

Add code to copy the enironment and loader metadata into kernel space.


85719 30-Oct-2001 jake

Add definitions for network support, doesn't work yet.
Pass the right arguments to the kernel.
Replace magic numbers with symbolic constants.
Pass the real openfirmware entry point to OF_init.


85718 30-Oct-2001 jake

Use ENTRY() for defining functions in asm.
Remove asm functions to call the openfirmware and kernel entry points;
we can just call them directly.
Don't use the stack pointer for an intermediate result in setx.
Put the stack in the bss.


84997 15-Oct-2001 robert

Fix some warnings.


84996 15-Oct-2001 robert

Add the FreeBSD/sparc64 boot loader source files.


84974 15-Oct-2001 robert

Add a Makefile for the sparc64 boot loader.