From nobody Mon Nov 23 04:34:19 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1794256283; cv=none; d=zohomail.com; s=zohoarc; b=m3LaXCYp4TarqBLgy7RVH7sp8x8rlnBtt5vHhN9uPjsiNXlUpxj9/MQbQwjcIpewNqeO3ONyTnrUB4FFVm+HhsfQC/RWHwYpvTHmx2ClA/Zwj3HBUKsYmJ7n+6vJIYubDa0E9m+93OAiOXv79pF7EOywoWx6Y/Bo8+RZpEbbSyk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794256283; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=yT8//N0GY+gttz42XYGIjhvStSZfx8rCAyqLX7JU1/c=; b=eis51kYmlH5zQ9r9XFudhNf8Udf8tgpiBs94Xs03RFs8Qx4A7ueHw4Kq1LWfIssbSLE/t9wcy4FFDG2DsI8qOrEk+Bf2Mx0zxTiPqOnyNoj+WuEP2hck/UAVH+vuXPbD3SOAfRV6E9zHTxRm0SaC8WhkfQRznMbBBKmWn8koj0Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794256283443660.7402483866015; Mon, 9 Nov 2026 12:31:23 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xQW18-0003Yf-Qp; Mon, 09 Nov 2026 15:31:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xQW0a-0003NY-Ad for qemu-devel@nongnu.org; Mon, 09 Nov 2026 15:30:31 -0500 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xQW0W-0007Hr-Eg for qemu-devel@nongnu.org; Mon, 09 Nov 2026 15:30:28 -0500 Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6A9HHLPJ562083 for ; Mon, 9 Nov 2026 20:30:22 GMT Received: from mail-dy1-f197.google.com (mail-dy1-f197.google.com [74.125.82.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4hucydj2yc-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 09 Nov 2026 20:30:22 +0000 (GMT) Received: by mail-dy1-f197.google.com with SMTP id 5a478bee46e88-36f26e6abe9so2229247eec.0 for ; Mon, 09 Nov 2026 12:30:22 -0800 (PST) Received: from hu-bcain-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3752060dc0csm823737eec.14.2026.11.09.12.30.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2026 12:30:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= yT8//N0GY+gttz42XYGIjhvStSZfx8rCAyqLX7JU1/c=; b=pN4bkn3KqFpH6oOf ofKgp9HaiQf8BsPSm6HB1LFFEnlXsey6deA3WNBhNYWxoQ0WUvYuTYMUjX+NfMlv HkZeTa3Jg0WrlYQiIiVmafWBOlDdCvdZCoY35gL0XMh9V7qtdihzhV02tqgfzteR ehWpZhxnKZ/9WeFJuS2SQdjWxk7epCgD2VlWIOdrfapNGyJZ12KvBCvxHN05kc/i CiddyQGk30OgUXKXTME9KV9yqLrTzWFYzWRnXZDwyiVfFw6eSZJURZTX2Z81drN/ XnYM8UaBeqcEPVu3CeIwbfGvZT87dCjdwcvHAX7SJ4gw3Y69h0/kv/hyAQNuXPkc ykV9Bw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1794256221; x=1794861021; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=yT8//N0GY+gttz42XYGIjhvStSZfx8rCAyqLX7JU1/c=; b=g4g7PUVXbEpfVmmMCNclOq0nHvoHM39nq4JO2IzNSjH4APxemhgKvHwjc74boevDGR jCL2W5afTzY6YKIwQk3hLWu3QXiBPtzB6AQLx8al5sWIOwLx96pzByCn/dwvaLcSLqYg LJbxM98YAxqMmN5h+B3EsPTKelcXAk9Xn4iZvX9cTk3HKbD52kdUBKINP3Wh9m1fA8cs d7f22EYKpQM76hQ1JtpXhFDmIDlRTNYGZniaLShmg3bgfQYwkh+U3Cx0UiA9TY8h0cd0 1CT9v406lng+IKtGa4f5K2a4kxtmifKIbmuessm6ThK+rBdWk4irh3BTyP5TxffcVsKv UYkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794256221; x=1794861021; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=yT8//N0GY+gttz42XYGIjhvStSZfx8rCAyqLX7JU1/c=; b=Q+VJbQyc5LkA9uNmiyd6W3lLtKfUNuKn34IX5Kcnb0H/yfopyyEa+0gxccDPs2p9vY xx/4rD1xDiPP9Ph8qYrhZa6skRFsi0I6+dy45BcUU0i5SdSaq6y54KuzJwesixhISc9U UiydaS1rpvcIHcfLHWt8u17RDRIy/gtIhIZQ1xZ6L6kFryct/oVyOcjKXCu7qPfjvBXk 72v4NML6kzt2EJdfaVLL0PRkxYe0h9+2ProlvCrccEKmCFRxjKWjYnOqFCZNch3d7KPo T2+1jve46nPG9gla5dCxdwLrABDNyryEO13JQAwTTSFLavr4dfgez6sWjkhsZiaIlD5/ ZwQg== X-Gm-Message-State: APuU4Z+JUZ38jwIOn/xfn4UKilMfiRXnni9HTs1GL4NnmLOnCozA2LIH luW58MBodJHUeJiksqy934Xacdtg1Q1Lpo2EVupyrH9pSMYdT64HxRlJWzgO/uChtesrnliO/qm nyZlhIIZgPRp0pGDnnzPWR9clauhpU1+rZaqOgsgD1J8NMZPa0Zht9KNjtX5rPZL4GA== X-Gm-Gg: AYBFou0TwGgp/bnkid18MfTBOlUofRdDF7MjunaAgj3TXSmczY6IlRdegnNd1w3dr8g pXjSPvujJzqlIL65iwjfbQ0eAMIjvkuklK2YHVehN/TiNU7mju4KpRzhwoFzkjECOT+mFr2zBy5 PrTBKktLwkHpvvr8oDBwtfjaldCgkFX57PWcHCZVxUrV3EL5YyRZKm6CEHsXOEsp2HrqPxRyjxt 44WNZwU0PFjoFcS1IAr9GXU51nNN8aTBO/AD1ilGOFMFOGvISxKJXUYOevu2tYzoLstBNb1B3xU Wb3Op2BsfsPgjx5kWrOKIRp5qHkl6li6RklBLMRPfZmrnqzRP6/yIARUtlzf9GhIy8Tz2PBDWRu DjJAOdBBVednICt5liEUU8lZDiWRUs5E/89KCZKo7JXbFm+QrbeHOitoPVPTBJ5R+dJCHWDNy2z 7M3m3LsLV9Kmdpszwmyhkn X-Received: by 2002:a05:693c:8842:b0:36a:1f8:a589 with SMTP id 5a478bee46e88-37520717487mr434286eec.27.1794256220869; Mon, 09 Nov 2026 12:30:20 -0800 (PST) X-Received: by 2002:a05:693c:8842:b0:36a:1f8:a589 with SMTP id 5a478bee46e88-37520717487mr434209eec.27.1794256219890; Mon, 09 Nov 2026 12:30:19 -0800 (PST) From: Brian Cain To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , Brian Cain Subject: [PATCH v2 1/5] docs/system/hexagon: describe machine models and memory maps Date: Mon, 9 Nov 2026 12:30:13 -0800 Message-Id: <20261109203017.262225-2-brian.cain@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20261109203017.262225-1-brian.cain@oss.qualcomm.com> References: <20261109203017.262225-1-brian.cain@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Info: AW1haW4tMjYxMTA5MDA4MSBTYWx0ZWRfX4/DdIhgG7rga H05W3S34HtrHZkQf8MCdjxGeNDz8P7N8wjQyWlEGc3QeYBGXYuSqi2vT1Rdr2TyewiNmayWrU39 FdvpnxRTYXs0HjNffZWtEb2IUrykIvg= X-Proofpoint-GUID: IvLSyaLs12-S9U7_bKjCnJzsE4DZ3s8T X-Proofpoint-ORIG-GUID: IvLSyaLs12-S9U7_bKjCnJzsE4DZ3s8T X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMTA5MDA4MSBTYWx0ZWRfX9/AsGoJ44EmD 469pfheJJaNOMzx2w209hDJK9i0t6nm3agGLPXXQYlyN4tl9mgIwCnjir5SYnJcSo2eZZmhzIS4 YLzMkVbk5uC1qbz+RtunHziKBBqbWyp5yREEV0jx2F2nQwcLKn1tAidtKI+Pg9luO+KL/t3OQfM AczebS/rnGHAaPM2Lv9fDTQeQbCcGWUX07qBe3H2anuhXI3JG0lX7gbdYR10yMzNHC8IWe5jYlO KqMCZwo9BIUzaJpYraU/0JFNx4iFJmfUqRfwMF6zKG5tY4Qk8x5zfcTxNPsyusW1NjTbGrrO1e9 XPYhjFBwhOq1r5vixqU053qdbvNs3udVPOzXrbqe82Sw/7olAykqZ8K3ExhRfc8FuhvqPw9Jj7s ad8RAtl/Bc8Ncid5bT/4bQKwG3JjokcNs1Nx6gM+DHEkx6TFsllwR4eSAH79P+SAHiu8r1wiTzg jjK8fIXAu4wR7RF1jUg== X-Authority-Analysis: v=2.4 cv=XuRvqlF9 c=1 sm=1 tr=0 ts=6af22d5e cx=c_pps a=Uww141gWH0fZj/3QKPojxA==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=IkcTkHD0fZMA:10 a=zJRp6_cAMcgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=ZpdpYltYx_vBUK5n70dp:22 a=NEAV23lmAAAA:8 a=EUspDBNiAAAA:8 a=XEA1TDPqdI0cZNt5_OoA:9 a=QEXdDO2ut3YA:10 a=PxkB5W3o20Ba91AHUih5:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-11-09_06,2026-11-06_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 lowpriorityscore=0 bulkscore=0 spamscore=0 adultscore=0 suspectscore=0 impostorscore=0 malwarescore=0 clxscore=1015 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2611090081 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.180.131; envelope-from=brian.cain@oss.qualcomm.com; helo=mx0b-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @qualcomm.com) X-ZM-MESSAGEID: 1794256285199158501 Reviewed-by: Pierrick Bouvier Signed-off-by: Brian Cain --- docs/system/hexagon/cdsp.rst | 41 +++++++++++++++----------------- docs/system/hexagon/machines.rst | 38 +++++++++++++++++++++++++++++ docs/system/target-hexagon.rst | 5 ++-- 3 files changed, 60 insertions(+), 24 deletions(-) create mode 100644 docs/system/hexagon/machines.rst diff --git a/docs/system/hexagon/cdsp.rst b/docs/system/hexagon/cdsp.rst index 8d3a1f611b0..3556d8a8aa0 100644 --- a/docs/system/hexagon/cdsp.rst +++ b/docs/system/hexagon/cdsp.rst @@ -1,21 +1,12 @@ .. SPDX-License-Identifier: GPL-2.0-or-later =20 -Compute DSP -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +Board-specific boot firmware +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D =20 -A Hexagon CDSP is designed as a computation offload device for an SoC. The -``V66G_1024`` machine contains: - -* L2VIC interrupt controller -* QTimer timer device - -This machine will support any Hexagon CPU, but will default to ``v66``. - -H2 boot firmware ----------------- - -These machines can be started through the H2 hypervisor images shipped in -``pc-bios``, selected with ``-bios``: +The CDSP/NSP machines can use the host firmware shipped in ``pc-bios``, +selected with ``-bios``. These images contain H2 and either the ``booter`` +or ``loadlinux`` loader. Use ``-L`` to specify QEMU's firmware directory +when running an uninstalled build. =20 .. list-table:: :header-rows: 1 @@ -45,16 +36,22 @@ These machines can be started through the H2 hypervisor= images shipped in - ``0xa0000000`` - ``sa8797p_nsp0`` =20 +``hexagon_loadlinux_`` + Boots a guest operating system written for the Hexagon VM interface. + Despite the name, it is not specific to Linux. H2 starts the guest from + an image that QEMU has placed at the ``-kernel`` address in the table + above. + ``hexagon_booter_`` - H2 plus a loader that reads guest ELF files from the host through QEMU - semihosting:: + Runs H2 user programs. The booter creates a VM, loads a program + that it reads from the host through semihosting, and waits for the + program to exit:: =20 qemu-system-hexagon -M qcs6490-cdsp -serial stdio -display none \ -bios hexagon_booter_qcs6490_cdsp \ - -semihosting-config enable=3Don,target=3Dnative,arg=3Dbooter,arg= =3Dguest.elf + -semihosting-config enable=3Don,target=3Dnative,arg=3Dbooter,arg= =3Dprog.elf =20 - Guests are loaded at ``0xa2000000``. + Programs are loaded at ``0xa2000000`` by default; the booter's + ``--guest_base`` option changes this (``arg=3D--help`` lists its options= ). =20 -``hexagon_loadlinux_`` - H2 plus a loader that starts a kernel which QEMU has placed at the - ``-kernel`` address in the table above. + For more info, see . diff --git a/docs/system/hexagon/machines.rst b/docs/system/hexagon/machine= s.rst new file mode 100644 index 00000000000..a4760b7a5b1 --- /dev/null +++ b/docs/system/hexagon/machines.rst @@ -0,0 +1,38 @@ +.. SPDX-License-Identifier: GPL-2.0-or-later + +Hexagon machines +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +Choose a machine that matches the runtime environment for the program and +the Hexagon ISA it targets. Hexagon machines fall into two broad categorie= s: +simulator-compatible machines and board-specific DSP subsystem machines. + +Simulator-compatible machines +----------------------------- + +Simulator-compatible machines support standalone SDK OS and QuRT programs +intended for the Hexagon simulator environment. They provide the common +Hexagon system facilities expected by those programs, including interrupt +and timer services, local memory, semihosting, and a configuration table +that describes the selected model's capabilities. + +Select the model that matches the program's target ISA and threading +requirements. ``V66G_1024`` is the default when ``-M`` is omitted; ``sim`` +selects the most modern simulator-style machine. + +The virtual machine (``virt``) +------------------------------ + +``virt`` is a synthetic simulator-compatible board for operating systems a= nd +bare-metal programs. QEMU supplies a device tree that describes the virtual +hardware available to the guest, including CPUs, interrupt controller, +console, virtio devices, and accelerator capabilities. See :doc:`boot` for +its boot protocol. + +Board-specific CDSP and NSP machines +------------------------------------ + +Board-specific CDSP and NSP machines model the DSP subsystem of a named +SoC. + +Firmware choices are listed in :doc:`cdsp`. diff --git a/docs/system/target-hexagon.rst b/docs/system/target-hexagon.rst index 5d48cf401ad..5a646fd0d04 100644 --- a/docs/system/target-hexagon.rst +++ b/docs/system/target-hexagon.rst @@ -21,8 +21,8 @@ reset and the first instructions are fetched from DDR via= the EVB/reset vector. In a real system, a TBU/SMMU would normally arbitrate AXI accesses but we don't have a need to model that for QEMU. =20 -Hexagon DSP cores use simultaneous multithreading (SMT) with as many as 8 -hardware threads. +Hexagon DSP cores use simultaneous multithreading (SMT). The number of +hardware threads depends on the machine. =20 .. admonition:: Diagram =20 @@ -100,6 +100,7 @@ machines. This can be further configured through ``-sem= ihosting-config``. Hexagon Features =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D .. toctree:: + hexagon/machines hexagon/emulation hexagon/cdsp =20 --=20 2.34.1 From nobody Mon Nov 23 04:34:19 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1794256325; cv=none; d=zohomail.com; s=zohoarc; b=AcikJww820G4mC7Alp0UBEPN0kSGZBPPcNjQMp5nCH9jkMF/SjFUiznuzlOGG/iybWMMIj7+YOV9/l7E1RoVubp7hLOMDoEbMcxYD+tDNF12CFy3/4QyL8zPv2GE6g5sLHADYUe7nxTz7xOCjXvDwduoZpx1xF2rElXCGUfxZ3g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794256325; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=wgs+JhNvl2XPwVbr0SO1ERlwL6AzljtaNttv0oIjdSA=; b=Ie57WdGnk1u72LsnEFzTZA/GW5U891te1ulxBJgllVDWXO2Kut49FITvsCXqpYQr9dk3Qv7QRsXcH3lWdBy9eqEpeaz0dy9u1CpX6znxCaZlpKZQ/8j9OCslGjChLh38KstnCE60nN3JWzK129RMDE9T2S1r8ehNBNtrglF3+mY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794256325302357.66566828589123; Mon, 9 Nov 2026 12:32:05 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xQW17-0003YD-Rf; Mon, 09 Nov 2026 15:31:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xQW0a-0003NZ-Ac for qemu-devel@nongnu.org; Mon, 09 Nov 2026 15:30:31 -0500 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xQW0W-0007Hu-Uf for qemu-devel@nongnu.org; Mon, 09 Nov 2026 15:30:28 -0500 Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6A9HHKM6562014 for ; Mon, 9 Nov 2026 20:30:23 GMT Received: from mail-dl1-f69.google.com (mail-dl1-f69.google.com [74.125.82.69]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4hucydj2yg-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 09 Nov 2026 20:30:23 +0000 (GMT) Received: by mail-dl1-f69.google.com with SMTP id a92af1059eb24-1aa0fb7f157so1896873c88.0 for ; Mon, 09 Nov 2026 12:30:23 -0800 (PST) Received: from hu-bcain-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3752060dc0csm823737eec.14.2026.11.09.12.30.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2026 12:30:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= wgs+JhNvl2XPwVbr0SO1ERlwL6AzljtaNttv0oIjdSA=; b=pNWCmJR1g6kapETP wD5umIxOF7aicXYXAubg2kytz7pxqQkCvsP7to7iN3Bbx/PRCXsgCcOCho+5UMXe gd5JfzlerkgEOdfS4z83RF428zLw9tof34AfZiE9kupjX7annDqqgtKpc7kVWFz+ i14gUA5S4P/zx7BqVEs1jirF29N6FomekEIHe+I4RNY3lnulfW5SV9XSJIemCluJ ddjbYD+hfx+TpLcD24mHWHeCMnMdse0y+EwGA6eEs9Z1VICn4pYrrS2KqjdRI2mJ IwSCw8XtPz8DeTQOsabRSesdexrZ1JjJs0ATrXEHevZ6dgY7nOZ8dlOBxI1JQaNc tcg81Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1794256222; x=1794861022; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=wgs+JhNvl2XPwVbr0SO1ERlwL6AzljtaNttv0oIjdSA=; b=jtf7LrpgUwGP1Y30x4l9z8ioGYP3JA+9fJcA+RLSdUXq/rQ69mltkS74uko9oNMzn4 MP+DiJzNOMZhMGMfa0N5ghMskeerE3l8T9xxRYJIXQqqCeb+476Egq87m46eIGS31ipf XZsL3Ss/RKeu24p7hdTJd+2ThTlF5JZosItqNB9tyHrt2FzJnKbNNOtTpMhBPcXDD3QO Ffe03ySYiUdXJbMhSPWxQq/1JYM2lBybrfmXcp2QGEYu4kqjV2UffF3rVdbMEEbWK0ZU FjGRHyPEjJ7hnznNoRs6mU/Kcy6aGE2K7/7oREC2sOu9hvfikp02OeIFPT2UVW/l5oVc LwDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794256222; x=1794861022; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=wgs+JhNvl2XPwVbr0SO1ERlwL6AzljtaNttv0oIjdSA=; b=iEn9SHPLmhSeSo5k+gmA36vbJhQf0tcBvb+4cGTqxunvTSTpJk81NfTE+JOSzKn2vF elaDdVJHbcoi9kxgPigagIPGBv7efrabcze3ItE2q6qM0o9K31fHivnvK7GAZwkmesvi ulCOBtWcCANQCxIyGaRPYkRJot9/dXtddtXmGPO0bKBfkhiVgARzeBcuy0radpqVOn+J Icu13rkA51FBjANJZ1PTNn+9mu72+3sTnknIaSoC7RAxr9Zm79UyEJ3PCxMUKAGZt59T nfqHMlUQoU7eKJ/Kv5HRAP8Nd2X9u9CBKzBuNwGk0GrEzA+aSHwHdDtxHqaMVCRNJLpL DDhw== X-Gm-Message-State: APuU4Z8b/OmU/cc2dHhNWWVnRIzn6nCPIlrHuPbTVqO3XWUUN3OeWfpm IAXNz6X3fTHsbz6gvIPY39lOJ6lZL0rZyLX6mYVmJ1RMraSXE2DCbWBQtFk3o5tMQ9tUmToi6uS KbLK9mVfiKfda8JOVYfmpofKzoG7T5SeCyFmdZgFsaU/IDyDB58VB84ceJzA8vDpneg== X-Gm-Gg: AYBFou1Atft3+nhC45WlhIw7ELgqHteiKcbwBh44fXzrX1vaLdlCBqBGiXIjlqxkPJG av8YidIkSnyHjareT1m1smo89uAS+s2UesJC/ZKZcLHk94P39XZhWULALpMc0siK4iIwbmDehBE AblN12WUBcHgIGHpw2K0LK66rTpcPoyYsNkYeot4wcgTNM9yu4YEQesROs2mtMH5qPQp1uafY7O aD4tCRXgBtRvmn2gE61VFgmnGWWM6ND4IuhltVg614qHNpr7bmsqnpPTwlEM1kcnwFgK/CoLncv z4ksSO5I5pYebX1MFBmVUAUSRCpPuaB2ogGAvIPdV4c4FhTulaNwlF8e35htJkHlzEpgnMXbJPs xISQHq+frHOflgngFrYBSt71a5zwr4Oc6HH+oFhzGvP5yMHlWhh100ghGzv0Hlwpa+SWll8X8kz 61Nm/haW2FTIVhmv5SBF8X X-Received: by 2002:a05:7022:23aa:b0:1ab:6b10:461 with SMTP id a92af1059eb24-1b3b604a557mr749074c88.45.1794256222028; Mon, 09 Nov 2026 12:30:22 -0800 (PST) X-Received: by 2002:a05:7022:23aa:b0:1ab:6b10:461 with SMTP id a92af1059eb24-1b3b604a557mr749011c88.45.1794256220969; Mon, 09 Nov 2026 12:30:20 -0800 (PST) From: Brian Cain To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , Brian Cain Subject: [PATCH v2 2/5] docs/system/hexagon: update the overview and emulation limits Date: Mon, 9 Nov 2026 12:30:14 -0800 Message-Id: <20261109203017.262225-3-brian.cain@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20261109203017.262225-1-brian.cain@oss.qualcomm.com> References: <20261109203017.262225-1-brian.cain@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Info: AW1haW4tMjYxMTA5MDA4MSBTYWx0ZWRfX/ISBRx9QkWNC 1xfcqR4qRbm0/fJLxmbDouDvxnkidXVVLTzGjJGHJR1Y+8nNDzqdjCUZqS1Qr6aHQdgPFqFl86n DLG8zcdg+slneoOma4ibqBJ+nrwcPt0= X-Proofpoint-GUID: bnhyIomcFpb-_oLTrWAx5su7Y9qgdoln X-Proofpoint-ORIG-GUID: bnhyIomcFpb-_oLTrWAx5su7Y9qgdoln X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMTA5MDA4MSBTYWx0ZWRfXzqWFjNLtxapM DCNMTYYPCf/XyxBqgw5P1wi2QAGwJmx+m+BQ1SKfw8vd4+NDzEIY0E5/4kMXJN6ZxfzrtMe03eC B0p9yvxnQD+vWVJ5T+aoTT+lxwxOt3N8grWEjZ+Qo0loVbmOAT8xbsxwfScrhoC596FvRLI9z// 1vAg7K7TxfnkzJ+OHC0HWbEH0GQllme4PYbpI7XK721W5RbzVsS72BvUFdTVyqfOUlEs6jlZzPE 8vgOWtT+wQV1YQxk44jnGjbSN1CBiu7Lz8cmNUjVe0oR09YThhTKM764CS96t8Vc0DLjEPPwn3u 3fvFrla9qKCM4arP3HqpdZO+6nK7i+6KhDcUYQ5Hvc/CuUBRjuq39kifCgnWrk/ihU08/h2UC/Q y9J0u3TK4xq0ZmRwzb1S/QUgmkFZwkOCGKuokB8JGbYldvDwvgrLSw3PTE9GN7YayCOjMWJU9S2 rlNLmngX9IGIRiow3Mg== X-Authority-Analysis: v=2.4 cv=XuRvqlF9 c=1 sm=1 tr=0 ts=6af22d5f cx=c_pps a=kVLUcbK0zfr7ocalXnG1qA==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=IkcTkHD0fZMA:10 a=zJRp6_cAMcgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=ZpdpYltYx_vBUK5n70dp:22 a=EUspDBNiAAAA:8 a=5uMcSSmQ1h4GQFTkCBAA:9 a=QEXdDO2ut3YA:10 a=vr4QvYf-bLy2KjpDp97w:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-11-09_06,2026-11-06_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 lowpriorityscore=0 bulkscore=0 spamscore=0 adultscore=0 suspectscore=0 impostorscore=0 malwarescore=0 clxscore=1015 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2611090081 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.180.131; envelope-from=brian.cain@oss.qualcomm.com; helo=mx0b-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @qualcomm.com) X-ZM-MESSAGEID: 1794256325899158500 Describe the devices that the machines instantiate, ELF boot path. Reviewed-by: Pierrick Bouvier Signed-off-by: Brian Cain --- docs/system/hexagon/emulation.rst | 18 +++++++++++++++ docs/system/target-hexagon.rst | 37 ++++++++++++++++++------------- 2 files changed, 39 insertions(+), 16 deletions(-) diff --git a/docs/system/hexagon/emulation.rst b/docs/system/hexagon/emulat= ion.rst index fb57c77ae90..41a9a8467f9 100644 --- a/docs/system/hexagon/emulation.rst +++ b/docs/system/hexagon/emulation.rst @@ -11,7 +11,25 @@ It also has support for the following architecture exten= sions: =20 - HVX (Hexagon Vector eXtensions) - `HVX floating point `_. +- HLX (see the `HLX reference manual + `_). + +User-DMA and HMX are not yet implemented. + +Machine configurations also select the available HVX contexts, VTCM, +and HMX/HLX resources. See :doc:`machines` for the machine configurations. =20 For information on the specifics of the HVX extension, please refer to the `Qualcomm Hexagon V79 HVX Programmer's Reference Manual `_. + +Emulation limits +---------------- + +The system models target functional execution. + +HVX uses 128-byte vectors; 64-byte mode is not implemented. + +See :doc:`../../devel/hexagon-sys` and +:doc:`../../devel/hexagon-l2vic` for system-register, TLB, and interrupt +details relevant to OS and firmware authors. diff --git a/docs/system/target-hexagon.rst b/docs/system/target-hexagon.rst index 5a646fd0d04..7b7d0bc31bc 100644 --- a/docs/system/target-hexagon.rst +++ b/docs/system/target-hexagon.rst @@ -8,15 +8,17 @@ Hexagon System emulator Use the ``qemu-system-hexagon`` executable to simulate a 32-bit Hexagon machine. =20 -Hexagon Machines -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +DSP subsystem +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 Hexagon DSPs are suited to various functions and generally appear in a "DSP subsystem" of a larger system-on-chip (SoC). =20 Hexagon DSPs are often included in a subsystem that looks like the diagram below. Instructions are loaded into DDR before the DSP is brought out of -reset and the first instructions are fetched from DDR via the EVB/reset ve= ctor. +reset and the first instructions are fetched from DDR via the reset vector. +QEMU's ELF boot path instead starts at the ELF entry point; the guest sets +up its own ``EVB``. =20 In a real system, a TBU/SMMU would normally arbitrate AXI accesses but we don't have a need to model that for QEMU. @@ -60,32 +62,36 @@ hardware threads depends on the machine. =20 Components ---------- -Other than l2vic and HVX, the components below are not implemented in QEMU. +The devices instantiated depend on the machine. QEMU implements the +interrupt controller, timer, configuration table, and accelerator contexts; +local RAM regions are provided where the machine configuration calls for +them. =20 * L2VIC: the L2 vectored interrupt controller. Supports 1024 input interrupts, edge- or level-triggered. The core ISA has system registers ``VID``, ``VID1`` which read through to the L2VIC device. -* QTimer: ARMSSE-based programmable timer device. Its interrupts are +* QTimer: programmable timer device. Its interrupts are wired to the L2VIC. System registers ``TIMER``, ``UTIMER`` read through to the QTimer device. * QDSP6SS: DSP subsystem features, accessible to the entire SoC, including - DSP NMI, watchdog, reset, etc. -* CSR: Configuration/Status Registers. + DSP NMI, watchdog, reset, etc. Board models provide selected registers + for firmware initialization. +* CSR: the QTimer control registers are mapped at the machine's CSR base + address; see :doc:`hexagon/machines`. * TCM: DSP-exclusive tightly-coupled memory. This memory can be used for DSPs when isolated from DDR and in some bootstrapping modes. * VTCM: DSP-exclusive vector tightly-coupled memory. This memory is acces= sed by some HVX instructions. -* HVX: the vector coprocessor supports 64 and 128-byte vector registers. - 64-byte mode is not implemented in QEMU. +* HVX: the vector coprocessor. See :doc:`hexagon/emulation` for supported + modes and instruction sets. =20 =20 Bootstrapping ------------- -Hexagon systems do not generally have access to a block device. So, for -QEMU the typical use case involves loading a binary or ELF file into memory -and executing from the indicated start address:: +Use ``-kernel`` to load an ELF file into memory and start execution at +its entry point:: =20 - $ qemu-system-hexagon -kernel ./prog -append 'arg1 arg2' + $ qemu-system-hexagon -M V68N_1024 -kernel ./prog.elf -append 'arg1 ar= g2' =20 Semihosting ----------- @@ -97,10 +103,9 @@ guest software can access the host console and filesyst= em. Read the for details. Semihosting is enabled by default on hexagon-sim-compatible machines. This can be further configured through ``-semihosting-config``. =20 -Hexagon Features -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D .. toctree:: + :caption: Hexagon documentation + hexagon/machines hexagon/emulation hexagon/cdsp - --=20 2.34.1 From nobody Mon Nov 23 04:34:19 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1794256286; cv=none; d=zohomail.com; s=zohoarc; b=UPRXD9MTWoGa3g+bT6llqAB8yaX7hFLeCQp8OHP4L2atvNmE8qaqT4stDfHPZqSCeozzg+lIHNQMZj8AIYkhTjVtC3Kysy/DhXgfklfPHRKvK2WbomACZDkHhRzDe+s3a6BHSTac9dqUq0ASodTpOWe6zN8k6rITRGx3fOvLqOY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794256286; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=42bq2TLvBR91FB9721+WCAnGkGl91+gPvA1PHP1ZjlU=; b=QgWCUtFylDh1Y8fZzehyhXAzOwUYtI2Px/pRetYE4WxCSXij8DXHI/BbA9HLJ9BX8o4Ddc5HFHmjbBjQhomg19XkSNr2MP8wbp3jarYgkWZcC9BoTw3U59e9uKXImHPlIU8SW0kNbQ+OSSU0zcpjNFu/Pjp2sC8dWctJXnSKVCo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794256286775182.42035139860343; Mon, 9 Nov 2026 12:31:26 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xQW15-0003W3-Np; Mon, 09 Nov 2026 15:30:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xQW0b-0003Nr-Kl for qemu-devel@nongnu.org; Mon, 09 Nov 2026 15:30:31 -0500 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xQW0Z-0007I1-3j for qemu-devel@nongnu.org; Mon, 09 Nov 2026 15:30:29 -0500 Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6A9HH71i879249 for ; Mon, 9 Nov 2026 20:30:25 GMT Received: from mail-dy1-f199.google.com (mail-dy1-f199.google.com [74.125.82.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4hucr5t24a-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 09 Nov 2026 20:30:25 +0000 (GMT) Received: by mail-dy1-f199.google.com with SMTP id 5a478bee46e88-36f26e6abe9so2229375eec.0 for ; Mon, 09 Nov 2026 12:30:25 -0800 (PST) Received: from hu-bcain-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3752060dc0csm823737eec.14.2026.11.09.12.30.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2026 12:30:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= 42bq2TLvBR91FB9721+WCAnGkGl91+gPvA1PHP1ZjlU=; b=VyjawCcdmWLbdHgD oXnQTuv46N71OGxuoMmKPq43U5NIFpvD/blSQKsgmRO0iD4IrlMcxl1LpgtA8s5x FDFnfEtxHOY6q7qEn/pNMHYxlLJQHKii+P8hHhjuF24s8Z9vMiyHmYFk57jUxxYb tg8JYzCsoTOxE2kLOTX4f3w+1/KFssjdqFaraY9Zi677WE4rOy9oZrH/okvdmCew KUqvEqyPAk6DxAk24MehTZ9nulqbpg75qXakCVNjBMIrj64c/C3O1rmTpdi3AUdg msST1lMS+2hHODN0HTF+vznGsBTXa9rDjPCP/hxySm3PhoNSebB801oC5zEVqLkp Xp0mUA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1794256225; x=1794861025; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=42bq2TLvBR91FB9721+WCAnGkGl91+gPvA1PHP1ZjlU=; b=KETPPNvh8++C4tcTmQWapkDJ6FGUwsahkSn3gsnE2Ophsmk3JN5H9RtmOepOS0iH6j AMBO98Y5VvvPAxakFEw7SXpRTnfagglRrDbJf1qcTyJx85ctU3kA6OrR4M0vdRtzkC3D kxXfjUpZqEUDPAo5PI3h+/0P2dFijtufZvKNB1+fM9vm6yrkCKgOdJYcG3PagTM4qpAJ qEpQplgEKg8EM2TaUaIQzwT0Ca+OPTXWEYqoAXOHmqlQ0E+oYzubF59fKJ6u9JnvcE06 Xyf+KLWl1Ir0F2z/z3eSU+UaWFvwUXgGLf3ZDh7ET3G1g2H+df8JwethjpZyQY7uFeIU dRgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794256225; x=1794861025; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=42bq2TLvBR91FB9721+WCAnGkGl91+gPvA1PHP1ZjlU=; b=MljT4gsUo9Aa9XBOd0axq0+vOm//eULj48mM9iRZafZORLdgr/tGls7iXQEogIXRRv d3//Lk0fzJISLvKu3WaiGeG/9rFdeft/foYX7jBXbmg+vBzkW8Lhdj7a+9lqJDlH31zq HwNEV705LuUwQwqopjszsBKlpqAZGojsQ+K+9oE9vMYrrGyvC2sGvcBA8XrQmms9Xqsk Bc1iGBHcX4cmAVDbP6tsIHrK9oAhZvT/fjCBfgQ9CsBAKlom2pWjeaZpJId8aEPPxSFo m0jJjjJ1RW5HN3pkwXJW1GgOYVWyxWi28ewgO2kNyTHxp1xN/KIHCKblX7xUdDeaICji g/rg== X-Gm-Message-State: APuU4Z/ULSMQ4XTa95Dk38kjgRqsALf1KSTWfdvoESalG0YdRyzO12wp 3qdp5QhdLLxofIVodET65CFwLjqT6tAPz+Kzb8SJoGORLzS1Ub2ElKL2BJPhWx7wwe0D/Lg9uMt lSZ/lLti/ZqkOc/ZUEHEp+c8/oQ1eKjXw30lXk66lf8YVx9AKwsnN6/tndf/9bncOxw== X-Gm-Gg: AYBFou3M3+Wb0fyO341uVpLf4JvfQ7grI61aMs1JZS+lpkl872MgiyAm63uWgUfcOTH xFhrnpoTk3R9yNc5mxFfkUgbgG//4FKi9A1EB8O27omVU3j1i/iWHCYrFMzaZm64Gk/Ujd6PEsG vPaxWUMYAJXpvJmvHOiQjRd9FIyc+imjaPhzbJskwBUVII/j0mmxsLnySCPiV6nYs1McC/Z3k5v H9e4qCx2Sz30R/xm4I/KT5VaM9MOQOyUCnf820BHNhVcZimEs3tqtXbMnLY+bLyILkpyU4ZdYX4 QGC+MoKtbPAQGXvJLTIQGBTBNLuMmh6wHce/QvnnE1XkrnUn9j187fO962RKqHP69idAyXKBHei QUh4P7JZgXM7XXTravn5rvyGmRvMR7ogQu+DKTcE3u46/3iYfmG8sgbRRLVUrrgWxBpXLTn3CfK GmHNcW0hMgwxM+R2GUP1Pc X-Received: by 2002:a05:693c:65d6:b0:375:388:a6d5 with SMTP id 5a478bee46e88-375211f1c97mr459094eec.32.1794256223089; Mon, 09 Nov 2026 12:30:23 -0800 (PST) X-Received: by 2002:a05:693c:65d6:b0:375:388:a6d5 with SMTP id 5a478bee46e88-375211f1c97mr459025eec.32.1794256222055; Mon, 09 Nov 2026 12:30:22 -0800 (PST) From: Brian Cain To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , Brian Cain Subject: [PATCH v2 3/5] docs/system/hexagon: document boot interfaces Date: Mon, 9 Nov 2026 12:30:15 -0800 Message-Id: <20261109203017.262225-4-brian.cain@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20261109203017.262225-1-brian.cain@oss.qualcomm.com> References: <20261109203017.262225-1-brian.cain@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Info: AW1haW4tMjYxMTA5MDA4MSBTYWx0ZWRfXwsmTh8bcLywj jkwaakj6LZYwCPK7YZHFXK4PEoYlQw8V+Z1QHhWzLFPYSQX+QBMIeJxrDdR19w3C2iZpgDEEz7u F0e/SiH8EtMMFvVxls0vMod9+2wExKw= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMTA5MDA4MSBTYWx0ZWRfX9WF9yO6ZRomo ZedmVfRctQMoQTF++/tM3Knk0JUDGHwhEnbkzDmEDI3+zdX5MBXpLzWuAS1uT/DY5q0eb9KGr/x haYqEJlt1toNKbLTbvBimU/lUlGL5xu60IH2rQtezOg1c0g1VDJg//3zAg3YLT6/fYP1VIqU50f 3uCJ0jImda6IkPEdNOUecNPPvzkMAxgDTOFMaU26ZHf/aa3LLu06XkH6Tb+qNu1gkYGuCJmyNSw QxonrUisBtCw25nqD28Ks/cb1uTqHwDh/e1y6XJUhTvMnYfcpyYYZeXHOJnDFaSzfm8Ye3ES2N6 gmu90rTpa/GpV5+gdStT9lOpAlYzifDKors3V1XJ6AbdeOYKudHk97NowMOf996eUNwl/FjoW1L BPbu17Qn7Lt5YCOFm73CG7n9ZzzBnAA8gbDr/y3xSzCBQ3N+bjzYU/KZC/IVJs/mrqJl5jZFUUy pxf9eHkAb1Ep1NaJscQ== X-Authority-Analysis: v=2.4 cv=ErlHPicA c=1 sm=1 tr=0 ts=6af22d61 cx=c_pps a=cFYjgdjTJScbgFmBucgdfQ==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=IkcTkHD0fZMA:10 a=zJRp6_cAMcgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=Um2Pa8k9VHT-vaBCBUpS:22 a=EUspDBNiAAAA:8 a=P_3Ky2eAZP25M8n5cw8A:9 a=QEXdDO2ut3YA:10 a=scEy_gLbYbu1JhEsrz4S:22 X-Proofpoint-ORIG-GUID: RCXQNVAFHxkAsCzVCmCVXPN-S8PGE3jy X-Proofpoint-GUID: RCXQNVAFHxkAsCzVCmCVXPN-S8PGE3jy X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-11-09_06,2026-11-06_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 phishscore=0 malwarescore=0 spamscore=0 bulkscore=0 priorityscore=1501 suspectscore=0 impostorscore=0 lowpriorityscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2611090081 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.168.131; envelope-from=brian.cain@oss.qualcomm.com; helo=mx0a-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @qualcomm.com) X-ZM-MESSAGEID: 1794256287262158500 Describe ELF and raw-image loading, reset state, the DTB handoff to VM host firmware, and initial thread state. Explain UART and semihosting console routing. Reviewed-by: Pierrick Bouvier Signed-off-by: Brian Cain --- docs/system/hexagon/boot.rst | 100 +++++++++++++++++++++++++++++++++ docs/system/target-hexagon.rst | 1 + 2 files changed, 101 insertions(+) create mode 100644 docs/system/hexagon/boot.rst diff --git a/docs/system/hexagon/boot.rst b/docs/system/hexagon/boot.rst new file mode 100644 index 00000000000..36c603c69e0 --- /dev/null +++ b/docs/system/hexagon/boot.rst @@ -0,0 +1,100 @@ +.. SPDX-License-Identifier: GPL-2.0-or-later + +Hexagon boot interface +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +``qemu-system-hexagon`` loads the initial image. Guest startup code +initializes the stack, exception handling, and runtime state. When a +Hexagon VM host is loaded, it establishes the guest OS's boot environment. + +Initial hardware state +---------------------- + +Only hardware thread zero starts executing. Other threads start powered +off. + +Execution uses untranslated physical addresses in monitor mode. Guest soft= ware +must populate TLB entries before enabling the MMU, and set up exception ve= ctors +and interrupt masks before enabling interrupts. See +:doc:`../../devel/hexagon-sys` for the system architecture. + +QEMU sets thread zero's PC to the selected image entry address. ``EVB`` +initially contains zero; ELF startup code installs its own aligned event +vector base. + +Simulator-compatible machines +----------------------------- + +``-kernel file`` loads a little-endian Hexagon ELF, places its loadable +segments according to their physical addresses, zero-fills the segments' +remaining memory, and starts thread zero at the ELF entry point. Link +startup code for untranslated execution, with the entry point accessible +at its linked address. + +The virt machine +---------------- + +``-kernel file`` alone loads a Hexagon ELF into DDR, which starts at +``0x80000000``, and starts at its ELF entry point. + +``-bios file`` alone loads a raw firmware image at the start of DDR and +starts executing there. + +``-bios`` with ``-kernel`` boots the kernel through Hexagon VM host +firmware, as described in :ref:`hexagon-vm-boot`. The kernel window starts +at ``0xa0000000``. + +Otherwise, guest software reads the generated DTB at ``0x99800000``. +``-append`` sets its ``/chosen/bootargs`` property. + +Board-specific machines +------------------------------------ + +Both ``-kernel`` and ``-bios`` accept Hexagon ELF images. The combinations +have different meanings: + +.. list-table:: + :header-rows: 1 + + * - Options + - Loading and entry + * - ``-kernel`` alone + - Load segments at ELF physical addresses and start at the ELF entry. + * - ``-bios`` alone + - Load firmware segments at ELF physical addresses and start at its e= ntry. + * - ``-bios`` and ``-kernel`` + - Load firmware normally, relocate the kernel segments into the board= 's + kernel window, and enter firmware through a QEMU boot stub. + +The combined case is described in :ref:`hexagon-vm-boot`, using the kernel +base in :doc:`cdsp`. + +``-dtb file`` replaces the generated tree. A nonempty ``-append`` value +sets its ``/chosen/bootargs``. A replacement tree must describe the +selected hardware-thread count, actual RAM, and matching device drivers. + +.. _hexagon-vm-boot: + +Booting a kernel through Hexagon VM host firmware +------------------------------------------------- + +On the ``virt`` and board-specific machines, ``-bios`` with ``-kernel`` +starts the kernel through Hexagon VM host firmware. QEMU loads the firmware +ELF as linked and adds the machine's kernel base to the kernel ELF's +physical load addresses, so the kernel's addresses are relative to the +start of its window. The kernel must use the corresponding Hexagon VM +guest layout. QEMU starts thread zero at a boot stub at ``0x99c00000``. +The stub passes the DTB address with the low word in ``r0`` and the high +word in ``r1``, then jumps to the firmware's ELF entry point. The Hexagon +VM host defines the child VM's register and execution state. + +QEMU places the DTB after the loaded kernel. QEMU copies it to guest RAM +before entering the firmware. An optional ``-initrd`` is placed +after the DTB base. ``-initrd`` requires both ``-bios`` and ``-kernel``. + +Console and semihosting +----------------------- + +SDK simulator programs use semihosting for console I/O. The ``virt`` and +board-specific machines also provide a PL011 UART, whose host backend is +selected with ``-serial``. diff --git a/docs/system/target-hexagon.rst b/docs/system/target-hexagon.rst index 7b7d0bc31bc..e091b75c7a3 100644 --- a/docs/system/target-hexagon.rst +++ b/docs/system/target-hexagon.rst @@ -107,5 +107,6 @@ machines. This can be further configured through ``-sem= ihosting-config``. :caption: Hexagon documentation =20 hexagon/machines + hexagon/boot hexagon/emulation hexagon/cdsp --=20 2.34.1 From nobody Mon Nov 23 04:34:19 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1794256374; cv=none; d=zohomail.com; s=zohoarc; b=lGVRzGV6UUBC5IapUZtbqcgCI019pWgpyyGRge+EVVhHqDfga+aVHSc9wHjtm7T8yQyjTw73maLBTg1UWX/cePsagmeBvt7K3SXDgaGw3YvVGb3Dxg9hAb+Lm5RowBn/gD08r0KE4rB1qRwSQs1/4oXovO/TuoV7BHG24JOzcPw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794256374; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Id3ds9IJWY+XtMbYAPcj1jaG0pTTJrImc70kxSQla5o=; b=TiM+a+LAfCOYT+3PEM8prcKY/pcjE2F5Ej1H9I8O466uuEur5LioVtOXZSnNMKHrO+0GLngnwP34oEPjdvN7JU4yu4u8T+5ZsUO+43l4yGHyA0PPxJMBibeTARIKzanA1H/OgCTIZs3Fbnk3Jtjrj5VftsQ6nFbF/QVo3y9wDD4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794256374732821.3597386493977; Mon, 9 Nov 2026 12:32:54 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xQW1A-0003aB-8V; Mon, 09 Nov 2026 15:31:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xQW0d-0003OU-GP for qemu-devel@nongnu.org; Mon, 09 Nov 2026 15:30:33 -0500 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xQW0b-0007IS-19 for qemu-devel@nongnu.org; Mon, 09 Nov 2026 15:30:31 -0500 Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6A9Jftln1830313 for ; Mon, 9 Nov 2026 20:30:27 GMT Received: from mail-dy1-f199.google.com (mail-dy1-f199.google.com [74.125.82.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4humjg054d-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 09 Nov 2026 20:30:27 +0000 (GMT) Received: by mail-dy1-f199.google.com with SMTP id 5a478bee46e88-37390b2989bso2168123eec.0 for ; Mon, 09 Nov 2026 12:30:27 -0800 (PST) Received: from hu-bcain-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3752060dc0csm823737eec.14.2026.11.09.12.30.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2026 12:30:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= Id3ds9IJWY+XtMbYAPcj1jaG0pTTJrImc70kxSQla5o=; b=jHjGnoDF6zYwmcGr pD5Jmu/mY2+CpaqEhDzc/26NNIC6/AqBvTfKlTg/DjUVtKvDS8jHCLI/LDPN+CBl tVAZ5sIkXg4Brkg4I55RnITrzL481ftkkyC5nN6qCdF1a1GH9wQLOZalW4rI8oAK ITyI5rsG2cdunCtSvVeHkxAA3fk3oe8BPFWb4V0AINzSQQPdSppfA1XUtEVBeEgZ U+li5VX4aTW28jqDvvfWnwlJeFTVjq52HEiRYmA7CHtMrIyCyPwmSaQWxa4bhOrO dFTbYJ9zMJcO7CRrXMloHw9MG2Iewmvb+8eo/roRG521XxFxEjDXu4HxI5mOWlKv ZolC1w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1794256227; x=1794861027; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=Id3ds9IJWY+XtMbYAPcj1jaG0pTTJrImc70kxSQla5o=; b=h/a2RFosg20+mZWEDt5i/UfiEQa6n4/aNBp+/r5V5A8fPxfKxwVx6/R7ozbeSkiOim 0q4nRZrbEumEesmtMYpj9SRPeF94An+oMl67Ji5Q/A9QVlYwrE0rsYPD195hd2oEJfB5 Gh6UywZOgl482Qvr9BZ5aEpx7PAnreEeDvFOvgHH+66B4HLzdrkLRPQRu1P2BVAp1xci OYgWvS1KG1mGI/XPbECRietd/huqWK23vTN8C3/YU8kII+w2KVx3KRMy9sH7VRv7jnQJ 9rDoOTZxWfXLK0jlOzdpMDLTCzCZ+jC++Hjmv6AzGsDF/prUWVxmTs2YEBfEROFYYxYM zX8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794256227; x=1794861027; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=Id3ds9IJWY+XtMbYAPcj1jaG0pTTJrImc70kxSQla5o=; b=C3qvxYAiyDWtiegn+sMn4/pWcYwTdt9+/bFb3IF7QMJU3SAg1mtH74fOfyFwUuMqBM 6aYu84kxGMiCRoFj93OYSznKejktobooWop0yGPSl5HWDLXR1xju9WfnNcRs0PZMzNYA 5gTd8aU4EEcclSvW9UpSnHuoVJsBkE8EPcMYARXIqRXrAnRClG3/vPz1C1YQ9ZoWBc+5 h3kal9kXbzF9C+dkVvkjam+7lVAmQQ8ZRZmgC7zEo3vWi5/i6nUi/lxM2WnhO2mLitbT CKk3gxE1Hbx2u0WkSwBJ94R/UyNspUh3x8A8UBF5nLiuRitjmH5QGguwc5U5J2s5EkWn YIFg== X-Gm-Message-State: APuU4Z8IhPavrvVUT111W4NqVWbpHu2ldFIIa9mMR+Twi5FG9qZQXBWT d+nQGi/vnOuxuSlmD18PTlN8RGvODp7UYUAZv5FDUsm7Esg2MQyUAo+4mLjlwaIrwRsVutrh7D1 CvBHN7+KfdWrmi4iZaUjpYIvBsgQsp3WJLvTU3VkysEsRVi/442nx13AzAIRXiAPNpg== X-Gm-Gg: AYBFou0X4utCfbMEdzhlnCV4nT95LXA4Mi0rHTz4qA+M+GpKhhAg4aNXgPuY6IFhnl8 Q/tM+aMF5bBN7WhdEsuqXf6+VJHP1Ig3FxdzbR0uSz9kifk2etpkG8hjq3YToYbjTclIDeBLRVd FFSQZX9Fi7JhRXdkf/KIWuQLXLO+D0iqbSTL4QppYFhg1Ot+SFXA7UUnvOipwUukHowZqRyAqgI qt6FshTCs8UyorQ+Wr7BS37lzW4vKmD16qgYGcfRl+Bcnbg8dI6rj9mZ45LQNKIpgTXra7ymzJD uHgCuecqcSTs9JLDWX1cCMXAb7yqdQhbNYLKUFt+BiKJgR5gHV9IVKllvVXenxl5/BC1vmAykrF xkjNPJwaFrVzifL2yPmcptfe1zoqTcuJTzSSJXpHdyZ0F64QjKUzliE8fHAY4oAyb1uMl1fbsyB P2x06MtY3RdCOUVwtdEAsv X-Received: by 2002:a05:7300:4f1b:b0:36d:25e:1961 with SMTP id 5a478bee46e88-3751f36678fmr432022eec.22.1794256225071; Mon, 09 Nov 2026 12:30:25 -0800 (PST) X-Received: by 2002:a05:7300:4f1b:b0:36d:25e:1961 with SMTP id 5a478bee46e88-3751f36678fmr431961eec.22.1794256224111; Mon, 09 Nov 2026 12:30:24 -0800 (PST) From: Brian Cain To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , Brian Cain Subject: [PATCH v2 4/5] docs/system/hexagon: document SDK semihosting workloads Date: Mon, 9 Nov 2026 12:30:16 -0800 Message-Id: <20261109203017.262225-5-brian.cain@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20261109203017.262225-1-brian.cain@oss.qualcomm.com> References: <20261109203017.262225-1-brian.cain@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMTA5MDA4MSBTYWx0ZWRfXzj8XSNM7gYXt CzelPK++1yyfLuVqU3GxCYFzCNEBqxyG3ANEG/Pgz4la7y9tn4iNZ7cZGpsAtft6oPdGP2ryWv5 wn2/9Y4tosANvNfedp9/Dx4X52VT0+Z/m0huwuXfJndDbbVwNZ6O562R49tfxpGYNuv4OOZbFNl ySDKAIk4WKrO770MBO33uJ1bvZFBvr1ajTPTw/iTSx9jQjr5mptCbyqxRjIov2fSnQnNtBBsd6Y 65ZXkAJaISWe1pFiUMSs0iSH+yWkajs1NjSvJc53tMw821wqu3op66U+Bt65XLxlOmCyooHfX7w VMpEdhrshA2rgvXa8f04Snn2zYuHMkEv7uO4gfcgluIjxP4xpS/yVLw86WLl87OodiWZOO68ULx 6t1Yi4NyA70QyCMpMizNChWwKMj8x26r4P1zbJc6YIMJFpUstyLG/CSNmFpjyrEZTB7Xmv2AKJD 5aXej8DR7g2pc8IHwBA== X-Proofpoint-Spam-Info: AW1haW4tMjYxMTA5MDA4MSBTYWx0ZWRfX67hPO8yCd2YH laYatNzokgxJ3H7lS5N8GZ3nwFCOU/Aq6764/GqWHypyMlzZ1mx9EI4o/LvTf//4rLgoxYvrCAF bAxVfTVMhe9N3P0K81kMtfKsD3ZyJsA= X-Proofpoint-GUID: 8Hk1vDYrNLsTFPKYoSF_k-LyewKo3D06 X-Authority-Analysis: v=2.4 cv=B6gsQ+tM c=1 sm=1 tr=0 ts=6af22d63 cx=c_pps a=cFYjgdjTJScbgFmBucgdfQ==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=IkcTkHD0fZMA:10 a=zJRp6_cAMcgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_glEPmIy2e8OvE2BGh3C:22 a=EUspDBNiAAAA:8 a=9FDP4kz7Fxl891_oENQA:9 a=QEXdDO2ut3YA:10 a=scEy_gLbYbu1JhEsrz4S:22 X-Proofpoint-ORIG-GUID: 8Hk1vDYrNLsTFPKYoSF_k-LyewKo3D06 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-11-09_06,2026-11-06_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 lowpriorityscore=0 adultscore=0 suspectscore=0 priorityscore=1501 impostorscore=0 bulkscore=0 spamscore=0 malwarescore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2611090081 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.180.131; envelope-from=brian.cain@oss.qualcomm.com; helo=mx0b-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @qualcomm.com) X-ZM-MESSAGEID: 1794256376715158500 Show how to run standalone SDK programs and the QuRT loader chain with an explicit v68 machine. Reviewed-by: Pierrick Bouvier Signed-off-by: Brian Cain --- docs/system/hexagon/sdk-programs.rst | 155 +++++++++++++++++++++++++++ docs/system/target-hexagon.rst | 3 + 2 files changed, 158 insertions(+) create mode 100644 docs/system/hexagon/sdk-programs.rst diff --git a/docs/system/hexagon/sdk-programs.rst b/docs/system/hexagon/sdk= -programs.rst new file mode 100644 index 00000000000..2edfe28ad66 --- /dev/null +++ b/docs/system/hexagon/sdk-programs.rst @@ -0,0 +1,155 @@ +.. SPDX-License-Identifier: GPL-2.0-or-later + +Running SDK programs +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +``qemu-system-hexagon`` can run SDK programs that normally run under +``hexagon-sim``. The boot image depends on the runtime the program expects: + +.. list-table:: + :header-rows: 1 + + * - Use case + - Initial image + - Subsequent stages + * - SDK standalone OS + - ``-kernel prog.elf`` + - Startup code calls the program's ``main()`` + * - SDK QuRT dynamic program + - ``-kernel runelf.pbn`` + - QuRT loads ``run_main_on_hexagon_sim``, which loads ``userprog.so`` + +SDK programs and semihosting +---------------------------- + +The simulator-compatible machines, such as ``V66G_1024`` and +``V68N_1024``, provide semihosting by default. The SDK runtime uses +``trap0`` calls for services such as console I/O, host file access, and +program termination. + +See :ref:`hexagon-semihosting` for more info. + +The examples below use v68 SDK artifacts with ``-M V68N_1024``. + +Standalone OS programs +~~~~~~~~~~~~~~~~~~~~~~ + +By default, ``hexagon-clang`` links a bare-metal executable with the SDK's +standalone OS startup code and C runtime. This small runtime initializes +the machine, calls ``main()``, and implements hosted services through +semihosting. + +For example, save the following as ``prog.c``: + +.. code-block:: c + + #include + + int main(int argc, char **argv) + { + for (int i =3D 0; i < argc; i++) { + printf("argv[%d] =3D %s\n", i, argv[i]); + } + return 0; + } + +With the SDK tools on ``PATH``, build and run it with: + +.. code-block:: sh + + hexagon-clang -mv68 prog.c -o prog.elf + qemu-system-hexagon -M V68N_1024 -display none \ + -kernel ./prog.elf -append "foo bar" + +The program prints: + +.. code-block:: text + + argv[0] =3D ./prog.elf + argv[1] =3D foo + argv[2] =3D bar + +Guest command-line arguments +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The example above passes the arguments with ``-append``. QEMU uses the +``-kernel`` filename as the first semihosting argument and splits +``-append`` on spaces to supply the remaining arguments. The host shell +quotes keep ``foo bar`` together as the value of the QEMU option; the +guest runtime subsequently parses the semihosting command line. + +You can instead specify the semihosting command line with ``arg=3D`` optio= ns: + +.. code-block:: sh + + qemu-system-hexagon -M V68N_1024 -display none -kernel ./prog.elf \ + -semihosting-config 'enable=3Don,target=3Dnative,arg=3D./prog.elf,= arg=3Dfoo,arg=3Dbar' + +Include the program name as the first ``arg=3D`` value. + +``target=3Dnative`` selects QEMU's implementation of semihosting even when +a debugger is connected. To connect the semihosting console explicitly to +the terminal, add a character device and select it with ``chardev=3D``: + +.. code-block:: sh + + qemu-system-hexagon -M V68N_1024 -display none \ + -chardev stdio,id=3Dsemi \ + -semihosting-config enable=3Don,target=3Dnative,chardev=3Dsemi \ + -kernel ./prog.elf -append "foo bar" + +QuRT programs and the SDK loader chain +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +An SDK QuRT dynamic test consists of three guest images: + +1. ``runelf.pbn`` boots QuRT and loads a user process from a host file. +2. ``run_main_on_hexagon_sim`` is that process. It initializes the dynamic + loader and loads the application's shared object. +3. ``userprog.so`` exports ``main(int argc, char **argv)``, which the + runner invokes. + +QEMU initially loads only ``runelf.pbn``. The subsequent stages read the +other images through semihosting. Use matching SDK architecture variants +for the boot image, runner, and application. For example, with Hexagon +SDK 6.4 and its toolv19 v68 artifacts: + +.. code-block:: sh + + runelf=3D"$HEXAGON_SDK_ROOT/rtos/qurt/computev68/sdksim_bin/runelf.pbn" + runner=3D"$HEXAGON_SDK_ROOT/libs/run_main_on_hexagon/ship/hexagon_tool= v19_v68/run_main_on_hexagon_sim" + qemu-system-hexagon -M V68N_1024 -display none \ + -kernel "$runelf" -append "$runner -- ./userprog.so foo bar" + +Build ``userprog.so`` with the SDK's QuRT shared-library build rules, +including any libraries needed by the application, and place its shared +dependencies where the SDK dynamic loader can find them. + +The command line exposed through semihosting is: + +.. code-block:: text + + -- ./userprog.so foo bar + +The fields have the following roles: + +.. csv-table:: + :header: "Field", "Consumer", "Meaning" + + , SDK startup, Boot image name + , runelf.pbn, Process ELF to load + --, run_main_on_hexagon_sim, End of runner options + ./userprog.so, Dynamic loader, Shared object exporting main() + foo bar, Application, argv[1] and argv[2] + +The application's ``argv[0]`` is ``./userprog.so``. When translating an +SDK simulator command ``runelf.pbn -- runner -- userprog.so``, omit the +separator immediately after ``runelf.pbn`` from QEMU's ``-append`` value. +The separator after the runner remains part of the guest command line. + +The equivalent explicit semihosting configuration is: + +.. code-block:: sh + + qemu-system-hexagon -M V68N_1024 -display none -kernel "$runelf" \ + -semihosting-config "enable=3Don,target=3Dnative,arg=3D$runelf,arg= =3D$runner,arg=3D--,arg=3D./userprog.so,arg=3Dfoo,arg=3Dbar" diff --git a/docs/system/target-hexagon.rst b/docs/system/target-hexagon.rst index e091b75c7a3..dac8b9b3483 100644 --- a/docs/system/target-hexagon.rst +++ b/docs/system/target-hexagon.rst @@ -93,6 +93,8 @@ its entry point:: =20 $ qemu-system-hexagon -M V68N_1024 -kernel ./prog.elf -append 'arg1 ar= g2' =20 +.. _hexagon-semihosting: + Semihosting ----------- Hexagon supports a semihosting interface similar to other architectures'. @@ -107,6 +109,7 @@ machines. This can be further configured through ``-sem= ihosting-config``. :caption: Hexagon documentation =20 hexagon/machines + hexagon/sdk-programs hexagon/boot hexagon/emulation hexagon/cdsp --=20 2.34.1 From nobody Mon Nov 23 04:34:19 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1794256324; cv=none; d=zohomail.com; s=zohoarc; b=hnbKKZ7NHA1R8OcqXfBHJXuX/oJbWSDjiJp6v3xiJSzdJkAFg0tVsRgf33sv5/PTQJbGtu9LM1sdNhyO3fTNLHyKkNlTXEjUkP6yxqrowBrjizRWXnBT63gzrXcxh82QfwakYrmW12/J/w8HiLbgcrzgd3wvdosuiORmxtEhbb0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794256324; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=sRtvnKv400vEameoQRJ33TnxrjTDXZ8FFaT4zrc3vEw=; b=XhxLlRnFU3FNHAG+0bu5g1/TxhyDLUZZ08/1UspewzNrS6/aNLYESLkNC2vRAM4ES5EBGsZl1Pgn29ylUkpkq0hfNWQQ9/hgI/BO5CvcItfjJ2VQOPdAeJ64/YwAtxLVq86+I+rxlDvQ0xac0aV+jWVII+JFitijRCiWkvBqwn0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794256324953953.742422458907; Mon, 9 Nov 2026 12:32:04 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xQW18-0003YG-2p; Mon, 09 Nov 2026 15:31:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xQW0f-0003Q2-I7 for qemu-devel@nongnu.org; Mon, 09 Nov 2026 15:30:51 -0500 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xQW0b-0007IZ-GT for qemu-devel@nongnu.org; Mon, 09 Nov 2026 15:30:33 -0500 Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6A9HHNUO899784 for ; Mon, 9 Nov 2026 20:30:28 GMT Received: from mail-dy1-f197.google.com (mail-dy1-f197.google.com [74.125.82.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4hu6x2kegp-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 09 Nov 2026 20:30:28 +0000 (GMT) Received: by mail-dy1-f197.google.com with SMTP id 5a478bee46e88-30bcb065bfdso2378529eec.0 for ; Mon, 09 Nov 2026 12:30:28 -0800 (PST) Received: from hu-bcain-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3752060dc0csm823737eec.14.2026.11.09.12.30.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2026 12:30:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= sRtvnKv400vEameoQRJ33TnxrjTDXZ8FFaT4zrc3vEw=; b=iQs4hSbOFtLLVMbr X5sdFiQqAJFCQOA00ekBIKQUD56oxhuCL1Uoa4cZ15hloIw1Zt55hqwJ4s09SrMW fFaql4eh3xhq6Nr4mCKcBrGO4VASK8MVgueMIvU+YF1mymp4KIu1meTBUFsgv5KQ Ux8t7cjDctmYUI7ITyPsR3/V1rMemRxjMlwoVgTz+86+LPu6reQLk3jtvPkU3ztt Z677c5y5LBwBfHE3mXertDBCbv0DN/dhbPddFsiPov4O8kzvQW844w/h6Z5XiLwG k+wKcsLfNtXiRbBt+L7mv2ImRezJcQfW0B29/WtqVuwU30XncIHCAlF0wsxhBbYt QOXUqQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1794256227; x=1794861027; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=sRtvnKv400vEameoQRJ33TnxrjTDXZ8FFaT4zrc3vEw=; b=fUfqkVBl3bHxCyPU8wqHQwR+e4w9vfZ6eQDnMvxeXc91v5Mn6DPLk5B8dfuz7GUsOa hhGBplm9kvKLN+7H+qOIwMzc/ggFah0Iym2+Q10CyyBFxRAnFjYPVNiB77jrrE5FQtmD C6Z9p57dsP/qYpY+jdgSotJTgsAPcEvwRGm54VLjpVfERKKDV0Zui1oHmvFVXVFSNVLP 0LrVwnxA7tA2afnq/4ztnUwaLdT8IBzt7tPDfr+50nNmcYCdzsqN990MbG/at9W6IxoQ WHWVzGZHyp09YQIO/Hy/3wC0vjeR/skOKlyNSU1pyBS2/P+hl/hxrFKWiU98DZsm8cvE RICw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794256227; x=1794861027; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=sRtvnKv400vEameoQRJ33TnxrjTDXZ8FFaT4zrc3vEw=; b=CyPbjEM/SzE3vJVfH/CErX/75k6aVR2ebH2maIwE+17uuWu075tvYVFgx3WaQL0Hu8 zoHNHp7e/8lne5UijCayZbHcU4thA0VtWW0mev6zZEyEFegAXwiW+QUy6/01fat588Eq Y9RKrAVRozsyGvDy5JUnaOrc6zGuQQIQUUEZyVvsa0fAWfjWoY3Tpr9pCKoem8JD1XWg +7GKl/KJvsWjrg3vfB8u+pvhckkq0jTz0RihQPmdeQ/ZP2VyAoYSSAqdh7WQkp5GuTsS L8vcdofEGTNIZzOqdFvdpEfNQ42Oq5i4u4dSF362lQBSvEd1YGYjHaTu4oERFmzKJvmE K6WQ== X-Gm-Message-State: APuU4Z/ShYefIDSXVDu96kmka78fw61EeB6fChCbFjXO5vyQeMFH7fwH cN0M5pFh0c+ToHEABEiqS6Ej9jWsbCculXLcV1uWIqe2Sx1iJoQbnAYHo8NZgACD1YxysxQOQLE hEKmQLo0YMr/o9z2WKoXyQk0SsSBUA6S+KBtm+1VNcgvTbrqxpXwkF6FMo0URatKq1A== X-Gm-Gg: AYBFou1E7ANwXVXOyVxJw9J4AqTl6Q6afEAVRQwd3vuiKZ8n9+OOe/A/5yo3klA748G K752eihDjZzE3yR+XNqKRifidhPW3kaxXGGIpsU2CUEtAitJKJ9zwOMfAKTodSILsgMF1HbrUuB Y1m6jjH4PMSqLlb+5WizpALXJ8ETTenjIyjFF43FC+9t+zwKHQ0jfcTJZQJ9E+xQwfB8A42ZFx0 Hp+9C1fnuPfJp7t5uPaoueacDuaCbStbJ/YI+a6bUg/VIQFgPe/+KFvbf7BVPSe84oqNdzTMURx 4tXvpl0vHxP64MIikHP5a2RTk4JkNgeHpdpbDN/+rl+M5S+5C0bCA0052YsTHXAnD0wTxQiup5D dUxcdaAMcZJ5w+PYYbySNOAcc2yxDD+i2gG5HGdA/8gmVVNUCVLJkzk60j/PC6Cu/U82VkWsS3t Z+CIl1OMZNTJDHayFMU4Md X-Received: by 2002:a05:7300:ed0e:b0:36d:2b02:86a6 with SMTP id 5a478bee46e88-3751c63a111mr692665eec.4.1794256226379; Mon, 09 Nov 2026 12:30:26 -0800 (PST) X-Received: by 2002:a05:7300:ed0e:b0:36d:2b02:86a6 with SMTP id 5a478bee46e88-3751c63a111mr692556eec.4.1794256225210; Mon, 09 Nov 2026 12:30:25 -0800 (PST) From: Brian Cain To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , Brian Cain Subject: [PATCH v2 5/5] docs/system/hexagon: describe integrated firmware OS boot paths Date: Mon, 9 Nov 2026 12:30:17 -0800 Message-Id: <20261109203017.262225-6-brian.cain@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20261109203017.262225-1-brian.cain@oss.qualcomm.com> References: <20261109203017.262225-1-brian.cain@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Authority-Analysis: v=2.4 cv=TMjQ2Fla c=1 sm=1 tr=0 ts=6af22d64 cx=c_pps a=Uww141gWH0fZj/3QKPojxA==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=IkcTkHD0fZMA:10 a=zJRp6_cAMcgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=gowsoOTTUOVcmtlkKump:22 a=EUspDBNiAAAA:8 a=DCEdGjf_N-zXLgs_qoUA:9 a=QEXdDO2ut3YA:10 a=PxkB5W3o20Ba91AHUih5:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMTA5MDA4MSBTYWx0ZWRfX2bT34ubtgkYt OwGP08K4juRF+GdpvWokbojRDVGWQx/mMacG+S2ROH6iIRXp9rlF5ONpCX522VO00v4VO1KTe5E r5SwtJAyN8kwNK1y1IW2Whuql9soUxBy37Ft4KNep5gilT32dUsKWewMbzuuSPsMMoiw/EZKMzO 2q8Lux1tntYzH+H3QDesJ4VCvgKKXWPwZP9feB4Mz2HtZWRzAM/mIRSgg0p/2q5eEA885IpVp8i T8z0esManCjOAgXhu1sdcth+x1XS2K+cJjrMqI9oENr87UqlTu+0DjocGr9DMniokhVy9XiJpZk kqxDy3RuC3cInn+UT0zgD9ZiLlHegtjmeAmeOblLJpqBiXdPIgcUmGj/psRF1wz1wX6NpQrdmgc zAdcPUFDpACbSwIvsKnwPLcLpCX6tLeMKN3YK+BDibyYH8Zen15G4MlOhgoy64jbGl3ZTSO+NaJ W5d+r7T4CyOQ03SH0LQ== X-Proofpoint-GUID: f7Xi30Y-T-Jv93T8LPifdwH38A8J-hlR X-Proofpoint-Spam-Info: AW1haW4tMjYxMTA5MDA4MSBTYWx0ZWRfX/pjzPRy4YfYS cvyuYHUA/CCo7Zy1sM1fR6vdkKvOSCxlnt2QhRAEedJ2TDCNDvpOV5g1YkRIg3R0XTTw8B+4n/o ymZEI2Sfs52QJ2Uwlr4+uBCBnDkg0LI= X-Proofpoint-ORIG-GUID: f7Xi30Y-T-Jv93T8LPifdwH38A8J-hlR X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-11-09_06,2026-11-06_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 adultscore=0 lowpriorityscore=0 clxscore=1015 malwarescore=0 phishscore=0 priorityscore=1501 spamscore=0 bulkscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2611090081 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.180.131; envelope-from=brian.cain@oss.qualcomm.com; helo=mx0b-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @qualcomm.com) X-ZM-MESSAGEID: 1794256325916158500 Show how to boot a Linux guest with the hexagon_loadlinux firmware, and hexagon_booter for running h2 user programs. Reviewed-by: Pierrick Bouvier Signed-off-by: Brian Cain --- docs/system/hexagon/boot.rst | 18 ++++----- docs/system/hexagon/operating-systems.rst | 48 +++++++++++++++++++++++ docs/system/target-hexagon.rst | 12 ++++++ 3 files changed, 69 insertions(+), 9 deletions(-) create mode 100644 docs/system/hexagon/operating-systems.rst diff --git a/docs/system/hexagon/boot.rst b/docs/system/hexagon/boot.rst index 36c603c69e0..80eaac99c79 100644 --- a/docs/system/hexagon/boot.rst +++ b/docs/system/hexagon/boot.rst @@ -41,8 +41,8 @@ The virt machine starts executing there. =20 ``-bios`` with ``-kernel`` boots the kernel through Hexagon VM host -firmware, as described in :ref:`hexagon-vm-boot`. The kernel window starts -at ``0xa0000000``. +firmware, as described in :ref:`hexagon-vm-boot`. Both ELF images load at +their declared physical addresses. =20 Otherwise, guest software reads the generated DTB at ``0x99800000``. ``-append`` sets its ``/chosen/bootargs`` property. @@ -80,13 +80,13 @@ Booting a kernel through Hexagon VM host firmware =20 On the ``virt`` and board-specific machines, ``-bios`` with ``-kernel`` starts the kernel through Hexagon VM host firmware. QEMU loads the firmware -ELF as linked and adds the machine's kernel base to the kernel ELF's -physical load addresses, so the kernel's addresses are relative to the -start of its window. The kernel must use the corresponding Hexagon VM -guest layout. QEMU starts thread zero at a boot stub at ``0x99c00000``. -The stub passes the DTB address with the low word in ``r0`` and the high -word in ``r1``, then jumps to the firmware's ELF entry point. The Hexagon -VM host defines the child VM's register and execution state. +ELF as linked. On ``virt``, it also loads the kernel ELF as linked. The +board-specific machines add their configured kernel base to the kernel ELF= 's +physical load addresses, so those kernels are relative to the start of the +board's guest window. QEMU starts thread zero at a boot stub at +``0x99c00000``. The stub passes the DTB address with the low word in ``r0`` +and the high word in ``r1``, then jumps to the firmware's ELF entry point. +The Hexagon VM host defines the child VM's register and execution state. =20 QEMU places the DTB after the loaded kernel. QEMU copies it to guest RAM before entering the firmware. An optional ``-initrd`` is placed diff --git a/docs/system/hexagon/operating-systems.rst b/docs/system/hexago= n/operating-systems.rst new file mode 100644 index 00000000000..c64af28e1f5 --- /dev/null +++ b/docs/system/hexagon/operating-systems.rst @@ -0,0 +1,48 @@ +.. SPDX-License-Identifier: GPL-2.0-or-later + +Booting guest operating systems +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D + +Hexagon VM guests require a Hexagon VM host. QEMU ships board-specific +host firmware in ``pc-bios``. Guest operating systems boot with the +``hexagon_loadlinux_*`` images; the ``hexagon_booter_*`` images run H2 +user programs instead (see :doc:`cdsp`). Select a matching machine, +firmware, and guest memory layout from :doc:`cdsp`. + +Linux +----- + +The kernel must be built for the Hexagon VM interface and include the +PL011 console and required virtio-mmio device drivers. + +For a preloaded kernel and separate initramfs: + +.. code-block:: sh + + qemu-system-hexagon -M qcs6490-cdsp -display none -serial stdio \ + -bios hexagon_loadlinux_qcs6490_cdsp \ + -kernel ./vmlinux -initrd ./initramfs.cpio.gz \ + -append "console=3DttyAMA0 rdinit=3D/init" + +``ttyAMA0`` selects the PL011 console. ``-append`` sets the boot arguments +in QEMU's DTB; the guest and its VM host determine how those arguments +are consumed. Add any platform-specific memory or delay-calibration +parameters required by the kernel image. + +Guest operating systems on virt +-------------------------------- + +The ``virt`` machine boots a guest operating system through the same +firmware: + +.. code-block:: sh + + qemu-system-hexagon -M virt -display none -serial stdio \ + -bios hexagon_loadlinux_sa8775p_cdsp \ + -kernel ./guest.elf -append "console=3DttyAMA0" + +QEMU loads the guest ELF at its declared physical addresses. QEMU enters +the firmware with the DTB address in ``r1:r0`` (see +:ref:`hexagon-vm-boot`). The guest must use the Hexagon VM interface for +interrupts and timers, the PL011 at ``0x10000000``, and the virtio-mmio +transports listed in :doc:`machines`. diff --git a/docs/system/target-hexagon.rst b/docs/system/target-hexagon.rst index dac8b9b3483..3b63a94eb56 100644 --- a/docs/system/target-hexagon.rst +++ b/docs/system/target-hexagon.rst @@ -105,11 +105,23 @@ guest software can access the host console and filesy= stem. Read the for details. Semihosting is enabled by default on hexagon-sim-compatible machines. This can be further configured through ``-semihosting-config``. =20 +Hexagon VM host +--------------- + +Guest operating systems can run under a Hexagon VM host, which provides +virtual processor, memory management, interrupt, and timer services. +The `Hexagon Virtual Machine Specification +`__ +describes the guest interface. The OS boot examples in +:doc:`hexagon/operating-systems` use H2 as the Hexagon VM host; QEMU +emulates the underlying DSP hardware. + .. toctree:: :caption: Hexagon documentation =20 hexagon/machines hexagon/sdk-programs hexagon/boot + hexagon/operating-systems hexagon/emulation hexagon/cdsp --=20 2.34.1