arm64: dts: allwinner: add support for Pinebook
Subsystems (2)
PATCH 1/1 arm64: dts: allwinner: add support for Pinebook
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/ANX9807 RGB-eDP bridge.
- A mini HDMI jack.
Misc:
- A Hall sensor designed to detect the status of lid, connected to GPIO PH10.
- A headphone jack connected to the SoC's internal codec.
- A BMA223 gravity sensor connected to the SoC's I2C1 bus. (Not supported yet)
- A debug UART port muxed with one of the USB ports, only available on product revision of the main board.
This commit adds basical support for it, with out-of-tree patches for display support the laptop can be basically usable.
--- arch/arm64/boot/dts/allwinner/Makefile | 1 + .../boot/dts/allwinner/sun50i-a64-pinebook.dts | 123 +++++++++++++++++++++ 2 files changed, 124 insertions(+) create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
arch/arm64/boot/dts/allwinner/Makefile +1 -0
@@ -1,4 +1,5 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-bananapi-m64.dtb +dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinebook.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pine64-plus.dtb sun50i-a64-pine64.dtb always := $(dtb-y)
arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts new file +123 -0
123 lines not on this page · raw message
Signature · 1 line
2.11.1
PATCH 1/1 arm64: dts: allwinner: add support for Pinebook
25.02.2017, 15:01, "Icenowy Zheng" <[email protected]>:
Quoted 95 lines
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/ANX9807 RGB-eDP bridge.
- A mini HDMI jack.Misc:
- A Hall sensor designed to detect the status of lid, connected to GPIO PH10.
- A headphone jack connected to the SoC's internal codec.
- A BMA223 gravity sensor connected to the SoC's I2C1 bus. (Not supported yet)
- A debug UART port muxed with one of the USB ports, only available on product revision of the main board.This commit adds basical support for it, with out-of-tree patches for display support the laptop can be basically usable.
Signed-off-by Icenowy Zheng <[email protected]>---
?arch/arm64/boot/dts/allwinner/Makefile | 1 + ?.../boot/dts/allwinner/sun50i-a64-pinebook.dts | 123 +++++++++++++++++++++ ?2 files changed, 124 insertions(+)
?create mode 100644arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dtsarch/arm64/boot/dts/allwinner/Makefile +0
-0@@ -1,4 +1,5 @@?dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-bananapi-m64.dtb +dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinebook.dtb ?dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pine64-plus.dtb sun50i-a64-pine64.dtb
?always := $(dtb-y)
arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts new file +37
-0@@ -0,0 +1,123 @@ +/* + * Copyright (c) 2016 ARM Ltd. + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual + * licensing only applies to this file, and not this project as a + * whole. + * + * a) This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Or, alternatively, + * + * b) Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts line 47
Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts new file +10
-0+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +/dts-v1/; + +#include "sun50i-a64.dtsi" + +#include <dt-bindings/gpio/gpio.h>
Sorry but I missed a line here:
#include <dt-bindings/input/input.h>
It's for the switch code for gpio_keys part (it's used to describe the Hall sensor).
Quoted 78 lines
arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts new file +76
-1+ +/ { + model = "Pinebook"; + compatible = "pine64,pinebook", "allwinner,sun50i-a64"; + + aliases { + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + gpio_keys { + compatible = "gpio-keys"; + + lid_switch { + label = "Lid Switch"; + gpios = <&pio 7 10 GPIO_ACTIVE_LOW>; /* PH10 */ + linux,input-type = <EV_SW>; + linux,code = <SW_LID>; + linux,can-disable; + }; + }; + + reg_vcc3v3: vcc3v3 { + compatible = "regulator-fixed"; + regulator-name = "vcc3v3"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + }; +}; + +&ehci1 { + status = "okay"; +}; + +&mmc0 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc0_pins>; + vmmc-supply = <®_vcc3v3>; + cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; + cd-inverted; + disable-wp; + bus-width = <4>; + status = "okay"; +}; + +&mmc2 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc2_pins>; + vmmc-supply = <®_vcc3v3>; + bus-width = <8>; + non-removable; + cap-mmc-hw-reset; + status = "okay"; +}; + +&ohci1 { + status = "okay"; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pins_a>; + status = "okay"; +}; + +&usb_otg { + dr_mode = "host"; + status = "okay"; +}; + +&usbphy { + status = "okay"; +}; --2.11.1
On Sat, Feb 25, 2017 at 03:00:32PM +0800, Icenowy Zheng wrote:
[...]
Quoted 5 lines
arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts new file +0
-0
[...]
arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts line 64
Quoted 4 lines
arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts new file +4
-0+ gpio_keys { + compatible = "gpio-keys"; + + lid_switch {
Node names should not contain underscores. You can use hyphens instead. See
https://www.mail-archive.com/linux-kernel%40vger.kernel.org/msg1122967.html
https://www.mail-archive.com/linux-kernel%40vger.kernel.org/msg1145633.html
arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts line 90
Quoted 6 lines
+&mmc0 {
arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts new file +5
-0+ pinctrl-names = "default"; + pinctrl-0 = <&mmc0_pins>; + vmmc-supply = <®_vcc3v3>; + cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; + cd-inverted;
You ought to be able to replace those last two lines with just cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
Quoted 4 lines
arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts new file +4
-0+ disable-wp; + bus-width = <4>; + status = "okay"; +};
Signature · 1 line
Rask Ingemann Lambertsen
PATCH 1/1 arm64: dts: allwinner: add support for Pinebook
26.02.2017, 00:38, "Rask Ingemann Lambertsen" <[email protected]>:
Quoted 9 lines · Icenowy Zheng
[...]
Quoted 5 lines
?diff --git
a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dtsb/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts?new file mode 100644
?index 000000000000..2dceba3132b0
?---/dev/null
?+++b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts[...]
Quoted 8 lines
Quoted 4 lines
?+
gpio_keys{
?+ compatible = "gpio-keys";
?+
?+lid_switch{Node names should not contain underscores. You can use hyphens instead. See
https://www.mail-archive.com/linux-kernel%40vger.kernel.org/msg1122967.html
https://www.mail-archive.com/linux-kernel%40vger.kernel.org/msg1145633.html
Sorry... but here I modelled after omap3-n900.dts, maybe it should also be changed?
Quoted 10 lines
Quoted 7 lines
?+&mmc0 {
?+ pinctrl-names = "default";
?+ pinctrl-0 = <&mmc0_pins>;
?+ vmmc-supply = <®_vcc3v3>;
?+ cd-gpios = <&pio 5 6GPIO_ACTIVE_HIGH>;
?+ cd-inverted;You ought to be able to replace those last two lines with just cd-gpios = <&pio 5 6
GPIO_ACTIVE_LOW>;
Before this all Allwinner boards uses GPIO_ACTIVE_HIGH and cd-inverted.
Quoted 8 lines
Quoted 5 lines
?+ disable-wp;
?+ bus-width = <4>;
?+ status = "okay";
?+};--
Rask Ingemann Lambertsen
Quoted 17 lines · Icenowy Zheng
26.02.2017, 00:38, "Rask Ingemann Lambertsen" <[email protected]>:
Quoted 14 lines · Icenowy Zheng
[...]
Quoted 5 lines
diff --git
a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dtsb/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dtsnew file mode 100644
index 000000000000..2dceba3132b0
---/dev/null
+++b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts[...]
Quoted 4 lines
+
gpio_keys{
+ compatible = "gpio-keys";
+
+lid_switch{
Quoted 5 lines
Quoted 3 lines
Node names should not contain underscores. You can use hyphens instead. See
https://www.mail-archive.com/linux-kernel%40vger.kernel.org/msg1122967.html
https://www.mail-archive.com/linux-kernel%40vger.kernel.org/msg1145633.htmlSorry... but here I modelled after
omap3-n900.dts, maybe it should also be changed?
I believe this is a recent change to the device tree compiler. (Or maybe not.) Either way underscores in node names will give out warnings if they are turned on. While they aren't at the moment, it does not mean it's OK to add even more.
Old DTs may have them. It may be up to the respective maintainers to fix them. Or there might be some code that depends on the names being how they currently are, which means they can't be changed easily.
Quoted 9 lines
Quoted 9 lines
Quoted 8 lines
+&mmc0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&mmc0_pins>;
+ vmmc-supply = <®_vcc3v3>;
+ cd-gpios = <&pio 5 6GPIO_ACTIVE_HIGH>;
+ cd-inverted;
Quoted 5 lines
Quoted 2 lines
You ought to be able to replace those last two lines with just cd-gpios = <&pio 5 6
GPIO_ACTIVE_LOW>;Before this all Allwinner boards uses
GPIO_ACTIVE_HIGHand cd-inverted.
This might be some leftover stuff from before gpios supported flags. IIRC the mmc core supports both, so dropping cd-inverted and using GPIO_ACTIVE_LOW should be fine.
Documentation/devicetree/bindings/mmc/mmc.txt explains this.
ChenYu
Quoted 13 lines
Quoted 8 lines
Quoted 5 lines
+ disable-wp;
+ bus-width = <4>;
+ status = "okay";
+};--
Rask Ingemann Lambertsen--
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe at googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Quoted 88 lines · 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/ANX9807 RGB-eDP bridge.
- A mini HDMI jack.Misc:
- A Hall sensor designed to detect the status of lid, connected to GPIO PH10.
- A headphone jack connected to the SoC's internal codec.
- A BMA223 gravity sensor connected to the SoC's I2C1 bus. (Not supported yet)
- A debug UART port muxed with one of the USB ports, only available on product revision of the main board.This commit adds basical support for it, with out-of-tree patches for display support the laptop can be basically usable.
Signed-off-by Icenowy Zheng <[email protected]>--- arch/arm64/boot/dts/allwinner/Makefile | 1 + .../boot/dts/allwinner/sun50i-a64-pinebook.dts | 123 +++++++++++++++++++++ 2 files changed, 124 insertions(+) create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dtsarch/arm64/boot/dts/allwinner/Makefile +1
-0@@ -1,4 +1,5 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-bananapi-m64.dtb +dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinebook.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pine64-plus.dtb sun50i-a64-pine64.dtb always := $(dtb-y)arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts new file +30
-0@@ -0,0 +1,123 @@ +/* + * Copyright (c) 2016 ARM Ltd. + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual + * licensing only applies to this file, and not this project as a + * whole. + * + * a) This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Or, alternatively, + * + * b) Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be
arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts line 40
Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts new file +10
-0+ * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE.
Use SPDX tags here:
SPDX-License-Identifier: (GPL-2.0+ OR MIT)
While it says X11, this is really MIT license text.