The existing routines hard-coded the initial values into the device tree at startup, and then didn't update them which could
allow the romvec memory lists and the device tree memory properties to become out of sync.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@925 f158a5a8-5612-0410-a976-696ce0be7e32
The existing code appeared to be allocating memory from the wrong property (map rather than avail) and so rather than allocating
memory starting from just below the OpenBIOS image downwards, it was simply reducing the reported size of the OpenBIOS image.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@923 f158a5a8-5612-0410-a976-696ce0be7e32
On ppc64, cell size is 32 bits but pointers are 64-bit.
Thus, direct casts result in warnings, treated as errors.
Use [u]intptr_t cast or cell2pointer and pointer2cell macros as necessary.
v2:
* Drop changes related to physical addresses since physical addresses may be
wider than pointers (e.g., 36 bits on sparc32, as pointed out by Blue).
* Drop changes to cell2pointer() and pointer2cell() for now.
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@922 f158a5a8-5612-0410-a976-696ce0be7e32
size on SPARC32 to help Solaris 8 boot.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@919 f158a5a8-5612-0410-a976-696ce0be7e32
This appears to resolve issues with OpenBIOS crashing when calling OBP functions through the romvec interface due to
stack/register issues. Note that this patch also implements pv_printf() and pv_putstr() which appears to fix issues with
displaying error messages during Solaris 8 boot.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@918 f158a5a8-5612-0410-a976-696ce0be7e32
The extra stack arguments are actually placed within %o1-%o5 but unfortunately there doesn't seem to be a way of passing the
number of parameters using the romvec API. Hence we go through the argument list and start pushing arguments onto the Forth
stack from the first non-zero argument before executing the Forth string.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@915 f158a5a8-5612-0410-a976-696ce0be7e32
RTAS had to be enabled via EXTRACFLAGS=-DUSE_RTAS.
Use the config file instead.
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@909 f158a5a8-5612-0410-a976-696ce0be7e32
The client stack was set up 96 * 64 KiB below the hash table.
Should be 96 KiB instead.
v2:
* Initial.
Cc: Alexander Graf <agraf@suse.de>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@908 f158a5a8-5612-0410-a976-696ce0be7e32
The exception stack was always set up 64 KiB below the ROM,
ignoring hash table alignment.
Align the stack pointer appropriately.
v2:
* Drop buggy distinction based on PVR value since the previous patch
unifies alignment. Suggested by Segher Boessenkool.
Cc: Alexander Graf <agraf@suse.de>
Cc: Segher Boessenkool <segher@kernel.crashing.org>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@907 f158a5a8-5612-0410-a976-696ce0be7e32
To avoid complications with ppc64, always use the ppc64 alignment.
v2:
* Initial. Suggested by Segher Boessenkool.
Cc: Segher Boessenkool <segher@kernel.crashing.org>
Cc: Alexander Graf <agraf@suse.de>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@906 f158a5a8-5612-0410-a976-696ce0be7e32
ofmem was fixed at 0x05400000, followed by the malloc zone. The latter was
bounded by the stack (now client stack), relative to the top of RAM.
An increase of RAM would therefore only enlarge the malloc zone.
Move the malloc zone below the client stack, with a fixed size of 2 MiB.
The size is derived from the memory map depicted in ofmem.c;
having a fixed size leaves room for memory claim'ed by clients
and by OpenBIOS.
v2:
* Through the preceding patch the malloc zone goes below the client stack
rather than below the stack. Adjust and prettify the illustration.
Cc: Alexander Graf <agraf@suse.de>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@905 f158a5a8-5612-0410-a976-696ce0be7e32
OpenBIOS kept getting overwritten in RAM by clients such as Haiku.
Make sure memory used by OpenBIOS cannot accidentally be claimed
by someone else.
This also sets up the "available" property as expected.
Note that we avoid ofmem_claim() as it would map the pages using a
default mode, followed by a remap with the desired mode.
v2:
* Reordered.
* Added spacing.
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@904 f158a5a8-5612-0410-a976-696ce0be7e32
Don't let the client stack and the heap overlap.
v2:
* Initial.
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@903 f158a5a8-5612-0410-a976-696ce0be7e32
The hash base is not get_rom_base() - HASH_SIZE. It gets rounded down,
depending on the PVR, so read its true value from SDR1.
v2:
* Split up.
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@902 f158a5a8-5612-0410-a976-696ce0be7e32
According to the illustration in start.S,
the stack size is supposed to be 64 KiB.
v2:
* Split up.
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@901 f158a5a8-5612-0410-a976-696ce0be7e32
ofmem_free() has no return value and neither does free().
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@900 f158a5a8-5612-0410-a976-696ce0be7e32
This will simplify moving OpenBIOS around in memory.
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@899 f158a5a8-5612-0410-a976-696ce0be7e32
My New World PowerMac G3 does not have a /hypervisor node.
Move all Forth code to kvm_of_init() to make it match the comment:
Don't expose /hypervisor when not in KVM.
Cc: Alexander Graf <agraf@suse.de>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@895 f158a5a8-5612-0410-a976-696ce0be7e32
This patch allocates an extra 192 bytes of stack space required by unoptimised gcc builds for saving arguments to the stack. As
suggested by Igor previously (see http://lists.openbios.org/pipermail/openbios/2009-July/003762.html and SVN r508).
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@887 f158a5a8-5612-0410-a976-696ce0be7e32
As used by OpenSolaris. This enables OpenSolaris boot to proceed further by allowing the kernel to correctly manage its own TLB
misses.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@886 f158a5a8-5612-0410-a976-696ce0be7e32
Compiling Sparc32 with GCC 4.6.0 20100925 produced a few warnings:
../arch/sparc32/context.c: In function 'start_main':
../arch/sparc32/context.c:49:9: error: variable 'retval' set but not used [-Werror=unused-but-set-variable]
../arch/sparc32/romvec.c: In function 'obp_devwrite':
../arch/sparc32/romvec.c:326:9: error: variable 'ret' set but not used [-Werror=unused-but-set-variable]
../drivers/iommu.c: In function 'iommu_init':
../drivers/iommu.c:102:24: error: variable 'vers' set but not used [-Werror=unused-but-set-variable]
../drivers/iommu.c:102:18: error: variable 'impl' set but not used [-Werror=unused-but-set-variable]
Fix the warnings by avoiding write-only variables.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@883 f158a5a8-5612-0410-a976-696ce0be7e32
Compiling Sparc64 with GCC 4.6.0 20100925 produced a few warnings:
../arch/sparc64/context.c: In function 'start_main':
../arch/sparc64/context.c:49:9: error: variable 'retval' set but not used [-Werror=unused-but-set-variable]
../packages/disk-label.c: In function 'dlabel_load':
../packages/disk-label.c:183:8: error: variable 'buf' set but not used [-Werror=unused-but-set-variable]
../drivers/floppy.c: In function 'collect_interrupt':
../drivers/floppy.c:378:13: error: variable 'status' set but not used [-Werror=unused-but-set-variable]
Fix the warnings by avoiding write-only variables.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@882 f158a5a8-5612-0410-a976-696ce0be7e32
than assembler.
In order to allow OpenSolaris to boot under OpenBIOS, it is necessary to be able to invoke Forth words from within the MMU
I/D-TLB miss handlers, since Solaris 10 kernels hook into the virtual to physical address translation process via va>tte-data at
boot time. Hence this patch implements two macros: SAVE_CPU_STATE and RESTORE_CPU_STATE which enable a context switch to occur
from within these trap handlers.
Things are more complicated from within the MMU miss handlers because we can't use flushw to flush the processor registers to
stack. This is because the memory pointed to by the stack pointer may not be in the TLB either, and so we'd end up in a
recursive MMU trap. Hence we solve this by creating a static stack within OpenBIOS which is guaranteed to be locked in the TLB
and storing all of our state there.
Once the ability to switch context has been implemented, it is possible to invoke C functions as per normal from within the MMU
miss handlers. Hence as a proof of concept I've migrated the MMU miss handling code from ASM to C with a view of making the
relevant changes to invoke the relevant Forth functions at a later date.
I'd also like to say thank you to Blue Swirl who took the time to answer all my questions and generally point out the
shortcomings in my first attempts at SPARC assembler.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@874 f158a5a8-5612-0410-a976-696ce0be7e32
The existing 8K stack used when switching context to run the executable payload was not enough. Increasing the stack to 16K
solves the issue, preventing the payload from clobbering memory within OpenBIOS as it runs.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@873 f158a5a8-5612-0410-a976-696ce0be7e32
Each console write caused temporary buffer allocation.
Avoid allocations by changing console_draw_str() to use Forth
string parameters, which are usually readily available.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@872 f158a5a8-5612-0410-a976-696ce0be7e32
Move nested extern declarations into header files, or use the
already existing declarations.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@861 f158a5a8-5612-0410-a976-696ce0be7e32
Solaris 9 boot; i.e. remove the /CPU/mmu device, relocate its methods to /virtual-memory, and alter the /chosen mmu property so
that it now points to /virtual-memory. This helps both Solaris 9 and OpenSolaris boot further along the way.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@859 f158a5a8-5612-0410-a976-696ce0be7e32
and physical memory and setting up an MMU mapping.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@856 f158a5a8-5612-0410-a976-696ce0be7e32
Found with this Coccinelle script:
@@
type T;
identifier i;
expression E;
@@
(
extern T i;
|
- T i;
<+... when != i
- i = E;
...+>
)
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@855 f158a5a8-5612-0410-a976-696ce0be7e32
The ePAPR spec requires us to have a /hypervisor node that tells the guest OS
which hypervisor it's running on and which hypercall to use to call into it.
So let's fetch all that information from Qemu's fw_cfg interface and put it
into place, making everyone happy.
Signed-off-by: Alexander Graf <agraf@suse.de>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@853 f158a5a8-5612-0410-a976-696ce0be7e32
callback as suggested by Google, and simply return nothing for the v2 callback as indicated by the romvec structure. This allows us to remove the
extra POP() which was causing a stack underflow error which was affecting Solaris 8 installation kernel boot.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@850 f158a5a8-5612-0410-a976-696ce0be7e32
If the size of the partition currently being probed is zero,
fail the probe. This lets Forth code try the next candidate from
boot-device list.
Add explicit ':d' (Sparc32, 'f' for Sparc64) partition to
CDROM probe list, so we can remove the ugly forced partition logic.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@846 f158a5a8-5612-0410-a976-696ce0be7e32
Move initial banner printing, CPU setup and graphic_depth
setup to openbios.c.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@845 f158a5a8-5612-0410-a976-696ce0be7e32
open_io() returns -1 on error and 0 is a valid return value.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@841 f158a5a8-5612-0410-a976-696ce0be7e32
CC target/arch/x86/boot.o
../arch/x86/boot.c: In function 'go':
../arch/x86/boot.c:35: error: 'boot_notes' undeclared (first use in this function)
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@834 f158a5a8-5612-0410-a976-696ce0be7e32