xref: /openbmc/u-boot/doc/README.semihosting (revision 83d290c56fab2d38cd1ab4c4cc7099559c1d5046)
1*83d290c5STom RiniSPDX-License-Identifier: GPL-2.0+
2261d2760SDarwin Rambo/*
3261d2760SDarwin Rambo * Copyright 2014 Broadcom Corporation.
4261d2760SDarwin Rambo */
5261d2760SDarwin Rambo
6261d2760SDarwin RamboSemihosting is ARM's way of having a real or virtual target communicate
7261d2760SDarwin Rambowith a host or host debugger for basic operations such as file I/O,
8261d2760SDarwin Ramboconsole I/O, etc. Please see
9261d2760SDarwin Rambohttp://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0471c/Bgbjjgij.html for more information.
10261d2760SDarwin Rambo
11261d2760SDarwin RamboFor developing on armv8 virtual fastmodel platforms, semihosting is a
12261d2760SDarwin Rambovaluable tool since it allows access to image/configuration files before
13261d2760SDarwin RamboeMMC or other NV media are available.
14261d2760SDarwin Rambo
15261d2760SDarwin RamboThere are two main ARM virtual Fixed Virtual Platform (FVP) models,
16261d2760SDarwin RamboVersatile Express (VE) FVP and BASE FVP (See
17261d2760SDarwin Rambohttp://www.arm.com/products/tools/models/fast-models/foundation-model.php)
18261d2760SDarwin RamboThe initial vexpress64 u-boot board created here runs on the VE virtual
19261d2760SDarwin Ramboplatform using the license-free Foundation_v8 simulator. Fortunately,
20261d2760SDarwin Rambothe Foundation_v8 simulator also supports the BASE_FVP model which
21261d2760SDarwin Rambocompanies can purchase licenses for and contain much more functionality.
22261d2760SDarwin RamboSo we can, in u-boot, run either model by either using the VE FVP (default),
23261d2760SDarwin Ramboor turning on CONFIG_BASE_FVP for the more full featured model.
24261d2760SDarwin Rambo
25261d2760SDarwin RamboRather than create a new armv8 board similar to armltd/vexpress64, add
26261d2760SDarwin Rambosemihosting calls to the existing one, enabled with CONFIG_SEMIHOSTING
27261d2760SDarwin Ramboand CONFIG_BASE_FVP both set. Also reuse the existing board config file
28261d2760SDarwin Rambovexpress_aemv8a.h but differentiate the two models by the presence or
29261d2760SDarwin Ramboabsence of CONFIG_BASE_FVP. This change is tested and works on both the
30261d2760SDarwin RamboFoundation and Base fastmodel simulators.
31261d2760SDarwin Rambo
32202a674bSLinus WalleijThe semihosting code adds a command:
33261d2760SDarwin Rambo
34202a674bSLinus Walleij  smhload <image> <address> [env var]
35261d2760SDarwin Rambo
36202a674bSLinus WalleijThat will load an image from the host filesystem into RAM at the specified
37202a674bSLinus Walleijaddress and optionally store the load end address in the specified
38202a674bSLinus Walleijenvironment variable.
39