aboutsummaryrefslogtreecommitdiff
path: root/slof
AgeCommit message (Collapse)AuthorFilesLines
2015-03-13helpers: Fix SLOF_alloc_mem_aligned to meet callers expectationAlexey Kardashevskiy1-1/+1
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>
2015-03-12Set default palette according to "16-color Text Extension" documentThomas Huth1-0/+25
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>
2015-03-12Fix rectangle drawing functions to work also with higher bit depthsThomas Huth1-0/+62
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>
2015-03-12Improve /openprom nodeThomas Huth1-1/+1
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>
2015-03-12pci-properties: Remove redundant call to device-typeAlexey Kardashevskiy2-2/+1
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
2014-12-03pci: use 64bit bar rangesNikunj A Dadhania2-3/+12
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>
2014-10-29pci: scan only type 0 and type 1Nikunj A Dadhania1-5/+6
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>
2014-10-29Fix term-io-key to also work when stdin has not been set yetThomas Huth1-0/+2
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>
2014-06-26Quieten the grub warningNikunj A Dadhania1-1/+1
Replace the warning with code comment Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2014-06-13Add boot menu supportAvik Sil1-7/+86
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>
2014-06-13boot from disk having chrp-boot fileNikunj A Dadhania1-16/+24
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>
2014-06-13fat16: fix read and remove debug messagesNikunj A Dadhania1-4/+5
* 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>
2014-05-14pci-scan: reserve memory for pci-bridge without devicesNikunj A Dadhania1-3/+3
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>
2014-05-14pci-bridge: Fix ranges when no device beyond the bridgeNikunj A Dadhania1-0/+1
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>
2014-04-25usb: use common pci dma alloc/mapping routinesNikunj A Dadhania1-4/+2
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2014-04-25Remove unused SLOF codeThomas Huth2-15/+7
This patch removes some code that is obsolete and completely unused nowadays. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com> Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2014-04-25pci-bridge: generic bridge needs to support pci dma functionsNikunj A Dadhania1-0/+1
With a generic pci bridge and a pci device on that bridge, any call to dma functions would fail as generic pci-bridge does not support them. This would result in TCE entries not getting populated either in the host(vfio) or qemu. Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com> Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2014-04-25pci: extract dma functions as separate fileNikunj A Dadhania2-26/+37
DMA alloc/mapping functions needs to be used by pci generic bridge as well. Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com> Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2014-03-27cas: increase hcall buffer size to accomodate 256 cpusNikunj A Dadhania1-1/+3
It is seen that guests booting in compatibility mode (like Power7) will issue a client-architecture-service call which will result in QEMU rebuilding the device tree. The size of the device tree to be built, which is passed from SLOF is currently 4 kB. This is insufficient to contain more than 48 CPU nodes. Increase this size in SLOF so that 255 CPUs (max limit in QEMU) can be supported. Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2014-03-26usb: change device tree namingNikunj A Dadhania3-44/+25
Qemu ignores the controller type while coding the bootindex. Changing the representation of name accordingly. Earlier a USB controller device representation was: /pci@800000020000000/ohci@1/usb-storage@1/disk@101000000000000 /pci@800000020000000/ehci@2/usb-storage@1/disk@101000000000000 /pci@800000020000000/xhci@3/usb-storage@1/disk@101000000000000 The patch changes this to: /pci@800000020000000/usb@1/storage@1/disk@101000000000000 /pci@800000020000000/usb@2/storage@1/disk@101000000000000 /pci@800000020000000/usb@3/storage@1/disk@101000000000000 Controller name is preserved in " device_type" property in the node. Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2014-03-18ELF: Enter LE binary in LE modeNikunj A Dadhania3-16/+50
Trampoline code in the LE binary were helping fix this. This patch now takes care of switching the mode to LE for LE elf binaries. Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2014-02-04Add support for 64bit LE ABI v1 and v2 supportNikunj A Dadhania2-12/+56
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> -- v2: With the parameters changed for go-64, kernel loading from commandline broke v3: (client-exec) calls start-elf64 directly, fix args
2014-02-04Change representation of string environment variableNikunj A Dadhania1-3/+3
Currently strings are stored in the dictionary using "string," which stores the length as a byte. This brings in the limitation of only 255 byte string. The issue got exposed when using "boot-device" which was more than 256 bytes, and the string length was equal to (length & 0xFF) With this patch, we are storing the length in dictionary in a cell and copying the string after that. Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2014-02-04cas: return error when unknown node foundNikunj A Dadhania1-1/+3
Hypercall for ibm,client-architecture-support could return nodes that isn't there in the guest DT, in such cases error should be returned to the guest kernel. Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-12-17Work around missing sc 1 traps on pHypAlexander Graf1-0/+10
When running a pseries guest in PR KVM on top of pHyp, sc 1 instructions are handled directly by pHyp, so we don't get to see them. That means we need to get inventive. Invent a new instruction that behaves like sc 1, but really is a reserved instruction that traps. This instruction can be used by KVM to emulate sc 1 behavior. This patch adds the SLOF support for it. With this, SLOF detects whether it's running on such a broken setup and if so patches itself to execute the fake sc 1 instruction instead of the real one. Furthermore, we also hook into "quiesce" which Linux calls when it boots. This gives us the chance to also patch Linux when it boots up, so it uses the fake sc 1 too. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-12-16Output banner and initial display output in VNC windowNikunj A Dadhania1-2/+2
Initial display output does not show up in the VGA/VNC window. Create replay buffer to store the initial output and when vga/vnc console starts, dump the buffer there. Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-12-09cas: remove warningAlexey Kardashevskiy1-1/+1
Since client-architecture-support is not support by the mainline QEMU yet, this warning might be confusing so remove it. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-12-06Find next available alias nameAvik Sil2-14/+25
This patch generaliazes the device alias name enumeration for all scsi disks, virtio-blk disks and network devices. Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com> Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-12-06SLOF does not exit if given 1KB diskNikunj A Dadhania1-2/+11
When passing a 1KB disk, it goes on looping inside the deblocker, ignoring the unability of driver to read from out-of-bound blocks. Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com> Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-11-22pci-properties: add properties to enable hotplug for spaprqemu-slof-20131122Michael Roth2-0/+16
drmgr expects ibm,my-drc-index and ibm,loc-code OF properties in the corresponding device tree node to determine whether a pre-populated slot is hotpluggable/unpluggable. This is also stated as a boot-time requirement for DR-capable devices in SPAPR, though it does not specify there how these entries are to be generated. In the case of QEMU, hotpluggable slots are allocated entries based on bus/slotno values, so we can determine these entries statically at boot-time, rather than relying on RTAS calls as we would during OS-driven configuration. Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-11-18Increase quiesce tokens array sizeNikunj A Dadhania1-1/+1
16 is too less, push it to 256 Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-11-15scsi: make-media-alias fixNikunj A Dadhania1-5/+9
* disk alias names are not correct * also drop stack variable in case we overflow max-alias Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-11-15usb-xhci: add xhci host controller supportNikunj A Dadhania1-0/+1
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-11-15usb-xhci: add xhci supportNikunj A Dadhania3-5/+20
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-10-15usb-core: disable xhciNikunj A Dadhania1-4/+4
Code still does not support xhci, disable creation of xhci node, as it was causing crash in the quiesce path. Also check if ops pointer is verified before accessing function pointers during usb_hcd_exit. Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-10-15client-architecture-support: fix wrong version readqemu-slof-20131015Alexey Kardashevskiy1-1/+1
This fixed size of reading the version (which is actually 32bit), this removes confusing "cas not implemented" message from the guest. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> --- Changes: v2: * replaced w@ (16 bit) with l@ (32 bit)
2013-10-15client-architecture-support: fix redundant stack dropAlexey Kardashevskiy1-1/+1
This removes dropping allocated memory buffer off the stack in the case when no change to the tree was generated by QEMU. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2013-10-09Update device tree returned by CAS hypercallqemu-slof-20131009listNikunj A Dadhania1-9/+23
Add device tree parsing code and setting properties. Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-10-09Add ibm,client-architecture-support methodNikunj A Dadhania2-0/+21
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-10-04Kernel parameter passed from qemu commandline ignoredNikunj A Dadhania1-4/+4
Commit ec5c9e8b (Use root.fs on qemu as well) would set the bootargs/bootpath to null string even in case when the /chosen node exist, the /chosen and boot property were populated during fdt parsing so do not change in case its already set. Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-10-04ci: add missing close in else conditionNikunj A Dadhania1-0/+2
The code in close for calling quiesce looks if there is stdin and checks whether is being closed. That condition was being used to call quiesce. So in case when the ihandle is not that of stdin, close-dev was missing. Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-10-04Add GPT supportAvik Sil1-10/+106
Add support for booting from a GPT partitioned disk. Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com> Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-10-04usb-msc: handle stall and other fixesNikunj A Dadhania1-2/+13
* Add Reset Recovery procedure * Zero cbw and csw memory everytime * Add delays during cbw, data and csw stage * Increment tag after every command Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-10-04scsi: make probe more error resilientNikunj A Dadhania3-13/+36
* Some usb devices do not like report-luns, assume it as single lun device and move further. * Make inquiry of the device first for 36bytes and then determine what is the additional size to read. Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-10-04Implement range allocatorNikunj A Dadhania5-4/+250
Use the allocator with dma-map-in so it does not create duplicate TCE entries. Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-10-04Add missing close-dev in pingAvik Sil1-0/+2
Without the close-dev successive ping command fails to get the arguments, because the net device is not instantiated as the open-count is not decremented. Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com> Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-10-04Add SLOF usleep wrapperAvik Sil1-0/+6
Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com> Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-10-04Add SLOF pci wrapper functionsAvik Sil1-0/+35
Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com> Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-09-26Fix 'canon' client interfaceAvik Sil1-1/+12
As per 1275 standard, canon converts the possibly ambiguous device-specifier to a fully qualified pathname (see 6.3.2.2). It is kind of find-alias for clients. Earlier canon implementation was not complete, it was not at all returning the full path name. So grub was not getting the alias path by calling canon and it was breaking. In this patch I'm checking if the passed string is already a full path by comparing the first character with '/'. In that case I return the passed string as is. Otherwise I return the find-alias. Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com> Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com> Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-08-23usb-storage: Fix cbwflags fieldNikunj A Dadhania1-0/+6
SCSI layer represents DIR as TRUE or FALSE, and for SLOF TRUE is -1 and FALSE is 0, convert that to proper direction when building the CBW Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>