Commit Graph

45 Commits

Author SHA1 Message Date
Marius Strobl
4f607e8ef2 - 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.
2010-02-13 14:13:39 +00:00
Marius Strobl
005ad6daf8 Execute the cleanup handlers before jumping to the kernel just
like the other architectures do.
2009-12-24 15:23:51 +00:00
Marius Strobl
4794ebf3b9 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.
2009-12-24 15:14:35 +00:00
Marius Strobl
24b847f1f0 Fix masking of TTE bits; the TD_*_MASK macros need shifting via the
corresponding TD_*_SHIFT.

MFC after:	3 days
2009-04-14 19:02:34 +00:00
Marius Strobl
b7f089e9f1 Fix whitespace. 2009-04-13 19:43:37 +00:00
Marius Strobl
ceab1bee37 - 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[].
2009-02-10 21:48:42 +00:00
Marius Strobl
5e9ebf8b21 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
2008-10-05 14:00:44 +00:00
Marius Strobl
d8f4dd34d6 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.
2008-09-10 20:07:08 +00:00
Marius Strobl
2611aba180 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
2008-09-08 20:38:48 +00:00
Marius Strobl
5aa6f9f392 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.
2008-09-04 19:41:54 +00:00
Marius Strobl
20e6aaf533 - 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.
2008-08-30 16:03:22 +00:00
Marius Strobl
898112a7dc cosmetic changes and style fixes 2008-08-22 20:28:19 +00:00
Marius Strobl
0b1bfc4986 - 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.
2008-08-07 22:46:25 +00:00
Marius Strobl
aa785996fd - 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.
2007-06-17 00:17:15 +00:00
Marius Strobl
555f163cd2 - 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.
2007-06-16 21:46:15 +00:00
Kip Macy
2d74924b65 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
2006-12-18 07:35:14 +00:00
Marcel Moolenaar
5cae408f81 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.
2006-11-02 00:26:45 +00:00
Kip Macy
a9928b2f58 unbreak sparc64 loader build
re-add accidentally deleted asi value
remove sun4v only header include

Approved by: rwatson (mentor)
Reviewed by: jmg
2006-10-09 05:59:04 +00:00
Kip Macy
0209c79363 add sun4v support to the sparc64 boot loader
Approved by: rwatson (mentor)
Reviewed by: jmg
Tested by: kris, dwhite, and jmg
2006-10-09 04:43:07 +00:00
Warner Losh
6a0fd84b50 Start each of the license/copyright comments with /*- 2005-01-05 22:16:58 +00:00
Ken Smith
a6406834da 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.
2004-09-08 12:52:45 +00:00
Ken Smith
7a4cf071fc 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
2004-08-19 20:13:31 +00:00
Marius Strobl
39513fa664 Instead of "OpenFirmware", "openfirmware", etc. use the official spelling
"Open Firmware" from IEEE 1275 and OpenFirmware.org (no pun intended).

Ok'ed by:	tmm
2004-08-16 15:45:27 +00:00
David E. O'Brien
bd506e2a3a Convert to __FBSDID. 2004-01-04 23:21:18 +00:00
Thomas Moestl
07a41f740a NFS support should be conditional on LOADER_NFS_SUPPORT, not
LOADER_NET_SUPPORT.
2003-07-11 16:12:50 +00:00
Jake Burkholder
caa4756af5 Remember to release the loader's heap.
Reviewed by:	tmm
2003-06-15 19:16:43 +00:00
Peter Wemm
ec4eecb60b Commit a missed change to keep in sync with the MI elf loader. 2003-05-01 04:39:22 +00:00
Jake Burkholder
7c6c018c0c Renamed the loader's zipfs to gzipfs. zipfs.c was repo-copied to gzipfs.c. 2002-12-19 19:34:59 +00:00
Jake Burkholder
de0acbf78f 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
2002-11-10 19:17:36 +00:00
Jake Burkholder
38013bd368 Compile in support for zipfs and bzipfs so we can load the gzipped mfsroot
that releases use.
2002-10-13 18:52:46 +00:00
Robert Drehmel
9884a53c1a - 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
2002-08-21 15:52:23 +00:00
Robert Drehmel
09bb4b96a4 - 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.
2002-08-21 12:45:36 +00:00
Jake Burkholder
7746cd480a Print out the strings in vers.o instead of hardcoding the loader banner. 2002-08-04 01:30:26 +00:00
Jake Burkholder
8c7b34b8a3 Add needed include of queue.h. Remove unneeded include of smp.h. 2002-05-29 19:38:49 +00:00
Jake Burkholder
35738638d6 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.
2002-05-29 05:49:59 +00:00
Tom Rhodes
d394511de3 More s/file system/filesystem/g 2002-05-16 21:28:32 +00:00
Jake Burkholder
6cc8d3ac6b Attempt to not crash and burn on UltraSPARC III machines; the cpuid property
is named differently.
2002-05-11 22:05:22 +00:00
Thomas Moestl
bc3c153560 Do not use semi-fixed TLB slots for the 4M kernel pages any more. 2002-04-02 17:10:15 +00:00
Thomas Moestl
ad68ab89e2 Add support for booting from CD-ROM. Make it possible to enable UFS
support using make arguments.
2002-04-01 23:28:35 +00:00
Jake Burkholder
dd4af53607 Catch up to change in tte format.
Forgetten by:	jake
Submitted by:	tmm
2002-03-01 06:17:28 +00:00
Jake Burkholder
4aaca88542 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.
2002-02-23 11:06:37 +00:00
Jake Burkholder
d112f7bd5b 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
2002-02-23 04:04:30 +00:00
Jake Burkholder
a237ed036e 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.
2001-10-30 06:31:45 +00:00
Robert Drehmel
8414482077 Fix some warnings. 2001-10-15 14:40:36 +00:00
Robert Drehmel
2727d8ffc8 Add the FreeBSD/sparc64 boot loader source files. 2001-10-15 14:35:39 +00:00