Commit Graph

112 Commits

Author SHA1 Message Date
Blue Swirl
47d86bb2cb NetBSD and OpenBSD fixes:
- Correct timer and interrupt controller mappings
 - Add ESP clock frequency to avoid division by zero
 - CS4231 exists only in SS5
 - Disable BPP for now, it's not emulated by Qemu anyway
With these fixes, one NetBSD kernel even got to root device prompt on SS5.


git-svn-id: svn://coreboot.org/openbios/openbios-devel@147 f158a5a8-5612-0410-a976-696ce0be7e32
2007-05-17 19:16:06 +00:00
Blue Swirl
c5beeefb90 Fix overallocation
git-svn-id: svn://coreboot.org/openbios/openbios-devel@146 f158a5a8-5612-0410-a976-696ce0be7e32
2007-05-17 19:07:21 +00:00
Blue Swirl
788d096f65 Fix power-management location for SS-10
git-svn-id: svn://coreboot.org/openbios/openbios-devel@145 f158a5a8-5612-0410-a976-696ce0be7e32
2007-05-07 20:02:01 +00:00
Blue Swirl
75a471e6c5 Fix power-management location
git-svn-id: svn://coreboot.org/openbios/openbios-devel@144 f158a5a8-5612-0410-a976-696ce0be7e32
2007-05-07 17:21:15 +00:00
Blue Swirl
e774472da7 Fix out of bounds accesses
git-svn-id: svn://coreboot.org/openbios/openbios-devel@143 f158a5a8-5612-0410-a976-696ce0be7e32
2007-05-06 17:29:58 +00:00
Blue Swirl
674ab21bdc Increase virtual memory supply to meet NetBSD and OpenBSD demand
git-svn-id: svn://coreboot.org/openbios/openbios-devel@142 f158a5a8-5612-0410-a976-696ce0be7e32
2007-05-05 18:35:34 +00:00
Blue Swirl
1a7a2e3c15 More obviously alarming return values for find_pte
git-svn-id: svn://coreboot.org/openbios/openbios-devel@141 f158a5a8-5612-0410-a976-696ce0be7e32
2007-05-05 18:34:01 +00:00
Blue Swirl
9eb7f86202 Fix unaligned memory access
git-svn-id: svn://coreboot.org/openbios/openbios-devel@140 f158a5a8-5612-0410-a976-696ce0be7e32
2007-05-05 18:32:35 +00:00
Blue Swirl
c76de95466 Fix memory corruption problems reported by glibc
git-svn-id: svn://coreboot.org/openbios/openbios-devel@139 f158a5a8-5612-0410-a976-696ce0be7e32
2007-05-05 10:03:56 +00:00
Blue Swirl
c4f3fbc099 Fix boot-device use
git-svn-id: svn://coreboot.org/openbios/openbios-devel@138 f158a5a8-5612-0410-a976-696ce0be7e32
2007-05-04 20:55:05 +00:00
Blue Swirl
2b99ad760f Use nvram boot-args and boot-device variables
git-svn-id: svn://coreboot.org/openbios/openbios-devel@137 f158a5a8-5612-0410-a976-696ce0be7e32
2007-05-01 14:14:17 +00:00
Blue Swirl
c4633488e8 Set variable defaults before nvram_init
git-svn-id: svn://coreboot.org/openbios/openbios-devel@136 f158a5a8-5612-0410-a976-696ce0be7e32
2007-05-01 14:12:34 +00:00
Blue Swirl
320db5725b Improve escape sequence handling
git-svn-id: svn://coreboot.org/openbios/openbios-devel@135 f158a5a8-5612-0410-a976-696ce0be7e32
2007-04-30 19:08:37 +00:00
Blue Swirl
fd4256fc89 Fix nvram parameter area
git-svn-id: svn://coreboot.org/openbios/openbios-devel@134 f158a5a8-5612-0410-a976-696ce0be7e32
2007-04-29 19:57:01 +00:00
Blue Swirl
44b2163f4b More Sparc32 CPUs
git-svn-id: svn://coreboot.org/openbios/openbios-devel@133 f158a5a8-5612-0410-a976-696ce0be7e32
2007-04-29 19:55:08 +00:00
Blue Swirl
9bcf7edf3d Clear preloaded kernel parameters to avoid crash at reset
git-svn-id: svn://coreboot.org/openbios/openbios-devel@132 f158a5a8-5612-0410-a976-696ce0be7e32
2007-04-29 19:50:57 +00:00
Blue Swirl
9ebb76df0f Add memory mapping functions needed by NetBSD
git-svn-id: svn://coreboot.org/openbios/openbios-devel@131 f158a5a8-5612-0410-a976-696ce0be7e32
2007-04-26 17:15:45 +00:00
Blue Swirl
c84fe3b819 CPU specific properties
git-svn-id: svn://coreboot.org/openbios/openbios-devel@130 f158a5a8-5612-0410-a976-696ce0be7e32
2007-04-25 19:57:23 +00:00
Blue Swirl
0e4a65dbb9 Fix broken compilation when debugging enabled
git-svn-id: svn://coreboot.org/openbios/openbios-devel@129 f158a5a8-5612-0410-a976-696ce0be7e32
2007-04-24 20:00:02 +00:00
Blue Swirl
8b8db9a6ac Re-enable interpose
git-svn-id: svn://coreboot.org/openbios/openbios-devel@128 f158a5a8-5612-0410-a976-696ce0be7e32
2007-04-24 19:44:35 +00:00
Stefan Reinauer
247c616971 Fix for interpose problem.
git-svn-id: svn://coreboot.org/openbios/openbios-devel@127 f158a5a8-5612-0410-a976-696ce0be7e32
2007-04-24 19:19:58 +00:00
Blue Swirl
a389f6e924 TCX 24 bit model support
git-svn-id: svn://coreboot.org/openbios/openbios-devel@126 f158a5a8-5612-0410-a976-696ce0be7e32
2007-04-21 19:47:16 +00:00
Blue Swirl
7baa8329a3 Fix exception number in crash output
git-svn-id: svn://coreboot.org/openbios/openbios-devel@125 f158a5a8-5612-0410-a976-696ce0be7e32
2007-04-16 16:52:52 +00:00
Blue Swirl
e3c69b17ee Linkage fix to reduce Sparc64 image size by 1M
git-svn-id: svn://coreboot.org/openbios/openbios-devel@124 f158a5a8-5612-0410-a976-696ce0be7e32
2007-04-16 16:47:42 +00:00
Blue Swirl
057ad34bea Fix Sparc32 properties with wrong encoding
git-svn-id: svn://coreboot.org/openbios/openbios-devel@123 f158a5a8-5612-0410-a976-696ce0be7e32
2007-04-15 05:46:25 +00:00
Stefan Reinauer
dfd35a78c0 Patch from Aurelien Jarno <aurelien@aurel32.net>:
The current SVN version currently fails to work on machines that have
strict alignment requirements, for example the SPARC target. This is due
to the way the struct fat_bpb in fs/grubfs/fat.h is defined and accessed
(through FAT_CVT_U16) to avoid padding. Some 16 bits fields like
bytes_per_sect are thus accessed unaligned.

