linuxOS_D21X/target/d211/aishoot88_nor/board.dts
2025-08-14 15:17:16 +08:00

860 lines
16 KiB
Plaintext

/*
* Copyright (C) 2020-2022 ArtInChip Technology Co., 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 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
* 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 "d211.dtsi"
#include "d211-pinctrl.dtsi"
#include <dt-bindings/display/artinchip,aic-disp.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/pwm/pwm.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/input/linux-event-codes.h>
/ {
model = "ArtInChip DEMO QFN88 with SPI NOR";
compatible = "artinchip,d211";
package = "QFN88";
aliases {
gpio0 = &gpio_a;
gpio1 = &gpio_b;
gpio2 = &gpio_c;
gpio3 = &gpio_d;
gpio4 = &gpio_e;
gpio5 = &gpio_f;
pinctrl = &pinctrl;
serial0 = &uart0;
serial1 = &uart1;
serial2 = &uart2;
serial3 = &uart3;
serial4 = &uart4;
serial5 = &uart5;
serial6 = &uart6;
serial7 = &uart7;
i2c0 = &i2c0;
i2c1 = &i2c1;
i2c2 = &i2c2;
i2c3 = &i2c3;
can0 = &can0;
can1 = &can1;
spi0 = &spi0;
spi1 = &spi1;
spi2 = &spi2;
spi3 = &spi3;
gmac0 = &gmac0;
gmac1 = &gmac1;
rtc = &rtc;
wdt0 = &wdt0;
fb0 = &fb0;
de0 = &de0;
lvds0 = &lvds0;
rgb0 = &rgb0;
dbi0 = &dbi0;
dsi0 = &dsi0;
dvp0 = &dvp0;
cir = &cir;
adcim = &adcim;
gpai = &gpai;
rtp = &rtp;
tsen = &tsen;
pwm = &pwm;
sdmc0 = &sdmc0;
sdmc1 = &sdmc1;
sdmc2 = &sdmc2;
dma = &dma;
crypto = &crypto;
sid = &sid;
mtop = &mtop;
codec = &codec;
wri = &wri;
aicudc = &aicudc;
usbh0 = &usbh0;
usbh1 = &usbh1;
ohci0 = &ohci0;
ohci1 = &ohci1;
i2s0 = &i2s0;
i2s1 = &i2s1;
ge = &ge;
};
chosen {
/* The value of stdout-path will be use by SPL/OpenSBI/U-Boot,
* and Kernel.
*/
stdout-path = "serial0:115200n8";
/* The value of "bootargs" here only be used in JTAG download and
* run kenrel case.
* In normal case which run kenrel by u-boot, the "bootargs" value
* will be updated by u-boot.
*/
bootargs = "rdinit=/init earlycon=sbi loglevel=7";
reset-after-fw-burn;
};
config {
};
cpus {
u-boot,dm-pre-reloc;
cpu0: cpu@0 {
u-boot,dm-pre-reloc;
};
};
clocks {
u-boot,dm-pre-reloc;
};
soc {
u-boot,dm-pre-reloc;
};
timer {
u-boot,dm-pre-reloc;
};
memory@40000000 {
device_type = "memory";
reg = <0x0 0x40000000 0x0 0x4000000>;
u-boot,dm-pre-reloc;
};
/* Reserved 1M memory for aic ramdump
When enable CONFIG_AIC_RAMDUMP in linux kernel, also must enable below node.
*/
reserved-memory {
#address-cells = <2>;
#size-cells = <2>;
ranges;
#if 0
aic_ramdump_buf {
compatible = "artinchip,aic-ramdump";
no-map;
reg = <0x43f00000 0x100000>;
};
#endif
};
#if 0
syspower {
compatible = "artinchip,aic-power";
power-gpios = <&gpio_e 13 GPIO_ACTIVE_HIGH>;
};
#endif
panel_dsi {
compatible = "artinchip,aic-dsi-panel-simple";
u-boot,dm-pre-reloc;
backlight = <&backlight>;
status = "okay";
//enable-gpios = <&gpio_c 6 GPIO_ACTIVE_HIGH>;
reset-gpios = <&gpio_c 4 GPIO_ACTIVE_HIGH>;
port {
u-boot,dm-pre-reloc;
panel_dsi_in: endpoint {
u-boot,dm-pre-reloc;
remote-endpoint = <&dsi0_out>;
};
};
};
backlight: backlight {
compatible = "pwm-backlight";
/* pwm node name; pwm device No.; period_ns; pwm_polarity */
pwms = <&pwm 3 1000000 0>;
brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>;
default-brightness-level = <6>;
u-boot,dm-pre-reloc;
status = "okay";
};
keys: gpio-keys {
status = "okay";
compatible = "gpio-keys";
power {
wakeup-source;
gpios = <&gpio_e 5 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
label = "GPIO Power";
linux,code = <KEY_POWER>;
};
up {
gpios = <&gpio_e 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
label = "GPIO Up";
linux,code = <KEY_UP>;
};
down {
gpios = <&gpio_e 7 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
label = "GPIO Down";
linux,code = <KEY_DOWN>;
};
};
rfkill_wlan {
compatible = "rfkill-gpio";
rfkill-name = "wlan";
rfkill-type = <1>;
reset-gpios = <&gpio_f 14 GPIO_ACTIVE_LOW>;
shutdown-gpios = <&gpio_d 10 GPIO_ACTIVE_HIGH>;
status = "okay";
};
};
&crypto {
status = "okay";
};
&cmu {
pll-int0 = <600000000>;
pll-int1 = <1200000000>;
pll-frac1 = <491520000>;
pll-frac2 = <840000000>;
axi0 = <240000000>;
ahb0 = <240000000>;
apb0 = <100000000>;
apb1 = <24000000>;
clk-out0 = <25000000>;
clk-out1 = <25000000>;
clk-out2 = <25000000>;
clk-out3 = <25000000>;
// clk-out0-enable;
// clk-out1-enable;
/* Enable clock out2 */
clk-out2-enable;
// clk-out3-enable;
u-boot,dm-pre-reloc;
};
&rst {
u-boot,dm-pre-reloc;
};
&osc24m {
u-boot,dm-pre-reloc;
};
&rc1m {
u-boot,dm-pre-reloc;
};
&osc32k {
u-boot,dm-pre-reloc;
};
&rtc {
aic,alarm-io-output;
status = "okay";
};
&wdt0 {
timeout-sec = <16>;
status = "okay";
};
&uart0 {
pinctrl-names = "default";
pinctrl-0 = <&uart0_pins_a>;
status = "okay";
u-boot,dm-pre-reloc;
};
&uart1 {
pinctrl-names = "default";
pinctrl-0 = <&uart1_pins_a>;
status = "disabled";
};
&uart2 {
pinctrl-names = "default";
pinctrl-0 = <&uart2_pins_a>;
status = "disabled";
};
&uart3 {
pinctrl-names = "default";
pinctrl-0 = <&uart3_pins_c>;
status = "disabled";
};
&uart4 {
pinctrl-names = "default";
pinctrl-0 = <&uart4_pins_a>;
status = "disabled";
};
&uart5 {
pinctrl-names = "default";
pinctrl-0 = <&uart5_pins_a>;
linux,rs485-enabled-at-boot-time;
aic,rs485-compact-io-mode;
status = "okay";
};
&uart6 {
pinctrl-names = "default";
pinctrl-0 = <&uart6_pins_a>;
status = "disabled";
};
&uart7 {
pinctrl-names = "default";
pinctrl-0 = <&uart7_pins_a>;
status = "disabled";
};
&i2c0 {
pinctrl-names = "default";
pinctrl-0 = <&i2c0_pins_b>;
status = "disabled";
rtc@32 {
compatible = "epson,rx8010";
reg = <0x32>;
};
};
&i2c1 {
pinctrl-names = "default";
pinctrl-0 = <&i2c1_pins_a>;
status = "disabled";
};
&i2c2 {
pinctrl-names = "default";
pinctrl-0 = <&i2c2_pins_a>;
status = "disabled";
};
&i2c3 {
pinctrl-names = "default";
pinctrl-0 = <&i2c3_pins_a>;
status = "disabled";
gt9xx@5d {
status = "disabled";
compatible = "goodix,gt9xx";
reg = <0x5d>;
reset-gpios = <&gpio_a 8 GPIO_ACTIVE_LOW>;
irq-gpios = <&gpio_a 9 GPIO_ACTIVE_HIGH>;
irq-flags = <2>;
touchscreen-max-id = <11>;
touchscreen-size-x = <1024>;
touchscreen-size-y = <600>;
touchscreen-max-w = <512>;
touchscreen-max-p = <512>;
goodix,int-sync = <1>;
};
};
&dma {
u-boot,dm-pre-reloc;
};
&spi0 {
pinctrl-names = "default";
pinctrl-0 = <&spi0_pins_a>;
status = "okay";
spi-max-frequency = <100000000>;
u-boot,dm-pre-reloc;
spi-flash@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "jedec,spi-nor";
spi-max-frequency = <100000000>;
spi-tx-bus-width = <4>;
spi-rx-bus-width = <4>;
reg = <0>;
// aic,encrypt;
// aic,spi-id = <0>;
status = "okay";
u-boot,dm-pre-reloc;
};
};
&spi1 {
pinctrl-names = "default";
pinctrl-0 = <&spi1_pins_a>;
status = "disabled";
};
&spi2 {
pinctrl-names = "default";
pinctrl-0 = <&spi2_pins_a>;
status = "disabled";
};
&spi3 {
pinctrl-names = "default";
pinctrl-0 = <&spi3_pins_a>;
status = "disabled";
};
&sdmc0 {
pinctrl-names = "default";
pinctrl-0 = <&sdmc0_pins>;
bus-width = <4>;
cap-mmc-highspeed;
status = "disabled";
};
&sdmc1 {
pinctrl-names = "default";
pinctrl-0 = <&sdmc1_pins>;
bus-width = <4>;
cap-sd-highspeed;
status = "disabled";
u-boot,dm-pre-reloc;
};
&sdmc2 {
pinctrl-names = "default";
pinctrl-0 = <&sdmc2_pins>;
status = "disabled";
};
/* case 1: USB0 = OTG Enable */
#if 0
&otg {
dp-sw-gpios = <&gpio_e 14 GPIO_ACTIVE_LOW>;
otg-mode = "device";
status = "okay";
};
&aicudc {
pinctrl-names = "default";
pinctrl-0 = <&usb0_pins_a>;
status = "okay";
};
&usbh0 {
aic,usb-ext-resistance = <0x40>;
status = "okay";
};
&ohci0 {
status = "okay";
};
/* case 2: USB0 = OTG Disable */
#else
&otg {
status = "disabled";
};
/* case 2.1: USB0 = Device */
#if 0
&aicudc {
pinctrl-names = "default";
pinctrl-0 = <&usb0_pins_a>;
status = "okay";
};
&usbh0 {
aic,usb-ext-resistance = <0x40>;
status = "disabled";
};
&ohci0 {
status = "disabled";
};
/* case 2.2: USB0 = Host */
#else
&aicudc {
aic,only-uboot-use;
status = "okay";
};
&usbh0 {
pinctrl-names = "default";
pinctrl-0 = <&usb0_pins_a>;
artinchip,sw_usb_phy0;
aic,usb-ext-resistance = <0x40>;
status = "okay";
};
&ohci0 {
status = "okay";
};
#endif
#endif
&pinctrl {
u-boot,dm-pre-reloc;
gmac0_local_pins: gmac0-2 {
pins {
pinmux = <AIC_PINMUX('E', 0, 6)>,
<AIC_PINMUX('E', 1, 6)>,
<AIC_PINMUX('E', 2, 6)>,
<AIC_PINMUX('E', 3, 6)>,
<AIC_PINMUX('E', 4, 6)>,
<AIC_PINMUX('E', 5, 6)>,
<AIC_PINMUX('E', 7, 6)>,
<AIC_PINMUX('E', 8, 6)>,
<AIC_PINMUX('E', 9, 6)>;
bias-disable;
drive-strength = <3>;
};
};
pwm3_pins_d: pwm3-3 {
pins {
pinmux = <AIC_PINMUX('C', 6, 7)>;
bias-disable;
drive-strength = <3>;
};
};
spk_pins_d: spk-3 {
pins {
pinmux = <AIC_PINMUX('E', 11, 4)>;
bias-disable;
drive-strength = <3>;
};
};
gpio_a: bank-0 {
u-boot,dm-pre-reloc;
};
gpio_b: bank-1 {
u-boot,dm-pre-reloc;
};
gpio_c: bank-2 {
u-boot,dm-pre-reloc;
};
gpio_d: bank-3 {
u-boot,dm-pre-reloc;
};
gpio_e: bank-4 {
u-boot,dm-pre-reloc;
};
gpio_f: bank-5 {
u-boot,dm-pre-reloc;
};
dsi_pins: dsi-0 {
u-boot,dm-pre-reloc;
pins {
u-boot,dm-pre-reloc;
};
};
pwm3_pins_d: pwm3-3 {
u-boot,dm-pre-reloc;
pins {
u-boot,dm-pre-reloc;
};
};
uart0_pins_a: uart0-0 {
u-boot,dm-pre-reloc;
pins1 {
u-boot,dm-pre-reloc;
};
pins2 {
u-boot,dm-pre-reloc;
};
};
spi0_pins_a: spi0-0 {
u-boot,dm-pre-reloc;
pins {
u-boot,dm-pre-reloc;
};
};
sdmc1_pins: sdmc1-0 {
u-boot,dm-pre-reloc;
pins {
u-boot,dm-pre-reloc;
};
};
};
&gmac0 {
pinctrl-names = "default";
pinctrl-0 = <&gmac0_local_pins>, <&clk_out2_pins_b>;
phy-handle = <&gmac0_phy>;
phy-reset-gpios = <&gpio_e 6 GPIO_ACTIVE_HIGH>;
phy-addr = <1>;
phy-mode = "rmii";
max-speed = <100>;
aic,use_extclk;
status = "disabled";
gmac0_mdio: mdio {
compatible = "aicmac-mdio";
#address-cells = <1>;
#size-cells = <0>;
gmac0_phy: ethernet-phy@1 {
reg = <1>;
};
};
};
&gmac1 {
status = "disabled";
};
&codec {
pinctrl-names = "default";
pinctrl-0 = <&spk_pins_d>, <&dmic_pins_b>;
pa-gpios = <&gpio_a 7 GPIO_ACTIVE_LOW>;
status = "disabled";
};
/* The data flow:
* fb ---> de ----> lvds ----> panel
* |-> rgb ->|
* '-> dsi ->'
*/
&fb0 {
artinchip,uboot-logo-on=<1>;
height-virtual = <2272>;
u-boot,dm-pre-reloc;
port {
u-boot,dm-pre-reloc;
fb0_out: endpoint {
remote-endpoint = <&de0_in>;
u-boot,dm-pre-reloc;
};
};
};
&de0 {
status = "okay";
u-boot,dm-pre-reloc;
port@0 {
reg = <0>;
u-boot,dm-pre-reloc;
de0_in: endpoint {
remote-endpoint = <&fb0_out>;
u-boot,dm-pre-reloc;
};
};
port@1 {
reg = <1>;
u-boot,dm-pre-reloc;
de0_out: endpoint {
remote-endpoint = <&dsi0_in>;
u-boot,dm-pre-reloc;
};
};
};
&disp {
u-boot,dm-pre-reloc;
};
&ve {
u-boot,dm-pre-reloc;
};
&dsi0 {
pinctrl-names = "default";
pinctrl-0 = <&dsi_pins>;
status = "okay";
u-boot,dm-pre-reloc;
data-lanes = <3 0 1 2>;
lane-polarities = <0 0 0 0>;
port@0 {
reg = <0>;
u-boot,dm-pre-reloc;
dsi0_in: endpoint {
remote-endpoint = <&de0_out>;
u-boot,dm-pre-reloc;
};
};
port@1 {
reg = <1>;
u-boot,dm-pre-reloc;
dsi0_out: endpoint {
remote-endpoint = <&panel_dsi_in>;
u-boot,dm-pre-reloc;
};
};
};
&cir {
pinctrl-names = "default";
pinctrl-0 = <&cir_pins_a>;
rx-level = <1>;
linux,rc-map-name = "rc-empty";
status = "disabled";
};
&adcim {
status = "okay";
};
&gpai {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&gpai7_pins>;
gpai0 {
aic,sample-period-ms = <18>;
aic,high-level-thd = <1830>;
aic,low-level-thd = <1800>;
status = "disabled";
};
gpai1 {
status = "disabled";
};
gpai2 {
status = "disabled";
};
gpai3 {
status = "disabled";
};
gpai4 {
status = "disabled";
};
gpai5 {
status = "disabled";
};
gpai6 {
status = "disabled";
};
gpai7 {
status = "okay";
};
};
&rtp {
aic,max-pressure = <800>;
aic,x-plate = <235>;
pinctrl-names = "default";
pinctrl-0 = <&rtp_pins>;
status = "disabled";
};
&tsen {
status = "okay";
tsen0 {
status = "okay";
};
tsen1 {
status = "okay";
};
};
&pwm {
status = "okay";
u-boot,dm-pre-reloc;
pinctrl-names = "default";
pinctrl-0 = <&pwm3_pins_d>;
/* mode: up-count, down-count, up-down-count
action: none, low, high, inverse */
pwm0 {
aic,mode = "up-count";
aic,tb-clk-rate = <24000000>;
aic,rise-edge-delay = <10>;
aic,fall-edge-delay = <10>;
/* CBD, CBU, CAD, CAU, PRD, ZRO */
aic,action0 = "none", "none", "none", "low", "none", "high";
aic,action1 = "none", "none", "none", "high", "none", "low";
status = "disabled";
u-boot,dm-pre-reloc;
};
pwm1 {
aic,mode = "down-count";
aic,tb-clk-rate = <24000000>;
aic,rise-edge-delay = <10>;
aic,fall-edge-delay = <10>;
/* CBD, CBU, CAD, CAU, PRD, ZRO */
aic,action0 = "none", "none", "none", "low", "none", "high";
aic,action1 = "none", "none", "none", "high", "none", "low";
status = "disabled";
u-boot,dm-pre-reloc;
};
pwm2 {
aic,mode = "up-count";
aic,tb-clk-rate = <24000000>;
/* CBD, CBU, CAD, CAU, PRD, ZRO */
aic,action0 = "none", "none", "none", "high", "low", "none";
aic,action1 = "none", "none", "none", "low", "high", "none";
aic,default-level = <0>;
aic,rise-edge-delay = <10>;
aic,fall-edge-delay = <10>;
status = "okay";
u-boot,dm-pre-reloc;
};
pwm3 {
aic,mode = "up-count";
aic,tb-clk-rate = <24000000>;
/* CBD, CBU, CAD, CAU, PRD, ZRO */
aic,action0 = "none", "none", "none", "low", "none", "high";
aic,action1 = "none", "none", "none", "high", "none", "low";
aic,rise-edge-delay = <10>;
aic,fall-edge-delay = <10>;
status = "okay";
u-boot,dm-pre-reloc;
};
};
&can0 {
pinctrl-names = "default";
pinctrl-0 = <&can0_pins_a>;
status = "disabled";
};
&can1 {
pinctrl-names = "default";
pinctrl-0 = <&can1_pins_a>;
status = "disabled";
};