| 1 | #!/usr/bin/env python3 |
| 2 | # |
| 3 | # Functional test that boots a Linux kernel and checks the console |
| 4 | # |
| 5 | # SPDX-License-Identifier: GPL-2.0-or-later |
| 6 | |
| 7 | from qemu_test import LinuxKernelTest, Asset |
| 8 | |
| 9 | |
| 10 | class Smdkc210Machine(LinuxKernelTest): |
| 11 | |
| 12 | ASSET_DEB = Asset( |
| 13 | ('https://snapshot.debian.org/archive/debian/20190928T224601Z/pool/' |
| 14 | 'main/l/linux/linux-image-4.19.0-6-armmp_4.19.67-2+deb10u1_armhf.deb'), |
| 15 | '421804e7579ef40d554c962850dbdf1bfc79f7fa7faec9d391397170dc806c3e') |
| 16 | |
| 17 | ASSET_ROOTFS = Asset( |
| 18 | ('https://github.com/groeck/linux-build-test/raw/' |
| 19 | '2eb0a73b5d5a28df3170c546ddaaa9757e1e0848/rootfs/arm/' |
| 20 | 'rootfs-armv5.cpio.gz'), |
| 21 | '334b8d256db67a3f2b3ad070aa08b5ade39624e0e7e35b02f4359a577bc8f39b') |
| 22 | |
| 23 | def test_arm_exynos4210_initrd(self): |
| 24 | self.set_machine('smdkc210') |
| 25 | |
| 26 | kernel_path = self.archive_extract(self.ASSET_DEB, |
| 27 | member='boot/vmlinuz-4.19.0-6-armmp') |
| 28 | dtb_path = 'usr/lib/linux-image-4.19.0-6-armmp/exynos4210-smdkv310.dtb' |
| 29 | dtb_path = self.archive_extract(self.ASSET_DEB, member=dtb_path) |
| 30 | |
| 31 | initrd_path = self.uncompress(self.ASSET_ROOTFS) |
| 32 | |
| 33 | self.vm.set_console() |
| 34 | kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + |
| 35 | 'earlycon=exynos4210,0x13800000 earlyprintk ' + |
| 36 | 'console=ttySAC0,115200n8 ' + |
| 37 | 'random.trust_cpu=off cryptomgr.notests ' + |
| 38 | 'cpuidle.off=1 panic=-1 noreboot') |
| 39 | |
| 40 | self.vm.add_args('-kernel', kernel_path, |
| 41 | '-dtb', dtb_path, |
| 42 | '-initrd', initrd_path, |
| 43 | '-append', kernel_command_line, |
| 44 | '-no-reboot') |
| 45 | self.vm.launch() |
| 46 | |
| 47 | self.wait_for_console_pattern('Boot successful.') |
| 48 | # TODO user command, for now the uart is stuck |
| 49 | |
| 50 | if __name__ == '__main__': |
| 51 | LinuxKernelTest.main() |