mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
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
This commit is contained in:
@@ -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[]:
|
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
|
git -C "$(./getvar linux_src_dir)" checkout gem5/v4.15
|
||||||
./build-linux \
|
./build-linux \
|
||||||
--arch aarch64 \
|
--arch aarch64 \
|
||||||
|
|||||||
25
common.py
25
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.
|
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(
|
parser.add_argument(
|
||||||
'-L', '--linux-build-id', default=default_build_id,
|
'-L', '--linux-build-id', default=default_build_id,
|
||||||
help='Linux build ID. Allows you to keep multiple separate Linux builds. Default: %(default)s'
|
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.buildroot_toolchain_prefix = 'arm-buildroot-linux-uclibcgnueabihf'
|
||||||
common.crosstool_ng_toolchain_prefix = 'arm-unknown-eabi'
|
common.crosstool_ng_toolchain_prefix = 'arm-unknown-eabi'
|
||||||
common.ubuntu_toolchain_prefix = 'arm-linux-gnueabihf'
|
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
|
common.is_arm = True
|
||||||
elif args.arch == 'aarch64':
|
elif args.arch == 'aarch64':
|
||||||
common.armv = 8
|
common.armv = 8
|
||||||
@@ -751,12 +748,6 @@ def setup(parser):
|
|||||||
common.buildroot_toolchain_prefix = 'aarch64-buildroot-linux-uclibc'
|
common.buildroot_toolchain_prefix = 'aarch64-buildroot-linux-uclibc'
|
||||||
common.crosstool_ng_toolchain_prefix = 'aarch64-unknown-elf'
|
common.crosstool_ng_toolchain_prefix = 'aarch64-unknown-elf'
|
||||||
common.ubuntu_toolchain_prefix = 'aarch64-linux-gnu'
|
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
|
common.is_arm = True
|
||||||
elif args.arch == 'x86_64':
|
elif args.arch == 'x86_64':
|
||||||
common.crosstool_ng_toolchain_prefix = 'x86_64-unknown-elf'
|
common.crosstool_ng_toolchain_prefix = 'x86_64-unknown-elf'
|
||||||
@@ -769,6 +760,16 @@ def setup(parser):
|
|||||||
else:
|
else:
|
||||||
if common.machine is None:
|
if common.machine is None:
|
||||||
common.machine = 'pc'
|
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_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_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')
|
common.buildroot_download_dir = os.path.join(common.buildroot_out_dir, 'download')
|
||||||
|
|||||||
6
run
6
run
@@ -192,11 +192,15 @@ def main(args, extra_args=None):
|
|||||||
elif common.is_arm:
|
elif common.is_arm:
|
||||||
if args.kvm:
|
if args.kvm:
|
||||||
cmd.extend(['--cpu-type', 'ArmV8KvmCPU', common.Newline])
|
cmd.extend(['--cpu-type', 'ArmV8KvmCPU', common.Newline])
|
||||||
|
if args.dp650:
|
||||||
|
dp650_cmd = 'dpu_'
|
||||||
|
else:
|
||||||
|
dp650_cmd = ''
|
||||||
cmd.extend([
|
cmd.extend([
|
||||||
# TODO why is it mandatory to pass mem= here? Not true for QEMU.
|
# 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?
|
# 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,
|
'--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,
|
'--machine-type', common.machine, common.Newline,
|
||||||
])
|
])
|
||||||
if common.baremetal is None:
|
if common.baremetal is None:
|
||||||
|
|||||||
Reference in New Issue
Block a user