mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20180309' into staging
target-arm queue: * i.MX: Add i.MX7 SOC implementation and i.MX7 Sabre board * Report the correct core count in A53 L2CTLR on the ZynqMP board * linux-user: preliminary SVE support work (signal handling) * hw/arm/boot: fix memory leak in case of error loading ELF file * hw/arm/boot: avoid reading off end of buffer if passed very small image file * hw/arm: Use more CONFIG switches for the object files * target/arm: Add "-cpu max" support * hw/arm/virt: Support -machine gic-version=max * hw/sd: improve debug tracing * hw/sd: sdcard: Add the Tuning Command (CMD 19) * MAINTAINERS: add Philippe as odd-fixes maintainer for SD # gpg: Signature made Fri 09 Mar 2018 17:24:23 GMT # gpg: using RSA key 3C2525ED14360CDE # gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" # gpg: aka "Peter Maydell <pmaydell@gmail.com>" # gpg: aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>" # Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83 15CF 3C25 25ED 1436 0CDE * remotes/pmaydell/tags/pull-target-arm-20180309: (25 commits) MAINTAINERS: Add entries for SD (SDHCI, SDBus, SDCard) sdhci: Fix a typo in comment sdcard: Add the Tuning Command (CMD19) sdcard: Display which protocol is used when tracing (SD or SPI) sdcard: Display command name when tracing CMD/ACMD sdcard: Do not trace CMD55, except when we already expect an ACMD hw/arm/virt: Support -machine gic-version=max hw/arm/virt: Add "max" to the list of CPU types "virt" supports target/arm: Make 'any' CPU just an alias for 'max' target/arm: Add "-cpu max" support target/arm: Move definition of 'host' cpu type into cpu.c target/arm: Query host CPU features on-demand at instance init arm: avoid heap-buffer-overflow in load_aarch64_image arm: fix load ELF error leak hw/arm: Use more CONFIG switches for the object files aarch64-linux-user: Add support for SVE signal frame records aarch64-linux-user: Add support for EXTRA signal frame records aarch64-linux-user: Remove struct target_aux_context aarch64-linux-user: Split out helpers for guest signal handling linux-user: Implement aarch64 PR_SVE_SET/GET_VL ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
@@ -1100,6 +1100,14 @@ M: Peter Crosthwaite <crosthwaite.peter@gmail.com>
|
||||
S: Maintained
|
||||
F: hw/ssi/xilinx_*
|
||||
|
||||
SD (Secure Card)
|
||||
M: Philippe Mathieu-Daudé <f4bug@amsat.org>
|
||||
S: Odd Fixes
|
||||
F: include/hw/sd/sd*
|
||||
F: hw/sd/core.c
|
||||
F: hw/sd/sd*
|
||||
F: tests/sd*
|
||||
|
||||
USB
|
||||
M: Gerd Hoffmann <kraxel@redhat.com>
|
||||
S: Maintained
|
||||
|
||||
@@ -47,6 +47,7 @@ CONFIG_A9MPCORE=y
|
||||
CONFIG_A15MPCORE=y
|
||||
|
||||
CONFIG_ARM_V7M=y
|
||||
CONFIG_NETDUINO2=y
|
||||
|
||||
CONFIG_ARM_GIC=y
|
||||
CONFIG_ARM_GIC_KVM=$(CONFIG_KVM)
|
||||
@@ -109,6 +110,7 @@ CONFIG_TZ_PPC=y
|
||||
CONFIG_IOTKIT=y
|
||||
CONFIG_IOTKIT_SECCTL=y
|
||||
|
||||
CONFIG_VERSATILE=y
|
||||
CONFIG_VERSATILE_PCI=y
|
||||
CONFIG_VERSATILE_I2C=y
|
||||
|
||||
@@ -117,6 +119,7 @@ CONFIG_VFIO_XGMAC=y
|
||||
CONFIG_VFIO_AMD_XGBE=y
|
||||
|
||||
CONFIG_SDHCI=y
|
||||
CONFIG_INTEGRATOR=y
|
||||
CONFIG_INTEGRATOR_DEBUG=y
|
||||
|
||||
CONFIG_ALLWINNER_A10_PIT=y
|
||||
@@ -126,6 +129,7 @@ CONFIG_ALLWINNER_A10=y
|
||||
CONFIG_FSL_IMX6=y
|
||||
CONFIG_FSL_IMX31=y
|
||||
CONFIG_FSL_IMX25=y
|
||||
CONFIG_FSL_IMX7=y
|
||||
|
||||
CONFIG_IMX_I2C=y
|
||||
|
||||
@@ -140,3 +144,8 @@ CONFIG_GPIO_KEY=y
|
||||
CONFIG_MSF2=y
|
||||
CONFIG_FW_CFG_DMA=y
|
||||
CONFIG_XILINX_AXI=y
|
||||
CONFIG_PCI_DESIGNWARE=y
|
||||
|
||||
CONFIG_STRONGARM=y
|
||||
CONFIG_HIGHBANK=y
|
||||
CONFIG_MUSICPAL=y
|
||||
|
||||
+22
-9
@@ -1,15 +1,27 @@
|
||||
obj-y += boot.o collie.o exynos4_boards.o gumstix.o highbank.o
|
||||
obj-$(CONFIG_DIGIC) += digic_boards.o
|
||||
obj-y += integratorcp.o mainstone.o musicpal.o nseries.o
|
||||
obj-y += omap_sx1.o palm.o realview.o spitz.o stellaris.o
|
||||
obj-y += tosa.o versatilepb.o vexpress.o virt.o xilinx_zynq.o z2.o
|
||||
obj-y += boot.o virt.o sysbus-fdt.o
|
||||
obj-$(CONFIG_ACPI) += virt-acpi-build.o
|
||||
obj-y += netduino2.o
|
||||
obj-y += sysbus-fdt.o
|
||||
obj-$(CONFIG_DIGIC) += digic_boards.o
|
||||
obj-$(CONFIG_EXYNOS4) += exynos4_boards.o
|
||||
obj-$(CONFIG_HIGHBANK) += highbank.o
|
||||
obj-$(CONFIG_INTEGRATOR) += integratorcp.o
|
||||
obj-$(CONFIG_MAINSTONE) += mainstone.o
|
||||
obj-$(CONFIG_MUSICPAL) += musicpal.o
|
||||
obj-$(CONFIG_NETDUINO2) += netduino2.o
|
||||
obj-$(CONFIG_NSERIES) += nseries.o
|
||||
obj-$(CONFIG_OMAP) += omap_sx1.o palm.o
|
||||
obj-$(CONFIG_PXA2XX) += gumstix.o spitz.o tosa.o z2.o
|
||||
obj-$(CONFIG_REALVIEW) += realview.o
|
||||
obj-$(CONFIG_STELLARIS) += stellaris.o
|
||||
obj-$(CONFIG_STRONGARM) += collie.o
|
||||
obj-$(CONFIG_VERSATILE) += vexpress.o versatilepb.o
|
||||
obj-$(CONFIG_ZYNQ) += xilinx_zynq.o
|
||||
|
||||
obj-y += armv7m.o exynos4210.o pxa2xx.o pxa2xx_gpio.o pxa2xx_pic.o
|
||||
obj-$(CONFIG_ARM_V7M) += armv7m.o
|
||||
obj-$(CONFIG_EXYNOS4) += exynos4210.o
|
||||
obj-$(CONFIG_PXA2XX) += pxa2xx.o pxa2xx_gpio.o pxa2xx_pic.o
|
||||
obj-$(CONFIG_DIGIC) += digic.o
|
||||
obj-y += omap1.o omap2.o strongarm.o
|
||||
obj-$(CONFIG_OMAP) += omap1.o omap2.o
|
||||
obj-$(CONFIG_STRONGARM) += strongarm.o
|
||||
obj-$(CONFIG_ALLWINNER_A10) += allwinner-a10.o cubieboard.o
|
||||
obj-$(CONFIG_RASPI) += bcm2835_peripherals.o bcm2836.o raspi.o
|
||||
obj-$(CONFIG_STM32F205_SOC) += stm32f205_soc.o
|
||||
@@ -22,3 +34,4 @@ obj-$(CONFIG_MPS2) += mps2.o
|
||||
obj-$(CONFIG_MPS2) += mps2-tz.o
|
||||
obj-$(CONFIG_MSF2) += msf2-soc.o msf2-som.o
|
||||
obj-$(CONFIG_IOTKIT) += iotkit.o
|
||||
obj-$(CONFIG_FSL_IMX7) += fsl-imx7.o mcimx7d-sabre.o
|
||||
|
||||
+3
-1
@@ -829,6 +829,7 @@ static uint64_t arm_load_elf(struct arm_boot_info *info, uint64_t *pentry,
|
||||
|
||||
load_elf_hdr(info->kernel_filename, &elf_header, &elf_is64, &err);
|
||||
if (err) {
|
||||
error_free(err);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -890,7 +891,8 @@ static uint64_t load_aarch64_image(const char *filename, hwaddr mem_base,
|
||||
}
|
||||
|
||||
/* check the arm64 magic header value -- very old kernels may not have it */
|
||||
if (memcmp(buffer + ARM64_MAGIC_OFFSET, "ARM\x64", 4) == 0) {
|
||||
if (size > ARM64_MAGIC_OFFSET + 4 &&
|
||||
memcmp(buffer + ARM64_MAGIC_OFFSET, "ARM\x64", 4) == 0) {
|
||||
uint64_t hdrvals[2];
|
||||
|
||||
/* The arm64 Image header has text_offset and image_size fields at 8 and
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* Copyright (c) 2018, Impinj, Inc.
|
||||
*
|
||||
* MCIMX7D_SABRE Board System emulation.
|
||||
*
|
||||
* Author: Andrey Smirnov <andrew.smirnov@gmail.com>
|
||||
*
|
||||
* This code is licensed under the GPL, version 2 or later.
|
||||
* See the file `COPYING' in the top level directory.
|
||||
*
|
||||
* It (partially) emulates a mcimx7d_sabre board, with a Freescale
|
||||
* i.MX7 SoC
|
||||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qemu-common.h"
|
||||
#include "hw/arm/fsl-imx7.h"
|
||||
#include "hw/boards.h"
|
||||
#include "sysemu/sysemu.h"
|
||||
#include "sysemu/device_tree.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "sysemu/qtest.h"
|
||||
#include "net/net.h"
|
||||
|
||||
typedef struct {
|
||||
FslIMX7State soc;
|
||||
MemoryRegion ram;
|
||||
} MCIMX7Sabre;
|
||||
|
||||
static void mcimx7d_sabre_init(MachineState *machine)
|
||||
{
|
||||
static struct arm_boot_info boot_info;
|
||||
MCIMX7Sabre *s = g_new0(MCIMX7Sabre, 1);
|
||||
Object *soc;
|
||||
int i;
|
||||
|
||||
if (machine->ram_size > FSL_IMX7_MMDC_SIZE) {
|
||||
error_report("RAM size " RAM_ADDR_FMT " above max supported (%08x)",
|
||||
machine->ram_size, FSL_IMX7_MMDC_SIZE);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
boot_info = (struct arm_boot_info) {
|
||||
.loader_start = FSL_IMX7_MMDC_ADDR,
|
||||
.board_id = -1,
|
||||
.ram_size = machine->ram_size,
|
||||
.kernel_filename = machine->kernel_filename,
|
||||
.kernel_cmdline = machine->kernel_cmdline,
|
||||
.initrd_filename = machine->initrd_filename,
|
||||
.nb_cpus = smp_cpus,
|
||||
};
|
||||
|
||||
object_initialize(&s->soc, sizeof(s->soc), TYPE_FSL_IMX7);
|
||||
soc = OBJECT(&s->soc);
|
||||
object_property_add_child(OBJECT(machine), "soc", soc, &error_fatal);
|
||||
object_property_set_bool(soc, true, "realized", &error_fatal);
|
||||
|
||||
memory_region_allocate_system_memory(&s->ram, NULL, "mcimx7d-sabre.ram",
|
||||
machine->ram_size);
|
||||
memory_region_add_subregion(get_system_memory(),
|
||||
FSL_IMX7_MMDC_ADDR, &s->ram);
|
||||
|
||||
for (i = 0; i < FSL_IMX7_NUM_USDHCS; i++) {
|
||||
BusState *bus;
|
||||
DeviceState *carddev;
|
||||
DriveInfo *di;
|
||||
BlockBackend *blk;
|
||||
|
||||
di = drive_get_next(IF_SD);
|
||||
blk = di ? blk_by_legacy_dinfo(di) : NULL;
|
||||
bus = qdev_get_child_bus(DEVICE(&s->soc.usdhc[i]), "sd-bus");
|
||||
carddev = qdev_create(bus, TYPE_SD_CARD);
|
||||
qdev_prop_set_drive(carddev, "drive", blk, &error_fatal);
|
||||
object_property_set_bool(OBJECT(carddev), true,
|
||||
"realized", &error_fatal);
|
||||
}
|
||||
|
||||
if (!qtest_enabled()) {
|
||||
arm_load_kernel(&s->soc.cpu[0], &boot_info);
|
||||
}
|
||||
}
|
||||
|
||||
static void mcimx7d_sabre_machine_init(MachineClass *mc)
|
||||
{
|
||||
mc->desc = "Freescale i.MX7 DUAL SABRE (Cortex A7)";
|
||||
mc->init = mcimx7d_sabre_init;
|
||||
mc->max_cpus = FSL_IMX7_NUM_CPUS;
|
||||
}
|
||||
DEFINE_MACHINE("mcimx7d-sabre", mcimx7d_sabre_machine_init)
|
||||
+20
-10
@@ -169,6 +169,7 @@ static const char *valid_cpus[] = {
|
||||
ARM_CPU_TYPE_NAME("cortex-a53"),
|
||||
ARM_CPU_TYPE_NAME("cortex-a57"),
|
||||
ARM_CPU_TYPE_NAME("host"),
|
||||
ARM_CPU_TYPE_NAME("max"),
|
||||
};
|
||||
|
||||
static bool cpu_type_valid(const char *cpu)
|
||||
@@ -1206,16 +1207,23 @@ static void machvirt_init(MachineState *machine)
|
||||
/* We can probe only here because during property set
|
||||
* KVM is not available yet
|
||||
*/
|
||||
if (!vms->gic_version) {
|
||||
if (vms->gic_version <= 0) {
|
||||
/* "host" or "max" */
|
||||
if (!kvm_enabled()) {
|
||||
error_report("gic-version=host requires KVM");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
vms->gic_version = kvm_arm_vgic_probe();
|
||||
if (!vms->gic_version) {
|
||||
error_report("Unable to determine GIC version supported by host");
|
||||
exit(1);
|
||||
if (vms->gic_version == 0) {
|
||||
error_report("gic-version=host requires KVM");
|
||||
exit(1);
|
||||
} else {
|
||||
/* "max": currently means 3 for TCG */
|
||||
vms->gic_version = 3;
|
||||
}
|
||||
} else {
|
||||
vms->gic_version = kvm_arm_vgic_probe();
|
||||
if (!vms->gic_version) {
|
||||
error_report(
|
||||
"Unable to determine GIC version supported by host");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1479,9 +1487,11 @@ static void virt_set_gic_version(Object *obj, const char *value, Error **errp)
|
||||
vms->gic_version = 2;
|
||||
} else if (!strcmp(value, "host")) {
|
||||
vms->gic_version = 0; /* Will probe later */
|
||||
} else if (!strcmp(value, "max")) {
|
||||
vms->gic_version = -1; /* Will probe later */
|
||||
} else {
|
||||
error_setg(errp, "Invalid gic-version value");
|
||||
error_append_hint(errp, "Valid values are 3, 2, host.\n");
|
||||
error_append_hint(errp, "Valid values are 3, 2, host, max.\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -282,6 +282,8 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp)
|
||||
s->virt, "has_el2", NULL);
|
||||
object_property_set_int(OBJECT(&s->apu_cpu[i]), GIC_BASE_ADDR,
|
||||
"reset-cbar", &error_abort);
|
||||
object_property_set_int(OBJECT(&s->apu_cpu[i]), num_apus,
|
||||
"core-count", &error_abort);
|
||||
object_property_set_bool(OBJECT(&s->apu_cpu[i]), true, "realized",
|
||||
&err);
|
||||
if (err) {
|
||||
|
||||
@@ -17,3 +17,5 @@ common-obj-$(CONFIG_PCI_PIIX) += piix.o
|
||||
common-obj-$(CONFIG_PCI_Q35) += q35.o
|
||||
common-obj-$(CONFIG_PCI_GENERIC) += gpex.o
|
||||
common-obj-$(CONFIG_PCI_XILINX) += xilinx-pcie.o
|
||||
|
||||
common-obj-$(CONFIG_PCI_DESIGNWARE) += designware.o
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -1,6 +1,6 @@
|
||||
common-obj-$(CONFIG_PL181) += pl181.o
|
||||
common-obj-$(CONFIG_SSI_SD) += ssi-sd.o
|
||||
common-obj-$(CONFIG_SD) += sd.o core.o
|
||||
common-obj-$(CONFIG_SD) += sd.o core.o sdmmc-internal.o
|
||||
common-obj-$(CONFIG_SDHCI) += sdhci.o
|
||||
|
||||
obj-$(CONFIG_MILKYMIST) += milkymist-memcard.o
|
||||
|
||||
+49
-6
@@ -120,6 +120,7 @@ struct SDState {
|
||||
qemu_irq readonly_cb;
|
||||
qemu_irq inserted_cb;
|
||||
QEMUTimer *ocr_power_timer;
|
||||
const char *proto_name;
|
||||
bool enable;
|
||||
uint8_t dat_lines;
|
||||
bool cmd_line;
|
||||
@@ -866,13 +867,19 @@ static void sd_lock_command(SDState *sd)
|
||||
sd->card_status &= ~CARD_IS_LOCKED;
|
||||
}
|
||||
|
||||
static sd_rsp_type_t sd_normal_command(SDState *sd,
|
||||
SDRequest req)
|
||||
static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
|
||||
{
|
||||
uint32_t rca = 0x0000;
|
||||
uint64_t addr = (sd->ocr & (1 << 30)) ? (uint64_t) req.arg << 9 : req.arg;
|
||||
|
||||
trace_sdcard_normal_command(req.cmd, req.arg, sd_state_name(sd->state));
|
||||
/* CMD55 precedes an ACMD, so we are not interested in tracing it.
|
||||
* However there is no ACMD55, so we want to trace this particular case.
|
||||
*/
|
||||
if (req.cmd != 55 || sd->expecting_acmd) {
|
||||
trace_sdcard_normal_command(sd->proto_name,
|
||||
sd_cmd_name(req.cmd), req.cmd,
|
||||
req.arg, sd_state_name(sd->state));
|
||||
}
|
||||
|
||||
/* Not interpreting this as an app command */
|
||||
sd->card_status &= ~APP_CMD;
|
||||
@@ -1162,6 +1169,14 @@ static sd_rsp_type_t sd_normal_command(SDState *sd,
|
||||
}
|
||||
break;
|
||||
|
||||
case 19: /* CMD19: SEND_TUNING_BLOCK (SD) */
|
||||
if (sd->state == sd_transfer_state) {
|
||||
sd->state = sd_sendingdata_state;
|
||||
sd->data_offset = 0;
|
||||
return sd_r1;
|
||||
}
|
||||
break;
|
||||
|
||||
case 23: /* CMD23: SET_BLOCK_COUNT */
|
||||
switch (sd->state) {
|
||||
case sd_transfer_state:
|
||||
@@ -1450,7 +1465,8 @@ static sd_rsp_type_t sd_normal_command(SDState *sd,
|
||||
static sd_rsp_type_t sd_app_command(SDState *sd,
|
||||
SDRequest req)
|
||||
{
|
||||
trace_sdcard_app_command(req.cmd, req.arg);
|
||||
trace_sdcard_app_command(sd->proto_name, sd_acmd_name(req.cmd),
|
||||
req.cmd, req.arg, sd_state_name(sd->state));
|
||||
sd->card_status |= APP_CMD;
|
||||
switch (req.cmd) {
|
||||
case 6: /* ACMD6: SET_BUS_WIDTH */
|
||||
@@ -1765,7 +1781,9 @@ void sd_write_data(SDState *sd, uint8_t value)
|
||||
if (sd->card_status & (ADDRESS_ERROR | WP_VIOLATION))
|
||||
return;
|
||||
|
||||
trace_sdcard_write_data(sd->current_cmd, value);
|
||||
trace_sdcard_write_data(sd->proto_name,
|
||||
sd_acmd_name(sd->current_cmd),
|
||||
sd->current_cmd, value);
|
||||
switch (sd->current_cmd) {
|
||||
case 24: /* CMD24: WRITE_SINGLE_BLOCK */
|
||||
sd->data[sd->data_offset ++] = value;
|
||||
@@ -1883,6 +1901,20 @@ void sd_write_data(SDState *sd, uint8_t value)
|
||||
}
|
||||
}
|
||||
|
||||
#define SD_TUNING_BLOCK_SIZE 64
|
||||
|
||||
static const uint8_t sd_tuning_block_pattern[SD_TUNING_BLOCK_SIZE] = {
|
||||
/* See: Physical Layer Simplified Specification Version 3.01, Table 4-2 */
|
||||
0xff, 0x0f, 0xff, 0x00, 0x0f, 0xfc, 0xc3, 0xcc,
|
||||
0xc3, 0x3c, 0xcc, 0xff, 0xfe, 0xff, 0xfe, 0xef,
|
||||
0xff, 0xdf, 0xff, 0xdd, 0xff, 0xfb, 0xff, 0xfb,
|
||||
0xbf, 0xff, 0x7f, 0xff, 0x77, 0xf7, 0xbd, 0xef,
|
||||
0xff, 0xf0, 0xff, 0xf0, 0x0f, 0xfc, 0xcc, 0x3c,
|
||||
0xcc, 0x33, 0xcc, 0xcf, 0xff, 0xef, 0xff, 0xee,
|
||||
0xff, 0xfd, 0xff, 0xfd, 0xdf, 0xff, 0xbf, 0xff,
|
||||
0xbb, 0xff, 0xf7, 0xff, 0xf7, 0x7f, 0x7b, 0xde,
|
||||
};
|
||||
|
||||
uint8_t sd_read_data(SDState *sd)
|
||||
{
|
||||
/* TODO: Append CRCs */
|
||||
@@ -1903,7 +1935,9 @@ uint8_t sd_read_data(SDState *sd)
|
||||
|
||||
io_len = (sd->ocr & (1 << 30)) ? 512 : sd->blk_len;
|
||||
|
||||
trace_sdcard_read_data(sd->current_cmd, io_len);
|
||||
trace_sdcard_read_data(sd->proto_name,
|
||||
sd_acmd_name(sd->current_cmd),
|
||||
sd->current_cmd, io_len);
|
||||
switch (sd->current_cmd) {
|
||||
case 6: /* CMD6: SWITCH_FUNCTION */
|
||||
ret = sd->data[sd->data_offset ++];
|
||||
@@ -1960,6 +1994,13 @@ uint8_t sd_read_data(SDState *sd)
|
||||
}
|
||||
break;
|
||||
|
||||
case 19: /* CMD19: SEND_TUNING_BLOCK (SD) */
|
||||
if (sd->data_offset >= SD_TUNING_BLOCK_SIZE - 1) {
|
||||
sd->state = sd_transfer_state;
|
||||
}
|
||||
ret = sd_tuning_block_pattern[sd->data_offset++];
|
||||
break;
|
||||
|
||||
case 22: /* ACMD22: SEND_NUM_WR_BLOCKS */
|
||||
ret = sd->data[sd->data_offset ++];
|
||||
|
||||
@@ -2029,6 +2070,8 @@ static void sd_realize(DeviceState *dev, Error **errp)
|
||||
SDState *sd = SD_CARD(dev);
|
||||
int ret;
|
||||
|
||||
sd->proto_name = sd->spi ? "SPI" : "SD";
|
||||
|
||||
if (sd->blk && blk_is_read_only(sd->blk)) {
|
||||
error_setg(errp, "Cannot use read-only drive as SD card");
|
||||
return;
|
||||
|
||||
+2
-2
@@ -433,13 +433,13 @@ static void sdhci_read_block_from_card(SDHCIState *s)
|
||||
for (index = 0; index < blk_size; index++) {
|
||||
data = sdbus_read_data(&s->sdbus);
|
||||
if (!FIELD_EX32(s->hostctl2, SDHC_HOSTCTL2, EXECUTE_TUNING)) {
|
||||
/* Device is not in tunning */
|
||||
/* Device is not in tuning */
|
||||
s->fifo_buffer[index] = data;
|
||||
}
|
||||
}
|
||||
|
||||
if (FIELD_EX32(s->hostctl2, SDHC_HOSTCTL2, EXECUTE_TUNING)) {
|
||||
/* Device is in tunning */
|
||||
/* Device is in tuning */
|
||||
s->hostctl2 &= ~R_SDHC_HOSTCTL2_EXECUTE_TUNING_MASK;
|
||||
s->hostctl2 |= R_SDHC_HOSTCTL2_SAMPLING_CLKSEL_MASK;
|
||||
s->prnsts &= ~(SDHC_DAT_LINE_ACTIVE | SDHC_DOING_READ |
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
* SD/MMC cards common helpers
|
||||
*
|
||||
* Copyright (c) 2018 Philippe Mathieu-Daudé <f4bug@amsat.org>
|
||||
*
|
||||
* This work is licensed under the terms of the GNU GPL, version 2 or later.
|
||||
* See the COPYING file in the top-level directory.
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "sdmmc-internal.h"
|
||||
|
||||
const char *sd_cmd_name(uint8_t cmd)
|
||||
{
|
||||
static const char *cmd_abbrev[SDMMC_CMD_MAX] = {
|
||||
[0] = "GO_IDLE_STATE",
|
||||
[2] = "ALL_SEND_CID", [3] = "SEND_RELATIVE_ADDR",
|
||||
[4] = "SET_DSR", [5] = "IO_SEND_OP_COND",
|
||||
[6] = "SWITCH_FUNC", [7] = "SELECT/DESELECT_CARD",
|
||||
[8] = "SEND_IF_COND", [9] = "SEND_CSD",
|
||||
[10] = "SEND_CID", [11] = "VOLTAGE_SWITCH",
|
||||
[12] = "STOP_TRANSMISSION", [13] = "SEND_STATUS",
|
||||
[15] = "GO_INACTIVE_STATE",
|
||||
[16] = "SET_BLOCKLEN", [17] = "READ_SINGLE_BLOCK",
|
||||
[18] = "READ_MULTIPLE_BLOCK", [19] = "SEND_TUNING_BLOCK",
|
||||
[20] = "SPEED_CLASS_CONTROL", [21] = "DPS_spec",
|
||||
[23] = "SET_BLOCK_COUNT",
|
||||
[24] = "WRITE_BLOCK", [25] = "WRITE_MULTIPLE_BLOCK",
|
||||
[26] = "MANUF_RSVD", [27] = "PROGRAM_CSD",
|
||||
[28] = "SET_WRITE_PROT", [29] = "CLR_WRITE_PROT",
|
||||
[30] = "SEND_WRITE_PROT",
|
||||
[32] = "ERASE_WR_BLK_START", [33] = "ERASE_WR_BLK_END",
|
||||
[34] = "SW_FUNC_RSVD", [35] = "SW_FUNC_RSVD",
|
||||
[36] = "SW_FUNC_RSVD", [37] = "SW_FUNC_RSVD",
|
||||
[38] = "ERASE",
|
||||
[40] = "DPS_spec",
|
||||
[42] = "LOCK_UNLOCK", [43] = "Q_MANAGEMENT",
|
||||
[44] = "Q_TASK_INFO_A", [45] = "Q_TASK_INFO_B",
|
||||
[46] = "Q_RD_TASK", [47] = "Q_WR_TASK",
|
||||
[48] = "READ_EXTR_SINGLE", [49] = "WRITE_EXTR_SINGLE",
|
||||
[50] = "SW_FUNC_RSVD",
|
||||
[52] = "IO_RW_DIRECT", [53] = "IO_RW_EXTENDED",
|
||||
[54] = "SDIO_RSVD", [55] = "APP_CMD",
|
||||
[56] = "GEN_CMD", [57] = "SW_FUNC_RSVD",
|
||||
[58] = "READ_EXTR_MULTI", [59] = "WRITE_EXTR_MULTI",
|
||||
[60] = "MANUF_RSVD", [61] = "MANUF_RSVD",
|
||||
[62] = "MANUF_RSVD", [63] = "MANUF_RSVD",
|
||||
};
|
||||
return cmd_abbrev[cmd] ? cmd_abbrev[cmd] : "UNKNOWN_CMD";
|
||||
}
|
||||
|
||||
const char *sd_acmd_name(uint8_t cmd)
|
||||
{
|
||||
static const char *acmd_abbrev[SDMMC_CMD_MAX] = {
|
||||
[6] = "SET_BUS_WIDTH",
|
||||
[13] = "SD_STATUS",
|
||||
[14] = "DPS_spec", [15] = "DPS_spec",
|
||||
[16] = "DPS_spec",
|
||||
[18] = "SECU_spec",
|
||||
[22] = "SEND_NUM_WR_BLOCKS", [23] = "SET_WR_BLK_ERASE_COUNT",
|
||||
[41] = "SD_SEND_OP_COND",
|
||||
[42] = "SET_CLR_CARD_DETECT",
|
||||
[51] = "SEND_SCR",
|
||||
[52] = "SECU_spec", [53] = "SECU_spec",
|
||||
[54] = "SECU_spec",
|
||||
[56] = "SECU_spec", [57] = "SECU_spec",
|
||||
[58] = "SECU_spec", [59] = "SECU_spec",
|
||||
};
|
||||
|
||||
return acmd_abbrev[cmd] ? acmd_abbrev[cmd] : "UNKNOWN_ACMD";
|
||||
}
|
||||
@@ -12,4 +12,28 @@
|
||||
|
||||
#define SDMMC_CMD_MAX 64
|
||||
|
||||
/**
|
||||
* sd_cmd_name:
|
||||
* @cmd: A SD "normal" command, up to SDMMC_CMD_MAX.
|
||||
*
|
||||
* Returns a human-readable name describing the command.
|
||||
* The return value is always a static string which does not need
|
||||
* to be freed after use.
|
||||
*
|
||||
* Returns: The command name of @cmd or "UNKNOWN_CMD".
|
||||
*/
|
||||
const char *sd_cmd_name(uint8_t cmd);
|
||||
|
||||
/**
|
||||
* sd_acmd_name:
|
||||
* @cmd: A SD "Application-Specific" command, up to SDMMC_CMD_MAX.
|
||||
*
|
||||
* Returns a human-readable name describing the application command.
|
||||
* The return value is always a static string which does not need
|
||||
* to be freed after use.
|
||||
*
|
||||
* Returns: The application command name of @cmd or "UNKNOWN_ACMD".
|
||||
*/
|
||||
const char *sd_acmd_name(uint8_t cmd);
|
||||
|
||||
#endif
|
||||
|
||||
+4
-4
@@ -24,8 +24,8 @@ sdhci_write_dataport(uint16_t data_count) "write buffer filled with %u bytes of
|
||||
sdhci_capareg(const char *desc, uint16_t val) "%s: %u"
|
||||
|
||||
# hw/sd/sd.c
|
||||
sdcard_normal_command(uint8_t cmd, uint32_t arg, const char *state) "CMD%d arg 0x%08x (state %s)"
|
||||
sdcard_app_command(uint8_t acmd, uint32_t arg) "ACMD%d arg 0x%08x"
|
||||
sdcard_normal_command(const char *proto, const char *cmd_desc, uint8_t cmd, uint32_t arg, const char *state) "%s %20s/ CMD%02d arg 0x%08x (state %s)"
|
||||
sdcard_app_command(const char *proto, const char *acmd_desc, uint8_t acmd, uint32_t arg, const char *state) "%s %23s/ACMD%02d arg 0x%08x (state %s)"
|
||||
sdcard_response(const char *rspdesc, int rsplen) "%s (sz:%d)"
|
||||
sdcard_powerup(void) ""
|
||||
sdcard_inquiry_cmd41(void) ""
|
||||
@@ -39,8 +39,8 @@ sdcard_lock(void) ""
|
||||
sdcard_unlock(void) ""
|
||||
sdcard_read_block(uint64_t addr, uint32_t len) "addr 0x%" PRIx64 " size 0x%x"
|
||||
sdcard_write_block(uint64_t addr, uint32_t len) "addr 0x%" PRIx64 " size 0x%x"
|
||||
sdcard_write_data(uint8_t cmd, uint8_t value) "CMD%02d value 0x%02x"
|
||||
sdcard_read_data(uint8_t cmd, int length) "CMD%02d len %d"
|
||||
sdcard_write_data(const char *proto, const char *cmd_desc, uint8_t cmd, uint8_t value) "%s %20s/ CMD%02d value 0x%02x"
|
||||
sdcard_read_data(const char *proto, const char *cmd_desc, uint8_t cmd, int length) "%s %20s/ CMD%02d len %d"
|
||||
sdcard_set_voltage(uint16_t millivolts) "%u mV"
|
||||
|
||||
# hw/sd/milkymist-memcard.c
|
||||
|
||||
@@ -0,0 +1,222 @@
|
||||
/*
|
||||
* Copyright (c) 2018, Impinj, Inc.
|
||||
*
|
||||
* i.MX7 SoC definitions
|
||||
*
|
||||
* Author: Andrey Smirnov <andrew.smirnov@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#ifndef FSL_IMX7_H
|
||||
#define FSL_IMX7_H
|
||||
|
||||
#include "hw/arm/arm.h"
|
||||
#include "hw/cpu/a15mpcore.h"
|
||||
#include "hw/intc/imx_gpcv2.h"
|
||||
#include "hw/misc/imx7_ccm.h"
|
||||
#include "hw/misc/imx7_snvs.h"
|
||||
#include "hw/misc/imx7_gpr.h"
|
||||
#include "hw/misc/imx6_src.h"
|
||||
#include "hw/misc/imx2_wdt.h"
|
||||
#include "hw/gpio/imx_gpio.h"
|
||||
#include "hw/char/imx_serial.h"
|
||||
#include "hw/timer/imx_gpt.h"
|
||||
#include "hw/timer/imx_epit.h"
|
||||
#include "hw/i2c/imx_i2c.h"
|
||||
#include "hw/gpio/imx_gpio.h"
|
||||
#include "hw/sd/sdhci.h"
|
||||
#include "hw/ssi/imx_spi.h"
|
||||
#include "hw/net/imx_fec.h"
|
||||
#include "hw/pci-host/designware.h"
|
||||
#include "hw/usb/chipidea.h"
|
||||
#include "exec/memory.h"
|
||||
#include "cpu.h"
|
||||
|
||||
#define TYPE_FSL_IMX7 "fsl,imx7"
|
||||
#define FSL_IMX7(obj) OBJECT_CHECK(FslIMX7State, (obj), TYPE_FSL_IMX7)
|
||||
|
||||
enum FslIMX7Configuration {
|
||||
FSL_IMX7_NUM_CPUS = 2,
|
||||
FSL_IMX7_NUM_UARTS = 7,
|
||||
FSL_IMX7_NUM_ETHS = 2,
|
||||
FSL_IMX7_ETH_NUM_TX_RINGS = 3,
|
||||
FSL_IMX7_NUM_USDHCS = 3,
|
||||
FSL_IMX7_NUM_WDTS = 4,
|
||||
FSL_IMX7_NUM_GPTS = 4,
|
||||
FSL_IMX7_NUM_IOMUXCS = 2,
|
||||
FSL_IMX7_NUM_GPIOS = 7,
|
||||
FSL_IMX7_NUM_I2CS = 4,
|
||||
FSL_IMX7_NUM_ECSPIS = 4,
|
||||
FSL_IMX7_NUM_USBS = 3,
|
||||
FSL_IMX7_NUM_ADCS = 2,
|
||||
};
|
||||
|
||||
typedef struct FslIMX7State {
|
||||
/*< private >*/
|
||||
DeviceState parent_obj;
|
||||
|
||||
/*< public >*/
|
||||
ARMCPU cpu[FSL_IMX7_NUM_CPUS];
|
||||
A15MPPrivState a7mpcore;
|
||||
IMXGPTState gpt[FSL_IMX7_NUM_GPTS];
|
||||
IMXGPIOState gpio[FSL_IMX7_NUM_GPIOS];
|
||||
IMX7CCMState ccm;
|
||||
IMX7AnalogState analog;
|
||||
IMX7SNVSState snvs;
|
||||
IMXGPCv2State gpcv2;
|
||||
IMXSPIState spi[FSL_IMX7_NUM_ECSPIS];
|
||||
IMXI2CState i2c[FSL_IMX7_NUM_I2CS];
|
||||
IMXSerialState uart[FSL_IMX7_NUM_UARTS];
|
||||
IMXFECState eth[FSL_IMX7_NUM_ETHS];
|
||||
SDHCIState usdhc[FSL_IMX7_NUM_USDHCS];
|
||||
IMX2WdtState wdt[FSL_IMX7_NUM_WDTS];
|
||||
IMX7GPRState gpr;
|
||||
ChipideaState usb[FSL_IMX7_NUM_USBS];
|
||||
DesignwarePCIEHost pcie;
|
||||
} FslIMX7State;
|
||||
|
||||
enum FslIMX7MemoryMap {
|
||||
FSL_IMX7_MMDC_ADDR = 0x80000000,
|
||||
FSL_IMX7_MMDC_SIZE = 2 * 1024 * 1024 * 1024UL,
|
||||
|
||||
FSL_IMX7_GPIO1_ADDR = 0x30200000,
|
||||
FSL_IMX7_GPIO2_ADDR = 0x30210000,
|
||||
FSL_IMX7_GPIO3_ADDR = 0x30220000,
|
||||
FSL_IMX7_GPIO4_ADDR = 0x30230000,
|
||||
FSL_IMX7_GPIO5_ADDR = 0x30240000,
|
||||
FSL_IMX7_GPIO6_ADDR = 0x30250000,
|
||||
FSL_IMX7_GPIO7_ADDR = 0x30260000,
|
||||
|
||||
FSL_IMX7_IOMUXC_LPSR_GPR_ADDR = 0x30270000,
|
||||
|
||||
FSL_IMX7_WDOG1_ADDR = 0x30280000,
|
||||
FSL_IMX7_WDOG2_ADDR = 0x30290000,
|
||||
FSL_IMX7_WDOG3_ADDR = 0x302A0000,
|
||||
FSL_IMX7_WDOG4_ADDR = 0x302B0000,
|
||||
|
||||
FSL_IMX7_IOMUXC_LPSR_ADDR = 0x302C0000,
|
||||
|
||||
FSL_IMX7_GPT1_ADDR = 0x302D0000,
|
||||
FSL_IMX7_GPT2_ADDR = 0x302E0000,
|
||||
FSL_IMX7_GPT3_ADDR = 0x302F0000,
|
||||
FSL_IMX7_GPT4_ADDR = 0x30300000,
|
||||
|
||||
FSL_IMX7_IOMUXC_ADDR = 0x30330000,
|
||||
FSL_IMX7_IOMUXC_GPR_ADDR = 0x30340000,
|
||||
FSL_IMX7_IOMUXCn_SIZE = 0x1000,
|
||||
|
||||
FSL_IMX7_ANALOG_ADDR = 0x30360000,
|
||||
FSL_IMX7_SNVS_ADDR = 0x30370000,
|
||||
FSL_IMX7_CCM_ADDR = 0x30380000,
|
||||
|
||||
FSL_IMX7_SRC_ADDR = 0x30390000,
|
||||
FSL_IMX7_SRC_SIZE = 0x1000,
|
||||
|
||||
FSL_IMX7_ADC1_ADDR = 0x30610000,
|
||||
FSL_IMX7_ADC2_ADDR = 0x30620000,
|
||||
FSL_IMX7_ADCn_SIZE = 0x1000,
|
||||
|
||||
FSL_IMX7_GPC_ADDR = 0x303A0000,
|
||||
|
||||
FSL_IMX7_I2C1_ADDR = 0x30A20000,
|
||||
FSL_IMX7_I2C2_ADDR = 0x30A30000,
|
||||
FSL_IMX7_I2C3_ADDR = 0x30A40000,
|
||||
FSL_IMX7_I2C4_ADDR = 0x30A50000,
|
||||
|
||||
FSL_IMX7_ECSPI1_ADDR = 0x30820000,
|
||||
FSL_IMX7_ECSPI2_ADDR = 0x30830000,
|
||||
FSL_IMX7_ECSPI3_ADDR = 0x30840000,
|
||||
FSL_IMX7_ECSPI4_ADDR = 0x30630000,
|
||||
|
||||
FSL_IMX7_LCDIF_ADDR = 0x30730000,
|
||||
FSL_IMX7_LCDIF_SIZE = 0x1000,
|
||||
|
||||
FSL_IMX7_UART1_ADDR = 0x30860000,
|
||||
/*
|
||||
* Some versions of the reference manual claim that UART2 is @
|
||||
* 0x30870000, but experiments with HW + DT files in upstream
|
||||
* Linux kernel show that not to be true and that block is
|
||||
* acutally located @ 0x30890000
|
||||
*/
|
||||
FSL_IMX7_UART2_ADDR = 0x30890000,
|
||||
FSL_IMX7_UART3_ADDR = 0x30880000,
|
||||
FSL_IMX7_UART4_ADDR = 0x30A60000,
|
||||
FSL_IMX7_UART5_ADDR = 0x30A70000,
|
||||
FSL_IMX7_UART6_ADDR = 0x30A80000,
|
||||
FSL_IMX7_UART7_ADDR = 0x30A90000,
|
||||
|
||||
FSL_IMX7_ENET1_ADDR = 0x30BE0000,
|
||||
FSL_IMX7_ENET2_ADDR = 0x30BF0000,
|
||||
|
||||
FSL_IMX7_USB1_ADDR = 0x30B10000,
|
||||
FSL_IMX7_USBMISC1_ADDR = 0x30B10200,
|
||||
FSL_IMX7_USB2_ADDR = 0x30B20000,
|
||||
FSL_IMX7_USBMISC2_ADDR = 0x30B20200,
|
||||
FSL_IMX7_USB3_ADDR = 0x30B30000,
|
||||
FSL_IMX7_USBMISC3_ADDR = 0x30B30200,
|
||||
FSL_IMX7_USBMISCn_SIZE = 0x200,
|
||||
|
||||
FSL_IMX7_USDHC1_ADDR = 0x30B40000,
|
||||
FSL_IMX7_USDHC2_ADDR = 0x30B50000,
|
||||
FSL_IMX7_USDHC3_ADDR = 0x30B60000,
|
||||
|
||||
FSL_IMX7_SDMA_ADDR = 0x30BD0000,
|
||||
FSL_IMX7_SDMA_SIZE = 0x1000,
|
||||
|
||||
FSL_IMX7_A7MPCORE_ADDR = 0x31000000,
|
||||
FSL_IMX7_A7MPCORE_DAP_ADDR = 0x30000000,
|
||||
|
||||
FSL_IMX7_PCIE_REG_ADDR = 0x33800000,
|
||||
FSL_IMX7_PCIE_REG_SIZE = 16 * 1024,
|
||||
|
||||
FSL_IMX7_GPR_ADDR = 0x30340000,
|
||||
};
|
||||
|
||||
enum FslIMX7IRQs {
|
||||
FSL_IMX7_USDHC1_IRQ = 22,
|
||||
FSL_IMX7_USDHC2_IRQ = 23,
|
||||
FSL_IMX7_USDHC3_IRQ = 24,
|
||||
|
||||
FSL_IMX7_UART1_IRQ = 26,
|
||||
FSL_IMX7_UART2_IRQ = 27,
|
||||
FSL_IMX7_UART3_IRQ = 28,
|
||||
FSL_IMX7_UART4_IRQ = 29,
|
||||
FSL_IMX7_UART5_IRQ = 30,
|
||||
FSL_IMX7_UART6_IRQ = 16,
|
||||
|
||||
FSL_IMX7_ECSPI1_IRQ = 31,
|
||||
FSL_IMX7_ECSPI2_IRQ = 32,
|
||||
FSL_IMX7_ECSPI3_IRQ = 33,
|
||||
FSL_IMX7_ECSPI4_IRQ = 34,
|
||||
|
||||
FSL_IMX7_I2C1_IRQ = 35,
|
||||
FSL_IMX7_I2C2_IRQ = 36,
|
||||
FSL_IMX7_I2C3_IRQ = 37,
|
||||
FSL_IMX7_I2C4_IRQ = 38,
|
||||
|
||||
FSL_IMX7_USB1_IRQ = 43,
|
||||
FSL_IMX7_USB2_IRQ = 42,
|
||||
FSL_IMX7_USB3_IRQ = 40,
|
||||
|
||||
FSL_IMX7_PCI_INTA_IRQ = 122,
|
||||
FSL_IMX7_PCI_INTB_IRQ = 123,
|
||||
FSL_IMX7_PCI_INTC_IRQ = 124,
|
||||
FSL_IMX7_PCI_INTD_IRQ = 125,
|
||||
|
||||
FSL_IMX7_UART7_IRQ = 126,
|
||||
|
||||
#define FSL_IMX7_ENET_IRQ(i, n) ((n) + ((i) ? 100 : 118))
|
||||
|
||||
FSL_IMX7_MAX_IRQ = 128,
|
||||
};
|
||||
|
||||
#endif /* FSL_IMX7_H */
|
||||
@@ -0,0 +1,102 @@
|
||||
/*
|
||||
* Copyright (c) 2017, Impinj, Inc.
|
||||
*
|
||||
* Designware PCIe IP block emulation
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, see
|
||||
* <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef DESIGNWARE_H
|
||||
#define DESIGNWARE_H
|
||||
|
||||
#include "hw/hw.h"
|
||||
#include "hw/sysbus.h"
|
||||
#include "hw/pci/pci.h"
|
||||
#include "hw/pci/pci_bus.h"
|
||||
#include "hw/pci/pcie_host.h"
|
||||
#include "hw/pci/pci_bridge.h"
|
||||
|
||||
#define TYPE_DESIGNWARE_PCIE_HOST "designware-pcie-host"
|
||||
#define DESIGNWARE_PCIE_HOST(obj) \
|
||||
OBJECT_CHECK(DesignwarePCIEHost, (obj), TYPE_DESIGNWARE_PCIE_HOST)
|
||||
|
||||
#define TYPE_DESIGNWARE_PCIE_ROOT "designware-pcie-root"
|
||||
#define DESIGNWARE_PCIE_ROOT(obj) \
|
||||
OBJECT_CHECK(DesignwarePCIERoot, (obj), TYPE_DESIGNWARE_PCIE_ROOT)
|
||||
|
||||
struct DesignwarePCIERoot;
|
||||
typedef struct DesignwarePCIERoot DesignwarePCIERoot;
|
||||
|
||||
typedef struct DesignwarePCIEViewport {
|
||||
DesignwarePCIERoot *root;
|
||||
|
||||
MemoryRegion cfg;
|
||||
MemoryRegion mem;
|
||||
|
||||
uint64_t base;
|
||||
uint64_t target;
|
||||
uint32_t limit;
|
||||
uint32_t cr[2];
|
||||
|
||||
bool inbound;
|
||||
} DesignwarePCIEViewport;
|
||||
|
||||
typedef struct DesignwarePCIEMSIBank {
|
||||
uint32_t enable;
|
||||
uint32_t mask;
|
||||
uint32_t status;
|
||||
} DesignwarePCIEMSIBank;
|
||||
|
||||
typedef struct DesignwarePCIEMSI {
|
||||
uint64_t base;
|
||||
MemoryRegion iomem;
|
||||
|
||||
#define DESIGNWARE_PCIE_NUM_MSI_BANKS 1
|
||||
|
||||
DesignwarePCIEMSIBank intr[DESIGNWARE_PCIE_NUM_MSI_BANKS];
|
||||
} DesignwarePCIEMSI;
|
||||
|
||||
struct DesignwarePCIERoot {
|
||||
PCIBridge parent_obj;
|
||||
|
||||
uint32_t atu_viewport;
|
||||
|
||||
#define DESIGNWARE_PCIE_VIEWPORT_OUTBOUND 0
|
||||
#define DESIGNWARE_PCIE_VIEWPORT_INBOUND 1
|
||||
#define DESIGNWARE_PCIE_NUM_VIEWPORTS 4
|
||||
|
||||
DesignwarePCIEViewport viewports[2][DESIGNWARE_PCIE_NUM_VIEWPORTS];
|
||||
DesignwarePCIEMSI msi;
|
||||
};
|
||||
|
||||
typedef struct DesignwarePCIEHost {
|
||||
PCIHostState parent_obj;
|
||||
|
||||
DesignwarePCIERoot root;
|
||||
|
||||
struct {
|
||||
AddressSpace address_space;
|
||||
MemoryRegion address_space_root;
|
||||
|
||||
MemoryRegion memory;
|
||||
MemoryRegion io;
|
||||
|
||||
qemu_irq irqs[4];
|
||||
} pci;
|
||||
|
||||
MemoryRegion mmio;
|
||||
} DesignwarePCIEHost;
|
||||
|
||||
#endif /* DESIGNWARE_H */
|
||||
@@ -269,4 +269,6 @@
|
||||
#define PCI_VENDOR_ID_VMWARE 0x15ad
|
||||
#define PCI_DEVICE_ID_VMWARE_PVRDMA 0x0820
|
||||
|
||||
#define PCI_VENDOR_ID_SYNOPSYS 0x16C3
|
||||
|
||||
#endif
|
||||
|
||||
@@ -19,4 +19,7 @@ struct target_pt_regs {
|
||||
#define TARGET_MLOCKALL_MCL_CURRENT 1
|
||||
#define TARGET_MLOCKALL_MCL_FUTURE 2
|
||||
|
||||
#define TARGET_PR_SVE_SET_VL 50
|
||||
#define TARGET_PR_SVE_GET_VL 51
|
||||
|
||||
#endif /* AARCH64_TARGET_SYSCALL_H */
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user