Commit Graph

725 Commits

Author SHA1 Message Date
Thomas Huth b3804299da Clean up pending packet variable in ipv4 code
The pending_pkt structure is not really an ARP cache entry, and
the fields .ipv4_addr, .mac_addr and .pkt_pending were only set
but never read again. So to avoid confusion, convert the pending
packet structure into a simple array for storing the packet and
an additional length variable.

Reported-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-12-01 17:02:04 +11:00
Thomas Huth a2e7a5c2be Fix tracking of pending outgoing packets when handling ARP replies
pending_pkt.pkt_pending is never read, thus setting it to 0
in handle_arp() does not make much sense. On the other hand,
arp_table[i].pkt_pending is never set back to 0, but it is
checked for tracking which packets still have to be sent
in handle_arp(), thus we might send out the same queued packet
multiple times when receiving more than one ARP packet from the
other side.
So setting "pending_pkt.pkt_pending = 0" seems to be a typo, and
"arp_table[i].pkt_pending = 0" should be right instead.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-12-01 17:02:04 +11:00
Alexey Kardashevskiy b4c93802a5 version: update to 20151103
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-11-03 13:12:10 +11:00
Alexey Kardashevskiy 396df97cc5 documentation: Add a clause about signing off
This adds a reference to the Developer Certificate of Origin (copied below)
to tell people that they have to sign their work and the consequences
this implies.

===
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
660 York Street, Suite 102,
San Francisco, CA 94110 USA

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.
===

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-11-03 12:00:25 +11:00
Alexey Kardashevskiy 12cbf22606 qemu/js2x/client: Support binutils >= 2.25.1
The recent binutils version introduces explicit definition of
a TOC symbol which points to the .toc section and enforces .toc
alignment to 256 rather than 8 bytes before.

For now the TOC symbol points to same location as it was before -
start of .toc + 0x8000; however as this might change, we should not
rely on that in the source code.

This changes __toc_start (for qemu and js2x boards), _got (for net-snk,
takeover, rtas) in linker scripts to use explicitely defined TOC if
defined and fall back to the older scheme if not.

This changes r2 (the register pointing to TOC) setup code not to add
0x8000 as linker scripts do that now.

Here is a bit more information about the change:
https://sourceware.org/ml/binutils/2015-10/msg00124.html
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=a27e685fa0a6480bdb07e3be359558524cec89b7

Tested on
1. gcc version 4.8.3 20140911 (Red Hat 4.8.3-7) (GCC)
   GNU ld version 2.23.2
2. gcc version 5.2.1 20151001 (GCC)
   GNU ld (GNU Binutils) 2.25.51.20150930

Reported-by: William Grant <wgrant@ubuntu.com>
Tested-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-11-03 12:00:22 +11:00
Dinar Valeev 67422f9371 Fix special keys on USB
This patch fixing HOME, INS, END and DEL keys in Grub, when USB
keyboard is used. Those keys are useful in faster grub interaction in
automated tests.

Signed-off-by: Dinar Valeev <dvaleev@suse.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-10-22 12:06:16 +11:00
Dinar Valeev 43c9abfd81 Fix function keys on USB
This is fixing F1-F12 keys in grub2.

Sequence was grabbed by running cat in xterm and pressing relative
function key.

Signed-off-by: Dinar Valeev <dvaleev@suse.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-10-22 12:05:57 +11:00
Nikunj A Dadhania 9633e036ae pci-scan: program 64-bit mem bar range in pci-bridge bar
If the devices beyond the bridge requests 64-bit mem
current code does not correctly program the bridge range properties.

64-bit prefetchable memory region is tracked by
pci-[next,max]-mem64. Use these to program the
pci bridge range registers.

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-10-10 20:32:06 +11:00
Dinar Valeev 14f14004dd Allow to build SLOF on Little Endian host
Don't require cross compiler in order to build SLOF on ppc64le platform.
Native compiler is capable to build ELFv1 BE binary. We just need to
instruct it how to do it. By adding -mbig and -mabi=elfv1 flags

Signed-off-by: Dinar Valeev <dvaleev@suse.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-10-10 20:31:57 +11:00
Nikunj A Dadhania 2757414329 usb-xhci: add keyboard support
Add support for xhci interrupt pipes needed for keyboard handling

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-10-06 12:52:02 +11:00
Nikunj A Dadhania ec94b351f6 usb-xhci: ready the link trb early
The keyboard events being async, need to prepare the link when last but
one trb is queued.

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-10-06 12:51:09 +11:00
Nikunj A Dadhania 35f9876b6a usb-xhci: scan usb high speed ports
Current code scanned only the super speed ports. Add support for
scanning high speed ports as well.