The patch below takes the same approach as for other structures in
openbios, it declares the structure as packed, and lets GCC do the right
things to access those unaligned field.



git-svn-id: svn://coreboot.org/openbios/openbios-devel@122 f158a5a8-5612-0410-a976-696ce0be7e32
2007-04-15 00:41:40 +00:00
Blue Swirl
20b56f4784 Fix Sparc64 stack offset
git-svn-id: svn://coreboot.org/openbios/openbios-devel@121 f158a5a8-5612-0410-a976-696ce0be7e32
2007-04-14 19:48:59 +00:00
Stefan Reinauer
d06b24d10f SS10 support by blueswirl
git-svn-id: svn://coreboot.org/openbios/openbios-devel@120 f158a5a8-5612-0410-a976-696ce0be7e32
2007-04-09 12:35:41 +00:00
Stefan Reinauer
1ebb8a3b50 fix from blueswirl
git-svn-id: svn://coreboot.org/openbios/openbios-devel@119 f158a5a8-5612-0410-a976-696ce0be7e32
2007-04-09 12:19:41 +00:00
Stefan Reinauer
ddf17efa6e fixes for xslt sheets from Mike Hommey <mh@glandium.org>,
reported by Alex Owen <r.alex.owen@gmail.com>


git-svn-id: svn://coreboot.org/openbios/openbios-devel@118 f158a5a8-5612-0410-a976-696ce0be7e32
2007-04-09 12:17:51 +00:00
Stefan Reinauer
0abfddd441 boot fix from blueswirl.
git-svn-id: svn://coreboot.org/openbios/openbios-devel@117 f158a5a8-5612-0410-a976-696ce0be7e32
2007-04-07 09:37:28 +00:00
Stefan Reinauer
99d535e4a3 small fix for width detection
git-svn-id: svn://coreboot.org/openbios/openbios-devel@116 f158a5a8-5612-0410-a976-696ce0be7e32
2007-03-23 17:00:01 +00:00
Stefan Reinauer
aac2f06b44 Patch for SunOS compatibility from pjcreath+openbios@gmail.com:
I've been trying to get old versions of SunOS to load under qemu.  In
doing so, I've encountered a number of bugs in OBP.  I'm not always
certain of the best fix, but I can at least provide a quick hack that
will get people farther along.


