sunxi: t113: add MYiR MYD-YT113X support
authorZoltan HERPAI <wigyori@uid0.hu>
Thu, 8 Jun 2023 13:25:27 +0000 (15:25 +0200)
committerZoltan HERPAI <wigyori@uid0.hu>
Thu, 8 Jun 2023 13:25:27 +0000 (15:25 +0200)
Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
package/boot/uboot-sunxi/Makefile
target/linux/sunxi/image/cortexa7.mk
target/linux/sunxi/patches-6.1/0010-add-myir.patch [new file with mode: 0644]

index 9602b1a8a604f6d6d89f95dcaab7cc20ddb7d464..3c53612eed2c9658e3ea4bc59d96e281e00c6786 100644 (file)
@@ -22,7 +22,7 @@ define U-Boot/Default
   BUILD_TARGET:=sunxi
   UBOOT_IMAGE:=u-boot-sunxi-with-spl.bin
   UENV:=default
-  HIDDEN:=1
+#  HIDDEN:=1
 endef
 
 define U-Boot/a64-olinuxino
@@ -343,7 +343,7 @@ endef
 define U-Boot/myir_myd_t113x
   BUILD_SUBTARGET:=cortexa7
   NAME:=MYIR MYD-T113X
-  BUILD_DEVICES:=myir_myd-t113x
+  BUILD_DEVICES:=myir_myd-yt113x
   UENV:=t113.ttyS5
 endef
 
index 3d31b95ed613892634b58e7decc62473b3225fea..a132a17497af7762bf14cb5721698d4fca372647 100644 (file)
@@ -239,3 +239,11 @@ define Device/widora_mangopi-mqdual-t113
   SOC := sun8i-t113s
 endef
 TARGET_DEVICES += widora_mangopi-mqdual-t113
