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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
- 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>
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>
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>
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>