Commit Graph

166 Commits

Author SHA1 Message Date
Benjamin Herrenschmidt 989d27121e Fix inverse display
Trying to display in "inverse" mode causes us to display black on black

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-05-14 15:56:29 +10:00
Thomas Huth eedaba3a2e Fixed some bugs in the bootinfo.txt parsing code
The bootinfo.txt parsing code assumed that the filename to the boot loader
always contained a backslash. However, this is maybe not the case if the
boot loader has been put into the root directory of the filesystem. For example
SLES 8 used "boot &device;:1,yaboot.chrp" in its boot-script. Now we look for
the &device; string instead which should always work.
SLOF also failed if there were parameters after the path to the boot loader.
Now we take care of the parameters, too.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2012-04-30 10:38:56 +02:00
Thomas Huth 042cb119ec Fixed ISO9660 filesystem directory parsing with a lot of entries
According to the ISO9660/Ecma-119 standard, directory entries must not cross
the boundary of a sector. That means that there might be some padding after
the last directory entry that still fitted into a sector. SLOF did not take
this into account yet so it failed to find files in directories which used
more than one sector for its directory entries. Now we are taking the padding
into account so the "file not found" problems should be gone.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2012-04-30 10:27:55 +02:00
Thomas Huth 8835553822 Use rtas-start-cpu from common code folder.
No need to redefine rtas-start-cpu in the board-qemu folder again, we can use
the function from the common code folder instead.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2012-04-25 19:29:07 +02:00
Thomas Huth 5c79eb0c59 Enable RTAS reboot and power-off for board-qemu, too.
Now that QEMU supports these two RTAS calls, we can also use them on board-qemu.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2012-04-25 19:21:49 +02:00
Thomas Huth 5d9ba900d2 Fixed typo 2012-04-25 19:21:33 +02:00
Thomas Huth 157c561405 Cleaned up envvar.fs and fixed the behaviour of env-bytes config variables
Some parts of envvar.fs were quite hard to read due to bad indentation, and
the handling of env-byte variables was quite shaky. Fixed and cleaned up the
code now so that it should be more maintainable now.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2012-03-16 11:43:01 +01:00
Thomas Huth 4c00ad329d Always enabled nvram-debug function
This function is also handy when we only fake a NVRAM, so let's always
enable it.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2012-03-16 11:40:41 +01:00
Thomas Huth a603c2e6f4 Removed obsolete netflash code.
Flashing on JS2x is done via the "update-flash" Forth code nowadays (see the
file slof/fs/update_flash.fs for details), so there is no need to maintain the
obsolete netflash code anymore.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2012-02-27 11:39:17 +01:00
Thomas Huth cf13fc9bee Added the possibility to debug the "getprop" client interface calls
To analyze the behavior and requirements of boot loaders and OS clients, it's
crucial to know which properties they try to read from our device tree. Thus
we need the possibility to debug the "getprop" client interface call.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2012-02-27 10:44:25 +01:00
Thomas Huth 33f6dd25bb Removed unused PCI Forth functions.
assign-bar-mapping and assigned-addresses-property are not needed anymore.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2012-02-23 18:44:44 +01:00
Benjamin Herrenschmidt 440e662879 Use hv-logical-memop for blinking the screen on qemu vga
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-02-22 10:34:27 +11:00
Benjamin Herrenschmidt e6aac8b56d Expose hv-logical-memop to forth code
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-02-22 10:34:00 +11:00
Benjamin Herrenschmidt 7add7a0a9f Move _FASTRMOVE implementation into headers & support new hcall
This moves _FASTREMOVE to the cache.h header, 970 uses the
existing code, p7 now uses the new memop hcall.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-02-22 10:33:18 +11:00
Benjamin Herrenschmidt 0dfcbc1336 Add a proper compiler barrier between prim's
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-02-22 10:31:07 +11:00
Benjamin Herrenschmidt 68e63dafa7 Change RTAS checkpoint numbers to avoid overlap
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-02-22 10:29:11 +11:00
Benjamin Herrenschmidt 17f7f20d04 Fix address masking for video cards
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-02-22 10:27:59 +11:00
Thomas Huth d153364253 Removed pci-setup.fs
The file pci-setup.fs provided the basic PCI environment in the past when we
did not do a full PCI scan yet. Now that we include the whole PCI scan functions
via pci-scan.fs in tree.fs, the pci-setup.fs file is not needed anymore.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2012-02-16 08:38:48 +01:00
Thomas Huth 2eed580261 Fixed disk-label partition parsing to also work with single partition arguments
The parse-partition function was not able to deal with arguments that only
contained a partition number (without comma), e.g. "boot disk:1" failed.
Also limited the size that we load from a PReP partition in case the hard disk
is smaller than max-prep-partition-blocks.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2012-02-14 09:01:46 +01:00
Thomas Huth 0bede83ced Fixed debugger for functions with (doito)
Functions that use the TO keyword with an instance variable need some special
treatment, just like we did it with the TO for normal variables already (see
the usage of <doto> in debugger.fs).

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2012-02-14 09:01:46 +01:00
Thomas Huth 34717b356a Fixed $call-method to clean up the return stack in case of errors.
There was a bug that occured when yaboot tried to load its configuration file
via network. The net-snk tries to probe the device tree node for write and read
methods (see ci_device.c), which triggers $call-method in the end. But when
$call-method failed, it did not restore my-self and the return stack, which
caused some bad crashes.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2012-02-14 09:01:46 +01:00
Thomas Huth b46da96a00 Added a possibility to debug the client interface calls
Set "debug-client-interface?" to TRUE to enable the debug messages.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2012-02-14 09:01:46 +01:00
Thomas Huth 5ab9ef4e71 Do not blindly scan all PCI bus IDs
We know that QEMU always starts with bus ID 0, so to speed up the boot process
quite a bit, we do not have to scan all 255 bus IDs here. In full emulation
mode, SLOF now boots ~20 seconds faster when there are no PCI devices attached.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2012-02-14 09:01:45 +01:00
Thomas Huth 22f6383925 New oco for JS20
The old file did not work with new compilers anymore.
2012-02-02 08:55:19 +01:00
Benjamin Herrenschmidt 839b9d1be2 Add cirrus support under qemu
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-01-19 17:17:50 +11:00
Benjamin Herrenschmidt ff882e7d32 vga: Small fixes
Properly clear screen and don't write to constants

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-01-19 17:17:50 +11:00
Benjamin Herrenschmidt 44e8d9a57d Add virtfs support
Code originally written by Timothy Rule and reworked &
bug fixed by myself

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-01-19 17:17:50 +11:00
Benjamin Herrenschmidt ca610c931e Move virtio to a separate library
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-01-19 17:17:50 +11:00
Thomas Huth adde61dfeb FCODE: Support for old-fashioned "local values" tokens
One of the old FCODE tokenizers uses the opcodes in the range of 0x407 to 0x41f
for supporting Forth local values. To get these FCODE programs working, we have
to support these opcodes, too.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2012-01-13 10:40:22 +01:00
Thomas Huth 69dec20994 Updated the documentation
Now the documentation reflect that we support KVM/QEMU, too. Also added a
short section about the source code structure.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2012-01-12 17:18:57 +01:00
Benjamin Herrenschmidt ab062ff3b3 Fix ram-boot handling of 64-bit addresses
Hex vs. decimal thinko

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-01-12 12:31:17 +11:00
Benjamin Herrenschmidt 509185b812 usb-ohci: Avoid instance specific allocations
The USB stack did instance specific allocations for the
various buffers, but would then assign them to package
specific lists, and would generally get badly confused
as soon as multiple instances of the driver got opened.

