1
0
mirror of https://github.com/paolosabatino/multitool.git synced 2024-11-25 12:16:14 +00:00
multitool/sources/rk3288/rk3288-box-5.6.dts
Paolo Sabatino b337dec818 Added full support for rk3288 boxes that use a legacy non-open boot
Modified multitool.sh to better support compressed archives
2020-06-06 16:15:53 +02:00

590 lines
12 KiB
Plaintext

/*
* Copyright (c) 2014, 2015 FUKAUMI Naoki <naobsd@gmail.com>
* 2018 Paolo Sabatino <paolo.sabatino@gm**l.com>
*
* 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 "rk3288.dtsi"
#include <dt-bindings/input/input.h>
/ {
model = "Generic RK3288 board";
compatible = "rockchip,rk3288";
memory@0 {
reg = <0x0 0x0 0x0 0x40000000>;
device_type = "memory";
};
ext_gmac: external-gmac-clock {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <125000000>;
clock-output-names = "ext_gmac";
};
keys: gpio-keys {
compatible = "gpio-keys";
#address-cells = <1>;
#size-cells = <0>;
pinctrl-names = "default";
pinctrl-0 = <&pwr_key>;
button@0 {
gpio-key,wakeup = <1>;
gpios = <&gpio0 5 GPIO_ACTIVE_HIGH>;
label = "GPIO Power";
linux,code = <KEY_POWER>;
wakeup-source;
debounce-interval = <100>;
};
};
leds {
compatible = "gpio-leds";
power {
/*
Power led is active high, but we set it here active low
so while there is mass storage access it turns red and
when it is idle is blue
*/
gpios = <&gpio7 2 GPIO_ACTIVE_LOW>;
label = "led:state1";
linux,default-trigger = "timer";
pinctrl-names = "default";
pinctrl-0 = <&power_led>;
};
};
vcc_sys: vsys-regulator {
compatible = "regulator-fixed";
regulator-name = "vcc_sys";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
regulator-always-on;
regulator-boot-on;
};
vcc_host_5v: usb-host-regulator {
compatible = "regulator-fixed";
gpio = <&gpio0 14 GPIO_ACTIVE_HIGH>;
regulator-name = "vcc_host_5v";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
regulator-boot-on;
enable-active-high;
vin-supply = <&vcc_sys>;
};
vcc_otg_5v: usb-otg-regulator {
compatible = "regulator-fixed";
gpio = <&gpio0 12 GPIO_ACTIVE_HIGH>;
regulator-name = "vcc_otg_5v";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
regulator-boot-on;
enable-active-high;
vin-supply = <&vcc_sys>;
};
};
&io_domains {
status = "okay";
};
&cpu0 {
cpu0-supply = <&vdd_cpu>;
};
&gmac {
assigned-clocks = <&cru SCLK_MAC>;
assigned-clock-parents = <&ext_gmac>;
clock_in_out = "input";
pinctrl-names = "default";
pinctrl-0 = <&rgmii_pins>, <&phy_rst>, <&phy_pmeb>, <&phy_int>;
phy-mode = "rgmii";
snps,reset-active-low;
snps,reset-delays-us = <0 10000 1000000>;
snps,reset-gpio = <&gpio4 8 GPIO_ACTIVE_LOW>;
tx_delay = <0x30>;
rx_delay = <0x10>;
status = "okay";
};
&hdmi {
ddc-i2c-bus = <&i2c5>;
status = "okay";
};
&gpu {
mali-supply = <&vdd_gpu>;
status = "okay";
};
&i2c0 {
clock-frequency = <400000>;
status = "okay";
vdd_cpu: syr827@40 {
compatible = "silergy,syr827";
fcs,suspend-voltage-selector = <1>;
reg = <0x40>;
regulator-name = "vdd_cpu";
regulator-min-microvolt = <850000>;
regulator-max-microvolt = <1350000>;
regulator-ramp-delay = <8000>;
regulator-always-on;
regulator-boot-on;
vin-supply = <&vcc_sys>;
regulator-state-mem {
regulator-off-in-suspend;
};
};
vdd_gpu: syr828@41 {
compatible = "silergy,syr828";
fcs,suspend-voltage-selector = <1>;
reg = <0x41>;
regulator-name = "vdd_gpu";
regulator-min-microvolt = <850000>;
regulator-max-microvolt = <1350000>;
regulator-ramp-delay = <8000>;
regulator-always-on;
vin-supply = <&vcc_sys>;
regulator-state-mem {
regulator-off-in-suspend;
};
};
};
&i2c1 {
status = "okay";
};
&i2c2 {
status = "okay";
};
&i2c4 {
status = "okay";
};
&i2c5 {
status = "okay";
};
&pinctrl {
/*
These two lines here, these must be commented out! Otherwise for some reason the kernel
does not see the boot device anymore and will stay stuck in initramfs!
On the contrary, these are required by u-boot to keep the power holding so the device does not
automatically turns off after a small timeout
*/
/*pinctrl-names = "default";*/
/*pinctrl-0 = <&pwr_hold>;*/
pcfg_output_high: pcfg-output-high {
output-high;
};
pcfg_output_low: pcfg-output-low {
output-low;
};
pcfg_wl: pcfg-wl {
bias-pull-up;
drive-strength = <8>;
};
pcfg_pull_up_drv_8ma: pcfg-pull-up-drv-8ma {
bias-pull-up;
drive-strength = <8>;
};
pcfg_pull_none_8ma: pcfg-pull-none-8ma {
bias-disable;
drive-strength = <8>;
};
pcfg_wl_clk: pcfg-wl-clk {
bias-disable;
drive-strength = <12>;
};
pcfg_wl_int: pcfg-wl-int {
bias-pull-up;
};
gmac {
phy_int: phy-int {
rockchip,pins = <0 9 RK_FUNC_GPIO &pcfg_pull_up>;
};
phy_pmeb: phy-pmeb {
rockchip,pins = <0 8 RK_FUNC_GPIO &pcfg_pull_up>;
};
phy_rst: phy-rst {
rockchip,pins = <4 8 RK_FUNC_GPIO &pcfg_output_high>;
};
};
hym8563 {
rtc_int: rtc-int {
rockchip,pins = <0 4 RK_FUNC_GPIO &pcfg_pull_up>;
};
};
keys {
pwr_key: pwr-key {
rockchip,pins = <0 5 RK_FUNC_GPIO &pcfg_pull_none>;
};
};
leds {
power_led: power-led {
rockchip,pins = <7 2 RK_FUNC_GPIO &pcfg_pull_none>;
};
};
ir {
ir_int: ir-int {
rockchip,pins = <7 0 RK_FUNC_GPIO &pcfg_pull_up>;
};
};
sdmmc {
/*
* Copied from firefly board definition to give more drive to
* the sdmmc pins. The Q8 seems to be quite able to drive
* ultra high speed uSD cards, so we give a bit more energy
* to the gpio pins
*/
sdmmc_bus4: sdmmc-bus4 {
rockchip,pins = <6 16 RK_FUNC_1 &pcfg_pull_up_drv_8ma>,
<6 17 RK_FUNC_1 &pcfg_pull_up_drv_8ma>,
<6 18 RK_FUNC_1 &pcfg_pull_up_drv_8ma>,
<6 19 RK_FUNC_1 &pcfg_pull_up_drv_8ma>;
};
sdmmc_clk: sdmmc-clk {
rockchip,pins = <6 20 RK_FUNC_1 &pcfg_pull_none_8ma>;
};
sdmmc_cmd: sdmmc-cmd {
rockchip,pins = <6 21 RK_FUNC_1 &pcfg_pull_up_drv_8ma>;
};
sdmmc_pwr: sdmmc-pwr {
rockchip,pins = <7 11 RK_FUNC_GPIO &pcfg_pull_none>;
};
};
usb_host1 {
host_vbus_drv: host-vbus-drv {
rockchip,pins = <0 14 RK_FUNC_GPIO &pcfg_pull_none>;
};
};
usb_otg {
otg_vbus_drv: otg-vbus-drv {
rockchip,pins = <0 12 RK_FUNC_GPIO &pcfg_pull_none>;
};
};
wireless-bluetooth {
uart0_gpios: uart0-gpios {
rockchip,pins = <4 19 RK_FUNC_GPIO &pcfg_pull_none>;
};
};
emmc {
emmc_reset: emmc-reset {
rockchip,pins = <3 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>;
};
};
};
&emmc {
/*
* eMMC is a 52Mhz DDR device on q8 devices, so set it here.
* Setting default-sample-rate to 180 degrees is very important,
* otherwise the eMMC is not stable and may not be able to negotiate
* the right clock.
* Despite the code already seems to use 180 degree phase when
* MMC + 8bit bus is set, we need to set default phase here too.
*
* Huge hint came from this patch:
* https://patchwork.kernel.org/patch/11129183/
*
*/
broken-cd;
bus-width = <8>;
cap-mmc-highspeed;
disable-wp;
non-removable;
pinctrl-names = "default";
pinctrl-0 = <&emmc_clk>, <&emmc_cmd>, <&emmc_bus8>;
status = "okay";
};
&sdmmc {
supports-sd;
bus-width = <4>;
cap-mmc-highspeed;
cap-sd-highspeed;
cd-gpios = <&gpio6 RK_PC6 GPIO_ACTIVE_LOW>;
cd-debounce-delay-ms = <500>;
disable-wp;
pinctrl-names = "default";
pinctrl-0 = <&sdmmc_clk>, <&sdmmc_cmd>, <&sdmmc_cd>, <&sdmmc_bus4>;
status = "okay";
};
&tsadc {
rockchip,hw-tshut-mode = <0>;
rockchip,hw-tshut-polarity = <0>;
status = "okay";
};
/*
* These dmas described here for uarts are present in original q8 board
* dts, so I replicate them here because documentation says that serial
* ports can have dmas.
* note:
* - uart0 is the serial port connected to the bluetooth module
* - uart2 is the onboard serial port
*
* As ok kernel 4.19 DMA for serial ports is disabled because it makes
* the ports unusable
*
*/
&uart0 {
pinctrl-names = "default";
pinctrl-0 = <&uart0_xfer>, <&uart0_cts>, <&uart0_rts>;
//dmas = <&dmac_peri 1 &dmac_peri 2>;
//dma-names = "tx", "rx";
status = "okay";
};
&uart1 {
//dmas = <&dmac_peri 3 &dmac_peri 4>;
//dma-names = "tx", "rx";
status = "okay";
};
&uart2 {
//dmas = <&dmac_bus_s 4 &dmac_bus_s 5>;
//dma-names = "tx", "rx";
status = "okay";
};
&uart3 {
//dmas = <&dmac_peri 7 &dmac_peri 8>;
//dma-names = "tx", "rx";
status = "okay";
};
&uart4 {
//dmas = <&dmac_peri 9 &dmac_peri 10>;
//dma-names = "tx", "rx";
status = "disabled";
};
/*
* Here usbphy* should have their proper reset lines described in rk3288.dtsi
* Describing resets for usb phy is important because otherwise the USB
* port gets stuck in case it goes into autosuspend: plugging any device
* when the port is autosuspended will actually kill the port itself and
* require a power cycle.
* This is required for the usbphy1 phy, nonetheless it is a good idea to
* specify the proper resources for all the phys though.
* The reference patch which works in conjuction with the reset lines:
* https://patchwork.kernel.org/patch/9469811/
*
*/
&usbphy {
status = "okay";
};
&usb_host0_ehci {
dr_mode = "host";
reg = <0x0 0xff500000 0x0 0x20000>;
status = "disable";
};
&usb_host1 {
vbus-supply = <&vcc_host_5v>;
status = "okay";
};
&usb_otg {
vbus-supply = <&vcc_otg_5v>;
status = "okay";
};
/*
* Enable VPU services and complete the relative IOMMU configurations
*/
&vopb {
status = "okay";
};
&vopb_mmu {
status = "okay";
};
&vopl {
status = "okay";
};
&vopl_mmu {
status = "okay";
};
&vpu_mmu {
status = "okay";
};
&hevc_mmu {
status = "okay";
};
&wdt {
status = "okay";
};
// i2s bus is present on q8 device, enable it
&i2s {
#sound-dai-cells = <0>;
status = "okay";
};
// spdif is present on q8 device, enable it
&spdif {
status = "okay";
};
/*
* Redefine some thermals to give a bit more headroom (+5°C)
*/
&cpu_alert0 {
temperature = <75000>;
};
&cpu_alert1 {
temperature = <80000>;
};
&gpu_alert0 {
temperature = <75000>;
};
/*
* Retouch the operating points for higher frequencies to reduce
* the voltage required
*/
&cpu_opp_table {
opp-1512000000 {
opp-microvolt = <1250000>;
};
opp-1608000000 {
opp-microvolt = <1300000>;
};
/*
Remove the overclocking/turbo frequencies
*/
/delete-node/ opp@1704000000;
/delete-node/ opp@1800000000;
/delete-node/ opp@1896000000;
/delete-node/ opp@1920000000;
/delete-node/ opp@1992000000;
/delete-node/ opp@2016000000;
/delete-node/ opp@2040000000;
/delete-node/ opp@2064000000;
/delete-node/ opp@2088000000;
/delete-node/ opp@2112000000;
/delete-node/ opp@2136000000;
/delete-node/ opp@2160000000;
/delete-node/ opp@2184000000;
/delete-node/ opp@2208000000;
};
&gpu_opp_table {
opp-500000000 {
opp-hz = /bits/ 64 <500000000>;
opp-microvolt = <1150000>;
};
opp-600000000 {
status = "disabled";
};
};