The "key?" Forth word did not work when being used for polling keyboard
events from USB keyboards since the usb_key_available() function never
triggered any USB transfers. Fix it by also refactoring usb_read_keyb()
a little bit so that both functions now use the same code for checking
for new keyboard events.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
The bulk.fs package was part of the old USB stack and is now not
required anymore.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Make sure to include make.rules from the Makefiles in the common
lib folder to get some more sane console output during the build
process.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
The value returned by virtio_vring_size() is used to allocate memory
for vring. The used descriptor list (array of vring_used_elem) is
counted by the header - vring_used struct - is not.
This fixes virtio_vring_size() to return the correct size.
At the moment rings are quite small (256) and allocated with
4096 alignment, this is why we have not been having issues with
this so far.
Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Reviewed-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---
Changes:
v2:
* remove magic numbers
Every caller of SLOF_alloc_mem_aligned() assumes the size is the first
argument while it is not.
This switches align and size and fixes random memory corruptions.
This is grep for SLOF_alloc_mem_aligned with this patch applied:
include/helpers.h|27| extern void *SLOF_alloc_mem_aligned(long size, long align);
lib/libveth/veth.c|103| buffer_list = SLOF_alloc_mem_aligned(8192, 4096);
lib/libveth/veth.c|105| rx_queue = SLOF_alloc_mem_aligned(rx_queue_len, 16);
lib/libvirtio/virtio-net.c|101| vq[i].desc = SLOF_alloc_mem_aligned(virtio_vring_size(vq[i].size), 4096);
slof/helpers.c|70| void *SLOF_alloc_mem_aligned(long size, long align)
Reviewed-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
The "Open Firmware Recommended Practice: 16-color Text Extension"
document specifies how the first 16 colors of a palette should be
set. So let's use these colors in SLOF, too.
Also move the function for initializing the palette into the
common graphics.fs file so that we do not have to do this change
twice.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
draw-rectangle, fill-rectangle and read-rectangle were only working
with 8-bit color depth displays so far. This is fixed now for 16-bit,
24-bit and 32-bit color depths, too, by taking the "screen-depth"
into account.
And while we're at it, consolidate all the same copies of these
functions into one common file (graphics.fs) so that we do not
have to do these modifications multiple times in different files.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
One of the hunks in the patch file was bad, so replace it with a proper hunk.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Fixed the compiler warnings about wrong and missing prototypes in the
biosemu snk code.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
It's easier to use "device-type" instead of creating the
corresponding properties manually.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
There's no need for a device_type property here, but according
to IEEE1275, it should have a "relative-addressing" propery instead.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
At the moment SLOF adds a "device_type" property automatically for
every single PCI device based on its class even if there is no SLOF
driver for such a device. OF1275 says that "device_type" is for
implemented interfaces only. A side effect of this is virtio-balloon
getting device_type=="memory" while it should not have.
This removes automatic call to device-type from the common PCI code.
Since now, we rely on existing SLOF PCI drivers to call device-type if
needed. virtio-blk/net, e1000, ohci/ehci/xhci do this. virtio-scsi
does not create the property for itself but disks on its bus do.
virtio-ballon won't get the device_type property as there is no driver
for it.
While we are here, remove device-type from usb-mouse as well.
Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---
Changes:
v2:
* removed usb mouse as well - slof does not implement it
For supporting memory hotplug feature, some changes are need in the
way memory is represented during VM bootup. Now the guest boots from
RMA and rest of the memory is configured only during
client-architecture call. SLOF adds support for creation of these
nodes dynamically.
If the guest supports ibm,dynamic-reconfiguration-memory, qemu would
create memory as part of /ibm,dynamic-reconfiguration-memory
While for older guests, memory@ would be populated.
CC: bharata@linux.vnet.ibm.com
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Add support for the new ranges property for 64bit BARs. This will
enable devices with higher BAR requirements. Currently, the device
could not get more than 256MB, as the 512MB memory range passed by
Qemu was divided between prefetchable and non-prefetchable MMIO range.
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com>
The send packet code does understand that the IP is not part of the
current network and needs to use the router. And then tries to get the
MAC address of the router IP from arp cache, that fails. This is
becuase there was no ARP Request send for the router IP.
So in case when there is router involved, send arp request for the
router IP and after the reply, we have the router mac cached to
communicate with.
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
In certain cases when a PCI device is passthru and is frozen before it
reaches SLOF. All PCI read result reading FF. This exposed a bug in
the pci scan code which would wrongly take it as a pci brigde and try
to scan devices below that and that would enter an infinite loop.
Explicitly scan for type 0/1 and rest are not supported.
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
commit 706c69e4 "xhci: fix port assignment" partially fixed the
usb port numbering.
Adding parsing of xhci extended capabilities, we can parse the
overlapped ports accordingly and have proper port numbering.
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
term-io-key simply did nothing when the stdin had not been set yet.
Especially, it even did not put an output item on the stack, which led
to very ugly crashes in case we dropped to the Forth prompt before
the console had been set up. Fix it by running the behaviour of the
previous key handler instead.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
It's loading from handler + 0x160 instead of 0x60. Not a big problem
in practice but should be fixed.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
No need to have a single giant section, break it back up, add
some missing bits, and make sure .opd is separate so that objdump
and gdb can properly reconstitute the dot symbols.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
[ do not discard .comment, this is fixed with binutils 2.24]
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
With module layer cleanup, and a fixed socket() call, start using the
fd across the network stack.
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
The read/write_io ones are used by biosemu, though we should
probably fix them to work on qemu platform at some stage.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
It's not used anymore, let's just call directly into the relevant
OF functions. While at it, also make socket() actually return
an fd.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
This patch adds a private HCALL to inform qemu the updated
rtas-base and rtas-entry address when OS invokes the call
"instantiate-rtas". This is required as qemu allocates the
error reporting structure in RTAS space upon a machine check
exception and hence needs to know the updated RTAS.
Enhancements to qemu to handle the private HCALL, prepare
error log and invoke machine check notification routine
are in a separate patch.
Signed-off-by: Nikunj A. Dadhania <nikunj@linux.vnet.ibm.com>
Signed-off-by: Aravinda Prasad <aravinda@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
This patch adds boot menu support to SLOF. When boot menu is enabled from qemu
commandline with '-boot menu=on', on pressing F12 key it displays the list of
devices to boot from and waits for user's input. This is in line with x86 qemu
bios feature.
Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
SLES when creating an LVM, creates a boot partition with
CHRP-BOOT. This was only being handled for CDROM case. Add this for
the hard-disk as well.
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
* fat16 code had old debug prints, get rid of that
* yaboot tried reading a file beyond the size of file, fix read
routine to override and read only till the file-size
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Include DHCPARCH define in the FLAG variable
Set the flag, so that dhcp request would contain DHCPARCH
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
A pci-bridge without a downstream device will end up with no memory
range allocated. For cases like hotplug, reserve some memory for the
bridge device.
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Before starting pci-bridge probing the ranges property is set to the
max limit, and then pci bridge is probed. Once the probe is over we
would update the ranges property.
In case when there is no device beyond the bridge, ranges will be null
and the code moves ahead. The actual problem here is that before
probing the bridge the ranges property was set to max limit. That
stays and cause overlapping ranges for sibling devices.
So empty the ranges property for this bridge when there is no device present.
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>