Hexagon system emulation - Part 3/3
v3 cover Hexagon system emulation - Part 3/3
This is Part 3 of the hexagon system emulation (sysemu) patch series, adding the hw/hexagon board and machine support that ties together the target infrastructure from Parts 1 and 2.
This part adds:
- Global register model (hexagon_globalreg) for shared system registers across hardware threads
- Global register tracing support
- Machine configuration infrastructure and sa8775-cdsp0 definition
- cfgbase support for hardware configuration base address
- hexagon-softmmu build configuration (Kconfig, meson, default.mak)
- The hexagon "virt" machine definition
- A boot-serial qtest for hexagon
Changes since v2:
- Dropped l2vic interrupt controller and QTimer device (deferred to a future series)
- Removed hvx_contexts field and hvx-contexts property (HVX context management deferred to a future series)
- arch_*_system_reg callers now go through globalreg_read/write directly (the abstraction layer from Part 2 v2 is no longer introduced)
- Adapted to tip's header renames (hw/*.h -> hw/core/*.h)
Previous versions:
v2: https://lore.kernel.org/qemu-devel/[email protected]/
v1: https://lore.kernel.org/qemu-devel/[email protected]/
Brian Cain (8):
hw/hexagon: Add globalreg model
hw/hexagon: Add global register tracing
hw/hexagon: Add machine configs for sysemu
hw/hexagon: Add v68, sa8775-cdsp0 defs
hw/hexagon: Modify "Standalone" symbols
target/hexagon: add build config for softmmu
hw/hexagon: Define hexagon "virt" machine
tests/qtest: Add hexagon boot-serial-test
Sid Manning (1):
hw/hexagon: Add support for cfgbase
MAINTAINERS | 3 + configs/devices/hexagon-softmmu/default.mak | 8 + configs/targets/hexagon-softmmu.mak | 7 + meson.build | 1 + include/hw/hexagon/hexagon.h | 150 +++++++ include/hw/hexagon/hexagon_globalreg.h | 56 +++ include/hw/hexagon/virt.h | 43 ++ target/hexagon/cpu.h | 4 - hw/hexagon/machine_cfg_sa8775_cdsp0.h.inc | 64 +++ hw/hexagon/machine_cfg_v66g_1024.h.inc | 64 +++ hw/hexagon/machine_cfg_v68n_1024.h.inc | 65 +++ hw/hexagon/hexagon_dsp.c | 182 ++++++++ hw/hexagon/hexagon_globalreg.c | 313 ++++++++++++++ hw/hexagon/virt.c | 453 ++++++++++++++++++++ system/qdev-monitor.c | 2 +- target/hexagon/cpu.c | 1 - target/hexagon/translate.c | 1 + tests/qtest/boot-serial-test.c | 8 + hw/Kconfig | 1 + hw/hexagon/Kconfig | 15 + hw/hexagon/meson.build | 8 + hw/hexagon/trace-events | 3 + hw/meson.build | 1 + target/Kconfig | 1 + target/hexagon/Kconfig | 2 + target/hexagon/meson.build | 13 +- tests/qemu-iotests/testenv.py | 1 + tests/qtest/meson.build | 2 + 28 files changed, 1465 insertions(+), 7 deletions(-) create mode 100644 configs/devices/hexagon-softmmu/default.mak create mode 100644 configs/targets/hexagon-softmmu.mak create mode 100644 include/hw/hexagon/hexagon.h create mode 100644 include/hw/hexagon/hexagon_globalreg.h create mode 100644 include/hw/hexagon/virt.h create mode 100644 hw/hexagon/machine_cfg_sa8775_cdsp0.h.inc create mode 100644 hw/hexagon/machine_cfg_v66g_1024.h.inc create mode 100644 hw/hexagon/machine_cfg_v68n_1024.h.inc create mode 100644 hw/hexagon/hexagon_dsp.c create mode 100644 hw/hexagon/hexagon_globalreg.c create mode 100644 hw/hexagon/virt.c create mode 100644 hw/hexagon/Kconfig create mode 100644 hw/hexagon/meson.build create mode 100644 hw/hexagon/trace-events create mode 100644 target/hexagon/Kconfig
Signature · 1 line
2.34.1
PATCH v3 1/9 hw/hexagon: Add globalreg model
Some of the system registers are shared among all threads in the core. This object contains the representation and interface to the system registers.
--- include/hw/hexagon/hexagon_globalreg.h | 56 ++++++ hw/hexagon/hexagon_globalreg.c | 240 +++++++++++++++++++++++++ 2 files changed, 296 insertions(+) create mode 100644 include/hw/hexagon/hexagon_globalreg.h create mode 100644 hw/hexagon/hexagon_globalreg.c
include/hw/hexagon/hexagon_globalreg.h new file +56 -0
@@ -0,0 +1,56 @@ +/* +* Hexagon Global Registers QOM Object +* +* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. +* SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#ifndef HEXAGON_GLOBALREG_H +#define HEXAGON_GLOBALREG_H + +#include "hw/core/qdev.h" +#include "hw/core/sysbus.h" +#include "qom/object.h" +#include "target/hexagon/cpu.h" + +#define TYPE_HEXAGON_GLOBALREG "hexagon-globalreg" +OBJECT_DECLARE_SIMPLE_TYPE(HexagonGlobalRegState, HEXAGON_GLOBALREG) + +struct HexagonGlobalRegState { +SysBusDevice parent_obj; + +/* Array of system registers */ +uint32_t regs[NUM_SREGS ]; + +/* Global performance cycle counter base */ +uint64_t g_pcycle_base; + +/* Properties for global register reset values */ +uint32_t boot_evb;/* Boot Exception Vector Base (HEX_SREG_EVB) */ +uint64_t config_table_addr;/* Configuration table base */ +uint32_t dsp_rev;/* DSP revision register (HEX_SREG_REV) */ + +/* ISDB properties */ +bool isdben_etm_enable;/* ISDB ETM enable bit */ +bool isdben_dfd_enable;/* ISDB DFD enable bit */ +bool isdben_trusted;/* ISDB trusted mode bit */ +bool isdben_secure;/* ISDB secure mode bit */ +}; + +/* Public interface functions */ +uint32_t hexagon_globalreg_read (HexagonGlobalRegState *s,uint32_t reg, +uint32_t htid); +void hexagon_globalreg_write (HexagonGlobalRegState *s,uint32_t reg, +uint32_t value,uint32_t htid); +uint32_t hexagon_globalreg_masked_value (HexagonGlobalRegState *s,uint32_t reg, +uint32_t value); +void hexagon_globalreg_write_masked (HexagonGlobalRegState *s,uint32_t reg, +uint32_t value); +void hexagon_globalreg_reset (HexagonGlobalRegState *s); + +/* Global performance cycle counter access */ +uint64_t hexagon_globalreg_get_pcycle_base (HexagonGlobalRegState *s); +void hexagon_globalreg_set_pcycle_base (HexagonGlobalRegState *s, +uint64_t value); + +#endif /* HEXAGON_GLOBALREG_H */
hw/hexagon/hexagon_globalreg.c new file +240 -0
240 lines not on this page · raw message
Signature · 1 line
2.34.1
Re: [PATCH v3 1/9] hw/hexagon: Add globalreg model
Quoted 50 lines · Brian Cain
Some of the system registers are shared among all threads in the core. This object contains the representation and interface to the system registers.
Signed-off-by Brian Cain <[email protected]>--- include/hw/hexagon/hexagon_globalreg.h | 56 ++++++ hw/hexagon/hexagon_globalreg.c | 240 +++++++++++++++++++++++++ 2 files changed, 296 insertions(+) create mode 100644 include/hw/hexagon/hexagon_globalreg.h create mode 100644 hw/hexagon/hexagon_globalreg.cinclude/hw/hexagon/hexagon_globalreg.h new file +29
-0@@ -0,0 +1,56 @@ +/* +* Hexagon Global Registers QOM Object +* +* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. +* SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#ifndef HEXAGON_GLOBALREG_H +#define HEXAGON_GLOBALREG_H + +#include "hw/core/qdev.h" +#include "hw/core/sysbus.h" +#include "qom/object.h" +#include "target/hexagon/cpu.h" + +#define TYPE_HEXAGON_GLOBALREG "hexagon-globalreg" +OBJECT_DECLARE_SIMPLE_TYPE(HexagonGlobalRegState, HEXAGON_GLOBALREG) + +struct HexagonGlobalRegState { + SysBusDevice parent_obj; + + /* Array of system registers */ + uint32_t regs[NUM_SREGS]; + + /* Global performance cycle counter base */ + uint64_t g_pcycle_base; + + /* Properties for global register reset values */ + uint32_t boot_evb; /* Boot Exception Vector Base(
HEX_SREG_EVB) */
include/hw/hexagon/hexagon_globalreg.h line 37
Quoted 8 lines
include/hw/hexagon/hexagon_globalreg.h new file +8
-0+uint64_t config_table_addr;/* Configuration table base */ +uint32_t dsp_rev;/* DSP revision register (HEX_SREG_REV) */ + +/* ISDB properties */ +bool isdben_etm_enable;/* ISDB ETM enable bit */ +bool isdben_dfd_enable;/* ISDB DFD enable bit */ +bool isdben_trusted;/* ISDB trusted mode bit */ +bool isdben_secure;/* ISDB secure mode bit */
Should the TLB entries go in here also?
include/hw/hexagon/hexagon_globalreg.h line 42
Quoted 6 lines
include/hw/hexagon/hexagon_globalreg.h new file +5
-0+}; + +/* Public interface functions */ +uint32_t hexagon_globalreg_read (HexagonGlobalRegState *s,uint32_t reg, +uint32_t htid);
Why is htid needed?
include/hw/hexagon/hexagon_globalreg.h line 44
Quoted 3 lines
include/hw/hexagon/hexagon_globalreg.h new file +2
-0+void hexagon_globalreg_write (HexagonGlobalRegState *s,uint32_t reg, +uint32_t value,uint32_t htid);
Ditto
Quoted 22 lines
+uint32_t hexagon_globalreg_masked_value(HexagonGlobalRegState *s,
uint32_treg,include/hw/hexagon/hexagon_globalreg.h new file +2
-0+ uint32_t value); +void hexagon_globalreg_write_masked(HexagonGlobalRegState *s, uint32_treg,
include/hw/hexagon/hexagon_globalreg.h new file +9
-0+ uint32_t value); +void hexagon_globalreg_reset (HexagonGlobalRegState *s); + +/* Global performance cycle counter access */ +uint64_t hexagon_globalreg_get_pcycle_base (HexagonGlobalRegState *s); +void hexagon_globalreg_set_pcycle_base (HexagonGlobalRegState *s, +uint64_t value); + +#endif /* HEXAGON_GLOBALREG_H */ hw/hexagon/hexagon_globalreg.c new file +0
-0
hw/hexagon/hexagon_globalreg.c line 5
Quoted 5 lines
hw/hexagon/hexagon_globalreg.c new file +5
-0@@ -0,0 +1,240 @@ +static void hexagon_globalreg_init (Object *obj) +{ +HexagonGlobalRegState *s =HEXAGON_GLOBALREG (obj); + +memset (s->regs,0 ,sizeof (uint32_t ) *NUM_SREGS );
Should we memset the whole thing?
Quoted 3 lines
hw/hexagon/hexagon_globalreg.c new file +1
-0+}
Re: [PATCH v3 1/9] hw/hexagon: Add globalreg model
Quoted 55 lines · Taylor Simpson
Quoted 51 lines · Brian Cain
Some of the system registers are shared among all threads in the core. This object contains the representation and interface to the system registers.
Signed-off-by Brian Cain <[email protected]>--- include/hw/hexagon/hexagon_globalreg.h | 56 ++++++ hw/hexagon/hexagon_globalreg.c | 240 +++++++++++++++++++++++++ 2 files changed, 296 insertions(+) create mode 100644 include/hw/hexagon/hexagon_globalreg.h create mode 100644 hw/hexagon/hexagon_globalreg.cinclude/hw/hexagon/hexagon_globalreg.h new file +32
-0@@ -0,0 +1,56 @@ +/* +* Hexagon Global Registers QOM Object +* +* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. +* SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#ifndef HEXAGON_GLOBALREG_H +#define HEXAGON_GLOBALREG_H + +#include "hw/core/qdev.h" +#include "hw/core/sysbus.h" +#include "qom/object.h" +#include "target/hexagon/cpu.h" + +#define TYPE_HEXAGON_GLOBALREG "hexagon-globalreg" +OBJECT_DECLARE_SIMPLE_TYPE(HexagonGlobalRegState, HEXAGON_GLOBALREG) + +struct HexagonGlobalRegState { + SysBusDevice parent_obj; + + /* Array of system registers */ + uint32_t regs[NUM_SREGS]; + + /* Global performance cycle counter base */ + uint64_t g_pcycle_base; + + /* Properties for global register reset values */ + uint32_t boot_evb; /* Boot Exception Vector Base (HEX_SREG_EVB) */ + uint64_t config_table_addr; /* Configuration table base */ + uint32_t dsp_rev; /* DSP revision register (HEX_SREG_REV) */ +
Quoted 8 lines
include/hw/hexagon/hexagon_globalreg.h line 37
Quoted 5 lines
include/hw/hexagon/hexagon_globalreg.h new file +5
-0+/* ISDB properties */ +bool isdben_etm_enable;/* ISDB ETM enable bit */ +bool isdben_dfd_enable;/* ISDB DFD enable bit */ +bool isdben_trusted;/* ISDB trusted mode bit */ +bool isdben_secure;/* ISDB secure mode bit */ Should the TLB entries go in here also?
No, the TLB entries are a property of the TLB device, not the global registers.
Quoted 8 lines
include/hw/hexagon/hexagon_globalreg.h line 42
Quoted 5 lines
include/hw/hexagon/hexagon_globalreg.h new file +5
-0+}; + +/* Public interface functions */ +uint32_t hexagon_globalreg_read (HexagonGlobalRegState *s,uint32_t reg, +uint32_t htid);Why is htid needed?
It's not strictly needed - it was Phil's suggestion to make it easier to follow. We can omit it if preferred:
https://lore.kernel.org/qemu-devel/[email protected]/
Quoted 25 lines
include/hw/hexagon/hexagon_globalreg.h line 44
Quoted 2 lines
include/hw/hexagon/hexagon_globalreg.h new file +2
-0+void hexagon_globalreg_write (HexagonGlobalRegState *s,uint32_t reg, +uint32_t value,uint32_t htid);Ditto
Quoted 19 lines
include/hw/hexagon/hexagon_globalreg.h new file +12
-0+uint32_t hexagon_globalreg_masked_value (HexagonGlobalRegState *s,uint32_t reg, +uint32_t value); +void hexagon_globalreg_write_masked (HexagonGlobalRegState *s,uint32_t reg, +uint32_t value); +void hexagon_globalreg_reset (HexagonGlobalRegState *s); + +/* Global performance cycle counter access */ +uint64_t hexagon_globalreg_get_pcycle_base (HexagonGlobalRegState *s); +void hexagon_globalreg_set_pcycle_base (HexagonGlobalRegState *s, +uint64_t value); + +#endif /* HEXAGON_GLOBALREG_H */ hw/hexagon/hexagon_globalreg.c new file +0
-0@@ -0,0 +1,240 @@
Quoted 8 lines
hw/hexagon/hexagon_globalreg.c line 55
Quoted 5 lines
hw/hexagon/hexagon_globalreg.c new file +5
-0+static void hexagon_globalreg_init (Object *obj) +{ +HexagonGlobalRegState *s =HEXAGON_GLOBALREG (obj); + +memset (s->regs,0 ,sizeof (uint32_t ) *NUM_SREGS );Should we memset the whole thing?
I don't think so: I believe that this would corrupt the parent fields of the QEMU object model.
Quoted 3 lines
Quoted 3 lines
hw/hexagon/hexagon_globalreg.c new file +1
-0+}
PATCH v3 2/9 hw/hexagon: Add global register tracing
In reply to Brian Cain--- meson.build | 1 + hw/hexagon/hexagon_globalreg.c | 73 ++++++++++++++++++++++++++++++++++ hw/hexagon/trace-events | 3 ++ 3 files changed, 77 insertions(+) create mode 100644 hw/hexagon/trace-events
meson.build +1 -0
@@ -3633,6 +3633,7 @@ if have_system 'hw/display', 'hw/dma', 'hw/fsi', + 'hw/hexagon', 'hw/hyperv', 'hw/i2c', 'hw/i3c',
hw/hexagon/hexagon_globalreg.c +73 -0
96 lines not on this page · raw message
hw/hexagon/trace-events new file +3 -0
@@ -0,0 +1,3 @@ +# Hexagon global register access +hexagon_globalreg_read(uint32_t htid, const char *reg_name, uint32_t value) "htid=%u reg=%s value=0x%x" +hexagon_globalreg_write(uint32_t htid, const char *reg_name, uint32_t value) "htid=%u reg=%s value=0x%x"
Signature · 1 line
2.34.1
Re: [PATCH v3 2/9] hw/hexagon: Add global register tracing
Quoted 15 lines · Brian Cain
Reviewed-by Philippe Mathieu-Daudé <[email protected]>Signed-off-by Brian Cain <[email protected]>--- meson.build | 1 + hw/hexagon/hexagon_globalreg.c | 73 ++++++++++++++++++++++++++++++++++ hw/hexagon/trace-events | 3 ++ 3 files changed, 77 insertions(+)create mode 100644 hw/hexagon/trace-events
hw/hexagon/hexagon_globalreg.c +0
-0
hw/hexagon/hexagon_globalreg.c line 19
Quoted 4 lines
hw/hexagon/hexagon_globalreg.c +1
-0@@ -16,11 +16,82 @@#include "target/hexagon/cpu.h" #include "target/hexagon/hex_regs.h" #include "qemu/log.h" +#include "trace/trace-hw_hexagon.h"
cat << 'EOF > hw/hexagon/trace.h
/* SPDX-License-Identifier: GPL-2.0-or-later */
#include "trace/trace-hw_hexagon.h"
EOF
Then #include "trace.h".
With that:
Quoted 4 lines
hw/hexagon/hexagon_globalreg.c +0
-0#include "qapi/error.h" #define IMMUTABLE (~0)#define INVALID_REG_VAL 0xdeadbeef
Re: [PATCH v3 2/9] hw/hexagon: Add global register tracing
In reply to Brian CainQuoted 31 lines · Brian Cain
Reviewed-by Philippe Mathieu-Daudé <[email protected]>Signed-off-by Brian Cain <[email protected]>--- meson.build | 1 + hw/hexagon/hexagon_globalreg.c | 73 ++++++++++++++++++++++++++++++++++ hw/hexagon/trace-events | 3 ++ 3 files changed, 77 insertions(+) create mode 100644 hw/hexagon/trace-eventsmeson.build +1
-0@@ -3633,6 +3633,7 @@ if have_system 'hw/display', 'hw/dma', 'hw/fsi', + 'hw/hexagon', 'hw/hyperv', 'hw/i2c', 'hw/i3c',hw/hexagon/hexagon_globalreg.c +1
-0@@ -16,11 +16,82 @@#include "target/hexagon/cpu.h" #include "target/hexagon/hex_regs.h" #include "qemu/log.h" +#include "trace/trace-hw_hexagon.h"
hw/hexagon/hexagon_globalreg.c line 29
Quoted 10 lines
hw/hexagon/hexagon_globalreg.c +4
-0#include "qapi/error.h" #define IMMUTABLE (~0)#define INVALID_REG_VAL 0xdeadbeef +static const char *hex_sreg_names[] = { + [HEX_SREG_SGP0 ] ="sgp0" , + [HEX_SREG_SGP1 ] ="sgp1" , + [HEX_SREG_STID ] ="stid" ,
Why not use the array in cpu.c from an earlier patch?
PATCH v3 3/9 hw/hexagon: Add machine configs for sysemu
In reply to Brian CainFrom: Brian Cain <[email protected]>
Some header includes are modified here: these are uniquely required for basic system emulation functionality and had not been required for linux-user.
--- MAINTAINERS | 2 + include/hw/hexagon/hexagon.h | 150 +++++++++++++++++++++++ hw/hexagon/machine_cfg_v66g_1024.h.inc | 64 ++++++++++ hw/hexagon/hexagon_dsp.c | 157 +++++++++++++++++++++++++ system/qdev-monitor.c | 2 +- target/hexagon/translate.c | 1 + hw/Kconfig | 1 + hw/hexagon/Kconfig | 5 + hw/hexagon/meson.build | 6 + hw/meson.build | 1 + 10 files changed, 388 insertions(+), 1 deletion(-) create mode 100644 include/hw/hexagon/hexagon.h create mode 100644 hw/hexagon/machine_cfg_v66g_1024.h.inc create mode 100644 hw/hexagon/hexagon_dsp.c create mode 100644 hw/hexagon/Kconfig create mode 100644 hw/hexagon/meson.build
MAINTAINERS +2 -0
@@ -245,6 +245,8 @@ Hexagon TCG CPUs M: Brian Cain <[email protected]> S: Supported F: target/hexagon/ +F: hw/hexagon/ +F: include/hw/hexagon/ X: target/hexagon/idef-parser/ X: target/hexagon/gen_idef_parser_funcs.py F: linux-user/hexagon/
include/hw/hexagon/hexagon.h new file +150 -0
150 lines not on this page · raw message
hw/hexagon/machine_cfg_v66g_1024.h.inc new file +64 -0
64 lines not on this page · raw message
hw/hexagon/hexagon_dsp.c new file +157 -0
157 lines not on this page · raw message
system/qdev-monitor.c +1 -1
@@ -69,7 +69,7 @@ typedef struct QDevAlias QEMU_ARCH_SPARC | \ QEMU_ARCH_XTENSA)#define QEMU_ARCH_VIRTIO_CCW (QEMU_ARCH_S390X) -#define QEMU_ARCH_VIRTIO_MMIO (QEMU_ARCH_M68K) +#define QEMU_ARCH_VIRTIO_MMIO (QEMU_ARCH_M68K | QEMU_ARCH_HEXAGON)/* Please keep this table sorted by typename. */ static const QDevAlias qdev_alias_table[] = {
target/hexagon/translate.c +1 -0
@@ -32,6 +32,7 @@#include "translate.h" #include "genptr.h" #include "printinsn.h" +#include "exec/target_page.h" #define HELPER_H "helper.h"#include "exec/helper-info.c.inc"
hw/Kconfig +1 -0
@@ -54,6 +54,7 @@ source arm/Kconfig source cpu/Kconfig source alpha/Kconfig source avr/Kconfig +source hexagon/Kconfig source hppa/Kconfig source i386/Kconfig source loongarch/Kconfig
hw/hexagon/Kconfig new file +5 -0
@@ -0,0 +1,5 @@ +config HEX_DSP + bool + default y + depends on HEXAGON && TCG + imply PTIMER
hw/hexagon/meson.build new file +6 -0
@@ -0,0 +1,6 @@ +hexagon_ss = ss.source_set() +hexagon_ss.add(files('hexagon_tlb.c')) +hexagon_ss.add(files('hexagon_globalreg.c')) +hexagon_ss.add(when: 'CONFIG_HEX_DSP', if_true: files('hexagon_dsp.c')) + +hw_arch += {'hexagon': hexagon_ss}
hw/meson.build +1 -0
@@ -3,6 +3,7 @@ subdir('alpha') subdir('arm') subdir('avr') subdir('hppa') +subdir('hexagon') subdir('xenpv') # i386 uses it subdir('i386') subdir('loongarch')
Signature · 1 line
2.34.1
PATCH v3 4/9 hw/hexagon: Add v68, sa8775-cdsp0 defs
In reply to Brian CainFrom: Brian Cain <[email protected]>
--- hw/hexagon/machine_cfg_sa8775_cdsp0.h.inc | 64 ++++++++++++++++++++++ hw/hexagon/machine_cfg_v68n_1024.h.inc | 65 +++++++++++++++++++++++ 2 files changed, 129 insertions(+) create mode 100644 hw/hexagon/machine_cfg_sa8775_cdsp0.h.inc create mode 100644 hw/hexagon/machine_cfg_v68n_1024.h.inc
hw/hexagon/machine_cfg_sa8775_cdsp0.h.inc new file +64 -0
@@ -0,0 +1,64 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +static struct hexagon_machine_config SA8775P_cdsp0 = { + .cfgbase = 0x24000000 + 0x180000, + .l2tcm_size = 0x00000000, + .l2vic_base = 0x26300000 + 0x90000, + .l2vic_size = 0x00001000, + .csr_base = 0x26300000, + .qtmr_region = 0x26300000 + 0xA1000, + .cfgtable = { + .l2tcm_base = 0x00002400, + .reserved0 = 0x00000000, + .subsystem_base = 0x00002638, + .etm_base = 0x00002419, + .l2cfg_base = 0x0000241a, + .reserved1 = 0x0000241b, + .l1s0_base = 0x00002500, + .axi2_lowaddr = 0x00000000, + .streamer_base = 0x00000000, + .reserved2 = 0x00000000, + .fastl2vic_base = 0x0000241e, + .jtlb_size_entries = 0x00000080, + .coproc_present = 0x00000001, + .ext_contexts = 0x00000004, + .vtcm_base = 0x00002500, + .vtcm_size_kb = 0x00002000, + .l2tag_size = 0x00000400, + .l2ecomem_size = 0x00000000, + .thread_enable_mask = 0x0000003f, + .eccreg_base = 0x0000241f, + .l2line_size = 0x00000080, + .tiny_core = 0x00000000, + .l2itcm_size = 0x00000000, + .l2itcm_base = 0x00002400, + .reserved3 = 0x00000000, + .dtm_present = 0x00000000, + .dma_version = 0x00000003, + .hvx_vec_log_length = 0x00000007, + .core_id = 0x00000000, + .core_count = 0x00000000, + .coproc2_reg0 = 0x00000040, + .coproc2_reg1 = 0x00000020, + .v2x_mode = 0x00000001, + .coproc2_reg2 = 0x00000008, + .coproc2_reg3 = 0x00000020, + .coproc2_reg4 = 0x00000000, + .coproc2_reg5 = 0x00000002, + .coproc2_reg6 = 0x00000016, + .coproc2_reg7 = 0x00000006, + .acd_preset = 0x00000001, + .mnd_preset = 0x00000000, + .l1d_size_kb = 0x00000010, + .l1i_size_kb = 0x00000020, + .l1d_write_policy = 0x00000002, + .vtcm_bank_width = 0x00000080, + .reserved4 = 0x00000001, + .reserved5 = 0x00000000, + .reserved6 = 0x00000003, + .coproc2_cvt_mpy_size = 0x0000000a, + .consistency_domain = 0x000000e0, + .capacity_domain = 0x00000080, + .axi3_lowaddr = 0x00000000, + }, +};
hw/hexagon/machine_cfg_v68n_1024.h.inc new file +65 -0
65 lines not on this page · raw message
Signature · 1 line
2.34.1
Re: [PATCH v3 4/9] hw/hexagon: Add v68, sa8775-cdsp0 defs
Quoted 17 lines · Brian Cain
From: Brian Cain <[email protected]>
Acked-by Taylor Simpson <[email protected]>Signed-off-by Brian Cain <[email protected]>--- hw/hexagon/machine_cfg_sa8775_cdsp0.h.inc | 64 ++++++++++++++++++++++ hw/hexagon/machine_cfg_v68n_1024.h.inc | 65 +++++++++++++++++++++++ 2 files changed, 129 insertions(+)create mode 100644 hw/hexagon/machine_cfg_sa8775_cdsp0.h.inc create mode 100644 hw/hexagon/machine_cfg_v68n_1024.h.inc
hw/hexagon/machine_cfg_sa8775_cdsp0.h.inc new file +0
-0
hw/hexagon/machine_cfg_sa8775_cdsp0.h.inc line 3
Quoted 3 lines
hw/hexagon/machine_cfg_sa8775_cdsp0.h.inc new file +3
-0@@ -0,0 +1,64 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +static
const
struct hexagon_machine_config SA8775P_cdsp0 = {
Quoted 67 lines
hw/hexagon/machine_cfg_sa8775_cdsp0.h.inc new file +61
-0+ .cfgbase = 0x24000000 + 0x180000, + .l2tcm_size = 0x00000000, + .l2vic_base = 0x26300000 + 0x90000, + .l2vic_size = 0x00001000, + .csr_base = 0x26300000, + .qtmr_region = 0x26300000 + 0xA1000, + .cfgtable = { + .l2tcm_base = 0x00002400, + .reserved0 = 0x00000000, + .subsystem_base = 0x00002638, + .etm_base = 0x00002419, + .l2cfg_base = 0x0000241a, + .reserved1 = 0x0000241b, + .l1s0_base = 0x00002500, + .axi2_lowaddr = 0x00000000, + .streamer_base = 0x00000000, + .reserved2 = 0x00000000, + .fastl2vic_base = 0x0000241e, + .jtlb_size_entries = 0x00000080, + .coproc_present = 0x00000001, + .ext_contexts = 0x00000004, + .vtcm_base = 0x00002500, + .vtcm_size_kb = 0x00002000, + .l2tag_size = 0x00000400, + .l2ecomem_size = 0x00000000, + .thread_enable_mask = 0x0000003f, + .eccreg_base = 0x0000241f, + .l2line_size = 0x00000080, + .tiny_core = 0x00000000, + .l2itcm_size = 0x00000000, + .l2itcm_base = 0x00002400, + .reserved3 = 0x00000000, + .dtm_present = 0x00000000, + .dma_version = 0x00000003, + .hvx_vec_log_length = 0x00000007, + .core_id = 0x00000000, + .core_count = 0x00000000, + .coproc2_reg0 = 0x00000040, + .coproc2_reg1 = 0x00000020, + .v2x_mode = 0x00000001, + .coproc2_reg2 = 0x00000008, + .coproc2_reg3 = 0x00000020, + .coproc2_reg4 = 0x00000000, + .coproc2_reg5 = 0x00000002, + .coproc2_reg6 = 0x00000016, + .coproc2_reg7 = 0x00000006, + .acd_preset = 0x00000001, + .mnd_preset = 0x00000000, + .l1d_size_kb = 0x00000010, + .l1i_size_kb = 0x00000020, + .l1d_write_policy = 0x00000002, + .vtcm_bank_width = 0x00000080, + .reserved4 = 0x00000001, + .reserved5 = 0x00000000, + .reserved6 = 0x00000003, + .coproc2_cvt_mpy_size = 0x0000000a, + .consistency_domain = 0x000000e0, + .capacity_domain = 0x00000080, + .axi3_lowaddr = 0x00000000, + }, +};hw/hexagon/machine_cfg_v68n_1024.h.inc new file +0
-0
hw/hexagon/machine_cfg_v68n_1024.h.inc line 3
Quoted 3 lines
hw/hexagon/machine_cfg_v68n_1024.h.inc new file +3
-0@@ -0,0 +1,65 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +static struct hexagon_machine_config v68n_1024 = {
Ditto.
Quoted 52 lines
hw/hexagon/machine_cfg_v68n_1024.h.inc new file +52
-0+ .cfgbase = 0xde000000, + .l2tcm_size = 0x00000000, + .l2vic_base = 0xfc910000, + .l2vic_size = 0x00001000, + .csr_base = 0xfc900000, + .qtmr_region = 0xfc921000, + .cfgtable = { + .l2tcm_base = 0x0000d800, + .reserved0 = 0x00000000, + .subsystem_base = 0x0000fc90, + .etm_base = 0x0000d819, + .l2cfg_base = 0x0000d81a, + .reserved1 = 0x00000000, + .l1s0_base = 0x0000d840, + .axi2_lowaddr = 0x00003000, + .streamer_base = 0x0000d81c, + .reserved2 = 0x0000d81d, + .fastl2vic_base = 0x0000d81e, + .jtlb_size_entries = 0x00000080, + .coproc_present = 0x00000001, + .ext_contexts = 0x00000004, + .vtcm_base = 0x0000d840, + .vtcm_size_kb = 0x00001000, + .l2tag_size = 0x00000400, + .l2ecomem_size = 0x00000400, + .thread_enable_mask = 0x0000003f, + .eccreg_base = 0x0000d81f, + .l2line_size = 0x00000080, + .tiny_core = 0x00000000, + .l2itcm_size = 0x00000000, + .l2itcm_base = 0x0000d820, + .reserved3 = 0x00000000, + .dtm_present = 0x00000000, + .dma_version = 0x00000001, + .hvx_vec_log_length = 0x00000007, + .core_id = 0x00000000, + .core_count = 0x00000000, + .coproc2_reg0 = 0x00000040, + .coproc2_reg1 = 0x00000020, + .v2x_mode = 0x1f1f1f1f, + .coproc2_reg2 = 0x1f1f1f1f, + .coproc2_reg3 = 0x1f1f1f1f, + .coproc2_reg4 = 0x1f1f1f1f, + .coproc2_reg5 = 0x1f1f1f1f, + .coproc2_reg6 = 0x1f1f1f1f, + .coproc2_reg7 = 0x1f1f1f1f, + .acd_preset = 0x1f1f1f1f, + .mnd_preset = 0x1f1f1f1f, + .l1d_size_kb = 0x1f1f1f1f, + .l1i_size_kb = 0x1f1f1f1f, + .l1d_write_policy = 0x1f1f1f1f, + .vtcm_bank_width = 0x1f1f1f1f,
hw/hexagon/machine_cfg_v68n_1024.h.inc line 65
Quoted 10 lines
hw/hexagon/machine_cfg_v68n_1024.h.inc new file +10
-0+ .reserved4 = 0x1f1f1f1f, + .reserved5 = 0x1f1f1f1f, + .reserved6 = 0x1f1f1f1f, + .coproc2_cvt_mpy_size = 0x1f1f1f1f, + .consistency_domain = 0x1f1f1f1f, + .capacity_domain = 0x1f1f1f1f, + .axi3_lowaddr = 0x1f1f1f1f, + }, +}; +
Are these configs generated?
Re: [PATCH v3 4/9] hw/hexagon: Add v68, sa8775-cdsp0 defs
Quoted 156 lines · Philippe Mathieu-Daudé
Quoted 4 lines · Brian Cain
From: Brian Cain <[email protected]>
Acked-by Taylor Simpson <[email protected]>Signed-off-by Brian Cain <[email protected]>Review
Quoted 8 lines
--- hw/hexagon/machine_cfg_sa8775_cdsp0.h.inc | 64 ++++++++++++++++++++++ hw/hexagon/machine_cfg_v68n_1024.h.inc | 65 +++++++++++++++++++++++ 2 files changed, 129 insertions(+)create mode 100644 hw/hexagon/machine_cfg_sa8775_cdsp0.h.inc create mode 100644 hw/hexagon/machine_cfg_v68n_1024.h.inc
(quoted diff) +0
-0b/hw/hexagon/machine_cfg_sa8775_cdsp0.h.inc
hw/hexagon/machine_cfg_sa8775_cdsp0.h.inc line 3
Quoted 8 lines
new file mode 100644
index 00000000000..3d787c104ffhw/hexagon/machine_cfg_sa8775_cdsp0.h.inc new file +3
-0@@ -0,0 +1,64 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +staticconst
struct hexagon_machine_config SA8775P_cdsp0 = {Review
Quoted 62 lines
hw/hexagon/machine_cfg_sa8775_cdsp0.h.inc new file +61
-0+ .cfgbase = 0x24000000 + 0x180000, + .l2tcm_size = 0x00000000, + .l2vic_base = 0x26300000 + 0x90000, + .l2vic_size = 0x00001000, + .csr_base = 0x26300000, + .qtmr_region = 0x26300000 + 0xA1000, + .cfgtable = { + .l2tcm_base = 0x00002400, + .reserved0 = 0x00000000, + .subsystem_base = 0x00002638, + .etm_base = 0x00002419, + .l2cfg_base = 0x0000241a, + .reserved1 = 0x0000241b, + .l1s0_base = 0x00002500, + .axi2_lowaddr = 0x00000000, + .streamer_base = 0x00000000, + .reserved2 = 0x00000000, + .fastl2vic_base = 0x0000241e, + .jtlb_size_entries = 0x00000080, + .coproc_present = 0x00000001, + .ext_contexts = 0x00000004, + .vtcm_base = 0x00002500, + .vtcm_size_kb = 0x00002000, + .l2tag_size = 0x00000400, + .l2ecomem_size = 0x00000000, + .thread_enable_mask = 0x0000003f, + .eccreg_base = 0x0000241f, + .l2line_size = 0x00000080, + .tiny_core = 0x00000000, + .l2itcm_size = 0x00000000, + .l2itcm_base = 0x00002400, + .reserved3 = 0x00000000, + .dtm_present = 0x00000000, + .dma_version = 0x00000003, + .hvx_vec_log_length = 0x00000007, + .core_id = 0x00000000, + .core_count = 0x00000000, + .coproc2_reg0 = 0x00000040, + .coproc2_reg1 = 0x00000020, + .v2x_mode = 0x00000001, + .coproc2_reg2 = 0x00000008, + .coproc2_reg3 = 0x00000020, + .coproc2_reg4 = 0x00000000, + .coproc2_reg5 = 0x00000002, + .coproc2_reg6 = 0x00000016, + .coproc2_reg7 = 0x00000006, + .acd_preset = 0x00000001, + .mnd_preset = 0x00000000, + .l1d_size_kb = 0x00000010, + .l1i_size_kb = 0x00000020, + .l1d_write_policy = 0x00000002, + .vtcm_bank_width = 0x00000080, + .reserved4 = 0x00000001, + .reserved5 = 0x00000000, + .reserved6 = 0x00000003, + .coproc2_cvt_mpy_size = 0x0000000a, + .consistency_domain = 0x000000e0, + .capacity_domain = 0x00000080, + .axi3_lowaddr = 0x00000000, + }, +};(quoted diff) +0
-0b/hw/hexagon/machine_cfg_v68n_1024.h.inc
hw/hexagon/machine_cfg_v68n_1024.h.inc line 3
Quoted 8 lines
new file mode 100644
index 00000000000..734a12a2f12hw/hexagon/machine_cfg_v68n_1024.h.inc new file +3
-0@@ -0,0 +1,65 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +static struct hexagon_machine_config v68n_1024 = {Ditto.
Quoted 56 lines
hw/hexagon/machine_cfg_v68n_1024.h.inc new file +56
-0+ .cfgbase = 0xde000000, + .l2tcm_size = 0x00000000, + .l2vic_base = 0xfc910000, + .l2vic_size = 0x00001000, + .csr_base = 0xfc900000, + .qtmr_region = 0xfc921000, + .cfgtable = { + .l2tcm_base = 0x0000d800, + .reserved0 = 0x00000000, + .subsystem_base = 0x0000fc90, + .etm_base = 0x0000d819, + .l2cfg_base = 0x0000d81a, + .reserved1 = 0x00000000, + .l1s0_base = 0x0000d840, + .axi2_lowaddr = 0x00003000, + .streamer_base = 0x0000d81c, + .reserved2 = 0x0000d81d, + .fastl2vic_base = 0x0000d81e, + .jtlb_size_entries = 0x00000080, + .coproc_present = 0x00000001, + .ext_contexts = 0x00000004, + .vtcm_base = 0x0000d840, + .vtcm_size_kb = 0x00001000, + .l2tag_size = 0x00000400, + .l2ecomem_size = 0x00000400, + .thread_enable_mask = 0x0000003f, + .eccreg_base = 0x0000d81f, + .l2line_size = 0x00000080, + .tiny_core = 0x00000000, + .l2itcm_size = 0x00000000, + .l2itcm_base = 0x0000d820, + .reserved3 = 0x00000000, + .dtm_present = 0x00000000, + .dma_version = 0x00000001, + .hvx_vec_log_length = 0x00000007, + .core_id = 0x00000000, + .core_count = 0x00000000, + .coproc2_reg0 = 0x00000040, + .coproc2_reg1 = 0x00000020, + .v2x_mode = 0x1f1f1f1f, + .coproc2_reg2 = 0x1f1f1f1f, + .coproc2_reg3 = 0x1f1f1f1f, + .coproc2_reg4 = 0x1f1f1f1f, + .coproc2_reg5 = 0x1f1f1f1f, + .coproc2_reg6 = 0x1f1f1f1f, + .coproc2_reg7 = 0x1f1f1f1f, + .acd_preset = 0x1f1f1f1f, + .mnd_preset = 0x1f1f1f1f, + .l1d_size_kb = 0x1f1f1f1f, + .l1i_size_kb = 0x1f1f1f1f, + .l1d_write_policy = 0x1f1f1f1f, + .vtcm_bank_width = 0x1f1f1f1f, + .reserved4 = 0x1f1f1f1f, + .reserved5 = 0x1f1f1f1f, + .reserved6 = 0x1f1f1f1f, + .coproc2_cvt_mpy_size = 0x1f1f1f1f,
Quoted 9 lines
hw/hexagon/machine_cfg_v68n_1024.h.inc line 65
Quoted 6 lines
hw/hexagon/machine_cfg_v68n_1024.h.inc new file +6
-0+ .consistency_domain = 0x1f1f1f1f, + .capacity_domain = 0x1f1f1f1f, + .axi3_lowaddr = 0x1f1f1f1f, + }, +}; +Are these configs generated?
No - but they are taken via a dump from a donor system.
PATCH v3 5/9 hw/hexagon: Add support for cfgbase
In reply to Brian CainFrom: Sid Manning <[email protected]>
--- hw/hexagon/hexagon_dsp.c | 10 ++++++++++ target/hexagon/cpu.c | 1 - 2 files changed, 10 insertions(+), 1 deletion(-)
hw/hexagon/hexagon_dsp.c +10 -0
@@ -82,6 +82,12 @@ static void hexagon_common_init(MachineState *machine, Rev_t rev,MemoryRegion *address_space =get_system_memory (); +MemoryRegion *config_table_rom =g_new (MemoryRegion,1 ); +memory_region_init_rom (config_table_rom,NULL ,"config_table.rom" , +sizeof (m_cfg->cfgtable), &error_fatal); +memory_region_add_subregion (address_space, m_cfg->cfgbase, + config_table_rom); +MemoryRegion *sram =g_new (MemoryRegion,1 );memory_region_init_ram (sram,NULL ,"ddr.ram" , machine->ram_size, &error_fatal);
@@ -110,6 +116,10 @@ static void hexagon_common_init(MachineState *machine, Rev_t rev, } } + +rom_add_blob_fixed_as ("config_table.rom" , &m_cfg->cfgtable, +sizeof (m_cfg->cfgtable), m_cfg->cfgbase, + &address_space_memory); }static void init_mc (MachineClass *mc)
target/hexagon/cpu.c +0 -1
@@ -413,7 +413,6 @@ void hexagon_cpu_soft_reset(CPUHexagonState *env) }#endif -static void hexagon_cpu_reset_hold (Object *obj,ResetType type) {CPUState *cs =CPU (obj);
Signature · 1 line
2.34.1
PATCH v3 6/9 hw/hexagon: Modify "Standalone" symbols
In reply to Brian CainFrom: Brian Cain <[email protected]>
These symbols are used by Hexagon Standalone OS to indicate whether the program should halt and wait for interrupts at startup. For QEMU, we want these programs to just continue crt0 startup through to the user program's main().
--- hw/hexagon/hexagon_dsp.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
hw/hexagon/hexagon_dsp.c +15 -0
@@ -28,9 +28,17 @@#include "machine_cfg_v66g_1024.h.inc" +static hwaddr isdb_secure_flag; +static hwaddr isdb_trusted_flag;static void hex_symbol_callback (const char *st_name,int st_info,uint64_t st_value,uint64_t st_size) { +if (!g_strcmp0 ("isdb_secure_flag" , st_name)) { + isdb_secure_flag = st_value; + } +if (!g_strcmp0 ("isdb_trusted_flag" , st_name)) { + isdb_trusted_flag = st_value; + } }/* Board init. */
@@ -59,6 +67,13 @@ static void hexagon_init_bootstrap(MachineState *machine, HexagonCPU *cpu) {if (machine->kernel_filename) {hexagon_load_kernel (cpu); +uint32_t mem =1 ; +if (isdb_secure_flag) { +cpu_physical_memory_write (isdb_secure_flag, &mem,sizeof (mem)); + } +if (isdb_trusted_flag) { +cpu_physical_memory_write (isdb_trusted_flag, &mem,sizeof (mem)); + } } }
Signature · 1 line
2.34.1
PATCH v3 7/9 target/hexagon: add build config for softmmu
In reply to Brian Cain--- MAINTAINERS | 1 + configs/devices/hexagon-softmmu/default.mak | 7 +++++++ configs/targets/hexagon-softmmu.mak | 6 ++++++ target/hexagon/cpu.h | 4 ---- target/Kconfig | 1 + target/hexagon/Kconfig | 2 ++ target/hexagon/meson.build | 13 ++++++++++++- 7 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 configs/devices/hexagon-softmmu/default.mak create mode 100644 configs/targets/hexagon-softmmu.mak create mode 100644 target/hexagon/Kconfig
MAINTAINERS +1 -0
@@ -253,6 +253,7 @@ F: linux-user/hexagon/ F: tests/tcg/hexagon/ F: disas/hexagon.c F: configs/targets/hexagon-linux-user/default.mak +F: configs/devices/hexagon-softmmu/default.mak F: docker/dockerfiles/debian-hexagon-cross.docker F: gdb-xml/hexagon*.xml F: docs/system/target-hexagon.rst
configs/devices/hexagon-softmmu/default.mak new file +7 -0
@@ -0,0 +1,7 @@ +# Default configuration for hexagon-softmmu + +# Uncomment the following lines to disable these optional devices: + +# Boards are selected by default, uncomment to keep out of the build. +# CONFIG_HEX_DSP=y +# CONFIG_L2VIC=y
configs/targets/hexagon-softmmu.mak new file +6 -0
@@ -0,0 +1,6 @@ +# Default configuration for hexagon-softmmu + +TARGET_ARCH=hexagon +TARGET_SUPPORTS_MTTCG=y +TARGET_XML_FILES=gdb-xml/hexagon-core.xml gdb-xml/hexagon-hvx.xml +TARGET_LONG_BITS=32
target/hexagon/cpu.h +0 -4
@@ -35,10 +35,6 @@#include "mmvec/mmvec.h" #include "hw/core/registerfields.h" -#ifndef CONFIG_USER_ONLY -#error "Hexagon does not support system emulation" -#endif -#include "reg_fields.h" #define NUM_PREGS 4
target/Kconfig +1 -0
@@ -16,6 +16,7 @@ source sh4/Kconfig source sparc/Kconfig source tricore/Kconfig source xtensa/Kconfig +source hexagon/Kconfig config TARGET_BIG_ENDIAN bool
target/hexagon/Kconfig new file +2 -0
@@ -0,0 +1,2 @@ +config HEXAGON + bool
target/hexagon/meson.build +12 -1
@@ -235,6 +235,7 @@ decodetree_trans_funcs_generated = custom_target( command: [python, files('gen_trans_funcs.py'), semantics_generated, '@OUTPUT@'], ) hexagon_ss.add(decodetree_trans_funcs_generated) +hexagon_softmmu_ss = ss.source_set() hexagon_ss.add(files( 'cpu.c',
@@ -253,6 +254,14 @@ hexagon_ss.add(files( 'mmvec/system_ext_mmvec.c', )) +hexagon_softmmu_ss.add(files( + 'cpu_helper.c', + 'hex_mmu.c', + 'hex_interrupts.c', + 'hexswi.c', + 'machine.c', +)) + # # Step 4.5 # We use flex/bison based idef-parser to generate TCG code for a lot
@@ -262,7 +271,8 @@ hexagon_ss.add(files( # idef-generated-enabled-instructions # idef_parser_enabled = get_option('hexagon_idef_parser') -if idef_parser_enabled and 'hexagon-linux-user' in target_dirs +if idef_parser_enabled and ('hexagon-linux-user' in target_dirs or + 'hexagon-softmmu' in target_dirs) idef_parser_input_generated = custom_target( 'idef_parser_input.h.inc', output: 'idef_parser_input.h.inc',
@@ -390,3 +400,4 @@ analyze_funcs_generated = custom_target( hexagon_ss.add(analyze_funcs_generated) target_arch += {'hexagon': hexagon_ss} +target_system_arch += {'hexagon': hexagon_softmmu_ss}
Signature · 1 line
2.34.1
Re: [PATCH v3 7/9] target/hexagon: add build config for softmmu
Quoted 35 lines · Brian Cain
Reviewed-by Taylor Simpson <[email protected]>Signed-off-by Brian Cain <[email protected]>--- MAINTAINERS | 1 + configs/devices/hexagon-softmmu/default.mak | 7 +++++++ configs/targets/hexagon-softmmu.mak | 6 ++++++ target/hexagon/cpu.h | 4 ---- target/Kconfig | 1 + target/hexagon/Kconfig | 2 ++ target/hexagon/meson.build | 13 ++++++++++++- 7 files changed, 29 insertions(+), 5 deletions(-)create mode 100644 configs/devices/hexagon-softmmu/default.mak create mode 100644 configs/targets/hexagon-softmmu.mak create mode 100644 target/hexagon/Kconfig
configs/devices/hexagon-softmmu/default.mak new file +7
-0@@ -0,0 +1,7 @@ +# Default configuration for hexagon-softmmu + +# Uncomment the following lines to disable these optional devices: + +# Boards are selected by default, uncomment to keep out of the build. +# CONFIG_HEX_DSP=y +# CONFIG_L2VIC=yconfigs/targets/hexagon-softmmu.mak new file +0
-0
configs/targets/hexagon-softmmu.mak line 4
Quoted 4 lines
configs/targets/hexagon-softmmu.mak new file +4
-0@@ -0,0 +1,6 @@ +# Default configuration for hexagon-softmmu + +TARGET_ARCH=hexagon +TARGET_SUPPORTS_MTTCG=y
See commit a3d40b5effa ("tcg: Convert TARGET_SUPPORTS_MTTCG to TCGCPUOps::mttcg_supported field") from almost 1 year ago.
Quoted 2 lines
configs/targets/hexagon-softmmu.mak new file +2
-0+TARGET_XML_FILES=gdb-xml/hexagon-core.xml gdb-xml/hexagon-hvx.xml +TARGET_LONG_BITS=32
Re: [PATCH v3 7/9] target/hexagon: add build config for softmmu
In reply to Brian CainQuoted 46 lines · Brian Cain
Reviewed-by Taylor Simpson <[email protected]>Signed-off-by Brian Cain <[email protected]>--- MAINTAINERS | 1 + configs/devices/hexagon-softmmu/default.mak | 7 +++++++ configs/targets/hexagon-softmmu.mak | 6 ++++++ target/hexagon/cpu.h | 4 ---- target/Kconfig | 1 + target/hexagon/Kconfig | 2 ++ target/hexagon/meson.build | 13 ++++++++++++- 7 files changed, 29 insertions(+), 5 deletions(-)create mode 100644 configs/devices/hexagon-softmmu/default.mak create mode 100644 configs/targets/hexagon-softmmu.mak create mode 100644 target/hexagon/Kconfig
MAINTAINERS +1
-0@@ -253,6 +253,7 @@ F: linux-user/hexagon/ F: tests/tcg/hexagon/ F: disas/hexagon.c F: configs/targets/hexagon-linux-user/default.mak +F: configs/devices/hexagon-softmmu/default.mak F: docker/dockerfiles/debian-hexagon-cross.docker F: gdb-xml/hexagon*.xml F: docs/system/target-hexagon.rstconfigs/devices/hexagon-softmmu/default.mak new file +7
-0@@ -0,0 +1,7 @@ +# Default configuration for hexagon-softmmu + +# Uncomment the following lines to disable these optional devices: + +# Boards are selected by default, uncomment to keep out of the build. +# CONFIG_HEX_DSP=y +# CONFIG_L2VIC=yconfigs/targets/hexagon-softmmu.mak new file +0
-0
configs/targets/hexagon-softmmu.mak line 6
Quoted 6 lines
configs/targets/hexagon-softmmu.mak new file +6
-0@@ -0,0 +1,6 @@ +# Default configuration for hexagon-softmmu + +TARGET_ARCH=hexagon +TARGET_SUPPORTS_MTTCG=y +TARGET_XML_FILES=gdb-xml/hexagon-core.xml gdb-xml/hexagon-hvx.xml +TARGET_LONG_BITS=32
Note, since we are trying to remove various legacy code, new system targets must be introduced with:
TARGET_NOT_USING_LEGACY_LDST_PHYS_API=y
TARGET_NOT_USING_LEGACY_NATIVE_ENDIAN_API=y
Regards,
Phil.
PATCH v3 8/9 hw/hexagon: Define hexagon "virt" machine
In reply to Brian CainFrom: Brian Cain <[email protected]>
--- configs/devices/hexagon-softmmu/default.mak | 1 + configs/targets/hexagon-softmmu.mak | 1 + include/hw/hexagon/virt.h | 43 ++ hw/hexagon/virt.c | 453 ++++++++++++++++++++ hw/hexagon/Kconfig | 10 + hw/hexagon/meson.build | 2 + tests/qemu-iotests/testenv.py | 1 + 7 files changed, 511 insertions(+) create mode 100644 include/hw/hexagon/virt.h create mode 100644 hw/hexagon/virt.c
configs/devices/hexagon-softmmu/default.mak +1 -0
@@ -3,5 +3,6 @@ # Uncomment the following lines to disable these optional devices: # Boards are selected by default, uncomment to keep out of the build. +# CONFIG_HEX_VIRT=y # CONFIG_HEX_DSP=y # CONFIG_L2VIC=y
configs/targets/hexagon-softmmu.mak +1 -0
@@ -4,3 +4,4 @@ TARGET_ARCH=hexagon TARGET_SUPPORTS_MTTCG=y TARGET_XML_FILES=gdb-xml/hexagon-core.xml gdb-xml/hexagon-hvx.xml TARGET_LONG_BITS=32 +TARGET_NEED_FDT=y
include/hw/hexagon/virt.h new file +43 -0
43 lines not on this page · raw message
hw/hexagon/virt.c new file +453 -0
453 lines not on this page · raw message
hw/hexagon/Kconfig +10 -0
@@ -3,3 +3,13 @@ config HEX_DSP default y depends on HEXAGON && TCG imply PTIMER + +config HEX_VIRT + bool + default y + depends on HEX_DSP && FDT + select DEVICE_TREE + select VIRTIO_MMIO + select PL011 + select VIRTIO_BLK + select VIRTIO_SCSI
hw/hexagon/meson.build +2 -0
@@ -4,3 +4,5 @@ hexagon_ss.add(files('hexagon_globalreg.c')) hexagon_ss.add(when: 'CONFIG_HEX_DSP', if_true: files('hexagon_dsp.c')) hw_arch += {'hexagon': hexagon_ss} + +hexagon_ss.add(when: 'CONFIG_HEX_VIRT', if_true: files('virt.c'))
tests/qemu-iotests/testenv.py +1 -0
@@ -259,6 +259,7 @@ def __init__(self, source_dir: str, build_dir: str, ('arm', 'virt'), ('aarch64', 'virt'), ('avr', 'mega2560'), + ('hexagon', 'virt'), ('m68k', 'virt'), ('or1k', 'virt'), ('riscv32', 'virt'),
Signature · 1 line
2.34.1
PATCH v3 9/9 tests/qtest: Add hexagon boot-serial-test
In reply to Brian CainAdd boot-serial-test support for Hexagon architecture using the virt machine.
--- tests/qtest/boot-serial-test.c | 8 ++++++++ tests/qtest/meson.build | 2 ++ 2 files changed, 10 insertions(+)
tests/qtest/boot-serial-test.c +8 -0
@@ -142,6 +142,13 @@ static const uint8_t kernel_stm32vldiscovery[] = {0x04 ,0x38 ,0x01 ,0x40 /* 0x40013804 = USART1 TXD */ }; +static const uint8_t bios_hexagon[] = { +0x00 ,0x40 ,0x00 ,0x01 ,/* immext(#0x10000000) */ +0x00 ,0xc0 ,0x00 ,0x78 ,/* r0 = ##0x10000000 */ +0x54 ,0xc0 ,0x00 ,0x3c ,/* memb(r0+#0) = #0x54 Write 'T' */ +0xf8 ,0xff ,0xff ,0x59 /* jump 0x0 ; Loop back to start */ +}; + typedef struct testdef { const char *arch; /* Target architecture */ const char *machine; /* Name of the machine */
@@ -194,6 +201,7 @@ static const testdef_t tests[] = { { "arm", "microbit", "", "T", sizeof(kernel_nrf51), kernel_nrf51 }, { "arm", "stm32vldiscovery", "", "T", sizeof(kernel_stm32vldiscovery), kernel_stm32vldiscovery }, + { "hexagon", "virt", "", "TT", sizeof(bios_hexagon), NULL, bios_hexagon }, { NULL } };
tests/qtest/meson.build +2 -0
@@ -290,6 +290,8 @@ qtests_riscv64 = ['riscv-csr-test'] + \ config_all_devices.has_key('CONFIG_RISCV_IOMMU') ? ['iommu-riscv-test'] : []) +qtests_hexagon = ['boot-serial-test'] + qos_test_ss = ss.source_set() qos_test_ss.add( 'ac97-test.c',
Signature · 1 line
2.34.1
Re: [PATCH v3 9/9] tests/qtest: Add hexagon boot-serial-test
Quoted 40 lines · Brian Cain
Add boot-serial-test support for Hexagon architecture using the virt machine.
Signed-off-by Brian Cain <[email protected]>--- tests/qtest/boot-serial-test.c | 8 ++++++++ tests/qtest/meson.build | 2 ++ 2 files changed, 10 insertions(+)tests/qtest/boot-serial-test.c +8
-0@@ -142,6 +142,13 @@ static const uint8_t kernel_stm32vldiscovery[] = {0x04 ,0x38 ,0x01 ,0x40 /* 0x40013804 = USART1 TXD */ }; +static const uint8_t bios_hexagon[] = { +0x00 ,0x40 ,0x00 ,0x01 ,/* immext(#0x10000000) */ +0x00 ,0xc0 ,0x00 ,0x78 ,/* r0 = ##0x10000000 */ +0x54 ,0xc0 ,0x00 ,0x3c ,/* memb(r0+#0) = #0x54 Write 'T' */ +0xf8 ,0xff ,0xff ,0x59 /* jump 0x0 ; Loop back to start */ +}; + typedef struct testdef { const char *arch; /* Target architecture */ const char *machine; /* Name of the machine */@@ -194,6 +201,7 @@ static const testdef_t tests[] = { { "arm", "microbit", "", "T", sizeof(kernel_nrf51), kernel_nrf51 }, { "arm", "stm32vldiscovery", "", "T", sizeof(kernel_stm32vldiscovery), kernel_stm32vldiscovery }, + { "hexagon", "virt", "", "TT", sizeof(bios_hexagon), NULL, bios_hexagon }, { NULL } };tests/qtest/meson.build +0
-0
tests/qtest/meson.build qtests_riscv64 = ['riscv-csr-test'] + \ · line 297
Quoted 8 lines
tests/qtest/meson.build +2
-0@@ -290,6 +290,8 @@ qtests_riscv64 = ['riscv-csr-test'] + \ config_all_devices.has_key('CONFIG_RISCV_IOMMU') ? ['iommu-riscv-test'] : []) +qtests_hexagon = ['boot-serial-test'] + qos_test_ss = ss.source_set() qos_test_ss.add( 'ac97-test.c',