From bc9e348a44c00dad2c8f6962b9dd90b72bdb6f13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciro=20Santilli=20=E5=85=AD=E5=9B=9B=E4=BA=8B=E4=BB=B6=20?= =?UTF-8?q?=E6=B3=95=E8=BD=AE=E5=8A=9F?= Date: Tue, 4 Dec 2018 00:00:00 +0000 Subject: [PATCH] start simple integration to test dp650 Not yet merged on gem5 mailine, review published at: https://gem5-review.googlesource.com/c/public/gem5/+/11036/1 --- README.adoc | 1 + common.py | 25 +++++++++++++------------ run | 6 +++++- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/README.adoc b/README.adoc index ffc9659..91c2454 100644 --- a/README.adoc +++ b/README.adoc @@ -3560,6 +3560,7 @@ Tested on: link:http://github.com/cirosantilli/linux-kernel-module-cheat/commit/ For `aarch64` we also need to configure the kernel with link:linux_config/display[]: .... +git -C "$(./getvar linux_src_dir)" fetch https://gem5.googlesource.com/arm/linux gem5/v4.15:gem5/v4.15 git -C "$(./getvar linux_src_dir)" checkout gem5/v4.15 ./build-linux \ --arch aarch64 \ diff --git a/common.py b/common.py index d697cbc..eade24c 100644 --- a/common.py +++ b/common.py @@ -305,6 +305,9 @@ inside baremetal/ and then try to use corresponding executable. Use the docker download Ubuntu root filesystem instead of the default Buildroot one. ''' ) + parser.add_argument( + '--dp650', default=False, action='store_true' + ) parser.add_argument( '-L', '--linux-build-id', default=default_build_id, help='Linux build ID. Allows you to keep multiple separate Linux builds. Default: %(default)s' @@ -737,12 +740,6 @@ def setup(parser): common.buildroot_toolchain_prefix = 'arm-buildroot-linux-uclibcgnueabihf' common.crosstool_ng_toolchain_prefix = 'arm-unknown-eabi' common.ubuntu_toolchain_prefix = 'arm-linux-gnueabihf' - if common.emulator == 'gem5': - if common.machine is None: - common.machine = 'VExpress_GEM5_V1' - else: - if common.machine is None: - common.machine = 'virt' common.is_arm = True elif args.arch == 'aarch64': common.armv = 8 @@ -751,12 +748,6 @@ def setup(parser): common.buildroot_toolchain_prefix = 'aarch64-buildroot-linux-uclibc' common.crosstool_ng_toolchain_prefix = 'aarch64-unknown-elf' common.ubuntu_toolchain_prefix = 'aarch64-linux-gnu' - if common.emulator == 'gem5': - if common.machine is None: - common.machine = 'VExpress_GEM5_V1' - else: - if common.machine is None: - common.machine = 'virt' common.is_arm = True elif args.arch == 'x86_64': common.crosstool_ng_toolchain_prefix = 'x86_64-unknown-elf' @@ -769,6 +760,16 @@ def setup(parser): else: if common.machine is None: common.machine = 'pc' + if is_arm: + if common.emulator == 'gem5': + if common.machine is None: + if args.dp650: + common.machine = 'VExpress_GEM5_V1_DPU' + else: + common.machine = 'VExpress_GEM5_V1' + else: + if common.machine is None: + common.machine = 'virt' common.buildroot_out_dir = os.path.join(common.out_dir, 'buildroot') common.buildroot_build_dir = os.path.join(common.buildroot_out_dir, 'build', args.buildroot_build_id, args.arch) common.buildroot_download_dir = os.path.join(common.buildroot_out_dir, 'download') diff --git a/run b/run index 1c63b04..f835be6 100755 --- a/run +++ b/run @@ -192,11 +192,15 @@ def main(args, extra_args=None): elif common.is_arm: if args.kvm: cmd.extend(['--cpu-type', 'ArmV8KvmCPU', common.Newline]) + if args.dp650: + dp650_cmd = 'dpu_' + else: + dp650_cmd = '' cmd.extend([ # TODO why is it mandatory to pass mem= here? Not true for QEMU. # Anything smaller than physical blows up as expected, but why can't it auto-detect the right value? '--command-line', 'earlyprintk=pl011,0x1c090000 lpj=19988480 rw loglevel=8 mem={} root=/dev/sda {}'.format(memory, kernel_cli), common.Newline, - '--dtb-filename', os.path.join(common.gem5_system_dir, 'arm', 'dt', 'armv{}_gem5_v1_{}cpu.dtb'.format(common.armv, args.cpus)), common.Newline, + '--dtb-filename', os.path.join(common.gem5_system_dir, 'arm', 'dt', 'armv{}_gem5_v1_{}{}cpu.dtb'.format(common.armv, dp650_cmd, args.cpus)), common.Newline, '--machine-type', common.machine, common.Newline, ]) if common.baremetal is None: