mediatek: remove custom layout for JCG Q30

Since the mainline implementation has been accepted by upstream,
it doesn't make sense to keep these hacks. People are also confused
with these "custom layouts".

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
Tianling Shen
2024-01-06 14:24:12 +08:00
parent a97a7d4575
commit 8593c213b0
9 changed files with 29 additions and 103 deletions

View File

@@ -75,7 +75,7 @@ glinet,gl-mt3000)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x80000" "0x20000"
;;
h3c,magic-nx30-pro|\
jcg,q30|\
jcg,q30-pro|\
qihoo,360t7|\
tplink,tl-xdr4288|\
tplink,tl-xdr6086|\

View File

@@ -238,11 +238,11 @@ define U-Boot/mt7981_h3c_magic-nx30-pro
DEPENDS:=+trusted-firmware-a-mt7981-spim-nand-ddr3
endef
define U-Boot/mt7981_jcg_q30
NAME:=JCG Q30
define U-Boot/mt7981_jcg_q30-pro
NAME:=JCG Q30 PRO
BUILD_SUBTARGET:=filogic
BUILD_DEVICES:=jcg_q30
UBOOT_CONFIG:=mt7981_jcg_q30
BUILD_DEVICES:=jcg_q30-pro
UBOOT_CONFIG:=mt7981_jcg_q30-pro
UBOOT_IMAGE:=u-boot.fip
BL2_BOOTDEV:=spim-nand
BL2_SOC:=mt7981
@@ -597,7 +597,7 @@ UBOOT_TARGETS := \
mt7981_cmcc_rax3000m-emmc \
mt7981_cmcc_rax3000m-nand \
mt7981_h3c_magic-nx30-pro \
mt7981_jcg_q30 \
mt7981_jcg_q30-pro \
mt7981_rfb-spim-nand \
mt7981_rfb-emmc \
mt7981_rfb-nor \

View File

