1 | Arm patch queue -- these are all bug fix patches but we might | 1 | Not very much here, but several people have fallen over |
---|---|---|---|
2 | as well put them in to rc0... | 2 | the vector operation segfault bug, so let's get the fix |
3 | into master. | ||
3 | 4 | ||
4 | thanks | 5 | thanks |
5 | -- PMM | 6 | -- PMM |
6 | 7 | ||
7 | The following changes since commit 2c8cfc0b52b5a4d123c26c0b5fdf941be24805be: | 8 | The following changes since commit d418238dca7b4e0b124135827ead3076233052b1: |
8 | 9 | ||
9 | Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging (2018-03-19 11:44:26 +0000) | 10 | Merge remote-tracking branch 'remotes/rth/tags/pull-rng-20190522' into staging (2019-05-23 12:57:17 +0100) |
10 | 11 | ||
11 | are available in the Git repository at: | 12 | are available in the Git repository at: |
12 | 13 | ||
13 | git://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20180319 | 14 | https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20190523 |
14 | 15 | ||
15 | for you to fetch changes up to ff72cb6b46b95bb530787add5277c211af3d31c6: | 16 | for you to fetch changes up to 98e4f4fdb8ea05d840f51f47125924c2bb9df2df: |
16 | 17 | ||
17 | hw/arm/raspi: Provide spin-loop code for AArch64 CPUs (2018-03-19 18:23:24 +0000) | 18 | hw/arm/exynos4210: QOM'ify the Exynos4210 SoC (2019-05-23 14:47:44 +0100) |
18 | 19 | ||
19 | ---------------------------------------------------------------- | 20 | ---------------------------------------------------------------- |
20 | target-arm queue: | 21 | target-arm queue: |
21 | * fsl-imx6: Fix incorrect Ethernet interrupt defines | 22 | * exynos4210: QOM'ify the Exynos4210 SoC |
22 | * dump: Update correct kdump phys_base field for AArch64 | 23 | * exynos4210: Add DMA support for the Exynos4210 |
23 | * char: i.MX: Add support for "TX complete" interrupt | 24 | * arm_gicv3: Fix writes to ICC_CTLR_EL3 |
24 | * bcm2836/raspi: Fix various bugs resulting in panics trying | 25 | * arm_gicv3: Fix write of ICH_VMCR_EL2.{VBPR0, VBPR1} |
25 | to boot a Debian Linux kernel on raspi3 | 26 | * target/arm: Fix vector operation segfault |
27 | * target/arm: Minor improvements to BFXIL, EXTR | ||
26 | 28 | ||
27 | ---------------------------------------------------------------- | 29 | ---------------------------------------------------------------- |
28 | Andrey Smirnov (2): | 30 | Alistair Francis (1): |
29 | char: i.MX: Simplify imx_update() | 31 | target/arm: Fix vector operation segfault |
30 | char: i.MX: Add support for "TX complete" interrupt | ||
31 | 32 | ||
32 | Guenter Roeck (1): | 33 | Guenter Roeck (1): |
33 | fsl-imx6: Swap Ethernet interrupt defines | 34 | hw/arm/exynos4210: Add DMA support for the Exynos4210 |
34 | 35 | ||
35 | Peter Maydell (9): | 36 | Peter Maydell (5): |
36 | hw/arm/raspi: Don't do board-setup or secure-boot for raspi3 | 37 | arm: Move system_clock_scale to armv7m_systick.h |
37 | hw/arm/boot: assert that secure_boot and secure_board_setup are false for AArch64 | 38 | arm: Remove unnecessary includes of hw/arm/arm.h |
38 | hw/arm/boot: If booting a kernel in EL2, set SCR_EL3.HCE | 39 | arm: Rename hw/arm/arm.h to hw/arm/boot.h |
39 | hw/arm/bcm2386: Fix parent type of bcm2386 | 40 | hw/intc/arm_gicv3: Fix write of ICH_VMCR_EL2.{VBPR0, VBPR1} |
40 | hw/arm/bcm2836: Rename bcm2836 type/struct to bcm283x | 41 | hw/intc/arm_gicv3: Fix writes to ICC_CTLR_EL3 |
41 | hw/arm/bcm2836: Create proper bcm2837 device | ||
42 | hw/arm/bcm2836: Use correct affinity values for BCM2837 | ||
43 | hw/arm/bcm2836: Hardcode correct CPU type | ||
44 | hw/arm/raspi: Provide spin-loop code for AArch64 CPUs | ||
45 | 42 | ||
46 | Wei Huang (1): | 43 | Philippe Mathieu-Daudé (3): |
47 | dump: Update correct kdump phys_base field for AArch64 | 44 | hw/arm/exynos4: Remove unuseful debug code |
45 | hw/arm/exynos4: Use the IEC binary prefix definitions | ||
46 | hw/arm/exynos4210: QOM'ify the Exynos4210 SoC | ||
48 | 47 | ||
49 | include/hw/arm/bcm2836.h | 31 +++++++++++++--- | 48 | Richard Henderson (2): |
50 | include/hw/arm/fsl-imx6.h | 4 +- | 49 | target/arm: Use extract2 for EXTR |
51 | include/hw/char/imx_serial.h | 3 ++ | 50 | target/arm: Simplify BFXIL expansion |
52 | dump.c | 14 +++++-- | ||
53 | hw/arm/bcm2836.c | 87 +++++++++++++++++++++++++++++++------------- | ||
54 | hw/arm/boot.c | 12 ++++++ | ||
55 | hw/arm/raspi.c | 77 +++++++++++++++++++++++++++++++-------- | ||
56 | hw/char/imx_serial.c | 44 ++++++++++++++++------ | ||
57 | hw/net/imx_fec.c | 28 +++++++++++++- | ||
58 | 9 files changed, 237 insertions(+), 63 deletions(-) | ||
59 | 51 | ||
52 | include/hw/arm/allwinner-a10.h | 2 +- | ||
53 | include/hw/arm/aspeed_soc.h | 1 - | ||
54 | include/hw/arm/bcm2836.h | 1 - | ||
55 | include/hw/arm/{arm.h => boot.h} | 12 +++------ | ||
56 | include/hw/arm/exynos4210.h | 9 +++++-- | ||
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 | diff view generated by jsdifflib |
1 | Now we have separate types for BCM2386 and BCM2387, we might as well | 1 | From: Richard Henderson <richard.henderson@linaro.org> |
---|---|---|---|
2 | just hard-code the CPU type they use rather than having it passed | ||
3 | through as an object property. This then lets us put the initialization | ||
4 | of the CPU object in init rather than realize. | ||
5 | 2 | ||
6 | Note that this change means that it's no longer possible on | 3 | This is, after all, how we implement extract2 in tcg/aarch64. |
7 | the command line to use -cpu to ask for a different kind of | ||
8 | CPU than the SoC supports. This was never a supported thing to | ||
9 | do anyway; we were just not sanity-checking the command line. | ||
10 | 4 | ||
11 | This does require us to only build the bcm2837 object on | 5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> |
12 | TARGET_AARCH64 configs, since otherwise it won't instantiate | 6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
13 | due to the missing cortex-a53 device and "make check" will fail. | 7 | Message-id: 20190514011129.11330-2-richard.henderson@linaro.org |
8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
9 | --- | ||
10 | target/arm/translate-a64.c | 38 ++++++++++++++++++++------------------ | ||
11 | 1 file changed, 20 insertions(+), 18 deletions(-) | ||
14 | 12 | ||
15 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 13 | diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c |
16 | Reviewed-by: Andrew Baumann <Andrew.Baumann@microsoft.com> | ||
17 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
18 | Message-id: 20180313153458.26822-9-peter.maydell@linaro.org | ||
19 | --- | ||
20 | hw/arm/bcm2836.c | 24 +++++++++++++++--------- | ||
21 | hw/arm/raspi.c | 2 -- | ||
22 | 2 files changed, 15 insertions(+), 11 deletions(-) | ||
23 | |||
24 | diff --git a/hw/arm/bcm2836.c b/hw/arm/bcm2836.c | ||
25 | index XXXXXXX..XXXXXXX 100644 | 14 | index XXXXXXX..XXXXXXX 100644 |
26 | --- a/hw/arm/bcm2836.c | 15 | --- a/target/arm/translate-a64.c |
27 | +++ b/hw/arm/bcm2836.c | 16 | +++ b/target/arm/translate-a64.c |
28 | @@ -XXX,XX +XXX,XX @@ | 17 | @@ -XXX,XX +XXX,XX @@ static void disas_extract(DisasContext *s, uint32_t insn) |
29 | 18 | } else { | |
30 | struct BCM283XInfo { | 19 | tcg_gen_ext32u_i64(tcg_rd, cpu_reg(s, rm)); |
31 | const char *name; | 20 | } |
32 | + const char *cpu_type; | 21 | - } else if (rm == rn) { /* ROR */ |
33 | int clusterid; | 22 | - tcg_rm = cpu_reg(s, rm); |
34 | }; | 23 | - if (sf) { |
35 | 24 | - tcg_gen_rotri_i64(tcg_rd, tcg_rm, imm); | |
36 | static const BCM283XInfo bcm283x_socs[] = { | 25 | - } else { |
37 | { | 26 | - TCGv_i32 tmp = tcg_temp_new_i32(); |
38 | .name = TYPE_BCM2836, | 27 | - tcg_gen_extrl_i64_i32(tmp, tcg_rm); |
39 | + .cpu_type = ARM_CPU_TYPE_NAME("cortex-a15"), | 28 | - tcg_gen_rotri_i32(tmp, tmp, imm); |
40 | .clusterid = 0xf, | 29 | - tcg_gen_extu_i32_i64(tcg_rd, tmp); |
41 | }, | 30 | - tcg_temp_free_i32(tmp); |
42 | +#ifdef TARGET_AARCH64 | 31 | - } |
43 | { | 32 | } else { |
44 | .name = TYPE_BCM2837, | 33 | - tcg_rm = read_cpu_reg(s, rm, sf); |
45 | + .cpu_type = ARM_CPU_TYPE_NAME("cortex-a53"), | 34 | - tcg_rn = read_cpu_reg(s, rn, sf); |
46 | .clusterid = 0x0, | 35 | - tcg_gen_shri_i64(tcg_rm, tcg_rm, imm); |
47 | }, | 36 | - tcg_gen_shli_i64(tcg_rn, tcg_rn, bitsize - imm); |
48 | +#endif | 37 | - tcg_gen_or_i64(tcg_rd, tcg_rm, tcg_rn); |
49 | }; | 38 | - if (!sf) { |
50 | 39 | - tcg_gen_ext32u_i64(tcg_rd, tcg_rd); | |
51 | static void bcm2836_init(Object *obj) | 40 | + tcg_rm = cpu_reg(s, rm); |
52 | { | 41 | + tcg_rn = cpu_reg(s, rn); |
53 | BCM283XState *s = BCM283X(obj); | ||
54 | + BCM283XClass *bc = BCM283X_GET_CLASS(obj); | ||
55 | + const BCM283XInfo *info = bc->info; | ||
56 | + int n; | ||
57 | + | 42 | + |
58 | + for (n = 0; n < BCM283X_NCPUS; n++) { | 43 | + if (sf) { |
59 | + object_initialize(&s->cpus[n], sizeof(s->cpus[n]), | 44 | + /* Specialization to ROR happens in EXTRACT2. */ |
60 | + info->cpu_type); | 45 | + tcg_gen_extract2_i64(tcg_rd, tcg_rm, tcg_rn, imm); |
61 | + object_property_add_child(obj, "cpu[*]", OBJECT(&s->cpus[n]), | 46 | + } else { |
62 | + &error_abort); | 47 | + TCGv_i32 t0 = tcg_temp_new_i32(); |
63 | + } | 48 | + |
64 | 49 | + tcg_gen_extrl_i64_i32(t0, tcg_rm); | |
65 | object_initialize(&s->control, sizeof(s->control), TYPE_BCM2836_CONTROL); | 50 | + if (rm == rn) { |
66 | object_property_add_child(obj, "control", OBJECT(&s->control), NULL); | 51 | + tcg_gen_rotri_i32(t0, t0, imm); |
67 | @@ -XXX,XX +XXX,XX @@ static void bcm2836_realize(DeviceState *dev, Error **errp) | 52 | + } else { |
68 | 53 | + TCGv_i32 t1 = tcg_temp_new_i32(); | |
69 | /* common peripherals from bcm2835 */ | 54 | + tcg_gen_extrl_i64_i32(t1, tcg_rn); |
70 | 55 | + tcg_gen_extract2_i32(t0, t0, t1, imm); | |
71 | - obj = OBJECT(dev); | 56 | + tcg_temp_free_i32(t1); |
72 | - for (n = 0; n < BCM283X_NCPUS; n++) { | 57 | + } |
73 | - object_initialize(&s->cpus[n], sizeof(s->cpus[n]), | 58 | + tcg_gen_extu_i32_i64(tcg_rd, t0); |
74 | - s->cpu_type); | 59 | + tcg_temp_free_i32(t0); |
75 | - object_property_add_child(obj, "cpu[*]", OBJECT(&s->cpus[n]), | 60 | } |
76 | - &error_abort); | 61 | } |
77 | - } | 62 | } |
78 | - | ||
79 | obj = object_property_get_link(OBJECT(dev), "ram", &err); | ||
80 | if (obj == NULL) { | ||
81 | error_setg(errp, "%s: required ram link not found: %s", | ||
82 | @@ -XXX,XX +XXX,XX @@ static void bcm2836_realize(DeviceState *dev, Error **errp) | ||
83 | } | ||
84 | |||
85 | static Property bcm2836_props[] = { | ||
86 | - DEFINE_PROP_STRING("cpu-type", BCM283XState, cpu_type), | ||
87 | DEFINE_PROP_UINT32("enabled-cpus", BCM283XState, enabled_cpus, | ||
88 | BCM283X_NCPUS), | ||
89 | DEFINE_PROP_END_OF_LIST() | ||
90 | diff --git a/hw/arm/raspi.c b/hw/arm/raspi.c | ||
91 | index XXXXXXX..XXXXXXX 100644 | ||
92 | --- a/hw/arm/raspi.c | ||
93 | +++ b/hw/arm/raspi.c | ||
94 | @@ -XXX,XX +XXX,XX @@ static void raspi_init(MachineState *machine, int version) | ||
95 | /* Setup the SOC */ | ||
96 | object_property_add_const_link(OBJECT(&s->soc), "ram", OBJECT(&s->ram), | ||
97 | &error_abort); | ||
98 | - object_property_set_str(OBJECT(&s->soc), machine->cpu_type, "cpu-type", | ||
99 | - &error_abort); | ||
100 | object_property_set_int(OBJECT(&s->soc), smp_cpus, "enabled-cpus", | ||
101 | &error_abort); | ||
102 | int board_rev = version == 3 ? 0xa02082 : 0xa21041; | ||
103 | -- | 63 | -- |
104 | 2.16.2 | 64 | 2.20.1 |
105 | 65 | ||
106 | 66 | diff view generated by jsdifflib |
1 | From: Andrey Smirnov <andrew.smirnov@gmail.com> | 1 | From: Richard Henderson <richard.henderson@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | Add support for "TX complete"/TXDC interrupt generate by real HW since | 3 | The mask implied by the extract is redundant with the one |
4 | it is needed to support guests other than Linux. | 4 | implied by the deposit. Also, fix spelling of BFXIL. |
5 | 5 | ||
6 | Based on the patch by Bill Paul as found here: | 6 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> |
7 | https://bugs.launchpad.net/qemu/+bug/1753314 | 7 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
8 | 8 | Message-id: 20190514011129.11330-3-richard.henderson@linaro.org | |
9 | Cc: qemu-devel@nongnu.org | ||
10 | Cc: qemu-arm@nongnu.org | ||
11 | Cc: Bill Paul <wpaul@windriver.com> | ||
12 | Cc: Peter Maydell <peter.maydell@linaro.org> | ||
13 | Signed-off-by: Bill Paul <wpaul@windriver.com> | ||
14 | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> | ||
15 | Message-id: 20180315191141.6789-2-andrew.smirnov@gmail.com | ||
16 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
17 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
18 | --- | 10 | --- |
19 | include/hw/char/imx_serial.h | 3 +++ | 11 | target/arm/translate-a64.c | 6 +++--- |
20 | hw/char/imx_serial.c | 20 +++++++++++++++++--- | 12 | 1 file changed, 3 insertions(+), 3 deletions(-) |
21 | 2 files changed, 20 insertions(+), 3 deletions(-) | ||
22 | 13 | ||
23 | diff --git a/include/hw/char/imx_serial.h b/include/hw/char/imx_serial.h | 14 | diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c |
24 | index XXXXXXX..XXXXXXX 100644 | 15 | index XXXXXXX..XXXXXXX 100644 |
25 | --- a/include/hw/char/imx_serial.h | 16 | --- a/target/arm/translate-a64.c |
26 | +++ b/include/hw/char/imx_serial.h | 17 | +++ b/target/arm/translate-a64.c |
27 | @@ -XXX,XX +XXX,XX @@ | 18 | @@ -XXX,XX +XXX,XX @@ static void disas_bitfield(DisasContext *s, uint32_t insn) |
28 | #define UCR2_RXEN (1<<1) /* Receiver enable */ | 19 | tcg_gen_extract_i64(tcg_rd, tcg_tmp, ri, len); |
29 | #define UCR2_SRST (1<<0) /* Reset complete */ | 20 | return; |
30 | |||
31 | +#define UCR4_TCEN BIT(3) /* TX complete interrupt enable */ | ||
32 | + | ||
33 | #define UTS1_TXEMPTY (1<<6) | ||
34 | #define UTS1_RXEMPTY (1<<5) | ||
35 | #define UTS1_TXFULL (1<<4) | ||
36 | @@ -XXX,XX +XXX,XX @@ typedef struct IMXSerialState { | ||
37 | uint32_t ubmr; | ||
38 | uint32_t ubrc; | ||
39 | uint32_t ucr3; | ||
40 | + uint32_t ucr4; | ||
41 | |||
42 | qemu_irq irq; | ||
43 | CharBackend chr; | ||
44 | diff --git a/hw/char/imx_serial.c b/hw/char/imx_serial.c | ||
45 | index XXXXXXX..XXXXXXX 100644 | ||
46 | --- a/hw/char/imx_serial.c | ||
47 | +++ b/hw/char/imx_serial.c | ||
48 | @@ -XXX,XX +XXX,XX @@ | ||
49 | |||
50 | static const VMStateDescription vmstate_imx_serial = { | ||
51 | .name = TYPE_IMX_SERIAL, | ||
52 | - .version_id = 1, | ||
53 | - .minimum_version_id = 1, | ||
54 | + .version_id = 2, | ||
55 | + .minimum_version_id = 2, | ||
56 | .fields = (VMStateField[]) { | ||
57 | VMSTATE_INT32(readbuff, IMXSerialState), | ||
58 | VMSTATE_UINT32(usr1, IMXSerialState), | ||
59 | @@ -XXX,XX +XXX,XX @@ static const VMStateDescription vmstate_imx_serial = { | ||
60 | VMSTATE_UINT32(ubmr, IMXSerialState), | ||
61 | VMSTATE_UINT32(ubrc, IMXSerialState), | ||
62 | VMSTATE_UINT32(ucr3, IMXSerialState), | ||
63 | + VMSTATE_UINT32(ucr4, IMXSerialState), | ||
64 | VMSTATE_END_OF_LIST() | ||
65 | }, | ||
66 | }; | ||
67 | @@ -XXX,XX +XXX,XX @@ static void imx_update(IMXSerialState *s) | ||
68 | * unfortunately. | ||
69 | */ | ||
70 | mask = (s->ucr1 & UCR1_TXMPTYEN) ? USR2_TXFE : 0; | ||
71 | + /* | ||
72 | + * TCEN and TXDC are both bit 3 | ||
73 | + */ | ||
74 | + mask |= s->ucr4 & UCR4_TCEN; | ||
75 | + | ||
76 | usr2 = s->usr2 & mask; | ||
77 | |||
78 | qemu_set_irq(s->irq, usr1 || usr2); | ||
79 | @@ -XXX,XX +XXX,XX @@ static uint64_t imx_serial_read(void *opaque, hwaddr offset, | ||
80 | return s->ucr3; | ||
81 | |||
82 | case 0x23: /* UCR4 */ | ||
83 | + return s->ucr4; | ||
84 | + | ||
85 | case 0x29: /* BRM Incremental */ | ||
86 | return 0x0; /* TODO */ | ||
87 | |||
88 | @@ -XXX,XX +XXX,XX @@ static void imx_serial_write(void *opaque, hwaddr offset, | ||
89 | * qemu_chr_fe_write and background I/O callbacks */ | ||
90 | qemu_chr_fe_write_all(&s->chr, &ch, 1); | ||
91 | s->usr1 &= ~USR1_TRDY; | ||
92 | + s->usr2 &= ~USR2_TXDC; | ||
93 | imx_update(s); | ||
94 | s->usr1 |= USR1_TRDY; | ||
95 | + s->usr2 |= USR2_TXDC; | ||
96 | imx_update(s); | ||
97 | } | 21 | } |
98 | break; | 22 | - /* opc == 1, BXFIL fall through to deposit */ |
99 | @@ -XXX,XX +XXX,XX @@ static void imx_serial_write(void *opaque, hwaddr offset, | 23 | - tcg_gen_extract_i64(tcg_tmp, tcg_tmp, ri, len); |
100 | s->ucr3 = value & 0xffff; | 24 | + /* opc == 1, BFXIL fall through to deposit */ |
101 | break; | 25 | + tcg_gen_shri_i64(tcg_tmp, tcg_tmp, ri); |
102 | 26 | pos = 0; | |
103 | - case 0x2d: /* UTS1 */ | 27 | } else { |
104 | case 0x23: /* UCR4 */ | 28 | /* Handle the ri > si case with a deposit |
105 | + s->ucr4 = value & 0xffff; | 29 | @@ -XXX,XX +XXX,XX @@ static void disas_bitfield(DisasContext *s, uint32_t insn) |
106 | + imx_update(s); | 30 | len = ri; |
107 | + break; | 31 | } |
108 | + | 32 | |
109 | + case 0x2d: /* UTS1 */ | 33 | - if (opc == 1) { /* BFM, BXFIL */ |
110 | qemu_log_mask(LOG_UNIMP, "[%s]%s: Unimplemented reg 0x%" | 34 | + if (opc == 1) { /* BFM, BFXIL */ |
111 | HWADDR_PRIx "\n", TYPE_IMX_SERIAL, __func__, offset); | 35 | tcg_gen_deposit_i64(tcg_rd, tcg_rd, tcg_tmp, pos, len); |
112 | /* TODO */ | 36 | } else { |
37 | /* SBFM or UBFM: We start with zero, and we haven't modified | ||
113 | -- | 38 | -- |
114 | 2.16.2 | 39 | 2.20.1 |
115 | 40 | ||
116 | 41 | diff view generated by jsdifflib |
1 | From: Andrey Smirnov <andrew.smirnov@gmail.com> | 1 | From: Alistair Francis <alistair.francis@wdc.com> |
---|---|---|---|
2 | 2 | ||
3 | Code of imx_update() is slightly confusing since the "flags" variable | 3 | Commit 89e68b575 "target/arm: Use vector operations for saturation" |
4 | doesn't really corespond to anything in real hardware and server as a | 4 | causes this abort() when booting QEMU ARM with a Cortex-A15: |
5 | kitchensink accumulating events normally reported via USR1 and USR2 | ||
6 | registers. | ||
7 | 5 | ||
8 | Change the code to explicitly evaluate state of interrupts reported | 6 | 0 0x00007ffff4c2382f in raise () at /usr/lib/libc.so.6 |
9 | via USR1 and USR2 against corresponding masking bits and use the to | 7 | 1 0x00007ffff4c0e672 in abort () at /usr/lib/libc.so.6 |
10 | detemine if IRQ line should be asserted or not. | 8 | 2 0x00005555559c1839 in disas_neon_data_insn (insn=<optimized out>, s=<optimized out>) at ./target/arm/translate.c:6673 |
9 | 3 0x00005555559c1839 in disas_neon_data_insn (s=<optimized out>, insn=<optimized out>) at ./target/arm/translate.c:6386 | ||
10 | 4 0x00005555559cd8a4 in disas_arm_insn (insn=4081107068, s=0x7fffe59a9510) at ./target/arm/translate.c:9289 | ||
11 | 5 0x00005555559cd8a4 in arm_tr_translate_insn (dcbase=0x7fffe59a9510, cpu=<optimized out>) at ./target/arm/translate.c:13612 | ||
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. | ||
11 | 22 | ||
12 | NOTE: Check for UTS1_TXEMPTY being set has been dropped for two | 23 | This patch ensures that we don't hit the abort() in the second switch |
13 | reasons: | 24 | case in disas_neon_data_insn() as we will return from the first case. |
14 | 25 | ||
15 | 1. Emulation code implements a single character FIFO, so this flag | 26 | Signed-off-by: Alistair Francis <alistair.francis@wdc.com> |
16 | will always be set since characters are trasmitted as a part of | 27 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> |
17 | the code emulating "push" into the FIFO | 28 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
18 | 29 | Reviewed-by: Alex Bennée <alex.bennee@linaro.org> | |
19 | 2. imx_update() is really just a function doing ORing and maksing | 30 | Tested-by: Alex Bennée <alex.bennee@linaro.org> |
20 | of reported events, so checking for UTS1_TXEMPTY should happen, | 31 | Message-id: ad91b397f360b2fc7f4087e476f7df5b04d42ddb.1558021877.git.alistair.francis@wdc.com |
21 | if it's ever really needed should probably happen outside of | ||
22 | it. | ||
23 | |||
24 | Cc: qemu-devel@nongnu.org | ||
25 | Cc: qemu-arm@nongnu.org | ||
26 | Cc: Bill Paul <wpaul@windriver.com> | ||
27 | Cc: Peter Maydell <peter.maydell@linaro.org> | ||
28 | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> | ||
29 | Message-id: 20180315191141.6789-1-andrew.smirnov@gmail.com | ||
30 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
31 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 32 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
32 | --- | 33 | --- |
33 | hw/char/imx_serial.c | 24 ++++++++++++++++-------- | 34 | target/arm/translate.c | 4 ++-- |
34 | 1 file changed, 16 insertions(+), 8 deletions(-) | 35 | 1 file changed, 2 insertions(+), 2 deletions(-) |
35 | 36 | ||
36 | diff --git a/hw/char/imx_serial.c b/hw/char/imx_serial.c | 37 | diff --git a/target/arm/translate.c b/target/arm/translate.c |
37 | index XXXXXXX..XXXXXXX 100644 | 38 | index XXXXXXX..XXXXXXX 100644 |
38 | --- a/hw/char/imx_serial.c | 39 | --- a/target/arm/translate.c |
39 | +++ b/hw/char/imx_serial.c | 40 | +++ b/target/arm/translate.c |
40 | @@ -XXX,XX +XXX,XX @@ static const VMStateDescription vmstate_imx_serial = { | 41 | @@ -XXX,XX +XXX,XX @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn) |
41 | 42 | tcg_gen_gvec_4(rd_ofs, offsetof(CPUARMState, vfp.qc), | |
42 | static void imx_update(IMXSerialState *s) | 43 | rn_ofs, rm_ofs, vec_size, vec_size, |
43 | { | 44 | (u ? uqadd_op : sqadd_op) + size); |
44 | - uint32_t flags; | 45 | - break; |
45 | + uint32_t usr1; | 46 | + return 0; |
46 | + uint32_t usr2; | 47 | |
47 | + uint32_t mask; | 48 | case NEON_3R_VQSUB: |
48 | 49 | tcg_gen_gvec_4(rd_ofs, offsetof(CPUARMState, vfp.qc), | |
49 | - flags = (s->usr1 & s->ucr1) & (USR1_TRDY|USR1_RRDY); | 50 | rn_ofs, rm_ofs, vec_size, vec_size, |
50 | - if (s->ucr1 & UCR1_TXMPTYEN) { | 51 | (u ? uqsub_op : sqsub_op) + size); |
51 | - flags |= (s->uts1 & UTS1_TXEMPTY); | 52 | - break; |
52 | - } else { | 53 | + return 0; |
53 | - flags &= ~USR1_TRDY; | 54 | |
54 | - } | 55 | case NEON_3R_VMUL: /* VMUL */ |
55 | + /* | 56 | if (u) { |
56 | + * Lucky for us TRDY and RRDY has the same offset in both USR1 and | ||
57 | + * UCR1, so we can get away with something as simple as the | ||
58 | + * following: | ||
59 | + */ | ||
60 | + usr1 = s->usr1 & s->ucr1 & (USR1_TRDY | USR1_RRDY); | ||
61 | + /* | ||
62 | + * Bits that we want in USR2 are not as conveniently laid out, | ||
63 | + * unfortunately. | ||
64 | + */ | ||
65 | + mask = (s->ucr1 & UCR1_TXMPTYEN) ? USR2_TXFE : 0; | ||
66 | + usr2 = s->usr2 & mask; | ||
67 | |||
68 | - qemu_set_irq(s->irq, !!flags); | ||
69 | + qemu_set_irq(s->irq, usr1 || usr2); | ||
70 | } | ||
71 | |||
72 | static void imx_serial_reset(IMXSerialState *s) | ||
73 | -- | 57 | -- |
74 | 2.16.2 | 58 | 2.20.1 |
75 | 59 | ||
76 | 60 | diff view generated by jsdifflib |
1 | If we're directly booting a Linux kernel and the CPU supports both | 1 | The system_clock_scale global is used only by the armv7m systick |
---|---|---|---|
2 | EL3 and EL2, we start the kernel in EL2, as it expects. We must also | 2 | device; move the extern declaration to the armv7m_systick.h header, |
3 | set the SCR_EL3.HCE bit in this situation, so that the HVC | 3 | and expand the comment to explain what it is and that it should |
4 | instruction is enabled rather than UNDEFing. Otherwise at least some | 4 | ideally be replaced with a different approach. |
5 | kernels will panic when trying to initialize KVM in the guest. | ||
6 | 5 | ||
7 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
8 | Message-id: 20180313153458.26822-4-peter.maydell@linaro.org | 7 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
8 | Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
9 | Message-id: 20190516163857.6430-2-peter.maydell@linaro.org | ||
9 | --- | 10 | --- |
10 | hw/arm/boot.c | 5 +++++ | 11 | include/hw/arm/arm.h | 4 ---- |
11 | 1 file changed, 5 insertions(+) | 12 | include/hw/timer/armv7m_systick.h | 22 ++++++++++++++++++++++ |
13 | 2 files changed, 22 insertions(+), 4 deletions(-) | ||
12 | 14 | ||
13 | diff --git a/hw/arm/boot.c b/hw/arm/boot.c | 15 | diff --git a/include/hw/arm/arm.h b/include/hw/arm/arm.h |
14 | index XXXXXXX..XXXXXXX 100644 | 16 | index XXXXXXX..XXXXXXX 100644 |
15 | --- a/hw/arm/boot.c | 17 | --- a/include/hw/arm/arm.h |
16 | +++ b/hw/arm/boot.c | 18 | +++ b/include/hw/arm/arm.h |
17 | @@ -XXX,XX +XXX,XX @@ static void do_cpu_reset(void *opaque) | 19 | @@ -XXX,XX +XXX,XX @@ void arm_write_secure_board_setup_dummy_smc(ARMCPU *cpu, |
18 | assert(!info->secure_board_setup); | 20 | const struct arm_boot_info *info, |
19 | } | 21 | hwaddr mvbar_addr); |
20 | 22 | ||
21 | + if (arm_feature(env, ARM_FEATURE_EL2)) { | 23 | -/* Multiplication factor to convert from system clock ticks to qemu timer |
22 | + /* If we have EL2 then Linux expects the HVC insn to work */ | 24 | - ticks. */ |
23 | + env->cp15.scr_el3 |= SCR_HCE; | 25 | -extern int system_clock_scale; |
24 | + } | 26 | - |
27 | #endif /* HW_ARM_H */ | ||
28 | diff --git a/include/hw/timer/armv7m_systick.h b/include/hw/timer/armv7m_systick.h | ||
29 | index XXXXXXX..XXXXXXX 100644 | ||
30 | --- a/include/hw/timer/armv7m_systick.h | ||
31 | +++ b/include/hw/timer/armv7m_systick.h | ||
32 | @@ -XXX,XX +XXX,XX @@ typedef struct SysTickState { | ||
33 | qemu_irq irq; | ||
34 | } SysTickState; | ||
35 | |||
36 | +/* | ||
37 | + * Multiplication factor to convert from system clock ticks to qemu timer | ||
38 | + * ticks. This should be set (by board code, usually) to a value | ||
39 | + * equal to NANOSECONDS_PER_SECOND / frq, where frq is the clock frequency | ||
40 | + * in Hz of the CPU. | ||
41 | + * | ||
42 | + * This value is used by the systick device when it is running in | ||
43 | + * its "use the CPU clock" mode (ie when SYST_CSR.CLKSOURCE == 1) to | ||
44 | + * set how fast the timer should tick. | ||
45 | + * | ||
46 | + * TODO: we should refactor this so that rather than using a global | ||
47 | + * we use a device property or something similar. This is complicated | ||
48 | + * because (a) the property would need to be plumbed through from the | ||
49 | + * board code down through various layers to the systick device | ||
50 | + * and (b) the property needs to be modifiable after realize, because | ||
51 | + * the stellaris board uses this to implement the behaviour where the | ||
52 | + * guest can reprogram the PLL registers to downclock the CPU, and the | ||
53 | + * systick device needs to react accordingly. Possibly this should | ||
54 | + * be deferred until we have a good API for modelling clock trees. | ||
55 | + */ | ||
56 | +extern int system_clock_scale; | ||
25 | + | 57 | + |
26 | /* Set to non-secure if not a secure boot */ | 58 | #endif |
27 | if (!info->secure_boot && | ||
28 | (cs != first_cpu || !info->secure_board_setup)) { | ||
29 | -- | 59 | -- |
30 | 2.16.2 | 60 | 2.20.1 |
31 | 61 | ||
32 | 62 | diff view generated by jsdifflib |
1 | The bcm2837 is pretty similar to the bcm2836, but it does have | 1 | The hw/arm/arm.h header now only includes declarations relating |
---|---|---|---|
2 | some differences. Notably, the MPIDR affinity aff1 values it | 2 | to boot.c code, so it is only needed by Arm board or SoC code. |
3 | sets for the CPUs are 0x0, rather than the 0xf that the bcm2836 | 3 | Remove some unnecessary inclusions of it from target/arm files |
4 | uses, and if this is wrong Linux will not boot. | 4 | and from hw/intc/armv7m_nvic.c. |
5 | |||
6 | Rather than trying to have one device with properties that | ||
7 | configure it differently for the two cases, create two | ||
8 | separate QOM devices for the two SoCs. We use the same approach | ||
9 | as hw/arm/aspeed_soc.c and share code and have a data table | ||
10 | that might differ per-SoC. For the moment the two types don't | ||
11 | actually have different behaviour. | ||
12 | 5 | ||
13 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
14 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | 7 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
15 | Message-id: 20180313153458.26822-7-peter.maydell@linaro.org | 8 | Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
9 | Message-id: 20190516163857.6430-3-peter.maydell@linaro.org | ||
16 | --- | 10 | --- |
17 | include/hw/arm/bcm2836.h | 19 +++++++++++++++++++ | 11 | hw/intc/armv7m_nvic.c | 1 - |
18 | hw/arm/bcm2836.c | 37 ++++++++++++++++++++++++++++++++----- | 12 | target/arm/arm-semi.c | 1 - |
19 | hw/arm/raspi.c | 3 ++- | 13 | target/arm/cpu.c | 1 - |
20 | 3 files changed, 53 insertions(+), 6 deletions(-) | 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(-) | ||
21 | 19 | ||
22 | diff --git a/include/hw/arm/bcm2836.h b/include/hw/arm/bcm2836.h | 20 | diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c |
23 | index XXXXXXX..XXXXXXX 100644 | 21 | index XXXXXXX..XXXXXXX 100644 |
24 | --- a/include/hw/arm/bcm2836.h | 22 | --- a/hw/intc/armv7m_nvic.c |
25 | +++ b/include/hw/arm/bcm2836.h | 23 | +++ b/hw/intc/armv7m_nvic.c |
26 | @@ -XXX,XX +XXX,XX @@ | 24 | @@ -XXX,XX +XXX,XX @@ |
27 | 25 | #include "cpu.h" | |
28 | #define BCM283X_NCPUS 4 | 26 | #include "hw/sysbus.h" |
29 | 27 | #include "qemu/timer.h" | |
30 | +/* These type names are for specific SoCs; other than instantiating | 28 | -#include "hw/arm/arm.h" |
31 | + * them, code using these devices should always handle them via the | 29 | #include "hw/intc/armv7m_nvic.h" |
32 | + * BCM283x base class, so they have no BCM2836(obj) etc macros. | 30 | #include "target/arm/cpu.h" |
33 | + */ | 31 | #include "exec/exec-all.h" |
34 | +#define TYPE_BCM2836 "bcm2836" | 32 | diff --git a/target/arm/arm-semi.c b/target/arm/arm-semi.c |
35 | +#define TYPE_BCM2837 "bcm2837" | ||
36 | + | ||
37 | typedef struct BCM283XState { | ||
38 | /*< private >*/ | ||
39 | DeviceState parent_obj; | ||
40 | @@ -XXX,XX +XXX,XX @@ typedef struct BCM283XState { | ||
41 | BCM2835PeripheralState peripherals; | ||
42 | } BCM283XState; | ||
43 | |||
44 | +typedef struct BCM283XInfo BCM283XInfo; | ||
45 | + | ||
46 | +typedef struct BCM283XClass { | ||
47 | + DeviceClass parent_class; | ||
48 | + const BCM283XInfo *info; | ||
49 | +} BCM283XClass; | ||
50 | + | ||
51 | +#define BCM283X_CLASS(klass) \ | ||
52 | + OBJECT_CLASS_CHECK(BCM283XClass, (klass), TYPE_BCM283X) | ||
53 | +#define BCM283X_GET_CLASS(obj) \ | ||
54 | + OBJECT_GET_CLASS(BCM283XClass, (obj), TYPE_BCM283X) | ||
55 | + | ||
56 | #endif /* BCM2836_H */ | ||
57 | diff --git a/hw/arm/bcm2836.c b/hw/arm/bcm2836.c | ||
58 | index XXXXXXX..XXXXXXX 100644 | 33 | index XXXXXXX..XXXXXXX 100644 |
59 | --- a/hw/arm/bcm2836.c | 34 | --- a/target/arm/arm-semi.c |
60 | +++ b/hw/arm/bcm2836.c | 35 | +++ b/target/arm/arm-semi.c |
61 | @@ -XXX,XX +XXX,XX @@ | 36 | @@ -XXX,XX +XXX,XX @@ |
62 | /* "QA7" (Pi2) interrupt controller and mailboxes etc. */ | 37 | #else |
63 | #define BCM2836_CONTROL_BASE 0x40000000 | 38 | #include "qemu-common.h" |
64 | 39 | #include "exec/gdbstub.h" | |
65 | +struct BCM283XInfo { | 40 | -#include "hw/arm/arm.h" |
66 | + const char *name; | 41 | #include "qemu/cutils.h" |
67 | +}; | 42 | #endif |
68 | + | 43 | |
69 | +static const BCM283XInfo bcm283x_socs[] = { | 44 | diff --git a/target/arm/cpu.c b/target/arm/cpu.c |
70 | + { | ||
71 | + .name = TYPE_BCM2836, | ||
72 | + }, | ||
73 | + { | ||
74 | + .name = TYPE_BCM2837, | ||
75 | + }, | ||
76 | +}; | ||
77 | + | ||
78 | static void bcm2836_init(Object *obj) | ||
79 | { | ||
80 | BCM283XState *s = BCM283X(obj); | ||
81 | @@ -XXX,XX +XXX,XX @@ static Property bcm2836_props[] = { | ||
82 | DEFINE_PROP_END_OF_LIST() | ||
83 | }; | ||
84 | |||
85 | -static void bcm2836_class_init(ObjectClass *oc, void *data) | ||
86 | +static void bcm283x_class_init(ObjectClass *oc, void *data) | ||
87 | { | ||
88 | DeviceClass *dc = DEVICE_CLASS(oc); | ||
89 | + BCM283XClass *bc = BCM283X_CLASS(oc); | ||
90 | |||
91 | - dc->props = bcm2836_props; | ||
92 | + bc->info = data; | ||
93 | dc->realize = bcm2836_realize; | ||
94 | + dc->props = bcm2836_props; | ||
95 | } | ||
96 | |||
97 | -static const TypeInfo bcm2836_type_info = { | ||
98 | +static const TypeInfo bcm283x_type_info = { | ||
99 | .name = TYPE_BCM283X, | ||
100 | .parent = TYPE_DEVICE, | ||
101 | .instance_size = sizeof(BCM283XState), | ||
102 | .instance_init = bcm2836_init, | ||
103 | - .class_init = bcm2836_class_init, | ||
104 | + .class_size = sizeof(BCM283XClass), | ||
105 | + .abstract = true, | ||
106 | }; | ||
107 | |||
108 | static void bcm2836_register_types(void) | ||
109 | { | ||
110 | - type_register_static(&bcm2836_type_info); | ||
111 | + int i; | ||
112 | + | ||
113 | + type_register_static(&bcm283x_type_info); | ||
114 | + for (i = 0; i < ARRAY_SIZE(bcm283x_socs); i++) { | ||
115 | + TypeInfo ti = { | ||
116 | + .name = bcm283x_socs[i].name, | ||
117 | + .parent = TYPE_BCM283X, | ||
118 | + .class_init = bcm283x_class_init, | ||
119 | + .class_data = (void *) &bcm283x_socs[i], | ||
120 | + }; | ||
121 | + type_register(&ti); | ||
122 | + } | ||
123 | } | ||
124 | |||
125 | type_init(bcm2836_register_types) | ||
126 | diff --git a/hw/arm/raspi.c b/hw/arm/raspi.c | ||
127 | index XXXXXXX..XXXXXXX 100644 | 45 | index XXXXXXX..XXXXXXX 100644 |
128 | --- a/hw/arm/raspi.c | 46 | --- a/target/arm/cpu.c |
129 | +++ b/hw/arm/raspi.c | 47 | +++ b/target/arm/cpu.c |
130 | @@ -XXX,XX +XXX,XX @@ static void raspi_init(MachineState *machine, int version) | 48 | @@ -XXX,XX +XXX,XX @@ |
131 | BusState *bus; | 49 | #if !defined(CONFIG_USER_ONLY) |
132 | DeviceState *carddev; | 50 | #include "hw/loader.h" |
133 | 51 | #endif | |
134 | - object_initialize(&s->soc, sizeof(s->soc), TYPE_BCM283X); | 52 | -#include "hw/arm/arm.h" |
135 | + object_initialize(&s->soc, sizeof(s->soc), | 53 | #include "sysemu/sysemu.h" |
136 | + version == 3 ? TYPE_BCM2837 : TYPE_BCM2836); | 54 | #include "sysemu/hw_accel.h" |
137 | object_property_add_child(OBJECT(machine), "soc", OBJECT(&s->soc), | 55 | #include "kvm_arm.h" |
138 | &error_abort); | 56 | diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c |
57 | index XXXXXXX..XXXXXXX 100644 | ||
58 | --- a/target/arm/cpu64.c | ||
59 | +++ b/target/arm/cpu64.c | ||
60 | @@ -XXX,XX +XXX,XX @@ | ||
61 | #if !defined(CONFIG_USER_ONLY) | ||
62 | #include "hw/loader.h" | ||
63 | #endif | ||
64 | -#include "hw/arm/arm.h" | ||
65 | #include "sysemu/sysemu.h" | ||
66 | #include "sysemu/kvm.h" | ||
67 | #include "kvm_arm.h" | ||
68 | diff --git a/target/arm/kvm.c b/target/arm/kvm.c | ||
69 | index XXXXXXX..XXXXXXX 100644 | ||
70 | --- a/target/arm/kvm.c | ||
71 | +++ b/target/arm/kvm.c | ||
72 | @@ -XXX,XX +XXX,XX @@ | ||
73 | #include "cpu.h" | ||
74 | #include "trace.h" | ||
75 | #include "internals.h" | ||
76 | -#include "hw/arm/arm.h" | ||
77 | #include "hw/pci/pci.h" | ||
78 | #include "exec/memattrs.h" | ||
79 | #include "exec/address-spaces.h" | ||
80 | diff --git a/target/arm/kvm32.c b/target/arm/kvm32.c | ||
81 | index XXXXXXX..XXXXXXX 100644 | ||
82 | --- a/target/arm/kvm32.c | ||
83 | +++ b/target/arm/kvm32.c | ||
84 | @@ -XXX,XX +XXX,XX @@ | ||
85 | #include "sysemu/kvm.h" | ||
86 | #include "kvm_arm.h" | ||
87 | #include "internals.h" | ||
88 | -#include "hw/arm/arm.h" | ||
89 | #include "qemu/log.h" | ||
90 | |||
91 | static inline void set_feature(uint64_t *features, int feature) | ||
92 | diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c | ||
93 | index XXXXXXX..XXXXXXX 100644 | ||
94 | --- a/target/arm/kvm64.c | ||
95 | +++ b/target/arm/kvm64.c | ||
96 | @@ -XXX,XX +XXX,XX @@ | ||
97 | #include "sysemu/kvm.h" | ||
98 | #include "kvm_arm.h" | ||
99 | #include "internals.h" | ||
100 | -#include "hw/arm/arm.h" | ||
101 | |||
102 | static bool have_guest_debug; | ||
139 | 103 | ||
140 | -- | 104 | -- |
141 | 2.16.2 | 105 | 2.20.1 |
142 | 106 | ||
143 | 107 | diff view generated by jsdifflib |
1 | Our BCM2836 type is really a generic one that can be any of | 1 | The header file hw/arm/arm.h now includes only declarations |
---|---|---|---|
2 | the bcm283x family. Rename it accordingly. We change only | 2 | relating to hw/arm/boot.c functionality. Rename it accordingly, |
3 | the names which are visible via the header file to the | 3 | and adjust its header comment. |
4 | rest of the QEMU code, leaving private function names | ||
5 | in bcm2836.c as they are. | ||
6 | 4 | ||
7 | This is a preliminary to making bcm283x be an abstract | 5 | The bulk of this commit was created via |
8 | parent class to specific types for the bcm2836 and bcm2837. | 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. | ||
9 | 11 | ||
10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 12 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
11 | Reviewed-by: Andrew Baumann <Andrew.Baumann@microsoft.com> | 13 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
12 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | 14 | Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
13 | Message-id: 20180313153458.26822-6-peter.maydell@linaro.org | 15 | Message-id: 20190516163857.6430-4-peter.maydell@linaro.org |
14 | --- | 16 | --- |
15 | include/hw/arm/bcm2836.h | 12 ++++++------ | 17 | include/hw/arm/allwinner-a10.h | 2 +- |
16 | hw/arm/bcm2836.c | 17 +++++++++-------- | 18 | include/hw/arm/aspeed_soc.h | 1 - |
17 | hw/arm/raspi.c | 16 ++++++++-------- | 19 | include/hw/arm/bcm2836.h | 1 - |
18 | 3 files changed, 23 insertions(+), 22 deletions(-) | 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%) | ||
19 | 68 | ||
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" | ||
20 | diff --git a/include/hw/arm/bcm2836.h b/include/hw/arm/bcm2836.h | 94 | diff --git a/include/hw/arm/bcm2836.h b/include/hw/arm/bcm2836.h |
21 | index XXXXXXX..XXXXXXX 100644 | 95 | index XXXXXXX..XXXXXXX 100644 |
22 | --- a/include/hw/arm/bcm2836.h | 96 | --- a/include/hw/arm/bcm2836.h |
23 | +++ b/include/hw/arm/bcm2836.h | 97 | +++ b/include/hw/arm/bcm2836.h |
24 | @@ -XXX,XX +XXX,XX @@ | 98 | @@ -XXX,XX +XXX,XX @@ |
99 | #ifndef BCM2836_H | ||
100 | #define BCM2836_H | ||
101 | |||
102 | -#include "hw/arm/arm.h" | ||
25 | #include "hw/arm/bcm2835_peripherals.h" | 103 | #include "hw/arm/bcm2835_peripherals.h" |
26 | #include "hw/intc/bcm2836_control.h" | 104 | #include "hw/intc/bcm2836_control.h" |
27 | 105 | ||
28 | -#define TYPE_BCM2836 "bcm2836" | 106 | diff --git a/include/hw/arm/arm.h b/include/hw/arm/boot.h |
29 | -#define BCM2836(obj) OBJECT_CHECK(BCM2836State, (obj), TYPE_BCM2836) | 107 | similarity index 98% |
30 | +#define TYPE_BCM283X "bcm283x" | 108 | rename from include/hw/arm/arm.h |
31 | +#define BCM283X(obj) OBJECT_CHECK(BCM283XState, (obj), TYPE_BCM283X) | 109 | rename to include/hw/arm/boot.h |
32 | 110 | index XXXXXXX..XXXXXXX 100644 | |
33 | -#define BCM2836_NCPUS 4 | 111 | --- a/include/hw/arm/arm.h |
34 | +#define BCM283X_NCPUS 4 | 112 | +++ b/include/hw/arm/boot.h |
35 | 113 | @@ -XXX,XX +XXX,XX @@ | |
36 | -typedef struct BCM2836State { | 114 | /* |
37 | +typedef struct BCM283XState { | 115 | - * Misc ARM declarations |
38 | /*< private >*/ | 116 | + * ARM kernel loader. |
39 | DeviceState parent_obj; | 117 | * |
40 | /*< public >*/ | 118 | * Copyright (c) 2006 CodeSourcery. |
41 | @@ -XXX,XX +XXX,XX @@ typedef struct BCM2836State { | 119 | * Written by Paul Brook |
42 | char *cpu_type; | 120 | @@ -XXX,XX +XXX,XX @@ |
43 | uint32_t enabled_cpus; | 121 | * |
44 | 122 | */ | |
45 | - ARMCPU cpus[BCM2836_NCPUS]; | 123 | |
46 | + ARMCPU cpus[BCM283X_NCPUS]; | 124 | -#ifndef HW_ARM_H |
47 | BCM2836ControlState control; | 125 | -#define HW_ARM_H |
48 | BCM2835PeripheralState peripherals; | 126 | +#ifndef HW_ARM_BOOT_H |
49 | -} BCM2836State; | 127 | +#define HW_ARM_BOOT_H |
50 | +} BCM283XState; | 128 | |
51 | 129 | #include "exec/memory.h" | |
52 | #endif /* BCM2836_H */ | 130 | #include "target/arm/cpu-qom.h" |
53 | diff --git a/hw/arm/bcm2836.c b/hw/arm/bcm2836.c | 131 | @@ -XXX,XX +XXX,XX @@ void arm_write_secure_board_setup_dummy_smc(ARMCPU *cpu, |
54 | index XXXXXXX..XXXXXXX 100644 | 132 | const struct arm_boot_info *info, |
55 | --- a/hw/arm/bcm2836.c | 133 | hwaddr mvbar_addr); |
56 | +++ b/hw/arm/bcm2836.c | 134 | |
57 | @@ -XXX,XX +XXX,XX @@ | 135 | -#endif /* HW_ARM_H */ |
58 | 136 | +#endif /* HW_ARM_BOOT_H */ | |
59 | static void bcm2836_init(Object *obj) | 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) | ||
60 | { | 473 | { |
61 | - BCM2836State *s = BCM2836(obj); | 474 | diff --git a/hw/arm/nrf51_soc.c b/hw/arm/nrf51_soc.c |
62 | + BCM283XState *s = BCM283X(obj); | 475 | index XXXXXXX..XXXXXXX 100644 |
63 | 476 | --- a/hw/arm/nrf51_soc.c | |
64 | object_initialize(&s->control, sizeof(s->control), TYPE_BCM2836_CONTROL); | 477 | +++ b/hw/arm/nrf51_soc.c |
65 | object_property_add_child(obj, "control", OBJECT(&s->control), NULL); | 478 | @@ -XXX,XX +XXX,XX @@ |
66 | @@ -XXX,XX +XXX,XX @@ static void bcm2836_init(Object *obj) | 479 | #include "qemu/osdep.h" |
67 | 480 | #include "qapi/error.h" | |
68 | static void bcm2836_realize(DeviceState *dev, Error **errp) | 481 | #include "qemu-common.h" |
69 | { | 482 | -#include "hw/arm/arm.h" |
70 | - BCM2836State *s = BCM2836(dev); | 483 | +#include "hw/arm/boot.h" |
71 | + BCM283XState *s = BCM283X(dev); | 484 | #include "hw/sysbus.h" |
72 | Object *obj; | 485 | #include "hw/boards.h" |
73 | Error *err = NULL; | 486 | #include "hw/misc/unimp.h" |
74 | int n; | 487 | diff --git a/hw/arm/nseries.c b/hw/arm/nseries.c |
75 | @@ -XXX,XX +XXX,XX @@ static void bcm2836_realize(DeviceState *dev, Error **errp) | 488 | index XXXXXXX..XXXXXXX 100644 |
76 | /* common peripherals from bcm2835 */ | 489 | --- a/hw/arm/nseries.c |
77 | 490 | +++ b/hw/arm/nseries.c | |
78 | obj = OBJECT(dev); | 491 | @@ -XXX,XX +XXX,XX @@ |
79 | - for (n = 0; n < BCM2836_NCPUS; n++) { | 492 | #include "qemu/bswap.h" |
80 | + for (n = 0; n < BCM283X_NCPUS; n++) { | 493 | #include "sysemu/sysemu.h" |
81 | object_initialize(&s->cpus[n], sizeof(s->cpus[n]), | 494 | #include "hw/arm/omap.h" |
82 | s->cpu_type); | 495 | -#include "hw/arm/arm.h" |
83 | object_property_add_child(obj, "cpu[*]", OBJECT(&s->cpus[n]), | 496 | +#include "hw/arm/boot.h" |
84 | @@ -XXX,XX +XXX,XX @@ static void bcm2836_realize(DeviceState *dev, Error **errp) | 497 | #include "hw/irq.h" |
85 | sysbus_connect_irq(SYS_BUS_DEVICE(&s->peripherals), 1, | 498 | #include "ui/console.h" |
86 | qdev_get_gpio_in_named(DEVICE(&s->control), "gpu-fiq", 0)); | 499 | #include "hw/boards.h" |
87 | 500 | diff --git a/hw/arm/omap1.c b/hw/arm/omap1.c | |
88 | - for (n = 0; n < BCM2836_NCPUS; n++) { | 501 | index XXXXXXX..XXXXXXX 100644 |
89 | + for (n = 0; n < BCM283X_NCPUS; n++) { | 502 | --- a/hw/arm/omap1.c |
90 | /* Mirror bcm2836, which has clusterid set to 0xf | 503 | +++ b/hw/arm/omap1.c |
91 | * TODO: this should be converted to a property of ARM_CPU | 504 | @@ -XXX,XX +XXX,XX @@ |
92 | */ | 505 | #include "cpu.h" |
93 | @@ -XXX,XX +XXX,XX @@ static void bcm2836_realize(DeviceState *dev, Error **errp) | 506 | #include "hw/boards.h" |
94 | } | 507 | #include "hw/hw.h" |
95 | 508 | -#include "hw/arm/arm.h" | |
96 | static Property bcm2836_props[] = { | 509 | +#include "hw/arm/boot.h" |
97 | - DEFINE_PROP_STRING("cpu-type", BCM2836State, cpu_type), | 510 | #include "hw/arm/omap.h" |
98 | - DEFINE_PROP_UINT32("enabled-cpus", BCM2836State, enabled_cpus, BCM2836_NCPUS), | 511 | #include "sysemu/sysemu.h" |
99 | + DEFINE_PROP_STRING("cpu-type", BCM283XState, cpu_type), | 512 | #include "hw/arm/soc_dma.h" |
100 | + DEFINE_PROP_UINT32("enabled-cpus", BCM283XState, enabled_cpus, | 513 | diff --git a/hw/arm/omap2.c b/hw/arm/omap2.c |
101 | + BCM283X_NCPUS), | 514 | index XXXXXXX..XXXXXXX 100644 |
102 | DEFINE_PROP_END_OF_LIST() | 515 | --- a/hw/arm/omap2.c |
103 | }; | 516 | +++ b/hw/arm/omap2.c |
104 | 517 | @@ -XXX,XX +XXX,XX @@ | |
105 | @@ -XXX,XX +XXX,XX @@ static void bcm2836_class_init(ObjectClass *oc, void *data) | 518 | #include "sysemu/qtest.h" |
106 | } | 519 | #include "hw/boards.h" |
107 | 520 | #include "hw/hw.h" | |
108 | static const TypeInfo bcm2836_type_info = { | 521 | -#include "hw/arm/arm.h" |
109 | - .name = TYPE_BCM2836, | 522 | +#include "hw/arm/boot.h" |
110 | + .name = TYPE_BCM283X, | 523 | #include "hw/arm/omap.h" |
111 | .parent = TYPE_DEVICE, | 524 | #include "sysemu/sysemu.h" |
112 | - .instance_size = sizeof(BCM2836State), | 525 | #include "qemu/timer.h" |
113 | + .instance_size = sizeof(BCM283XState), | 526 | diff --git a/hw/arm/omap_sx1.c b/hw/arm/omap_sx1.c |
114 | .instance_init = bcm2836_init, | 527 | index XXXXXXX..XXXXXXX 100644 |
115 | .class_init = bcm2836_class_init, | 528 | --- a/hw/arm/omap_sx1.c |
116 | }; | 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" | ||
117 | diff --git a/hw/arm/raspi.c b/hw/arm/raspi.c | 552 | diff --git a/hw/arm/raspi.c b/hw/arm/raspi.c |
118 | index XXXXXXX..XXXXXXX 100644 | 553 | index XXXXXXX..XXXXXXX 100644 |
119 | --- a/hw/arm/raspi.c | 554 | --- a/hw/arm/raspi.c |
120 | +++ b/hw/arm/raspi.c | 555 | +++ b/hw/arm/raspi.c |
121 | @@ -XXX,XX +XXX,XX @@ | 556 | @@ -XXX,XX +XXX,XX @@ |
122 | static const int raspi_boardid[] = {[1] = 0xc42, [2] = 0xc43, [3] = 0xc44}; | 557 | #include "qemu/error-report.h" |
123 | 558 | #include "hw/boards.h" | |
124 | typedef struct RasPiState { | 559 | #include "hw/loader.h" |
125 | - BCM2836State soc; | 560 | -#include "hw/arm/arm.h" |
126 | + BCM283XState soc; | 561 | +#include "hw/arm/boot.h" |
127 | MemoryRegion ram; | 562 | #include "sysemu/sysemu.h" |
128 | } RasPiState; | 563 | |
129 | 564 | #define SMPBOOT_ADDR 0x300 /* this should leave enough space for ATAGS */ | |
130 | @@ -XXX,XX +XXX,XX @@ static void raspi_init(MachineState *machine, int version) | 565 | diff --git a/hw/arm/realview.c b/hw/arm/realview.c |
131 | BusState *bus; | 566 | index XXXXXXX..XXXXXXX 100644 |
132 | DeviceState *carddev; | 567 | --- a/hw/arm/realview.c |
133 | 568 | +++ b/hw/arm/realview.c | |
134 | - object_initialize(&s->soc, sizeof(s->soc), TYPE_BCM2836); | 569 | @@ -XXX,XX +XXX,XX @@ |
135 | + object_initialize(&s->soc, sizeof(s->soc), TYPE_BCM283X); | 570 | #include "qemu-common.h" |
136 | object_property_add_child(OBJECT(machine), "soc", OBJECT(&s->soc), | 571 | #include "cpu.h" |
137 | &error_abort); | 572 | #include "hw/sysbus.h" |
138 | 573 | -#include "hw/arm/arm.h" | |
139 | @@ -XXX,XX +XXX,XX @@ static void raspi2_machine_init(MachineClass *mc) | 574 | +#include "hw/arm/boot.h" |
140 | mc->no_floppy = 1; | 575 | #include "hw/arm/primecell.h" |
141 | mc->no_cdrom = 1; | 576 | #include "hw/net/lan9118.h" |
142 | mc->default_cpu_type = ARM_CPU_TYPE_NAME("cortex-a15"); | 577 | #include "hw/net/smc91c111.h" |
143 | - mc->max_cpus = BCM2836_NCPUS; | 578 | diff --git a/hw/arm/spitz.c b/hw/arm/spitz.c |
144 | - mc->min_cpus = BCM2836_NCPUS; | 579 | index XXXXXXX..XXXXXXX 100644 |
145 | - mc->default_cpus = BCM2836_NCPUS; | 580 | --- a/hw/arm/spitz.c |
146 | + mc->max_cpus = BCM283X_NCPUS; | 581 | +++ b/hw/arm/spitz.c |
147 | + mc->min_cpus = BCM283X_NCPUS; | 582 | @@ -XXX,XX +XXX,XX @@ |
148 | + mc->default_cpus = BCM283X_NCPUS; | 583 | #include "qapi/error.h" |
149 | mc->default_ram_size = 1024 * 1024 * 1024; | 584 | #include "hw/hw.h" |
150 | mc->ignore_memory_transaction_failures = true; | 585 | #include "hw/arm/pxa.h" |
151 | }; | 586 | -#include "hw/arm/arm.h" |
152 | @@ -XXX,XX +XXX,XX @@ static void raspi3_machine_init(MachineClass *mc) | 587 | +#include "hw/arm/boot.h" |
153 | mc->no_floppy = 1; | 588 | #include "sysemu/sysemu.h" |
154 | mc->no_cdrom = 1; | 589 | #include "hw/pcmcia.h" |
155 | mc->default_cpu_type = ARM_CPU_TYPE_NAME("cortex-a53"); | 590 | #include "hw/i2c/i2c.h" |
156 | - mc->max_cpus = BCM2836_NCPUS; | 591 | diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c |
157 | - mc->min_cpus = BCM2836_NCPUS; | 592 | index XXXXXXX..XXXXXXX 100644 |
158 | - mc->default_cpus = BCM2836_NCPUS; | 593 | --- a/hw/arm/stellaris.c |
159 | + mc->max_cpus = BCM283X_NCPUS; | 594 | +++ b/hw/arm/stellaris.c |
160 | + mc->min_cpus = BCM283X_NCPUS; | 595 | @@ -XXX,XX +XXX,XX @@ |
161 | + mc->default_cpus = BCM283X_NCPUS; | 596 | #include "qapi/error.h" |
162 | mc->default_ram_size = 1024 * 1024 * 1024; | 597 | #include "hw/sysbus.h" |
163 | } | 598 | #include "hw/ssi/ssi.h" |
164 | DEFINE_MACHINE("raspi3", raspi3_machine_init) | 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 | ||
631 | index XXXXXXX..XXXXXXX 100644 | ||
632 | --- a/hw/arm/tosa.c | ||
633 | +++ b/hw/arm/tosa.c | ||
634 | @@ -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" | ||
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" | ||
694 | #include "sysemu/sysemu.h" | ||
695 | diff --git a/hw/arm/xlnx-versal.c b/hw/arm/xlnx-versal.c | ||
696 | index XXXXXXX..XXXXXXX 100644 | ||
697 | --- a/hw/arm/xlnx-versal.c | ||
698 | +++ b/hw/arm/xlnx-versal.c | ||
699 | @@ -XXX,XX +XXX,XX @@ | ||
700 | #include "net/net.h" | ||
701 | #include "sysemu/sysemu.h" | ||
702 | #include "sysemu/kvm.h" | ||
703 | -#include "hw/arm/arm.h" | ||
704 | +#include "hw/arm/boot.h" | ||
705 | #include "kvm_arm.h" | ||
706 | #include "hw/misc/unimp.h" | ||
707 | #include "hw/intc/arm_gicv3_common.h" | ||
708 | diff --git a/hw/arm/z2.c b/hw/arm/z2.c | ||
709 | index XXXXXXX..XXXXXXX 100644 | ||
710 | --- a/hw/arm/z2.c | ||
711 | +++ b/hw/arm/z2.c | ||
712 | @@ -XXX,XX +XXX,XX @@ | ||
713 | #include "qemu/osdep.h" | ||
714 | #include "hw/hw.h" | ||
715 | #include "hw/arm/pxa.h" | ||
716 | -#include "hw/arm/arm.h" | ||
717 | +#include "hw/arm/boot.h" | ||
718 | #include "hw/i2c/i2c.h" | ||
719 | #include "hw/ssi/ssi.h" | ||
720 | #include "hw/boards.h" | ||
165 | -- | 721 | -- |
166 | 2.16.2 | 722 | 2.20.1 |
167 | 723 | ||
168 | 724 | diff view generated by jsdifflib |
1 | The TypeInfo and state struct for bcm2386 disagree about what the | 1 | In ich_vmcr_write() we enforce "writes of BPR fields to less than |
---|---|---|---|
2 | parent class is -- the TypeInfo says it's TYPE_SYS_BUS_DEVICE, | 2 | their minimum sets them to the minimum" by doing a "read vbpr and |
3 | but the BCM2386State struct only defines the parent_obj field | 3 | write it back" operation. A typo here meant that we weren't handling |
4 | as DeviceState. This would have caused problems if anything | 4 | writes to these fields correctly, because we were reading from VBPR0 |
5 | actually tried to treat the object as a TYPE_SYS_BUS_DEVICE. | 5 | but writing to VBPR1. |
6 | Fix the TypeInfo to use TYPE_DEVICE as the parent, since we don't | ||
7 | need any of the additional functionality TYPE_SYS_BUS_DEVICE | ||
8 | provides. | ||
9 | 6 | ||
10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 7 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
11 | Reviewed-by: Andrew Baumann <Andrew.Baumann@microsoft.com> | 8 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
12 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | 9 | Message-id: 20190520162809.2677-4-peter.maydell@linaro.org |
13 | Message-id: 20180313153458.26822-5-peter.maydell@linaro.org | ||
14 | --- | 10 | --- |
15 | hw/arm/bcm2836.c | 2 +- | 11 | hw/intc/arm_gicv3_cpuif.c | 2 +- |
16 | 1 file changed, 1 insertion(+), 1 deletion(-) | 12 | 1 file changed, 1 insertion(+), 1 deletion(-) |
17 | 13 | ||
18 | diff --git a/hw/arm/bcm2836.c b/hw/arm/bcm2836.c | 14 | diff --git a/hw/intc/arm_gicv3_cpuif.c b/hw/intc/arm_gicv3_cpuif.c |
19 | index XXXXXXX..XXXXXXX 100644 | 15 | index XXXXXXX..XXXXXXX 100644 |
20 | --- a/hw/arm/bcm2836.c | 16 | --- a/hw/intc/arm_gicv3_cpuif.c |
21 | +++ b/hw/arm/bcm2836.c | 17 | +++ b/hw/intc/arm_gicv3_cpuif.c |
22 | @@ -XXX,XX +XXX,XX @@ static void bcm2836_class_init(ObjectClass *oc, void *data) | 18 | @@ -XXX,XX +XXX,XX @@ static void ich_vmcr_write(CPUARMState *env, const ARMCPRegInfo *ri, |
23 | 19 | /* Enforce "writing BPRs to less than minimum sets them to the minimum" | |
24 | static const TypeInfo bcm2836_type_info = { | 20 | * by reading and writing back the fields. |
25 | .name = TYPE_BCM2836, | 21 | */ |
26 | - .parent = TYPE_SYS_BUS_DEVICE, | 22 | - write_vbpr(cs, GICV3_G1, read_vbpr(cs, GICV3_G0)); |
27 | + .parent = TYPE_DEVICE, | 23 | + write_vbpr(cs, GICV3_G0, read_vbpr(cs, GICV3_G0)); |
28 | .instance_size = sizeof(BCM2836State), | 24 | write_vbpr(cs, GICV3_G1, read_vbpr(cs, GICV3_G1)); |
29 | .instance_init = bcm2836_init, | 25 | |
30 | .class_init = bcm2836_class_init, | 26 | gicv3_cpuif_virt_update(cs); |
31 | -- | 27 | -- |
32 | 2.16.2 | 28 | 2.20.1 |
33 | 29 | ||
34 | 30 | diff view generated by jsdifflib |
1 | Add some assertions that if we're about to boot an AArch64 kernel, | 1 | The ICC_CTLR_EL3 register includes some bits which are aliases |
---|---|---|---|
2 | the board code has not mistakenly set either secure_boot or | 2 | of bits in the ICC_CTLR_EL1(S) and (NS) registers. QEMU chooses |
3 | secure_board_setup. It doesn't make sense to set secure_boot, | 3 | to keep those bits in the cs->icc_ctlr_el1[] struct fields. |
4 | because all AArch64 kernels must be booted in non-secure mode. | 4 | Unfortunately a missing '~' in the code to update the bits |
5 | 5 | in those fields meant that writing to ICC_CTLR_EL3 would corrupt | |
6 | It might in theory make sense to set secure_board_setup, but | 6 | the ICC_CLTR_EL1 register values. |
7 | we don't currently support that, because only the AArch32 | ||
8 | bootloader[] code calls this hook; bootloader_aarch64[] does not. | ||
9 | Since we don't have a current need for this functionality, just | ||
10 | assert that we don't try to use it. If it's needed we'll add | ||
11 | it later. | ||
12 | 7 | ||
13 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
14 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | 9 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
15 | Message-id: 20180313153458.26822-3-peter.maydell@linaro.org | 10 | Message-id: 20190520162809.2677-5-peter.maydell@linaro.org |
16 | --- | 11 | --- |
17 | hw/arm/boot.c | 7 +++++++ | 12 | hw/intc/arm_gicv3_cpuif.c | 4 ++-- |
18 | 1 file changed, 7 insertions(+) | 13 | 1 file changed, 2 insertions(+), 2 deletions(-) |
19 | 14 | ||
20 | diff --git a/hw/arm/boot.c b/hw/arm/boot.c | 15 | diff --git a/hw/intc/arm_gicv3_cpuif.c b/hw/intc/arm_gicv3_cpuif.c |
21 | index XXXXXXX..XXXXXXX 100644 | 16 | index XXXXXXX..XXXXXXX 100644 |
22 | --- a/hw/arm/boot.c | 17 | --- a/hw/intc/arm_gicv3_cpuif.c |
23 | +++ b/hw/arm/boot.c | 18 | +++ b/hw/intc/arm_gicv3_cpuif.c |
24 | @@ -XXX,XX +XXX,XX @@ static void do_cpu_reset(void *opaque) | 19 | @@ -XXX,XX +XXX,XX @@ static void icc_ctlr_el3_write(CPUARMState *env, const ARMCPRegInfo *ri, |
25 | } else { | 20 | trace_gicv3_icc_ctlr_el3_write(gicv3_redist_affid(cs), value); |
26 | env->pstate = PSTATE_MODE_EL1h; | 21 | |
27 | } | 22 | /* *_EL1NS and *_EL1S bits are aliases into the ICC_CTLR_EL1 bits. */ |
28 | + /* AArch64 kernels never boot in secure mode */ | 23 | - cs->icc_ctlr_el1[GICV3_NS] &= (ICC_CTLR_EL1_CBPR | ICC_CTLR_EL1_EOIMODE); |
29 | + assert(!info->secure_boot); | 24 | + cs->icc_ctlr_el1[GICV3_NS] &= ~(ICC_CTLR_EL1_CBPR | ICC_CTLR_EL1_EOIMODE); |
30 | + /* This hook is only supported for AArch32 currently: | 25 | if (value & ICC_CTLR_EL3_EOIMODE_EL1NS) { |
31 | + * bootloader_aarch64[] will not call the hook, and | 26 | cs->icc_ctlr_el1[GICV3_NS] |= ICC_CTLR_EL1_EOIMODE; |
32 | + * the code above has already dropped us into EL2 or EL1. | 27 | } |
33 | + */ | 28 | @@ -XXX,XX +XXX,XX @@ static void icc_ctlr_el3_write(CPUARMState *env, const ARMCPRegInfo *ri, |
34 | + assert(!info->secure_board_setup); | 29 | cs->icc_ctlr_el1[GICV3_NS] |= ICC_CTLR_EL1_CBPR; |
35 | } | 30 | } |
36 | 31 | ||
37 | /* Set to non-secure if not a secure boot */ | 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 | } | ||
38 | -- | 37 | -- |
39 | 2.16.2 | 38 | 2.20.1 |
40 | 39 | ||
41 | 40 | diff view generated by jsdifflib |
1 | From: Wei Huang <wei@redhat.com> | 1 | From: Philippe Mathieu-Daudé <philmd@redhat.com> |
---|---|---|---|
2 | 2 | ||
3 | For guest kernel that supports KASLR, the load address can change every | 3 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
4 | time when guest VM runs. To find the physical base address correctly, | 4 | Reviewed-by: Alistair Francis <alistair.francis@wdc.com> |
5 | current QEMU dump searches VMCOREINFO for the string "NUMBER(phys_base)=". | 5 | Message-id: 20190520214342.13709-2-philmd@redhat.com |
6 | However this string pattern is only available on x86_64. AArch64 uses a | ||
7 | different field, called "NUMBER(PHYS_OFFSET)=". This patch makes sure | ||
8 | QEMU dump uses the correct string on AArch64. | ||
9 | |||
10 | Signed-off-by: Wei Huang <wei@redhat.com> | ||
11 | Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> | ||
12 | Message-id: 1520615003-20869-1-git-send-email-wei@redhat.com | ||
13 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
14 | --- | 7 | --- |
15 | dump.c | 14 +++++++++++--- | 8 | hw/arm/exynos4_boards.c | 24 ------------------------ |
16 | 1 file changed, 11 insertions(+), 3 deletions(-) | 9 | 1 file changed, 24 deletions(-) |
17 | 10 | ||
18 | diff --git a/dump.c b/dump.c | 11 | diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c |
19 | index XXXXXXX..XXXXXXX 100644 | 12 | index XXXXXXX..XXXXXXX 100644 |
20 | --- a/dump.c | 13 | --- a/hw/arm/exynos4_boards.c |
21 | +++ b/dump.c | 14 | +++ b/hw/arm/exynos4_boards.c |
22 | @@ -XXX,XX +XXX,XX @@ static void vmcoreinfo_update_phys_base(DumpState *s) | 15 | @@ -XXX,XX +XXX,XX @@ |
23 | 16 | #include "hw/net/lan9118.h" | |
24 | lines = g_strsplit((char *)vmci, "\n", -1); | 17 | #include "hw/boards.h" |
25 | for (i = 0; lines[i]; i++) { | 18 | |
26 | - if (g_str_has_prefix(lines[i], "NUMBER(phys_base)=")) { | 19 | -#undef DEBUG |
27 | - if (qemu_strtou64(lines[i] + 18, NULL, 16, | 20 | - |
28 | + const char *prefix = NULL; | 21 | -//#define DEBUG |
29 | + | 22 | - |
30 | + if (s->dump_info.d_machine == EM_X86_64) { | 23 | -#ifdef DEBUG |
31 | + prefix = "NUMBER(phys_base)="; | 24 | - #undef PRINT_DEBUG |
32 | + } else if (s->dump_info.d_machine == EM_AARCH64) { | 25 | - #define PRINT_DEBUG(fmt, args...) \ |
33 | + prefix = "NUMBER(PHYS_OFFSET)="; | 26 | - do { \ |
34 | + } | 27 | - fprintf(stderr, " [%s:%d] "fmt, __func__, __LINE__, ##args); \ |
35 | + | 28 | - } while (0) |
36 | + if (prefix && g_str_has_prefix(lines[i], prefix)) { | 29 | -#else |
37 | + if (qemu_strtou64(lines[i] + strlen(prefix), NULL, 16, | 30 | - #define PRINT_DEBUG(fmt, args...) do {} while (0) |
38 | &phys_base) < 0) { | 31 | -#endif |
39 | - warn_report("Failed to read NUMBER(phys_base)="); | 32 | - |
40 | + warn_report("Failed to read %s", prefix); | 33 | #define SMDK_LAN9118_BASE_ADDR 0x05000000 |
41 | } else { | 34 | |
42 | s->dump_info.phys_base = phys_base; | 35 | typedef enum Exynos4BoardType { |
43 | } | 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 | |||
44 | -- | 53 | -- |
45 | 2.16.2 | 54 | 2.20.1 |
46 | 55 | ||
47 | 56 | diff view generated by jsdifflib |
1 | The BCM2837 sets the Aff1 field of the MPIDR affinity values for the | 1 | From: Philippe Mathieu-Daudé <philmd@redhat.com> |
---|---|---|---|
2 | CPUs to 0, whereas the BCM2836 uses 0xf. Set this correctly, as it | ||
3 | is required for Linux to boot. | ||
4 | 2 | ||
3 | It eases code review, unit is explicit. | ||
4 | |||
5 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
6 | Reviewed-by: Alistair Francis <alistair.francis@wdc.com> | ||
7 | Message-id: 20190520214342.13709-3-philmd@redhat.com | ||
5 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
6 | Reviewed-by: Andrew Baumann <Andrew.Baumann@microsoft.com> | ||
7 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
8 | Message-id: 20180313153458.26822-8-peter.maydell@linaro.org | ||
9 | --- | 9 | --- |
10 | hw/arm/bcm2836.c | 11 +++++++---- | 10 | hw/arm/exynos4_boards.c | 5 +++-- |
11 | 1 file changed, 7 insertions(+), 4 deletions(-) | 11 | 1 file changed, 3 insertions(+), 2 deletions(-) |
12 | 12 | ||
13 | diff --git a/hw/arm/bcm2836.c b/hw/arm/bcm2836.c | 13 | diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c |
14 | index XXXXXXX..XXXXXXX 100644 | 14 | index XXXXXXX..XXXXXXX 100644 |
15 | --- a/hw/arm/bcm2836.c | 15 | --- a/hw/arm/exynos4_boards.c |
16 | +++ b/hw/arm/bcm2836.c | 16 | +++ b/hw/arm/exynos4_boards.c |
17 | @@ -XXX,XX +XXX,XX @@ | 17 | @@ -XXX,XX +XXX,XX @@ |
18 | 18 | */ | |
19 | struct BCM283XInfo { | 19 | |
20 | const char *name; | 20 | #include "qemu/osdep.h" |
21 | + int clusterid; | 21 | +#include "qemu/units.h" |
22 | #include "qapi/error.h" | ||
23 | #include "qemu/error-report.h" | ||
24 | #include "qemu-common.h" | ||
25 | @@ -XXX,XX +XXX,XX @@ static int exynos4_board_smp_bootreg_addr[EXYNOS4_NUM_OF_BOARDS] = { | ||
22 | }; | 26 | }; |
23 | 27 | ||
24 | static const BCM283XInfo bcm283x_socs[] = { | 28 | static unsigned long exynos4_board_ram_size[EXYNOS4_NUM_OF_BOARDS] = { |
25 | { | 29 | - [EXYNOS4_BOARD_NURI] = 0x40000000, |
26 | .name = TYPE_BCM2836, | 30 | - [EXYNOS4_BOARD_SMDKC210] = 0x40000000, |
27 | + .clusterid = 0xf, | 31 | + [EXYNOS4_BOARD_NURI] = 1 * GiB, |
28 | }, | 32 | + [EXYNOS4_BOARD_SMDKC210] = 1 * GiB, |
29 | { | ||
30 | .name = TYPE_BCM2837, | ||
31 | + .clusterid = 0x0, | ||
32 | }, | ||
33 | }; | 33 | }; |
34 | 34 | ||
35 | @@ -XXX,XX +XXX,XX @@ static void bcm2836_init(Object *obj) | 35 | static struct arm_boot_info exynos4_board_binfo = { |
36 | static void bcm2836_realize(DeviceState *dev, Error **errp) | ||
37 | { | ||
38 | BCM283XState *s = BCM283X(dev); | ||
39 | + BCM283XClass *bc = BCM283X_GET_CLASS(dev); | ||
40 | + const BCM283XInfo *info = bc->info; | ||
41 | Object *obj; | ||
42 | Error *err = NULL; | ||
43 | int n; | ||
44 | @@ -XXX,XX +XXX,XX @@ static void bcm2836_realize(DeviceState *dev, Error **errp) | ||
45 | qdev_get_gpio_in_named(DEVICE(&s->control), "gpu-fiq", 0)); | ||
46 | |||
47 | for (n = 0; n < BCM283X_NCPUS; n++) { | ||
48 | - /* Mirror bcm2836, which has clusterid set to 0xf | ||
49 | - * TODO: this should be converted to a property of ARM_CPU | ||
50 | - */ | ||
51 | - s->cpus[n].mp_affinity = 0xF00 | n; | ||
52 | + /* TODO: this should be converted to a property of ARM_CPU */ | ||
53 | + s->cpus[n].mp_affinity = (info->clusterid << 8) | n; | ||
54 | |||
55 | /* set periphbase/CBAR value for CPU-local registers */ | ||
56 | object_property_set_int(OBJECT(&s->cpus[n]), | ||
57 | -- | 36 | -- |
58 | 2.16.2 | 37 | 2.20.1 |
59 | 38 | ||
60 | 39 | diff view generated by jsdifflib |
1 | From: Guenter Roeck <linux@roeck-us.net> | 1 | From: Guenter Roeck <linux@roeck-us.net> |
---|---|---|---|
2 | 2 | ||
3 | The sabrelite machine model used by qemu-system-arm is based on the | 3 | QEMU already supports pl330. Instantiate it for Exynos4210. |
4 | Freescale/NXP i.MX6Q processor. This SoC has an on-board ethernet | ||
5 | controller which is supported in QEMU using the imx_fec.c module | ||
6 | (actually called imx.enet for this model.) | ||
7 | 4 | ||
8 | The include/hw/arm/fsm-imx6.h file defines the interrupt vectors for the | 5 | Relevant part of Linux arch/arm/boot/dts/exynos4.dtsi: |
9 | imx.enet device like this: | ||
10 | 6 | ||
11 | #define FSL_IMX6_ENET_MAC_1588_IRQ 118 | 7 | / { |
12 | #define FSL_IMX6_ENET_MAC_IRQ 119 | 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 | }; | ||
13 | 43 | ||
14 | According to https://www.nxp.com/docs/en/reference-manual/IMX6DQRM.pdf, | ||
15 | page 225, in Table 3-1. ARM Cortex A9 domain interrupt summary, | ||
16 | interrupts are as follows. | ||
17 | |||
18 | 150 ENET MAC 0 IRQ | ||
19 | 151 ENET MAC 0 1588 Timer interrupt | ||
20 | |||
21 | where | ||
22 | |||
23 | 150 - 32 == 118 | ||
24 | 151 - 32 == 119 | ||
25 | |||
26 | In other words, the vector definitions in the fsl-imx6.h file are reversed. | ||
27 | |||
28 | Fixing the interrupts alone causes problems with older Linux kernels: | ||
29 | The Ethernet interface will fail to probe with Linux v4.9 and earlier. | ||
30 | Linux v4.1 and earlier will crash due to a bug in Ethernet driver probe | ||
31 | error handling. This is a Linux kernel problem, not a qemu problem: | ||
32 | the Linux kernel only worked by accident since it requested both interrupts. | ||
33 | |||
34 | For backward compatibility, generate the Ethernet interrupt on both interrupt | ||
35 | lines. This was shown to work from all Linux kernel releases starting with | ||
36 | v3.16. | ||
37 | |||
38 | Link: https://bugs.launchpad.net/qemu/+bug/1753309 | ||
39 | Signed-off-by: Guenter Roeck <linux@roeck-us.net> | 44 | Signed-off-by: Guenter Roeck <linux@roeck-us.net> |
40 | Message-id: 1520723090-22130-1-git-send-email-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> | ||
41 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 53 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> |
42 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 54 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
43 | --- | 55 | --- |
44 | include/hw/arm/fsl-imx6.h | 4 ++-- | 56 | hw/arm/exynos4210.c | 26 ++++++++++++++++++++++++++ |
45 | hw/net/imx_fec.c | 28 +++++++++++++++++++++++++++- | 57 | 1 file changed, 26 insertions(+) |
46 | 2 files changed, 29 insertions(+), 3 deletions(-) | ||
47 | 58 | ||
48 | diff --git a/include/hw/arm/fsl-imx6.h b/include/hw/arm/fsl-imx6.h | 59 | diff --git a/hw/arm/exynos4210.c b/hw/arm/exynos4210.c |
49 | index XXXXXXX..XXXXXXX 100644 | 60 | index XXXXXXX..XXXXXXX 100644 |
50 | --- a/include/hw/arm/fsl-imx6.h | 61 | --- a/hw/arm/exynos4210.c |
51 | +++ b/include/hw/arm/fsl-imx6.h | 62 | +++ b/hw/arm/exynos4210.c |
52 | @@ -XXX,XX +XXX,XX @@ typedef struct FslIMX6State { | 63 | @@ -XXX,XX +XXX,XX @@ |
53 | #define FSL_IMX6_HDMI_MASTER_IRQ 115 | 64 | /* EHCI */ |
54 | #define FSL_IMX6_HDMI_CEC_IRQ 116 | 65 | #define EXYNOS4210_EHCI_BASE_ADDR 0x12580000 |
55 | #define FSL_IMX6_MLB150_LOW_IRQ 117 | 66 | |
56 | -#define FSL_IMX6_ENET_MAC_1588_IRQ 118 | 67 | +/* DMA */ |
57 | -#define FSL_IMX6_ENET_MAC_IRQ 119 | 68 | +#define EXYNOS4210_PL330_BASE0_ADDR 0x12680000 |
58 | +#define FSL_IMX6_ENET_MAC_IRQ 118 | 69 | +#define EXYNOS4210_PL330_BASE1_ADDR 0x12690000 |
59 | +#define FSL_IMX6_ENET_MAC_1588_IRQ 119 | 70 | +#define EXYNOS4210_PL330_BASE2_ADDR 0x12850000 |
60 | #define FSL_IMX6_PCIE1_IRQ 120 | 71 | + |
61 | #define FSL_IMX6_PCIE2_IRQ 121 | 72 | static uint8_t chipid_and_omr[] = { 0x11, 0x02, 0x21, 0x43, |
62 | #define FSL_IMX6_PCIE3_IRQ 122 | 73 | 0x09, 0x00, 0x00, 0x00 }; |
63 | diff --git a/hw/net/imx_fec.c b/hw/net/imx_fec.c | 74 | |
64 | index XXXXXXX..XXXXXXX 100644 | 75 | @@ -XXX,XX +XXX,XX @@ static uint64_t exynos4210_calc_affinity(int cpu) |
65 | --- a/hw/net/imx_fec.c | 76 | return (0x9 << ARM_AFF1_SHIFT) | cpu; |
66 | +++ b/hw/net/imx_fec.c | 77 | } |
67 | @@ -XXX,XX +XXX,XX @@ static void imx_enet_write_bd(IMXENETBufDesc *bd, dma_addr_t addr) | 78 | |
68 | 79 | +static void pl330_create(uint32_t base, qemu_irq irq, int nreq) | |
69 | static void imx_eth_update(IMXFECState *s) | 80 | +{ |
81 | + SysBusDevice *busdev; | ||
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) | ||
70 | { | 93 | { |
71 | - if (s->regs[ENET_EIR] & s->regs[ENET_EIMR] & ENET_INT_TS_TIMER) { | 94 | Exynos4210State *s = g_new0(Exynos4210State, 1); |
72 | + /* | 95 | @@ -XXX,XX +XXX,XX @@ Exynos4210State *exynos4210_init(MemoryRegion *system_mem) |
73 | + * Previous versions of qemu had the ENET_INT_MAC and ENET_INT_TS_TIMER | 96 | sysbus_create_simple(TYPE_EXYNOS4210_EHCI, EXYNOS4210_EHCI_BASE_ADDR, |
74 | + * interrupts swapped. This worked with older versions of Linux (4.14 | 97 | s->irq_table[exynos4210_get_irq(28, 3)]); |
75 | + * and older) since Linux associated both interrupt lines with Ethernet | 98 | |
76 | + * MAC interrupts. Specifically, | 99 | + /*** DMA controllers ***/ |
77 | + * - Linux 4.15 and later have separate interrupt handlers for the MAC and | 100 | + pl330_create(EXYNOS4210_PL330_BASE0_ADDR, |
78 | + * timer interrupts. Those versions of Linux fail with versions of QEMU | 101 | + qemu_irq_invert(s->irq_table[exynos4210_get_irq(35, 1)]), 32); |
79 | + * with swapped interrupt assignments. | 102 | + pl330_create(EXYNOS4210_PL330_BASE1_ADDR, |
80 | + * - In linux 4.14, both interrupt lines were registered with the Ethernet | 103 | + qemu_irq_invert(s->irq_table[exynos4210_get_irq(36, 1)]), 32); |
81 | + * MAC interrupt handler. As a result, all versions of qemu happen to | 104 | + pl330_create(EXYNOS4210_PL330_BASE2_ADDR, |
82 | + * work, though that is accidental. | 105 | + qemu_irq_invert(s->irq_table[exynos4210_get_irq(34, 1)]), 1); |
83 | + * - In Linux 4.9 and older, the timer interrupt was registered directly | 106 | + |
84 | + * with the Ethernet MAC interrupt handler. The MAC interrupt was | 107 | return s; |
85 | + * redirected to a GPIO interrupt to work around erratum ERR006687. | 108 | } |
86 | + * This was implemented using the SOC's IOMUX block. In qemu, this GPIO | ||
87 | + * interrupt never fired since IOMUX is currently not supported in qemu. | ||
88 | + * Linux instead received MAC interrupts on the timer interrupt. | ||
89 | + * As a result, qemu versions with the swapped interrupt assignment work, | ||
90 | + * albeit accidentally, but qemu versions with the correct interrupt | ||
91 | + * assignment fail. | ||
92 | + * | ||
93 | + * To ensure that all versions of Linux work, generate ENET_INT_MAC | ||
94 | + * interrrupts on both interrupt lines. This should be changed if and when | ||
95 | + * qemu supports IOMUX. | ||
96 | + */ | ||
97 | + if (s->regs[ENET_EIR] & s->regs[ENET_EIMR] & | ||
98 | + (ENET_INT_MAC | ENET_INT_TS_TIMER)) { | ||
99 | qemu_set_irq(s->irq[1], 1); | ||
100 | } else { | ||
101 | qemu_set_irq(s->irq[1], 0); | ||
102 | -- | 109 | -- |
103 | 2.16.2 | 110 | 2.20.1 |
104 | 111 | ||
105 | 112 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | For the rpi1 and 2 we want to boot the Linux kernel via some | ||
2 | custom setup code that makes sure that the SMC instruction | ||
3 | acts as a no-op, because it's used for cache maintenance. | ||
4 | The rpi3 boots AArch64 kernels, which don't need SMC for | ||
5 | cache maintenance and always expect to be booted non-secure. | ||
6 | Don't fill in the aarch32-specific parts of the binfo struct. | ||
7 | 1 | ||
8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
9 | Reviewed-by: Andrew Baumann <Andrew.Baumann@microsoft.com> | ||
10 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
11 | Message-id: 20180313153458.26822-2-peter.maydell@linaro.org | ||
12 | --- | ||
13 | hw/arm/raspi.c | 17 +++++++++++++---- | ||
14 | 1 file changed, 13 insertions(+), 4 deletions(-) | ||
15 | |||
16 | diff --git a/hw/arm/raspi.c b/hw/arm/raspi.c | ||
17 | index XXXXXXX..XXXXXXX 100644 | ||
18 | --- a/hw/arm/raspi.c | ||
19 | +++ b/hw/arm/raspi.c | ||
20 | @@ -XXX,XX +XXX,XX @@ static void setup_boot(MachineState *machine, int version, size_t ram_size) | ||
21 | binfo.board_id = raspi_boardid[version]; | ||
22 | binfo.ram_size = ram_size; | ||
23 | binfo.nb_cpus = smp_cpus; | ||
24 | - binfo.board_setup_addr = BOARDSETUP_ADDR; | ||
25 | - binfo.write_board_setup = write_board_setup; | ||
26 | - binfo.secure_board_setup = true; | ||
27 | - binfo.secure_boot = true; | ||
28 | + | ||
29 | + if (version <= 2) { | ||
30 | + /* The rpi1 and 2 require some custom setup code to run in Secure | ||
31 | + * mode before booting a kernel (to set up the SMC vectors so | ||
32 | + * that we get a no-op SMC; this is used by Linux to call the | ||
33 | + * firmware for some cache maintenance operations. | ||
34 | + * The rpi3 doesn't need this. | ||
35 | + */ | ||
36 | + binfo.board_setup_addr = BOARDSETUP_ADDR; | ||
37 | + binfo.write_board_setup = write_board_setup; | ||
38 | + binfo.secure_board_setup = true; | ||
39 | + binfo.secure_boot = true; | ||
40 | + } | ||
41 | |||
42 | /* Pi2 and Pi3 requires SMP setup */ | ||
43 | if (version >= 2) { | ||
44 | -- | ||
45 | 2.16.2 | ||
46 | |||
47 | diff view generated by jsdifflib |
1 | The raspi3 has AArch64 CPUs, which means that our smpboot | 1 | From: Philippe Mathieu-Daudé <philmd@redhat.com> |
---|---|---|---|
2 | code for keeping the secondary CPUs in a pen needs to have | ||
3 | a version for A64 as well as A32. Without this, the | ||
4 | secondary CPUs go into an infinite loop of taking undefined | ||
5 | instruction exceptions. | ||
6 | 2 | ||
3 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
4 | Reviewed-by: Alistair Francis <alistair.francis@wdc.com> | ||
5 | Message-id: 20190520214342.13709-5-philmd@redhat.com | ||
7 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
8 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
9 | Message-id: 20180313153458.26822-10-peter.maydell@linaro.org | ||
10 | --- | 7 | --- |
11 | hw/arm/raspi.c | 41 ++++++++++++++++++++++++++++++++++++++++- | 8 | include/hw/arm/exynos4210.h | 9 +++++++-- |
12 | 1 file changed, 40 insertions(+), 1 deletion(-) | 9 | hw/arm/exynos4210.c | 28 ++++++++++++++++++++++++---- |
10 | hw/arm/exynos4_boards.c | 9 ++++++--- | ||
11 | 3 files changed, 37 insertions(+), 9 deletions(-) | ||
13 | 12 | ||
14 | diff --git a/hw/arm/raspi.c b/hw/arm/raspi.c | 13 | diff --git a/include/hw/arm/exynos4210.h b/include/hw/arm/exynos4210.h |
15 | index XXXXXXX..XXXXXXX 100644 | 14 | index XXXXXXX..XXXXXXX 100644 |
16 | --- a/hw/arm/raspi.c | 15 | --- a/include/hw/arm/exynos4210.h |
17 | +++ b/hw/arm/raspi.c | 16 | +++ b/include/hw/arm/exynos4210.h |
18 | @@ -XXX,XX +XXX,XX @@ | 17 | @@ -XXX,XX +XXX,XX @@ typedef struct Exynos4210Irq { |
19 | #define BOARDSETUP_ADDR (MVBAR_ADDR + 0x20) /* board setup code */ | 18 | } Exynos4210Irq; |
20 | #define FIRMWARE_ADDR_2 0x8000 /* Pi 2 loads kernel.img here by default */ | 19 | |
21 | #define FIRMWARE_ADDR_3 0x80000 /* Pi 3 loads kernel.img here by default */ | 20 | typedef struct Exynos4210State { |
22 | +#define SPINTABLE_ADDR 0xd8 /* Pi 3 bootloader spintable */ | 21 | + /*< private >*/ |
23 | 22 | + SysBusDevice parent_obj; | |
24 | /* Table of Linux board IDs for different Pi versions */ | 23 | + /*< public >*/ |
25 | static const int raspi_boardid[] = {[1] = 0xc42, [2] = 0xc43, [3] = 0xc44}; | 24 | ARMCPU *cpu[EXYNOS4210_NCPUS]; |
26 | @@ -XXX,XX +XXX,XX @@ static void write_smpboot(ARMCPU *cpu, const struct arm_boot_info *info) | 25 | Exynos4210Irq irqs; |
27 | info->smp_loader_start); | 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 | + | ||
35 | void exynos4210_write_secondary(ARMCPU *cpu, | ||
36 | const struct arm_boot_info *info); | ||
37 | |||
38 | -Exynos4210State *exynos4210_init(MemoryRegion *system_mem); | ||
39 | - | ||
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); | ||
28 | } | 49 | } |
29 | 50 | ||
30 | +static void write_smpboot64(ARMCPU *cpu, const struct arm_boot_info *info) | 51 | -Exynos4210State *exynos4210_init(MemoryRegion *system_mem) |
52 | +static void exynos4210_realize(DeviceState *socdev, Error **errp) | ||
53 | { | ||
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 | + | ||
68 | +static void exynos4210_class_init(ObjectClass *klass, void *data) | ||
31 | +{ | 69 | +{ |
32 | + /* Unlike the AArch32 version we don't need to call the board setup hook. | 70 | + DeviceClass *dc = DEVICE_CLASS(klass); |
33 | + * The mechanism for doing the spin-table is also entirely different. | ||
34 | + * We must have four 64-bit fields at absolute addresses | ||
35 | + * 0xd8, 0xe0, 0xe8, 0xf0 in RAM, which are the flag variables for | ||
36 | + * our CPUs, and which we must ensure are zero initialized before | ||
37 | + * the primary CPU goes into the kernel. We put these variables inside | ||
38 | + * a rom blob, so that the reset for ROM contents zeroes them for us. | ||
39 | + */ | ||
40 | + static const uint32_t smpboot[] = { | ||
41 | + 0xd2801b05, /* mov x5, 0xd8 */ | ||
42 | + 0xd53800a6, /* mrs x6, mpidr_el1 */ | ||
43 | + 0x924004c6, /* and x6, x6, #0x3 */ | ||
44 | + 0xd503205f, /* spin: wfe */ | ||
45 | + 0xf86678a4, /* ldr x4, [x5,x6,lsl #3] */ | ||
46 | + 0xb4ffffc4, /* cbz x4, spin */ | ||
47 | + 0xd2800000, /* mov x0, #0x0 */ | ||
48 | + 0xd2800001, /* mov x1, #0x0 */ | ||
49 | + 0xd2800002, /* mov x2, #0x0 */ | ||
50 | + 0xd2800003, /* mov x3, #0x0 */ | ||
51 | + 0xd61f0080, /* br x4 */ | ||
52 | + }; | ||
53 | + | 71 | + |
54 | + static const uint64_t spintables[] = { | 72 | + dc->realize = exynos4210_realize; |
55 | + 0, 0, 0, 0 | ||
56 | + }; | ||
57 | + | ||
58 | + rom_add_blob_fixed("raspi_smpboot", smpboot, sizeof(smpboot), | ||
59 | + info->smp_loader_start); | ||
60 | + rom_add_blob_fixed("raspi_spintables", spintables, sizeof(spintables), | ||
61 | + SPINTABLE_ADDR); | ||
62 | +} | 73 | +} |
63 | + | 74 | + |
64 | static void write_board_setup(ARMCPU *cpu, const struct arm_boot_info *info) | 75 | +static const TypeInfo exynos4210_info = { |
65 | { | 76 | + .name = TYPE_EXYNOS4210_SOC, |
66 | arm_write_secure_board_setup_dummy_smc(cpu, info, MVBAR_ADDR); | 77 | + .parent = TYPE_SYS_BUS_DEVICE, |
67 | @@ -XXX,XX +XXX,XX @@ static void setup_boot(MachineState *machine, int version, size_t ram_size) | 78 | + .instance_size = sizeof(Exynos4210State), |
68 | /* Pi2 and Pi3 requires SMP setup */ | 79 | + .class_init = exynos4210_class_init, |
69 | if (version >= 2) { | 80 | +}; |
70 | binfo.smp_loader_start = SMPBOOT_ADDR; | 81 | + |
71 | - binfo.write_secondary_boot = write_smpboot; | 82 | +static void exynos4210_register_types(void) |
72 | + if (version == 2) { | 83 | +{ |
73 | + binfo.write_secondary_boot = write_smpboot; | 84 | + type_register_static(&exynos4210_info); |
74 | + } else { | 85 | +} |
75 | + binfo.write_secondary_boot = write_smpboot64; | 86 | + |
76 | + } | 87 | +type_init(exynos4210_register_types) |
77 | binfo.secondary_cpu_reset_hook = reset_secondary; | 88 | diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c |
78 | } | 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 | } | ||
79 | 121 | ||
80 | -- | 122 | -- |
81 | 2.16.2 | 123 | 2.20.1 |
82 | 124 | ||
83 | 125 | diff view generated by jsdifflib |