Prefer phys_addr_t for physical addresses.
Resort to uintptr_t where a conversion to pointer occurs,
since the physical address may be larger (e.g., sparc32).
v2:
* Use phys_addr_t.
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@933 f158a5a8-5612-0410-a976-696ce0be7e32
Define phys_addr_t type for all architectures.
v2:
* Add comment on PAE for x86, pointed out by Blue.
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@932 f158a5a8-5612-0410-a976-696ce0be7e32
Add a uintptr_t cast as an interim solution to resolve errors for ppc64,
where pointer size is larger than cell size.
v2:
* Add comment on potential better fix.
Postpone potential conversion to inline function until investigated.
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@931 f158a5a8-5612-0410-a976-696ce0be7e32
Do the double-dereference in two cell2pointer steps
to avoid garbage in the high 32 address bits on ppc64.
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@930 f158a5a8-5612-0410-a976-696ce0be7e32
Use $(ARCH) to allow using a different linker script for ppc64.
v2:
* Add ppc64/qemu/ldscript, derived from ppc/qemu/ldscript.
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@929 f158a5a8-5612-0410-a976-696ce0be7e32
ppc64 doesn't use int128_t and thus fails to build when NEED_FAKE_INT128_T
gets defined, due to its use in include/kernel/stack.h.
Continue to use it for all other targets for which "$targetlongbits" = "64".
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@928 f158a5a8-5612-0410-a976-696ce0be7e32
Detect ppc64 as Big Endian and 64-bit.
Reuse arch/ppc/ wherever possible.
v3:
* Split off int128_t fix.
* Rebase to HEAD, add support for qemu-ppc64 target.
* Rename $INCLUDEARCH to $BASEARCH and initialize it earlier.
* Set both CONFIG_$BASEARCH and CONFIG_$ARCH if they differ.
* Use -fno-builtin.
* Add ppc64 config, copied from ppc.
v2:
* Use powerpc64 prefix.
* Disable fake int128_t for everything but sparc64.
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@927 f158a5a8-5612-0410-a976-696ce0be7e32
r879 broke ppc cross-compilation from Darwin/ppc host.
Symptom is that the assembler chokes on arch/ppc/qemu/start.S.
Always use a cross-compiler on Darwin host
since *-apple-darwin*-{gcc,ld} would produce Mach-O binaries.
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@926 f158a5a8-5612-0410-a976-696ce0be7e32
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 adb_dev_t state field is used to store a adb_kbd_t pointer.
It is unused in the mouse driver.
v2:
* Change field type from uint32_t to void* to avoid uintptr_t casts
in keyboard driver.
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Acked-by: Alexander Graf <agraf@suse.de>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@924 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
A misplaced digit 8 made it look as if some signedness issue was present
somewhere between libopenbios/client.c:of_client_interface() and
arch/ppc/qemu/methods.c:ciface_claim(). This is not the case;
despite unsigned long -> ucell -> cell -> ucell conversions,
PUSH'ing 0x81234567 and POP'ing works as expected.
Fix the format string to avoid such confusion.
Add zero-padding while at it.
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@921 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
These will be needed elsewhere for ppc64.
Cc: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@917 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
As pointed out by Tarl, since these are called as separate words (and not inline), we need to preserve the top-most R stack item
as this is return address of the word itself.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@912 f158a5a8-5612-0410-a976-696ce0be7e32
This fixes various errors being caused by previous calls to CIF interpret throwing exceptions whilst in the Forth compile
state. Without this fix, subsequent calls to CIF interpret could be executed erroneusly in Forth compile state rather than the
Forth interpret state causing hard-to-detect Forth errors.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@910 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
The previous code used the standard set_property() function which copies the new property into the dictionary each time the
property is set. During OpenSolaris boot, this would cause OpenBIOS to run out of memory due to large number of changes to the
memory regions.
Now for each property we have a static buffer allocated within OpenBIOS which starts from 2K and doubles in size everytime the
memory region is exhausted, and set the address directly to the relevant buffer. This saves a great deal of memory and prevents
the dictionary and internal memory regions from being exhausted during OpenSolaris boot.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@896 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
According to IEEE 1275, "Size is either the actual size of the property,
or –1 if name does not exist."
The property might be larger than the client's buffer, so don't dup
the min used for writing into the buffer but the original proplen value.
Insert a comment to show what's going on.
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@894 f158a5a8-5612-0410-a976-696ce0be7e32
Currently the whole buffer supplied by the client is traced.
AIX uses buffer sizes such as 64, 256, 1024 on properties that might
not exist or contain 1 or 8 bytes.
Limit the output to the amount of data actually written into the buffer.
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@893 f158a5a8-5612-0410-a976-696ce0be7e32
test-method for "instantiate-rtas" would fail on the /rtas node.
According to CHRP 1.5 draft, the stack order seems reversed.
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@891 f158a5a8-5612-0410-a976-696ce0be7e32
Don't trace the buffer length in place of the property size.
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@889 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
New GCCs (for example 4.6.0) needed a few more functions to
libgcc. Without the functions, there were a lot of linker errors:
LINK openbios-qemu.elf
libqemu.a(ofmem.o): In function `hash_page':
/src/openbios-devel/obj-ppc/../arch/ppc/qemu/ofmem.c:353: undefined reference to `_restgpr_25_x'
libqemu.a(ofmem.o): In function `ea_to_phys':
/src/openbios-devel/obj-ppc/../arch/ppc/qemu/ofmem.c:231: undefined reference to `_restgpr_30_x'
etc.
Copy the needed functions from Linux.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@885 f158a5a8-5612-0410-a976-696ce0be7e32
Compiling PPC with GCC 4.6.0 20100925 produced a few warnings:
../fs/hfs/block.c: In function 'reuse':
../fs/hfs/block.c:304:11: error: variable 'chain' set but not used [-Werror=unused-but-set-variable]
../fs/iso9660/iso9660_mount.c: In function 'iso9660_name':
../fs/iso9660/iso9660_mount.c:18:16: error: variable 'uh' 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@884 f158a5a8-5612-0410-a976-696ce0be7e32