qtest: add register fuzzing to RTC test

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
qtest: add dummy functions for user emulators

Allow qtest to be used also in files used for user emulators by
introducing dummy functions.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
sparc: fix qtest

Initialize TCG only when enabled.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
realview: break out versatile i2c controller code

The versatile i2c controller implementation was separated to
its own file called versatile_i2c.c. This is done as a preparation
for adding i2c support to the versatilepb board.

Signed-off-by: Oskar Andero <oskar.andero@gmail.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
versatilepb: add ds1338 rtc device

Add ds1338 rtc attached on i2c.

Signed-off-by: Oskar Andero <oskar.andero@gmail.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/arm_mptimer: Reset the qemu_timer at reset

On reset of the mpcore timer/watchdog block we need to
delete the qemu_timer in case it was running.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
versatiblepb: add NOR flash support

- add support for the 64MB NOR CFI01 flash available at
0x34000000 on the versatilepb board
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0225d/BBAJIHEC.html

- tested with barebox bootloader

Signed-off-by: Eric Bénard <eric@eukrea.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
qtest: add m48t59 tests for Sparc

Add simple m48t59 qtests, enable test only for Sparc32
and Sparc64. On PPC, the device is behind PCI bus.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
target-xtensa: fix LOOPNEZ/LOOPGTZ translation

Translation of LOOP instructions used to call LEND SR write handler to
update LEND and invalidate relevant TBs. Now that LEND SR write handler
ends TB, LOOPNEZ and LOOPGTZ generate wrong code (same as for simple
LOOP). Fix it by calling wsr_lend helper directly.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
target-xtensa: add tests for LOOPNEZ and LOOPGTZ

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
softfloat: make USE_SOFTFLOAT_STRUCT_TYPES compile

This change makes it compile and return the same value than the #undef one.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
gdbstub: Synchronize CPU state unconditionally in gdb_set_cpu_pc

Synchronize the CPU state via cpu_sychronize_state() unconditionally
in gdb_set_cpu_pc() rather than only in some of the target ifdef
ladder cases.

We can divide the CPUs into three categories:
 * non-KVM targets: no change of behaviour since we will use the
   kvm-stub.c no-op function.
 * i386 and s390: no change of behaviour since they were already
   calling this function
 * PPC (in KVM mode): this fixes an error: failing to synchronise
   was accidental and probably a bug.

This also paves the way for other targets (specifically ARM) which
can add KVM support in future without having to add another target
specific change to this bit of code.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
tci: GETPC() macro must return an uintptr_t

Change the data type of tci_tb_ptr, so GETPC() returns an
uintptr_t now (like for all other TCG targets).

This completes commit 2050396801ca0c8359364d61eaadece951006057
and fixes builds with TCI.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Merge branch 'arm-devs.for-upstream' of git://git.linaro.org/people/pmaydell/qemu-arm

* 'arm-devs.for-upstream' of git://git.linaro.org/people/pmaydell/qemu-arm:
  versatiblepb: add NOR flash support
  hw/arm_mptimer: Reset the qemu_timer at reset
  versatilepb: add ds1338 rtc device
  realview: break out versatile i2c controller code