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