Commit 31d321c2 authored by Peter Maydell's avatar Peter Maydell
Browse files

Merge remote-tracking branch 'remotes/philmd-gitlab/tags/sparc-next-20200609' into staging

SPARC patches

HW:
- Use UNIMP device instead of EMPTY_SLOT
- Make EMPTY_SLOT similar to UNIMP device
- Map UART devices unconditionally
- Pair of fixes for AHB PnP
- Add trace events to AHB PnP

TCG:
- Improve exception logging

CI:
- https://gitlab.com/philmd/qemu/-/pipelines/154231191
- https://travis-ci.org/github/philmd/qemu/builds/696321130



# gpg: Signature made Tue 09 Jun 2020 08:24:09 BST
# gpg:                using RSA key FAABE75E12917221DCFD6BB2E3E32C2CDEADC0DE
# gpg: Good signature from "Philippe Mathieu-Daudé (F4BUG) <f4bug@amsat.org>" [full]
# Primary key fingerprint: FAAB E75E 1291 7221 DCFD  6BB2 E3E3 2C2C DEAD C0DE

* remotes/philmd-gitlab/tags/sparc-next-20200609:
  target/sparc/int32_helper: Extract and use excp_name_str()
  target/sparc/int32_helper: Remove DEBUG_PCALL definition
  hw/timer/grlib_gptimer: Display frequency in decimal
  hw/misc/grlib_ahb_apb_pnp: Add trace events on read accesses
  hw/misc/grlib_ahb_apb_pnp: Fix AHB PnP 8-bit accesses
  hw/misc/grlib_ahb_apb_pnp: Avoid crash when writing to AHB PnP registers
  hw/sparc64/niagara: Remove duplicated NIAGARA_UART_BASE definition
  hw/sparc64/niagara: Map the UART device unconditionally
  hw/sparc/leon3: Map the UART device unconditionally
  hw/misc/empty_slot: Name the slots when created
  hw/misc/empty_slot: Move the 'hw/misc' and cover in MAINTAINERS
  hw/misc/empty_slot: Convert debug printf() to trace event
  hw/misc/empty_slot: Add a 'name' qdev property
  hw/misc/empty_slot: Convert 'size' field as qdev property
  hw/misc/empty_slot: Lower address space priority
  hw/sparc/sun4m: Use UnimplementedDevice for I/O devices

Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
parents 49ee1155 86e8c353
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1864,6 +1864,13 @@ S: Maintained
F: include/hw/misc/unimp.h
F: hw/misc/unimp.c

Empty slot
M: Artyom Tarasenko <atar4qemu@gmail.com>
R: Philippe Mathieu-Daudé <f4bug@amsat.org>
S: Maintained
F: include/hw/misc/empty_slot.h
F: hw/misc/empty_slot.c

Standard VGA
M: Gerd Hoffmann <kraxel@redhat.com>
S: Maintained
+0 −1
Original line number Diff line number Diff line
@@ -24,7 +24,6 @@ common-obj-$(CONFIG_SOFTMMU) += numa.o
common-obj-$(CONFIG_SOFTMMU) += clock-vmstate.o
obj-$(CONFIG_SOFTMMU) += machine-qmp-cmds.o

common-obj-$(CONFIG_EMPTY_SLOT) += empty_slot.o
common-obj-$(CONFIG_XILINX_AXI) += stream.o
common-obj-$(CONFIG_PTIMER) += ptimer.o
common-obj-$(CONFIG_FITLOADER) += loader-fit.o
+2 −2
Original line number Diff line number Diff line
@@ -52,7 +52,7 @@
#include "sysemu/runstate.h"
#include "qapi/error.h"
#include "qemu/error-report.h"
#include "hw/empty_slot.h"
#include "hw/misc/empty_slot.h"
#include "sysemu/kvm.h"
#include "hw/semihosting/semihost.h"
#include "hw/mips/cps.h"
@@ -1241,7 +1241,7 @@ void mips_malta_init(MachineState *machine)
     * exception when accessing invalid memory. Create an empty slot to
     * emulate this feature.
     */
    empty_slot_init(0, 0x20000000);
    empty_slot_init("GT64120", 0, 0x20000000);

    qdev_init_nofail(dev);

+1 −0
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@ common-obj-$(CONFIG_EDU) += edu.o
common-obj-$(CONFIG_PCA9552) += pca9552.o

common-obj-$(CONFIG_UNIMP) += unimp.o
common-obj-$(CONFIG_EMPTY_SLOT) += empty_slot.o
common-obj-$(CONFIG_FW_CFG_DMA) += vmcoreinfo.o

# ARM devices
+26 −21
Original line number Diff line number Diff line
@@ -11,17 +11,9 @@

#include "qemu/osdep.h"
#include "hw/sysbus.h"
#include "qemu/module.h"
#include "hw/empty_slot.h"

//#define DEBUG_EMPTY_SLOT

#ifdef DEBUG_EMPTY_SLOT
#define DPRINTF(fmt, ...)                                       \
    do { printf("empty_slot: " fmt , ## __VA_ARGS__); } while (0)
#else
#define DPRINTF(fmt, ...) do {} while (0)
#endif
#include "hw/qdev-properties.h"
#include "hw/misc/empty_slot.h"
#include "trace.h"

#define TYPE_EMPTY_SLOT "empty_slot"
#define EMPTY_SLOT(obj) OBJECT_CHECK(EmptySlot, (obj), TYPE_EMPTY_SLOT)
@@ -30,20 +22,26 @@ typedef struct EmptySlot {
    SysBusDevice parent_obj;

    MemoryRegion iomem;
    char *name;
    uint64_t size;
} EmptySlot;

static uint64_t empty_slot_read(void *opaque, hwaddr addr,
                                unsigned size)
{
    DPRINTF("read from " TARGET_FMT_plx "\n", addr);
    EmptySlot *s = EMPTY_SLOT(opaque);

    trace_empty_slot_write(addr, size << 1, 0, size, s->name);

    return 0;
}

static void empty_slot_write(void *opaque, hwaddr addr,
                             uint64_t val, unsigned size)
{
    DPRINTF("write 0x%x to " TARGET_FMT_plx "\n", (unsigned)val, addr);
    EmptySlot *s = EMPTY_SLOT(opaque);

    trace_empty_slot_write(addr, size << 1, val, size, s->name);
}

static const MemoryRegionOps empty_slot_ops = {
@@ -52,22 +50,18 @@ static const MemoryRegionOps empty_slot_ops = {
    .endianness = DEVICE_NATIVE_ENDIAN,
};

void empty_slot_init(hwaddr addr, uint64_t slot_size)
void empty_slot_init(const char *name, hwaddr addr, uint64_t slot_size)
{
    if (slot_size > 0) {
        /* Only empty slots larger than 0 byte need handling. */
        DeviceState *dev;
        SysBusDevice *s;
        EmptySlot *e;

        dev = qdev_create(NULL, TYPE_EMPTY_SLOT);
        s = SYS_BUS_DEVICE(dev);
        e = EMPTY_SLOT(dev);
        e->size = slot_size;

        qdev_prop_set_uint64(dev, "size", slot_size);
        qdev_init_nofail(dev);

        sysbus_mmio_map(s, 0, addr);
        sysbus_mmio_map_overlap(SYS_BUS_DEVICE(dev), 0, addr, -10000);
    }
}

@@ -75,16 +69,27 @@ static void empty_slot_realize(DeviceState *dev, Error **errp)
{
    EmptySlot *s = EMPTY_SLOT(dev);

    if (s->name == NULL) {
        s->name = g_strdup("empty-slot");
    }
    memory_region_init_io(&s->iomem, OBJECT(s), &empty_slot_ops, s,
                          "empty-slot", s->size);
                          s->name, s->size);
    sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->iomem);
}

static Property empty_slot_properties[] = {
    DEFINE_PROP_UINT64("size", EmptySlot, size, 0),
    DEFINE_PROP_STRING("name", EmptySlot, name),
    DEFINE_PROP_END_OF_LIST(),
};

static void empty_slot_class_init(ObjectClass *klass, void *data)
{
    DeviceClass *dc = DEVICE_CLASS(klass);

    dc->realize = empty_slot_realize;
    device_class_set_props(dc, empty_slot_properties);
    set_bit(DEVICE_CATEGORY_MISC, dc->categories);
}

static const TypeInfo empty_slot_info = {
Loading