Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc: Add Microwatt platform

Microwatt is a FPGA-based implementation of the Power ISA. It
currently only implements little-endian 64-bit mode, and does
not (yet) support SMP, VMX, VSX or transactional memory. It has an
optional FPU, and an optional MMU (required for running Linux,
obviously) which implements a configurable radix tree but not
hypervisor mode or nested radix translation.

This adds a new machine type to support FPGA-based SoCs with a
Microwatt core. CONFIG_MATH_EMULATION can be selected for Microwatt
SOCs which don't have the FPU.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Reviewed-by: Segher Boessenkool <segher@kernel.crashing.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/YMwWbZVREsVug9R0@thinks.paulus.ozlabs.org

authored by

Paul Mackerras and committed by
Michael Ellerman
53d143fe c988cfd3

+36 -1
+1 -1
arch/powerpc/Kconfig
··· 430 430 431 431 config MATH_EMULATION 432 432 bool "Math emulation" 433 - depends on 4xx || PPC_8xx || PPC_MPC832x || BOOKE 433 + depends on 4xx || PPC_8xx || PPC_MPC832x || BOOKE || PPC_MICROWATT 434 434 select PPC_FPU_REGS 435 435 help 436 436 Some PowerPC chips designed for embedded applications do not have
+1
arch/powerpc/platforms/Kconfig
··· 21 21 source "arch/powerpc/platforms/40x/Kconfig" 22 22 source "arch/powerpc/platforms/amigaone/Kconfig" 23 23 source "arch/powerpc/platforms/book3s/Kconfig" 24 + source "arch/powerpc/platforms/microwatt/Kconfig" 24 25 25 26 config KVM_GUEST 26 27 bool "KVM Guest support"
+1
arch/powerpc/platforms/Makefile
··· 23 23 obj-$(CONFIG_EMBEDDED6xx) += embedded6xx/ 24 24 obj-$(CONFIG_AMIGAONE) += amigaone/ 25 25 obj-$(CONFIG_PPC_BOOK3S) += book3s/ 26 + obj-$(CONFIG_PPC_MICROWATT) += microwatt/
+9
arch/powerpc/platforms/microwatt/Kconfig
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + config PPC_MICROWATT 3 + depends on PPC_BOOK3S_64 && !SMP 4 + bool "Microwatt SoC platform" 5 + select PPC_XICS 6 + select PPC_NATIVE 7 + help 8 + This option enables support for FPGA-based Microwatt implementations. 9 +
+1
arch/powerpc/platforms/microwatt/Makefile
··· 1 + obj-y += setup.o
+23
arch/powerpc/platforms/microwatt/setup.c
··· 1 + /* 2 + * Microwatt FPGA-based SoC platform setup code. 3 + * 4 + * Copyright 2020 Paul Mackerras (paulus@ozlabs.org), IBM Corp. 5 + */ 6 + 7 + #include <linux/types.h> 8 + #include <linux/kernel.h> 9 + #include <linux/stddef.h> 10 + #include <linux/init.h> 11 + #include <asm/machdep.h> 12 + #include <asm/time.h> 13 + 14 + static int __init microwatt_probe(void) 15 + { 16 + return of_machine_is_compatible("microwatt-soc"); 17 + } 18 + 19 + define_machine(microwatt) { 20 + .name = "microwatt", 21 + .probe = microwatt_probe, 22 + .calibrate_decr = generic_calibrate_decr, 23 + };