[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221119113041.284419-11-ash@heyquark.com>
Date: Sat, 19 Nov 2022 22:30:40 +1100
From: Ash Logan <ash@...quark.com>
To: krzysztof.kozlowski+dt@...aro.org, paulus@...ba.org,
mpe@...erman.id.au, christophe.leroy@...roup.eu,
robh+dt@...nel.org, benh@...nel.crashing.org,
segher@...nel.crashing.org, pali@...nel.org
Cc: linux-kernel@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
j.ne@...teo.net, linkmauve@...kmauve.fr,
rw-r-r-0644@...tonmail.com, devicetree@...r.kernel.org,
joel@....id.au
Subject: [PATCH v4 10/11] powerpc: wiiu: platform support
Add platform support for the Nintendo Wii U console.
Signed-off-by: Ash Logan <ash@...quark.com>
Co-developed-by: Roberto Van Eeden <rw-r-r-0644@...tonmail.com>
Signed-off-by: Roberto Van Eeden <rw-r-r-0644@...tonmail.com>
Co-developed-by: Emmanuel Gil Peyrot <linkmauve@...kmauve.fr>
Signed-off-by: Emmanuel Gil Peyrot <linkmauve@...kmauve.fr>
---
v2->v3: Use of_platform_default_populate instead of a custom match table.
arch/powerpc/platforms/wiiu/Makefile | 2 +-
arch/powerpc/platforms/wiiu/setup.c | 60 ++++++++++++++++++++++++++++
2 files changed, 61 insertions(+), 1 deletion(-)
create mode 100644 arch/powerpc/platforms/wiiu/setup.c
diff --git a/arch/powerpc/platforms/wiiu/Makefile b/arch/powerpc/platforms/wiiu/Makefile
index fa16c60261e6..abcb7a1beebf 100644
--- a/arch/powerpc/platforms/wiiu/Makefile
+++ b/arch/powerpc/platforms/wiiu/Makefile
@@ -1,4 +1,4 @@
# SPDX-License-Identifier: GPL-2.0
-obj-$(CONFIG_WIIU) += espresso-pic.o latte-pic.o
+obj-$(CONFIG_WIIU) += setup.o espresso-pic.o latte-pic.o
obj-$(CONFIG_LATTEIPC_UDBG) += udbg_latteipc.o
diff --git a/arch/powerpc/platforms/wiiu/setup.c b/arch/powerpc/platforms/wiiu/setup.c
new file mode 100644
index 000000000000..e3f07ce65cad
--- /dev/null
+++ b/arch/powerpc/platforms/wiiu/setup.c
@@ -0,0 +1,60 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Nintendo Wii U board-specific support
+ *
+ * Copyright (C) 2022 The linux-wiiu Team
+ */
+#define DRV_MODULE_NAME "wiiu"
+#define pr_fmt(fmt) DRV_MODULE_NAME ": " fmt
+
+#include <linux/kernel.h>
+#include <linux/of_platform.h>
+
+#include <asm/machdep.h>
+#include <asm/udbg.h>
+
+#include "espresso-pic.h"
+#include "latte-pic.h"
+#include "udbg_latteipc.h"
+
+static int __init wiiu_probe(void)
+{
+ if (!of_machine_is_compatible("nintendo,wiiu"))
+ return 0;
+
+ latteipc_udbg_init();
+
+ return 1;
+}
+
+static void __noreturn wiiu_halt(void)
+{
+ for (;;)
+ cpu_relax();
+}
+
+static void __init wiiu_init_irq(void)
+{
+ espresso_pic_init();
+ latte_pic_init();
+}
+
+static int __init wiiu_device_probe(void)
+{
+ if (!machine_is(wiiu))
+ return 0;
+
+ of_platform_default_populate(NULL, NULL, NULL);
+ return 0;
+}
+device_initcall(wiiu_device_probe);
+
+define_machine(wiiu) {
+ .name = "wiiu",
+ .probe = wiiu_probe,
+ .halt = wiiu_halt,
+ .progress = udbg_progress,
+ .calibrate_decr = generic_calibrate_decr,
+ .init_IRQ = wiiu_init_irq,
+ .get_irq = espresso_pic_get_irq,
+};
--
2.38.1
Powered by blists - more mailing lists