/*
|
* Copyright (c) 2016 Fuzhou Rockchip Electronics 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.
|
*/
|
|
#include "rk3399-sapphire.dtsi"
|
#include <dt-bindings/sensor-dev.h>
|
/ {
|
compatible = "rockchip,rk3399-sapphire-excavator", "rockchip,rk3399";
|
|
rt5651_sound: rt5651-sound {
|
compatible = "simple-audio-card";
|
simple-audio-card,format = "i2s";
|
simple-audio-card,name = "realtek,rt5651-codec";
|
simple-audio-card,mclk-fs = <256>;
|
simple-audio-card,widgets =
|
"Microphone", "Mic Jack",
|
"Headphone", "Headphone Jack";
|
simple-audio-card,routing =
|
"Mic Jack", "MICBIAS1",
|
"IN1P", "Mic Jack",
|
"Headphone Jack", "HPOL",
|
"Headphone Jack", "HPOR";
|
simple-audio-card,cpu {
|
sound-dai = <&i2s0>;
|
};
|
simple-audio-card,codec {
|
sound-dai = <&rt5651>;
|
};
|
};
|
|
spdif-sound {
|
status = "okay";
|
compatible = "simple-audio-card";
|
simple-audio-card,name = "ROCKCHIP,SPDIF";
|
simple-audio-card,cpu {
|
sound-dai = <&spdif>;
|
};
|
simple-audio-card,codec {
|
sound-dai = <&spdif_out>;
|
};
|
};
|
|
spdif_out: spdif-out {
|
status = "okay";
|
compatible = "linux,spdif-dit";
|
#sound-dai-cells = <0>;
|
};
|
|
sdio_pwrseq: sdio-pwrseq {
|
compatible = "mmc-pwrseq-simple";
|
clocks = <&rk808 1>;
|
clock-names = "ext_clock";
|
pinctrl-names = "default";
|
pinctrl-0 = <&wifi_enable_h>;
|
|
/*
|
* On the module itself this is one of these (depending
|
* on the actual card populated):
|
* - SDIO_RESET_L_WL_REG_ON
|
* - PDN (power down when low)
|
*/
|
reset-gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; /* GPIO0_B2 */
|
};
|
|
wireless-wlan {
|
compatible = "wlan-platdata";
|
rockchip,grf = <&grf>;
|
wifi_chip_type = "ap6354";
|
sdio_vref = <1800>;
|
WIFI,host_wake_irq = <&gpio0 3 GPIO_ACTIVE_HIGH>; /* GPIO0_a3 */
|
status = "okay";
|
};
|
|
wireless-bluetooth {
|
compatible = "bluetooth-platdata";
|
clocks = <&rk808 1>;
|
clock-names = "ext_clock";
|
//wifi-bt-power-toggle;
|
uart_rts_gpios = <&gpio2 19 GPIO_ACTIVE_LOW>; /* GPIO2_C3 */
|
pinctrl-names = "default", "rts_gpio";
|
pinctrl-0 = <&uart0_rts>, <&bt_reset_gpio>, <&bt_wake_gpio>, <&bt_irq_gpio>;
|
pinctrl-1 = <&uart0_gpios>;
|
//BT,power_gpio = <&gpio3 19 GPIO_ACTIVE_HIGH>; /* GPIOx_xx */
|
BT,reset_gpio = <&gpio0 9 GPIO_ACTIVE_HIGH>; /* GPIO0_B1 */
|
BT,wake_gpio = <&gpio2 26 GPIO_ACTIVE_HIGH>; /* GPIO2_D2 */
|
BT,wake_host_irq = <&gpio0 4 GPIO_ACTIVE_HIGH>; /* GPIO0_A4 */
|
status = "okay";
|
};
|
};
|
|
&dfi {
|
status = "okay";
|
};
|
|
&dmc {
|
status = "okay";
|
center-supply = <&vdd_center>;
|
upthreshold = <40>;
|
downdifferential = <20>;
|
system-status-freq = <
|
/*system status freq(KHz)*/
|
SYS_STATUS_NORMAL 800000
|
SYS_STATUS_REBOOT 528000
|
SYS_STATUS_SUSPEND 200000
|
SYS_STATUS_VIDEO_1080P 200000
|
SYS_STATUS_VIDEO_4K 600000
|
SYS_STATUS_VIDEO_4K_10B 800000
|
SYS_STATUS_PERFORMANCE 800000
|
SYS_STATUS_BOOST 600000
|
SYS_STATUS_DUALVIEW 600000
|
SYS_STATUS_ISP 600000
|
>;
|
vop-bw-dmc-freq = <
|
/* min_bw(MB/s) max_bw(MB/s) freq(KHz) */
|
0 762 200000
|
763 1893 400000
|
1894 3012 528000
|
3013 99999 800000
|
>;
|
auto-freq-en = <1>;
|
auto-min-freq = <200000>;
|
};
|
|
&spdif {
|
status = "okay";
|
pinctrl-0 = <&spdif_bus>;
|
i2c-scl-rising-time-ns = <450>;
|
i2c-scl-falling-time-ns = <15>;
|
#sound-dai-cells = <0>;
|
};
|
|
&i2s0 {
|
status = "okay";
|
rockchip,playback-channels = <8>;
|
rockchip,capture-channels = <8>;
|
#sound-dai-cells = <0>;
|
};
|
|
&i2c1 {
|
status = "okay";
|
i2c-scl-rising-time-ns = <300>;
|
i2c-scl-falling-time-ns = <15>;
|
|
rt5651: rt5651@1a {
|
#sound-dai-cells = <0>;
|
compatible = "rockchip,rt5651";
|
reg = <0x1a>;
|
clocks = <&cru SCLK_I2S_8CH_OUT>;
|
clock-names = "mclk";
|
pinctrl-names = "default";
|
pinctrl-0 = <&i2s_8ch_mclk>;
|
spk-con-gpio = <&gpio0 11 GPIO_ACTIVE_HIGH>;
|
hp-det-gpio = <&gpio4 28 GPIO_ACTIVE_LOW>;
|
};
|
};
|
|
&i2c4 {
|
status = "okay";
|
i2c-scl-rising-time-ns = <600>;
|
i2c-scl-falling-time-ns = <20>;
|
|
mpu6500@68 {
|
status = "disabled";
|
compatible = "invensense,mpu6500";
|
reg = <0x68>;
|
irq-gpio = <&gpio1 22 IRQ_TYPE_EDGE_RISING>;
|
mpu-int_config = <0x10>;
|
mpu-level_shifter = <0>;
|
mpu-orientation = <0 1 0 1 0 0 0 0 1>;
|
orientation-x= <1>;
|
orientation-y= <0>;
|
orientation-z= <0>;
|
mpu-debug = <1>;
|
};
|
|
mpu6500_acc: mpu_acc@68 {
|
compatible = "mpu6500_acc";
|
reg = <0x68>;
|
irq-gpio = <&gpio1 22 IRQ_TYPE_EDGE_RISING>;
|
irq_enable = <0>;
|
poll_delay_ms = <30>;
|
type = <SENSOR_TYPE_ACCEL>;
|
layout = <2>;
|
};
|
|
mpu6500_gyro: mpu_gyro@68 {
|
compatible = "mpu6500_gyro";
|
reg = <0x68>;
|
irq_enable = <0>;
|
poll_delay_ms = <30>;
|
type = <SENSOR_TYPE_GYROSCOPE>;
|
layout = <2>;
|
};
|
};
|
|
&pcie0 {
|
ep-gpios = <&gpio2 4 GPIO_ACTIVE_HIGH>;
|
num-lanes = <4>;
|
pinctrl-names = "default";
|
pinctrl-0 = <&pcie_clkreqn_cpm>;
|
};
|
|
&uart0 {
|
pinctrl-names = "default";
|
pinctrl-0 = <&uart0_xfer &uart0_cts>;
|
status = "okay";
|
};
|
|
&saradc {
|
status = "okay";
|
};
|
|
&sdio0 {
|
max-frequency = <100000000>;
|
supports-sdio;
|
bus-width = <4>;
|
disable-wp;
|
cap-sd-highspeed;
|
cap-sdio-irq;
|
keep-power-in-suspend;
|
mmc-pwrseq = <&sdio_pwrseq>;
|
non-removable;
|
num-slots = <1>;
|
pinctrl-names = "default";
|
pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>;
|
sd-uhs-sdr104;
|
status = "okay";
|
};
|
|
&rockchip_suspend {
|
status = "okay";
|
rockchip,sleep-debug-en = <1>;
|
rockchip,sleep-mode-config = <
|
(0
|
| RKPM_SLP_ARMPD
|
| RKPM_SLP_PERILPPD
|
| RKPM_SLP_DDR_RET
|
| RKPM_SLP_PLLPD
|
| RKPM_SLP_CENTER_PD
|
| RKPM_SLP_AP_PWROFF
|
)
|
>;
|
rockchip,wakeup-config = <
|
(0
|
| RKPM_GPIO_WKUP_EN
|
| RKPM_PWM_WKUP_EN
|
)
|
>;
|
rockchip,pwm-regulator-config = <
|
(0
|
| PWM2_REGULATOR_EN
|
)
|
>;
|
rockchip,power-ctrl =
|
<&gpio1 17 GPIO_ACTIVE_HIGH>,
|
<&gpio1 14 GPIO_ACTIVE_HIGH>;
|
};
|
|
&pinctrl {
|
sdio-pwrseq {
|
wifi_enable_h: wifi-enable-h {
|
rockchip,pins =
|
<0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>;
|
};
|
};
|
|
wireless-bluetooth {
|
uart0_gpios: uart0-gpios {
|
rockchip,pins =
|
<2 RK_PC3 RK_FUNC_GPIO &pcfg_pull_none>;
|
};
|
bt_reset_gpio: bt-reset-gpio {
|
rockchip,pins =
|
<0 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>;
|
};
|
bt_wake_gpio: bt-wake-gpio {
|
rockchip,pins =
|
<2 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>;
|
};
|
bt_irq_gpio: bt-irq-gpio {
|
rockchip,pins =
|
<0 RK_PA4 RK_FUNC_GPIO &pcfg_pull_down>;
|
};
|
};
|
};
|