Commit aa9c5adf authored by Benjamin Herrenschmidt's avatar Benjamin Herrenschmidt Committed by Michael Ellerman
Browse files

powerpc/xics: Add a native ICS backend for microwatt



This is a simple native ICS backend that matches the layout of
the Microwatt implementation of ICS.

Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarPaul Mackerras <paulus@ozlabs.org>
Reviewed-by: default avatarSegher Boessenkool <segher@kernel.crashing.org>
[mpe: Add empty ics_native_init() to unbreak non-microwatt builds]
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>

fixup-ics
Link: https://lore.kernel.org/r/YMwW8cxrwB2W5EUN@thinks.paulus.ozlabs.org
parent 0d0f9e5f
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -99,7 +99,25 @@
		compatible = "simple-bus";
		#address-cells = <1>;
		#size-cells = <1>;
		interrupt-parent = <&ICS>;

		ranges = <0 0 0xc0000000 0x40000000>;

		interrupt-controller@4000 {
			compatible = "openpower,xics-presentation", "ibm,ppc-xicp";
			ibm,interrupt-server-ranges = <0x0 0x1>;
			reg = <0x4000 0x100>;
		};

		ICS: interrupt-controller@5000 {
			compatible = "openpower,xics-sources";
			interrupt-controller;
			interrupt-ranges = <0x10 0x10>;
			reg = <0x5000 0x100>;
			#address-cells = <0>;
			#size-cells = <0>;
			#interrupt-cells = <2>;
		};

	};
};
+4 −0
Original line number Diff line number Diff line
@@ -65,8 +65,12 @@ struct icp_ops {

extern const struct icp_ops *icp_ops;

#ifdef CONFIG_PPC_ICS_NATIVE
/* Native ICS */
extern int ics_native_init(void);
#else
static inline int ics_native_init(void) { return -ENODEV; }
#endif

/* RTAS ICS */
#ifdef CONFIG_PPC_ICS_RTAS
+2 −0
Original line number Diff line number Diff line
@@ -3,6 +3,8 @@ config PPC_MICROWATT
	depends on PPC_BOOK3S_64 && !SMP
	bool "Microwatt SoC platform"
	select PPC_XICS
	select PPC_ICS_NATIVE
	select PPC_ICP_NATIVE
	select PPC_NATIVE
	help
          This option enables support for FPGA-based Microwatt implementations.
+8 −0
Original line number Diff line number Diff line
@@ -10,8 +10,15 @@
#include <linux/init.h>
#include <linux/of.h>
#include <linux/of_platform.h>

#include <asm/machdep.h>
#include <asm/time.h>
#include <asm/xics.h>

static void __init microwatt_init_IRQ(void)
{
	xics_init();
}

static int __init microwatt_probe(void)
{
@@ -27,5 +34,6 @@ machine_arch_initcall(microwatt, microwatt_populate);
define_machine(microwatt) {
	.name			= "microwatt",
	.probe			= microwatt_probe,
	.init_IRQ		= microwatt_init_IRQ,
	.calibrate_decr		= generic_calibrate_decr,
};
+3 −0
Original line number Diff line number Diff line
@@ -12,3 +12,6 @@ config PPC_ICP_HV

config PPC_ICS_RTAS
	def_bool n

config PPC_ICS_NATIVE
	def_bool n
Loading