From patchwork Wed Mar 7 16:43:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 10264381 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 43176602BD for ; Wed, 7 Mar 2018 16:44:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 34E2E281D2 for ; Wed, 7 Mar 2018 16:44:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 29B3028414; Wed, 7 Mar 2018 16:44:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9508C281D2 for ; Wed, 7 Mar 2018 16:44:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=NJjzO3PjmPQw8w8EBlqJHg5pS6M7QSl5Sl1gdnpyt1U=; b=f70 HclQGIeIJEzMXhQ0H0wv3SE82dhisCycVrcyOE9pnkDj15V4zlAdGHTYzuurSd30yRT5vzpqRkejE VNWtGOcBNkv55dAt0A3EqQr6U4Vou9ETr+Y4TZXx+dLmx5uyk5jGGBuADxtEbcVOzYohlqF9XHinG mq1AMVAHF2OdXMogqSzQuU5cvEZEry41eAbRoWBcHBQwT45op2FIDpTmqLjtj46BbykDkL4yBb9C9 yknxIDFF2WmHjTMbVbs4uHuWjnzbx1gAB9xFWyQnIygthZ+vqba6ifLESEadWk5cOudp2an2EJ1j3 y4mJ8UkvYISBEsn6UfzdSawPF0exCFA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1etcAW-0001c9-Je; Wed, 07 Mar 2018 16:43:56 +0000 Received: from mail.bootlin.com ([62.4.15.54]) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1etcAR-0001ap-3Y for linux-arm-kernel@lists.infradead.org; Wed, 07 Mar 2018 16:43:53 +0000 Received: by mail.bootlin.com (Postfix, from userid 110) id 3FE862075C; Wed, 7 Mar 2018 17:43:38 +0100 (CET) Received: from localhost.localdomain (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.bootlin.com (Postfix) with ESMTPSA id D31102071B; Wed, 7 Mar 2018 17:43:37 +0100 (CET) From: Miquel Raynal To: Maxime Ripard , Chen-Yu Tsai Subject: [PATCH] arm: dts: nes: add Nintendo NES Classic Edition support Date: Wed, 7 Mar 2018 17:43:36 +0100 Message-Id: <20180307164336.32359-1-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.14.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180307_084351_511503_82A338B4 X-CRM114-Status: GOOD ( 15.14 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Boris Brezillon , linux-arm-kernel@lists.infradead.org, Miquel Raynal MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The Nintendo NES Classic features an R16 already well supported in mainline. The console over UART0 may be wired on two ports of the R16, both available on the NES Classic PCB. USB host can be used after a bit of soldering to wire a 5V power supply directly on the PCB, in order to free the micro-USB port from that task and allow the plug of any USB device. Signed-off-by: Miquel Raynal --- arch/arm/boot/dts/Makefile | 1 + arch/arm/boot/dts/sun8i-a23-a33.dtsi | 18 ++++++ .../dts/sun8i-r16-nintendo-nes-classic-edition.dts | 71 ++++++++++++++++++++++ 3 files changed, 90 insertions(+) create mode 100644 arch/arm/boot/dts/sun8i-r16-nintendo-nes-classic-edition.dts diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index ade7a38543dc..eed4e1222897 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -990,6 +990,7 @@ dtb-$(CONFIG_MACH_SUN8I) += \ sun8i-h3-orangepi-plus.dtb \ sun8i-h3-orangepi-plus2e.dtb \ sun8i-r16-bananapi-m2m.dtb \ + sun8i-r16-nintendo-nes-classic-edition.dtb \ sun8i-r16-parrot.dtb \ sun8i-r40-bananapi-m2-ultra.dtb \ sun8i-v3s-licheepi-zero.dtb \ diff --git a/arch/arm/boot/dts/sun8i-a23-a33.dtsi b/arch/arm/boot/dts/sun8i-a23-a33.dtsi index 971f9be699a7..1ad7291581be 100644 --- a/arch/arm/boot/dts/sun8i-a23-a33.dtsi +++ b/arch/arm/boot/dts/sun8i-a23-a33.dtsi @@ -315,6 +315,24 @@ bias-pull-up; }; + nand_pins_a: nand-base0@0 { + pins = "PC0", "PC1", "PC2", + "PC5", "PC8", "PC9", "PC10", + "PC11", "PC12", "PC13", "PC14", + "PC15"; + function = "nand0"; + }; + + nand_cs0_pins_a: nand-cs@0 { + pins = "PC4"; + function = "nand0"; + }; + + nand_rb0_pins_a: nand-rb@0 { + pins = "PC6"; + function = "nand0"; + }; + pwm0_pins: pwm0 { pins = "PH0"; function = "pwm0"; diff --git a/arch/arm/boot/dts/sun8i-r16-nintendo-nes-classic-edition.dts b/arch/arm/boot/dts/sun8i-r16-nintendo-nes-classic-edition.dts new file mode 100644 index 000000000000..63c289f1f46d --- /dev/null +++ b/arch/arm/boot/dts/sun8i-r16-nintendo-nes-classic-edition.dts @@ -0,0 +1,71 @@ +// SPDX-License-Identifier: GPL-2.0 OR X11 +/* Copyright (c) 2016 FUKAUMI Naoki */ + +/dts-v1/; +#include "sun8i-a33.dtsi" +#include "sunxi-common-regulators.dtsi" + +/ { + model = "Nintendo NES Classic Edition"; + compatible = "nintendo,nes-classic-edition", "allwinner,sun8i-a33"; + + aliases { + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; +}; + +&uart0 { + /* + * UART0 is available on two ports, both accessible on the NES Classic + * PCB. One can use the <&uart0_pins_b> handle instead. + */ + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pins_a>; + status = "okay"; +}; + +&nfc { + pinctrl-names = "default"; + pinctrl-0 = <&nand_pins_a &nand_cs0_pins_a &nand_rb0_pins_a>; + status = "okay"; + + /* 2Gb Macronix MX30LF2G18AC (3V) */ + nand@0 { + #address-cells = <1>; + #size-cells = <1>; + reg = <0>; + allwinner,rb = <0>; + nand-ecc-mode = "hw"; + nand-ecc-strength = <16>; + nand-ecc-step-size = <1024>; + }; +}; + +/* + * The NES is powered by the USB port. However it is possible to solder a wire + * from the internal side of the connector on VBUS pin to supply the required 5V + * without the need of a cable plugged in the micro USB port. This way it is + * easy to use any USB device. + */ +&usb_otg { + dr_mode = "host"; + status = "okay"; +}; + +&usbphy { + /* VBUS is always on because it is wired to the power supply */ + usb1_vbus-supply = <®_vcc5v0>; + status = "okay"; +}; + +&ehci0 { + status = "okay"; +}; + +&ohci0 { + status = "okay"; +};