@@ -1,5 +1,5 @@
--- /dev/null
+++ b/configs/mt7981_jcg_q30_defconfig
+++ b/configs/mt7981_jcg_q30-pro_defconfig
@@ -0,0 +1,175 @@
+CONFIG_ARM=y
+CONFIG_POSITION_INDEPENDENT=y
@@ -9,9 +9,9 @@
+CONFIG_SYS_MALLOC_F_LEN=0x4000
+CONFIG_SYS_HAS_NONCACHED_MEMORY=y
+CONFIG_NR_DRAM_BANKS=1
+CONFIG_DEFAULT_DEVICE_TREE="mt7981_jcg_q30"
+CONFIG_DEFAULT_ENV_FILE="jcg_q30_env"
+CONFIG_DEFAULT_FDT_FILE="mediatek/mt7981_jcg_q30.dtb"
+CONFIG_DEFAULT_DEVICE_TREE="mt7981_jcg_q30-pro"
+CONFIG_DEFAULT_ENV_FILE="jcg_q30-pro_env"
+CONFIG_DEFAULT_FDT_FILE="mediatek/mt7981_jcg_q30-pro.dtb"
+CONFIG_OF_LIBFDT_OVERLAY=y
+CONFIG_DEBUG_UART_BASE=0x11002000
+CONFIG_DEBUG_UART_CLOCK=40000000
@@ -177,7 +177,7 @@
+CONFIG_USE_SERVERIP=y
+CONFIG_SERVERIP="192.168.1.254"
--- /dev/null
+++ b/arch/arm/dts/mt7981_jcg_q30.dts
+++ b/arch/arm/dts/mt7981_jcg_q30-pro.dts
@@ -0,0 +1,179 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
@@ -193,7 +193,7 @@
+/ {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ model = "JCG Q30";
+ model = "JCG Q30 PRO";
+ compatible = "mediatek,mt7981", "mediatek,mt7981-rfb";
+
+ chosen {
@@ -359,7 +359,7 @@
+ status = "disabled";
+};
--- /dev/null
+++ b/jcg_q30_env
+++ b/jcg_q30-pro_env
@@ -0,0 +1,57 @@
+ipaddr=192.168.1.1
+serverip=192.168.1.254
@@ -368,10 +368,10 @@
+bootcmd=if pstore check ; then run boot_recovery ; else run boot_ubi ; fi
+bootconf=config-1
+bootdelay=0
+bootfile=immortalwrt-mediatek-filogic-jcg_q30-initramfs-recovery.itb
+bootfile_bl2=immortalwrt-mediatek-filogic-jcg_q30-preloader.bin
+bootfile_fip=immortalwrt-mediatek-filogic-jcg_q30-bl31-uboot.fip
+bootfile_upg=immortalwrt-mediatek-filogic-jcg_q30-squashfs-sysupgrade.itb
+bootfile=immortalwrt-mediatek-filogic-jcg_q30-pro-initramfs-recovery.itb
+bootfile_bl2=immortalwrt-mediatek-filogic-jcg_q30-pro-preloader.bin
+bootfile_fip=immortalwrt-mediatek-filogic-jcg_q30-pro-bl31-uboot.fip
+bootfile_upg=immortalwrt-mediatek-filogic-jcg_q30-pro-squashfs-sysupgrade.itb
+bootled_pwr=blue:status
+bootled_rec=red:status
+bootmenu_confirm_return=askenv - Press ENTER to return to menu ; bootmenu 60

View File

@@ -7,8 +7,8 @@
#include "mt7981.dtsi"
/ {
model = "JCG Q30";
compatible = "jcg,q30", "mediatek,mt7981";
model = "JCG Q30 PRO";
compatible = "jcg,q30-pro", "mediatek,mt7981";
aliases {
led-boot = &status_red_led;

View File

@@ -1,41 +0,0 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/*
* Copyright (C) 2023 Tianling Shen <cnsztl@immortalwrt.org>
*/
/dts-v1/;
#include "mt7981b-jcg-q30.dts"
/ {
model = "JCG Q30 (custom U-Boot layout)";
compatible = "jcg,q30-ubootmod", "mediatek,mt7981";
};
&spi_nand {
mediatek,nmbm;
mediatek,bmt-max-ratio = <1>;
mediatek,bmt-max-reserved-blocks = <64>;
spi-cal-enable;
spi-cal-mode = "read-data";
spi-cal-datalen = <7>;
spi-cal-data = /bits/ 8 <0x53 0x50 0x49 0x4E 0x41 0x4E 0x44>;
spi-cal-addrlen = <5>;
spi-cal-addr = /bits/ 32 <0x0 0x0 0x0 0x0 0x0>;
};
&spi0_flash_pins {
conf-pu {
/delete-property/ mediatek,pull-up-adv;
bias-pull-up = <MTK_PUPD_SET_R1R0_11>;
};
conf-pd {
/delete-property/ mediatek,pull-up-adv;
bias-pull-up = <MTK_PUPD_SET_R1R0_11>;
};
};
&ubi {
reg = <0x580000 0x6e80000>;
};

View File

@@ -28,8 +28,7 @@ mediatek_setup_interfaces()
cmcc,a10-ubootmod|\
confiabits,mt7981|\
cudy,wr3000-v1|\
jcg,q30|\
jcg,q30-ubootmod|\
jcg,q30-pro|\
livinet,zr-3020|\
livinet,zr-3020-ubootmod|\
qihoo,360t7|\

View File

@@ -97,8 +97,7 @@ case "$board" in
[ "$PHYNBR" = "0" ] && macaddr_add $addr 1 > /sys${DEVPATH}/macaddress
[ "$PHYNBR" = "1" ] && macaddr_add $addr 3 > /sys${DEVPATH}/macaddress
;;
jcg,q30|\
jcg,q30-ubootmod)
jcg,q30-pro)
# Originally, phy1 is phy0 mac with LA bit set. However, this would conflict
# addresses on multiple VIFs with the other radio. Use label mac to set LA bit.
[ "$PHYNBR" = "1" ] && macaddr_setbit_la $(get_mac_label) > /sys${DEVPATH}/macaddress

View File

@@ -123,7 +123,7 @@ platform_do_upgrade() {
emmc_do_upgrade "$1"
;;
h3c,magic-nx30-pro|\
jcg,q30|\
jcg,q30-pro|\
mediatek,mt7981-rfb|\
qihoo,360t7|\
tplink,tl-xdr4288|\

View File

@@ -574,18 +574,15 @@ define Device/imou_lc-hx3001-ubootmod
endef
TARGET_DEVICES += imou_lc-hx3001-ubootmod
define Device/jcg_q30
define Device/jcg_q30-pro
DEVICE_VENDOR := JCG
DEVICE_MODEL := Q30
DEVICE_VARIANT := (OpenWrt U-Boot layout)
DEVICE_MODEL := Q30 PRO
DEVICE_ALT0_VENDOR := JCG
DEVICE_ALT0_MODEL := Q30 Pro
DEVICE_ALT0_VARIANT := (OpenWrt U-Boot layout)
DEVICE_ALT0_MODEL := Q30
DEVICE_ALT1_VENDOR := CMCC
DEVICE_ALT1_MODEL := MR3000D-CIq
DEVICE_ALT1_VARIANT := (OpenWrt U-Boot layout)
SUPPORTED_DEVICES += jcg,q30-pro
DEVICE_DTS := mt7981b-jcg-q30
SUPPORTED_DEVICES += jcg,q30
DEVICE_DTS := mt7981b-jcg-q30-pro
DEVICE_DTS_DIR := ../dts
UBINIZE_OPTS := -E 5
BLOCKSIZE := 128k
@@ -602,37 +599,9 @@ define Device/jcg_q30
DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware
ARTIFACTS := preloader.bin bl31-uboot.fip
ARTIFACT/preloader.bin := mt7981-bl2 spim-nand-ddr3
ARTIFACT/bl31-uboot.fip := mt7981-bl31-uboot jcg_q30
ARTIFACT/bl31-uboot.fip := mt7981-bl31-uboot jcg_q30-pro
endef
TARGET_DEVICES += jcg_q30
define Device/jcg_q30-ubootmod
DEVICE_VENDOR := JCG
DEVICE_MODEL := Q30
DEVICE_VARIANT := (custom U-Boot layout)
DEVICE_ALT0_VENDOR := JCG
DEVICE_ALT0_MODEL := Q30 Pro
DEVICE_ALT0_VARIANT := (custom U-Boot layout)
DEVICE_ALT1_VENDOR := CMCC
DEVICE_ALT1_MODEL := MR3000D-CIq
DEVICE_ALT1_VARIANT := (custom U-Boot layout)
DEVICE_DTS := mt7981b-jcg-q30-ubootmod
DEVICE_DTS_DIR := ../dts
DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware
UBINIZE_OPTS := -E 5
BLOCKSIZE := 128k
PAGESIZE := 2048
IMAGE_SIZE := 113152k
KERNEL_IN_UBI := 1
IMAGES += factory.bin
IMAGE/factory.bin := append-ubi | check-size $$$$(IMAGE_SIZE)
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
KERNEL = kernel-bin | lzma | \
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
KERNEL_INITRAMFS = kernel-bin | lzma | \
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd
endef
TARGET_DEVICES += jcg_q30-ubootmod
TARGET_DEVICES += jcg_q30-pro
define Device/jdcloud_re-cp-03
DEVICE_VENDOR := JDCloud