Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1785566rwb; Sat, 19 Nov 2022 03:36:14 -0800 (PST) X-Google-Smtp-Source: AA0mqf6tcoiSCO87eCEUVuKrI3g6/8T7gtx19y3Y3AF0nyZYW73rpeUT7FV0jwSTnhpSWUd5hE+2 X-Received: by 2002:a17:906:d103:b0:7ad:9673:8b73 with SMTP id b3-20020a170906d10300b007ad96738b73mr9442636ejz.14.1668857774285; Sat, 19 Nov 2022 03:36:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668857774; cv=none; d=google.com; s=arc-20160816; b=0J1hQXaULYinoW3d3u/Qbk1fQJgCml96PjQB002gOla52kwg6HNYW8Fn37sQ6V2Xoj z7iR31GK63qhONnkFx6SxVBNCsYbkSJSKdStdMsXlUziyzKatHT50elz6C1igljB6B8d xEroJNR9RNqp9Fba5BUI7ra4zVBcMw3xc9LFU3xaecHv7kmiGMcKCbfyOnQPhdt0pIyF bjdkqamv8kl6EJWk1LQrDqKuKuOh5asmfxyMpvUljy5zdrkWktSGaPcnc8ZyCW1J9XW1 dRHLHlW9LWx2JAE8LkquG4CzLzB5ED6HbsXltFgyDiKNUAttqrLNv7Balbzv+6oRwy3t xjCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=Gocs/bFniJ5SQ3hpkO5LwanfQbzWfG7ldWF1WGwfanw=; b=wmZzcxvYRIVxEkd2+fYXLSISecedtgeHV/2rIavAw7A4Hoq6byOZk+ZJmCzrgK2079 c8CuMIG8O7gtTrTDVKqaMO0owoCCrRWypNU+PaagggqsgG/PRj6SH6sO63kGkcYpkr1/ QdwTh0btlcMNS8sBEfFTM8ZsPoDHM8DKc5B64CTwNzjhm/U189TK8LDglIAEpfWvRa4p 93NK9GibzsQrbRWv6ujAzx2zVe+8/GrwzVb4buRrucHRCrfOVLLm4adwWgSIkKSoZMBY sU3Nih9O5I43+UVJSbmOF2hZjE+Qzx+docPr2jNrnYBYbFnlX+M3sS+cwUsRNFZS9aUK y4gg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y10-20020a056402270a00b004637e16cfa4si5764416edd.599.2022.11.19.03.35.50; Sat, 19 Nov 2022 03:36:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234139AbiKSLcv (ORCPT + 90 others); Sat, 19 Nov 2022 06:32:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233941AbiKSLcS (ORCPT ); Sat, 19 Nov 2022 06:32:18 -0500 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A4B7950D2; Sat, 19 Nov 2022 03:32:17 -0800 (PST) Received: (Authenticated sender: ash@heyquark.com) by mail.gandi.net (Postfix) with ESMTPSA id BCE59FF802; Sat, 19 Nov 2022 11:32:08 +0000 (UTC) From: Ash Logan To: krzysztof.kozlowski+dt@linaro.org, paulus@samba.org, mpe@ellerman.id.au, christophe.leroy@csgroup.eu, robh+dt@kernel.org, benh@kernel.crashing.org, segher@kernel.crashing.org, pali@kernel.org Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, j.ne@posteo.net, linkmauve@linkmauve.fr, rw-r-r-0644@protonmail.com, devicetree@vger.kernel.org, joel@jms.id.au Subject: [PATCH v4 10/11] powerpc: wiiu: platform support Date: Sat, 19 Nov 2022 22:30:40 +1100 Message-Id: <20221119113041.284419-11-ash@heyquark.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221119113041.284419-1-ash@heyquark.com> References: <20220628133144.142185-1-ash@heyquark.com> <20221119113041.284419-1-ash@heyquark.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add platform support for the Nintendo Wii U console. Signed-off-by: Ash Logan Co-developed-by: Roberto Van Eeden Signed-off-by: Roberto Van Eeden Co-developed-by: Emmanuel Gil Peyrot Signed-off-by: Emmanuel Gil Peyrot --- 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 +#include + +#include +#include + +#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