All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: Paul Mackerras <paulus@ozlabs.org>,
	linuxppc-dev@ozlabs.org, Benjamin Herrenschmidt <benh@ozlabs.org>,
	Michael Neuling <mikey@neuling.org>,
	Anton Blanchard <anton@ozlabs.org>
Subject: Re: [PATCH RFC 2/4] powerpc: Add Microwatt platform
Date: Tue, 12 May 2020 11:56:33 +1000	[thread overview]
Message-ID: <87sgg5c3vy.fsf@mpe.ellerman.id.au> (raw)
In-Reply-To: <20200509050255.GC1464954@thinks.paulus.ozlabs.org>

Paul Mackerras <paulus@ozlabs.org> writes:
> 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.

... or FP or VSX or Altivec?

What about transactional memory?

> This adds a new machine type to support FPGA-based SoCs with a
> Microwatt core.
>
> Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
> ---
>  arch/powerpc/Kconfig                      |    2 +-
>  arch/powerpc/configs/microwatt_defconfig  | 1418 +++++++++++++++++++++
>  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  |   40 +
>  7 files changed, 1471 insertions(+), 1 deletion(-)
>  create mode 100644 arch/powerpc/configs/microwatt_defconfig
>  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 497b7d0b2d7e..97286b8312f5 100644
> --- a/arch/powerpc/Kconfig
> +++ b/arch/powerpc/Kconfig
> @@ -407,7 +407,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
>  	help
>  	  Some PowerPC chips designed for embedded applications do not have
>  	  a floating-point unit and therefore do not implement the
> diff --git a/arch/powerpc/configs/microwatt_defconfig b/arch/powerpc/configs/microwatt_defconfig
> new file mode 100644
> index 000000000000..f4f4c965a786
> --- /dev/null
> +++ b/arch/powerpc/configs/microwatt_defconfig
> @@ -0,0 +1,1418 @@
> +#
> +# Automatically generated file; DO NOT EDIT.
> +# Linux/powerpc 5.6.0 Kernel Configuration
> +#
> +
> +#
> +# Compiler: powerpc64le-linux-gnu-gcc (GCC) 9.2.1 20190827 (Red Hat Cross 9.2.1-1)
> +#
> +CONFIG_CC_IS_GCC=y
> +CONFIG_GCC_VERSION=90201
> +CONFIG_CLANG_VERSION=0
> +CONFIG_CC_HAS_ASM_GOTO=y
> +CONFIG_CC_HAS_ASM_INLINE=y
> +CONFIG_CC_HAS_WARN_MAYBE_UNINITIALIZED=y
> +CONFIG_CC_DISABLE_WARN_MAYBE_UNINITIALIZED=y
> +CONFIG_IRQ_WORK=y
> +CONFIG_BUILDTIME_TABLE_SORT=y
> +CONFIG_THREAD_INFO_IN_TASK=y

This should be a minimised config generated with savedefconfig.

> diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig
> index 1f8025383caa..5b701acc6afa 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..981f722ae9ce
> --- /dev/null
> +++ b/arch/powerpc/platforms/microwatt/Kconfig
> @@ -0,0 +1,9 @@
> +# SPDX-License-Identifier: GPL-2.0
> +config PPC_MICROWATT
> +	depends on PPC64 && PPC_BOOK3S

That can just be PPC_BOOK3S_64

I think it should also depend on !CPU_BIG_ENDIAN && !SMP ?

Should it also select MATH_EMULATION?
And MATH_EMULATION_FULL ?

> +	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..3cfc5955a6fe
> --- /dev/null
> +++ b/arch/powerpc/platforms/microwatt/setup.c
> @@ -0,0 +1,40 @@
> +/*
> + * 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 <linux/of.h>
> +#include <asm/machdep.h>
> +#include <asm/time.h>
> +
> +static void __init microwatt_calibrate_decr(void)
> +{
> +	ppc_tb_freq = 100000000;
> +	ppc_proc_freq = 100000000;
> +}

Why can't those come via the device tree?

> +
> +static void __init microwatt_setup_arch(void)
> +{
> +}

That can be NULL in ppc_md.

> +static void __init microwatt_init_IRQ(void)
> +{
> +}

Can be NULL in ppc_md.

> +static int __init microwatt_probe(void)
> +{
> +	return of_machine_is_compatible("microwatt-soc");
> +}
> +
> +define_machine(microwatt) {
> +	.name			= "microwatt",
> +	.probe			= microwatt_probe,
> +	.setup_arch		= microwatt_setup_arch,
> +	.init_IRQ		= microwatt_init_IRQ,
> +	.calibrate_decr		= microwatt_calibrate_decr,
> +};
> -- 
> 2.25.3

cheers

  parent reply	other threads:[~2020-05-12  1:58 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-09  5:01 [PATCH RFC 0/4] Add support for Microwatt-based SoCs Paul Mackerras
2020-05-09  5:02 ` [PATCH RFC 1/4] powerpc/radix: Fix compilation for radix with CONFIG_SMP=n Paul Mackerras
2020-05-09  7:52   ` Nicholas Piggin
2020-05-14  8:26     ` Joel Stanley
2020-05-09  5:02 ` [PATCH RFC 2/4] powerpc: Add Microwatt platform Paul Mackerras
2020-05-09  7:58   ` Nicholas Piggin
2020-05-09  8:36     ` Alistair Popple
2020-05-09  9:10       ` Nicholas Piggin
2020-05-12  1:56   ` Michael Ellerman [this message]
2020-05-09  5:03 ` [PATCH RFC 3/4] powerpc/microwatt: Add early debug UART support for Microwatt Paul Mackerras
2020-05-11  7:07   ` Segher Boessenkool
2020-05-12  1:57   ` Michael Ellerman
2020-05-09  5:04 ` [PATCH RFC 4/4] powerpc/radix: Add support for microwatt's PRTBL SPR Paul Mackerras
2020-05-09  8:02   ` Nicholas Piggin

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=87sgg5c3vy.fsf@mpe.ellerman.id.au \
    --to=mpe@ellerman.id.au \
    --cc=anton@ozlabs.org \
    --cc=benh@ozlabs.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=mikey@neuling.org \
    --cc=paulus@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.