+
+define Device/myir_myd-yt113x
+  DEVICE_VENDOR := MYIR
+  DEVICE_MODEL := MYD-YT113X
+  DEVICE_PACKAGES:=kmod-rtc-sunxi
+  SOC := sun8i-t113s
+endef
+TARGET_DEVICES += myir_myd-yt113x
diff --git a/target/linux/sunxi/patches-6.1/0010-add-myir.patch b/target/linux/sunxi/patches-6.1/0010-add-myir.patch
new file mode 100644 (file)
index 0000000..4a41973
--- /dev/null
@@ -0,0 +1,149 @@
+diff -ruN linux-6.1.32/arch/arm/boot/dts.old/Makefile linux-6.1.32/arch/arm/boot/dts/Makefile
+--- linux-6.1.32/arch/arm/boot/dts.old/Makefile        2023-06-08 12:31:43.836149794 +0200
++++ linux-6.1.32/arch/arm/boot/dts/Makefile    2023-06-08 13:54:54.227133463 +0200
+@@ -1384,6 +1384,7 @@
+       sun8i-s3-pinecube.dtb \
+       sun8i-t113s-mangopi-mq-r-t113.dtb \
+       sun8i-t113s-mangopi-mqdual-t113.dtb \
++      sun8i-t113s-sun8i-t113s-myd-yt113x.dtb \
+       sun8i-t3-cqa3t-bv3.dtb \
+       sun8i-v3-sl631-imx179.dtb \
+       sun8i-v3s-licheepi-zero.dtb \
+diff -ruN linux-6.1.32/arch/arm/boot/dts.old/sun8i-t113s-myir-myd-yt113x.dts linux-6.1.32/arch/arm/boot/dts/sun8i-t113s-myir-myd-yt113x.dts
+--- linux-6.1.32/arch/arm/boot/dts.old/sun8i-t113s-myd-yt113x.dts      1970-01-01 01:00:00.000000000 +0100
++++ linux-6.1.32/arch/arm/boot/dts/sun8i-t113s-myd-yt113x.dts  2023-06-08 13:57:21.610411139 +0200
+@@ -0,0 +1,134 @@
++// SPDX-License-Identifier: (GPL-2.0+ or MIT)
++// Copyright (C) 2022 Arm Ltd.
++
++#include <dt-bindings/interrupt-controller/irq.h>
++#include <dt-bindings/gpio/gpio.h>
++
++/dts-v1/;
++
++#include "sun8i-t113s.dtsi"
++
++/ {
++      model = "MYIR MYD-YT113X";
++      compatible = "myir,myd-yt113x", "myir,myc-yt113x", "allwinner,sun8i-t113s";
++
++      aliases {
++              serial5 = &uart5;
++      };
++
++      chosen {
++              stdout-path = "serial5:115200n8";
++      };
++
++      /* board wide 5V supply directly from the USB-C socket */
++      reg_vcc5v: regulator-5v {
++              compatible = "regulator-fixed";
++              regulator-name = "vcc-5v";
++              regulator-min-microvolt = <5000000>;
++              regulator-max-microvolt = <5000000>;
++              regulator-always-on;
++      };
++
++      /* SY8008 DC/DC regulator on the board */
++      reg_3v3: regulator-3v3 {
++              compatible = "regulator-fixed";
++              regulator-name = "vcc-3v3";
++              regulator-min-microvolt = <3300000>;
++              regulator-max-microvolt = <3300000>;
++              vin-supply = <&reg_vcc5v>;
++      };
++
++      /* SY8008 DC/DC regulator on the board, also supplying VDD-SYS */
++      reg_vcc_core: regulator-core {
++              compatible = "regulator-fixed";
++              regulator-name = "vcc-core";
++              regulator-min-microvolt = <880000>;
++              regulator-max-microvolt = <880000>;
++              vin-supply = <&reg_vcc5v>;
++      };
++
++      /* XC6206 LDO on the board */
++      reg_avdd2v8: regulator-avdd {
++              compatible = "regulator-fixed";
++              regulator-name = "avdd2v8";
++              regulator-min-microvolt = <2800000>;
++              regulator-max-microvolt = <2800000>;
++              vin-supply = <&reg_3v3>;
++      };
++
++      reg_gmac_3v3: gmac-3v3 {
++              compatible = "regulator-fixed";
++              regulator-name = "gmac-3v3";
++              regulator-min-microvolt = <3300000>;
++              regulator-max-microvolt = <3300000>;
++              startup-delay-us = <100000>;
++              enable-active-high;
++              gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>; /* PD6 */
++      };
++};
++
++
++&cpu0 {
++      cpu-supply = <&reg_vcc_core>;
++};
++
++&cpu1 {
++      cpu-supply = <&reg_vcc_core>;
++};
++
++&pio {
++      /omit-if-no-ref/
++      uart5_pins: uart5-pins {
++              pins = "PE6", "PE7";
++              function = "uart5";
++      };
++
++      vcc-pb-supply = <&reg_3v3>;
++      vcc-pd-supply = <&reg_3v3>;
++      vcc-pe-supply = <&reg_avdd2v8>;
++      vcc-pf-supply = <&reg_3v3>;
++      vcc-pg-supply = <&reg_3v3>;
++};
++
++&uart5 {
++      pinctrl-names = "default";
++      pinctrl-0 = <&uart5_pins>;
++      status = "okay";
++};
++
++&mmc0 {
++      pinctrl-0 = <&mmc0_pins>;
++      pinctrl-names = "default";
++      vmmc-supply = <&reg_3v3>;
++      cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
++      disable-wp;
++      bus-width = <4>;
++      status = "okay";
++};
++
++&mmc2 {
++      pinctrl-0 = <&mmc2_pins>;
++      pinctrl-names = "default";
++      vmmc-supply = <&reg_3v3>;
++      non-removable;
++      bus-width = <4>;
++      status = "okay";
++};
++
++&mdio {
++      ext_rgmii_phy: ethernet-phy@1 {
++              compatible = "ethernet-phy-ieee802.3-c22";
++              reg = <1>;
++      };
++};
++
++&emac {
++      pinctrl-names = "default";
++      pinctrl-0 = <&rmii_pe_pins>;
++
++      phy-supply = <&reg_3v3>;
++      phy-handle = <&ext_rgmii_phy>;
++      phy-mode = "rmii";
++
++      status = "okay";
++};