sunxi: t113: myir: add LEDs, i2c support and i2c devices
authorZoltan HERPAI <wigyori@uid0.hu>
Wed, 5 Jul 2023 21:58:52 +0000 (23:58 +0200)
committerZoltan HERPAI <wigyori@uid0.hu>
Wed, 5 Jul 2023 21:58:52 +0000 (23:58 +0200)
Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
target/linux/sunxi/patches-6.1/0012-myir-updates-leds-i2c-i2cdevs.patch [new file with mode: 0644]

diff --git a/target/linux/sunxi/patches-6.1/0012-myir-updates-leds-i2c-i2cdevs.patch b/target/linux/sunxi/patches-6.1/0012-myir-updates-leds-i2c-i2cdevs.patch
new file mode 100644 (file)
index 0000000..b429320
--- /dev/null
@@ -0,0 +1,174 @@
+diff -ruN linux-6.1.32.old/arch/arm/boot/dts/sun8i-t113s-myd-yt113x.dts linux-6.1.32/arch/arm/boot/dts/sun8i-t113s-myd-yt113x.dts
+--- linux-6.1.32.old/arch/arm/boot/dts/sun8i-t113s-myd-yt113x.dts      2023-07-05 23:30:45.587744919 +0200
++++ linux-6.1.32/arch/arm/boot/dts/sun8i-t113s-myd-yt113x.dts  2023-07-02 20:56:59.723698557 +0200
+@@ -14,12 +14,32 @@
+       aliases {
+               serial5 = &uart5;
++
++              led-boot = &led_blue;
++              led-failsafe = &led_blue;
++              led-running = &led_blue;
++              led-upgrade = &led_blue;
+       };
+       chosen {
+               stdout-path = "serial5:115200n8";
+       };
++      leds {
++              compatible = "gpio-leds";
++
++              led_blue: blue {
++                      label = "blue";
++                      gpios = <&pio 4 2 GPIO_ACTIVE_LOW>; /* PD2 */
++              };
++
++              green {
++                      label = "green";
++                      gpios = <&pcf9555 6 GPIO_ACTIVE_LOW>;
++                      default-state = "on";
++              };
++      };
++
+       /* board wide 5V supply directly from the USB-C socket */
+       reg_vcc5v: regulator-5v {
+               compatible = "regulator-fixed";
+@@ -63,7 +83,7 @@
+               regulator-max-microvolt = <3300000>;
+               startup-delay-us = <100000>;
+               enable-active-high;
+-              gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>; /* PD6 */
++              gpio = <&pio 4 12 GPIO_ACTIVE_HIGH>; /* PE12 */
+       };
+ };
+@@ -92,6 +112,29 @@
+               pins = "PE6", "PE7";
+               function = "uart5";
+       };
++
++//    rmii_pg_pins: rmii-pg-pins {
++//            pins = "PG0", "PG1", "PG2", "PG3", "PG4",
++//                   "PG5", "PG12", "PG13", "PG14", "PG15";
++//            function = "emac";
++//    };
++
++      rgmii_pg_pins: rgmii-pg-pins {
++              pins = "PG0", "PG1", "PG2", "PG3", "PG4", "PG5",
++                     "PG6", "PG7", "PG8", "PG9", "PG10",
++                     "PG12", "PG14", "PG15";
++              function = "emac";
++      };
++
++      i2c1_pb_pins: i2c1-pb-pins {
++              pins = "PB4", "PB5";
++              function = "i2c1";
++      };
++
++      i2c3_pb_pins: i2c3-pb-pins {
++              pins = "PB6", "PB7";
++              function = "i2c3";
++      };
+ };
+ &uart5 {
+@@ -110,6 +153,11 @@
+       status = "okay";
+ };
++&mmc2_pins {
++      bias-pull-up;
++      drive-strength = <40>;
++};
++
+ &mmc2 {
+       pinctrl-0 = <&mmc2_pins>;
+       pinctrl-names = "default";
+@@ -119,20 +167,81 @@
+       status = "okay";
+ };
++
++&ehci0 {
++      status = "okay";
++};
++
++&ohci0 {
++      status = "okay";
++};
++
++&ehci1 {
++      status = "okay";
++};
++
++&ohci1 {
++      status = "okay";
++};
++
++&usbphy {
++      usb1_vbus-supply = <&reg_vcc5v>;
++      status = "okay";
++};
++
++&i2c1 {
++      pinctrl-0 = <&i2c1_pb_pins>;
++      pinctrl-names = "default";
++
++      status = "okay";
++
++      rtc@32 {
++              compatible = "epson,rx8025";
++              reg = <0x32>;
++      };
++};
++
++&i2c3 {
++      pinctrl-0 = <&i2c3_pb_pins>;
++      pinctrl-names = "default";
++
++      status = "okay";
++
++      eeprom@50 {
++              compatible = "atmel,24c32";
++              reg = <0x50>;
++      };
++
++      pcf9555: pcf9555@20 {
++              #gpio-cells = <2>;
++              compatible = "nxp,pca9555";
++              reg = <0x20>;
++      };
++};
++
++
++
++
++
+ &mdio {
+-      ext_rgmii_phy: ethernet-phy@1 {
++      ext_rgmii_phy: ethernet-phy@0 {
++//            #address-cells = <1>;
++//            #size-cells = <0>;
++//            compatible = "snps,dwmac-mdio";
+               compatible = "ethernet-phy-ieee802.3-c22";
+-              reg = <1>;
++
++              reg = <0>;
++              reset-gpios = <&pio 4 11 GPIO_ACTIVE_HIGH>;
+       };
+ };
+ &emac {
+       pinctrl-names = "default";
+-      pinctrl-0 = <&rmii_pe_pins>;
++      pinctrl-0 = <&rgmii_pg_pins>;
+       phy-supply = <&reg_3v3>;
+       phy-handle = <&ext_rgmii_phy>;
+-      phy-mode = "rmii";
++      phy-mode = "rgmii";
+       status = "okay";
+ };
+diff -ruN linux-6.1.32.old/scripts/dtc/include-prefixes/arm/sun8i-t113s-myd-yt113x.dts linux-6.1.32/scripts/dtc/include-prefixes/arm/sun8i-t113s-myd-yt113x.dts