Commit Graph

59 Commits

Author SHA1 Message Date
Mark Cave-Ayland
c112720b01 Move the kernel header files into include/kernel to synchronise with the code directory structure.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@689 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-14 14:21:02 +00:00
Blue Swirl
b098842b5b Use firmware configuration instead of NVRAM (initial patch by Aurelien Jarno)
Use firmware configuration device for boot device, kernel, initrd and
kernel command line parameters on PPC, Sparc32 and Sparc64.


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@479 f158a5a8-5612-0410-a976-696ce0be7e32
2009-03-08 09:45:25 +00:00
Blue Swirl
36bab875b8 Refactor QEMU firmware confguration device handling (based on patch by
Aurelien Jarno)


git-svn-id: svn://coreboot.org/openbios/openbios-devel@432 f158a5a8-5612-0410-a976-696ce0be7e32
2009-01-31 08:49:16 +00:00
Blue Swirl
eea3589cb9 Use RAM for SMP init instead of NVRAM
git-svn-id: svn://coreboot.org/openbios/openbios-devel@426 f158a5a8-5612-0410-a976-696ce0be7e32
2009-01-25 12:20:12 +00:00
Blue Swirl
3fae06cd81 Add support for floppy boot on Sparc32
git-svn-id: svn://coreboot.org/openbios/openbios-devel@425 f158a5a8-5612-0410-a976-696ce0be7e32
2009-01-25 09:56:08 +00:00
Blue Swirl
7a00116a9f Add slavioconfig only for SS-4, SS-5 and S3GX
git-svn-id: svn://coreboot.org/openbios/openbios-devel@421 f158a5a8-5612-0410-a976-696ce0be7e32
2009-01-24 07:31:45 +00:00
Blue Swirl
f5f46f28f5 Use aliases for console device selection
git-svn-id: svn://coreboot.org/openbios/openbios-devel@413 f158a5a8-5612-0410-a976-696ce0be7e32
2009-01-17 10:15:13 +00:00
Blue Swirl
95183db81e Fix Sparc32 nographic mode
git-svn-id: svn://coreboot.org/openbios/openbios-devel@412 f158a5a8-5612-0410-a976-696ce0be7e32
2009-01-17 09:55:09 +00:00
Blue Swirl
4f2d4ae6f2 Extract ESCC serial driver
git-svn-id: svn://coreboot.org/openbios/openbios-devel@391 f158a5a8-5612-0410-a976-696ce0be7e32
2009-01-12 17:46:19 +00:00
Blue Swirl
91148c0702 Clean up Sparc32 memory management
Concentrate memory and MMU management (lib.c malloc, romvec opb_, iommu,
OF /memory) to lib.c.



git-svn-id: svn://coreboot.org/openbios/openbios-devel@344 f158a5a8-5612-0410-a976-696ce0be7e32
2009-01-03 13:45:02 +00:00
Blue Swirl
d902f85e2e Fix serial console broken by r317
git-svn-id: svn://coreboot.org/openbios/openbios-devel@323 f158a5a8-5612-0410-a976-696ce0be7e32
2008-12-24 07:12:14 +00:00
Blue Swirl
32591c48f0 Check configuration device version
git-svn-id: svn://coreboot.org/openbios/openbios-devel@319 f158a5a8-5612-0410-a976-696ce0be7e32
2008-12-23 13:38:11 +00:00
Blue Swirl
a7c3b47d20 Clean up configuration device and NVRAM access, add UUID to Sparc32
git-svn-id: svn://coreboot.org/openbios/openbios-devel@318 f158a5a8-5612-0410-a976-696ce0be7e32
2008-12-23 13:14:33 +00:00
Blue Swirl
37cc208996 Move serial console functions to obio.c
git-svn-id: svn://coreboot.org/openbios/openbios-devel@317 f158a5a8-5612-0410-a976-696ce0be7e32
2008-12-23 12:07:07 +00:00
Blue Swirl
c77259ec3a Change uses of sprintf to snprintf
git-svn-id: svn://coreboot.org/openbios/openbios-devel@277 f158a5a8-5612-0410-a976-696ce0be7e32
2008-11-30 13:44:38 +00:00
Blue Swirl
bf0c6b1c38 Fix most warnings from Sparse
git-svn-id: svn://coreboot.org/openbios/openbios-devel@274 f158a5a8-5612-0410-a976-696ce0be7e32
2008-11-30 11:54:01 +00:00
Blue Swirl
c52d26b976 Reduce warnings by 29%
git-svn-id: svn://coreboot.org/openbios/openbios-devel@273 f158a5a8-5612-0410-a976-696ce0be7e32
2008-11-29 19:31:28 +00:00
Laurent Vivier
f4f7644d8c This patch moves all definitions of REGISTER_NAMED_NODE and
REGISTER_NODE_METHODS to openbios/bindings.h.

Signed-off-by: Laurent Vivier <Laurent@lvivier.info>
Acked-by: Stefan Reinauer <stepan@coresystems.de>



