mediatek: filogic: add Arcadyan Mozart platform
authorJohn Crispin <john@phrozen.org>
Sat, 21 Sep 2024 07:48:47 +0000 (09:48 +0200)
committerJohn Crispin <john@phrozen.org>
Tue, 5 Nov 2024 12:30:21 +0000 (13:30 +0100)
* Mediatek MT7988A (4x Cortex-A73, up to 1.8 GHz clock speed)
* 8 GiB eMMC
* 4 GiB DDR4 RAM
* 2x 10000M + 1x 1000M  ports
* MT7996 Tri-band (2.4G, 5G, 6G) 4T4R 802.11be Wi-Fi
* 2 buttons (Reset, WPS)
* 2x LED for each GMAC
* USB-C PD power input

Signed-off-by: John Crispin <john@phrozen.org>
target/linux/mediatek/dts/mt7988a-arcadyan-mozart.dts [new file with mode: 0644]
target/linux/mediatek/filogic/base-files/etc/board.d/02_network
target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
target/linux/mediatek/image/filogic.mk

diff --git a/target/linux/mediatek/dts/mt7988a-arcadyan-mozart.dts b/target/linux/mediatek/dts/mt7988a-arcadyan-mozart.dts
new file mode 100644 (file)
index 0000000..8b5f052
--- /dev/null
@@ -0,0 +1,336 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+
+/dts-v1/;
+#include "mt7988a-rfb.dts"
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+       compatible = "arcadyan,mozart", "mediatek,mt7988a";
+       model = "MediaTek / Arcadyan - Mozart";
+
+       aliases {
+               serial0 = &uart0;
+               led-boot = &led_status_blue;
+               led-failsafe = &led_status_red;
+               led-running = &led_status_green;
+               led-upgrade = &led_status_green;
+       };
+
+       chosen {
+               rootdisk = <&emmc_rootfs>;
+       };
+
+       gpio-leds {
+               compatible = "gpio-leds";
+
+               wifi_white {
+                       color = <LED_COLOR_ID_WHITE>;
+                       function = LED_FUNCTION_STATUS;
+                       gpios = <&pio 68 GPIO_ACTIVE_HIGH>;
+               };
+
+               led_status_red: wifi_red {
+                       color = <LED_COLOR_ID_RED>;
+                       function = LED_FUNCTION_STATUS;
+                       gpios = <&pio 29 GPIO_ACTIVE_HIGH>;
+               };
+
+               led_status_green: wifi_green {
+                       color = <LED_COLOR_ID_GREEN>;
+                       function = LED_FUNCTION_STATUS;
+                       gpios = <&pio 30 GPIO_ACTIVE_HIGH>;
+               };
+
+               led_status_blue: wifi_blue {
+                       color = <LED_COLOR_ID_BLUE>;
+                       function = LED_FUNCTION_STATUS;
+                       gpios = <&pio 31 GPIO_ACTIVE_HIGH>;
+               };
+       };
+
+       keys {
+               compatible = "gpio-keys";
+
+               button-reset {
+                       label = "reset";
+                       linux,code = <KEY_RESTART>;
+                       gpios = <&pio 13 GPIO_ACTIVE_LOW>;
+               };
+       };
+};
+
+&pio {
+       mdio0_pins: mdio0-pins {
+               mux {
+                       function = "eth";
+                       groups = "mdc_mdio0";
+               };
+
+               conf {
+                       groups = "mdc_mdio0";
+                       drive-strength = <MTK_DRIVE_10mA>;
+               };
+       };
+
+       spic_pins: spi1-pins {
+               mux {
+                       function = "spi";
+                       groups = "spi1";
+               };
+       };
+};
+
+&usxgmiisys0 {
+       mediatek,pnswap-rx;
+};
+
+&usxgmiisys1 {
+       mediatek,pnswap-rx;
+};
+
+&mdio_bus {
+       #address-cells = <1>;
+       #size-cells = <0>;
+       reset-gpios = <&pio 72 GPIO_ACTIVE_LOW>;
+       reset-assert-us = <100000>;
+       reset-deassert-us = <100000>;
+
+       phy0: ethernet-phy@0 {
+               reg = <0>;
+               compatible = "ethernet-phy-ieee802.3-c45";
+       };
+
+       phy8: ethernet-phy@8 {
+               reg = <8>;
+               compatible = "ethernet-phy-ieee802.3-c45";
+       };
+};
+
+&gmac0 {
+       nvmem-cells = <&macaddr_factory_4 3>;
+       nvmem-cell-names = "mac-address";
+};
+
+&gmac1 {
+       phy-mode = "usxgmii";
+       phy-connection-type = "usxgmii";
+       phy = <&phy0>;
+       nvmem-cells = <&macaddr_factory_4 4>;
+       nvmem-cell-names = "mac-address";
+       status = "okay";
+};
+
+&gmac2 {
+       phy-mode = "usxgmii";
+       phy-connection-type = "usxgmii";
+       phy = <&phy8>;
+       nvmem-cells = <&macaddr_factory_4 5>;
+       nvmem-cell-names = "mac-address";
+       status = "okay";
+};
+
+&switch {
+       /delete-node/ports;
+
+       ports {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               gsw_port0: port@0 {
+                       reg = <0>;
+                       label = "lan0";
+                       phy-mode = "internal";
+                       phy-handle = <&gsw_phy0>;
+               };
+
+               port@6 {
+                       reg = <6>;
+                       ethernet = <&gmac0>;
+                       phy-mode = "internal";
+
+                       fixed-link {
+                               speed = <10000>;
+                               full-duplex;
+                               pause;
+                       };
+               };
+       };
+};
+
+&i2c1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c1_pins>;
+       clock-frequency = <100000>;
+       status = "okay";
+
+       icp201xx@63{
+               compatible = "invensense,icp201xx";
+               reg = <0x63>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+       };
+};
+
+&uart1 {
+       status = "okay";
+};
+
+&fan {
+       pwms = <&pwm 1 40000 0>;
+       status = "okay";
+};
+
+&pwm {
+       status = "okay";
+};
+
+&spi1 {
+       pinctrl-names = "default";
+       /* pin shared with snfi */
+       pinctrl-0 = <&spic_pins>;
+       status = "disabled";
+};
+
+&mmc0 {
+       pinctrl-names = "default", "state_uhs";
+       pinctrl-0 = <&mmc0_pins_emmc_51>;
+       pinctrl-1 = <&mmc0_pins_emmc_51>;
+       bus-width = <8>;
+       max-frequency = <200000000>;
+       cap-mmc-highspeed;
+       mmc-hs200-1_8v;
+       mmc-hs400-1_8v;
+       hs400-ds-delay = <0x12814>;
+       vqmmc-supply = <&reg_1p8v>;
+       vmmc-supply = <&reg_3p3v>;
+       non-removable;
+       no-sd;
+       no-sdio;
+       status = "okay";
+
+       card@0 {
+               compatible = "mmc-card";
+               reg = <0>;
+
+               block {
+                       compatible = "block-device";
+                       partitions {
+                               block-partition-env {
+                                       partname = "u-boot-env";
+                                       nvmem-layout {
+                                               compatible = "u-boot,env-layout";
+                                       };
+                               };
+
+                               emmc_rootfs: block-partition-production {
+                                       partname = "production";
+                               };
+
+                               block-partition-factory {
+                                       partname = "factory";
+
+                                       nvmem-layout {
+                                               compatible = "fixed-layout";
+                                               #address-cells = <1>;
+                                               #size-cells = <1>;
+
+                                               eeprom_factory_0: eeprom@0 {
+                                                       reg = <0x0 0x1e00>;
+                                               };
+
+                                               macaddr_factory_4: macaddr@a {
+                                                       compatible = "mac-base";
+                                                       reg = <0x4 0x6>;
+                                                       #nvmem-cell-cells = <1>;
+                                               };
+                                       };
+                               };
+                       };
+               };
+       };
+};
+
+&cpu_thermal {
+       /delete-node/cooling-maps;
+       /delete-node/trips;
+
+       trips {
+               cpu_trip_crit: crit {
+                       temperature = <125000>;
+                       hysteresis = <2000>;
+                       type = "critical";
+               };
+
+               cpu_trip_hot: hot {
+                       temperature = <120000>;
+                       hysteresis = <2000>;
+                       type = "hot";
+               };
+
+               cpu_trip_active_high: active-high {
+                       temperature = <110000>;
+                       hysteresis = <2000>;
+                       type = "active";
+               };
+
+               cpu_trip_active_med: active-med {
+                       temperature = <80000>;
+                       hysteresis = <2000>;
+                       type = "active";
+               };
+
+               cpu_trip_active_low: active-low {
+                       temperature = <60000>;
+                       hysteresis = <2000>;
+                       type = "active";
+               };
+
+               cpu_trip_active_silent: active-silent {
+                       temperature = <40000>;
+                       hysteresis = <2000>;
+                       type = "active";
+               };
+       };
+
+       cooling-maps {
+               cpu-active-high {
+                       /* active: set fan to cooling level 3 */
+                       cooling-device = <&fan 3 3>;
+                       trip = <&cpu_trip_active_high>;
+               };
+
+               cpu-active-med {
+                       /* active: set fan to cooling level 2 */
+                       cooling-device = <&fan 2 2>;
+                       trip = <&cpu_trip_active_med>;
+               };
+
+               cpu-active-low {
+                       /* active: set fan to cooling level 1 */
+                       cooling-device = <&fan 1 1>;
+                       trip = <&cpu_trip_active_low>;
+               };
+
+               cpu-active-silent {
+                       /* active: set fan to cooling level 0 */
+                       cooling-device = <&fan 0 0>;
+                       trip = <&cpu_trip_active_silent>;
+               };
+       };
+};
+
+&pcie0 {
+       status = "okay";
+
+       pcie@0,0 {
+               reg = <0x0000 0 0 0 0>;
+
+               mt7996@1,0 {
+                       reg = <0x0000 0 0 0 0>;
+                       nvmem-cells = <&eeprom_factory_0>;
+                       nvmem-cell-names = "eeprom";
+               };
+       };
+};
index af5c4ceafee13113faae6c032ae05c4931fa53f5..fff39006da82bc00a8c1d5dbd31265d15ff84ca1 100644 (file)
@@ -21,6 +21,9 @@ mediatek_setup_interfaces()
        acer,predator-w6)
                ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 game" eth1
                ;;
