mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
Drop the deprecated unicore32 target
Target unicore32 was deprecated in commit 8e4ff4a8d2, v5.2.0. See
there for rationale.
Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20210503084034.3804963-3-armbru@redhat.com>
Acked-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
+1
-1
@@ -624,7 +624,7 @@ build-deprecated:
|
||||
IMAGE: debian-all-test-cross
|
||||
CONFIGURE_ARGS: --disable-tools
|
||||
MAKE_CHECK_ARGS: build-tcg
|
||||
TARGETS: ppc64abi32-linux-user unicore32-softmmu
|
||||
TARGETS: ppc64abi32-linux-user
|
||||
artifacts:
|
||||
expire_in: 2 days
|
||||
paths:
|
||||
|
||||
-15
@@ -318,13 +318,6 @@ F: hw/sparc64/
|
||||
F: include/hw/sparc/sparc64.h
|
||||
F: disas/sparc.c
|
||||
|
||||
UniCore32 TCG CPUs
|
||||
M: Guan Xuetao <gxt@mprc.pku.edu.cn>
|
||||
S: Maintained
|
||||
F: target/unicore32/
|
||||
F: hw/unicore32/
|
||||
F: include/hw/unicore32/
|
||||
|
||||
X86 TCG CPUs
|
||||
M: Paolo Bonzini <pbonzini@redhat.com>
|
||||
M: Richard Henderson <richard.henderson@linaro.org>
|
||||
@@ -1508,14 +1501,6 @@ F: hw/s390x/s390-pci*
|
||||
F: include/hw/s390x/s390-pci*
|
||||
L: qemu-s390x@nongnu.org
|
||||
|
||||
UniCore32 Machines
|
||||
------------------
|
||||
PKUnity-3 SoC initramfs-with-busybox
|
||||
M: Guan Xuetao <gxt@mprc.pku.edu.cn>
|
||||
S: Maintained
|
||||
F: hw/*/puv3*
|
||||
F: hw/unicore32/
|
||||
|
||||
X86 Machines
|
||||
------------
|
||||
PC
|
||||
|
||||
@@ -1663,7 +1663,7 @@ if [ "$ARCH" = "unknown" ]; then
|
||||
fi
|
||||
|
||||
default_target_list=""
|
||||
deprecated_targets_list=ppc64abi32-linux-user,unicore32-softmmu
|
||||
deprecated_targets_list=ppc64abi32-linux-user
|
||||
deprecated_features=""
|
||||
mak_wilds=""
|
||||
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
# Default configuration for unicore32-softmmu
|
||||
|
||||
# Boards:
|
||||
#
|
||||
CONFIG_PUV3=y
|
||||
CONFIG_SEMIHOSTING=y
|
||||
@@ -1 +0,0 @@
|
||||
TARGET_ARCH=unicore32
|
||||
@@ -198,14 +198,6 @@ from Linux upstream kernel, declare it deprecated.
|
||||
System emulator CPUS
|
||||
--------------------
|
||||
|
||||
``unicore32`` CPUs (since 5.2.0)
|
||||
''''''''''''''''''''''''''''''''
|
||||
|
||||
The ``unicore32`` guest CPU support is deprecated and will be removed in
|
||||
a future version of QEMU. Support for this CPU was removed from the
|
||||
upstream Linux kernel, and there is no available upstream toolchain
|
||||
to build binaries for it.
|
||||
|
||||
``Icelake-Client`` CPU Model (since 5.2.0)
|
||||
''''''''''''''''''''''''''''''''''''''''''
|
||||
|
||||
|
||||
@@ -305,6 +305,13 @@ The only public user of this architecture was the milkymist project,
|
||||
which has been dead for years; there was never an upstream Linux
|
||||
port. Removed without replacement.
|
||||
|
||||
``unicore32`` CPUs (since 6.1.0)
|
||||
''''''''''''''''''''''''''''''''
|
||||
|
||||
Support for this CPU was removed from the upstream Linux kernel, and
|
||||
there is no available upstream toolchain to build binaries for it.
|
||||
Removed without replacement.
|
||||
|
||||
System emulator machines
|
||||
------------------------
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ static inline bool snan_bit_is_one(float_status *status)
|
||||
{
|
||||
#if defined(TARGET_MIPS)
|
||||
return status->snan_bit_is_one;
|
||||
#elif defined(TARGET_HPPA) || defined(TARGET_UNICORE32) || defined(TARGET_SH4)
|
||||
#elif defined(TARGET_HPPA) || defined(TARGET_SH4)
|
||||
return 1;
|
||||
#else
|
||||
return 0;
|
||||
@@ -149,11 +149,10 @@ static FloatParts parts_default_nan(float_status *status)
|
||||
sign = 1;
|
||||
frac = ~0ULL;
|
||||
#else
|
||||
/* This case is true for Alpha, ARM, MIPS, OpenRISC, PPC, RISC-V,
|
||||
* S390, SH4, TriCore, and Xtensa. I cannot find documentation
|
||||
* for Unicore32; the choice from the original commit is unchanged.
|
||||
* Our other supported targets, CRIS, Nios2, and Tile,
|
||||
* do not have floating-point.
|
||||
/*
|
||||
* This case is true for Alpha, ARM, MIPS, OpenRISC, PPC, RISC-V,
|
||||
* S390, SH4, TriCore, and Xtensa. Our other supported targets,
|
||||
* CRIS, Nios2, and Tile, do not have floating-point.
|
||||
*/
|
||||
if (snan_bit_is_one(status)) {
|
||||
/* set all bits other than msb */
|
||||
|
||||
@@ -60,7 +60,6 @@ source sh4/Kconfig
|
||||
source sparc/Kconfig
|
||||
source sparc64/Kconfig
|
||||
source tricore/Kconfig
|
||||
source unicore32/Kconfig
|
||||
source xtensa/Kconfig
|
||||
|
||||
# Symbols used by multiple targets
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
softmmu_ss.add(when: 'CONFIG_PUV3', if_true: files('puv3_dma.c'))
|
||||
softmmu_ss.add(when: 'CONFIG_RC4030', if_true: files('rc4030.c'))
|
||||
softmmu_ss.add(when: 'CONFIG_PL080', if_true: files('pl080.c'))
|
||||
softmmu_ss.add(when: 'CONFIG_PL330', if_true: files('pl330.c'))
|
||||
|
||||
@@ -1,119 +0,0 @@
|
||||
/*
|
||||
* DMA device simulation in PKUnity SoC
|
||||
*
|
||||
* Copyright (C) 2010-2012 Guan Xuetao
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation, or any later version.
|
||||
* See the COPYING file in the top-level directory.
|
||||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "hw/sysbus.h"
|
||||
#include "qom/object.h"
|
||||
|
||||
#undef DEBUG_PUV3
|
||||
#include "hw/unicore32/puv3.h"
|
||||
#include "qemu/module.h"
|
||||
#include "qemu/log.h"
|
||||
|
||||
#define PUV3_DMA_CH_NR (6)
|
||||
#define PUV3_DMA_CH_MASK (0xff)
|
||||
#define PUV3_DMA_CH(offset) ((offset) >> 8)
|
||||
|
||||
#define TYPE_PUV3_DMA "puv3_dma"
|
||||
OBJECT_DECLARE_SIMPLE_TYPE(PUV3DMAState, PUV3_DMA)
|
||||
|
||||
struct PUV3DMAState {
|
||||
SysBusDevice parent_obj;
|
||||
|
||||
MemoryRegion iomem;
|
||||
uint32_t reg_CFG[PUV3_DMA_CH_NR];
|
||||
};
|
||||
|
||||
static uint64_t puv3_dma_read(void *opaque, hwaddr offset,
|
||||
unsigned size)
|
||||
{
|
||||
PUV3DMAState *s = opaque;
|
||||
uint32_t ret = 0;
|
||||
|
||||
assert(PUV3_DMA_CH(offset) < PUV3_DMA_CH_NR);
|
||||
|
||||
switch (offset & PUV3_DMA_CH_MASK) {
|
||||
case 0x10:
|
||||
ret = s->reg_CFG[PUV3_DMA_CH(offset)];
|
||||
break;
|
||||
default:
|
||||
qemu_log_mask(LOG_GUEST_ERROR,
|
||||
"%s: Bad read offset 0x%"HWADDR_PRIx"\n",
|
||||
__func__, offset);
|
||||
}
|
||||
DPRINTF("offset 0x%x, value 0x%x\n", offset, ret);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void puv3_dma_write(void *opaque, hwaddr offset,
|
||||
uint64_t value, unsigned size)
|
||||
{
|
||||
PUV3DMAState *s = opaque;
|
||||
|
||||
assert(PUV3_DMA_CH(offset) < PUV3_DMA_CH_NR);
|
||||
|
||||
switch (offset & PUV3_DMA_CH_MASK) {
|
||||
case 0x10:
|
||||
s->reg_CFG[PUV3_DMA_CH(offset)] = value;
|
||||
break;
|
||||
default:
|
||||
qemu_log_mask(LOG_GUEST_ERROR,
|
||||
"%s: Bad write offset 0x%"HWADDR_PRIx"\n",
|
||||
__func__, offset);
|
||||
}
|
||||
DPRINTF("offset 0x%x, value 0x%x\n", offset, value);
|
||||
}
|
||||
|
||||
static const MemoryRegionOps puv3_dma_ops = {
|
||||
.read = puv3_dma_read,
|
||||
.write = puv3_dma_write,
|
||||
.impl = {
|
||||
.min_access_size = 4,
|
||||
.max_access_size = 4,
|
||||
},
|
||||
.endianness = DEVICE_NATIVE_ENDIAN,
|
||||
};
|
||||
|
||||
static void puv3_dma_realize(DeviceState *dev, Error **errp)
|
||||
{
|
||||
PUV3DMAState *s = PUV3_DMA(dev);
|
||||
int i;
|
||||
|
||||
for (i = 0; i < PUV3_DMA_CH_NR; i++) {
|
||||
s->reg_CFG[i] = 0x0;
|
||||
}
|
||||
|
||||
memory_region_init_io(&s->iomem, OBJECT(s), &puv3_dma_ops, s, "puv3_dma",
|
||||
PUV3_REGS_OFFSET);
|
||||
sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->iomem);
|
||||
}
|
||||
|
||||
static void puv3_dma_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
|
||||
dc->realize = puv3_dma_realize;
|
||||
}
|
||||
|
||||
static const TypeInfo puv3_dma_info = {
|
||||
.name = TYPE_PUV3_DMA,
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(PUV3DMAState),
|
||||
.class_init = puv3_dma_class_init,
|
||||
};
|
||||
|
||||
static void puv3_dma_register_type(void)
|
||||
{
|
||||
type_register_static(&puv3_dma_info);
|
||||
}
|
||||
|
||||
type_init(puv3_dma_register_type)
|
||||
@@ -3,7 +3,6 @@ softmmu_ss.add(when: 'CONFIG_GPIO_KEY', if_true: files('gpio_key.c'))
|
||||
softmmu_ss.add(when: 'CONFIG_GPIO_PWR', if_true: files('gpio_pwr.c'))
|
||||
softmmu_ss.add(when: 'CONFIG_MAX7310', if_true: files('max7310.c'))
|
||||
softmmu_ss.add(when: 'CONFIG_PL061', if_true: files('pl061.c'))
|
||||
softmmu_ss.add(when: 'CONFIG_PUV3', if_true: files('puv3_gpio.c'))
|
||||
softmmu_ss.add(when: 'CONFIG_ZAURUS', if_true: files('zaurus.c'))
|
||||
|
||||
softmmu_ss.add(when: 'CONFIG_IMX', if_true: files('imx_gpio.c'))
|
||||
|
||||
@@ -1,154 +0,0 @@
|
||||
/*
|
||||
* GPIO device simulation in PKUnity SoC
|
||||
*
|
||||
* Copyright (C) 2010-2012 Guan Xuetao
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation, or any later version.
|
||||
* See the COPYING file in the top-level directory.
|
||||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "hw/sysbus.h"
|
||||
#include "qom/object.h"
|
||||
|
||||
#undef DEBUG_PUV3
|
||||
#include "hw/unicore32/puv3.h"
|
||||
#include "qemu/module.h"
|
||||
#include "qemu/log.h"
|
||||
|
||||
#define TYPE_PUV3_GPIO "puv3_gpio"
|
||||
OBJECT_DECLARE_SIMPLE_TYPE(PUV3GPIOState, PUV3_GPIO)
|
||||
|
||||
struct PUV3GPIOState {
|
||||
SysBusDevice parent_obj;
|
||||
|
||||
MemoryRegion iomem;
|
||||
qemu_irq irq[9];
|
||||
|
||||
uint32_t reg_GPLR;
|
||||
uint32_t reg_GPDR;
|
||||
uint32_t reg_GPIR;
|
||||
};
|
||||
|
||||
static uint64_t puv3_gpio_read(void *opaque, hwaddr offset,
|
||||
unsigned size)
|
||||
{
|
||||
PUV3GPIOState *s = opaque;
|
||||
uint32_t ret = 0;
|
||||
|
||||
switch (offset) {
|
||||
case 0x00:
|
||||
ret = s->reg_GPLR;
|
||||
break;
|
||||
case 0x04:
|
||||
ret = s->reg_GPDR;
|
||||
break;
|
||||
case 0x20:
|
||||
ret = s->reg_GPIR;
|
||||
break;
|
||||
default:
|
||||
qemu_log_mask(LOG_GUEST_ERROR,
|
||||
"%s: Bad read offset 0x%"HWADDR_PRIx"\n",
|
||||
__func__, offset);
|
||||
}
|
||||
DPRINTF("offset 0x%x, value 0x%x\n", offset, ret);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void puv3_gpio_write(void *opaque, hwaddr offset,
|
||||
uint64_t value, unsigned size)
|
||||
{
|
||||
PUV3GPIOState *s = opaque;
|
||||
|
||||
DPRINTF("offset 0x%x, value 0x%x\n", offset, value);
|
||||
switch (offset) {
|
||||
case 0x04:
|
||||
s->reg_GPDR = value;
|
||||
break;
|
||||
case 0x08:
|
||||
if (s->reg_GPDR & value) {
|
||||
s->reg_GPLR |= value;
|
||||
} else {
|
||||
qemu_log_mask(LOG_GUEST_ERROR, "%s: Write gpio input port\n",
|
||||
__func__);
|
||||
}
|
||||
break;
|
||||
case 0x0c:
|
||||
if (s->reg_GPDR & value) {
|
||||
s->reg_GPLR &= ~value;
|
||||
} else {
|
||||
qemu_log_mask(LOG_GUEST_ERROR, "%s: Write gpio input port\n",
|
||||
__func__);
|
||||
}
|
||||
break;
|
||||
case 0x10: /* GRER */
|
||||
case 0x14: /* GFER */
|
||||
case 0x18: /* GEDR */
|
||||
break;
|
||||
case 0x20: /* GPIR */
|
||||
s->reg_GPIR = value;
|
||||
break;
|
||||
default:
|
||||
qemu_log_mask(LOG_GUEST_ERROR,
|
||||
"%s: Bad write offset 0x%"HWADDR_PRIx"\n",
|
||||
__func__, offset);
|
||||
}
|
||||
}
|
||||
|
||||
static const MemoryRegionOps puv3_gpio_ops = {
|
||||
.read = puv3_gpio_read,
|
||||
.write = puv3_gpio_write,
|
||||
.impl = {
|
||||
.min_access_size = 4,
|
||||
.max_access_size = 4,
|
||||
},
|
||||
.endianness = DEVICE_NATIVE_ENDIAN,
|
||||
};
|
||||
|
||||
static void puv3_gpio_realize(DeviceState *dev, Error **errp)
|
||||
{
|
||||
PUV3GPIOState *s = PUV3_GPIO(dev);
|
||||
SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
|
||||
|
||||
s->reg_GPLR = 0;
|
||||
s->reg_GPDR = 0;
|
||||
|
||||
/* FIXME: these irqs not handled yet */
|
||||
sysbus_init_irq(sbd, &s->irq[PUV3_IRQS_GPIOLOW0]);
|
||||
sysbus_init_irq(sbd, &s->irq[PUV3_IRQS_GPIOLOW1]);
|
||||
sysbus_init_irq(sbd, &s->irq[PUV3_IRQS_GPIOLOW2]);
|
||||
sysbus_init_irq(sbd, &s->irq[PUV3_IRQS_GPIOLOW3]);
|
||||
sysbus_init_irq(sbd, &s->irq[PUV3_IRQS_GPIOLOW4]);
|
||||
sysbus_init_irq(sbd, &s->irq[PUV3_IRQS_GPIOLOW5]);
|
||||
sysbus_init_irq(sbd, &s->irq[PUV3_IRQS_GPIOLOW6]);
|
||||
sysbus_init_irq(sbd, &s->irq[PUV3_IRQS_GPIOLOW7]);
|
||||
sysbus_init_irq(sbd, &s->irq[PUV3_IRQS_GPIOHIGH]);
|
||||
|
||||
memory_region_init_io(&s->iomem, OBJECT(s), &puv3_gpio_ops, s, "puv3_gpio",
|
||||
PUV3_REGS_OFFSET);
|
||||
sysbus_init_mmio(sbd, &s->iomem);
|
||||
}
|
||||
|
||||
static void puv3_gpio_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
|
||||
dc->realize = puv3_gpio_realize;
|
||||
}
|
||||
|
||||
static const TypeInfo puv3_gpio_info = {
|
||||
.name = TYPE_PUV3_GPIO,
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(PUV3GPIOState),
|
||||
.class_init = puv3_gpio_class_init,
|
||||
};
|
||||
|
||||
static void puv3_gpio_register_type(void)
|
||||
{
|
||||
type_register_static(&puv3_gpio_info);
|
||||
}
|
||||
|
||||
type_init(puv3_gpio_register_type)
|
||||
@@ -16,7 +16,6 @@ softmmu_ss.add(when: 'CONFIG_IMX', if_true: files('imx_avic.c', 'imx_gpcv2.c'))
|
||||
softmmu_ss.add(when: 'CONFIG_IOAPIC', if_true: files('ioapic_common.c'))
|
||||
softmmu_ss.add(when: 'CONFIG_OPENPIC', if_true: files('openpic.c'))
|
||||
softmmu_ss.add(when: 'CONFIG_PL190', if_true: files('pl190.c'))
|
||||
softmmu_ss.add(when: 'CONFIG_PUV3', if_true: files('puv3_intc.c'))
|
||||
softmmu_ss.add(when: 'CONFIG_REALVIEW', if_true: files('realview_gic.c'))
|
||||
softmmu_ss.add(when: 'CONFIG_SLAVIO', if_true: files('slavio_intctl.c'))
|
||||
softmmu_ss.add(when: 'CONFIG_XILINX', if_true: files('xilinx_intc.c'))
|
||||
|
||||
@@ -1,147 +0,0 @@
|
||||
/*
|
||||
* INTC device simulation in PKUnity SoC
|
||||
*
|
||||
* Copyright (C) 2010-2012 Guan Xuetao
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation, or any later version.
|
||||
* See the COPYING file in the top-level directory.
|
||||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "hw/irq.h"
|
||||
#include "hw/sysbus.h"
|
||||
#include "qom/object.h"
|
||||
|
||||
#undef DEBUG_PUV3
|
||||
#include "hw/unicore32/puv3.h"
|
||||
#include "qemu/module.h"
|
||||
#include "qemu/log.h"
|
||||
|
||||
#define TYPE_PUV3_INTC "puv3_intc"
|
||||
OBJECT_DECLARE_SIMPLE_TYPE(PUV3INTCState, PUV3_INTC)
|
||||
|
||||
struct PUV3INTCState {
|
||||
SysBusDevice parent_obj;
|
||||
|
||||
MemoryRegion iomem;
|
||||
qemu_irq parent_irq;
|
||||
|
||||
uint32_t reg_ICMR;
|
||||
uint32_t reg_ICPR;
|
||||
};
|
||||
|
||||
/* Update interrupt status after enabled or pending bits have been changed. */
|
||||
static void puv3_intc_update(PUV3INTCState *s)
|
||||
{
|
||||
if (s->reg_ICMR & s->reg_ICPR) {
|
||||
qemu_irq_raise(s->parent_irq);
|
||||
} else {
|
||||
qemu_irq_lower(s->parent_irq);
|
||||
}
|
||||
}
|
||||
|
||||
/* Process a change in an external INTC input. */
|
||||
static void puv3_intc_handler(void *opaque, int irq, int level)
|
||||
{
|
||||
PUV3INTCState *s = opaque;
|
||||
|
||||
DPRINTF("irq 0x%x, level 0x%x\n", irq, level);
|
||||
if (level) {
|
||||
s->reg_ICPR |= (1 << irq);
|
||||
} else {
|
||||
s->reg_ICPR &= ~(1 << irq);
|
||||
}
|
||||
puv3_intc_update(s);
|
||||
}
|
||||
|
||||
static uint64_t puv3_intc_read(void *opaque, hwaddr offset,
|
||||
unsigned size)
|
||||
{
|
||||
PUV3INTCState *s = opaque;
|
||||
uint32_t ret = 0;
|
||||
|
||||
switch (offset) {
|
||||
case 0x04: /* INTC_ICMR */
|
||||
ret = s->reg_ICMR;
|
||||
break;
|
||||
case 0x0c: /* INTC_ICIP */
|
||||
ret = s->reg_ICPR; /* the same value with ICPR */
|
||||
break;
|
||||
default:
|
||||
qemu_log_mask(LOG_GUEST_ERROR,
|
||||
"%s: Bad read offset 0x%"HWADDR_PRIx"\n",
|
||||
__func__, offset);
|
||||
}
|
||||
DPRINTF("offset 0x%x, value 0x%x\n", offset, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void puv3_intc_write(void *opaque, hwaddr offset,
|
||||
uint64_t value, unsigned size)
|
||||
{
|
||||
PUV3INTCState *s = opaque;
|
||||
|
||||
DPRINTF("offset 0x%x, value 0x%x\n", offset, value);
|
||||
switch (offset) {
|
||||
case 0x00: /* INTC_ICLR */
|
||||
case 0x14: /* INTC_ICCR */
|
||||
break;
|
||||
case 0x04: /* INTC_ICMR */
|
||||
s->reg_ICMR = value;
|
||||
break;
|
||||
default:
|
||||
qemu_log_mask(LOG_GUEST_ERROR,
|
||||
"%s: Bad write offset 0x%"HWADDR_PRIx"\n",
|
||||
__func__, offset);
|
||||
return;
|
||||
}
|
||||
puv3_intc_update(s);
|
||||
}
|
||||
|
||||
static const MemoryRegionOps puv3_intc_ops = {
|
||||
.read = puv3_intc_read,
|
||||
.write = puv3_intc_write,
|
||||
.impl = {
|
||||
.min_access_size = 4,
|
||||
.max_access_size = 4,
|
||||
},
|
||||
.endianness = DEVICE_NATIVE_ENDIAN,
|
||||
};
|
||||
|
||||
static void puv3_intc_realize(DeviceState *dev, Error **errp)
|
||||
{
|
||||
PUV3INTCState *s = PUV3_INTC(dev);
|
||||
SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
|
||||
|
||||
qdev_init_gpio_in(dev, puv3_intc_handler, PUV3_IRQS_NR);
|
||||
sysbus_init_irq(sbd, &s->parent_irq);
|
||||
|
||||
s->reg_ICMR = 0;
|
||||
s->reg_ICPR = 0;
|
||||
|
||||
memory_region_init_io(&s->iomem, OBJECT(s), &puv3_intc_ops, s, "puv3_intc",
|
||||
PUV3_REGS_OFFSET);
|
||||
sysbus_init_mmio(sbd, &s->iomem);
|
||||
}
|
||||
|
||||
static void puv3_intc_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
dc->realize = puv3_intc_realize;
|
||||
}
|
||||
|
||||
static const TypeInfo puv3_intc_info = {
|
||||
.name = TYPE_PUV3_INTC,
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(PUV3INTCState),
|
||||
.class_init = puv3_intc_class_init,
|
||||
};
|
||||
|
||||
static void puv3_intc_register_type(void)
|
||||
{
|
||||
type_register_static(&puv3_intc_info);
|
||||
}
|
||||
|
||||
type_init(puv3_intc_register_type)
|
||||
@@ -61,5 +61,4 @@ subdir('sh4')
|
||||
subdir('sparc')
|
||||
subdir('sparc64')
|
||||
subdir('tricore')
|
||||
subdir('unicore32')
|
||||
subdir('xtensa')
|
||||
|
||||
@@ -36,9 +36,6 @@ softmmu_ss.add(when: 'CONFIG_SIFIVE_E_PRCI', if_true: files('sifive_e_prci.c'))
|
||||
softmmu_ss.add(when: 'CONFIG_SIFIVE_U_OTP', if_true: files('sifive_u_otp.c'))
|
||||
softmmu_ss.add(when: 'CONFIG_SIFIVE_U_PRCI', if_true: files('sifive_u_prci.c'))
|
||||
|
||||
# PKUnity SoC devices
|
||||
softmmu_ss.add(when: 'CONFIG_PUV3', if_true: files('puv3_pm.c'))
|
||||
|
||||
subdir('macio')
|
||||
|
||||
softmmu_ss.add(when: 'CONFIG_IVSHMEM_DEVICE', if_true: files('ivshmem.c'))
|
||||
|
||||
@@ -1,159 +0,0 @@
|
||||
/*
|
||||
* Power Management device simulation in PKUnity SoC
|
||||
*
|
||||
* Copyright (C) 2010-2012 Guan Xuetao
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation, or any later version.
|
||||
* See the COPYING file in the top-level directory.
|
||||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "hw/sysbus.h"
|
||||
#include "qom/object.h"
|
||||
|
||||
#undef DEBUG_PUV3
|
||||
#include "hw/unicore32/puv3.h"
|
||||
#include "qemu/module.h"
|
||||
#include "qemu/log.h"
|
||||
|
||||
#define TYPE_PUV3_PM "puv3_pm"
|
||||
OBJECT_DECLARE_SIMPLE_TYPE(PUV3PMState, PUV3_PM)
|
||||
|
||||
struct PUV3PMState {
|
||||
SysBusDevice parent_obj;
|
||||
|
||||
MemoryRegion iomem;
|
||||
|
||||
uint32_t reg_PMCR;
|
||||
uint32_t reg_PCGR;
|
||||
uint32_t reg_PLL_SYS_CFG;
|
||||
uint32_t reg_PLL_DDR_CFG;
|
||||
uint32_t reg_PLL_VGA_CFG;
|
||||
uint32_t reg_DIVCFG;
|
||||
};
|
||||
|
||||
static uint64_t puv3_pm_read(void *opaque, hwaddr offset,
|
||||
unsigned size)
|
||||
{
|
||||
PUV3PMState *s = opaque;
|
||||
uint32_t ret = 0;
|
||||
|
||||
switch (offset) {
|
||||
case 0x14:
|
||||
ret = s->reg_PCGR;
|
||||
break;
|
||||
case 0x18:
|
||||
ret = s->reg_PLL_SYS_CFG;
|
||||
break;
|
||||
case 0x1c:
|
||||
ret = s->reg_PLL_DDR_CFG;
|
||||
break;
|
||||
case 0x20:
|
||||
ret = s->reg_PLL_VGA_CFG;
|
||||
break;
|
||||
case 0x24:
|
||||
ret = s->reg_DIVCFG;
|
||||
break;
|
||||
case 0x28: /* PLL SYS STATUS */
|
||||
ret = 0x00002401;
|
||||
break;
|
||||
case 0x2c: /* PLL DDR STATUS */
|
||||
ret = 0x00100c00;
|
||||
break;
|
||||
case 0x30: /* PLL VGA STATUS */
|
||||
ret = 0x00003801;
|
||||
break;
|
||||
case 0x34: /* DIV STATUS */
|
||||
ret = 0x22f52015;
|
||||
break;
|
||||
case 0x38: /* SW RESET */
|
||||
ret = 0x0;
|
||||
break;
|
||||
case 0x44: /* PLL DFC DONE */
|
||||
ret = 0x7;
|
||||
break;
|
||||
default:
|
||||
qemu_log_mask(LOG_GUEST_ERROR,
|
||||
"%s: Bad read offset 0x%"HWADDR_PRIx"\n",
|
||||
__func__, offset);
|
||||
}
|
||||
DPRINTF("offset 0x%x, value 0x%x\n", offset, ret);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void puv3_pm_write(void *opaque, hwaddr offset,
|
||||
uint64_t value, unsigned size)
|
||||
{
|
||||
PUV3PMState *s = opaque;
|
||||
|
||||
switch (offset) {
|
||||
case 0x0:
|
||||
s->reg_PMCR = value;
|
||||
break;
|
||||
case 0x14:
|
||||
s->reg_PCGR = value;
|
||||
break;
|
||||
case 0x18:
|
||||
s->reg_PLL_SYS_CFG = value;
|
||||
break;
|
||||
case 0x1c:
|
||||
s->reg_PLL_DDR_CFG = value;
|
||||
break;
|
||||
case 0x20:
|
||||
s->reg_PLL_VGA_CFG = value;
|
||||
break;
|
||||
case 0x24:
|
||||
case 0x38:
|
||||
break;
|
||||
default:
|
||||
qemu_log_mask(LOG_GUEST_ERROR,
|
||||
"%s: Bad write offset 0x%"HWADDR_PRIx"\n",
|
||||
__func__, offset);
|
||||
}
|
||||
DPRINTF("offset 0x%x, value 0x%x\n", offset, value);
|
||||
}
|
||||
|
||||
static const MemoryRegionOps puv3_pm_ops = {
|
||||
.read = puv3_pm_read,
|
||||
.write = puv3_pm_write,
|
||||
.impl = {
|
||||
.min_access_size = 4,
|
||||
.max_access_size = 4,
|
||||
},
|
||||
.endianness = DEVICE_NATIVE_ENDIAN,
|
||||
};
|
||||
|
||||
static void puv3_pm_realize(DeviceState *dev, Error **errp)
|
||||
{
|
||||
PUV3PMState *s = PUV3_PM(dev);
|
||||
|
||||
s->reg_PCGR = 0x0;
|
||||
|
||||
memory_region_init_io(&s->iomem, OBJECT(s), &puv3_pm_ops, s, "puv3_pm",
|
||||
PUV3_REGS_OFFSET);
|
||||
sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->iomem);
|
||||
}
|
||||
|
||||
static void puv3_pm_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
|
||||
dc->realize = puv3_pm_realize;
|
||||
}
|
||||
|
||||
static const TypeInfo puv3_pm_info = {
|
||||
.name = TYPE_PUV3_PM,
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(PUV3PMState),
|
||||
.class_init = puv3_pm_class_init,
|
||||
};
|
||||
|
||||
static void puv3_pm_register_type(void)
|
||||
{
|
||||
type_register_static(&puv3_pm_info);
|
||||
}
|
||||
|
||||
type_init(puv3_pm_register_type)
|
||||
@@ -25,7 +25,6 @@ softmmu_ss.add(when: 'CONFIG_NPCM7XX', if_true: files('npcm7xx_timer.c'))
|
||||
softmmu_ss.add(when: 'CONFIG_NRF51_SOC', if_true: files('nrf51_timer.c'))
|
||||
softmmu_ss.add(when: 'CONFIG_OMAP', if_true: files('omap_gptimer.c'))
|
||||
softmmu_ss.add(when: 'CONFIG_OMAP', if_true: files('omap_synctimer.c'))
|
||||
softmmu_ss.add(when: 'CONFIG_PUV3', if_true: files('puv3_ost.c'))
|
||||
softmmu_ss.add(when: 'CONFIG_PXA2XX', if_true: files('pxa2xx_timer.c'))
|
||||
softmmu_ss.add(when: 'CONFIG_RASPI', if_true: files('bcm2835_systmr.c'))
|
||||
softmmu_ss.add(when: 'CONFIG_SH_TIMER', if_true: files('sh_timer.c'))
|
||||
|
||||
@@ -1,166 +0,0 @@
|
||||
/*
|
||||
* OSTimer device simulation in PKUnity SoC
|
||||
*
|
||||
* Copyright (C) 2010-2012 Guan Xuetao
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation, or any later version.
|
||||
* See the COPYING file in the top-level directory.
|
||||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "hw/sysbus.h"
|
||||
#include "hw/irq.h"
|
||||
#include "hw/ptimer.h"
|
||||
#include "qemu/module.h"
|
||||
#include "qemu/log.h"
|
||||
#include "qom/object.h"
|
||||
|
||||
#undef DEBUG_PUV3
|
||||
#include "hw/unicore32/puv3.h"
|
||||
|
||||
#define TYPE_PUV3_OST "puv3_ost"
|
||||
OBJECT_DECLARE_SIMPLE_TYPE(PUV3OSTState, PUV3_OST)
|
||||
|
||||
/* puv3 ostimer implementation. */
|
||||
struct PUV3OSTState {
|
||||
SysBusDevice parent_obj;
|
||||
|
||||
MemoryRegion iomem;
|
||||
qemu_irq irq;
|
||||
ptimer_state *ptimer;
|
||||
|
||||
uint32_t reg_OSMR0;
|
||||
uint32_t reg_OSCR;
|
||||
uint32_t reg_OSSR;
|
||||
uint32_t reg_OIER;
|
||||
};
|
||||
|
||||
static uint64_t puv3_ost_read(void *opaque, hwaddr offset,
|
||||
unsigned size)
|
||||
{
|
||||
PUV3OSTState *s = opaque;
|
||||
uint32_t ret = 0;
|
||||
|
||||
switch (offset) {
|
||||
case 0x10: /* Counter Register */
|
||||
ret = s->reg_OSMR0 - (uint32_t)ptimer_get_count(s->ptimer);
|
||||
break;
|
||||
case 0x14: /* Status Register */
|
||||
ret = s->reg_OSSR;
|
||||
break;
|
||||
case 0x1c: /* Interrupt Enable Register */
|
||||
ret = s->reg_OIER;
|
||||
break;
|
||||
default:
|
||||
qemu_log_mask(LOG_GUEST_ERROR,
|
||||
"%s: Bad read offset 0x%"HWADDR_PRIx"\n",
|
||||
__func__, offset);
|
||||
}
|
||||
DPRINTF("offset 0x%x, value 0x%x\n", offset, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void puv3_ost_write(void *opaque, hwaddr offset,
|
||||
uint64_t value, unsigned size)
|
||||
{
|
||||
PUV3OSTState *s = opaque;
|
||||
|
||||
DPRINTF("offset 0x%x, value 0x%x\n", offset, value);
|
||||
switch (offset) {
|
||||
case 0x00: /* Match Register 0 */
|
||||
ptimer_transaction_begin(s->ptimer);
|
||||
s->reg_OSMR0 = value;
|
||||
if (s->reg_OSMR0 > s->reg_OSCR) {
|
||||
ptimer_set_count(s->ptimer, s->reg_OSMR0 - s->reg_OSCR);
|
||||
} else {
|
||||
ptimer_set_count(s->ptimer, s->reg_OSMR0 +
|
||||
(0xffffffff - s->reg_OSCR));
|
||||
}
|
||||
ptimer_run(s->ptimer, 2);
|
||||
ptimer_transaction_commit(s->ptimer);
|
||||
break;
|
||||
case 0x14: /* Status Register */
|
||||
assert(value == 0);
|
||||
if (s->reg_OSSR) {
|
||||
s->reg_OSSR = value;
|
||||
qemu_irq_lower(s->irq);
|
||||
}
|
||||
break;
|
||||
case 0x1c: /* Interrupt Enable Register */
|
||||
s->reg_OIER = value;
|
||||
break;
|
||||
default:
|
||||
qemu_log_mask(LOG_GUEST_ERROR,
|
||||
"%s: Bad write offset 0x%"HWADDR_PRIx"\n",
|
||||
__func__, offset);
|
||||
}
|
||||
}
|
||||
|
||||
static const MemoryRegionOps puv3_ost_ops = {
|
||||
.read = puv3_ost_read,
|
||||
.write = puv3_ost_write,
|
||||
.impl = {
|
||||
.min_access_size = 4,
|
||||
.max_access_size = 4,
|
||||
},
|
||||
.endianness = DEVICE_NATIVE_ENDIAN,
|
||||
};
|
||||
|
||||
static void puv3_ost_tick(void *opaque)
|
||||
{
|
||||
PUV3OSTState *s = opaque;
|
||||
|
||||
DPRINTF("ost hit when ptimer counter from 0x%x to 0x%x!\n",
|
||||
s->reg_OSCR, s->reg_OSMR0);
|
||||
|
||||
s->reg_OSCR = s->reg_OSMR0;
|
||||
if (s->reg_OIER) {
|
||||
s->reg_OSSR = 1;
|
||||
qemu_irq_raise(s->irq);
|
||||
}
|
||||
}
|
||||
|
||||
static void puv3_ost_realize(DeviceState *dev, Error **errp)
|
||||
{
|
||||
PUV3OSTState *s = PUV3_OST(dev);
|
||||
SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
|
||||
|
||||
s->reg_OIER = 0;
|
||||
s->reg_OSSR = 0;
|
||||
s->reg_OSMR0 = 0;
|
||||
s->reg_OSCR = 0;
|
||||
|
||||
sysbus_init_irq(sbd, &s->irq);
|
||||
|
||||
s->ptimer = ptimer_init(puv3_ost_tick, s, PTIMER_POLICY_DEFAULT);
|
||||
ptimer_transaction_begin(s->ptimer);
|
||||
ptimer_set_freq(s->ptimer, 50 * 1000 * 1000);
|
||||
ptimer_transaction_commit(s->ptimer);
|
||||
|
||||
memory_region_init_io(&s->iomem, OBJECT(s), &puv3_ost_ops, s, "puv3_ost",
|
||||
PUV3_REGS_OFFSET);
|
||||
sysbus_init_mmio(sbd, &s->iomem);
|
||||
}
|
||||
|
||||
static void puv3_ost_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
|
||||
dc->realize = puv3_ost_realize;
|
||||
}
|
||||
|
||||
static const TypeInfo puv3_ost_info = {
|
||||
.name = TYPE_PUV3_OST,
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(PUV3OSTState),
|
||||
.class_init = puv3_ost_class_init,
|
||||
};
|
||||
|
||||
static void puv3_ost_register_type(void)
|
||||
{
|
||||
type_register_static(&puv3_ost_info);
|
||||
}
|
||||
|
||||
type_init(puv3_ost_register_type)
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user