From nobody Tue Dec 23 14:11:28 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E6C8CC433EF for ; Tue, 28 Jun 2022 13:34:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346149AbiF1NeZ (ORCPT ); Tue, 28 Jun 2022 09:34:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346590AbiF1Nc2 (ORCPT ); Tue, 28 Jun 2022 09:32:28 -0400 Received: from relay12.mail.gandi.net (relay12.mail.gandi.net [217.70.178.232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A26D731363; Tue, 28 Jun 2022 06:32:12 -0700 (PDT) Received: (Authenticated sender: ash@heyquark.com) by mail.gandi.net (Postfix) with ESMTPSA id 1CC1320001B; Tue, 28 Jun 2022 13:32:04 +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 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 v3 02/12] powerpc: wiiu: device tree Date: Tue, 28 Jun 2022 23:31:34 +1000 Message-Id: <20220628133144.142185-3-ash@heyquark.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220628133144.142185-1-ash@heyquark.com> References: <20220622131037.57604-1-ash@heyquark.com> <20220628133144.142185-1-ash@heyquark.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Add a device tree source file for the Nintendo Wii U video game 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 --- v1->v2: Style and formatting changes suggested by Rob Herring. License remains GPL-2.0 as the other powerpc dtses are the same, happy to change if there is a different preferred default. v2->v3: Re-added address-cells accidentally removed in v2. Marked latte as a simple-bus, since it is. arch/powerpc/boot/dts/wiiu.dts | 326 +++++++++++++++++++++++++++++++++ 1 file changed, 326 insertions(+) create mode 100644 arch/powerpc/boot/dts/wiiu.dts diff --git a/arch/powerpc/boot/dts/wiiu.dts b/arch/powerpc/boot/dts/wiiu.dts new file mode 100644 index 000000000000..44a5a1469095 --- /dev/null +++ b/arch/powerpc/boot/dts/wiiu.dts @@ -0,0 +1,326 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Nintendo Wii U Device Tree Source + * + * Copyright (C) 2022 The linux-wiiu Team + */ + +/dts-v1/; +#include +#include + +/ { + model =3D "nintendo,wiiu"; + compatible =3D "nintendo,wiiu"; + + #address-cells =3D <1>; + #size-cells =3D <1>; + + chosen { + bootargs =3D "root=3D/dev/sda1 rootwait"; + }; + + memory { + device_type =3D "memory"; + reg =3D <0x00000000 0x02000000 /* MEM1 - 32MiB */ + 0x08000000 0x00300000 /* MEM0 - 3MiB */ + 0x10000000 0x80000000>; /* MEM2 - 2GiB */ + }; + + cpus { + #address-cells =3D <1>; + #size-cells =3D <0>; + + /* TODO: Add SMP */ + PowerPC,espresso@0 { + device_type =3D "cpu"; + reg =3D <0>; + clock-frequency =3D <1243125000>; /* 1.243125GHz */ + bus-frequency =3D <248625000>; /* 248.625MHz core-to-bus 5x */ + timebase-frequency =3D <62156250>; /* 1/4 of the bus clock */ + i-cache-size =3D <32768>; /* 32K icache */ + i-cache-line-size =3D <32>; + i-cache-block-size =3D <32>; + i-cache-sets =3D <128>; + d-cache-size =3D <32768>; /* 32K dcache */ + d-cache-line-size =3D <32>; + d-cache-block-size =3D <32>; + d-cache-sets =3D <128>; + next-level-cache =3D <&L2_0>; + L2_0:l2-cache { + compatible =3D "cache"; + cache-level =3D <2>; + cache-unified; + cache-size =3D <0x80000>; /* 512KB L2 */ + cache-line-size =3D <64>; + cache-block-size =3D <32>; + cache-sets =3D <2048>; + }; + }; + }; + + latte { + #address-cells =3D <1>; + #size-cells =3D <1>; + compatible =3D "nintendo,latte", "simple-bus"; + ranges =3D <0x0c000000 0x0c000000 0x00400000 /* Espresso-only registers = */ + 0x0d000000 0x0d000000 0x00200000 /* Latte AHB deivces */ + 0x0d800000 0x0d800000 0x00800000>; /* Latte SoC registers */ + + latte_gpu: gpu@c200000 { + compatible =3D "nintendo,latte-gpu7"; + reg =3D <0x0c200000 0x80000>; + interrupts =3D <2>; + interrupt-parent =3D <&espresso_pic>; + }; + + espresso_pic: pic@c000078 { + #interrupt-cells =3D <1>; + interrupt-controller; + + compatible =3D "nintendo,espresso-pic"; + reg =3D <0x0c000078 0x18>; + }; + + latte_dsp: dsp@c005000 { + compatible =3D "nintendo,latte-dsp"; + reg =3D <0x0c005000 0x200>; + }; + + ehci_0: usb@d040000 { + compatible =3D "nintendo,latte-usb-ehci", "usb-ehci"; + reg =3D <0x0d040000 0x100>; + interrupts =3D <4>; + interrupt-parent =3D <&latte_pic>; + big-endian-regs; + }; + + ohci_0_0: usb@d050000 { + compatible =3D "nintendo,latte-usb-ohci"; + reg =3D <0x0d050000 0x100>; + interrupts =3D <5>; + interrupt-parent =3D <&latte_pic>; + + big-endian-regs; + }; + + ohci_0_1: usb@d060000 { + compatible =3D "nintendo,latte-usb-ohci"; + reg =3D <0x0d060000 0x100>; + interrupts =3D <6>; + interrupt-parent =3D <&latte_pic>; + + big-endian-regs; + }; + + ehci_1: usb@d120000 { + compatible =3D "nintendo,latte-usb-ehci", "usb-ehci"; + reg =3D <0x0d120000 0x100>; + interrupts =3D <16>; + interrupt-parent =3D <&latte_pic>; + big-endian-regs; + }; + + ohci_1_0: usb@d130000 { + compatible =3D "nintendo,latte-usb-ohci"; + reg =3D <0x0d130000 0x100>; + interrupts =3D <35>; + interrupt-parent =3D <&latte_pic>; + + big-endian-regs; + }; + + ehci_2: usb@d140000 { + compatible =3D "nintendo,latte-usb-ehci", "usb-ehci"; + reg =3D <0x0d140000 0x100>; + interrupts =3D <36>; + interrupt-parent =3D <&latte_pic>; + big-endian-regs; + }; + + ohci_2_0: usb@d150000 { + compatible =3D "nintendo,latte-usb-ohci"; + reg =3D <0x0d150000 0x100>; + interrupts =3D <37>; + interrupt-parent =3D <&latte_pic>; + + big-endian-regs; + }; + + sdcard_0: sdhci@d070000 { + compatible =3D "nintendo,latte-sdhci","sdhci"; + reg =3D <0x0d070000 0x200>; + interrupts =3D <7>; + interrupt-parent =3D <&latte_pic>; + }; + + wifi_0: sdhci@d080000 { + compatible =3D "nintendo,latte-sdhci","sdhci"; + reg =3D <0x0d080000 0x200>; + interrupts =3D <8>; + interrupt-parent =3D <&latte_pic>; + }; + + legacy_ipc: ipc@d800000 { + compatible =3D "nintendo,latte-ipc", "nintendo,hollywood-ipc"; + reg =3D <0x0d800000 0x10>; + interrupts =3D <30 31>; + interrupt-parent =3D <&latte_pic>; + }; + + latte_otp: otp@d8001ec { + compatible =3D "nintendo,latte-otp"; + reg =3D <0x0d8001ec 0x8>; + }; + + sata: ahci@d160400 { + compatible =3D "nintendo,latte-ahci"; + reg =3D <0x0d160400 0x808>; + + interrupt-parent =3D <&latte_pic>; + interrupts =3D <38 28>; + }; + + latte_pic: pic@d800440 { + #interrupt-cells =3D <1>; + interrupt-controller; + + compatible =3D "nintendo,latte-pic"; + reg =3D <0x0d800440 0x30>; + interrupt-parent =3D <&espresso_pic>; + interrupts =3D <24>; + }; + + gpio: gpio@d8000c0 { + #gpio-cells =3D <2>; + compatible =3D "nintendo,latte-gpio", "nintendo,hollywood-gpio"; + + reg =3D <0x0d8000c0 0x40>; + gpio-controller; + /* TODO: There are actually 31 AHBALL GPIOs */ + ngpios =3D <24>; + + gpio-line-names =3D + "POWER", "DWIFI", "FAN", "DC_DC", + "", "Esp10WorkAround", "", "", + "PADPD", "", "EEP_CS", "EEP_CLK", + "EEP_MOSI", "EEP_MISO", "AVE_SCL", "AVE_SDA", + "DEBUG0", "DEBUG1", "DEBUG2", "DEBUG3", + "DEBUG4", "DEBUG5", "DEBUG6", "DEBUG7"; + + interrupt-controller; + #interrupt-cells =3D <2>; + interrupts =3D <10>; + interrupt-parent =3D <&latte_pic>; + }; + + gpio2: gpio@d800520 { + #gpio-cells =3D <2>; + compatible =3D "nintendo,latte-gpio", "nintendo,hollywood-gpio"; + + reg =3D <0x0d800520 0x40>; + gpio-controller; + ngpios =3D <7>; + + gpio-line-names =3D + "FANSPEED", "SMC_SCL", "SMC_SDA", "DC_DC2", + "AVE_INT", "", "AVE_RESET"; + + interrupt-controller; + #interrupt-cells =3D <2>; + interrupts =3D <10>; + interrupt-parent =3D <&latte_pic>; + }; + }; + + spi_gpio: spi-gpio { + compatible =3D "spi-gpio"; + #address-cells =3D <1>; + #size-cells =3D <0>; + + cs-gpios =3D <&gpio 10 GPIO_ACTIVE_HIGH>; + gpio-sck =3D <&gpio 11 GPIO_ACTIVE_HIGH>; + gpio-mosi =3D <&gpio 12 GPIO_ACTIVE_HIGH>; + gpio-miso =3D <&gpio 13 GPIO_ACTIVE_HIGH>; + num-chipselects =3D <1>; + + eeprom@0 { + compatible =3D "atmel,at93c66"; + reg =3D <0>; + spi-max-frequency =3D <1000000>; + spi-cs-high; + /* TODO: wiiubrew says this is 16-bit, but I only get the correct + * values in 8-bit... + */ + data-size =3D <8>; + read-only; + + #address-cells =3D <1>; + #size-cells =3D <1>; + + /* https://wiiubrew.org/wiki/Hardware/SEEPROM */ + rng_seed: rng@12 { reg =3D <0x012 8>; }; + ppc_pvr: pvr@20 { reg =3D <0x020 4>; }; + seeprom_ver_str: sver-str@24 { reg =3D <0x024 6>; }; + seeprom_ver: sver@2a { reg =3D <0x02A 2>; }; + otp_ver: over@2c { reg =3D <0x02C 2>; }; + otp_rev: orev@2e { reg =3D <0x02E 2>; }; + otp_ver_str: over-str@30 { reg =3D <0x030 8>; }; + + bc_crc: bc-crc@38 { reg =3D <0x038 4>; }; + bc_sz: bc-sz@3c { reg =3D <0x03C 2>; }; + bc_ver: bc-ver@3e { reg =3D <0x03E 2>; }; + bc_boardtype: boardtype@42 { reg =3D <0x042 2>; }; + bc_boardrev: boardrev@44 { reg =3D <0x044 2>; }; + bc_bootsource: bootsource@46 { reg =3D <0x046 2>; }; + bc_ddr3size: ddr3size@48 { reg =3D <0x048 2>; }; + bc_ddr3speed: ddr3speed@4a { reg =3D <0x04A 2>; }; + bc_ppcclockmul: ppcclockmul@4c { reg =3D <0x04C 2>; }; + bc_iopclockmul: iopclockmul@46 { reg =3D <0x04E 2>; }; + bc_video1080p: video1080p@50 { reg =3D <0x050 2>; }; + bc_ddr3vendor: ddr3vendor@52 { reg =3D <0x052 2>; }; + bc_movpassivereset: movpassivereset@54 { reg =3D <0x054 2>; }; + bc_syspllspd: syspllspd@56 { reg =3D <0x056 2>; }; + bc_satadevice: satadevice@58 { reg =3D <0x058 2>; }; + bc_consoletype: consoletype@5a { reg =3D <0x05A 2>; }; + bc_deviceprescence: deviceprescence@5c { reg =3D <0x05C 2>; }; + + drive_key: drvkey@80 { reg =3D <0x080 16>; }; + factory_key: fackey@90 { reg =3D <0x090 16>; }; + shdd_key: shddkey@a0 { reg =3D <0x0A0 16>; }; + usb_key_seed: usbkeyseed@b0 { reg =3D <0x0B0 16>; }; + drive_key_flag: drvkeyf@c0 { reg =3D <0x0C0 2>; }; + usb_key_flag: udbkeyf@c2 { reg =3D <0x0C2 2>; }; + shdd_key_flag: shddkeyf@c4 { reg =3D <0x0C4 2>; }; + + sysprod_version: sp_ver@140 { reg =3D <0x140 4>; }; + sysprod_eeprom_version: sp_ee_ver@144 { reg =3D <0x144 4>; }; + sysprod_product_area: sp_parea@148 { reg =3D <0x148 4>; }; + sysprod_game_region: sp_region@14c { reg =3D <0x14C 4>; }; + sysprod_ntsc_pal: sp_ntscpal@150 { reg =3D <0x150 4>; }; + sysprod_5ghz_country: sp_5ghz_c@154 { reg =3D <0x154 2>; }; + sysprod_5ghz_country_rev: sp_5ghz_crev@156 { reg =3D <0x156 2>; }; + sysprod_code: sp_code@158 { reg =3D <0x158 8>; }; + sysprod_serial: sp_serial@160 { reg =3D <0x160 16>; }; + sysprod_model: sp_model@170 { reg =3D <0x170 16>; }; + + prod_year: pyear@188 { reg =3D <0x188 2>; }; + prod_date: pdate@18a { reg =3D <0x18A 2>; }; + prod_time: ptime@18c { reg =3D <0x18C 2>; }; + + boot_params: boot_params@1c0 { reg =3D <0x1C0 48>; }; + }; + }; + + /* TODO make this gpio-keyed once hollywood-gpio supports interrupts */ + gpio-keys-polled { + poll-interval =3D <50>; + compatible =3D "gpio-keys-polled"; + + power { + label =3D "Power Button"; + gpios =3D <&gpio 0 GPIO_ACTIVE_HIGH>; + linux,code =3D ; + }; + }; +}; --=20 2.36.1