mt7629 zioncom ip04398a mtk-snand
authorChuanhong Guo <gch981213@gmail.com>
Sat, 9 Apr 2022 12:13:58 +0000 (20:13 +0800)
committerChuanhong Guo <gch981213@gmail.com>
Sat, 9 Apr 2022 12:31:32 +0000 (20:31 +0800)
target/linux/mediatek/dts/mt7629-zioncom_ip04398a.dts [new file with mode: 0644]
target/linux/mediatek/image/mt7629.mk
target/linux/mediatek/mt7629/base-files/lib/upgrade/platform.sh

diff --git a/target/linux/mediatek/dts/mt7629-zioncom_ip04398a.dts b/target/linux/mediatek/dts/mt7629-zioncom_ip04398a.dts
new file mode 100644 (file)
index 0000000..aacbcc4
--- /dev/null
@@ -0,0 +1,346 @@
+// SPDX-License-Identifier: GPL-2.0
+
+/dts-v1/;
+#include <dt-bindings/input/input.h>
+#include "mt7629.dtsi"
+
+/ {
+       model = "Zioncom IP04398A reference board";
+       compatible = "zioncom,ip04398a", "mediatek,mt7629";
+
+       aliases {
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+               bootargs = "earlycon=uart8250,mmio32,0x11002000 console=ttyS0,115200n8";
+       };
+
+       cpus {
+               enable-method = "psci";
+       };
+
+       psci {
+               compatible = "arm,psci-1.0";
+               method = "smc";
+       };
+
+       leds {
+               compatible = "gpio-leds";
+
+               led_cpu: cpu {
+                       label = "blue:cpu";
+                       gpios = <&pio 57 GPIO_ACTIVE_LOW>;
+               };
+
+               usb {
+                       label = "blue:usb";
+                       gpios = <&pio 56 GPIO_ACTIVE_LOW>;
+               };
+
+               wlan2g {
+                       label = "blue:wlan2g";
+                       gpios = <&pio 21 GPIO_ACTIVE_LOW>;
+               };
+
+               wlan5g {
+                       label = "blue:wlan5g";
+                       gpios = <&pio 22 GPIO_ACTIVE_LOW>;
+               };
+       };
+
+       keys {
+               compatible = "gpio-keys";
+
+               reset {
+                       label = "reset";
+                       gpios = <&pio 60 GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_RESTART>;
+               };
+
+               wps {
+                       label = "wps";
+                       gpios = <&pio 58 GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_WPS_BUTTON>;
+               };
+       };
+
+
+       memory@40000000 {
+               device_type = "memory";
+               reg = <0x40000000 0x10000000>;
+       };
+
+       reg_3p3v: regulator-3p3v {
+               compatible = "regulator-fixed";
+               regulator-name = "fixed-3.3V";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               regulator-boot-on;
+               regulator-always-on;
+       };
+
+       reg_5v: regulator-5v {
+               compatible = "regulator-fixed";
+               regulator-name = "fixed-5V";
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               regulator-boot-on;
+               regulator-always-on;
+       };
+
+       gsw: gsw@0 {
+               compatible = "mediatek,mt753x";
+               mediatek,ethsys = <&ethsys>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+       };
+};
+
+&cpu0 {
+       clock-frequency = <1200000000>;
+};
+
+&cpu1 {
+       clock-frequency = <1200000000>;
+};
+
+&gsw {
+       mediatek,mdio = <&mdio>;
+       mediatek,portmap = "llllw";
+       mediatek,mdio_master_pinmux = <0>;
+       reset-gpios = <&pio 28 0>;
+       interrupt-parent = <&pio>;
+       interrupts = <6 IRQ_TYPE_LEVEL_HIGH>;
+       status = "okay";
+
+       port6: port@6 {
+               compatible = "mediatek,mt753x-port";
+               reg = <6>;
+               phy-mode = "sgmii";
+               fixed-link {
+                       speed = <2500>;
+                       full-duplex;
+               };
+       };
+};
+
+&eth {
+       pinctrl-names = "default";
+       pinctrl-0 = <&eth_pins>;
+       pinctrl-1 = <&ephy_leds_pins>;
+       status = "okay";
+
+       gmac0: mac@0 {
+               compatible = "mediatek,eth-mac";
+               reg = <0>;
+               phy-mode = "2500base-x";
+
+               nvmem-cells = <&macaddr_factory_2a>;
+               nvmem-cell-names = "mac-address";
+
+               fixed-link {
+                       speed = <2500>;
+                       full-duplex;
+                       pause;
+               };
+       };
+
+       gmac1: mac@1 {
+               compatible = "mediatek,eth-mac";
+               reg = <1>;
+               phy-mode = "gmii";
+               phy-handle = <&phy0>;
+
+               nvmem-cells = <&macaddr_factory_24>;
+               nvmem-cell-names = "mac-address";
+       };
+
+       mdio: mdio-bus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               phy0: ethernet-phy@0 {
+                       reg = <0>;
+                       phy-mode = "gmii";
+               };
+       };
+};
+
+&pio {
+       eth_pins: eth-pins {
+               mux {
+                       function = "eth";
+                       groups = "mdc_mdio";
+               };
+       };
+
+       ephy_leds_pins: ephy-leds-pins {
+               mux {
+                       function = "led";
+                       groups = "gphy_leds_0", "ephy_leds";
+               };
+       };
+
+       i2c_pins: i2c-pins {
+               mux {
+                       function = "i2c";
+                       groups =  "i2c_0";
+               };
+
+               conf {
+                       pins = "I2C_SDA", "I2C_SCL";
+                       drive-strength = <4>;
+                       bias-disable;
+               };
+       };
+
+       pcie_pins: pcie-pins {
+               mux {
+                       function = "pcie";
+                       groups = "pcie_clkreq",
+                                "pcie_pereset",
+                                "pcie_wake";
+               };
+       };
+
+       pwm_pins: pwm-pins {
+               mux {
+                       function = "pwm";
+                       groups = "pwm_0";
+               };
+       };
+
+       /* SPI-NOR is shared pin with serial NAND */
+       qspi_pins: qspi-pins {
+               mux {
+                       function = "flash";
+                       groups = "spi_nor";
+               };
+       };
+
+       /* Serial NAND is shared pin with SPI-NOR */
+       serial_nand_pins: serial-nand-pins {
+               mux {
+                       function = "flash";
+                       groups = "snfi";
+               };
+       };
+
+       spi_pins: spi-pins {
+               mux {
+                       function = "spi";
+                       groups = "spi_0";
+               };
+       };
+
+       uart0_pins: uart0-pins {
+               mux {
+                       function = "uart";
+                       groups = "uart0_txd_rxd" ;
+               };
+       };
+
+       uart1_pins: uart1-pins {
+               mux {
+                       function = "uart";
+                       groups = "uart1_0_tx_rx" ;
+               };
+       };
+
+       uart2_pins: uart2-pins {
+               mux {
+                       function = "uart";
+                       groups = "uart2_0_txd_rxd" ;
+               };
+       };
+
+       watchdog_pins: watchdog-pins {
+               mux {
+                       function = "watchdog";
+                       groups = "watchdog";
+               };
+       };
+};
+
+&bch {
+       status = "okay";
+};
+
+&snfi {
+       pinctrl-names = "default";
+       pinctrl-0 = <&serial_nand_pins>;
+       status = "okay";
+       flash@0 {
+               compatible = "spi-nand";
+               reg = <0>;
+               spi-tx-bus-width = <4>;
+               spi-rx-bus-width = <4>;
+               nand-ecc-engine = <&snfi>;
+
+               partitions {
+                       compatible = "fixed-partitions";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       partition@0 {
+                               label = "bl2";
+                               reg = <0x0 0x80000>;
+                               read-only;
+                       };
+
+                       partition@80000 {
+                               label = "fip";
+                               reg = <0x80000 0x200000>;
+                       };
+
+                       factory: partition@280000 {
+                               label = "factory";
+                               reg = <0x280000 0x80000>;
+                       };
+
+                       partition@300000 {
+                               label = "ubi";
+                               reg = <0x300000 0>;
+                       };
+               };
+       };
+};
+
+
+&ssusb {
+       vusb33-supply = <&reg_3p3v>;
+       vbus-supply = <&reg_5v>;
+       status = "okay";
+};
+
+&u3phy0 {
+       status = "okay";
+};
+
+&uart0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart0_pins>;
+       status = "okay";
+};
+
+&watchdog {
+       pinctrl-names = "default";
+       pinctrl-0 = <&watchdog_pins>;
+       status = "okay";
+};
+
+&factory {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       macaddr_factory_24: macaddr@24 {
+               reg = <0x24 0x6>;
+       };
+
+       macaddr_factory_2a: macaddr@2a {
+               reg = <0x2a 0x6>;
+       };
+};
index 754ce974b19c8e2c2293c9d84d4110b1751e90b9..6955ca30fe0292af6d6a3730913a2f467f5e7111 100644 (file)
@@ -7,3 +7,17 @@ define Device/mediatek_mt7629-rfb
   DEVICE_PACKAGES := swconfig
 endef
 TARGET_DEVICES += mediatek_mt7629-rfb
+
+define Device/zioncom_ip04398a
+  DEVICE_VENDOR := Zioncom
+  DEVICE_MODEL := IP04398A Reference Design
+  DEVICE_DTS := mt7629-zioncom_ip04398a
+  DEVICE_DTS_DIR := ../dts
+  DEVICE_PACKAGES := swconfig
+  IMAGES := sysupgrade.itb
+  KERNEL_INITRAMFS_SUFFIX := -recovery.itb
+  KERNEL := kernel-bin | gzip
+  KERNEL_INITRAMFS := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 128k
+  IMAGE/sysupgrade.itb := append-kernel | fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
+endef
+TARGET_DEVICES += zioncom_ip04398a
index 9a613c43b1a2a3f1ed32fccaf9ffb50f5c19f23c..93f24e7b5a02c08e41710575954da20778c7616a 100755 (executable)
@@ -9,6 +9,10 @@ platform_do_upgrade() {
        local board=$(board_name)
 
        case "$board" in
+       zioncom,ip04398a)
+               CI_KERNPART="fit"
+               nand_do_upgrade "$1"
+               ;;
        *)
                default_do_upgrade "$1"
                ;;