Commit Graph

116 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
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
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
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
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
Mark Cave-Ayland
ba52470cce In the IEEE 1275-1994 specification the parameters for Client Interface calls
are not in forth stack order but in reversed (heh!) order. Our implementation
confused this.

This second patch is fairly straightforward; probably the only unexpected part is
the need to rename the existing /openprom/client-services "claim" and
"release" words to "cif-claim" and "cif-release" respectively. This is
because we need to use the "claim" and "release" words in
forth/system/ciface.fs to reverse the argument order before calling the real
underlying words.

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



git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@637 f158a5a8-5612-0410-a976-696ce0be7e32
2009-12-02 10:44:35 +00:00
Laurent Vivier
8d752aaf26 Change link edition order to move libc after libfs, allowing libfs to
use functions from libc.

Signed-off-by: Laurent Vivier <Laurent@vivier.eu>



git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@629 f158a5a8-5612-0410-a976-696ce0be7e32
2009-11-22 09:53:54 +00:00
Laurent Vivier
8fd9a7d4af Add "64-bit" property for PowerPC 970fx.
(allows Fedora bootloader to load the good kernel, 32-bit or 64-bit)

Signed-off-by: Laurent Vivier <Laurent@vivier.eu>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@607 f158a5a8-5612-0410-a976-696ce0be7e32
2009-11-10 22:13:54 +00:00
Laurent Vivier
5398f1f5e3 Correct typo
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@600 f158a5a8-5612-0410-a976-696ce0be7e32
2009-11-08 23:43:19 +00:00
Laurent Vivier
657daacde8 ppc/qemu: correctly manage property "available" of package "/memory"
Instead of hardcoding values during init, call ofmem_register() with "/memory" phandle.

Signed-off-by: Laurent Vivier <Laurent@vivier.eu>



git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@599 f158a5a8-5612-0410-a976-696ce0be7e32
2009-11-07 21:53:45 +00:00
Laurent Vivier
e76492313a ppc: replace ofmem_claim_phys() + ofmem_claim_virt() by ofmem_map().
This is needed by haiku-ppc bootloader (but it is not enough).

Signed-off-by: Laurent Vivier <Laurent@vivier.eu>



git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@591 f158a5a8-5612-0410-a976-696ce0be7e32
2009-11-01 23:27:35 +00:00
Laurent Vivier
b9486926d9 ppc: if "\\:tbxi" (mac) fails, try "ppc\bootinfo.txt" (chrp).
This is needed to load the bootloader of OpenBSD.

Signed-off-by: Laurent Vivier <Laurent@vivier.eu>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@590 f158a5a8-5612-0410-a976-696ce0be7e32
2009-10-19 23:02:10 +00:00
Laurent Vivier
6e47ae9e09 ppc: simplify boot by using load and go.
Signed-off-by: Laurent Vivier <Laurent@vivier.eu>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@589 f158a5a8-5612-0410-a976-696ce0be7e32
2009-09-21 23:12:02 +00:00
Laurent Vivier
719271835f Add bootinfo-loader.
Signed-off-by: Laurent Vivier <Laurent@vivier.eu>



git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@584 f158a5a8-5612-0410-a976-696ce0be7e32
2009-09-20 20:15:46 +00:00
Laurent Vivier
1a93a83480 Allows to boot openSUSE from install CD-ROM
Implements "init-program" using loader packages
Write a first loader package: elf-loader

Signed-off-by: Laurent Vivier <Laurent@vivier.eu>



git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@578 f158a5a8-5612-0410-a976-696ce0be7e32
2009-09-18 22:59:30 +00:00
Laurent Vivier
38283e32ac Use the load method to load and execute CHRP script.
This adds a better support of Apple BootX script.
However, "init-program" and "go" are always missing to be able to really boot with BootX.

Signed-off-by: Laurent Vivier <Laurent@vivier.eu>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@576 f158a5a8-5612-0410-a976-696ce0be7e32
2009-09-01 23:44:24 +00:00
Laurent Vivier
a58190e204 Define load-base to follow memory mapping defined in the BootX source
comments.

This as been reported by Steven Noonan.



git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@573 f158a5a8-5612-0410-a976-696ce0be7e32
2009-08-29 21:09:21 +00:00
Laurent Vivier
2db781a446 Replace yaboot_startup() by newworld_boot() which implements generic
CHRP boot method.
It finds the CHRP bootscript using the file attribute 'tbxi' and 
the blessed directory.

