Commit Graph

871 Commits

Author SHA1 Message Date
Mark Cave-Ayland
c60fad9646 Add is_fcode(), is_forth() and is_aout() functions which take a pointer to an area of memory which may contain a valid loader
image.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@719 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-28 20:55:10 +00:00
Blue Swirl
dc5c530885 Add missing newline
Fixes build:
  CC    target/arch/sparc64/boot.o
In file included from ../arch/sparc64/boot.c:14:
../include/libopenbios/forth_load.h:22:28: error: no newline at end of file

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@718 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-28 20:48:53 +00:00
Mark Cave-Ayland
f78fec5713 Introduce a set of CONFIG_LOADER_* configuration options to allow each 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
2010-03-28 20:18:30 +00:00
Blue Swirl
63db85036b Fix linker warning
There were two global symbols named 'entry':
  LINK  openbios-builtin.elf
libsparc32.a(entry.o): warning: definition of `entry' overriding common
libsparc32.a(boot.o): warning: common is here

Add 'static' to hide the boot.c one.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@716 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-27 13:20:54 +00:00
Blue Swirl
5fb589b003 Add missing newlines
Fixes build:
In file included from ../arch/sparc64/boot.c:12:
../include/libopenbios/aout_load.h:24:27: error: no newline at end of file
In file included from ../arch/sparc64/boot.c:13:
../include/libopenbios/fcode_load.h:22:28: error: no newline at end of file

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@715 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-27 13:20:52 +00:00
Mark Cave-Ayland
0933f8c540 Move the Fcode loader from arch/*/fcodeload.c to libopenbios/fcode_load.c.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@714 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-27 12:09:16 +00:00
Mark Cave-Ayland
08ee7445f1 Fix a couple of minor omissions (and an incorrect switch-arch alteration) from the previous commit.
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@713 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-27 11:59:43 +00:00
Mark Cave-Ayland
126f9ee43e Move the Forth loader forthload.c from arch/*/forthload.c to 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
2010-03-27 11:53:59 +00:00
Mark Cave-Ayland
f02d2bde53 Move the a.out loader from arch/*/aoutload.c into libopenbios as aout_load.c.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@711 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-27 11:30:14 +00:00
Mark Cave-Ayland
1264ad95d2 Create a brand new ELF loader based upon arch/*/elfload.c and 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
2010-03-27 10:57:03 +00:00
Mark Cave-Ayland
6dd0574272 Switch the loaders for x86, sparc64 and sparc32 over to use the new 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
2010-03-26 22:33:50 +00:00
Mark Cave-Ayland
8a6d445d38 Introduce the concept of the OF saved-program-state structure and modify all 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
2010-03-26 21:17:32 +00:00
Mark Cave-Ayland
d66540542d Remove loadfs.c and loadfs.h from all of the various architectures. They 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
2010-03-26 20:25:04 +00:00
Mark Cave-Ayland
34d5a76f7e Revert the parts of the last commit which changed the exception function to use an exception pointer as it isn't really
required. Update forthstrap to add a new -c option that when specified will direct the Forth kernel console output to a file 
and integrate this into the build system. By default, when a dictionary is built using a base dictionary then a new log file 
called <dict>-console.log will be generated to help debugging if the build fails.

Also update the exception handler in kernel/bootstrap.c so that it matches the entire range of error codes in 
forth/bootstrap/interpreter.fs.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@706 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-25 21:14:00 +00:00
Mark Cave-Ayland
a288b3044b Change the sysdebug exception() callback so that it is now a function pointer, rather than a function. This enables us to setup an appropriate exception handler
for the task in hand; in particular it allows us to distinguish between an error that occurs when attempting to execute a base dictionary, and an error that 
occurs when interpreting source.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@705 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-24 11:49:41 +00:00
Mark Cave-Ayland
5c73290696 Add source file and line number tracking to forthstrap to allow the user to locate forth errors much more easily. An example of the new output is given below:
build@zeno:~/src/openbios/openbios-devel.pre$ ./config/scripts/switch-arch cross-ppc; make
Configuring OpenBIOS on amd64 for cross-ppc
Initializing build tree obj-ppc...ok.
Creating target Makefile...ok.
Creating config files...ok.
Building OpenBIOS for ppc
Building...error:
 HOSTCC host/kernel/stack.o
 HOSTCC forthstrap
  GEN   bootstrap.dict
bootstrap.fs:339 - foo is not defined.



git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@704 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-24 10:28:51 +00:00
Mark Cave-Ayland
553344a5da Change the location of the function prototype for collect_sys_info() so that 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
2010-03-17 22:20:12 +00:00
Mark Cave-Ayland
feee9b0fd5 Correct comments in kernel/primitives.c as pointed out by ProgrammingKid and Andreas Färber.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@702 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-14 21:40:22 +00:00
Mark Cave-Ayland
cbb3d8bf5b Fix a debug whereby the debug banner was being printed to the debug output rather than the console.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@701 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-14 21:35:54 +00:00
Mark Cave-Ayland
4bc97b7c9f Fix PPC build - it seems that changing the headers around was masking the fact that virt_offset was not being defined within
ppc/qemu.c compared to the other PPC builds.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@700 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-14 21:14:04 +00:00
Mark Cave-Ayland
10a518a7aa Only one file remains - asm.m4. I have absolutely no idea what this file is supposed to do (since it doesn't seem to be called)
so I'll move in into include/libopenbios for the time being. Anyone know what this file is used for?

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@699 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-14 21:02:58 +00:00
Mark Cave-Ayland
92f8310ff7 Split nvram.h into its proper two components - one for the arch-specific 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
2010-03-14 20:34:01 +00:00
Mark Cave-Ayland
d60e3b62a4 Commit extra files I forgot to "svn add" from the previous commit :(
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@697 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-14 20:19:46 +00:00
Mark Cave-Ayland
bf897f1619 Split video_subr.h into its separate components so that they can live in the right places, rather than placing the definitions
from lots of different C files into a single header.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@696 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-14 20:10:01 +00:00
Mark Cave-Ayland
1dbe55b8e4 Move the basic OpenBIOS configuration header files from include/openbios to 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
2010-03-14 17:19:58 +00:00
Mark Cave-Ayland
02896c11fd Move the a.out, ELF and XCOFF header files down into include/arch/common.
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
2010-03-14 17:06:20 +00:00
Mark Cave-Ayland
f84dd73af4 Fix the sys_info.h header file so it doesn't reference functions both inside 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
2010-03-14 16:09:44 +00:00
Mark Cave-Ayland
da4cc1d0bd Move the driver header files into include/drivers 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@692 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-14 15:19:41 +00:00
Mark Cave-Ayland
4a2c065e4f Move the libopenbios header files into include/libopenbios 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@691 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-14 15:05:53 +00:00
Mark Cave-Ayland
9a1c40734c Move the fs header file into include/fs 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@690 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-14 14:33:32 +00:00
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
Mark Cave-Ayland
259edb2d3b Finish move of architecture-specific header files, with modifications to the header paths as required.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@688 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-14 13:54:45 +00:00
Mark Cave-Ayland
04a412a7f5 Begin tidying up of header locations as described on the mailing list. Firstly we move all of the architecture-specific header
files from include/$ARCH to include/arch/$ARCH.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@687 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-14 13:47:44 +00:00
Mark Cave-Ayland
76447ee919 Add missing files from previous refactoring commit and also fix a slight error in libopenbios/build.xml.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@686 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-13 12:44:22 +00:00
Mark Cave-Ayland
dbf16392cc Refactoring of the OpenBIOS source code, as discussed on the mailing list. The primary aim of this process is to try and arrange
the source files into a structure whereby it is easier to find the relationship between a forth package word and its C 
implementation, while also creating a libopenbios library into which more common code from the arch/ tree can eventually be 
moved.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk> 


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@685 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-13 10:58:19 +00:00
Blue Swirl
0d5f749065 Fix Unix target build on PPC host
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@684 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-07 16:36:30 +00:00
Alexander Graf
9724a856d7 PPC: Disable host binary build
On PPC the host binary build always fails for me. Since I guess I'm
the only one actually building OpenBIOS ppc on ppc and I don't really
care that much about debugging Forth code in my Linux environment,
I guess we can just disable building it by default.

Signed-off-by: Alexander Graf <agraf@suse.de>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@683 f158a5a8-5612-0410-a976-696ce0be7e32
2010-02-22 18:52:34 +00:00
Alexander Graf
82639976aa PPC: Set Uninorth interrupt numbers to new Qemu values
We changed the uninorth interrupt mapping to better reflect real
hardware. OpenBIOS obviously needs to know about that.

Signed-off-by: Alexander Graf <agraf@suse.de>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@682 f158a5a8-5612-0410-a976-696ce0be7e32
2010-02-22 18:52:32 +00:00
Alexander Graf
88679e07e4 PPC: Add U3 based Mac machine
Linux on PPC64 knows only so many chipsets. One of the is the U3. So
we can use that when we're emulating a PPC64 machine, making Linux happy.

Signed-off-by: Alexander Graf <agraf@suse.de>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@681 f158a5a8-5612-0410-a976-696ce0be7e32
2010-02-22 18:52:30 +00:00
Alexander Graf
b2036c0313 PPC: Fix interrupt numbers
We changed several interrupt numbers in Qemu to better reflect real
world hardware. Also, since we're now using proper interrupt maps, we
need to make sure we specify interrupts in the way the respective map
requires it.

Signed-off-by: Alexander Graf <agraf@suse.de>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@680 f158a5a8-5612-0410-a976-696ce0be7e32
2010-02-22 18:52:28 +00:00
Alexander Graf
81605d775a PPC: Create interrupt map for PCI
There is a draft spec that defines how interrupts are supposed to be mapped
from one bus to another, down to the PIC and CPU interrupt line.

So far we don't implement that spec. But PPC64 Linux requires us to for PCI
devices. So let's create a map here.

Draft: http://playground.sun.com/1275/practice/imap/imap0_9d.pdf

Signed-off-by: Alexander Graf <agraf@suse.de>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@679 f158a5a8-5612-0410-a976-696ce0be7e32
2010-02-22 18:52:26 +00:00
Alexander Graf
50d1f0e78e PPC: Get timebase and clock speed from fw_cfg
When running on Qemu (TCG) time goes by at a constant frequency which
accidently happens to match with Linux's fallback value.

As soon as we go to KVM, the time base suddenly starts going as fast as
the host CPU's time base. So we need to make sure Linux knows about
it, so it can do its timekeeping properly.

Signed-off-by: Alexander Graf <agraf@suse.de>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@678 f158a5a8-5612-0410-a976-696ce0be7e32
2010-02-22 18:52:25 +00:00
Alexander Graf
63e7a89932 PPC: Increase instruction cache size
A real 970FX has more icache, so we should reflect that.

Signed-off-by: Alexander Graf <agraf@suse.de>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@677 f158a5a8-5612-0410-a976-696ce0be7e32
2010-02-22 18:52:23 +00:00
Blue Swirl
37f12143ba Add "reg" property to kb_ps2, fix device_type
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@676 f158a5a8-5612-0410-a976-696ce0be7e32
2010-02-07 20:25:32 +00:00
Blue Swirl
a20a8cc176 Fix wrong device_type for non-PCI bridge devices, like EBUS
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@675 f158a5a8-5612-0410-a976-696ce0be7e32
2010-02-07 20:25:30 +00:00
Igor V. Kovalenko
91857d3a8c pathres: consistently encode unit address on 64bit target
This change fixes node unit address matching on arch
where cell is not 4 byte integer (tested with sparc64.)

Since we encode "reg" property chunks with encode-int
we need to use the same encoding while preparing unit
phys addr for comparison at path resolution time.

- (exact-match): calculate phys addr length using 4 byte
  member encoding with /l* not cells

- find-child: encode phys addr components similar to
  encode-int with 4 byte stores

Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@674 f158a5a8-5612-0410-a976-696ce0be7e32
2010-02-03 17:54:14 +00:00
Blue Swirl
305168fb73 sparc64: implement reset
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@673 f158a5a8-5612-0410-a976-696ce0be7e32
2010-01-31 12:16:46 +00:00
Blue Swirl
dec920ff08 Sparc64: Add interrupt properties to Sabre
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@672 f158a5a8-5612-0410-a976-696ce0be7e32
2010-01-30 20:58:40 +00:00
Blue Swirl
bdf1f6ce72 QEMU changed PCI/IO port byte swapping, adapt OpenBIOS to new way
This requires an updated QEMU.

Also use little endian access ASIs.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@671 f158a5a8-5612-0410-a976-696ce0be7e32
2010-01-29 18:46:38 +00:00
Blue Swirl
dc3b5cc5f2 Sparc64: more generic method for display and keyboard selection
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@669 f158a5a8-5612-0410-a976-696ce0be7e32
2010-01-24 13:38:28 +00:00