armbian_build/patch/u-boot/v2024.07/board_rk322x-box/rk322x-box-add-device-tree.patch

328 lines
9.0 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Paolo <paolo.sabatino@gmail.com>
Date: Fri, 19 Jun 2020 17:27:27 +0200
Subject: [ARCHEOLOGY] Introducing Rockchip RK322X SoC support (#2032)
> X-Git-Archeology: > recovered message: > * Introducing Rockchip rk322x SoC support
> X-Git-Archeology: > recovered message: > Main features:
> X-Git-Archeology: > recovered message: > - Legacy kernel flavour based upon stable v2.x rk3288 Rockchip branch (https://github.com/rockchip-linux/kernel/tree/stable-4.4-rk3288-linux-v2.x)
> X-Git-Archeology: > recovered message: > - Current kernel flavour based on mainline 5.6.y kernel
> X-Git-Archeology: > recovered message: > - Mainline u-boot (v2020.04)
> X-Git-Archeology: > recovered message: > - Single generic tv box target (rk322x-box) which boots on all the known tv boxes
> X-Git-Archeology: > recovered message: > - Hardware devices (eMMC/NAND, led wiring configuration, SoC variant selection) modulation done by user at runtime via device tree overlays - a script (rk322x-config) is provided for autodetection and simple configuration by inexperienced users;
> X-Git-Archeology: > recovered message: > - Bits added to armbian-hardware-optimization to set affinity for irq handlers
> X-Git-Archeology: > recovered message: > - rk322x-box targets already added to targets.conf for automatic image creation
> X-Git-Archeology: > recovered message: > * Removed disabled patches
> X-Git-Archeology: > recovered message: > * Restored mysteriously removed comment character
> X-Git-Archeology: - Revision 23604e8a0dcdf81ec6c28ccd4b2a64b90816d8e7: https://github.com/armbian/build/commit/23604e8a0dcdf81ec6c28ccd4b2a64b90816d8e7
> X-Git-Archeology: Date: Fri, 19 Jun 2020 17:27:27 +0200
> X-Git-Archeology: From: Paolo <paolo.sabatino@gmail.com>
> X-Git-Archeology: Subject: Introducing Rockchip RK322X SoC support (#2032)
> X-Git-Archeology:
> X-Git-Archeology: - Revision 95425c27b9d3bbb96e7936cc531638c9150538f9: https://github.com/armbian/build/commit/95425c27b9d3bbb96e7936cc531638c9150538f9
> X-Git-Archeology: Date: Fri, 12 Mar 2021 20:20:12 +0000
> X-Git-Archeology: From: Paolo Sabatino <paolo.sabatino@gmail.com>
> X-Git-Archeology: Subject: Changes and fixes to rk322x uboot and kernel config
> X-Git-Archeology:
> X-Git-Archeology: - Revision 97c34489831f2146940f52915428263b7edfcbe1: https://github.com/armbian/build/commit/97c34489831f2146940f52915428263b7edfcbe1
> X-Git-Archeology: Date: Fri, 24 Mar 2023 23:13:42 +0100
> X-Git-Archeology: From: Paolo Sabatino <paolo.sabatino@gmail.com>
> X-Git-Archeology: Subject: rockchip: put all rockchip 32 bit into uboot/v2022.04 directory
> X-Git-Archeology:
> X-Git-Archeology: - Revision fb7484f3f9f50bbbae033c251978e00fa59fd080: https://github.com/armbian/build/commit/fb7484f3f9f50bbbae033c251978e00fa59fd080
> X-Git-Archeology: Date: Wed, 01 May 2024 08:29:03 +0100
> X-Git-Archeology: From: Paolo Sabatino <paolo.sabatino@gmail.com>
> X-Git-Archeology: Subject: rockchip: bump rk322x u-boot to v2024.01
> X-Git-Archeology:
> X-Git-Archeology: - Revision 5657ec0798045ad9cff0df0033ff1c963dfcdd66: https://github.com/armbian/build/commit/5657ec0798045ad9cff0df0033ff1c963dfcdd66
> X-Git-Archeology: Date: Mon, 06 May 2024 15:50:14 +0100
> X-Git-Archeology: From: Paolo Sabatino <paolo.sabatino@gmail.com>
> X-Git-Archeology: Subject: rockchip: add reset props for usb on rk322x
> X-Git-Archeology:
> X-Git-Archeology: - Revision 7876017d0b77bbfefbb3d112045b32d9b50db928: https://github.com/armbian/build/commit/7876017d0b77bbfefbb3d112045b32d9b50db928
> X-Git-Archeology: Date: Tue, 02 Jul 2024 23:31:50 +0000
> X-Git-Archeology: From: Paolo <paolo.sabatino@gmail.com>
> X-Git-Archeology: Subject: Bump rk322x-box and rk3318-box to u-boot v2024.07-rc5 (#6855)
> X-Git-Archeology:
---
arch/arm/dts/rk322x-box.dts | 268 ++++++++++
1 file changed, 268 insertions(+)
diff --git a/arch/arm/dts/rk322x-box.dts b/arch/arm/dts/rk322x-box.dts
new file mode 100755
index 000000000000..111111111111
--- /dev/null
+++ b/arch/arm/dts/rk322x-box.dts
@@ -0,0 +1,268 @@
+// SPDX-License-Identifier: GPL-2.0+ OR X11
+/*
+ * (C) Copyright 2019 Paolo Sabatino
+ *
+ * Generic rk322x tv box device tree include file.
+ *
+ * This dtsi covers most of the common hardware included in generic tv boxes around the market.
+ * Include this dtsi in your configuration and make the necessary adjustments there for base support.
+ *
+ */
+
+/dts-v1/;
+
+#include "rk322x.dtsi"
+
+/ {
+ model = "Generic Rockchip RK322x TV Box board";
+ compatible = "rockchip,rk322x-box";
+
+ chosen {
+ bootph-all;
+ stdout-path = &uart2;
+ u-boot,spl-boot-order = "same-as-spl", &emmc, &sdmmc;
+ };
+
+ memory@60000000 {
+ device_type = "memory";
+ reg = <0x60000000 0x40000000>;
+ };
+
+ leds: leds {
+ compatible = "gpio-leds";
+
+ /*
+ * Main led is available on all boards.
+ * Default state is honoured only if led_default_state() is called inside
+ * an early init hook function.
+ */
+ main {
+ label = "working";
+ gpios = <&gpio3 RK_PC5 GPIO_ACTIVE_LOW>;
+ default-state = "on";
+ };
+
+ };
+
+ vcc_sys: vcc-sys-regulator {
+ compatible = "regulator-fixed";
+ regulator-name = "vcc_sys";
+ regulator-always-on;
+ regulator-boot-on;
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ };
+
+ vcc_phy: vcc-phy-regulator {
+ compatible = "regulator-fixed";
+ enable-active-high;
+ regulator-name = "vcc_phy";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-always-on;
+ regulator-boot-on;
+ };
+
+ vcc_otg_vbus: otg-vbus-regulator {
+ compatible = "regulator-fixed";
+ gpio = <&gpio3 RK_PC6 GPIO_ACTIVE_HIGH>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&otg_vbus_drv>;
+ regulator-name = "vcc_otg_vbus";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-boot-on;
+ // regulator-always-on;
+ enable-active-high;
+ vin-supply = <&vcc_sys>;
+ };
+
+ vcc_host_vbus: vcc-host-regulator {
+ compatible = "regulator-fixed";
+ gpio = <&gpio3 RK_PC4 GPIO_ACTIVE_HIGH>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&host_vbus_drv>;
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-name = "vcc_host";
+ // regulator-always-on;
+ regulator-boot-on;
+ enable-active-high;
+ vin-supply = <&vcc_sys>;
+ };
+
+};
+
+&gmac {
+
+ assigned-clocks = <&cru SCLK_MAC_SRC>;
+ assigned-clock-rates = <50000000>;
+
+ clock_in_out = "output";
+ phy-supply = <&vcc_phy>;
+ phy-mode = "rmii";
+ phy-is-integrated;
+
+ tx_delay = < 0x26 >; // Default is 0x30, but original dts proposes 0x26
+ rx_delay = < 0x11 >; // Default is 0x10, but original dts proposes 0x11
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&phy_pins>;
+
+ status = "okay";
+
+};
+
+&emmc {
+
+ bootph-pre-ram;
+ clock-frequency = <50000000>;
+ clock-freq-min-max = <400000 50000000>;
+ broken-cd;
+ cap-mmc-highspeed;
+ mmc-hs200-1_8v;
+ supports-emmc;
+ disable-wp;
+ non-removable;
+ /delete-property/ pinctrl-names;
+ /delete-property/ pinctrl-0;
+ status = "okay";
+
+};
+
+&sdmmc {
+
+ bootph-pre-ram;
+ bus-width = <4>;
+ cap-mmc-highspeed;
+ cap-sd-highspeed;
+ card-detect-delay = <200>;
+ cd-gpios = <&gpio1 RK_PC1 GPIO_ACTIVE_LOW>;
+ disable-wp;
+ num-slots = <1>;
+ supports-sd;
+
+ status = "okay";
+
+};
+
+&uart2 {
+ pinctrl-0 = <&uart21_xfer>;
+ pinctrl-names = "default";
+ bootph-all;
+ status = "okay";
+};
+
+&u2phy0 {
+ status = "okay";
+};
+
+&u2phy0_otg {
+ status = "okay";
+};
+
+&u2phy0_host {
+ status = "okay";
+};
+
+&u2phy1 {
+ status = "okay";
+};
+
+&u2phy1_otg {
+ status = "okay";
+};
+
+&u2phy1_host {
+ status = "okay";
+};
+
+&usb_host0_ehci {
+ vbus-supply = <&vcc_host_vbus>;
+ status = "okay";
+};
+
+&usb_host0_ohci {
+ vbus-supply = <&vcc_host_vbus>;
+ status = "okay";
+};
+
+&usb_host1_ehci {
+ vbus-supply = <&vcc_host_vbus>;
+ status = "okay";
+};
+
+&usb_host1_ohci {
+ vbus-supply = <&vcc_host_vbus>;
+ status = "okay";
+};
+
+&usb_host2_ehci {
+ vbus-supply = <&vcc_host_vbus>;
+ status = "okay";
+};
+
+&usb_host2_ohci {
+ vbus-supply = <&vcc_host_vbus>;
+ status = "okay";
+};
+
+&usb_otg {
+ dr_mode = "host";
+ hnp-srp-disable;
+ vbus-supply = <&vcc_otg_vbus>;
+ status = "okay";
+};
+
+&pinctrl {
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&gpio_leds>;
+
+ gpio {
+ gpio_leds: gpio-leds {
+ rockchip,pins = <3 21 RK_FUNC_GPIO &pcfg_pull_down>;
+ };
+ };
+
+ usb {
+ host_vbus_drv: host-vbus-drv {
+ rockchip,pins = <3 RK_PC4 RK_FUNC_GPIO &pcfg_pull_down>;
+ };
+
+ otg_vbus_drv: otg-vbus-drv {
+ rockchip,pins = <3 RK_PC6 RK_FUNC_GPIO &pcfg_pull_down>;
+ };
+ };
+
+ uart2 {
+ uart21_xfer: uart21-xfer {
+ rockchip,pins = <1 RK_PB2 2 &pcfg_pull_up>,
+ <1 RK_PB1 2 &pcfg_pull_none>;
+ };
+ };
+
+};
+
+&hdmi {
+ /*
+ * u-boot clk driver is not yet capable to handle parents correctly;
+ * these properties will prevent the video output features if present
+ */
+ /delete-property/assigned-clocks;
+ /delete-property/assigned-clock-parents;
+ status = "okay";
+};
+
+&hdmi_phy {
+ status = "okay";
+};
+
+&vop {
+ bootph-all;
+ status = "okay";
+};
+
+&vop_mmu {
+ status = "okay";
+};
--
Armbian