This method allows to boot easily Fedora (the bitness detection is done
by the script and yaboot is called with the according yaboot.conf) but
openSUSE is broken (you have to use "boot cd:,\suseboot\yaboot")
Debian works well (as usual...).
The openSUSE needs the missing forth words: "load" and "go".
The MacOS bootloader (BootX) is also loaded automatically but forth 
script is too complex to be executed correctly.

Signed-off-by: Laurent Vivier <Laurent@vivier.eu>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@571 f158a5a8-5612-0410-a976-696ce0be7e32
2009-08-29 15:43:00 +00:00
Laurent Vivier
1ced7923e7 For mac-parts, when no partition number is provided, open the first HFS
partition (type is "Apple_HFS").

Signed-off-by: Laurent Vivier <Laurent@vivier.eu>



git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@570 f158a5a8-5612-0410-a976-696ce0be7e32
2009-08-29 15:24:49 +00:00
Laurent Vivier
1be70e1bca We can select cpu using unit number instead of name,
for instance we can use "dev /cpus/@0" instead of "dev 
/cpus/PowerPC,750". This notation is used in Fedora bootscript
to know if the CPU is 64-bit or 32-bit: it looks at "64-bit" property
of first available CPUS ("@0").

Signed-off-by: Laurent Vivier <Laurent@vivier.eu>



git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@559 f158a5a8-5612-0410-a976-696ce0be7e32
2009-08-17 21:57:04 +00:00
Blue Swirl
9162f1b584 Introduce quiet build
Make forthstrap quiet by default. Use generic rules when possible, unify
the rules and cleanup white space. Use ld flag --whole-archive to avoid
some local rule use. We can also remove some hacks introduced to avoid
missing symbols.

Fix problems brought in by ld flag --whole-archive:
 * x86: fix missing nvram symbols
 * PPC: disable misc.S build for qemu (conflicts with our libgcc)

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

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@556 f158a5a8-5612-0410-a976-696ce0be7e32
2009-08-17 16:58:42 +00:00
Laurent Vivier
6a16562087 This patch allows to boot from bootsector of first bootable partition
using "boot hd:%BOOT"

As explained in:

"PowerPC Microprocessor Common Hardware Reference Platform (CHRP)
System binding to:
IEEE Std 1275-1994 Standard for Boot (Initialization, Configuration)
Firmware
Revision: 1.8"

"Chapter 11.1.2. Open Method Algorith"

Signed-off-by: Laurent Vivier <Laurent@vivier.info>



git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@552 f158a5a8-5612-0410-a976-696ce0be7e32
2009-08-12 19:55:31 +00:00
Steven Noonan
4636eeeedf There are numerous places where using 'ELF_DPRINTF' does not make
sense, because the loader does not use ELF binaries or is not
directly involved in loading them.

Created a generic SUBSYS_PRINTF macro, as well as loader-specific
ELF_DPRINTF, CHRP_DPRINTF, and YABOOT_DPRINTF macros.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>



git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@545 f158a5a8-5612-0410-a976-696ce0be7e32
2009-08-10 19:57:43 +00:00
Steven Noonan
a734a346f2 try_chrp_script() now accepts a third parameter which indicates the
script to be loaded and parsed. It will also terminate parsing on
the '</chrp-boot>' tag, which makes locating embedded data after
the script easier.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>

(laurent: remove XCOFF placeholder)



git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@544 f158a5a8-5612-0410-a976-696ce0be7e32
2009-08-10 19:50:04 +00:00
Laurent Vivier
bf92aa1fbf quik_startup() uses now encode_bootpath() instead of calling
find_dev()/set_property().



