1 | Not very much here, but several people have fallen over | 1 | target-arm queue: nothing big, just a collection of minor things. |
---|---|---|---|
2 | the vector operation segfault bug, so let's get the fix | ||
3 | into master. | ||
4 | 2 | ||
5 | thanks | ||
6 | -- PMM | 3 | -- PMM |
7 | 4 | ||
8 | The following changes since commit d418238dca7b4e0b124135827ead3076233052b1: | 5 | The following changes since commit ae3aa5da96f4ccf0c2a28851449d92db9fcfad71: |
9 | 6 | ||
10 | Merge remote-tracking branch 'remotes/rth/tags/pull-rng-20190522' into staging (2019-05-23 12:57:17 +0100) | 7 | Merge remote-tracking branch 'remotes/berrange/tags/socket-next-pull-request' into staging (2020-05-21 16:47:28 +0100) |
11 | 8 | ||
12 | are available in the Git repository at: | 9 | are available in the Git repository at: |
13 | 10 | ||
14 | https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20190523 | 11 | https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20200521 |
15 | 12 | ||
16 | for you to fetch changes up to 98e4f4fdb8ea05d840f51f47125924c2bb9df2df: | 13 | for you to fetch changes up to 17b5df7b65d0192c5d775b5e1581518580774c77: |
17 | 14 | ||
18 | hw/arm/exynos4210: QOM'ify the Exynos4210 SoC (2019-05-23 14:47:44 +0100) | 15 | linux-user/arm/signal.c: Drop TARGET_CONFIG_CPU_32 (2020-05-21 20:00:19 +0100) |
19 | 16 | ||
20 | ---------------------------------------------------------------- | 17 | ---------------------------------------------------------------- |
21 | target-arm queue: | 18 | target-arm queue: |
22 | * exynos4210: QOM'ify the Exynos4210 SoC | 19 | * tests/acceptance: Add a test for the canon-a1100 machine |
23 | * exynos4210: Add DMA support for the Exynos4210 | 20 | * docs/system: Document some of the Arm development boards |
24 | * arm_gicv3: Fix writes to ICC_CTLR_EL3 | 21 | * linux-user: make BKPT insn cause SIGTRAP, not be a syscall |
25 | * arm_gicv3: Fix write of ICH_VMCR_EL2.{VBPR0, VBPR1} | 22 | * target/arm: Remove unused GEN_NEON_INTEGER_OP macro |
26 | * target/arm: Fix vector operation segfault | 23 | * fsl-imx25, fsl-imx31, fsl-imx6, fsl-imx6ul, fsl-imx7: implement watchdog |
27 | * target/arm: Minor improvements to BFXIL, EXTR | 24 | * hw/arm: Use qemu_log_mask() instead of hw_error() in various places |
25 | * ARM: PL061: Introduce N_GPIOS | ||
26 | * target/arm: Improve clear_vec_high() usage | ||
27 | * target/arm: Allow user-mode code to write CPSR.E via MSR | ||
28 | * linux-user/arm: Reset CPSR_E when entering a signal handler | ||
29 | * linux-user/arm/signal.c: Drop TARGET_CONFIG_CPU_32 | ||
28 | 30 | ||
29 | ---------------------------------------------------------------- | 31 | ---------------------------------------------------------------- |
30 | Alistair Francis (1): | 32 | Amanieu d'Antras (1): |
31 | target/arm: Fix vector operation segfault | 33 | linux-user/arm: Reset CPSR_E when entering a signal handler |
32 | 34 | ||
33 | Guenter Roeck (1): | 35 | Geert Uytterhoeven (1): |
34 | hw/arm/exynos4210: Add DMA support for the Exynos4210 | 36 | ARM: PL061: Introduce N_GPIOS |
35 | 37 | ||
36 | Peter Maydell (5): | 38 | Guenter Roeck (8): |
37 | arm: Move system_clock_scale to armv7m_systick.h | 39 | hw: Move i.MX watchdog driver to hw/watchdog |
38 | arm: Remove unnecessary includes of hw/arm/arm.h | 40 | hw/watchdog: Implement full i.MX watchdog support |
39 | arm: Rename hw/arm/arm.h to hw/arm/boot.h | 41 | hw/arm/fsl-imx25: Wire up watchdog |
40 | hw/intc/arm_gicv3: Fix write of ICH_VMCR_EL2.{VBPR0, VBPR1} | 42 | hw/arm/fsl-imx31: Wire up watchdog |
41 | hw/intc/arm_gicv3: Fix writes to ICC_CTLR_EL3 | 43 | hw/arm/fsl-imx6: Connect watchdog interrupts |
44 | hw/arm/fsl-imx6ul: Connect watchdog interrupts | ||
45 | hw/arm/fsl-imx7: Instantiate various unimplemented devices | ||
46 | hw/arm/fsl-imx7: Connect watchdog interrupts | ||
42 | 47 | ||
43 | Philippe Mathieu-Daudé (3): | 48 | Peter Maydell (12): |
44 | hw/arm/exynos4: Remove unuseful debug code | 49 | docs/system: Add 'Arm' to the Integrator/CP document title |
45 | hw/arm/exynos4: Use the IEC binary prefix definitions | 50 | docs/system: Sort Arm board index into alphabetical order |
46 | hw/arm/exynos4210: QOM'ify the Exynos4210 SoC | 51 | docs/system: Document Arm Versatile Express boards |
52 | docs/system: Document the various MPS2 models | ||
53 | docs/system: Document Musca boards | ||
54 | linux-user/arm: BKPT should cause SIGTRAP, not be a syscall | ||
55 | linux-user/arm: Remove bogus SVC 0xf0002 handling | ||
56 | linux-user/arm: Handle invalid arm-specific syscalls correctly | ||
57 | linux-user/arm: Fix identification of syscall numbers | ||
58 | target/arm: Remove unused GEN_NEON_INTEGER_OP macro | ||
59 | target/arm: Allow user-mode code to write CPSR.E via MSR | ||
60 | linux-user/arm/signal.c: Drop TARGET_CONFIG_CPU_32 | ||
61 | |||
62 | Philippe Mathieu-Daudé (4): | ||
63 | hw/arm/integratorcp: Replace hw_error() by qemu_log_mask() | ||
64 | hw/arm/pxa2xx: Replace hw_error() by qemu_log_mask() | ||
65 | hw/char/xilinx_uartlite: Replace hw_error() by qemu_log_mask() | ||
66 | hw/timer/exynos4210_mct: Replace hw_error() by qemu_log_mask() | ||
47 | 67 | ||
48 | Richard Henderson (2): | 68 | Richard Henderson (2): |
49 | target/arm: Use extract2 for EXTR | 69 | target/arm: Use tcg_gen_gvec_mov for clear_vec_high |
50 | target/arm: Simplify BFXIL expansion | 70 | target/arm: Use clear_vec_high more effectively |
51 | 71 | ||
52 | include/hw/arm/allwinner-a10.h | 2 +- | 72 | Thomas Huth (1): |
53 | include/hw/arm/aspeed_soc.h | 1 - | 73 | tests/acceptance: Add a test for the canon-a1100 machine |
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 | 74 | ||
75 | docs/system/arm/integratorcp.rst | 4 +- | ||
76 | docs/system/arm/mps2.rst | 29 +++ | ||
77 | docs/system/arm/musca.rst | 31 +++ | ||
78 | docs/system/arm/vexpress.rst | 60 ++++++ | ||
79 | docs/system/target-arm.rst | 20 +- | ||
80 | include/hw/arm/fsl-imx25.h | 5 + | ||
81 | include/hw/arm/fsl-imx31.h | 4 + | ||
82 | include/hw/arm/fsl-imx6.h | 2 +- | ||
83 | include/hw/arm/fsl-imx6ul.h | 2 +- | ||
84 | include/hw/arm/fsl-imx7.h | 23 ++- | ||
85 | include/hw/misc/imx2_wdt.h | 33 ---- | ||
86 | include/hw/watchdog/wdt_imx2.h | 90 +++++++++ | ||
87 | target/arm/cpu.h | 2 +- | ||
88 | hw/arm/fsl-imx25.c | 10 + | ||
89 | hw/arm/fsl-imx31.c | 6 + | ||
90 | hw/arm/fsl-imx6.c | 9 + | ||
91 | hw/arm/fsl-imx6ul.c | 10 + | ||
92 | hw/arm/fsl-imx7.c | 35 ++++ | ||
93 | hw/arm/integratorcp.c | 23 ++- | ||
94 | hw/arm/pxa2xx_gpio.c | 7 +- | ||
95 | hw/char/xilinx_uartlite.c | 5 +- | ||
96 | hw/display/pxa2xx_lcd.c | 8 +- | ||
97 | hw/dma/pxa2xx_dma.c | 14 +- | ||
98 | hw/gpio/pl061.c | 12 +- | ||
99 | hw/misc/imx2_wdt.c | 90 --------- | ||
100 | hw/timer/exynos4210_mct.c | 12 +- | ||
101 | hw/watchdog/wdt_imx2.c | 303 +++++++++++++++++++++++++++++ | ||
102 | linux-user/arm/cpu_loop.c | 145 ++++++++------ | ||
103 | linux-user/arm/signal.c | 15 +- | ||
104 | target/arm/translate-a64.c | 63 +++--- | ||
105 | target/arm/translate.c | 23 --- | ||
106 | MAINTAINERS | 6 + | ||
107 | hw/arm/Kconfig | 5 + | ||
108 | hw/misc/Makefile.objs | 1 - | ||
109 | hw/watchdog/Kconfig | 3 + | ||
110 | hw/watchdog/Makefile.objs | 1 + | ||
111 | tests/acceptance/machine_arm_canona1100.py | 35 ++++ | ||
112 | 37 files changed, 854 insertions(+), 292 deletions(-) | ||
113 | create mode 100644 docs/system/arm/mps2.rst | ||
114 | create mode 100644 docs/system/arm/musca.rst | ||
115 | create mode 100644 docs/system/arm/vexpress.rst | ||
116 | delete mode 100644 include/hw/misc/imx2_wdt.h | ||
117 | create mode 100644 include/hw/watchdog/wdt_imx2.h | ||
118 | delete mode 100644 hw/misc/imx2_wdt.c | ||
119 | create mode 100644 hw/watchdog/wdt_imx2.c | ||
120 | create mode 100644 tests/acceptance/machine_arm_canona1100.py | ||
121 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: Thomas Huth <thuth@redhat.com> | ||
1 | 2 | ||
3 | The canon-a1100 machine can be used with the Barebox firmware. The | ||
4 | QEMU Advent Calendar 2018 features a pre-compiled image which we | ||
5 | can use for testing. | ||
6 | |||
7 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
8 | Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
9 | Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com> | ||
10 | Tested-by: Wainer dos Santos Moschetta <wainersm@redhat.com> | ||
11 | Signed-off-by: Thomas Huth <thuth@redhat.com> | ||
12 | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
13 | Message-id: 20200514190422.23645-1-f4bug@amsat.org | ||
14 | Message-Id: <20200129090420.13954-1-thuth@redhat.com> | ||
15 | [PMD: Rebased MAINTAINERS] | ||
16 | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
17 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
18 | --- | ||
19 | MAINTAINERS | 1 + | ||
20 | tests/acceptance/machine_arm_canona1100.py | 35 ++++++++++++++++++++++ | ||
21 | 2 files changed, 36 insertions(+) | ||
22 | create mode 100644 tests/acceptance/machine_arm_canona1100.py | ||
23 | |||
24 | diff --git a/MAINTAINERS b/MAINTAINERS | ||
25 | index XXXXXXX..XXXXXXX 100644 | ||
26 | --- a/MAINTAINERS | ||
27 | +++ b/MAINTAINERS | ||
28 | @@ -XXX,XX +XXX,XX @@ S: Odd Fixes | ||
29 | F: include/hw/arm/digic.h | ||
30 | F: hw/*/digic* | ||
31 | F: include/hw/*/digic* | ||
32 | +F: tests/acceptance/machine_arm_canona1100.py | ||
33 | |||
34 | Goldfish RTC | ||
35 | M: Anup Patel <anup.patel@wdc.com> | ||
36 | diff --git a/tests/acceptance/machine_arm_canona1100.py b/tests/acceptance/machine_arm_canona1100.py | ||
37 | new file mode 100644 | ||
38 | index XXXXXXX..XXXXXXX | ||
39 | --- /dev/null | ||
40 | +++ b/tests/acceptance/machine_arm_canona1100.py | ||
41 | @@ -XXX,XX +XXX,XX @@ | ||
42 | +# Functional test that boots the canon-a1100 machine with firmware | ||
43 | +# | ||
44 | +# Copyright (c) 2020 Red Hat, Inc. | ||
45 | +# | ||
46 | +# Author: | ||
47 | +# Thomas Huth <thuth@redhat.com> | ||
48 | +# | ||
49 | +# This work is licensed under the terms of the GNU GPL, version 2 or | ||
50 | +# later. See the COPYING file in the top-level directory. | ||
51 | + | ||
52 | +from avocado_qemu import Test | ||
53 | +from avocado_qemu import wait_for_console_pattern | ||
54 | +from avocado.utils import archive | ||
55 | + | ||
56 | +class CanonA1100Machine(Test): | ||
57 | + """Boots the barebox firmware and checks that the console is operational""" | ||
58 | + | ||
59 | + timeout = 90 | ||
60 | + | ||
61 | + def test_arm_canona1100(self): | ||
62 | + """ | ||
63 | + :avocado: tags=arch:arm | ||
64 | + :avocado: tags=machine:canon-a1100 | ||
65 | + :avocado: tags=device:pflash_cfi02 | ||
66 | + """ | ||
67 | + tar_url = ('https://www.qemu-advent-calendar.org' | ||
68 | + '/2018/download/day18.tar.xz') | ||
69 | + tar_hash = '068b5fc4242b29381acee94713509f8a876e9db6' | ||
70 | + file_path = self.fetch_asset(tar_url, asset_hash=tar_hash) | ||
71 | + archive.extract(file_path, self.workdir) | ||
72 | + self.vm.set_console() | ||
73 | + self.vm.add_args('-bios', | ||
74 | + self.workdir + '/day18/barebox.canon-a1100.bin') | ||
75 | + self.vm.launch() | ||
76 | + wait_for_console_pattern(self, 'running /env/bin/init') | ||
77 | -- | ||
78 | 2.20.1 | ||
79 | |||
80 | diff view generated by jsdifflib |
1 | The ICC_CTLR_EL3 register includes some bits which are aliases | 1 | Add 'Arm' to the Integrator/CP document title, for consistency with |
---|---|---|---|
2 | of bits in the ICC_CTLR_EL1(S) and (NS) registers. QEMU chooses | 2 | the titling of the other documentation of Arm devboard models |
3 | to keep those bits in the cs->icc_ctlr_el1[] struct fields. | 3 | (versatile, realview). |
4 | Unfortunately a missing '~' in the code to update the bits | ||
5 | in those fields meant that writing to ICC_CTLR_EL3 would corrupt | ||
6 | the ICC_CLTR_EL1 register values. | ||
7 | 4 | ||
8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 5 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
9 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | 6 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
10 | Message-id: 20190520162809.2677-5-peter.maydell@linaro.org | 7 | Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> |
8 | Reviewed-by: Alex Bennée <alex.bennee@linaro.org> | ||
9 | Message-id: 20200507151819.28444-2-peter.maydell@linaro.org | ||
11 | --- | 10 | --- |
12 | hw/intc/arm_gicv3_cpuif.c | 4 ++-- | 11 | docs/system/arm/integratorcp.rst | 4 ++-- |
13 | 1 file changed, 2 insertions(+), 2 deletions(-) | 12 | 1 file changed, 2 insertions(+), 2 deletions(-) |
14 | 13 | ||
15 | diff --git a/hw/intc/arm_gicv3_cpuif.c b/hw/intc/arm_gicv3_cpuif.c | 14 | diff --git a/docs/system/arm/integratorcp.rst b/docs/system/arm/integratorcp.rst |
16 | index XXXXXXX..XXXXXXX 100644 | 15 | index XXXXXXX..XXXXXXX 100644 |
17 | --- a/hw/intc/arm_gicv3_cpuif.c | 16 | --- a/docs/system/arm/integratorcp.rst |
18 | +++ b/hw/intc/arm_gicv3_cpuif.c | 17 | +++ b/docs/system/arm/integratorcp.rst |
19 | @@ -XXX,XX +XXX,XX @@ static void icc_ctlr_el3_write(CPUARMState *env, const ARMCPRegInfo *ri, | 18 | @@ -XXX,XX +XXX,XX @@ |
20 | trace_gicv3_icc_ctlr_el3_write(gicv3_redist_affid(cs), value); | 19 | -Integrator/CP (``integratorcp``) |
21 | 20 | -================================ | |
22 | /* *_EL1NS and *_EL1S bits are aliases into the ICC_CTLR_EL1 bits. */ | 21 | +Arm Integrator/CP (``integratorcp``) |
23 | - cs->icc_ctlr_el1[GICV3_NS] &= (ICC_CTLR_EL1_CBPR | ICC_CTLR_EL1_EOIMODE); | 22 | +==================================== |
24 | + cs->icc_ctlr_el1[GICV3_NS] &= ~(ICC_CTLR_EL1_CBPR | ICC_CTLR_EL1_EOIMODE); | 23 | |
25 | if (value & ICC_CTLR_EL3_EOIMODE_EL1NS) { | 24 | The Arm Integrator/CP board is emulated with the following devices: |
26 | cs->icc_ctlr_el1[GICV3_NS] |= ICC_CTLR_EL1_EOIMODE; | 25 | |
27 | } | ||
28 | @@ -XXX,XX +XXX,XX @@ static void icc_ctlr_el3_write(CPUARMState *env, const ARMCPRegInfo *ri, | ||
29 | cs->icc_ctlr_el1[GICV3_NS] |= ICC_CTLR_EL1_CBPR; | ||
30 | } | ||
31 | |||
32 | - cs->icc_ctlr_el1[GICV3_S] &= (ICC_CTLR_EL1_CBPR | ICC_CTLR_EL1_EOIMODE); | ||
33 | + cs->icc_ctlr_el1[GICV3_S] &= ~(ICC_CTLR_EL1_CBPR | ICC_CTLR_EL1_EOIMODE); | ||
34 | if (value & ICC_CTLR_EL3_EOIMODE_EL1S) { | ||
35 | cs->icc_ctlr_el1[GICV3_S] |= ICC_CTLR_EL1_EOIMODE; | ||
36 | } | ||
37 | -- | 26 | -- |
38 | 2.20.1 | 27 | 2.20.1 |
39 | 28 | ||
40 | 29 | diff view generated by jsdifflib |
1 | The hw/arm/arm.h header now only includes declarations relating | 1 | Sort the board index into alphabetical order. (Note that we need to |
---|---|---|---|
2 | to boot.c code, so it is only needed by Arm board or SoC code. | 2 | sort alphabetically by the title text of each file, which isn't the |
3 | Remove some unnecessary inclusions of it from target/arm files | 3 | same ordering as sorting by the filename.) |
4 | and from hw/intc/armv7m_nvic.c. | ||
5 | 4 | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 5 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
7 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | 6 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
8 | Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> | 7 | Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> |
9 | Message-id: 20190516163857.6430-3-peter.maydell@linaro.org | 8 | Reviewed-by: Alex Bennée <alex.bennee@linaro.org> |
9 | Message-id: 20200507151819.28444-3-peter.maydell@linaro.org | ||
10 | --- | 10 | --- |
11 | hw/intc/armv7m_nvic.c | 1 - | 11 | docs/system/target-arm.rst | 17 +++++++++++------ |
12 | target/arm/arm-semi.c | 1 - | 12 | 1 file changed, 11 insertions(+), 6 deletions(-) |
13 | target/arm/cpu.c | 1 - | ||
14 | target/arm/cpu64.c | 1 - | ||
15 | target/arm/kvm.c | 1 - | ||
16 | target/arm/kvm32.c | 1 - | ||
17 | target/arm/kvm64.c | 1 - | ||
18 | 7 files changed, 7 deletions(-) | ||
19 | 13 | ||
20 | diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c | 14 | diff --git a/docs/system/target-arm.rst b/docs/system/target-arm.rst |
21 | index XXXXXXX..XXXXXXX 100644 | 15 | index XXXXXXX..XXXXXXX 100644 |
22 | --- a/hw/intc/armv7m_nvic.c | 16 | --- a/docs/system/target-arm.rst |
23 | +++ b/hw/intc/armv7m_nvic.c | 17 | +++ b/docs/system/target-arm.rst |
24 | @@ -XXX,XX +XXX,XX @@ | 18 | @@ -XXX,XX +XXX,XX @@ Unfortunately many of the Arm boards QEMU supports are currently |
25 | #include "cpu.h" | 19 | undocumented; you can get a complete list by running |
26 | #include "hw/sysbus.h" | 20 | ``qemu-system-aarch64 --machine help``. |
27 | #include "qemu/timer.h" | 21 | |
28 | -#include "hw/arm/arm.h" | 22 | +.. |
29 | #include "hw/intc/armv7m_nvic.h" | 23 | + This table of contents should be kept sorted alphabetically |
30 | #include "target/arm/cpu.h" | 24 | + by the title text of each file, which isn't the same ordering |
31 | #include "exec/exec-all.h" | 25 | + as an alphabetical sort by filename. |
32 | diff --git a/target/arm/arm-semi.c b/target/arm/arm-semi.c | 26 | + |
33 | index XXXXXXX..XXXXXXX 100644 | 27 | .. toctree:: |
34 | --- a/target/arm/arm-semi.c | 28 | :maxdepth: 1 |
35 | +++ b/target/arm/arm-semi.c | 29 | |
36 | @@ -XXX,XX +XXX,XX @@ | 30 | arm/integratorcp |
37 | #else | 31 | - arm/versatile |
38 | #include "qemu-common.h" | 32 | arm/realview |
39 | #include "exec/gdbstub.h" | 33 | - arm/xscale |
40 | -#include "hw/arm/arm.h" | 34 | - arm/palm |
41 | #include "qemu/cutils.h" | 35 | - arm/nseries |
42 | #endif | 36 | - arm/stellaris |
43 | 37 | + arm/versatile | |
44 | diff --git a/target/arm/cpu.c b/target/arm/cpu.c | 38 | arm/musicpal |
45 | index XXXXXXX..XXXXXXX 100644 | 39 | - arm/sx1 |
46 | --- a/target/arm/cpu.c | 40 | + arm/nseries |
47 | +++ b/target/arm/cpu.c | 41 | arm/orangepi |
48 | @@ -XXX,XX +XXX,XX @@ | 42 | + arm/palm |
49 | #if !defined(CONFIG_USER_ONLY) | 43 | + arm/xscale |
50 | #include "hw/loader.h" | 44 | + arm/sx1 |
51 | #endif | 45 | + arm/stellaris |
52 | -#include "hw/arm/arm.h" | 46 | |
53 | #include "sysemu/sysemu.h" | 47 | Arm CPU features |
54 | #include "sysemu/hw_accel.h" | 48 | ================ |
55 | #include "kvm_arm.h" | ||
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; | ||
103 | |||
104 | -- | 49 | -- |
105 | 2.20.1 | 50 | 2.20.1 |
106 | 51 | ||
107 | 52 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | Provide a minimal documentation of the Versatile Express boards | ||
2 | (vexpress-a9, vexpress-a15). | ||
1 | 3 | ||
4 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
5 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
6 | Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> | ||
7 | Reviewed-by: Alex Bennée <alex.bennee@linaro.org> | ||
8 | Message-id: 20200507151819.28444-4-peter.maydell@linaro.org | ||
9 | --- | ||
10 | docs/system/arm/vexpress.rst | 60 ++++++++++++++++++++++++++++++++++++ | ||
11 | docs/system/target-arm.rst | 1 + | ||
12 | MAINTAINERS | 1 + | ||
13 | 3 files changed, 62 insertions(+) | ||
14 | create mode 100644 docs/system/arm/vexpress.rst | ||
15 | |||
16 | diff --git a/docs/system/arm/vexpress.rst b/docs/system/arm/vexpress.rst | ||
17 | new file mode 100644 | ||
18 | index XXXXXXX..XXXXXXX | ||
19 | --- /dev/null | ||
20 | +++ b/docs/system/arm/vexpress.rst | ||
21 | @@ -XXX,XX +XXX,XX @@ | ||
22 | +Arm Versatile Express boards (``vexpress-a9``, ``vexpress-a15``) | ||
23 | +================================================================ | ||
24 | + | ||
25 | +QEMU models two variants of the Arm Versatile Express development | ||
26 | +board family: | ||
27 | + | ||
28 | +- ``vexpress-a9`` models the combination of the Versatile Express | ||
29 | + motherboard and the CoreTile Express A9x4 daughterboard | ||
30 | +- ``vexpress-a15`` models the combination of the Versatile Express | ||
31 | + motherboard and the CoreTile Express A15x2 daughterboard | ||
32 | + | ||
33 | +Note that as this hardware does not have PCI, IDE or SCSI, | ||
34 | +the only available storage option is emulated SD card. | ||
35 | + | ||
36 | +Implemented devices: | ||
37 | + | ||
38 | +- PL041 audio | ||
39 | +- PL181 SD controller | ||
40 | +- PL050 keyboard and mouse | ||
41 | +- PL011 UARTs | ||
42 | +- SP804 timers | ||
43 | +- I2C controller | ||
44 | +- PL031 RTC | ||
45 | +- PL111 LCD display controller | ||
46 | +- Flash memory | ||
47 | +- LAN9118 ethernet | ||
48 | + | ||
49 | +Unimplemented devices: | ||
50 | + | ||
51 | +- SP810 system control block | ||
52 | +- PCI-express | ||
53 | +- USB controller (Philips ISP1761) | ||
54 | +- Local DAP ROM | ||
55 | +- CoreSight interfaces | ||
56 | +- PL301 AXI interconnect | ||
57 | +- SCC | ||
58 | +- System counter | ||
59 | +- HDLCD controller (``vexpress-a15``) | ||
60 | +- SP805 watchdog | ||
61 | +- PL341 dynamic memory controller | ||
62 | +- DMA330 DMA controller | ||
63 | +- PL354 static memory controller | ||
64 | +- BP147 TrustZone Protection Controller | ||
65 | +- TrustZone Address Space Controller | ||
66 | + | ||
67 | +Other differences between the hardware and the QEMU model: | ||
68 | + | ||
69 | +- QEMU will default to creating one CPU unless you pass a different | ||
70 | + ``-smp`` argument | ||
71 | +- QEMU allows the amount of RAM provided to be specified with the | ||
72 | + ``-m`` argument | ||
73 | +- QEMU defaults to providing a CPU which does not provide either | ||
74 | + TrustZone or the Virtualization Extensions: if you want these you | ||
75 | + must enable them with ``-machine secure=on`` and ``-machine | ||
76 | + virtualization=on`` | ||
77 | +- QEMU provides 4 virtio-mmio virtio transports; these start at | ||
78 | + address ``0x10013000`` for ``vexpress-a9`` and at ``0x1c130000`` for | ||
79 | + ``vexpress-a15``, and have IRQs from 40 upwards. If a dtb is | ||
80 | + provided on the command line then QEMU will edit it to include | ||
81 | + suitable entries describing these transports for the guest. | ||
82 | diff --git a/docs/system/target-arm.rst b/docs/system/target-arm.rst | ||
83 | index XXXXXXX..XXXXXXX 100644 | ||
84 | --- a/docs/system/target-arm.rst | ||
85 | +++ b/docs/system/target-arm.rst | ||
86 | @@ -XXX,XX +XXX,XX @@ undocumented; you can get a complete list by running | ||
87 | arm/integratorcp | ||
88 | arm/realview | ||
89 | arm/versatile | ||
90 | + arm/vexpress | ||
91 | arm/musicpal | ||
92 | arm/nseries | ||
93 | arm/orangepi | ||
94 | diff --git a/MAINTAINERS b/MAINTAINERS | ||
95 | index XXXXXXX..XXXXXXX 100644 | ||
96 | --- a/MAINTAINERS | ||
97 | +++ b/MAINTAINERS | ||
98 | @@ -XXX,XX +XXX,XX @@ M: Peter Maydell <peter.maydell@linaro.org> | ||
99 | L: qemu-arm@nongnu.org | ||
100 | S: Maintained | ||
101 | F: hw/arm/vexpress.c | ||
102 | +F: docs/system/arm/vexpress.rst | ||
103 | |||
104 | Versatile PB | ||
105 | M: Peter Maydell <peter.maydell@linaro.org> | ||
106 | -- | ||
107 | 2.20.1 | ||
108 | |||
109 | diff view generated by jsdifflib |
1 | In ich_vmcr_write() we enforce "writes of BPR fields to less than | 1 | Add basic documentation of the MPS2 board models. |
---|---|---|---|
2 | their minimum sets them to the minimum" by doing a "read vbpr and | ||
3 | write it back" operation. A typo here meant that we weren't handling | ||
4 | writes to these fields correctly, because we were reading from VBPR0 | ||
5 | but writing to VBPR1. | ||
6 | 2 | ||
7 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 3 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
8 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | 4 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
9 | Message-id: 20190520162809.2677-4-peter.maydell@linaro.org | 5 | Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> |
6 | Reviewed-by: Alex Bennée <alex.bennee@linaro.org> | ||
7 | Message-id: 20200507151819.28444-5-peter.maydell@linaro.org | ||
10 | --- | 8 | --- |
11 | hw/intc/arm_gicv3_cpuif.c | 2 +- | 9 | docs/system/arm/mps2.rst | 29 +++++++++++++++++++++++++++++ |
12 | 1 file changed, 1 insertion(+), 1 deletion(-) | 10 | docs/system/target-arm.rst | 1 + |
11 | MAINTAINERS | 1 + | ||
12 | 3 files changed, 31 insertions(+) | ||
13 | create mode 100644 docs/system/arm/mps2.rst | ||
13 | 14 | ||
14 | diff --git a/hw/intc/arm_gicv3_cpuif.c b/hw/intc/arm_gicv3_cpuif.c | 15 | diff --git a/docs/system/arm/mps2.rst b/docs/system/arm/mps2.rst |
16 | new file mode 100644 | ||
17 | index XXXXXXX..XXXXXXX | ||
18 | --- /dev/null | ||
19 | +++ b/docs/system/arm/mps2.rst | ||
20 | @@ -XXX,XX +XXX,XX @@ | ||
21 | +Arm MPS2 boards (``mps2-an385``, ``mps2-an505``, ``mps2-an511``, ``mps2-an521``) | ||
22 | +================================================================================ | ||
23 | + | ||
24 | +These board models all use Arm M-profile CPUs. | ||
25 | + | ||
26 | +The Arm MPS2 and MPS2+ dev boards are FPGA based (the 2+ has a bigger | ||
27 | +FPGA but is otherwise the same as the 2). Since the CPU itself | ||
28 | +and most of the devices are in the FPGA, the details of the board | ||
29 | +as seen by the guest depend significantly on the FPGA image. | ||
30 | + | ||
31 | +QEMU models the following FPGA images: | ||
32 | + | ||
33 | +``mps2-an385`` | ||
34 | + Cortex-M3 as documented in ARM Application Note AN385 | ||
35 | +``mps2-an511`` | ||
36 | + Cortex-M3 'DesignStart' as documented in AN511 | ||
37 | +``mps2-an505`` | ||
38 | + Cortex-M33 as documented in ARM Application Note AN505 | ||
39 | +``mps2-an521`` | ||
40 | + Dual Cortex-M33 as documented in Application Note AN521 | ||
41 | + | ||
42 | +Differences between QEMU and real hardware: | ||
43 | + | ||
44 | +- AN385 remapping of low 16K of memory to either ZBT SSRAM1 or to | ||
45 | + block RAM is unimplemented (QEMU always maps this to ZBT SSRAM1, as | ||
46 | + if zbt_boot_ctrl is always zero) | ||
47 | +- QEMU provides a LAN9118 ethernet rather than LAN9220; the only guest | ||
48 | + visible difference is that the LAN9118 doesn't support checksum | ||
49 | + offloading | ||
50 | diff --git a/docs/system/target-arm.rst b/docs/system/target-arm.rst | ||
15 | index XXXXXXX..XXXXXXX 100644 | 51 | index XXXXXXX..XXXXXXX 100644 |
16 | --- a/hw/intc/arm_gicv3_cpuif.c | 52 | --- a/docs/system/target-arm.rst |
17 | +++ b/hw/intc/arm_gicv3_cpuif.c | 53 | +++ b/docs/system/target-arm.rst |
18 | @@ -XXX,XX +XXX,XX @@ static void ich_vmcr_write(CPUARMState *env, const ARMCPRegInfo *ri, | 54 | @@ -XXX,XX +XXX,XX @@ undocumented; you can get a complete list by running |
19 | /* Enforce "writing BPRs to less than minimum sets them to the minimum" | 55 | :maxdepth: 1 |
20 | * by reading and writing back the fields. | 56 | |
21 | */ | 57 | arm/integratorcp |
22 | - write_vbpr(cs, GICV3_G1, read_vbpr(cs, GICV3_G0)); | 58 | + arm/mps2 |
23 | + write_vbpr(cs, GICV3_G0, read_vbpr(cs, GICV3_G0)); | 59 | arm/realview |
24 | write_vbpr(cs, GICV3_G1, read_vbpr(cs, GICV3_G1)); | 60 | arm/versatile |
25 | 61 | arm/vexpress | |
26 | gicv3_cpuif_virt_update(cs); | 62 | diff --git a/MAINTAINERS b/MAINTAINERS |
63 | index XXXXXXX..XXXXXXX 100644 | ||
64 | --- a/MAINTAINERS | ||
65 | +++ b/MAINTAINERS | ||
66 | @@ -XXX,XX +XXX,XX @@ F: hw/misc/armsse-cpuid.c | ||
67 | F: include/hw/misc/armsse-cpuid.h | ||
68 | F: hw/misc/armsse-mhu.c | ||
69 | F: include/hw/misc/armsse-mhu.h | ||
70 | +F: docs/system/arm/mps2.rst | ||
71 | |||
72 | Musca | ||
73 | M: Peter Maydell <peter.maydell@linaro.org> | ||
27 | -- | 74 | -- |
28 | 2.20.1 | 75 | 2.20.1 |
29 | 76 | ||
30 | 77 | diff view generated by jsdifflib |
1 | The system_clock_scale global is used only by the armv7m systick | 1 | Provide a minimal documentation of the Musca boards. |
---|---|---|---|
2 | device; move the extern declaration to the armv7m_systick.h header, | ||
3 | and expand the comment to explain what it is and that it should | ||
4 | ideally be replaced with a different approach. | ||
5 | 2 | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 3 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
7 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | 4 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
8 | Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> | 5 | Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> |
9 | Message-id: 20190516163857.6430-2-peter.maydell@linaro.org | 6 | Reviewed-by: Alex Bennée <alex.bennee@linaro.org> |
7 | Message-id: 20200507151819.28444-6-peter.maydell@linaro.org | ||
10 | --- | 8 | --- |
11 | include/hw/arm/arm.h | 4 ---- | 9 | docs/system/arm/musca.rst | 31 +++++++++++++++++++++++++++++++ |
12 | include/hw/timer/armv7m_systick.h | 22 ++++++++++++++++++++++ | 10 | docs/system/target-arm.rst | 1 + |
13 | 2 files changed, 22 insertions(+), 4 deletions(-) | 11 | MAINTAINERS | 1 + |
12 | 3 files changed, 33 insertions(+) | ||
13 | create mode 100644 docs/system/arm/musca.rst | ||
14 | 14 | ||
15 | diff --git a/include/hw/arm/arm.h b/include/hw/arm/arm.h | 15 | diff --git a/docs/system/arm/musca.rst b/docs/system/arm/musca.rst |
16 | new file mode 100644 | ||
17 | index XXXXXXX..XXXXXXX | ||
18 | --- /dev/null | ||
19 | +++ b/docs/system/arm/musca.rst | ||
20 | @@ -XXX,XX +XXX,XX @@ | ||
21 | +Arm Musca boards (``musca-a``, ``musca-b1``) | ||
22 | +============================================ | ||
23 | + | ||
24 | +The Arm Musca development boards are a reference implementation | ||
25 | +of a system using the SSE-200 Subsystem for Embedded. They are | ||
26 | +dual Cortex-M33 systems. | ||
27 | + | ||
28 | +QEMU provides models of the A and B1 variants of this board. | ||
29 | + | ||
30 | +Unimplemented devices: | ||
31 | + | ||
32 | +- SPI | ||
33 | +- |I2C| | ||
34 | +- |I2S| | ||
35 | +- PWM | ||
36 | +- QSPI | ||
37 | +- Timer | ||
38 | +- SCC | ||
39 | +- GPIO | ||
40 | +- eFlash | ||
41 | +- MHU | ||
42 | +- PVT | ||
43 | +- SDIO | ||
44 | +- CryptoCell | ||
45 | + | ||
46 | +Note that (like the real hardware) the Musca-A machine is | ||
47 | +asymmetric: CPU 0 does not have the FPU or DSP extensions, | ||
48 | +but CPU 1 does. Also like the real hardware, the memory maps | ||
49 | +for the A and B1 variants differ significantly, so guest | ||
50 | +software must be built for the right variant. | ||
51 | + | ||
52 | diff --git a/docs/system/target-arm.rst b/docs/system/target-arm.rst | ||
16 | index XXXXXXX..XXXXXXX 100644 | 53 | index XXXXXXX..XXXXXXX 100644 |
17 | --- a/include/hw/arm/arm.h | 54 | --- a/docs/system/target-arm.rst |
18 | +++ b/include/hw/arm/arm.h | 55 | +++ b/docs/system/target-arm.rst |
19 | @@ -XXX,XX +XXX,XX @@ void arm_write_secure_board_setup_dummy_smc(ARMCPU *cpu, | 56 | @@ -XXX,XX +XXX,XX @@ undocumented; you can get a complete list by running |
20 | const struct arm_boot_info *info, | 57 | |
21 | hwaddr mvbar_addr); | 58 | arm/integratorcp |
22 | 59 | arm/mps2 | |
23 | -/* Multiplication factor to convert from system clock ticks to qemu timer | 60 | + arm/musca |
24 | - ticks. */ | 61 | arm/realview |
25 | -extern int system_clock_scale; | 62 | arm/versatile |
26 | - | 63 | arm/vexpress |
27 | #endif /* HW_ARM_H */ | 64 | diff --git a/MAINTAINERS b/MAINTAINERS |
28 | diff --git a/include/hw/timer/armv7m_systick.h b/include/hw/timer/armv7m_systick.h | ||
29 | index XXXXXXX..XXXXXXX 100644 | 65 | index XXXXXXX..XXXXXXX 100644 |
30 | --- a/include/hw/timer/armv7m_systick.h | 66 | --- a/MAINTAINERS |
31 | +++ b/include/hw/timer/armv7m_systick.h | 67 | +++ b/MAINTAINERS |
32 | @@ -XXX,XX +XXX,XX @@ typedef struct SysTickState { | 68 | @@ -XXX,XX +XXX,XX @@ M: Peter Maydell <peter.maydell@linaro.org> |
33 | qemu_irq irq; | 69 | L: qemu-arm@nongnu.org |
34 | } SysTickState; | 70 | S: Maintained |
35 | 71 | F: hw/arm/musca.c | |
36 | +/* | 72 | +F: docs/system/arm/musca.rst |
37 | + * Multiplication factor to convert from system clock ticks to qemu timer | 73 | |
38 | + * ticks. This should be set (by board code, usually) to a value | 74 | Musicpal |
39 | + * equal to NANOSECONDS_PER_SECOND / frq, where frq is the clock frequency | 75 | M: Jan Kiszka <jan.kiszka@web.de> |
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; | ||
57 | + | ||
58 | #endif | ||
59 | -- | 76 | -- |
60 | 2.20.1 | 77 | 2.20.1 |
61 | 78 | ||
62 | 79 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | In linux-user/arm/cpu-loop.c we incorrectly treat EXCP_BKPT similarly | ||
2 | to EXCP_SWI, which means that if the guest executes a BKPT insn then | ||
3 | QEMU will perform a syscall for it (which syscall depends on what | ||
4 | value happens to be in r7...). The correct behaviour is that the | ||
5 | guest process should take a SIGTRAP. | ||
1 | 6 | ||
7 | This code has been like this (more or less) since commit | ||
8 | 06c949e62a098f in 2006 which added BKPT in the first place. This is | ||
9 | probably because at the time the same code path was used to handle | ||
10 | both Linux syscalls and semihosting calls, and (on M profile) BKPT | ||
11 | with a suitable magic number is used for semihosting calls. But | ||
12 | these days we've moved handling of semihosting out to an entirely | ||
13 | different codepath, so we can fix this bug by simply removing this | ||
14 | handling of EXCP_BKPT and instead making it deliver a SIGTRAP like | ||
15 | EXCP_DEBUG (as we do already on aarch64). | ||
16 | |||
17 | Reported-by: <omerg681@gmail.com> | ||
18 | Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> | ||
19 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
20 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
21 | Message-id: 20200420212206.12776-2-peter.maydell@linaro.org | ||
22 | Fixes: https://bugs.launchpad.net/qemu/+bug/1873898 | ||
23 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
24 | --- | ||
25 | linux-user/arm/cpu_loop.c | 30 ++++++++---------------------- | ||
26 | 1 file changed, 8 insertions(+), 22 deletions(-) | ||
27 | |||
28 | diff --git a/linux-user/arm/cpu_loop.c b/linux-user/arm/cpu_loop.c | ||
29 | index XXXXXXX..XXXXXXX 100644 | ||
30 | --- a/linux-user/arm/cpu_loop.c | ||
31 | +++ b/linux-user/arm/cpu_loop.c | ||
32 | @@ -XXX,XX +XXX,XX @@ void cpu_loop(CPUARMState *env) | ||
33 | } | ||
34 | break; | ||
35 | case EXCP_SWI: | ||
36 | - case EXCP_BKPT: | ||
37 | { | ||
38 | env->eabi = 1; | ||
39 | /* system call */ | ||
40 | - if (trapnr == EXCP_BKPT) { | ||
41 | - if (env->thumb) { | ||
42 | - /* FIXME - what to do if get_user() fails? */ | ||
43 | - get_user_code_u16(insn, env->regs[15], env); | ||
44 | - n = insn & 0xff; | ||
45 | - env->regs[15] += 2; | ||
46 | - } else { | ||
47 | - /* FIXME - what to do if get_user() fails? */ | ||
48 | - get_user_code_u32(insn, env->regs[15], env); | ||
49 | - n = (insn & 0xf) | ((insn >> 4) & 0xff0); | ||
50 | - env->regs[15] += 4; | ||
51 | - } | ||
52 | + if (env->thumb) { | ||
53 | + /* FIXME - what to do if get_user() fails? */ | ||
54 | + get_user_code_u16(insn, env->regs[15] - 2, env); | ||
55 | + n = insn & 0xff; | ||
56 | } else { | ||
57 | - if (env->thumb) { | ||
58 | - /* FIXME - what to do if get_user() fails? */ | ||
59 | - get_user_code_u16(insn, env->regs[15] - 2, env); | ||
60 | - n = insn & 0xff; | ||
61 | - } else { | ||
62 | - /* FIXME - what to do if get_user() fails? */ | ||
63 | - get_user_code_u32(insn, env->regs[15] - 4, env); | ||
64 | - n = insn & 0xffffff; | ||
65 | - } | ||
66 | + /* FIXME - what to do if get_user() fails? */ | ||
67 | + get_user_code_u32(insn, env->regs[15] - 4, env); | ||
68 | + n = insn & 0xffffff; | ||
69 | } | ||
70 | |||
71 | if (n == ARM_NR_cacheflush) { | ||
72 | @@ -XXX,XX +XXX,XX @@ void cpu_loop(CPUARMState *env) | ||
73 | } | ||
74 | break; | ||
75 | case EXCP_DEBUG: | ||
76 | + case EXCP_BKPT: | ||
77 | excp_debug: | ||
78 | info.si_signo = TARGET_SIGTRAP; | ||
79 | info.si_errno = 0; | ||
80 | -- | ||
81 | 2.20.1 | ||
82 | |||
83 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | We incorrectly treat SVC 0xf0002 as a cacheflush request (which is a | ||
2 | NOP for QEMU). This is the wrong syscall number, because in the | ||
3 | svc-immediate OABI syscall numbers are all offset by the | ||
4 | ARM_SYSCALL_BASE value and so the correct insn is SVC 0x9f0002. | ||
5 | (This is handled further down in the code with the other Arm-specific | ||
6 | syscalls like NR_breakpoint.) | ||
1 | 7 | ||
8 | When this code was initially added in commit 6f1f31c069b20611 in | ||
9 | 2004, ARM_NR_cacheflush was defined as (ARM_SYSCALL_BASE + 0xf0000 + 2) | ||
10 | so the value in the comparison took account of the extra 0x900000 | ||
11 | offset. In commit fbb4a2e371f2fa7 in 2008, the ARM_SYSCALL_BASE | ||
12 | was removed from the definition of ARM_NR_cacheflush and handling | ||
13 | for this group of syscalls was added below the point where we subtract | ||
14 | ARM_SYSCALL_BASE from the SVC immediate value. However that commit | ||
15 | forgot to remove the now-obsolete earlier handling code. | ||
16 | |||
17 | Remove the spurious ARM_NR_cacheflush condition. | ||
18 | |||
19 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
20 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
21 | Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> | ||
22 | Message-id: 20200420212206.12776-3-peter.maydell@linaro.org | ||
23 | --- | ||
24 | linux-user/arm/cpu_loop.c | 4 +--- | ||
25 | 1 file changed, 1 insertion(+), 3 deletions(-) | ||
26 | |||
27 | diff --git a/linux-user/arm/cpu_loop.c b/linux-user/arm/cpu_loop.c | ||
28 | index XXXXXXX..XXXXXXX 100644 | ||
29 | --- a/linux-user/arm/cpu_loop.c | ||
30 | +++ b/linux-user/arm/cpu_loop.c | ||
31 | @@ -XXX,XX +XXX,XX @@ void cpu_loop(CPUARMState *env) | ||
32 | n = insn & 0xffffff; | ||
33 | } | ||
34 | |||
35 | - if (n == ARM_NR_cacheflush) { | ||
36 | - /* nop */ | ||
37 | - } else if (n == 0 || n >= ARM_SYSCALL_BASE || env->thumb) { | ||
38 | + if (n == 0 || n >= ARM_SYSCALL_BASE || env->thumb) { | ||
39 | /* linux syscall */ | ||
40 | if (env->thumb || n == 0) { | ||
41 | n = env->regs[7]; | ||
42 | -- | ||
43 | 2.20.1 | ||
44 | |||
45 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | The kernel has different handling for syscalls with invalid | ||
2 | numbers that are in the "arm-specific" range 0x9f0000 and up: | ||
3 | * 0x9f0000..0x9f07ff return -ENOSYS if not implemented | ||
4 | * other out of range syscalls cause a SIGILL | ||
5 | (see the kernel's arch/arm/kernel/traps.c:arm_syscall()) | ||
1 | 6 | ||
7 | Implement this distinction. (Note that our code doesn't look | ||
8 | quite like the kernel's, because we have removed the | ||
9 | 0x900000 prefix by this point, whereas the kernel retains | ||
10 | it in arm_syscall().) | ||
11 | |||
12 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
13 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
14 | Message-id: 20200420212206.12776-4-peter.maydell@linaro.org | ||
15 | --- | ||
16 | linux-user/arm/cpu_loop.c | 30 ++++++++++++++++++++++++++---- | ||
17 | 1 file changed, 26 insertions(+), 4 deletions(-) | ||
18 | |||
19 | diff --git a/linux-user/arm/cpu_loop.c b/linux-user/arm/cpu_loop.c | ||
20 | index XXXXXXX..XXXXXXX 100644 | ||
21 | --- a/linux-user/arm/cpu_loop.c | ||
22 | +++ b/linux-user/arm/cpu_loop.c | ||
23 | @@ -XXX,XX +XXX,XX @@ void cpu_loop(CPUARMState *env) | ||
24 | env->regs[0] = cpu_get_tls(env); | ||
25 | break; | ||
26 | default: | ||
27 | - qemu_log_mask(LOG_UNIMP, | ||
28 | - "qemu: Unsupported ARM syscall: 0x%x\n", | ||
29 | - n); | ||
30 | - env->regs[0] = -TARGET_ENOSYS; | ||
31 | + if (n < 0xf0800) { | ||
32 | + /* | ||
33 | + * Syscalls 0xf0000..0xf07ff (or 0x9f0000.. | ||
34 | + * 0x9f07ff in OABI numbering) are defined | ||
35 | + * to return -ENOSYS rather than raising | ||
36 | + * SIGILL. Note that we have already | ||
37 | + * removed the 0x900000 prefix. | ||
38 | + */ | ||
39 | + qemu_log_mask(LOG_UNIMP, | ||
40 | + "qemu: Unsupported ARM syscall: 0x%x\n", | ||
41 | + n); | ||
42 | + env->regs[0] = -TARGET_ENOSYS; | ||
43 | + } else { | ||
44 | + /* Otherwise SIGILL */ | ||
45 | + info.si_signo = TARGET_SIGILL; | ||
46 | + info.si_errno = 0; | ||
47 | + info.si_code = TARGET_ILL_ILLTRP; | ||
48 | + info._sifields._sigfault._addr = env->regs[15]; | ||
49 | + if (env->thumb) { | ||
50 | + info._sifields._sigfault._addr -= 2; | ||
51 | + } else { | ||
52 | + info._sifields._sigfault._addr -= 4; | ||
53 | + } | ||
54 | + queue_signal(env, info.si_signo, | ||
55 | + QEMU_SI_FAULT, &info); | ||
56 | + } | ||
57 | break; | ||
58 | } | ||
59 | } else { | ||
60 | -- | ||
61 | 2.20.1 | ||
62 | |||
63 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | Our code to identify syscall numbers has some issues: | ||
2 | * for Thumb mode, we never need the immediate value from the insn, | ||
3 | but we always read it anyway | ||
4 | * bad immediate values in the svc insn should cause a SIGILL, but we | ||
5 | were abort()ing instead (via "goto error") | ||
1 | 6 | ||
7 | We can fix both these things by refactoring the code that identifies | ||
8 | the syscall number to more closely follow the kernel COMPAT_OABI code: | ||
9 | * for Thumb it is always r7 | ||
10 | * for Arm, if the immediate value is 0, then this is an EABI call | ||
11 | with the syscall number in r7 | ||
12 | * otherwise, we XOR the immediate value with 0x900000 | ||
13 | (ARM_SYSCALL_BASE for QEMU; __NR_OABI_SYSCALL_BASE in the kernel), | ||
14 | which converts valid syscall immediates into the desired value, | ||
15 | and puts all invalid immediates in the range 0x100000 or above | ||
16 | * then we can just let the existing "value too large, deliver | ||
17 | SIGILL" case handle invalid numbers, and drop the 'goto error' | ||
18 | |||
19 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
20 | Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> | ||
21 | Message-id: 20200420212206.12776-5-peter.maydell@linaro.org | ||
22 | --- | ||
23 | linux-user/arm/cpu_loop.c | 143 ++++++++++++++++++++------------------ | ||
24 | 1 file changed, 77 insertions(+), 66 deletions(-) | ||
25 | |||
26 | diff --git a/linux-user/arm/cpu_loop.c b/linux-user/arm/cpu_loop.c | ||
27 | index XXXXXXX..XXXXXXX 100644 | ||
28 | --- a/linux-user/arm/cpu_loop.c | ||
29 | +++ b/linux-user/arm/cpu_loop.c | ||
30 | @@ -XXX,XX +XXX,XX @@ void cpu_loop(CPUARMState *env) | ||
31 | env->eabi = 1; | ||
32 | /* system call */ | ||
33 | if (env->thumb) { | ||
34 | - /* FIXME - what to do if get_user() fails? */ | ||
35 | - get_user_code_u16(insn, env->regs[15] - 2, env); | ||
36 | - n = insn & 0xff; | ||
37 | + /* Thumb is always EABI style with syscall number in r7 */ | ||
38 | + n = env->regs[7]; | ||
39 | } else { | ||
40 | + /* | ||
41 | + * Equivalent of kernel CONFIG_OABI_COMPAT: read the | ||
42 | + * Arm SVC insn to extract the immediate, which is the | ||
43 | + * syscall number in OABI. | ||
44 | + */ | ||
45 | /* FIXME - what to do if get_user() fails? */ | ||
46 | get_user_code_u32(insn, env->regs[15] - 4, env); | ||
47 | n = insn & 0xffffff; | ||
48 | - } | ||
49 | - | ||
50 | - if (n == 0 || n >= ARM_SYSCALL_BASE || env->thumb) { | ||
51 | - /* linux syscall */ | ||
52 | - if (env->thumb || n == 0) { | ||
53 | + if (n == 0) { | ||
54 | + /* zero immediate: EABI, syscall number in r7 */ | ||
55 | n = env->regs[7]; | ||
56 | } else { | ||
57 | - n -= ARM_SYSCALL_BASE; | ||
58 | + /* | ||
59 | + * This XOR matches the kernel code: an immediate | ||
60 | + * in the valid range (0x900000 .. 0x9fffff) is | ||
61 | + * converted into the correct EABI-style syscall | ||
62 | + * number; invalid immediates end up as values | ||
63 | + * > 0xfffff and are handled below as out-of-range. | ||
64 | + */ | ||
65 | + n ^= ARM_SYSCALL_BASE; | ||
66 | env->eabi = 0; | ||
67 | } | ||
68 | - if ( n > ARM_NR_BASE) { | ||
69 | - switch (n) { | ||
70 | - case ARM_NR_cacheflush: | ||
71 | - /* nop */ | ||
72 | - break; | ||
73 | - case ARM_NR_set_tls: | ||
74 | - cpu_set_tls(env, env->regs[0]); | ||
75 | - env->regs[0] = 0; | ||
76 | - break; | ||
77 | - case ARM_NR_breakpoint: | ||
78 | - env->regs[15] -= env->thumb ? 2 : 4; | ||
79 | - goto excp_debug; | ||
80 | - case ARM_NR_get_tls: | ||
81 | - env->regs[0] = cpu_get_tls(env); | ||
82 | - break; | ||
83 | - default: | ||
84 | - if (n < 0xf0800) { | ||
85 | - /* | ||
86 | - * Syscalls 0xf0000..0xf07ff (or 0x9f0000.. | ||
87 | - * 0x9f07ff in OABI numbering) are defined | ||
88 | - * to return -ENOSYS rather than raising | ||
89 | - * SIGILL. Note that we have already | ||
90 | - * removed the 0x900000 prefix. | ||
91 | - */ | ||
92 | - qemu_log_mask(LOG_UNIMP, | ||
93 | - "qemu: Unsupported ARM syscall: 0x%x\n", | ||
94 | - n); | ||
95 | - env->regs[0] = -TARGET_ENOSYS; | ||
96 | + } | ||
97 | + | ||
98 | + if (n > ARM_NR_BASE) { | ||
99 | + switch (n) { | ||
100 | + case ARM_NR_cacheflush: | ||
101 | + /* nop */ | ||
102 | + break; | ||
103 | + case ARM_NR_set_tls: | ||
104 | + cpu_set_tls(env, env->regs[0]); | ||
105 | + env->regs[0] = 0; | ||
106 | + break; | ||
107 | + case ARM_NR_breakpoint: | ||
108 | + env->regs[15] -= env->thumb ? 2 : 4; | ||
109 | + goto excp_debug; | ||
110 | + case ARM_NR_get_tls: | ||
111 | + env->regs[0] = cpu_get_tls(env); | ||
112 | + break; | ||
113 | + default: | ||
114 | + if (n < 0xf0800) { | ||
115 | + /* | ||
116 | + * Syscalls 0xf0000..0xf07ff (or 0x9f0000.. | ||
117 | + * 0x9f07ff in OABI numbering) are defined | ||
118 | + * to return -ENOSYS rather than raising | ||
119 | + * SIGILL. Note that we have already | ||
120 | + * removed the 0x900000 prefix. | ||
121 | + */ | ||
122 | + qemu_log_mask(LOG_UNIMP, | ||
123 | + "qemu: Unsupported ARM syscall: 0x%x\n", | ||
124 | + n); | ||
125 | + env->regs[0] = -TARGET_ENOSYS; | ||
126 | + } else { | ||
127 | + /* | ||
128 | + * Otherwise SIGILL. This includes any SWI with | ||
129 | + * immediate not originally 0x9fxxxx, because | ||
130 | + * of the earlier XOR. | ||
131 | + */ | ||
132 | + info.si_signo = TARGET_SIGILL; | ||
133 | + info.si_errno = 0; | ||
134 | + info.si_code = TARGET_ILL_ILLTRP; | ||
135 | + info._sifields._sigfault._addr = env->regs[15]; | ||
136 | + if (env->thumb) { | ||
137 | + info._sifields._sigfault._addr -= 2; | ||
138 | } else { | ||
139 | - /* Otherwise SIGILL */ | ||
140 | - info.si_signo = TARGET_SIGILL; | ||
141 | - info.si_errno = 0; | ||
142 | - info.si_code = TARGET_ILL_ILLTRP; | ||
143 | - info._sifields._sigfault._addr = env->regs[15]; | ||
144 | - if (env->thumb) { | ||
145 | - info._sifields._sigfault._addr -= 2; | ||
146 | - } else { | ||
147 | - info._sifields._sigfault._addr -= 4; | ||
148 | - } | ||
149 | - queue_signal(env, info.si_signo, | ||
150 | - QEMU_SI_FAULT, &info); | ||
151 | + info._sifields._sigfault._addr -= 4; | ||
152 | } | ||
153 | - break; | ||
154 | - } | ||
155 | - } else { | ||
156 | - ret = do_syscall(env, | ||
157 | - n, | ||
158 | - env->regs[0], | ||
159 | - env->regs[1], | ||
160 | - env->regs[2], | ||
161 | - env->regs[3], | ||
162 | - env->regs[4], | ||
163 | - env->regs[5], | ||
164 | - 0, 0); | ||
165 | - if (ret == -TARGET_ERESTARTSYS) { | ||
166 | - env->regs[15] -= env->thumb ? 2 : 4; | ||
167 | - } else if (ret != -TARGET_QEMU_ESIGRETURN) { | ||
168 | - env->regs[0] = ret; | ||
169 | + queue_signal(env, info.si_signo, | ||
170 | + QEMU_SI_FAULT, &info); | ||
171 | } | ||
172 | + break; | ||
173 | } | ||
174 | } else { | ||
175 | - goto error; | ||
176 | + ret = do_syscall(env, | ||
177 | + n, | ||
178 | + env->regs[0], | ||
179 | + env->regs[1], | ||
180 | + env->regs[2], | ||
181 | + env->regs[3], | ||
182 | + env->regs[4], | ||
183 | + env->regs[5], | ||
184 | + 0, 0); | ||
185 | + if (ret == -TARGET_ERESTARTSYS) { | ||
186 | + env->regs[15] -= env->thumb ? 2 : 4; | ||
187 | + } else if (ret != -TARGET_QEMU_ESIGRETURN) { | ||
188 | + env->regs[0] = ret; | ||
189 | + } | ||
190 | } | ||
191 | } | ||
192 | break; | ||
193 | -- | ||
194 | 2.20.1 | ||
195 | |||
196 | diff view generated by jsdifflib |
1 | From: Alistair Francis <alistair.francis@wdc.com> | 1 | The GEN_NEON_INTEGER_OP macro is no longer used; remove it. |
---|---|---|---|
2 | 2 | ||
3 | Commit 89e68b575 "target/arm: Use vector operations for saturation" | 3 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
4 | causes this abort() when booting QEMU ARM with a Cortex-A15: | ||
5 | |||
6 | 0 0x00007ffff4c2382f in raise () at /usr/lib/libc.so.6 | ||
7 | 1 0x00007ffff4c0e672 in abort () at /usr/lib/libc.so.6 | ||
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. | ||
22 | |||
23 | This patch ensures that we don't hit the abort() in the second switch | ||
24 | case in disas_neon_data_insn() as we will return from the first case. | ||
25 | |||
26 | Signed-off-by: Alistair Francis <alistair.francis@wdc.com> | ||
27 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | 4 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> |
28 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
29 | Reviewed-by: Alex Bennée <alex.bennee@linaro.org> | ||
30 | Tested-by: Alex Bennée <alex.bennee@linaro.org> | ||
31 | Message-id: ad91b397f360b2fc7f4087e476f7df5b04d42ddb.1558021877.git.alistair.francis@wdc.com | ||
32 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
33 | --- | 5 | --- |
34 | target/arm/translate.c | 4 ++-- | 6 | target/arm/translate.c | 23 ----------------------- |
35 | 1 file changed, 2 insertions(+), 2 deletions(-) | 7 | 1 file changed, 23 deletions(-) |
36 | 8 | ||
37 | diff --git a/target/arm/translate.c b/target/arm/translate.c | 9 | diff --git a/target/arm/translate.c b/target/arm/translate.c |
38 | index XXXXXXX..XXXXXXX 100644 | 10 | index XXXXXXX..XXXXXXX 100644 |
39 | --- a/target/arm/translate.c | 11 | --- a/target/arm/translate.c |
40 | +++ b/target/arm/translate.c | 12 | +++ b/target/arm/translate.c |
41 | @@ -XXX,XX +XXX,XX @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn) | 13 | @@ -XXX,XX +XXX,XX @@ static inline void gen_neon_rsb(int size, TCGv_i32 t0, TCGv_i32 t1) |
42 | tcg_gen_gvec_4(rd_ofs, offsetof(CPUARMState, vfp.qc), | 14 | default: return 1; \ |
43 | rn_ofs, rm_ofs, vec_size, vec_size, | 15 | }} while (0) |
44 | (u ? uqadd_op : sqadd_op) + size); | 16 | |
45 | - break; | 17 | -#define GEN_NEON_INTEGER_OP(name) do { \ |
46 | + return 0; | 18 | - switch ((size << 1) | u) { \ |
47 | 19 | - case 0: \ | |
48 | case NEON_3R_VQSUB: | 20 | - gen_helper_neon_##name##_s8(tmp, tmp, tmp2); \ |
49 | tcg_gen_gvec_4(rd_ofs, offsetof(CPUARMState, vfp.qc), | 21 | - break; \ |
50 | rn_ofs, rm_ofs, vec_size, vec_size, | 22 | - case 1: \ |
51 | (u ? uqsub_op : sqsub_op) + size); | 23 | - gen_helper_neon_##name##_u8(tmp, tmp, tmp2); \ |
52 | - break; | 24 | - break; \ |
53 | + return 0; | 25 | - case 2: \ |
54 | 26 | - gen_helper_neon_##name##_s16(tmp, tmp, tmp2); \ | |
55 | case NEON_3R_VMUL: /* VMUL */ | 27 | - break; \ |
56 | if (u) { | 28 | - case 3: \ |
29 | - gen_helper_neon_##name##_u16(tmp, tmp, tmp2); \ | ||
30 | - break; \ | ||
31 | - case 4: \ | ||
32 | - gen_helper_neon_##name##_s32(tmp, tmp, tmp2); \ | ||
33 | - break; \ | ||
34 | - case 5: \ | ||
35 | - gen_helper_neon_##name##_u32(tmp, tmp, tmp2); \ | ||
36 | - break; \ | ||
37 | - default: return 1; \ | ||
38 | - }} while (0) | ||
39 | - | ||
40 | static TCGv_i32 neon_load_scratch(int scratch) | ||
41 | { | ||
42 | TCGv_i32 tmp = tcg_temp_new_i32(); | ||
57 | -- | 43 | -- |
58 | 2.20.1 | 44 | 2.20.1 |
59 | 45 | ||
60 | 46 | diff view generated by jsdifflib |
1 | The header file hw/arm/arm.h now includes only declarations | 1 | From: Guenter Roeck <linux@roeck-us.net> |
---|---|---|---|
2 | relating to hw/arm/boot.c functionality. Rename it accordingly, | ||
3 | and adjust its header comment. | ||
4 | 2 | ||
5 | The bulk of this commit was created via | 3 | In preparation for a full implementation, move i.MX watchdog driver |
6 | perl -pi -e 's|hw/arm/arm.h|hw/arm/boot.h|' hw/arm/*.c include/hw/arm/*.h | 4 | from hw/misc to hw/watchdog. While at it, add the watchdog files |
5 | to MAINTAINERS. | ||
7 | 6 | ||
8 | In a few cases we can just delete the #include: | 7 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
9 | hw/arm/msf2-soc.c, include/hw/arm/aspeed_soc.h and | 8 | Signed-off-by: Guenter Roeck <linux@roeck-us.net> |
10 | include/hw/arm/bcm2836.h did not require it. | 9 | Message-id: 20200517162135.110364-2-linux@roeck-us.net |
10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
11 | --- | ||
12 | include/hw/arm/fsl-imx6.h | 2 +- | ||
13 | include/hw/arm/fsl-imx6ul.h | 2 +- | ||
14 | include/hw/arm/fsl-imx7.h | 2 +- | ||
15 | include/hw/{misc/imx2_wdt.h => watchdog/wdt_imx2.h} | 0 | ||
16 | hw/{misc/imx2_wdt.c => watchdog/wdt_imx2.c} | 2 +- | ||
17 | MAINTAINERS | 2 ++ | ||
18 | hw/arm/Kconfig | 3 +++ | ||
19 | hw/misc/Makefile.objs | 1 - | ||
20 | hw/watchdog/Kconfig | 3 +++ | ||
21 | hw/watchdog/Makefile.objs | 1 + | ||
22 | 10 files changed, 13 insertions(+), 5 deletions(-) | ||
23 | rename include/hw/{misc/imx2_wdt.h => watchdog/wdt_imx2.h} (100%) | ||
24 | rename hw/{misc/imx2_wdt.c => watchdog/wdt_imx2.c} (98%) | ||
11 | 25 | ||
12 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
13 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
14 | Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
15 | Message-id: 20190516163857.6430-4-peter.maydell@linaro.org | ||
16 | --- | ||
17 | include/hw/arm/allwinner-a10.h | 2 +- | ||
18 | include/hw/arm/aspeed_soc.h | 1 - | ||
19 | include/hw/arm/bcm2836.h | 1 - | ||
20 | include/hw/arm/{arm.h => boot.h} | 8 ++++---- | ||
21 | include/hw/arm/fsl-imx25.h | 2 +- | ||
22 | include/hw/arm/fsl-imx31.h | 2 +- | ||
23 | include/hw/arm/fsl-imx6.h | 2 +- | ||
24 | include/hw/arm/fsl-imx6ul.h | 2 +- | ||
25 | include/hw/arm/fsl-imx7.h | 2 +- | ||
26 | include/hw/arm/virt.h | 2 +- | ||
27 | include/hw/arm/xlnx-versal.h | 2 +- | ||
28 | include/hw/arm/xlnx-zynqmp.h | 2 +- | ||
29 | hw/arm/armsse.c | 2 +- | ||
30 | hw/arm/armv7m.c | 2 +- | ||
31 | hw/arm/aspeed.c | 2 +- | ||
32 | hw/arm/boot.c | 2 +- | ||
33 | hw/arm/collie.c | 2 +- | ||
34 | hw/arm/exynos4210.c | 2 +- | ||
35 | hw/arm/exynos4_boards.c | 2 +- | ||
36 | hw/arm/highbank.c | 2 +- | ||
37 | hw/arm/integratorcp.c | 2 +- | ||
38 | hw/arm/mainstone.c | 2 +- | ||
39 | hw/arm/microbit.c | 2 +- | ||
40 | hw/arm/mps2-tz.c | 2 +- | ||
41 | hw/arm/mps2.c | 2 +- | ||
42 | hw/arm/msf2-soc.c | 1 - | ||
43 | hw/arm/msf2-som.c | 2 +- | ||
44 | hw/arm/musca.c | 2 +- | ||
45 | hw/arm/musicpal.c | 2 +- | ||
46 | hw/arm/netduino2.c | 2 +- | ||
47 | hw/arm/nrf51_soc.c | 2 +- | ||
48 | hw/arm/nseries.c | 2 +- | ||
49 | hw/arm/omap1.c | 2 +- | ||
50 | hw/arm/omap2.c | 2 +- | ||
51 | hw/arm/omap_sx1.c | 2 +- | ||
52 | hw/arm/palm.c | 2 +- | ||
53 | hw/arm/raspi.c | 2 +- | ||
54 | hw/arm/realview.c | 2 +- | ||
55 | hw/arm/spitz.c | 2 +- | ||
56 | hw/arm/stellaris.c | 2 +- | ||
57 | hw/arm/stm32f205_soc.c | 2 +- | ||
58 | hw/arm/strongarm.c | 2 +- | ||
59 | hw/arm/tosa.c | 2 +- | ||
60 | hw/arm/versatilepb.c | 2 +- | ||
61 | hw/arm/vexpress.c | 2 +- | ||
62 | hw/arm/virt.c | 2 +- | ||
63 | hw/arm/xilinx_zynq.c | 2 +- | ||
64 | hw/arm/xlnx-versal.c | 2 +- | ||
65 | hw/arm/z2.c | 2 +- | ||
66 | 49 files changed, 49 insertions(+), 52 deletions(-) | ||
67 | rename include/hw/arm/{arm.h => boot.h} (98%) | ||
68 | |||
69 | diff --git a/include/hw/arm/allwinner-a10.h b/include/hw/arm/allwinner-a10.h | ||
70 | index XXXXXXX..XXXXXXX 100644 | ||
71 | --- a/include/hw/arm/allwinner-a10.h | ||
72 | +++ b/include/hw/arm/allwinner-a10.h | ||
73 | @@ -XXX,XX +XXX,XX @@ | ||
74 | #include "qemu-common.h" | ||
75 | #include "qemu/error-report.h" | ||
76 | #include "hw/char/serial.h" | ||
77 | -#include "hw/arm/arm.h" | ||
78 | +#include "hw/arm/boot.h" | ||
79 | #include "hw/timer/allwinner-a10-pit.h" | ||
80 | #include "hw/intc/allwinner-a10-pic.h" | ||
81 | #include "hw/net/allwinner_emac.h" | ||
82 | diff --git a/include/hw/arm/aspeed_soc.h b/include/hw/arm/aspeed_soc.h | ||
83 | index XXXXXXX..XXXXXXX 100644 | ||
84 | --- a/include/hw/arm/aspeed_soc.h | ||
85 | +++ b/include/hw/arm/aspeed_soc.h | ||
86 | @@ -XXX,XX +XXX,XX @@ | ||
87 | #ifndef ASPEED_SOC_H | ||
88 | #define ASPEED_SOC_H | ||
89 | |||
90 | -#include "hw/arm/arm.h" | ||
91 | #include "hw/intc/aspeed_vic.h" | ||
92 | #include "hw/misc/aspeed_scu.h" | ||
93 | #include "hw/misc/aspeed_sdmc.h" | ||
94 | diff --git a/include/hw/arm/bcm2836.h b/include/hw/arm/bcm2836.h | ||
95 | index XXXXXXX..XXXXXXX 100644 | ||
96 | --- a/include/hw/arm/bcm2836.h | ||
97 | +++ b/include/hw/arm/bcm2836.h | ||
98 | @@ -XXX,XX +XXX,XX @@ | ||
99 | #ifndef BCM2836_H | ||
100 | #define BCM2836_H | ||
101 | |||
102 | -#include "hw/arm/arm.h" | ||
103 | #include "hw/arm/bcm2835_peripherals.h" | ||
104 | #include "hw/intc/bcm2836_control.h" | ||
105 | |||
106 | diff --git a/include/hw/arm/arm.h b/include/hw/arm/boot.h | ||
107 | similarity index 98% | ||
108 | rename from include/hw/arm/arm.h | ||
109 | rename to include/hw/arm/boot.h | ||
110 | index XXXXXXX..XXXXXXX 100644 | ||
111 | --- a/include/hw/arm/arm.h | ||
112 | +++ b/include/hw/arm/boot.h | ||
113 | @@ -XXX,XX +XXX,XX @@ | ||
114 | /* | ||
115 | - * Misc ARM declarations | ||
116 | + * ARM kernel loader. | ||
117 | * | ||
118 | * Copyright (c) 2006 CodeSourcery. | ||
119 | * Written by Paul Brook | ||
120 | @@ -XXX,XX +XXX,XX @@ | ||
121 | * | ||
122 | */ | ||
123 | |||
124 | -#ifndef HW_ARM_H | ||
125 | -#define HW_ARM_H | ||
126 | +#ifndef HW_ARM_BOOT_H | ||
127 | +#define HW_ARM_BOOT_H | ||
128 | |||
129 | #include "exec/memory.h" | ||
130 | #include "target/arm/cpu-qom.h" | ||
131 | @@ -XXX,XX +XXX,XX @@ void arm_write_secure_board_setup_dummy_smc(ARMCPU *cpu, | ||
132 | const struct arm_boot_info *info, | ||
133 | hwaddr mvbar_addr); | ||
134 | |||
135 | -#endif /* HW_ARM_H */ | ||
136 | +#endif /* HW_ARM_BOOT_H */ | ||
137 | diff --git a/include/hw/arm/fsl-imx25.h b/include/hw/arm/fsl-imx25.h | ||
138 | index XXXXXXX..XXXXXXX 100644 | ||
139 | --- a/include/hw/arm/fsl-imx25.h | ||
140 | +++ b/include/hw/arm/fsl-imx25.h | ||
141 | @@ -XXX,XX +XXX,XX @@ | ||
142 | #ifndef FSL_IMX25_H | ||
143 | #define FSL_IMX25_H | ||
144 | |||
145 | -#include "hw/arm/arm.h" | ||
146 | +#include "hw/arm/boot.h" | ||
147 | #include "hw/intc/imx_avic.h" | ||
148 | #include "hw/misc/imx25_ccm.h" | ||
149 | #include "hw/char/imx_serial.h" | ||
150 | diff --git a/include/hw/arm/fsl-imx31.h b/include/hw/arm/fsl-imx31.h | ||
151 | index XXXXXXX..XXXXXXX 100644 | ||
152 | --- a/include/hw/arm/fsl-imx31.h | ||
153 | +++ b/include/hw/arm/fsl-imx31.h | ||
154 | @@ -XXX,XX +XXX,XX @@ | ||
155 | #ifndef FSL_IMX31_H | ||
156 | #define FSL_IMX31_H | ||
157 | |||
158 | -#include "hw/arm/arm.h" | ||
159 | +#include "hw/arm/boot.h" | ||
160 | #include "hw/intc/imx_avic.h" | ||
161 | #include "hw/misc/imx31_ccm.h" | ||
162 | #include "hw/char/imx_serial.h" | ||
163 | diff --git a/include/hw/arm/fsl-imx6.h b/include/hw/arm/fsl-imx6.h | 26 | diff --git a/include/hw/arm/fsl-imx6.h b/include/hw/arm/fsl-imx6.h |
164 | index XXXXXXX..XXXXXXX 100644 | 27 | index XXXXXXX..XXXXXXX 100644 |
165 | --- a/include/hw/arm/fsl-imx6.h | 28 | --- a/include/hw/arm/fsl-imx6.h |
166 | +++ b/include/hw/arm/fsl-imx6.h | 29 | +++ b/include/hw/arm/fsl-imx6.h |
167 | @@ -XXX,XX +XXX,XX @@ | 30 | @@ -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" | 31 | #include "hw/cpu/a9mpcore.h" |
174 | #include "hw/misc/imx6_ccm.h" | 32 | #include "hw/misc/imx6_ccm.h" |
175 | #include "hw/misc/imx6_src.h" | 33 | #include "hw/misc/imx6_src.h" |
34 | -#include "hw/misc/imx2_wdt.h" | ||
35 | +#include "hw/watchdog/wdt_imx2.h" | ||
36 | #include "hw/char/imx_serial.h" | ||
37 | #include "hw/timer/imx_gpt.h" | ||
38 | #include "hw/timer/imx_epit.h" | ||
176 | diff --git a/include/hw/arm/fsl-imx6ul.h b/include/hw/arm/fsl-imx6ul.h | 39 | diff --git a/include/hw/arm/fsl-imx6ul.h b/include/hw/arm/fsl-imx6ul.h |
177 | index XXXXXXX..XXXXXXX 100644 | 40 | index XXXXXXX..XXXXXXX 100644 |
178 | --- a/include/hw/arm/fsl-imx6ul.h | 41 | --- a/include/hw/arm/fsl-imx6ul.h |
179 | +++ b/include/hw/arm/fsl-imx6ul.h | 42 | +++ b/include/hw/arm/fsl-imx6ul.h |
180 | @@ -XXX,XX +XXX,XX @@ | 43 | @@ -XXX,XX +XXX,XX @@ |
181 | #ifndef FSL_IMX6UL_H | 44 | #include "hw/misc/imx7_snvs.h" |
182 | #define FSL_IMX6UL_H | 45 | #include "hw/misc/imx7_gpr.h" |
183 | 46 | #include "hw/intc/imx_gpcv2.h" | |
184 | -#include "hw/arm/arm.h" | 47 | -#include "hw/misc/imx2_wdt.h" |
185 | +#include "hw/arm/boot.h" | 48 | +#include "hw/watchdog/wdt_imx2.h" |
186 | #include "hw/cpu/a15mpcore.h" | 49 | #include "hw/gpio/imx_gpio.h" |
187 | #include "hw/misc/imx6ul_ccm.h" | 50 | #include "hw/char/imx_serial.h" |
188 | #include "hw/misc/imx6_src.h" | 51 | #include "hw/timer/imx_gpt.h" |
189 | diff --git a/include/hw/arm/fsl-imx7.h b/include/hw/arm/fsl-imx7.h | 52 | diff --git a/include/hw/arm/fsl-imx7.h b/include/hw/arm/fsl-imx7.h |
190 | index XXXXXXX..XXXXXXX 100644 | 53 | index XXXXXXX..XXXXXXX 100644 |
191 | --- a/include/hw/arm/fsl-imx7.h | 54 | --- a/include/hw/arm/fsl-imx7.h |
192 | +++ b/include/hw/arm/fsl-imx7.h | 55 | +++ b/include/hw/arm/fsl-imx7.h |
193 | @@ -XXX,XX +XXX,XX @@ | 56 | @@ -XXX,XX +XXX,XX @@ |
194 | #ifndef FSL_IMX7_H | 57 | #include "hw/misc/imx7_snvs.h" |
195 | #define FSL_IMX7_H | 58 | #include "hw/misc/imx7_gpr.h" |
196 | 59 | #include "hw/misc/imx6_src.h" | |
197 | -#include "hw/arm/arm.h" | 60 | -#include "hw/misc/imx2_wdt.h" |
198 | +#include "hw/arm/boot.h" | 61 | +#include "hw/watchdog/wdt_imx2.h" |
199 | #include "hw/cpu/a15mpcore.h" | 62 | #include "hw/gpio/imx_gpio.h" |
200 | #include "hw/intc/imx_gpcv2.h" | 63 | #include "hw/char/imx_serial.h" |
201 | #include "hw/misc/imx7_ccm.h" | 64 | #include "hw/timer/imx_gpt.h" |
202 | diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h | 65 | diff --git a/include/hw/misc/imx2_wdt.h b/include/hw/watchdog/wdt_imx2.h |
66 | similarity index 100% | ||
67 | rename from include/hw/misc/imx2_wdt.h | ||
68 | rename to include/hw/watchdog/wdt_imx2.h | ||
69 | diff --git a/hw/misc/imx2_wdt.c b/hw/watchdog/wdt_imx2.c | ||
70 | similarity index 98% | ||
71 | rename from hw/misc/imx2_wdt.c | ||
72 | rename to hw/watchdog/wdt_imx2.c | ||
203 | index XXXXXXX..XXXXXXX 100644 | 73 | index XXXXXXX..XXXXXXX 100644 |
204 | --- a/include/hw/arm/virt.h | 74 | --- a/hw/misc/imx2_wdt.c |
205 | +++ b/include/hw/arm/virt.h | 75 | +++ b/hw/watchdog/wdt_imx2.c |
206 | @@ -XXX,XX +XXX,XX @@ | 76 | @@ -XXX,XX +XXX,XX @@ |
207 | #include "exec/hwaddr.h" | 77 | #include "qemu/module.h" |
208 | #include "qemu/notify.h" | 78 | #include "sysemu/watchdog.h" |
209 | #include "hw/boards.h" | 79 | |
210 | -#include "hw/arm/arm.h" | 80 | -#include "hw/misc/imx2_wdt.h" |
211 | +#include "hw/arm/boot.h" | 81 | +#include "hw/watchdog/wdt_imx2.h" |
212 | #include "hw/block/flash.h" | 82 | |
213 | #include "sysemu/kvm.h" | 83 | #define IMX2_WDT_WCR_WDA BIT(5) /* -> External Reset WDOG_B */ |
214 | #include "hw/intc/arm_gicv3_common.h" | 84 | #define IMX2_WDT_WCR_SRS BIT(4) /* -> Software Reset Signal */ |
215 | diff --git a/include/hw/arm/xlnx-versal.h b/include/hw/arm/xlnx-versal.h | 85 | diff --git a/MAINTAINERS b/MAINTAINERS |
216 | index XXXXXXX..XXXXXXX 100644 | 86 | index XXXXXXX..XXXXXXX 100644 |
217 | --- a/include/hw/arm/xlnx-versal.h | 87 | --- a/MAINTAINERS |
218 | +++ b/include/hw/arm/xlnx-versal.h | 88 | +++ b/MAINTAINERS |
219 | @@ -XXX,XX +XXX,XX @@ | 89 | @@ -XXX,XX +XXX,XX @@ S: Odd Fixes |
220 | #define XLNX_VERSAL_H | 90 | F: hw/arm/fsl-imx25.c |
221 | 91 | F: hw/arm/imx25_pdk.c | |
222 | #include "hw/sysbus.h" | 92 | F: hw/misc/imx25_ccm.c |
223 | -#include "hw/arm/arm.h" | 93 | +F: hw/watchdog/wdt_imx2.c |
224 | +#include "hw/arm/boot.h" | 94 | F: include/hw/arm/fsl-imx25.h |
225 | #include "hw/intc/arm_gicv3.h" | 95 | F: include/hw/misc/imx25_ccm.h |
226 | 96 | +F: include/hw/watchdog/wdt_imx2.h | |
227 | #define TYPE_XLNX_VERSAL "xlnx-versal" | 97 | |
228 | diff --git a/include/hw/arm/xlnx-zynqmp.h b/include/hw/arm/xlnx-zynqmp.h | 98 | i.MX31 (kzm) |
99 | M: Peter Chubb <peter.chubb@nicta.com.au> | ||
100 | diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig | ||
229 | index XXXXXXX..XXXXXXX 100644 | 101 | index XXXXXXX..XXXXXXX 100644 |
230 | --- a/include/hw/arm/xlnx-zynqmp.h | 102 | --- a/hw/arm/Kconfig |
231 | +++ b/include/hw/arm/xlnx-zynqmp.h | 103 | +++ b/hw/arm/Kconfig |
232 | @@ -XXX,XX +XXX,XX @@ | 104 | @@ -XXX,XX +XXX,XX @@ config FSL_IMX6 |
233 | #ifndef XLNX_ZYNQMP_H | 105 | select IMX_FEC |
234 | 106 | select IMX_I2C | |
235 | #include "qemu-common.h" | 107 | select IMX_USBPHY |
236 | -#include "hw/arm/arm.h" | 108 | + select WDT_IMX2 |
237 | +#include "hw/arm/boot.h" | 109 | select SDHCI |
238 | #include "hw/intc/arm_gic.h" | 110 | |
239 | #include "hw/net/cadence_gem.h" | 111 | config ASPEED_SOC |
240 | #include "hw/char/cadence_uart.h" | 112 | @@ -XXX,XX +XXX,XX @@ config FSL_IMX7 |
241 | diff --git a/hw/arm/armsse.c b/hw/arm/armsse.c | 113 | select IMX |
114 | select IMX_FEC | ||
115 | select IMX_I2C | ||
116 | + select WDT_IMX2 | ||
117 | select PCI_EXPRESS_DESIGNWARE | ||
118 | select SDHCI | ||
119 | select UNIMP | ||
120 | @@ -XXX,XX +XXX,XX @@ config FSL_IMX6UL | ||
121 | select IMX | ||
122 | select IMX_FEC | ||
123 | select IMX_I2C | ||
124 | + select WDT_IMX2 | ||
125 | select SDHCI | ||
126 | select UNIMP | ||
127 | |||
128 | diff --git a/hw/misc/Makefile.objs b/hw/misc/Makefile.objs | ||
242 | index XXXXXXX..XXXXXXX 100644 | 129 | index XXXXXXX..XXXXXXX 100644 |
243 | --- a/hw/arm/armsse.c | 130 | --- a/hw/misc/Makefile.objs |
244 | +++ b/hw/arm/armsse.c | 131 | +++ b/hw/misc/Makefile.objs |
245 | @@ -XXX,XX +XXX,XX @@ | 132 | @@ -XXX,XX +XXX,XX @@ common-obj-$(CONFIG_IMX) += imx6_ccm.o |
246 | #include "hw/sysbus.h" | 133 | common-obj-$(CONFIG_IMX) += imx6ul_ccm.o |
247 | #include "hw/registerfields.h" | 134 | obj-$(CONFIG_IMX) += imx6_src.o |
248 | #include "hw/arm/armsse.h" | 135 | common-obj-$(CONFIG_IMX) += imx7_ccm.o |
249 | -#include "hw/arm/arm.h" | 136 | -common-obj-$(CONFIG_IMX) += imx2_wdt.o |
250 | +#include "hw/arm/boot.h" | 137 | common-obj-$(CONFIG_IMX) += imx7_snvs.o |
251 | 138 | common-obj-$(CONFIG_IMX) += imx7_gpr.o | |
252 | /* Format of the System Information block SYS_CONFIG register */ | 139 | common-obj-$(CONFIG_IMX) += imx_rngc.o |
253 | typedef enum SysConfigFormat { | 140 | diff --git a/hw/watchdog/Kconfig b/hw/watchdog/Kconfig |
254 | diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c | ||
255 | index XXXXXXX..XXXXXXX 100644 | 141 | index XXXXXXX..XXXXXXX 100644 |
256 | --- a/hw/arm/armv7m.c | 142 | --- a/hw/watchdog/Kconfig |
257 | +++ b/hw/arm/armv7m.c | 143 | +++ b/hw/watchdog/Kconfig |
258 | @@ -XXX,XX +XXX,XX @@ | 144 | @@ -XXX,XX +XXX,XX @@ config WDT_IB700 |
259 | #include "qemu-common.h" | 145 | |
260 | #include "cpu.h" | 146 | config WDT_DIAG288 |
261 | #include "hw/sysbus.h" | 147 | bool |
262 | -#include "hw/arm/arm.h" | 148 | + |
263 | +#include "hw/arm/boot.h" | 149 | +config WDT_IMX2 |
264 | #include "hw/loader.h" | 150 | + bool |
265 | #include "elf.h" | 151 | diff --git a/hw/watchdog/Makefile.objs b/hw/watchdog/Makefile.objs |
266 | #include "sysemu/qtest.h" | ||
267 | diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c | ||
268 | index XXXXXXX..XXXXXXX 100644 | 152 | index XXXXXXX..XXXXXXX 100644 |
269 | --- a/hw/arm/aspeed.c | 153 | --- a/hw/watchdog/Makefile.objs |
270 | +++ b/hw/arm/aspeed.c | 154 | +++ b/hw/watchdog/Makefile.objs |
271 | @@ -XXX,XX +XXX,XX @@ | 155 | @@ -XXX,XX +XXX,XX @@ common-obj-$(CONFIG_WDT_IB6300ESB) += wdt_i6300esb.o |
272 | #include "qemu-common.h" | 156 | common-obj-$(CONFIG_WDT_IB700) += wdt_ib700.o |
273 | #include "cpu.h" | 157 | common-obj-$(CONFIG_WDT_DIAG288) += wdt_diag288.o |
274 | #include "exec/address-spaces.h" | 158 | common-obj-$(CONFIG_ASPEED_SOC) += wdt_aspeed.o |
275 | -#include "hw/arm/arm.h" | 159 | +common-obj-$(CONFIG_WDT_IMX2) += wdt_imx2.o |
276 | +#include "hw/arm/boot.h" | ||
277 | #include "hw/arm/aspeed.h" | ||
278 | #include "hw/arm/aspeed_soc.h" | ||
279 | #include "hw/boards.h" | ||
280 | diff --git a/hw/arm/boot.c b/hw/arm/boot.c | ||
281 | index XXXXXXX..XXXXXXX 100644 | ||
282 | --- a/hw/arm/boot.c | ||
283 | +++ b/hw/arm/boot.c | ||
284 | @@ -XXX,XX +XXX,XX @@ | ||
285 | #include "qapi/error.h" | ||
286 | #include <libfdt.h> | ||
287 | #include "hw/hw.h" | ||
288 | -#include "hw/arm/arm.h" | ||
289 | +#include "hw/arm/boot.h" | ||
290 | #include "hw/arm/linux-boot-if.h" | ||
291 | #include "sysemu/kvm.h" | ||
292 | #include "sysemu/sysemu.h" | ||
293 | diff --git a/hw/arm/collie.c b/hw/arm/collie.c | ||
294 | index XXXXXXX..XXXXXXX 100644 | ||
295 | --- a/hw/arm/collie.c | ||
296 | +++ b/hw/arm/collie.c | ||
297 | @@ -XXX,XX +XXX,XX @@ | ||
298 | #include "hw/sysbus.h" | ||
299 | #include "hw/boards.h" | ||
300 | #include "strongarm.h" | ||
301 | -#include "hw/arm/arm.h" | ||
302 | +#include "hw/arm/boot.h" | ||
303 | #include "hw/block/flash.h" | ||
304 | #include "exec/address-spaces.h" | ||
305 | #include "cpu.h" | ||
306 | diff --git a/hw/arm/exynos4210.c b/hw/arm/exynos4210.c | ||
307 | index XXXXXXX..XXXXXXX 100644 | ||
308 | --- a/hw/arm/exynos4210.c | ||
309 | +++ b/hw/arm/exynos4210.c | ||
310 | @@ -XXX,XX +XXX,XX @@ | ||
311 | #include "hw/boards.h" | ||
312 | #include "sysemu/sysemu.h" | ||
313 | #include "hw/sysbus.h" | ||
314 | -#include "hw/arm/arm.h" | ||
315 | +#include "hw/arm/boot.h" | ||
316 | #include "hw/loader.h" | ||
317 | #include "hw/arm/exynos4210.h" | ||
318 | #include "hw/sd/sdhci.h" | ||
319 | diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c | ||
320 | index XXXXXXX..XXXXXXX 100644 | ||
321 | --- a/hw/arm/exynos4_boards.c | ||
322 | +++ b/hw/arm/exynos4_boards.c | ||
323 | @@ -XXX,XX +XXX,XX @@ | ||
324 | #include "sysemu/sysemu.h" | ||
325 | #include "hw/sysbus.h" | ||
326 | #include "net/net.h" | ||
327 | -#include "hw/arm/arm.h" | ||
328 | +#include "hw/arm/boot.h" | ||
329 | #include "exec/address-spaces.h" | ||
330 | #include "hw/arm/exynos4210.h" | ||
331 | #include "hw/net/lan9118.h" | ||
332 | diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c | ||
333 | index XXXXXXX..XXXXXXX 100644 | ||
334 | --- a/hw/arm/highbank.c | ||
335 | +++ b/hw/arm/highbank.c | ||
336 | @@ -XXX,XX +XXX,XX @@ | ||
337 | #include "qemu/osdep.h" | ||
338 | #include "qapi/error.h" | ||
339 | #include "hw/sysbus.h" | ||
340 | -#include "hw/arm/arm.h" | ||
341 | +#include "hw/arm/boot.h" | ||
342 | #include "hw/loader.h" | ||
343 | #include "net/net.h" | ||
344 | #include "sysemu/kvm.h" | ||
345 | diff --git a/hw/arm/integratorcp.c b/hw/arm/integratorcp.c | ||
346 | index XXXXXXX..XXXXXXX 100644 | ||
347 | --- a/hw/arm/integratorcp.c | ||
348 | +++ b/hw/arm/integratorcp.c | ||
349 | @@ -XXX,XX +XXX,XX @@ | ||
350 | #include "cpu.h" | ||
351 | #include "hw/sysbus.h" | ||
352 | #include "hw/boards.h" | ||
353 | -#include "hw/arm/arm.h" | ||
354 | +#include "hw/arm/boot.h" | ||
355 | #include "hw/misc/arm_integrator_debug.h" | ||
356 | #include "hw/net/smc91c111.h" | ||
357 | #include "net/net.h" | ||
358 | diff --git a/hw/arm/mainstone.c b/hw/arm/mainstone.c | ||
359 | index XXXXXXX..XXXXXXX 100644 | ||
360 | --- a/hw/arm/mainstone.c | ||
361 | +++ b/hw/arm/mainstone.c | ||
362 | @@ -XXX,XX +XXX,XX @@ | ||
363 | #include "qapi/error.h" | ||
364 | #include "hw/hw.h" | ||
365 | #include "hw/arm/pxa.h" | ||
366 | -#include "hw/arm/arm.h" | ||
367 | +#include "hw/arm/boot.h" | ||
368 | #include "net/net.h" | ||
369 | #include "hw/net/smc91c111.h" | ||
370 | #include "hw/boards.h" | ||
371 | diff --git a/hw/arm/microbit.c b/hw/arm/microbit.c | ||
372 | index XXXXXXX..XXXXXXX 100644 | ||
373 | --- a/hw/arm/microbit.c | ||
374 | +++ b/hw/arm/microbit.c | ||
375 | @@ -XXX,XX +XXX,XX @@ | ||
376 | #include "qemu/osdep.h" | ||
377 | #include "qapi/error.h" | ||
378 | #include "hw/boards.h" | ||
379 | -#include "hw/arm/arm.h" | ||
380 | +#include "hw/arm/boot.h" | ||
381 | #include "sysemu/sysemu.h" | ||
382 | #include "exec/address-spaces.h" | ||
383 | |||
384 | diff --git a/hw/arm/mps2-tz.c b/hw/arm/mps2-tz.c | ||
385 | index XXXXXXX..XXXXXXX 100644 | ||
386 | --- a/hw/arm/mps2-tz.c | ||
387 | +++ b/hw/arm/mps2-tz.c | ||
388 | @@ -XXX,XX +XXX,XX @@ | ||
389 | #include "qemu/osdep.h" | ||
390 | #include "qapi/error.h" | ||
391 | #include "qemu/error-report.h" | ||
392 | -#include "hw/arm/arm.h" | ||
393 | +#include "hw/arm/boot.h" | ||
394 | #include "hw/arm/armv7m.h" | ||
395 | #include "hw/or-irq.h" | ||
396 | #include "hw/boards.h" | ||
397 | diff --git a/hw/arm/mps2.c b/hw/arm/mps2.c | ||
398 | index XXXXXXX..XXXXXXX 100644 | ||
399 | --- a/hw/arm/mps2.c | ||
400 | +++ b/hw/arm/mps2.c | ||
401 | @@ -XXX,XX +XXX,XX @@ | ||
402 | #include "qemu/osdep.h" | ||
403 | #include "qapi/error.h" | ||
404 | #include "qemu/error-report.h" | ||
405 | -#include "hw/arm/arm.h" | ||
406 | +#include "hw/arm/boot.h" | ||
407 | #include "hw/arm/armv7m.h" | ||
408 | #include "hw/or-irq.h" | ||
409 | #include "hw/boards.h" | ||
410 | diff --git a/hw/arm/msf2-soc.c b/hw/arm/msf2-soc.c | ||
411 | index XXXXXXX..XXXXXXX 100644 | ||
412 | --- a/hw/arm/msf2-soc.c | ||
413 | +++ b/hw/arm/msf2-soc.c | ||
414 | @@ -XXX,XX +XXX,XX @@ | ||
415 | #include "qemu/units.h" | ||
416 | #include "qapi/error.h" | ||
417 | #include "qemu-common.h" | ||
418 | -#include "hw/arm/arm.h" | ||
419 | #include "exec/address-spaces.h" | ||
420 | #include "hw/char/serial.h" | ||
421 | #include "hw/boards.h" | ||
422 | diff --git a/hw/arm/msf2-som.c b/hw/arm/msf2-som.c | ||
423 | index XXXXXXX..XXXXXXX 100644 | ||
424 | --- a/hw/arm/msf2-som.c | ||
425 | +++ b/hw/arm/msf2-som.c | ||
426 | @@ -XXX,XX +XXX,XX @@ | ||
427 | #include "qapi/error.h" | ||
428 | #include "qemu/error-report.h" | ||
429 | #include "hw/boards.h" | ||
430 | -#include "hw/arm/arm.h" | ||
431 | +#include "hw/arm/boot.h" | ||
432 | #include "exec/address-spaces.h" | ||
433 | #include "hw/arm/msf2-soc.h" | ||
434 | #include "cpu.h" | ||
435 | diff --git a/hw/arm/musca.c b/hw/arm/musca.c | ||
436 | index XXXXXXX..XXXXXXX 100644 | ||
437 | --- a/hw/arm/musca.c | ||
438 | +++ b/hw/arm/musca.c | ||
439 | @@ -XXX,XX +XXX,XX @@ | ||
440 | #include "qapi/error.h" | ||
441 | #include "exec/address-spaces.h" | ||
442 | #include "sysemu/sysemu.h" | ||
443 | -#include "hw/arm/arm.h" | ||
444 | +#include "hw/arm/boot.h" | ||
445 | #include "hw/arm/armsse.h" | ||
446 | #include "hw/boards.h" | ||
447 | #include "hw/char/pl011.h" | ||
448 | diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c | ||
449 | index XXXXXXX..XXXXXXX 100644 | ||
450 | --- a/hw/arm/musicpal.c | ||
451 | +++ b/hw/arm/musicpal.c | ||
452 | @@ -XXX,XX +XXX,XX @@ | ||
453 | #include "qemu-common.h" | ||
454 | #include "cpu.h" | ||
455 | #include "hw/sysbus.h" | ||
456 | -#include "hw/arm/arm.h" | ||
457 | +#include "hw/arm/boot.h" | ||
458 | #include "net/net.h" | ||
459 | #include "sysemu/sysemu.h" | ||
460 | #include "hw/boards.h" | ||
461 | diff --git a/hw/arm/netduino2.c b/hw/arm/netduino2.c | ||
462 | index XXXXXXX..XXXXXXX 100644 | ||
463 | --- a/hw/arm/netduino2.c | ||
464 | +++ b/hw/arm/netduino2.c | ||
465 | @@ -XXX,XX +XXX,XX @@ | ||
466 | #include "hw/boards.h" | ||
467 | #include "qemu/error-report.h" | ||
468 | #include "hw/arm/stm32f205_soc.h" | ||
469 | -#include "hw/arm/arm.h" | ||
470 | +#include "hw/arm/boot.h" | ||
471 | |||
472 | static void netduino2_init(MachineState *machine) | ||
473 | { | ||
474 | diff --git a/hw/arm/nrf51_soc.c b/hw/arm/nrf51_soc.c | ||
475 | index XXXXXXX..XXXXXXX 100644 | ||
476 | --- a/hw/arm/nrf51_soc.c | ||
477 | +++ b/hw/arm/nrf51_soc.c | ||
478 | @@ -XXX,XX +XXX,XX @@ | ||
479 | #include "qemu/osdep.h" | ||
480 | #include "qapi/error.h" | ||
481 | #include "qemu-common.h" | ||
482 | -#include "hw/arm/arm.h" | ||
483 | +#include "hw/arm/boot.h" | ||
484 | #include "hw/sysbus.h" | ||
485 | #include "hw/boards.h" | ||
486 | #include "hw/misc/unimp.h" | ||
487 | diff --git a/hw/arm/nseries.c b/hw/arm/nseries.c | ||
488 | index XXXXXXX..XXXXXXX 100644 | ||
489 | --- a/hw/arm/nseries.c | ||
490 | +++ b/hw/arm/nseries.c | ||
491 | @@ -XXX,XX +XXX,XX @@ | ||
492 | #include "qemu/bswap.h" | ||
493 | #include "sysemu/sysemu.h" | ||
494 | #include "hw/arm/omap.h" | ||
495 | -#include "hw/arm/arm.h" | ||
496 | +#include "hw/arm/boot.h" | ||
497 | #include "hw/irq.h" | ||
498 | #include "ui/console.h" | ||
499 | #include "hw/boards.h" | ||
500 | diff --git a/hw/arm/omap1.c b/hw/arm/omap1.c | ||
501 | index XXXXXXX..XXXXXXX 100644 | ||
502 | --- a/hw/arm/omap1.c | ||
503 | +++ b/hw/arm/omap1.c | ||
504 | @@ -XXX,XX +XXX,XX @@ | ||
505 | #include "cpu.h" | ||
506 | #include "hw/boards.h" | ||
507 | #include "hw/hw.h" | ||
508 | -#include "hw/arm/arm.h" | ||
509 | +#include "hw/arm/boot.h" | ||
510 | #include "hw/arm/omap.h" | ||
511 | #include "sysemu/sysemu.h" | ||
512 | #include "hw/arm/soc_dma.h" | ||
513 | diff --git a/hw/arm/omap2.c b/hw/arm/omap2.c | ||
514 | index XXXXXXX..XXXXXXX 100644 | ||
515 | --- a/hw/arm/omap2.c | ||
516 | +++ b/hw/arm/omap2.c | ||
517 | @@ -XXX,XX +XXX,XX @@ | ||
518 | #include "sysemu/qtest.h" | ||
519 | #include "hw/boards.h" | ||
520 | #include "hw/hw.h" | ||
521 | -#include "hw/arm/arm.h" | ||
522 | +#include "hw/arm/boot.h" | ||
523 | #include "hw/arm/omap.h" | ||
524 | #include "sysemu/sysemu.h" | ||
525 | #include "qemu/timer.h" | ||
526 | diff --git a/hw/arm/omap_sx1.c b/hw/arm/omap_sx1.c | ||
527 | index XXXXXXX..XXXXXXX 100644 | ||
528 | --- a/hw/arm/omap_sx1.c | ||
529 | +++ b/hw/arm/omap_sx1.c | ||
530 | @@ -XXX,XX +XXX,XX @@ | ||
531 | #include "ui/console.h" | ||
532 | #include "hw/arm/omap.h" | ||
533 | #include "hw/boards.h" | ||
534 | -#include "hw/arm/arm.h" | ||
535 | +#include "hw/arm/boot.h" | ||
536 | #include "hw/block/flash.h" | ||
537 | #include "sysemu/qtest.h" | ||
538 | #include "exec/address-spaces.h" | ||
539 | diff --git a/hw/arm/palm.c b/hw/arm/palm.c | ||
540 | index XXXXXXX..XXXXXXX 100644 | ||
541 | --- a/hw/arm/palm.c | ||
542 | +++ b/hw/arm/palm.c | ||
543 | @@ -XXX,XX +XXX,XX @@ | ||
544 | #include "ui/console.h" | ||
545 | #include "hw/arm/omap.h" | ||
546 | #include "hw/boards.h" | ||
547 | -#include "hw/arm/arm.h" | ||
548 | +#include "hw/arm/boot.h" | ||
549 | #include "hw/input/tsc2xxx.h" | ||
550 | #include "hw/loader.h" | ||
551 | #include "exec/address-spaces.h" | ||
552 | diff --git a/hw/arm/raspi.c b/hw/arm/raspi.c | ||
553 | index XXXXXXX..XXXXXXX 100644 | ||
554 | --- a/hw/arm/raspi.c | ||
555 | +++ b/hw/arm/raspi.c | ||
556 | @@ -XXX,XX +XXX,XX @@ | ||
557 | #include "qemu/error-report.h" | ||
558 | #include "hw/boards.h" | ||
559 | #include "hw/loader.h" | ||
560 | -#include "hw/arm/arm.h" | ||
561 | +#include "hw/arm/boot.h" | ||
562 | #include "sysemu/sysemu.h" | ||
563 | |||
564 | #define SMPBOOT_ADDR 0x300 /* this should leave enough space for ATAGS */ | ||
565 | diff --git a/hw/arm/realview.c b/hw/arm/realview.c | ||
566 | index XXXXXXX..XXXXXXX 100644 | ||
567 | --- a/hw/arm/realview.c | ||
568 | +++ b/hw/arm/realview.c | ||
569 | @@ -XXX,XX +XXX,XX @@ | ||
570 | #include "qemu-common.h" | ||
571 | #include "cpu.h" | ||
572 | #include "hw/sysbus.h" | ||
573 | -#include "hw/arm/arm.h" | ||
574 | +#include "hw/arm/boot.h" | ||
575 | #include "hw/arm/primecell.h" | ||
576 | #include "hw/net/lan9118.h" | ||
577 | #include "hw/net/smc91c111.h" | ||
578 | diff --git a/hw/arm/spitz.c b/hw/arm/spitz.c | ||
579 | index XXXXXXX..XXXXXXX 100644 | ||
580 | --- a/hw/arm/spitz.c | ||
581 | +++ b/hw/arm/spitz.c | ||
582 | @@ -XXX,XX +XXX,XX @@ | ||
583 | #include "qapi/error.h" | ||
584 | #include "hw/hw.h" | ||
585 | #include "hw/arm/pxa.h" | ||
586 | -#include "hw/arm/arm.h" | ||
587 | +#include "hw/arm/boot.h" | ||
588 | #include "sysemu/sysemu.h" | ||
589 | #include "hw/pcmcia.h" | ||
590 | #include "hw/i2c/i2c.h" | ||
591 | diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c | ||
592 | index XXXXXXX..XXXXXXX 100644 | ||
593 | --- a/hw/arm/stellaris.c | ||
594 | +++ b/hw/arm/stellaris.c | ||
595 | @@ -XXX,XX +XXX,XX @@ | ||
596 | #include "qapi/error.h" | ||
597 | #include "hw/sysbus.h" | ||
598 | #include "hw/ssi/ssi.h" | ||
599 | -#include "hw/arm/arm.h" | ||
600 | +#include "hw/arm/boot.h" | ||
601 | #include "qemu/timer.h" | ||
602 | #include "hw/i2c/i2c.h" | ||
603 | #include "net/net.h" | ||
604 | diff --git a/hw/arm/stm32f205_soc.c b/hw/arm/stm32f205_soc.c | ||
605 | index XXXXXXX..XXXXXXX 100644 | ||
606 | --- a/hw/arm/stm32f205_soc.c | ||
607 | +++ b/hw/arm/stm32f205_soc.c | ||
608 | @@ -XXX,XX +XXX,XX @@ | ||
609 | #include "qemu/osdep.h" | ||
610 | #include "qapi/error.h" | ||
611 | #include "qemu-common.h" | ||
612 | -#include "hw/arm/arm.h" | ||
613 | +#include "hw/arm/boot.h" | ||
614 | #include "exec/address-spaces.h" | ||
615 | #include "hw/arm/stm32f205_soc.h" | ||
616 | |||
617 | diff --git a/hw/arm/strongarm.c b/hw/arm/strongarm.c | ||
618 | index XXXXXXX..XXXXXXX 100644 | ||
619 | --- a/hw/arm/strongarm.c | ||
620 | +++ b/hw/arm/strongarm.c | ||
621 | @@ -XXX,XX +XXX,XX @@ | ||
622 | #include "hw/sysbus.h" | ||
623 | #include "strongarm.h" | ||
624 | #include "qemu/error-report.h" | ||
625 | -#include "hw/arm/arm.h" | ||
626 | +#include "hw/arm/boot.h" | ||
627 | #include "chardev/char-fe.h" | ||
628 | #include "chardev/char-serial.h" | ||
629 | #include "sysemu/sysemu.h" | ||
630 | diff --git a/hw/arm/tosa.c b/hw/arm/tosa.c | ||
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" | ||
721 | -- | 160 | -- |
722 | 2.20.1 | 161 | 2.20.1 |
723 | 162 | ||
724 | 163 | diff view generated by jsdifflib |
1 | From: Philippe Mathieu-Daudé <philmd@redhat.com> | 1 | From: Guenter Roeck <linux@roeck-us.net> |
---|---|---|---|
2 | 2 | ||
3 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> | 3 | Implement full support for the watchdog in i.MX systems. |
4 | Reviewed-by: Alistair Francis <alistair.francis@wdc.com> | 4 | Pretimeout support is optional because the watchdog hardware |
5 | Message-id: 20190520214342.13709-5-philmd@redhat.com | 5 | on i.MX31 does not support pretimeouts. |
6 | |||
7 | Signed-off-by: Guenter Roeck <linux@roeck-us.net> | ||
8 | Message-id: 20200517162135.110364-3-linux@roeck-us.net | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
10 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | 11 | --- |
8 | include/hw/arm/exynos4210.h | 9 +++++++-- | 12 | include/hw/watchdog/wdt_imx2.h | 61 ++++++++- |
9 | hw/arm/exynos4210.c | 28 ++++++++++++++++++++++++---- | 13 | hw/watchdog/wdt_imx2.c | 239 +++++++++++++++++++++++++++++++-- |
10 | hw/arm/exynos4_boards.c | 9 ++++++--- | 14 | 2 files changed, 285 insertions(+), 15 deletions(-) |
11 | 3 files changed, 37 insertions(+), 9 deletions(-) | 15 | |
12 | 16 | diff --git a/include/hw/watchdog/wdt_imx2.h b/include/hw/watchdog/wdt_imx2.h | |
13 | diff --git a/include/hw/arm/exynos4210.h b/include/hw/arm/exynos4210.h | ||
14 | index XXXXXXX..XXXXXXX 100644 | 17 | index XXXXXXX..XXXXXXX 100644 |
15 | --- a/include/hw/arm/exynos4210.h | 18 | --- a/include/hw/watchdog/wdt_imx2.h |
16 | +++ b/include/hw/arm/exynos4210.h | 19 | +++ b/include/hw/watchdog/wdt_imx2.h |
17 | @@ -XXX,XX +XXX,XX @@ typedef struct Exynos4210Irq { | 20 | @@ -XXX,XX +XXX,XX @@ |
18 | } Exynos4210Irq; | 21 | #ifndef IMX2_WDT_H |
19 | 22 | #define IMX2_WDT_H | |
20 | typedef struct Exynos4210State { | 23 | |
21 | + /*< private >*/ | 24 | +#include "qemu/bitops.h" |
22 | + SysBusDevice parent_obj; | 25 | #include "hw/sysbus.h" |
26 | +#include "hw/irq.h" | ||
27 | +#include "hw/ptimer.h" | ||
28 | |||
29 | #define TYPE_IMX2_WDT "imx2.wdt" | ||
30 | #define IMX2_WDT(obj) OBJECT_CHECK(IMX2WdtState, (obj), TYPE_IMX2_WDT) | ||
31 | |||
32 | enum IMX2WdtRegisters { | ||
33 | - IMX2_WDT_WCR = 0x0000, | ||
34 | - IMX2_WDT_REG_NUM = 0x0008 / sizeof(uint16_t) + 1, | ||
35 | + IMX2_WDT_WCR = 0x0000, /* Control Register */ | ||
36 | + IMX2_WDT_WSR = 0x0002, /* Service Register */ | ||
37 | + IMX2_WDT_WRSR = 0x0004, /* Reset Status Register */ | ||
38 | + IMX2_WDT_WICR = 0x0006, /* Interrupt Control Register */ | ||
39 | + IMX2_WDT_WMCR = 0x0008, /* Misc Register */ | ||
40 | }; | ||
41 | |||
42 | +#define IMX2_WDT_MMIO_SIZE 0x000a | ||
43 | + | ||
44 | +/* Control Register definitions */ | ||
45 | +#define IMX2_WDT_WCR_WT (0xFF << 8) /* Watchdog Timeout Field */ | ||
46 | +#define IMX2_WDT_WCR_WDW BIT(7) /* WDOG Disable for Wait */ | ||
47 | +#define IMX2_WDT_WCR_WDA BIT(5) /* WDOG Assertion */ | ||
48 | +#define IMX2_WDT_WCR_SRS BIT(4) /* Software Reset Signal */ | ||
49 | +#define IMX2_WDT_WCR_WDT BIT(3) /* WDOG Timeout Assertion */ | ||
50 | +#define IMX2_WDT_WCR_WDE BIT(2) /* Watchdog Enable */ | ||
51 | +#define IMX2_WDT_WCR_WDBG BIT(1) /* Watchdog Debug Enable */ | ||
52 | +#define IMX2_WDT_WCR_WDZST BIT(0) /* Watchdog Timer Suspend */ | ||
53 | + | ||
54 | +#define IMX2_WDT_WCR_LOCK_MASK (IMX2_WDT_WCR_WDZST | IMX2_WDT_WCR_WDBG \ | ||
55 | + | IMX2_WDT_WCR_WDW) | ||
56 | + | ||
57 | +/* Service Register definitions */ | ||
58 | +#define IMX2_WDT_SEQ1 0x5555 /* service sequence 1 */ | ||
59 | +#define IMX2_WDT_SEQ2 0xAAAA /* service sequence 2 */ | ||
60 | + | ||
61 | +/* Reset Status Register definitions */ | ||
62 | +#define IMX2_WDT_WRSR_TOUT BIT(1) /* Reset due to Timeout */ | ||
63 | +#define IMX2_WDT_WRSR_SFTW BIT(0) /* Reset due to software reset */ | ||
64 | + | ||
65 | +/* Interrupt Control Register definitions */ | ||
66 | +#define IMX2_WDT_WICR_WIE BIT(15) /* Interrupt Enable */ | ||
67 | +#define IMX2_WDT_WICR_WTIS BIT(14) /* Interrupt Status */ | ||
68 | +#define IMX2_WDT_WICR_WICT 0xff /* Interrupt Timeout */ | ||
69 | +#define IMX2_WDT_WICR_WICT_DEF 0x04 /* Default interrupt timeout (2s) */ | ||
70 | + | ||
71 | +#define IMX2_WDT_WICR_LOCK_MASK (IMX2_WDT_WICR_WIE | IMX2_WDT_WICR_WICT) | ||
72 | + | ||
73 | +/* Misc Control Register definitions */ | ||
74 | +#define IMX2_WDT_WMCR_PDE BIT(0) /* Power-Down Enable */ | ||
75 | |||
76 | typedef struct IMX2WdtState { | ||
77 | /* <private> */ | ||
78 | SysBusDevice parent_obj; | ||
79 | |||
23 | + /*< public >*/ | 80 | + /*< public >*/ |
24 | ARMCPU *cpu[EXYNOS4210_NCPUS]; | 81 | MemoryRegion mmio; |
25 | Exynos4210Irq irqs; | 82 | + qemu_irq irq; |
26 | qemu_irq *irq_table; | 83 | + |
27 | @@ -XXX,XX +XXX,XX @@ typedef struct Exynos4210State { | 84 | + struct ptimer_state *timer; |
28 | I2CBus *i2c_if[EXYNOS4210_I2C_NUMBER]; | 85 | + struct ptimer_state *itimer; |
29 | } Exynos4210State; | 86 | + |
30 | 87 | + bool pretimeout_support; | |
31 | +#define TYPE_EXYNOS4210_SOC "exynos4210" | 88 | + bool wicr_locked; |
32 | +#define EXYNOS4210_SOC(obj) \ | 89 | + |
33 | + OBJECT_CHECK(Exynos4210State, obj, TYPE_EXYNOS4210_SOC) | 90 | + uint16_t wcr; |
34 | + | 91 | + uint16_t wsr; |
35 | void exynos4210_write_secondary(ARMCPU *cpu, | 92 | + uint16_t wrsr; |
36 | const struct arm_boot_info *info); | 93 | + uint16_t wicr; |
37 | 94 | + uint16_t wmcr; | |
38 | -Exynos4210State *exynos4210_init(MemoryRegion *system_mem); | 95 | + |
96 | + bool wcr_locked; /* affects WDZST, WDBG, and WDW */ | ||
97 | + bool wcr_wde_locked; /* affects WDE */ | ||
98 | + bool wcr_wdt_locked; /* affects WDT (never cleared) */ | ||
99 | } IMX2WdtState; | ||
100 | |||
101 | #endif /* IMX2_WDT_H */ | ||
102 | diff --git a/hw/watchdog/wdt_imx2.c b/hw/watchdog/wdt_imx2.c | ||
103 | index XXXXXXX..XXXXXXX 100644 | ||
104 | --- a/hw/watchdog/wdt_imx2.c | ||
105 | +++ b/hw/watchdog/wdt_imx2.c | ||
106 | @@ -XXX,XX +XXX,XX @@ | ||
107 | #include "qemu/bitops.h" | ||
108 | #include "qemu/module.h" | ||
109 | #include "sysemu/watchdog.h" | ||
110 | +#include "migration/vmstate.h" | ||
111 | +#include "hw/qdev-properties.h" | ||
112 | |||
113 | #include "hw/watchdog/wdt_imx2.h" | ||
114 | |||
115 | -#define IMX2_WDT_WCR_WDA BIT(5) /* -> External Reset WDOG_B */ | ||
116 | -#define IMX2_WDT_WCR_SRS BIT(4) /* -> Software Reset Signal */ | ||
39 | - | 117 | - |
40 | /* Initialize exynos4210 IRQ subsystem stub */ | 118 | -static uint64_t imx2_wdt_read(void *opaque, hwaddr addr, |
41 | qemu_irq *exynos4210_init_irq(Exynos4210Irq *env); | 119 | - unsigned int size) |
42 | 120 | +static void imx2_wdt_interrupt(void *opaque) | |
43 | diff --git a/hw/arm/exynos4210.c b/hw/arm/exynos4210.c | 121 | { |
44 | index XXXXXXX..XXXXXXX 100644 | 122 | + IMX2WdtState *s = IMX2_WDT(opaque); |
45 | --- a/hw/arm/exynos4210.c | 123 | + |
46 | +++ b/hw/arm/exynos4210.c | 124 | + s->wicr |= IMX2_WDT_WICR_WTIS; |
47 | @@ -XXX,XX +XXX,XX @@ static void pl330_create(uint32_t base, qemu_irq irq, int nreq) | 125 | + qemu_set_irq(s->irq, 1); |
48 | sysbus_connect_irq(busdev, 0, irq); | 126 | +} |
127 | + | ||
128 | +static void imx2_wdt_expired(void *opaque) | ||
129 | +{ | ||
130 | + IMX2WdtState *s = IMX2_WDT(opaque); | ||
131 | + | ||
132 | + s->wrsr = IMX2_WDT_WRSR_TOUT; | ||
133 | + | ||
134 | + /* Perform watchdog action if watchdog is enabled */ | ||
135 | + if (s->wcr & IMX2_WDT_WCR_WDE) { | ||
136 | + s->wrsr = IMX2_WDT_WRSR_TOUT; | ||
137 | + watchdog_perform_action(); | ||
138 | + } | ||
139 | +} | ||
140 | + | ||
141 | +static void imx2_wdt_reset(DeviceState *dev) | ||
142 | +{ | ||
143 | + IMX2WdtState *s = IMX2_WDT(dev); | ||
144 | + | ||
145 | + ptimer_transaction_begin(s->timer); | ||
146 | + ptimer_stop(s->timer); | ||
147 | + ptimer_transaction_commit(s->timer); | ||
148 | + | ||
149 | + if (s->pretimeout_support) { | ||
150 | + ptimer_transaction_begin(s->itimer); | ||
151 | + ptimer_stop(s->itimer); | ||
152 | + ptimer_transaction_commit(s->itimer); | ||
153 | + } | ||
154 | + | ||
155 | + s->wicr_locked = false; | ||
156 | + s->wcr_locked = false; | ||
157 | + s->wcr_wde_locked = false; | ||
158 | + | ||
159 | + s->wcr = IMX2_WDT_WCR_WDA | IMX2_WDT_WCR_SRS; | ||
160 | + s->wsr = 0; | ||
161 | + s->wrsr &= ~(IMX2_WDT_WRSR_TOUT | IMX2_WDT_WRSR_SFTW); | ||
162 | + s->wicr = IMX2_WDT_WICR_WICT_DEF; | ||
163 | + s->wmcr = IMX2_WDT_WMCR_PDE; | ||
164 | +} | ||
165 | + | ||
166 | +static uint64_t imx2_wdt_read(void *opaque, hwaddr addr, unsigned int size) | ||
167 | +{ | ||
168 | + IMX2WdtState *s = IMX2_WDT(opaque); | ||
169 | + | ||
170 | + switch (addr) { | ||
171 | + case IMX2_WDT_WCR: | ||
172 | + return s->wcr; | ||
173 | + case IMX2_WDT_WSR: | ||
174 | + return s->wsr; | ||
175 | + case IMX2_WDT_WRSR: | ||
176 | + return s->wrsr; | ||
177 | + case IMX2_WDT_WICR: | ||
178 | + return s->wicr; | ||
179 | + case IMX2_WDT_WMCR: | ||
180 | + return s->wmcr; | ||
181 | + } | ||
182 | return 0; | ||
49 | } | 183 | } |
50 | 184 | ||
51 | -Exynos4210State *exynos4210_init(MemoryRegion *system_mem) | 185 | +static void imx_wdt2_update_itimer(IMX2WdtState *s, bool start) |
52 | +static void exynos4210_realize(DeviceState *socdev, Error **errp) | 186 | +{ |
187 | + bool running = (s->wcr & IMX2_WDT_WCR_WDE) && (s->wcr & IMX2_WDT_WCR_WT); | ||
188 | + bool enabled = s->wicr & IMX2_WDT_WICR_WIE; | ||
189 | + | ||
190 | + ptimer_transaction_begin(s->itimer); | ||
191 | + if (start || !enabled) { | ||
192 | + ptimer_stop(s->itimer); | ||
193 | + } | ||
194 | + if (running && enabled) { | ||
195 | + int count = ptimer_get_count(s->timer); | ||
196 | + int pretimeout = s->wicr & IMX2_WDT_WICR_WICT; | ||
197 | + | ||
198 | + /* | ||
199 | + * Only (re-)start pretimeout timer if its counter value is larger | ||
200 | + * than 0. Otherwise it will fire right away and we'll get an | ||
201 | + * interrupt loop. | ||
202 | + */ | ||
203 | + if (count > pretimeout) { | ||
204 | + ptimer_set_count(s->itimer, count - pretimeout); | ||
205 | + if (start) { | ||
206 | + ptimer_run(s->itimer, 1); | ||
207 | + } | ||
208 | + } | ||
209 | + } | ||
210 | + ptimer_transaction_commit(s->itimer); | ||
211 | +} | ||
212 | + | ||
213 | +static void imx_wdt2_update_timer(IMX2WdtState *s, bool start) | ||
214 | +{ | ||
215 | + ptimer_transaction_begin(s->timer); | ||
216 | + if (start) { | ||
217 | + ptimer_stop(s->timer); | ||
218 | + } | ||
219 | + if ((s->wcr & IMX2_WDT_WCR_WDE) && (s->wcr & IMX2_WDT_WCR_WT)) { | ||
220 | + int count = (s->wcr & IMX2_WDT_WCR_WT) >> 8; | ||
221 | + | ||
222 | + /* A value of 0 reflects one period (0.5s). */ | ||
223 | + ptimer_set_count(s->timer, count + 1); | ||
224 | + if (start) { | ||
225 | + ptimer_run(s->timer, 1); | ||
226 | + } | ||
227 | + } | ||
228 | + ptimer_transaction_commit(s->timer); | ||
229 | + if (s->pretimeout_support) { | ||
230 | + imx_wdt2_update_itimer(s, start); | ||
231 | + } | ||
232 | +} | ||
233 | + | ||
234 | static void imx2_wdt_write(void *opaque, hwaddr addr, | ||
235 | uint64_t value, unsigned int size) | ||
53 | { | 236 | { |
54 | - Exynos4210State *s = g_new0(Exynos4210State, 1); | 237 | - if (addr == IMX2_WDT_WCR && |
55 | + Exynos4210State *s = EXYNOS4210_SOC(socdev); | 238 | - (~value & (IMX2_WDT_WCR_WDA | IMX2_WDT_WCR_SRS))) { |
56 | + MemoryRegion *system_mem = get_system_memory(); | 239 | - watchdog_perform_action(); |
57 | qemu_irq gate_irq[EXYNOS4210_NCPUS][EXYNOS4210_IRQ_GATE_NINPUTS]; | 240 | + IMX2WdtState *s = IMX2_WDT(opaque); |
58 | SysBusDevice *busdev; | 241 | + |
59 | DeviceState *dev; | 242 | + switch (addr) { |
60 | @@ -XXX,XX +XXX,XX @@ Exynos4210State *exynos4210_init(MemoryRegion *system_mem) | 243 | + case IMX2_WDT_WCR: |
61 | qemu_irq_invert(s->irq_table[exynos4210_get_irq(36, 1)]), 32); | 244 | + if (s->wcr_locked) { |
62 | pl330_create(EXYNOS4210_PL330_BASE2_ADDR, | 245 | + value &= ~IMX2_WDT_WCR_LOCK_MASK; |
63 | qemu_irq_invert(s->irq_table[exynos4210_get_irq(34, 1)]), 1); | 246 | + value |= (s->wicr & IMX2_WDT_WCR_LOCK_MASK); |
64 | - | 247 | + } |
65 | - return s; | 248 | + s->wcr_locked = true; |
249 | + if (s->wcr_wde_locked) { | ||
250 | + value &= ~IMX2_WDT_WCR_WDE; | ||
251 | + value |= (s->wicr & ~IMX2_WDT_WCR_WDE); | ||
252 | + } else if (value & IMX2_WDT_WCR_WDE) { | ||
253 | + s->wcr_wde_locked = true; | ||
254 | + } | ||
255 | + if (s->wcr_wdt_locked) { | ||
256 | + value &= ~IMX2_WDT_WCR_WDT; | ||
257 | + value |= (s->wicr & ~IMX2_WDT_WCR_WDT); | ||
258 | + } else if (value & IMX2_WDT_WCR_WDT) { | ||
259 | + s->wcr_wdt_locked = true; | ||
260 | + } | ||
261 | + | ||
262 | + s->wcr = value; | ||
263 | + if (!(value & IMX2_WDT_WCR_SRS)) { | ||
264 | + s->wrsr = IMX2_WDT_WRSR_SFTW; | ||
265 | + } | ||
266 | + if (!(value & (IMX2_WDT_WCR_WDA | IMX2_WDT_WCR_SRS)) || | ||
267 | + (!(value & IMX2_WDT_WCR_WT) && (value & IMX2_WDT_WCR_WDE))) { | ||
268 | + watchdog_perform_action(); | ||
269 | + } | ||
270 | + s->wcr |= IMX2_WDT_WCR_SRS; | ||
271 | + imx_wdt2_update_timer(s, true); | ||
272 | + break; | ||
273 | + case IMX2_WDT_WSR: | ||
274 | + if (s->wsr == IMX2_WDT_SEQ1 && value == IMX2_WDT_SEQ2) { | ||
275 | + imx_wdt2_update_timer(s, false); | ||
276 | + } | ||
277 | + s->wsr = value; | ||
278 | + break; | ||
279 | + case IMX2_WDT_WRSR: | ||
280 | + break; | ||
281 | + case IMX2_WDT_WICR: | ||
282 | + if (!s->pretimeout_support) { | ||
283 | + return; | ||
284 | + } | ||
285 | + value &= IMX2_WDT_WICR_LOCK_MASK | IMX2_WDT_WICR_WTIS; | ||
286 | + if (s->wicr_locked) { | ||
287 | + value &= IMX2_WDT_WICR_WTIS; | ||
288 | + value |= (s->wicr & IMX2_WDT_WICR_LOCK_MASK); | ||
289 | + } | ||
290 | + s->wicr = value | (s->wicr & IMX2_WDT_WICR_WTIS); | ||
291 | + if (value & IMX2_WDT_WICR_WTIS) { | ||
292 | + s->wicr &= ~IMX2_WDT_WICR_WTIS; | ||
293 | + qemu_set_irq(s->irq, 0); | ||
294 | + } | ||
295 | + imx_wdt2_update_itimer(s, true); | ||
296 | + s->wicr_locked = true; | ||
297 | + break; | ||
298 | + case IMX2_WDT_WMCR: | ||
299 | + s->wmcr = value & IMX2_WDT_WMCR_PDE; | ||
300 | + break; | ||
301 | } | ||
66 | } | 302 | } |
67 | + | 303 | |
68 | +static void exynos4210_class_init(ObjectClass *klass, void *data) | 304 | @@ -XXX,XX +XXX,XX @@ static const MemoryRegionOps imx2_wdt_ops = { |
69 | +{ | 305 | * real device but in practice there is no reason for a guest |
70 | + DeviceClass *dc = DEVICE_CLASS(klass); | 306 | * to access this device unaligned. |
71 | + | 307 | */ |
72 | + dc->realize = exynos4210_realize; | 308 | - .min_access_size = 4, |
73 | +} | 309 | - .max_access_size = 4, |
74 | + | 310 | + .min_access_size = 2, |
75 | +static const TypeInfo exynos4210_info = { | 311 | + .max_access_size = 2, |
76 | + .name = TYPE_EXYNOS4210_SOC, | 312 | .unaligned = false, |
77 | + .parent = TYPE_SYS_BUS_DEVICE, | 313 | }, |
78 | + .instance_size = sizeof(Exynos4210State), | 314 | }; |
79 | + .class_init = exynos4210_class_init, | 315 | |
316 | +static const VMStateDescription vmstate_imx2_wdt = { | ||
317 | + .name = "imx2.wdt", | ||
318 | + .fields = (VMStateField[]) { | ||
319 | + VMSTATE_PTIMER(timer, IMX2WdtState), | ||
320 | + VMSTATE_PTIMER(itimer, IMX2WdtState), | ||
321 | + VMSTATE_BOOL(wicr_locked, IMX2WdtState), | ||
322 | + VMSTATE_BOOL(wcr_locked, IMX2WdtState), | ||
323 | + VMSTATE_BOOL(wcr_wde_locked, IMX2WdtState), | ||
324 | + VMSTATE_BOOL(wcr_wdt_locked, IMX2WdtState), | ||
325 | + VMSTATE_UINT16(wcr, IMX2WdtState), | ||
326 | + VMSTATE_UINT16(wsr, IMX2WdtState), | ||
327 | + VMSTATE_UINT16(wrsr, IMX2WdtState), | ||
328 | + VMSTATE_UINT16(wmcr, IMX2WdtState), | ||
329 | + VMSTATE_UINT16(wicr, IMX2WdtState), | ||
330 | + VMSTATE_END_OF_LIST() | ||
331 | + } | ||
80 | +}; | 332 | +}; |
81 | + | 333 | + |
82 | +static void exynos4210_register_types(void) | 334 | static void imx2_wdt_realize(DeviceState *dev, Error **errp) |
83 | +{ | 335 | { |
84 | + type_register_static(&exynos4210_info); | 336 | IMX2WdtState *s = IMX2_WDT(dev); |
85 | +} | 337 | + SysBusDevice *sbd = SYS_BUS_DEVICE(dev); |
86 | + | 338 | |
87 | +type_init(exynos4210_register_types) | 339 | memory_region_init_io(&s->mmio, OBJECT(dev), |
88 | diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c | 340 | &imx2_wdt_ops, s, |
89 | index XXXXXXX..XXXXXXX 100644 | 341 | - TYPE_IMX2_WDT".mmio", |
90 | --- a/hw/arm/exynos4_boards.c | 342 | - IMX2_WDT_REG_NUM * sizeof(uint16_t)); |
91 | +++ b/hw/arm/exynos4_boards.c | 343 | - sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->mmio); |
92 | @@ -XXX,XX +XXX,XX @@ typedef enum Exynos4BoardType { | 344 | + TYPE_IMX2_WDT, |
93 | } Exynos4BoardType; | 345 | + IMX2_WDT_MMIO_SIZE); |
94 | 346 | + sysbus_init_mmio(sbd, &s->mmio); | |
95 | typedef struct Exynos4BoardState { | 347 | + sysbus_init_irq(sbd, &s->irq); |
96 | - Exynos4210State *soc; | 348 | + |
97 | + Exynos4210State soc; | 349 | + s->timer = ptimer_init(imx2_wdt_expired, s, |
98 | MemoryRegion dram0_mem; | 350 | + PTIMER_POLICY_NO_IMMEDIATE_TRIGGER | |
99 | MemoryRegion dram1_mem; | 351 | + PTIMER_POLICY_NO_IMMEDIATE_RELOAD | |
100 | } Exynos4BoardState; | 352 | + PTIMER_POLICY_NO_COUNTER_ROUND_DOWN); |
101 | @@ -XXX,XX +XXX,XX @@ exynos4_boards_init_common(MachineState *machine, | 353 | + ptimer_transaction_begin(s->timer); |
102 | exynos4_boards_init_ram(s, get_system_memory(), | 354 | + ptimer_set_freq(s->timer, 2); |
103 | exynos4_board_ram_size[board_type]); | 355 | + ptimer_set_limit(s->timer, 0xff, 1); |
104 | 356 | + ptimer_transaction_commit(s->timer); | |
105 | - s->soc = exynos4210_init(get_system_memory()); | 357 | + if (s->pretimeout_support) { |
106 | + object_initialize(&s->soc, sizeof(s->soc), TYPE_EXYNOS4210_SOC); | 358 | + s->itimer = ptimer_init(imx2_wdt_interrupt, s, |
107 | + qdev_set_parent_bus(DEVICE(&s->soc), sysbus_get_default()); | 359 | + PTIMER_POLICY_NO_IMMEDIATE_TRIGGER | |
108 | + object_property_set_bool(OBJECT(&s->soc), true, "realized", | 360 | + PTIMER_POLICY_NO_IMMEDIATE_RELOAD | |
109 | + &error_fatal); | 361 | + PTIMER_POLICY_NO_COUNTER_ROUND_DOWN); |
110 | 362 | + ptimer_transaction_begin(s->itimer); | |
111 | return s; | 363 | + ptimer_set_freq(s->itimer, 2); |
364 | + ptimer_set_limit(s->itimer, 0xff, 1); | ||
365 | + ptimer_transaction_commit(s->itimer); | ||
366 | + } | ||
112 | } | 367 | } |
113 | @@ -XXX,XX +XXX,XX @@ static void smdkc210_init(MachineState *machine) | 368 | |
114 | EXYNOS4_BOARD_SMDKC210); | 369 | +static Property imx2_wdt_properties[] = { |
115 | 370 | + DEFINE_PROP_BOOL("pretimeout-support", IMX2WdtState, pretimeout_support, | |
116 | lan9215_init(SMDK_LAN9118_BASE_ADDR, | 371 | + false), |
117 | - qemu_irq_invert(s->soc->irq_table[exynos4210_get_irq(37, 1)])); | 372 | +}; |
118 | + qemu_irq_invert(s->soc.irq_table[exynos4210_get_irq(37, 1)])); | 373 | + |
119 | arm_load_kernel(ARM_CPU(first_cpu), &exynos4_board_binfo); | 374 | static void imx2_wdt_class_init(ObjectClass *klass, void *data) |
375 | { | ||
376 | DeviceClass *dc = DEVICE_CLASS(klass); | ||
377 | |||
378 | + device_class_set_props(dc, imx2_wdt_properties); | ||
379 | dc->realize = imx2_wdt_realize; | ||
380 | + dc->reset = imx2_wdt_reset; | ||
381 | + dc->vmsd = &vmstate_imx2_wdt; | ||
382 | + dc->desc = "i.MX watchdog timer"; | ||
383 | set_bit(DEVICE_CATEGORY_MISC, dc->categories); | ||
120 | } | 384 | } |
121 | 385 | ||
122 | -- | 386 | -- |
123 | 2.20.1 | 387 | 2.20.1 |
124 | 388 | ||
125 | 389 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: Guenter Roeck <linux@roeck-us.net> | ||
1 | 2 | ||
3 | With this commit, the watchdog on imx25-pdk is fully operational, | ||
4 | including pretimeout support. | ||
5 | |||
6 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
7 | Signed-off-by: Guenter Roeck <linux@roeck-us.net> | ||
8 | Message-id: 20200517162135.110364-4-linux@roeck-us.net | ||
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
10 | --- | ||
11 | include/hw/arm/fsl-imx25.h | 5 +++++ | ||
12 | hw/arm/fsl-imx25.c | 10 ++++++++++ | ||
13 | hw/arm/Kconfig | 1 + | ||
14 | 3 files changed, 16 insertions(+) | ||
15 | |||
16 | diff --git a/include/hw/arm/fsl-imx25.h b/include/hw/arm/fsl-imx25.h | ||
17 | index XXXXXXX..XXXXXXX 100644 | ||
18 | --- a/include/hw/arm/fsl-imx25.h | ||
19 | +++ b/include/hw/arm/fsl-imx25.h | ||
20 | @@ -XXX,XX +XXX,XX @@ | ||
21 | #include "hw/gpio/imx_gpio.h" | ||
22 | #include "hw/sd/sdhci.h" | ||
23 | #include "hw/usb/chipidea.h" | ||
24 | +#include "hw/watchdog/wdt_imx2.h" | ||
25 | #include "exec/memory.h" | ||
26 | #include "target/arm/cpu.h" | ||
27 | |||
28 | @@ -XXX,XX +XXX,XX @@ typedef struct FslIMX25State { | ||
29 | IMXGPIOState gpio[FSL_IMX25_NUM_GPIOS]; | ||
30 | SDHCIState esdhc[FSL_IMX25_NUM_ESDHCS]; | ||
31 | ChipideaState usb[FSL_IMX25_NUM_USBS]; | ||
32 | + IMX2WdtState wdt; | ||
33 | MemoryRegion rom[2]; | ||
34 | MemoryRegion iram; | ||
35 | MemoryRegion iram_alias; | ||
36 | @@ -XXX,XX +XXX,XX @@ typedef struct FslIMX25State { | ||
37 | #define FSL_IMX25_GPIO1_SIZE 0x4000 | ||
38 | #define FSL_IMX25_GPIO2_ADDR 0x53FD0000 | ||
39 | #define FSL_IMX25_GPIO2_SIZE 0x4000 | ||
40 | +#define FSL_IMX25_WDT_ADDR 0x53FDC000 | ||
41 | +#define FSL_IMX25_WDT_SIZE 0x4000 | ||
42 | #define FSL_IMX25_USB1_ADDR 0x53FF4000 | ||
43 | #define FSL_IMX25_USB1_SIZE 0x0200 | ||
44 | #define FSL_IMX25_USB2_ADDR 0x53FF4400 | ||
45 | @@ -XXX,XX +XXX,XX @@ typedef struct FslIMX25State { | ||
46 | #define FSL_IMX25_ESDHC2_IRQ 8 | ||
47 | #define FSL_IMX25_USB1_IRQ 37 | ||
48 | #define FSL_IMX25_USB2_IRQ 35 | ||
49 | +#define FSL_IMX25_WDT_IRQ 55 | ||
50 | |||
51 | #endif /* FSL_IMX25_H */ | ||
52 | diff --git a/hw/arm/fsl-imx25.c b/hw/arm/fsl-imx25.c | ||
53 | index XXXXXXX..XXXXXXX 100644 | ||
54 | --- a/hw/arm/fsl-imx25.c | ||
55 | +++ b/hw/arm/fsl-imx25.c | ||
56 | @@ -XXX,XX +XXX,XX @@ static void fsl_imx25_init(Object *obj) | ||
57 | TYPE_CHIPIDEA); | ||
58 | } | ||
59 | |||
60 | + sysbus_init_child_obj(obj, "wdt", &s->wdt, sizeof(s->wdt), TYPE_IMX2_WDT); | ||
61 | } | ||
62 | |||
63 | static void fsl_imx25_realize(DeviceState *dev, Error **errp) | ||
64 | @@ -XXX,XX +XXX,XX @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp) | ||
65 | usb_table[i].irq)); | ||
66 | } | ||
67 | |||
68 | + /* Watchdog */ | ||
69 | + object_property_set_bool(OBJECT(&s->wdt), true, "pretimeout-support", | ||
70 | + &error_abort); | ||
71 | + object_property_set_bool(OBJECT(&s->wdt), true, "realized", &error_abort); | ||
72 | + sysbus_mmio_map(SYS_BUS_DEVICE(&s->wdt), 0, FSL_IMX25_WDT_ADDR); | ||
73 | + sysbus_connect_irq(SYS_BUS_DEVICE(&s->wdt), 0, | ||
74 | + qdev_get_gpio_in(DEVICE(&s->avic), | ||
75 | + FSL_IMX25_WDT_IRQ)); | ||
76 | + | ||
77 | /* initialize 2 x 16 KB ROM */ | ||
78 | memory_region_init_rom(&s->rom[0], OBJECT(dev), "imx25.rom0", | ||
79 | FSL_IMX25_ROM0_SIZE, &err); | ||
80 | diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig | ||
81 | index XXXXXXX..XXXXXXX 100644 | ||
82 | --- a/hw/arm/Kconfig | ||
83 | +++ b/hw/arm/Kconfig | ||
84 | @@ -XXX,XX +XXX,XX @@ config FSL_IMX25 | ||
85 | select IMX | ||
86 | select IMX_FEC | ||
87 | select IMX_I2C | ||
88 | + select WDT_IMX2 | ||
89 | select DS1338 | ||
90 | |||
91 | config FSL_IMX31 | ||
92 | -- | ||
93 | 2.20.1 | ||
94 | |||
95 | diff view generated by jsdifflib |
1 | From: Guenter Roeck <linux@roeck-us.net> | 1 | From: Guenter Roeck <linux@roeck-us.net> |
---|---|---|---|
2 | 2 | ||
3 | QEMU already supports pl330. Instantiate it for Exynos4210. | 3 | With this patch, the watchdog on i.MX31 emulations is fully operational. |
4 | 4 | ||
5 | Relevant part of Linux arch/arm/boot/dts/exynos4.dtsi: | 5 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
6 | |||
7 | / { | ||
8 | soc: soc { | ||
9 | amba { | ||
10 | pdma0: pdma@12680000 { | ||
11 | compatible = "arm,pl330", "arm,primecell"; | ||
12 | reg = <0x12680000 0x1000>; | ||
13 | interrupts = <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>; | ||
14 | clocks = <&clock CLK_PDMA0>; | ||
15 | clock-names = "apb_pclk"; | ||
16 | #dma-cells = <1>; | ||
17 | #dma-channels = <8>; | ||
18 | #dma-requests = <32>; | ||
19 | }; | ||
20 | pdma1: pdma@12690000 { | ||
21 | compatible = "arm,pl330", "arm,primecell"; | ||
22 | reg = <0x12690000 0x1000>; | ||
23 | interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>; | ||
24 | clocks = <&clock CLK_PDMA1>; | ||
25 | clock-names = "apb_pclk"; | ||
26 | #dma-cells = <1>; | ||
27 | #dma-channels = <8>; | ||
28 | #dma-requests = <32>; | ||
29 | }; | ||
30 | mdma1: mdma@12850000 { | ||
31 | compatible = "arm,pl330", "arm,primecell"; | ||
32 | reg = <0x12850000 0x1000>; | ||
33 | interrupts = <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>; | ||
34 | clocks = <&clock CLK_MDMA>; | ||
35 | clock-names = "apb_pclk"; | ||
36 | #dma-cells = <1>; | ||
37 | #dma-channels = <8>; | ||
38 | #dma-requests = <1>; | ||
39 | }; | ||
40 | }; | ||
41 | }; | ||
42 | }; | ||
43 | |||
44 | Signed-off-by: Guenter Roeck <linux@roeck-us.net> | 6 | Signed-off-by: Guenter Roeck <linux@roeck-us.net> |
45 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | 7 | Message-id: 20200517162135.110364-5-linux@roeck-us.net |
46 | Reviewed-by: Alistair Francis <alistair.francis@wdc.com> | ||
47 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
48 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
49 | Message-id: 20190520214342.13709-4-philmd@redhat.com | ||
50 | [PMD: Do not set default qdev properties, create the controllers in the SoC | ||
51 | rather than the board (Peter Maydell), add dtsi in commit message] | ||
52 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
53 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
54 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
55 | --- | 9 | --- |
56 | hw/arm/exynos4210.c | 26 ++++++++++++++++++++++++++ | 10 | include/hw/arm/fsl-imx31.h | 4 ++++ |
57 | 1 file changed, 26 insertions(+) | 11 | hw/arm/fsl-imx31.c | 6 ++++++ |
12 | hw/arm/Kconfig | 1 + | ||
13 | 3 files changed, 11 insertions(+) | ||
58 | 14 | ||
59 | diff --git a/hw/arm/exynos4210.c b/hw/arm/exynos4210.c | 15 | diff --git a/include/hw/arm/fsl-imx31.h b/include/hw/arm/fsl-imx31.h |
60 | index XXXXXXX..XXXXXXX 100644 | 16 | index XXXXXXX..XXXXXXX 100644 |
61 | --- a/hw/arm/exynos4210.c | 17 | --- a/include/hw/arm/fsl-imx31.h |
62 | +++ b/hw/arm/exynos4210.c | 18 | +++ b/include/hw/arm/fsl-imx31.h |
63 | @@ -XXX,XX +XXX,XX @@ | 19 | @@ -XXX,XX +XXX,XX @@ |
64 | /* EHCI */ | 20 | #include "hw/timer/imx_epit.h" |
65 | #define EXYNOS4210_EHCI_BASE_ADDR 0x12580000 | 21 | #include "hw/i2c/imx_i2c.h" |
66 | 22 | #include "hw/gpio/imx_gpio.h" | |
67 | +/* DMA */ | 23 | +#include "hw/watchdog/wdt_imx2.h" |
68 | +#define EXYNOS4210_PL330_BASE0_ADDR 0x12680000 | 24 | #include "exec/memory.h" |
69 | +#define EXYNOS4210_PL330_BASE1_ADDR 0x12690000 | 25 | #include "target/arm/cpu.h" |
70 | +#define EXYNOS4210_PL330_BASE2_ADDR 0x12850000 | 26 | |
27 | @@ -XXX,XX +XXX,XX @@ typedef struct FslIMX31State { | ||
28 | IMXEPITState epit[FSL_IMX31_NUM_EPITS]; | ||
29 | IMXI2CState i2c[FSL_IMX31_NUM_I2CS]; | ||
30 | IMXGPIOState gpio[FSL_IMX31_NUM_GPIOS]; | ||
31 | + IMX2WdtState wdt; | ||
32 | MemoryRegion secure_rom; | ||
33 | MemoryRegion rom; | ||
34 | MemoryRegion iram; | ||
35 | @@ -XXX,XX +XXX,XX @@ typedef struct FslIMX31State { | ||
36 | #define FSL_IMX31_GPIO1_SIZE 0x4000 | ||
37 | #define FSL_IMX31_GPIO2_ADDR 0x53FD0000 | ||
38 | #define FSL_IMX31_GPIO2_SIZE 0x4000 | ||
39 | +#define FSL_IMX31_WDT_ADDR 0x53FDC000 | ||
40 | +#define FSL_IMX31_WDT_SIZE 0x4000 | ||
41 | #define FSL_IMX31_AVIC_ADDR 0x68000000 | ||
42 | #define FSL_IMX31_AVIC_SIZE 0x100 | ||
43 | #define FSL_IMX31_SDRAM0_ADDR 0x80000000 | ||
44 | diff --git a/hw/arm/fsl-imx31.c b/hw/arm/fsl-imx31.c | ||
45 | index XXXXXXX..XXXXXXX 100644 | ||
46 | --- a/hw/arm/fsl-imx31.c | ||
47 | +++ b/hw/arm/fsl-imx31.c | ||
48 | @@ -XXX,XX +XXX,XX @@ static void fsl_imx31_init(Object *obj) | ||
49 | sysbus_init_child_obj(obj, "gpio[*]", &s->gpio[i], sizeof(s->gpio[i]), | ||
50 | TYPE_IMX_GPIO); | ||
51 | } | ||
71 | + | 52 | + |
72 | static uint8_t chipid_and_omr[] = { 0x11, 0x02, 0x21, 0x43, | 53 | + sysbus_init_child_obj(obj, "wdt", &s->wdt, sizeof(s->wdt), TYPE_IMX2_WDT); |
73 | 0x09, 0x00, 0x00, 0x00 }; | ||
74 | |||
75 | @@ -XXX,XX +XXX,XX @@ static uint64_t exynos4210_calc_affinity(int cpu) | ||
76 | return (0x9 << ARM_AFF1_SHIFT) | cpu; | ||
77 | } | 54 | } |
78 | 55 | ||
79 | +static void pl330_create(uint32_t base, qemu_irq irq, int nreq) | 56 | static void fsl_imx31_realize(DeviceState *dev, Error **errp) |
80 | +{ | 57 | @@ -XXX,XX +XXX,XX @@ static void fsl_imx31_realize(DeviceState *dev, Error **errp) |
81 | + SysBusDevice *busdev; | 58 | gpio_table[i].irq)); |
82 | + DeviceState *dev; | 59 | } |
60 | |||
61 | + /* Watchdog */ | ||
62 | + object_property_set_bool(OBJECT(&s->wdt), true, "realized", &error_abort); | ||
63 | + sysbus_mmio_map(SYS_BUS_DEVICE(&s->wdt), 0, FSL_IMX31_WDT_ADDR); | ||
83 | + | 64 | + |
84 | + dev = qdev_create(NULL, "pl330"); | 65 | /* On a real system, the first 16k is a `secure boot rom' */ |
85 | + qdev_prop_set_uint8(dev, "num_periph_req", nreq); | 66 | memory_region_init_rom(&s->secure_rom, OBJECT(dev), "imx31.secure_rom", |
86 | + qdev_init_nofail(dev); | 67 | FSL_IMX31_SECURE_ROM_SIZE, &err); |
87 | + busdev = SYS_BUS_DEVICE(dev); | 68 | diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig |
88 | + sysbus_mmio_map(busdev, 0, base); | 69 | index XXXXXXX..XXXXXXX 100644 |
89 | + sysbus_connect_irq(busdev, 0, irq); | 70 | --- a/hw/arm/Kconfig |
90 | +} | 71 | +++ b/hw/arm/Kconfig |
91 | + | 72 | @@ -XXX,XX +XXX,XX @@ config FSL_IMX31 |
92 | Exynos4210State *exynos4210_init(MemoryRegion *system_mem) | 73 | select SERIAL |
93 | { | 74 | select IMX |
94 | Exynos4210State *s = g_new0(Exynos4210State, 1); | 75 | select IMX_I2C |
95 | @@ -XXX,XX +XXX,XX @@ Exynos4210State *exynos4210_init(MemoryRegion *system_mem) | 76 | + select WDT_IMX2 |
96 | sysbus_create_simple(TYPE_EXYNOS4210_EHCI, EXYNOS4210_EHCI_BASE_ADDR, | 77 | select LAN9118 |
97 | s->irq_table[exynos4210_get_irq(28, 3)]); | 78 | |
98 | 79 | config FSL_IMX6 | |
99 | + /*** DMA controllers ***/ | ||
100 | + pl330_create(EXYNOS4210_PL330_BASE0_ADDR, | ||
101 | + qemu_irq_invert(s->irq_table[exynos4210_get_irq(35, 1)]), 32); | ||
102 | + pl330_create(EXYNOS4210_PL330_BASE1_ADDR, | ||
103 | + qemu_irq_invert(s->irq_table[exynos4210_get_irq(36, 1)]), 32); | ||
104 | + pl330_create(EXYNOS4210_PL330_BASE2_ADDR, | ||
105 | + qemu_irq_invert(s->irq_table[exynos4210_get_irq(34, 1)]), 1); | ||
106 | + | ||
107 | return s; | ||
108 | } | ||
109 | -- | 80 | -- |
110 | 2.20.1 | 81 | 2.20.1 |
111 | 82 | ||
112 | 83 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: Guenter Roeck <linux@roeck-us.net> | ||
1 | 2 | ||
3 | With this patch applied, the watchdog in the sabrelite emulation | ||
4 | is fully operational, including pretimeout support. | ||
5 | |||
6 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
7 | Signed-off-by: Guenter Roeck <linux@roeck-us.net> | ||
8 | Message-id: 20200517162135.110364-6-linux@roeck-us.net | ||
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
10 | --- | ||
11 | hw/arm/fsl-imx6.c | 9 +++++++++ | ||
12 | 1 file changed, 9 insertions(+) | ||
13 | |||
14 | diff --git a/hw/arm/fsl-imx6.c b/hw/arm/fsl-imx6.c | ||
15 | index XXXXXXX..XXXXXXX 100644 | ||
16 | --- a/hw/arm/fsl-imx6.c | ||
17 | +++ b/hw/arm/fsl-imx6.c | ||
18 | @@ -XXX,XX +XXX,XX @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp) | ||
19 | FSL_IMX6_WDOG1_ADDR, | ||
20 | FSL_IMX6_WDOG2_ADDR, | ||
21 | }; | ||
22 | + static const int FSL_IMX6_WDOGn_IRQ[FSL_IMX6_NUM_WDTS] = { | ||
23 | + FSL_IMX6_WDOG1_IRQ, | ||
24 | + FSL_IMX6_WDOG2_IRQ, | ||
25 | + }; | ||
26 | |||
27 | + object_property_set_bool(OBJECT(&s->wdt[i]), true, "pretimeout-support", | ||
28 | + &error_abort); | ||
29 | object_property_set_bool(OBJECT(&s->wdt[i]), true, "realized", | ||
30 | &error_abort); | ||
31 | |||
32 | sysbus_mmio_map(SYS_BUS_DEVICE(&s->wdt[i]), 0, FSL_IMX6_WDOGn_ADDR[i]); | ||
33 | + sysbus_connect_irq(SYS_BUS_DEVICE(&s->wdt[i]), 0, | ||
34 | + qdev_get_gpio_in(DEVICE(&s->a9mpcore), | ||
35 | + FSL_IMX6_WDOGn_IRQ[i])); | ||
36 | } | ||
37 | |||
38 | /* ROM memory */ | ||
39 | -- | ||
40 | 2.20.1 | ||
41 | |||
42 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: Guenter Roeck <linux@roeck-us.net> | ||
1 | 2 | ||
3 | With this commit, the watchdog on mcimx6ul-evk is fully operational, | ||
4 | including pretimeout support. | ||
5 | |||
6 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
7 | Signed-off-by: Guenter Roeck <linux@roeck-us.net> | ||
8 | Message-id: 20200517162135.110364-7-linux@roeck-us.net | ||
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
10 | --- | ||
11 | hw/arm/fsl-imx6ul.c | 10 ++++++++++ | ||
12 | 1 file changed, 10 insertions(+) | ||
13 | |||
14 | diff --git a/hw/arm/fsl-imx6ul.c b/hw/arm/fsl-imx6ul.c | ||
15 | index XXXXXXX..XXXXXXX 100644 | ||
16 | --- a/hw/arm/fsl-imx6ul.c | ||
17 | +++ b/hw/arm/fsl-imx6ul.c | ||
18 | @@ -XXX,XX +XXX,XX @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp) | ||
19 | FSL_IMX6UL_WDOG2_ADDR, | ||
20 | FSL_IMX6UL_WDOG3_ADDR, | ||
21 | }; | ||
22 | + static const int FSL_IMX6UL_WDOGn_IRQ[FSL_IMX6UL_NUM_WDTS] = { | ||
23 | + FSL_IMX6UL_WDOG1_IRQ, | ||
24 | + FSL_IMX6UL_WDOG2_IRQ, | ||
25 | + FSL_IMX6UL_WDOG3_IRQ, | ||
26 | + }; | ||
27 | |||
28 | + object_property_set_bool(OBJECT(&s->wdt[i]), true, "pretimeout-support", | ||
29 | + &error_abort); | ||
30 | object_property_set_bool(OBJECT(&s->wdt[i]), true, "realized", | ||
31 | &error_abort); | ||
32 | |||
33 | sysbus_mmio_map(SYS_BUS_DEVICE(&s->wdt[i]), 0, | ||
34 | FSL_IMX6UL_WDOGn_ADDR[i]); | ||
35 | + sysbus_connect_irq(SYS_BUS_DEVICE(&s->wdt[i]), 0, | ||
36 | + qdev_get_gpio_in(DEVICE(&s->a7mpcore), | ||
37 | + FSL_IMX6UL_WDOGn_IRQ[i])); | ||
38 | } | ||
39 | |||
40 | /* | ||
41 | -- | ||
42 | 2.20.1 | ||
43 | |||
44 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: Guenter Roeck <linux@roeck-us.net> | ||
1 | 2 | ||
3 | Instantiating PWM, CAN, CAAM, and OCOTP devices is necessary to avoid | ||
4 | crashes when booting mainline Linux. | ||
5 | |||
6 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | Signed-off-by: Guenter Roeck <linux@roeck-us.net> | ||
8 | Message-id: 20200517162135.110364-8-linux@roeck-us.net | ||
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
10 | --- | ||
11 | include/hw/arm/fsl-imx7.h | 16 ++++++++++++++++ | ||
12 | hw/arm/fsl-imx7.c | 24 ++++++++++++++++++++++++ | ||
13 | 2 files changed, 40 insertions(+) | ||
14 | |||
15 | diff --git a/include/hw/arm/fsl-imx7.h b/include/hw/arm/fsl-imx7.h | ||
16 | index XXXXXXX..XXXXXXX 100644 | ||
17 | --- a/include/hw/arm/fsl-imx7.h | ||
18 | +++ b/include/hw/arm/fsl-imx7.h | ||
19 | @@ -XXX,XX +XXX,XX @@ enum FslIMX7MemoryMap { | ||
20 | FSL_IMX7_IOMUXC_GPR_ADDR = 0x30340000, | ||
21 | FSL_IMX7_IOMUXCn_SIZE = 0x1000, | ||
22 | |||
23 | + FSL_IMX7_OCOTP_ADDR = 0x30350000, | ||
24 | + FSL_IMX7_OCOTP_SIZE = 0x10000, | ||
25 | + | ||
26 | FSL_IMX7_ANALOG_ADDR = 0x30360000, | ||
27 | FSL_IMX7_SNVS_ADDR = 0x30370000, | ||
28 | FSL_IMX7_CCM_ADDR = 0x30380000, | ||
29 | @@ -XXX,XX +XXX,XX @@ enum FslIMX7MemoryMap { | ||
30 | FSL_IMX7_ADC2_ADDR = 0x30620000, | ||
31 | FSL_IMX7_ADCn_SIZE = 0x1000, | ||
32 | |||
33 | + FSL_IMX7_PWM1_ADDR = 0x30660000, | ||
34 | + FSL_IMX7_PWM2_ADDR = 0x30670000, | ||
35 | + FSL_IMX7_PWM3_ADDR = 0x30680000, | ||
36 | + FSL_IMX7_PWM4_ADDR = 0x30690000, | ||
37 | + FSL_IMX7_PWMn_SIZE = 0x10000, | ||
38 | + | ||
39 | FSL_IMX7_PCIE_PHY_ADDR = 0x306D0000, | ||
40 | FSL_IMX7_PCIE_PHY_SIZE = 0x10000, | ||
41 | |||
42 | FSL_IMX7_GPC_ADDR = 0x303A0000, | ||
43 | |||
44 | + FSL_IMX7_CAAM_ADDR = 0x30900000, | ||
45 | + FSL_IMX7_CAAM_SIZE = 0x40000, | ||
46 | + | ||
47 | + FSL_IMX7_CAN1_ADDR = 0x30A00000, | ||
48 | + FSL_IMX7_CAN2_ADDR = 0x30A10000, | ||
49 | + FSL_IMX7_CANn_SIZE = 0x10000, | ||
50 | + | ||
51 | FSL_IMX7_I2C1_ADDR = 0x30A20000, | ||
52 | FSL_IMX7_I2C2_ADDR = 0x30A30000, | ||
53 | FSL_IMX7_I2C3_ADDR = 0x30A40000, | ||
54 | diff --git a/hw/arm/fsl-imx7.c b/hw/arm/fsl-imx7.c | ||
55 | index XXXXXXX..XXXXXXX 100644 | ||
56 | --- a/hw/arm/fsl-imx7.c | ||
57 | +++ b/hw/arm/fsl-imx7.c | ||
58 | @@ -XXX,XX +XXX,XX @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp) | ||
59 | */ | ||
60 | create_unimplemented_device("sdma", FSL_IMX7_SDMA_ADDR, FSL_IMX7_SDMA_SIZE); | ||
61 | |||
62 | + /* | ||
63 | + * CAAM | ||
64 | + */ | ||
65 | + create_unimplemented_device("caam", FSL_IMX7_CAAM_ADDR, FSL_IMX7_CAAM_SIZE); | ||
66 | + | ||
67 | + /* | ||
68 | + * PWM | ||
69 | + */ | ||
70 | + create_unimplemented_device("pwm1", FSL_IMX7_PWM1_ADDR, FSL_IMX7_PWMn_SIZE); | ||
71 | + create_unimplemented_device("pwm2", FSL_IMX7_PWM2_ADDR, FSL_IMX7_PWMn_SIZE); | ||
72 | + create_unimplemented_device("pwm3", FSL_IMX7_PWM3_ADDR, FSL_IMX7_PWMn_SIZE); | ||
73 | + create_unimplemented_device("pwm4", FSL_IMX7_PWM4_ADDR, FSL_IMX7_PWMn_SIZE); | ||
74 | + | ||
75 | + /* | ||
76 | + * CAN | ||
77 | + */ | ||
78 | + create_unimplemented_device("can1", FSL_IMX7_CAN1_ADDR, FSL_IMX7_CANn_SIZE); | ||
79 | + create_unimplemented_device("can2", FSL_IMX7_CAN2_ADDR, FSL_IMX7_CANn_SIZE); | ||
80 | + | ||
81 | + /* | ||
82 | + * OCOTP | ||
83 | + */ | ||
84 | + create_unimplemented_device("ocotp", FSL_IMX7_OCOTP_ADDR, | ||
85 | + FSL_IMX7_OCOTP_SIZE); | ||
86 | |||
87 | object_property_set_bool(OBJECT(&s->gpr), true, "realized", | ||
88 | &error_abort); | ||
89 | -- | ||
90 | 2.20.1 | ||
91 | |||
92 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: Guenter Roeck <linux@roeck-us.net> | ||
1 | 2 | ||
3 | i.MX7 supports watchdog pretimeout interupts. With this commit, | ||
4 | the watchdog in mcimx7d-sabre is fully operational, including | ||
5 | pretimeout support. | ||
6 | |||
7 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
8 | Signed-off-by: Guenter Roeck <linux@roeck-us.net> | ||
9 | Message-id: 20200517162135.110364-9-linux@roeck-us.net | ||
10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
11 | --- | ||
12 | include/hw/arm/fsl-imx7.h | 5 +++++ | ||
13 | hw/arm/fsl-imx7.c | 11 +++++++++++ | ||
14 | 2 files changed, 16 insertions(+) | ||
15 | |||
16 | diff --git a/include/hw/arm/fsl-imx7.h b/include/hw/arm/fsl-imx7.h | ||
17 | index XXXXXXX..XXXXXXX 100644 | ||
18 | --- a/include/hw/arm/fsl-imx7.h | ||
19 | +++ b/include/hw/arm/fsl-imx7.h | ||
20 | @@ -XXX,XX +XXX,XX @@ enum FslIMX7IRQs { | ||
21 | FSL_IMX7_USB2_IRQ = 42, | ||
22 | FSL_IMX7_USB3_IRQ = 40, | ||
23 | |||
24 | + FSL_IMX7_WDOG1_IRQ = 78, | ||
25 | + FSL_IMX7_WDOG2_IRQ = 79, | ||
26 | + FSL_IMX7_WDOG3_IRQ = 10, | ||
27 | + FSL_IMX7_WDOG4_IRQ = 109, | ||
28 | + | ||
29 | FSL_IMX7_PCI_INTA_IRQ = 125, | ||
30 | FSL_IMX7_PCI_INTB_IRQ = 124, | ||
31 | FSL_IMX7_PCI_INTC_IRQ = 123, | ||
32 | diff --git a/hw/arm/fsl-imx7.c b/hw/arm/fsl-imx7.c | ||
33 | index XXXXXXX..XXXXXXX 100644 | ||
34 | --- a/hw/arm/fsl-imx7.c | ||
35 | +++ b/hw/arm/fsl-imx7.c | ||
36 | @@ -XXX,XX +XXX,XX @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp) | ||
37 | FSL_IMX7_WDOG3_ADDR, | ||
38 | FSL_IMX7_WDOG4_ADDR, | ||
39 | }; | ||
40 | + static const int FSL_IMX7_WDOGn_IRQ[FSL_IMX7_NUM_WDTS] = { | ||
41 | + FSL_IMX7_WDOG1_IRQ, | ||
42 | + FSL_IMX7_WDOG2_IRQ, | ||
43 | + FSL_IMX7_WDOG3_IRQ, | ||
44 | + FSL_IMX7_WDOG4_IRQ, | ||
45 | + }; | ||
46 | |||
47 | + object_property_set_bool(OBJECT(&s->wdt[i]), true, "pretimeout-support", | ||
48 | + &error_abort); | ||
49 | object_property_set_bool(OBJECT(&s->wdt[i]), true, "realized", | ||
50 | &error_abort); | ||
51 | |||
52 | sysbus_mmio_map(SYS_BUS_DEVICE(&s->wdt[i]), 0, FSL_IMX7_WDOGn_ADDR[i]); | ||
53 | + sysbus_connect_irq(SYS_BUS_DEVICE(&s->wdt[i]), 0, | ||
54 | + qdev_get_gpio_in(DEVICE(&s->a7mpcore), | ||
55 | + FSL_IMX7_WDOGn_IRQ[i])); | ||
56 | } | ||
57 | |||
58 | /* | ||
59 | -- | ||
60 | 2.20.1 | ||
61 | |||
62 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
1 | 2 | ||
3 | hw_error() calls exit(). This a bit overkill when we can log | ||
4 | the accesses as unimplemented or guest error. | ||
5 | |||
6 | When fuzzing the devices, we don't want the whole process to | ||
7 | exit. Replace some hw_error() calls by qemu_log_mask(). | ||
8 | |||
9 | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
10 | Reviewed-by: Alistair Francis <alistair.francis@wdc.com> | ||
11 | Message-id: 20200518140309.5220-2-f4bug@amsat.org | ||
12 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
13 | --- | ||
14 | hw/arm/integratorcp.c | 23 +++++++++++++++-------- | ||
15 | 1 file changed, 15 insertions(+), 8 deletions(-) | ||
16 | |||
17 | diff --git a/hw/arm/integratorcp.c b/hw/arm/integratorcp.c | ||
18 | index XXXXXXX..XXXXXXX 100644 | ||
19 | --- a/hw/arm/integratorcp.c | ||
20 | +++ b/hw/arm/integratorcp.c | ||
21 | @@ -XXX,XX +XXX,XX @@ | ||
22 | #include "exec/address-spaces.h" | ||
23 | #include "sysemu/runstate.h" | ||
24 | #include "sysemu/sysemu.h" | ||
25 | +#include "qemu/log.h" | ||
26 | #include "qemu/error-report.h" | ||
27 | #include "hw/char/pl011.h" | ||
28 | #include "hw/hw.h" | ||
29 | @@ -XXX,XX +XXX,XX @@ static uint64_t integratorcm_read(void *opaque, hwaddr offset, | ||
30 | /* ??? Voltage control unimplemented. */ | ||
31 | return 0; | ||
32 | default: | ||
33 | - hw_error("integratorcm_read: Unimplemented offset 0x%x\n", | ||
34 | - (int)offset); | ||
35 | + qemu_log_mask(LOG_UNIMP, | ||
36 | + "%s: Unimplemented offset 0x%" HWADDR_PRIX "\n", | ||
37 | + __func__, offset); | ||
38 | return 0; | ||
39 | } | ||
40 | } | ||
41 | @@ -XXX,XX +XXX,XX @@ static void integratorcm_write(void *opaque, hwaddr offset, | ||
42 | /* ??? Voltage control unimplemented. */ | ||
43 | break; | ||
44 | default: | ||
45 | - hw_error("integratorcm_write: Unimplemented offset 0x%x\n", | ||
46 | - (int)offset); | ||
47 | + qemu_log_mask(LOG_UNIMP, | ||
48 | + "%s: Unimplemented offset 0x%" HWADDR_PRIX "\n", | ||
49 | + __func__, offset); | ||
50 | break; | ||
51 | } | ||
52 | } | ||
53 | @@ -XXX,XX +XXX,XX @@ static uint64_t icp_pic_read(void *opaque, hwaddr offset, | ||
54 | case 5: /* INT_SOFTCLR */ | ||
55 | case 11: /* FRQ_ENABLECLR */ | ||
56 | default: | ||
57 | - printf ("icp_pic_read: Bad register offset 0x%x\n", (int)offset); | ||
58 | + qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad offset 0x%" HWADDR_PRIX "\n", | ||
59 | + __func__, offset); | ||
60 | return 0; | ||
61 | } | ||
62 | } | ||
63 | @@ -XXX,XX +XXX,XX @@ static void icp_pic_write(void *opaque, hwaddr offset, | ||
64 | case 8: /* FRQ_STATUS */ | ||
65 | case 9: /* FRQ_RAWSTAT */ | ||
66 | default: | ||
67 | - printf ("icp_pic_write: Bad register offset 0x%x\n", (int)offset); | ||
68 | + qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad offset 0x%" HWADDR_PRIX "\n", | ||
69 | + __func__, offset); | ||
70 | return; | ||
71 | } | ||
72 | icp_pic_update(s); | ||
73 | @@ -XXX,XX +XXX,XX @@ static uint64_t icp_control_read(void *opaque, hwaddr offset, | ||
74 | case 3: /* CP_DECODE */ | ||
75 | return 0x11; | ||
76 | default: | ||
77 | - hw_error("icp_control_read: Bad offset %x\n", (int)offset); | ||
78 | + qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad offset 0x%" HWADDR_PRIX "\n", | ||
79 | + __func__, offset); | ||
80 | return 0; | ||
81 | } | ||
82 | } | ||
83 | @@ -XXX,XX +XXX,XX @@ static void icp_control_write(void *opaque, hwaddr offset, | ||
84 | /* Nothing interesting implemented yet. */ | ||
85 | break; | ||
86 | default: | ||
87 | - hw_error("icp_control_write: Bad offset %x\n", (int)offset); | ||
88 | + qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad offset 0x%" HWADDR_PRIX "\n", | ||
89 | + __func__, offset); | ||
90 | } | ||
91 | } | ||
92 | |||
93 | -- | ||
94 | 2.20.1 | ||
95 | |||
96 | diff view generated by jsdifflib |
1 | From: Philippe Mathieu-Daudé <philmd@redhat.com> | 1 | From: Philippe Mathieu-Daudé <f4bug@amsat.org> |
---|---|---|---|
2 | 2 | ||
3 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> | 3 | hw_error() calls exit(). This a bit overkill when we can log |
4 | the accesses as unimplemented or guest error. | ||
5 | |||
6 | When fuzzing the devices, we don't want the whole process to | ||
7 | exit. Replace some hw_error() calls by qemu_log_mask(). | ||
8 | |||
9 | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
4 | Reviewed-by: Alistair Francis <alistair.francis@wdc.com> | 10 | Reviewed-by: Alistair Francis <alistair.francis@wdc.com> |
5 | Message-id: 20190520214342.13709-2-philmd@redhat.com | 11 | Message-id: 20200518140309.5220-3-f4bug@amsat.org |
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 12 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
7 | --- | 13 | --- |
8 | hw/arm/exynos4_boards.c | 24 ------------------------ | 14 | hw/arm/pxa2xx_gpio.c | 7 ++++--- |
9 | 1 file changed, 24 deletions(-) | 15 | hw/display/pxa2xx_lcd.c | 8 +++++--- |
16 | hw/dma/pxa2xx_dma.c | 14 +++++++++----- | ||
17 | 3 files changed, 18 insertions(+), 11 deletions(-) | ||
10 | 18 | ||
11 | diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c | 19 | diff --git a/hw/arm/pxa2xx_gpio.c b/hw/arm/pxa2xx_gpio.c |
12 | index XXXXXXX..XXXXXXX 100644 | 20 | index XXXXXXX..XXXXXXX 100644 |
13 | --- a/hw/arm/exynos4_boards.c | 21 | --- a/hw/arm/pxa2xx_gpio.c |
14 | +++ b/hw/arm/exynos4_boards.c | 22 | +++ b/hw/arm/pxa2xx_gpio.c |
15 | @@ -XXX,XX +XXX,XX @@ | 23 | @@ -XXX,XX +XXX,XX @@ |
16 | #include "hw/net/lan9118.h" | 24 | |
17 | #include "hw/boards.h" | 25 | #include "qemu/osdep.h" |
18 | 26 | #include "cpu.h" | |
19 | -#undef DEBUG | 27 | -#include "hw/hw.h" |
28 | #include "hw/irq.h" | ||
29 | #include "hw/qdev-properties.h" | ||
30 | #include "hw/sysbus.h" | ||
31 | @@ -XXX,XX +XXX,XX @@ static uint64_t pxa2xx_gpio_read(void *opaque, hwaddr offset, | ||
32 | return s->status[bank]; | ||
33 | |||
34 | default: | ||
35 | - hw_error("%s: Bad offset " REG_FMT "\n", __func__, offset); | ||
36 | + qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad offset 0x%" HWADDR_PRIX "\n", | ||
37 | + __func__, offset); | ||
38 | } | ||
39 | |||
40 | return 0; | ||
41 | @@ -XXX,XX +XXX,XX @@ static void pxa2xx_gpio_write(void *opaque, hwaddr offset, | ||
42 | break; | ||
43 | |||
44 | default: | ||
45 | - hw_error("%s: Bad offset " REG_FMT "\n", __func__, offset); | ||
46 | + qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad offset 0x%" HWADDR_PRIX "\n", | ||
47 | + __func__, offset); | ||
48 | } | ||
49 | } | ||
50 | |||
51 | diff --git a/hw/display/pxa2xx_lcd.c b/hw/display/pxa2xx_lcd.c | ||
52 | index XXXXXXX..XXXXXXX 100644 | ||
53 | --- a/hw/display/pxa2xx_lcd.c | ||
54 | +++ b/hw/display/pxa2xx_lcd.c | ||
55 | @@ -XXX,XX +XXX,XX @@ | ||
56 | */ | ||
57 | |||
58 | #include "qemu/osdep.h" | ||
59 | -#include "hw/hw.h" | ||
60 | +#include "qemu/log.h" | ||
61 | #include "hw/irq.h" | ||
62 | #include "migration/vmstate.h" | ||
63 | #include "ui/console.h" | ||
64 | @@ -XXX,XX +XXX,XX @@ static uint64_t pxa2xx_lcdc_read(void *opaque, hwaddr offset, | ||
65 | |||
66 | default: | ||
67 | fail: | ||
68 | - hw_error("%s: Bad offset " REG_FMT "\n", __func__, offset); | ||
69 | + qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad offset 0x%" HWADDR_PRIX "\n", | ||
70 | + __func__, offset); | ||
71 | } | ||
72 | |||
73 | return 0; | ||
74 | @@ -XXX,XX +XXX,XX @@ static void pxa2xx_lcdc_write(void *opaque, hwaddr offset, | ||
75 | |||
76 | default: | ||
77 | fail: | ||
78 | - hw_error("%s: Bad offset " REG_FMT "\n", __func__, offset); | ||
79 | + qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad offset 0x%" HWADDR_PRIX "\n", | ||
80 | + __func__, offset); | ||
81 | } | ||
82 | } | ||
83 | |||
84 | diff --git a/hw/dma/pxa2xx_dma.c b/hw/dma/pxa2xx_dma.c | ||
85 | index XXXXXXX..XXXXXXX 100644 | ||
86 | --- a/hw/dma/pxa2xx_dma.c | ||
87 | +++ b/hw/dma/pxa2xx_dma.c | ||
88 | @@ -XXX,XX +XXX,XX @@ | ||
89 | */ | ||
90 | |||
91 | #include "qemu/osdep.h" | ||
92 | +#include "qemu/log.h" | ||
93 | #include "hw/hw.h" | ||
94 | #include "hw/irq.h" | ||
95 | #include "hw/qdev-properties.h" | ||
96 | @@ -XXX,XX +XXX,XX @@ static uint64_t pxa2xx_dma_read(void *opaque, hwaddr offset, | ||
97 | unsigned int channel; | ||
98 | |||
99 | if (size != 4) { | ||
100 | - hw_error("%s: Bad access width\n", __func__); | ||
101 | + qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad access width %u\n", | ||
102 | + __func__, size); | ||
103 | return 5; | ||
104 | } | ||
105 | |||
106 | @@ -XXX,XX +XXX,XX @@ static uint64_t pxa2xx_dma_read(void *opaque, hwaddr offset, | ||
107 | return s->chan[channel].cmd; | ||
108 | } | ||
109 | } | ||
20 | - | 110 | - |
21 | -//#define DEBUG | 111 | - hw_error("%s: Bad offset 0x" TARGET_FMT_plx "\n", __func__, offset); |
22 | - | 112 | + qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad offset 0x%" HWADDR_PRIX "\n", |
23 | -#ifdef DEBUG | 113 | + __func__, offset); |
24 | - #undef PRINT_DEBUG | 114 | return 7; |
25 | - #define PRINT_DEBUG(fmt, args...) \ | 115 | } |
26 | - do { \ | 116 | |
27 | - fprintf(stderr, " [%s:%d] "fmt, __func__, __LINE__, ##args); \ | 117 | @@ -XXX,XX +XXX,XX @@ static void pxa2xx_dma_write(void *opaque, hwaddr offset, |
28 | - } while (0) | 118 | unsigned int channel; |
29 | -#else | 119 | |
30 | - #define PRINT_DEBUG(fmt, args...) do {} while (0) | 120 | if (size != 4) { |
31 | -#endif | 121 | - hw_error("%s: Bad access width\n", __func__); |
32 | - | 122 | + qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad access width %u\n", |
33 | #define SMDK_LAN9118_BASE_ADDR 0x05000000 | 123 | + __func__, size); |
34 | 124 | return; | |
35 | typedef enum Exynos4BoardType { | 125 | } |
36 | @@ -XXX,XX +XXX,XX @@ exynos4_boards_init_common(MachineState *machine, | 126 | |
37 | exynos4_board_binfo.gic_cpu_if_addr = | 127 | @@ -XXX,XX +XXX,XX @@ static void pxa2xx_dma_write(void *opaque, hwaddr offset, |
38 | EXYNOS4210_SMP_PRIVATE_BASE_ADDR + 0x100; | 128 | break; |
39 | 129 | } | |
40 | - PRINT_DEBUG("\n ram_size: %luMiB [0x%08lx]\n" | 130 | fail: |
41 | - " kernel_filename: %s\n" | 131 | - hw_error("%s: Bad offset " TARGET_FMT_plx "\n", __func__, offset); |
42 | - " kernel_cmdline: %s\n" | 132 | + qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad offset 0x%" HWADDR_PRIX "\n", |
43 | - " initrd_filename: %s\n", | 133 | + __func__, offset); |
44 | - exynos4_board_ram_size[board_type] / 1048576, | 134 | } |
45 | - exynos4_board_ram_size[board_type], | 135 | } |
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 | 136 | ||
53 | -- | 137 | -- |
54 | 2.20.1 | 138 | 2.20.1 |
55 | 139 | ||
56 | 140 | diff view generated by jsdifflib |
1 | From: Philippe Mathieu-Daudé <philmd@redhat.com> | 1 | From: Philippe Mathieu-Daudé <f4bug@amsat.org> |
---|---|---|---|
2 | 2 | ||
3 | It eases code review, unit is explicit. | 3 | hw_error() calls exit(). This a bit overkill when we can log |
4 | the accesses as unimplemented or guest error. | ||
4 | 5 | ||
5 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> | 6 | When fuzzing the devices, we don't want the whole process to |
7 | exit. Replace some hw_error() calls by qemu_log_mask(). | ||
8 | |||
9 | Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> | ||
10 | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
6 | Reviewed-by: Alistair Francis <alistair.francis@wdc.com> | 11 | Reviewed-by: Alistair Francis <alistair.francis@wdc.com> |
7 | Message-id: 20190520214342.13709-3-philmd@redhat.com | 12 | Message-id: 20200518140309.5220-4-f4bug@amsat.org |
8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 13 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
9 | --- | 14 | --- |
10 | hw/arm/exynos4_boards.c | 5 +++-- | 15 | hw/char/xilinx_uartlite.c | 5 +++-- |
11 | 1 file changed, 3 insertions(+), 2 deletions(-) | 16 | 1 file changed, 3 insertions(+), 2 deletions(-) |
12 | 17 | ||
13 | diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c | 18 | diff --git a/hw/char/xilinx_uartlite.c b/hw/char/xilinx_uartlite.c |
14 | index XXXXXXX..XXXXXXX 100644 | 19 | index XXXXXXX..XXXXXXX 100644 |
15 | --- a/hw/arm/exynos4_boards.c | 20 | --- a/hw/char/xilinx_uartlite.c |
16 | +++ b/hw/arm/exynos4_boards.c | 21 | +++ b/hw/char/xilinx_uartlite.c |
17 | @@ -XXX,XX +XXX,XX @@ | 22 | @@ -XXX,XX +XXX,XX @@ |
18 | */ | 23 | */ |
19 | 24 | ||
20 | #include "qemu/osdep.h" | 25 | #include "qemu/osdep.h" |
21 | +#include "qemu/units.h" | 26 | -#include "hw/hw.h" |
22 | #include "qapi/error.h" | 27 | +#include "qemu/log.h" |
23 | #include "qemu/error-report.h" | 28 | #include "hw/irq.h" |
24 | #include "qemu-common.h" | 29 | #include "hw/qdev-properties.h" |
25 | @@ -XXX,XX +XXX,XX @@ static int exynos4_board_smp_bootreg_addr[EXYNOS4_NUM_OF_BOARDS] = { | 30 | #include "hw/sysbus.h" |
26 | }; | 31 | @@ -XXX,XX +XXX,XX @@ uart_write(void *opaque, hwaddr addr, |
27 | 32 | switch (addr) | |
28 | static unsigned long exynos4_board_ram_size[EXYNOS4_NUM_OF_BOARDS] = { | 33 | { |
29 | - [EXYNOS4_BOARD_NURI] = 0x40000000, | 34 | case R_STATUS: |
30 | - [EXYNOS4_BOARD_SMDKC210] = 0x40000000, | 35 | - hw_error("write to UART STATUS?\n"); |
31 | + [EXYNOS4_BOARD_NURI] = 1 * GiB, | 36 | + qemu_log_mask(LOG_GUEST_ERROR, "%s: write to UART STATUS\n", |
32 | + [EXYNOS4_BOARD_SMDKC210] = 1 * GiB, | 37 | + __func__); |
33 | }; | 38 | break; |
34 | 39 | ||
35 | static struct arm_boot_info exynos4_board_binfo = { | 40 | case R_CTRL: |
36 | -- | 41 | -- |
37 | 2.20.1 | 42 | 2.20.1 |
38 | 43 | ||
39 | 44 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
1 | 2 | ||
3 | hw_error() calls exit(). This a bit overkill when we can log | ||
4 | the accesses as unimplemented or guest error. | ||
5 | |||
6 | When fuzzing the devices, we don't want the whole process to | ||
7 | exit. Replace some hw_error() calls by qemu_log_mask(). | ||
8 | |||
9 | Per the datasheet "Exynos 4412 RISC Microprocessor Rev 1.00" | ||
10 | Chapter 25 "Multi Core Timer (MCT)" figure 1 and table 4, | ||
11 | the default value on the APB bus is 0. | ||
12 | |||
13 | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
14 | Reviewed-by: Alistair Francis <alistair.francis@wdc.com> | ||
15 | Message-id: 20200518140309.5220-5-f4bug@amsat.org | ||
16 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
17 | --- | ||
18 | hw/timer/exynos4210_mct.c | 12 +++++------- | ||
19 | 1 file changed, 5 insertions(+), 7 deletions(-) | ||
20 | |||
21 | diff --git a/hw/timer/exynos4210_mct.c b/hw/timer/exynos4210_mct.c | ||
22 | index XXXXXXX..XXXXXXX 100644 | ||
23 | --- a/hw/timer/exynos4210_mct.c | ||
24 | +++ b/hw/timer/exynos4210_mct.c | ||
25 | @@ -XXX,XX +XXX,XX @@ | ||
26 | |||
27 | #include "qemu/osdep.h" | ||
28 | #include "qemu/log.h" | ||
29 | -#include "hw/hw.h" | ||
30 | #include "hw/sysbus.h" | ||
31 | #include "migration/vmstate.h" | ||
32 | #include "qemu/timer.h" | ||
33 | @@ -XXX,XX +XXX,XX @@ | ||
34 | #include "hw/ptimer.h" | ||
35 | |||
36 | #include "hw/arm/exynos4210.h" | ||
37 | -#include "hw/hw.h" | ||
38 | #include "hw/irq.h" | ||
39 | |||
40 | //#define DEBUG_MCT | ||
41 | @@ -XXX,XX +XXX,XX @@ static uint64_t exynos4210_mct_read(void *opaque, hwaddr offset, | ||
42 | int index; | ||
43 | int shift; | ||
44 | uint64_t count; | ||
45 | - uint32_t value; | ||
46 | + uint32_t value = 0; | ||
47 | int lt_i; | ||
48 | |||
49 | switch (offset) { | ||
50 | @@ -XXX,XX +XXX,XX @@ static uint64_t exynos4210_mct_read(void *opaque, hwaddr offset, | ||
51 | break; | ||
52 | |||
53 | default: | ||
54 | - hw_error("exynos4210.mct: bad read offset " | ||
55 | - TARGET_FMT_plx "\n", offset); | ||
56 | + qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad offset 0x%" HWADDR_PRIX "\n", | ||
57 | + __func__, offset); | ||
58 | break; | ||
59 | } | ||
60 | return value; | ||
61 | @@ -XXX,XX +XXX,XX @@ static void exynos4210_mct_write(void *opaque, hwaddr offset, | ||
62 | break; | ||
63 | |||
64 | default: | ||
65 | - hw_error("exynos4210.mct: bad write offset " | ||
66 | - TARGET_FMT_plx "\n", offset); | ||
67 | + qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad offset 0x%" HWADDR_PRIX "\n", | ||
68 | + __func__, offset); | ||
69 | break; | ||
70 | } | ||
71 | } | ||
72 | -- | ||
73 | 2.20.1 | ||
74 | |||
75 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: Geert Uytterhoeven <geert+renesas@glider.be> | ||
1 | 2 | ||
3 | Add a definition for the number of GPIO lines controlled by a PL061 | ||
4 | instance, and use it instead of the hardcoded magic value 8. | ||
5 | |||
6 | Suggested-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
7 | Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> | ||
8 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
9 | Message-id: 20200519085143.1376-1-geert+renesas@glider.be | ||
10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
11 | --- | ||
12 | hw/gpio/pl061.c | 12 +++++++----- | ||
13 | 1 file changed, 7 insertions(+), 5 deletions(-) | ||
14 | |||
15 | diff --git a/hw/gpio/pl061.c b/hw/gpio/pl061.c | ||
16 | index XXXXXXX..XXXXXXX 100644 | ||
17 | --- a/hw/gpio/pl061.c | ||
18 | +++ b/hw/gpio/pl061.c | ||
19 | @@ -XXX,XX +XXX,XX @@ static const uint8_t pl061_id_luminary[12] = | ||
20 | #define TYPE_PL061 "pl061" | ||
21 | #define PL061(obj) OBJECT_CHECK(PL061State, (obj), TYPE_PL061) | ||
22 | |||
23 | +#define N_GPIOS 8 | ||
24 | + | ||
25 | typedef struct PL061State { | ||
26 | SysBusDevice parent_obj; | ||
27 | |||
28 | @@ -XXX,XX +XXX,XX @@ typedef struct PL061State { | ||
29 | uint32_t cr; | ||
30 | uint32_t amsel; | ||
31 | qemu_irq irq; | ||
32 | - qemu_irq out[8]; | ||
33 | + qemu_irq out[N_GPIOS]; | ||
34 | const unsigned char *id; | ||
35 | uint32_t rsvd_start; /* reserved area: [rsvd_start, 0xfcc] */ | ||
36 | } PL061State; | ||
37 | @@ -XXX,XX +XXX,XX @@ static void pl061_update(PL061State *s) | ||
38 | changed = s->old_out_data ^ out; | ||
39 | if (changed) { | ||
40 | s->old_out_data = out; | ||
41 | - for (i = 0; i < 8; i++) { | ||
42 | + for (i = 0; i < N_GPIOS; i++) { | ||
43 | mask = 1 << i; | ||
44 | if (changed & mask) { | ||
45 | DPRINTF("Set output %d = %d\n", i, (out & mask) != 0); | ||
46 | @@ -XXX,XX +XXX,XX @@ static void pl061_update(PL061State *s) | ||
47 | changed = (s->old_in_data ^ s->data) & ~s->dir; | ||
48 | if (changed) { | ||
49 | s->old_in_data = s->data; | ||
50 | - for (i = 0; i < 8; i++) { | ||
51 | + for (i = 0; i < N_GPIOS; i++) { | ||
52 | mask = 1 << i; | ||
53 | if (changed & mask) { | ||
54 | DPRINTF("Changed input %d = %d\n", i, (s->data & mask) != 0); | ||
55 | @@ -XXX,XX +XXX,XX @@ static void pl061_init(Object *obj) | ||
56 | memory_region_init_io(&s->iomem, obj, &pl061_ops, s, "pl061", 0x1000); | ||
57 | sysbus_init_mmio(sbd, &s->iomem); | ||
58 | sysbus_init_irq(sbd, &s->irq); | ||
59 | - qdev_init_gpio_in(dev, pl061_set_irq, 8); | ||
60 | - qdev_init_gpio_out(dev, s->out, 8); | ||
61 | + qdev_init_gpio_in(dev, pl061_set_irq, N_GPIOS); | ||
62 | + qdev_init_gpio_out(dev, s->out, N_GPIOS); | ||
63 | } | ||
64 | |||
65 | static void pl061_class_init(ObjectClass *klass, void *data) | ||
66 | -- | ||
67 | 2.20.1 | ||
68 | |||
69 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Richard Henderson <richard.henderson@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | The mask implied by the extract is redundant with the one | 3 | The 8-byte store for the end a !is_q operation can be |
4 | implied by the deposit. Also, fix spelling of BFXIL. | 4 | merged with the other stores. Use a no-op vector move |
5 | to trigger the expand_clr portion of tcg_gen_gvec_mov. | ||
5 | 6 | ||
6 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | 7 | Reviewed-by: Alex Bennée <alex.bennee@linaro.org> |
7 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 8 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
8 | Message-id: 20190514011129.11330-3-richard.henderson@linaro.org | 9 | Message-id: 20200519212453.28494-2-richard.henderson@linaro.org |
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
10 | --- | 11 | --- |
11 | target/arm/translate-a64.c | 6 +++--- | 12 | target/arm/translate-a64.c | 10 ++-------- |
12 | 1 file changed, 3 insertions(+), 3 deletions(-) | 13 | 1 file changed, 2 insertions(+), 8 deletions(-) |
13 | 14 | ||
14 | diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c | 15 | diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c |
15 | index XXXXXXX..XXXXXXX 100644 | 16 | index XXXXXXX..XXXXXXX 100644 |
16 | --- a/target/arm/translate-a64.c | 17 | --- a/target/arm/translate-a64.c |
17 | +++ b/target/arm/translate-a64.c | 18 | +++ b/target/arm/translate-a64.c |
18 | @@ -XXX,XX +XXX,XX @@ static void disas_bitfield(DisasContext *s, uint32_t insn) | 19 | @@ -XXX,XX +XXX,XX @@ static void clear_vec_high(DisasContext *s, bool is_q, int rd) |
19 | tcg_gen_extract_i64(tcg_rd, tcg_tmp, ri, len); | 20 | unsigned ofs = fp_reg_offset(s, rd, MO_64); |
20 | return; | 21 | unsigned vsz = vec_full_reg_size(s); |
21 | } | 22 | |
22 | - /* opc == 1, BXFIL fall through to deposit */ | 23 | - if (!is_q) { |
23 | - tcg_gen_extract_i64(tcg_tmp, tcg_tmp, ri, len); | 24 | - TCGv_i64 tcg_zero = tcg_const_i64(0); |
24 | + /* opc == 1, BFXIL fall through to deposit */ | 25 | - tcg_gen_st_i64(tcg_zero, cpu_env, ofs + 8); |
25 | + tcg_gen_shri_i64(tcg_tmp, tcg_tmp, ri); | 26 | - tcg_temp_free_i64(tcg_zero); |
26 | pos = 0; | 27 | - } |
27 | } else { | 28 | - if (vsz > 16) { |
28 | /* Handle the ri > si case with a deposit | 29 | - tcg_gen_gvec_dup_imm(MO_64, ofs + 16, vsz - 16, vsz - 16, 0); |
29 | @@ -XXX,XX +XXX,XX @@ static void disas_bitfield(DisasContext *s, uint32_t insn) | 30 | - } |
30 | len = ri; | 31 | + /* Nop move, with side effect of clearing the tail. */ |
31 | } | 32 | + tcg_gen_gvec_mov(MO_64, ofs, ofs, is_q ? 16 : 8, vsz); |
32 | 33 | } | |
33 | - if (opc == 1) { /* BFM, BXFIL */ | 34 | |
34 | + if (opc == 1) { /* BFM, BFXIL */ | 35 | void write_fp_dreg(DisasContext *s, int reg, TCGv_i64 v) |
35 | tcg_gen_deposit_i64(tcg_rd, tcg_rd, tcg_tmp, pos, len); | ||
36 | } else { | ||
37 | /* SBFM or UBFM: We start with zero, and we haven't modified | ||
38 | -- | 36 | -- |
39 | 2.20.1 | 37 | 2.20.1 |
40 | 38 | ||
41 | 39 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Richard Henderson <richard.henderson@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | This is, after all, how we implement extract2 in tcg/aarch64. | 3 | Do not explicitly store zero to the NEON high part |
4 | when we can pass !is_q to clear_vec_high. | ||
4 | 5 | ||
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 6 | Reviewed-by: Alex Bennée <alex.bennee@linaro.org> |
6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 7 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
7 | Message-id: 20190514011129.11330-2-richard.henderson@linaro.org | 8 | Message-id: 20200519212453.28494-3-richard.henderson@linaro.org |
8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
9 | --- | 10 | --- |
10 | target/arm/translate-a64.c | 38 ++++++++++++++++++++------------------ | 11 | target/arm/translate-a64.c | 53 +++++++++++++++++++++++--------------- |
11 | 1 file changed, 20 insertions(+), 18 deletions(-) | 12 | 1 file changed, 32 insertions(+), 21 deletions(-) |
12 | 13 | ||
13 | diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c | 14 | diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c |
14 | index XXXXXXX..XXXXXXX 100644 | 15 | index XXXXXXX..XXXXXXX 100644 |
15 | --- a/target/arm/translate-a64.c | 16 | --- a/target/arm/translate-a64.c |
16 | +++ b/target/arm/translate-a64.c | 17 | +++ b/target/arm/translate-a64.c |
17 | @@ -XXX,XX +XXX,XX @@ static void disas_extract(DisasContext *s, uint32_t insn) | 18 | @@ -XXX,XX +XXX,XX @@ static void do_fp_ld(DisasContext *s, int destidx, TCGv_i64 tcg_addr, int size) |
18 | } else { | 19 | { |
19 | tcg_gen_ext32u_i64(tcg_rd, cpu_reg(s, rm)); | 20 | /* This always zero-extends and writes to a full 128 bit wide vector */ |
20 | } | 21 | TCGv_i64 tmplo = tcg_temp_new_i64(); |
21 | - } else if (rm == rn) { /* ROR */ | 22 | - TCGv_i64 tmphi; |
22 | - tcg_rm = cpu_reg(s, rm); | 23 | + TCGv_i64 tmphi = NULL; |
23 | - if (sf) { | 24 | |
24 | - tcg_gen_rotri_i64(tcg_rd, tcg_rm, imm); | 25 | if (size < 4) { |
25 | - } else { | 26 | MemOp memop = s->be_data + size; |
26 | - TCGv_i32 tmp = tcg_temp_new_i32(); | 27 | - tmphi = tcg_const_i64(0); |
27 | - tcg_gen_extrl_i64_i32(tmp, tcg_rm); | 28 | tcg_gen_qemu_ld_i64(tmplo, tcg_addr, get_mem_index(s), memop); |
28 | - tcg_gen_rotri_i32(tmp, tmp, imm); | 29 | } else { |
29 | - tcg_gen_extu_i32_i64(tcg_rd, tmp); | 30 | bool be = s->be_data == MO_BE; |
30 | - tcg_temp_free_i32(tmp); | 31 | @@ -XXX,XX +XXX,XX @@ static void do_fp_ld(DisasContext *s, int destidx, TCGv_i64 tcg_addr, int size) |
31 | - } | 32 | } |
32 | } else { | 33 | |
33 | - tcg_rm = read_cpu_reg(s, rm, sf); | 34 | tcg_gen_st_i64(tmplo, cpu_env, fp_reg_offset(s, destidx, MO_64)); |
34 | - tcg_rn = read_cpu_reg(s, rn, sf); | 35 | - tcg_gen_st_i64(tmphi, cpu_env, fp_reg_hi_offset(s, destidx)); |
35 | - tcg_gen_shri_i64(tcg_rm, tcg_rm, imm); | 36 | - |
36 | - tcg_gen_shli_i64(tcg_rn, tcg_rn, bitsize - imm); | 37 | tcg_temp_free_i64(tmplo); |
37 | - tcg_gen_or_i64(tcg_rd, tcg_rm, tcg_rn); | 38 | - tcg_temp_free_i64(tmphi); |
38 | - if (!sf) { | 39 | |
39 | - tcg_gen_ext32u_i64(tcg_rd, tcg_rd); | 40 | - clear_vec_high(s, true, destidx); |
40 | + tcg_rm = cpu_reg(s, rm); | 41 | + if (tmphi) { |
41 | + tcg_rn = cpu_reg(s, rn); | 42 | + tcg_gen_st_i64(tmphi, cpu_env, fp_reg_hi_offset(s, destidx)); |
43 | + tcg_temp_free_i64(tmphi); | ||
44 | + } | ||
45 | + clear_vec_high(s, tmphi != NULL, destidx); | ||
46 | } | ||
47 | |||
48 | /* | ||
49 | @@ -XXX,XX +XXX,XX @@ static void disas_simd_ext(DisasContext *s, uint32_t insn) | ||
50 | read_vec_element(s, tcg_resh, rm, 0, MO_64); | ||
51 | do_ext64(s, tcg_resh, tcg_resl, pos); | ||
52 | } | ||
53 | - tcg_gen_movi_i64(tcg_resh, 0); | ||
54 | } else { | ||
55 | TCGv_i64 tcg_hh; | ||
56 | typedef struct { | ||
57 | @@ -XXX,XX +XXX,XX @@ static void disas_simd_ext(DisasContext *s, uint32_t insn) | ||
58 | |||
59 | write_vec_element(s, tcg_resl, rd, 0, MO_64); | ||
60 | tcg_temp_free_i64(tcg_resl); | ||
61 | - write_vec_element(s, tcg_resh, rd, 1, MO_64); | ||
62 | + if (is_q) { | ||
63 | + write_vec_element(s, tcg_resh, rd, 1, MO_64); | ||
64 | + } | ||
65 | tcg_temp_free_i64(tcg_resh); | ||
66 | - clear_vec_high(s, true, rd); | ||
67 | + clear_vec_high(s, is_q, rd); | ||
68 | } | ||
69 | |||
70 | /* TBL/TBX | ||
71 | @@ -XXX,XX +XXX,XX @@ static void disas_simd_tb(DisasContext *s, uint32_t insn) | ||
72 | * the input. | ||
73 | */ | ||
74 | tcg_resl = tcg_temp_new_i64(); | ||
75 | - tcg_resh = tcg_temp_new_i64(); | ||
76 | + tcg_resh = NULL; | ||
77 | |||
78 | if (is_tblx) { | ||
79 | read_vec_element(s, tcg_resl, rd, 0, MO_64); | ||
80 | } else { | ||
81 | tcg_gen_movi_i64(tcg_resl, 0); | ||
82 | } | ||
83 | - if (is_tblx && is_q) { | ||
84 | - read_vec_element(s, tcg_resh, rd, 1, MO_64); | ||
85 | - } else { | ||
86 | - tcg_gen_movi_i64(tcg_resh, 0); | ||
42 | + | 87 | + |
43 | + if (sf) { | 88 | + if (is_q) { |
44 | + /* Specialization to ROR happens in EXTRACT2. */ | 89 | + tcg_resh = tcg_temp_new_i64(); |
45 | + tcg_gen_extract2_i64(tcg_rd, tcg_rm, tcg_rn, imm); | 90 | + if (is_tblx) { |
46 | + } else { | 91 | + read_vec_element(s, tcg_resh, rd, 1, MO_64); |
47 | + TCGv_i32 t0 = tcg_temp_new_i32(); | 92 | + } else { |
93 | + tcg_gen_movi_i64(tcg_resh, 0); | ||
94 | + } | ||
95 | } | ||
96 | |||
97 | tcg_idx = tcg_temp_new_i64(); | ||
98 | @@ -XXX,XX +XXX,XX @@ static void disas_simd_tb(DisasContext *s, uint32_t insn) | ||
99 | |||
100 | write_vec_element(s, tcg_resl, rd, 0, MO_64); | ||
101 | tcg_temp_free_i64(tcg_resl); | ||
102 | - write_vec_element(s, tcg_resh, rd, 1, MO_64); | ||
103 | - tcg_temp_free_i64(tcg_resh); | ||
104 | - clear_vec_high(s, true, rd); | ||
48 | + | 105 | + |
49 | + tcg_gen_extrl_i64_i32(t0, tcg_rm); | 106 | + if (is_q) { |
50 | + if (rm == rn) { | 107 | + write_vec_element(s, tcg_resh, rd, 1, MO_64); |
51 | + tcg_gen_rotri_i32(t0, t0, imm); | 108 | + tcg_temp_free_i64(tcg_resh); |
52 | + } else { | 109 | + } |
53 | + TCGv_i32 t1 = tcg_temp_new_i32(); | 110 | + clear_vec_high(s, is_q, rd); |
54 | + tcg_gen_extrl_i64_i32(t1, tcg_rn); | 111 | } |
55 | + tcg_gen_extract2_i32(t0, t0, t1, imm); | 112 | |
56 | + tcg_temp_free_i32(t1); | 113 | /* ZIP/UZP/TRN |
57 | + } | 114 | @@ -XXX,XX +XXX,XX @@ static void disas_simd_zip_trn(DisasContext *s, uint32_t insn) |
58 | + tcg_gen_extu_i32_i64(tcg_rd, t0); | ||
59 | + tcg_temp_free_i32(t0); | ||
60 | } | ||
61 | } | ||
62 | } | 115 | } |
116 | |||
117 | tcg_resl = tcg_const_i64(0); | ||
118 | - tcg_resh = tcg_const_i64(0); | ||
119 | + tcg_resh = is_q ? tcg_const_i64(0) : NULL; | ||
120 | tcg_res = tcg_temp_new_i64(); | ||
121 | |||
122 | for (i = 0; i < elements; i++) { | ||
123 | @@ -XXX,XX +XXX,XX @@ static void disas_simd_zip_trn(DisasContext *s, uint32_t insn) | ||
124 | |||
125 | write_vec_element(s, tcg_resl, rd, 0, MO_64); | ||
126 | tcg_temp_free_i64(tcg_resl); | ||
127 | - write_vec_element(s, tcg_resh, rd, 1, MO_64); | ||
128 | - tcg_temp_free_i64(tcg_resh); | ||
129 | - clear_vec_high(s, true, rd); | ||
130 | + | ||
131 | + if (is_q) { | ||
132 | + write_vec_element(s, tcg_resh, rd, 1, MO_64); | ||
133 | + tcg_temp_free_i64(tcg_resh); | ||
134 | + } | ||
135 | + clear_vec_high(s, is_q, rd); | ||
136 | } | ||
137 | |||
138 | /* | ||
63 | -- | 139 | -- |
64 | 2.20.1 | 140 | 2.20.1 |
65 | 141 | ||
66 | 142 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | Using the MSR instruction to write to CPSR.E is deprecated, but it is | ||
2 | required to work from any mode including unprivileged code. We were | ||
3 | incorrectly forbidding usermode code from writing it because | ||
4 | CPSR_USER did not include the CPSR_E bit. | ||
1 | 5 | ||
6 | We use CPSR_USER in only three places: | ||
7 | * as the mask of what to allow userspace MSR to write to CPSR | ||
8 | * when deciding what bits a linux-user signal-return should be | ||
9 | able to write from the sigcontext structure | ||
10 | * in target_user_copy_regs() when we set up the initial | ||
11 | registers for the linux-user process | ||
12 | |||
13 | In the first two cases not being able to update CPSR.E is a bug, and | ||
14 | in the third case it doesn't matter because CPSR.E is always 0 there. | ||
15 | So we can fix both bugs by adding CPSR_E to CPSR_USER. | ||
16 | |||
17 | Because the cpsr_write() in restore_sigcontext() is now changing | ||
18 | a CPSR bit which is cached in hflags, we need to add an | ||
19 | arm_rebuild_hflags() call there; the callsite in | ||
20 | target_user_copy_regs() was already rebuilding hflags for other | ||
21 | reasons. | ||
22 | |||
23 | (The recommended way to change CPSR.E is to use the 'SETEND' | ||
24 | instruction, which we do correctly allow from usermode code.) | ||
25 | |||
26 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
27 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
28 | Message-id: 20200518142801.20503-1-peter.maydell@linaro.org | ||
29 | --- | ||
30 | target/arm/cpu.h | 2 +- | ||
31 | linux-user/arm/signal.c | 1 + | ||
32 | 2 files changed, 2 insertions(+), 1 deletion(-) | ||
33 | |||
34 | diff --git a/target/arm/cpu.h b/target/arm/cpu.h | ||
35 | index XXXXXXX..XXXXXXX 100644 | ||
36 | --- a/target/arm/cpu.h | ||
37 | +++ b/target/arm/cpu.h | ||
38 | @@ -XXX,XX +XXX,XX @@ void pmu_init(ARMCPU *cpu); | ||
39 | #define CACHED_CPSR_BITS (CPSR_T | CPSR_AIF | CPSR_GE | CPSR_IT | CPSR_Q \ | ||
40 | | CPSR_NZCV) | ||
41 | /* Bits writable in user mode. */ | ||
42 | -#define CPSR_USER (CPSR_NZCV | CPSR_Q | CPSR_GE) | ||
43 | +#define CPSR_USER (CPSR_NZCV | CPSR_Q | CPSR_GE | CPSR_E) | ||
44 | /* Execution state bits. MRS read as zero, MSR writes ignored. */ | ||
45 | #define CPSR_EXEC (CPSR_T | CPSR_IT | CPSR_J | CPSR_IL) | ||
46 | |||
47 | diff --git a/linux-user/arm/signal.c b/linux-user/arm/signal.c | ||
48 | index XXXXXXX..XXXXXXX 100644 | ||
49 | --- a/linux-user/arm/signal.c | ||
50 | +++ b/linux-user/arm/signal.c | ||
51 | @@ -XXX,XX +XXX,XX @@ restore_sigcontext(CPUARMState *env, struct target_sigcontext *sc) | ||
52 | #ifdef TARGET_CONFIG_CPU_32 | ||
53 | __get_user(cpsr, &sc->arm_cpsr); | ||
54 | cpsr_write(env, cpsr, CPSR_USER | CPSR_EXEC, CPSRWriteByInstr); | ||
55 | + arm_rebuild_hflags(env); | ||
56 | #endif | ||
57 | |||
58 | err |= !valid_user_regs(env); | ||
59 | -- | ||
60 | 2.20.1 | ||
61 | |||
62 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: Amanieu d'Antras <amanieu@gmail.com> | ||
1 | 2 | ||
3 | This fixes signal handlers running with the wrong endianness if the | ||
4 | interrupted code used SETEND to dynamically switch endianness. | ||
5 | |||
6 | Signed-off-by: Amanieu d'Antras <amanieu@gmail.com> | ||
7 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
8 | Message-id: 20200511131117.2486486-1-amanieu@gmail.com | ||
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
10 | --- | ||
11 | linux-user/arm/signal.c | 8 +++++++- | ||
12 | 1 file changed, 7 insertions(+), 1 deletion(-) | ||
13 | |||
14 | diff --git a/linux-user/arm/signal.c b/linux-user/arm/signal.c | ||
15 | index XXXXXXX..XXXXXXX 100644 | ||
16 | --- a/linux-user/arm/signal.c | ||
17 | +++ b/linux-user/arm/signal.c | ||
18 | @@ -XXX,XX +XXX,XX @@ setup_return(CPUARMState *env, struct target_sigaction *ka, | ||
19 | } else { | ||
20 | cpsr &= ~CPSR_T; | ||
21 | } | ||
22 | + if (env->cp15.sctlr_el[1] & SCTLR_E0E) { | ||
23 | + cpsr |= CPSR_E; | ||
24 | + } else { | ||
25 | + cpsr &= ~CPSR_E; | ||
26 | + } | ||
27 | |||
28 | if (ka->sa_flags & TARGET_SA_RESTORER) { | ||
29 | if (is_fdpic) { | ||
30 | @@ -XXX,XX +XXX,XX @@ setup_return(CPUARMState *env, struct target_sigaction *ka, | ||
31 | env->regs[13] = frame_addr; | ||
32 | env->regs[14] = retcode; | ||
33 | env->regs[15] = handler & (thumb ? ~1 : ~3); | ||
34 | - cpsr_write(env, cpsr, CPSR_IT | CPSR_T, CPSRWriteByInstr); | ||
35 | + cpsr_write(env, cpsr, CPSR_IT | CPSR_T | CPSR_E, CPSRWriteByInstr); | ||
36 | + arm_rebuild_hflags(env); | ||
37 | |||
38 | return 0; | ||
39 | } | ||
40 | -- | ||
41 | 2.20.1 | ||
42 | |||
43 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | The Arm signal-handling code has some parts ifdeffed with a | ||
2 | TARGET_CONFIG_CPU_32, which is always defined. This is a leftover | ||
3 | from when this code's structure was based on the Linux kernel | ||
4 | signal handling code, where it was intended to support 26-bit | ||
5 | Arm CPUs. The kernel dropped its CONFIG_CPU_32 in kernel commit | ||
6 | 4da8b8208eded0ba21e3 in 2009. | ||
1 | 7 | ||
8 | QEMU has never had 26-bit CPU support and is unlikely to ever | ||
9 | add it; we certainly aren't going to support 26-bit Linux | ||
10 | binaries via linux-user mode. The ifdef is just unhelpful | ||
11 | noise, so remove it entirely. | ||
12 | |||
13 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
14 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
15 | Message-id: 20200518143014.20689-1-peter.maydell@linaro.org | ||
16 | --- | ||
17 | linux-user/arm/signal.c | 6 ------ | ||
18 | 1 file changed, 6 deletions(-) | ||
19 | |||
20 | diff --git a/linux-user/arm/signal.c b/linux-user/arm/signal.c | ||
21 | index XXXXXXX..XXXXXXX 100644 | ||
22 | --- a/linux-user/arm/signal.c | ||
23 | +++ b/linux-user/arm/signal.c | ||
24 | @@ -XXX,XX +XXX,XX @@ struct rt_sigframe_v2 | ||
25 | abi_ulong retcode[4]; | ||
26 | }; | ||
27 | |||
28 | -#define TARGET_CONFIG_CPU_32 1 | ||
29 | - | ||
30 | /* | ||
31 | * For ARM syscalls, we encode the syscall number into the instruction. | ||
32 | */ | ||
33 | @@ -XXX,XX +XXX,XX @@ setup_sigcontext(struct target_sigcontext *sc, /*struct _fpstate *fpstate,*/ | ||
34 | __put_user(env->regs[13], &sc->arm_sp); | ||
35 | __put_user(env->regs[14], &sc->arm_lr); | ||
36 | __put_user(env->regs[15], &sc->arm_pc); | ||
37 | -#ifdef TARGET_CONFIG_CPU_32 | ||
38 | __put_user(cpsr_read(env), &sc->arm_cpsr); | ||
39 | -#endif | ||
40 | |||
41 | __put_user(/* current->thread.trap_no */ 0, &sc->trap_no); | ||
42 | __put_user(/* current->thread.error_code */ 0, &sc->error_code); | ||
43 | @@ -XXX,XX +XXX,XX @@ restore_sigcontext(CPUARMState *env, struct target_sigcontext *sc) | ||
44 | __get_user(env->regs[13], &sc->arm_sp); | ||
45 | __get_user(env->regs[14], &sc->arm_lr); | ||
46 | __get_user(env->regs[15], &sc->arm_pc); | ||
47 | -#ifdef TARGET_CONFIG_CPU_32 | ||
48 | __get_user(cpsr, &sc->arm_cpsr); | ||
49 | cpsr_write(env, cpsr, CPSR_USER | CPSR_EXEC, CPSRWriteByInstr); | ||
50 | arm_rebuild_hflags(env); | ||
51 | -#endif | ||
52 | |||
53 | err |= !valid_user_regs(env); | ||
54 | |||
55 | -- | ||
56 | 2.20.1 | ||
57 | |||
58 | diff view generated by jsdifflib |