Skip to content

Commit 521125e

Browse files
committed
boot-qemu.py: Add support for powerpc
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
1 parent 7d28e84 commit 521125e

1 file changed

Lines changed: 66 additions & 0 deletions

File tree

boot-qemu.py

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
'arm64be',
2525
'mips',
2626
'mipsel',
27+
'ppc32',
28+
'ppc32_mac',
29+
'ppc64',
30+
'ppc64le',
2731
'x86',
2832
'x86_64',
2933
]
@@ -496,6 +500,64 @@ def __init__(self):
496500
self._initrd_arch = self._qemu_arch = 'mipsel'
497501

498502

503+
class PowerPC32QEMURunner(QEMURunner):
504+
505+
def __init__(self):
506+
super().__init__()
507+
508+
self.cmdline.append('console=ttyS0')
509+
self._default_kernel_path = Path('arch/powerpc/boot/uImage')
510+
self._initrd_arch = 'ppc32'
511+
self._machine = 'bamboo'
512+
self._qemu_arch = 'ppc'
513+
self._ram = '128m'
514+
515+
def run(self):
516+
self._qemu_args += ['-machine', self._machine]
517+
518+
super().run()
519+
520+
521+
class PowerPC32MacQEMURunner(PowerPC32QEMURunner):
522+
523+
def __init__(self):
524+
super().__init__()
525+
526+
self._default_kernel_path = Path('vmlinux')
527+
self._machine = 'mac99'
528+
529+
530+
class PowerPC64QEMURunner(QEMURunner):
531+
532+
def __init__(self):
533+
super().__init__()
534+
535+
self._default_kernel_path = Path('vmlinux')
536+
self._initrd_arch = self._qemu_arch = 'ppc64'
537+
self._qemu_args += [
538+
'-cpu', 'power8',
539+
'-machine', 'pseries',
540+
'-vga', 'none',
541+
] # yapf: disable
542+
self._ram = '1G'
543+
544+
545+
class PowerPC64LEQEMURunner(QEMURunner):
546+
547+
def __init__(self):
548+
super().__init__()
549+
550+
self._default_kernel_path = Path('arch/powerpc/boot/zImage.epapr')
551+
self._initrd_arch = 'ppc64le'
552+
self._qemu_arch = 'ppc64'
553+
self._qemu_args += [
554+
'-device', 'ipmi-bmc-sim,id=bmc0',
555+
'-device', 'isa-ipmi-bt,bmc=bmc0,irq=10',
556+
'-machine', 'powernv',
557+
] # yapf: disable
558+
self._ram = '2G'
559+
560+
499561
class X86QEMURunner(QEMURunner):
500562

501563
def __init__(self):
@@ -622,6 +684,10 @@ def parse_arguments():
622684
'arm64be': ARM64BEQEMURunner,
623685
'mips': MIPSQEMURunner,
624686
'mipsel': MIPSELQEMURunner,
687+
'ppc32': PowerPC32QEMURunner,
688+
'ppc32_mac': PowerPC32MacQEMURunner,
689+
'ppc64': PowerPC64QEMURunner,
690+
'ppc64le': PowerPC64LEQEMURunner,
625691
'x86': X86QEMURunner,
626692
'x86_64': X8664QEMURunner,
627693
}

0 commit comments

Comments
 (0)