Also re-org code to reduce duplication of code.

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-10-06 12:51:01 +11:00
Nikunj A Dadhania 94168f451f usb-xhci: bulk improve event handling loop
Since the controller was being used by single user, event poll loop
works without verifying what event returned. Now with usb-keyboard
addition where we will get keyboard events, this would not work.

Transfer bulk would only look for response from the trb queued and
ignore rest of the events. Moreover, while bulk transfer is going on,
there are no keyboard events in booting use case.

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-10-06 12:50:50 +11:00
Nikunj A Dadhania 8d2f3ba631 usb-xhci: return on allocation failure
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-10-06 12:50:39 +11:00
Nikunj A Dadhania 2a37eb9a6a usb-xhci: add delay in shutdown path
QEMU implementation of XHCI doesn't implement halt properly. There might
be ongoing activities and active DMAs, introduce 50ms delay during
shutdown path.

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-10-06 12:50:31 +11:00
Nikunj A Dadhania 41c2c5df4f usb-xhci: event trbs does not need link trb
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-10-06 12:50:23 +11:00
Nikunj A Dadhania f591c5d7a2 usb-hid: refactor usb key reading
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-10-06 12:50:12 +11:00
Thomas Huth cdd5077650 takeover: Fix header includes
The ioctl.h header has been removed with commit 6495aef5b6
("net-snk: Remove module system"), so it can not be included in
the takeover client anymore. Thus remove the include statement (which
is no problem since the takeover client does not use ioctls anyway).
Include unistd.h instead, to avoid that the compiler is printing
out a warning about a missing prototype of the function sbrk().

Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-09-30 15:10:58 +10:00
Thomas Huth 1c9af10b8a board-js2x: Add missing file dma-function.fs
The PCI scan code needs the functions from the file
dma-function.fs - and this had been forgotten to be
included in the rom filesystem of board js2x. So add
it here, too, to avoid that the boot process aborts
due to the missing functions.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-09-30 15:10:58 +10:00
Benjamin Herrenschmidt 534cfe0a3f vga: Add support for virtio-vga
Move the bulk of the qemu VGA code to a qemu-vga.fs file and include
it from both the qemu std PCI device and a qemu virtio VGA PCI device

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
[aik: removed trailing spaces, changed year 2011 to 2015 in copyright notice]
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-09-30 15:10:54 +10:00
Benjamin Herrenschmidt 838a9fffba qemu-vga: Use MMIO BAR instead of legacy IO ports
Qemu "std" VGA has long supported MMIO-only operations instead of
legacy IO ports. This switches to using those.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-09-18 16:46:44 +10:00
Thomas Huth 882bbc2734 slof: Change call_c() function to a proper assembler function
Using inline assembly for the call_c() function does not work
properly: Recent versions of the GCC compiler save some registers
to negative offsets on the stack before executing the inline
assembler code (to the so-called "red zone", which is OK according
to the ABI), since the compiler does not know that this assembler
code jumps to another function. However that other function might
also put some values on the stack, which can destroy the saved
values, causing weird effects or crashes.
To be on the save side, move the jump code to a proper assembler
file instead, so we do not have to make any bogus assumptions
for the inline assembly anymore.
This fixes the issue with "Cannot open file : fbuffer.fs" etc.
messages that occured with GCC versions >= 4.9

