Commit graph

4503 commits

Author SHA1 Message Date
Dmitry Eremin-Solenikov b651fc6fd8 mainstone: PCMCIA support
Extend mst_fpga and mainstone with logic to support PCMCIA
attachment (IRQs, status regs).

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-03-10 03:38:13 +01:00
Dmitry Eremin-Solenikov 95499a1d28 mainstone: use gpio 0 for connection of FPGA instead of hooking into PIC directly
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-03-10 03:36:18 +01:00
Andrzej Zaborowski 8034ce7d17 pxa2xx_timer: Get rid of .level in PXA2xxTimer0. 2011-03-10 03:31:02 +01:00
Andrzej Zaborowski 7c29d6ce0f pxa2xx_pic: fixup initialisation
This is based on Dmitry Eremin-Solenikov's patch but simplified.
2011-03-10 03:11:47 +01:00
Dmitry Eremin-Solenikov 4ff927cc62 pxa2xx_timer: separate irq for pxa27x handling
First, sysbus_init_irq shan't be called on on-stack variables. Indeed,
it only stores a passed pointer in qdev and the stored irq is later
populated, so we get a nice write-to-stack bug.
Second, irq for pxa27x should probably be handled in a more gentler way,
as we should check if we have events to raise this irq.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-03-10 02:46:21 +01:00
Michael Walle d821732aba lm32: EVR32 and uclinux BSP
This patch adds support for the following two BSPs:
 - LM32 EVR32 BSP (as used by RTEMS)
 - uclinux BSP by Theobroma Systems

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-03-07 13:42:37 +01:00
Michael Walle e5f799a267 lm32: support for creating device tree
This patch adds helper functions to create a ROM, which contains a hardware
description of a board. This is used in Theobromas LM32 Linux port.

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-03-07 13:42:37 +01:00
Michael Walle f19410ca69 lm32: system control model
This patch add support for a system control block. It is supposed to
act as helper for the emulated program. E.g. shutting down the VM or
printing test results. This model is intended for testing purposes only and
doesn't fit to any real hardware. Therefore, it is not added to any board
by default. Instead a user has to add it explicitly with the '-device'
commandline parameter.

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-03-07 13:42:37 +01:00
Michael Walle 770ae5713a lm32: uart model
This patch add support for the LatticeMico32 UART.

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-03-07 13:42:36 +01:00
Michael Walle ea7924dcc4 lm32: timer model
This patch adds support for the LatticeMico32 system timer.

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-03-07 13:42:36 +01:00
Michael Walle f89286ae45 lm32: pic and juart helper functions
This patch adds init functions for the PIC and JTAG UART commonly used
in the board initialization.

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-03-07 13:42:36 +01:00
Michael Walle 15d7dc4f80 lm32: juart model
This patch adds the JTAG UART model. It is accessed through special control
registers and opcodes. Therefore the translation uses callbacks to this
model.

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-03-07 13:42:36 +01:00
Michael Walle 4ef66fa718 lm32: interrupt controller model
This patch adds the interrupt controller of the lm32. Because the PIC is
accessed through special control registers and opcodes, there are callbacks
from the lm32 translation code to this model.

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-03-07 13:42:36 +01:00
Adam Lackorzynski 6ed221b637 target-arm: Integrate secondary CPU reset in arm_boot
Integrate secondary CPU reset into arm_boot, removing it from realview.c.
On non-Linux systems secondary CPUs start with the same entry as the boot
CPU.

Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-06 23:37:19 +01:00
Adam Lackorzynski fa25014441 target-arm: Fix soft interrupt in GIC distributor
Fix selection of target list filter mode.

Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-06 23:37:17 +01:00
Juan Quintela 05a7fcd081 gt64xxx: remove savevm support
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-06 20:10:58 +01:00
Juan Quintela 9023f7b2c8 vmstate: remove uninorth savevm code
It was migrating the wrong structures, no way it would work

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-06 20:10:58 +01:00
Juan Quintela 532847e427 vmstate: remove grackle_pci savevm code
It was migrating the wrong structures, no way it would work

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-06 20:10:58 +01:00
Aurelien Jarno 0d2e91c178 hw/sd.c: fix sd_set_cb() crash when bdrv == NULL
sd_set_cb() calls bdrv_is_read_only() and bdrv_is_inserted() even if
no block driver is associated with the card reader.