1) Error message: "kmem_alloc failed, nbytes 680"

Bug: obp_dumb_memalloc is a bit too dumb.  It needs to pick an address
if passed a null address.  (According to the comment in the allocator
in OpenSolaris prom_alloc.c (see
<http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/psm/promif/ieee1275/sun4/prom_alloc.c>),
"If virthint is zero, a suitable virt is chosen.")

Quick fix: If passed a null address, start doling out addresses at
10MB and increment by size.

Shortcomings: The quick fix ignores the issue of free() and doesn't
remove memory from the virtual-memory/available node.

After the quick fix, the boot gets farther, leading us to:


2) Error message: "Unhandled Exception 0x00000080"

Bug: Trap 0 (entry 0x80 in the table, i.e. syscall_trap_4x) is
undefined.  This is because the SunOS bootloader installs the trap by
writing code in the trap table, but the trap table is in the .text
section of OpenBIOS.  Thus the trap 0 handler simply jumps to "bug".

Quick fix: Move the trap table  to the .data section.  Insert a "b
entry; nop; nop; nop;" before "bug:".

Shortcomings: Requires the extra "b entry" code.  Allows the only VM
copy of the trap table to be permanently changed.  OpenBIOS should
copy the read-only trap table to read-write memory (and update %tbr)
upon reset/entry.


3) #2 above actually exposes another bug.  The write to the read-only
trap table does not cause an access violation -- instead, it silently
fails.  The "std" instruction at 0x403e6c in the bootloader has no
effect.

Bug: Uncertain.  It could be a systemic bug in qemu, but it appears
that the VM's MMU believes that the page is writable.  That means that
the VM's MMU is not having the access protection flags set for pages
mapped to ROM.  It thinks everything is rwx.

Fix?: The VM's MMU should have the access protection flags properly
set for each ROM section.  This should probably be done within
OpenBIOS.  E.g., .text should be r-x, .data should probably be rwx,
etc.

This is the one fix I'm really not sure how to implement.  Any
suggestions?  This may be a problem that only affects this bootloader,
so fixing #2 above may be all that's strictly necessary.  But I'm not
positive that this bug doesn't have other ill effects I haven't found
yet.

At any rate, fixing #2 gets us still further, to:


4) Error messages:
"obp_devopen(sd(0,0,0):d) = 0xffd8e270
obp_inst2pkg(fd 0xffd8e270) = 0xffd57f44
obp_getprop(0xffd57f44, device_type) (not found)"

Bug: The OpenBIOS "interpose" implementation is not transparent to
non-interposition-aware code (in violation of the interposition spec).
 The inst2pkg call in this sequence returns the phandle for
/packages/misc-files, instead of the proper phandle.

Quick fix: Comment out the "interpose disk-label" lines in ob_sd_open.

Shortcomings: It disables disk-label.  The correct fix is to fix the
underlying problem with interposition, but I'm not sure exactly what
it is.  Could someone help?


Fixing #4 gets us quite a bit further, until:


5) Error message:
"Unhandled Exception 0x00000009
PC = 0xf0138b20 NPC = 0xf0138b24
Stopping execution"

Bug: The instruction is trying to read from 0xfd020000+4, which is an
invalid address.  This address isn't mapped by OBP by default on Sun
hardware, so the bootloader must be trying to (a) map this address and
failing silently or (b) skipping the mapping for some reason.  The
instruction is hard-coded to look at this absolute address.

Fix: Unknown.  This may be another instance of writes silently
failing, hence my interest in #3 above.  It could also be a
side-effect of the quick fix for #4.

6) Error message:
"BAD TRAP: cpu=0 type=9 rp=fd008f0c addr=feff8008 mmu_fsr=3a6 rw=2
MMU sfsr=3a6: Invalid Address on supv data store at level 3
regs at fd008f0c:
psr=4400fc7 pc=f00053f4 npc=f00053f8
..."