git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@541 f158a5a8-5612-0410-a976-696ce0be7e32
2009-08-08 21:56:26 +00:00
Blue Swirl
d4b64752eb Improve version number handling
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@533 f158a5a8-5612-0410-a976-696ce0be7e32
2009-08-02 18:20:53 +00:00
Blue Swirl
f8c0ae8f7b switch ppc to ofmem module implementation (Igor Kovalenko)
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@527 f158a5a8-5612-0410-a976-696ce0be7e32
2009-08-02 11:07:13 +00:00
Blue Swirl
a4c4f46834 unify ppc ofmem implementations (Igor Kovalenko)
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@524 f158a5a8-5612-0410-a976-696ce0be7e32
2009-08-02 11:05:00 +00:00
Blue Swirl
75cbf028bb update briq/mol/pearpc client interface to use ucell type (Igor Kovalenko)
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@523 f158a5a8-5612-0410-a976-696ce0be7e32
2009-08-02 11:04:27 +00:00
Blue Swirl
b2336d54c0 migrate ppc briq/mol/pearpc ofmem implementation to ucell type (Igor Kovalenko)
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@522 f158a5a8-5612-0410-a976-696ce0be7e32
2009-08-02 11:03:26 +00:00
Blue Swirl
5fd89d6537 migrate ppc/qemu ofmem implementation to ucell parameter type (Igor Kovalenko)
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@521 f158a5a8-5612-0410-a976-696ce0be7e32
2009-08-02 11:02:32 +00:00
Blue Swirl
0f141c94d3 move ppc internal prototypes to arch-specific implementation (Igor Kovalenko)
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@519 f158a5a8-5612-0410-a976-696ce0be7e32
2009-08-02 10:59:49 +00:00
Blue Swirl
6b052af925 Use ucell type to pass ofmem arguments (Igor Kovalenko)
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@513 f158a5a8-5612-0410-a976-696ce0be7e32
2009-07-31 11:10:38 +00:00
Laurent Vivier
45caaecfa6 Author: Pavel Roskin <proski@gnu.org>
This is needed on Fedora 11 (GNU ld 2.19.51.0.2).  Otherwise, qemu
reports on statup:

invalid/unsupported opcode: 00 - 18 - 01 (00004070) 00000004 1
invalid/unsupported opcode: 00 - 04 - 17 (000095c8) 000095ec 0

I checked Linux sources (arch/powerpc/kernel/vmlinux.lds.S) and I see
that .sbss is put to the .bss section in front of .bss itself.

The problem is discussed at
https://bugzilla.redhat.com/show_bug.cgi?id=494075



git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@488 f158a5a8-5612-0410-a976-696ce0be7e32
2009-05-17 17:14:01 +00:00
Blue Swirl
a0c398f24b Delete some unused macros detected with -Wp,-Wunused-macros use
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@482 f158a5a8-5612-0410-a976-696ce0be7e32
2009-03-28 14:28:16 +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
Alexander Graf
4702c219f3 Author: Alexander Graf <alex@csgraf.de>
Expose PCI controller information

Linux tries to detect which PCI controller it's supposed to work with.
On PPC32 there is fallback code that doesn't get compiled with
CONFIG_PPC64, so we really have to expose a controller or we don't have
pci config space accessor functions.

Let's expose a un3-agp if we have a mac99 model, as that's what is
supposed to be in there anyways.

Signed-off-by: Alexander Graf <alex@csgraf.de>
Signed-off-by: Laurent Vivier <Laurent@vivier.eu>



git-svn-id: svn://coreboot.org/openbios/openbios-devel@466 f158a5a8-5612-0410-a976-696ce0be7e32
2009-03-08 01:06:56 +00:00
Alexander Graf
4578c8ae20 Author: Alexander Graf <alex@csgraf.de>
Expose NVRAM compatibility

Linux requires the NVRAM to expose a 'nvram,flash' compatibility
in the device tree. Let's expose it so it's happy.

v2 adds a NEWWORLD macro to protect nvram,flash getting exposed in
oldworld macs.

Signed-off-by: Alexander Graf <alex@csgraf.de>
Signed-off-by: Laurent Vivier <Laurent@vivier.eu>



git-svn-id: svn://coreboot.org/openbios/openbios-devel@465 f158a5a8-5612-0410-a976-696ce0be7e32
2009-03-08 01:03:17 +00:00
Alexander Graf
5973871ed2 Author: Alexander Graf <alex@csgraf.de>
PPC64: Switch to 32-bit mode in interrupts

All the code in OpenBIOS runs in 32 bits, which is fine. Now, when
an interrupt arrives, the 970 CPU automatically sets the MSR_SF bit,
making us run in 64 bit mode.

That breaks address calculation, because 'lis' and 'ba' get sign
extended.

In order to circumvent that mess, let's just go back to 32 bit mode
whenever we get an interrupt.

Signed-off-by: Alexander Graf <alex@csgraf.de>
Signed-off-by: Laurent Vivier <Laurent@vivier.eu>



