Skip to content

Commit

Permalink
overlays-10-add-rk3318-box-led-conf3(:1)
Browse files Browse the repository at this point in the history
Original-Subject: rk3318-box: add led-conf3 to support MXQ-RK3328-D4 boards with RK805 PMIC
None
X-Armbian: Patch-File: overlays-10-add-rk3318-box-led-conf3
X-Armbian: Patch-File-Counter: 1
X-Armbian: Patch-Rel-Directory: patch/kernel/archive/rockchip64-6.1
X-Armbian: Patch-Type: kernel
X-Armbian: Patch-Root-Type: core
X-Armbian: Patch-Sub-Type: common
X-Armbian: Original-Subject: rk3318-box: add led-conf3 to support MXQ-RK3328-D4 boards with RK805 PMIC
  • Loading branch information
paolosabatino authored and Armbian AutoPatcher committed Oct 18, 2021
1 parent bd05139 commit 98e920c
Show file tree
Hide file tree
Showing 3 changed files with 308 additions and 0 deletions.
1 change: 1 addition & 0 deletions arch/arm64/boot/dts/rockchip/overlay/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ dtbo-$(CONFIG_ARCH_ROCKCHIP) += \
rockchip-w1-gpio.dtbo \
rockchip-rk3318-box-led-conf1.dtbo \
rockchip-rk3318-box-led-conf2.dtbo \
rockchip-rk3318-box-led-conf3.dtbo \
rockchip-rk3318-box-emmc-ddr.dtbo \
rockchip-rk3318-box-wlan-ap6334.dtbo \
rockchip-rk3318-box-wlan-ext.dtbo \
Expand Down
7 changes: 7 additions & 0 deletions arch/arm64/boot/dts/rockchip/overlay/README.rockchip-overlays
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,13 @@ YX_RK3328 and clones
Activates led/gpio configuration for rk3318 tv box boards withs signature
X88_PRO_B and clones

### rk3318-box-led-conf3

This device tree overlay is suitable for MXQ-RK3328-D4_A board which
has an integrated PMIC (RK805). The dtbo is very important to achieve
1.3 Ghz speed for CPU and stable voltages for other parts of the
system. Also enables gpio leds and keys.

### rk3318-box-emmc-ddr

Activates eMMC DDR capability for rk3318 tv box boards. Probably all the eMMC chips
Expand Down
300 changes: 300 additions & 0 deletions arch/arm64/boot/dts/rockchip/overlay/rockchip-rk3318-box-led-conf3.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,300 @@
/dts-v1/;
/plugin/;

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/pinctrl/rockchip.h>
#include <dt-bindings/interrupt-controller/irq.h>

&{/regulators/regulator@0} {
status = "disabled";
};

&{/regulators/regulator@1} {
status = "disabled";
};

&{/vdd-arm} {
status = "disabled";
};

&{/vdd-log} {
status = "disabled";
};

&{/xin32k} {
status = "disabled";
};

