summaryrefslogtreecommitdiff
path: root/arch/x86
Commit message (Collapse)AuthorAgeFilesLines
* x86: set active package and current instance to root device node before probeMark Cave-Ayland2019-08-181-1/+8
| | | | | | | | | Now that all PCI devices have been converted to new-device...finish-device we can set both the active package and current instance to the root device node before probe, giving all child devices a correct active package and instance chain during creation. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
* x86: remove static declaration from multiboot_header definitionMark Cave-Ayland2018-01-191-1/+1
| | | | | | | | | | | | Newer versions of gcc fail to compile OpenBIOS giving a "error: ‘multiboot_header’ defined but not used" message when the default build with -Werror enabled is used. Remove the static declaration to enable compilation to succeed, which incidentally matches the other copies of multiboot.c in the OpenBIOS source tree. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
* arch: update pci_host_t host_ranges with values for each architectureMark Cave-Ayland2017-07-121-0/+4
| | | | | | As derived from the current logic in pci_host_set_ranges(). Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
* Remove obsolete email addressesStefan Reinauer2017-06-081-1/+1
| | | | Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
* Fix spelling mistakesEdward Betts2017-02-102-2/+2
| | | | | Signed-off-by: Edward Betts <edward@4angle.com> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
* libopenbios: remove address parameter from start_elf()Mark Cave-Ayland2016-09-111-3/+1
| | | | | | | Now that each loader sets up its own context, there is no need to pass in the address or set up the context ourselves. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
* libopenbios: move go() function into libopenbiosMark Cave-Ayland2016-09-113-45/+1
| | | | | | | | | Add an (arch-go) hook for architectures that need to do their own thing before starting an image, and switch the callers over to use it. Also clarify the state-valid check: any non-zero value is considered true. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
* libopenbios: move prototypes for start_elf() and __context into libopenbiosMark Cave-Ayland2016-09-112-5/+1
| | | | | | Also fix up the incorrect x86 prototype which is missing the volatile qualifier. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
* elf: set boot notes in elf_load() if suppliedMark Cave-Ayland2016-09-113-12/+7
| | | | | | | | | | Since the parameter is now already available to arch_init_program(), there is no need to supply it separately to start_elf(). Remove the second parameter and fix up the callers, including standardising the prototype of start_elf() across all architectures. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
* x86: move Forth/FCode over to use new context wrappersMark Cave-Ayland2016-09-111-12/+6
| | | | Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
* x86: introduce arch_init_program() implementationMark Cave-Ayland2016-09-111-5/+35
| | | | | | And switch start_elf() over to use it. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
* all: create client program context once at startupMark Cave-Ayland2016-09-111-3/+10
| | | | | | | Make sure that __context points to it to potentially allow state to be viewed/altered beforehand. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
* libopenbios: rename saved-program-state to load-stateMark Cave-Ayland2016-09-111-3/+3
| | | | | | | The per-arch context is held via __context, so what we hold here is effectively just information about the last loaded file. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
* ide: change ob_ide_init() to take usual control base addressesHervé Poussineau2014-01-131-1/+1
| | | | | | | | | | The +2 offset comes from the PCI IDE controllers, where control status must be accessed at BAR1+2 and BAR3+2. Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@1247 f158a5a8-5612-0410-a976-696ce0be7e32
* libopenbios: move console selection from compile-time to runtimeMark Cave-Ayland2013-10-252-3/+13
| | | | | | | | | | | | | Some architectures require different console configurations depending upon the machine type. This commit moves the console handlers into a struct _console_ops structure held within libopenbios and switches all our supported architectures over to use it. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> CC: Andreas Färber <afaerber@suse.de> CC: Hervé Poussineau <hpoussin@reactos.org> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@1230 f158a5a8-5612-0410-a976-696ce0be7e32
* tcx.fs: move framebuffer mapping over from C to tcx.fsMark Cave-Ayland2013-08-191-1/+1
| | | | | | | | | | | Finally we can now fix up setup_video() so that it has no knowledge of fixed addresse but simply refers to the underlying Forth variables as per the specification. Touch up various places as a result of this, but we can now remove the bogus openbios-video-addr and just use frame-buffer-adr instead. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@1215 f158a5a8-5612-0410-a976-696ce0be7e32
* x86/SPARC64/PPC/amd64: switch VGA driver over to FCodeMark Cave-Ayland2013-07-272-0/+9
| | | | | | | | | Currently we cannot read the FCode from the card, so for the moment simply execute the bytecode directly. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@1194 f158a5a8-5612-0410-a976-696ce0be7e32
* video_common.c: split video setup routines into setup_video()Mark Cave-Ayland2013-07-271-1/+7
| | | | | | | | | | | | | | | | | Leave per-device work in init_video() for the moment. As part of this commit we fix up switch-arch so that CONFIG_QEMU works for SPARC32 - if we are given the framebuffer information via the QEMU firmware interface we use it. Otherwise fall back to the values of the VGA_DEFAULT_* constants. This commit requires a corresponding patch for QEMU as currently the framebuffer width/height are not passed via the firmware interface for SPARC32. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@1182 f158a5a8-5612-0410-a976-696ce0be7e32
* x86: avoid runtime relocationsBlue Swirl2011-01-303-15/+15
| | | | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@1017 f158a5a8-5612-0410-a976-696ce0be7e32
* Introduce forth_init() for trampoline initializationAndreas Färber2010-11-131-0/+1
| | | | | | | | | | | | | | | | | | | | Use init_trampoline() for trampoline variable initialization. Add calls to a new forth_init() function for each architecture to invoke it. Idea courtesy of Blue. This fixes ppc64 compilation by avoiding a casted self-reference. v2: * Share init_trampoline() with kernel/bootstrap.c, suggested by Mark. * Adopt QEMU coding style for new functions. Cc: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk> Signed-off-by: Andreas Färber <andreas.faerber@web.de> Acked-by: Blue Swirl <blauwirbel@gmail.com> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@954 f158a5a8-5612-0410-a976-696ce0be7e32
* Avoid a lot of malloc/free trafficBlue Swirl2010-09-291-7/+1
| | | | | | | | | | | 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
* Enable GCC warning flag -Wnested-externs, fix warningsBlue Swirl2010-09-063-4/+4
| | | | | | | | | 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
* linux_load: fix open_io return value checksBlue Swirl2010-08-081-2/+3
| | | | | | | | 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
* Bind the (go) function into the C equivalent go function arch/x86/boot.c ↵Mark Cave-Ayland2010-08-071-1/+2
| | | | | | | | | | | (this should re-enable load/boot with the new unified loader). Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@837 f158a5a8-5612-0410-a976-696ce0be7e32
* Fix x86 buildBlue Swirl2010-08-061-1/+1
| | | | | | | | | | 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
* Use standard typesBlue Swirl2010-08-011-1/+1
| | | | | | | | | | | | | | | | Replace uchar, uint, ulong, u_char, u_int, u_long, u_int* with their standard equivalents. Fixes warnings like these on OpenBSD: CC target/arch/unix/unix.o In file included from ../arch/unix/unix.c:29: ../include/config.h:26: warning: redefinition of `ulong' /usr/include/sys/types.h:56: warning: `ulong' previously declared here ../include/config.h:26: warning: redundant redeclaration of `ulong' in same scope Signed-off-by: Blue Swirl <blauwirbel@gmail.com> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@830 f158a5a8-5612-0410-a976-696ce0be7e32
* Fix Unix target buildBlue Swirl2010-08-011-2/+0
| | | | | | | | | | | | | | | Fix build failure: LINK openbios-unix libopenbios.a(load.o)(.text+0xe0): In function `load': ../libopenbios/load.c:58: undefined reference to `elf_boot_notes' libopenbios.a(load.o)(.text+0xe8):../libopenbios/load.c:58: undefined reference to `elf_boot_notes' Move elf_boot_notes variable to load.c to make it also available on Unix build. Also fix a spurious sys_info variable definition. Signed-off-by: Blue Swirl <blauwirbel@gmail.com> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@829 f158a5a8-5612-0410-a976-696ce0be7e32
* Rework the OpenBIOS internals so that boot, load and init-program now all ↵Mark Cave-Ayland2010-08-011-83/+3
| | | | | | | | | | | | | | | | | | | | | use the unified libopenbios loader code with improved IEEE-1275 spec compliance. This patch implements the following: 1) Fix bootpath/bootargs handling so that default values are read from NVRAM, and allow multiple space-separated values to be specified. 2) With correct bootargs handling in place, move the ELF loader over to the new libopenbios unified loaders. 3) Remove all the loader code from all architecture directories sine we don't need it anymore. 4) Simplify the boot word so it invokes platform-specific code where required, then calls load and go as per the specification. Tested on all my available images for SPARC32, SPARC64 and PPC, and compile-tested on x86. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@828 f158a5a8-5612-0410-a976-696ce0be7e32
* Fix Unix target buildBlue Swirl2010-08-011-1/+0
| | | | | | | | Move sys_info to load.c to make it also available on Unix build. Signed-off-by: Blue Swirl <blauwirbel@gmail.com> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@826 f158a5a8-5612-0410-a976-696ce0be7e32
* Move a.out loader into the new C load implementation (also fix up the header ↵Mark Cave-Ayland2010-06-273-3/+1
| | | | | | | | | includes in load.c). Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@801 f158a5a8-5612-0410-a976-696ce0be7e32
* Switch Forth loader over to using an ihandle rather than a direct path ↵Mark Cave-Ayland2010-06-271-1/+1
| | | | | | | | | reference. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@799 f158a5a8-5612-0410-a976-696ce0be7e32
* Implement a basic C loader function in load.c that tries to load each ↵Mark Cave-Ayland2010-06-251-1/+7
| | | | | | | | | | | | | | | | supported executable file format. Now that the ihandle hierarchy is correct, we can simply pass an ihandle into the loader and it will work correctly regardless of whether it is being invoked on an entire disk, partition or individual file. In order to test the new code, start by switching the Fcode loader over to the new infrastructure for testing on SPARC64. Note this patch also contains a correction to load-base on SPARC which was being set to a value other than 0x4000 which is the documented default. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@798 f158a5a8-5612-0410-a976-696ce0be7e32
* Commit revised version of Igor Kovalenko's patch for detecting whether ↵Igor V. Kovalenko2010-04-121-1/+4
| | | | | | | | | | | | dictionary allocations have overrun the memory buffer allocated for them. Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@741 f158a5a8-5612-0410-a976-696ce0be7e32
* Add an extra linefeed in front of the jump message in (go) to make the debug ↵Mark Cave-Ayland2010-04-021-1/+1
| | | | | | | | | output a bit tidier. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@730 f158a5a8-5612-0410-a976-696ce0be7e32
* Now that we have a C version of go available, rework client.fs so that it ↵Mark Cave-Ayland2010-04-021-1/+6
| | | | | | | | | | | | will automatically detect if a platform has execution capability based upon the existence of the lower level (go) word. Also add standard ELF image support to (go) for SPARC32, SPARC64 and x86. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@728 f158a5a8-5612-0410-a976-696ce0be7e32
* Since the original boot code had been previously refactored to make use of ↵Mark Cave-Ayland2010-04-022-5/+14
| | | | | | | | | | | saved-program-state, we can take the existing code and with only slight modification use it as a C implementation of the go word. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@727 f158a5a8-5612-0410-a976-696ce0be7e32
* Create an initialisation function called openbios_init(), similar to ↵Mark Cave-Ayland2010-04-021-0/+2
| | | | | | | | | | | | modules_init(), for use by libopenbios and make sure all architectures are updated to use it. This is required to allow binding of C functions into Forth by libopenbios (i.e. cross architecture) rather than having to update everything in every arch/*/ initialisation file. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@725 f158a5a8-5612-0410-a976-696ce0be7e32
* Introduce a set of CONFIG_LOADER_* configuration options to allow each ↵Mark Cave-Ayland2010-03-281-0/+38
| | | | | | | | | architecture to specify the loaders that are to be used. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@717 f158a5a8-5612-0410-a976-696ce0be7e32
* Move the Forth loader forthload.c from arch/*/forthload.c to ↵Mark Cave-Ayland2010-03-274-84/+5
| | | | | | | | | | | | libopenbios/forth_load.c. While the Forth loader source was included and built as part of the SPARC64 and SPARC32 builds, it was never actually invoked in the boot sequence. Hence this patch maintains the existing behaviour in that only X86 builds included the Forth loader. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@712 f158a5a8-5612-0410-a976-696ce0be7e32
* Create a brand new ELF loader based upon arch/*/elfload.c and ↵Mark Cave-Ayland2010-03-274-404/+0
| | | | | | | | | | | libopenbios/elfload.c combined together in libopenbios. This means that each arch no longer needs its own ELF loader implementation. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@710 f158a5a8-5612-0410-a976-696ce0be7e32
* Switch the loaders for x86, sparc64 and sparc32 over to use the new ↵Mark Cave-Ayland2010-03-263-20/+58
| | | | | | | | | | | | saved-program-state in boot() rather than try to execute the device payload directly. This is the first stage in isolating the OF "load" and "go" words, and in preparation for moving the majority of the loaders into libopenbios. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@709 f158a5a8-5612-0410-a976-696ce0be7e32
* Introduce the concept of the OF saved-program-state structure and modify all ↵Mark Cave-Ayland2010-03-262-7/+34
| | | | | | | | | of the loaders (except PPC) to make use of it. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@708 f158a5a8-5612-0410-a976-696ce0be7e32
* Remove loadfs.c and loadfs.h from all of the various architectures. They ↵Mark Cave-Ayland2010-03-266-73/+54
| | | | | | | | | | | appear to be almost non-existent wrappers which add an extra layer of indirection without much benefit. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@707 f158a5a8-5612-0410-a976-696ce0be7e32
* Change the location of the function prototype for collect_sys_info() so that ↵Mark Cave-Ayland2010-03-171-0/+1
| | | | | | | | | | | it both works for x86 and is the same location as for the amd64 build. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@703 f158a5a8-5612-0410-a976-696ce0be7e32
* Split nvram.h into its proper two components - one for the arch-specific ↵Mark Cave-Ayland2010-03-141-1/+1
| | | | | | | | | functions and another for the package functions. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@698 f158a5a8-5612-0410-a976-696ce0be7e32
* Move the basic OpenBIOS configuration header files from include/openbios to ↵Mark Cave-Ayland2010-03-1417-17/+17
| | | | | | | | | include/. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@695 f158a5a8-5612-0410-a976-696ce0be7e32
* Move the a.out, ELF and XCOFF header files down into include/arch/common.Mark Cave-Ayland2010-03-141-2/+2
| | | | | | | Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@694 f158a5a8-5612-0410-a976-696ce0be7e32
* Fix the sys_info.h header file so it doesn't reference functions both inside ↵Mark Cave-Ayland2010-03-1411-11/+12
| | | | | | | | | | | | and outside of libopenbios, and move the firmware configuration header file to include/arch/common. Following through the code showed that elfnote.c and linuxbios.c were being used by sys_info and so these are also renamed to elf_info.c and linuxbios_info.c for clarity. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@693 f158a5a8-5612-0410-a976-696ce0be7e32
* Move the driver header files into include/drivers to synchronise with the ↵Mark Cave-Ayland2010-03-141-2/+2
| | | | | | | | | 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@692 f158a5a8-5612-0410-a976-696ce0be7e32
* Move the libopenbios header files into include/libopenbios to synchronise ↵Mark Cave-Ayland2010-03-148-10/+10
| | | | | | | | | 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@691 f158a5a8-5612-0410-a976-696ce0be7e32