target/hexagon: add build config for softmmu
Reviewed-by: Taylor Simpson <ltaylorsimpson@gmail.com> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com> Acked-by: Philippe Mathieu-Daudé <philmd@mailo.com> Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
Brian Cain committed
Jun 22, 2026 at 15:29 UTC
6beec3bcdaa00e22cec385e28c6734c45ddb5724
7 files changed
+30
-5
MAINTAINERS
+1
@@ -256,6 +256,7 @@ F: linux-user/hexagon/
256
F: tests/tcg/hexagon/
257
F: disas/hexagon.c
258
F: configs/targets/hexagon-linux-user.mak
259
+F: configs/targets/hexagon-softmmu.mak
260
F: tests/docker/dockerfiles/debian-hexagon-cross.docker
261
F: gdbstub/gdb-xml/hexagon*.xml
262
F: docs/system/target-hexagon.rst
configs/devices/hexagon-softmmu/default.mak
new
+6
@@ -0,0 +1,6 @@
1
+# Default configuration for hexagon-softmmu
2
+
3
+# Uncomment the following lines to disable these optional devices:
4
+
5
+# Boards are selected by default, uncomment to keep out of the build.
6
+# CONFIG_HEX_DSP=y
configs/targets/hexagon-softmmu.mak
new
+7
@@ -0,0 +1,7 @@
1
+# Default configuration for hexagon-softmmu
2
+
3
+TARGET_ARCH=hexagon
4
+TARGET_XML_FILES=hexagon-core.xml hexagon-hvx.xml
5
+TARGET_LONG_BITS=32
6
+TARGET_NOT_USING_LEGACY_LDST_PHYS_API=y
7
+TARGET_NOT_USING_LEGACY_NATIVE_ENDIAN_API=y
target/Kconfig
+1
@@ -16,6 +16,7 @@ source sh4/Kconfig
16
source sparc/Kconfig
17
source tricore/Kconfig
18
source xtensa/Kconfig
19
+source hexagon/Kconfig
20
21
config TARGET_BIG_ENDIAN
22
bool
target/hexagon/Kconfig
new
+2
@@ -0,0 +1,2 @@
1
+config HEXAGON
2
+ bool
target/hexagon/cpu.h
+1
-4
@@ -38,10 +38,7 @@ typedef struct HexagonGlobalRegState HexagonGlobalRegState;
38
#include "hw/core/registerfields.h"
39
#include "qemu/bitmap.h"
40
41
-#ifndef CONFIG_USER_ONLY
42
-#error "Hexagon does not support system emulation"
43
-#endif
44
-
41
+#include "target/hexagon/reg_fields.h"
42
43
#define NUM_PREGS 4
44
#define TOTAL_PER_THREAD_REGS 64
target/hexagon/meson.build
+12
-1
@@ -235,6 +235,7 @@ decodetree_trans_funcs_generated = custom_target(
235
command: [python, files('gen_trans_funcs.py'), semantics_generated, '@OUTPUT@'],
236
)
237
hexagon_ss.add(decodetree_trans_funcs_generated)
238
+hexagon_softmmu_ss = ss.source_set()
239
240
hexagon_ss.add(files(
241
'cpu.c',
@@ -253,6 +254,14 @@ hexagon_ss.add(files(
254
'mmvec/system_ext_mmvec.c',
255
))
256
257
+hexagon_softmmu_ss.add(files(
258
+ 'cpu_helper.c',
259
+ 'hex_mmu.c',
260
+ 'hex_interrupts.c',
261
+ 'hexswi.c',
262
+ 'machine.c',
263
+))
264
+
265
#
266
# Step 4.5
267
# We use flex/bison based idef-parser to generate TCG code for a lot
@@ -262,7 +271,8 @@ hexagon_ss.add(files(
271
# idef-generated-enabled-instructions
272
#
273
idef_parser_enabled = get_option('hexagon_idef_parser')
265
-if idef_parser_enabled and 'hexagon-linux-user' in target_dirs
274
+if idef_parser_enabled and ('hexagon-linux-user' in target_dirs or
275
+ 'hexagon-softmmu' in target_dirs)
276
idef_parser_input_generated = custom_target(
277
'idef_parser_input.h.inc',
278
output: 'idef_parser_input.h.inc',
@@ -390,3 +400,4 @@ analyze_funcs_generated = custom_target(
400
hexagon_ss.add(analyze_funcs_generated)
401
402
target_arch += {'hexagon': hexagon_ss}
403
+target_system_arch += {'hexagon': hexagon_softmmu_ss}