Sean Anderson | 1ecc8d0 | 2022-03-22 16:59:09 -0400 | [diff] [blame^] | 1 | .. SPDX-License-Identifier: GPL-2.0+ |
| 2 | .. Copyright 2014 Broadcom Corporation. |
| 3 | |
| 4 | Semihosting |
| 5 | =========== |
| 6 | |
| 7 | Semihosting is ARM's way of having a real or virtual target communicate |
| 8 | with a host or host debugger for basic operations such as file I/O, |
| 9 | console I/O, etc. Please see `Arm's semihosting documentation |
| 10 | <https://developer.arm.com/documentation/100863/latest/>`_ for more |
| 11 | information. |
| 12 | |
| 13 | For developing on armv8 virtual fastmodel platforms, semihosting is a |
| 14 | valuable tool since it allows access to image/configuration files before |
| 15 | eMMC or other NV media are available. |
| 16 | |
| 17 | There are two main ARM virtual Fixed Virtual Platform (FVP) models, |
| 18 | `Versatile Express (VE) FVP and BASE FVP |
| 19 | <http://www.arm.com/products/tools/models/fast-models/foundation-model.php>`_. |
| 20 | The initial vexpress64 u-boot board created here runs on the VE virtual |
| 21 | platform using the license-free Foundation_v8 simulator. Fortunately, |
| 22 | the Foundation_v8 simulator also supports the BASE_FVP model which |
| 23 | companies can purchase licenses for and contain much more functionality. |
| 24 | So we can, in U-Boot, run either model by either using the VE FVP (default), |
| 25 | or turning on ``CONFIG_BASE_FVP`` for the more full featured model. |
| 26 | |
| 27 | Rather than create a new armv8 board similar to ``armltd/vexpress64``, add |
| 28 | semihosting calls to the existing one, enabled with ``CONFIG_SEMIHOSTING`` |
| 29 | and ``CONFIG_BASE_FVP`` both set. Also reuse the existing board config file |
| 30 | vexpress_aemv8.h but differentiate the two models by the presence or |
| 31 | absence of ``CONFIG_BASE_FVP``. This change is tested and works on both the |
| 32 | Foundation and Base fastmodel simulators. |
| 33 | |
| 34 | Loading files |
| 35 | ------------- |
| 36 | |
| 37 | The semihosting code adds a "hostfs":: |
| 38 | |
| 39 | smhload <image> <address> [env var] |
| 40 | |
| 41 | That will load an image from the host filesystem into RAM at the specified |
| 42 | address and optionally store the load end address in the specified |
| 43 | environment variable. |