From: Paul Mackerras <paulus@ozlabs.org>
To: linuxppc-dev@ozlabs.org
Subject: [PATCH v2 1/9] powerpc: Add Microwatt platform
Date: Fri, 18 Jun 2021 13:43:41 +1000 [thread overview]
Message-ID: <YMwWbZVREsVug9R0@thinks.paulus.ozlabs.org> (raw)
In-Reply-To: <YMwWPcsaWzMlDPqQ@thinks.paulus.ozlabs.org>
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>
---
arch/powerpc/Kconfig | 2 +-
arch/powerpc/platforms/Kconfig | 1 +
arch/powerpc/platforms/Makefile | 1 +
arch/powerpc/platforms/microwatt/Kconfig | 9 +++++++++
arch/powerpc/platforms/microwatt/Makefile | 1 +
arch/powerpc/platforms/microwatt/setup.c | 23 +++++++++++++++++++++++
6 files changed, 36 insertions(+), 1 deletion(-)
create mode 100644 arch/powerpc/platforms/microwatt/Kconfig
create mode 100644 arch/powerpc/platforms/microwatt/Makefile
create mode 100644 arch/powerpc/platforms/microwatt/setup.c
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 386ae12d8523..5ce51c38a346 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -422,7 +422,7 @@ config HUGETLB_PAGE_SIZE_VARIABLE
config MATH_EMULATION
bool "Math emulation"
- depends on 4xx || PPC_8xx || PPC_MPC832x || BOOKE
+ depends on 4xx || PPC_8xx || PPC_MPC832x || BOOKE || PPC_MICROWATT
select PPC_FPU_REGS
help
Some PowerPC chips designed for embedded applications do not have
diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig
index 7a5e8f4541e3..74be4d06afbf 100644
--- a/arch/powerpc/platforms/Kconfig
+++ b/arch/powerpc/platforms/Kconfig
@@ -20,6 +20,7 @@ source "arch/powerpc/platforms/embedded6xx/Kconfig"
source "arch/powerpc/platforms/44x/Kconfig"
source "arch/powerpc/platforms/40x/Kconfig"
source "arch/powerpc/platforms/amigaone/Kconfig"
+source "arch/powerpc/platforms/microwatt/Kconfig"
config KVM_GUEST
bool "KVM Guest support"
diff --git a/arch/powerpc/platforms/Makefile b/arch/powerpc/platforms/Makefile
index 143d4417f6cc..edcb54cdb1a8 100644
--- a/arch/powerpc/platforms/Makefile
+++ b/arch/powerpc/platforms/Makefile
@@ -22,3 +22,4 @@ obj-$(CONFIG_PPC_CELL) += cell/
obj-$(CONFIG_PPC_PS3) += ps3/
obj-$(CONFIG_EMBEDDED6xx) += embedded6xx/
obj-$(CONFIG_AMIGAONE) += amigaone/
+obj-$(CONFIG_PPC_MICROWATT) += microwatt/
diff --git a/arch/powerpc/platforms/microwatt/Kconfig b/arch/powerpc/platforms/microwatt/Kconfig
new file mode 100644
index 000000000000..3be01e78ce57
--- /dev/null
+++ b/arch/powerpc/platforms/microwatt/Kconfig
@@ -0,0 +1,9 @@
+# SPDX-License-Identifier: GPL-2.0
+config PPC_MICROWATT
+ depends on PPC_BOOK3S_64 && !SMP
+ bool "Microwatt SoC platform"
+ select PPC_XICS
+ select PPC_NATIVE
+ help
+ This option enables support for FPGA-based Microwatt implementations.
+
diff --git a/arch/powerpc/platforms/microwatt/Makefile b/arch/powerpc/platforms/microwatt/Makefile
new file mode 100644
index 000000000000..e6885b3b2ee7
--- /dev/null
+++ b/arch/powerpc/platforms/microwatt/Makefile
@@ -0,0 +1 @@
+obj-y += setup.o
diff --git a/arch/powerpc/platforms/microwatt/setup.c b/arch/powerpc/platforms/microwatt/setup.c
new file mode 100644
index 000000000000..d80d52612672
--- /dev/null
+++ b/arch/powerpc/platforms/microwatt/setup.c
@@ -0,0 +1,23 @@
+/*
+ * Microwatt FPGA-based SoC platform setup code.
+ *
+ * Copyright 2020 Paul Mackerras (paulus@ozlabs.org), IBM Corp.
+ */
+
+#include <linux/types.h>
+#include <linux/kernel.h>
+#include <linux/stddef.h>
+#include <linux/init.h>
+#include <asm/machdep.h>
+#include <asm/time.h>
+
+static int __init microwatt_probe(void)
+{
+ return of_machine_is_compatible("microwatt-soc");
+}
+
+define_machine(microwatt) {
+ .name = "microwatt",
+ .probe = microwatt_probe,
+ .calibrate_decr = generic_calibrate_decr,
+};
--
2.31.1
next prev parent reply other threads:[~2021-06-18 3:54 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-18 3:42 [PATCH v2 0/9] powerpc: Add support for Microwatt soft-core Paul Mackerras
2021-06-18 3:43 ` Paul Mackerras [this message]
2021-06-19 3:03 ` [PATCH v2 1/9] powerpc: Add Microwatt platform Nicholas Piggin
2021-06-18 3:44 ` [PATCH v2 2/9] powerpc: Add Microwatt device tree Paul Mackerras
2021-06-19 14:26 ` Segher Boessenkool
2021-06-20 12:08 ` Paul Mackerras
2021-06-21 13:54 ` Segher Boessenkool
2021-06-18 3:45 ` [PATCH v2 3/9] powerpc/microwatt: Populate platform bus from device-tree Paul Mackerras
2021-06-18 3:45 ` [PATCH v2 4/9] powerpc/xics: Add a native ICS backend for microwatt Paul Mackerras
2021-06-18 3:46 ` [PATCH v2 5/9] powerpc/microwatt: Use standard 16550 UART for console Paul Mackerras
2021-06-18 7:40 ` Nicholas Piggin
2021-06-18 12:12 ` Paul Mackerras
2021-06-19 2:58 ` Nicholas Piggin
2021-08-12 13:14 ` Christophe Leroy
2021-08-12 16:09 ` Segher Boessenkool
2021-06-18 3:47 ` [PATCH v2 6/9] powerpc/microwatt: Add support for hardware random number generator Paul Mackerras
2021-06-19 3:08 ` Nicholas Piggin
2021-06-19 14:36 ` Segher Boessenkool
2021-06-20 8:19 ` Nicholas Piggin
2021-06-18 3:48 ` [PATCH v2 7/9] powerpc/microwatt: Add microwatt_defconfig Paul Mackerras
2021-06-18 3:49 ` [PATCH v2 8/9] powerpc/boot: Fixup device-tree on little endian Paul Mackerras
2021-06-19 3:14 ` Nicholas Piggin
2021-06-18 3:49 ` [PATCH v2 9/9] powerpc/boot: Add a boot wrapper for Microwatt Paul Mackerras
2021-06-19 3:16 ` Nicholas Piggin
2021-06-19 14:45 ` [PATCH v2 0/9] powerpc: Add support for Microwatt soft-core Segher Boessenkool
2021-06-24 14:03 ` Michael Ellerman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YMwWbZVREsVug9R0@thinks.paulus.ozlabs.org \
--to=paulus@ozlabs.org \
--cc=linuxppc-dev@ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).