Signed-off-by: Thomas Huth <thuth@redhat.com>
Acked-by: Segher Boessenkool <segher@kernel.crashing.org>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-09-17 11:45:32 +10:00
Alexey Kardashevskiy 811277ac91 version: update to 20150813
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-08-13 19:06:11 +10:00
Thomas Huth 86b2718b46 Add missing half word access case to _FASTRMOVE and _FASTMOVE
The _FASTRMOVE and _FASTMOVE macros are missing the case where
the alignment matches "6" - in this case, the copying can also
be done with 16-bit accesses.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-08-05 16:02:34 +10:00
Thomas Huth f879da7948 Remove unused RMOVE64 stub
It has never been implemented, so remove the comment.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-08-05 16:02:26 +10:00
Thomas Huth 47a425db40 fbuffer: Implement RFILL as an accelerated primitive
By implementing RFILL as an primitive, we can get a huge
speed-up of the screen erasing function. On board-js2x,
it writes the pattern directly into the IO region, and on
board-qemu it uses the KVMPPC_H_LOGICAL_MEMOP hypercall to
copy the pattern from a temporary buffer into the IO region.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-08-05 16:02:18 +10:00
Thomas Huth 59a135eb78 fbuffer: Implement MRMOVE as an accelerated primitive
The character drawing function fb8-draw-character uses "mrmove"
(which moves main memory contents to IO memory) to copy the data
of the character from main memory to the frame buffer. However,
the current implementation of "mrmove"  performs quite badly on
board-qemu since it triggers a hypercall for each memory access
(e.g. for each 8 bytes that are transfered).
But since the KVMPPC_H_LOGICAL_MEMOP hypercall can transfer bigger
regions at once, we can accelerate the character drawing quite a
bit by simply mapping the "mrmove" to the same macro that is
already used for the "rmove" (which is normally only used for
copying from IO memory to IO memory, but on board-qemu it does
not matter). For keeping board-js2x in sync, this patch also
transforms the "mrmove" for js2x into primitives.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-08-05 16:01:39 +10:00
Thomas Huth d0732f556d fbuffer: Precalculate line length in bytes
The framebuffer code calculates the length of a line in bytes over
and over again, even in the tight innermost loops of the drawing
functions. We can easily avoid this multiplication and make the
code more readable by storing this value in a variable instead.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-08-05 16:00:52 +10:00
Thomas Huth 007c450044 terminal: Disable the terminal-write trace by default
The terminal-write function has a built-in trace buffer feature
which is currently always enabled. Since this is only needed
for debugging, let's disable this feature by default. It can
easily be enabled again by typing "true to twtrace-enabled?"
at the Forth prompt.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-08-05 16:00:40 +10:00
Nikunj A Dadhania bb624f7b53 boot: remove trailing ":" in the bootpath
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-08-05 15:06:15 +10:00
Nikunj A Dadhania 2a3b6f8bfa ci: implement boot client interface
IEEE1275 - "Standard for Boot", section 6.3.2.5:
Implements "boot" client interface which will store the bootspec
passed by the client and resets the system. The system comes
back with the settings specified in bootspec.

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-08-05 15:06:04 +10:00
Nikunj A Dadhania 3a00f80e06 boot: bootpath should be complete device path
de-alias the booting device alias so that complete device path is
stored in /chosen/bootpath. This is in accordance with IEEE1275
section A.2

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-08-05 15:05:49 +10:00
Thomas Huth d4a6b1d29d fbuffer: Use a smaller cursor
Drawing the cursor in the frame buffer memory is a very, very
slow operation. So let's simply switch to a "underscore" cursor
instead of the full block cursor to save some precious cycles.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-08-03 12:57:35 +10:00
Thomas Huth be3d1ca710 fbuffer: Improve invert-region helper
The introduction of invert-region already speeded up the cursor
drawing very much. But there is still space for improvement:
So far invert-region is accessing the memory only byte by byte,
but with some additional logic that checks the alignment of the
address and the length of the area, we can also make this function
to access the memory with half-word, word or long-word accesses.
With this additional logic, invert-region-x is also no longer
necessary and thus can be removed.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-08-03 12:57:24 +10:00
Dinar Valeev c8bd0cdce2 usb-hid: Caps is not always shift
Caps behaves like shift only for latin characters.
In case we're typing - for example with caps enabled, SLOF picks _ char
from shifted table.

Treat caps as shift only for letters.

Signed-off-by: Dinar Valeev <dvaleev@suse.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-07-20 21:04:26 +10:00
Bharata B Rao f8e7ca8e06 cas: Increase FDT buffer size to accomodate larger ibm, cas node properties
When QEMU starts with a higher value of maxmem, ibm,dynamic-memory
property under ibm,client-architecture-support device tree node can
consume a large FDT buffer space.

Accommodate this by increasing the FDT buffer size passed from SLOF
to QEMU to 128KB from the current 32KB.

Tested with QEMU options:
"-m 2G,slots=16,maxmem=1024G -smp 255 -cpu host,compat=power7"
on a POWER8 host with /sys/devices/system/cpu/subcores_per_core=4

Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
Cc: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-07-13 13:32:29 +10:00
Alexey Kardashevskiy ba71dece3e README: Update with patch submittion note
This adds a maillist and emails to be used when posting a patch for SLOF.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: Thomas Huth <thuth@redhat.com>
2015-07-06 21:01:48 +10:00
Nikunj A Dadhania 0097e61aa5 disk-label: add support for booting from GPT FAT partition
For a GPT+LVM combination disk, older bootloader that does not support
LVM, cannot load kernel from LVM.