git-svn-id: svn://coreboot.org/openbios/openbios-devel@252 f158a5a8-5612-0410-a976-696ce0be7e32
2008-11-24 12:15:08 +00:00
Blue Swirl
b5bb226eed Add more machine types
git-svn-id: svn://coreboot.org/openbios/openbios-devel@240 f158a5a8-5612-0410-a976-696ce0be7e32
2008-09-28 19:55:25 +00:00
Blue Swirl
aee05c163e Use the firmware device introduced in Qemu SVN r5256
git-svn-id: svn://coreboot.org/openbios/openbios-devel@237 f158a5a8-5612-0410-a976-696ce0be7e32
2008-09-18 18:41:26 +00:00
Blue Swirl
5205e45840 Fix some Sparc32 compile warnings
git-svn-id: svn://coreboot.org/openbios/openbios-devel@189 f158a5a8-5612-0410-a976-696ce0be7e32
2008-07-07 18:35:51 +00:00
Blue Swirl
a7bceec408 Fix NetBSD reset problem
git-svn-id: svn://coreboot.org/openbios/openbios-devel@187 f158a5a8-5612-0410-a976-696ce0be7e32
2008-07-05 16:57:17 +00:00
Blue Swirl
b56d6fd8a5 Move AUX1 and AUX2 to correct locations, rename APC
git-svn-id: svn://coreboot.org/openbios/openbios-devel@185 f158a5a8-5612-0410-a976-696ce0be7e32
2008-02-01 19:58:56 +00:00
Blue Swirl
4f53b1dbc2 Add handlers for timer interrupts
git-svn-id: svn://coreboot.org/openbios/openbios-devel@182 f158a5a8-5612-0410-a976-696ce0be7e32
2007-12-25 08:26:21 +00:00
Blue Swirl
4657a8af34 Add support for SPARCstation 20 machine type
git-svn-id: svn://coreboot.org/openbios/openbios-devel@181 f158a5a8-5612-0410-a976-696ce0be7e32
2007-12-10 20:06:58 +00:00
Blue Swirl
2a5207fe7e Add support for eccmemctl
git-svn-id: svn://coreboot.org/openbios/openbios-devel@180 f158a5a8-5612-0410-a976-696ce0be7e32
2007-12-09 17:04:51 +00:00
Blue Swirl
e1785b5d8d Improved Module ID generation
git-svn-id: svn://coreboot.org/openbios/openbios-devel@179 f158a5a8-5612-0410-a976-696ce0be7e32
2007-11-19 19:11:38 +00:00
Blue Swirl
4b56483e61 Remove unused variable
git-svn-id: svn://coreboot.org/openbios/openbios-devel@178 f158a5a8-5612-0410-a976-696ce0be7e32
2007-11-17 19:00:58 +00:00
Blue Swirl
1f76ff66bd Reset fixes:
* recalculate CRC to avoid error message and halt after reset
 * fix bug that crashed SS10/SMP when reset


git-svn-id: svn://coreboot.org/openbios/openbios-devel@177 f158a5a8-5612-0410-a976-696ce0be7e32
2007-11-17 18:56:43 +00:00
Blue Swirl
a4340199fb Update OHW interface to version 3.
Use common ABI description file with Qemu for both Sparc32 and Sparc64.
Remove private definitions and magic constants.


git-svn-id: svn://coreboot.org/openbios/openbios-devel@176 f158a5a8-5612-0410-a976-696ce0be7e32
2007-11-14 19:25:43 +00:00
Blue Swirl
65dca7dd37 Add SPARCserver 600MP emulation
git-svn-id: svn://coreboot.org/openbios/openbios-devel@175 f158a5a8-5612-0410-a976-696ce0be7e32
2007-11-11 18:02:11 +00:00
Blue Swirl
e3994059c1 More CPU definitions
git-svn-id: svn://coreboot.org/openbios/openbios-devel@173 f158a5a8-5612-0410-a976-696ce0be7e32
2007-11-09 20:40:09 +00:00
Blue Swirl
4ab9d3902c Enable all interrupt sources for NetBSD
git-svn-id: svn://coreboot.org/openbios/openbios-devel@168 f158a5a8-5612-0410-a976-696ce0be7e32
2007-08-05 18:01:20 +00:00
Blue Swirl
bca00a2c33 Fix mapping of a single byte area, fix reset and poweroff
git-svn-id: svn://coreboot.org/openbios/openbios-devel@166 f158a5a8-5612-0410-a976-696ce0be7e32
2007-07-20 11:23:30 +00:00
Blue Swirl
e3db406e09 Fix pop_fstr_copy memory leaks
- console one prevented Debian 3.1r1 from installing in console=prom mode
- fixing this also needed the real malloc/free



git-svn-id: svn://coreboot.org/openbios/openbios-devel@155 f158a5a8-5612-0410-a976-696ce0be7e32
2007-06-27 20:16:01 +00:00
Blue Swirl
f4151ed546 Try to fix system reset for SMP and SS-10 cases
git-svn-id: svn://coreboot.org/openbios/openbios-devel@150 f158a5a8-5612-0410-a976-696ce0be7e32
2007-05-27 19:49:35 +00:00
Blue Swirl
21fb003090 Use full 36-bit physical address space on SS10
git-svn-id: svn://coreboot.org/openbios/openbios-devel@149 f158a5a8-5612-0410-a976-696ce0be7e32
2007-05-19 12:55:01 +00:00
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
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
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
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
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
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
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
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
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
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