&i2c1 {
#address-cells = <1>;
#size-cells = <0>;

clock-frequency = <1000000>;
i2c-scl-rising-time-ns = <83>;
i2c-scl-falling-time-ns = <5>;
status = "okay";

rk805: rk805@18 {
compatible = "rockchip,rk805";
reg = <0x18>;
status = "okay";

gpio-controller;
#gpio-cells = <2>;

interrupt-parent = <&gpio2>;
interrupts = <RK_PA6 IRQ_TYPE_LEVEL_LOW>;

pinctrl-names = "default";
pinctrl-0 = <&pmic_int_l>;

rockchip,system-power-controller;
wakeup-source;

#clock-cells = <1>;
clock-output-names = "xin32k", "rk805-clkout2";

vcc1-supply = <&vcc_sys>;
vcc2-supply = <&vcc_sys>;
vcc3-supply = <&vcc_sys>;
vcc4-supply = <&vcc_sys>;
vcc5-supply = <&rk805_vcc_io>;
vcc6-supply = <&rk805_vcc_io>;

rtc {
status = "okay";
};

pwrkey {
status = "okay";
};

gpio {
status = "okay";
};

regulators {
compatible = "rk805-regulator";
status = "okay";
#address-cells = <1>;
#size-cells = <0>;

vdd_logic: DCDC_REG1 {
regulator-name = "vdd_logic";
regulator-min-microvolt = <700000>;
regulator-max-microvolt = <1350000>;
regulator-ramp-delay = <12500>;
regulator-boot-on;
regulator-always-on;
regulator-state-mem {
regulator-on-in-suspend;
regulator-suspend-microvolt = <1000000>;
};
};

vdd_arm: DCDC_REG2 {
regulator-name = "vdd_arm";
regulator-min-microvolt = <700000>;
regulator-max-microvolt = <1350000>;
regulator-ramp-delay = <12500>;
regulator-boot-on;
regulator-always-on;
regulator-state-mem {
regulator-on-in-suspend;
regulator-suspend-microvolt = <950000>;
};
};

vcc_ddr: DCDC_REG3 {
regulator-name = "vcc_ddr";
regulator-boot-on;
regulator-always-on;
regulator-state-mem {
regulator-on-in-suspend;
};
};

vcc_io: rk805_vcc_io: DCDC_REG4 {
regulator-name = "vccio_3v3";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-boot-on;
regulator-always-on;
regulator-state-mem {
regulator-on-in-suspend;
regulator-suspend-microvolt = <3300000>;
};
};

vdd_18: vcc_18: LDO_REG1 {
regulator-name = "vccio_1v8";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
regulator-boot-on;
regulator-always-on;
regulator-state-mem {
regulator-on-in-suspend;
regulator-suspend-microvolt = <1800000>;
};
};

vcc_18emmc: LDO_REG2 {
regulator-name = "vcc_18emmc";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
regulator-boot-on;
regulator-always-on;
regulator-state-mem {
regulator-on-in-suspend;
regulator-suspend-microvolt = <1800000>;
};
};

vdd_11: LDO_REG3 {
regulator-name = "vdd_11";
regulator-min-microvolt = <1100000>;
regulator-max-microvolt = <1100000>;
regulator-boot-on;
regulator-always-on;
regulator-state-mem {
regulator-on-in-suspend;
regulator-suspend-microvolt = <1100000>;
};
};
};
};

};

&pinctrl {

leds {
ir_led: ir-led {
rockchip,pins = <2 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>;
};
};

};

&gpio_led {

pinctrl-names = "default";
pinctrl-0 = <&ir_led>;

working {
gpios = <&rk805 0 GPIO_ACTIVE_LOW>;
linux,default-trigger = "mmc2";
default-state = "off";
mode = <35>;
};

/*
* These leds are described in the original dtb, but are not present on the board
auxiliary {
gpios = <&rk805 1 GPIO_ACTIVE_LOW>;
linux,default-trigger = "mmc2";
default-state = "off";
mode = <5>;
};

ir {
gpios = <&gpio2 RK_PC2 GPIO_ACTIVE_LOW>;
linux,default-trigger = "ir";
default-state = "off";
mode = <0>;
};
*/

};

&io_domains {
vccio1-supply = <&vcc_io>;
vccio2-supply = <&vcc_18emmc>;
vccio3-supply = <&vcc_io>;
vccio4-supply = <&vdd_18>;
vccio5-supply = <&vcc_io>;
vccio6-supply = <&vcc_io>;
pmuio-supply = <&vcc_io>;
};

&{/} {
gpio_keys: gpio-keys {
compatible = "gpio-keys";

power {
label = "Power button";
linux,code = <KEY_POWER>;
gpios = <&gpio2 RK_PC5 GPIO_ACTIVE_HIGH>;
};
};
};

&dmc {
center-supply = <&vdd_logic>;
};

&gpu {
mali-supply = <&vdd_logic>;
};

&vpu {
vcodec-supply = <&vdd_logic>;
};

&cpu0 {
cpu-supply = <&vdd_arm>;
};

&cpu1 {
cpu-supply = <&vdd_arm>;
};

&cpu2 {
cpu-supply = <&vdd_arm>;
};

&cpu3 {
cpu-supply = <&vdd_arm>;
};


&vcc_sd {
vin-supply = <&vcc_io>;
};

&emmc {
vmmc-supply = <&vcc_io>;
vqmmc-supply = <&vcc_18emmc>;
};

&saradc {
vref-supply = <&vcc_18>;
};

&pwm0 {
status = "disabled";
};

&pwm1 {
status = "disabled";
};

/*
* Following section enables the sdio bus on sdmmc_ext controller
*/
&sdio {
/delete-property/ mmc-pwrseq;
status = "disabled";
};

&sdio_ext {
rockchip,default-sample-phase = <112>; // Allows ssv6051 chips to be detected at 50 MHz
sd-uhs-sdr50;
mmc-pwrseq = <&sdio_pwrseq>;
status = "okay";
};

&sdmmc_ext {
status = "disabled";
};

0 comments on commit 98e920c

Please sign in to comment.