Commit Graph

19 Commits

Author SHA1 Message Date
Thomas Huth 580d42015f Scan USB bus during boot.
For board-qemu, USB scan had to be triggered manually so far. Now it is run
automatically during each boot when an OHCI controller is available.
To determine the base address of the OHCI controller, we need translate-address.
However, this function does not work during the PCI scan on real hardware yet,
since the "assigned-addresses" properties might not be set up yet. Therefor the
translate-address is now done in the file usb-ohci.fs, which is now included
during the USB scan instead of the PCI scan.
For the real JS2x hardware there were also some words missing, like dma-alloc.
These are now provided, too, so the USB code now works on both again, emulated
and real hardware.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-10-12 16:24:55 +02:00
Thomas Huth 82954d4c10 Patch "interrupt-map" properties to contain the phandles from SLOF
The flattened device tree from QEMU contains some "phandle" and "linux,phandle"
properties which are referenced from the "interrupt-map" properties in the
pci root nodes. This is bad, since SLOF has a different concept of phandles.
Now the code patches the "interrupt-map" properties to contain the values
from SLOF and removes the "phandle" and "linux,phandle" properties from the
device tree.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-10-12 16:24:55 +02:00
Thomas Huth 4f0a051873 Added PCI DMA functions
DMA transfers can only happen within a dedicated DMA window, so we need
special functions for allocating buffers and for mapping these buffers in and
out again.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-10-12 16:24:55 +02:00
Thomas Huth c691959389 Set up PCI nodes on board-qemu
Populate the PCI device tree nodes with additional properties and words, and
provide enough of the SLOF PCI framework to be able to use the nodes with our
device specific drivers.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-10-12 16:21:48 +02:00
Thomas Huth eecba74b38 Fixed unit address handling for PCI nodes
Added proper encode-unit and decode-unit functions for the PCI root node and
fixed the unit address handling for PCI nodes in the fdt to OF1275 device tree
conversion function.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-10-12 13:20:00 +02:00
Benjamin Herrenschmidt c9d1203de0 Add RTAS config space accessors and skeletton PHB
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2011-10-12 13:20:00 +02:00
Thomas Huth d823eb86d6 Removed obsolete types.h header files
Our "portable" types are defined in stdint.h, so there is no need for the
types.h header files anymore.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-10-12 12:50:05 +02:00
Thomas Huth f227b33012 Cleaned up Makefiles
Replaced "make" by "$(MAKE)" to be able to built in parallel, fixed
the indentation of some rules and removed some unused targets.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-10-12 12:50:05 +02:00
Thomas Huth 4f6e2c9efe Fix compiler warnings
GCC 4.6 complains about unused-but-set variables - which can safely be removed
in our cases.
Also fixed a strict-aliasing problem in rtas_flash.c of board-js2x.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-10-12 12:50:05 +02:00
Thomas Huth 399e16b3f7 Make net-snk and modules relocatable, too.
Cleaned up the toc-relative assembly of net-snk, fixed the Makefiles, save the
modules as ELF files instead of raw binaries, adjust the net-snk base address
and the load-base variable... a lot of changes were required to make the net-snk
and the snk modules relocatable, too. But now it should be possible to relocate
all files so that the firmware also runs with less than 256 MiB RAM.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-10-12 08:58:04 +02:00
Thomas Huth 98cdbf03c1 Got rid of the ELF loader functions written in Forth, using libelf instead.
It's cumbersome to maintain code twice, in Forth and in C, and now that libelf
has a new important feature (relocation), I removed most of the old Forth
functions for ELF loading and use the libelf everywhere instead.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-10-12 08:44:23 +02:00
Thomas Huth ad3238534f Pass IMA to Paflof and fix the memory regions which have to be CLAIMed
Provide a IMA (initially mapped area) value to Paflof so that the Forth code
can properly claim the memory regions which are used by Paflof.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-10-12 08:44:11 +02:00
Thomas Huth 7a3606eeb9 Reworked libelf to support relocation
Split elf.c into elf32.c and elf64.c for better readability. Added relocation
code to libelf for 64-bit ELF images, modified the Paflof Makefile to link
the executable with relocation information and load Paflof now to the upper
end of the memory.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-10-12 08:43:50 +02:00
Thomas Huth b94bde008b Fix vSCSI device addressing method
According to the "SCSI Architecture Model", there are multiple ways to specify
the 64-bit LUNs in the SRP_CMD structure. SLOF was using the "Peripheral device
addressing method" (00b) which did not match the rest of the source code that
is trying to scan for target IDs, not bus/channel numbers. Now the method has
been switched to "Logical unit addressing method" (10b) which matches the rest
of the code and which is also used by the Linux kernel in the same way.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-09-16 15:53:13 +02:00
Thomas Huth 3a3f3280e6 Workaround for the VSCSI problems with latest qemu version
The VSCSI behaviour of upstream qemu has changed a little bit, so that the
read-capacity command from SLOF failed. We now issue a test-unit-ready for
normal disks, too, and explicitly check whether read-capacity returned valid
values to work-around the problem.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-08-19 15:06:09 +02:00
Thomas Huth 1d41e8a29b Fixed some problems with libnvram
- On board-qemu, the logging partitions were too big (bigger than the total
  NVRAM size).
- Fixed a compiler warning about type-punned pointers in nvram.c
- When DISABLE_NVRAM is set, the fake buffer should not be accessed with
  cache-inhibited functions
- Makefile did not generate proper dependencies

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-08-19 14:57:32 +02:00
Thomas Huth f36326c115 Cleaned up vio-vscsi.fs a little bit
Got rid of the target-id/target-lun hack. Instead we're now creating a
temporary node instance for scanning, too.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-08-19 14:34:09 +02:00
Thomas Huth 5a9155e834 Fixed problem with potentially unitialized variable.
GCC complained about an uninitialized variable in the veth_receive() receive
function. And indeed, the buf variable might have been used uninitialized here
when the packet could not be handled and the code jumped to the recycle part
immediately.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-06-06 15:30:22 +02:00
Benjamin Herrenschmidt 39426bad55 Initial qemu/KVM board support
Added a new board for SLOF running on KVM/qemu.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-03-22 15:22:00 +01:00