Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp370394pxm; Tue, 1 Mar 2022 23:28:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJxD7B340NzJBukTtlwKMhe96amTyHFbOwcnzkkH33GCEgPHePRys/dDgMtWT4p5oQ53EQsy X-Received: by 2002:a05:6402:148d:b0:410:b099:86f1 with SMTP id e13-20020a056402148d00b00410b09986f1mr28118598edv.273.1646206123721; Tue, 01 Mar 2022 23:28:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646206123; cv=none; d=google.com; s=arc-20160816; b=APpVwhWGR5KaYTr4pywU/nCO4l+/0qmzlAoWcLHn1B015i6a2fU4Yh/1wiCWi3cOqW /HwHIeXbW/nfSoYO0nZ0YyqK8fuZqryMInt7pRbNIqaZ8VQgl8Aej0e9Vs1zFypA+oLE eKC5QmFIRg74HFaaXsdZcCQGZXhy9v8tCoAlOzrfjw/hkMeiPzTijgcI/iyvZlfCtFxV XoHyAIZzomIQNNvokGblW1GlTJeUXVkx8nzCjYBje1lkiEvcX9VyxIsORkyP2waV08c9 2ywQGbw3dwMC3w0dRgZ7nhtrUMixnwQTFasBch0CxZOyN+soK4xChZI8kXDdudMmlI8k 3h6g== 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=XjLnEwJLdijLILMMgI7QxE+sytLlYa3V5wVGQDD1AmY=; b=eijdc9O3uo5qa4orPKRqpp5WleW3xS9HDbIMvF7DCEK/xdoCbUqj84NXlkJUOiF4mA 5E7mLtVdpF2WTJunr2+suhg+r5A939Vk/pz6FOcNkBMOjuGJHzsPY2Dvwzb+sdLYywmo +j+FnQ0pfIGfQ1Kt39QNbwp3EQrkBkyoDShCGMKvhuFMU2FMD9eOZ5SJQnootbK+21Gg d0PIxIhQOtsLzAz34VtfMXM/BmPOVYmOg2GMhJMVNfoVdf2ogIyxuuoXcKgjwbAUfEAv uCSNV3/zzA+OdbsVD5t7522XQHPg3SwSwZsGYVq3MITmwlzYHNp/zhQrZohmSd9XyJHd LFzQ== 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 e21-20020aa7d7d5000000b00412cd5d7d27si10058929eds.572.2022.03.01.23.28.21; Tue, 01 Mar 2022 23:28:43 -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 S239611AbiCBEqT (ORCPT + 99 others); Tue, 1 Mar 2022 23:46:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239576AbiCBEp6 (ORCPT ); Tue, 1 Mar 2022 23:45:58 -0500 Received: from relay11.mail.gandi.net (relay11.mail.gandi.net [217.70.178.231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EAEB1B12CC for ; Tue, 1 Mar 2022 20:45:12 -0800 (PST) Received: (Authenticated sender: ash@heyquark.com) by mail.gandi.net (Postfix) with ESMTPSA id 7DA90100005; Wed, 2 Mar 2022 04:45:03 +0000 (UTC) From: Ash Logan To: paulus@samba.org, mpe@ellerman.id.au, christophe.leroy@csgroup.eu, robh+dt@kernel.org, benh@kernel.crashing.org Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, j.ne@posteo.net, Roberto Van Eeden , Emmanuel Gil Peyrot Subject: [PATCH 10/12] powerpc: wiiu: platform support Date: Wed, 2 Mar 2022 15:44:04 +1100 Message-Id: <20220302044406.63401-11-ash@heyquark.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220302044406.63401-1-ash@heyquark.com> References: <20220302044406.63401-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, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 --- arch/powerpc/platforms/wiiu/Makefile | 2 +- arch/powerpc/platforms/wiiu/setup.c | 67 ++++++++++++++++++++++++++++ 2 files changed, 68 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..279fa899a296 --- /dev/null +++ b/arch/powerpc/platforms/wiiu/setup.c @@ -0,0 +1,67 @@ +// 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 const struct of_device_id wiiu_of_bus[] = { + { + .compatible = "nintendo,latte", + }, + {}, +}; + +static int __init wiiu_device_probe(void) +{ + if (!machine_is(wiiu)) + return 0; + + of_platform_populate(NULL, wiiu_of_bus, 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.35.1