This patch fixes the issues by not setting the irq in this case, this
fixes ARM versatile crash.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-06 20:02:40 +01:00
Peter Maydell 26883c699e hw/realview: Wire up the MMC card status
Instantiate the three PL061 GPIO modules the realview boards have.
Connect the MMC card status outputs of the PL181 MMC controller
to both the system registers and the GPIO module which handles
internal devices.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-06 19:01:31 +01:00
Peter Maydell 9793212bb0 hw/irq: Add qemu_irq_split() so one GPIO output can feed two inputs
Add a qemu_irq_split() function which allows a board to wire a single
GPIO output up to two GPIO inputs. This is needed for realview boards,
where the MMC card status is visible both in a system register and
via a PL061 GPIO module.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-06 19:01:31 +01:00
Peter Maydell 7063f49f59 hw/pl061.c: Implement ARM PL061 as well as Luminary one
ARM's PL061 has a different set of ID registers to the one in the
Luminary Stellaris; implement this so that the Linux driver can
identify the Realview PBX PL061 correctly.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-06 19:01:30 +01:00
Peter Maydell b50ff6f524 hw/arm_sysctl.c: Wire MCI register MMC card status bits to GPIO inputs
Implement some GPIO inputs which a board can connect up to set the
MMC card status bits in the MCI register.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-06 19:01:30 +01:00
Peter Maydell c31a4724e2 hw/pl181: Implement GPIO output pins for card status
Add two GPIO output pins to the PL181 model to indicate the card
present and readonly status information. On ARM boards these usually
are reflected in a system register.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-06 19:01:29 +01:00
Stefan Hajnoczi 444dd39b5f lsi53c895a: Update dnad when skipping MSGOUT bytes
Update not only dbc but also dnad when skipping bytes during the MSGOUT
phase.  Previously only dbc was updated which is probably wrong and
could lead to bogus message codes being read.

Tested on Linux and Windows Server 2003.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-06 18:22:19 +01:00
Gerhard Wiesinger 219982ef42 hw/pcnet.c: Fix EPROM contents to suit AMD netware drivers
bugfix under DOS for AMD netware driver:
AMD PCNTNW Ethernet MLID v3.10 (960115), network card not found

bugfix works well under DOS with:
1.) AMD NDIS driver v2.0.1
2.) AMD PCNTNW Ethernet MLID v3.10 (960115)
3.) Knoppix 6.2

Signed-off-by: Gerhard Wiesinger <lists@wiesinger.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-03-05 13:07:25 +00:00
Stefan Hajnoczi b46d97f2d2 virtio-net: Fix lduw_p() pointer argument of wrong size
A pointer to a size_t variable was passed as the void * pointer to
lduw_p() in virtio_net_receive().  Instead of acting on the 16-bit value
this caused failure on big-endian hosts.

Avoid this issue in the future by using stw_p() instead.  In general we
should use ld*_p() for loading from target memory and st*_p() for
storing to target memory anyway, not the other way around.

Also tighten up a correct use of lduw_p() when stw_p() should be used
instead in virtio_net_get_config().

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-03 23:33:26 +01:00
Andrzej Zaborowski 8a231487bc pxa2xx: port pxa2xx_rtc to using qdev/vmstate
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-03-03 15:13:42 +01:00
Andrzej Zaborowski f114c82612 pxa2xx_dma: Get rid of a forward declaration. 2011-03-03 15:06:03 +01:00
Andrzej Zaborowski 2115c01924 pxa2xx_dma: port to qdev/vmstate
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-03-03 15:04:51 +01:00
Dmitry Eremin-Solenikov 47188700a4 vmstate: move VMSTATE_PCIE_AER_ERRS to hw/hw.h
VMSTATE_PCIE_AER_ERRS is indeed useful for other emulation drivers.
Move it to hw/hw.h under the name of VMSTATE_STRUCT_VARRAY_POINTER_UINT16.
Also add VMSTATE_STRUCT_VARRAY_POINTER_INT32 which is more or less
the same as _UINT16 macro, except the fact it uses int32_t internally.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-03-03 14:54:50 +01:00
Dmitry Eremin-Solenikov ee2479d3e8 pxa2xx_dma: drop unused pxa2xx_dma_handler_t/handler field
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-03-03 14:50:20 +01:00
Andrzej Zaborowski 5251d196aa pxa2xx_timer: Store relevant irq line in each timer. 2011-03-03 14:24:25 +01:00
Dmitry Eremin-Solenikov 797e9542f5 pxa2xx_timer: switch to using qdev/vmstate
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-03-03 14:14:44 +01:00
Dmitry Eremin-Solenikov d353eb43cf pxa2xx_timer: change info struct name to comply with guidelines
It should be PXA2xxTimerInfo, not pxa2xx_timer_info. Replace all
occurences of old name with the new one.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-03-03 03:45:06 +01:00
Andrzej Zaborowski 0c69aa703c pxa2xx_pic: Set base address for sysbus device.
Thid device's registration was broken since
e1f8c729fa, this should fix it.
2011-03-03 03:43:40 +01:00
Dmitry Eremin-Solenikov 13801f32f6 vmstate: add VMSTATE_STRUCT_ARRAY_TEST
This is a _TEST variant of VMSTATE_STRUCT_ARRAY, necessary e.g.
for future patch changing pxa2xx_timer to use vmstate.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-03-03 03:34:01 +01:00
Dmitry Eremin-Solenikov e1f8c729fa pxa2xx_pic: update to use qdev
Use qdev/sysbus framework to handle pxa2xx-pic. Instead of exposing IRQs
via array, reference them via qdev_get_gpio_in().

