arm: Add support for semihosting for armv8 fastmodel targets.
Subsystems (2)
PATCH v5 1/1 arm: Add support for semihosting for armv8 fastmodel targets.
The armv8 ARM Trusted Firmware (ATF) can be used to load various ATF images and u-boot, and does this for virtual platforms by using semihosting. This commit extends this idea by allowing u-boot to also use semihosting to load the kernel/ramdisk/dtb. This eliminates the need for a bootwrapper and produces a more realistic boot sequence with virtual models.
Though the semihosting code is quite generic, support for armv7 in fastmodel is less useful due to the wide range of available silicon and the lack of a free armv7 fastmodel, so this change contains an untested armv7 placeholder for the service trap opcode.
Please refer to README.semihosting for a more detailed description of semihosting and how it is used with the armv8 virtual platforms.
---
Changes in v5:
- Shorten and cleanup commit message
- Move more commit description to README.semihosting
Changes in v4:
- refreshed patch and retested
- fix boards.cfg conflict
- fix GICV3 conflict
- minor documentation cleanup - semihosting.c, README.semihosting
- change maintainer of semihosting target
- tested with vexpress_aemv8a_semi target (BASE_FVP) against e75e73dd5f280b91f5bfc0a76a0fd09b6eba1c66 (May 16, 2014)
Changes in v3:
- minor format fixup in board file
Changes in v2:
- use kernel_addr_r, fdt_addr_r, initrd_addr_r convention.
- Use env variables for kernel/fdt/initrd file names.
- Add CONFIG_BASE_FVP to differentiate VE and BASE FVP models.
- CONFIG_SEMIHOSTING only refers to bringing in semihosting code now.
- Remove unnecessary CONFIG_SYS_BAUDRATE_TABLE, CONFIG_SYS_PROMPT_HUSH_PS2
- Remove vexpress_aemv8a_semi.h and replace with CONFIG_BASE_FVP
- Update boards.cfg with option SEMIHOSTING and BASE_FVP
- Add doc/README.semihosting
Changes in v1:
- Initial code
- Remove empty timer_init() function.
arch/arm/include/asm/semihosting.h | 21 +++ arch/arm/lib/Makefile | 1 + arch/arm/lib/semihosting.c | 233 ++++++++++++++++++++++++++++++++++ board/armltd/vexpress64/vexpress64.c | 101 ++++++++++++++- boards.cfg | 1 + doc/README.semihosting | 54 ++++++++ include/configs/vexpress_aemv8a.h | 63 ++++++++- 7 files changed, 462 insertions(+), 12 deletions(-) create mode 100644 arch/arm/include/asm/semihosting.h create mode 100644 arch/arm/lib/semihosting.c create mode 100644 doc/README.semihosting
arch/arm/include/asm/semihosting.h new file +21 -0
@@ -0,0 +1,21 @@ +/* +* Copyright 2014 Broadcom Corporation +* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +#ifndef __SEMIHOSTING_H__ +#define __SEMIHOSTING_H__ + +/* +* ARM semihosting functions for loading images to memory. See the source +* code for more information. +*/ +int smh_load (const char *fname,void *memp,int avail,int verbose); +int smh_read (int fd,void *memp,int len); +int smh_open (const char *fname,char *modestr); +int smh_close (int fd); +int smh_len_fd (int fd); +int smh_len (const char *fname); + +#endif /* __SEMIHOSTING_H__ */
arch/arm/lib/Makefile +1 -0
@@ -32,6 +32,7 @@ obj-$(CONFIG_USE_ARCH_MEMCPY) += memcpy.o else obj-$(CONFIG_SPL_FRAMEWORK) += spl.o endif +obj-$(CONFIG_SEMIHOSTING) += semihosting.o obj-y += sections.o ifdef CONFIG_ARM64
arch/arm/lib/semihosting.c new file +233 -0
233 lines not on this page · raw message
board/armltd/vexpress64/vexpress64.c +96 -5
119 lines not on this page · raw message
boards.cfg +1 -0
@@ -44,6 +44,7 @@ ########################################################################################################### Active aarch64 armv8 - armltd vexpress64 vexpress_aemv8a vexpress_aemv8a:ARM64 David Feng <[email protected]> +Active aarch64 armv8 - armltd vexpress64 vexpress_aemv8a_semi vexpress_aemv8a:ARM64,SEMIHOSTING,BASE_FVP Steve Rae <[email protected]> Active arc arc700 - synopsys - axs101 - Alexey Brodkin <[email protected]> Active arc arc700 - synopsys <none> arcangel4 - Alexey Brodkin <[email protected]> Active arc arc700 - synopsys <none> arcangel4-be - Alexey Brodkin <[email protected]>
doc/README.semihosting new file +54 -0
54 lines not on this page · raw message
include/configs/vexpress_aemv8a.h +56 -7
120 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH v5 1/1 arm: Add support for semihosting for armv8 fastmodel targets.
Hi Darwin,
On Mon, 9 Jun 2014 11:12:59 -0700, Darwin Rambo <[email protected]> wrote:
[...]
Quoted 2 lines
Please refer to README.semihosting for a more detailed description of semihosting and how it is used with the armv8 virtual platforms.
With your permission, will apply but modify the above into...
Quoted 2 lines
Please refer to doc/README.semihosting for a more detailed description of semihosting and how it is used with the armv8 virtual platforms.
... just so that people can tell that the README file is in the doc/ directory.
Amicalement,
Signature · 1 line
Albert.
PATCH v5 1/1 arm: Add support for semihosting for armv8 fastmodel targets.
Quoted 10 lines · Albert ARIBAUD
Hi Darwin,
On Mon, 9 Jun 2014 11:12:59 -0700, Darwin Rambo <[email protected]> wrote:
[...]
Quoted 2 lines
Please refer to README.semihosting for a more detailed description of semihosting and how it is used with the armv8 virtual platforms.
Quoted 7 lines
With your permission, will apply but modify the above into...
Quoted 2 lines
Please refer to doc/README.semihosting for a more detailed description of semihosting and how it is used with the armv8 virtual platforms.
... just so that people can tell that the README file is in the doc/ directory.
Absolutely! Thanks.
Darwin
Quoted 3 lines
Amicalement,
PATCH v5 1/1 arm: Add support for semihosting for armv8 fastmodel targets.
In reply to Darwin RamboHi Darwin,
Quoted 15 lines · Darwin Rambo
The armv8 ARM Trusted Firmware (ATF) can be used to load various ATF images and u-boot, and does this for virtual platforms by using semihosting. This commit extends this idea by allowing u-boot to also use semihosting to load the
kernel/ramdisk/dtb. This eliminates the need for a bootwrapper and produces a more realistic boot sequence with virtual models.Though the semihosting code is quite generic, support for armv7 in fastmodel is less useful due to the wide range of available silicon and the lack of a free armv7 fastmodel, so this change contains an untested armv7 placeholder for the service trap opcode.
Please refer to README.semihosting for a more detailed description of semihosting and how it is used with the armv8 virtual platforms.
Quoted 6 lines
Signed-off-by Darwin Rambo <[email protected]>Cc trini at ti.comCc fenghua at phytium.com.cnCc bhupesh.sharma at freescale.com---
Applied to u-boot-arm/master, with the change from "README..." to "doc/README..." as agreed, thanks!
Amicalement,
Signature · 1 line
Albert.