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