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>
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>
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>
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.htmlhttps://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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>