Patch has been modified by the committer.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-02-25 12:13:38 +01:00
Dmitry Eremin-Solenikov 3e1dbc3bd4 mst_fpga: correct irq level settings
Final corrections for IRQ levels that are set by mst_fpga:

* Don't retranslate IRQ if previously IRQ was masked.
* After setting or clearing IRQs through register, apply mask
  before setting parent IRQ level.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-02-25 09:06:16 +01:00
Gerd Hoffmann a43f9c90c9 virtio-serial: kill VirtIOSerialDevice
VirtIOSerialDevice is like VirtIOSerialPort with just the first two
fields, which makes it pretty pointless.  Using VirtIOSerialPort
directly works equally well and is less confusing.

[Amit: - rebase
       - rename 'dev' to 'port' in function params in virtio-serial.h ]

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-02-24 11:25:38 -06:00
Peter Maydell fb1ba03ab0 hw/sd.c: Add missing state change for SD_STATUS, SEND_NUM_WR_BLOCKS
The SD_STATUS and SEND_NUM_WR_BLOCKS commands are supposed to cause
the card to send data back to the host. However sd.c was missing the
state change to sd_sendingdata_state for these commands, with the effect
that the Linux driver would either hang indefinitely waiting for
nonexistent data (pl181) or read zeroes and provoke a qemu warning
message (omap).

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-02-24 08:53:36 +01:00
Edgar E. Iglesias 082e5be809 pls3adsp1800: Base load_elf endianness on target endianness
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
2011-02-23 12:31:53 +01:00
Peter Maydell 9a31334f41 hw/irq.h: Remove unused SetIRQFunc typedef
Remove the typedef SetIRQFunc, as it is not used by anything.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-02-21 16:02:38 +01:00
Aurelien Jarno 81aa06471a Revert "prep: Disable second IDE channel, as long as ISA IDE emulation doesn't support same irq for both channels"
This reverts commit 491e2a338f.
2011-02-21 15:53:05 +01:00
Jan Kiszka ee951a37d8 isa-bus: Remove bogus IRQ sharing check
Nothing prevented IRQ sharing on the ISA bus in principle. Not all
boards supported this, neither each and every card nor driver and OS.
Still, there existed valid IRQ sharing scenarios, (at least) two of them
can also be found in QEMU: >2 PC UARTs and the PREP IDE buses.

So remove this artificial restriction from our ISA model.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-02-21 15:46:53 +01:00
Roy Tam 7096a96db2 PS/2 keyboard Scancode Set 3 support
The following patch adds PS/2 keyboard Scancode Set 3 support.

Signed-off-by: Roy Tam <roytam@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-02-21 15:41:12 +01:00
Vasily Khoruzhick 9dda246547 Fix obvious mistake in pxa2xx i2s driver
RST bit is (1 << 4) bit, not (1 << 3), fix condition
that enables i2s if ENB is set and RST is not set.

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-02-20 20:28:45 +01:00
Vasily Khoruzhick 582798b5c6 pxa2xx_keypad: Handle 0xe0xx keycodes
Add handling of 0xe0xx keycodes to pxa2xx_driver.
Extended keycodes in keymap should be marked with most significant
bit set (i.e. 0x80). Without this patch it's not possible to handle
i.e. cursor keys.

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-02-20 19:53:23 +01:00
Vasily Khoruzhick b976b4c0e7 pxa2xx_keypad: enhance emulation of KPAS, KPASMKP regs
Add emulation of KPAS register and proper emulation of
KPASMKP regs, so now driver supports multipresses and properly
works with Linux driver.

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-02-20 19:53:22 +01:00
David 'Digit' Turner 5a5e3d55ff qdev: Fix printout of bit device properties with bit index >= 8
Signed-off-by: David 'Digit' Turner <digit@google.com>
Acked-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-02-20 18:51:59 +01:00