Commit Graph

725 Commits

Author SHA1 Message Date
Nikunj A. Dadhania 0ad10f26c9 SLOF: Support PAPR NVRAM RTAS calls
BenH still need to ACK this though.

From: Nikunj A. Dadhania <nikunj@linux.vnet.ibm.com>

* Determines size of the flash using device tree.
* Provides nvram access functions for RTAS_NVRAM
* Allocates temporary buffer of nvram in SLOF code and use that in C.
  (sbrk not available)
* NVRAM_LENGTH is used at various places, make sure it is well guarded
  and also use dynamically determined size once an RTAS-NVRAM is
  found.
* Use NVRAM_LENGTH as a variable in case of RTAS_NVRAM, not very
  elegant though

Signed-off-by: Nikunj A. Dadhania <nikunj@linux.vnet.ibm.com>

--

Changelog from v1:
* #define cleanups suggested by Thomas/Benh
* Fix makefile which missed passing $FLAG for building llfw
* renamed vio-nvram.fs as rtas-nvram.fs
2012-10-17 16:30:58 +11:00
Ben Herrenschmidt 7000cbc4e1 Workaround for SLES11 installer bug
This is a hack to work around some stupid behaviour in the SLES11
installer.  It expects a node named simply "disk" under the VIO SCSI
device node, rather than individual disk@XXX devices.  pHyp doesn't
enumerate the disks, and so provides such a node with the disk only probed
when the device is actually opened.  SLOF does enumerate the disks and so
provides the nodes with specific unit addresses instead, breaking the
installer.

The installer doesn't actually use anything in the "disk" node however, it
just expects it to be there, so this hack provides a dummy node to make
the installer happy.

Signed-off-by: Ben Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2012-10-17 16:30:58 +11:00
David Gibson 840aa7ca1f Update .gitignore files
This updates a number of .gitignore files to ignore generated targets of
various sorts.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2012-10-17 16:30:58 +11:00
Alexey Kardashevskiy f21f7a3f46 Added ibm,req#msi and ibm,req#msi-x to device nodes
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2012-07-31 16:24:30 +10:00
Benjamin Herrenschmidt 7279655af2 vscsi updates to match IBM OFW variant
This update our vscsi to encode unit-addresses the same way as IBM
proprietary OFW does, and adds support for the vscsi-report-lun
method.

This fixes booting with grub2 on fedora. It also means that we now
support devices with LUNs.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-07-19 16:44:17 +10:00
Benjamin Herrenschmidt 748d6ae8ae Fix encode/decode-unit to use a full 64-bit @xxxx value
Currently, for devices with a 2 cells address, we always use the
form @hi,lo which doesn't match what pseries OFW does and is generally
awkward. This changes things to use a single 64-bit number instead

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-07-19 16:42:47 +10:00
Alexey Kardashevskiy 0c0331e83e Added interrupt-map + swizzling for bridges.
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2012-06-29 15:56:15 +10:00
Alexey Kardashevskiy 05a383ee8b Fixes error preventing from scanning PHBs with devices type1 (bridges):
E3401: Aborting boot,  no current instance
 no current instance

The fix is taken from pci-device.fs.
2012-06-29 15:50:24 +10:00
Benjamin Herrenschmidt cd5f73de2b Fixes to ANSI escape sequence handling
We have a couple of issues making grub2 essentially unusable when
using a framebuffer console:

 - When we encounter a ";" in a CSI sequence, we still stop the
parsing, so all the positioning sequences are broken

 - We made a pretty poor choice of when to use invert video,
basically switching to invert whenever a "m" sequence had any
non-zero value. Instead we remember the foreground and background
colors set by the client and use invert when the foreground value
is lower (or equal) to the background value.

There is still a -lot- of improvements to do here (including proper
support for colors) but at least this makes grub2 from fedora 17
usable.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-05-14 16:01:33 +10:00
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