git-svn-id: svn://coreboot.org/openbios/openbios-devel@464 f158a5a8-5612-0410-a976-696ce0be7e32
2009-03-08 00:54:06 +00:00
Alexander Graf
d257db6033 Make OpenBIOS interrupt handlers 64bit aware v2
While booting a 64bit kernel, there is a small timeframe where OF and the kernel communicate with each other. Within that timeframe, DSI/ISI interrupts may occur, because some memory is not mapped yet.

Right now in case that happens, we jump into the DSI/ISI interrupt handler which clobbers the high 32 bits of the kernel's registers. In order to circumvent that, let's save/restore all 64 bits of all kernel registers when we get a DSI/ISI interrupt.

This patch enables a PPC64 Linux kernel to boot up to the point where it tries to set up the SLB entries (slbmte), which is not yet implemented in qemu.

v2 implements handling for the HIOR register, bringing interrupt handlers to RAM.

Signed-off-by: Alexander Graf <alex@csgraf.de>


git-svn-id: svn://coreboot.org/openbios/openbios-devel@462 f158a5a8-5612-0410-a976-696ce0be7e32
2009-02-28 18:38:55 +00:00
Alexander Graf
189c9077a1 This patch enables OpenBIOS to initialize on PPC64, enabling support for -cpu 970fx.
It gets up to the boot prompt and works rather good so far, though I haven't been able to run a kernel yet.

For more recent PowerPC CPUs the PTE layout has changed, so we need to take that into account and create PTEs according to the new layout and at the new physical positions.

Signed-off-by: Alexander Graf <alex@csgraf.de>
Signed-off-by: Laurent Vivier <Laurent@vivier.eu>



git-svn-id: svn://coreboot.org/openbios/openbios-devel@461 f158a5a8-5612-0410-a976-696ce0be7e32
2009-02-27 22:13:34 +00:00
Blue Swirl
3e926b99ce Postpone serial console use until PCI probe, fixes reset
git-svn-id: svn://coreboot.org/openbios/openbios-devel@459 f158a5a8-5612-0410-a976-696ce0be7e32
2009-02-21 17:13:41 +00:00
Laurent Vivier
21507bfb5b Extract "bootargs" from "boot" command line.
It is needed to boot Fedora-10 as we must specify the path to the yaboot.conf.

To boot Fedora:

boot cd: conf=cd:,\ppc\ppc32\yaboot.conf

so "bootpath" is "cd:", and "bootargs" is "conf=cd:,\ppc\ppc32\yaboot.conf"



git-svn-id: svn://coreboot.org/openbios/openbios-devel@456 f158a5a8-5612-0410-a976-696ce0be7e32
2009-02-18 13:58:35 +00:00
Laurent Vivier
d95cb61e29 remove unused function timer_calib_start
git-svn-id: svn://coreboot.org/openbios/openbios-devel@455 f158a5a8-5612-0410-a976-696ce0be7e32
2009-02-17 22:45:41 +00:00
Laurent Vivier
f0daea0151 In "<boot-script>", from bootinfo.txt, decode all bootinfo entities: device,
partition, directory, filename, full-path.

(as defined in "PowerPC Microprocessor CHRP binding r1.8", chapter 3.1.6.1.)



git-svn-id: svn://coreboot.org/openbios/openbios-devel@453 f158a5a8-5612-0410-a976-696ce0be7e32
2009-02-15 20:20:55 +00:00
Blue Swirl
9020fb5fa1 Support for Qemu -nographic flag
git-svn-id: svn://coreboot.org/openbios/openbios-devel@452 f158a5a8-5612-0410-a976-696ce0be7e32
2009-02-14 09:44:55 +00:00
Blue Swirl
c6040cb8a0 Add basic Mac99 machine support
git-svn-id: svn://coreboot.org/openbios/openbios-devel@449 f158a5a8-5612-0410-a976-696ce0be7e32
2009-02-08 12:22:04 +00:00
Laurent Vivier
b47d10c5e2 Extract correctly "&device;" and "&partition;" from bootinfo.txt.
To keep compatibility with yaboot (tested with debian install CD), 
put in bootpath a fully qualified path (<device>:<partition>,<filename>)



git-svn-id: svn://coreboot.org/openbios/openbios-devel@442 f158a5a8-5612-0410-a976-696ce0be7e32
2009-02-05 00:05:58 +00:00