build/patch/kernel/rk322x-current/board-rk322x-box.patch
Paolo 23604e8a0d
Introducing Rockchip RK322X SoC support (#2032)
* Introducing Rockchip rk322x SoC support

Main features:

- 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)
- Current kernel flavour based on mainline 5.6.y kernel
- Mainline u-boot (v2020.04)
- Single generic tv box target (rk322x-box) which boots on all the known tv boxes
- 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;
- Bits added to armbian-hardware-optimization to set affinity for irq handlers
- rk322x-box targets already added to targets.conf for automatic image creation

* Removed disabled patches
* Restored mysteriously removed comment character
2020-06-19 17:27:27 +02:00

219 lines
4.5 KiB
Diff

diff --git a/arch/arm/boot/dts/rk322x-box.dts b/arch/arm/boot/dts/rk322x-box.dts
new file mode 100644
index 000000000..6f2833a50
--- /dev/null
+++ b/arch/arm/boot/dts/rk322x-box.dts
@@ -0,0 +1,213 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+
+/dts-v1/;
+
+#include "rk3228a-box.dtsi"
+
+/ {
+
+ model = "Generic RK322x Tv Box board";
+
+ /delete-node/ leds;
+
+ gpio_leds: gpio-leds {
+
+ compatible = "gpio-leds";
+
+ /*
+ * Working led, available on all boards
+ */
+ working {
+ gpios = <&gpio3 RK_PC5 GPIO_ACTIVE_HIGH>;
+ label = "working";
+ default-state = "on";
+ linux,default-trigger = "timer";
+ pinctrl-names = "default";
+ pinctrl-0 = <&gpio_led_working>;
+ };
+
+ };
+
+};
+
+&emmc {
+ status = "okay";
+ /delete-property/ mmc-ddr-1_8v;
+ /delete-property/ pinctrl-names;
+ /delete-property/ pinctrl-0;
+ rockchip,default-sample-phase = <180>;
+};
+
+&nfc {
+ status = "okay";
+};
+
+&gmac {
+ tx_delay = <0x26>;
+ rx_delay = <0x11>;
+};
+
+&ir_receiver {
+ status = "okay";
+};
+
+&power_key {
+ status = "okay";
+};
+
+&usb_otg {
+ dr_mode = "host";
+};
+
+&sdio {
+ mmc-pwrseq = <&sdio_pwrseq>;
+ status = "okay";
+};
+
+&sdmmc {
+ status = "okay";
+};
+
+/** Integration to pin controller */
+&pinctrl {
+
+ pcfg_pull_up_12ma: pcfg-pull-up-12ma {
+ drive-strength = <12>;
+ bias-pull-up;
+ };
+
+ pcfg_pull_down_12ma: pcfg-pull-down-12ma {
+ drive-strength = <12>;
+ bias-pull-down;
+ };
+
+ pcfg_pull_none_12ma: pcfg-pull-none-12ma {
+ drive-strength = <12>;
+ bias-disable;
+ };
+
+ pcfg_pull_up_2ma: pcfg-pull-up-2ma {
+ drive-strength = <2>;
+ bias-pull-up;
+ };
+
+ pcfg_pull_down_2ma: pcfg-pull-down-2ma {
+ drive-strength = <2>;
+ bias-pull-down;
+ };
+
+ pcfg_pull_none_2ma: pcfg-pull-none-2ma {
+ drive-strength = <2>;
+ bias-disable;
+ };
+
+ /*
+ * Some rk322x electrical schemes report this kind of pull-up/down
+ * pin configurations. We set them here, but we don't use it in this
+ * device tree. These instead are useful for overlays, because they seem
+ * to increase stability on at least one board I got here
+ */
+ sdmmc {
+ sdmmc_clk: sdmmc-clk {
+ rockchip,pins = <1 16 RK_FUNC_1 &pcfg_pull_down>;
+ };
+
+ sdmmc_cmd: sdmmc-cmd {
+ rockchip,pins = <1 15 RK_FUNC_1 &pcfg_pull_up>;
+ };
+
+ sdmmc_bus4: sdmmc-bus4 {
+ rockchip,pins = <1 18 RK_FUNC_1 &pcfg_pull_up>,
+ <1 19 RK_FUNC_1 &pcfg_pull_up>,
+ <1 20 RK_FUNC_1 &pcfg_pull_up>,
+ <1 21 RK_FUNC_1 &pcfg_pull_up>;
+ };
+ };
+
+ /*
+ * Same as above, decreasing strength of SDIO pins seems to be benefical
+ * to stability
+ */
+ sdio {
+ sdio_clk: sdio-clk {
+ rockchip,pins = <3 0 RK_FUNC_1 &pcfg_pull_down_2ma>;
+ };
+
+ sdio_cmd: sdio-cmd {
+ rockchip,pins = <3 1 RK_FUNC_1 &pcfg_pull_up_2ma>;
+ };
+
+ sdio_bus4: sdio-bus4 {
+ rockchip,pins = <3 2 RK_FUNC_1 &pcfg_pull_up_2ma>,
+ <3 3 RK_FUNC_1 &pcfg_pull_up_2ma>,
+ <3 4 RK_FUNC_1 &pcfg_pull_up_2ma>,
+ <3 5 RK_FUNC_1 &pcfg_pull_up_2ma>;
+ };
+ };
+
+ /*
+ * Same drill as above, electrical schemes also report this pull-up/down
+ * configurations.
+ */
+ emmc {
+ emmc_clk: emmc-clk {
+ rockchip,pins = <2 7 RK_FUNC_2 &pcfg_pull_up>;
+ };
+
+ emmc_cmd: emmc-cmd {
+ rockchip,pins = <1 22 RK_FUNC_2 &pcfg_pull_up>;
+ };
+
+ emmc_bus8: emmc-bus8 {
+ rockchip,pins = <1 24 RK_FUNC_2 &pcfg_pull_up>,
+ <1 25 RK_FUNC_2 &pcfg_pull_up>,
+ <1 26 RK_FUNC_2 &pcfg_pull_up>,
+ <1 27 RK_FUNC_2 &pcfg_pull_up>,
+ <1 28 RK_FUNC_2 &pcfg_pull_up>,
+ <1 29 RK_FUNC_2 &pcfg_pull_up>,
+ <1 30 RK_FUNC_2 &pcfg_pull_up>,
+ <1 31 RK_FUNC_2 &pcfg_pull_up>;
+ };
+
+ emmc_pwr: emmc-pwr {
+ rockchip,pins = <2 RK_PA5 RK_FUNC_2 &pcfg_pull_down>;
+ };
+
+ emmc_rst: emmc-rst {
+ rockchip,pins = <1 RK_PC7 RK_FUNC_2 &pcfg_pull_up>;
+ };
+
+ };
+
+
+ gpio {
+ gpio_led_working: gpio-led-working {
+ rockchip,pins = <3 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>;
+ };
+ };
+
+ ir {
+ ir_int: ir-int {
+ rockchip,pins = <1 RK_PB3 RK_FUNC_GPIO &pcfg_pull_none>;
+ };
+ };
+
+ keys {
+ pwr_key: pwr-key {
+ rockchip,pins = <3 RK_PC7 RK_FUNC_GPIO &pcfg_pull_up>;
+ };
+ };
+
+ sdio-pwrseq {
+ wifi_enable_h: wifi-enable-h {
+ rockchip,pins = <2 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>;
+ };
+ };
+
+ gpio {
+ gpio_led_working: gpio-led-working {
+ rockchip,pins = <3 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>;
+ };
+ };
+
+};