+       arcadyan,mozart)
+               ucidef_set_interfaces_lan_wan "lan0 eth1" eth2
+               ;;
        asus,rt-ax59u|\
        cetron,ct3003|\
        confiabits,mt7981|\
index edc045656639c2274c6f4a50dabea82a359413d6..7fe2d29d31d2078300ccfefc714f9b50576a0266 100755 (executable)
@@ -90,6 +90,7 @@ platform_do_upgrade() {
                fit_do_upgrade "$1"
                ;;
        acer,predator-w6|\
+       arcadyan,mozart|\
        smartrg,sdg-8612|\
        smartrg,sdg-8614|\
        smartrg,sdg-8622|\
@@ -202,6 +203,7 @@ platform_copy_config() {
                fi
                ;;
        acer,predator-w6|\
+       arcadyan,mozart|\
        glinet,gl-mt2500|\
        glinet,gl-mt6000|\
        glinet,gl-x3000|\
index 37fe740c31d4e3a54108557a79755fd12b1d67a6..5dfde755a0125ba912890be9d12e60be49d1b9b6 100644 (file)
@@ -254,6 +254,30 @@ define Device/asus_tuf-ax4200
 endef
 TARGET_DEVICES += asus_tuf-ax4200
 
+define Device/arcadyan_mozart
+  DEVICE_VENDOR := Arcadyan
+  DEVICE_MODEL := Mozart
+  DEVICE_DTS := mt7988a-arcadyan-mozart
+  DEVICE_DTS_DIR := ../dts
+  DEVICE_DTC_FLAGS := --pad 4096
+  DEVICE_DTS_LOADADDR := 0x45f00000
+  DEVICE_PACKAGES := kmod-hwmon-pwmfan e2fsprogs f2fsck mkf2fs kmod-mt7996-firmware
+  KERNEL_LOADADDR := 0x46000000
+  KERNEL := kernel-bin | gzip
+  KERNEL_INITRAMFS := kernel-bin | lzma | \
+        fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
+  KERNEL_INITRAMFS_SUFFIX := .itb
+  IMAGE_SIZE := $$(shell expr 64 + $$(CONFIG_TARGET_ROOTFS_PARTSIZE))m
+  IMAGES := sysupgrade.itb
+  IMAGE/sysupgrade.itb := append-kernel | fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-with-rootfs | pad-rootfs | append-metadata
+  ARTIFACTS := emmc-preloader.bin emmc-bl31-uboot.fip emmc-gpt.bin
+  ARTIFACT/emmc-gpt.bin := mt798x-gpt emmc
+  ARTIFACT/emmc-preloader.bin  := mt7988-bl2 emmc-comb
+  ARTIFACT/emmc-bl31-uboot.fip := mt7988-bl31-uboot arcadyan_mozart
+  SUPPORTED_DEVICES += arcadyan,mozart
+endef
+TARGET_DEVICES += arcadyan_mozart
+
 define Device/asus_tuf-ax6000
   DEVICE_VENDOR := ASUS
   DEVICE_MODEL := TUF-AX6000