Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp4829753iog; Wed, 22 Jun 2022 06:42:46 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tvXblp97IedXkfyg0DYpxSX4O34O/CdN6e5TKRWK3JSUa2ipk5ojwUZbghqWMRzS3ekFcn X-Received: by 2002:a63:4643:0:b0:3fe:e16a:a01f with SMTP id v3-20020a634643000000b003fee16aa01fmr2910718pgk.91.1655905366504; Wed, 22 Jun 2022 06:42:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655905366; cv=none; d=google.com; s=arc-20160816; b=j0VlEkeeWFg2aBtIuBGZ8C2RpVOvSZADC/vQRINZ8llnEOJFCyJ6+W3AlLI4+Fl6iI MZeJgMmXVx7tdqOIN+P7V9YtAyCTlhmOAKKSVxm2/ykscMnahz7Kb34tnDKT/peRWuzR Rru7XSiVIdzinaNDjBnUo2EH8+7kWNq6yV4os91R6/DpX/Imf7qIDBKGjMRSrxPLk+gi Ya2YLIN+PJ/zTG19TvmWQ886QubQjHDW1q76RAOUUpO33um/mM/gEsvUzhQPqnZp0neL ldLTgLP84Hmlop02nT60pEtVMOioE3HL0aQeRXkOGjNr8uuWKtzdVlIOg4m02urcf25C LqtQ== 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=2QavLro/KgPvvw+eX9V6ftYuJfuUFE+uhiMjqjoAgSU=; b=Ci74ukvbPwlfeFz9l0MhTlQ5U6Rq6cKO8tYRUEea1bbmQ3njuGaIS3E2yMXnmMY95Z VJqf+CIf6V5d0yKx0fRhXLrJhcNSdMxGCdnRJ1XZJ3cRs+1aTcxxYQAn8BDrvtlWT8ub mn4E9DRSeiDJGmhIZs+fXTQmhijUCEUMXzqyQke7H+YoEHge40KO49VzQQ2tclT4tQG9 xuoVYm0zgand/cIrXGwev7IsZpv291Cp51oPVn32YwpBj3DpDLbH7yFbU+W6u6LE0FDp 5osqmj8or7WIbYI08LidG41+gTjh/wlfeLhO8GIcGJfAB4fCZWyogz0uCxpWlT9MN2QD EGGA== 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 c7-20020a170902848700b00163539b9430si21203494plo.434.2022.06.22.06.42.34; Wed, 22 Jun 2022 06:42:46 -0700 (PDT) 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 S1355707AbiFVNM2 (ORCPT + 99 others); Wed, 22 Jun 2022 09:12:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355812AbiFVNMM (ORCPT ); Wed, 22 Jun 2022 09:12:12 -0400 X-Greylist: delayed 73 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 22 Jun 2022 06:12:04 PDT Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B3D43668A; Wed, 22 Jun 2022 06:12:03 -0700 (PDT) Received: (Authenticated sender: ash@heyquark.com) by mail.gandi.net (Postfix) with ESMTPSA id 7837BFF804; Wed, 22 Jun 2022 13:11:54 +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, linkmauve@linkmauve.fr, rw-r-r-0644@protonmail.com, devicetree@vger.kernel.org Subject: [PATCH v2 10/12] powerpc: wiiu: platform support Date: Wed, 22 Jun 2022 23:10:35 +1000 Message-Id: <20220622131037.57604-11-ash@heyquark.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220622131037.57604-1-ash@heyquark.com> References: <20220302044406.63401-1-ash@heyquark.com> <20220622131037.57604-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.36.1