target-arm queue
Hi; here's a target-arm pull; mostly refactoring and other small stuff.
thanks
-- PMM
The following changes since commit d2e9b78162e31b1eaf20f3a4f563da82da56908d:
Merge tag 'pull-qapi-2025-05-28' of https://repo.or.cz/qemu/armbru into staging (2025-05-29 08:36:01 -0400)
are available in the Git repository at:
https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20250530-2
for you to fetch changes up to e86c1f967a323165d13bcadfad4b92d0d34cdb08:
hw/block: Drop unused nand.c (2025-05-29 17:45:13 +0100)
----------------------------------------------------------------
target-arm queue:
* hw/arm: Add GMAC devices to NPCM8XX SoC
* hw/arm: Add missing psci_conduit to NPCM8XX SoC boot info
* docs/interop: convert text files to restructuredText
* target/arm: Some minor refactorings
* tests/functional: Add a test for the Stellaris arm machines
* hw/block: Drop unused nand.c
----------------------------------------------------------------
Guenter Roeck (1):
hw/arm: Add missing psci_conduit to NPCM8XX SoC boot info
Hao Wu (1):
hw/arm: Add GMAC devices to NPCM8XX SoC
Nabih Estefan (1):
tests/qtest: Migrate GMAC test from 7xx to 8xx
Peter Maydell (1):
hw/block: Drop unused nand.c
Philippe Mathieu-Daudé (9):
target/arm/tcg-stubs: compile file once (system) target/arm/hvf_arm: Avoid using poisoned CONFIG_HVF definition target/arm: Only link with zlib when TCG is enabled target/arm/cpregs: Include missing 'target/arm/cpu.h' header hw/arm/boot: Include missing 'system/memory.h' header target/arm/cpu-features: Include missing 'cpu.h' header target/arm/qmp: Include missing 'cpu.h' header target/arm/kvm: Include missing 'cpu-qom.h' header target/arm/hvf: Include missing 'cpu-qom.h' header
Souleymane Conte (1):
docs/interop: convert text files to restructuredText
Thomas Huth (1):
tests/functional: Add a test for the Stellaris arm machines
MAINTAINERS | 4 +-
docs/interop/bitmaps.rst | 2 +-
docs/interop/index.rst | 1 +
docs/interop/{qcow2.txt => qcow2.rst} | 187 +++++---
docs/qcow2-cache.txt | 2 +-
include/hw/arm/npcm8xx.h | 5 +-
include/hw/block/flash.h | 18 -
target/arm/cpregs.h | 1 +
target/arm/cpu-features.h | 1 +
target/arm/hvf_arm.h | 18 +-
target/arm/kvm_arm.h | 1 +
hw/arm/boot.c | 1 +
hw/arm/npcm8xx.c | 55 ++-
hw/block/nand.c | 835 ---------------------------------
target/arm/arm-qmp-cmds.c | 1 +
target/arm/hvf-stub.c | 20 +
tests/qtest/npcm_gmac-test.c | 85 +++-
hw/arm/Kconfig | 1 -
hw/block/Kconfig | 3 -
hw/block/meson.build | 1 -
target/arm/meson.build | 4 +-
target/arm/tcg/meson.build | 2 +
tests/functional/meson.build | 1 +
tests/functional/test_arm_stellaris.py | 48 ++
tests/qtest/meson.build | 6 +-
25 files changed, 334 insertions(+), 969 deletions(-)
rename docs/interop/{qcow2.txt => qcow2.rst} (89%)
delete mode 100644 hw/block/nand.c
create mode 100644 target/arm/hvf-stub.c
create mode 100755 tests/functional/test_arm_stellaris.py[PULL 06/15] target/arm/hvf_arm: Avoid using poisoned CONFIG_HVF definition
From: Philippe Mathieu-Daudé <[email protected]>
In order to allow non-target specific code to include "hvf_arm.h", define the stubs in hvf-stub.c.
Message-id: [email protected]
--- MAINTAINERS | 1 + target/arm/hvf_arm.h | 16 ---------------- target/arm/hvf-stub.c | 20 ++++++++++++++++++++ target/arm/meson.build | 1 + 4 files changed, 22 insertions(+), 16 deletions(-) create mode 100644 target/arm/hvf-stub.c
MAINTAINERS +1 -0
@@ -510,6 +510,7 @@ Apple Silicon HVF CPUs M: Alexander Graf <[email protected]> S: Maintained F: target/arm/hvf/ +F: target/arm/hvf-stub.c X86 HVF CPUs M: Cameron Esfahani <[email protected]>
target/arm/hvf_arm.h +0 -16
@@ -22,23 +22,7 @@ void hvf_arm_init_debug(void);void hvf_arm_set_cpu_features_from_host (ARMCPU *cpu); -#ifdef CONFIG_HVF -uint32_t hvf_arm_get_default_ipa_bit_size (void );uint32_t hvf_arm_get_max_ipa_bit_size (void ); -#else - -static inline uint32_t hvf_arm_get_default_ipa_bit_size (void ) -{ -return 0 ; -} - -static inline uint32_t hvf_arm_get_max_ipa_bit_size (void ) -{ -return 0 ; -} - -#endif -#endif
target/arm/hvf-stub.c new file +20 -0
@@ -0,0 +1,20 @@ +/* +* QEMU Hypervisor.framework (HVF) stubs for ARM +* +* Copyright (c) Linaro +* +* SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#include "qemu/osdep.h" +#include "hvf_arm.h" + +uint32_t hvf_arm_get_default_ipa_bit_size (void ) +{ +g_assert_not_reached (); +} + +uint32_t hvf_arm_get_max_ipa_bit_size (void ) +{ +g_assert_not_reached (); +}
target/arm/meson.build +1 -0
@@ -32,6 +32,7 @@ arm_common_system_ss.add(files('cpu.c'), capstone) arm_common_system_ss.add(when: 'TARGET_AARCH64', if_false: files( 'cpu32-stubs.c')) arm_common_system_ss.add(when: 'CONFIG_KVM', if_false: files('kvm-stub.c')) +arm_common_system_ss.add(when: 'CONFIG_HVF', if_false: files('hvf-stub.c')) arm_common_system_ss.add(files( 'arch_dump.c', 'arm-powerctl.c',
Signature · 1 line
2.43.0
[PULL 09/15] hw/arm/boot: Include missing 'system/memory.h' header
In reply to Peter MaydellFrom: Philippe Mathieu-Daudé <[email protected]>
default_reset_secondary() uses address_space_stl_notdirty(), itself declared in "system/memory.h". Include this header in order to avoid when refactoring headers:
../hw/arm/boot.c:281:5: error: implicit declaration of function 'address_space_stl_notdirty' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
address_space_stl_notdirty(as, info->smp_bootreg_addr,
^Message-id: [email protected]
--- hw/arm/boot.c | 1 + 1 file changed, 1 insertion(+)
hw/arm/boot.c +1 -0
@@ -19,6 +19,7 @@#include "system/kvm.h" #include "system/tcg.h" #include "system/system.h" +#include "system/memory.h" #include "system/numa.h" #include "hw/boards.h" #include "system/reset.h"
Signature · 1 line
2.43.0
[PULL 14/15] tests/functional: Add a test for the Stellaris arm machines
In reply to Peter MaydellFrom: Thomas Huth <[email protected]>
The 2023 edition of the QEMU advent calendar featured an image that we can use to test whether the lm3s6965evb machine is basically still working.
And for the lm3s811evb there is a small test kernel on github which can be used to check its UART.
Message-id: [email protected]
--- MAINTAINERS | 1 + tests/functional/meson.build | 1 + tests/functional/test_arm_stellaris.py | 48 ++++++++++++++++++++++++++ 3 files changed, 50 insertions(+) create mode 100755 tests/functional/test_arm_stellaris.py
MAINTAINERS +1 -0
@@ -1004,6 +1004,7 @@ F: hw/display/ssd03* F: include/hw/input/gamepad.h F: include/hw/timer/stellaris-gptm.h F: docs/system/arm/stellaris.rst +F: tests/functional/test_arm_stellaris.py STM32L4x5 SoC Family M: Samuel Tardieu <[email protected]>
tests/functional/meson.build +1 -0
@@ -137,6 +137,7 @@ tests_arm_system_thorough = [ 'arm_raspi2', 'arm_replay', 'arm_smdkc210', + 'arm_stellaris', 'arm_sx1', 'arm_vexpress', 'arm_virt',
tests/functional/test_arm_stellaris.py new file +48 -0
48 lines not on this page · raw message
Signature · 1 line
2.43.0
[PULL 01/15] hw/arm: Add GMAC devices to NPCM8XX SoC
In reply to Peter MaydellFrom: Hao Wu <[email protected]>
The GMAC was originally created for the 8xx machine. During upstreaming both the GMAC and the 8XX we removed it so they would not depend on each other for the process, that connection should be added back in.
Message-id: [email protected]
--- include/hw/arm/npcm8xx.h | 5 +++- hw/arm/npcm8xx.c | 54 ++++++++++++++++++++++++++++++++++++---- 2 files changed, 53 insertions(+), 6 deletions(-)
include/hw/arm/npcm8xx.h +4 -1
@@ -28,7 +28,8 @@#include "hw/misc/npcm7xx_mft.h" #include "hw/misc/npcm7xx_pwm.h" #include "hw/misc/npcm7xx_rng.h" -#include "hw/net/npcm7xx_emc.h" +#include "hw/net/npcm_gmac.h" +#include "hw/net/npcm_pcs.h" #include "hw/nvram/npcm7xx_otp.h" #include "hw/sd/npcm7xx_sdhci.h" #include "hw/timer/npcm7xx_timer.h"
@@ -99,6 +100,8 @@ struct NPCM8xxState {EHCISysBusState ehci[2 ];OHCISysBusState ohci[2 ];NPCM7xxFIUState fiu[3 ]; +NPCMGMACState gmac[4 ]; +NPCMPCSState pcs;NPCM7xxSDHCIState mmc;NPCMPSPIState pspi; };
hw/arm/npcm8xx.c +49 -5
91 lines not on this page · raw message
Signature · 1 line
2.43.0
[PULL 07/15] target/arm: Only link with zlib when TCG is enabled
In reply to Peter MaydellFrom: Philippe Mathieu-Daudé <[email protected]>
Since commit 538b764d341 ("target/arm: Move minor arithmetic helpers out of helper.c") we only use the zlib helpers under TCG.
Message-id: [email protected]
--- target/arm/meson.build | 1 - target/arm/tcg/meson.build | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-)
target/arm/meson.build +0 -1
@@ -3,7 +3,6 @@ arm_common_ss = ss.source_set() arm_ss.add(files( 'gdbstub.c', )) -arm_ss.add(zlib) arm_ss.add(when: 'TARGET_AARCH64', if_true: files( 'cpu64.c',
target/arm/tcg/meson.build +2 -0
@@ -56,6 +56,8 @@ arm_system_ss.add(files( arm_system_ss.add(when: 'CONFIG_ARM_V7M', if_true: files('cpu-v7m.c')) arm_user_ss.add(when: 'TARGET_AARCH64', if_false: files('cpu-v7m.c')) +arm_common_ss.add(zlib) + arm_common_ss.add(files( 'arith_helper.c', 'crypto_helper.c',
Signature · 1 line
2.43.0
[PULL 08/15] target/arm/cpregs: Include missing 'target/arm/cpu.h' header
In reply to Peter MaydellFrom: Philippe Mathieu-Daudé <[email protected]>
CPReadFn type definitions use the CPUARMState type, itself declared in "cpu.h". Include this file in order to avoid when refactoring headers:
../target/arm/cpregs.h:241:27: error: unknown type name 'CPUARMState'
typedef uint64_t CPReadFn(CPUARMState *env, const ARMCPRegInfo *opaque);
^Message-id: [email protected]
--- target/arm/cpregs.h | 1 + 1 file changed, 1 insertion(+)
target/arm/cpregs.h +1 -0
@@ -23,6 +23,7 @@#include "hw/registerfields.h" #include "target/arm/kvm-consts.h" +#include "cpu.h" /* * ARMCPRegInfo type field bits:
Signature · 1 line
2.43.0
[PULL 04/15] docs/interop: convert text files to restructuredText
In reply to Peter MaydellFrom: Souleymane Conte <[email protected]>
Message-id: [email protected] [PMM: switched a few more bits of formatting to monospaced;
updated references to qcow2.txt in MAINTAINERS, qcow2-cache.txt and bitmaps.rst]
---
MAINTAINERS | 2 +-
docs/interop/bitmaps.rst | 2 +-
docs/interop/index.rst | 1 +
docs/interop/{qcow2.txt => qcow2.rst} | 187 +++++++++++++++-----------
docs/qcow2-cache.txt | 2 +-
5 files changed, 113 insertions(+), 81 deletions(-)
rename docs/interop/{qcow2.txt => qcow2.rst} (89%)MAINTAINERS +1 -1
@@ -4130,7 +4130,7 @@ M: Hanna Reitz <[email protected]> L: [email protected] S: Supported F: block/qcow2* -F: docs/interop/qcow2.txt +F: docs/interop/qcow2.rst qcow M: Kevin Wolf <[email protected]>
docs/interop/bitmaps.rst +1 -1
@@ -97,7 +97,7 @@ time. - Persistent storage formats may impose their own requirements on bitmap names and namespaces. Presently, only qcow2 supports persistent bitmaps. See - docs/interop/qcow2.txt for more details on restrictions. Notably: + :doc:`qcow2` for more details on restrictions. Notably: - qcow2 bitmap names are limited to between 1 and 1023 bytes long.
docs/interop/index.rst +1 -0
@@ -17,6 +17,7 @@ are useful for making QEMU interoperate with other software. nbd parallels prl-xml + qcow2 pr-helper qmp-spec qemu-ga
docs/interop/qcow2.rst renamed from docs/interop/qcow2.txt +109 -78
495 lines not on this page · raw message
docs/qcow2-cache.txt +1 -1
@@ -15,7 +15,7 @@ not a straightforward operation. This document attempts to give an overview of the L2 and refcount caches, and how to configure them. -Please refer to the docs/interop/qcow2.txt file for an in-depth +Please refer to the docs/interop/qcow2.rst file for an in-depth technical description of the qcow2 file format.
Signature · 1 line
2.43.0
[PULL 13/15] target/arm/hvf: Include missing 'cpu-qom.h' header
In reply to Peter MaydellFrom: Philippe Mathieu-Daudé <[email protected]>
ARMCPU typedef is declared in "cpu-qom.h". Include it in order to avoid when refactoring unrelated headers:
target/arm/hvf_arm.h:23:41: error: unknown type name 'ARMCPU'
23 | void hvf_arm_set_cpu_features_from_host(ARMCPU *cpu);
| ^Message-id: [email protected]
--- target/arm/hvf_arm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
target/arm/hvf_arm.h +1 -1
@@ -11,7 +11,7 @@#ifndef QEMU_HVF_ARM_H #define QEMU_HVF_ARM_H -#include "cpu.h" +#include "target/arm/cpu-qom.h" /** * hvf_arm_init_debug() - initialize guest debug capabilities
Signature · 1 line
2.43.0
[PULL 12/15] target/arm/kvm: Include missing 'cpu-qom.h' header
In reply to Peter MaydellFrom: Philippe Mathieu-Daudé <[email protected]>
ARMCPU typedef is declared in "cpu-qom.h". Include it in order to avoid when refactoring unrelated headers:
target/arm/kvm_arm.h:54:29: error: unknown type name 'ARMCPU'
54 | bool write_list_to_kvmstate(ARMCPU *cpu, int level);
| ^Message-id: [email protected]
--- target/arm/kvm_arm.h | 1 + 1 file changed, 1 insertion(+)
target/arm/kvm_arm.h +1 -0
@@ -12,6 +12,7 @@#define QEMU_KVM_ARM_H #include "system/kvm.h" +#include "target/arm/cpu-qom.h" #define KVM_ARM_VGIC_V2 (1 << 0)#define KVM_ARM_VGIC_V3 (1 << 1)
Signature · 1 line
2.43.0
[PULL 05/15] target/arm/tcg-stubs: compile file once (system)
In reply to Peter MaydellFrom: Philippe Mathieu-Daudé <[email protected]>
Message-id: [email protected]
--- target/arm/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
target/arm/meson.build +1 -1
@@ -48,7 +48,7 @@ subdir('hvf') if 'CONFIG_TCG' in config_all_accel subdir('tcg') else - arm_ss.add(files('tcg-stubs.c')) + arm_common_system_ss.add(files('tcg-stubs.c')) endif target_arch += {'arm': arm_ss}
Signature · 1 line
2.43.0
[PULL 15/15] hw/block: Drop unused nand.c
In reply to Peter MaydellThe nand.c device (TYPE_NAND) is an emulation of a NAND flash memory chip which was used by the old OMAP boards. No current QEMU board uses it, and although techically "-device nand,chip-id=0x6b" doesn't error out, it's not possible to usefully use it from the command line because the only interface it has is via calling C functions like nand_setpins() and nand_setio().
The "config OMAP" stanza (used only by the SX1 board) is the only thing that does "select NAND" to compile in this code, but the SX1 board doesn't actually use the NAND device.
Remove the NAND device code entirely; this is effectively leftover cleanup from when we dropped the PXA boards and the OMAP boards other than the sx1.
Message-id: [email protected]
--- include/hw/block/flash.h | 18 - hw/block/nand.c | 835 --------------------------------------- hw/arm/Kconfig | 1 - hw/block/Kconfig | 3 - hw/block/meson.build | 1 - 5 files changed, 858 deletions(-) delete mode 100644 hw/block/nand.c
include/hw/block/flash.h +0 -18
@@ -44,24 +44,6 @@ PFlashCFI02 *pflash_cfi02_register(hwaddr base,uint16_t unlock_addr1, int be); -/* nand.c */ -DeviceState *nand_init (BlockBackend *blk,int manf_id,int chip_id); -void nand_setpins (DeviceState *dev,uint8_t cle,uint8_t ale, -uint8_t ce,uint8_t wp,uint8_t gnd); -void nand_getpins (DeviceState *dev,int *rb); -void nand_setio (DeviceState *dev,uint32_t value); -uint32_t nand_getio (DeviceState *dev); -uint32_t nand_getbuswidth (DeviceState *dev); - -#define NAND_MFR_TOSHIBA 0x98 -#define NAND_MFR_SAMSUNG 0xec -#define NAND_MFR_FUJITSU 0x04 -#define NAND_MFR_NATIONAL 0x8f -#define NAND_MFR_RENESAS 0x07 -#define NAND_MFR_STMICRO 0x20 -#define NAND_MFR_HYNIX 0xad -#define NAND_MFR_MICRON 0x2c -/* m25p80.c */ #define TYPE_M25P80 "m25p80-generic"
hw/block/nand.c deleted +0 -835
835 lines not on this page · raw message
hw/arm/Kconfig +0 -1
@@ -147,7 +147,6 @@ config OMAP bool select FRAMEBUFFER select I2C - select NAND select PFLASH_CFI01 select SD select SERIAL_MM
hw/block/Kconfig +0 -3
@@ -13,9 +13,6 @@ config FDC_SYSBUS config SSI_M25P80 bool -config NAND - bool - config PFLASH_CFI01 bool
hw/block/meson.build +0 -1
@@ -6,7 +6,6 @@ system_ss.add(files( system_ss.add(when: 'CONFIG_FDC', if_true: files('fdc.c')) system_ss.add(when: 'CONFIG_FDC_ISA', if_true: files('fdc-isa.c')) system_ss.add(when: 'CONFIG_FDC_SYSBUS', if_true: files('fdc-sysbus.c')) -system_ss.add(when: 'CONFIG_NAND', if_true: files('nand.c')) system_ss.add(when: 'CONFIG_PFLASH_CFI01', if_true: files('pflash_cfi01.c')) system_ss.add(when: 'CONFIG_PFLASH_CFI02', if_true: files('pflash_cfi02.c')) system_ss.add(when: 'CONFIG_SSI_M25P80', if_true: files('m25p80.c'))
Signature · 1 line
2.43.0
[PULL 10/15] target/arm/cpu-features: Include missing 'cpu.h' header
In reply to Peter MaydellFrom: Philippe Mathieu-Daudé <[email protected]>
"target/arm/cpu-features.h" dereferences the ARMISARegisters structure, which is defined in "cpu.h". Include the latter to avoid when refactoring unrelated headers:
In file included from target/arm/internals.h:33:
target/arm/cpu-features.h:45:54: error: unknown type name 'ARMISARegisters'
45 | static inline bool isar_feature_aa32_thumb_div(const ARMISARegisters *id)
| ^
target/arm/cpu-features.h:47:12: error: use of undeclared identifier 'R_ID_ISAR0_DIVIDE_SHIFT'
47 | return FIELD_EX32(id->id_isar0, ID_ISAR0, DIVIDE) != 0;
| ^Message-id: [email protected]
--- target/arm/cpu-features.h | 1 + 1 file changed, 1 insertion(+)
target/arm/cpu-features.h +1 -0
@@ -22,6 +22,7 @@#include "hw/registerfields.h" #include "qemu/host-utils.h" +#include "cpu.h" /* * Naming convention for isar_feature functions:
Signature · 1 line
2.43.0
[PULL 11/15] target/arm/qmp: Include missing 'cpu.h' header
In reply to Peter MaydellFrom: Philippe Mathieu-Daudé <[email protected]>
arm-qmp-cmds.c uses ARM_MAX_VQ, which is defined in "cpu.h". Include the latter to avoid when refactoring unrelated headers:
target/arm/arm-qmp-cmds.c:83:19: error: use of undeclared identifier 'ARM_MAX_VQ'
83 | QEMU_BUILD_BUG_ON(ARM_MAX_VQ > 16);
| ^Message-id: [email protected]
--- target/arm/arm-qmp-cmds.c | 1 + 1 file changed, 1 insertion(+)
target/arm/arm-qmp-cmds.c +1 -0
@@ -30,6 +30,7 @@#include "qapi/qapi-commands-misc-arm.h" #include "qobject/qdict.h" #include "qom/qom-qobject.h" +#include "cpu.h" static GICCapability *gic_cap_new (int version) {
Signature · 1 line
2.43.0
[PULL 03/15] hw/arm: Add missing psci_conduit to NPCM8XX SoC boot info
In reply to Peter MaydellFrom: Guenter Roeck <[email protected]>
Without psci_conduit, the Linux kernel crashes almost immediately.
psci: probing for conduit method from DT.
Internal error: Oops - Undefined instruction: 0000000002000000 [#1] PREEMPT SMP
Message-id: [email protected]
--- hw/arm/npcm8xx.c | 1 + 1 file changed, 1 insertion(+)
hw/arm/npcm8xx.c +1 -0
@@ -365,6 +365,7 @@ static struct arm_boot_info npcm8xx_binfo = { .secure_boot = false, .board_id = -1, .board_setup_addr = NPCM8XX_BOARD_SETUP_ADDR, + .psci_conduit = QEMU_PSCI_CONDUIT_SMC, };void npcm8xx_load_kernel (MachineState *machine,NPCM8xxState *soc)
Signature · 1 line
2.43.0
[PULL 02/15] tests/qtest: Migrate GMAC test from 7xx to 8xx
In reply to Peter MaydellFrom: Nabih Estefan <[email protected]>
For upstreaming we migrated this test to 7xx (since that was already upstream) move it back to 8xx where it can check the 4 GMACs since that is the board this test was originally created for.
Message-id: [email protected]
--- tests/qtest/npcm_gmac-test.c | 85 ++++++++++++++++++++++++++++++++++-- tests/qtest/meson.build | 6 ++- 2 files changed, 86 insertions(+), 5 deletions(-)
tests/qtest/npcm_gmac-test.c +82 -3
@@ -36,7 +36,7 @@ typedef struct TestData {const GMACModule *module; } TestData; -/* Values extracted from hw/arm/npcm7xx.c */ +/* Values extracted from hw/arm/npcm8xx.c */ static const GMACModule gmac_module_list[] = { { .irq =14 ,
@@ -46,6 +46,14 @@ static const GMACModule gmac_module_list[] = { .irq = 15, .base_addr = 0xf0804000 }, + { + .irq = 16, + .base_addr = 0xf0806000 + }, + { + .irq = 17, + .base_addr = 0xf0808000 + } };/* Returns the index of the GMAC module. */
@@ -174,18 +182,32 @@ static uint32_t gmac_read(QTestState *qts, const GMACModule *mod,return qtest_readl (qts, mod->base_addr + regno); } +static uint16_t pcs_read (QTestState *qts,const GMACModule *mod, +NPCMRegister regno) +{ +uint32_t write_value = (regno &0x3ffe00 ) >>9 ; +qtest_writel (qts,PCS_BASE_ADDRESS +NPCM_PCS_IND_AC_BA , write_value); +uint32_t read_offset = regno &0x1ff ; +return qtest_readl (qts,PCS_BASE_ADDRESS + read_offset); +} +/* Check that GMAC registers are reset to default value */ static void test_init (gconstpointer test_data) {const TestData *td = test_data;const GMACModule *mod = td->module; -QTestState *qts =qtest_init ("-machine npcm750-evb" ); +QTestState *qts =qtest_init ("-machine npcm845-evb" );#define CHECK_REG32 (regno, value) \ do { \ g_assert_cmphex(gmac_read(qts, mod, (regno)), ==, (value)); \ } while (0) +#define CHECK_REG_PCS (regno, value) \ + do { \ + g_assert_cmphex(pcs_read(qts, mod, (regno)), ==, (value)); \ + } while (0) +CHECK_REG32 (NPCM_DMA_BUS_MODE ,0x00020100 );CHECK_REG32 (NPCM_DMA_XMT_POLL_DEMAND ,0 );CHECK_REG32 (NPCM_DMA_RCV_POLL_DEMAND ,0 );
@@ -235,6 +257,63 @@ static void test_init(gconstpointer test_data)CHECK_REG32 (NPCM_GMAC_PTP_TAR ,0 );CHECK_REG32 (NPCM_GMAC_PTP_TTSR ,0 ); +if (mod->base_addr ==0xf0802000 ) { +CHECK_REG_PCS (NPCM_PCS_SR_CTL_ID1 ,0x699e ); +CHECK_REG_PCS (NPCM_PCS_SR_CTL_ID2 ,0 ); +CHECK_REG_PCS (NPCM_PCS_SR_CTL_STS ,0x8000 ); + +CHECK_REG_PCS (NPCM_PCS_SR_MII_CTRL ,0x1140 ); +CHECK_REG_PCS (NPCM_PCS_SR_MII_STS ,0x0109 ); +CHECK_REG_PCS (NPCM_PCS_SR_MII_DEV_ID1 ,0x699e ); +CHECK_REG_PCS (NPCM_PCS_SR_MII_DEV_ID2 ,0x0ced0 ); +CHECK_REG_PCS (NPCM_PCS_SR_MII_AN_ADV ,0x0020 ); +CHECK_REG_PCS (NPCM_PCS_SR_MII_LP_BABL ,0 ); +CHECK_REG_PCS (NPCM_PCS_SR_MII_AN_EXPN ,0 ); +CHECK_REG_PCS (NPCM_PCS_SR_MII_EXT_STS ,0xc000 ); + +CHECK_REG_PCS (NPCM_PCS_SR_TIM_SYNC_ABL ,0x0003 ); +CHECK_REG_PCS (NPCM_PCS_SR_TIM_SYNC_TX_MAX_DLY_LWR ,0x0038 ); +CHECK_REG_PCS (NPCM_PCS_SR_TIM_SYNC_TX_MAX_DLY_UPR ,0 ); +CHECK_REG_PCS (NPCM_PCS_SR_TIM_SYNC_TX_MIN_DLY_LWR ,0x0038 ); +CHECK_REG_PCS (NPCM_PCS_SR_TIM_SYNC_TX_MIN_DLY_UPR ,0 ); +CHECK_REG_PCS (NPCM_PCS_SR_TIM_SYNC_RX_MAX_DLY_LWR ,0x0058 ); +CHECK_REG_PCS (NPCM_PCS_SR_TIM_SYNC_RX_MAX_DLY_UPR ,0 ); +CHECK_REG_PCS (NPCM_PCS_SR_TIM_SYNC_RX_MIN_DLY_LWR ,0x0048 ); +CHECK_REG_PCS (NPCM_PCS_SR_TIM_SYNC_RX_MIN_DLY_UPR ,0 ); + +CHECK_REG_PCS (NPCM_PCS_VR_MII_MMD_DIG_CTRL1 ,0x2400 ); +CHECK_REG_PCS (NPCM_PCS_VR_MII_AN_CTRL ,0 ); +CHECK_REG_PCS (NPCM_PCS_VR_MII_AN_INTR_STS ,0x000a ); +CHECK_REG_PCS (NPCM_PCS_VR_MII_TC ,0 ); +CHECK_REG_PCS (NPCM_PCS_VR_MII_DBG_CTRL ,0 ); +CHECK_REG_PCS (NPCM_PCS_VR_MII_EEE_MCTRL0 ,0x899c ); +CHECK_REG_PCS (NPCM_PCS_VR_MII_EEE_TXTIMER ,0 ); +CHECK_REG_PCS (NPCM_PCS_VR_MII_EEE_RXTIMER ,0 ); +CHECK_REG_PCS (NPCM_PCS_VR_MII_LINK_TIMER_CTRL ,0 ); +CHECK_REG_PCS (NPCM_PCS_VR_MII_EEE_MCTRL1 ,0 ); +CHECK_REG_PCS (NPCM_PCS_VR_MII_DIG_STS ,0x0010 ); +CHECK_REG_PCS (NPCM_PCS_VR_MII_ICG_ERRCNT1 ,0 ); +CHECK_REG_PCS (NPCM_PCS_VR_MII_MISC_STS ,0 ); +CHECK_REG_PCS (NPCM_PCS_VR_MII_RX_LSTS ,0 ); +CHECK_REG_PCS (NPCM_PCS_VR_MII_MP_TX_BSTCTRL0 ,0x00a ); +CHECK_REG_PCS (NPCM_PCS_VR_MII_MP_TX_LVLCTRL0 ,0x007f ); +CHECK_REG_PCS (NPCM_PCS_VR_MII_MP_TX_GENCTRL0 ,0x0001 ); +CHECK_REG_PCS (NPCM_PCS_VR_MII_MP_TX_GENCTRL1 ,0 ); +CHECK_REG_PCS (NPCM_PCS_VR_MII_MP_TX_STS ,0 ); +CHECK_REG_PCS (NPCM_PCS_VR_MII_MP_RX_GENCTRL0 ,0x0100 ); +CHECK_REG_PCS (NPCM_PCS_VR_MII_MP_RX_GENCTRL1 ,0x1100 ); +CHECK_REG_PCS (NPCM_PCS_VR_MII_MP_RX_LOS_CTRL0 ,0x000e ); +CHECK_REG_PCS (NPCM_PCS_VR_MII_MP_MPLL_CTRL0 ,0x0100 ); +CHECK_REG_PCS (NPCM_PCS_VR_MII_MP_MPLL_CTRL1 ,0x0032 ); +CHECK_REG_PCS (NPCM_PCS_VR_MII_MP_MPLL_STS ,0x0001 ); +CHECK_REG_PCS (NPCM_PCS_VR_MII_MP_MISC_CTRL2 ,0 ); +CHECK_REG_PCS (NPCM_PCS_VR_MII_MP_LVL_CTRL ,0x0019 ); +CHECK_REG_PCS (NPCM_PCS_VR_MII_MP_MISC_CTRL0 ,0 ); +CHECK_REG_PCS (NPCM_PCS_VR_MII_MP_MISC_CTRL1 ,0 ); +CHECK_REG_PCS (NPCM_PCS_VR_MII_DIG_CTRL2 ,0 ); +CHECK_REG_PCS (NPCM_PCS_VR_MII_DIG_ERRCNT_SEL ,0 ); + } +qtest_quit (qts); }
@@ -242,7 +321,7 @@ static void gmac_add_test(const char *name, const TestData* td, GTestDataFunc fn) { g_autofree char *full_name = g_strdup_printf( -"npcm7xx_gmac/gmac[%d]/%s" ,gmac_module_index (td->module), name); +"npcm8xx_gmac/gmac[%d]/%s" ,gmac_module_index (td->module), name);qtest_add_data_func (full_name, td, fn); }
tests/qtest/meson.build +4 -2
@@ -208,9 +208,10 @@ qtests_npcm7xx = \ 'npcm7xx_sdhci-test', 'npcm7xx_smbus-test', 'npcm7xx_timer-test', - 'npcm7xx_watchdog_timer-test', - 'npcm_gmac-test'] + \ + 'npcm7xx_watchdog_timer-test'] + \ (slirp.found() ? ['npcm7xx_emc-test'] : []) +qtests_npcm8xx = \ + ['npcm_gmac-test'] qtests_aspeed = \ ['aspeed_gpio-test', 'aspeed_hace-test',
@@ -259,6 +260,7 @@ qtests_aarch64 = \ (config_all_accel.has_key('CONFIG_TCG') and \ config_all_devices.has_key('CONFIG_TPM_TIS_I2C') ? ['tpm-tis-i2c-test'] : []) + \ (config_all_devices.has_key('CONFIG_ASPEED_SOC') ? qtests_aspeed64 : []) + \ + (config_all_devices.has_key('CONFIG_NPCM8XX') ? qtests_npcm8xx : []) + \ ['arm-cpu-features', 'numa-test', 'boot-serial-test',
Signature · 1 line
2.43.0
Stefan Hajnoczi
AppliedApplied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/10.1 for any user-visible changes.