The patch adds support to read from BASIC_DATA UUID partitions for the
case that the OS installer has installed the CHRP-BOOT config on a FAT
file system.

Makes GPT detection robust
* Fix bug in seek-pos updation code
* Check for Protective MBR Magic
* Check for valid GPT Signature
* Boundary check for allocated block size before reading into the
  buffer

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-07-04 11:51:32 +10:00
Nikunj A Dadhania 30632f2c08 disk-label: introduce helper to check fat filesystem
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-07-04 11:51:18 +10:00
Nikunj A Dadhania fd5d7089dd introduce 8-byte LE helpers
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-07-04 11:51:05 +10:00
Nikunj A Dadhania 655fabf136 disk-label: simplify gpt-prep-partition? routine
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-07-04 11:50:52 +10:00
Alexey Kardashevskiy 99c534ecc7 fbuffer: introduce the invert-region-x helper
This patch simply moves the slow RX based logic from fb8-invert-screen
to board-js2x helpers and implement a fast hv-logical-memop based helper
for board-qemu. And we can drop hcall-invert-screen !

Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
[aik: removed one empty line]
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-05-29 14:57:52 +10:00
Greg Kurz 4c7a70f061 fbuffer: introduce the invert-region helper
The inner loop in fb8-toggle-cursor can be implemented with hv-logical-memop
in board-qemu and get an incredible performance boost.

Let's introduce a per-board helper:
- board-js2x: slow RB based, taken from current fb8-toggle-cursor
- board-qemu: faster hv-logical-memop based

With standard graphical settings on board-qemu, we go from 512 hcall
invocations per character down to 16.

Suggested-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-05-29 14:57:30 +10:00
Greg Kurz 57ca8e04b4 fbuffer: simplify address computations in fb8-toggle-cursor
The inner loop deals with a contiguous region. It could easily be replaced
by faster board specific functions like hv-logical-memop in board-qemu.
Since hv-logical-memop does not return an address, let's have the enclosing
loop compute the next line address by itself and drop the confusing
"char-width screen-depth * -" address adjustment.

Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-05-29 14:57:07 +10:00
Nikunj A Dadhania 7d766a3ac9 version: update to 20150429
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-05-07 16:55:25 +10:00
Nikunj A Dadhania be9b2fa44c pci: Use QEMU created PCI device nodes
PCI Enumeration has been part of SLOF. Now with hotplug code addition
in QEMU, it makes more sense to have this code in one place,
i.e. QEMU.

Adding routines to walk through the device nodes created by QEMU. SLOF
will now configure the device/bridges and program the BARs for
communicating with the devices.

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-05-07 16:53:13 +10:00
Nikunj A Dadhania d5c4b47104 usb: support 64-bit pci bars
With the addition of 64-bit bar ranges (commit: 9fbfed08 - pci: use
64bit bar ranges), the usb-setup-hcidev needs to handle 64-bit
addresses.

For example, QEMU provided NEC USB XHCI device requests 64-bit memory
address. Added code to check the memory type before address
translation.

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-05-07 16:52:51 +10:00
Nikunj A Dadhania cb4e9e99eb pci: Support 64-bit address translation
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-05-07 16:51:58 +10:00
Nikunj A Dadhania 893ebad99d pci: program correct bridge limit registers during probe
According to the pci-to-pci bridge specification, memory/io limit
should be the last address of the window, while currently its set to
last + 1. It broke when the memory range was increased and hit 32-bit
limit. The last address in the window is 0xFFFF.FFFF and max-mmio is
0x1.0000.0000, because of the bug 0x0000 got programmed in the memory
limit register. All the mmio reads across the pci-to-pci bridge
started failing during probe.

All pci-bridge-set-[mmio,mem,io]-base sufferred from similar problem.

Suggested-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-05-07 16:47:22 +10:00
Nikunj A Dadhania c03647c19b scsi: handle report-luns failure
When report-lun fails, number of luns returned is 0.

Due to FORTH semantics of "DO ... LOOP", it will enter loop and
execute, when the counter is 0.

For this "?DO ... LOOP" should be used to solve this problem

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-04-07 16:07:03 +10:00