1 | Not very much here, but several people have fallen over | 1 | Last lot of target-arm changes to squeeze in before rc1: |
---|---|---|---|
2 | the vector operation segfault bug, so let's get the fix | 2 | * various minor Arm bug fixes |
3 | into master. | 3 | * David Carlier's Haiku build portability fixes |
4 | * Wentong Wu's fixes for icount handling in the nios2 target | ||
4 | 5 | ||
5 | thanks | 6 | The following changes since commit 00ce6c36b35e0eb8cc5d68a28f288a6335848813: |
6 | -- PMM | ||
7 | 7 | ||
8 | The following changes since commit d418238dca7b4e0b124135827ead3076233052b1: | 8 | Merge remote-tracking branch 'remotes/huth-gitlab/tags/pull-request-2020-07-13' into staging (2020-07-13 13:01:30 +0100) |
9 | |||
10 | Merge remote-tracking branch 'remotes/rth/tags/pull-rng-20190522' into staging (2019-05-23 12:57:17 +0100) | ||
11 | 9 | ||
12 | are available in the Git repository at: | 10 | are available in the Git repository at: |
13 | 11 | ||
14 | https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20190523 | 12 | https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20200713 |
15 | 13 | ||
16 | for you to fetch changes up to 98e4f4fdb8ea05d840f51f47125924c2bb9df2df: | 14 | for you to fetch changes up to 756f739b1682bf131994ec96dad7fbdf8b54493a: |
17 | 15 | ||
18 | hw/arm/exynos4210: QOM'ify the Exynos4210 SoC (2019-05-23 14:47:44 +0100) | 16 | hw/arm/aspeed: Do not create and attach empty SD cards by default (2020-07-13 14:36:12 +0100) |
19 | 17 | ||
20 | ---------------------------------------------------------------- | 18 | ---------------------------------------------------------------- |
21 | target-arm queue: | 19 | target-arm queue: |
22 | * exynos4210: QOM'ify the Exynos4210 SoC | 20 | * hw/arm/bcm2836: Remove unused 'cpu_type' field |
23 | * exynos4210: Add DMA support for the Exynos4210 | 21 | * target/arm: Fix mtedesc for do_mem_zpz |
24 | * arm_gicv3: Fix writes to ICC_CTLR_EL3 | 22 | * Add the ability to change the FEC PHY MDIO device number on i.MX25/i.MX6/i.MX7 |
25 | * arm_gicv3: Fix write of ICH_VMCR_EL2.{VBPR0, VBPR1} | 23 | * target/arm: Don't do raw writes for PMINTENCLR |
26 | * target/arm: Fix vector operation segfault | 24 | * virtio-iommu: Fix coverity issue in virtio_iommu_handle_command() |
27 | * target/arm: Minor improvements to BFXIL, EXTR | 25 | * build: Fix various issues with building on Haiku |
26 | * target/nios2: fix wrctl behaviour when using icount | ||
27 | * hw/arm/tosa: Encapsulate misc GPIO handling in a device | ||
28 | * hw/arm/palm.c: Encapsulate misc GPIO handling in a device | ||
29 | * hw/arm/aspeed: Do not create and attach empty SD cards by default | ||
28 | 30 | ||
29 | ---------------------------------------------------------------- | 31 | ---------------------------------------------------------------- |
30 | Alistair Francis (1): | 32 | Aaron Lindsay (1): |
31 | target/arm: Fix vector operation segfault | 33 | target/arm: Don't do raw writes for PMINTENCLR |
32 | 34 | ||
33 | Guenter Roeck (1): | 35 | David CARLIER (8): |
34 | hw/arm/exynos4210: Add DMA support for the Exynos4210 | 36 | build: Enable BSD symbols for Haiku |
37 | util/qemu-openpty.c: Don't assume pty.h is glibc-only | ||
38 | build: Check that mlockall() exists | ||
39 | osdep.h: Always include <sys/signal.h> if it exists | ||
40 | osdep.h: For Haiku, define SIGIO as equivalent to SIGPOLL | ||
41 | bswap.h: Include <endian.h> on Haiku for bswap operations | ||
42 | util/compatfd.c: Only include <sys/syscall.h> if CONFIG_SIGNALFD | ||
43 | util/oslib-posix.c: Implement qemu_init_exec_dir() for Haiku | ||
35 | 44 | ||
36 | Peter Maydell (5): | 45 | Eric Auger (1): |
37 | arm: Move system_clock_scale to armv7m_systick.h | 46 | virtio-iommu: Fix coverity issue in virtio_iommu_handle_command() |
38 | arm: Remove unnecessary includes of hw/arm/arm.h | ||
39 | arm: Rename hw/arm/arm.h to hw/arm/boot.h | ||
40 | hw/intc/arm_gicv3: Fix write of ICH_VMCR_EL2.{VBPR0, VBPR1} | ||
41 | hw/intc/arm_gicv3: Fix writes to ICC_CTLR_EL3 | ||
42 | 47 | ||
43 | Philippe Mathieu-Daudé (3): | 48 | Gerd Hoffmann (1): |
44 | hw/arm/exynos4: Remove unuseful debug code | 49 | util/drm: make portable by avoiding struct dirent d_type |
45 | hw/arm/exynos4: Use the IEC binary prefix definitions | ||
46 | hw/arm/exynos4210: QOM'ify the Exynos4210 SoC | ||
47 | 50 | ||
48 | Richard Henderson (2): | 51 | Jean-Christophe Dubois (3): |
49 | target/arm: Use extract2 for EXTR | 52 | Add the ability to change the FEC PHY MDIO device number on i.MX25 processor |
50 | target/arm: Simplify BFXIL expansion | 53 | Add the ability to change the FEC PHY MDIO device number on i.MX6 processor |
54 | Add the ability to change the FEC PHY MDIO devices numbers on i.MX7 processor | ||
51 | 55 | ||
52 | include/hw/arm/allwinner-a10.h | 2 +- | 56 | Peter Maydell (4): |
53 | include/hw/arm/aspeed_soc.h | 1 - | 57 | hw/arm/tosa.c: Detabify |
54 | include/hw/arm/bcm2836.h | 1 - | 58 | hw/arm/tosa: Encapsulate misc GPIO handling in a device |
55 | include/hw/arm/{arm.h => boot.h} | 12 +++------ | 59 | hw/arm/palm.c: Detabify |
56 | include/hw/arm/exynos4210.h | 9 +++++-- | 60 | hw/arm/palm.c: Encapsulate misc GPIO handling in a device |
57 | include/hw/arm/fsl-imx25.h | 2 +- | ||
58 | include/hw/arm/fsl-imx31.h | 2 +- | ||
59 | include/hw/arm/fsl-imx6.h | 2 +- | ||
60 | include/hw/arm/fsl-imx6ul.h | 2 +- | ||
61 | include/hw/arm/fsl-imx7.h | 2 +- | ||
62 | include/hw/arm/virt.h | 2 +- | ||
63 | include/hw/arm/xlnx-versal.h | 2 +- | ||
64 | include/hw/arm/xlnx-zynqmp.h | 2 +- | ||
65 | include/hw/timer/armv7m_systick.h | 22 ++++++++++++++++ | ||
66 | hw/arm/armsse.c | 2 +- | ||
67 | hw/arm/armv7m.c | 2 +- | ||
68 | hw/arm/aspeed.c | 2 +- | ||
69 | hw/arm/boot.c | 2 +- | ||
70 | hw/arm/collie.c | 2 +- | ||
71 | hw/arm/exynos4210.c | 54 ++++++++++++++++++++++++++++++++++++--- | ||
72 | hw/arm/exynos4_boards.c | 40 ++++++++--------------------- | ||
73 | hw/arm/highbank.c | 2 +- | ||
74 | hw/arm/integratorcp.c | 2 +- | ||
75 | hw/arm/mainstone.c | 2 +- | ||
76 | hw/arm/microbit.c | 2 +- | ||
77 | hw/arm/mps2-tz.c | 2 +- | ||
78 | hw/arm/mps2.c | 2 +- | ||
79 | hw/arm/msf2-soc.c | 1 - | ||
80 | hw/arm/msf2-som.c | 2 +- | ||
81 | hw/arm/musca.c | 2 +- | ||
82 | hw/arm/musicpal.c | 2 +- | ||
83 | hw/arm/netduino2.c | 2 +- | ||
84 | hw/arm/nrf51_soc.c | 2 +- | ||
85 | hw/arm/nseries.c | 2 +- | ||
86 | hw/arm/omap1.c | 2 +- | ||
87 | hw/arm/omap2.c | 2 +- | ||
88 | hw/arm/omap_sx1.c | 2 +- | ||
89 | hw/arm/palm.c | 2 +- | ||
90 | hw/arm/raspi.c | 2 +- | ||
91 | hw/arm/realview.c | 2 +- | ||
92 | hw/arm/spitz.c | 2 +- | ||
93 | hw/arm/stellaris.c | 2 +- | ||
94 | hw/arm/stm32f205_soc.c | 2 +- | ||
95 | hw/arm/strongarm.c | 2 +- | ||
96 | hw/arm/tosa.c | 2 +- | ||
97 | hw/arm/versatilepb.c | 2 +- | ||
98 | hw/arm/vexpress.c | 2 +- | ||
99 | hw/arm/virt.c | 2 +- | ||
100 | hw/arm/xilinx_zynq.c | 2 +- | ||
101 | hw/arm/xlnx-versal.c | 2 +- | ||
102 | hw/arm/z2.c | 2 +- | ||
103 | hw/intc/arm_gicv3_cpuif.c | 6 ++--- | ||
104 | hw/intc/armv7m_nvic.c | 1 - | ||
105 | target/arm/arm-semi.c | 1 - | ||
106 | target/arm/cpu.c | 1 - | ||
107 | target/arm/cpu64.c | 1 - | ||
108 | target/arm/kvm.c | 1 - | ||
109 | target/arm/kvm32.c | 1 - | ||
110 | target/arm/kvm64.c | 1 - | ||
111 | target/arm/translate-a64.c | 44 ++++++++++++++++--------------- | ||
112 | target/arm/translate.c | 4 +-- | ||
113 | 61 files changed, 164 insertions(+), 123 deletions(-) | ||
114 | rename include/hw/arm/{arm.h => boot.h} (96%) | ||
115 | 61 | ||
62 | Philippe Mathieu-Daudé (2): | ||
63 | hw/arm/bcm2836: Remove unused 'cpu_type' field | ||
64 | hw/arm/aspeed: Do not create and attach empty SD cards by default | ||
65 | |||
66 | Richard Henderson (1): | ||
67 | target/arm: Fix mtedesc for do_mem_zpz | ||
68 | |||
69 | Wentong Wu (4): | ||
70 | target/nios2: add DISAS_NORETURN case for nothing more to generate | ||
71 | target/nios2: in line the semantics of DISAS_UPDATE with other targets | ||
72 | target/nios2: Use gen_io_start around wrctl instruction | ||
73 | hw/nios2: exit to main CPU loop only when unmasking interrupts | ||
74 | |||
75 | configure | 38 ++++++++++++- | ||
76 | include/hw/arm/bcm2836.h | 1 - | ||
77 | include/hw/arm/fsl-imx25.h | 1 + | ||
78 | include/hw/arm/fsl-imx6.h | 1 + | ||
79 | include/hw/arm/fsl-imx7.h | 1 + | ||
80 | include/qemu/bswap.h | 2 + | ||
81 | include/qemu/osdep.h | 6 +- | ||
82 | hw/arm/aspeed.c | 9 +-- | ||
83 | hw/arm/fsl-imx25.c | 7 +++ | ||
84 | hw/arm/fsl-imx6.c | 7 +++ | ||
85 | hw/arm/fsl-imx7.c | 9 +++ | ||
86 | hw/arm/palm.c | 111 +++++++++++++++++++++++++------------ | ||
87 | hw/arm/tosa.c | 132 +++++++++++++++++++++++++++++--------------- | ||
88 | hw/nios2/cpu_pic.c | 3 +- | ||
89 | hw/virtio/virtio-iommu.c | 1 + | ||
90 | hw/xen/xen-legacy-backend.c | 1 - | ||
91 | os-posix.c | 4 ++ | ||
92 | target/arm/helper.c | 4 +- | ||
93 | target/arm/translate-sve.c | 2 +- | ||
94 | target/nios2/translate.c | 12 +++- | ||
95 | util/compatfd.c | 2 + | ||
96 | util/drm.c | 19 +++++-- | ||
97 | util/oslib-posix.c | 20 ++++++- | ||
98 | util/qemu-openpty.c | 2 +- | ||
99 | 24 files changed, 292 insertions(+), 103 deletions(-) | ||
100 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
1 | 2 | ||
3 | The 'cpu_type' has been moved from BCM283XState to BCM283XClass | ||
4 | in commit 210f47840d, but we forgot to remove the old variable. | ||
5 | Do it now. | ||
6 | |||
7 | Fixes: 210f47840d ("hw/arm/bcm2836: Hardcode correct CPU type") | ||
8 | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
9 | Reviewed-by: Alistair Francis <alistair.francis@wdc.com> | ||
10 | Message-id: 20200703200459.23294-1-f4bug@amsat.org | ||
11 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
12 | --- | ||
13 | include/hw/arm/bcm2836.h | 1 - | ||
14 | 1 file changed, 1 deletion(-) | ||
15 | |||
16 | diff --git a/include/hw/arm/bcm2836.h b/include/hw/arm/bcm2836.h | ||
17 | index XXXXXXX..XXXXXXX 100644 | ||
18 | --- a/include/hw/arm/bcm2836.h | ||
19 | +++ b/include/hw/arm/bcm2836.h | ||
20 | @@ -XXX,XX +XXX,XX @@ typedef struct BCM283XState { | ||
21 | DeviceState parent_obj; | ||
22 | /*< public >*/ | ||
23 | |||
24 | - char *cpu_type; | ||
25 | uint32_t enabled_cpus; | ||
26 | |||
27 | struct { | ||
28 | -- | ||
29 | 2.20.1 | ||
30 | |||
31 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Richard Henderson <richard.henderson@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | The mask implied by the extract is redundant with the one | 3 | The mtedesc that was constructed was not actually passed in. |
4 | implied by the deposit. Also, fix spelling of BFXIL. | 4 | Found by Coverity (CID 1429996). |
5 | 5 | ||
6 | Fixes: d28d12f008e | ||
7 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
6 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | 8 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> |
7 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 9 | Message-id: 20200706202345.193676-1-richard.henderson@linaro.org |
8 | Message-id: 20190514011129.11330-3-richard.henderson@linaro.org | ||
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
10 | --- | 11 | --- |
11 | target/arm/translate-a64.c | 6 +++--- | 12 | target/arm/translate-sve.c | 2 +- |
12 | 1 file changed, 3 insertions(+), 3 deletions(-) | 13 | 1 file changed, 1 insertion(+), 1 deletion(-) |
13 | 14 | ||
14 | diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c | 15 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c |
15 | index XXXXXXX..XXXXXXX 100644 | 16 | index XXXXXXX..XXXXXXX 100644 |
16 | --- a/target/arm/translate-a64.c | 17 | --- a/target/arm/translate-sve.c |
17 | +++ b/target/arm/translate-a64.c | 18 | +++ b/target/arm/translate-sve.c |
18 | @@ -XXX,XX +XXX,XX @@ static void disas_bitfield(DisasContext *s, uint32_t insn) | 19 | @@ -XXX,XX +XXX,XX @@ static void do_mem_zpz(DisasContext *s, int zt, int pg, int zm, |
19 | tcg_gen_extract_i64(tcg_rd, tcg_tmp, ri, len); | 20 | desc = FIELD_DP32(desc, MTEDESC, ESIZE, 1 << msz); |
20 | return; | 21 | desc <<= SVE_MTEDESC_SHIFT; |
21 | } | ||
22 | - /* opc == 1, BXFIL fall through to deposit */ | ||
23 | - tcg_gen_extract_i64(tcg_tmp, tcg_tmp, ri, len); | ||
24 | + /* opc == 1, BFXIL fall through to deposit */ | ||
25 | + tcg_gen_shri_i64(tcg_tmp, tcg_tmp, ri); | ||
26 | pos = 0; | ||
27 | } else { | ||
28 | /* Handle the ri > si case with a deposit | ||
29 | @@ -XXX,XX +XXX,XX @@ static void disas_bitfield(DisasContext *s, uint32_t insn) | ||
30 | len = ri; | ||
31 | } | 22 | } |
32 | 23 | - desc = simd_desc(vsz, vsz, scale); | |
33 | - if (opc == 1) { /* BFM, BXFIL */ | 24 | + desc = simd_desc(vsz, vsz, desc | scale); |
34 | + if (opc == 1) { /* BFM, BFXIL */ | 25 | t_desc = tcg_const_i32(desc); |
35 | tcg_gen_deposit_i64(tcg_rd, tcg_rd, tcg_tmp, pos, len); | 26 | |
36 | } else { | 27 | tcg_gen_addi_ptr(t_pg, cpu_env, pred_full_reg_offset(s, pg)); |
37 | /* SBFM or UBFM: We start with zero, and we haven't modified | ||
38 | -- | 28 | -- |
39 | 2.20.1 | 29 | 2.20.1 |
40 | 30 | ||
41 | 31 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: Jean-Christophe Dubois <jcd@tribudubois.net> | ||
1 | 2 | ||
3 | Signed-off-by: Jean-Christophe Dubois <jcd@tribudubois.net> | ||
4 | Message-id: 9f8923ecd974160ae8f634c275b1100c2cbe66d7.1593806826.git.jcd@tribudubois.net | ||
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
6 | [PMM: updated for object_property_set_uint() argument reordering] | ||
7 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
8 | --- | ||
9 | include/hw/arm/fsl-imx25.h | 1 + | ||
10 | hw/arm/fsl-imx25.c | 7 +++++++ | ||
11 | 2 files changed, 8 insertions(+) | ||
12 | |||
13 | diff --git a/include/hw/arm/fsl-imx25.h b/include/hw/arm/fsl-imx25.h | ||
14 | index XXXXXXX..XXXXXXX 100644 | ||
15 | --- a/include/hw/arm/fsl-imx25.h | ||
16 | +++ b/include/hw/arm/fsl-imx25.h | ||
17 | @@ -XXX,XX +XXX,XX @@ typedef struct FslIMX25State { | ||
18 | MemoryRegion rom[2]; | ||
19 | MemoryRegion iram; | ||
20 | MemoryRegion iram_alias; | ||
21 | + uint32_t phy_num; | ||
22 | } FslIMX25State; | ||
23 | |||
24 | /** | ||
25 | diff --git a/hw/arm/fsl-imx25.c b/hw/arm/fsl-imx25.c | ||
26 | index XXXXXXX..XXXXXXX 100644 | ||
27 | --- a/hw/arm/fsl-imx25.c | ||
28 | +++ b/hw/arm/fsl-imx25.c | ||
29 | @@ -XXX,XX +XXX,XX @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp) | ||
30 | epit_table[i].irq)); | ||
31 | } | ||
32 | |||
33 | + object_property_set_uint(OBJECT(&s->fec), "phy-num", s->phy_num, &err); | ||
34 | qdev_set_nic_properties(DEVICE(&s->fec), &nd_table[0]); | ||
35 | |||
36 | if (!sysbus_realize(SYS_BUS_DEVICE(&s->fec), errp)) { | ||
37 | @@ -XXX,XX +XXX,XX @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp) | ||
38 | &s->iram_alias); | ||
39 | } | ||
40 | |||
41 | +static Property fsl_imx25_properties[] = { | ||
42 | + DEFINE_PROP_UINT32("fec-phy-num", FslIMX25State, phy_num, 0), | ||
43 | + DEFINE_PROP_END_OF_LIST(), | ||
44 | +}; | ||
45 | + | ||
46 | static void fsl_imx25_class_init(ObjectClass *oc, void *data) | ||
47 | { | ||
48 | DeviceClass *dc = DEVICE_CLASS(oc); | ||
49 | |||
50 | + device_class_set_props(dc, fsl_imx25_properties); | ||
51 | dc->realize = fsl_imx25_realize; | ||
52 | dc->desc = "i.MX25 SOC"; | ||
53 | /* | ||
54 | -- | ||
55 | 2.20.1 | ||
56 | |||
57 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: Jean-Christophe Dubois <jcd@tribudubois.net> | ||
1 | 2 | ||
3 | Signed-off-by: Jean-Christophe Dubois <jcd@tribudubois.net> | ||
4 | Message-id: 05a64e83eb1c0c865ac077b22c599425c024c02c.1593806826.git.jcd@tribudubois.net | ||
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
6 | [PMM: updated for object_property_set_uint() argument reordering] | ||
7 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
8 | --- | ||
9 | include/hw/arm/fsl-imx6.h | 1 + | ||
10 | hw/arm/fsl-imx6.c | 7 +++++++ | ||
11 | 2 files changed, 8 insertions(+) | ||
12 | |||
13 | diff --git a/include/hw/arm/fsl-imx6.h b/include/hw/arm/fsl-imx6.h | ||
14 | index XXXXXXX..XXXXXXX 100644 | ||
15 | --- a/include/hw/arm/fsl-imx6.h | ||
16 | +++ b/include/hw/arm/fsl-imx6.h | ||
17 | @@ -XXX,XX +XXX,XX @@ typedef struct FslIMX6State { | ||
18 | MemoryRegion caam; | ||
19 | MemoryRegion ocram; | ||
20 | MemoryRegion ocram_alias; | ||
21 | + uint32_t phy_num; | ||
22 | } FslIMX6State; | ||
23 | |||
24 | |||
25 | diff --git a/hw/arm/fsl-imx6.c b/hw/arm/fsl-imx6.c | ||
26 | index XXXXXXX..XXXXXXX 100644 | ||
27 | --- a/hw/arm/fsl-imx6.c | ||
28 | +++ b/hw/arm/fsl-imx6.c | ||
29 | @@ -XXX,XX +XXX,XX @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp) | ||
30 | spi_table[i].irq)); | ||
31 | } | ||
32 | |||
33 | + object_property_set_uint(OBJECT(&s->eth), "phy-num", s->phy_num, &err); | ||
34 | qdev_set_nic_properties(DEVICE(&s->eth), &nd_table[0]); | ||
35 | if (!sysbus_realize(SYS_BUS_DEVICE(&s->eth), errp)) { | ||
36 | return; | ||
37 | @@ -XXX,XX +XXX,XX @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp) | ||
38 | &s->ocram_alias); | ||
39 | } | ||
40 | |||
41 | +static Property fsl_imx6_properties[] = { | ||
42 | + DEFINE_PROP_UINT32("fec-phy-num", FslIMX6State, phy_num, 0), | ||
43 | + DEFINE_PROP_END_OF_LIST(), | ||
44 | +}; | ||
45 | + | ||
46 | static void fsl_imx6_class_init(ObjectClass *oc, void *data) | ||
47 | { | ||
48 | DeviceClass *dc = DEVICE_CLASS(oc); | ||
49 | |||
50 | + device_class_set_props(dc, fsl_imx6_properties); | ||
51 | dc->realize = fsl_imx6_realize; | ||
52 | dc->desc = "i.MX6 SOC"; | ||
53 | /* Reason: Uses serial_hd() in the realize() function */ | ||
54 | -- | ||
55 | 2.20.1 | ||
56 | |||
57 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: Jean-Christophe Dubois <jcd@tribudubois.net> | ||
1 | 2 | ||
3 | Signed-off-by: Jean-Christophe Dubois <jcd@tribudubois.net> | ||
4 | Message-id: c850187322be9930e47c8b234c385a7d0da245cb.1593806826.git.jcd@tribudubois.net | ||
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
6 | [PMM: updated for object_property_set_uint() argument reordering] | ||
7 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
8 | --- | ||
9 | include/hw/arm/fsl-imx7.h | 1 + | ||
10 | hw/arm/fsl-imx7.c | 9 +++++++++ | ||
11 | 2 files changed, 10 insertions(+) | ||
12 | |||
13 | diff --git a/include/hw/arm/fsl-imx7.h b/include/hw/arm/fsl-imx7.h | ||
14 | index XXXXXXX..XXXXXXX 100644 | ||
15 | --- a/include/hw/arm/fsl-imx7.h | ||
16 | +++ b/include/hw/arm/fsl-imx7.h | ||
17 | @@ -XXX,XX +XXX,XX @@ typedef struct FslIMX7State { | ||
18 | IMX7GPRState gpr; | ||
19 | ChipideaState usb[FSL_IMX7_NUM_USBS]; | ||
20 | DesignwarePCIEHost pcie; | ||
21 | + uint32_t phy_num[FSL_IMX7_NUM_ETHS]; | ||
22 | } FslIMX7State; | ||
23 | |||
24 | enum FslIMX7MemoryMap { | ||
25 | diff --git a/hw/arm/fsl-imx7.c b/hw/arm/fsl-imx7.c | ||
26 | index XXXXXXX..XXXXXXX 100644 | ||
27 | --- a/hw/arm/fsl-imx7.c | ||
28 | +++ b/hw/arm/fsl-imx7.c | ||
29 | @@ -XXX,XX +XXX,XX @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp) | ||
30 | FSL_IMX7_ENET2_ADDR, | ||
31 | }; | ||
32 | |||
33 | + object_property_set_uint(OBJECT(&s->eth[i]), "phy-num", | ||
34 | + s->phy_num[i], &error_abort); | ||
35 | object_property_set_uint(OBJECT(&s->eth[i]), "tx-ring-num", | ||
36 | FSL_IMX7_ETH_NUM_TX_RINGS, &error_abort); | ||
37 | qdev_set_nic_properties(DEVICE(&s->eth[i]), &nd_table[i]); | ||
38 | @@ -XXX,XX +XXX,XX @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp) | ||
39 | FSL_IMX7_PCIE_PHY_SIZE); | ||
40 | } | ||
41 | |||
42 | +static Property fsl_imx7_properties[] = { | ||
43 | + DEFINE_PROP_UINT32("fec1-phy-num", FslIMX7State, phy_num[0], 0), | ||
44 | + DEFINE_PROP_UINT32("fec2-phy-num", FslIMX7State, phy_num[1], 1), | ||
45 | + DEFINE_PROP_END_OF_LIST(), | ||
46 | +}; | ||
47 | + | ||
48 | static void fsl_imx7_class_init(ObjectClass *oc, void *data) | ||
49 | { | ||
50 | DeviceClass *dc = DEVICE_CLASS(oc); | ||
51 | |||
52 | + device_class_set_props(dc, fsl_imx7_properties); | ||
53 | dc->realize = fsl_imx7_realize; | ||
54 | |||
55 | /* Reason: Uses serial_hds and nd_table in realize() directly */ | ||
56 | -- | ||
57 | 2.20.1 | ||
58 | |||
59 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: Aaron Lindsay <aaron@os.amperecomputing.com> | ||
1 | 2 | ||
3 | Raw writes to this register when in KVM mode can cause interrupts to be | ||
4 | raised (even when the PMU is disabled). Because the underlying state is | ||
5 | already aliased to PMINTENSET (which already provides raw write | ||
6 | functions), we can safely disable raw accesses to PMINTENCLR entirely. | ||
7 | |||
8 | Signed-off-by: Aaron Lindsay <aaron@os.amperecomputing.com> | ||
9 | Message-id: 20200707152616.1917154-1-aaron@os.amperecomputing.com | ||
10 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
11 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
12 | --- | ||
13 | target/arm/helper.c | 4 ++-- | ||
14 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
15 | |||
16 | diff --git a/target/arm/helper.c b/target/arm/helper.c | ||
17 | index XXXXXXX..XXXXXXX 100644 | ||
18 | --- a/target/arm/helper.c | ||
19 | +++ b/target/arm/helper.c | ||
20 | @@ -XXX,XX +XXX,XX @@ static const ARMCPRegInfo v7_cp_reginfo[] = { | ||
21 | .resetvalue = 0x0 }, | ||
22 | { .name = "PMINTENCLR", .cp = 15, .crn = 9, .crm = 14, .opc1 = 0, .opc2 = 2, | ||
23 | .access = PL1_RW, .accessfn = access_tpm, | ||
24 | - .type = ARM_CP_ALIAS | ARM_CP_IO, | ||
25 | + .type = ARM_CP_ALIAS | ARM_CP_IO | ARM_CP_NO_RAW, | ||
26 | .fieldoffset = offsetof(CPUARMState, cp15.c9_pminten), | ||
27 | .writefn = pmintenclr_write, }, | ||
28 | { .name = "PMINTENCLR_EL1", .state = ARM_CP_STATE_AA64, | ||
29 | .opc0 = 3, .opc1 = 0, .crn = 9, .crm = 14, .opc2 = 2, | ||
30 | .access = PL1_RW, .accessfn = access_tpm, | ||
31 | - .type = ARM_CP_ALIAS | ARM_CP_IO, | ||
32 | + .type = ARM_CP_ALIAS | ARM_CP_IO | ARM_CP_NO_RAW, | ||
33 | .fieldoffset = offsetof(CPUARMState, cp15.c9_pminten), | ||
34 | .writefn = pmintenclr_write }, | ||
35 | { .name = "CCSIDR", .state = ARM_CP_STATE_BOTH, | ||
36 | -- | ||
37 | 2.20.1 | ||
38 | |||
39 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: Eric Auger <eric.auger@redhat.com> | ||
1 | 2 | ||
3 | Coverity points out (CID 1430180) that the new case is missing | ||
4 | break or a /* fallthrough */ comment. Break is the right thing to | ||
5 | do as in that case, tail is not used. | ||
6 | |||
7 | Fixes 1733eebb9e ("virtio-iommu: Implement RESV_MEM probe request") | ||
8 | Signed-off-by: Eric Auger <eric.auger@redhat.com> | ||
9 | Reported-by: Peter Maydell <peter.maydell@linaro.org> | ||
10 | Message-id: 20200708160147.18426-1-eric.auger@redhat.com | ||
11 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
12 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
13 | --- | ||
14 | hw/virtio/virtio-iommu.c | 1 + | ||
15 | 1 file changed, 1 insertion(+) | ||
16 | |||
17 | diff --git a/hw/virtio/virtio-iommu.c b/hw/virtio/virtio-iommu.c | ||
18 | index XXXXXXX..XXXXXXX 100644 | ||
19 | --- a/hw/virtio/virtio-iommu.c | ||
20 | +++ b/hw/virtio/virtio-iommu.c | ||
21 | @@ -XXX,XX +XXX,XX @@ static void virtio_iommu_handle_command(VirtIODevice *vdev, VirtQueue *vq) | ||
22 | ptail = (struct virtio_iommu_req_tail *) | ||
23 | (buf + s->config.probe_size); | ||
24 | ptail->status = virtio_iommu_handle_probe(s, iov, iov_cnt, buf); | ||
25 | + break; | ||
26 | } | ||
27 | default: | ||
28 | tail.status = VIRTIO_IOMMU_S_UNSUPP; | ||
29 | -- | ||
30 | 2.20.1 | ||
31 | |||
32 | diff view generated by jsdifflib |
1 | From: Alistair Francis <alistair.francis@wdc.com> | 1 | From: David CARLIER <devnexen@gmail.com> |
---|---|---|---|
2 | 2 | ||
3 | Commit 89e68b575 "target/arm: Use vector operations for saturation" | 3 | Tell Haiku to provide various BSD functions by setting BSD_SOURCE |
4 | causes this abort() when booting QEMU ARM with a Cortex-A15: | 4 | and linking libbsd. |
5 | 5 | ||
6 | 0 0x00007ffff4c2382f in raise () at /usr/lib/libc.so.6 | 6 | Signed-off-by: David Carlier <devnexen@gmail.com> |
7 | 1 0x00007ffff4c0e672 in abort () at /usr/lib/libc.so.6 | 7 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> |
8 | 2 0x00005555559c1839 in disas_neon_data_insn (insn=<optimized out>, s=<optimized out>) at ./target/arm/translate.c:6673 | 8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
9 | 3 0x00005555559c1839 in disas_neon_data_insn (s=<optimized out>, insn=<optimized out>) at ./target/arm/translate.c:6386 | 9 | Message-id: 20200703145614.16684-2-peter.maydell@linaro.org |
10 | 4 0x00005555559cd8a4 in disas_arm_insn (insn=4081107068, s=0x7fffe59a9510) at ./target/arm/translate.c:9289 | 10 | [PMM: expanded commit message] |
11 | 5 0x00005555559cd8a4 in arm_tr_translate_insn (dcbase=0x7fffe59a9510, cpu=<optimized out>) at ./target/arm/translate.c:13612 | 11 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> |
12 | 6 0x00005555558d1d39 in translator_loop (ops=0x5555561cc580 <arm_translator_ops>, db=0x7fffe59a9510, cpu=0x55555686a2f0, tb=<optimized out>, max_insns=<optimized out>) at ./accel/tcg/translator.c:96 | ||
13 | 7 0x00005555559d10d4 in gen_intermediate_code (cpu=cpu@entry=0x55555686a2f0, tb=tb@entry=0x7fffd7840080 <code_gen_buffer+126091347>, max_insns=max_insns@entry=512) at ./target/arm/translate.c:13901 | ||
14 | 8 0x00005555558d06b9 in tb_gen_code (cpu=cpu@entry=0x55555686a2f0, pc=3067096216, cs_base=0, flags=192, cflags=-16252928, cflags@entry=524288) at ./accel/tcg/translate-all.c:1736 | ||
15 | 9 0x00005555558ce467 in tb_find (cf_mask=524288, tb_exit=1, last_tb=0x7fffd783e640 <code_gen_buffer+126084627>, cpu=0x1) at ./accel/tcg/cpu-exec.c:407 | ||
16 | 10 0x00005555558ce467 in cpu_exec (cpu=cpu@entry=0x55555686a2f0) at ./accel/tcg/cpu-exec.c:728 | ||
17 | 11 0x000055555588b0cf in tcg_cpu_exec (cpu=0x55555686a2f0) at ./cpus.c:1431 | ||
18 | 12 0x000055555588d223 in qemu_tcg_cpu_thread_fn (arg=0x55555686a2f0) at ./cpus.c:1735 | ||
19 | 13 0x000055555588d223 in qemu_tcg_cpu_thread_fn (arg=arg@entry=0x55555686a2f0) at ./cpus.c:1709 | ||
20 | 14 0x0000555555d2629a in qemu_thread_start (args=<optimized out>) at ./util/qemu-thread-posix.c:502 | ||
21 | 15 0x00007ffff4db8a92 in start_thread () at /usr/lib/libpthread. | ||
22 | |||
23 | This patch ensures that we don't hit the abort() in the second switch | ||
24 | case in disas_neon_data_insn() as we will return from the first case. | ||
25 | |||
26 | Signed-off-by: Alistair Francis <alistair.francis@wdc.com> | ||
27 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
28 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
29 | Reviewed-by: Alex Bennée <alex.bennee@linaro.org> | ||
30 | Tested-by: Alex Bennée <alex.bennee@linaro.org> | ||
31 | Message-id: ad91b397f360b2fc7f4087e476f7df5b04d42ddb.1558021877.git.alistair.francis@wdc.com | ||
32 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 12 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
33 | --- | 13 | --- |
34 | target/arm/translate.c | 4 ++-- | 14 | configure | 4 ++-- |
35 | 1 file changed, 2 insertions(+), 2 deletions(-) | 15 | 1 file changed, 2 insertions(+), 2 deletions(-) |
36 | 16 | ||
37 | diff --git a/target/arm/translate.c b/target/arm/translate.c | 17 | diff --git a/configure b/configure |
38 | index XXXXXXX..XXXXXXX 100644 | 18 | index XXXXXXX..XXXXXXX 100755 |
39 | --- a/target/arm/translate.c | 19 | --- a/configure |
40 | +++ b/target/arm/translate.c | 20 | +++ b/configure |
41 | @@ -XXX,XX +XXX,XX @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn) | 21 | @@ -XXX,XX +XXX,XX @@ SunOS) |
42 | tcg_gen_gvec_4(rd_ofs, offsetof(CPUARMState, vfp.qc), | 22 | ;; |
43 | rn_ofs, rm_ofs, vec_size, vec_size, | 23 | Haiku) |
44 | (u ? uqadd_op : sqadd_op) + size); | 24 | haiku="yes" |
45 | - break; | 25 | - QEMU_CFLAGS="-DB_USE_POSITIVE_POSIX_ERRORS $QEMU_CFLAGS" |
46 | + return 0; | 26 | - LIBS="-lposix_error_mapper -lnetwork $LIBS" |
47 | 27 | + QEMU_CFLAGS="-DB_USE_POSITIVE_POSIX_ERRORS -DBSD_SOURCE $QEMU_CFLAGS" | |
48 | case NEON_3R_VQSUB: | 28 | + LIBS="-lposix_error_mapper -lnetwork -lbsd $LIBS" |
49 | tcg_gen_gvec_4(rd_ofs, offsetof(CPUARMState, vfp.qc), | 29 | ;; |
50 | rn_ofs, rm_ofs, vec_size, vec_size, | 30 | Linux) |
51 | (u ? uqsub_op : sqsub_op) + size); | 31 | audio_drv_list="try-pa oss" |
52 | - break; | ||
53 | + return 0; | ||
54 | |||
55 | case NEON_3R_VMUL: /* VMUL */ | ||
56 | if (u) { | ||
57 | -- | 32 | -- |
58 | 2.20.1 | 33 | 2.20.1 |
59 | 34 | ||
60 | 35 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: David CARLIER <devnexen@gmail.com> | ||
1 | 2 | ||
3 | Instead of using an OS-specific ifdef test to select the "openpty() | ||
4 | is in pty.h" codepath, make configure check for the existence of | ||
5 | the header and use the new CONFIG_PTY instead. | ||
6 | |||
7 | This is necessary to build on Haiku, which also provides openpty() | ||
8 | via pty.h. | ||
9 | |||
10 | Signed-off-by: David Carlier <devnexen@gmail.com> | ||
11 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
12 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
13 | Message-id: 20200703145614.16684-3-peter.maydell@linaro.org | ||
14 | [PMM: Expanded commit message; rename to HAVE_PTY_H] | ||
15 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
16 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
17 | --- | ||
18 | configure | 9 +++++++++ | ||
19 | util/qemu-openpty.c | 2 +- | ||
20 | 2 files changed, 10 insertions(+), 1 deletion(-) | ||
21 | |||
22 | diff --git a/configure b/configure | ||
23 | index XXXXXXX..XXXXXXX 100755 | ||
24 | --- a/configure | ||
25 | +++ b/configure | ||
26 | @@ -XXX,XX +XXX,XX @@ else | ||
27 | l2tpv3=no | ||
28 | fi | ||
29 | |||
30 | +if check_include "pty.h" ; then | ||
31 | + pty_h=yes | ||
32 | +else | ||
33 | + pty_h=no | ||
34 | +fi | ||
35 | + | ||
36 | ######################################### | ||
37 | # vhost interdependencies and host support | ||
38 | |||
39 | @@ -XXX,XX +XXX,XX @@ fi | ||
40 | if test "$sheepdog" = "yes" ; then | ||
41 | echo "CONFIG_SHEEPDOG=y" >> $config_host_mak | ||
42 | fi | ||
43 | +if test "$pty_h" = "yes" ; then | ||
44 | + echo "HAVE_PTY_H=y" >> $config_host_mak | ||
45 | +fi | ||
46 | if test "$fuzzing" = "yes" ; then | ||
47 | if test "$have_fuzzer" = "yes"; then | ||
48 | FUZZ_LDFLAGS=" -fsanitize=address,fuzzer" | ||
49 | diff --git a/util/qemu-openpty.c b/util/qemu-openpty.c | ||
50 | index XXXXXXX..XXXXXXX 100644 | ||
51 | --- a/util/qemu-openpty.c | ||
52 | +++ b/util/qemu-openpty.c | ||
53 | @@ -XXX,XX +XXX,XX @@ | ||
54 | #include "qemu/osdep.h" | ||
55 | #include "qemu-common.h" | ||
56 | |||
57 | -#if defined(__GLIBC__) | ||
58 | +#if defined HAVE_PTY_H | ||
59 | # include <pty.h> | ||
60 | #elif defined CONFIG_BSD | ||
61 | # include <termios.h> | ||
62 | -- | ||
63 | 2.20.1 | ||
64 | |||
65 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: David CARLIER <devnexen@gmail.com> | ||
1 | 2 | ||
3 | Instead of assuming that all POSIX platforms provide mlockall(), | ||
4 | test for it in configure. If the host doesn't provide this platform | ||
5 | then os_mlock() will fail -ENOSYS, as it does already on Windows. | ||
6 | |||
7 | This is necessary for Haiku, which does not have mlockall(). | ||
8 | |||
9 | Signed-off-by: David Carlier <devnexen@gmail.com> | ||
10 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
11 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
12 | Message-id: 20200703145614.16684-4-peter.maydell@linaro.org | ||
13 | [PMM: Expanded commit message; rename to HAVE_MLOCKALL] | ||
14 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
15 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
16 | --- | ||
17 | configure | 15 +++++++++++++++ | ||
18 | os-posix.c | 4 ++++ | ||
19 | 2 files changed, 19 insertions(+) | ||
20 | |||
21 | diff --git a/configure b/configure | ||
22 | index XXXXXXX..XXXXXXX 100755 | ||
23 | --- a/configure | ||
24 | +++ b/configure | ||
25 | @@ -XXX,XX +XXX,XX @@ else | ||
26 | pty_h=no | ||
27 | fi | ||
28 | |||
29 | +cat > $TMPC <<EOF | ||
30 | +#include <sys/mman.h> | ||
31 | +int main(int argc, char *argv[]) { | ||
32 | + return mlockall(MCL_FUTURE); | ||
33 | +} | ||
34 | +EOF | ||
35 | +if compile_prog "" "" ; then | ||
36 | + have_mlockall=yes | ||
37 | +else | ||
38 | + have_mlockall=no | ||
39 | +fi | ||
40 | + | ||
41 | ######################################### | ||
42 | # vhost interdependencies and host support | ||
43 | |||
44 | @@ -XXX,XX +XXX,XX @@ fi | ||
45 | if test "$pty_h" = "yes" ; then | ||
46 | echo "HAVE_PTY_H=y" >> $config_host_mak | ||
47 | fi | ||
48 | +if test "$have_mlockall" = "yes" ; then | ||
49 | + echo "HAVE_MLOCKALL=y" >> $config_host_mak | ||
50 | +fi | ||
51 | if test "$fuzzing" = "yes" ; then | ||
52 | if test "$have_fuzzer" = "yes"; then | ||
53 | FUZZ_LDFLAGS=" -fsanitize=address,fuzzer" | ||
54 | diff --git a/os-posix.c b/os-posix.c | ||
55 | index XXXXXXX..XXXXXXX 100644 | ||
56 | --- a/os-posix.c | ||
57 | +++ b/os-posix.c | ||
58 | @@ -XXX,XX +XXX,XX @@ bool is_daemonized(void) | ||
59 | |||
60 | int os_mlock(void) | ||
61 | { | ||
62 | +#ifdef HAVE_MLOCKALL | ||
63 | int ret = 0; | ||
64 | |||
65 | ret = mlockall(MCL_CURRENT | MCL_FUTURE); | ||
66 | @@ -XXX,XX +XXX,XX @@ int os_mlock(void) | ||
67 | } | ||
68 | |||
69 | return ret; | ||
70 | +#else | ||
71 | + return -ENOSYS; | ||
72 | +#endif | ||
73 | } | ||
74 | -- | ||
75 | 2.20.1 | ||
76 | |||
77 | diff view generated by jsdifflib |
1 | From: Philippe Mathieu-Daudé <philmd@redhat.com> | 1 | From: David CARLIER <devnexen@gmail.com> |
---|---|---|---|
2 | 2 | ||
3 | It eases code review, unit is explicit. | 3 | Regularize our handling of <sys/signal.h>: currently we include it in |
4 | osdep.h, but only for OpenBSD, and we include it without an ifdef | ||
5 | guard in a couple of C files. This causes problems for Haiku, which | ||
6 | doesn't have that header. | ||
4 | 7 | ||
5 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> | 8 | Instead, check in configure whether sys/signal.h exists, and if it |
6 | Reviewed-by: Alistair Francis <alistair.francis@wdc.com> | 9 | does then always include it from osdep.h. |
7 | Message-id: 20190520214342.13709-3-philmd@redhat.com | 10 | |
11 | Signed-off-by: David Carlier <devnexen@gmail.com> | ||
12 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
13 | Reviewed-by: Thomas Huth <thuth@redhat.com> | ||
14 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
15 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
16 | Message-id: 20200703145614.16684-5-peter.maydell@linaro.org | ||
17 | [PMM: Expanded commit message; rename to HAVE_SYS_SIGNAL_H] | ||
18 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 19 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
9 | --- | 20 | --- |
10 | hw/arm/exynos4_boards.c | 5 +++-- | 21 | configure | 10 ++++++++++ |
11 | 1 file changed, 3 insertions(+), 2 deletions(-) | 22 | include/qemu/osdep.h | 2 +- |
23 | hw/xen/xen-legacy-backend.c | 1 - | ||
24 | util/oslib-posix.c | 1 - | ||
25 | 4 files changed, 11 insertions(+), 3 deletions(-) | ||
12 | 26 | ||
13 | diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c | 27 | diff --git a/configure b/configure |
28 | index XXXXXXX..XXXXXXX 100755 | ||
29 | --- a/configure | ||
30 | +++ b/configure | ||
31 | @@ -XXX,XX +XXX,XX @@ if check_include "libdrm/drm.h" ; then | ||
32 | have_drm_h=yes | ||
33 | fi | ||
34 | |||
35 | +######################################### | ||
36 | +# sys/signal.h check | ||
37 | +have_sys_signal_h=no | ||
38 | +if check_include "sys/signal.h" ; then | ||
39 | + have_sys_signal_h=yes | ||
40 | +fi | ||
41 | + | ||
42 | ########################################## | ||
43 | # VTE probe | ||
44 | |||
45 | @@ -XXX,XX +XXX,XX @@ fi | ||
46 | if test "$have_openpty" = "yes" ; then | ||
47 | echo "HAVE_OPENPTY=y" >> $config_host_mak | ||
48 | fi | ||
49 | +if test "$have_sys_signal_h" = "yes" ; then | ||
50 | + echo "HAVE_SYS_SIGNAL_H=y" >> $config_host_mak | ||
51 | +fi | ||
52 | |||
53 | # Work around a system header bug with some kernel/XFS header | ||
54 | # versions where they both try to define 'struct fsxattr': | ||
55 | diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h | ||
14 | index XXXXXXX..XXXXXXX 100644 | 56 | index XXXXXXX..XXXXXXX 100644 |
15 | --- a/hw/arm/exynos4_boards.c | 57 | --- a/include/qemu/osdep.h |
16 | +++ b/hw/arm/exynos4_boards.c | 58 | +++ b/include/qemu/osdep.h |
59 | @@ -XXX,XX +XXX,XX @@ extern int daemon(int, int); | ||
60 | #include <setjmp.h> | ||
61 | #include <signal.h> | ||
62 | |||
63 | -#ifdef __OpenBSD__ | ||
64 | +#ifdef HAVE_SYS_SIGNAL_H | ||
65 | #include <sys/signal.h> | ||
66 | #endif | ||
67 | |||
68 | diff --git a/hw/xen/xen-legacy-backend.c b/hw/xen/xen-legacy-backend.c | ||
69 | index XXXXXXX..XXXXXXX 100644 | ||
70 | --- a/hw/xen/xen-legacy-backend.c | ||
71 | +++ b/hw/xen/xen-legacy-backend.c | ||
17 | @@ -XXX,XX +XXX,XX @@ | 72 | @@ -XXX,XX +XXX,XX @@ |
18 | */ | 73 | */ |
19 | 74 | ||
20 | #include "qemu/osdep.h" | 75 | #include "qemu/osdep.h" |
21 | +#include "qemu/units.h" | 76 | -#include <sys/signal.h> |
22 | #include "qapi/error.h" | 77 | |
23 | #include "qemu/error-report.h" | 78 | #include "hw/sysbus.h" |
24 | #include "qemu-common.h" | 79 | #include "hw/boards.h" |
25 | @@ -XXX,XX +XXX,XX @@ static int exynos4_board_smp_bootreg_addr[EXYNOS4_NUM_OF_BOARDS] = { | 80 | diff --git a/util/oslib-posix.c b/util/oslib-posix.c |
26 | }; | 81 | index XXXXXXX..XXXXXXX 100644 |
27 | 82 | --- a/util/oslib-posix.c | |
28 | static unsigned long exynos4_board_ram_size[EXYNOS4_NUM_OF_BOARDS] = { | 83 | +++ b/util/oslib-posix.c |
29 | - [EXYNOS4_BOARD_NURI] = 0x40000000, | 84 | @@ -XXX,XX +XXX,XX @@ |
30 | - [EXYNOS4_BOARD_SMDKC210] = 0x40000000, | 85 | #include "qemu/sockets.h" |
31 | + [EXYNOS4_BOARD_NURI] = 1 * GiB, | 86 | #include "qemu/thread.h" |
32 | + [EXYNOS4_BOARD_SMDKC210] = 1 * GiB, | 87 | #include <libgen.h> |
33 | }; | 88 | -#include <sys/signal.h> |
34 | 89 | #include "qemu/cutils.h" | |
35 | static struct arm_boot_info exynos4_board_binfo = { | 90 | |
91 | #ifdef CONFIG_LINUX | ||
36 | -- | 92 | -- |
37 | 2.20.1 | 93 | 2.20.1 |
38 | 94 | ||
39 | 95 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: David CARLIER <devnexen@gmail.com> | ||
1 | 2 | ||
3 | Haiku doesn't provide SIGIO; fix this up in osdep.h by defining it as | ||
4 | equal to SIGPOLL. | ||
5 | |||
6 | Signed-off-by: David Carlier <devnexen@gmail.com> | ||
7 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
8 | Reviewed-by: Thomas Huth <thuth@redhat.com> | ||
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
10 | Message-id: 20200703145614.16684-6-peter.maydell@linaro.org | ||
11 | [PMM: Expanded commit message] | ||
12 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
13 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
14 | --- | ||
15 | include/qemu/osdep.h | 4 ++++ | ||
16 | 1 file changed, 4 insertions(+) | ||
17 | |||
18 | diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h | ||
19 | index XXXXXXX..XXXXXXX 100644 | ||
20 | --- a/include/qemu/osdep.h | ||
21 | +++ b/include/qemu/osdep.h | ||
22 | @@ -XXX,XX +XXX,XX @@ void qemu_anon_ram_free(void *ptr, size_t size); | ||
23 | #define HAVE_CHARDEV_PARPORT 1 | ||
24 | #endif | ||
25 | |||
26 | +#if defined(__HAIKU__) | ||
27 | +#define SIGIO SIGPOLL | ||
28 | +#endif | ||
29 | + | ||
30 | #if defined(CONFIG_LINUX) | ||
31 | #ifndef BUS_MCEERR_AR | ||
32 | #define BUS_MCEERR_AR 4 | ||
33 | -- | ||
34 | 2.20.1 | ||
35 | |||
36 | diff view generated by jsdifflib |
1 | From: Philippe Mathieu-Daudé <philmd@redhat.com> | 1 | From: David CARLIER <devnexen@gmail.com> |
---|---|---|---|
2 | 2 | ||
3 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> | 3 | Haiku puts the bswap* functions in <endian.h>; pull in that |
4 | Reviewed-by: Alistair Francis <alistair.francis@wdc.com> | 4 | include file on that platform. |
5 | Message-id: 20190520214342.13709-2-philmd@redhat.com | 5 | |
6 | Signed-off-by: David Carlier <devnexen@gmail.com> | ||
7 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
8 | Reviewed-by: Thomas Huth <thuth@redhat.com> | ||
9 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
11 | Message-id: 20200703145614.16684-7-peter.maydell@linaro.org | ||
12 | [PMM: Expanded commit message] | ||
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/arm/exynos4_boards.c | 24 ------------------------ | 16 | include/qemu/bswap.h | 2 ++ |
9 | 1 file changed, 24 deletions(-) | 17 | 1 file changed, 2 insertions(+) |
10 | 18 | ||
11 | diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c | 19 | diff --git a/include/qemu/bswap.h b/include/qemu/bswap.h |
12 | index XXXXXXX..XXXXXXX 100644 | 20 | index XXXXXXX..XXXXXXX 100644 |
13 | --- a/hw/arm/exynos4_boards.c | 21 | --- a/include/qemu/bswap.h |
14 | +++ b/hw/arm/exynos4_boards.c | 22 | +++ b/include/qemu/bswap.h |
15 | @@ -XXX,XX +XXX,XX @@ | 23 | @@ -XXX,XX +XXX,XX @@ |
16 | #include "hw/net/lan9118.h" | 24 | # include <machine/bswap.h> |
17 | #include "hw/boards.h" | 25 | #elif defined(__FreeBSD__) |
18 | 26 | # include <sys/endian.h> | |
19 | -#undef DEBUG | 27 | +#elif defined(__HAIKU__) |
20 | - | 28 | +# include <endian.h> |
21 | -//#define DEBUG | 29 | #elif defined(CONFIG_BYTESWAP_H) |
22 | - | 30 | # include <byteswap.h> |
23 | -#ifdef DEBUG | ||
24 | - #undef PRINT_DEBUG | ||
25 | - #define PRINT_DEBUG(fmt, args...) \ | ||
26 | - do { \ | ||
27 | - fprintf(stderr, " [%s:%d] "fmt, __func__, __LINE__, ##args); \ | ||
28 | - } while (0) | ||
29 | -#else | ||
30 | - #define PRINT_DEBUG(fmt, args...) do {} while (0) | ||
31 | -#endif | ||
32 | - | ||
33 | #define SMDK_LAN9118_BASE_ADDR 0x05000000 | ||
34 | |||
35 | typedef enum Exynos4BoardType { | ||
36 | @@ -XXX,XX +XXX,XX @@ exynos4_boards_init_common(MachineState *machine, | ||
37 | exynos4_board_binfo.gic_cpu_if_addr = | ||
38 | EXYNOS4210_SMP_PRIVATE_BASE_ADDR + 0x100; | ||
39 | |||
40 | - PRINT_DEBUG("\n ram_size: %luMiB [0x%08lx]\n" | ||
41 | - " kernel_filename: %s\n" | ||
42 | - " kernel_cmdline: %s\n" | ||
43 | - " initrd_filename: %s\n", | ||
44 | - exynos4_board_ram_size[board_type] / 1048576, | ||
45 | - exynos4_board_ram_size[board_type], | ||
46 | - machine->kernel_filename, | ||
47 | - machine->kernel_cmdline, | ||
48 | - machine->initrd_filename); | ||
49 | - | ||
50 | exynos4_boards_init_ram(s, get_system_memory(), | ||
51 | exynos4_board_ram_size[board_type]); | ||
52 | 31 | ||
53 | -- | 32 | -- |
54 | 2.20.1 | 33 | 2.20.1 |
55 | 34 | ||
56 | 35 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: David CARLIER <devnexen@gmail.com> | ||
1 | 2 | ||
3 | util/compatfd.c includes <sys/syscall.h> so that the CONFIG_SIGNALFD | ||
4 | code can use SYS_signalfd. Guard the #include with CONFIG_SIGNALFD | ||
5 | to avoid portability issues on hosts like Haiku which do not | ||
6 | provide that header file. | ||
7 | |||
8 | Signed-off-by: David Carlier <devnexen@gmail.com> | ||
9 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
10 | Reviewed-by: Thomas Huth <thuth@redhat.com> | ||
11 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
12 | Message-id: 20200703145614.16684-8-peter.maydell@linaro.org | ||
13 | [PMM: Expanded commit message] | ||
14 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
15 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
16 | --- | ||
17 | util/compatfd.c | 2 ++ | ||
18 | 1 file changed, 2 insertions(+) | ||
19 | |||
20 | diff --git a/util/compatfd.c b/util/compatfd.c | ||
21 | index XXXXXXX..XXXXXXX 100644 | ||
22 | --- a/util/compatfd.c | ||
23 | +++ b/util/compatfd.c | ||
24 | @@ -XXX,XX +XXX,XX @@ | ||
25 | #include "qemu/osdep.h" | ||
26 | #include "qemu/thread.h" | ||
27 | |||
28 | +#if defined(CONFIG_SIGNALFD) | ||
29 | #include <sys/syscall.h> | ||
30 | +#endif | ||
31 | |||
32 | struct sigfd_compat_info | ||
33 | { | ||
34 | -- | ||
35 | 2.20.1 | ||
36 | |||
37 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: David CARLIER <devnexen@gmail.com> |
---|---|---|---|
2 | 2 | ||
3 | This is, after all, how we implement extract2 in tcg/aarch64. | 3 | The qemu_init_exec_dir() function is inherently non-portable; |
4 | provide an implementation for Haiku hosts. | ||
4 | 5 | ||
6 | Signed-off-by: David Carlier <devnexen@gmail.com> | ||
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 7 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> |
6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
7 | Message-id: 20190514011129.11330-2-richard.henderson@linaro.org | 9 | Message-id: 20200703145614.16684-9-peter.maydell@linaro.org |
10 | [PMM: Expanded commit message] | ||
11 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 12 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
9 | --- | 13 | --- |
10 | target/arm/translate-a64.c | 38 ++++++++++++++++++++------------------ | 14 | util/oslib-posix.c | 19 +++++++++++++++++++ |
11 | 1 file changed, 20 insertions(+), 18 deletions(-) | 15 | 1 file changed, 19 insertions(+) |
12 | 16 | ||
13 | diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c | 17 | diff --git a/util/oslib-posix.c b/util/oslib-posix.c |
14 | index XXXXXXX..XXXXXXX 100644 | 18 | index XXXXXXX..XXXXXXX 100644 |
15 | --- a/target/arm/translate-a64.c | 19 | --- a/util/oslib-posix.c |
16 | +++ b/target/arm/translate-a64.c | 20 | +++ b/util/oslib-posix.c |
17 | @@ -XXX,XX +XXX,XX @@ static void disas_extract(DisasContext *s, uint32_t insn) | 21 | @@ -XXX,XX +XXX,XX @@ |
18 | } else { | 22 | #include <mach-o/dyld.h> |
19 | tcg_gen_ext32u_i64(tcg_rd, cpu_reg(s, rm)); | 23 | #endif |
20 | } | 24 | |
21 | - } else if (rm == rn) { /* ROR */ | 25 | +#ifdef __HAIKU__ |
22 | - tcg_rm = cpu_reg(s, rm); | 26 | +#include <kernel/image.h> |
23 | - if (sf) { | 27 | +#endif |
24 | - tcg_gen_rotri_i64(tcg_rd, tcg_rm, imm); | ||
25 | - } else { | ||
26 | - TCGv_i32 tmp = tcg_temp_new_i32(); | ||
27 | - tcg_gen_extrl_i64_i32(tmp, tcg_rm); | ||
28 | - tcg_gen_rotri_i32(tmp, tmp, imm); | ||
29 | - tcg_gen_extu_i32_i64(tcg_rd, tmp); | ||
30 | - tcg_temp_free_i32(tmp); | ||
31 | - } | ||
32 | } else { | ||
33 | - tcg_rm = read_cpu_reg(s, rm, sf); | ||
34 | - tcg_rn = read_cpu_reg(s, rn, sf); | ||
35 | - tcg_gen_shri_i64(tcg_rm, tcg_rm, imm); | ||
36 | - tcg_gen_shli_i64(tcg_rn, tcg_rn, bitsize - imm); | ||
37 | - tcg_gen_or_i64(tcg_rd, tcg_rm, tcg_rn); | ||
38 | - if (!sf) { | ||
39 | - tcg_gen_ext32u_i64(tcg_rd, tcg_rd); | ||
40 | + tcg_rm = cpu_reg(s, rm); | ||
41 | + tcg_rn = cpu_reg(s, rn); | ||
42 | + | 28 | + |
43 | + if (sf) { | 29 | #include "qemu/mmap-alloc.h" |
44 | + /* Specialization to ROR happens in EXTRACT2. */ | 30 | |
45 | + tcg_gen_extract2_i64(tcg_rd, tcg_rm, tcg_rn, imm); | 31 | #ifdef CONFIG_DEBUG_STACK_USAGE |
46 | + } else { | 32 | @@ -XXX,XX +XXX,XX @@ void qemu_init_exec_dir(const char *argv0) |
47 | + TCGv_i32 t0 = tcg_temp_new_i32(); | ||
48 | + | ||
49 | + tcg_gen_extrl_i64_i32(t0, tcg_rm); | ||
50 | + if (rm == rn) { | ||
51 | + tcg_gen_rotri_i32(t0, t0, imm); | ||
52 | + } else { | ||
53 | + TCGv_i32 t1 = tcg_temp_new_i32(); | ||
54 | + tcg_gen_extrl_i64_i32(t1, tcg_rn); | ||
55 | + tcg_gen_extract2_i32(t0, t0, t1, imm); | ||
56 | + tcg_temp_free_i32(t1); | ||
57 | + } | ||
58 | + tcg_gen_extu_i32_i64(tcg_rd, t0); | ||
59 | + tcg_temp_free_i32(t0); | ||
60 | } | 33 | } |
61 | } | 34 | } |
62 | } | 35 | } |
36 | +#elif defined(__HAIKU__) | ||
37 | + { | ||
38 | + image_info ii; | ||
39 | + int32_t c = 0; | ||
40 | + | ||
41 | + *buf = '\0'; | ||
42 | + while (get_next_image_info(0, &c, &ii) == B_OK) { | ||
43 | + if (ii.type == B_APP_IMAGE) { | ||
44 | + strncpy(buf, ii.name, sizeof(buf)); | ||
45 | + buf[sizeof(buf) - 1] = 0; | ||
46 | + p = buf; | ||
47 | + break; | ||
48 | + } | ||
49 | + } | ||
50 | + } | ||
51 | #endif | ||
52 | /* If we don't have any way of figuring out the actual executable | ||
53 | location then try argv[0]. */ | ||
63 | -- | 54 | -- |
64 | 2.20.1 | 55 | 2.20.1 |
65 | 56 | ||
66 | 57 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: Gerd Hoffmann <kraxel@redhat.com> | ||
1 | 2 | ||
3 | Given this isn't perforance critical at all lets avoid the non-portable | ||
4 | d_type and use fstat instead to check whenever the file is a chardev. | ||
5 | |||
6 | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> | ||
7 | Reported-by: David Carlier <devnexen@gmail.com> | ||
8 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
9 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
11 | Message-id: 20200703145614.16684-10-peter.maydell@linaro.org | ||
12 | Message-id: 20200701180302.14821-1-kraxel@redhat.com | ||
13 | [PMM: fixed comment style; tweaked subject line] | ||
14 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
15 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
16 | --- | ||
17 | util/drm.c | 19 ++++++++++++++----- | ||
18 | 1 file changed, 14 insertions(+), 5 deletions(-) | ||
19 | |||
20 | diff --git a/util/drm.c b/util/drm.c | ||
21 | index XXXXXXX..XXXXXXX 100644 | ||
22 | --- a/util/drm.c | ||
23 | +++ b/util/drm.c | ||
24 | @@ -XXX,XX +XXX,XX @@ int qemu_drm_rendernode_open(const char *rendernode) | ||
25 | { | ||
26 | DIR *dir; | ||
27 | struct dirent *e; | ||
28 | - int r, fd; | ||
29 | + struct stat st; | ||
30 | + int r, fd, ret; | ||
31 | char *p; | ||
32 | |||
33 | if (rendernode) { | ||
34 | @@ -XXX,XX +XXX,XX @@ int qemu_drm_rendernode_open(const char *rendernode) | ||
35 | |||
36 | fd = -1; | ||
37 | while ((e = readdir(dir))) { | ||
38 | - if (e->d_type != DT_CHR) { | ||
39 | - continue; | ||
40 | - } | ||
41 | - | ||
42 | if (strncmp(e->d_name, "renderD", 7)) { | ||
43 | continue; | ||
44 | } | ||
45 | @@ -XXX,XX +XXX,XX @@ int qemu_drm_rendernode_open(const char *rendernode) | ||
46 | g_free(p); | ||
47 | continue; | ||
48 | } | ||
49 | + | ||
50 | + /* | ||
51 | + * prefer fstat() over checking e->d_type == DT_CHR for | ||
52 | + * portability reasons | ||
53 | + */ | ||
54 | + ret = fstat(r, &st); | ||
55 | + if (ret < 0 || (st.st_mode & S_IFMT) != S_IFCHR) { | ||
56 | + close(r); | ||
57 | + g_free(p); | ||
58 | + continue; | ||
59 | + } | ||
60 | + | ||
61 | fd = r; | ||
62 | g_free(p); | ||
63 | break; | ||
64 | -- | ||
65 | 2.20.1 | ||
66 | |||
67 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: Wentong Wu <wentong.wu@intel.com> | ||
1 | 2 | ||
3 | Add DISAS_NORETURN case for nothing more to generate because at runtime | ||
4 | execution will never return from some helper call. And at the same time | ||
5 | replace DISAS_UPDATE in t_gen_helper_raise_exception and gen_exception | ||
6 | with the newly added DISAS_NORETURN. | ||
7 | |||
8 | Signed-off-by: Wentong Wu <wentong.wu@intel.com> | ||
9 | Message-id: 20200710233433.19729-1-wentong.wu@intel.com | ||
10 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
11 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
12 | --- | ||
13 | target/nios2/translate.c | 5 +++-- | ||
14 | 1 file changed, 3 insertions(+), 2 deletions(-) | ||
15 | |||
16 | diff --git a/target/nios2/translate.c b/target/nios2/translate.c | ||
17 | index XXXXXXX..XXXXXXX 100644 | ||
18 | --- a/target/nios2/translate.c | ||
19 | +++ b/target/nios2/translate.c | ||
20 | @@ -XXX,XX +XXX,XX @@ static void t_gen_helper_raise_exception(DisasContext *dc, | ||
21 | tcg_gen_movi_tl(dc->cpu_R[R_PC], dc->pc); | ||
22 | gen_helper_raise_exception(dc->cpu_env, tmp); | ||
23 | tcg_temp_free_i32(tmp); | ||
24 | - dc->is_jmp = DISAS_UPDATE; | ||
25 | + dc->is_jmp = DISAS_NORETURN; | ||
26 | } | ||
27 | |||
28 | static bool use_goto_tb(DisasContext *dc, uint32_t dest) | ||
29 | @@ -XXX,XX +XXX,XX @@ static void gen_exception(DisasContext *dc, uint32_t excp) | ||
30 | tcg_gen_movi_tl(cpu_R[R_PC], dc->pc); | ||
31 | gen_helper_raise_exception(cpu_env, tmp); | ||
32 | tcg_temp_free_i32(tmp); | ||
33 | - dc->is_jmp = DISAS_UPDATE; | ||
34 | + dc->is_jmp = DISAS_NORETURN; | ||
35 | } | ||
36 | |||
37 | /* generate intermediate code for basic block 'tb'. */ | ||
38 | @@ -XXX,XX +XXX,XX @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns) | ||
39 | tcg_gen_exit_tb(NULL, 0); | ||
40 | break; | ||
41 | |||
42 | + case DISAS_NORETURN: | ||
43 | case DISAS_TB_JUMP: | ||
44 | /* nothing more to generate */ | ||
45 | break; | ||
46 | -- | ||
47 | 2.20.1 | ||
48 | |||
49 | diff view generated by jsdifflib |
1 | In ich_vmcr_write() we enforce "writes of BPR fields to less than | 1 | From: Wentong Wu <wentong.wu@intel.com> |
---|---|---|---|
2 | their minimum sets them to the minimum" by doing a "read vbpr and | ||
3 | write it back" operation. A typo here meant that we weren't handling | ||
4 | writes to these fields correctly, because we were reading from VBPR0 | ||
5 | but writing to VBPR1. | ||
6 | 2 | ||
3 | In line the semantics of DISAS_UPDATE on nios2 target with other targets | ||
4 | which is to explicitly write the PC back into the cpu state before doing | ||
5 | a tcg_gen_exit_tb(). | ||
6 | |||
7 | Signed-off-by: Wentong Wu <wentong.wu@intel.com> | ||
8 | Message-id: 20200710233433.19729-2-wentong.wu@intel.com | ||
9 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
7 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
8 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
9 | Message-id: 20190520162809.2677-4-peter.maydell@linaro.org | ||
10 | --- | 11 | --- |
11 | hw/intc/arm_gicv3_cpuif.c | 2 +- | 12 | target/nios2/translate.c | 2 +- |
12 | 1 file changed, 1 insertion(+), 1 deletion(-) | 13 | 1 file changed, 1 insertion(+), 1 deletion(-) |
13 | 14 | ||
14 | diff --git a/hw/intc/arm_gicv3_cpuif.c b/hw/intc/arm_gicv3_cpuif.c | 15 | diff --git a/target/nios2/translate.c b/target/nios2/translate.c |
15 | index XXXXXXX..XXXXXXX 100644 | 16 | index XXXXXXX..XXXXXXX 100644 |
16 | --- a/hw/intc/arm_gicv3_cpuif.c | 17 | --- a/target/nios2/translate.c |
17 | +++ b/hw/intc/arm_gicv3_cpuif.c | 18 | +++ b/target/nios2/translate.c |
18 | @@ -XXX,XX +XXX,XX @@ static void ich_vmcr_write(CPUARMState *env, const ARMCPRegInfo *ri, | 19 | @@ -XXX,XX +XXX,XX @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns) |
19 | /* Enforce "writing BPRs to less than minimum sets them to the minimum" | 20 | /* Indicate where the next block should start */ |
20 | * by reading and writing back the fields. | 21 | switch (dc->is_jmp) { |
21 | */ | 22 | case DISAS_NEXT: |
22 | - write_vbpr(cs, GICV3_G1, read_vbpr(cs, GICV3_G0)); | 23 | + case DISAS_UPDATE: |
23 | + write_vbpr(cs, GICV3_G0, read_vbpr(cs, GICV3_G0)); | 24 | /* Save the current PC back into the CPU register */ |
24 | write_vbpr(cs, GICV3_G1, read_vbpr(cs, GICV3_G1)); | 25 | tcg_gen_movi_tl(cpu_R[R_PC], dc->pc); |
25 | 26 | tcg_gen_exit_tb(NULL, 0); | |
26 | gicv3_cpuif_virt_update(cs); | 27 | @@ -XXX,XX +XXX,XX @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns) |
28 | |||
29 | default: | ||
30 | case DISAS_JUMP: | ||
31 | - case DISAS_UPDATE: | ||
32 | /* The jump will already have updated the PC register */ | ||
33 | tcg_gen_exit_tb(NULL, 0); | ||
34 | break; | ||
27 | -- | 35 | -- |
28 | 2.20.1 | 36 | 2.20.1 |
29 | 37 | ||
30 | 38 | diff view generated by jsdifflib |
1 | From: Guenter Roeck <linux@roeck-us.net> | 1 | From: Wentong Wu <wentong.wu@intel.com> |
---|---|---|---|
2 | 2 | ||
3 | QEMU already supports pl330. Instantiate it for Exynos4210. | 3 | wrctl instruction on nios2 target will cause checking cpu |
4 | interrupt but tcg_handle_interrupt() will call cpu_abort() | ||
5 | if the CPU gets an interrupt while it's not in 'can do IO' | ||
6 | state, so add gen_io_start around wrctl instruction. Also | ||
7 | at the same time, end the onging TB with DISAS_UPDATE. | ||
4 | 8 | ||
5 | Relevant part of Linux arch/arm/boot/dts/exynos4.dtsi: | 9 | Signed-off-by: Wentong Wu <wentong.wu@intel.com> |
6 | 10 | Message-id: 20200710233433.19729-3-wentong.wu@intel.com | |
7 | / { | ||
8 | soc: soc { | ||
9 | amba { | ||
10 | pdma0: pdma@12680000 { | ||
11 | compatible = "arm,pl330", "arm,primecell"; | ||
12 | reg = <0x12680000 0x1000>; | ||
13 | interrupts = <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>; | ||
14 | clocks = <&clock CLK_PDMA0>; | ||
15 | clock-names = "apb_pclk"; | ||
16 | #dma-cells = <1>; | ||
17 | #dma-channels = <8>; | ||
18 | #dma-requests = <32>; | ||
19 | }; | ||
20 | pdma1: pdma@12690000 { | ||
21 | compatible = "arm,pl330", "arm,primecell"; | ||
22 | reg = <0x12690000 0x1000>; | ||
23 | interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>; | ||
24 | clocks = <&clock CLK_PDMA1>; | ||
25 | clock-names = "apb_pclk"; | ||
26 | #dma-cells = <1>; | ||
27 | #dma-channels = <8>; | ||
28 | #dma-requests = <32>; | ||
29 | }; | ||
30 | mdma1: mdma@12850000 { | ||
31 | compatible = "arm,pl330", "arm,primecell"; | ||
32 | reg = <0x12850000 0x1000>; | ||
33 | interrupts = <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>; | ||
34 | clocks = <&clock CLK_MDMA>; | ||
35 | clock-names = "apb_pclk"; | ||
36 | #dma-cells = <1>; | ||
37 | #dma-channels = <8>; | ||
38 | #dma-requests = <1>; | ||
39 | }; | ||
40 | }; | ||
41 | }; | ||
42 | }; | ||
43 | |||
44 | Signed-off-by: Guenter Roeck <linux@roeck-us.net> | ||
45 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
46 | Reviewed-by: Alistair Francis <alistair.francis@wdc.com> | ||
47 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
48 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
49 | Message-id: 20190520214342.13709-4-philmd@redhat.com | ||
50 | [PMD: Do not set default qdev properties, create the controllers in the SoC | ||
51 | rather than the board (Peter Maydell), add dtsi in commit message] | ||
52 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
53 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 11 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> |
54 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 12 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
55 | --- | 13 | --- |
56 | hw/arm/exynos4210.c | 26 ++++++++++++++++++++++++++ | 14 | target/nios2/translate.c | 5 +++++ |
57 | 1 file changed, 26 insertions(+) | 15 | 1 file changed, 5 insertions(+) |
58 | 16 | ||
59 | diff --git a/hw/arm/exynos4210.c b/hw/arm/exynos4210.c | 17 | diff --git a/target/nios2/translate.c b/target/nios2/translate.c |
60 | index XXXXXXX..XXXXXXX 100644 | 18 | index XXXXXXX..XXXXXXX 100644 |
61 | --- a/hw/arm/exynos4210.c | 19 | --- a/target/nios2/translate.c |
62 | +++ b/hw/arm/exynos4210.c | 20 | +++ b/target/nios2/translate.c |
63 | @@ -XXX,XX +XXX,XX @@ | 21 | @@ -XXX,XX +XXX,XX @@ |
64 | /* EHCI */ | 22 | #include "exec/cpu_ldst.h" |
65 | #define EXYNOS4210_EHCI_BASE_ADDR 0x12580000 | 23 | #include "exec/translator.h" |
66 | 24 | #include "qemu/qemu-print.h" | |
67 | +/* DMA */ | 25 | +#include "exec/gen-icount.h" |
68 | +#define EXYNOS4210_PL330_BASE0_ADDR 0x12680000 | 26 | |
69 | +#define EXYNOS4210_PL330_BASE1_ADDR 0x12690000 | 27 | /* is_jmp field values */ |
70 | +#define EXYNOS4210_PL330_BASE2_ADDR 0x12850000 | 28 | #define DISAS_JUMP DISAS_TARGET_0 /* only pc was modified dynamically */ |
71 | + | 29 | @@ -XXX,XX +XXX,XX @@ static void wrctl(DisasContext *dc, uint32_t code, uint32_t flags) |
72 | static uint8_t chipid_and_omr[] = { 0x11, 0x02, 0x21, 0x43, | 30 | /* If interrupts were enabled using WRCTL, trigger them. */ |
73 | 0x09, 0x00, 0x00, 0x00 }; | 31 | #if !defined(CONFIG_USER_ONLY) |
74 | 32 | if ((instr.imm5 + CR_BASE) == CR_STATUS) { | |
75 | @@ -XXX,XX +XXX,XX @@ static uint64_t exynos4210_calc_affinity(int cpu) | 33 | + if (tb_cflags(dc->tb) & CF_USE_ICOUNT) { |
76 | return (0x9 << ARM_AFF1_SHIFT) | cpu; | 34 | + gen_io_start(); |
77 | } | 35 | + } |
78 | 36 | gen_helper_check_interrupts(dc->cpu_env); | |
79 | +static void pl330_create(uint32_t base, qemu_irq irq, int nreq) | 37 | + dc->is_jmp = DISAS_UPDATE; |
80 | +{ | 38 | } |
81 | + SysBusDevice *busdev; | 39 | #endif |
82 | + DeviceState *dev; | ||
83 | + | ||
84 | + dev = qdev_create(NULL, "pl330"); | ||
85 | + qdev_prop_set_uint8(dev, "num_periph_req", nreq); | ||
86 | + qdev_init_nofail(dev); | ||
87 | + busdev = SYS_BUS_DEVICE(dev); | ||
88 | + sysbus_mmio_map(busdev, 0, base); | ||
89 | + sysbus_connect_irq(busdev, 0, irq); | ||
90 | +} | ||
91 | + | ||
92 | Exynos4210State *exynos4210_init(MemoryRegion *system_mem) | ||
93 | { | ||
94 | Exynos4210State *s = g_new0(Exynos4210State, 1); | ||
95 | @@ -XXX,XX +XXX,XX @@ Exynos4210State *exynos4210_init(MemoryRegion *system_mem) | ||
96 | sysbus_create_simple(TYPE_EXYNOS4210_EHCI, EXYNOS4210_EHCI_BASE_ADDR, | ||
97 | s->irq_table[exynos4210_get_irq(28, 3)]); | ||
98 | |||
99 | + /*** DMA controllers ***/ | ||
100 | + pl330_create(EXYNOS4210_PL330_BASE0_ADDR, | ||
101 | + qemu_irq_invert(s->irq_table[exynos4210_get_irq(35, 1)]), 32); | ||
102 | + pl330_create(EXYNOS4210_PL330_BASE1_ADDR, | ||
103 | + qemu_irq_invert(s->irq_table[exynos4210_get_irq(36, 1)]), 32); | ||
104 | + pl330_create(EXYNOS4210_PL330_BASE2_ADDR, | ||
105 | + qemu_irq_invert(s->irq_table[exynos4210_get_irq(34, 1)]), 1); | ||
106 | + | ||
107 | return s; | ||
108 | } | 40 | } |
109 | -- | 41 | -- |
110 | 2.20.1 | 42 | 2.20.1 |
111 | 43 | ||
112 | 44 | diff view generated by jsdifflib |
1 | The ICC_CTLR_EL3 register includes some bits which are aliases | 1 | From: Wentong Wu <wentong.wu@intel.com> |
---|---|---|---|
2 | of bits in the ICC_CTLR_EL1(S) and (NS) registers. QEMU chooses | ||
3 | to keep those bits in the cs->icc_ctlr_el1[] struct fields. | ||
4 | Unfortunately a missing '~' in the code to update the bits | ||
5 | in those fields meant that writing to ICC_CTLR_EL3 would corrupt | ||
6 | the ICC_CLTR_EL1 register values. | ||
7 | 2 | ||
3 | Only when guest code is unmasking interrupts, terminate the excution | ||
4 | of translated code and exit to the main CPU loop to handle previous | ||
5 | pended interrupts because of the interrupts mask by guest code. | ||
6 | |||
7 | Signed-off-by: Wentong Wu <wentong.wu@intel.com> | ||
8 | Message-id: 20200710233433.19729-4-wentong.wu@intel.com | ||
9 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
9 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
10 | Message-id: 20190520162809.2677-5-peter.maydell@linaro.org | ||
11 | --- | 11 | --- |
12 | hw/intc/arm_gicv3_cpuif.c | 4 ++-- | 12 | hw/nios2/cpu_pic.c | 3 ++- |
13 | 1 file changed, 2 insertions(+), 2 deletions(-) | 13 | 1 file changed, 2 insertions(+), 1 deletion(-) |
14 | 14 | ||
15 | diff --git a/hw/intc/arm_gicv3_cpuif.c b/hw/intc/arm_gicv3_cpuif.c | 15 | diff --git a/hw/nios2/cpu_pic.c b/hw/nios2/cpu_pic.c |
16 | index XXXXXXX..XXXXXXX 100644 | 16 | index XXXXXXX..XXXXXXX 100644 |
17 | --- a/hw/intc/arm_gicv3_cpuif.c | 17 | --- a/hw/nios2/cpu_pic.c |
18 | +++ b/hw/intc/arm_gicv3_cpuif.c | 18 | +++ b/hw/nios2/cpu_pic.c |
19 | @@ -XXX,XX +XXX,XX @@ static void icc_ctlr_el3_write(CPUARMState *env, const ARMCPRegInfo *ri, | 19 | @@ -XXX,XX +XXX,XX @@ static void nios2_pic_cpu_handler(void *opaque, int irq, int level) |
20 | trace_gicv3_icc_ctlr_el3_write(gicv3_redist_affid(cs), value); | 20 | |
21 | 21 | void nios2_check_interrupts(CPUNios2State *env) | |
22 | /* *_EL1NS and *_EL1S bits are aliases into the ICC_CTLR_EL1 bits. */ | 22 | { |
23 | - cs->icc_ctlr_el1[GICV3_NS] &= (ICC_CTLR_EL1_CBPR | ICC_CTLR_EL1_EOIMODE); | 23 | - if (env->irq_pending) { |
24 | + cs->icc_ctlr_el1[GICV3_NS] &= ~(ICC_CTLR_EL1_CBPR | ICC_CTLR_EL1_EOIMODE); | 24 | + if (env->irq_pending && |
25 | if (value & ICC_CTLR_EL3_EOIMODE_EL1NS) { | 25 | + (env->regs[CR_STATUS] & CR_STATUS_PIE)) { |
26 | cs->icc_ctlr_el1[GICV3_NS] |= ICC_CTLR_EL1_EOIMODE; | 26 | env->irq_pending = 0; |
27 | } | 27 | cpu_interrupt(env_cpu(env), CPU_INTERRUPT_HARD); |
28 | @@ -XXX,XX +XXX,XX @@ static void icc_ctlr_el3_write(CPUARMState *env, const ARMCPRegInfo *ri, | ||
29 | cs->icc_ctlr_el1[GICV3_NS] |= ICC_CTLR_EL1_CBPR; | ||
30 | } | ||
31 | |||
32 | - cs->icc_ctlr_el1[GICV3_S] &= (ICC_CTLR_EL1_CBPR | ICC_CTLR_EL1_EOIMODE); | ||
33 | + cs->icc_ctlr_el1[GICV3_S] &= ~(ICC_CTLR_EL1_CBPR | ICC_CTLR_EL1_EOIMODE); | ||
34 | if (value & ICC_CTLR_EL3_EOIMODE_EL1S) { | ||
35 | cs->icc_ctlr_el1[GICV3_S] |= ICC_CTLR_EL1_EOIMODE; | ||
36 | } | 28 | } |
37 | -- | 29 | -- |
38 | 2.20.1 | 30 | 2.20.1 |
39 | 31 | ||
40 | 32 | diff view generated by jsdifflib |
1 | The header file hw/arm/arm.h now includes only declarations | 1 | Remove the hardcoded tabs from hw/arm/tosa.c. There aren't |
---|---|---|---|
2 | relating to hw/arm/boot.c functionality. Rename it accordingly, | 2 | many, but since they're all in constant #defines they're not |
3 | and adjust its header comment. | 3 | going to go away with our usual "only when we touch a function" |
4 | 4 | policy on reformatting. | |
5 | The bulk of this commit was created via | ||
6 | perl -pi -e 's|hw/arm/arm.h|hw/arm/boot.h|' hw/arm/*.c include/hw/arm/*.h | ||
7 | |||
8 | In a few cases we can just delete the #include: | ||
9 | hw/arm/msf2-soc.c, include/hw/arm/aspeed_soc.h and | ||
10 | include/hw/arm/bcm2836.h did not require it. | ||
11 | 5 | ||
12 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
13 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | 7 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> |
14 | Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> | 8 | Message-id: 20200628203748.14250-2-peter.maydell@linaro.org |
15 | Message-id: 20190516163857.6430-4-peter.maydell@linaro.org | ||
16 | --- | 9 | --- |
17 | include/hw/arm/allwinner-a10.h | 2 +- | 10 | hw/arm/tosa.c | 44 ++++++++++++++++++++++---------------------- |
18 | include/hw/arm/aspeed_soc.h | 1 - | 11 | 1 file changed, 22 insertions(+), 22 deletions(-) |
19 | include/hw/arm/bcm2836.h | 1 - | ||
20 | include/hw/arm/{arm.h => boot.h} | 8 ++++---- | ||
21 | include/hw/arm/fsl-imx25.h | 2 +- | ||
22 | include/hw/arm/fsl-imx31.h | 2 +- | ||
23 | include/hw/arm/fsl-imx6.h | 2 +- | ||
24 | include/hw/arm/fsl-imx6ul.h | 2 +- | ||
25 | include/hw/arm/fsl-imx7.h | 2 +- | ||
26 | include/hw/arm/virt.h | 2 +- | ||
27 | include/hw/arm/xlnx-versal.h | 2 +- | ||
28 | include/hw/arm/xlnx-zynqmp.h | 2 +- | ||
29 | hw/arm/armsse.c | 2 +- | ||
30 | hw/arm/armv7m.c | 2 +- | ||
31 | hw/arm/aspeed.c | 2 +- | ||
32 | hw/arm/boot.c | 2 +- | ||
33 | hw/arm/collie.c | 2 +- | ||
34 | hw/arm/exynos4210.c | 2 +- | ||
35 | hw/arm/exynos4_boards.c | 2 +- | ||
36 | hw/arm/highbank.c | 2 +- | ||
37 | hw/arm/integratorcp.c | 2 +- | ||
38 | hw/arm/mainstone.c | 2 +- | ||
39 | hw/arm/microbit.c | 2 +- | ||
40 | hw/arm/mps2-tz.c | 2 +- | ||
41 | hw/arm/mps2.c | 2 +- | ||
42 | hw/arm/msf2-soc.c | 1 - | ||
43 | hw/arm/msf2-som.c | 2 +- | ||
44 | hw/arm/musca.c | 2 +- | ||
45 | hw/arm/musicpal.c | 2 +- | ||
46 | hw/arm/netduino2.c | 2 +- | ||
47 | hw/arm/nrf51_soc.c | 2 +- | ||
48 | hw/arm/nseries.c | 2 +- | ||
49 | hw/arm/omap1.c | 2 +- | ||
50 | hw/arm/omap2.c | 2 +- | ||
51 | hw/arm/omap_sx1.c | 2 +- | ||
52 | hw/arm/palm.c | 2 +- | ||
53 | hw/arm/raspi.c | 2 +- | ||
54 | hw/arm/realview.c | 2 +- | ||
55 | hw/arm/spitz.c | 2 +- | ||
56 | hw/arm/stellaris.c | 2 +- | ||
57 | hw/arm/stm32f205_soc.c | 2 +- | ||
58 | hw/arm/strongarm.c | 2 +- | ||
59 | hw/arm/tosa.c | 2 +- | ||
60 | hw/arm/versatilepb.c | 2 +- | ||
61 | hw/arm/vexpress.c | 2 +- | ||
62 | hw/arm/virt.c | 2 +- | ||
63 | hw/arm/xilinx_zynq.c | 2 +- | ||
64 | hw/arm/xlnx-versal.c | 2 +- | ||
65 | hw/arm/z2.c | 2 +- | ||
66 | 49 files changed, 49 insertions(+), 52 deletions(-) | ||
67 | rename include/hw/arm/{arm.h => boot.h} (98%) | ||
68 | 12 | ||
69 | diff --git a/include/hw/arm/allwinner-a10.h b/include/hw/arm/allwinner-a10.h | ||
70 | index XXXXXXX..XXXXXXX 100644 | ||
71 | --- a/include/hw/arm/allwinner-a10.h | ||
72 | +++ b/include/hw/arm/allwinner-a10.h | ||
73 | @@ -XXX,XX +XXX,XX @@ | ||
74 | #include "qemu-common.h" | ||
75 | #include "qemu/error-report.h" | ||
76 | #include "hw/char/serial.h" | ||
77 | -#include "hw/arm/arm.h" | ||
78 | +#include "hw/arm/boot.h" | ||
79 | #include "hw/timer/allwinner-a10-pit.h" | ||
80 | #include "hw/intc/allwinner-a10-pic.h" | ||
81 | #include "hw/net/allwinner_emac.h" | ||
82 | diff --git a/include/hw/arm/aspeed_soc.h b/include/hw/arm/aspeed_soc.h | ||
83 | index XXXXXXX..XXXXXXX 100644 | ||
84 | --- a/include/hw/arm/aspeed_soc.h | ||
85 | +++ b/include/hw/arm/aspeed_soc.h | ||
86 | @@ -XXX,XX +XXX,XX @@ | ||
87 | #ifndef ASPEED_SOC_H | ||
88 | #define ASPEED_SOC_H | ||
89 | |||
90 | -#include "hw/arm/arm.h" | ||
91 | #include "hw/intc/aspeed_vic.h" | ||
92 | #include "hw/misc/aspeed_scu.h" | ||
93 | #include "hw/misc/aspeed_sdmc.h" | ||
94 | diff --git a/include/hw/arm/bcm2836.h b/include/hw/arm/bcm2836.h | ||
95 | index XXXXXXX..XXXXXXX 100644 | ||
96 | --- a/include/hw/arm/bcm2836.h | ||
97 | +++ b/include/hw/arm/bcm2836.h | ||
98 | @@ -XXX,XX +XXX,XX @@ | ||
99 | #ifndef BCM2836_H | ||
100 | #define BCM2836_H | ||
101 | |||
102 | -#include "hw/arm/arm.h" | ||
103 | #include "hw/arm/bcm2835_peripherals.h" | ||
104 | #include "hw/intc/bcm2836_control.h" | ||
105 | |||
106 | diff --git a/include/hw/arm/arm.h b/include/hw/arm/boot.h | ||
107 | similarity index 98% | ||
108 | rename from include/hw/arm/arm.h | ||
109 | rename to include/hw/arm/boot.h | ||
110 | index XXXXXXX..XXXXXXX 100644 | ||
111 | --- a/include/hw/arm/arm.h | ||
112 | +++ b/include/hw/arm/boot.h | ||
113 | @@ -XXX,XX +XXX,XX @@ | ||
114 | /* | ||
115 | - * Misc ARM declarations | ||
116 | + * ARM kernel loader. | ||
117 | * | ||
118 | * Copyright (c) 2006 CodeSourcery. | ||
119 | * Written by Paul Brook | ||
120 | @@ -XXX,XX +XXX,XX @@ | ||
121 | * | ||
122 | */ | ||
123 | |||
124 | -#ifndef HW_ARM_H | ||
125 | -#define HW_ARM_H | ||
126 | +#ifndef HW_ARM_BOOT_H | ||
127 | +#define HW_ARM_BOOT_H | ||
128 | |||
129 | #include "exec/memory.h" | ||
130 | #include "target/arm/cpu-qom.h" | ||
131 | @@ -XXX,XX +XXX,XX @@ void arm_write_secure_board_setup_dummy_smc(ARMCPU *cpu, | ||
132 | const struct arm_boot_info *info, | ||
133 | hwaddr mvbar_addr); | ||
134 | |||
135 | -#endif /* HW_ARM_H */ | ||
136 | +#endif /* HW_ARM_BOOT_H */ | ||
137 | diff --git a/include/hw/arm/fsl-imx25.h b/include/hw/arm/fsl-imx25.h | ||
138 | index XXXXXXX..XXXXXXX 100644 | ||
139 | --- a/include/hw/arm/fsl-imx25.h | ||
140 | +++ b/include/hw/arm/fsl-imx25.h | ||
141 | @@ -XXX,XX +XXX,XX @@ | ||
142 | #ifndef FSL_IMX25_H | ||
143 | #define FSL_IMX25_H | ||
144 | |||
145 | -#include "hw/arm/arm.h" | ||
146 | +#include "hw/arm/boot.h" | ||
147 | #include "hw/intc/imx_avic.h" | ||
148 | #include "hw/misc/imx25_ccm.h" | ||
149 | #include "hw/char/imx_serial.h" | ||
150 | diff --git a/include/hw/arm/fsl-imx31.h b/include/hw/arm/fsl-imx31.h | ||
151 | index XXXXXXX..XXXXXXX 100644 | ||
152 | --- a/include/hw/arm/fsl-imx31.h | ||
153 | +++ b/include/hw/arm/fsl-imx31.h | ||
154 | @@ -XXX,XX +XXX,XX @@ | ||
155 | #ifndef FSL_IMX31_H | ||
156 | #define FSL_IMX31_H | ||
157 | |||
158 | -#include "hw/arm/arm.h" | ||
159 | +#include "hw/arm/boot.h" | ||
160 | #include "hw/intc/imx_avic.h" | ||
161 | #include "hw/misc/imx31_ccm.h" | ||
162 | #include "hw/char/imx_serial.h" | ||
163 | diff --git a/include/hw/arm/fsl-imx6.h b/include/hw/arm/fsl-imx6.h | ||
164 | index XXXXXXX..XXXXXXX 100644 | ||
165 | --- a/include/hw/arm/fsl-imx6.h | ||
166 | +++ b/include/hw/arm/fsl-imx6.h | ||
167 | @@ -XXX,XX +XXX,XX @@ | ||
168 | #ifndef FSL_IMX6_H | ||
169 | #define FSL_IMX6_H | ||
170 | |||
171 | -#include "hw/arm/arm.h" | ||
172 | +#include "hw/arm/boot.h" | ||
173 | #include "hw/cpu/a9mpcore.h" | ||
174 | #include "hw/misc/imx6_ccm.h" | ||
175 | #include "hw/misc/imx6_src.h" | ||
176 | diff --git a/include/hw/arm/fsl-imx6ul.h b/include/hw/arm/fsl-imx6ul.h | ||
177 | index XXXXXXX..XXXXXXX 100644 | ||
178 | --- a/include/hw/arm/fsl-imx6ul.h | ||
179 | +++ b/include/hw/arm/fsl-imx6ul.h | ||
180 | @@ -XXX,XX +XXX,XX @@ | ||
181 | #ifndef FSL_IMX6UL_H | ||
182 | #define FSL_IMX6UL_H | ||
183 | |||
184 | -#include "hw/arm/arm.h" | ||
185 | +#include "hw/arm/boot.h" | ||
186 | #include "hw/cpu/a15mpcore.h" | ||
187 | #include "hw/misc/imx6ul_ccm.h" | ||
188 | #include "hw/misc/imx6_src.h" | ||
189 | diff --git a/include/hw/arm/fsl-imx7.h b/include/hw/arm/fsl-imx7.h | ||
190 | index XXXXXXX..XXXXXXX 100644 | ||
191 | --- a/include/hw/arm/fsl-imx7.h | ||
192 | +++ b/include/hw/arm/fsl-imx7.h | ||
193 | @@ -XXX,XX +XXX,XX @@ | ||
194 | #ifndef FSL_IMX7_H | ||
195 | #define FSL_IMX7_H | ||
196 | |||
197 | -#include "hw/arm/arm.h" | ||
198 | +#include "hw/arm/boot.h" | ||
199 | #include "hw/cpu/a15mpcore.h" | ||
200 | #include "hw/intc/imx_gpcv2.h" | ||
201 | #include "hw/misc/imx7_ccm.h" | ||
202 | diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h | ||
203 | index XXXXXXX..XXXXXXX 100644 | ||
204 | --- a/include/hw/arm/virt.h | ||
205 | +++ b/include/hw/arm/virt.h | ||
206 | @@ -XXX,XX +XXX,XX @@ | ||
207 | #include "exec/hwaddr.h" | ||
208 | #include "qemu/notify.h" | ||
209 | #include "hw/boards.h" | ||
210 | -#include "hw/arm/arm.h" | ||
211 | +#include "hw/arm/boot.h" | ||
212 | #include "hw/block/flash.h" | ||
213 | #include "sysemu/kvm.h" | ||
214 | #include "hw/intc/arm_gicv3_common.h" | ||
215 | diff --git a/include/hw/arm/xlnx-versal.h b/include/hw/arm/xlnx-versal.h | ||
216 | index XXXXXXX..XXXXXXX 100644 | ||
217 | --- a/include/hw/arm/xlnx-versal.h | ||
218 | +++ b/include/hw/arm/xlnx-versal.h | ||
219 | @@ -XXX,XX +XXX,XX @@ | ||
220 | #define XLNX_VERSAL_H | ||
221 | |||
222 | #include "hw/sysbus.h" | ||
223 | -#include "hw/arm/arm.h" | ||
224 | +#include "hw/arm/boot.h" | ||
225 | #include "hw/intc/arm_gicv3.h" | ||
226 | |||
227 | #define TYPE_XLNX_VERSAL "xlnx-versal" | ||
228 | diff --git a/include/hw/arm/xlnx-zynqmp.h b/include/hw/arm/xlnx-zynqmp.h | ||
229 | index XXXXXXX..XXXXXXX 100644 | ||
230 | --- a/include/hw/arm/xlnx-zynqmp.h | ||
231 | +++ b/include/hw/arm/xlnx-zynqmp.h | ||
232 | @@ -XXX,XX +XXX,XX @@ | ||
233 | #ifndef XLNX_ZYNQMP_H | ||
234 | |||
235 | #include "qemu-common.h" | ||
236 | -#include "hw/arm/arm.h" | ||
237 | +#include "hw/arm/boot.h" | ||
238 | #include "hw/intc/arm_gic.h" | ||
239 | #include "hw/net/cadence_gem.h" | ||
240 | #include "hw/char/cadence_uart.h" | ||
241 | diff --git a/hw/arm/armsse.c b/hw/arm/armsse.c | ||
242 | index XXXXXXX..XXXXXXX 100644 | ||
243 | --- a/hw/arm/armsse.c | ||
244 | +++ b/hw/arm/armsse.c | ||
245 | @@ -XXX,XX +XXX,XX @@ | ||
246 | #include "hw/sysbus.h" | ||
247 | #include "hw/registerfields.h" | ||
248 | #include "hw/arm/armsse.h" | ||
249 | -#include "hw/arm/arm.h" | ||
250 | +#include "hw/arm/boot.h" | ||
251 | |||
252 | /* Format of the System Information block SYS_CONFIG register */ | ||
253 | typedef enum SysConfigFormat { | ||
254 | diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c | ||
255 | index XXXXXXX..XXXXXXX 100644 | ||
256 | --- a/hw/arm/armv7m.c | ||
257 | +++ b/hw/arm/armv7m.c | ||
258 | @@ -XXX,XX +XXX,XX @@ | ||
259 | #include "qemu-common.h" | ||
260 | #include "cpu.h" | ||
261 | #include "hw/sysbus.h" | ||
262 | -#include "hw/arm/arm.h" | ||
263 | +#include "hw/arm/boot.h" | ||
264 | #include "hw/loader.h" | ||
265 | #include "elf.h" | ||
266 | #include "sysemu/qtest.h" | ||
267 | diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c | ||
268 | index XXXXXXX..XXXXXXX 100644 | ||
269 | --- a/hw/arm/aspeed.c | ||
270 | +++ b/hw/arm/aspeed.c | ||
271 | @@ -XXX,XX +XXX,XX @@ | ||
272 | #include "qemu-common.h" | ||
273 | #include "cpu.h" | ||
274 | #include "exec/address-spaces.h" | ||
275 | -#include "hw/arm/arm.h" | ||
276 | +#include "hw/arm/boot.h" | ||
277 | #include "hw/arm/aspeed.h" | ||
278 | #include "hw/arm/aspeed_soc.h" | ||
279 | #include "hw/boards.h" | ||
280 | diff --git a/hw/arm/boot.c b/hw/arm/boot.c | ||
281 | index XXXXXXX..XXXXXXX 100644 | ||
282 | --- a/hw/arm/boot.c | ||
283 | +++ b/hw/arm/boot.c | ||
284 | @@ -XXX,XX +XXX,XX @@ | ||
285 | #include "qapi/error.h" | ||
286 | #include <libfdt.h> | ||
287 | #include "hw/hw.h" | ||
288 | -#include "hw/arm/arm.h" | ||
289 | +#include "hw/arm/boot.h" | ||
290 | #include "hw/arm/linux-boot-if.h" | ||
291 | #include "sysemu/kvm.h" | ||
292 | #include "sysemu/sysemu.h" | ||
293 | diff --git a/hw/arm/collie.c b/hw/arm/collie.c | ||
294 | index XXXXXXX..XXXXXXX 100644 | ||
295 | --- a/hw/arm/collie.c | ||
296 | +++ b/hw/arm/collie.c | ||
297 | @@ -XXX,XX +XXX,XX @@ | ||
298 | #include "hw/sysbus.h" | ||
299 | #include "hw/boards.h" | ||
300 | #include "strongarm.h" | ||
301 | -#include "hw/arm/arm.h" | ||
302 | +#include "hw/arm/boot.h" | ||
303 | #include "hw/block/flash.h" | ||
304 | #include "exec/address-spaces.h" | ||
305 | #include "cpu.h" | ||
306 | diff --git a/hw/arm/exynos4210.c b/hw/arm/exynos4210.c | ||
307 | index XXXXXXX..XXXXXXX 100644 | ||
308 | --- a/hw/arm/exynos4210.c | ||
309 | +++ b/hw/arm/exynos4210.c | ||
310 | @@ -XXX,XX +XXX,XX @@ | ||
311 | #include "hw/boards.h" | ||
312 | #include "sysemu/sysemu.h" | ||
313 | #include "hw/sysbus.h" | ||
314 | -#include "hw/arm/arm.h" | ||
315 | +#include "hw/arm/boot.h" | ||
316 | #include "hw/loader.h" | ||
317 | #include "hw/arm/exynos4210.h" | ||
318 | #include "hw/sd/sdhci.h" | ||
319 | diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c | ||
320 | index XXXXXXX..XXXXXXX 100644 | ||
321 | --- a/hw/arm/exynos4_boards.c | ||
322 | +++ b/hw/arm/exynos4_boards.c | ||
323 | @@ -XXX,XX +XXX,XX @@ | ||
324 | #include "sysemu/sysemu.h" | ||
325 | #include "hw/sysbus.h" | ||
326 | #include "net/net.h" | ||
327 | -#include "hw/arm/arm.h" | ||
328 | +#include "hw/arm/boot.h" | ||
329 | #include "exec/address-spaces.h" | ||
330 | #include "hw/arm/exynos4210.h" | ||
331 | #include "hw/net/lan9118.h" | ||
332 | diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c | ||
333 | index XXXXXXX..XXXXXXX 100644 | ||
334 | --- a/hw/arm/highbank.c | ||
335 | +++ b/hw/arm/highbank.c | ||
336 | @@ -XXX,XX +XXX,XX @@ | ||
337 | #include "qemu/osdep.h" | ||
338 | #include "qapi/error.h" | ||
339 | #include "hw/sysbus.h" | ||
340 | -#include "hw/arm/arm.h" | ||
341 | +#include "hw/arm/boot.h" | ||
342 | #include "hw/loader.h" | ||
343 | #include "net/net.h" | ||
344 | #include "sysemu/kvm.h" | ||
345 | diff --git a/hw/arm/integratorcp.c b/hw/arm/integratorcp.c | ||
346 | index XXXXXXX..XXXXXXX 100644 | ||
347 | --- a/hw/arm/integratorcp.c | ||
348 | +++ b/hw/arm/integratorcp.c | ||
349 | @@ -XXX,XX +XXX,XX @@ | ||
350 | #include "cpu.h" | ||
351 | #include "hw/sysbus.h" | ||
352 | #include "hw/boards.h" | ||
353 | -#include "hw/arm/arm.h" | ||
354 | +#include "hw/arm/boot.h" | ||
355 | #include "hw/misc/arm_integrator_debug.h" | ||
356 | #include "hw/net/smc91c111.h" | ||
357 | #include "net/net.h" | ||
358 | diff --git a/hw/arm/mainstone.c b/hw/arm/mainstone.c | ||
359 | index XXXXXXX..XXXXXXX 100644 | ||
360 | --- a/hw/arm/mainstone.c | ||
361 | +++ b/hw/arm/mainstone.c | ||
362 | @@ -XXX,XX +XXX,XX @@ | ||
363 | #include "qapi/error.h" | ||
364 | #include "hw/hw.h" | ||
365 | #include "hw/arm/pxa.h" | ||
366 | -#include "hw/arm/arm.h" | ||
367 | +#include "hw/arm/boot.h" | ||
368 | #include "net/net.h" | ||
369 | #include "hw/net/smc91c111.h" | ||
370 | #include "hw/boards.h" | ||
371 | diff --git a/hw/arm/microbit.c b/hw/arm/microbit.c | ||
372 | index XXXXXXX..XXXXXXX 100644 | ||
373 | --- a/hw/arm/microbit.c | ||
374 | +++ b/hw/arm/microbit.c | ||
375 | @@ -XXX,XX +XXX,XX @@ | ||
376 | #include "qemu/osdep.h" | ||
377 | #include "qapi/error.h" | ||
378 | #include "hw/boards.h" | ||
379 | -#include "hw/arm/arm.h" | ||
380 | +#include "hw/arm/boot.h" | ||
381 | #include "sysemu/sysemu.h" | ||
382 | #include "exec/address-spaces.h" | ||
383 | |||
384 | diff --git a/hw/arm/mps2-tz.c b/hw/arm/mps2-tz.c | ||
385 | index XXXXXXX..XXXXXXX 100644 | ||
386 | --- a/hw/arm/mps2-tz.c | ||
387 | +++ b/hw/arm/mps2-tz.c | ||
388 | @@ -XXX,XX +XXX,XX @@ | ||
389 | #include "qemu/osdep.h" | ||
390 | #include "qapi/error.h" | ||
391 | #include "qemu/error-report.h" | ||
392 | -#include "hw/arm/arm.h" | ||
393 | +#include "hw/arm/boot.h" | ||
394 | #include "hw/arm/armv7m.h" | ||
395 | #include "hw/or-irq.h" | ||
396 | #include "hw/boards.h" | ||
397 | diff --git a/hw/arm/mps2.c b/hw/arm/mps2.c | ||
398 | index XXXXXXX..XXXXXXX 100644 | ||
399 | --- a/hw/arm/mps2.c | ||
400 | +++ b/hw/arm/mps2.c | ||
401 | @@ -XXX,XX +XXX,XX @@ | ||
402 | #include "qemu/osdep.h" | ||
403 | #include "qapi/error.h" | ||
404 | #include "qemu/error-report.h" | ||
405 | -#include "hw/arm/arm.h" | ||
406 | +#include "hw/arm/boot.h" | ||
407 | #include "hw/arm/armv7m.h" | ||
408 | #include "hw/or-irq.h" | ||
409 | #include "hw/boards.h" | ||
410 | diff --git a/hw/arm/msf2-soc.c b/hw/arm/msf2-soc.c | ||
411 | index XXXXXXX..XXXXXXX 100644 | ||
412 | --- a/hw/arm/msf2-soc.c | ||
413 | +++ b/hw/arm/msf2-soc.c | ||
414 | @@ -XXX,XX +XXX,XX @@ | ||
415 | #include "qemu/units.h" | ||
416 | #include "qapi/error.h" | ||
417 | #include "qemu-common.h" | ||
418 | -#include "hw/arm/arm.h" | ||
419 | #include "exec/address-spaces.h" | ||
420 | #include "hw/char/serial.h" | ||
421 | #include "hw/boards.h" | ||
422 | diff --git a/hw/arm/msf2-som.c b/hw/arm/msf2-som.c | ||
423 | index XXXXXXX..XXXXXXX 100644 | ||
424 | --- a/hw/arm/msf2-som.c | ||
425 | +++ b/hw/arm/msf2-som.c | ||
426 | @@ -XXX,XX +XXX,XX @@ | ||
427 | #include "qapi/error.h" | ||
428 | #include "qemu/error-report.h" | ||
429 | #include "hw/boards.h" | ||
430 | -#include "hw/arm/arm.h" | ||
431 | +#include "hw/arm/boot.h" | ||
432 | #include "exec/address-spaces.h" | ||
433 | #include "hw/arm/msf2-soc.h" | ||
434 | #include "cpu.h" | ||
435 | diff --git a/hw/arm/musca.c b/hw/arm/musca.c | ||
436 | index XXXXXXX..XXXXXXX 100644 | ||
437 | --- a/hw/arm/musca.c | ||
438 | +++ b/hw/arm/musca.c | ||
439 | @@ -XXX,XX +XXX,XX @@ | ||
440 | #include "qapi/error.h" | ||
441 | #include "exec/address-spaces.h" | ||
442 | #include "sysemu/sysemu.h" | ||
443 | -#include "hw/arm/arm.h" | ||
444 | +#include "hw/arm/boot.h" | ||
445 | #include "hw/arm/armsse.h" | ||
446 | #include "hw/boards.h" | ||
447 | #include "hw/char/pl011.h" | ||
448 | diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c | ||
449 | index XXXXXXX..XXXXXXX 100644 | ||
450 | --- a/hw/arm/musicpal.c | ||
451 | +++ b/hw/arm/musicpal.c | ||
452 | @@ -XXX,XX +XXX,XX @@ | ||
453 | #include "qemu-common.h" | ||
454 | #include "cpu.h" | ||
455 | #include "hw/sysbus.h" | ||
456 | -#include "hw/arm/arm.h" | ||
457 | +#include "hw/arm/boot.h" | ||
458 | #include "net/net.h" | ||
459 | #include "sysemu/sysemu.h" | ||
460 | #include "hw/boards.h" | ||
461 | diff --git a/hw/arm/netduino2.c b/hw/arm/netduino2.c | ||
462 | index XXXXXXX..XXXXXXX 100644 | ||
463 | --- a/hw/arm/netduino2.c | ||
464 | +++ b/hw/arm/netduino2.c | ||
465 | @@ -XXX,XX +XXX,XX @@ | ||
466 | #include "hw/boards.h" | ||
467 | #include "qemu/error-report.h" | ||
468 | #include "hw/arm/stm32f205_soc.h" | ||
469 | -#include "hw/arm/arm.h" | ||
470 | +#include "hw/arm/boot.h" | ||
471 | |||
472 | static void netduino2_init(MachineState *machine) | ||
473 | { | ||
474 | diff --git a/hw/arm/nrf51_soc.c b/hw/arm/nrf51_soc.c | ||
475 | index XXXXXXX..XXXXXXX 100644 | ||
476 | --- a/hw/arm/nrf51_soc.c | ||
477 | +++ b/hw/arm/nrf51_soc.c | ||
478 | @@ -XXX,XX +XXX,XX @@ | ||
479 | #include "qemu/osdep.h" | ||
480 | #include "qapi/error.h" | ||
481 | #include "qemu-common.h" | ||
482 | -#include "hw/arm/arm.h" | ||
483 | +#include "hw/arm/boot.h" | ||
484 | #include "hw/sysbus.h" | ||
485 | #include "hw/boards.h" | ||
486 | #include "hw/misc/unimp.h" | ||
487 | diff --git a/hw/arm/nseries.c b/hw/arm/nseries.c | ||
488 | index XXXXXXX..XXXXXXX 100644 | ||
489 | --- a/hw/arm/nseries.c | ||
490 | +++ b/hw/arm/nseries.c | ||
491 | @@ -XXX,XX +XXX,XX @@ | ||
492 | #include "qemu/bswap.h" | ||
493 | #include "sysemu/sysemu.h" | ||
494 | #include "hw/arm/omap.h" | ||
495 | -#include "hw/arm/arm.h" | ||
496 | +#include "hw/arm/boot.h" | ||
497 | #include "hw/irq.h" | ||
498 | #include "ui/console.h" | ||
499 | #include "hw/boards.h" | ||
500 | diff --git a/hw/arm/omap1.c b/hw/arm/omap1.c | ||
501 | index XXXXXXX..XXXXXXX 100644 | ||
502 | --- a/hw/arm/omap1.c | ||
503 | +++ b/hw/arm/omap1.c | ||
504 | @@ -XXX,XX +XXX,XX @@ | ||
505 | #include "cpu.h" | ||
506 | #include "hw/boards.h" | ||
507 | #include "hw/hw.h" | ||
508 | -#include "hw/arm/arm.h" | ||
509 | +#include "hw/arm/boot.h" | ||
510 | #include "hw/arm/omap.h" | ||
511 | #include "sysemu/sysemu.h" | ||
512 | #include "hw/arm/soc_dma.h" | ||
513 | diff --git a/hw/arm/omap2.c b/hw/arm/omap2.c | ||
514 | index XXXXXXX..XXXXXXX 100644 | ||
515 | --- a/hw/arm/omap2.c | ||
516 | +++ b/hw/arm/omap2.c | ||
517 | @@ -XXX,XX +XXX,XX @@ | ||
518 | #include "sysemu/qtest.h" | ||
519 | #include "hw/boards.h" | ||
520 | #include "hw/hw.h" | ||
521 | -#include "hw/arm/arm.h" | ||
522 | +#include "hw/arm/boot.h" | ||
523 | #include "hw/arm/omap.h" | ||
524 | #include "sysemu/sysemu.h" | ||
525 | #include "qemu/timer.h" | ||
526 | diff --git a/hw/arm/omap_sx1.c b/hw/arm/omap_sx1.c | ||
527 | index XXXXXXX..XXXXXXX 100644 | ||
528 | --- a/hw/arm/omap_sx1.c | ||
529 | +++ b/hw/arm/omap_sx1.c | ||
530 | @@ -XXX,XX +XXX,XX @@ | ||
531 | #include "ui/console.h" | ||
532 | #include "hw/arm/omap.h" | ||
533 | #include "hw/boards.h" | ||
534 | -#include "hw/arm/arm.h" | ||
535 | +#include "hw/arm/boot.h" | ||
536 | #include "hw/block/flash.h" | ||
537 | #include "sysemu/qtest.h" | ||
538 | #include "exec/address-spaces.h" | ||
539 | diff --git a/hw/arm/palm.c b/hw/arm/palm.c | ||
540 | index XXXXXXX..XXXXXXX 100644 | ||
541 | --- a/hw/arm/palm.c | ||
542 | +++ b/hw/arm/palm.c | ||
543 | @@ -XXX,XX +XXX,XX @@ | ||
544 | #include "ui/console.h" | ||
545 | #include "hw/arm/omap.h" | ||
546 | #include "hw/boards.h" | ||
547 | -#include "hw/arm/arm.h" | ||
548 | +#include "hw/arm/boot.h" | ||
549 | #include "hw/input/tsc2xxx.h" | ||
550 | #include "hw/loader.h" | ||
551 | #include "exec/address-spaces.h" | ||
552 | diff --git a/hw/arm/raspi.c b/hw/arm/raspi.c | ||
553 | index XXXXXXX..XXXXXXX 100644 | ||
554 | --- a/hw/arm/raspi.c | ||
555 | +++ b/hw/arm/raspi.c | ||
556 | @@ -XXX,XX +XXX,XX @@ | ||
557 | #include "qemu/error-report.h" | ||
558 | #include "hw/boards.h" | ||
559 | #include "hw/loader.h" | ||
560 | -#include "hw/arm/arm.h" | ||
561 | +#include "hw/arm/boot.h" | ||
562 | #include "sysemu/sysemu.h" | ||
563 | |||
564 | #define SMPBOOT_ADDR 0x300 /* this should leave enough space for ATAGS */ | ||
565 | diff --git a/hw/arm/realview.c b/hw/arm/realview.c | ||
566 | index XXXXXXX..XXXXXXX 100644 | ||
567 | --- a/hw/arm/realview.c | ||
568 | +++ b/hw/arm/realview.c | ||
569 | @@ -XXX,XX +XXX,XX @@ | ||
570 | #include "qemu-common.h" | ||
571 | #include "cpu.h" | ||
572 | #include "hw/sysbus.h" | ||
573 | -#include "hw/arm/arm.h" | ||
574 | +#include "hw/arm/boot.h" | ||
575 | #include "hw/arm/primecell.h" | ||
576 | #include "hw/net/lan9118.h" | ||
577 | #include "hw/net/smc91c111.h" | ||
578 | diff --git a/hw/arm/spitz.c b/hw/arm/spitz.c | ||
579 | index XXXXXXX..XXXXXXX 100644 | ||
580 | --- a/hw/arm/spitz.c | ||
581 | +++ b/hw/arm/spitz.c | ||
582 | @@ -XXX,XX +XXX,XX @@ | ||
583 | #include "qapi/error.h" | ||
584 | #include "hw/hw.h" | ||
585 | #include "hw/arm/pxa.h" | ||
586 | -#include "hw/arm/arm.h" | ||
587 | +#include "hw/arm/boot.h" | ||
588 | #include "sysemu/sysemu.h" | ||
589 | #include "hw/pcmcia.h" | ||
590 | #include "hw/i2c/i2c.h" | ||
591 | diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c | ||
592 | index XXXXXXX..XXXXXXX 100644 | ||
593 | --- a/hw/arm/stellaris.c | ||
594 | +++ b/hw/arm/stellaris.c | ||
595 | @@ -XXX,XX +XXX,XX @@ | ||
596 | #include "qapi/error.h" | ||
597 | #include "hw/sysbus.h" | ||
598 | #include "hw/ssi/ssi.h" | ||
599 | -#include "hw/arm/arm.h" | ||
600 | +#include "hw/arm/boot.h" | ||
601 | #include "qemu/timer.h" | ||
602 | #include "hw/i2c/i2c.h" | ||
603 | #include "net/net.h" | ||
604 | diff --git a/hw/arm/stm32f205_soc.c b/hw/arm/stm32f205_soc.c | ||
605 | index XXXXXXX..XXXXXXX 100644 | ||
606 | --- a/hw/arm/stm32f205_soc.c | ||
607 | +++ b/hw/arm/stm32f205_soc.c | ||
608 | @@ -XXX,XX +XXX,XX @@ | ||
609 | #include "qemu/osdep.h" | ||
610 | #include "qapi/error.h" | ||
611 | #include "qemu-common.h" | ||
612 | -#include "hw/arm/arm.h" | ||
613 | +#include "hw/arm/boot.h" | ||
614 | #include "exec/address-spaces.h" | ||
615 | #include "hw/arm/stm32f205_soc.h" | ||
616 | |||
617 | diff --git a/hw/arm/strongarm.c b/hw/arm/strongarm.c | ||
618 | index XXXXXXX..XXXXXXX 100644 | ||
619 | --- a/hw/arm/strongarm.c | ||
620 | +++ b/hw/arm/strongarm.c | ||
621 | @@ -XXX,XX +XXX,XX @@ | ||
622 | #include "hw/sysbus.h" | ||
623 | #include "strongarm.h" | ||
624 | #include "qemu/error-report.h" | ||
625 | -#include "hw/arm/arm.h" | ||
626 | +#include "hw/arm/boot.h" | ||
627 | #include "chardev/char-fe.h" | ||
628 | #include "chardev/char-serial.h" | ||
629 | #include "sysemu/sysemu.h" | ||
630 | diff --git a/hw/arm/tosa.c b/hw/arm/tosa.c | 13 | diff --git a/hw/arm/tosa.c b/hw/arm/tosa.c |
631 | index XXXXXXX..XXXXXXX 100644 | 14 | index XXXXXXX..XXXXXXX 100644 |
632 | --- a/hw/arm/tosa.c | 15 | --- a/hw/arm/tosa.c |
633 | +++ b/hw/arm/tosa.c | 16 | +++ b/hw/arm/tosa.c |
634 | @@ -XXX,XX +XXX,XX @@ | 17 | @@ -XXX,XX +XXX,XX @@ |
635 | #include "qapi/error.h" | ||
636 | #include "hw/hw.h" | ||
637 | #include "hw/arm/pxa.h" | ||
638 | -#include "hw/arm/arm.h" | ||
639 | +#include "hw/arm/boot.h" | ||
640 | #include "hw/arm/sharpsl.h" | ||
641 | #include "hw/pcmcia.h" | ||
642 | #include "hw/boards.h" | ||
643 | diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c | ||
644 | index XXXXXXX..XXXXXXX 100644 | ||
645 | --- a/hw/arm/versatilepb.c | ||
646 | +++ b/hw/arm/versatilepb.c | ||
647 | @@ -XXX,XX +XXX,XX @@ | ||
648 | #include "qemu-common.h" | ||
649 | #include "cpu.h" | ||
650 | #include "hw/sysbus.h" | 18 | #include "hw/sysbus.h" |
651 | -#include "hw/arm/arm.h" | ||
652 | +#include "hw/arm/boot.h" | ||
653 | #include "hw/net/smc91c111.h" | ||
654 | #include "net/net.h" | ||
655 | #include "sysemu/sysemu.h" | ||
656 | diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c | ||
657 | index XXXXXXX..XXXXXXX 100644 | ||
658 | --- a/hw/arm/vexpress.c | ||
659 | +++ b/hw/arm/vexpress.c | ||
660 | @@ -XXX,XX +XXX,XX @@ | ||
661 | #include "qemu-common.h" | ||
662 | #include "cpu.h" | ||
663 | #include "hw/sysbus.h" | ||
664 | -#include "hw/arm/arm.h" | ||
665 | +#include "hw/arm/boot.h" | ||
666 | #include "hw/arm/primecell.h" | ||
667 | #include "hw/net/lan9118.h" | ||
668 | #include "hw/i2c/i2c.h" | ||
669 | diff --git a/hw/arm/virt.c b/hw/arm/virt.c | ||
670 | index XXXXXXX..XXXXXXX 100644 | ||
671 | --- a/hw/arm/virt.c | ||
672 | +++ b/hw/arm/virt.c | ||
673 | @@ -XXX,XX +XXX,XX @@ | ||
674 | #include "qemu/option.h" | ||
675 | #include "qapi/error.h" | ||
676 | #include "hw/sysbus.h" | ||
677 | -#include "hw/arm/arm.h" | ||
678 | +#include "hw/arm/boot.h" | ||
679 | #include "hw/arm/primecell.h" | ||
680 | #include "hw/arm/virt.h" | ||
681 | #include "hw/block/flash.h" | ||
682 | diff --git a/hw/arm/xilinx_zynq.c b/hw/arm/xilinx_zynq.c | ||
683 | index XXXXXXX..XXXXXXX 100644 | ||
684 | --- a/hw/arm/xilinx_zynq.c | ||
685 | +++ b/hw/arm/xilinx_zynq.c | ||
686 | @@ -XXX,XX +XXX,XX @@ | ||
687 | #include "qemu-common.h" | ||
688 | #include "cpu.h" | ||
689 | #include "hw/sysbus.h" | ||
690 | -#include "hw/arm/arm.h" | ||
691 | +#include "hw/arm/boot.h" | ||
692 | #include "net/net.h" | ||
693 | #include "exec/address-spaces.h" | 19 | #include "exec/address-spaces.h" |
694 | #include "sysemu/sysemu.h" | 20 | |
695 | diff --git a/hw/arm/xlnx-versal.c b/hw/arm/xlnx-versal.c | 21 | -#define TOSA_RAM 0x04000000 |
696 | index XXXXXXX..XXXXXXX 100644 | 22 | -#define TOSA_ROM 0x00800000 |
697 | --- a/hw/arm/xlnx-versal.c | 23 | +#define TOSA_RAM 0x04000000 |
698 | +++ b/hw/arm/xlnx-versal.c | 24 | +#define TOSA_ROM 0x00800000 |
699 | @@ -XXX,XX +XXX,XX @@ | 25 | |
700 | #include "net/net.h" | 26 | -#define TOSA_GPIO_USB_IN (5) |
701 | #include "sysemu/sysemu.h" | 27 | -#define TOSA_GPIO_nSD_DETECT (9) |
702 | #include "sysemu/kvm.h" | 28 | -#define TOSA_GPIO_ON_RESET (19) |
703 | -#include "hw/arm/arm.h" | 29 | -#define TOSA_GPIO_CF_IRQ (21) /* CF slot0 Ready */ |
704 | +#include "hw/arm/boot.h" | 30 | -#define TOSA_GPIO_CF_CD (13) |
705 | #include "kvm_arm.h" | 31 | -#define TOSA_GPIO_TC6393XB_INT (15) |
706 | #include "hw/misc/unimp.h" | 32 | -#define TOSA_GPIO_JC_CF_IRQ (36) /* CF slot1 Ready */ |
707 | #include "hw/intc/arm_gicv3_common.h" | 33 | +#define TOSA_GPIO_USB_IN (5) |
708 | diff --git a/hw/arm/z2.c b/hw/arm/z2.c | 34 | +#define TOSA_GPIO_nSD_DETECT (9) |
709 | index XXXXXXX..XXXXXXX 100644 | 35 | +#define TOSA_GPIO_ON_RESET (19) |
710 | --- a/hw/arm/z2.c | 36 | +#define TOSA_GPIO_CF_IRQ (21) /* CF slot0 Ready */ |
711 | +++ b/hw/arm/z2.c | 37 | +#define TOSA_GPIO_CF_CD (13) |
712 | @@ -XXX,XX +XXX,XX @@ | 38 | +#define TOSA_GPIO_TC6393XB_INT (15) |
713 | #include "qemu/osdep.h" | 39 | +#define TOSA_GPIO_JC_CF_IRQ (36) /* CF slot1 Ready */ |
714 | #include "hw/hw.h" | 40 | |
715 | #include "hw/arm/pxa.h" | 41 | -#define TOSA_SCOOP_GPIO_BASE 1 |
716 | -#include "hw/arm/arm.h" | 42 | -#define TOSA_GPIO_IR_POWERDWN (TOSA_SCOOP_GPIO_BASE + 2) |
717 | +#include "hw/arm/boot.h" | 43 | -#define TOSA_GPIO_SD_WP (TOSA_SCOOP_GPIO_BASE + 3) |
718 | #include "hw/i2c/i2c.h" | 44 | -#define TOSA_GPIO_PWR_ON (TOSA_SCOOP_GPIO_BASE + 4) |
719 | #include "hw/ssi/ssi.h" | 45 | +#define TOSA_SCOOP_GPIO_BASE 1 |
720 | #include "hw/boards.h" | 46 | +#define TOSA_GPIO_IR_POWERDWN (TOSA_SCOOP_GPIO_BASE + 2) |
47 | +#define TOSA_GPIO_SD_WP (TOSA_SCOOP_GPIO_BASE + 3) | ||
48 | +#define TOSA_GPIO_PWR_ON (TOSA_SCOOP_GPIO_BASE + 4) | ||
49 | |||
50 | -#define TOSA_SCOOP_JC_GPIO_BASE 1 | ||
51 | -#define TOSA_GPIO_BT_LED (TOSA_SCOOP_JC_GPIO_BASE + 0) | ||
52 | -#define TOSA_GPIO_NOTE_LED (TOSA_SCOOP_JC_GPIO_BASE + 1) | ||
53 | -#define TOSA_GPIO_CHRG_ERR_LED (TOSA_SCOOP_JC_GPIO_BASE + 2) | ||
54 | -#define TOSA_GPIO_TC6393XB_L3V_ON (TOSA_SCOOP_JC_GPIO_BASE + 5) | ||
55 | -#define TOSA_GPIO_WLAN_LED (TOSA_SCOOP_JC_GPIO_BASE + 7) | ||
56 | +#define TOSA_SCOOP_JC_GPIO_BASE 1 | ||
57 | +#define TOSA_GPIO_BT_LED (TOSA_SCOOP_JC_GPIO_BASE + 0) | ||
58 | +#define TOSA_GPIO_NOTE_LED (TOSA_SCOOP_JC_GPIO_BASE + 1) | ||
59 | +#define TOSA_GPIO_CHRG_ERR_LED (TOSA_SCOOP_JC_GPIO_BASE + 2) | ||
60 | +#define TOSA_GPIO_TC6393XB_L3V_ON (TOSA_SCOOP_JC_GPIO_BASE + 5) | ||
61 | +#define TOSA_GPIO_WLAN_LED (TOSA_SCOOP_JC_GPIO_BASE + 7) | ||
62 | |||
63 | -#define DAC_BASE 0x4e | ||
64 | -#define DAC_CH1 0 | ||
65 | -#define DAC_CH2 1 | ||
66 | +#define DAC_BASE 0x4e | ||
67 | +#define DAC_CH1 0 | ||
68 | +#define DAC_CH2 1 | ||
69 | |||
70 | static void tosa_microdrive_attach(PXA2xxState *cpu) | ||
71 | { | ||
721 | -- | 72 | -- |
722 | 2.20.1 | 73 | 2.20.1 |
723 | 74 | ||
724 | 75 | diff view generated by jsdifflib |
1 | The hw/arm/arm.h header now only includes declarations relating | 1 | Currently we have a free-floating set of IRQs and a function |
---|---|---|---|
2 | to boot.c code, so it is only needed by Arm board or SoC code. | 2 | tosa_out_switch() which handle the GPIO lines on the tosa board which |
3 | Remove some unnecessary inclusions of it from target/arm files | 3 | connect to LEDs, and another free-floating IRQ and tosa_reset() |
4 | and from hw/intc/armv7m_nvic.c. | 4 | function to handle the GPIO line that resets the system. Encapsulate |
5 | this behaviour in a simple QOM device. | ||
6 | |||
7 | This commit fixes Coverity issue CID 1421929 (which pointed out that | ||
8 | the 'outsignals' in tosa_gpio_setup() were leaked), because it | ||
9 | removes the use of the qemu_allocate_irqs() API from this code | ||
10 | entirely. | ||
5 | 11 | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 12 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
7 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | 13 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> |
8 | Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> | 14 | Message-id: 20200628203748.14250-3-peter.maydell@linaro.org |
9 | Message-id: 20190516163857.6430-3-peter.maydell@linaro.org | ||
10 | --- | 15 | --- |
11 | hw/intc/armv7m_nvic.c | 1 - | 16 | hw/arm/tosa.c | 88 +++++++++++++++++++++++++++++++++++++-------------- |
12 | target/arm/arm-semi.c | 1 - | 17 | 1 file changed, 64 insertions(+), 24 deletions(-) |
13 | target/arm/cpu.c | 1 - | ||
14 | target/arm/cpu64.c | 1 - | ||
15 | target/arm/kvm.c | 1 - | ||
16 | target/arm/kvm32.c | 1 - | ||
17 | target/arm/kvm64.c | 1 - | ||
18 | 7 files changed, 7 deletions(-) | ||
19 | 18 | ||
20 | diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c | 19 | diff --git a/hw/arm/tosa.c b/hw/arm/tosa.c |
21 | index XXXXXXX..XXXXXXX 100644 | 20 | index XXXXXXX..XXXXXXX 100644 |
22 | --- a/hw/intc/armv7m_nvic.c | 21 | --- a/hw/arm/tosa.c |
23 | +++ b/hw/intc/armv7m_nvic.c | 22 | +++ b/hw/arm/tosa.c |
24 | @@ -XXX,XX +XXX,XX @@ | 23 | @@ -XXX,XX +XXX,XX @@ static void tosa_microdrive_attach(PXA2xxState *cpu) |
25 | #include "cpu.h" | 24 | pxa2xx_pcmcia_attach(cpu->pcmcia[0], md); |
26 | #include "hw/sysbus.h" | 25 | } |
27 | #include "qemu/timer.h" | 26 | |
28 | -#include "hw/arm/arm.h" | 27 | -static void tosa_out_switch(void *opaque, int line, int level) |
29 | #include "hw/intc/armv7m_nvic.h" | 28 | +/* |
30 | #include "target/arm/cpu.h" | 29 | + * Encapsulation of some GPIO line behaviour for the Tosa board |
31 | #include "exec/exec-all.h" | 30 | + * |
32 | diff --git a/target/arm/arm-semi.c b/target/arm/arm-semi.c | 31 | + * QEMU interface: |
33 | index XXXXXXX..XXXXXXX 100644 | 32 | + * + named GPIO inputs "leds[0..3]": assert to light LEDs |
34 | --- a/target/arm/arm-semi.c | 33 | + * + named GPIO input "reset": when asserted, resets the system |
35 | +++ b/target/arm/arm-semi.c | 34 | + */ |
36 | @@ -XXX,XX +XXX,XX @@ | 35 | + |
37 | #else | 36 | +#define TYPE_TOSA_MISC_GPIO "tosa-misc-gpio" |
38 | #include "qemu-common.h" | 37 | +#define TOSA_MISC_GPIO(obj) \ |
39 | #include "exec/gdbstub.h" | 38 | + OBJECT_CHECK(TosaMiscGPIOState, (obj), TYPE_TOSA_MISC_GPIO) |
40 | -#include "hw/arm/arm.h" | 39 | + |
41 | #include "qemu/cutils.h" | 40 | +typedef struct TosaMiscGPIOState { |
42 | #endif | 41 | + SysBusDevice parent_obj; |
43 | 42 | +} TosaMiscGPIOState; | |
44 | diff --git a/target/arm/cpu.c b/target/arm/cpu.c | 43 | + |
45 | index XXXXXXX..XXXXXXX 100644 | 44 | +static void tosa_gpio_leds(void *opaque, int line, int level) |
46 | --- a/target/arm/cpu.c | 45 | { |
47 | +++ b/target/arm/cpu.c | 46 | switch (line) { |
48 | @@ -XXX,XX +XXX,XX @@ | 47 | - case 0: |
49 | #if !defined(CONFIG_USER_ONLY) | 48 | - fprintf(stderr, "blue LED %s.\n", level ? "on" : "off"); |
50 | #include "hw/loader.h" | 49 | - break; |
51 | #endif | 50 | - case 1: |
52 | -#include "hw/arm/arm.h" | 51 | - fprintf(stderr, "green LED %s.\n", level ? "on" : "off"); |
53 | #include "sysemu/sysemu.h" | 52 | - break; |
54 | #include "sysemu/hw_accel.h" | 53 | - case 2: |
55 | #include "kvm_arm.h" | 54 | - fprintf(stderr, "amber LED %s.\n", level ? "on" : "off"); |
56 | diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c | 55 | - break; |
57 | index XXXXXXX..XXXXXXX 100644 | 56 | - case 3: |
58 | --- a/target/arm/cpu64.c | 57 | - fprintf(stderr, "wlan LED %s.\n", level ? "on" : "off"); |
59 | +++ b/target/arm/cpu64.c | 58 | - break; |
60 | @@ -XXX,XX +XXX,XX @@ | 59 | - default: |
61 | #if !defined(CONFIG_USER_ONLY) | 60 | - fprintf(stderr, "Uhandled out event: %d = %d\n", line, level); |
62 | #include "hw/loader.h" | 61 | - break; |
63 | #endif | 62 | + case 0: |
64 | -#include "hw/arm/arm.h" | 63 | + fprintf(stderr, "blue LED %s.\n", level ? "on" : "off"); |
65 | #include "sysemu/sysemu.h" | 64 | + break; |
66 | #include "sysemu/kvm.h" | 65 | + case 1: |
67 | #include "kvm_arm.h" | 66 | + fprintf(stderr, "green LED %s.\n", level ? "on" : "off"); |
68 | diff --git a/target/arm/kvm.c b/target/arm/kvm.c | 67 | + break; |
69 | index XXXXXXX..XXXXXXX 100644 | 68 | + case 2: |
70 | --- a/target/arm/kvm.c | 69 | + fprintf(stderr, "amber LED %s.\n", level ? "on" : "off"); |
71 | +++ b/target/arm/kvm.c | 70 | + break; |
72 | @@ -XXX,XX +XXX,XX @@ | 71 | + case 3: |
73 | #include "cpu.h" | 72 | + fprintf(stderr, "wlan LED %s.\n", level ? "on" : "off"); |
74 | #include "trace.h" | 73 | + break; |
75 | #include "internals.h" | 74 | + default: |
76 | -#include "hw/arm/arm.h" | 75 | + g_assert_not_reached(); |
77 | #include "hw/pci/pci.h" | 76 | } |
78 | #include "exec/memattrs.h" | 77 | } |
79 | #include "exec/address-spaces.h" | 78 | |
80 | diff --git a/target/arm/kvm32.c b/target/arm/kvm32.c | 79 | @@ -XXX,XX +XXX,XX @@ static void tosa_reset(void *opaque, int line, int level) |
81 | index XXXXXXX..XXXXXXX 100644 | 80 | } |
82 | --- a/target/arm/kvm32.c | 81 | } |
83 | +++ b/target/arm/kvm32.c | 82 | |
84 | @@ -XXX,XX +XXX,XX @@ | 83 | +static void tosa_misc_gpio_init(Object *obj) |
85 | #include "sysemu/kvm.h" | 84 | +{ |
86 | #include "kvm_arm.h" | 85 | + DeviceState *dev = DEVICE(obj); |
87 | #include "internals.h" | 86 | + |
88 | -#include "hw/arm/arm.h" | 87 | + qdev_init_gpio_in_named(dev, tosa_gpio_leds, "leds", 4); |
89 | #include "qemu/log.h" | 88 | + qdev_init_gpio_in_named(dev, tosa_reset, "reset", 1); |
90 | 89 | +} | |
91 | static inline void set_feature(uint64_t *features, int feature) | 90 | + |
92 | diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c | 91 | static void tosa_gpio_setup(PXA2xxState *cpu, |
93 | index XXXXXXX..XXXXXXX 100644 | 92 | DeviceState *scp0, |
94 | --- a/target/arm/kvm64.c | 93 | DeviceState *scp1, |
95 | +++ b/target/arm/kvm64.c | 94 | TC6393xbState *tmio) |
96 | @@ -XXX,XX +XXX,XX @@ | 95 | { |
97 | #include "sysemu/kvm.h" | 96 | - qemu_irq *outsignals = qemu_allocate_irqs(tosa_out_switch, cpu, 4); |
98 | #include "kvm_arm.h" | 97 | - qemu_irq reset; |
99 | #include "internals.h" | 98 | + DeviceState *misc_gpio; |
100 | -#include "hw/arm/arm.h" | 99 | + |
101 | 100 | + misc_gpio = sysbus_create_simple(TYPE_TOSA_MISC_GPIO, -1, NULL); | |
102 | static bool have_guest_debug; | 101 | |
103 | 102 | /* MMC/SD host */ | |
103 | pxa2xx_mmci_handlers(cpu->mmc, | ||
104 | @@ -XXX,XX +XXX,XX @@ static void tosa_gpio_setup(PXA2xxState *cpu, | ||
105 | qemu_irq_invert(qdev_get_gpio_in(cpu->gpio, TOSA_GPIO_nSD_DETECT))); | ||
106 | |||
107 | /* Handle reset */ | ||
108 | - reset = qemu_allocate_irq(tosa_reset, cpu, 0); | ||
109 | - qdev_connect_gpio_out(cpu->gpio, TOSA_GPIO_ON_RESET, reset); | ||
110 | + qdev_connect_gpio_out(cpu->gpio, TOSA_GPIO_ON_RESET, | ||
111 | + qdev_get_gpio_in_named(misc_gpio, "reset", 0)); | ||
112 | |||
113 | /* PCMCIA signals: card's IRQ and Card-Detect */ | ||
114 | pxa2xx_pcmcia_set_irq_cb(cpu->pcmcia[0], | ||
115 | @@ -XXX,XX +XXX,XX @@ static void tosa_gpio_setup(PXA2xxState *cpu, | ||
116 | qdev_get_gpio_in(cpu->gpio, TOSA_GPIO_JC_CF_IRQ), | ||
117 | NULL); | ||
118 | |||
119 | - qdev_connect_gpio_out(scp1, TOSA_GPIO_BT_LED, outsignals[0]); | ||
120 | - qdev_connect_gpio_out(scp1, TOSA_GPIO_NOTE_LED, outsignals[1]); | ||
121 | - qdev_connect_gpio_out(scp1, TOSA_GPIO_CHRG_ERR_LED, outsignals[2]); | ||
122 | - qdev_connect_gpio_out(scp1, TOSA_GPIO_WLAN_LED, outsignals[3]); | ||
123 | + qdev_connect_gpio_out(scp1, TOSA_GPIO_BT_LED, | ||
124 | + qdev_get_gpio_in_named(misc_gpio, "leds", 0)); | ||
125 | + qdev_connect_gpio_out(scp1, TOSA_GPIO_NOTE_LED, | ||
126 | + qdev_get_gpio_in_named(misc_gpio, "leds", 1)); | ||
127 | + qdev_connect_gpio_out(scp1, TOSA_GPIO_CHRG_ERR_LED, | ||
128 | + qdev_get_gpio_in_named(misc_gpio, "leds", 2)); | ||
129 | + qdev_connect_gpio_out(scp1, TOSA_GPIO_WLAN_LED, | ||
130 | + qdev_get_gpio_in_named(misc_gpio, "leds", 3)); | ||
131 | |||
132 | qdev_connect_gpio_out(scp1, TOSA_GPIO_TC6393XB_L3V_ON, tc6393xb_l3v_get(tmio)); | ||
133 | |||
134 | @@ -XXX,XX +XXX,XX @@ static const TypeInfo tosa_ssp_info = { | ||
135 | .class_init = tosa_ssp_class_init, | ||
136 | }; | ||
137 | |||
138 | +static const TypeInfo tosa_misc_gpio_info = { | ||
139 | + .name = "tosa-misc-gpio", | ||
140 | + .parent = TYPE_SYS_BUS_DEVICE, | ||
141 | + .instance_size = sizeof(TosaMiscGPIOState), | ||
142 | + .instance_init = tosa_misc_gpio_init, | ||
143 | + /* | ||
144 | + * No class init required: device has no internal state so does not | ||
145 | + * need to set up reset or vmstate, and has no realize method. | ||
146 | + */ | ||
147 | +}; | ||
148 | + | ||
149 | static void tosa_register_types(void) | ||
150 | { | ||
151 | type_register_static(&tosa_dac_info); | ||
152 | type_register_static(&tosa_ssp_info); | ||
153 | + type_register_static(&tosa_misc_gpio_info); | ||
154 | } | ||
155 | |||
156 | type_init(tosa_register_types) | ||
104 | -- | 157 | -- |
105 | 2.20.1 | 158 | 2.20.1 |
106 | 159 | ||
107 | 160 | diff view generated by jsdifflib |
1 | The system_clock_scale global is used only by the armv7m systick | 1 | Remove hard-tabs from palm.c. |
---|---|---|---|
2 | device; move the extern declaration to the armv7m_systick.h header, | ||
3 | and expand the comment to explain what it is and that it should | ||
4 | ideally be replaced with a different approach. | ||
5 | 2 | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 3 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
7 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | 4 | Reviewed-by: Li Qiang <liq3ea@gmail.com> |
8 | Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> | 5 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> |
9 | Message-id: 20190516163857.6430-2-peter.maydell@linaro.org | 6 | Message-id: 20200628214230.2592-2-peter.maydell@linaro.org |
10 | --- | 7 | --- |
11 | include/hw/arm/arm.h | 4 ---- | 8 | hw/arm/palm.c | 64 +++++++++++++++++++++++++-------------------------- |
12 | include/hw/timer/armv7m_systick.h | 22 ++++++++++++++++++++++ | 9 | 1 file changed, 32 insertions(+), 32 deletions(-) |
13 | 2 files changed, 22 insertions(+), 4 deletions(-) | ||
14 | 10 | ||
15 | diff --git a/include/hw/arm/arm.h b/include/hw/arm/arm.h | 11 | diff --git a/hw/arm/palm.c b/hw/arm/palm.c |
16 | index XXXXXXX..XXXXXXX 100644 | 12 | index XXXXXXX..XXXXXXX 100644 |
17 | --- a/include/hw/arm/arm.h | 13 | --- a/hw/arm/palm.c |
18 | +++ b/include/hw/arm/arm.h | 14 | +++ b/hw/arm/palm.c |
19 | @@ -XXX,XX +XXX,XX @@ void arm_write_secure_board_setup_dummy_smc(ARMCPU *cpu, | 15 | @@ -XXX,XX +XXX,XX @@ static const MemoryRegionOps static_ops = { |
20 | const struct arm_boot_info *info, | 16 | /* Palm Tunsgten|E support */ |
21 | hwaddr mvbar_addr); | 17 | |
22 | 18 | /* Shared GPIOs */ | |
23 | -/* Multiplication factor to convert from system clock ticks to qemu timer | 19 | -#define PALMTE_USBDETECT_GPIO 0 |
24 | - ticks. */ | 20 | -#define PALMTE_USB_OR_DC_GPIO 1 |
25 | -extern int system_clock_scale; | 21 | -#define PALMTE_TSC_GPIO 4 |
26 | - | 22 | -#define PALMTE_PINTDAV_GPIO 6 |
27 | #endif /* HW_ARM_H */ | 23 | -#define PALMTE_MMC_WP_GPIO 8 |
28 | diff --git a/include/hw/timer/armv7m_systick.h b/include/hw/timer/armv7m_systick.h | 24 | -#define PALMTE_MMC_POWER_GPIO 9 |
29 | index XXXXXXX..XXXXXXX 100644 | 25 | -#define PALMTE_HDQ_GPIO 11 |
30 | --- a/include/hw/timer/armv7m_systick.h | 26 | -#define PALMTE_HEADPHONES_GPIO 14 |
31 | +++ b/include/hw/timer/armv7m_systick.h | 27 | -#define PALMTE_SPEAKER_GPIO 15 |
32 | @@ -XXX,XX +XXX,XX @@ typedef struct SysTickState { | 28 | +#define PALMTE_USBDETECT_GPIO 0 |
33 | qemu_irq irq; | 29 | +#define PALMTE_USB_OR_DC_GPIO 1 |
34 | } SysTickState; | 30 | +#define PALMTE_TSC_GPIO 4 |
35 | 31 | +#define PALMTE_PINTDAV_GPIO 6 | |
36 | +/* | 32 | +#define PALMTE_MMC_WP_GPIO 8 |
37 | + * Multiplication factor to convert from system clock ticks to qemu timer | 33 | +#define PALMTE_MMC_POWER_GPIO 9 |
38 | + * ticks. This should be set (by board code, usually) to a value | 34 | +#define PALMTE_HDQ_GPIO 11 |
39 | + * equal to NANOSECONDS_PER_SECOND / frq, where frq is the clock frequency | 35 | +#define PALMTE_HEADPHONES_GPIO 14 |
40 | + * in Hz of the CPU. | 36 | +#define PALMTE_SPEAKER_GPIO 15 |
41 | + * | 37 | /* MPU private GPIOs */ |
42 | + * This value is used by the systick device when it is running in | 38 | -#define PALMTE_DC_GPIO 2 |
43 | + * its "use the CPU clock" mode (ie when SYST_CSR.CLKSOURCE == 1) to | 39 | -#define PALMTE_MMC_SWITCH_GPIO 4 |
44 | + * set how fast the timer should tick. | 40 | -#define PALMTE_MMC1_GPIO 6 |
45 | + * | 41 | -#define PALMTE_MMC2_GPIO 7 |
46 | + * TODO: we should refactor this so that rather than using a global | 42 | -#define PALMTE_MMC3_GPIO 11 |
47 | + * we use a device property or something similar. This is complicated | 43 | +#define PALMTE_DC_GPIO 2 |
48 | + * because (a) the property would need to be plumbed through from the | 44 | +#define PALMTE_MMC_SWITCH_GPIO 4 |
49 | + * board code down through various layers to the systick device | 45 | +#define PALMTE_MMC1_GPIO 6 |
50 | + * and (b) the property needs to be modifiable after realize, because | 46 | +#define PALMTE_MMC2_GPIO 7 |
51 | + * the stellaris board uses this to implement the behaviour where the | 47 | +#define PALMTE_MMC3_GPIO 11 |
52 | + * guest can reprogram the PLL registers to downclock the CPU, and the | 48 | |
53 | + * systick device needs to react accordingly. Possibly this should | 49 | static MouseTransformInfo palmte_pointercal = { |
54 | + * be deferred until we have a good API for modelling clock trees. | 50 | .x = 320, |
55 | + */ | 51 | @@ -XXX,XX +XXX,XX @@ static struct { |
56 | +extern int system_clock_scale; | 52 | int column; |
57 | + | 53 | } palmte_keymap[0x80] = { |
58 | #endif | 54 | [0 ... 0x7f] = { -1, -1 }, |
55 | - [0x3b] = { 0, 0 }, /* F1 -> Calendar */ | ||
56 | - [0x3c] = { 1, 0 }, /* F2 -> Contacts */ | ||
57 | - [0x3d] = { 2, 0 }, /* F3 -> Tasks List */ | ||
58 | - [0x3e] = { 3, 0 }, /* F4 -> Note Pad */ | ||
59 | - [0x01] = { 4, 0 }, /* Esc -> Power */ | ||
60 | - [0x4b] = { 0, 1 }, /* Left */ | ||
61 | - [0x50] = { 1, 1 }, /* Down */ | ||
62 | - [0x48] = { 2, 1 }, /* Up */ | ||
63 | - [0x4d] = { 3, 1 }, /* Right */ | ||
64 | - [0x4c] = { 4, 1 }, /* Centre */ | ||
65 | - [0x39] = { 4, 1 }, /* Spc -> Centre */ | ||
66 | + [0x3b] = { 0, 0 }, /* F1 -> Calendar */ | ||
67 | + [0x3c] = { 1, 0 }, /* F2 -> Contacts */ | ||
68 | + [0x3d] = { 2, 0 }, /* F3 -> Tasks List */ | ||
69 | + [0x3e] = { 3, 0 }, /* F4 -> Note Pad */ | ||
70 | + [0x01] = { 4, 0 }, /* Esc -> Power */ | ||
71 | + [0x4b] = { 0, 1 }, /* Left */ | ||
72 | + [0x50] = { 1, 1 }, /* Down */ | ||
73 | + [0x48] = { 2, 1 }, /* Up */ | ||
74 | + [0x4d] = { 3, 1 }, /* Right */ | ||
75 | + [0x4c] = { 4, 1 }, /* Centre */ | ||
76 | + [0x39] = { 4, 1 }, /* Spc -> Centre */ | ||
77 | }; | ||
78 | |||
79 | static void palmte_button_event(void *opaque, int keycode) | ||
80 | @@ -XXX,XX +XXX,XX @@ static void palmte_gpio_setup(struct omap_mpu_state_s *cpu) | ||
81 | [PALMTE_MMC_SWITCH_GPIO])); | ||
82 | |||
83 | misc_gpio = qemu_allocate_irqs(palmte_onoff_gpios, cpu, 7); | ||
84 | - qdev_connect_gpio_out(cpu->gpio, PALMTE_MMC_POWER_GPIO, misc_gpio[0]); | ||
85 | - qdev_connect_gpio_out(cpu->gpio, PALMTE_SPEAKER_GPIO, misc_gpio[1]); | ||
86 | - qdev_connect_gpio_out(cpu->gpio, 11, misc_gpio[2]); | ||
87 | - qdev_connect_gpio_out(cpu->gpio, 12, misc_gpio[3]); | ||
88 | - qdev_connect_gpio_out(cpu->gpio, 13, misc_gpio[4]); | ||
89 | - omap_mpuio_out_set(cpu->mpuio, 1, misc_gpio[5]); | ||
90 | - omap_mpuio_out_set(cpu->mpuio, 3, misc_gpio[6]); | ||
91 | + qdev_connect_gpio_out(cpu->gpio, PALMTE_MMC_POWER_GPIO, misc_gpio[0]); | ||
92 | + qdev_connect_gpio_out(cpu->gpio, PALMTE_SPEAKER_GPIO, misc_gpio[1]); | ||
93 | + qdev_connect_gpio_out(cpu->gpio, 11, misc_gpio[2]); | ||
94 | + qdev_connect_gpio_out(cpu->gpio, 12, misc_gpio[3]); | ||
95 | + qdev_connect_gpio_out(cpu->gpio, 13, misc_gpio[4]); | ||
96 | + omap_mpuio_out_set(cpu->mpuio, 1, misc_gpio[5]); | ||
97 | + omap_mpuio_out_set(cpu->mpuio, 3, misc_gpio[6]); | ||
98 | |||
99 | /* Reset some inputs to initial state. */ | ||
100 | qemu_irq_lower(qdev_get_gpio_in(cpu->gpio, PALMTE_USBDETECT_GPIO)); | ||
59 | -- | 101 | -- |
60 | 2.20.1 | 102 | 2.20.1 |
61 | 103 | ||
62 | 104 | diff view generated by jsdifflib |
1 | From: Philippe Mathieu-Daudé <philmd@redhat.com> | 1 | Replace the free-floating set of IRQs and palmte_onoff_gpios() |
---|---|---|---|
2 | function with a simple QOM device that encapsulates this | ||
3 | behaviour. | ||
2 | 4 | ||
3 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> | 5 | This fixes Coverity issue CID 1421944, which points out that |
4 | Reviewed-by: Alistair Francis <alistair.francis@wdc.com> | 6 | the memory returned by qemu_allocate_irqs() is leaked. |
5 | Message-id: 20190520214342.13709-5-philmd@redhat.com | 7 | |
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
9 | Reviewed-by: Li Qiang <liq3ea@gmail.com> | ||
10 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
11 | Message-id: 20200628214230.2592-3-peter.maydell@linaro.org | ||
7 | --- | 12 | --- |
8 | include/hw/arm/exynos4210.h | 9 +++++++-- | 13 | hw/arm/palm.c | 61 +++++++++++++++++++++++++++++++++++++++++++-------- |
9 | hw/arm/exynos4210.c | 28 ++++++++++++++++++++++++---- | 14 | 1 file changed, 52 insertions(+), 9 deletions(-) |
10 | hw/arm/exynos4_boards.c | 9 ++++++--- | ||
11 | 3 files changed, 37 insertions(+), 9 deletions(-) | ||
12 | 15 | ||
13 | diff --git a/include/hw/arm/exynos4210.h b/include/hw/arm/exynos4210.h | 16 | diff --git a/hw/arm/palm.c b/hw/arm/palm.c |
14 | index XXXXXXX..XXXXXXX 100644 | 17 | index XXXXXXX..XXXXXXX 100644 |
15 | --- a/include/hw/arm/exynos4210.h | 18 | --- a/hw/arm/palm.c |
16 | +++ b/include/hw/arm/exynos4210.h | 19 | +++ b/hw/arm/palm.c |
17 | @@ -XXX,XX +XXX,XX @@ typedef struct Exynos4210Irq { | 20 | @@ -XXX,XX +XXX,XX @@ static void palmte_button_event(void *opaque, int keycode) |
18 | } Exynos4210Irq; | 21 | !(keycode & 0x80)); |
19 | 22 | } | |
20 | typedef struct Exynos4210State { | 23 | |
21 | + /*< private >*/ | 24 | +/* |
25 | + * Encapsulation of some GPIO line behaviour for the Palm board | ||
26 | + * | ||
27 | + * QEMU interface: | ||
28 | + * + unnamed GPIO inputs 0..6: for the various miscellaneous input lines | ||
29 | + */ | ||
30 | + | ||
31 | +#define TYPE_PALM_MISC_GPIO "palm-misc-gpio" | ||
32 | +#define PALM_MISC_GPIO(obj) \ | ||
33 | + OBJECT_CHECK(PalmMiscGPIOState, (obj), TYPE_PALM_MISC_GPIO) | ||
34 | + | ||
35 | +typedef struct PalmMiscGPIOState { | ||
22 | + SysBusDevice parent_obj; | 36 | + SysBusDevice parent_obj; |
23 | + /*< public >*/ | 37 | +} PalmMiscGPIOState; |
24 | ARMCPU *cpu[EXYNOS4210_NCPUS]; | ||
25 | Exynos4210Irq irqs; | ||
26 | qemu_irq *irq_table; | ||
27 | @@ -XXX,XX +XXX,XX @@ typedef struct Exynos4210State { | ||
28 | I2CBus *i2c_if[EXYNOS4210_I2C_NUMBER]; | ||
29 | } Exynos4210State; | ||
30 | |||
31 | +#define TYPE_EXYNOS4210_SOC "exynos4210" | ||
32 | +#define EXYNOS4210_SOC(obj) \ | ||
33 | + OBJECT_CHECK(Exynos4210State, obj, TYPE_EXYNOS4210_SOC) | ||
34 | + | 38 | + |
35 | void exynos4210_write_secondary(ARMCPU *cpu, | 39 | static void palmte_onoff_gpios(void *opaque, int line, int level) |
36 | const struct arm_boot_info *info); | 40 | { |
37 | 41 | switch (line) { | |
38 | -Exynos4210State *exynos4210_init(MemoryRegion *system_mem); | 42 | @@ -XXX,XX +XXX,XX @@ static void palmte_onoff_gpios(void *opaque, int line, int level) |
39 | - | 43 | } |
40 | /* Initialize exynos4210 IRQ subsystem stub */ | ||
41 | qemu_irq *exynos4210_init_irq(Exynos4210Irq *env); | ||
42 | |||
43 | diff --git a/hw/arm/exynos4210.c b/hw/arm/exynos4210.c | ||
44 | index XXXXXXX..XXXXXXX 100644 | ||
45 | --- a/hw/arm/exynos4210.c | ||
46 | +++ b/hw/arm/exynos4210.c | ||
47 | @@ -XXX,XX +XXX,XX @@ static void pl330_create(uint32_t base, qemu_irq irq, int nreq) | ||
48 | sysbus_connect_irq(busdev, 0, irq); | ||
49 | } | 44 | } |
50 | 45 | ||
51 | -Exynos4210State *exynos4210_init(MemoryRegion *system_mem) | 46 | +static void palm_misc_gpio_init(Object *obj) |
52 | +static void exynos4210_realize(DeviceState *socdev, Error **errp) | 47 | +{ |
53 | { | 48 | + DeviceState *dev = DEVICE(obj); |
54 | - Exynos4210State *s = g_new0(Exynos4210State, 1); | ||
55 | + Exynos4210State *s = EXYNOS4210_SOC(socdev); | ||
56 | + MemoryRegion *system_mem = get_system_memory(); | ||
57 | qemu_irq gate_irq[EXYNOS4210_NCPUS][EXYNOS4210_IRQ_GATE_NINPUTS]; | ||
58 | SysBusDevice *busdev; | ||
59 | DeviceState *dev; | ||
60 | @@ -XXX,XX +XXX,XX @@ Exynos4210State *exynos4210_init(MemoryRegion *system_mem) | ||
61 | qemu_irq_invert(s->irq_table[exynos4210_get_irq(36, 1)]), 32); | ||
62 | pl330_create(EXYNOS4210_PL330_BASE2_ADDR, | ||
63 | qemu_irq_invert(s->irq_table[exynos4210_get_irq(34, 1)]), 1); | ||
64 | - | ||
65 | - return s; | ||
66 | } | ||
67 | + | 49 | + |
68 | +static void exynos4210_class_init(ObjectClass *klass, void *data) | 50 | + qdev_init_gpio_in(dev, palmte_onoff_gpios, 7); |
69 | +{ | ||
70 | + DeviceClass *dc = DEVICE_CLASS(klass); | ||
71 | + | ||
72 | + dc->realize = exynos4210_realize; | ||
73 | +} | 51 | +} |
74 | + | 52 | + |
75 | +static const TypeInfo exynos4210_info = { | 53 | +static const TypeInfo palm_misc_gpio_info = { |
76 | + .name = TYPE_EXYNOS4210_SOC, | 54 | + .name = TYPE_PALM_MISC_GPIO, |
77 | + .parent = TYPE_SYS_BUS_DEVICE, | 55 | + .parent = TYPE_SYS_BUS_DEVICE, |
78 | + .instance_size = sizeof(Exynos4210State), | 56 | + .instance_size = sizeof(PalmMiscGPIOState), |
79 | + .class_init = exynos4210_class_init, | 57 | + .instance_init = palm_misc_gpio_init, |
58 | + /* | ||
59 | + * No class init required: device has no internal state so does not | ||
60 | + * need to set up reset or vmstate, and has no realize method. | ||
61 | + */ | ||
80 | +}; | 62 | +}; |
81 | + | 63 | + |
82 | +static void exynos4210_register_types(void) | 64 | static void palmte_gpio_setup(struct omap_mpu_state_s *cpu) |
65 | { | ||
66 | - qemu_irq *misc_gpio; | ||
67 | + DeviceState *misc_gpio; | ||
68 | + | ||
69 | + misc_gpio = sysbus_create_simple(TYPE_PALM_MISC_GPIO, -1, NULL); | ||
70 | |||
71 | omap_mmc_handlers(cpu->mmc, | ||
72 | qdev_get_gpio_in(cpu->gpio, PALMTE_MMC_WP_GPIO), | ||
73 | qemu_irq_invert(omap_mpuio_in_get(cpu->mpuio) | ||
74 | [PALMTE_MMC_SWITCH_GPIO])); | ||
75 | |||
76 | - misc_gpio = qemu_allocate_irqs(palmte_onoff_gpios, cpu, 7); | ||
77 | - qdev_connect_gpio_out(cpu->gpio, PALMTE_MMC_POWER_GPIO, misc_gpio[0]); | ||
78 | - qdev_connect_gpio_out(cpu->gpio, PALMTE_SPEAKER_GPIO, misc_gpio[1]); | ||
79 | - qdev_connect_gpio_out(cpu->gpio, 11, misc_gpio[2]); | ||
80 | - qdev_connect_gpio_out(cpu->gpio, 12, misc_gpio[3]); | ||
81 | - qdev_connect_gpio_out(cpu->gpio, 13, misc_gpio[4]); | ||
82 | - omap_mpuio_out_set(cpu->mpuio, 1, misc_gpio[5]); | ||
83 | - omap_mpuio_out_set(cpu->mpuio, 3, misc_gpio[6]); | ||
84 | + qdev_connect_gpio_out(cpu->gpio, PALMTE_MMC_POWER_GPIO, | ||
85 | + qdev_get_gpio_in(misc_gpio, 0)); | ||
86 | + qdev_connect_gpio_out(cpu->gpio, PALMTE_SPEAKER_GPIO, | ||
87 | + qdev_get_gpio_in(misc_gpio, 1)); | ||
88 | + qdev_connect_gpio_out(cpu->gpio, 11, qdev_get_gpio_in(misc_gpio, 2)); | ||
89 | + qdev_connect_gpio_out(cpu->gpio, 12, qdev_get_gpio_in(misc_gpio, 3)); | ||
90 | + qdev_connect_gpio_out(cpu->gpio, 13, qdev_get_gpio_in(misc_gpio, 4)); | ||
91 | + omap_mpuio_out_set(cpu->mpuio, 1, qdev_get_gpio_in(misc_gpio, 5)); | ||
92 | + omap_mpuio_out_set(cpu->mpuio, 3, qdev_get_gpio_in(misc_gpio, 6)); | ||
93 | |||
94 | /* Reset some inputs to initial state. */ | ||
95 | qemu_irq_lower(qdev_get_gpio_in(cpu->gpio, PALMTE_USBDETECT_GPIO)); | ||
96 | @@ -XXX,XX +XXX,XX @@ static void palmte_machine_init(MachineClass *mc) | ||
97 | } | ||
98 | |||
99 | DEFINE_MACHINE("cheetah", palmte_machine_init) | ||
100 | + | ||
101 | +static void palm_register_types(void) | ||
83 | +{ | 102 | +{ |
84 | + type_register_static(&exynos4210_info); | 103 | + type_register_static(&palm_misc_gpio_info); |
85 | +} | 104 | +} |
86 | + | 105 | + |
87 | +type_init(exynos4210_register_types) | 106 | +type_init(palm_register_types) |
88 | diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c | ||
89 | index XXXXXXX..XXXXXXX 100644 | ||
90 | --- a/hw/arm/exynos4_boards.c | ||
91 | +++ b/hw/arm/exynos4_boards.c | ||
92 | @@ -XXX,XX +XXX,XX @@ typedef enum Exynos4BoardType { | ||
93 | } Exynos4BoardType; | ||
94 | |||
95 | typedef struct Exynos4BoardState { | ||
96 | - Exynos4210State *soc; | ||
97 | + Exynos4210State soc; | ||
98 | MemoryRegion dram0_mem; | ||
99 | MemoryRegion dram1_mem; | ||
100 | } Exynos4BoardState; | ||
101 | @@ -XXX,XX +XXX,XX @@ exynos4_boards_init_common(MachineState *machine, | ||
102 | exynos4_boards_init_ram(s, get_system_memory(), | ||
103 | exynos4_board_ram_size[board_type]); | ||
104 | |||
105 | - s->soc = exynos4210_init(get_system_memory()); | ||
106 | + object_initialize(&s->soc, sizeof(s->soc), TYPE_EXYNOS4210_SOC); | ||
107 | + qdev_set_parent_bus(DEVICE(&s->soc), sysbus_get_default()); | ||
108 | + object_property_set_bool(OBJECT(&s->soc), true, "realized", | ||
109 | + &error_fatal); | ||
110 | |||
111 | return s; | ||
112 | } | ||
113 | @@ -XXX,XX +XXX,XX @@ static void smdkc210_init(MachineState *machine) | ||
114 | EXYNOS4_BOARD_SMDKC210); | ||
115 | |||
116 | lan9215_init(SMDK_LAN9118_BASE_ADDR, | ||
117 | - qemu_irq_invert(s->soc->irq_table[exynos4210_get_irq(37, 1)])); | ||
118 | + qemu_irq_invert(s->soc.irq_table[exynos4210_get_irq(37, 1)])); | ||
119 | arm_load_kernel(ARM_CPU(first_cpu), &exynos4_board_binfo); | ||
120 | } | ||
121 | |||
122 | -- | 107 | -- |
123 | 2.20.1 | 108 | 2.20.1 |
124 | 109 | ||
125 | 110 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
1 | 2 | ||
3 | Since added in commit 2bea128c3d, each SDHCI is wired with a SD | ||
4 | card, using empty card when no block drive provided. This is not | ||
5 | the desired behavior. The SDHCI exposes a SD bus to plug cards | ||
6 | on, if no card available, it is fine to have an unplugged bus. | ||
7 | |||
8 | Avoid creating unnecessary SD card device when no block drive | ||
9 | provided. | ||
10 | |||
11 | Fixes: 2bea128c3d ("hw/sd/aspeed_sdhci: New device") | ||
12 | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
13 | Message-id: 20200705173402.15620-1-f4bug@amsat.org | ||
14 | Reviewed-by: Cédric Le Goater <clg@kaod.org> | ||
15 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
16 | --- | ||
17 | hw/arm/aspeed.c | 9 +++++---- | ||
18 | 1 file changed, 5 insertions(+), 4 deletions(-) | ||
19 | |||
20 | diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c | ||
21 | index XXXXXXX..XXXXXXX 100644 | ||
22 | --- a/hw/arm/aspeed.c | ||
23 | +++ b/hw/arm/aspeed.c | ||
24 | @@ -XXX,XX +XXX,XX @@ static void sdhci_attach_drive(SDHCIState *sdhci, DriveInfo *dinfo) | ||
25 | { | ||
26 | DeviceState *card; | ||
27 | |||
28 | - card = qdev_new(TYPE_SD_CARD); | ||
29 | - if (dinfo) { | ||
30 | - qdev_prop_set_drive_err(card, "drive", blk_by_legacy_dinfo(dinfo), | ||
31 | - &error_fatal); | ||
32 | + if (!dinfo) { | ||
33 | + return; | ||
34 | } | ||
35 | + card = qdev_new(TYPE_SD_CARD); | ||
36 | + qdev_prop_set_drive_err(card, "drive", blk_by_legacy_dinfo(dinfo), | ||
37 | + &error_fatal); | ||
38 | qdev_realize_and_unref(card, | ||
39 | qdev_get_child_bus(DEVICE(sdhci), "sd-bus"), | ||
40 | &error_fatal); | ||
41 | -- | ||
42 | 2.20.1 | ||
43 | |||
44 | diff view generated by jsdifflib |