1 | More arm patches (mostly the SDHCI ones from Philippe) | 1 | Patches for rc1: nothing major, just some minor bugfixes and |
---|---|---|---|
2 | code cleanups. | ||
2 | 3 | ||
3 | thanks | ||
4 | -- PMM | 4 | -- PMM |
5 | 5 | ||
6 | The following changes since commit f521eeee3bd060b460c99e605472b7e03967db43: | 6 | The following changes since commit f7e1914adad8885a5d4c70239ab90d901ed97e9f: |
7 | 7 | ||
8 | Merge remote-tracking branch 'remotes/juanquintela/tags/migration/20180115' into staging (2018-01-15 13:17:47 +0000) | 8 | Merge remote-tracking branch 'remotes/alistair/tags/pull-riscv-to-apply-20201109' into staging (2020-11-10 09:24:56 +0000) |
9 | 9 | ||
10 | are available in the git repository at: | 10 | are available in the Git repository at: |
11 | 11 | ||
12 | git://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20180116 | 12 | https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20201110 |
13 | 13 | ||
14 | for you to fetch changes up to 60765b6ceeb4998a0d4220b3a53f1f185061da77: | 14 | for you to fetch changes up to b6c56c8a9a4064ea783f352f43c5df6231a110fa: |
15 | 15 | ||
16 | sdhci: add a 'dma' property to the sysbus devices (2018-01-16 13:28:21 +0000) | 16 | target/arm/translate-neon.c: Handle VTBL UNDEF case before VFP access check (2020-11-10 11:03:48 +0000) |
17 | 17 | ||
18 | ---------------------------------------------------------------- | 18 | ---------------------------------------------------------------- |
19 | target-arm queue: | 19 | target-arm queue: |
20 | * SDHCI: cleanups and minor bug fixes | 20 | * hw/arm/Kconfig: ARM_V7M depends on PTIMER |
21 | * target/arm: minor refactor preparatory to fp16 support | 21 | * Minor coding style fixes |
22 | * omap_ssd, ssi-sd, pl181, milkymist-memcard: reset the SD | 22 | * docs: add some notes on the sbsa-ref machine |
23 | card on controller reset (fixes migration failures) | 23 | * hw/arm/virt: Remove dependency on Cortex-A15 MPCore peripherals |
24 | * target/arm: Handle page table walk load failures correctly | 24 | * target/arm: Fix neon VTBL/VTBX for len > 1 |
25 | * hw/arm/virt: Add virt-2.12 machine type | 25 | * hw/arm/armsse: Correct expansion MPC interrupt lines |
26 | * get_phys_addr_pmsav7: Support AP=0b111 for v7M | 26 | * hw/misc/stm32f2xx_syscfg: Remove extraneous IRQ |
27 | * hw/intc/armv7m: Support byte and halfword accesses to CFSR | 27 | * hw/arm/nseries: Remove invalid/unnecessary n8x0_uart_setup() |
28 | * hw/arm/musicpal: Don't connect two qemu_irqs directly to the same input | ||
29 | * hw/arm/musicpal: Only use qdev_get_gpio_in() when necessary | ||
30 | * hw/arm/nseries: Check return value from load_image_targphys() | ||
31 | * tests/qtest/npcm7xx_rng-test: count runs properly | ||
32 | * target/arm/translate-neon.c: Handle VTBL UNDEF case before VFP access check | ||
28 | 33 | ||
29 | ---------------------------------------------------------------- | 34 | ---------------------------------------------------------------- |
30 | Andrey Smirnov (1): | 35 | Alex Bennée (1): |
31 | sdhci: Implement write method of ACMD12ERRSTS register | 36 | docs: add some notes on the sbsa-ref machine |
32 | 37 | ||
33 | Peter Maydell (8): | 38 | AlexChen (1): |
34 | hw/intc/armv7m: Support byte and halfword accesses to CFSR | 39 | ssi: Fix bad printf format specifiers |
35 | get_phys_addr_pmsav7: Support AP=0b111 for v7M | ||
36 | hw/arm/virt: Add virt-2.12 machine type | ||
37 | target/arm: Handle page table walk load failures correctly | ||
38 | hw/sd/pl181: Reset SD card on controller reset | ||
39 | hw/sd/milkymist-memcard: Reset SD card on controller reset | ||
40 | hw/sd/ssi-sd: Reset SD card on controller reset | ||
41 | hw/sd/omap_mmc: Reset SD card on controller reset | ||
42 | 40 | ||
43 | Philippe Mathieu-Daudé (13): | 41 | Andrew Jones (1): |
44 | sdhci: clean up includes | 42 | hw/arm/Kconfig: ARM_V7M depends on PTIMER |
45 | sdhci: remove dead code | ||
46 | sdhci: use DEFINE_SDHCI_COMMON_PROPERTIES() for common sysbus/pci properties | ||
47 | sdhci: refactor common sysbus/pci class_init() into sdhci_common_class_init() | ||
48 | sdhci: refactor common sysbus/pci realize() into sdhci_common_realize() | ||
49 | sdhci: refactor common sysbus/pci unrealize() into sdhci_common_unrealize() | ||
50 | sdhci: use qemu_log_mask(UNIMP) instead of fprintf() | ||
51 | sdhci: convert the DPRINT() calls into trace events | ||
52 | sdhci: move MASK_TRNMOD with other SDHC_TRN* defines in "sd-internal.h" | ||
53 | sdhci: rename the SDHC_CAPAB register | ||
54 | sdhci: fix CAPAB/MAXCURR registers, both are 64bit and read-only | ||
55 | sdhci: fix the PCI device, using the PCI address space for DMA | ||
56 | sdhci: add a 'dma' property to the sysbus devices | ||
57 | 43 | ||
58 | Richard Henderson (2): | 44 | Havard Skinnemoen (1): |
59 | target/arm: Split out vfp_expand_imm | 45 | tests/qtest/npcm7xx_rng-test: count runs properly |
60 | target/arm: Add fp16 support to vfp_expand_imm | ||
61 | 46 | ||
62 | hw/sd/sdhci-internal.h | 7 +- | 47 | Peter Maydell (2): |
63 | include/hw/sd/sdhci.h | 19 +++- | 48 | hw/arm/nseries: Check return value from load_image_targphys() |
64 | target/arm/internals.h | 10 ++ | 49 | target/arm/translate-neon.c: Handle VTBL UNDEF case before VFP access check |
65 | hw/arm/virt.c | 19 +++- | ||
66 | hw/intc/armv7m_nvic.c | 38 ++++--- | ||
67 | hw/sd/milkymist-memcard.c | 4 + | ||
68 | hw/sd/omap_mmc.c | 14 ++- | ||
69 | hw/sd/pl181.c | 4 + | ||
70 | hw/sd/sdhci.c | 266 +++++++++++++++++++++++++++------------------ | ||
71 | hw/sd/ssi-sd.c | 25 ++++- | ||
72 | target/arm/helper.c | 53 ++++++++- | ||
73 | target/arm/op_helper.c | 7 +- | ||
74 | target/arm/translate-a64.c | 49 ++++++--- | ||
75 | hw/sd/trace-events | 14 +++ | ||
76 | 14 files changed, 362 insertions(+), 167 deletions(-) | ||
77 | 50 | ||
51 | Philippe Mathieu-Daudé (6): | ||
52 | hw/arm/virt: Remove dependency on Cortex-A15 MPCore peripherals | ||
53 | hw/arm/armsse: Correct expansion MPC interrupt lines | ||
54 | hw/misc/stm32f2xx_syscfg: Remove extraneous IRQ | ||
55 | hw/arm/nseries: Remove invalid/unnecessary n8x0_uart_setup() | ||
56 | hw/arm/musicpal: Don't connect two qemu_irqs directly to the same input | ||
57 | hw/arm/musicpal: Only use qdev_get_gpio_in() when necessary | ||
58 | |||
59 | Richard Henderson (1): | ||
60 | target/arm: Fix neon VTBL/VTBX for len > 1 | ||
61 | |||
62 | Xinhao Zhang (3): | ||
63 | target/arm: add spaces around operator | ||
64 | target/arm: Don't use '#' flag of printf format | ||
65 | target/arm: add space before the open parenthesis '(' | ||
66 | |||
67 | docs/system/arm/sbsa.rst | 32 ++++++++++++++++++++++ | ||
68 | docs/system/target-arm.rst | 1 + | ||
69 | include/hw/misc/stm32f2xx_syscfg.h | 2 -- | ||
70 | target/arm/helper.h | 2 +- | ||
71 | hw/arm/armsse.c | 3 +- | ||
72 | hw/arm/musicpal.c | 40 +++++++++++++++++---------- | ||
73 | hw/arm/nseries.c | 26 ++++++++---------- | ||
74 | hw/arm/stm32f205_soc.c | 1 - | ||
75 | hw/misc/stm32f2xx_syscfg.c | 2 -- | ||
76 | hw/ssi/imx_spi.c | 2 +- | ||
77 | hw/ssi/xilinx_spi.c | 2 +- | ||
78 | target/arm/arch_dump.c | 8 +++--- | ||
79 | target/arm/arm-semi.c | 8 +++--- | ||
80 | target/arm/helper.c | 2 +- | ||
81 | target/arm/op_helper.c | 23 +++++++++------- | ||
82 | target/arm/translate-a64.c | 4 +-- | ||
83 | target/arm/translate.c | 2 +- | ||
84 | tests/qtest/npcm7xx_rng-test.c | 2 +- | ||
85 | hw/arm/Kconfig | 3 +- | ||
86 | target/arm/translate-neon.c.inc | 56 ++++++++++++++------------------------ | ||
87 | 20 files changed, 123 insertions(+), 98 deletions(-) | ||
88 | create mode 100644 docs/system/arm/sbsa.rst | ||
89 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | The Configurable Fault Status Register for ARMv7M and v8M is | ||
2 | supposed to be byte and halfword accessible, but we were only | ||
3 | implementing word accesses. Add support for the other access | ||
4 | sizes, which are used by the Zephyr RTOS. | ||
5 | 1 | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | Reported-by: Andy Gross <andy.gross@linaro.org> | ||
8 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
9 | Message-id: 1512742372-31517-1-git-send-email-peter.maydell@linaro.org | ||
10 | --- | ||
11 | hw/intc/armv7m_nvic.c | 38 ++++++++++++++++++++++---------------- | ||
12 | 1 file changed, 22 insertions(+), 16 deletions(-) | ||
13 | |||
14 | diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c | ||
15 | index XXXXXXX..XXXXXXX 100644 | ||
16 | --- a/hw/intc/armv7m_nvic.c | ||
17 | +++ b/hw/intc/armv7m_nvic.c | ||
18 | @@ -XXX,XX +XXX,XX @@ static uint32_t nvic_readl(NVICState *s, uint32_t offset, MemTxAttrs attrs) | ||
19 | val |= (1 << 8); | ||
20 | } | ||
21 | return val; | ||
22 | - case 0xd28: /* Configurable Fault Status. */ | ||
23 | - /* The BFSR bits [15:8] are shared between security states | ||
24 | - * and we store them in the NS copy | ||
25 | - */ | ||
26 | - val = cpu->env.v7m.cfsr[attrs.secure]; | ||
27 | - val |= cpu->env.v7m.cfsr[M_REG_NS] & R_V7M_CFSR_BFSR_MASK; | ||
28 | - return val; | ||
29 | case 0xd2c: /* Hard Fault Status. */ | ||
30 | return cpu->env.v7m.hfsr; | ||
31 | case 0xd30: /* Debug Fault Status. */ | ||
32 | @@ -XXX,XX +XXX,XX @@ static void nvic_writel(NVICState *s, uint32_t offset, uint32_t value, | ||
33 | s->vectors[ARMV7M_EXCP_DEBUG].active = (value & (1 << 8)) != 0; | ||
34 | nvic_irq_update(s); | ||
35 | break; | ||
36 | - case 0xd28: /* Configurable Fault Status. */ | ||
37 | - cpu->env.v7m.cfsr[attrs.secure] &= ~value; /* W1C */ | ||
38 | - if (attrs.secure) { | ||
39 | - /* The BFSR bits [15:8] are shared between security states | ||
40 | - * and we store them in the NS copy. | ||
41 | - */ | ||
42 | - cpu->env.v7m.cfsr[M_REG_NS] &= ~(value & R_V7M_CFSR_BFSR_MASK); | ||
43 | - } | ||
44 | - break; | ||
45 | case 0xd2c: /* Hard Fault Status. */ | ||
46 | cpu->env.v7m.hfsr &= ~value; /* W1C */ | ||
47 | break; | ||
48 | @@ -XXX,XX +XXX,XX @@ static MemTxResult nvic_sysreg_read(void *opaque, hwaddr addr, | ||
49 | val = deposit32(val, i * 8, 8, get_prio(s, hdlidx, sbank)); | ||
50 | } | ||
51 | break; | ||
52 | + case 0xd28 ... 0xd2b: /* Configurable Fault Status (CFSR) */ | ||
53 | + /* The BFSR bits [15:8] are shared between security states | ||
54 | + * and we store them in the NS copy | ||
55 | + */ | ||
56 | + val = s->cpu->env.v7m.cfsr[attrs.secure]; | ||
57 | + val |= s->cpu->env.v7m.cfsr[M_REG_NS] & R_V7M_CFSR_BFSR_MASK; | ||
58 | + val = extract32(val, (offset - 0xd28) * 8, size * 8); | ||
59 | + break; | ||
60 | case 0xfe0 ... 0xfff: /* ID. */ | ||
61 | if (offset & 3) { | ||
62 | val = 0; | ||
63 | @@ -XXX,XX +XXX,XX @@ static MemTxResult nvic_sysreg_write(void *opaque, hwaddr addr, | ||
64 | } | ||
65 | nvic_irq_update(s); | ||
66 | return MEMTX_OK; | ||
67 | + case 0xd28 ... 0xd2b: /* Configurable Fault Status (CFSR) */ | ||
68 | + /* All bits are W1C, so construct 32 bit value with 0s in | ||
69 | + * the parts not written by the access size | ||
70 | + */ | ||
71 | + value <<= ((offset - 0xd28) * 8); | ||
72 | + | ||
73 | + s->cpu->env.v7m.cfsr[attrs.secure] &= ~value; | ||
74 | + if (attrs.secure) { | ||
75 | + /* The BFSR bits [15:8] are shared between security states | ||
76 | + * and we store them in the NS copy. | ||
77 | + */ | ||
78 | + s->cpu->env.v7m.cfsr[M_REG_NS] &= ~(value & R_V7M_CFSR_BFSR_MASK); | ||
79 | + } | ||
80 | + return MEMTX_OK; | ||
81 | } | ||
82 | if (size == 4) { | ||
83 | nvic_writel(s, offset, value, attrs); | ||
84 | -- | ||
85 | 2.7.4 | ||
86 | |||
87 | diff view generated by jsdifflib |
1 | From: Philippe Mathieu-Daudé <f4bug@amsat.org> | 1 | From: Andrew Jones <drjones@redhat.com> |
---|---|---|---|
2 | 2 | ||
3 | Add a 'dma' property allowing machine creation to provide the address-space | 3 | commit 32bd322a0134 ("hw/timer/armv7m_systick: Rewrite to use ptimers") |
4 | SDHCI DMA operates on. | 4 | changed armv7m_systick to build on ptimers. Make sure we have ptimers |
5 | in the build when building armv7m_systick. | ||
5 | 6 | ||
6 | [based on a patch from Alistair Francis <alistair.francis@xilinx.com> | 7 | Signed-off-by: Andrew Jones <drjones@redhat.com> |
7 | from qemu/xilinx tag xilinx-v2016.1] | 8 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
8 | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | 9 | Message-id: 20201104103343.30392-1-drjones@redhat.com |
9 | Message-id: 20180115182436.2066-15-f4bug@amsat.org | ||
10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
11 | --- | 11 | --- |
12 | include/hw/sd/sdhci.h | 1 + | 12 | hw/arm/Kconfig | 1 + |
13 | hw/sd/sdhci.c | 18 +++++++++++++++++- | 13 | 1 file changed, 1 insertion(+) |
14 | 2 files changed, 18 insertions(+), 1 deletion(-) | ||
15 | 14 | ||
16 | diff --git a/include/hw/sd/sdhci.h b/include/hw/sd/sdhci.h | 15 | diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig |
17 | index XXXXXXX..XXXXXXX 100644 | 16 | index XXXXXXX..XXXXXXX 100644 |
18 | --- a/include/hw/sd/sdhci.h | 17 | --- a/hw/arm/Kconfig |
19 | +++ b/include/hw/sd/sdhci.h | 18 | +++ b/hw/arm/Kconfig |
20 | @@ -XXX,XX +XXX,XX @@ typedef struct SDHCIState { | 19 | @@ -XXX,XX +XXX,XX @@ config ZYNQ |
21 | SDBus sdbus; | 20 | |
22 | MemoryRegion iomem; | 21 | config ARM_V7M |
23 | AddressSpace *dma_as; | 22 | bool |
24 | + MemoryRegion *dma_mr; | 23 | + select PTIMER |
25 | 24 | ||
26 | QEMUTimer *insert_timer; /* timer for 'changing' sd card. */ | 25 | config ALLWINNER_A10 |
27 | QEMUTimer *transfer_timer; | 26 | bool |
28 | diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c | ||
29 | index XXXXXXX..XXXXXXX 100644 | ||
30 | --- a/hw/sd/sdhci.c | ||
31 | +++ b/hw/sd/sdhci.c | ||
32 | @@ -XXX,XX +XXX,XX @@ static Property sdhci_sysbus_properties[] = { | ||
33 | DEFINE_SDHCI_COMMON_PROPERTIES(SDHCIState), | ||
34 | DEFINE_PROP_BOOL("pending-insert-quirk", SDHCIState, pending_insert_quirk, | ||
35 | false), | ||
36 | + DEFINE_PROP_LINK("dma", SDHCIState, | ||
37 | + dma_mr, TYPE_MEMORY_REGION, MemoryRegion *), | ||
38 | DEFINE_PROP_END_OF_LIST(), | ||
39 | }; | ||
40 | |||
41 | @@ -XXX,XX +XXX,XX @@ static void sdhci_sysbus_init(Object *obj) | ||
42 | static void sdhci_sysbus_finalize(Object *obj) | ||
43 | { | ||
44 | SDHCIState *s = SYSBUS_SDHCI(obj); | ||
45 | + | ||
46 | + if (s->dma_mr) { | ||
47 | + object_unparent(OBJECT(s->dma_mr)); | ||
48 | + } | ||
49 | + | ||
50 | sdhci_uninitfn(s); | ||
51 | } | ||
52 | |||
53 | @@ -XXX,XX +XXX,XX @@ static void sdhci_sysbus_realize(DeviceState *dev, Error ** errp) | ||
54 | return; | ||
55 | } | ||
56 | |||
57 | - s->dma_as = &address_space_memory; | ||
58 | + if (s->dma_mr) { | ||
59 | + address_space_init(s->dma_as, s->dma_mr, "sdhci-dma"); | ||
60 | + } else { | ||
61 | + /* use system_memory() if property "dma" not set */ | ||
62 | + s->dma_as = &address_space_memory; | ||
63 | + } | ||
64 | |||
65 | sysbus_init_irq(sbd, &s->irq); | ||
66 | sysbus_init_mmio(sbd, &s->iomem); | ||
67 | @@ -XXX,XX +XXX,XX @@ static void sdhci_sysbus_unrealize(DeviceState *dev, Error **errp) | ||
68 | SDHCIState *s = SYSBUS_SDHCI(dev); | ||
69 | |||
70 | sdhci_common_unrealize(s, &error_abort); | ||
71 | + | ||
72 | + if (s->dma_mr) { | ||
73 | + address_space_destroy(s->dma_as); | ||
74 | + } | ||
75 | } | ||
76 | |||
77 | static void sdhci_sysbus_class_init(ObjectClass *klass, void *data) | ||
78 | -- | 27 | -- |
79 | 2.7.4 | 28 | 2.20.1 |
80 | 29 | ||
81 | 30 | diff view generated by jsdifflib |
1 | From: Philippe Mathieu-Daudé <f4bug@amsat.org> | 1 | From: AlexChen <alex.chen@huawei.com> |
---|---|---|---|
2 | 2 | ||
3 | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | 3 | We should use printf format specifier "%u" instead of "%d" for |
4 | Reviewed-by: Alistair Francis <alistair.francis@xilinx.com> | 4 | argument of type "unsigned int". |
5 | Message-id: 20180115182436.2066-11-f4bug@amsat.org | 5 | |
6 | Reported-by: Euler Robot <euler.robot@huawei.com> | ||
7 | Signed-off-by: Alex Chen <alex.chen@huawei.com> | ||
8 | Reviewed-by: Alistair Francis <alistair.francis@wdc.com> | ||
9 | Message-id: 5FA280F5.8060902@huawei.com | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
7 | --- | 11 | --- |
8 | hw/sd/sdhci-internal.h | 2 +- | 12 | hw/ssi/imx_spi.c | 2 +- |
9 | hw/sd/sdhci.c | 2 +- | 13 | hw/ssi/xilinx_spi.c | 2 +- |
10 | 2 files changed, 2 insertions(+), 2 deletions(-) | 14 | 2 files changed, 2 insertions(+), 2 deletions(-) |
11 | 15 | ||
12 | diff --git a/hw/sd/sdhci-internal.h b/hw/sd/sdhci-internal.h | 16 | diff --git a/hw/ssi/imx_spi.c b/hw/ssi/imx_spi.c |
13 | index XXXXXXX..XXXXXXX 100644 | 17 | index XXXXXXX..XXXXXXX 100644 |
14 | --- a/hw/sd/sdhci-internal.h | 18 | --- a/hw/ssi/imx_spi.c |
15 | +++ b/hw/sd/sdhci-internal.h | 19 | +++ b/hw/ssi/imx_spi.c |
16 | @@ -XXX,XX +XXX,XX @@ | 20 | @@ -XXX,XX +XXX,XX @@ static const char *imx_spi_reg_name(uint32_t reg) |
17 | #define SDHC_ACMD12ERRSTS 0x3C | 21 | case ECSPI_MSGDATA: |
18 | 22 | return "ECSPI_MSGDATA"; | |
19 | /* HWInit Capabilities Register 0x05E80080 */ | 23 | default: |
20 | -#define SDHC_CAPAREG 0x40 | 24 | - sprintf(unknown, "%d ?", reg); |
21 | +#define SDHC_CAPAB 0x40 | 25 | + sprintf(unknown, "%u ?", reg); |
22 | #define SDHC_CAN_DO_DMA 0x00400000 | 26 | return unknown; |
23 | #define SDHC_CAN_DO_ADMA2 0x00080000 | 27 | } |
24 | #define SDHC_CAN_DO_ADMA1 0x00100000 | 28 | } |
25 | diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c | 29 | diff --git a/hw/ssi/xilinx_spi.c b/hw/ssi/xilinx_spi.c |
26 | index XXXXXXX..XXXXXXX 100644 | 30 | index XXXXXXX..XXXXXXX 100644 |
27 | --- a/hw/sd/sdhci.c | 31 | --- a/hw/ssi/xilinx_spi.c |
28 | +++ b/hw/sd/sdhci.c | 32 | +++ b/hw/ssi/xilinx_spi.c |
29 | @@ -XXX,XX +XXX,XX @@ static uint64_t sdhci_read(void *opaque, hwaddr offset, unsigned size) | 33 | @@ -XXX,XX +XXX,XX @@ static void xlx_spi_update_irq(XilinxSPI *s) |
30 | case SDHC_ACMD12ERRSTS: | 34 | irq chain unless things really changed. */ |
31 | ret = s->acmd12errsts; | 35 | if (pending != s->irqline) { |
32 | break; | 36 | s->irqline = pending; |
33 | - case SDHC_CAPAREG: | 37 | - DB_PRINT("irq_change of state %d ISR:%x IER:%X\n", |
34 | + case SDHC_CAPAB: | 38 | + DB_PRINT("irq_change of state %u ISR:%x IER:%X\n", |
35 | ret = s->capareg; | 39 | pending, s->regs[R_IPISR], s->regs[R_IPIER]); |
36 | break; | 40 | qemu_set_irq(s->irq, pending); |
37 | case SDHC_MAXCURR: | 41 | } |
38 | -- | 42 | -- |
39 | 2.7.4 | 43 | 2.20.1 |
40 | 44 | ||
41 | 45 | diff view generated by jsdifflib |
1 | Instead of ignoring the response from address_space_ld*() | 1 | From: Xinhao Zhang <zhangxinhao1@huawei.com> |
---|---|---|---|
2 | (indicating an attempt to read a page table descriptor from | ||
3 | an invalid physical address), use it to report the failure | ||
4 | correctly. | ||
5 | 2 | ||
6 | Since this is another couple of locations where we need to | 3 | Fix code style. Operator needs spaces both sides. |
7 | decide the value of the ARMMMUFaultInfo ea bit based on a | ||
8 | MemTxResult, we factor out that operation into a helper | ||
9 | function. | ||
10 | 4 | ||
5 | Signed-off-by: Xinhao Zhang <zhangxinhao1@huawei.com> | ||
6 | Signed-off-by: Kai Deng <dengkai1@huawei.com> | ||
7 | Message-id: 20201103114529.638233-1-zhangxinhao1@huawei.com | ||
8 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
11 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
12 | --- | 10 | --- |
13 | target/arm/internals.h | 10 ++++++++++ | 11 | target/arm/arch_dump.c | 8 ++++---- |
14 | target/arm/helper.c | 39 ++++++++++++++++++++++++++++++++++----- | 12 | target/arm/arm-semi.c | 8 ++++---- |
15 | target/arm/op_helper.c | 7 +------ | 13 | target/arm/helper.c | 2 +- |
16 | 3 files changed, 45 insertions(+), 11 deletions(-) | 14 | 3 files changed, 9 insertions(+), 9 deletions(-) |
17 | 15 | ||
18 | diff --git a/target/arm/internals.h b/target/arm/internals.h | 16 | diff --git a/target/arm/arch_dump.c b/target/arm/arch_dump.c |
19 | index XXXXXXX..XXXXXXX 100644 | 17 | index XXXXXXX..XXXXXXX 100644 |
20 | --- a/target/arm/internals.h | 18 | --- a/target/arm/arch_dump.c |
21 | +++ b/target/arm/internals.h | 19 | +++ b/target/arm/arch_dump.c |
22 | @@ -XXX,XX +XXX,XX @@ static inline uint32_t arm_fi_to_lfsc(ARMMMUFaultInfo *fi) | 20 | @@ -XXX,XX +XXX,XX @@ static int aarch64_write_elf64_prfpreg(WriteCoreDumpFunction f, |
23 | return fsc; | 21 | |
24 | } | 22 | for (i = 0; i < 32; ++i) { |
25 | 23 | uint64_t *q = aa64_vfp_qreg(env, i); | |
26 | +static inline bool arm_extabort_type(MemTxResult result) | 24 | - note.vfp.vregs[2*i + 0] = cpu_to_dump64(s, q[0]); |
27 | +{ | 25 | - note.vfp.vregs[2*i + 1] = cpu_to_dump64(s, q[1]); |
28 | + /* The EA bit in syndromes and fault status registers is an | 26 | + note.vfp.vregs[2 * i + 0] = cpu_to_dump64(s, q[0]); |
29 | + * IMPDEF classification of external aborts. ARM implementations | 27 | + note.vfp.vregs[2 * i + 1] = cpu_to_dump64(s, q[1]); |
30 | + * usually use this to indicate AXI bus Decode error (0) or | 28 | } |
31 | + * Slave error (1); in QEMU we follow that. | 29 | |
32 | + */ | 30 | if (s->dump_info.d_endian == ELFDATA2MSB) { |
33 | + return result != MEMTX_DECODE_ERROR; | 31 | @@ -XXX,XX +XXX,XX @@ static int aarch64_write_elf64_prfpreg(WriteCoreDumpFunction f, |
34 | +} | 32 | */ |
35 | + | 33 | for (i = 0; i < 32; ++i) { |
36 | /* Do a page table walk and add page to TLB if possible */ | 34 | uint64_t tmp = note.vfp.vregs[2*i]; |
37 | bool arm_tlb_fill(CPUState *cpu, vaddr address, | 35 | - note.vfp.vregs[2*i] = note.vfp.vregs[2*i+1]; |
38 | MMUAccessType access_type, int mmu_idx, | 36 | - note.vfp.vregs[2*i+1] = tmp; |
37 | + note.vfp.vregs[2 * i] = note.vfp.vregs[2 * i + 1]; | ||
38 | + note.vfp.vregs[2 * i + 1] = tmp; | ||
39 | } | ||
40 | } | ||
41 | |||
42 | diff --git a/target/arm/arm-semi.c b/target/arm/arm-semi.c | ||
43 | index XXXXXXX..XXXXXXX 100644 | ||
44 | --- a/target/arm/arm-semi.c | ||
45 | +++ b/target/arm/arm-semi.c | ||
46 | @@ -XXX,XX +XXX,XX @@ target_ulong do_arm_semihosting(CPUARMState *env) | ||
47 | if (use_gdb_syscalls()) { | ||
48 | arm_semi_open_guestfd = guestfd; | ||
49 | ret = arm_gdb_syscall(cpu, arm_semi_open_cb, "open,%s,%x,1a4", arg0, | ||
50 | - (int)arg2+1, gdb_open_modeflags[arg1]); | ||
51 | + (int)arg2 + 1, gdb_open_modeflags[arg1]); | ||
52 | } else { | ||
53 | ret = set_swi_errno(env, open(s, open_modeflags[arg1], 0644)); | ||
54 | if (ret == (uint32_t)-1) { | ||
55 | @@ -XXX,XX +XXX,XX @@ target_ulong do_arm_semihosting(CPUARMState *env) | ||
56 | GET_ARG(1); | ||
57 | if (use_gdb_syscalls()) { | ||
58 | ret = arm_gdb_syscall(cpu, arm_semi_cb, "unlink,%s", | ||
59 | - arg0, (int)arg1+1); | ||
60 | + arg0, (int)arg1 + 1); | ||
61 | } else { | ||
62 | s = lock_user_string(arg0); | ||
63 | if (!s) { | ||
64 | @@ -XXX,XX +XXX,XX @@ target_ulong do_arm_semihosting(CPUARMState *env) | ||
65 | GET_ARG(3); | ||
66 | if (use_gdb_syscalls()) { | ||
67 | return arm_gdb_syscall(cpu, arm_semi_cb, "rename,%s,%s", | ||
68 | - arg0, (int)arg1+1, arg2, (int)arg3+1); | ||
69 | + arg0, (int)arg1 + 1, arg2, (int)arg3 + 1); | ||
70 | } else { | ||
71 | char *s2; | ||
72 | s = lock_user_string(arg0); | ||
73 | @@ -XXX,XX +XXX,XX @@ target_ulong do_arm_semihosting(CPUARMState *env) | ||
74 | GET_ARG(1); | ||
75 | if (use_gdb_syscalls()) { | ||
76 | return arm_gdb_syscall(cpu, arm_semi_cb, "system,%s", | ||
77 | - arg0, (int)arg1+1); | ||
78 | + arg0, (int)arg1 + 1); | ||
79 | } else { | ||
80 | s = lock_user_string(arg0); | ||
81 | if (!s) { | ||
39 | diff --git a/target/arm/helper.c b/target/arm/helper.c | 82 | diff --git a/target/arm/helper.c b/target/arm/helper.c |
40 | index XXXXXXX..XXXXXXX 100644 | 83 | index XXXXXXX..XXXXXXX 100644 |
41 | --- a/target/arm/helper.c | 84 | --- a/target/arm/helper.c |
42 | +++ b/target/arm/helper.c | 85 | +++ b/target/arm/helper.c |
43 | @@ -XXX,XX +XXX,XX @@ static hwaddr S1_ptw_translate(CPUARMState *env, ARMMMUIdx mmu_idx, | 86 | @@ -XXX,XX +XXX,XX @@ uint32_t HELPER(usad8)(uint32_t a, uint32_t b) |
44 | ret = get_phys_addr_lpae(env, addr, 0, ARMMMUIdx_S2NS, &s2pa, | 87 | uint32_t sum; |
45 | &txattrs, &s2prot, &s2size, fi, NULL); | 88 | sum = do_usad(a, b); |
46 | if (ret) { | 89 | sum += do_usad(a >> 8, b >> 8); |
47 | + assert(fi->type != ARMFault_None); | 90 | - sum += do_usad(a >> 16, b >>16); |
48 | fi->s2addr = addr; | 91 | + sum += do_usad(a >> 16, b >> 16); |
49 | fi->stage2 = true; | 92 | sum += do_usad(a >> 24, b >> 24); |
50 | fi->s1ptw = true; | 93 | return sum; |
51 | @@ -XXX,XX +XXX,XX @@ static uint32_t arm_ldl_ptw(CPUState *cs, hwaddr addr, bool is_secure, | ||
52 | ARMCPU *cpu = ARM_CPU(cs); | ||
53 | CPUARMState *env = &cpu->env; | ||
54 | MemTxAttrs attrs = {}; | ||
55 | + MemTxResult result = MEMTX_OK; | ||
56 | AddressSpace *as; | ||
57 | + uint32_t data; | ||
58 | |||
59 | attrs.secure = is_secure; | ||
60 | as = arm_addressspace(cs, attrs); | ||
61 | @@ -XXX,XX +XXX,XX @@ static uint32_t arm_ldl_ptw(CPUState *cs, hwaddr addr, bool is_secure, | ||
62 | return 0; | ||
63 | } | ||
64 | if (regime_translation_big_endian(env, mmu_idx)) { | ||
65 | - return address_space_ldl_be(as, addr, attrs, NULL); | ||
66 | + data = address_space_ldl_be(as, addr, attrs, &result); | ||
67 | } else { | ||
68 | - return address_space_ldl_le(as, addr, attrs, NULL); | ||
69 | + data = address_space_ldl_le(as, addr, attrs, &result); | ||
70 | } | ||
71 | + if (result == MEMTX_OK) { | ||
72 | + return data; | ||
73 | + } | ||
74 | + fi->type = ARMFault_SyncExternalOnWalk; | ||
75 | + fi->ea = arm_extabort_type(result); | ||
76 | + return 0; | ||
77 | } | ||
78 | |||
79 | static uint64_t arm_ldq_ptw(CPUState *cs, hwaddr addr, bool is_secure, | ||
80 | @@ -XXX,XX +XXX,XX @@ static uint64_t arm_ldq_ptw(CPUState *cs, hwaddr addr, bool is_secure, | ||
81 | ARMCPU *cpu = ARM_CPU(cs); | ||
82 | CPUARMState *env = &cpu->env; | ||
83 | MemTxAttrs attrs = {}; | ||
84 | + MemTxResult result = MEMTX_OK; | ||
85 | AddressSpace *as; | ||
86 | + uint32_t data; | ||
87 | |||
88 | attrs.secure = is_secure; | ||
89 | as = arm_addressspace(cs, attrs); | ||
90 | @@ -XXX,XX +XXX,XX @@ static uint64_t arm_ldq_ptw(CPUState *cs, hwaddr addr, bool is_secure, | ||
91 | return 0; | ||
92 | } | ||
93 | if (regime_translation_big_endian(env, mmu_idx)) { | ||
94 | - return address_space_ldq_be(as, addr, attrs, NULL); | ||
95 | + data = address_space_ldq_be(as, addr, attrs, &result); | ||
96 | } else { | ||
97 | - return address_space_ldq_le(as, addr, attrs, NULL); | ||
98 | + data = address_space_ldq_le(as, addr, attrs, &result); | ||
99 | + } | ||
100 | + if (result == MEMTX_OK) { | ||
101 | + return data; | ||
102 | } | ||
103 | + fi->type = ARMFault_SyncExternalOnWalk; | ||
104 | + fi->ea = arm_extabort_type(result); | ||
105 | + return 0; | ||
106 | } | ||
107 | |||
108 | static bool get_phys_addr_v5(CPUARMState *env, uint32_t address, | ||
109 | @@ -XXX,XX +XXX,XX @@ static bool get_phys_addr_v5(CPUARMState *env, uint32_t address, | ||
110 | } | ||
111 | desc = arm_ldl_ptw(cs, table, regime_is_secure(env, mmu_idx), | ||
112 | mmu_idx, fi); | ||
113 | + if (fi->type != ARMFault_None) { | ||
114 | + goto do_fault; | ||
115 | + } | ||
116 | type = (desc & 3); | ||
117 | domain = (desc >> 5) & 0x0f; | ||
118 | if (regime_el(env, mmu_idx) == 1) { | ||
119 | @@ -XXX,XX +XXX,XX @@ static bool get_phys_addr_v5(CPUARMState *env, uint32_t address, | ||
120 | } | ||
121 | desc = arm_ldl_ptw(cs, table, regime_is_secure(env, mmu_idx), | ||
122 | mmu_idx, fi); | ||
123 | + if (fi->type != ARMFault_None) { | ||
124 | + goto do_fault; | ||
125 | + } | ||
126 | switch (desc & 3) { | ||
127 | case 0: /* Page translation fault. */ | ||
128 | fi->type = ARMFault_Translation; | ||
129 | @@ -XXX,XX +XXX,XX @@ static bool get_phys_addr_v6(CPUARMState *env, uint32_t address, | ||
130 | } | ||
131 | desc = arm_ldl_ptw(cs, table, regime_is_secure(env, mmu_idx), | ||
132 | mmu_idx, fi); | ||
133 | + if (fi->type != ARMFault_None) { | ||
134 | + goto do_fault; | ||
135 | + } | ||
136 | type = (desc & 3); | ||
137 | if (type == 0 || (type == 3 && !arm_feature(env, ARM_FEATURE_PXN))) { | ||
138 | /* Section translation fault, or attempt to use the encoding | ||
139 | @@ -XXX,XX +XXX,XX @@ static bool get_phys_addr_v6(CPUARMState *env, uint32_t address, | ||
140 | table = (desc & 0xfffffc00) | ((address >> 10) & 0x3fc); | ||
141 | desc = arm_ldl_ptw(cs, table, regime_is_secure(env, mmu_idx), | ||
142 | mmu_idx, fi); | ||
143 | + if (fi->type != ARMFault_None) { | ||
144 | + goto do_fault; | ||
145 | + } | ||
146 | ap = ((desc >> 4) & 3) | ((desc >> 7) & 4); | ||
147 | switch (desc & 3) { | ||
148 | case 0: /* Page translation fault. */ | ||
149 | @@ -XXX,XX +XXX,XX @@ static bool get_phys_addr_lpae(CPUARMState *env, target_ulong address, | ||
150 | descaddr &= ~7ULL; | ||
151 | nstable = extract32(tableattrs, 4, 1); | ||
152 | descriptor = arm_ldq_ptw(cs, descaddr, !nstable, mmu_idx, fi); | ||
153 | - if (fi->s1ptw) { | ||
154 | + if (fi->type != ARMFault_None) { | ||
155 | goto do_fault; | ||
156 | } | ||
157 | |||
158 | diff --git a/target/arm/op_helper.c b/target/arm/op_helper.c | ||
159 | index XXXXXXX..XXXXXXX 100644 | ||
160 | --- a/target/arm/op_helper.c | ||
161 | +++ b/target/arm/op_helper.c | ||
162 | @@ -XXX,XX +XXX,XX @@ void arm_cpu_do_transaction_failed(CPUState *cs, hwaddr physaddr, | ||
163 | /* now we have a real cpu fault */ | ||
164 | cpu_restore_state(cs, retaddr); | ||
165 | |||
166 | - /* The EA bit in syndromes and fault status registers is an | ||
167 | - * IMPDEF classification of external aborts. ARM implementations | ||
168 | - * usually use this to indicate AXI bus Decode error (0) or | ||
169 | - * Slave error (1); in QEMU we follow that. | ||
170 | - */ | ||
171 | - fi.ea = (response != MEMTX_DECODE_ERROR); | ||
172 | + fi.ea = arm_extabort_type(response); | ||
173 | fi.type = ARMFault_SyncExternal; | ||
174 | deliver_fault(cpu, addr, access_type, mmu_idx, &fi); | ||
175 | } | 94 | } |
176 | -- | 95 | -- |
177 | 2.7.4 | 96 | 2.20.1 |
178 | 97 | ||
179 | 98 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Xinhao Zhang <zhangxinhao1@huawei.com> |
---|---|---|---|
2 | 2 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 3 | Fix code style. Don't use '#' flag of printf format ('%#') in |
4 | format strings, use '0x' prefix instead | ||
5 | |||
6 | Signed-off-by: Xinhao Zhang <zhangxinhao1@huawei.com> | ||
7 | Signed-off-by: Kai Deng <dengkai1@huawei.com> | ||
8 | Message-id: 20201103114529.638233-2-zhangxinhao1@huawei.com | ||
4 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 9 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> |
5 | Message-id: 20180110063337.21538-3-richard.henderson@linaro.org | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
7 | --- | 11 | --- |
8 | target/arm/translate-a64.c | 5 +++++ | 12 | target/arm/translate-a64.c | 4 ++-- |
9 | 1 file changed, 5 insertions(+) | 13 | 1 file changed, 2 insertions(+), 2 deletions(-) |
10 | 14 | ||
11 | diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c | 15 | diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c |
12 | index XXXXXXX..XXXXXXX 100644 | 16 | index XXXXXXX..XXXXXXX 100644 |
13 | --- a/target/arm/translate-a64.c | 17 | --- a/target/arm/translate-a64.c |
14 | +++ b/target/arm/translate-a64.c | 18 | +++ b/target/arm/translate-a64.c |
15 | @@ -XXX,XX +XXX,XX @@ static uint64_t vfp_expand_imm(int size, uint8_t imm8) | 19 | @@ -XXX,XX +XXX,XX @@ static void disas_simd_three_reg_same_fp16(DisasContext *s, uint32_t insn) |
16 | (extract32(imm8, 0, 6) << 3); | 20 | gen_helper_advsimd_acgt_f16(tcg_res, tcg_op1, tcg_op2, fpst); |
17 | imm <<= 16; | 21 | break; |
22 | default: | ||
23 | - fprintf(stderr, "%s: insn %#04x, fpop %#2x @ %#" PRIx64 "\n", | ||
24 | + fprintf(stderr, "%s: insn 0x%04x, fpop 0x%2x @ 0x%" PRIx64 "\n", | ||
25 | __func__, insn, fpopcode, s->pc_curr); | ||
26 | g_assert_not_reached(); | ||
27 | } | ||
28 | @@ -XXX,XX +XXX,XX @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn) | ||
29 | case 0x7f: /* FSQRT (vector) */ | ||
18 | break; | 30 | break; |
19 | + case MO_16: | ||
20 | + imm = (extract32(imm8, 7, 1) ? 0x8000 : 0) | | ||
21 | + (extract32(imm8, 6, 1) ? 0x3000 : 0x4000) | | ||
22 | + (extract32(imm8, 0, 6) << 6); | ||
23 | + break; | ||
24 | default: | 31 | default: |
32 | - fprintf(stderr, "%s: insn %#04x fpop %#2x\n", __func__, insn, fpop); | ||
33 | + fprintf(stderr, "%s: insn 0x%04x fpop 0x%2x\n", __func__, insn, fpop); | ||
25 | g_assert_not_reached(); | 34 | g_assert_not_reached(); |
26 | } | 35 | } |
36 | |||
27 | -- | 37 | -- |
28 | 2.7.4 | 38 | 2.20.1 |
29 | 39 | ||
30 | 40 | diff view generated by jsdifflib |
1 | From: Philippe Mathieu-Daudé <f4bug@amsat.org> | 1 | From: Xinhao Zhang <zhangxinhao1@huawei.com> |
---|---|---|---|
2 | 2 | ||
3 | While SysBus devices can use the get_system_memory() address space, | 3 | Fix code style. Space required before the open parenthesis '('. |
4 | PCI devices should use the bus master address space for DMA. | ||
5 | 4 | ||
6 | Suggested-by: Peter Maydell <peter.maydell@linaro.org> | 5 | Signed-off-by: Xinhao Zhang <zhangxinhao1@huawei.com> |
7 | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | 6 | Signed-off-by: Kai Deng <dengkai1@huawei.com> |
7 | Message-id: 20201103114529.638233-3-zhangxinhao1@huawei.com | ||
8 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 8 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> |
9 | Message-id: 20180115182436.2066-14-f4bug@amsat.org | ||
10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
11 | --- | 10 | --- |
12 | include/hw/sd/sdhci.h | 1 + | 11 | target/arm/translate.c | 2 +- |
13 | hw/sd/sdhci.c | 29 +++++++++++++++-------------- | 12 | 1 file changed, 1 insertion(+), 1 deletion(-) |
14 | 2 files changed, 16 insertions(+), 14 deletions(-) | ||
15 | 13 | ||
16 | diff --git a/include/hw/sd/sdhci.h b/include/hw/sd/sdhci.h | 14 | diff --git a/target/arm/translate.c b/target/arm/translate.c |
17 | index XXXXXXX..XXXXXXX 100644 | 15 | index XXXXXXX..XXXXXXX 100644 |
18 | --- a/include/hw/sd/sdhci.h | 16 | --- a/target/arm/translate.c |
19 | +++ b/include/hw/sd/sdhci.h | 17 | +++ b/target/arm/translate.c |
20 | @@ -XXX,XX +XXX,XX @@ typedef struct SDHCIState { | 18 | @@ -XXX,XX +XXX,XX @@ static void arm_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu) |
21 | /*< public >*/ | 19 | - Hardware watchpoints. |
22 | SDBus sdbus; | 20 | Hardware breakpoints have already been handled and skip this code. |
23 | MemoryRegion iomem; | 21 | */ |
24 | + AddressSpace *dma_as; | 22 | - switch(dc->base.is_jmp) { |
25 | 23 | + switch (dc->base.is_jmp) { | |
26 | QEMUTimer *insert_timer; /* timer for 'changing' sd card. */ | 24 | case DISAS_NEXT: |
27 | QEMUTimer *transfer_timer; | 25 | case DISAS_TOO_MANY: |
28 | diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c | 26 | gen_goto_tb(dc, 1, dc->base.pc_next); |
29 | index XXXXXXX..XXXXXXX 100644 | ||
30 | --- a/hw/sd/sdhci.c | ||
31 | +++ b/hw/sd/sdhci.c | ||
32 | @@ -XXX,XX +XXX,XX @@ static void sdhci_sdma_transfer_multi_blocks(SDHCIState *s) | ||
33 | s->blkcnt--; | ||
34 | } | ||
35 | } | ||
36 | - dma_memory_write(&address_space_memory, s->sdmasysad, | ||
37 | + dma_memory_write(s->dma_as, s->sdmasysad, | ||
38 | &s->fifo_buffer[begin], s->data_count - begin); | ||
39 | s->sdmasysad += s->data_count - begin; | ||
40 | if (s->data_count == block_size) { | ||
41 | @@ -XXX,XX +XXX,XX @@ static void sdhci_sdma_transfer_multi_blocks(SDHCIState *s) | ||
42 | s->data_count = block_size; | ||
43 | boundary_count -= block_size - begin; | ||
44 | } | ||
45 | - dma_memory_read(&address_space_memory, s->sdmasysad, | ||
46 | + dma_memory_read(s->dma_as, s->sdmasysad, | ||
47 | &s->fifo_buffer[begin], s->data_count - begin); | ||
48 | s->sdmasysad += s->data_count - begin; | ||
49 | if (s->data_count == block_size) { | ||
50 | @@ -XXX,XX +XXX,XX @@ static void sdhci_sdma_transfer_single_block(SDHCIState *s) | ||
51 | for (n = 0; n < datacnt; n++) { | ||
52 | s->fifo_buffer[n] = sdbus_read_data(&s->sdbus); | ||
53 | } | ||
54 | - dma_memory_write(&address_space_memory, s->sdmasysad, s->fifo_buffer, | ||
55 | - datacnt); | ||
56 | + dma_memory_write(s->dma_as, s->sdmasysad, s->fifo_buffer, datacnt); | ||
57 | } else { | ||
58 | - dma_memory_read(&address_space_memory, s->sdmasysad, s->fifo_buffer, | ||
59 | - datacnt); | ||
60 | + dma_memory_read(s->dma_as, s->sdmasysad, s->fifo_buffer, datacnt); | ||
61 | for (n = 0; n < datacnt; n++) { | ||
62 | sdbus_write_data(&s->sdbus, s->fifo_buffer[n]); | ||
63 | } | ||
64 | @@ -XXX,XX +XXX,XX @@ static void get_adma_description(SDHCIState *s, ADMADescr *dscr) | ||
65 | hwaddr entry_addr = (hwaddr)s->admasysaddr; | ||
66 | switch (SDHC_DMA_TYPE(s->hostctl)) { | ||
67 | case SDHC_CTRL_ADMA2_32: | ||
68 | - dma_memory_read(&address_space_memory, entry_addr, (uint8_t *)&adma2, | ||
69 | + dma_memory_read(s->dma_as, entry_addr, (uint8_t *)&adma2, | ||
70 | sizeof(adma2)); | ||
71 | adma2 = le64_to_cpu(adma2); | ||
72 | /* The spec does not specify endianness of descriptor table. | ||
73 | @@ -XXX,XX +XXX,XX @@ static void get_adma_description(SDHCIState *s, ADMADescr *dscr) | ||
74 | dscr->incr = 8; | ||
75 | break; | ||
76 | case SDHC_CTRL_ADMA1_32: | ||
77 | - dma_memory_read(&address_space_memory, entry_addr, (uint8_t *)&adma1, | ||
78 | + dma_memory_read(s->dma_as, entry_addr, (uint8_t *)&adma1, | ||
79 | sizeof(adma1)); | ||
80 | adma1 = le32_to_cpu(adma1); | ||
81 | dscr->addr = (hwaddr)(adma1 & 0xFFFFF000); | ||
82 | @@ -XXX,XX +XXX,XX @@ static void get_adma_description(SDHCIState *s, ADMADescr *dscr) | ||
83 | } | ||
84 | break; | ||
85 | case SDHC_CTRL_ADMA2_64: | ||
86 | - dma_memory_read(&address_space_memory, entry_addr, | ||
87 | + dma_memory_read(s->dma_as, entry_addr, | ||
88 | (uint8_t *)(&dscr->attr), 1); | ||
89 | - dma_memory_read(&address_space_memory, entry_addr + 2, | ||
90 | + dma_memory_read(s->dma_as, entry_addr + 2, | ||
91 | (uint8_t *)(&dscr->length), 2); | ||
92 | dscr->length = le16_to_cpu(dscr->length); | ||
93 | - dma_memory_read(&address_space_memory, entry_addr + 4, | ||
94 | + dma_memory_read(s->dma_as, entry_addr + 4, | ||
95 | (uint8_t *)(&dscr->addr), 8); | ||
96 | dscr->attr = le64_to_cpu(dscr->attr); | ||
97 | dscr->attr &= 0xfffffff8; | ||
98 | @@ -XXX,XX +XXX,XX @@ static void sdhci_do_adma(SDHCIState *s) | ||
99 | s->data_count = block_size; | ||
100 | length -= block_size - begin; | ||
101 | } | ||
102 | - dma_memory_write(&address_space_memory, dscr.addr, | ||
103 | + dma_memory_write(s->dma_as, dscr.addr, | ||
104 | &s->fifo_buffer[begin], | ||
105 | s->data_count - begin); | ||
106 | dscr.addr += s->data_count - begin; | ||
107 | @@ -XXX,XX +XXX,XX @@ static void sdhci_do_adma(SDHCIState *s) | ||
108 | s->data_count = block_size; | ||
109 | length -= block_size - begin; | ||
110 | } | ||
111 | - dma_memory_read(&address_space_memory, dscr.addr, | ||
112 | + dma_memory_read(s->dma_as, dscr.addr, | ||
113 | &s->fifo_buffer[begin], | ||
114 | s->data_count - begin); | ||
115 | dscr.addr += s->data_count - begin; | ||
116 | @@ -XXX,XX +XXX,XX @@ static void sdhci_pci_realize(PCIDevice *dev, Error **errp) | ||
117 | dev->config[PCI_CLASS_PROG] = 0x01; /* Standard Host supported DMA */ | ||
118 | dev->config[PCI_INTERRUPT_PIN] = 0x01; /* interrupt pin A */ | ||
119 | s->irq = pci_allocate_irq(dev); | ||
120 | - pci_register_bar(dev, 0, 0, &s->iomem); | ||
121 | + s->dma_as = pci_get_address_space(dev); | ||
122 | + pci_register_bar(dev, 0, PCI_BASE_ADDRESS_SPACE_MEMORY, &s->iomem); | ||
123 | } | ||
124 | |||
125 | static void sdhci_pci_exit(PCIDevice *dev) | ||
126 | @@ -XXX,XX +XXX,XX @@ static void sdhci_sysbus_realize(DeviceState *dev, Error ** errp) | ||
127 | return; | ||
128 | } | ||
129 | |||
130 | + s->dma_as = &address_space_memory; | ||
131 | + | ||
132 | sysbus_init_irq(sbd, &s->irq); | ||
133 | sysbus_init_mmio(sbd, &s->iomem); | ||
134 | } | ||
135 | -- | 27 | -- |
136 | 2.7.4 | 28 | 2.20.1 |
137 | 29 | ||
138 | 30 | diff view generated by jsdifflib |
1 | From: Andrey Smirnov <andrew.smirnov@gmail.com> | 1 | From: Alex Bennée <alex.bennee@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> | 3 | We should at least document what this machine is about. |
4 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 4 | |
5 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | 5 | Reviewed-by: Graeme Gregory <graeme@nuviainc.com> |
6 | Reviewed-by: Alistair Francis <alistair.francis@xilinx.com> | 6 | Signed-off-by: Alex Bennée <alex.bennee@linaro.org> |
7 | Message-id: 20180115182436.2066-13-f4bug@amsat.org | 7 | Message-id: 20201104165254.24822-1-alex.bennee@linaro.org |
8 | Cc: Leif Lindholm <leif@nuviainc.com> | ||
9 | Cc: Shashi Mallela <shashi.mallela@linaro.org> | ||
10 | Signed-off-by: Alex Bennée <alex.bennee@linaro.org> | ||
11 | [PMM: fixed filename mismatch] | ||
8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 12 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
9 | --- | 13 | --- |
10 | hw/sd/sdhci.c | 3 +++ | 14 | docs/system/arm/sbsa.rst | 32 ++++++++++++++++++++++++++++++++ |
11 | 1 file changed, 3 insertions(+) | 15 | docs/system/target-arm.rst | 1 + |
16 | 2 files changed, 33 insertions(+) | ||
17 | create mode 100644 docs/system/arm/sbsa.rst | ||
12 | 18 | ||
13 | diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c | 19 | diff --git a/docs/system/arm/sbsa.rst b/docs/system/arm/sbsa.rst |
20 | new file mode 100644 | ||
21 | index XXXXXXX..XXXXXXX | ||
22 | --- /dev/null | ||
23 | +++ b/docs/system/arm/sbsa.rst | ||
24 | @@ -XXX,XX +XXX,XX @@ | ||
25 | +Arm Server Base System Architecture Reference board (``sbsa-ref``) | ||
26 | +================================================================== | ||
27 | + | ||
28 | +While the `virt` board is a generic board platform that doesn't match | ||
29 | +any real hardware the `sbsa-ref` board intends to look like real | ||
30 | +hardware. The `Server Base System Architecture | ||
31 | +<https://developer.arm.com/documentation/den0029/latest>` defines a | ||
32 | +minimum base line of hardware support and importantly how the firmware | ||
33 | +reports that to any operating system. It is a static system that | ||
34 | +reports a very minimal DT to the firmware for non-discoverable | ||
35 | +information about components affected by the qemu command line (i.e. | ||
36 | +cpus and memory). As a result it must have a firmware specifically | ||
37 | +built to expect a certain hardware layout (as you would in a real | ||
38 | +machine). | ||
39 | + | ||
40 | +It is intended to be a machine for developing firmware and testing | ||
41 | +standards compliance with operating systems. | ||
42 | + | ||
43 | +Supported devices | ||
44 | +""""""""""""""""" | ||
45 | + | ||
46 | +The sbsa-ref board supports: | ||
47 | + | ||
48 | + - A configurable number of AArch64 CPUs | ||
49 | + - GIC version 3 | ||
50 | + - System bus AHCI controller | ||
51 | + - System bus EHCI controller | ||
52 | + - CDROM and hard disc on AHCI bus | ||
53 | + - E1000E ethernet card on PCIe bus | ||
54 | + - VGA display adaptor on PCIe bus | ||
55 | + - A generic SBSA watchdog device | ||
56 | + | ||
57 | diff --git a/docs/system/target-arm.rst b/docs/system/target-arm.rst | ||
14 | index XXXXXXX..XXXXXXX 100644 | 58 | index XXXXXXX..XXXXXXX 100644 |
15 | --- a/hw/sd/sdhci.c | 59 | --- a/docs/system/target-arm.rst |
16 | +++ b/hw/sd/sdhci.c | 60 | +++ b/docs/system/target-arm.rst |
17 | @@ -XXX,XX +XXX,XX @@ sdhci_write(void *opaque, hwaddr offset, uint64_t val, unsigned size) | 61 | @@ -XXX,XX +XXX,XX @@ undocumented; you can get a complete list by running |
18 | } | 62 | arm/mps2 |
19 | sdhci_update_irq(s); | 63 | arm/musca |
20 | break; | 64 | arm/realview |
21 | + case SDHC_ACMD12ERRSTS: | 65 | + arm/sbsa |
22 | + MASKED_WRITE(s->acmd12errsts, mask, value); | 66 | arm/versatile |
23 | + break; | 67 | arm/vexpress |
24 | 68 | arm/aspeed | |
25 | case SDHC_CAPAB: | ||
26 | case SDHC_CAPAB + 4: | ||
27 | -- | 69 | -- |
28 | 2.7.4 | 70 | 2.20.1 |
29 | 71 | ||
30 | 72 | diff view generated by jsdifflib |
1 | From: Philippe Mathieu-Daudé <f4bug@amsat.org> | 1 | From: Philippe Mathieu-Daudé <philmd@redhat.com> |
---|---|---|---|
2 | 2 | ||
3 | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | 3 | When using a Cortex-A15, the Virt machine does not use any |
4 | Reviewed-by: Alistair Francis <alistair.francis@xilinx.com> | 4 | MPCore peripherals. Remove the dependency. |
5 | Message-id: 20180115182436.2066-10-f4bug@amsat.org | 5 | |
6 | Fixes: 7951c7b7c05 ("hw/arm: Express dependencies of the virt machine with Kconfig") | ||
7 | Reported-by: Miroslav Rezanina <mrezanin@redhat.com> | ||
8 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
9 | Message-id: 20201107114852.271922-1-philmd@redhat.com | ||
10 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 11 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
7 | --- | 12 | --- |
8 | hw/sd/sdhci-internal.h | 1 + | 13 | hw/arm/Kconfig | 1 - |
9 | hw/sd/sdhci.c | 3 +-- | 14 | 1 file changed, 1 deletion(-) |
10 | 2 files changed, 2 insertions(+), 2 deletions(-) | ||
11 | 15 | ||
12 | diff --git a/hw/sd/sdhci-internal.h b/hw/sd/sdhci-internal.h | 16 | diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig |
13 | index XXXXXXX..XXXXXXX 100644 | 17 | index XXXXXXX..XXXXXXX 100644 |
14 | --- a/hw/sd/sdhci-internal.h | 18 | --- a/hw/arm/Kconfig |
15 | +++ b/hw/sd/sdhci-internal.h | 19 | +++ b/hw/arm/Kconfig |
16 | @@ -XXX,XX +XXX,XX @@ | 20 | @@ -XXX,XX +XXX,XX @@ config ARM_VIRT |
17 | #define SDHC_TRNS_ACMD12 0x0004 | 21 | imply VFIO_PLATFORM |
18 | #define SDHC_TRNS_READ 0x0010 | 22 | imply VFIO_XGMAC |
19 | #define SDHC_TRNS_MULTI 0x0020 | 23 | imply TPM_TIS_SYSBUS |
20 | +#define SDHC_TRNMOD_MASK 0x0037 | 24 | - select A15MPCORE |
21 | 25 | select ACPI | |
22 | /* R/W Command Register 0x0 */ | 26 | select ARM_SMMUV3 |
23 | #define SDHC_CMDREG 0x0E | 27 | select GPIO_KEY |
24 | diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c | ||
25 | index XXXXXXX..XXXXXXX 100644 | ||
26 | --- a/hw/sd/sdhci.c | ||
27 | +++ b/hw/sd/sdhci.c | ||
28 | @@ -XXX,XX +XXX,XX @@ | ||
29 | (SDHC_CAPAB_BASECLKFREQ << 8) | (SDHC_CAPAB_TOUNIT << 7) | \ | ||
30 | (SDHC_CAPAB_TOCLKFREQ)) | ||
31 | |||
32 | -#define MASK_TRNMOD 0x0037 | ||
33 | #define MASKED_WRITE(reg, mask, val) (reg = (reg & (mask)) | (val)) | ||
34 | |||
35 | static uint8_t sdhci_slotint(SDHCIState *s) | ||
36 | @@ -XXX,XX +XXX,XX @@ sdhci_write(void *opaque, hwaddr offset, uint64_t val, unsigned size) | ||
37 | if (!(s->capareg & SDHC_CAN_DO_DMA)) { | ||
38 | value &= ~SDHC_TRNS_DMA; | ||
39 | } | ||
40 | - MASKED_WRITE(s->trnmod, mask, value & MASK_TRNMOD); | ||
41 | + MASKED_WRITE(s->trnmod, mask, value & SDHC_TRNMOD_MASK); | ||
42 | MASKED_WRITE(s->cmdreg, mask >> 16, value >> 16); | ||
43 | |||
44 | /* Writing to the upper byte of CMDREG triggers SD command generation */ | ||
45 | -- | 28 | -- |
46 | 2.7.4 | 29 | 2.20.1 |
47 | 30 | ||
48 | 31 | diff view generated by jsdifflib |
1 | From: Philippe Mathieu-Daudé <f4bug@amsat.org> | 1 | From: Richard Henderson <richard.henderson@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | zero-initialize ADMADescr 'dscr' in sdhci_do_adma() to avoid: | 3 | The helper function did not get updated when we reorganized |
4 | the vector register file for SVE. Since then, the neon dregs | ||
5 | are non-sequential and cannot be simply indexed. | ||
4 | 6 | ||
5 | hw/sd/sdhci.c: In function ‘sdhci_do_adma’: | 7 | At the same time, make the helper function operate on 64-bit |
6 | hw/sd/sdhci.c:714:29: error: ‘dscr.addr’ may be used uninitialized in this function [-Werror=maybe-uninitialized] | 8 | quantities so that we do not have to call it twice. |
7 | trace_sdhci_adma("link", s->admasysaddr); | ||
8 | ^ | ||
9 | 9 | ||
10 | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | 10 | Fixes: c39c2b9043e |
11 | Acked-by: Alistair Francis <alistair.francis@xilinx.com> | 11 | Reported-by: Ard Biesheuvel <ardb@kernel.org> |
12 | Message-id: 20180115182436.2066-9-f4bug@amsat.org | 12 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
13 | [PMM: use aa32_vfp_dreg() rather than opencoding] | ||
14 | Message-id: 20201105171126.88014-1-richard.henderson@linaro.org | ||
15 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
13 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 16 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
14 | --- | 17 | --- |
15 | hw/sd/sdhci.c | 89 ++++++++++++++++++------------------------------------ | 18 | target/arm/helper.h | 2 +- |
16 | hw/sd/trace-events | 14 +++++++++ | 19 | target/arm/op_helper.c | 23 +++++++++-------- |
17 | 2 files changed, 44 insertions(+), 59 deletions(-) | 20 | target/arm/translate-neon.c.inc | 44 +++++++++++---------------------- |
21 | 3 files changed, 29 insertions(+), 40 deletions(-) | ||
18 | 22 | ||
19 | diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c | 23 | diff --git a/target/arm/helper.h b/target/arm/helper.h |
20 | index XXXXXXX..XXXXXXX 100644 | 24 | index XXXXXXX..XXXXXXX 100644 |
21 | --- a/hw/sd/sdhci.c | 25 | --- a/target/arm/helper.h |
22 | +++ b/hw/sd/sdhci.c | 26 | +++ b/target/arm/helper.h |
23 | @@ -XXX,XX +XXX,XX @@ | 27 | @@ -XXX,XX +XXX,XX @@ DEF_HELPER_FLAGS_2(rsqrte_f32, TCG_CALL_NO_RWG, f32, f32, ptr) |
24 | #include "sdhci-internal.h" | 28 | DEF_HELPER_FLAGS_2(rsqrte_f64, TCG_CALL_NO_RWG, f64, f64, ptr) |
25 | #include "qapi/error.h" | 29 | DEF_HELPER_FLAGS_1(recpe_u32, TCG_CALL_NO_RWG, i32, i32) |
26 | #include "qemu/log.h" | 30 | DEF_HELPER_FLAGS_1(rsqrte_u32, TCG_CALL_NO_RWG, i32, i32) |
27 | - | 31 | -DEF_HELPER_FLAGS_4(neon_tbl, TCG_CALL_NO_RWG, i32, i32, i32, ptr, i32) |
28 | -/* host controller debug messages */ | 32 | +DEF_HELPER_FLAGS_4(neon_tbl, TCG_CALL_NO_RWG, i64, env, i32, i64, i64) |
29 | -#ifndef SDHC_DEBUG | 33 | |
30 | -#define SDHC_DEBUG 0 | 34 | DEF_HELPER_3(shl_cc, i32, env, i32, i32) |
31 | -#endif | 35 | DEF_HELPER_3(shr_cc, i32, env, i32, i32) |
32 | - | 36 | diff --git a/target/arm/op_helper.c b/target/arm/op_helper.c |
33 | -#define DPRINT_L1(fmt, args...) \ | 37 | index XXXXXXX..XXXXXXX 100644 |
34 | - do { \ | 38 | --- a/target/arm/op_helper.c |
35 | - if (SDHC_DEBUG) { \ | 39 | +++ b/target/arm/op_helper.c |
36 | - fprintf(stderr, "QEMU SDHC: " fmt, ## args); \ | 40 | @@ -XXX,XX +XXX,XX @@ void raise_exception_ra(CPUARMState *env, uint32_t excp, uint32_t syndrome, |
37 | - } \ | 41 | cpu_loop_exit_restore(cs, ra); |
38 | - } while (0) | 42 | } |
39 | -#define DPRINT_L2(fmt, args...) \ | 43 | |
40 | - do { \ | 44 | -uint32_t HELPER(neon_tbl)(uint32_t ireg, uint32_t def, void *vn, |
41 | - if (SDHC_DEBUG > 1) { \ | 45 | - uint32_t maxindex) |
42 | - fprintf(stderr, "QEMU SDHC: " fmt, ## args); \ | 46 | +uint64_t HELPER(neon_tbl)(CPUARMState *env, uint32_t desc, |
43 | - } \ | 47 | + uint64_t ireg, uint64_t def) |
44 | - } while (0) | ||
45 | -#define ERRPRINT(fmt, args...) \ | ||
46 | - do { \ | ||
47 | - if (SDHC_DEBUG) { \ | ||
48 | - fprintf(stderr, "QEMU SDHC ERROR: " fmt, ## args); \ | ||
49 | - } \ | ||
50 | - } while (0) | ||
51 | +#include "trace.h" | ||
52 | |||
53 | #define TYPE_SDHCI_BUS "sdhci-bus" | ||
54 | #define SDHCI_BUS(obj) OBJECT_CHECK(SDBus, (obj), TYPE_SDHCI_BUS) | ||
55 | @@ -XXX,XX +XXX,XX @@ static void sdhci_raise_insertion_irq(void *opaque) | ||
56 | static void sdhci_set_inserted(DeviceState *dev, bool level) | ||
57 | { | 48 | { |
58 | SDHCIState *s = (SDHCIState *)dev; | 49 | - uint32_t val, shift; |
59 | - DPRINT_L1("Card state changed: %s!\n", level ? "insert" : "eject"); | 50 | - uint64_t *table = vn; |
60 | 51 | + uint64_t tmp, val = 0; | |
61 | + trace_sdhci_set_inserted(level ? "insert" : "eject"); | 52 | + uint32_t maxindex = ((desc & 3) + 1) * 8; |
62 | if ((s->norintsts & SDHC_NIS_REMOVE) && level) { | 53 | + uint32_t base_reg = desc >> 2; |
63 | /* Give target some time to notice card ejection */ | 54 | + uint32_t shift, index, reg; |
64 | timer_mod(s->insert_timer, | 55 | |
65 | @@ -XXX,XX +XXX,XX @@ static void sdhci_send_command(SDHCIState *s) | 56 | - val = 0; |
66 | s->acmd12errsts = 0; | 57 | - for (shift = 0; shift < 32; shift += 8) { |
67 | request.cmd = s->cmdreg >> 8; | 58 | - uint32_t index = (ireg >> shift) & 0xff; |
68 | request.arg = s->argument; | 59 | + for (shift = 0; shift < 64; shift += 8) { |
69 | - DPRINT_L1("sending CMD%u ARG[0x%08x]\n", request.cmd, request.arg); | 60 | + index = (ireg >> shift) & 0xff; |
70 | + | 61 | if (index < maxindex) { |
71 | + trace_sdhci_send_command(request.cmd, request.arg); | 62 | - uint32_t tmp = (table[index >> 3] >> ((index & 7) << 3)) & 0xff; |
72 | rlen = sdbus_do_command(&s->sdbus, &request, response); | 63 | - val |= tmp << shift; |
73 | 64 | + reg = base_reg + (index >> 3); | |
74 | if (s->cmdreg & SDHC_CMD_RESPONSE) { | 65 | + tmp = *aa32_vfp_dreg(env, reg); |
75 | @@ -XXX,XX +XXX,XX @@ static void sdhci_send_command(SDHCIState *s) | 66 | + tmp = ((tmp >> ((index & 7) << 3)) & 0xff) << shift; |
76 | s->rspreg[0] = (response[0] << 24) | (response[1] << 16) | | ||
77 | (response[2] << 8) | response[3]; | ||
78 | s->rspreg[1] = s->rspreg[2] = s->rspreg[3] = 0; | ||
79 | - DPRINT_L1("Response: RSPREG[31..0]=0x%08x\n", s->rspreg[0]); | ||
80 | + trace_sdhci_response4(s->rspreg[0]); | ||
81 | } else if (rlen == 16) { | ||
82 | s->rspreg[0] = (response[11] << 24) | (response[12] << 16) | | ||
83 | (response[13] << 8) | response[14]; | ||
84 | @@ -XXX,XX +XXX,XX @@ static void sdhci_send_command(SDHCIState *s) | ||
85 | (response[5] << 8) | response[6]; | ||
86 | s->rspreg[3] = (response[0] << 16) | (response[1] << 8) | | ||
87 | response[2]; | ||
88 | - DPRINT_L1("Response received:\n RSPREG[127..96]=0x%08x, RSPREG[95.." | ||
89 | - "64]=0x%08x,\n RSPREG[63..32]=0x%08x, RSPREG[31..0]=0x%08x\n", | ||
90 | - s->rspreg[3], s->rspreg[2], s->rspreg[1], s->rspreg[0]); | ||
91 | + trace_sdhci_response16(s->rspreg[3], s->rspreg[2], | ||
92 | + s->rspreg[1], s->rspreg[0]); | ||
93 | } else { | 67 | } else { |
94 | - ERRPRINT("Timeout waiting for command response\n"); | 68 | - val |= def & (0xff << shift); |
95 | + trace_sdhci_error("timeout waiting for command response"); | 69 | + tmp = def & (0xffull << shift); |
96 | if (s->errintstsen & SDHC_EISEN_CMDTIMEOUT) { | 70 | } |
97 | s->errintsts |= SDHC_EIS_CMDTIMEOUT; | 71 | + val |= tmp; |
98 | s->norintsts |= SDHC_NIS_ERR; | ||
99 | @@ -XXX,XX +XXX,XX @@ static void sdhci_end_transfer(SDHCIState *s) | ||
100 | |||
101 | request.cmd = 0x0C; | ||
102 | request.arg = 0; | ||
103 | - DPRINT_L1("Automatically issue CMD%d %08x\n", request.cmd, request.arg); | ||
104 | + trace_sdhci_end_transfer(request.cmd, request.arg); | ||
105 | sdbus_do_command(&s->sdbus, &request, response); | ||
106 | /* Auto CMD12 response goes to the upper Response register */ | ||
107 | s->rspreg[3] = (response[0] << 24) | (response[1] << 16) | | ||
108 | @@ -XXX,XX +XXX,XX @@ static uint32_t sdhci_read_dataport(SDHCIState *s, unsigned size) | ||
109 | |||
110 | /* first check that a valid data exists in host controller input buffer */ | ||
111 | if ((s->prnsts & SDHC_DATA_AVAILABLE) == 0) { | ||
112 | - ERRPRINT("Trying to read from empty buffer\n"); | ||
113 | + trace_sdhci_error("read from empty buffer"); | ||
114 | return 0; | ||
115 | } | 72 | } |
116 | 73 | return val; | |
117 | @@ -XXX,XX +XXX,XX @@ static uint32_t sdhci_read_dataport(SDHCIState *s, unsigned size) | 74 | } |
118 | s->data_count++; | 75 | diff --git a/target/arm/translate-neon.c.inc b/target/arm/translate-neon.c.inc |
119 | /* check if we've read all valid data (blksize bytes) from buffer */ | 76 | index XXXXXXX..XXXXXXX 100644 |
120 | if ((s->data_count) >= (s->blksize & 0x0fff)) { | 77 | --- a/target/arm/translate-neon.c.inc |
121 | - DPRINT_L2("All %u bytes of data have been read from input buffer\n", | 78 | +++ b/target/arm/translate-neon.c.inc |
122 | - s->data_count); | 79 | @@ -XXX,XX +XXX,XX @@ static bool trans_VEXT(DisasContext *s, arg_VEXT *a) |
123 | + trace_sdhci_read_dataport(s->data_count); | 80 | |
124 | s->prnsts &= ~SDHC_DATA_AVAILABLE; /* no more data in a buffer */ | 81 | static bool trans_VTBL(DisasContext *s, arg_VTBL *a) |
125 | s->data_count = 0; /* next buff read must start at position [0] */ | 82 | { |
126 | 83 | - int n; | |
127 | @@ -XXX,XX +XXX,XX @@ static void sdhci_write_dataport(SDHCIState *s, uint32_t value, unsigned size) | 84 | - TCGv_i32 tmp, tmp2, tmp3, tmp4; |
128 | 85 | - TCGv_ptr ptr1; | |
129 | /* Check that there is free space left in a buffer */ | 86 | + TCGv_i64 val, def; |
130 | if (!(s->prnsts & SDHC_SPACE_AVAILABLE)) { | 87 | + TCGv_i32 desc; |
131 | - ERRPRINT("Can't write to data buffer: buffer full\n"); | 88 | |
132 | + trace_sdhci_error("Can't write to data buffer: buffer full"); | 89 | if (!arm_dc_feature(s, ARM_FEATURE_NEON)) { |
133 | return; | 90 | return false; |
91 | @@ -XXX,XX +XXX,XX @@ static bool trans_VTBL(DisasContext *s, arg_VTBL *a) | ||
92 | return true; | ||
134 | } | 93 | } |
135 | 94 | ||
136 | @@ -XXX,XX +XXX,XX @@ static void sdhci_write_dataport(SDHCIState *s, uint32_t value, unsigned size) | 95 | - n = a->len + 1; |
137 | s->data_count++; | 96 | - if ((a->vn + n) > 32) { |
138 | value >>= 8; | 97 | + if ((a->vn + a->len + 1) > 32) { |
139 | if (s->data_count >= (s->blksize & 0x0fff)) { | 98 | /* |
140 | - DPRINT_L2("write buffer filled with %u bytes of data\n", | 99 | * This is UNPREDICTABLE; we choose to UNDEF to avoid the |
141 | - s->data_count); | 100 | * helper function running off the end of the register file. |
142 | + trace_sdhci_write_dataport(s->data_count); | 101 | */ |
143 | s->data_count = 0; | ||
144 | s->prnsts &= ~SDHC_SPACE_AVAILABLE; | ||
145 | if (s->prnsts & SDHC_DOING_WRITE) { | ||
146 | @@ -XXX,XX +XXX,XX @@ static void sdhci_do_adma(SDHCIState *s) | ||
147 | { | ||
148 | unsigned int n, begin, length; | ||
149 | const uint16_t block_size = s->blksize & 0x0fff; | ||
150 | - ADMADescr dscr; | ||
151 | + ADMADescr dscr = {}; | ||
152 | int i; | ||
153 | |||
154 | for (i = 0; i < SDHC_ADMA_DESCS_PER_DELAY; ++i) { | ||
155 | s->admaerr &= ~SDHC_ADMAERR_LENGTH_MISMATCH; | ||
156 | |||
157 | get_adma_description(s, &dscr); | ||
158 | - DPRINT_L2("ADMA loop: addr=" TARGET_FMT_plx ", len=%d, attr=%x\n", | ||
159 | - dscr.addr, dscr.length, dscr.attr); | ||
160 | + trace_sdhci_adma_loop(dscr.addr, dscr.length, dscr.attr); | ||
161 | |||
162 | if ((dscr.attr & SDHC_ADMA_ATTR_VALID) == 0) { | ||
163 | /* Indicate that error occurred in ST_FDS state */ | ||
164 | @@ -XXX,XX +XXX,XX @@ static void sdhci_do_adma(SDHCIState *s) | ||
165 | break; | ||
166 | case SDHC_ADMA_ATTR_ACT_LINK: /* link to next descriptor table */ | ||
167 | s->admasysaddr = dscr.addr; | ||
168 | - DPRINT_L1("ADMA link: admasysaddr=0x%" PRIx64 "\n", | ||
169 | - s->admasysaddr); | ||
170 | + trace_sdhci_adma("link", s->admasysaddr); | ||
171 | break; | ||
172 | default: | ||
173 | s->admasysaddr += dscr.incr; | ||
174 | @@ -XXX,XX +XXX,XX @@ static void sdhci_do_adma(SDHCIState *s) | ||
175 | } | ||
176 | |||
177 | if (dscr.attr & SDHC_ADMA_ATTR_INT) { | ||
178 | - DPRINT_L1("ADMA interrupt: admasysaddr=0x%" PRIx64 "\n", | ||
179 | - s->admasysaddr); | ||
180 | + trace_sdhci_adma("interrupt", s->admasysaddr); | ||
181 | if (s->norintstsen & SDHC_NISEN_DMA) { | ||
182 | s->norintsts |= SDHC_NIS_DMA; | ||
183 | } | ||
184 | @@ -XXX,XX +XXX,XX @@ static void sdhci_do_adma(SDHCIState *s) | ||
185 | /* ADMA transfer terminates if blkcnt == 0 or by END attribute */ | ||
186 | if (((s->trnmod & SDHC_TRNS_BLK_CNT_EN) && | ||
187 | (s->blkcnt == 0)) || (dscr.attr & SDHC_ADMA_ATTR_END)) { | ||
188 | - DPRINT_L2("ADMA transfer completed\n"); | ||
189 | + trace_sdhci_adma_transfer_completed(); | ||
190 | if (length || ((dscr.attr & SDHC_ADMA_ATTR_END) && | ||
191 | (s->trnmod & SDHC_TRNS_BLK_CNT_EN) && | ||
192 | s->blkcnt != 0)) { | ||
193 | - ERRPRINT("SD/MMC host ADMA length mismatch\n"); | ||
194 | + trace_sdhci_error("SD/MMC host ADMA length mismatch"); | ||
195 | s->admaerr |= SDHC_ADMAERR_LENGTH_MISMATCH | | ||
196 | SDHC_ADMAERR_STATE_ST_TFR; | ||
197 | if (s->errintstsen & SDHC_EISEN_ADMAERR) { | ||
198 | - ERRPRINT("Set ADMA error flag\n"); | ||
199 | + trace_sdhci_error("Set ADMA error flag"); | ||
200 | s->errintsts |= SDHC_EIS_ADMAERR; | ||
201 | s->norintsts |= SDHC_NIS_ERR; | ||
202 | } | ||
203 | @@ -XXX,XX +XXX,XX @@ static void sdhci_data_transfer(void *opaque) | ||
204 | break; | ||
205 | case SDHC_CTRL_ADMA1_32: | ||
206 | if (!(s->capareg & SDHC_CAN_DO_ADMA1)) { | ||
207 | - ERRPRINT("ADMA1 not supported\n"); | ||
208 | + trace_sdhci_error("ADMA1 not supported"); | ||
209 | break; | ||
210 | } | ||
211 | |||
212 | @@ -XXX,XX +XXX,XX @@ static void sdhci_data_transfer(void *opaque) | ||
213 | break; | ||
214 | case SDHC_CTRL_ADMA2_32: | ||
215 | if (!(s->capareg & SDHC_CAN_DO_ADMA2)) { | ||
216 | - ERRPRINT("ADMA2 not supported\n"); | ||
217 | + trace_sdhci_error("ADMA2 not supported"); | ||
218 | break; | ||
219 | } | ||
220 | |||
221 | @@ -XXX,XX +XXX,XX @@ static void sdhci_data_transfer(void *opaque) | ||
222 | case SDHC_CTRL_ADMA2_64: | ||
223 | if (!(s->capareg & SDHC_CAN_DO_ADMA2) || | ||
224 | !(s->capareg & SDHC_64_BIT_BUS_SUPPORT)) { | ||
225 | - ERRPRINT("64 bit ADMA not supported\n"); | ||
226 | + trace_sdhci_error("64 bit ADMA not supported"); | ||
227 | break; | ||
228 | } | ||
229 | |||
230 | sdhci_do_adma(s); | ||
231 | break; | ||
232 | default: | ||
233 | - ERRPRINT("Unsupported DMA type\n"); | ||
234 | + trace_sdhci_error("Unsupported DMA type"); | ||
235 | break; | ||
236 | } | ||
237 | } else { | ||
238 | @@ -XXX,XX +XXX,XX @@ static inline bool | ||
239 | sdhci_buff_access_is_sequential(SDHCIState *s, unsigned byte_num) | ||
240 | { | ||
241 | if ((s->data_count & 0x3) != byte_num) { | ||
242 | - ERRPRINT("Non-sequential access to Buffer Data Port register" | ||
243 | - "is prohibited\n"); | ||
244 | + trace_sdhci_error("Non-sequential access to Buffer Data Port register" | ||
245 | + "is prohibited\n"); | ||
246 | return false; | 102 | return false; |
247 | } | 103 | } |
104 | - n <<= 3; | ||
105 | - tmp = tcg_temp_new_i32(); | ||
106 | - if (a->op) { | ||
107 | - read_neon_element32(tmp, a->vd, 0, MO_32); | ||
108 | - } else { | ||
109 | - tcg_gen_movi_i32(tmp, 0); | ||
110 | - } | ||
111 | - tmp2 = tcg_temp_new_i32(); | ||
112 | - read_neon_element32(tmp2, a->vm, 0, MO_32); | ||
113 | - ptr1 = vfp_reg_ptr(true, a->vn); | ||
114 | - tmp4 = tcg_const_i32(n); | ||
115 | - gen_helper_neon_tbl(tmp2, tmp2, tmp, ptr1, tmp4); | ||
116 | |||
117 | + desc = tcg_const_i32((a->vn << 2) | a->len); | ||
118 | + def = tcg_temp_new_i64(); | ||
119 | if (a->op) { | ||
120 | - read_neon_element32(tmp, a->vd, 1, MO_32); | ||
121 | + read_neon_element64(def, a->vd, 0, MO_64); | ||
122 | } else { | ||
123 | - tcg_gen_movi_i32(tmp, 0); | ||
124 | + tcg_gen_movi_i64(def, 0); | ||
125 | } | ||
126 | - tmp3 = tcg_temp_new_i32(); | ||
127 | - read_neon_element32(tmp3, a->vm, 1, MO_32); | ||
128 | - gen_helper_neon_tbl(tmp3, tmp3, tmp, ptr1, tmp4); | ||
129 | - tcg_temp_free_i32(tmp); | ||
130 | - tcg_temp_free_i32(tmp4); | ||
131 | - tcg_temp_free_ptr(ptr1); | ||
132 | + val = tcg_temp_new_i64(); | ||
133 | + read_neon_element64(val, a->vm, 0, MO_64); | ||
134 | |||
135 | - write_neon_element32(tmp2, a->vd, 0, MO_32); | ||
136 | - write_neon_element32(tmp3, a->vd, 1, MO_32); | ||
137 | - tcg_temp_free_i32(tmp2); | ||
138 | - tcg_temp_free_i32(tmp3); | ||
139 | + gen_helper_neon_tbl(val, cpu_env, desc, val, def); | ||
140 | + write_neon_element64(val, a->vd, 0, MO_64); | ||
141 | + | ||
142 | + tcg_temp_free_i64(def); | ||
143 | + tcg_temp_free_i64(val); | ||
144 | + tcg_temp_free_i32(desc); | ||
248 | return true; | 145 | return true; |
249 | @@ -XXX,XX +XXX,XX @@ static uint64_t sdhci_read(void *opaque, hwaddr offset, unsigned size) | ||
250 | case SDHC_BDATA: | ||
251 | if (sdhci_buff_access_is_sequential(s, offset - SDHC_BDATA)) { | ||
252 | ret = sdhci_read_dataport(s, size); | ||
253 | - DPRINT_L2("read %ub: addr[0x%04x] -> %u(0x%x)\n", size, (int)offset, | ||
254 | - ret, ret); | ||
255 | + trace_sdhci_access("rd", size << 3, offset, "->", ret, ret); | ||
256 | return ret; | ||
257 | } | ||
258 | break; | ||
259 | @@ -XXX,XX +XXX,XX @@ static uint64_t sdhci_read(void *opaque, hwaddr offset, unsigned size) | ||
260 | |||
261 | ret >>= (offset & 0x3) * 8; | ||
262 | ret &= (1ULL << (size * 8)) - 1; | ||
263 | - DPRINT_L2("read %ub: addr[0x%04x] -> %u(0x%x)\n", size, (int)offset, ret, ret); | ||
264 | + trace_sdhci_access("rd", size << 3, offset, "->", ret, ret); | ||
265 | return ret; | ||
266 | } | 146 | } |
267 | 147 | ||
268 | @@ -XXX,XX +XXX,XX @@ sdhci_write(void *opaque, hwaddr offset, uint64_t val, unsigned size) | ||
269 | "not implemented\n", size, offset, value >> shift); | ||
270 | break; | ||
271 | } | ||
272 | - DPRINT_L2("write %ub: addr[0x%04x] <- %u(0x%x)\n", | ||
273 | - size, (int)offset, value >> shift, value >> shift); | ||
274 | + trace_sdhci_access("wr", size << 3, offset, "<-", | ||
275 | + value >> shift, value >> shift); | ||
276 | } | ||
277 | |||
278 | static const MemoryRegionOps sdhci_mmio_ops = { | ||
279 | diff --git a/hw/sd/trace-events b/hw/sd/trace-events | ||
280 | index XXXXXXX..XXXXXXX 100644 | ||
281 | --- a/hw/sd/trace-events | ||
282 | +++ b/hw/sd/trace-events | ||
283 | @@ -XXX,XX +XXX,XX @@ | ||
284 | # See docs/devel/tracing.txt for syntax documentation. | ||
285 | |||
286 | +# hw/sd/sdhci.c | ||
287 | +sdhci_set_inserted(const char *level) "card state changed: %s" | ||
288 | +sdhci_send_command(uint8_t cmd, uint32_t arg) "CMD%02u ARG[0x%08x]" | ||
289 | +sdhci_error(const char *msg) "%s" | ||
290 | +sdhci_response4(uint32_t r0) "RSPREG[31..0]=0x%08x" | ||
291 | +sdhci_response16(uint32_t r3, uint32_t r2, uint32_t r1, uint32_t r0) "RSPREG[127..96]=0x%08x, RSPREG[95..64]=0x%08x, RSPREG[63..32]=0x%08x, RSPREG[31..0]=0x%08x" | ||
292 | +sdhci_end_transfer(uint8_t cmd, uint32_t arg) "Automatically issue CMD%02u 0x%08x" | ||
293 | +sdhci_adma(const char *desc, uint32_t sysad) "%s: admasysaddr=0x%" PRIx32 | ||
294 | +sdhci_adma_loop(uint64_t addr, uint16_t length, uint8_t attr) "addr=0x%08" PRIx64 ", len=%d, attr=0x%x" | ||
295 | +sdhci_adma_transfer_completed(void) "" | ||
296 | +sdhci_access(const char *access, unsigned int size, uint64_t offset, const char *dir, uint64_t val, uint64_t val2) "%s%u: addr[0x%04" PRIx64 "] %s 0x%08" PRIx64 " (%" PRIu64 ")" | ||
297 | +sdhci_read_dataport(uint16_t data_count) "all %u bytes of data have been read from input buffer" | ||
298 | +sdhci_write_dataport(uint16_t data_count) "write buffer filled with %u bytes of data" | ||
299 | + | ||
300 | # hw/sd/milkymist-memcard.c | ||
301 | milkymist_memcard_memory_read(uint32_t addr, uint32_t value) "addr 0x%08x value 0x%08x" | ||
302 | milkymist_memcard_memory_write(uint32_t addr, uint32_t value) "addr 0x%08x value 0x%08x" | ||
303 | -- | 148 | -- |
304 | 2.7.4 | 149 | 2.20.1 |
305 | 150 | ||
306 | 151 | diff view generated by jsdifflib |
1 | From: Philippe Mathieu-Daudé <f4bug@amsat.org> | 1 | From: Philippe Mathieu-Daudé <f4bug@amsat.org> |
---|---|---|---|
2 | 2 | ||
3 | We can use one MPC per SRAM bank, but we currently only wire the | ||
4 | IRQ from the first expansion MPC to the IRQ splitter. Fix that. | ||
5 | |||
6 | Fixes: bb75e16d5e6 ("hw/arm/iotkit: Wire up MPC interrupt lines") | ||
3 | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | 7 | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> |
4 | Reviewed-by: Alistair Francis <alistair.francis@xilinx.com> | 8 | Message-id: 20201107193403.436146-2-f4bug@amsat.org |
5 | Message-id: 20180115182436.2066-8-f4bug@amsat.org | 9 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> |
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
7 | --- | 11 | --- |
8 | hw/sd/sdhci.c | 7 ++++--- | 12 | hw/arm/armsse.c | 3 ++- |
9 | 1 file changed, 4 insertions(+), 3 deletions(-) | 13 | 1 file changed, 2 insertions(+), 1 deletion(-) |
10 | 14 | ||
11 | diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c | 15 | diff --git a/hw/arm/armsse.c b/hw/arm/armsse.c |
12 | index XXXXXXX..XXXXXXX 100644 | 16 | index XXXXXXX..XXXXXXX 100644 |
13 | --- a/hw/sd/sdhci.c | 17 | --- a/hw/arm/armsse.c |
14 | +++ b/hw/sd/sdhci.c | 18 | +++ b/hw/arm/armsse.c |
15 | @@ -XXX,XX +XXX,XX @@ static uint64_t sdhci_read(void *opaque, hwaddr offset, unsigned size) | 19 | @@ -XXX,XX +XXX,XX @@ static void armsse_realize(DeviceState *dev, Error **errp) |
16 | ret = (SD_HOST_SPECv2_VERS << 16) | sdhci_slotint(s); | 20 | qdev_get_gpio_in(dev_splitter, 0)); |
17 | break; | 21 | qdev_connect_gpio_out(dev_splitter, 0, |
18 | default: | 22 | qdev_get_gpio_in_named(dev_secctl, |
19 | - ERRPRINT("bad %ub read: addr[0x%04x]\n", size, (int)offset); | 23 | - "mpc_status", 0)); |
20 | + qemu_log_mask(LOG_UNIMP, "SDHC rd_%ub @0x%02" HWADDR_PRIx " " | 24 | + "mpc_status", |
21 | + "not implemented\n", size, offset); | 25 | + i - IOTS_NUM_EXP_MPC)); |
22 | break; | 26 | } |
23 | } | 27 | |
24 | 28 | qdev_connect_gpio_out(dev_splitter, 1, | |
25 | @@ -XXX,XX +XXX,XX @@ sdhci_write(void *opaque, hwaddr offset, uint64_t val, unsigned size) | ||
26 | sdhci_update_irq(s); | ||
27 | break; | ||
28 | default: | ||
29 | - ERRPRINT("bad %ub write offset: addr[0x%04x] <- %u(0x%x)\n", | ||
30 | - size, (int)offset, value >> shift, value >> shift); | ||
31 | + qemu_log_mask(LOG_UNIMP, "SDHC wr_%ub @0x%02" HWADDR_PRIx " <- 0x%08x " | ||
32 | + "not implemented\n", size, offset, value >> shift); | ||
33 | break; | ||
34 | } | ||
35 | DPRINT_L2("write %ub: addr[0x%04x] <- %u(0x%x)\n", | ||
36 | -- | 29 | -- |
37 | 2.7.4 | 30 | 2.20.1 |
38 | 31 | ||
39 | 32 | diff view generated by jsdifflib |
1 | From: Philippe Mathieu-Daudé <f4bug@amsat.org> | 1 | From: Philippe Mathieu-Daudé <f4bug@amsat.org> |
---|---|---|---|
2 | 2 | ||
3 | The system configuration controller (SYSCFG) doesn't have | ||
4 | any output IRQ (and the INTC input #71 belongs to the UART6). | ||
5 | Remove the invalid code. | ||
6 | |||
7 | Fixes: db635521a02 ("stm32f205: Add the stm32f205 SoC") | ||
3 | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | 8 | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> |
4 | Reviewed-by: Alistair Francis <alistair.francis@xilinx.com> | 9 | Message-id: 20201107193403.436146-3-f4bug@amsat.org |
5 | Message-id: 20180115182436.2066-2-f4bug@amsat.org | 10 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> |
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 11 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
7 | --- | 12 | --- |
8 | hw/sd/sdhci-internal.h | 4 ---- | 13 | include/hw/misc/stm32f2xx_syscfg.h | 2 -- |
9 | include/hw/sd/sdhci.h | 7 ++++++- | 14 | hw/arm/stm32f205_soc.c | 1 - |
10 | hw/sd/sdhci.c | 1 + | 15 | hw/misc/stm32f2xx_syscfg.c | 2 -- |
11 | 3 files changed, 7 insertions(+), 5 deletions(-) | 16 | 3 files changed, 5 deletions(-) |
12 | 17 | ||
13 | diff --git a/hw/sd/sdhci-internal.h b/hw/sd/sdhci-internal.h | 18 | diff --git a/include/hw/misc/stm32f2xx_syscfg.h b/include/hw/misc/stm32f2xx_syscfg.h |
14 | index XXXXXXX..XXXXXXX 100644 | 19 | index XXXXXXX..XXXXXXX 100644 |
15 | --- a/hw/sd/sdhci-internal.h | 20 | --- a/include/hw/misc/stm32f2xx_syscfg.h |
16 | +++ b/hw/sd/sdhci-internal.h | 21 | +++ b/include/hw/misc/stm32f2xx_syscfg.h |
17 | @@ -XXX,XX +XXX,XX @@ | 22 | @@ -XXX,XX +XXX,XX @@ struct STM32F2XXSyscfgState { |
18 | #ifndef SDHCI_INTERNAL_H | 23 | uint32_t syscfg_exticr3; |
19 | #define SDHCI_INTERNAL_H | 24 | uint32_t syscfg_exticr4; |
20 | 25 | uint32_t syscfg_cmpcr; | |
21 | -#include "hw/sd/sdhci.h" | ||
22 | - | 26 | - |
23 | /* R/W SDMA System Address register 0x0 */ | 27 | - qemu_irq irq; |
24 | #define SDHC_SYSAD 0x00 | ||
25 | |||
26 | @@ -XXX,XX +XXX,XX @@ enum { | ||
27 | sdhc_gap_write = 2 /* SDHC stopped at block gap during write operation */ | ||
28 | }; | 28 | }; |
29 | 29 | ||
30 | -extern const VMStateDescription sdhci_vmstate; | 30 | #endif /* HW_STM32F2XX_SYSCFG_H */ |
31 | diff --git a/hw/arm/stm32f205_soc.c b/hw/arm/stm32f205_soc.c | ||
32 | index XXXXXXX..XXXXXXX 100644 | ||
33 | --- a/hw/arm/stm32f205_soc.c | ||
34 | +++ b/hw/arm/stm32f205_soc.c | ||
35 | @@ -XXX,XX +XXX,XX @@ static void stm32f205_soc_realize(DeviceState *dev_soc, Error **errp) | ||
36 | } | ||
37 | busdev = SYS_BUS_DEVICE(dev); | ||
38 | sysbus_mmio_map(busdev, 0, 0x40013800); | ||
39 | - sysbus_connect_irq(busdev, 0, qdev_get_gpio_in(armv7m, 71)); | ||
40 | |||
41 | /* Attach UART (uses USART registers) and USART controllers */ | ||
42 | for (i = 0; i < STM_NUM_USARTS; i++) { | ||
43 | diff --git a/hw/misc/stm32f2xx_syscfg.c b/hw/misc/stm32f2xx_syscfg.c | ||
44 | index XXXXXXX..XXXXXXX 100644 | ||
45 | --- a/hw/misc/stm32f2xx_syscfg.c | ||
46 | +++ b/hw/misc/stm32f2xx_syscfg.c | ||
47 | @@ -XXX,XX +XXX,XX @@ static void stm32f2xx_syscfg_init(Object *obj) | ||
48 | { | ||
49 | STM32F2XXSyscfgState *s = STM32F2XX_SYSCFG(obj); | ||
50 | |||
51 | - sysbus_init_irq(SYS_BUS_DEVICE(obj), &s->irq); | ||
31 | - | 52 | - |
32 | #endif | 53 | memory_region_init_io(&s->mmio, obj, &stm32f2xx_syscfg_ops, s, |
33 | diff --git a/include/hw/sd/sdhci.h b/include/hw/sd/sdhci.h | 54 | TYPE_STM32F2XX_SYSCFG, 0x400); |
34 | index XXXXXXX..XXXXXXX 100644 | 55 | sysbus_init_mmio(SYS_BUS_DEVICE(obj), &s->mmio); |
35 | --- a/include/hw/sd/sdhci.h | ||
36 | +++ b/include/hw/sd/sdhci.h | ||
37 | @@ -XXX,XX +XXX,XX @@ | ||
38 | #define SDHCI_H | ||
39 | |||
40 | #include "qemu-common.h" | ||
41 | -#include "hw/block/block.h" | ||
42 | #include "hw/pci/pci.h" | ||
43 | #include "hw/sysbus.h" | ||
44 | #include "hw/sd/sd.h" | ||
45 | |||
46 | /* SD/MMC host controller state */ | ||
47 | typedef struct SDHCIState { | ||
48 | + /*< private >*/ | ||
49 | union { | ||
50 | PCIDevice pcidev; | ||
51 | SysBusDevice busdev; | ||
52 | }; | ||
53 | + | ||
54 | + /*< public >*/ | ||
55 | SDBus sdbus; | ||
56 | MemoryRegion iomem; | ||
57 | |||
58 | @@ -XXX,XX +XXX,XX @@ typedef struct SDHCIState { | ||
59 | qemu_irq ro_cb; | ||
60 | qemu_irq irq; | ||
61 | |||
62 | + /* Registers cleared on reset */ | ||
63 | uint32_t sdmasysad; /* SDMA System Address register */ | ||
64 | uint16_t blksize; /* Host DMA Buff Boundary and Transfer BlkSize Reg */ | ||
65 | uint16_t blkcnt; /* Blocks count for current transfer */ | ||
66 | @@ -XXX,XX +XXX,XX @@ typedef struct SDHCIState { | ||
67 | uint16_t acmd12errsts; /* Auto CMD12 error status register */ | ||
68 | uint64_t admasysaddr; /* ADMA System Address Register */ | ||
69 | |||
70 | + /* Read-only registers */ | ||
71 | uint32_t capareg; /* Capabilities Register */ | ||
72 | uint32_t maxcurr; /* Maximum Current Capabilities Register */ | ||
73 | + | ||
74 | uint8_t *fifo_buffer; /* SD host i/o FIFO buffer */ | ||
75 | uint32_t buf_maxsz; | ||
76 | uint16_t data_count; /* current element in FIFO buffer */ | ||
77 | diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c | ||
78 | index XXXXXXX..XXXXXXX 100644 | ||
79 | --- a/hw/sd/sdhci.c | ||
80 | +++ b/hw/sd/sdhci.c | ||
81 | @@ -XXX,XX +XXX,XX @@ | ||
82 | #include "sysemu/dma.h" | ||
83 | #include "qemu/timer.h" | ||
84 | #include "qemu/bitops.h" | ||
85 | +#include "hw/sd/sdhci.h" | ||
86 | #include "sdhci-internal.h" | ||
87 | #include "qemu/log.h" | ||
88 | |||
89 | -- | 56 | -- |
90 | 2.7.4 | 57 | 2.20.1 |
91 | 58 | ||
92 | 59 | diff view generated by jsdifflib |
1 | From: Philippe Mathieu-Daudé <f4bug@amsat.org> | 1 | From: Philippe Mathieu-Daudé <f4bug@amsat.org> |
---|---|---|---|
2 | 2 | ||
3 | Now both inherited classes appear as DEVICE_CATEGORY_STORAGE. | 3 | omap2420_mpu_init() introduced in commit 827df9f3c5f ("Add basic |
4 | OMAP2 chip support") takes care of creating the 3 UARTs. | ||
5 | |||
6 | Then commit 58a26b477e9 ("Emulate a serial bluetooth HCI with H4+ | ||
7 | extensions and attach to n8x0's UART") added n8x0_uart_setup() | ||
8 | which create the UART and connects it to an IRQ output, | ||
9 | overwritting the existing peripheral and its IRQ connection. | ||
10 | This is incorrect. | ||
11 | |||
12 | Fortunately we don't need to fix this, because commit 6da68df7f9b | ||
13 | ("hw/arm/nseries: Replace the bluetooth chardev with a "null" | ||
14 | chardev") removed the use of this peripheral. We can simply | ||
15 | remove the code. | ||
4 | 16 | ||
5 | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | 17 | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> |
6 | Reviewed-by: Alistair Francis <alistair.francis@xilinx.com> | 18 | Message-id: 20201107193403.436146-4-f4bug@amsat.org |
7 | Message-id: 20180115182436.2066-5-f4bug@amsat.org | 19 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> |
8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 20 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
9 | --- | 21 | --- |
10 | hw/sd/sdhci.c | 18 +++++++++++++----- | 22 | hw/arm/nseries.c | 11 ----------- |
11 | 1 file changed, 13 insertions(+), 5 deletions(-) | 23 | 1 file changed, 11 deletions(-) |
12 | 24 | ||
13 | diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c | 25 | diff --git a/hw/arm/nseries.c b/hw/arm/nseries.c |
14 | index XXXXXXX..XXXXXXX 100644 | 26 | index XXXXXXX..XXXXXXX 100644 |
15 | --- a/hw/sd/sdhci.c | 27 | --- a/hw/arm/nseries.c |
16 | +++ b/hw/sd/sdhci.c | 28 | +++ b/hw/arm/nseries.c |
17 | @@ -XXX,XX +XXX,XX @@ const VMStateDescription sdhci_vmstate = { | 29 | @@ -XXX,XX +XXX,XX @@ static void n8x0_cbus_setup(struct n800_s *s) |
18 | }, | 30 | cbus_attach(cbus, s->tahvo = tahvo_init(tahvo_irq, 1)); |
19 | }; | ||
20 | |||
21 | +static void sdhci_common_class_init(ObjectClass *klass, void *data) | ||
22 | +{ | ||
23 | + DeviceClass *dc = DEVICE_CLASS(klass); | ||
24 | + | ||
25 | + set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); | ||
26 | + dc->vmsd = &sdhci_vmstate; | ||
27 | + dc->reset = sdhci_poweron_reset; | ||
28 | +} | ||
29 | + | ||
30 | /* --- qdev PCI --- */ | ||
31 | |||
32 | static Property sdhci_pci_properties[] = { | ||
33 | @@ -XXX,XX +XXX,XX @@ static void sdhci_pci_class_init(ObjectClass *klass, void *data) | ||
34 | k->vendor_id = PCI_VENDOR_ID_REDHAT; | ||
35 | k->device_id = PCI_DEVICE_ID_REDHAT_SDHCI; | ||
36 | k->class_id = PCI_CLASS_SYSTEM_SDHCI; | ||
37 | - set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); | ||
38 | - dc->vmsd = &sdhci_vmstate; | ||
39 | dc->props = sdhci_pci_properties; | ||
40 | - dc->reset = sdhci_poweron_reset; | ||
41 | + | ||
42 | + sdhci_common_class_init(klass, data); | ||
43 | } | 31 | } |
44 | 32 | ||
45 | static const TypeInfo sdhci_pci_info = { | 33 | -static void n8x0_uart_setup(struct n800_s *s) |
46 | @@ -XXX,XX +XXX,XX @@ static void sdhci_sysbus_class_init(ObjectClass *klass, void *data) | 34 | -{ |
35 | - Chardev *radio = qemu_chr_new("bt-dummy-uart", "null", NULL); | ||
36 | - /* | ||
37 | - * Note: We used to connect N8X0_BT_RESET_GPIO and N8X0_BT_WKUP_GPIO | ||
38 | - * here, but this code has been removed with the bluetooth backend. | ||
39 | - */ | ||
40 | - omap_uart_attach(s->mpu->uart[BT_UART], radio); | ||
41 | -} | ||
42 | - | ||
43 | static void n8x0_usb_setup(struct n800_s *s) | ||
47 | { | 44 | { |
48 | DeviceClass *dc = DEVICE_CLASS(klass); | 45 | SysBusDevice *dev; |
49 | 46 | @@ -XXX,XX +XXX,XX @@ static void n8x0_init(MachineState *machine, | |
50 | - dc->vmsd = &sdhci_vmstate; | 47 | n8x0_spi_setup(s); |
51 | dc->props = sdhci_sysbus_properties; | 48 | n8x0_dss_setup(s); |
52 | dc->realize = sdhci_sysbus_realize; | 49 | n8x0_cbus_setup(s); |
53 | - dc->reset = sdhci_poweron_reset; | 50 | - n8x0_uart_setup(s); |
54 | + | 51 | if (machine_usb(machine)) { |
55 | + sdhci_common_class_init(klass, data); | 52 | n8x0_usb_setup(s); |
56 | } | 53 | } |
57 | |||
58 | static const TypeInfo sdhci_sysbus_info = { | ||
59 | -- | 54 | -- |
60 | 2.7.4 | 55 | 2.20.1 |
61 | 56 | ||
62 | 57 | diff view generated by jsdifflib |
1 | From: Philippe Mathieu-Daudé <f4bug@amsat.org> | 1 | From: Philippe Mathieu-Daudé <f4bug@amsat.org> |
---|---|---|---|
2 | 2 | ||
3 | The MusicPal board code connects both of the IRQ outputs of the UART | ||
4 | to the same INTC qemu_irq. Connecting two qemu_irqs outputs directly | ||
5 | to the same input is not valid as it produces subtly wrong behaviour | ||
6 | (for instance if both the IRQ lines are high, and then one goes | ||
7 | low, the INTC input will see this as a high-to-low transition | ||
8 | even though the second IRQ line should still be holding it high). | ||
9 | |||
10 | This kind of wiring needs an explicitly created OR gate; add one. | ||
11 | |||
12 | Inspired-by: Peter Maydell <peter.maydell@linaro.org> | ||
3 | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | 13 | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> |
4 | Reviewed-by: Alistair Francis <alistair.francis@xilinx.com> | 14 | Message-id: 20201107193403.436146-5-f4bug@amsat.org |
5 | Message-id: 20180115182436.2066-7-f4bug@amsat.org | 15 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> |
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 16 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
7 | --- | 17 | --- |
8 | hw/sd/sdhci.c | 22 ++++++++++++++++++++++ | 18 | hw/arm/musicpal.c | 17 +++++++++++++---- |
9 | 1 file changed, 22 insertions(+) | 19 | hw/arm/Kconfig | 1 + |
20 | 2 files changed, 14 insertions(+), 4 deletions(-) | ||
10 | 21 | ||
11 | diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c | 22 | diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c |
12 | index XXXXXXX..XXXXXXX 100644 | 23 | index XXXXXXX..XXXXXXX 100644 |
13 | --- a/hw/sd/sdhci.c | 24 | --- a/hw/arm/musicpal.c |
14 | +++ b/hw/sd/sdhci.c | 25 | +++ b/hw/arm/musicpal.c |
15 | @@ -XXX,XX +XXX,XX @@ | 26 | @@ -XXX,XX +XXX,XX @@ |
16 | #include "qemu/bitops.h" | 27 | #include "ui/console.h" |
17 | #include "hw/sd/sdhci.h" | 28 | #include "hw/i2c/i2c.h" |
18 | #include "sdhci-internal.h" | 29 | #include "hw/irq.h" |
19 | +#include "qapi/error.h" | 30 | +#include "hw/or-irq.h" |
20 | #include "qemu/log.h" | 31 | #include "hw/audio/wm8750.h" |
21 | 32 | #include "sysemu/block-backend.h" | |
22 | /* host controller debug messages */ | 33 | #include "sysemu/runstate.h" |
23 | @@ -XXX,XX +XXX,XX @@ static void sdhci_common_realize(SDHCIState *s, Error **errp) | 34 | @@ -XXX,XX +XXX,XX @@ |
24 | SDHC_REGISTERS_MAP_SIZE); | 35 | #define MP_TIMER4_IRQ 7 |
25 | } | 36 | #define MP_EHCI_IRQ 8 |
26 | 37 | #define MP_ETH_IRQ 9 | |
27 | +static void sdhci_common_unrealize(SDHCIState *s, Error **errp) | 38 | -#define MP_UART1_IRQ 11 |
28 | +{ | 39 | -#define MP_UART2_IRQ 11 |
29 | + /* This function is expected to be called only once for each class: | 40 | +#define MP_UART_SHARED_IRQ 11 |
30 | + * - SysBus: via DeviceClass->unrealize(), | 41 | #define MP_GPIO_IRQ 12 |
31 | + * - PCI: via PCIDeviceClass->exit(). | 42 | #define MP_RTC_IRQ 28 |
32 | + * However to avoid double-free and/or use-after-free we still nullify | 43 | #define MP_AUDIO_IRQ 30 |
33 | + * this variable (better safe than sorry!). */ | 44 | @@ -XXX,XX +XXX,XX @@ static void musicpal_init(MachineState *machine) |
34 | + g_free(s->fifo_buffer); | 45 | ARMCPU *cpu; |
35 | + s->fifo_buffer = NULL; | 46 | qemu_irq pic[32]; |
36 | +} | 47 | DeviceState *dev; |
48 | + DeviceState *uart_orgate; | ||
49 | DeviceState *i2c_dev; | ||
50 | DeviceState *lcd_dev; | ||
51 | DeviceState *key_dev; | ||
52 | @@ -XXX,XX +XXX,XX @@ static void musicpal_init(MachineState *machine) | ||
53 | pic[MP_TIMER2_IRQ], pic[MP_TIMER3_IRQ], | ||
54 | pic[MP_TIMER4_IRQ], NULL); | ||
55 | |||
56 | - serial_mm_init(address_space_mem, MP_UART1_BASE, 2, pic[MP_UART1_IRQ], | ||
57 | + /* Logically OR both UART IRQs together */ | ||
58 | + uart_orgate = DEVICE(object_new(TYPE_OR_IRQ)); | ||
59 | + object_property_set_int(OBJECT(uart_orgate), "num-lines", 2, &error_fatal); | ||
60 | + qdev_realize_and_unref(uart_orgate, NULL, &error_fatal); | ||
61 | + qdev_connect_gpio_out(DEVICE(uart_orgate), 0, pic[MP_UART_SHARED_IRQ]); | ||
37 | + | 62 | + |
38 | static bool sdhci_pending_insert_vmstate_needed(void *opaque) | 63 | + serial_mm_init(address_space_mem, MP_UART1_BASE, 2, |
39 | { | 64 | + qdev_get_gpio_in(uart_orgate, 0), |
40 | SDHCIState *s = opaque; | 65 | 1825000, serial_hd(0), DEVICE_NATIVE_ENDIAN); |
41 | @@ -XXX,XX +XXX,XX @@ static void sdhci_pci_realize(PCIDevice *dev, Error **errp) | 66 | - serial_mm_init(address_space_mem, MP_UART2_BASE, 2, pic[MP_UART2_IRQ], |
42 | static void sdhci_pci_exit(PCIDevice *dev) | 67 | + serial_mm_init(address_space_mem, MP_UART2_BASE, 2, |
43 | { | 68 | + qdev_get_gpio_in(uart_orgate, 1), |
44 | SDHCIState *s = PCI_SDHCI(dev); | 69 | 1825000, serial_hd(1), DEVICE_NATIVE_ENDIAN); |
45 | + | 70 | |
46 | + sdhci_common_unrealize(s, &error_abort); | 71 | /* Register flash */ |
47 | sdhci_uninitfn(s); | 72 | diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig |
48 | } | 73 | index XXXXXXX..XXXXXXX 100644 |
49 | 74 | --- a/hw/arm/Kconfig | |
50 | @@ -XXX,XX +XXX,XX @@ static void sdhci_sysbus_realize(DeviceState *dev, Error ** errp) | 75 | +++ b/hw/arm/Kconfig |
51 | sysbus_init_mmio(sbd, &s->iomem); | 76 | @@ -XXX,XX +XXX,XX @@ config MUSCA |
52 | } | 77 | |
53 | 78 | config MUSICPAL | |
54 | +static void sdhci_sysbus_unrealize(DeviceState *dev, Error **errp) | 79 | bool |
55 | +{ | 80 | + select OR_IRQ |
56 | + SDHCIState *s = SYSBUS_SDHCI(dev); | 81 | select BITBANG_I2C |
57 | + | 82 | select MARVELL_88W8618 |
58 | + sdhci_common_unrealize(s, &error_abort); | 83 | select PTIMER |
59 | +} | ||
60 | + | ||
61 | static void sdhci_sysbus_class_init(ObjectClass *klass, void *data) | ||
62 | { | ||
63 | DeviceClass *dc = DEVICE_CLASS(klass); | ||
64 | |||
65 | dc->props = sdhci_sysbus_properties; | ||
66 | dc->realize = sdhci_sysbus_realize; | ||
67 | + dc->unrealize = sdhci_sysbus_unrealize; | ||
68 | |||
69 | sdhci_common_class_init(klass, data); | ||
70 | } | ||
71 | -- | 84 | -- |
72 | 2.7.4 | 85 | 2.20.1 |
73 | 86 | ||
74 | 87 | diff view generated by jsdifflib |
1 | From: Philippe Mathieu-Daudé <f4bug@amsat.org> | 1 | From: Philippe Mathieu-Daudé <f4bug@amsat.org> |
---|---|---|---|
2 | 2 | ||
3 | running qtests: | 3 | We don't need to fill the full pic[] array if we only use |
4 | 4 | few of the interrupt lines. Directly call qdev_get_gpio_in() | |
5 | $ make check-qtest-arm | 5 | when necessary. |
6 | GTESTER check-qtest-arm | ||
7 | SDHC rd_4b @0x44 not implemented | ||
8 | SDHC wr_4b @0x40 <- 0x89abcdef not implemented | ||
9 | SDHC wr_4b @0x44 <- 0x01234567 not implemented | ||
10 | 6 | ||
11 | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | 7 | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> |
12 | Reviewed-by: Alistair Francis <alistair.francis@xilinx.com> | 8 | Message-id: 20201107193403.436146-6-f4bug@amsat.org |
13 | Message-id: 20180115182436.2066-12-f4bug@amsat.org | 9 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> |
14 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
15 | --- | 11 | --- |
16 | include/hw/sd/sdhci.h | 4 ++-- | 12 | hw/arm/musicpal.c | 25 +++++++++++++------------ |
17 | hw/sd/sdhci.c | 23 +++++++++++++++++++---- | 13 | 1 file changed, 13 insertions(+), 12 deletions(-) |
18 | 2 files changed, 21 insertions(+), 6 deletions(-) | ||
19 | 14 | ||
20 | diff --git a/include/hw/sd/sdhci.h b/include/hw/sd/sdhci.h | 15 | diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c |
21 | index XXXXXXX..XXXXXXX 100644 | 16 | index XXXXXXX..XXXXXXX 100644 |
22 | --- a/include/hw/sd/sdhci.h | 17 | --- a/hw/arm/musicpal.c |
23 | +++ b/include/hw/sd/sdhci.h | 18 | +++ b/hw/arm/musicpal.c |
24 | @@ -XXX,XX +XXX,XX @@ typedef struct SDHCIState { | 19 | @@ -XXX,XX +XXX,XX @@ static struct arm_boot_info musicpal_binfo = { |
25 | uint64_t admasysaddr; /* ADMA System Address Register */ | 20 | static void musicpal_init(MachineState *machine) |
26 | |||
27 | /* Read-only registers */ | ||
28 | - uint32_t capareg; /* Capabilities Register */ | ||
29 | - uint32_t maxcurr; /* Maximum Current Capabilities Register */ | ||
30 | + uint64_t capareg; /* Capabilities Register */ | ||
31 | + uint64_t maxcurr; /* Maximum Current Capabilities Register */ | ||
32 | |||
33 | uint8_t *fifo_buffer; /* SD host i/o FIFO buffer */ | ||
34 | uint32_t buf_maxsz; | ||
35 | diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c | ||
36 | index XXXXXXX..XXXXXXX 100644 | ||
37 | --- a/hw/sd/sdhci.c | ||
38 | +++ b/hw/sd/sdhci.c | ||
39 | @@ -XXX,XX +XXX,XX @@ static uint64_t sdhci_read(void *opaque, hwaddr offset, unsigned size) | ||
40 | ret = s->acmd12errsts; | ||
41 | break; | ||
42 | case SDHC_CAPAB: | ||
43 | - ret = s->capareg; | ||
44 | + ret = (uint32_t)s->capareg; | ||
45 | + break; | ||
46 | + case SDHC_CAPAB + 4: | ||
47 | + ret = (uint32_t)(s->capareg >> 32); | ||
48 | break; | ||
49 | case SDHC_MAXCURR: | ||
50 | - ret = s->maxcurr; | ||
51 | + ret = (uint32_t)s->maxcurr; | ||
52 | + break; | ||
53 | + case SDHC_MAXCURR + 4: | ||
54 | + ret = (uint32_t)(s->maxcurr >> 32); | ||
55 | break; | ||
56 | case SDHC_ADMAERR: | ||
57 | ret = s->admaerr; | ||
58 | @@ -XXX,XX +XXX,XX @@ sdhci_write(void *opaque, hwaddr offset, uint64_t val, unsigned size) | ||
59 | } | ||
60 | sdhci_update_irq(s); | ||
61 | break; | ||
62 | + | ||
63 | + case SDHC_CAPAB: | ||
64 | + case SDHC_CAPAB + 4: | ||
65 | + case SDHC_MAXCURR: | ||
66 | + case SDHC_MAXCURR + 4: | ||
67 | + qemu_log_mask(LOG_GUEST_ERROR, "SDHC wr_%ub @0x%02" HWADDR_PRIx | ||
68 | + " <- 0x%08x read-only\n", size, offset, value >> shift); | ||
69 | + break; | ||
70 | + | ||
71 | default: | ||
72 | qemu_log_mask(LOG_UNIMP, "SDHC wr_%ub @0x%02" HWADDR_PRIx " <- 0x%08x " | ||
73 | "not implemented\n", size, offset, value >> shift); | ||
74 | @@ -XXX,XX +XXX,XX @@ static inline unsigned int sdhci_get_fifolen(SDHCIState *s) | ||
75 | #define DEFINE_SDHCI_COMMON_PROPERTIES(_state) \ | ||
76 | /* Capabilities registers provide information on supported features | ||
77 | * of this specific host controller implementation */ \ | ||
78 | - DEFINE_PROP_UINT32("capareg", _state, capareg, SDHC_CAPAB_REG_DEFAULT), \ | ||
79 | - DEFINE_PROP_UINT32("maxcurr", _state, maxcurr, 0) | ||
80 | + DEFINE_PROP_UINT64("capareg", _state, capareg, SDHC_CAPAB_REG_DEFAULT), \ | ||
81 | + DEFINE_PROP_UINT64("maxcurr", _state, maxcurr, 0) | ||
82 | |||
83 | static void sdhci_initfn(SDHCIState *s) | ||
84 | { | 21 | { |
22 | ARMCPU *cpu; | ||
23 | - qemu_irq pic[32]; | ||
24 | DeviceState *dev; | ||
25 | + DeviceState *pic; | ||
26 | DeviceState *uart_orgate; | ||
27 | DeviceState *i2c_dev; | ||
28 | DeviceState *lcd_dev; | ||
29 | @@ -XXX,XX +XXX,XX @@ static void musicpal_init(MachineState *machine) | ||
30 | &error_fatal); | ||
31 | memory_region_add_subregion(address_space_mem, MP_SRAM_BASE, sram); | ||
32 | |||
33 | - dev = sysbus_create_simple(TYPE_MV88W8618_PIC, MP_PIC_BASE, | ||
34 | + pic = sysbus_create_simple(TYPE_MV88W8618_PIC, MP_PIC_BASE, | ||
35 | qdev_get_gpio_in(DEVICE(cpu), ARM_CPU_IRQ)); | ||
36 | - for (i = 0; i < 32; i++) { | ||
37 | - pic[i] = qdev_get_gpio_in(dev, i); | ||
38 | - } | ||
39 | - sysbus_create_varargs(TYPE_MV88W8618_PIT, MP_PIT_BASE, pic[MP_TIMER1_IRQ], | ||
40 | - pic[MP_TIMER2_IRQ], pic[MP_TIMER3_IRQ], | ||
41 | - pic[MP_TIMER4_IRQ], NULL); | ||
42 | + sysbus_create_varargs(TYPE_MV88W8618_PIT, MP_PIT_BASE, | ||
43 | + qdev_get_gpio_in(pic, MP_TIMER1_IRQ), | ||
44 | + qdev_get_gpio_in(pic, MP_TIMER2_IRQ), | ||
45 | + qdev_get_gpio_in(pic, MP_TIMER3_IRQ), | ||
46 | + qdev_get_gpio_in(pic, MP_TIMER4_IRQ), NULL); | ||
47 | |||
48 | /* Logically OR both UART IRQs together */ | ||
49 | uart_orgate = DEVICE(object_new(TYPE_OR_IRQ)); | ||
50 | object_property_set_int(OBJECT(uart_orgate), "num-lines", 2, &error_fatal); | ||
51 | qdev_realize_and_unref(uart_orgate, NULL, &error_fatal); | ||
52 | - qdev_connect_gpio_out(DEVICE(uart_orgate), 0, pic[MP_UART_SHARED_IRQ]); | ||
53 | + qdev_connect_gpio_out(DEVICE(uart_orgate), 0, | ||
54 | + qdev_get_gpio_in(pic, MP_UART_SHARED_IRQ)); | ||
55 | |||
56 | serial_mm_init(address_space_mem, MP_UART1_BASE, 2, | ||
57 | qdev_get_gpio_in(uart_orgate, 0), | ||
58 | @@ -XXX,XX +XXX,XX @@ static void musicpal_init(MachineState *machine) | ||
59 | OBJECT(get_system_memory()), &error_fatal); | ||
60 | sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); | ||
61 | sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, MP_ETH_BASE); | ||
62 | - sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, pic[MP_ETH_IRQ]); | ||
63 | + sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, | ||
64 | + qdev_get_gpio_in(pic, MP_ETH_IRQ)); | ||
65 | |||
66 | sysbus_create_simple("mv88w8618_wlan", MP_WLAN_BASE, NULL); | ||
67 | |||
68 | sysbus_create_simple(TYPE_MUSICPAL_MISC, MP_MISC_BASE, NULL); | ||
69 | |||
70 | dev = sysbus_create_simple(TYPE_MUSICPAL_GPIO, MP_GPIO_BASE, | ||
71 | - pic[MP_GPIO_IRQ]); | ||
72 | + qdev_get_gpio_in(pic, MP_GPIO_IRQ)); | ||
73 | i2c_dev = sysbus_create_simple("gpio_i2c", -1, NULL); | ||
74 | i2c = (I2CBus *)qdev_get_child_bus(i2c_dev, "i2c"); | ||
75 | |||
76 | @@ -XXX,XX +XXX,XX @@ static void musicpal_init(MachineState *machine) | ||
77 | NULL); | ||
78 | sysbus_realize_and_unref(s, &error_fatal); | ||
79 | sysbus_mmio_map(s, 0, MP_AUDIO_BASE); | ||
80 | - sysbus_connect_irq(s, 0, pic[MP_AUDIO_IRQ]); | ||
81 | + sysbus_connect_irq(s, 0, qdev_get_gpio_in(pic, MP_AUDIO_IRQ)); | ||
82 | |||
83 | musicpal_binfo.ram_size = MP_RAM_DEFAULT_SIZE; | ||
84 | arm_load_kernel(cpu, machine, &musicpal_binfo); | ||
85 | -- | 85 | -- |
86 | 2.7.4 | 86 | 2.20.1 |
87 | 87 | ||
88 | 88 | diff view generated by jsdifflib |
1 | For PMSAv7, the v7A/R Arm ARM defines that setting AP to 0b111 | 1 | The nseries machines have a codepath that allows them to load a |
---|---|---|---|
2 | is an UNPREDICTABLE reserved combination. However, for v7M | 2 | secondary bootloader. This code wasn't checking that the |
3 | this value is documented as having the same behaviour as 0b110: | 3 | load_image_targphys() succeeded. Check the return value and report |
4 | read-only for both privileged and unprivileged. Accept this | 4 | the error to the user. |
5 | value on an M profile core rather than treating it as a guest | ||
6 | error and a no-access page. | ||
7 | 5 | ||
8 | Reported-by: Andy Gross <andy.gross@linaro.org> | 6 | While we're in the vicinity, fix the comment style of the |
7 | comment documenting what this image load is doing. | ||
8 | |||
9 | Fixes: Coverity CID 1192904 | ||
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
10 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | 11 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> |
11 | Message-id: 1512742402-31669-1-git-send-email-peter.maydell@linaro.org | 12 | Message-id: 20201103114918.11807-1-peter.maydell@linaro.org |
12 | --- | 13 | --- |
13 | target/arm/helper.c | 14 ++++++++++++++ | 14 | hw/arm/nseries.c | 15 +++++++++++---- |
14 | 1 file changed, 14 insertions(+) | 15 | 1 file changed, 11 insertions(+), 4 deletions(-) |
15 | 16 | ||
16 | diff --git a/target/arm/helper.c b/target/arm/helper.c | 17 | diff --git a/hw/arm/nseries.c b/hw/arm/nseries.c |
17 | index XXXXXXX..XXXXXXX 100644 | 18 | index XXXXXXX..XXXXXXX 100644 |
18 | --- a/target/arm/helper.c | 19 | --- a/hw/arm/nseries.c |
19 | +++ b/target/arm/helper.c | 20 | +++ b/hw/arm/nseries.c |
20 | @@ -XXX,XX +XXX,XX @@ static bool get_phys_addr_pmsav7(CPUARMState *env, uint32_t address, | 21 | @@ -XXX,XX +XXX,XX @@ static void n8x0_init(MachineState *machine, |
21 | case 6: | 22 | /* No, wait, better start at the ROM. */ |
22 | *prot |= PAGE_READ | PAGE_EXEC; | 23 | s->mpu->cpu->env.regs[15] = OMAP2_Q2_BASE + 0x400000; |
23 | break; | 24 | |
24 | + case 7: | 25 | - /* This is intended for loading the `secondary.bin' program from |
25 | + /* for v7M, same as 6; for R profile a reserved value */ | 26 | + /* |
26 | + if (arm_feature(env, ARM_FEATURE_M)) { | 27 | + * This is intended for loading the `secondary.bin' program from |
27 | + *prot |= PAGE_READ | PAGE_EXEC; | 28 | * Nokia images (the NOLO bootloader). The entry point seems |
28 | + break; | 29 | * to be at OMAP2_Q2_BASE + 0x400000. |
29 | + } | 30 | * |
30 | + /* fall through */ | 31 | @@ -XXX,XX +XXX,XX @@ static void n8x0_init(MachineState *machine, |
31 | default: | 32 | * for them the entry point needs to be set to OMAP2_SRAM_BASE. |
32 | qemu_log_mask(LOG_GUEST_ERROR, | 33 | * |
33 | "DRACR[%d]: Bad value for AP bits: 0x%" | 34 | * The code above is for loading the `zImage' file from Nokia |
34 | @@ -XXX,XX +XXX,XX @@ static bool get_phys_addr_pmsav7(CPUARMState *env, uint32_t address, | 35 | - * images. */ |
35 | case 6: | 36 | - load_image_targphys(option_rom[0].name, OMAP2_Q2_BASE + 0x400000, |
36 | *prot |= PAGE_READ | PAGE_EXEC; | 37 | - machine->ram_size - 0x400000); |
37 | break; | 38 | + * images. |
38 | + case 7: | 39 | + */ |
39 | + /* for v7M, same as 6; for R profile a reserved value */ | 40 | + if (load_image_targphys(option_rom[0].name, |
40 | + if (arm_feature(env, ARM_FEATURE_M)) { | 41 | + OMAP2_Q2_BASE + 0x400000, |
41 | + *prot |= PAGE_READ | PAGE_EXEC; | 42 | + machine->ram_size - 0x400000) < 0) { |
42 | + break; | 43 | + error_report("Failed to load secondary bootloader %s", |
43 | + } | 44 | + option_rom[0].name); |
44 | + /* fall through */ | 45 | + exit(EXIT_FAILURE); |
45 | default: | 46 | + } |
46 | qemu_log_mask(LOG_GUEST_ERROR, | 47 | |
47 | "DRACR[%d]: Bad value for AP bits: 0x%" | 48 | n800_setup_nolo_tags(nolo_tags); |
49 | cpu_physical_memory_write(OMAP2_SRAM_BASE, nolo_tags, 0x10000); | ||
48 | -- | 50 | -- |
49 | 2.7.4 | 51 | 2.20.1 |
50 | 52 | ||
51 | 53 | diff view generated by jsdifflib |
1 | From: Philippe Mathieu-Daudé <f4bug@amsat.org> | 1 | From: Havard Skinnemoen <hskinnemoen@google.com> |
---|---|---|---|
2 | 2 | ||
3 | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | 3 | The number of runs is equal to the number of 0-1 and 1-0 transitions, |
4 | Reviewed-by: Alistair Francis <alistair.francis@xilinx.com> | 4 | plus one. Currently, it's counting the number of times these transitions |
5 | Message-id: 20180115182436.2066-6-f4bug@amsat.org | 5 | do _not_ happen, plus one. |
6 | |||
7 | Source: | ||
8 | https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-22r1a.pdf | ||
9 | section 2.3.4 point (3). | ||
10 | |||
11 | Signed-off-by: Havard Skinnemoen <hskinnemoen@google.com> | ||
12 | Message-id: 20201103011457.2959989-2-hskinnemoen@google.com | ||
13 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 14 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
7 | --- | 15 | --- |
8 | hw/sd/sdhci.c | 30 +++++++++++++++++++++--------- | 16 | tests/qtest/npcm7xx_rng-test.c | 2 +- |
9 | 1 file changed, 21 insertions(+), 9 deletions(-) | 17 | 1 file changed, 1 insertion(+), 1 deletion(-) |
10 | 18 | ||
11 | diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c | 19 | diff --git a/tests/qtest/npcm7xx_rng-test.c b/tests/qtest/npcm7xx_rng-test.c |
12 | index XXXXXXX..XXXXXXX 100644 | 20 | index XXXXXXX..XXXXXXX 100644 |
13 | --- a/hw/sd/sdhci.c | 21 | --- a/tests/qtest/npcm7xx_rng-test.c |
14 | +++ b/hw/sd/sdhci.c | 22 | +++ b/tests/qtest/npcm7xx_rng-test.c |
15 | @@ -XXX,XX +XXX,XX @@ static void sdhci_uninitfn(SDHCIState *s) | 23 | @@ -XXX,XX +XXX,XX @@ static double calc_runs_p(const unsigned long *buf, unsigned int nr_bits) |
16 | s->fifo_buffer = NULL; | 24 | pi = (double)nr_ones / nr_bits; |
17 | } | 25 | |
18 | 26 | for (k = 0; k < nr_bits - 1; k++) { | |
19 | +static void sdhci_common_realize(SDHCIState *s, Error **errp) | 27 | - vn_obs += !(test_bit(k, buf) ^ test_bit(k + 1, buf)); |
20 | +{ | 28 | + vn_obs += (test_bit(k, buf) ^ test_bit(k + 1, buf)); |
21 | + s->buf_maxsz = sdhci_get_fifolen(s); | 29 | } |
22 | + s->fifo_buffer = g_malloc0(s->buf_maxsz); | 30 | vn_obs += 1; |
23 | + | ||
24 | + memory_region_init_io(&s->iomem, OBJECT(s), &sdhci_mmio_ops, s, "sdhci", | ||
25 | + SDHC_REGISTERS_MAP_SIZE); | ||
26 | +} | ||
27 | + | ||
28 | static bool sdhci_pending_insert_vmstate_needed(void *opaque) | ||
29 | { | ||
30 | SDHCIState *s = opaque; | ||
31 | @@ -XXX,XX +XXX,XX @@ static Property sdhci_pci_properties[] = { | ||
32 | static void sdhci_pci_realize(PCIDevice *dev, Error **errp) | ||
33 | { | ||
34 | SDHCIState *s = PCI_SDHCI(dev); | ||
35 | + | ||
36 | + sdhci_initfn(s); | ||
37 | + sdhci_common_realize(s, errp); | ||
38 | + if (errp && *errp) { | ||
39 | + return; | ||
40 | + } | ||
41 | + | ||
42 | dev->config[PCI_CLASS_PROG] = 0x01; /* Standard Host supported DMA */ | ||
43 | dev->config[PCI_INTERRUPT_PIN] = 0x01; /* interrupt pin A */ | ||
44 | - sdhci_initfn(s); | ||
45 | - s->buf_maxsz = sdhci_get_fifolen(s); | ||
46 | - s->fifo_buffer = g_malloc0(s->buf_maxsz); | ||
47 | s->irq = pci_allocate_irq(dev); | ||
48 | - memory_region_init_io(&s->iomem, OBJECT(s), &sdhci_mmio_ops, s, "sdhci", | ||
49 | - SDHC_REGISTERS_MAP_SIZE); | ||
50 | pci_register_bar(dev, 0, 0, &s->iomem); | ||
51 | } | ||
52 | |||
53 | @@ -XXX,XX +XXX,XX @@ static void sdhci_sysbus_realize(DeviceState *dev, Error ** errp) | ||
54 | SDHCIState *s = SYSBUS_SDHCI(dev); | ||
55 | SysBusDevice *sbd = SYS_BUS_DEVICE(dev); | ||
56 | |||
57 | - s->buf_maxsz = sdhci_get_fifolen(s); | ||
58 | - s->fifo_buffer = g_malloc0(s->buf_maxsz); | ||
59 | + sdhci_common_realize(s, errp); | ||
60 | + if (errp && *errp) { | ||
61 | + return; | ||
62 | + } | ||
63 | + | ||
64 | sysbus_init_irq(sbd, &s->irq); | ||
65 | - memory_region_init_io(&s->iomem, OBJECT(s), &sdhci_mmio_ops, s, "sdhci", | ||
66 | - SDHC_REGISTERS_MAP_SIZE); | ||
67 | sysbus_init_mmio(sbd, &s->iomem); | ||
68 | } | ||
69 | 31 | ||
70 | -- | 32 | -- |
71 | 2.7.4 | 33 | 2.20.1 |
72 | 34 | ||
73 | 35 | diff view generated by jsdifflib |
1 | Add virt-2.12 machine type. | 1 | Checks for UNDEF cases should go before the "is VFP enabled?" access |
---|---|---|---|
2 | check, except in special cases. Move a stray UNDEF check in the VTBL | ||
3 | trans function up above the access check. | ||
2 | 4 | ||
3 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 5 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
6 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
7 | Message-id: 20201109145324.2859-1-peter.maydell@linaro.org | ||
4 | --- | 8 | --- |
5 | hw/arm/virt.c | 19 +++++++++++++++++-- | 9 | target/arm/translate-neon.c.inc | 8 ++++---- |
6 | 1 file changed, 17 insertions(+), 2 deletions(-) | 10 | 1 file changed, 4 insertions(+), 4 deletions(-) |
7 | 11 | ||
8 | diff --git a/hw/arm/virt.c b/hw/arm/virt.c | 12 | diff --git a/target/arm/translate-neon.c.inc b/target/arm/translate-neon.c.inc |
9 | index XXXXXXX..XXXXXXX 100644 | 13 | index XXXXXXX..XXXXXXX 100644 |
10 | --- a/hw/arm/virt.c | 14 | --- a/target/arm/translate-neon.c.inc |
11 | +++ b/hw/arm/virt.c | 15 | +++ b/target/arm/translate-neon.c.inc |
12 | @@ -XXX,XX +XXX,XX @@ static void machvirt_machine_init(void) | 16 | @@ -XXX,XX +XXX,XX @@ static bool trans_VTBL(DisasContext *s, arg_VTBL *a) |
13 | } | 17 | return false; |
14 | type_init(machvirt_machine_init); | 18 | } |
15 | 19 | ||
16 | -static void virt_2_11_instance_init(Object *obj) | 20 | - if (!vfp_access_check(s)) { |
17 | +static void virt_2_12_instance_init(Object *obj) | 21 | - return true; |
18 | { | 22 | - } |
19 | VirtMachineState *vms = VIRT_MACHINE(obj); | 23 | - |
20 | VirtMachineClass *vmc = VIRT_MACHINE_GET_CLASS(vms); | 24 | if ((a->vn + a->len + 1) > 32) { |
21 | @@ -XXX,XX +XXX,XX @@ static void virt_2_11_instance_init(Object *obj) | 25 | /* |
22 | vms->irqmap = a15irqmap; | 26 | * This is UNPREDICTABLE; we choose to UNDEF to avoid the |
23 | } | 27 | @@ -XXX,XX +XXX,XX @@ static bool trans_VTBL(DisasContext *s, arg_VTBL *a) |
24 | 28 | return false; | |
25 | +static void virt_machine_2_12_options(MachineClass *mc) | 29 | } |
26 | +{ | 30 | |
27 | +} | 31 | + if (!vfp_access_check(s)) { |
28 | +DEFINE_VIRT_MACHINE_AS_LATEST(2, 12) | 32 | + return true; |
33 | + } | ||
29 | + | 34 | + |
30 | +#define VIRT_COMPAT_2_11 \ | 35 | desc = tcg_const_i32((a->vn << 2) | a->len); |
31 | + HW_COMPAT_2_11 | 36 | def = tcg_temp_new_i64(); |
32 | + | 37 | if (a->op) { |
33 | +static void virt_2_11_instance_init(Object *obj) | ||
34 | +{ | ||
35 | + virt_2_12_instance_init(obj); | ||
36 | +} | ||
37 | + | ||
38 | static void virt_machine_2_11_options(MachineClass *mc) | ||
39 | { | ||
40 | + virt_machine_2_12_options(mc); | ||
41 | + SET_MACHINE_COMPAT(mc, VIRT_COMPAT_2_11); | ||
42 | } | ||
43 | -DEFINE_VIRT_MACHINE_AS_LATEST(2, 11) | ||
44 | +DEFINE_VIRT_MACHINE(2, 11) | ||
45 | |||
46 | #define VIRT_COMPAT_2_10 \ | ||
47 | HW_COMPAT_2_10 | ||
48 | -- | 38 | -- |
49 | 2.7.4 | 39 | 2.20.1 |
50 | 40 | ||
51 | 41 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | Since pl181 is still using the legacy SD card API, the SD | ||
2 | card created by sd_init() is not plugged into any bus. This | ||
3 | means that the controller has to reset it manually. | ||
4 | 1 | ||
5 | Failing to do this mostly didn't affect the guest since the | ||
6 | guest typically does a programmed SD card reset as part of | ||
7 | its SD controller driver initialization, but meant that | ||
8 | migration failed because it's only in sd_reset() that we | ||
9 | set up the wpgrps_size field. | ||
10 | |||
11 | Cc: qemu-stable@nongnu.org | ||
12 | Fixes: https://bugs.launchpad.net/qemu/+bug/1739378 | ||
13 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
14 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
15 | Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
16 | Message-id: 1515506513-31961-2-git-send-email-peter.maydell@linaro.org | ||
17 | --- | ||
18 | hw/sd/pl181.c | 4 ++++ | ||
19 | 1 file changed, 4 insertions(+) | ||
20 | |||
21 | diff --git a/hw/sd/pl181.c b/hw/sd/pl181.c | ||
22 | index XXXXXXX..XXXXXXX 100644 | ||
23 | --- a/hw/sd/pl181.c | ||
24 | +++ b/hw/sd/pl181.c | ||
25 | @@ -XXX,XX +XXX,XX @@ static void pl181_reset(DeviceState *d) | ||
26 | |||
27 | /* We can assume our GPIO outputs have been wired up now */ | ||
28 | sd_set_cb(s->card, s->cardstatus[0], s->cardstatus[1]); | ||
29 | + /* Since we're still using the legacy SD API the card is not plugged | ||
30 | + * into any bus, and we must reset it manually. | ||
31 | + */ | ||
32 | + device_reset(DEVICE(s->card)); | ||
33 | } | ||
34 | |||
35 | static void pl181_init(Object *obj) | ||
36 | -- | ||
37 | 2.7.4 | ||
38 | |||
39 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | Since milkymist-memcard is still using the legacy SD card API, | ||
2 | the SD card created by sd_init() is not plugged into any bus. | ||
3 | This means that the controller has to reset it manually. | ||
4 | 1 | ||
5 | Failing to do this mostly didn't affect the guest since the | ||
6 | guest typically does a programmed SD card reset as part of | ||
7 | its SD controller driver initialization, but meant that | ||
8 | migration failed because it's only in sd_reset() that we | ||
9 | set up the wpgrps_size field. | ||
10 | |||
11 | Cc: qemu-stable@nongnu.org | ||
12 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
13 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
14 | Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
15 | Message-id: 1515506513-31961-3-git-send-email-peter.maydell@linaro.org | ||
16 | --- | ||
17 | hw/sd/milkymist-memcard.c | 4 ++++ | ||
18 | 1 file changed, 4 insertions(+) | ||
19 | |||
20 | diff --git a/hw/sd/milkymist-memcard.c b/hw/sd/milkymist-memcard.c | ||
21 | index XXXXXXX..XXXXXXX 100644 | ||
22 | --- a/hw/sd/milkymist-memcard.c | ||
23 | +++ b/hw/sd/milkymist-memcard.c | ||
24 | @@ -XXX,XX +XXX,XX @@ static void milkymist_memcard_reset(DeviceState *d) | ||
25 | for (i = 0; i < R_MAX; i++) { | ||
26 | s->regs[i] = 0; | ||
27 | } | ||
28 | + /* Since we're still using the legacy SD API the card is not plugged | ||
29 | + * into any bus, and we must reset it manually. | ||
30 | + */ | ||
31 | + device_reset(DEVICE(s->card)); | ||
32 | } | ||
33 | |||
34 | static int milkymist_memcard_init(SysBusDevice *dev) | ||
35 | -- | ||
36 | 2.7.4 | ||
37 | |||
38 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | Since ssi-sd is still using the legacy SD card API, the SD | ||
2 | card created by sd_init() is not plugged into any bus. This | ||
3 | means that the controller has to reset it manually. | ||
4 | 1 | ||
5 | Failing to do this mostly didn't affect the guest since the | ||
6 | guest typically does a programmed SD card reset as part of | ||
7 | its SD controller driver initialization, but meant that | ||
8 | migration failed because it's only in sd_reset() that we | ||
9 | set up the wpgrps_size field. | ||
10 | |||
11 | In the case of sd-ssi, we have to implement an entire | ||
12 | reset function since there wasn't one previously, and | ||
13 | that requires a QOM cast macro that got omitted when this | ||
14 | device was QOMified. | ||
15 | |||
16 | Cc: qemu-stable@nongnu.org | ||
17 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
18 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
19 | Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
20 | Message-id: 1515506513-31961-4-git-send-email-peter.maydell@linaro.org | ||
21 | --- | ||
22 | hw/sd/ssi-sd.c | 25 +++++++++++++++++++++++-- | ||
23 | 1 file changed, 23 insertions(+), 2 deletions(-) | ||
24 | |||
25 | diff --git a/hw/sd/ssi-sd.c b/hw/sd/ssi-sd.c | ||
26 | index XXXXXXX..XXXXXXX 100644 | ||
27 | --- a/hw/sd/ssi-sd.c | ||
28 | +++ b/hw/sd/ssi-sd.c | ||
29 | @@ -XXX,XX +XXX,XX @@ typedef struct { | ||
30 | SDState *sd; | ||
31 | } ssi_sd_state; | ||
32 | |||
33 | +#define TYPE_SSI_SD "ssi-sd" | ||
34 | +#define SSI_SD(obj) OBJECT_CHECK(ssi_sd_state, (obj), TYPE_SSI_SD) | ||
35 | + | ||
36 | /* State word bits. */ | ||
37 | #define SSI_SDR_LOCKED 0x0001 | ||
38 | #define SSI_SDR_WP_ERASE 0x0002 | ||
39 | @@ -XXX,XX +XXX,XX @@ static void ssi_sd_realize(SSISlave *d, Error **errp) | ||
40 | ssi_sd_state *s = FROM_SSI_SLAVE(ssi_sd_state, d); | ||
41 | DriveInfo *dinfo; | ||
42 | |||
43 | - s->mode = SSI_SD_CMD; | ||
44 | /* FIXME use a qdev drive property instead of drive_get_next() */ | ||
45 | dinfo = drive_get_next(IF_SD); | ||
46 | s->sd = sd_init(dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, true); | ||
47 | @@ -XXX,XX +XXX,XX @@ static void ssi_sd_realize(SSISlave *d, Error **errp) | ||
48 | } | ||
49 | } | ||
50 | |||
51 | +static void ssi_sd_reset(DeviceState *dev) | ||
52 | +{ | ||
53 | + ssi_sd_state *s = SSI_SD(dev); | ||
54 | + | ||
55 | + s->mode = SSI_SD_CMD; | ||
56 | + s->cmd = 0; | ||
57 | + memset(s->cmdarg, 0, sizeof(s->cmdarg)); | ||
58 | + memset(s->response, 0, sizeof(s->response)); | ||
59 | + s->arglen = 0; | ||
60 | + s->response_pos = 0; | ||
61 | + s->stopping = 0; | ||
62 | + | ||
63 | + /* Since we're still using the legacy SD API the card is not plugged | ||
64 | + * into any bus, and we must reset it manually. | ||
65 | + */ | ||
66 | + device_reset(DEVICE(s->sd)); | ||
67 | +} | ||
68 | + | ||
69 | static void ssi_sd_class_init(ObjectClass *klass, void *data) | ||
70 | { | ||
71 | DeviceClass *dc = DEVICE_CLASS(klass); | ||
72 | @@ -XXX,XX +XXX,XX @@ static void ssi_sd_class_init(ObjectClass *klass, void *data) | ||
73 | k->transfer = ssi_sd_transfer; | ||
74 | k->cs_polarity = SSI_CS_LOW; | ||
75 | dc->vmsd = &vmstate_ssi_sd; | ||
76 | + dc->reset = ssi_sd_reset; | ||
77 | } | ||
78 | |||
79 | static const TypeInfo ssi_sd_info = { | ||
80 | - .name = "ssi-sd", | ||
81 | + .name = TYPE_SSI_SD, | ||
82 | .parent = TYPE_SSI_SLAVE, | ||
83 | .instance_size = sizeof(ssi_sd_state), | ||
84 | .class_init = ssi_sd_class_init, | ||
85 | -- | ||
86 | 2.7.4 | ||
87 | |||
88 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | Since omap_mmc is still using the legacy SD card API, the SD | ||
2 | card created by sd_init() is not plugged into any bus. This | ||
3 | means that the controller has to reset it manually. | ||
4 | 1 | ||
5 | Failing to do this mostly didn't affect the guest since the | ||
6 | guest typically does a programmed SD card reset as part of | ||
7 | its SD controller driver initialization, but would mean that | ||
8 | migration fails because it's only in sd_reset() that we | ||
9 | set up the wpgrps_size field. | ||
10 | |||
11 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
12 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
13 | Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
14 | Message-id: 1515506513-31961-5-git-send-email-peter.maydell@linaro.org | ||
15 | --- | ||
16 | hw/sd/omap_mmc.c | 14 ++++++++++---- | ||
17 | 1 file changed, 10 insertions(+), 4 deletions(-) | ||
18 | |||
19 | diff --git a/hw/sd/omap_mmc.c b/hw/sd/omap_mmc.c | ||
20 | index XXXXXXX..XXXXXXX 100644 | ||
21 | --- a/hw/sd/omap_mmc.c | ||
22 | +++ b/hw/sd/omap_mmc.c | ||
23 | @@ -XXX,XX +XXX,XX @@ void omap_mmc_reset(struct omap_mmc_s *host) | ||
24 | host->cdet_enable = 0; | ||
25 | qemu_set_irq(host->coverswitch, host->cdet_state); | ||
26 | host->clkdiv = 0; | ||
27 | + | ||
28 | + /* Since we're still using the legacy SD API the card is not plugged | ||
29 | + * into any bus, and we must reset it manually. When omap_mmc is | ||
30 | + * QOMified this must move into the QOM reset function. | ||
31 | + */ | ||
32 | + device_reset(DEVICE(host->card)); | ||
33 | } | ||
34 | |||
35 | static uint64_t omap_mmc_read(void *opaque, hwaddr offset, | ||
36 | @@ -XXX,XX +XXX,XX @@ struct omap_mmc_s *omap_mmc_init(hwaddr base, | ||
37 | s->lines = 1; /* TODO: needs to be settable per-board */ | ||
38 | s->rev = 1; | ||
39 | |||
40 | - omap_mmc_reset(s); | ||
41 | - | ||
42 | memory_region_init_io(&s->iomem, NULL, &omap_mmc_ops, s, "omap.mmc", 0x800); | ||
43 | memory_region_add_subregion(sysmem, base, &s->iomem); | ||
44 | |||
45 | @@ -XXX,XX +XXX,XX @@ struct omap_mmc_s *omap_mmc_init(hwaddr base, | ||
46 | exit(1); | ||
47 | } | ||
48 | |||
49 | + omap_mmc_reset(s); | ||
50 | + | ||
51 | return s; | ||
52 | } | ||
53 | |||
54 | @@ -XXX,XX +XXX,XX @@ struct omap_mmc_s *omap2_mmc_init(struct omap_target_agent_s *ta, | ||
55 | s->lines = 4; | ||
56 | s->rev = 2; | ||
57 | |||
58 | - omap_mmc_reset(s); | ||
59 | - | ||
60 | memory_region_init_io(&s->iomem, NULL, &omap_mmc_ops, s, "omap.mmc", | ||
61 | omap_l4_region_size(ta, 0)); | ||
62 | omap_l4_attach(ta, 0, &s->iomem); | ||
63 | @@ -XXX,XX +XXX,XX @@ struct omap_mmc_s *omap2_mmc_init(struct omap_target_agent_s *ta, | ||
64 | s->cdet = qemu_allocate_irq(omap_mmc_cover_cb, s, 0); | ||
65 | sd_set_cb(s->card, NULL, s->cdet); | ||
66 | |||
67 | + omap_mmc_reset(s); | ||
68 | + | ||
69 | return s; | ||
70 | } | ||
71 | |||
72 | -- | ||
73 | 2.7.4 | ||
74 | |||
75 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
4 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
5 | Message-id: 20180110063337.21538-2-richard.henderson@linaro.org | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | ||
8 | target/arm/translate-a64.c | 44 ++++++++++++++++++++++++++++---------------- | ||
9 | 1 file changed, 28 insertions(+), 16 deletions(-) | ||
10 | |||
11 | diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c | ||
12 | index XXXXXXX..XXXXXXX 100644 | ||
13 | --- a/target/arm/translate-a64.c | ||
14 | +++ b/target/arm/translate-a64.c | ||
15 | @@ -XXX,XX +XXX,XX @@ static void disas_fp_3src(DisasContext *s, uint32_t insn) | ||
16 | } | ||
17 | } | ||
18 | |||
19 | +/* The imm8 encodes the sign bit, enough bits to represent an exponent in | ||
20 | + * the range 01....1xx to 10....0xx, and the most significant 4 bits of | ||
21 | + * the mantissa; see VFPExpandImm() in the v8 ARM ARM. | ||
22 | + */ | ||
23 | +static uint64_t vfp_expand_imm(int size, uint8_t imm8) | ||
24 | +{ | ||
25 | + uint64_t imm; | ||
26 | + | ||
27 | + switch (size) { | ||
28 | + case MO_64: | ||
29 | + imm = (extract32(imm8, 7, 1) ? 0x8000 : 0) | | ||
30 | + (extract32(imm8, 6, 1) ? 0x3fc0 : 0x4000) | | ||
31 | + extract32(imm8, 0, 6); | ||
32 | + imm <<= 48; | ||
33 | + break; | ||
34 | + case MO_32: | ||
35 | + imm = (extract32(imm8, 7, 1) ? 0x8000 : 0) | | ||
36 | + (extract32(imm8, 6, 1) ? 0x3e00 : 0x4000) | | ||
37 | + (extract32(imm8, 0, 6) << 3); | ||
38 | + imm <<= 16; | ||
39 | + break; | ||
40 | + default: | ||
41 | + g_assert_not_reached(); | ||
42 | + } | ||
43 | + return imm; | ||
44 | +} | ||
45 | + | ||
46 | /* Floating point immediate | ||
47 | * 31 30 29 28 24 23 22 21 20 13 12 10 9 5 4 0 | ||
48 | * +---+---+---+-----------+------+---+------------+-------+------+------+ | ||
49 | @@ -XXX,XX +XXX,XX @@ static void disas_fp_imm(DisasContext *s, uint32_t insn) | ||
50 | return; | ||
51 | } | ||
52 | |||
53 | - /* The imm8 encodes the sign bit, enough bits to represent | ||
54 | - * an exponent in the range 01....1xx to 10....0xx, | ||
55 | - * and the most significant 4 bits of the mantissa; see | ||
56 | - * VFPExpandImm() in the v8 ARM ARM. | ||
57 | - */ | ||
58 | - if (is_double) { | ||
59 | - imm = (extract32(imm8, 7, 1) ? 0x8000 : 0) | | ||
60 | - (extract32(imm8, 6, 1) ? 0x3fc0 : 0x4000) | | ||
61 | - extract32(imm8, 0, 6); | ||
62 | - imm <<= 48; | ||
63 | - } else { | ||
64 | - imm = (extract32(imm8, 7, 1) ? 0x8000 : 0) | | ||
65 | - (extract32(imm8, 6, 1) ? 0x3e00 : 0x4000) | | ||
66 | - (extract32(imm8, 0, 6) << 3); | ||
67 | - imm <<= 16; | ||
68 | - } | ||
69 | + imm = vfp_expand_imm(MO_32 + is_double, imm8); | ||
70 | |||
71 | tcg_res = tcg_const_i64(imm); | ||
72 | write_fp_dreg(s, rd, tcg_res); | ||
73 | -- | ||
74 | 2.7.4 | ||
75 | |||
76 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
2 | 1 | ||
3 | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
4 | Reviewed-by: Alistair Francis <alistair.francis@xilinx.com> | ||
5 | Message-id: 20180115182436.2066-3-f4bug@amsat.org | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | ||
8 | include/hw/sd/sdhci.h | 2 -- | ||
9 | hw/sd/sdhci.c | 2 -- | ||
10 | 2 files changed, 4 deletions(-) | ||
11 | |||
12 | diff --git a/include/hw/sd/sdhci.h b/include/hw/sd/sdhci.h | ||
13 | index XXXXXXX..XXXXXXX 100644 | ||
14 | --- a/include/hw/sd/sdhci.h | ||
15 | +++ b/include/hw/sd/sdhci.h | ||
16 | @@ -XXX,XX +XXX,XX @@ typedef struct SDHCIState { | ||
17 | |||
18 | QEMUTimer *insert_timer; /* timer for 'changing' sd card. */ | ||
19 | QEMUTimer *transfer_timer; | ||
20 | - qemu_irq eject_cb; | ||
21 | - qemu_irq ro_cb; | ||
22 | qemu_irq irq; | ||
23 | |||
24 | /* Registers cleared on reset */ | ||
25 | diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c | ||
26 | index XXXXXXX..XXXXXXX 100644 | ||
27 | --- a/hw/sd/sdhci.c | ||
28 | +++ b/hw/sd/sdhci.c | ||
29 | @@ -XXX,XX +XXX,XX @@ static void sdhci_uninitfn(SDHCIState *s) | ||
30 | timer_free(s->insert_timer); | ||
31 | timer_del(s->transfer_timer); | ||
32 | timer_free(s->transfer_timer); | ||
33 | - qemu_free_irq(s->eject_cb); | ||
34 | - qemu_free_irq(s->ro_cb); | ||
35 | |||
36 | g_free(s->fifo_buffer); | ||
37 | s->fifo_buffer = NULL; | ||
38 | -- | ||
39 | 2.7.4 | ||
40 | |||
41 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
2 | 1 | ||
3 | Add common/sysbus/pci/sdbus comments to have clearer code blocks separation. | ||
4 | |||
5 | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
6 | Message-id: 20180115182436.2066-4-f4bug@amsat.org | ||
7 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
8 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
9 | --- | ||
10 | include/hw/sd/sdhci.h | 4 +++- | ||
11 | hw/sd/sdhci.c | 25 +++++++++++++++++-------- | ||
12 | 2 files changed, 20 insertions(+), 9 deletions(-) | ||
13 | |||
14 | diff --git a/include/hw/sd/sdhci.h b/include/hw/sd/sdhci.h | ||
15 | index XXXXXXX..XXXXXXX 100644 | ||
16 | --- a/include/hw/sd/sdhci.h | ||
17 | +++ b/include/hw/sd/sdhci.h | ||
18 | @@ -XXX,XX +XXX,XX @@ typedef struct SDHCIState { | ||
19 | uint32_t buf_maxsz; | ||
20 | uint16_t data_count; /* current element in FIFO buffer */ | ||
21 | uint8_t stopped_state;/* Current SDHC state */ | ||
22 | - bool pending_insert_quirk;/* Quirk for Raspberry Pi card insert int */ | ||
23 | bool pending_insert_state; | ||
24 | /* Buffer Data Port Register - virtual access point to R and W buffers */ | ||
25 | /* Software Reset Register - always reads as 0 */ | ||
26 | /* Force Event Auto CMD12 Error Interrupt Reg - write only */ | ||
27 | /* Force Event Error Interrupt Register- write only */ | ||
28 | /* RO Host Controller Version Register always reads as 0x2401 */ | ||
29 | + | ||
30 | + /* Configurable properties */ | ||
31 | + bool pending_insert_quirk; /* Quirk for Raspberry Pi card insert int */ | ||
32 | } SDHCIState; | ||
33 | |||
34 | #define TYPE_PCI_SDHCI "sdhci-pci" | ||
35 | diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c | ||
36 | index XXXXXXX..XXXXXXX 100644 | ||
37 | --- a/hw/sd/sdhci.c | ||
38 | +++ b/hw/sd/sdhci.c | ||
39 | @@ -XXX,XX +XXX,XX @@ | ||
40 | */ | ||
41 | |||
42 | #include "qemu/osdep.h" | ||
43 | +#include "qapi/error.h" | ||
44 | #include "hw/hw.h" | ||
45 | #include "sysemu/block-backend.h" | ||
46 | #include "sysemu/blockdev.h" | ||
47 | @@ -XXX,XX +XXX,XX @@ static inline unsigned int sdhci_get_fifolen(SDHCIState *s) | ||
48 | } | ||
49 | } | ||
50 | |||
51 | +/* --- qdev common --- */ | ||
52 | + | ||
53 | +#define DEFINE_SDHCI_COMMON_PROPERTIES(_state) \ | ||
54 | + /* Capabilities registers provide information on supported features | ||
55 | + * of this specific host controller implementation */ \ | ||
56 | + DEFINE_PROP_UINT32("capareg", _state, capareg, SDHC_CAPAB_REG_DEFAULT), \ | ||
57 | + DEFINE_PROP_UINT32("maxcurr", _state, maxcurr, 0) | ||
58 | + | ||
59 | static void sdhci_initfn(SDHCIState *s) | ||
60 | { | ||
61 | qbus_create_inplace(&s->sdbus, sizeof(s->sdbus), | ||
62 | @@ -XXX,XX +XXX,XX @@ const VMStateDescription sdhci_vmstate = { | ||
63 | }, | ||
64 | }; | ||
65 | |||
66 | -/* Capabilities registers provide information on supported features of this | ||
67 | - * specific host controller implementation */ | ||
68 | +/* --- qdev PCI --- */ | ||
69 | + | ||
70 | static Property sdhci_pci_properties[] = { | ||
71 | - DEFINE_PROP_UINT32("capareg", SDHCIState, capareg, | ||
72 | - SDHC_CAPAB_REG_DEFAULT), | ||
73 | - DEFINE_PROP_UINT32("maxcurr", SDHCIState, maxcurr, 0), | ||
74 | + DEFINE_SDHCI_COMMON_PROPERTIES(SDHCIState), | ||
75 | DEFINE_PROP_END_OF_LIST(), | ||
76 | }; | ||
77 | |||
78 | @@ -XXX,XX +XXX,XX @@ static const TypeInfo sdhci_pci_info = { | ||
79 | }, | ||
80 | }; | ||
81 | |||
82 | +/* --- qdev SysBus --- */ | ||
83 | + | ||
84 | static Property sdhci_sysbus_properties[] = { | ||
85 | - DEFINE_PROP_UINT32("capareg", SDHCIState, capareg, | ||
86 | - SDHC_CAPAB_REG_DEFAULT), | ||
87 | - DEFINE_PROP_UINT32("maxcurr", SDHCIState, maxcurr, 0), | ||
88 | + DEFINE_SDHCI_COMMON_PROPERTIES(SDHCIState), | ||
89 | DEFINE_PROP_BOOL("pending-insert-quirk", SDHCIState, pending_insert_quirk, | ||
90 | false), | ||
91 | DEFINE_PROP_END_OF_LIST(), | ||
92 | @@ -XXX,XX +XXX,XX @@ static const TypeInfo sdhci_sysbus_info = { | ||
93 | .class_init = sdhci_sysbus_class_init, | ||
94 | }; | ||
95 | |||
96 | +/* --- qdev bus master --- */ | ||
97 | + | ||
98 | static void sdhci_bus_class_init(ObjectClass *klass, void *data) | ||
99 | { | ||
100 | SDBusClass *sbc = SD_BUS_CLASS(klass); | ||
101 | -- | ||
102 | 2.7.4 | ||
103 | |||
104 | diff view generated by jsdifflib |