This typically occurs when using a USB keyboard and booting
from a USB disk.

This makes everything node variables instead, with tracking
of how many instances are open, with one allocation pass
on the first open and one free pass on the last close.

The result is a lot more reliable, I can boot with USB keyboard
and a USB disk fine without hanging qemu.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-01-12 12:31:17 +11:00
Thomas Huth 3a88b69f2f Fixed problem in framebuffer code when erasing or inserting characters.
When erasing characters or when inserting characters in the middle of a line,
the framebuffer code did not correctly calculate the line width, since it was
not taking the bit depth into account yet.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2012-01-11 12:25:05 +01:00
Benjamin Herrenschmidt c1394c3d2a Support new-style PCI for qemu board
We now support populating the device-nodes ourselves when using
a newer qemu which doesn't do it anymore.

Note: I have removed the support for working with the existing
device nodes, so qemu needs to be updated in sync with slof

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-01-11 12:48:40 +11:00
Benjamin Herrenschmidt c90d5abd0d Fix virtio access size
We don't support 8-bytes PIO

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-01-11 11:54:24 +11:00
Benjamin Herrenschmidt 59f6d802f3 Fix inline asm for ci_write_xx
It was clobbering r4 and not marking it as such, causing
problems among others in virtio-blk

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-01-11 11:54:24 +11:00
Benjamin Herrenschmidt 3a7cb8581e vga: support for 15bpp
This is the default in qemu now

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-01-11 11:54:23 +11:00
Benjamin Herrenschmidt 2896f6cf73 qemu: Allow qemu passing the boot kernel directly
We do that by replacing the word "boot-command" to return
"(boot-ram)" (but we don't change the nvram env).

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-01-11 11:54:23 +11:00
Thomas Huth 895e94fe32 Add support for instance specific "my-unit" settings
According to IEEE 1275, the "my-unit" command shall return the unit address
of the current _instance_, i.e. this unit address can be set differently for
each instance, it is not bound to the physical unit address like "my-space"
and "my-address". This behaviour is expected by the Citrine FCODE for example,
which does not set a physical unit address for the "sd" (disk) nodes, but
needs the unit address to be specified when opening the device tree node
instead.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-12-29 16:48:09 +01:00
Thomas Huth 8536acbc9f Enabled -Wmissing-prototypes and -Wstrict-prototypes CFLAGS and cleaned up
These two compiler flags for additional warnings help to improve the quality
of the source code: Removed some unused code and fixed some obvious bugs.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-12-28 18:38:39 +01:00
Thomas Huth 23c9ac8981 Source code beautification
Some functions in node.fs were formatted in a very bad way, using wrong
indentation or mixing spaces and tabs for indentation. Cleaned this up now,
without doing any functional changes.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-12-28 18:33:21 +01:00
Thomas Huth ef727e4b6f Improved "tick", postpone and $FIND commands
When the ' (tick) or postpone commands hit an unknown function, they simply
printed out "undefined word" without telling which word was not defined. These
problems were quite cumbersome to debug since it was quite hard to find the
right spot in the source code where such problems happened. Now the tick and
postpone command store the name of the undefined word, too, so that the code
which catches the ABORT also prints this information.
I also fixed the $FIND command to be standard compliant right from the start
(so that it leaves the string parameters on the stack in case the word has
not been found).

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-12-28 15:05:23 +01:00
Thomas Huth 46b5160777 Fixed yet another bug in open-node
When the "open" method of the target node failed, the open-node function did
not correctly restore the previous value of "my-self" (it was using my-parent
of the new node to restore the previous value, but that did not work when the
new node could not be opened). Now the old value of "my-self" is saved on the
return stack instead and then always correctly restored.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-12-22 16:59:04 +01:00
Thomas Huth d249d1b5d3 Enable 16 bit and 32 bit color depth support in QEMU VGA device driver
Now that our framebuffer code basically supports 16 and 32 bit color depths,
we can also enable support for these resolutions in the QEMU VGA device driver.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-12-21 12:07:14 +01:00
Thomas Huth 72811e02b3 Disable the debug message about FDT phandles that could not be replaced
The "Warning: Did not replace phandle in XYZ" messages could confuse the
normal users, so they are now only printed when running in diagnostic-mode.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-12-21 11:32:10 +01:00
Thomas Huth caf3ad3e8d Improved framebuffer code to support more than only 8-bit resolutions
With these changes, it should be possible to use screen depth of 16 bit and
32 bit as well.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-12-20 19:30:10 +01:00
Thomas Huth 1d328fe603 Fixed assembler constraints for lwbrx and lhbrx
The biosemu on bimini had some problems with newer versions of GCC ... I saw
on a couple of websites that for lwbrx and lhbrx, the assembler constraint
"Z" should be used instead of "r". This seems to fix the hang.
2011-12-20 18:53:08 +01:00
Thomas Huth deb63aa40e Fixes for using the USB keyboard driver on QEMU
For some reasons, interrupt transfers do not work right on QEMU, so we use
control transfers there instead. Also digest one key scancode at a time only
to avoid the problem with phantom keypresses.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-12-20 17:56:48 +01:00
Thomas Huth 760473678d Do not override the "model" property of the root node.
QEMU already provides a string for the "model" property of the root node.
We should not change this to avoid incompatibilities with the kernel.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-12-20 17:56:48 +01:00
Thomas Huth 05a38d52f8 Source code beautification
Cleaned up indentation and superfluous white spaces in usb-keyboard.fs

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-12-20 17:56:48 +01:00