Bug: Real sun4m hardware registers 4 CPU-specific interrupts followed
by a system-wide interrupt, regardless of the number of CPUs
installed.  The same is true of counters.  SunOS looks at the 5th
interrupt for the system-wide interrupt.  OBP, since there's only one
CPU, just sets up one CPU-specific interrupt followed by the
system-wide interrupt, so there is no 5th interrupt.  See the comment
on "NCPU" at
<http://stuff.mit.edu/afs/athena/astaff/project/opssrc/sys.sunos/sun4m/devaddr.h>.

Fix: in obp_interrupt_init() and obp_counter_init() register 4
CPU-specific interrupts before allocating the system-wide interrupt.
The kernel will then map the 5th interrupt to the system-wide
interrupt.

7) Error message:
"BAD TRAP: cpu=0 type=9 rp=fd008d8c addr=7ff000 mmu_fsr=126 rw=1
MMU sfsr=126: Invalid Address on supv data fetch at level 1
regs at fd008d8c:
psr=4000cc4 pc=f01339a4 npc=f01339a8
..."

Bug: The command-line arguments passed to the kernel are fixed at
address 0x7FF000 (CMDLINE_ADDR, passed from qemu via nv_info.cmdline),
which is no longer mapped by the time the kernel looks at the boot
arguments.  A regular Sun boot ROM will copy this into mapped memory.

Fix: Copy the string in nv_info.cmdline to a OpenBIOS global (since
OpenBIOS continues to be mapped) in ob_nvram_init().


8) Error message:
"BAD TRAP: cpu=0 type=9 rp=fd008dec addr=1019000 mmu_fsr=126 rw=1
MMU sfsr=126: Invalid Address on supv data fetch at level 1
regs at fd008dec:
psr=4400cc5 pc=f0131680 npc=f0131684
..."

Bug: The dumb memory allocator from bug #1 was allocating a range that
the SunOS 4 kernel doesn't like.

Fix: Mimic the Sun boot ROM allocator:  the top of the heap should be
a 0xFFEDA000 and allocations should return descending addresses.  So,
for example, if asking for 0x1000 bytes, the first returned pointer
should be 0xFFED9000.

9) Error message:
"BAD TRAP: cpu=0 type=9 rp=fd008d2c addr=b1b91000 mmu_fsr=126 rw=1
MMU sfsr=126: Invalid Address on supv data fetch at level 1
regs at fd008d2c:
psr=4900cc3 pc=f0142c04 npc=f0142c08
..."

Bug: The precise underlying cause isn't clear.  The bug appears due to
a variation between OBP's behavior and stock Sun behavior.

Fix: Add the "cache-physical?" property to the CPU node in
ob_nvram_init() and bump the "mmu-nctx" property up to 4096 (from
256).





git-svn-id: svn://coreboot.org/openbios/openbios-devel@114 f158a5a8-5612-0410-a976-696ce0be7e32
2007-03-09 00:59:05 +00:00
Stefan Reinauer
9be00e6061 From Paul Brook <paul@codesourcery.com>
The current esp code will perform partial reads on devices with sector sizes 
> 512. The attached patch makes it read the whole sector from the device, and
uses the additional if multiple blocks are requested.

I'm not sure if the old behavior is technically wrong, but it confused me when
debugging the qemu device emulation :-)

Paul



git-svn-id: svn://coreboot.org/openbios/openbios-devel@87 f158a5a8-5612-0410-a976-696ce0be7e32
2006-10-10 17:43:11 +00:00
Stefan Reinauer
d98f56098d power management patch from blueswirl
git-svn-id: svn://coreboot.org/openbios/openbios-devel@86 f158a5a8-5612-0410-a976-696ce0be7e32
2006-09-20 20:12:04 +00:00
Stefan Reinauer
74666ba799 int-fixes part II
git-svn-id: svn://coreboot.org/openbios/openbios-devel@85 f158a5a8-5612-0410-a976-696ce0be7e32
2006-09-14 16:29:48 +00:00
Stefan Reinauer
8dafee5941 Blueswirl's serial patch
git-svn-id: svn://coreboot.org/openbios/openbios-devel@84 f158a5a8-5612-0410-a976-696ce0be7e32
2006-09-14 15:08:45 +00:00
Stefan Reinauer
1a34b8a360 64bit fixes from blueswirl
git-svn-id: svn://coreboot.org/openbios/openbios-devel@83 f158a5a8-5612-0410-a976-696ce0be7e32
2006-09-14 15:06:38 +00:00
Blue Swirl
84c8ff3704 From: Blue Swirl <blueswir1@hotmail.com>
This patch fixes SMP booting:
Entering SMP Mode...
Starting CPU 1 at f01e46e4
Calibrating delay loop... 180.63 BogoMIPS
Starting CPU 2 at f01e46f0
Calibrating delay loop... 181.86 BogoMIPS
Starting CPU 3 at f01e46fc
Calibrating delay loop... 182.68 BogoMIPS
Total of 4 Processors activated (721.71 BogoMIPS).

