arm: dts: allwinner: a20: Add Drejo DS167 initial support
Subsystems (3)
From: Sertac TULLUK <[email protected]>
Drejo DS167 is an Allwinner A20 based IoT device, which support
- Allwinner A20 Cortex-A7
- Mali-400MP2 GPU
- AXP209 PMIC
- 1GB DDR3 RAM
- 8GB eMMC
- 10/100M Ethernet
- SATA
- HDMI
- 10.1inch and 7.0inch LVDS LCD and Touch screens
- CSI: OV5640 sensor
- USB OTG
- 2x USB2.0
- builtin KNX Transceiver
- 3x Dry Contact Input
- 3x Relay output
- IR
- UART3
- SPI1
- RTC Battery
- 8x GPIO
- Analogue + Digital Microphone
- PAM8620 speaker Amplifier
- 12V DC power supply
- 3.7V Battery Operable
--- arch/arm/boot/dts/Makefile | 2 + .../boot/dts/sun7i-a20-drejo-ds167-emmc.dts | 69 ++++ arch/arm/boot/dts/sun7i-a20-drejo-ds167.dts | 361 ++++++++++++++++++ 3 files changed, 432 insertions(+) create mode 100644 arch/arm/boot/dts/sun7i-a20-drejo-ds167-emmc.dts create mode 100644 arch/arm/boot/dts/sun7i-a20-drejo-ds167.dts
arch/arm/boot/dts/Makefile +2 -0
@@ -1115,6 +1115,8 @@ dtb-$(CONFIG_MACH_SUN7I) += \ sun7i-a20-olinuxino-lime2-emmc.dtb \ sun7i-a20-olinuxino-micro.dtb \ sun7i-a20-olinuxino-micro-emmc.dtb \ + sun7i-a20-drejo-ds167.dtb \ + sun7i-a20-drejo-ds167-emmc.dtb \ sun7i-a20-orangepi.dtb \ sun7i-a20-orangepi-mini.dtb \ sun7i-a20-pcduino3.dtb \
arch/arm/boot/dts/sun7i-a20-drejo-ds167-emmc.dts new file +69 -0
69 lines not on this page · raw message
arch/arm/boot/dts/sun7i-a20-drejo-ds167.dts new file +361 -0
361 lines not on this page · raw message
Signature · 1 line
2.17.1
Hi,
Quoted 43 lines · On Sun, Aug 02, 2020 at 11:29:24PM +0300, [email protected] wrote:
From: Sertac TULLUK <[email protected]>
Drejo DS167 is an Allwinner A20 based IoT device, which support
- Allwinner A20 Cortex-A7
- Mali-400MP2 GPU
- AXP209 PMIC
- 1GB DDR3 RAM
- 8GB eMMC
- 10/100M Ethernet
- SATA
- HDMI
- 10.1inch and 7.0inch LVDS LCD and Touch screens
- CSI: OV5640 sensor
- USB OTG
- 2x USB2.0
- builtin KNX Transceiver
- 3x Dry Contact Input
- 3x Relay output
- IR
- UART3
- SPI1
- RTC Battery
- 8x GPIO
- Analogue + Digital Microphone
- PAM8620 speaker Amplifier
- 12V DC power supply
- 3.7V Battery OperableSigned-off-by Sertac TULLUK <[email protected]>--- arch/arm/boot/dts/Makefile | 2 + .../boot/dts/sun7i-a20-drejo-ds167-emmc.dts | 69 ++++ arch/arm/boot/dts/sun7i-a20-drejo-ds167.dts | 361 ++++++++++++++++++ 3 files changed, 432 insertions(+) create mode 100644 arch/arm/boot/dts/sun7i-a20-drejo-ds167-emmc.dts create mode 100644 arch/arm/boot/dts/sun7i-a20-drejo-ds167.dtsarch/arm/boot/dts/Makefile +0
-0
arch/arm/boot/dts/Makefile dtb-$(CONFIG_MACH_SUN7I) += \ · line 1119
Quoted 5 lines
arch/arm/boot/dts/Makefile +2
-0@@ -1115,6 +1115,8 @@ dtb-$(CONFIG_MACH_SUN7I) += \ sun7i-a20-olinuxino-lime2-emmc.dtb \ sun7i-a20-olinuxino-micro.dtb \ sun7i-a20-olinuxino-micro-emmc.dtb \ + sun7i-a20-drejo-ds167.dtb \ + sun7i-a20-drejo-ds167-emmc.dtb \
Why do you need an emmc variant here?
Quoted 42 lines
arch/arm/boot/dts/Makefile +0
-0sun7i-a20-orangepi.dtb \ sun7i-a20-orangepi-mini.dtb \ sun7i-a20-pcduino3.dtb \arch/arm/boot/dts/sun7i-a20-drejo-ds167-emmc.dts new file +33
-0@@ -0,0 +1,69 @@ +/* + * Copyright 2020 Sertac TULLUK + * + * Sertac TULLUK <[email protected]> + * + * 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 file 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 file 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.
arch/arm/boot/dts/sun7i-a20-drejo-ds167-emmc.dts line 43
Quoted 10 lines
arch/arm/boot/dts/sun7i-a20-drejo-ds167-emmc.dts new file +10
-0+ * + * 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. + */
You should use an SPDX tag here instead
arch/arm/boot/dts/sun7i-a20-drejo-ds167-emmc.dts line 48
Quoted 4 lines
arch/arm/boot/dts/sun7i-a20-drejo-ds167-emmc.dts new file +4
-0+#include "sun7i-a20-drejo-ds167.dts" + +/ { + model = "drejo DS167-eMMC";
What is the casing of the vendor name? You use an uppercase in the commit title, but a lowercase letter here
arch/arm/boot/dts/sun7i-a20-drejo-ds167-emmc.dts line 49
Quoted 1 line
arch/arm/boot/dts/sun7i-a20-drejo-ds167-emmc.dts new file +1
-0+ compatible = "drejo,sun7i-a20-drejo-ds167-emmc", "allwinner,sun7i-a20";
The vendor prefix must be documented in vendor-prefixes.yaml, and similarly the board compatible must be documented in arm/sunxi.yaml.
I'm not really sure why you'd need a compatible so complicated. If the DS167 ships only with an A20, then you can simply use drejo,ds167-emmc. Also, adding the base board compatible would make sense here.
Quoted 63 lines
arch/arm/boot/dts/sun7i-a20-drejo-ds167-emmc.dts new file +20
-0+ + mmc2_pwrseq: pwrseq { + compatible = "mmc-pwrseq-emmc"; + reset-gpios = <&pio 2 24 GPIO_ACTIVE_LOW>; + }; +}; + +&mmc2 { + vmmc-supply = <®_vcc3v3>; + bus-width = <4>; + non-removable; + mmc-pwrseq = <&mmc2_pwrseq>; + status = "okay"; + + emmc: emmc@0 { + reg = <0>; + compatible = "mmc-card"; + broken-hpi; + }; +};arch/arm/boot/dts/sun7i-a20-drejo-ds167.dts new file +37
-0@@ -0,0 +1,361 @@ +/* + * Copyright 2020 Sertac TULLUK + * + * Sertac TULLUK <[email protected]> + * + * 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 file 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 file 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
arch/arm/boot/dts/sun7i-a20-drejo-ds167.dts line 47
Quoted 10 lines
arch/arm/boot/dts/sun7i-a20-drejo-ds167.dts new file +10
-0+ * 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. + */ + +/dts-v1/; +#include "sun7i-a20.dtsi" +#include "sunxi-common-regulators.dtsi"
If you have the PMIC regulators support, then you don't really need that DTSI.
Quoted 12 lines
arch/arm/boot/dts/sun7i-a20-drejo-ds167.dts new file +12
-0+ +#include <dt-bindings/gpio/gpio.h> +#include <dt-bindings/input/input.h> +#include <dt-bindings/interrupt-controller/irq.h> + +/ { + model = "drejo DS167"; + compatible = "drejo,sun7i-a20-drejo-ds167", "allwinner,sun7i-a20"; + + aliases { + serial0 = &uart0; + serial1 = &uart3;
arch/arm/boot/dts/sun7i-a20-drejo-ds167.dts line 69
Quoted 10 lines
arch/arm/boot/dts/sun7i-a20-drejo-ds167.dts new file +10
-0+ + spi0 = &spi1; + spi1 = &spi2; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + backlight: backlight {
The indentation is off here.
arch/arm/boot/dts/sun7i-a20-drejo-ds167.dts line 74
Quoted 5 lines
arch/arm/boot/dts/sun7i-a20-drejo-ds167.dts new file +5
-0+ compatible = "pwm-backlight"; + + brightness-levels = <0 1 2 4 8 16 32 64 128 255>; + default-brightness-level = <9>; + };
You're missing the pwm attached to the backlight.
Quoted 10 lines
arch/arm/boot/dts/sun7i-a20-drejo-ds167.dts new file +10
-0+ + panel { + compatible = "drejo,ds167-10inch-panel", "panel-lvds"; + backlight = <&backlight>; + + width-mm = <220>; + height-mm = <132>; + data-mapping = "vesa-24"; + + panel-timing {
arch/arm/boot/dts/sun7i-a20-drejo-ds167.dts line 94
Quoted 10 lines
arch/arm/boot/dts/sun7i-a20-drejo-ds167.dts new file +10
-0+ /* 1280x800 @60Hz */ + clock-frequency = <69000000>; + hactive = <1280>; + vactive = <800>; + hsync-len = <1>; /* hs */ + hfront-porch = <118>; /* ri */ + hback-porch = <19>; /* le */ + vfront-porch = <6>; /* lo */ + vback-porch = <9>; /* up */ + vsync-len = <1>; /* vs */
The clock frequency doesn't match the timing you've set (it's supposed to be 69425280 Hz).
Those comments are also fairly redundant with the name of the properties.
Quoted 15 lines
arch/arm/boot/dts/sun7i-a20-drejo-ds167.dts new file +15
-0+ }; + + port { + panel_input: endpoint { + remote-endpoint = <&tcon0_out_lcd>; + }; + }; + }; + + + hdmi-connector { + compatible = "hdmi-connector"; + type = "a"; + + port {
arch/arm/boot/dts/sun7i-a20-drejo-ds167.dts line 119
Quoted 10 lines
arch/arm/boot/dts/sun7i-a20-drejo-ds167.dts new file +10
-0+ hdmi_con_in: endpoint { + remote-endpoint = <&hdmi_out_con>; + }; + }; + }; + + leds { + compatible = "gpio-leds"; + pinctrl-names = "default"; + pinctrl-0 = <&led_pins_ds167>;
You don't need the pinctrl properties here.
arch/arm/boot/dts/sun7i-a20-drejo-ds167.dts line 122
Quoted 3 lines
arch/arm/boot/dts/sun7i-a20-drejo-ds167.dts new file +3
-0+ + red { + label = "ds167-status";
That's not the proper format for leds labels, seeDocumentation/leds/leds-class.rst
Quoted 32 lines
arch/arm/boot/dts/sun7i-a20-drejo-ds167.dts new file +32
-0+ gpios = <&pio 8 9 GPIO_ACTIVE_LOW>; /* PI9 STATUS LED NEAR A20 */ + default-state = "on"; + }; + }; +}; + +&ahci { + target-supply = <®_ahci_5v>; + status = "okay"; +}; + +&codec { + status = "okay"; +}; + +&cpu0 { + cpu-supply = <®_dcdc2>; +}; + +&de { + status = "okay"; +}; + +&ehci0 { + status = "okay"; +}; + +&ehci1 { + status = "okay"; +}; + +&gmac {
arch/arm/boot/dts/sun7i-a20-drejo-ds167.dts line 164
Quoted 10 lines
arch/arm/boot/dts/sun7i-a20-drejo-ds167.dts new file +10
-0+ pinctrl-names = "default"; + pinctrl-0 = <&gmac_mii_pins>, <&gmac_txerr>; + phy-handle = <&phy1>; + phy-mode = "mii"; + status = "okay"; +}; + +&mali { + status = "okay"; +};
The mali is always enabled
Quoted 13 lines
arch/arm/boot/dts/sun7i-a20-drejo-ds167.dts new file +13
-0+&hdmi { + status = "okay"; +}; + +&hdmi_out { + hdmi_out_con: endpoint { + remote-endpoint = <&hdmi_con_in>; + }; +}; + +&i2c0 { + status = "okay"; +
arch/arm/boot/dts/sun7i-a20-drejo-ds167.dts line 188
Quoted 10 lines
arch/arm/boot/dts/sun7i-a20-drejo-ds167.dts new file +10
-0+ axp209: pmic@34 { + reg = <0x34>; + interrupt-parent = <&nmi_intc>; + interrupts = <0 IRQ_TYPE_LEVEL_LOW>; + }; +}; + +&i2c1 { + status = "okay"; +};
What is connected to i2c1?
arch/arm/boot/dts/sun7i-a20-drejo-ds167.dts line 189
Quoted 2 lines
arch/arm/boot/dts/sun7i-a20-drejo-ds167.dts new file +2
-0+ +
There's an extra new line here
arch/arm/boot/dts/sun7i-a20-drejo-ds167.dts line 195
Quoted 5 lines
arch/arm/boot/dts/sun7i-a20-drejo-ds167.dts new file +5
-0+&i2c2 { + status = "okay"; + + clock-frequency = <400000>; + polytouch: edt-ft5x06@38 {
I'm not sure why you need a label, and the node name should be the class of the device, not its model, so touchscreen
arch/arm/boot/dts/sun7i-a20-drejo-ds167.dts line 203
Quoted 8 lines
arch/arm/boot/dts/sun7i-a20-drejo-ds167.dts new file +8
-0+ compatible = "edt,edt-ft5406", "edt,edt-ft5x06"; + reg = <0x38>; + interrupt-parent = <&pio>; + interrupts = <7 21 IRQ_TYPE_EDGE_FALLING>; /* PH21 */ + wake-gpios = <&pio 1 13 GPIO_ACTIVE_HIGH>; /* PB13 */ + touchscreen-size-x = <1200>; + touchscreen-size-y = <800>; + };
The indentation is off here too
arch/arm/boot/dts/sun7i-a20-drejo-ds167.dts line 208
Quoted 5 lines
arch/arm/boot/dts/sun7i-a20-drejo-ds167.dts new file +5
-0+}; + +&i2c3 { + status = "okay"; +};
What is connected to i2c3?
arch/arm/boot/dts/sun7i-a20-drejo-ds167.dts line 209
Quoted 2 lines
arch/arm/boot/dts/sun7i-a20-drejo-ds167.dts new file +2
-0+ +
Extra new line
arch/arm/boot/dts/sun7i-a20-drejo-ds167.dts line 223
Quoted 13 lines
arch/arm/boot/dts/sun7i-a20-drejo-ds167.dts new file +13
-0+&lradc { + vref-supply = <®_vcc3v0>; + status = "okay"; +}; + +&gmac_mdio { + phy1: ethernet-phy@1 { + reg = <1>; + }; +}; + +&mmc0 { + vmmc-supply = <®_vcc3v3>;
I guess it's a regulator supplied by the PMIC too?
Quoted 12 lines
arch/arm/boot/dts/sun7i-a20-drejo-ds167.dts new file +12
-0+ bus-width = <4>; + cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>; /* PH1 */ + status = "okay"; +}; + +&ohci0 { + status = "okay"; +}; + +&ohci1 { + status = "okay"; +};
arch/arm/boot/dts/sun7i-a20-drejo-ds167.dts line 245
Quoted 10 lines
arch/arm/boot/dts/sun7i-a20-drejo-ds167.dts new file +10
-0+ +&otg_sram { + status = "okay"; +}; + +&pio { + gmac_txerr: gmac-txerr-pin { + pins = "PA17"; + function = "gmac"; + };
This should be in the DTSI
Quoted 63 lines
arch/arm/boot/dts/sun7i-a20-drejo-ds167.dts new file +63
-0+ led_pins_ds167: led-pins { + pins = "PI9"; /* Status led, on schematic, this is LED_EN */ + function = "gpio_out"; + drive-strength = <20>; + }; +}; + +&pwm { + pinctrl-names = "default"; + pinctrl-0 = <&pwm0_pin>, <&pwm1_pin>; + status = "okay"; +}; + +#include "axp209.dtsi" + +&ac_power_supply { + status = "okay"; +}; + +&battery_power_supply { + status = "okay"; +}; + +®_dcdc2 { + regulator-always-on; + regulator-min-microvolt = <1000000>; + regulator-max-microvolt = <1400000>; + regulator-name = "vdd-cpu"; +}; + +®_dcdc3 { + regulator-always-on; + regulator-min-microvolt = <1000000>; + regulator-max-microvolt = <1400000>; + regulator-name = "vdd-int-dll"; +}; + +®_ldo2 { + regulator-always-on; + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3000000>; + regulator-name = "avcc"; +}; + +®_ahci_5v { + status = "okay"; +}; + +®_usb0_vbus { + status = "okay"; +}; + +®_usb1_vbus { + status = "okay"; +}; + +®_usb2_vbus { + status = "okay"; +}; + +&spi1 { + pinctrl-names = "default"; + pinctrl-0 = <&spi1_pi_pins>,
arch/arm/boot/dts/sun7i-a20-drejo-ds167.dts line 319
Quoted 10 lines
arch/arm/boot/dts/sun7i-a20-drejo-ds167.dts new file +10
-0+ <&spi1_cs0_pi_pin>; + status = "okay"; +}; + +&spi2 { + pinctrl-names = "default"; + pinctrl-0 = <&spi2_pc_pins>, + <&spi2_cs0_pc_pin>; + status = "okay"; +};
What is connected to the two SPI busses?
arch/arm/boot/dts/sun7i-a20-drejo-ds167.dts line 332
Quoted 12 lines
arch/arm/boot/dts/sun7i-a20-drejo-ds167.dts new file +12
-0+&tcon0 { + pinctrl-names = "default"; + pinctrl-0 = <&lcd_lvds0_pins>; +}; + +&tcon0_out { + tcon0_out_lcd: endpoint { + remote-endpoint = <&panel_input>; + }; +}; + +
Extra new line here
Maxime
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel