aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2012-01-12Fix ram-boot handling of 64-bit addressesqemu-slof-20120112Benjamin Herrenschmidt1-2/+2
Hex vs. decimal thinko Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-01-12usb-ohci: Avoid instance specific allocationsBenjamin Herrenschmidt1-10/+25
The USB stack did instance specific allocations for the various buffers, but would then assign them to package specific lists, and would generally get badly confused as soon as multiple instances of the driver got opened. This typically occurs when using a USB keyboard and booting from a USB disk. This makes everything node variables instead, with tracking of how many instances are open, with one allocation pass on the first open and one free pass on the last close. The result is a lot more reliable, I can boot with USB keyboard and a USB disk fine without hanging qemu. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-01-11Fixed problem in framebuffer code when erasing or inserting characters.Thomas Huth1-4/+10
When erasing characters or when inserting characters in the middle of a line, the framebuffer code did not correctly calculate the line width, since it was not taking the bit depth into account yet. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2012-01-11Support new-style PCI for qemu boardqemu-slof-20120111.1Benjamin Herrenschmidt7-28/+100
We now support populating the device-nodes ourselves when using a newer qemu which doesn't do it anymore. Note: I have removed the support for working with the existing device nodes, so qemu needs to be updated in sync with slof Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-01-11Fix virtio access sizeqemu-slof-20120111Benjamin Herrenschmidt1-5/+11
We don't support 8-bytes PIO Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-01-11Fix inline asm for ci_write_xxBenjamin Herrenschmidt1-19/+31
It was clobbering r4 and not marking it as such, causing problems among others in virtio-blk Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-01-11vga: support for 15bppBenjamin Herrenschmidt1-2/+3
This is the default in qemu now Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-01-11qemu: Allow qemu passing the boot kernel directlyBenjamin Herrenschmidt1-0/+38
We do that by replacing the word "boot-command" to return "(boot-ram)" (but we don't change the nvram env). Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2011-12-29Add support for instance specific "my-unit" settingsThomas Huth2-15/+82
According to IEEE 1275, the "my-unit" command shall return the unit address of the current _instance_, i.e. this unit address can be set differently for each instance, it is not bound to the physical unit address like "my-space" and "my-address". This behaviour is expected by the Citrine FCODE for example, which does not set a physical unit address for the "sd" (disk) nodes, but needs the unit address to be specified when opening the device tree node instead. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-12-28Enabled -Wmissing-prototypes and -Wstrict-prototypes CFLAGS and cleaned upThomas Huth11-92/+62
These two compiler flags for additional warnings help to improve the quality of the source code: Removed some unused code and fixed some obvious bugs. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-12-28Source code beautificationThomas Huth1-46/+91
Some functions in node.fs were formatted in a very bad way, using wrong indentation or mixing spaces and tabs for indentation. Cleaned this up now, without doing any functional changes. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-12-28Improved "tick", postpone and $FIND commandsThomas Huth2-16/+9
When the ' (tick) or postpone commands hit an unknown function, they simply printed out "undefined word" without telling which word was not defined. These problems were quite cumbersome to debug since it was quite hard to find the right spot in the source code where such problems happened. Now the tick and postpone command store the name of the undefined word, too, so that the code which catches the ABORT also prints this information. I also fixed the $FIND command to be standard compliant right from the start (so that it leaves the string parameters on the stack in case the word has not been found). Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-12-22Fixed yet another bug in open-nodeThomas Huth1-12/+22
When the "open" method of the target node failed, the open-node function did not correctly restore the previous value of "my-self" (it was using my-parent of the new node to restore the previous value, but that did not work when the new node could not be opened). Now the old value of "my-self" is saved on the return stack instead and then always correctly restored. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-12-21Enable 16 bit and 32 bit color depth support in QEMU VGA device driverThomas Huth1-8/+6
Now that our framebuffer code basically supports 16 and 32 bit color depths, we can also enable support for these resolutions in the QEMU VGA device driver. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-12-21Disable the debug message about FDT phandles that could not be replacedThomas Huth1-1/+3
The "Warning: Did not replace phandle in XYZ" messages could confuse the normal users, so they are now only printed when running in diagnostic-mode. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-12-20Improved framebuffer code to support more than only 8-bit resolutionsThomas Huth1-18/+46
With these changes, it should be possible to use screen depth of 16 bit and 32 bit as well. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-12-20Fixed assembler constraints for lwbrx and lhbrxThomas Huth1-2/+4
The biosemu on bimini had some problems with newer versions of GCC ... I saw on a couple of websites that for lwbrx and lhbrx, the assembler constraint "Z" should be used instead of "r". This seems to fix the hang.
2011-12-20Fixes for using the USB keyboard driver on QEMUThomas Huth1-9/+25
For some reasons, interrupt transfers do not work right on QEMU, so we use control transfers there instead. Also digest one key scancode at a time only to avoid the problem with phantom keypresses. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-12-20Do not override the "model" property of the root node.Thomas Huth1-6/+6
QEMU already provides a string for the "model" property of the root node. We should not change this to avoid incompatibilities with the kernel. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-12-20Source code beautificationThomas Huth1-110/+110
Cleaned up indentation and superfluous white spaces in usb-keyboard.fs Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-12-20Add support for qemu standard VGABenjamin Herrenschmidt4-14/+354
Simple framebuffer support for the standard VGA display provided by QEMU. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-12-20FCODE: Always include evaluator, move framebuffer token init to fbuffer.fsThomas Huth10-88/+159
Since the FCODE evaluator can be used for more than one PCI card now, the interpreter is now always included during boot. The framebuffer tokens are now only initialized when the code from fbuffer.fs is being used. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-12-20Added net-snk client-interface moduleThomas Huth4-3/+138
So far the net-snk could only use networking cards that had corresponding drivers in the ROM filesystem. NICs that come with their of FCODE drivers were not supported yet. For these NICs I added now a pseudo-module to the net-snk that is able to use the corresponding device tree nodes via the "read" and "write" functions of the client interface. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-12-20JS2x: Added oco files to be able to built board-js2xThomas Huth4-0/+0
These additional files are necessary to built board-js2x, see the following URL for details: http://www.ibm.com/developerworks/power/pa-slof-js20/
2011-12-20Two minor improvements for the device tree node codeThomas Huth1-3/+9
The "open-node" command always tried to execute the "open" method of the node that should be opened and used CATCH to determine whether the method is available or not (and assumed success if it is not available). That works fine as long as the "open" method does not ABORT due to any reason - in that case the "open" should be considered as failure instead. So the code is now using "find-method" instead to determine whether the "open" method is available or not. Second fix is about "my-unit". According to IEEE1275, this value should be initialized to the firt component of the "reg" property in case it has not been specified by other means. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-12-20Fixed get-inherited-propertyThomas Huth1-10/+13
The get-inherited-property function messed up the stack in case the property could not be found. Now it deals with this situation correctly. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-12-20Repeat TFTP read request in case the packet got lost.Thomas Huth1-1/+7
The TFTP downloads failed when the read request packet got lost. This problem is now fixed by retransmitting the read request after a while. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-12-20Fixed "map-in" to also allow access to the Option ROM BAR.Thomas Huth2-2/+2
Some FCODE programs try to access their ROM BAR, so map-in has got to support this BAR, too. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-12-20JS2x: Fixed config space access functions.Thomas Huth1-1/+8
According to the PCI bus binding to Open Firmware, the uppermost byte can contain some description bits when doing "config-l@" and the like. For accessing the config space via MMIO, we've got to mask them away. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-12-20Fixed the BEHAVIOR function to also work with INSTANCE DEFERsThomas Huth1-0/+8
The BEHAVIOR function only worked with normal DEFER variables so far. It was not aware of INSTANCE DEFERs yet. This problem has been fixed now. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-12-20Removed unused codeThomas Huth1-39/+0
In 1275.fs there were some functions that were apparently not used anymore. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-12-20FCODE: Support for fcode programs with 8-bit offsetsThomas Huth3-12/+21
IEEE1275 allows offset values to be either encoded with 8-bit values or 16-bit values. So far our FCODE engine only supported 16-bit offsets. Now 8-bit offsets are working, too. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-12-20Fixed "dev" command to only parse one wordThomas Huth1-1/+1
The "dev" command parsed the whole remaining input line. That way it was not possible to do something like "dev / ls" at the prompt. Now it parses only the next available word in the input so that the rest of the input line can be interpreted by the Forth engine instead. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-12-20Print phandle when listing the device treeThomas Huth1-3/+17
Printing the phandle of each node is quite handy when searching for a specific phandle value. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-12-20Encode FDT properties as string when they contain a valid ASCII string.Thomas Huth3-12/+29
There are a lot of properties in the FDT that contain a string, but commands like ".properties" only displayed them as byte array since all properties were encoded with "encode-bytes". Now the code tries to detect valid ASCII strings and encodes such properties with "encode-string" instead. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-12-20Support for "INSTANCE BUFFER:" in Forth and FCODE.Thomas Huth2-10/+29
IEEE 1275 stipulates that the "BUFFER:" keyword and its FCODE equivalent "b(buffer:)" can both be used with the INSTANCE keyword to create an instance-specific buffer. SLOF lacked this support, but now it's possible to create such instance-specific buffers with SLOF, too. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-12-20Use linux,stdout-path to find the consoleMichael Ellerman1-3/+13
Currently the hvterm code just picks an arbitrary vty to use as the console. It would be preferable under QEMU if we could use linux,stdout-path. Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
2011-12-20hvterm: Update hvterm routines to take the termno as an argumentMichael Ellerman5-19/+29
Currently the hvterm routines always use termno=0. This works because QEMU has code that recognies termno=0 and chooses a "default" vty. It would be more correct if the hvterm routines took the termno as an argument. That way if we open a vty other than the default the output will correctly go to that vty. Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
2011-12-20Silenced some compiler warnings that occur when compiling with prototype checksThomas Huth40-85/+139
The compiler flags -Wmissing-prototypes and -Wstrict-prototypes generally help to write code with proper prototypes. This way one can avoid some ugly bugs because it helps to identify functions that do not have prototypes in headers. It also helps to improve performance since local functions then have to be declared "static", so the compiler can do better optimizations. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-11-28FCODE: Added token 0x12b (interpose)Thomas Huth1-1/+2
The "Recommended Practice: Interposition" document declares that token 0x12b is used for "interpose". Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-11-25Fixed crash during "quiesce" when USB OHCI controller is enabledqemu-slof-20111128Thomas Huth4-11/+19
The OHCI code unmaps the allocated DMA buffers during "quiesce". For this the dma-map-out and dma-free functions were using the $call-parent function that requires a valid current instance ("my-self"). However, there is no current instance available during "quiesce" so $call-parent aborted the boot process. To fix the problem, the dma-* functions now use $call-static again so that they also work without a current instance. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-11-24Improved version printingThomas Huth4-20/+53
When building SLOF from a git repository, use the SHA-id as version information instead of the less useful "private build" string. Also make sure that version information is updated during each build, so that we also print more accurate "build date" information now. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-11-24Support for virtio-net PCI devicesThomas Huth15-23/+707
Added a driver for the "virtio-net" virtualized network devices from KVM/qemu. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-11-24Support for virtio-block PCI devicesThomas Huth13-11/+719
The virtio devices are preferred way of providing virtualized devices on KVM/qemu. Here's now the basic support for virtio block devices. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-11-24Check whether local-mac-address property exists before using its valueThomas Huth1-1/+2
Fixed network booting for device tree nodes that do not provide a local-mac-address property by default. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-11-24Do not disassemble net-snk by defaultThomas Huth1-1/+3
2011-11-24Fix stack problem during setup-alias functionsThomas Huth4-4/+10
The code for setting some of the device alias had a bug. When it was called multiple times, for example because two or more hard disk images had been configured, it left an item on the Forth stack, causing a crash or other ugly side effects later. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-11-24Provide PCI memory mapping and dma memory handling in PHB node on board-qemuThomas Huth5-107/+144
According to the PCI Bus Binding to IEEE 1275, the dma-alloc, dma-free, dma-map-in, dma-map-out and dma-sync functions have to be provided by the PCI bus node, not by the PCI device node, so I moved these functions to the PHB node now. Since the "ibm,dma-window" property is still located in the device node instead, I had to add a little hack to the $call-parent method to remember the calling child, so that the parent node (the PHB node) can access that property of the calling child. Also added map-in and map-out functions now according the the PCI Bus Binding. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-11-24OHCI: Reworked USB scan code a little bitThomas Huth2-20/+35
Refactored the ohci-scan function a little bit and use the new "extend-device" function to extend the ohci node properly. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2011-11-24Improved instance handlingThomas Huth2-34/+52
Fixed various bugs and added some improvements in the device tree node instance handling code: - The ">instance" word now checks whether access is beyond the allocated memory - Check max-instance-size when creating new instance variables/values - The arg point and the args-len were stored the wrong way round in the instance header structure - Free instance args buffer when closing an instance to avoid memory leaking - finish-device destroyed the instance-template buffer, causing instance values not to be initialized correctly anymore - Added new command "extend-device" to be able to modify the instance template of already existing nodes - Added new command "unselect-dev" to undo the changes from select-dev Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>