From patchwork Fri Jun 1 06:29:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasily Khoruzhick X-Patchwork-Id: 10442501 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 4C5BA602BD for ; Fri, 1 Jun 2018 06:31:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 36DF129074 for ; Fri, 1 Jun 2018 06:31:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 34D0029094; Fri, 1 Jun 2018 06:31:18 +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=-2.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, MAILING_LIST_MULTI 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 6772629074 for ; Fri, 1 Jun 2018 06:31:17 +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:References: In-Reply-To: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:List-Owner; bh=A0VhYhLgNYWsZEa2LD5/sUMhmJe9qQYIC/r9MYdRMkc=; b=Z0O4faQALMxL+RZm9F9Q5tyxgo iHhRitEk1ue3cv6nhn7/KZx7+4g6+ieFJHDlllx9HWndzyfcw40nHAG5KmkbH/7hEYVfckdKttD6e dqa8Hs+nZl6oHvP0Mn1beG0XYPNfk50gb8ajYXULrn0rbK8Z7zEAVgMxoapZCgJSrSmuUHGARkIIH Epp9nngzD7N4lHJTL9Bz+vUg6LMyx8+U8yoD96CQBHQFYmAxDzjKwSmvqZcT/9Zr2/Rf8x4d09hli ySIvQQyCR3BZjER3q41LBjjLuaiLWcIivG5a6kuXNRbdtfdN2y4p53m5m26kK6akbPsFHVcRsRSkc 2dgJ2twA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fOdae-0003z0-Iu; Fri, 01 Jun 2018 06:31:08 +0000 Received: from mail-pl0-x241.google.com ([2607:f8b0:400e:c01::241]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fOdYv-0001py-6R for linux-arm-kernel@lists.infradead.org; Fri, 01 Jun 2018 06:29:24 +0000 Received: by mail-pl0-x241.google.com with SMTP id u6-v6so14723253pls.9 for ; Thu, 31 May 2018 23:29:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=obn7FduMkjUAdIP6JE6/JVchRzNX9J1r/0LDyXD4UJM=; b=OJs1moXvmcDZTeGEJssDMZVWIz+/id+xkR9ABC05tDvte3TFsW99GHDSugTj9NidFn ihkTW0CLm9L8E/7Gl97ecg0ddmUcDuJHNCK/C42ZIcgn2dGAjmMo21y71bSvp7UlPwEW gll+6UcnPp0MRXJyyOxrMIdti+f3LeecGoYJ7F+X6hs033bDmQeWmkNFXVV1nD6PwmY+ PQuKFL5H8CGAeYXnfHZuCIk5y3onnquV9QhXNTNOprmFfWpWr38Z3urYaf4zUKORNKPf YmDcE6ZXBGr8BcobqgNun/3mm/rhzk9d1+Ot/0XCZNbX5wzuBSEGyCI+7e50UGks4VHa uTJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=obn7FduMkjUAdIP6JE6/JVchRzNX9J1r/0LDyXD4UJM=; b=Ce05KbEjiPwREvhhb4zFMbgDJsniN6ub5JlwV3ZCDJvoEXkQFDhKAU1aX5nx07VZfc 0ZAWupeQYcWcdR7mfJcBFtjoPJzA9L+0ksn6yFxvIc3QA+SXGDMcfSdEdQ7xfhcMyMRH vu+9FV3aCWcpe6uZnBLG9KJ+CNuarKpV4+wSUGTHVZ244DhujvGYPhGc7LblDr0HIrFC z/CXIOjc4K8SHR+nIqLby66sIFgoKdxFhXkMArmv48BNMJQVHcDmWTZK52oQJldjlWow epEZOzQMpDTcBLPyKoVGZPr8Yf0FkzC6SXgDHjnvChyHHh3pHfzw1M2/UJUeJptwUOfU /RBg== X-Gm-Message-State: ALKqPwcQLdW+7RPZCmietku7nAGOI+c19P1cQ6aZ6gwOTqbsS5MQKrGb db0S84X/5e2plGiGlxhRVXk= X-Google-Smtp-Source: ADUXVKITjNDGfg+x8iHnUW5HmlRf92+3cNfKwK/srTcWQt3t2ZRAv6vGewDBiLPjWR0+xRICNaD7Ng== X-Received: by 2002:a17:902:6105:: with SMTP id t5-v6mr9865720plj.138.1527834551361; Thu, 31 May 2018 23:29:11 -0700 (PDT) Received: from anarsoul-thinkpad.lan (216-71-193-140.dyn.novuscom.net. [216.71.193.140]) by smtp.gmail.com with ESMTPSA id d22-v6sm11149949pfl.10.2018.05.31.23.29.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 31 May 2018 23:29:10 -0700 (PDT) From: Vasily Khoruzhick To: Maxime Ripard , Chen-Yu Tsai , Rob Herring , Mark Rutland , Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org Subject: [PATCH 3/3] arm64: dts: allwinner: add support for Pinebook Date: Thu, 31 May 2018 23:29:01 -0700 Message-Id: <20180601062901.8052-4-anarsoul@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180601062901.8052-1-anarsoul@gmail.com> References: <20180601062901.8052-1-anarsoul@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180531_232921_258904_E15DCC59 X-CRM114-Status: GOOD ( 21.88 ) 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: Vasily Khoruzhick , Icenowy Zheng 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 From: Icenowy Zheng Pinebook is a A64-based laptop produced by Pine64, with the following peripherals: USB: - Two external USB ports (one is directly connected to A64's OTG controller, the other is under a internal hub connected to the host-only controller.) - USB HID keyboard and touchpad connected to the internal hub. - USB UVC camera connected to the internal hub. Power-related: - A DC IN jack connected to AXP803's DCIN pin. - A Li-Polymer battery connected to AXP803's battery pins. Storage: - An eMMC by Foresee on the main board (in the product revision of the main board it's designed to be switchable). - An external MicroSD card slot. Display: - An eDP LCD panel (1366x768) connected via an ANX6345 RGB-eDP bridge. - A mini HDMI port. Misc: - A Hall sensor designed to detect the status of lid, connected to GPIO PL12. - A headphone jack connected to the SoC's internal codec. - A debug UART port muxed with headphone jack. This commit adds basical support for it. [vasily: squashed several commits into one, added simplefb node, added usbphy to ehci0 and ohci0 nodes] Signed-off-by: Icenowy Zheng Signed-off-by: Vasily Khoruzhick --- arch/arm64/boot/dts/allwinner/Makefile | 1 + .../dts/allwinner/sun50i-a64-pinebook.dts | 285 ++++++++++++++++++ 2 files changed, 286 insertions(+) create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts diff --git a/arch/arm64/boot/dts/allwinner/Makefile b/arch/arm64/boot/dts/allwinner/Makefile index 8bebe7da5ed9..a8c6d0c6f2c5 100644 --- a/arch/arm64/boot/dts/allwinner/Makefile +++ b/arch/arm64/boot/dts/allwinner/Makefile @@ -4,6 +4,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-nanopi-a64.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-olinuxino.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-orangepi-win.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pine64-plus.dtb sun50i-a64-pine64.dtb +dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinebook.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-sopine-baseboard.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-teres-i.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-pc2.dtb diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts new file mode 100644 index 000000000000..d952db217702 --- /dev/null +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts @@ -0,0 +1,285 @@ +/* + * Copyright (C) 2017 Icenowy Zheng + * Copyright (C) 2018 Vasily Khoruzhick + * + * SPDX-License-Identifier: (GPL-2.0 OR MIT) + */ + +/dts-v1/; + +#include "sun50i-a64.dtsi" + +#include +#include +#include + +/ { + model = "Pinebook"; + compatible = "pine64,pinebook", "allwinner,sun50i-a64"; + + aliases { + serial0 = &uart0; + ethernet0 = &rtl8723cs; + }; + + backlight: backlight { + compatible = "pwm-backlight"; + pwms = <&pwm 0 50000 0>; + brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>; + default-brightness-level = <2>; + enable-gpios = <&pio 3 23 GPIO_ACTIVE_HIGH>; /* PD23 */ + }; + + chosen { + stdout-path = "serial0:115200n8"; + + framebuffer-lcd { + panel-supply = <®_dc1sw>; + dvdd25-supply = <®_dldo2>; + dvdd12-supply = <®_fldo1>; + }; + }; + + gpio_keys { + compatible = "gpio-keys"; + + lid_switch { + label = "Lid Switch"; + gpios = <&r_pio 0 12 GPIO_ACTIVE_LOW>; /* PL12 */ + linux,input-type = ; + linux,code = ; + linux,can-disable; + }; + }; + + reg_vcc3v3: vcc3v3 { + compatible = "regulator-fixed"; + regulator-name = "vcc3v3"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + }; + + wifi_pwrseq: wifi_pwrseq { + compatible = "mmc-pwrseq-simple"; + reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */ + }; +}; + +&ehci0 { + phys = <&usbphy 0>; + phy-names = "usb"; + status = "okay"; +}; + +&ehci1 { + status = "okay"; +}; + +&mmc0 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc0_pins>; + vmmc-supply = <®_dcdc1>; + cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; + cd-inverted; + disable-wp; + bus-width = <4>; + status = "okay"; +}; + +&mmc1 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc1_pins>; + vmmc-supply = <®_dldo4>; + vqmmc-supply = <®_eldo1>; + mmc-pwrseq = <&wifi_pwrseq>; + bus-width = <4>; + non-removable; + status = "okay"; + + rtl8723cs: wifi@1 { + reg = <1>; + }; +}; + +&mmc2 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc2_pins>; + vmmc-supply = <®_dcdc1>; + vqmmc-supply = <®_eldo1>; + bus-width = <8>; + non-removable; + cap-mmc-hw-reset; + mmc-hs200-1_8v; + status = "okay"; +}; + +&ohci0 { + phys = <&usbphy 0>; + phy-names = "usb"; + status = "okay"; +}; + +&ohci1 { + status = "okay"; +}; + +&pwm { + pinctrl-names = "default"; + pinctrl-0 = <&pwm_pin>; + status = "okay"; +}; + +&r_rsb { + status = "okay"; + + axp803: pmic@3a3 { + compatible = "x-powers,axp803"; + reg = <0x3a3>; + interrupt-parent = <&r_intc>; + interrupts = <0 IRQ_TYPE_LEVEL_LOW>; + }; +}; + +/* The ANX6345 eDP-bridge is on r_i2c. There is no linux (mainline) + * driver for this chip at the moment, the bootloader initializes it. + * However it can be accessed with the i2c-dev driver from user space. + */ +&r_i2c { + clock-frequency = <100000>; + pinctrl-names = "default"; + pinctrl-0 = <&r_i2c_pins_a>; + status = "okay"; +}; + +#include "axp803.dtsi" + +®_aldo1 { + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + regulator-name = "vcc-csi"; +}; + +®_aldo2 { + regulator-always-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc-pl"; +}; + +®_aldo3 { + regulator-always-on; + regulator-min-microvolt = <2700000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc-pll-avcc"; +}; + +®_dc1sw { + regulator-name = "vcc-lcd"; +}; + +®_dcdc1 { + regulator-always-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc-3v3"; +}; + +®_dcdc2 { + regulator-always-on; + regulator-min-microvolt = <1000000>; + regulator-max-microvolt = <1300000>; + regulator-name = "vdd-cpux"; +}; + +/* DCDC3 is polyphased with DCDC2 */ + +®_dcdc5 { + regulator-always-on; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + regulator-name = "vcc-dram"; +}; + +®_dcdc6 { + regulator-always-on; + regulator-min-microvolt = <1100000>; + regulator-max-microvolt = <1100000>; + regulator-name = "vdd-sys"; +}; + +®_dldo1 { + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc-hdmi"; +}; + +®_dldo2 { + regulator-min-microvolt = <2500000>; + regulator-max-microvolt = <2500000>; + regulator-name = "vcc-edp"; +}; + +®_dldo3 { + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "avdd-csi"; +}; + +®_dldo4 { + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc-wifi"; +}; + +®_eldo1 { + regulator-always-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-name = "cpvdd"; +}; + +®_eldo3 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-name = "vdd-1v8-csi"; +}; + +®_fldo1 { + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + regulator-name = "vcc-1v2-hsic"; +}; + +®_fldo2 { + regulator-always-on; + regulator-min-microvolt = <1100000>; + regulator-max-microvolt = <1100000>; + regulator-name = "vdd-cpus"; +}; + +®_ldo_io0 { + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc-usb"; + status = "okay"; +}; + +®_rtc_ldo { + regulator-name = "vcc-rtc"; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pins_a>; + status = "okay"; +}; + +&usb_otg { + dr_mode = "host"; +}; + +&usbphy { + usb0_vbus-supply = <®_ldo_io0>; + usb1_vbus-supply = <®_ldo_io0>; + status = "okay"; +};