Though depending on version Linux usually hangs later.



git-svn-id: svn://coreboot.org/openbios/openbios-devel@82 f158a5a8-5612-0410-a976-696ce0be7e32
2006-09-05 19:46:20 +00:00
Stefan Reinauer
f2e16903cd mark devbios officially obsolete.
git-svn-id: svn://coreboot.org/openbios/openbios-devel@81 f158a5a8-5612-0410-a976-696ce0be7e32
2006-09-05 19:44:40 +00:00
Stefan Reinauer
947d04854c * remove toke, detok and romheaders and add reference to
svn://openbios.org/openbios/fcode-utils where they are located now.

* drop fccc



git-svn-id: svn://coreboot.org/openbios/openbios-devel@80 f158a5a8-5612-0410-a976-696ce0be7e32
2006-09-05 19:37:13 +00:00
Stefan Reinauer
6b2c88cf60 Fix booting without CD in drive.
git-svn-id: svn://coreboot.org/openbios/openbios-devel@79 f158a5a8-5612-0410-a976-696ce0be7e32
2006-08-20 15:59:02 +00:00
Stefan Reinauer
8be21e0d3a From Paul Brook:
The ESP SCSI driver currently doesn't check whether a DMA requests has
completed before checking its status. On older qemu versions this
works ok because DMA happens instantly. On never qemu DMA can take an
indeterminate amount of time ooto complete, just like on real
hardware.

The patch waits for the controller to raise the DMA interrupt after
initiating a DMA request.



git-svn-id: svn://coreboot.org/openbios/openbios-devel@73 f158a5a8-5612-0410-a976-696ce0be7e32
2006-08-12 09:52:34 +00:00
Stefan Reinauer
83a3c5d996 blueswirl's latest console patches.
git-svn-id: svn://coreboot.org/openbios/openbios-devel@72 f158a5a8-5612-0410-a976-696ce0be7e32
2006-07-28 21:44:07 +00:00
Stefan Reinauer
0726cb7dd7 blueswirl's latest console-nographic.diff.bz2
git-svn-id: svn://coreboot.org/openbios/openbios-devel@71 f158a5a8-5612-0410-a976-696ce0be7e32
2006-07-23 14:29:29 +00:00
Stefan Reinauer
cc29864b60 workaround for wrong viewvc permissions, Makefile bugfixes
git-svn-id: svn://coreboot.org/openbios/openbios-devel@70 f158a5a8-5612-0410-a976-696ce0be7e32
2006-07-23 14:22:39 +00:00
Stefan Reinauer
7c2a631397 VGA for Sparc64
Added 8x16 font, low-level VGA register programming and mode switching
functions from LinuxBIOS.

Fixed incorrect VGA_BASE.



git-svn-id: svn://coreboot.org/openbios/openbios-devel@69 f158a5a8-5612-0410-a976-696ce0be7e32
2006-07-18 21:48:00 +00:00
Stefan Reinauer
e492087dbe 64-bit fixes
General 64-bit fixes and a hack for x86 to Sparc64 crosscompiling problem,
where x86 misses 128-bit types.



git-svn-id: svn://coreboot.org/openbios/openbios-devel@68 f158a5a8-5612-0410-a976-696ce0be7e32
2006-07-18 21:42:16 +00:00
Stefan Reinauer
b03ab3d3ae - Cleanup compiler warnings etc.
- add crosscflags from previous patch ;)


git-svn-id: svn://coreboot.org/openbios/openbios-devel@67 f158a5a8-5612-0410-a976-696ce0be7e32
2006-07-18 21:38:42 +00:00
Stefan Reinauer
b623837257 Automatic cross-compiler flags
Detect cross-compiling flags (CROSSCFLAGS) automatically based on endian
and word size differences.



git-svn-id: svn://coreboot.org/openbios/openbios-devel@66 f158a5a8-5612-0410-a976-696ce0be7e32
2006-07-18 21:35:55 +00:00