From b2f7355eece0b1685ccb85280f3cdb13b3c1ebf5 Mon Sep 17 00:00:00 2001 From: Kevin Darbyshire-Bryant Date: Sat, 4 Jul 2020 17:18:10 +0100 Subject: [PATCH 01/31] cake-oot: update to latest HEAD Signed-off-by: Kevin Darbyshire-Bryant --- package/kernel/kmod-sched-cake-oot/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/kernel/kmod-sched-cake-oot/Makefile b/package/kernel/kmod-sched-cake-oot/Makefile index e6d8d76e5f..a6ab1eb4c6 100644 --- a/package/kernel/kmod-sched-cake-oot/Makefile +++ b/package/kernel/kmod-sched-cake-oot/Makefile @@ -13,9 +13,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/dtaht/sch_cake.git -PKG_SOURCE_DATE:=2020-01-10 -PKG_SOURCE_VERSION:=aeff7a3e61ffa3159a8a95384d33e47a006211f4 -PKG_MIRROR_HASH:=3f634fdc05d30988abb4cae2f7fcb4bd55ff10b0b354ac16b8577e85a4b74f6f +PKG_SOURCE_DATE:=2020-07-24 +PKG_SOURCE_VERSION:=48979385757f3408c3427b3ebbf5963efdada5aa +PKG_MIRROR_HASH:=0e8ed53f55e28ad0c30f20293c16988876bae8d6f70f5629a43cf2ce1e49fc51 PKG_MAINTAINER:=Kevin Darbyshire-Bryant include $(INCLUDE_DIR)/package.mk From 114e5255c419cdba735cdaeeb9d592a0b5eeb9ed Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sat, 25 Jul 2020 16:07:59 +0100 Subject: [PATCH 02/31] procd: update to git HEAD 48777de rcS: cast format string to int64_t a4df90f jail: fix wrong format for 32-bit c482c5d jail: add support for referencing existing namespaces Signed-off-by: Daniel Golle --- package/system/procd/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/system/procd/Makefile b/package/system/procd/Makefile index b91b5cd623..a7531157de 100644 --- a/package/system/procd/Makefile +++ b/package/system/procd/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/procd.git -PKG_SOURCE_DATE:=2020-07-20 -PKG_SOURCE_VERSION:=66ae2d947ea463c53de1bf2ed5491c9926694f02 -PKG_MIRROR_HASH:=c66fb1d6f89c110b59cc53595754522272a9e62aaf1970a5aea34fe528ec3dcd +PKG_SOURCE_DATE:=2020-07-21 +PKG_SOURCE_VERSION:=c482c5de77f4adf53cdd55c7ef391264ac189359 +PKG_MIRROR_HASH:=a4ef6c99435be69f048bb182a08fdbb4730bb710e4190dc3dcaa16c69aeac1db CMAKE_INSTALL:=1 PKG_LICENSE:=GPL-2.0 From 98b60b3efafbb4de6b2cbabfeb2c6290db57aa05 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sat, 25 Jul 2020 16:54:40 +0100 Subject: [PATCH 03/31] procd: jail: fix build on glibc and uclibc Signed-off-by: Daniel Golle --- package/system/procd/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/system/procd/Makefile b/package/system/procd/Makefile index a7531157de..ab0783e85f 100644 --- a/package/system/procd/Makefile +++ b/package/system/procd/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/procd.git -PKG_SOURCE_DATE:=2020-07-21 -PKG_SOURCE_VERSION:=c482c5de77f4adf53cdd55c7ef391264ac189359 -PKG_MIRROR_HASH:=a4ef6c99435be69f048bb182a08fdbb4730bb710e4190dc3dcaa16c69aeac1db +PKG_SOURCE_DATE:=2020-07-25 +PKG_SOURCE_VERSION:=5cb3715a079c09d1e66a6455a246347c7cf7b998 +PKG_MIRROR_HASH:=ab4e79ba5d1180ce850c811d346de7275889ba4df6f82e373c416f30da89ad12 CMAKE_INSTALL:=1 PKG_LICENSE:=GPL-2.0 From 1e55df2e412f0b3f26ec49ed1d0580e84f1cc709 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Sat, 18 Jul 2020 14:22:54 +0200 Subject: [PATCH 04/31] oxnas: use vendor_model scheme for ox810se Most newer targets have been converted to consistently use vendor_model scheme for device definitions/image names, ox820 is using it as well, so let's just convert ox810se for consistency. While at it, use generic setup for DEVICE_DTS and add SUPPORTED_DEVICES. The latter have been introduced for ox820 already in cf7896117b3e ("oxnas: enable image metadata by setting SUPPORTED_DEVICES") Signed-off-by: Adrian Schmutzler --- target/linux/oxnas/image/ox810se.mk | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/target/linux/oxnas/image/ox810se.mk b/target/linux/oxnas/image/ox810se.mk index 37f2ebffb0..b9bb5e7117 100644 --- a/target/linux/oxnas/image/ox810se.mk +++ b/target/linux/oxnas/image/ox810se.mk @@ -6,15 +6,16 @@ define Device/Default KERNEL_INSTALL := 1 FILESYSTEMS := squashfs ext4 PROFILES := Default + SUPPORTED_DEVICES := $(subst _,$(comma),$(1)) + DEVICE_DTS := ox810se-$(subst _,-,$(1)) IMAGES := sysupgrade.tar IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata endef -define Device/wd-mbwe - DEVICE_DTS := ox810se-wd-mbwe +define Device/wd_mbwe DEVICE_VENDOR := Western Digital DEVICE_MODEL := My Book DEVICE_VARIANT := World Edition KERNEL := kernel-bin | append-dtb | uImage none endef -TARGET_DEVICES += wd-mbwe +TARGET_DEVICES += wd_mbwe From 92780d80ab6f5f03fac2407c06eb267dd83914a1 Mon Sep 17 00:00:00 2001 From: Davide Fioravanti Date: Thu, 16 Jul 2020 23:29:27 +0200 Subject: [PATCH 05/31] ramips: add support for Winstars WS-WN583A6 The Winstars WS-WN583A6 is a wireless repeater with 2 gigabit ethernet ports. Even if mine is branded as "Gemeita AC2100", the sticker on the back says WS-WN583A6. So I will refer to it as Winstars WS-WN583A6. Probably the real product name is the Wavlink WL-WN583A6 because of the many references to Wavlink in the OEM firmware and bootlog. Hardware -------- SoC: Mediatek MT7621AT (880 MHz, 2 cores 4 threads) RAM: 128MB FLASH: 8MB NOR (GigaDevice GD25Q64B) ETH: 2x 10/100/1000 Mbps Ethernet (MT7530) WIFI: - 2.4GHz: 1x MT7603E (2x2:2) - 5GHz: 1x MT7615E (4x4:4) - 6 internal antennas BTN: - 1x Reset button - 1x WPS button - 1x ON/OFF switch (working but unmodifiable) - 1x Auto/Schedule switch (working but unmodifiable. Read Note #3) LEDS: - 1x White led - 1x Red led - 1x Amber led - 1x Blue led - 2x Blue leds (lan and wan port status: working but unmodifiable) UART: - 57600-8-N-1 Everything works correctly. Currently there is no firmware update available. Because of this, in order to restore the OEM firmware, you must firstly dump the OEM firmware from your router before you flash the OpenWrt image. Backup the OEM Firmware ----------------------- The following steps are to be intended for users having little to none experience in linux. Obviously there are many ways to backup the OEM firmware, but probably this is the easiest way for this router. Procedure tested on M83A6.V5030.191210 firmware version. 1) Go to http://192.168.10.1/webcmd.shtml 2) Type the following line in the "Command" input box: mkdir /etc_ro/lighttpd/www/dev; for i in /dev/mtd*ro; do dd if=${i} of=/etc_ro/lighttpd/www${i}; done 3) Click "Apply" 4) After few seconds, in the textarea should appear this output: 16384+0 records in 16384+0 records out 8388608 bytes (8.0MB) copied, 4.038820 seconds, 2.0MB/s 384+0 records in 384+0 records out 196608 bytes (192.0KB) copied, 0.095180 seconds, 2.0MB/s 128+0 records in 128+0 records out 65536 bytes (64.0KB) copied, 0.032020 seconds, 2.0MB/s 128+0 records in 128+0 records out 65536 bytes (64.0KB) copied, 0.031760 seconds, 2.0MB/s 15744+0 records in 15744+0 records out 8060928 bytes (7.7MB) copied, 3.885280 seconds, 2.0MB/s dd: can't open '/dev/mtd5ro': No such device dd: can't open '/dev/mtd6ro': No such device dd: can't open '/dev/mtd7ro': No such device Excluding the "X.XXXXXX seconds" part, you should get the same exact output. If your output doesn't match mine, stop reading and ask for help in the forum. 5) Open the following links to download the partitions of the OEM FW: http://192.168.10.1/dev/mtd0ro http://192.168.10.1/dev/mtd1ro http://192.168.10.1/dev/mtd2ro http://192.168.10.1/dev/mtd3ro http://192.168.10.1/dev/mtd4ro If one (or more) of these files weight 0 byte, stop reading and ask for help in the forum. 6) Store these downloaded files in a safe place. 7) Reboot your router to remove any temporary file from your router. Installation ------------ Flash the initramfs image in the OEM firmware interface. When openwrt boots, flash the sysupgrade image otherwise you won't be able to keep configuration between reboots. Restore OEM Firmware -------------------- Flash the "mtd4ro" file you previously backed-up directly from LUCI. Warning: Remember to not keep settings! Warning2: Remember to force the flash. Notes ----- 1) The "System Command" page allows to run every command as root. For example you can use "dd" and "nc" to backup the OEM firmware. PC (SERVER): nc -l 5555 > ./mtdXro ROUTER (CLIENT): dd if=/dev/mtdXro | nc PC_IP_ADDRESS 5555 2) The OEM web interface accepts only images containing the string "WN583A6" in the filename. Currently the OEM interface accepts only the initramfs image probably because it checks if the ih_size in the image header is equal to the whole image size (instead of the kernel size) Read more here: https://forum.openwrt.org/t/support-for-strong-1200/22768/19 3) The white led (namely "Smart Night Light") can be controller by the user only if the side switch is set to "Schedule" otherwise it will be activated by the light condition (there is a photodiode on the top side of the router) 4) Router mac addresses: LAN XX:XX:XX:XX:XX:8F WAN XX:XX:XX:XX:XX:90 WIFI 2G XX:XX:XX:XX:XX:91 WIFI 5G XX:XX:XX:XX:XX:92 LABEL XX:XX:XX:XX:XX:91 Signed-off-by: Davide Fioravanti [remove chosen node, fix whitespace] Signed-off-by: Adrian Schmutzler --- .../ramips/dts/mt7621_winstars_ws-wn583a6.dts | 150 ++++++++++++++++++ target/linux/ramips/image/mt7621.mk | 12 ++ .../mt7621/base-files/etc/board.d/02_network | 4 +- 3 files changed, 165 insertions(+), 1 deletion(-) create mode 100644 target/linux/ramips/dts/mt7621_winstars_ws-wn583a6.dts diff --git a/target/linux/ramips/dts/mt7621_winstars_ws-wn583a6.dts b/target/linux/ramips/dts/mt7621_winstars_ws-wn583a6.dts new file mode 100644 index 0000000000..2897f42f1d --- /dev/null +++ b/target/linux/ramips/dts/mt7621_winstars_ws-wn583a6.dts @@ -0,0 +1,150 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "mt7621.dtsi" + +#include +#include + +/ { + compatible = "winstars,ws-wn583a6", "mediatek,mt7621-soc"; + model = "Winstars WS-WN583A6"; + + aliases { + led-boot = &led_status_red; + led-failsafe = &led_status_red; + led-running = &led_status_blue; + led-upgrade = &led_status_red; + }; + + leds { + compatible = "gpio-leds"; + + night_light_white { + label = "ws-wn583a6:white:night_light"; + gpios = <&gpio 15 GPIO_ACTIVE_HIGH>; + }; + + led_status_blue: status_blue { + label = "ws-wn583a6:blue:status"; + gpios = <&gpio 22 GPIO_ACTIVE_LOW>; + }; + + status_amber { + label = "ws-wn583a6:amber:status"; + gpios = <&gpio 24 GPIO_ACTIVE_LOW>; + }; + + led_status_red: status_red { + label = "ws-wn583a6:red:status"; + gpios = <&gpio 25 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <104000000>; + m25p,fast-read; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "config"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0x7b0000>; + }; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x0000>; + }; +}; + +&pcie1 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + }; +}; + +&gmac0 { + mtd-mac-address = <&factory 0xe000>; +}; + +&switch0 { + ports { + port@0 { + status = "okay"; + label = "wan"; + mtd-mac-address = <&factory 0xe006>; + }; + + port@1 { + status = "okay"; + label = "lan"; + }; + }; +}; + +&state_default { + gpio { + groups = "jtag", "wdt", "rgmii2"; + function = "gpio"; + }; +}; + +&xhci { + status = "disabled"; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 0315822c0b..6a9d49b32c 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -1020,6 +1020,18 @@ define Device/wevo_w2914ns-v2 endef TARGET_DEVICES += wevo_w2914ns-v2 +define Device/winstars_ws-wn583a6 + $(Device/uimage-lzma-loader) + IMAGE_SIZE := 7872k + DEVICE_VENDOR := Winstars + DEVICE_MODEL := WS-WN583A6 + DEVICE_ALT0_VENDOR := Gemeita + DEVICE_ALT0_MODEL := AC2100 + KERNEL_INITRAMFS_SUFFIX := -WN583A6$$(KERNEL_SUFFIX) + DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615e kmod-mt7615-firmware wpad-basic +endef +TARGET_DEVICES += winstars_ws-wn583a6 + define Device/xiaomi-ac2100 $(Device/uimage-lzma-loader) BLOCKSIZE := 128k diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network index 2d3db99b3d..b9f2740a1b 100755 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network @@ -9,7 +9,8 @@ ramips_setup_interfaces() local board="$1" case $board in - asiarf,ap7621-001) + asiarf,ap7621-001|\ + winstars,ws-wn583a6) ucidef_set_interfaces_lan_wan "lan" "wan" ;; asiarf,ap7621-nv1|\ @@ -113,6 +114,7 @@ ramips_setup_macs() wan_mac=$label_mac lan_mac=$(macaddr_add $label_mac 1) ;; + winstars,ws-wn583a6|\ zbtlink,zbt-we1326|\ zbtlink,zbt-wg3526-16m|\ zbtlink,zbt-wg3526-32m) From 8484d6da1e70d9058cfd2c646c8931d786160bb4 Mon Sep 17 00:00:00 2001 From: John Thomson Date: Sat, 13 Jun 2020 21:25:12 +1000 Subject: [PATCH 06/31] ramips: remove non-existant poe_passthrough for RouterBOARD 750Gr3 This 750gr3 GPIO17 switch was added based on vendor source, but only the 760iGS (which shares the rbsysfs board identifier) device has the physical wiring. The 750Gr3 actually does not support PoE out. Apart from that, note that the gpio base (480) would have required this GPIO to be referenced as 497 if it was kept. Fixes: 6ba58b7b020c ("ramips: cleanup the RB750Gr3 support") Signed-off-by: John Thomson [commit title/message facelift] Signed-off-by: Adrian Schmutzler --- .../ramips/mt7621/base-files/etc/board.d/03_gpio_switches | 3 --- 1 file changed, 3 deletions(-) diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/03_gpio_switches b/target/linux/ramips/mt7621/base-files/etc/board.d/03_gpio_switches index e24e04f1d8..7787ddcbc7 100755 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/03_gpio_switches +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/03_gpio_switches @@ -7,9 +7,6 @@ board_config_update board=$(board_name) case "$board" in -mikrotik,routerboard-750gr3) - ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "17" - ;; telco-electronics,x1) ucidef_add_gpio_switch "modem_reset" "Modem Reset" "16" ;; From ab78694fe88bf0d65952c13a53ea14e92eb7885f Mon Sep 17 00:00:00 2001 From: Sungbo Eo Date: Thu, 2 Jul 2020 22:33:18 +0900 Subject: [PATCH 07/31] treewide: rename POWER_ON_STRIP register AR8327 datasheet[1] calls the register at address 0x0010 "Power-on Strapping Register". As it has nothing to do with "strip", let's rename it to "POWER_ON_STRAP" to make it easier to grasp. [1] https://lafibre.info/images/doc/201106_spec_AR8327.pdf Signed-off-by: Sungbo Eo --- .../linux/ath79/dts/ar9344_compex_wpj344-16m.dts | 2 +- .../linux/ath79/dts/ar9344_tplink_tl-wdr4300.dtsi | 2 +- target/linux/ath79/dts/ar9344_wd_mynet-n750.dts | 2 +- .../ath79/dts/qca9558_comfast_cf-wr650ac.dtsi | 2 +- .../ath79/dts/qca9558_tplink_tl-wr1043nd.dtsi | 2 +- .../ath79/dts/qca9558_trendnet_tew-823dru.dts | 2 +- target/linux/ath79/dts/qca9558_zyxel_nbg6716.dts | 2 +- .../linux/ath79/dts/qca9563_dlink_dir-842-c.dtsi | 2 +- .../linux/ath79/dts/qca9563_dlink_dir-859-a1.dts | 2 +- target/linux/ath79/dts/qca9563_netgear_wndr.dtsi | 2 +- target/linux/ath79/dts/qca9563_phicomm_k2t.dts | 2 +- .../ath79/dts/qca9563_tplink_archer-x7-v5.dtsi | 2 +- target/linux/ath79/dts/qca9563_yuncore_xd4200.dtsi | 2 +- .../linux/generic/files/drivers/net/phy/ar8327.c | 14 +++++++------- .../linux/generic/files/drivers/net/phy/ar8327.h | 8 ++++---- .../files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts | 2 +- 16 files changed, 25 insertions(+), 25 deletions(-) diff --git a/target/linux/ath79/dts/ar9344_compex_wpj344-16m.dts b/target/linux/ath79/dts/ar9344_compex_wpj344-16m.dts index 09edeb5884..4ce280f869 100644 --- a/target/linux/ath79/dts/ar9344_compex_wpj344-16m.dts +++ b/target/linux/ath79/dts/ar9344_compex_wpj344-16m.dts @@ -131,7 +131,7 @@ qca,ar8327-initvals = < 0x04 0x07600000 /* PORT0 PAD MODE CTRL */ - 0x10 0x80000080 /* POWER_ON_STRIP */ + 0x10 0x80000080 /* POWER_ON_STRAP */ 0x50 0x00000000 /* LED_CTRL0 */ 0x54 0xc737c737 /* LED_CTRL1 */ 0x58 0x00000000 /* LED_CTRL2 */ diff --git a/target/linux/ath79/dts/ar9344_tplink_tl-wdr4300.dtsi b/target/linux/ath79/dts/ar9344_tplink_tl-wdr4300.dtsi index dc85075bcf..fd9f2b48ca 100644 --- a/target/linux/ath79/dts/ar9344_tplink_tl-wdr4300.dtsi +++ b/target/linux/ath79/dts/ar9344_tplink_tl-wdr4300.dtsi @@ -99,7 +99,7 @@ qca,ar8327-initvals = < 0x04 0x07600000 /* PORT0 PAD MODE CTRL */ - 0x10 0x80000080 /* POWER_ON_STRIP */ + 0x10 0x80000080 /* POWER_ON_STRAP */ 0x50 0xc737c737 /* LED_CTRL0 */ 0x54 0x00000000 /* LED_CTRL1 */ 0x58 0x00000000 /* LED_CTRL2 */ diff --git a/target/linux/ath79/dts/ar9344_wd_mynet-n750.dts b/target/linux/ath79/dts/ar9344_wd_mynet-n750.dts index 871928c0a9..18a52458a9 100644 --- a/target/linux/ath79/dts/ar9344_wd_mynet-n750.dts +++ b/target/linux/ath79/dts/ar9344_wd_mynet-n750.dts @@ -192,7 +192,7 @@ qca,ar8327-initvals = < 0x04 0x07600000 /* PORT0 PAD MODE CTRL */ - 0x10 0x80000080 /* POWER_ON_STRIP */ + 0x10 0x80000080 /* POWER_ON_STRAP */ 0x50 0xc737c737 /* LED_CTRL0 */ 0x54 0x00000000 /* LED_CTRL1 */ 0x58 0x00000000 /* LED_CTRL2 */ diff --git a/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac.dtsi b/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac.dtsi index 1a93a023af..59926ef44a 100644 --- a/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac.dtsi +++ b/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac.dtsi @@ -51,7 +51,7 @@ qca,ar8327-initvals = < 0x04 0x87600000 /* PORT0 PAD MODE CTRL */ 0x0c 0x00080080 /* PORT6 PAD MODE CTRL */ - 0x10 0x81000080 /* POWER_ON_STRIP */ + 0x10 0x81000080 /* POWER_ON_STRAP */ 0x7c 0x0000007e /* PORT0_STATUS */ 0x94 0x0000007e /* PORT6 STATUS */ >; diff --git a/target/linux/ath79/dts/qca9558_tplink_tl-wr1043nd.dtsi b/target/linux/ath79/dts/qca9558_tplink_tl-wr1043nd.dtsi index 161f8ccb0a..9c5e2c7d53 100644 --- a/target/linux/ath79/dts/qca9558_tplink_tl-wr1043nd.dtsi +++ b/target/linux/ath79/dts/qca9558_tplink_tl-wr1043nd.dtsi @@ -134,7 +134,7 @@ qca,ar8327-initvals = < 0x04 0x00080080 /* PORT0 PAD MODE CTRL */ 0x0c 0x07600000 /* PORT6 PAD MODE CTRL */ - 0x10 0x81000080 /* POWER_ON_STRIP */ + 0x10 0x81000080 /* POWER_ON_STRAP */ 0x50 0xcc35cc35 /* LED_CTRL0 */ 0x54 0xca35ca35 /* LED_CTRL1 */ 0x58 0xc935c935 /* LED_CTRL2 */ diff --git a/target/linux/ath79/dts/qca9558_trendnet_tew-823dru.dts b/target/linux/ath79/dts/qca9558_trendnet_tew-823dru.dts index 3cafda1d3e..6e7faf5983 100644 --- a/target/linux/ath79/dts/qca9558_trendnet_tew-823dru.dts +++ b/target/linux/ath79/dts/qca9558_trendnet_tew-823dru.dts @@ -170,7 +170,7 @@ qca,ar8327-initvals = < 0x04 0x00080080 /* PORT0 PAD MODE CTRL */ 0x0c 0x07600000 /* PORT6 PAD MODE CTRL */ - 0x10 0x81000080 /* POWER_ON_STRIP */ + 0x10 0x81000080 /* POWER_ON_STRAP */ 0x7c 0x0000007e /* PORT0_STATUS */ 0x94 0x0000007e /* PORT6 STATUS */ >; diff --git a/target/linux/ath79/dts/qca9558_zyxel_nbg6716.dts b/target/linux/ath79/dts/qca9558_zyxel_nbg6716.dts index aa33eed164..2249263522 100644 --- a/target/linux/ath79/dts/qca9558_zyxel_nbg6716.dts +++ b/target/linux/ath79/dts/qca9558_zyxel_nbg6716.dts @@ -210,7 +210,7 @@ qca,ar8327-initvals = < 0x04 0x87600000 /* PORT0 PAD MODE CTRL */ 0x0c 0x00080080 /* PORT6 PAD MODE CTRL */ - 0x10 0x81000080 /* POWER_ON_STRIP */ + 0x10 0x81000080 /* POWER_ON_STRAP */ 0x50 0xffb7ffb7 /* LED_CTRL0 */ 0x54 0xffb7ffb7 /* LED_CTRL1 */ 0x58 0xffb7ffb7 /* LED_CTRL2 */ diff --git a/target/linux/ath79/dts/qca9563_dlink_dir-842-c.dtsi b/target/linux/ath79/dts/qca9563_dlink_dir-842-c.dtsi index 5e2c614dfc..0d8063de35 100644 --- a/target/linux/ath79/dts/qca9563_dlink_dir-842-c.dtsi +++ b/target/linux/ath79/dts/qca9563_dlink_dir-842-c.dtsi @@ -109,7 +109,7 @@ qca,ar8327-initvals = < 0x04 0x00080080 /* PORT0 PAD MODE CTRL */ - 0x10 0x81000080 /* POWER_ON_STRIP */ + 0x10 0x81000080 /* POWER_ON_STRAP */ 0x50 0xcc35cc35 /* LED_CTRL0 */ 0x54 0xcb37cb37 /* LED_CTRL1 */ 0x58 0x00000000 /* LED_CTRL2 */ diff --git a/target/linux/ath79/dts/qca9563_dlink_dir-859-a1.dts b/target/linux/ath79/dts/qca9563_dlink_dir-859-a1.dts index 4b328c5cf3..25580b1c99 100644 --- a/target/linux/ath79/dts/qca9563_dlink_dir-859-a1.dts +++ b/target/linux/ath79/dts/qca9563_dlink_dir-859-a1.dts @@ -144,7 +144,7 @@ qca,ar8327-initvals = < 0x04 0x00080080 /* PORT0 PAD MODE CTRL */ - 0x10 0x81000080 /* POWER_ON_STRIP */ + 0x10 0x81000080 /* POWER_ON_STRAP */ 0x50 0xcc35cc35 /* LED_CTRL0 */ 0x54 0xcb37cb37 /* LED_CTRL1 */ 0x58 0x00000000 /* LED_CTRL2 */ diff --git a/target/linux/ath79/dts/qca9563_netgear_wndr.dtsi b/target/linux/ath79/dts/qca9563_netgear_wndr.dtsi index 2c0b0b0d71..111d073aa6 100644 --- a/target/linux/ath79/dts/qca9563_netgear_wndr.dtsi +++ b/target/linux/ath79/dts/qca9563_netgear_wndr.dtsi @@ -187,7 +187,7 @@ qca,ar8327-initvals = < 0x04 0x00000080 /* PORT0 PAD MODE CTRL */ - 0x10 0x81000080 /* POWER_ON_STRIP */ + 0x10 0x81000080 /* POWER_ON_STRAP */ 0x50 0xcc35cc35 /* LED_CTRL0 */ 0x54 0xcb37cb37 /* LED_CTRL1 */ 0x58 0x00000000 /* LED_CTRL2 */ diff --git a/target/linux/ath79/dts/qca9563_phicomm_k2t.dts b/target/linux/ath79/dts/qca9563_phicomm_k2t.dts index ba185c568b..802641bbc2 100644 --- a/target/linux/ath79/dts/qca9563_phicomm_k2t.dts +++ b/target/linux/ath79/dts/qca9563_phicomm_k2t.dts @@ -114,7 +114,7 @@ qca,ar8327-initvals = < 0x04 0x00080080 /* PORT0 PAD MODE CTRL */ - 0x10 0x81000080 /* POWER_ON_STRIP */ + 0x10 0x81000080 /* POWER_ON_STRAP */ 0x50 0xcc35cc35 /* LED_CTRL0 */ 0x54 0xcb37cb37 /* LED_CTRL1 */ 0x58 0x00000000 /* LED_CTRL2 */ diff --git a/target/linux/ath79/dts/qca9563_tplink_archer-x7-v5.dtsi b/target/linux/ath79/dts/qca9563_tplink_archer-x7-v5.dtsi index 44bcc1e538..633543e739 100644 --- a/target/linux/ath79/dts/qca9563_tplink_archer-x7-v5.dtsi +++ b/target/linux/ath79/dts/qca9563_tplink_archer-x7-v5.dtsi @@ -155,7 +155,7 @@ 0x04 0x80080080 /* PORT0 PAD MODE CTRL */ 0x08 0x00000000 /* PORT5 PAD MODE CTRL */ 0x0c 0x00000000 /* PORT6 PAD MODE CTRL */ - 0x10 0x00000080 /* POWER_ON_STRIP */ + 0x10 0x00000080 /* POWER_ON_STRAP */ 0x7c 0x0000007e /* PORT0_STATUS */ 0x94 0x00000200 /* PORT6_STATUS */ >; diff --git a/target/linux/ath79/dts/qca9563_yuncore_xd4200.dtsi b/target/linux/ath79/dts/qca9563_yuncore_xd4200.dtsi index c80aec409e..81aa8dc935 100644 --- a/target/linux/ath79/dts/qca9563_yuncore_xd4200.dtsi +++ b/target/linux/ath79/dts/qca9563_yuncore_xd4200.dtsi @@ -42,7 +42,7 @@ qca,ar8327-initvals = < 0x04 0x00080080 /* PORT0 PAD MODE CTRL */ - 0x10 0x81000080 /* POWER_ON_STRIP */ + 0x10 0x81000080 /* POWER_ON_STRAP */ 0x50 0xcf37cf37 /* LED_CTRL0 */ 0x54 0xcf37cf37 /* LED_CTRL1 */ 0x58 0xcf37cf37 /* LED_CTRL2 */ diff --git a/target/linux/generic/files/drivers/net/phy/ar8327.c b/target/linux/generic/files/drivers/net/phy/ar8327.c index 4cbfa4d234..dce52ce0e4 100644 --- a/target/linux/generic/files/drivers/net/phy/ar8327.c +++ b/target/linux/generic/files/drivers/net/phy/ar8327.c @@ -553,15 +553,15 @@ ar8327_hw_config_pdata(struct ar8xxx_priv *priv, t = ar8327_get_pad_cfg(pdata->pad6_cfg); ar8xxx_write(priv, AR8327_REG_PAD6_MODE, t); - pos = ar8xxx_read(priv, AR8327_REG_POWER_ON_STRIP); + pos = ar8xxx_read(priv, AR8327_REG_POWER_ON_STRAP); new_pos = pos; led_cfg = pdata->led_cfg; if (led_cfg) { if (led_cfg->open_drain) - new_pos |= AR8327_POWER_ON_STRIP_LED_OPEN_EN; + new_pos |= AR8327_POWER_ON_STRAP_LED_OPEN_EN; else - new_pos &= ~AR8327_POWER_ON_STRIP_LED_OPEN_EN; + new_pos &= ~AR8327_POWER_ON_STRAP_LED_OPEN_EN; ar8xxx_write(priv, AR8327_REG_LED_CTRL0, led_cfg->led_ctrl0); ar8xxx_write(priv, AR8327_REG_LED_CTRL1, led_cfg->led_ctrl1); @@ -569,7 +569,7 @@ ar8327_hw_config_pdata(struct ar8xxx_priv *priv, ar8xxx_write(priv, AR8327_REG_LED_CTRL3, led_cfg->led_ctrl3); if (new_pos != pos) - new_pos |= AR8327_POWER_ON_STRIP_POWER_ON_SEL; + new_pos |= AR8327_POWER_ON_STRAP_POWER_ON_SEL; } if (pdata->sgmii_cfg) { @@ -586,12 +586,12 @@ ar8327_hw_config_pdata(struct ar8xxx_priv *priv, ar8xxx_write(priv, AR8327_REG_SGMII_CTRL, t); if (pdata->sgmii_cfg->serdes_aen) - new_pos &= ~AR8327_POWER_ON_STRIP_SERDES_AEN; + new_pos &= ~AR8327_POWER_ON_STRAP_SERDES_AEN; else - new_pos |= AR8327_POWER_ON_STRIP_SERDES_AEN; + new_pos |= AR8327_POWER_ON_STRAP_SERDES_AEN; } - ar8xxx_write(priv, AR8327_REG_POWER_ON_STRIP, new_pos); + ar8xxx_write(priv, AR8327_REG_POWER_ON_STRAP, new_pos); if (pdata->leds && pdata->num_leds) { int i; diff --git a/target/linux/generic/files/drivers/net/phy/ar8327.h b/target/linux/generic/files/drivers/net/phy/ar8327.h index a59d306d6f..088b288618 100644 --- a/target/linux/generic/files/drivers/net/phy/ar8327.h +++ b/target/linux/generic/files/drivers/net/phy/ar8327.h @@ -53,10 +53,10 @@ #define AR8327_PAD_RGMII_TXCLK_DELAY_EN BIT(25) #define AR8327_PAD_RGMII_EN BIT(26) -#define AR8327_REG_POWER_ON_STRIP 0x010 -#define AR8327_POWER_ON_STRIP_POWER_ON_SEL BIT(31) -#define AR8327_POWER_ON_STRIP_LED_OPEN_EN BIT(24) -#define AR8327_POWER_ON_STRIP_SERDES_AEN BIT(7) +#define AR8327_REG_POWER_ON_STRAP 0x010 +#define AR8327_POWER_ON_STRAP_POWER_ON_SEL BIT(31) +#define AR8327_POWER_ON_STRAP_LED_OPEN_EN BIT(24) +#define AR8327_POWER_ON_STRAP_SERDES_AEN BIT(7) #define AR8327_REG_INT_STATUS0 0x020 #define AR8327_INT0_VT_DONE BIT(20) diff --git a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts index 0998a4933a..29b49a9357 100644 --- a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts +++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts @@ -97,7 +97,7 @@ 0x00004 0x07600000 /* PAD0_MODE */ 0x00008 0x00000000 /* PAD5_MODE */ 0x0000c 0x01000000 /* PAD6_MODE */ - 0x00010 0x40000000 /* POWER_ON_STRIP */ + 0x00010 0x40000000 /* POWER_ON_STRAP */ 0x00050 0xcf35cf35 /* LED_CTRL0 */ 0x00054 0xcf35cf35 /* LED_CTRL1 */ 0x00058 0xcf35cf35 /* LED_CTRL2 */ From d38d345c72e9783361a413411a3814f7d096fc7b Mon Sep 17 00:00:00 2001 From: Bjoern Dobe Date: Fri, 24 Jul 2020 08:48:39 +0200 Subject: [PATCH 08/31] ath79: mikrotik: use base mac on lan for RBwAPG-5HacT2HnD The Mikrotik RBwAPG-5HacT2HnD has only a single ethernet interface (lan), and the vendor uses the base (label) MAC address for it. Signed-off-by: Bjoern Dobe [commit title/message improvement] Signed-off-by: Adrian Schmutzler --- target/linux/ath79/mikrotik/base-files/etc/board.d/02_network | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network b/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network index 96e0f5610a..5d87e88beb 100755 --- a/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network +++ b/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network @@ -34,6 +34,10 @@ ath79_setup_macs() local mac_base="$(cat /sys/firmware/mikrotik/hard_config/mac_base)" case "$board" in + mikrotik,routerboard-wap-g-5hact2hnd) + label_mac="$mac_base" + lan_mac="$mac_base" + ;; *) label_mac="$mac_base" wan_mac="$mac_base" From a956c14d6aa49973b713120cede96bee41f2cd25 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Sat, 25 Jul 2020 11:26:11 +0200 Subject: [PATCH 09/31] mac80211: util: don't warn on missing sband iftype data The kernel currently floods the ringbuffer with warnings when adding a mesh interface for a device not support HE 6GHz modes. Return without warning in this case, as mesh_add_he_6ghz_cap_ie calls ieee80211_ie_build_he_6ghz_cap regardless of the supported interface modes. Signed-off-by: David Bauer --- ...n-t-warn-on-missing-sband-iftype-dat.patch | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 package/kernel/mac80211/patches/subsys/600-mac80211-util-don-t-warn-on-missing-sband-iftype-dat.patch diff --git a/package/kernel/mac80211/patches/subsys/600-mac80211-util-don-t-warn-on-missing-sband-iftype-dat.patch b/package/kernel/mac80211/patches/subsys/600-mac80211-util-don-t-warn-on-missing-sband-iftype-dat.patch new file mode 100644 index 0000000000..65689c0717 --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/600-mac80211-util-don-t-warn-on-missing-sband-iftype-dat.patch @@ -0,0 +1,28 @@ +From db6d1e942f5a2828e1245e16ceb997f537a2d1a4 Mon Sep 17 00:00:00 2001 +From: David Bauer +Date: Sat, 25 Jul 2020 01:43:26 +0200 +Subject: [PATCH] mac80211: util: don't warn on missing sband iftype data + +The kernel currently floods the ringbuffer with warnings when adding a +mesh interface for a device not support HE 6GHz modes. + +Return without warning in this case, as mesh_add_he_6ghz_cap_ie calls +ieee80211_ie_build_he_6ghz_cap regardless of the supported interface +modes. + +Signed-off-by: David Bauer +--- + net/mac80211/util.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/net/mac80211/util.c ++++ b/net/mac80211/util.c +@@ -2875,7 +2875,7 @@ void ieee80211_ie_build_he_6ghz_cap(stru + return; + + iftd = ieee80211_get_sband_iftype_data(sband, iftype); +- if (WARN_ON(!iftd)) ++ if (!iftd) + return; + + cap = le16_to_cpu(iftd->he_6ghz_capa.capa); From 739d282c2fc83906c1cd75d01e86fc2ab8dd625c Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Tue, 21 Jul 2020 17:28:54 +0200 Subject: [PATCH 10/31] mediatek: remove condition in Device/Default The current condition with part of the variables set dependent on the subtarget in Device/Default isn't really nice to read and also defeats the purpose of having a default node. This removes the special settings for mt7623 and moves them to the individual devices, which is not much of a problem as there are actually just two of them and they partly use different settings anyway. While at it, slightly adjust the order of variables and wrap some long lines. Signed-off-by: Adrian Schmutzler --- target/linux/mediatek/image/Makefile | 18 +++++++----------- target/linux/mediatek/image/mt7623.mk | 14 +++++++++----- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/target/linux/mediatek/image/Makefile b/target/linux/mediatek/image/Makefile index db702509ed..724bf430ef 100644 --- a/target/linux/mediatek/image/Makefile +++ b/target/linux/mediatek/image/Makefile @@ -21,21 +21,17 @@ endef # default all platform image(fit) build define Device/Default PROFILES = Default $$(DEVICE_NAME) - KERNEL_NAME := zImage + KERNEL_NAME := Image + 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 FILESYSTEMS := squashfs DEVICE_DTS_DIR := $(DTS_DIR) IMAGES := sysupgrade.bin - IMAGE/sysupgrade.bin := append-kernel | pad-to 128k | append-rootfs | pad-rootfs | append-metadata + IMAGE/sysupgrade.bin := append-kernel | pad-to 128k | append-rootfs | \ + pad-rootfs | append-metadata SUPPORTED_DEVICES := $(subst _,$(comma),$(1)) -ifeq ($(SUBTARGET),mt7623) - KERNEL_NAME := zImage - KERNEL := kernel-bin | append-dtb | uImage none - KERNEL_INITRAMFS := kernel-bin | append-dtb | uImage none -else - KERNEL_NAME := Image - 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 -endif endef include $(SUBTARGET).mk diff --git a/target/linux/mediatek/image/mt7623.mk b/target/linux/mediatek/image/mt7623.mk index 1c2dcf7624..bdd3820ed3 100644 --- a/target/linux/mediatek/image/mt7623.mk +++ b/target/linux/mediatek/image/mt7623.mk @@ -29,14 +29,15 @@ define Device/bpi_bananapi-r2 DEVICE_VENDOR := Bpi DEVICE_MODEL := Banana Pi R2 DEVICE_DTS := mt7623n-bananapi-bpi-r2 - SUPPORTED_DEVICES := bananapi,bpi-r2 + KERNEL_NAME := zImage + KERNEL := kernel-bin | fit none $$(DTS_DIR)/$$(DEVICE_DTS).dtb + KERNEL_INITRAMFS := DEVICE_PACKAGES := kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1 kmod-mmc \ mkf2fs e2fsprogs kmod-usb-ohci kmod-usb2 kmod-usb3 kmod-ata-ahci-mtk UBOOT_TARGET := mt7623n_bpir2 IMAGES := img.gz IMAGE/img.gz := banana-pi-sdcard | gzip | append-metadata - KERNEL := kernel-bin | fit none $$(DTS_DIR)/$$(DEVICE_DTS).dtb - KERNEL_INITRAMFS := + SUPPORTED_DEVICES := bananapi,bpi-r2 endef TARGET_DEVICES += bpi_bananapi-r2 @@ -45,9 +46,12 @@ define Device/unielec_u7623-02-emmc-512m DEVICE_MODEL := U7623-02 DEVICE_VARIANT := eMMC/512MB RAM DEVICE_DTS := mt7623a-unielec-u7623-02-emmc-512m - IMAGES := sysupgrade-emmc.bin.gz - IMAGE/sysupgrade-emmc.bin.gz := sysupgrade-emmc | gzip | append-metadata + KERNEL_NAME := zImage + KERNEL := kernel-bin | append-dtb | uImage none + KERNEL_INITRAMFS := kernel-bin | append-dtb | uImage none DEVICE_PACKAGES := kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1 kmod-mmc \ mkf2fs e2fsprogs kmod-usb-ohci kmod-usb2 kmod-usb3 kmod-ata-ahci-mtk + IMAGES := sysupgrade-emmc.bin.gz + IMAGE/sysupgrade-emmc.bin.gz := sysupgrade-emmc | gzip | append-metadata endef TARGET_DEVICES += unielec_u7623-02-emmc-512m From f8ea7c53fd227a9c21f0ca45a2c3345312ea54b5 Mon Sep 17 00:00:00 2001 From: Aleksander Jan Bajkowski Date: Sat, 27 Jun 2020 13:41:54 +0200 Subject: [PATCH 11/31] lantiq: xrx200: disable unused switch and phy xrx200 has a 6 port built-in switch with 2 integrated PHY. None of the xrx200 router uses external switch. Most boards use integrated or Lantiq (Intel) PEF7071 PHY. Only some FritzBox routers use AT803X PHY and VGV7510KW22 use ICPLUS PHY. Other unused PHY drivers may be removed. This patch enables these symbols only on xway and xway_legacy subtargets: - CONFIG_PSB6970_PHY (Driver for PHY in PSB6970 - 7 port FE Switch) - CONFIG_RTL8366RB_PHY (Driver for PHY in RTL8366 - 6 port GE Switch) - CONFIG_RTL8366_SMI (Driver for RTL8366 - 6 port GE Switch) Reduces image size by 7.3kB. Continuation of 58a6f06978f8 (PR: #2983) Signed-off-by: Aleksander Jan Bajkowski [fix sorting in config files, small fix in commit message] Signed-off-by: Adrian Schmutzler --- target/linux/lantiq/ase/config-5.4 | 2 -- target/linux/lantiq/config-5.4 | 3 --- target/linux/lantiq/falcon/config-5.4 | 2 -- target/linux/lantiq/xway/config-5.4 | 3 +++ target/linux/lantiq/xway_legacy/config-5.4 | 3 +++ 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/target/linux/lantiq/ase/config-5.4 b/target/linux/lantiq/ase/config-5.4 index 9b6dd41a14..01f6799b32 100644 --- a/target/linux/lantiq/ase/config-5.4 +++ b/target/linux/lantiq/ase/config-5.4 @@ -14,8 +14,6 @@ CONFIG_GPIO_GENERIC_PLATFORM=y CONFIG_LANTIQ_ETOP=y CONFIG_LEDS_TRIGGER_HEARTBEAT=y CONFIG_NLS=y -# CONFIG_PSB6970_PHY is not set -# CONFIG_RTL8366_SMI is not set CONFIG_SGL_ALLOC=y CONFIG_SOC_AMAZON_SE=y # CONFIG_SOC_XWAY is not set diff --git a/target/linux/lantiq/config-5.4 b/target/linux/lantiq/config-5.4 index 6f3b193cc7..a1c259b002 100644 --- a/target/linux/lantiq/config-5.4 +++ b/target/linux/lantiq/config-5.4 @@ -194,13 +194,10 @@ CONFIG_PINCTRL_LANTIQ=y CONFIG_PINCTRL_XWAY=y CONFIG_POWER_RESET=y CONFIG_POWER_RESET_SYSCON=y -CONFIG_PSB6970_PHY=y CONFIG_REGMAP=y CONFIG_REGMAP_MMIO=y CONFIG_RESET_CONTROLLER=y CONFIG_RESET_LANTIQ=y -CONFIG_RTL8366RB_PHY=y -CONFIG_RTL8366_SMI=y # CONFIG_SERIAL_8250 is not set CONFIG_SERIAL_LANTIQ=y # CONFIG_SOC_AMAZON_SE is not set diff --git a/target/linux/lantiq/falcon/config-5.4 b/target/linux/lantiq/falcon/config-5.4 index a6d9e944f0..0dc0cc4e39 100644 --- a/target/linux/lantiq/falcon/config-5.4 +++ b/target/linux/lantiq/falcon/config-5.4 @@ -4,8 +4,6 @@ CONFIG_MTD_NAND_ECC_SW_HAMMING=y CONFIG_MTD_RAW_NAND=y CONFIG_MTD_SPLIT_FIRMWARE_NAME="linux" CONFIG_PINCTRL_FALCON=y -# CONFIG_PSB6970_PHY is not set -# CONFIG_RTL8366_SMI is not set CONFIG_SOC_FALCON=y # CONFIG_SOC_XWAY is not set CONFIG_SPI_FALCON=y diff --git a/target/linux/lantiq/xway/config-5.4 b/target/linux/lantiq/xway/config-5.4 index b0ce4a9043..89b96d3863 100644 --- a/target/linux/lantiq/xway/config-5.4 +++ b/target/linux/lantiq/xway/config-5.4 @@ -29,10 +29,13 @@ CONFIG_PCI=y # CONFIG_PCIE_LANTIQ is not set CONFIG_PCI_DOMAINS=y CONFIG_PCI_LANTIQ=y +CONFIG_PSB6970_PHY=y CONFIG_REGULATOR=y CONFIG_REGULATOR_FIXED_VOLTAGE=y CONFIG_RTL8306_PHY=y +CONFIG_RTL8366RB_PHY=y CONFIG_RTL8366S_PHY=y +CONFIG_RTL8366_SMI=y CONFIG_RTL8367B_PHY=y CONFIG_RTL8367_PHY=y CONFIG_SGL_ALLOC=y diff --git a/target/linux/lantiq/xway_legacy/config-5.4 b/target/linux/lantiq/xway_legacy/config-5.4 index 2ce37051de..91dbebbe9d 100644 --- a/target/linux/lantiq/xway_legacy/config-5.4 +++ b/target/linux/lantiq/xway_legacy/config-5.4 @@ -22,10 +22,13 @@ CONFIG_PCI=y # CONFIG_PCIE_LANTIQ is not set CONFIG_PCI_DOMAINS=y CONFIG_PCI_LANTIQ=y +CONFIG_PSB6970_PHY=y CONFIG_REGULATOR=y CONFIG_REGULATOR_FIXED_VOLTAGE=y CONFIG_RTL8306_PHY=y +CONFIG_RTL8366RB_PHY=y CONFIG_RTL8366S_PHY=y +CONFIG_RTL8366_SMI=y CONFIG_RTL8367B_PHY=y CONFIG_RTL8367_PHY=y CONFIG_SGL_ALLOC=y From 15f585afc5b66f5addb6667001c303b5fd502ce5 Mon Sep 17 00:00:00 2001 From: "Leon M. George" Date: Fri, 26 Jul 2019 20:34:01 +0200 Subject: [PATCH 12/31] ath79: add support for Compex WPJ563 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Specifications: SoC: QCA9563 DRAM: 128MB DDR2 Flash: 16MB SPI-NOR 2 Gigabit ethernet ports 3×3 2.4GHz on-board radio miniPCIe slot that supports 5GHz radio PoE 24V passive or 36V-56V passive with optional IEEE 802.3af/at USB 3.0 header Installation: To install, either start tftp in bin/targets/ath79/generic/ and use the u-boot prompt over UART: tftpboot 0x80500000 openwrt-ath79-generic-compex_wpj563-squashfs-sysupgrade.bin erase 0x9f680000 +1 erase 0x9f030000 +$filesize cp.b $fileaddr 0x9f030000 $filesize boot The cpximg file can be used with sysupgrade in the stock firmware (add SSH key in luci for root access) or with the built-in cpximg loader. The cpximg loader can be started either by holding the reset button during power up or by entering the u-boot prompt and entering 'cpximg'. Once it's running, a TFTP-server under 192.168.1.1 will accept the image appropriate for the board revision that is etched on the board. For example, if the board is labelled '7A02': tftp -v -m binary 192.168.1.1 -c put openwrt-ath79-generic-compex_wpj563-squashfs-cpximg-7a02.bin MAC addresses: <&uboot 0x2e010> *:71 (label) <&uboot 0x2e018> *:72 <&uboot 0x2e020> *:73 <&uboot 0x2e028> *:74 Only the first two are used (for ethernet), the WiFi modules have separate (valid) addresses. The latter two addresses are not used. Signed-off-by: Leon M. George --- .../linux/ath79/dts/qca9563_compex_wpj563.dts | 145 ++++++++++++++++++ .../generic/base-files/etc/board.d/02_network | 6 +- target/linux/ath79/image/generic.mk | 12 ++ 3 files changed, 161 insertions(+), 2 deletions(-) create mode 100644 target/linux/ath79/dts/qca9563_compex_wpj563.dts diff --git a/target/linux/ath79/dts/qca9563_compex_wpj563.dts b/target/linux/ath79/dts/qca9563_compex_wpj563.dts new file mode 100644 index 0000000000..ae9dd5c460 --- /dev/null +++ b/target/linux/ath79/dts/qca9563_compex_wpj563.dts @@ -0,0 +1,145 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "qca956x.dtsi" + +/ { + model = "Compex WPJ563"; + compatible = "compex,wpj563", "qca,qca9563"; + + aliases { + label-mac-device = ð0; + led-boot = &led_sig4; + led-failsafe = &led_sig4; + led-running = &led_sig4; + led-upgrade = &led_sig4; + }; + + beeper { + compatible = "gpio-beeper"; + gpios = <&gpio 19 GPIO_ACTIVE_HIGH>; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + leds { + compatible = "gpio-leds"; + + sig1 { + label = "wpj563:green:sig1"; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + }; + + sig2 { + label = "wpj563:green:sig2"; + gpios = <&gpio 5 GPIO_ACTIVE_LOW>; + }; + + sig3 { + label = "wpj563:green:sig4"; + gpios = <&gpio 6 GPIO_ACTIVE_LOW>; + }; + + led_sig4: sig4 { + label = "wpj563:green:sig4"; + gpios = <&gpio 7 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&spi { + status = "okay"; + + num-cs = <1>; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + uboot: partition@0 { + label = "u-boot"; + reg = <0x000000 0x030000>; + read-only; + }; + + partition@30000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x030000 0xfc0000>; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; + +&mdio0 { + status = "okay"; + + phy-mask = <0>; + + phy0: ethernet-phy@0 { + reg = <0>; + phy-mode = "sgmii"; + qca,mib-poll-interval = <500>; + + qca,ar8327-initvals = < + 0x04 0x00080080 /* PORT0 PAD MODE CTRL */ + 0x7c 0x0000007e /* PORT0_STATUS */ + >; + }; +}; + +ð0 { + status = "okay"; + + pll-data = <0x03000101 0x00000101 0x00001919>; + + mtd-mac-address = <&uboot 0x2e010>; + phy-mode = "sgmii"; + phy-handle = <&phy0>; +}; + +&usb_phy0 { + status = "okay"; +}; + +&usb0 { + status = "okay"; +}; + +&uart { + status = "okay"; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; +}; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index e301b6f616..d99e2ed0eb 100755 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -135,7 +135,8 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "6@eth1" ;; - compex,wpj344-16m) + compex,wpj344-16m|\ + compex,wpj563) ucidef_add_switch "switch0" \ "0@eth0" "3:lan" "2:wan" ;; @@ -383,7 +384,8 @@ ath79_setup_macs() lan_mac=$(fritz_tffs -n maca -i $(find_mtd_part "tffs (1)")) wan_mac=$(fritz_tffs -n macb -i $(find_mtd_part "tffs (1)")) ;; - compex,wpj344-16m) + compex,wpj344-16m|\ + compex,wpj563) wan_mac=$(mtd_get_mac_binary u-boot 0x2e018) ;; devolo,magic-2-wifi) diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 8dc16983e1..adc7772c0e 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -502,6 +502,18 @@ define Device/compex_wpj531-16m endef TARGET_DEVICES += compex_wpj531-16m +define Device/compex_wpj563 + SOC := qca9563 + DEVICE_PACKAGES := kmod-usb2 kmod-usb3 + IMAGE_SIZE := 16128k + DEVICE_VENDOR := Compex + DEVICE_MODEL := WPJ563 + SUPPORTED_DEVICES += wpj563 + IMAGES += cpximg-7a02.bin + IMAGE/cpximg-7a02.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | mkmylofw_16m 0x694 2 +endef +TARGET_DEVICES += compex_wpj563 + define Device/devolo_dvl1200e SOC := qca9558 DEVICE_VENDOR := devolo From ea9ef8c9451a08aa4dbb6efcbe5f20d9b788ebd2 Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Mon, 20 Jul 2020 21:00:29 +0100 Subject: [PATCH 13/31] mediatek: mt7623: add explicit console= to U7623 kernel The bootloader for legacy builds can't set it, so we end up unable to log in on the serial port. Signed-off-by: David Woodhouse --- .../patches-5.4/0227-arm-dts-Add-Unielec-U7623-DTS.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/mediatek/patches-5.4/0227-arm-dts-Add-Unielec-U7623-DTS.patch b/target/linux/mediatek/patches-5.4/0227-arm-dts-Add-Unielec-U7623-DTS.patch index 255445360f..d1ea20c0ff 100644 --- a/target/linux/mediatek/patches-5.4/0227-arm-dts-Add-Unielec-U7623-DTS.patch +++ b/target/linux/mediatek/patches-5.4/0227-arm-dts-Add-Unielec-U7623-DTS.patch @@ -63,7 +63,7 @@ Subject: [PATCH] arm: dts: Add Unielec U7623 DTS + }; + + chosen { -+ bootargs = "root=/dev/mmcblk0p2 rootfstype=squashfs,f2fs"; ++ bootargs = "root=/dev/mmcblk0p2 rootfstype=squashfs,f2fs console=ttyS0,115200"; + stdout-path = "serial2:115200n8"; + }; + From 6eb63019afef89404899f2cb65fb4c16e00aa0ed Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Tue, 21 Jul 2020 09:53:32 +0100 Subject: [PATCH 14/31] mediatek: mt7623: fix sysupgrade from vendor OpenWrt on UniElec U7623 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This board ships with an ancient 14.07-based OpenWrt using block2mtd, and the MBR partition table contains nonsense. It is possible to sysupgrade to an upstream OpenWrt image, but the legacy layout of the OpenWrt images start at 0xA00 in the eMMC, with a raw uImage. The legacy OpenWrt image doesn't "own" the beginning of the device, including the MBR and U-Boot. This means that when a user upgrades to upstream OpenWrt, it doesn't boot because it can't find the right partitions. So hard-code them on the kernel's command line using CONFIG_CMDLINE_PARTITION (for block). Additionally, the vendor firmware doesn't cope with images larger than about 36MiB, because it only overwrites the contents of its "firmware" MTD partition. The current layout of the legacy image wastes a lot of space, allowing over 32MiB for the kernel and another 10MiB for the FAT recovery file system which is only created as 3MiB. So pull those in to allow 4¾ MiB for the kernel, 3MiB for recovery, and then we have over 20MiB for the root file system. This doesn't affect the new images which ship with a full eMMC image including a different MBR layout and a partition for U-Boot, because our modern U-Boot can actually pass the command line to the kernel, and the built-in one doesn't get used anyway. Tested by upgrading from vendor OpenWrt to the current legacy image, from legacy to itself, to the previous legacy layout, and then to finally the full-system image. This commit probably wants backporting to 19.07, which also doesn't install over the vendor OpenWrt and doesn't even have a full-system installation option. Signed-off-by: David Woodhouse --- .../mediatek/image/gen_mt7623_emmc_img.sh | 22 ++++++++++++++----- target/linux/mediatek/mt7623/config-5.4 | 1 + .../0227-arm-dts-Add-Unielec-U7623-DTS.patch | 2 +- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/target/linux/mediatek/image/gen_mt7623_emmc_img.sh b/target/linux/mediatek/image/gen_mt7623_emmc_img.sh index a5f296ef14..b9eedf80b4 100755 --- a/target/linux/mediatek/image/gen_mt7623_emmc_img.sh +++ b/target/linux/mediatek/image/gen_mt7623_emmc_img.sh @@ -1,5 +1,8 @@ #!/bin/sh - +# +# This script is used only to create the "legacy" image for UniElec U7623, +# suitable for upgrading from the vendor OpenWrt or from OpenWrt 19.07. +# OUTPUT_FILE=$1 KERNEL_FILE=$2 RECOVERY_FILE=$3 @@ -7,10 +10,19 @@ ROOTFS_FILE=$4 BS=512 -#These to offsets are relative to the absolute location of the kernel on the mmc -#(0xA00), so their position in the image is -2560 blocks -RECOVERY_OFFSET=67072 -ROOTFS_OFFSET=87552 +# These two offsets are relative to the absolute location of the kernel on the mmc +# (0xA00), so their position in the image is -2560 blocks +# +# They must be kept in sync with the default command line for U7623. +# blkdevparts=mmcblk0:3M@6M(recovery),256M@9M(root)" +# +# For upgrading from the vendor firmware, the total image must fit in its +# MTD 'firmware' partition, which is typically 36MiB. + +# In the legacy image, the uImage starts at block 0xa00. Allow 4864 KiB (9728) blocks. +RECOVERY_OFFSET=9728 +# The recovery image is 3MiB, or 6144 blocks. +ROOTFS_OFFSET=15872 dd bs="$BS" of="$OUTPUT_FILE" if="$KERNEL_FILE" dd bs="$BS" of="$OUTPUT_FILE" if="$RECOVERY_FILE" seek="$RECOVERY_OFFSET" diff --git a/target/linux/mediatek/mt7623/config-5.4 b/target/linux/mediatek/mt7623/config-5.4 index 2ebdae7077..83ff7b3111 100644 --- a/target/linux/mediatek/mt7623/config-5.4 +++ b/target/linux/mediatek/mt7623/config-5.4 @@ -70,6 +70,7 @@ CONFIG_CLKSRC_MMIO=y CONFIG_CLONE_BACKWARDS=y CONFIG_CMDLINE="earlyprintk console=ttyS0,115200 rootfstype=squashfs,jffs2" CONFIG_CMDLINE_FROM_BOOTLOADER=y +CONFIG_CMDLINE_PARTITION=y CONFIG_COMMON_CLK=y CONFIG_COMMON_CLK_MEDIATEK=y CONFIG_COMMON_CLK_MT2701=y diff --git a/target/linux/mediatek/patches-5.4/0227-arm-dts-Add-Unielec-U7623-DTS.patch b/target/linux/mediatek/patches-5.4/0227-arm-dts-Add-Unielec-U7623-DTS.patch index d1ea20c0ff..7371611059 100644 --- a/target/linux/mediatek/patches-5.4/0227-arm-dts-Add-Unielec-U7623-DTS.patch +++ b/target/linux/mediatek/patches-5.4/0227-arm-dts-Add-Unielec-U7623-DTS.patch @@ -63,7 +63,7 @@ Subject: [PATCH] arm: dts: Add Unielec U7623 DTS + }; + + chosen { -+ bootargs = "root=/dev/mmcblk0p2 rootfstype=squashfs,f2fs console=ttyS0,115200"; ++ bootargs = "root=/dev/mmcblk0p2 rootfstype=squashfs,f2fs console=ttyS0,115200 blkdevparts=mmcblk0:3M@6M(recovery),256M@9M(root)"; + stdout-path = "serial2:115200n8"; + }; + From be3c8f8b2bf2893950b11ea7fa16cea074bc7903 Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Mon, 13 Jul 2020 00:49:22 +0100 Subject: [PATCH 15/31] mediatek: fix Ethernet support on UniElec U7623 The definition of the switch in the device-tree was not correct. Make it look more like the Banana Pi R2, which works. Signed-off-by: David Woodhouse --- .../0227-arm-dts-Add-Unielec-U7623-DTS.patch | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/target/linux/mediatek/patches-5.4/0227-arm-dts-Add-Unielec-U7623-DTS.patch b/target/linux/mediatek/patches-5.4/0227-arm-dts-Add-Unielec-U7623-DTS.patch index 7371611059..7def128daf 100644 --- a/target/linux/mediatek/patches-5.4/0227-arm-dts-Add-Unielec-U7623-DTS.patch +++ b/target/linux/mediatek/patches-5.4/0227-arm-dts-Add-Unielec-U7623-DTS.patch @@ -44,7 +44,7 @@ Subject: [PATCH] arm: dts: Add Unielec U7623 DTS +}; --- /dev/null +++ b/arch/arm/boot/dts/mt7623a-unielec-u7623-02-emmc.dtsi -@@ -0,0 +1,349 @@ +@@ -0,0 +1,343 @@ +/* + * Copyright 2018 Kristian Evensen + * @@ -141,12 +141,6 @@ Subject: [PATCH] arm: dts: Add Unielec U7623 DTS + default-state = "off"; + }; + }; -+ -+ mt7530: switch@0 { -+ compatible = "mediatek,mt7530"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ }; +}; + +&crypto { @@ -171,9 +165,9 @@ Subject: [PATCH] arm: dts: Add Unielec U7623 DTS + mdio: mdio-bus { + #address-cells = <1>; + #size-cells = <0>; -+ phy5: ethernet-phy@5 { -+ reg = <5>; -+ phy-mode = "rgmii-rxid"; ++ ++ mt7530: switch@0 { ++ compatible = "mediatek,mt7530"; + }; + }; +}; From ff8cc137fb999d2f828cfaa53584fa77138836ed Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Thu, 23 Jul 2020 19:35:36 +0100 Subject: [PATCH 16/31] mediatek: mt7623: fix Ethernet setup for TRGMII mode This fixes the TX performance issues seen on MT7623 boards. Signed-off-by: David Woodhouse --- ..._eth_soc-Always-call-mtk_gmac0_rgmii.patch | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 target/linux/mediatek/patches-5.4/0402-net-ethernet-mtk_eth_soc-Always-call-mtk_gmac0_rgmii.patch diff --git a/target/linux/mediatek/patches-5.4/0402-net-ethernet-mtk_eth_soc-Always-call-mtk_gmac0_rgmii.patch b/target/linux/mediatek/patches-5.4/0402-net-ethernet-mtk_eth_soc-Always-call-mtk_gmac0_rgmii.patch new file mode 100644 index 0000000000..0dc50f28d8 --- /dev/null +++ b/target/linux/mediatek/patches-5.4/0402-net-ethernet-mtk_eth_soc-Always-call-mtk_gmac0_rgmii.patch @@ -0,0 +1,62 @@ +In-Reply-To: +References: +Subject: [PATCH] net: ethernet: mtk_eth_soc: Always call mtk_gmac0_rgmii_adjust() for mt7623 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: René van Dorst + +Modify mtk_gmac0_rgmii_adjust() so it can always be called. +mtk_gmac0_rgmii_adjust() sets-up the TRGMII clocks. + +Signed-off-by: René van Dorst +Signed-off-By: David Woodhouse +--- + drivers/net/ethernet/mediatek/mtk_eth_soc.c | 19 ++++++++++++++----- + 1 file changed, 14 insertions(+), 5 deletions(-) + +diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +index b5408c5b954a..f89f225ab144 100644 +--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c ++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +@@ -171,11 +171,21 @@ static int mt7621_gmac0_rgmii_adjust(struct mtk_eth *eth, + return 0; + } + +-static void mtk_gmac0_rgmii_adjust(struct mtk_eth *eth, int speed) ++static void mtk_gmac0_rgmii_adjust(struct mtk_eth *eth, ++ phy_interface_t interface, int speed) + { + u32 val; + int ret; + ++ if (interface == PHY_INTERFACE_MODE_TRGMII) { ++ mtk_w32(eth, TRGMII_MODE, INTF_MODE); ++ val = 500000000; ++ ret = clk_set_rate(eth->clks[MTK_CLK_TRGPLL], val); ++ if (ret) ++ dev_err(eth->dev, "Failed to set trgmii pll: %d\n", ret); ++ return; ++ } ++ + val = (speed == SPEED_1000) ? + INTF_MODE_RGMII_1000 : INTF_MODE_RGMII_10_100; + mtk_w32(eth, val, INTF_MODE); +@@ -262,10 +272,9 @@ static void mtk_mac_config(struct phylink_config *config, unsigned int mode, + state->interface)) + goto err_phy; + } else { +- if (state->interface != +- PHY_INTERFACE_MODE_TRGMII) +- mtk_gmac0_rgmii_adjust(mac->hw, +- state->speed); ++ mtk_gmac0_rgmii_adjust(mac->hw, ++ state->interface, ++ state->speed); + + /* mt7623_pad_clk_setup */ + for (i = 0 ; i < NUM_TRGMII_CTRL; i++) +-- +2.26.2 + From ad295e0ee81b61b667f6e38418b02006aea7c5aa Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Mon, 13 Jul 2020 10:37:28 +0100 Subject: [PATCH 17/31] mediatek: add U-Boot build for UniElec U7623 Patches submitted upstream at https://patchwork.ozlabs.org/project/uboot/list/?series=189178 Tested on Banana Pi R2 and U7623-06. Signed-off-by: David Woodhouse --- package/boot/uboot-mediatek/Makefile | 20 +- ...ix-mmc_get_boot_dev-for-platforms-wi.patch | 51 +++ ...-Add-support-for-UniElec-U7623-board.patch | 310 ++++++++++++++++++ .../patches/010-update-u7623-defconfig.patch | 17 + 4 files changed, 391 insertions(+), 7 deletions(-) create mode 100644 package/boot/uboot-mediatek/patches/008-board-mediatek-fix-mmc_get_boot_dev-for-platforms-wi.patch create mode 100644 package/boot/uboot-mediatek/patches/009-board-mediatek-Add-support-for-UniElec-U7623-board.patch create mode 100644 package/boot/uboot-mediatek/patches/010-update-u7623-defconfig.patch diff --git a/package/boot/uboot-mediatek/Makefile b/package/boot/uboot-mediatek/Makefile index a7b47ecae5..8cb20075a3 100644 --- a/package/boot/uboot-mediatek/Makefile +++ b/package/boot/uboot-mediatek/Makefile @@ -15,18 +15,18 @@ define U-Boot/Default DEFAULT:=y endef -define U-Boot/mt7629 - NAME:=MT7629 - BUILD_SUBTARGET:=mt7629 - UBOOT_CONFIG:=mt7629_rfb -endef - define U-Boot/mt7622 NAME:=MT7622 BUILD_SUBTARGET:=mt7622 UBOOT_CONFIG:=mt7622_rfb endef +define U-Boot/mt7623a_unielec_u7623 + NAME:=UniElec U7623 (mt7623) + BUILD_SUBTARGET:=mt7623 + UBOOT_CONFIG:=mt7623a_unielec_u7623_02 +endef + define U-Boot/mt7623n_bpir2 NAME:=Banana Pi R2 (mt7623) BUILD_SUBTARGET:=mt7623 @@ -34,7 +34,13 @@ define U-Boot/mt7623n_bpir2 UBOOT_CONFIG:=mt7623n_bpir2 endef -UBOOT_TARGETS := mt7629 mt7622 mt7623n_bpir2 +define U-Boot/mt7629 + NAME:=MT7629 + BUILD_SUBTARGET:=mt7629 + UBOOT_CONFIG:=mt7629_rfb +endef + +UBOOT_TARGETS := mt7629 mt7622 mt7623n_bpir2 mt7623a_unielec_u7623 UBOOT_MAKE_FLAGS += $(UBOOT_IMAGE) diff --git a/package/boot/uboot-mediatek/patches/008-board-mediatek-fix-mmc_get_boot_dev-for-platforms-wi.patch b/package/boot/uboot-mediatek/patches/008-board-mediatek-fix-mmc_get_boot_dev-for-platforms-wi.patch new file mode 100644 index 0000000000..e32114a880 --- /dev/null +++ b/package/boot/uboot-mediatek/patches/008-board-mediatek-fix-mmc_get_boot_dev-for-platforms-wi.patch @@ -0,0 +1,51 @@ +From b0d1b85fb25a28a9532eaa9dda064b40a0e25f25 Mon Sep 17 00:00:00 2001 +From: David Woodhouse +Date: Sun, 12 Jul 2020 23:19:09 +0100 +Subject: [PATCH 1/3] board: mediatek: fix mmc_get_boot_dev() for platforms + without external SD + +On the UniElec U7623 board there is no external SD slot and the preloader +doesn't fill in the magic field at 0x81dffff0 to indicate that it was +booted from eMMC. + +Signed-off-by: David Woodhouse +--- + board/mediatek/mt7623/mt7623_rfb.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/board/mediatek/mt7623/mt7623_rfb.c b/board/mediatek/mt7623/mt7623_rfb.c +index 4ec2764976..984e75ccaf 100644 +--- a/board/mediatek/mt7623/mt7623_rfb.c ++++ b/board/mediatek/mt7623/mt7623_rfb.c +@@ -4,6 +4,7 @@ + */ + + #include ++#include + + DECLARE_GLOBAL_DATA_PTR; + +@@ -15,10 +16,15 @@ int board_init(void) + return 0; + } + ++#ifdef CONFIG_MMC + int mmc_get_boot_dev(void) + { + int g_mmc_devid = -1; + char *uflag = (char *)0x81DFFFF0; ++ ++ if (!find_mmc_device(1)) ++ return 0; ++ + if (strncmp(uflag,"eMMC",4)==0) { + g_mmc_devid = 0; + printf("Boot From Emmc(id:%d)\n\n", g_mmc_devid); +@@ -33,3 +39,4 @@ int mmc_get_env_dev(void) + { + return mmc_get_boot_dev(); + } ++#endif +-- +2.26.2 + diff --git a/package/boot/uboot-mediatek/patches/009-board-mediatek-Add-support-for-UniElec-U7623-board.patch b/package/boot/uboot-mediatek/patches/009-board-mediatek-Add-support-for-UniElec-U7623-board.patch new file mode 100644 index 0000000000..32bef358f4 --- /dev/null +++ b/package/boot/uboot-mediatek/patches/009-board-mediatek-Add-support-for-UniElec-U7623-board.patch @@ -0,0 +1,310 @@ +From d13abe5b2c5b85228bdd34584fcbd642f1883668 Mon Sep 17 00:00:00 2001 +From: David Woodhouse +Date: Sun, 12 Jul 2020 23:23:05 +0100 +Subject: [PATCH 3/3] board: mediatek: Add support for UniElec U7623 board + +This is an MT7623A-based board, very similar to the Banana Pi R2. + +http://www.unielecinc.com/q/news/cn/p/product/detail.html?qd_guid=OjXwKCaRlN + +Signed-off-by: David Woodhouse +--- + arch/arm/dts/Makefile | 1 + + .../arm/dts/mt7623a-unielec-u7623-02-emmc.dts | 211 ++++++++++++++++++ + configs/mt7623a_unielec_u7623_02_defconfig | 54 +++++ + 3 files changed, 266 insertions(+) + create mode 100644 arch/arm/dts/mt7623a-unielec-u7623-02-emmc.dts + create mode 100644 configs/mt7623a_unielec_u7623_02_defconfig + +diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile +index 89fa448818..a140b1c8d4 100644 +--- a/arch/arm/dts/Makefile ++++ b/arch/arm/dts/Makefile +@@ -938,6 +938,7 @@ dtb-$(CONFIG_SOC_K3_J721E) += k3-j721e-common-proc-board.dtb \ + + dtb-$(CONFIG_ARCH_MEDIATEK) += \ + mt7622-rfb.dtb \ ++ mt7623a-unielec-u7623-02-emmc.dtb \ + mt7623n-bananapi-bpi-r2.dtb \ + mt7629-rfb.dtb \ + mt8512-bm1-emmc.dtb \ +diff --git a/arch/arm/dts/mt7623a-unielec-u7623-02-emmc.dts b/arch/arm/dts/mt7623a-unielec-u7623-02-emmc.dts +new file mode 100644 +index 0000000000..fdeec75b05 +--- /dev/null ++++ b/arch/arm/dts/mt7623a-unielec-u7623-02-emmc.dts +@@ -0,0 +1,211 @@ ++/* ++ * Copyright (C) 2018 MediaTek Inc. ++ * Author: Ryder Lee ++ * ++ * SPDX-License-Identifier: (GPL-2.0 OR MIT) ++ */ ++ ++/dts-v1/; ++#include "mt7623.dtsi" ++#include "mt7623-u-boot.dtsi" ++ ++/ { ++ model = "UniElec U7623-02 eMMC"; ++ compatible = "unielec,u7623-02-emmc", "mediatek,mt7623"; ++ ++ memory@80000000 { ++ device_type = "memory"; ++ reg = <0 0x80000000 0 0x20000000>; ++ }; ++ ++ chosen { ++ stdout-path = &uart2; ++ tick-timer = &timer0; ++ }; ++ ++ reg_1p8v: regulator-1p8v { ++ compatible = "regulator-fixed"; ++ regulator-name = "fixed-1.8V"; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-boot-on; ++ regulator-always-on; ++ }; ++ ++ 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; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ led3 { ++ label = "u7623-01:green:led3"; ++ gpios = <&gpio 14 GPIO_ACTIVE_LOW>; ++ default-state = "off"; ++ }; ++ ++ led4 { ++ label = "u7623-01:green:led4"; ++ gpios = <&gpio 15 GPIO_ACTIVE_LOW>; ++ default-state = "off"; ++ }; ++ }; ++}; ++ ++ð { ++ status = "okay"; ++ mediatek,gmac-id = <0>; ++ phy-mode = "rgmii"; ++ mediatek,switch = "mt7530"; ++ mediatek,mcm; ++ ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++}; ++ ++&mmc0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&mmc0_pins_default>; ++ status = "okay"; ++ bus-width = <8>; ++ max-frequency = <50000000>; ++ cap-mmc-highspeed; ++ vmmc-supply = <®_3p3v>; ++ vqmmc-supply = <®_1p8v>; ++ non-removable; ++}; ++ ++&pinctrl { ++ ephy_default: ephy_default { ++ mux { ++ function = "eth"; ++ groups = "mdc_mdio", "ephy"; ++ }; ++ ++ conf { ++ pins = "G2_TXEN", "G2_TXD0", "G2_TXD1", "G2_TXD2", ++ "G2_TXD3", "G2_TXC", "G2_RXC", "G2_RXD0", ++ "G2_RXD1", "G2_RXD2", "G2_RXD3", "G2_RXDV", ++ "MDC", "MDIO"; ++ drive-strength = <12>; ++ mediatek,tdsel = <5>; ++ }; ++ }; ++ ++ mmc0_pins_default: mmc0default { ++ mux { ++ function = "msdc"; ++ groups = "msdc0"; ++ }; ++ ++ conf-cmd-data { ++ pins = "MSDC0_CMD", "MSDC0_DAT0", "MSDC0_DAT1", ++ "MSDC0_DAT2", "MSDC0_DAT3", "MSDC0_DAT4", ++ "MSDC0_DAT5", "MSDC0_DAT6", "MSDC0_DAT7"; ++ input-enable; ++ bias-pull-up; ++ }; ++ ++ conf-clk { ++ pins = "MSDC0_CLK"; ++ bias-pull-down; ++ }; ++ ++ conf-rst { ++ pins = "MSDC0_RSTB"; ++ bias-pull-up; ++ }; ++ }; ++ ++ pcie_default: pcie-default { ++ mux { ++ function = "pcie"; ++ groups = "pcie0_0_perst", "pcie1_0_perst"; ++ }; ++ }; ++ ++ uart0_pins_a: uart0-default { ++ mux { ++ function = "uart"; ++ groups = "uart0_0_txd_rxd"; ++ }; ++ }; ++ ++ uart1_pins_a: uart1-default { ++ mux { ++ function = "uart"; ++ groups = "uart1_0_txd_rxd"; ++ }; ++ }; ++ ++ uart2_pins_a: uart2-default { ++ mux { ++ function = "uart"; ++ groups = "uart2_0_txd_rxd"; ++ }; ++ }; ++ ++ uart2_pins_b: uart2-alt { ++ mux { ++ function = "uart"; ++ groups = "uart2_1_txd_rxd"; ++ }; ++ }; ++}; ++ ++&pcie { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pcie_default>; ++ status = "okay"; ++ ++ pcie@0,0 { ++ status = "okay"; ++ }; ++ ++ pcie@1,0 { ++ status = "okay"; ++ }; ++}; ++ ++&pcie0_phy { ++ status = "okay"; ++}; ++ ++&pcie1_phy { ++ status = "okay"; ++}; ++ ++&uart0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart0_pins_a>; ++ status = "okay"; ++}; ++ ++&uart1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart1_pins_a>; ++ status = "okay"; ++}; ++ ++&uart2 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart2_pins_b>; ++ status = "okay"; ++}; +diff --git a/configs/mt7623a_unielec_u7623_02_defconfig b/configs/mt7623a_unielec_u7623_02_defconfig +new file mode 100644 +index 0000000000..72b5f31092 +--- /dev/null ++++ b/configs/mt7623a_unielec_u7623_02_defconfig +@@ -0,0 +1,54 @@ ++CONFIG_ARM=y ++CONFIG_SYS_THUMB_BUILD=y ++CONFIG_ARCH_MEDIATEK=y ++CONFIG_SYS_TEXT_BASE=0x81e00000 ++CONFIG_SYS_MALLOC_F_LEN=0x4000 ++CONFIG_ENV_SIZE=0x1000 ++CONFIG_ENV_OFFSET=0x100000 ++CONFIG_TARGET_MT7623=y ++CONFIG_NR_DRAM_BANKS=1 ++CONFIG_DISTRO_DEFAULTS=y ++CONFIG_FIT=y ++CONFIG_FIT_VERBOSE=y ++CONFIG_BOOTDELAY=3 ++CONFIG_SYS_CONSOLE_IS_IN_ENV=y ++CONFIG_DEFAULT_FDT_FILE="mt7623a-unielec-u7623-02-emmc.dtb" ++# CONFIG_DISPLAY_BOARDINFO is not set ++CONFIG_SYS_PROMPT="U-Boot> " ++CONFIG_CMD_BOOTMENU=y ++# CONFIG_CMD_ELF is not set ++# CONFIG_CMD_XIMG is not set ++CONFIG_CMD_GPIO=y ++CONFIG_CMD_GPT=y ++CONFIG_CMD_MMC=y ++CONFIG_CMD_READ=y ++# CONFIG_CMD_SETEXPR is not set ++# CONFIG_CMD_NFS is not set ++CONFIG_DEFAULT_DEVICE_TREE="mt7623a-unielec-u7623-02-emmc" ++CONFIG_ENV_IS_IN_MMC=y ++CONFIG_SYS_RELOC_GD_ENV_ADDR=y ++CONFIG_NET_RANDOM_ETHADDR=y ++CONFIG_REGMAP=y ++CONFIG_SYSCON=y ++CONFIG_CLK=y ++CONFIG_DM_MMC=y ++# CONFIG_MMC_QUIRKS is not set ++CONFIG_SUPPORT_EMMC_BOOT=y ++CONFIG_MMC_HS400_SUPPORT=y ++CONFIG_MMC_MTK=y ++CONFIG_PHY_FIXED=y ++CONFIG_DM_ETH=y ++CONFIG_MEDIATEK_ETH=y ++CONFIG_PINCTRL=y ++CONFIG_PINCONF=y ++CONFIG_PINCTRL_MT7623=y ++CONFIG_POWER_DOMAIN=y ++CONFIG_MTK_POWER_DOMAIN=y ++CONFIG_DM_SERIAL=y ++CONFIG_MTK_SERIAL=y ++CONFIG_SYSRESET=y ++CONFIG_SYSRESET_WATCHDOG=y ++CONFIG_TIMER=y ++CONFIG_MTK_TIMER=y ++CONFIG_WDT_MTK=y ++CONFIG_LZMA=y +-- +2.26.2 + diff --git a/package/boot/uboot-mediatek/patches/010-update-u7623-defconfig.patch b/package/boot/uboot-mediatek/patches/010-update-u7623-defconfig.patch new file mode 100644 index 0000000000..ec189f82dc --- /dev/null +++ b/package/boot/uboot-mediatek/patches/010-update-u7623-defconfig.patch @@ -0,0 +1,17 @@ +diff --git a/configs/mt7623n_bpir2_defconfig b/configs/mt7623n_bpir2_defconfig +index 6b9fbd7e22..fb2a004803 100644 +--- a/configs/mt7623a_unielec_u7623_02_defconfig ++++ b/configs/mt7623a_unielec_u7623_02_defconfig +@@ -52,3 +52,12 @@ CONFIG_TIMER=y + CONFIG_MTK_TIMER=y + CONFIG_WDT_MTK=y + CONFIG_LZMA=y ++CONFIG_CMD_BOOTZ=y ++CONFIG_OF_LIBFDT_OVERLAY=y ++#enables savenenv-command ++CONFIG_ENV_IS_IN_FAT=y ++CONFIG_ENV_FAT_INTERFACE="mmc" ++CONFIG_ENV_FAT_DEVICE_AND_PART="0:2" ++CONFIG_ENV_FAT_FILE="uboot.env" ++CONFIG_CMD_ASKENV=y ++CONFIG_CMD_SETEXPR=y From 7a1eaa446b07ebf516a43db609ccbf169baadcae Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Mon, 20 Jul 2020 16:25:49 +0100 Subject: [PATCH 18/31] mediatek: mt7623: increase flexibility of finding recovery partition I'm about to change the layout of the images for UniElec U7623 so make it find the recovery partition based on which the root partition is too. Signed-off-by: David Woodhouse --- .../base-files/lib/preinit/07_set_iface_mac | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/target/linux/mediatek/mt7623/base-files/lib/preinit/07_set_iface_mac b/target/linux/mediatek/mt7623/base-files/lib/preinit/07_set_iface_mac index 60b699d9c9..7b165df565 100644 --- a/target/linux/mediatek/mt7623/base-files/lib/preinit/07_set_iface_mac +++ b/target/linux/mediatek/mt7623/base-files/lib/preinit/07_set_iface_mac @@ -42,16 +42,22 @@ preinit_set_mac_address() { local rootpart case $(board_name) in - bananapi,bpi-r2) + bananapi,bpi-r2|\ + unielec,u7623-02-emmc-512m) rootpart=$(cat /proc/cmdline) rootpart="${rootpart##*root=}" - rootpart="${rootpart%%p3 *}" - if [ "$rootpart" = "/dev/mmcblk0" -o "$rootpart" = "/dev/mmcblk1" ]; then - set_recovery_mac_address ${rootpart}p2 - fi - ;; - unielec,u7623-02-emmc-512m) - set_recovery_mac_address /dev/mmcblk0p1 + rootpart="${rootpart%% *}" + case $rootpart in + /dev/mmcblk0p2) # Legacy U7623 image + set_recovery_mac_address /dev/mmcblk0p1 + ;; + /dev/mmcblk0p3) # U7623 or Banana Pi R2 eMMC + set_recovery_mac_address /dev/mmcblk0p2 + ;; + /dev/mmcblk1p3) # Banana Pi R2 SD + set_recovery_mac_address /dev/mmcblk1p2 + ;; + esac ;; esac } From 29fa5526a2ba5882cf0159b03998e29194c1f190 Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Mon, 20 Jul 2020 21:10:04 +0100 Subject: [PATCH 19/31] mediatek: mt7623: prepare for full sysupgrade support on UniElec U7623 An upcoming commit will add a full system image for U7623 which will contain the MBR partition table and U-Boot too. That contrasts with the current image which only owns the eMMC from sector 0xa00 onwards, and must start with a legacy uImage. Prepare for sysupgrade to the new images, and cope with the fact that the recovery partition will be /dev/mmcblk0p2 instead of /dev/mmcblk0p1 after the upgrade. This commit could potentially be backported to 19.07 to allow for direct sysupgrade to the new image layout. Signed-off-by: David Woodhouse --- .../base-files/lib/preinit/79_move_config | 6 +- .../mt7623/base-files/lib/upgrade/platform.sh | 215 ++++++++++-------- 2 files changed, 125 insertions(+), 96 deletions(-) diff --git a/target/linux/mediatek/mt7623/base-files/lib/preinit/79_move_config b/target/linux/mediatek/mt7623/base-files/lib/preinit/79_move_config index cbb6c604c8..f47894c0fd 100644 --- a/target/linux/mediatek/mt7623/base-files/lib/preinit/79_move_config +++ b/target/linux/mediatek/mt7623/base-files/lib/preinit/79_move_config @@ -10,7 +10,11 @@ move_config() { partnum=2 ;; unielec,u7623-02-emmc-512m) - partnum=1 + if grep -q root=/dev/mmcblk0p2 /proc/cmdline; then + partnum=1; + else + partnum=2; + fi ;; *) return 1 diff --git a/target/linux/mediatek/mt7623/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/mt7623/base-files/lib/upgrade/platform.sh index 2b37846456..d3da22d496 100755 --- a/target/linux/mediatek/mt7623/base-files/lib/upgrade/platform.sh +++ b/target/linux/mediatek/mt7623/base-files/lib/upgrade/platform.sh @@ -1,92 +1,113 @@ + +REQUIRE_IMAGE_METADATA=1 + +# Full system upgrade including preloader for MediaTek SoCs on eMMC or SD +mtk_mmc_full_upgrade() { + local diskdev partdev diff oldrecovery + + if grep -q root=/dev/mmcblk0p2 /proc/cmdline; then + oldrecovery=1 + else + oldrecovery=2 + fi + + export_bootdevice && export_partdevice diskdev 0 || { + echo "Unable to determine upgrade device" + return 1 + } + + #Keep the persistent random mac address (if it exists) + mkdir -p /tmp/recovery + export_partdevice recoverydev $oldrecovery + if mount -o rw,noatime "/dev/$recoverydev" -tvfat /tmp/recovery; then + [ -f "/tmp/recovery/mac_addr" ] && cp /tmp/recovery/mac_addr /tmp/ + umount /tmp/recovery + fi + sync + + if [ "$SAVE_PARTITIONS" = "1" ]; then + get_partitions "/dev/$diskdev" bootdisk + + #extract the boot sector from the image + get_image "$@" | dd of=/tmp/image.bs count=1 bs=512b + + get_partitions /tmp/image.bs image + + #compare tables + diff="$(grep -F -x -v -f /tmp/partmap.bootdisk /tmp/partmap.image)" + else + diff=1 + fi + + if [ -n "$diff" ]; then + get_image "$@" | dd of="/dev/$diskdev" bs=4096 conv=fsync + + # Separate removal and addition is necessary; otherwise, partition 1 + # will be missing if it overlaps with the old partition 2 + partx -d - "/dev/$diskdev" + partx -a - "/dev/$diskdev" + else + # iterate over each partition from the image and write it to the boot disk + while read part start size; do + part="$(($part - 2))" + if export_partdevice partdev $part; then + echo "Writing image to /dev/$partdev..." + get_image "$@" | dd of="/dev/$partdev" ibs="512" obs=1M skip="$start" count="$size" conv=fsync + else + echo "Unable to find partition $part device, skipped." + fi + done < /tmp/partmap.image + + #copy partition uuid + echo "Writing new UUID to /dev/$diskdev..." + get_image "$@" | dd of="/dev/$diskdev" bs=1 skip=440 count=4 seek=440 conv=fsync + fi + + export_partdevice recoverydev 2 + if mount -o rw,noatime "/dev/$recoverydev" -t vfat /tmp/recovery; then + [ -f "/tmp/mac_addr" ] && cp /tmp/mac_addr /tmp/recovery + + if [ "$diskdev" = "mmcblk0" -a -r /tmp/recovery/eMMCboot.bin ]; then + echo 0 > /sys/block/mmcblk0boot0/force_ro + dd if=/tmp/recovery/eMMCboot.bin of=/dev/mmcblk0boot0 conv=fsync + sync + echo 1 > /sys/block/mmcblk0boot0/force_ro + fi + sync + umount /tmp/recovery + fi +} + platform_do_upgrade() { local board=$(board_name) case "$board" in bananapi,bpi-r2) - local diskdev partdev diff - - export_bootdevice && export_partdevice diskdev 0 || { - echo "Unable to determine upgrade device" - return 1 - } - - #Keep the persistent random mac address (if it exists) - mkdir -p /tmp/recovery - export_partdevice recoverydev 2 - if mount -o rw,noatime "/dev/$recoverydev" -tvfat /tmp/recovery; then - [ -f "/tmp/recovery/mac_addr" ] && cp /tmp/recovery/mac_addr /tmp/ - umount /tmp/recovery - fi - sync - - if [ "$SAVE_PARTITIONS" = "1" ]; then - get_partitions "/dev/$diskdev" bootdisk - - #extract the boot sector from the image - get_image "$@" | dd of=/tmp/image.bs count=1 bs=512b - - get_partitions /tmp/image.bs image - - #compare tables - diff="$(grep -F -x -v -f /tmp/partmap.bootdisk /tmp/partmap.image)" - else - diff=1 - fi - - if [ -n "$diff" ]; then - get_image "$@" | dd of="/dev/$diskdev" bs=4096 conv=fsync - - # Separate removal and addtion is necessary; otherwise, partition 1 - # will be missing if it overlaps with the old partition 2 - partx -d - "/dev/$diskdev" - partx -a - "/dev/$diskdev" - else - #iterate over each partition from the image and write it to the boot disk - while read part start size; do - part="$(($part - 2))" - if export_partdevice partdev $part; then - echo "Writing image to /dev/$partdev..." - get_image "$@" | dd of="/dev/$partdev" ibs="512" obs=1M skip="$start" count="$size" conv=fsync - else - echo "Unable to find partition $part device, skipped." - fi - done < /tmp/partmap.image - - #copy partition uuid - echo "Writing new UUID to /dev/$diskdev..." - get_image "$@" | dd of="/dev/$diskdev" bs=1 skip=440 count=4 seek=440 conv=fsync - fi - - if mount -o rw,noatime "/dev/$recoverydev" -t vfat /tmp/recovery; then - [ -f "/tmp/mac_addr" ] && cp /tmp/mac_addr /tmp/recovery - - if [ "$diskdev" = "mmcblk0" -a -r /tmp/recovery/eMMCboot.bin ]; then - echo 0 > /sys/block/mmcblk0boot0/force_ro - dd if=/tmp/recovery/eMMCboot.bin of=/dev/mmcblk0boot0 conv=fsync - sync - echo 1 > /sys/block/mmcblk0boot0/force_ro - fi - sync - umount /tmp/recovery - fi + mtk_mmc_full_upgrade "$1" ;; unielec,u7623-02-emmc-512m) - #Keep the persisten random mac address (if it exists) - mkdir -p /tmp/recovery - mount -o rw,noatime /dev/mmcblk0p1 /tmp/recovery - [ -f "/tmp/recovery/mac_addr" ] && \ - mv -f /tmp/recovery/mac_addr /tmp/ - umount /tmp/recovery + local magic="$(get_magic_long "$1")" + if [ "$magic" = "53444d4d" ]; then + mtk_mmc_full_upgrade "$1" + else # Old partial image starting with uImage + # Keep the persistent random mac address (if it exists) + recoverydev=mmcblk0p1 + mkdir -p /tmp/recovery + mount -o rw,noatime /dev/$recoverydev /tmp/recovery + [ -f "/tmp/recovery/mac_addr" ] && \ + mv -f /tmp/recovery/mac_addr /tmp/ + umount /tmp/recovery - #1310720 is the offset in bytes from the start of eMMC and to - #the location of the kernel (2560 512 byte sectors) - get_image "$1" | dd of=/dev/mmcblk0 bs=1310720 seek=1 conv=fsync + # 1310720 is the offset in bytes from the start of eMMC and to + # the location of the kernel (2560 512 byte sectors) + get_image "$1" | dd of=/dev/mmcblk0 bs=1310720 seek=1 conv=fsync - mount -o rw,noatime /dev/mmcblk0p1 /tmp/recovery - [ -f "/tmp/mac_addr" ] && mv -f /tmp/mac_addr /tmp/recovery - sync - umount /tmp/recovery + mount -o rw,noatime /dev/$recoverydev /tmp/recovery + [ -f "/tmp/mac_addr" ] && mv -f /tmp/mac_addr /tmp/recovery + sync + umount /tmp/recovery + fi ;; *) default_do_upgrade "$1" @@ -133,10 +154,21 @@ platform_check_image() { fi ;; unielec,u7623-02-emmc-512m) + # Can always upgrade to the new-style full image + [ "$magic" = "53444d4d" ] && return 0 + + # Legacy uImage directly at 0xA00 on the eMMC. [ "$magic" != "27051956" ] && { echo "Invalid image type." return 1 } + rootpart=$(cat /proc/cmdline) + rootpart="${rootpart##*root=}" + rootpart="${rootpart%% *}" + [ "$rootpart" != "/dev/mmcblk0p2" ] && { + echo "Cannot downgrade to legacy image." + return 1 + } return 0 ;; *) @@ -148,25 +180,18 @@ platform_check_image() { return 0 } -platform_copy_config_emmc() { - local partdev - - if export_bootdevice && export_partdevice partdev $1; then - mkdir -p /recovery - mount -o rw,noatime "/dev/$partdev" -t vfat /recovery - cp -af "$UPGRADE_BACKUP" "/recovery/$BACKUP_FILE" - sync - umount /recovery - fi -} - platform_copy_config() { case "$(board_name)" in - bananapi,bpi-r2) - platform_copy_config_emmc 2 - ;; + bananapi,bpi-r2|\ unielec,u7623-02-emmc-512m) - platform_copy_config_emmc 1 + # platform_do_upgrade() will have set $recoverydev + if [ -n "$recoverydev" ]; then + mkdir -p /tmp/recovery + mount -o rw,noatime "/dev/$recoverydev" -t vfat /tmp/recovery + cp -af "$UPGRADE_BACKUP" "/tmp/recovery/$BACKUP_FILE" + sync + umount /tmp/recovery + fi ;; esac } From 65fc47cac562f0bba18aafd40e2d51884075e5ab Mon Sep 17 00:00:00 2001 From: Chuanhong Guo Date: Sun, 26 Jul 2020 16:57:05 +0800 Subject: [PATCH 20/31] mediatek: mt7623: build lzma fit for bpi-r2 bpi-r2 images are shipped with mainline u-boot which can extract lzma with no problem. remove custom kernel recipe to build lzma fit image instead of uncompressed fit with zboot. Signed-off-by: Chuanhong Guo --- target/linux/mediatek/image/mt7623.mk | 3 --- 1 file changed, 3 deletions(-) diff --git a/target/linux/mediatek/image/mt7623.mk b/target/linux/mediatek/image/mt7623.mk index bdd3820ed3..4ed8cb0a69 100644 --- a/target/linux/mediatek/image/mt7623.mk +++ b/target/linux/mediatek/image/mt7623.mk @@ -29,9 +29,6 @@ define Device/bpi_bananapi-r2 DEVICE_VENDOR := Bpi DEVICE_MODEL := Banana Pi R2 DEVICE_DTS := mt7623n-bananapi-bpi-r2 - KERNEL_NAME := zImage - KERNEL := kernel-bin | fit none $$(DTS_DIR)/$$(DEVICE_DTS).dtb - KERNEL_INITRAMFS := DEVICE_PACKAGES := kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1 kmod-mmc \ mkf2fs e2fsprogs kmod-usb-ohci kmod-usb2 kmod-usb3 kmod-ata-ahci-mtk UBOOT_TARGET := mt7623n_bpir2 From 5787684cb4e241bd5d28237fbcad5d4a0dca7ba1 Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Tue, 21 Jul 2020 17:43:12 +0100 Subject: [PATCH 21/31] mediatek: mt7623: add scatter file for unbricking with SP Flash Tool MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Many MediaTek SoCs can be unbricked by using the SP Flash Tool from http://spflashtool.com/ along with a "scatter list" file, which is just a text file listing which image gets loaded where. We use a trivial partition layout for the tool, with the whole eMMC image as a single "partition", which means users just need to unzip the sysupgrade image. Doing the real partition layout would be overly complex and would require the individual partitions to be shipped as artifacts — or users to extract them out of the sysupgrade image just for the tool to put them adjacent to each other on the eMMC anyway. The tool does require a copy of the preloader in order to operate, even when it isn't flashing the preloader to the eMMC boot region. So drop that into the bin directory as an artifact too. Signed-off-by: David Woodhouse --- .../linux/mediatek/image/gen_scatterfile.sh | 75 +++++++++++++++++++ target/linux/mediatek/image/mt7623.mk | 13 ++++ 2 files changed, 88 insertions(+) create mode 100755 target/linux/mediatek/image/gen_scatterfile.sh diff --git a/target/linux/mediatek/image/gen_scatterfile.sh b/target/linux/mediatek/image/gen_scatterfile.sh new file mode 100755 index 0000000000..f23cf819b8 --- /dev/null +++ b/target/linux/mediatek/image/gen_scatterfile.sh @@ -0,0 +1,75 @@ +#!/bin/sh +# +# Copyright © 2020 David Woodhouse +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +# Generate as "scatter file" for use with the MediaTek SP Flash tool for +# writing images to MediaTek boards. This can be used to write images +# even on a bricked board which has no preloader installed, or broken +# U-Boot. +# +# NOTE: At the time of writing (2020-07-20), the Linux tool linked from +# the front page of https://spflashtool.com/ is out of date and does not +# support MT7623. The newer v5.1916 found on the download page at +# https://spflashtool.com/download/ has been tested on UniElec U7623 and +# Banana Pi R2 from Linux, and does work. +# + +SOC=$1 +IMAGE=${2%.gz} +PROJECT=${3%-scatter.txt} +DEVICENAME="$4" + +cat < $@ +endef + define Device/bpi_bananapi-r2 DEVICE_VENDOR := Bpi DEVICE_MODEL := Banana Pi R2 @@ -34,6 +44,9 @@ define Device/bpi_bananapi-r2 UBOOT_TARGET := mt7623n_bpir2 IMAGES := img.gz IMAGE/img.gz := banana-pi-sdcard | gzip | append-metadata + ARTIFACT/preloader.bin := preloader $$(UBOOT_TARGET) + ARTIFACT/scatter.txt := scatterfile $$(firstword $$(FILESYSTEMS))-$$(firstword $$(IMAGES)) + ARTIFACTS = preloader.bin scatter.txt SUPPORTED_DEVICES := bananapi,bpi-r2 endef TARGET_DEVICES += bpi_bananapi-r2 From f5cebbe2e49c3807d1bd3ed371da35ed2ef32314 Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Tue, 21 Jul 2020 19:07:47 +0100 Subject: [PATCH 22/31] mediatek: mt7623: make gen_banana_pi_img.sh more generic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This actually covers fairly much all the MediaTek platforms; they only have different images because they don't include the preloader and U-Boot, and rely on preinstalled stuff from the vendor. So this script can slowly take over the world as we complete the support for various other platforms, starting with UniElec U7623… Signed-off-by: David Woodhouse --- .../linux/mediatek/image/gen_banana_pi_img.sh | 21 ++++++++++++------- target/linux/mediatek/image/mt7623.mk | 18 +++++++++------- 2 files changed, 24 insertions(+), 15 deletions(-) diff --git a/target/linux/mediatek/image/gen_banana_pi_img.sh b/target/linux/mediatek/image/gen_banana_pi_img.sh index d46e92fa42..611a17edff 100755 --- a/target/linux/mediatek/image/gen_banana_pi_img.sh +++ b/target/linux/mediatek/image/gen_banana_pi_img.sh @@ -79,7 +79,7 @@ # with the preloader loading 512KiB of U-Boot starting at 0x50000. usage() { - echo "SYNTAX: $0 sd " + echo "SYNTAX: $0 sd " echo " OR: $0 emmc " exit 1 } @@ -96,20 +96,21 @@ BRLYT="BRLYT\x00\x00\x00\x01\x00\x00\x00\x00\x08\x00\x00\ case $1 in sd) - [ $# -eq 8 ] || usage + [ $# -eq 9 ] || usage OUTPUT="$2" PRELOADER="$3" UBOOT="$4" - BOOTFS="$5" - ROOTFS="$6" - BOOTFSSIZE="$7" - ROOTFSSIZE="$8" + UBOOTOFS="$5" + BOOTFS="$6" + ROOTFS="$7" + BOOTFSSIZE="$8" + ROOTFSSIZE="$9" head=4 sect=63 set $(ptgen -o $OUTPUT -h $head -s $sect -a 0 -l 1024 \ - -t 41 -p 512k@320k \ + -t 41 -p 512k@${UBOOTOFS} \ -t c -p ${BOOTFSSIZE}M \ -t 83 -p ${ROOTFSSIZE}M ) @@ -123,7 +124,11 @@ case $1 in echo -en "${SDMMC_BOOT}" | dd bs=1 of="${OUTPUT}" seek=0 conv=notrunc echo -en "${BRLYT}" | dd bs=1 of="${OUTPUT}" seek=512 conv=notrunc - dd bs=1024 if="${PRELOADER}" of="${OUTPUT}" seek="${PRELOADER_OFFSET}" conv=notrunc + # For eMMC-only boards like U7623 the preloader doesn't need to be included in the + # main image as it's only ever needed in the eMMC boot partition. + if [ -r ${PRELOADER} ]; then + dd bs=1024 if="${PRELOADER}" of="${OUTPUT}" seek="${PRELOADER_OFFSET}" conv=notrunc + fi dd bs=512 if="${UBOOT}" of="${OUTPUT}" seek="${UBOOT_OFFSET}" conv=notrunc dd bs=512 if="${BOOTFS}" of="${OUTPUT}" seek="${BOOTFS_OFFSET}" conv=notrunc dd bs=512 if="${ROOTFS}" of="${OUTPUT}" seek="${ROOTFS_OFFSET}" conv=notrunc diff --git a/target/linux/mediatek/image/mt7623.mk b/target/linux/mediatek/image/mt7623.mk index ef14969029..1061a0d281 100644 --- a/target/linux/mediatek/image/mt7623.mk +++ b/target/linux/mediatek/image/mt7623.mk @@ -1,5 +1,5 @@ KERNEL_LOADADDR := 0x80008000 -DEVICE_VARS += UBOOT_TARGET +DEVICE_VARS += UBOOT_TARGET UBOOT_OFFSET UBOOT_ENVSIZE ifneq ($(CONFIG_BANANA_PI_BOOT_PARTSIZE),) BOOTFS_BLOCK_SIZE := 1024 @@ -10,16 +10,18 @@ define Build/banana-pi-sdcard rm -f $@.boot mkfs.fat -C $@.boot $(BOOTFS_BLOCKS) - ./gen_banana_pi_img.sh emmc $@.emmc \ - $(STAGING_DIR_IMAGE)/$(UBOOT_TARGET)-preloader.bin - - mkenvimage -s 0x2000 -o $(STAGING_DIR_IMAGE)/$(UBOOT_TARGET)-uboot.env $(UBOOT_TARGET)-uEnv.txt + if [ -r $(STAGING_DIR_IMAGE)/$(UBOOT_TARGET)-preloader.bin ]; then \ + ./gen_banana_pi_img.sh emmc $@.emmc \ + $(STAGING_DIR_IMAGE)/$(UBOOT_TARGET)-preloader.bin; \ + mcopy -i $@.boot $@.emmc ::eMMCboot.bin; \ + fi + mkenvimage -s $(UBOOT_ENVSIZE) -o $(STAGING_DIR_IMAGE)/$(UBOOT_TARGET)-uboot.env $(UBOOT_TARGET)-uEnv.txt mcopy -i $@.boot $(STAGING_DIR_IMAGE)/$(UBOOT_TARGET)-uboot.env ::uboot.env mcopy -i $@.boot $(IMAGE_KERNEL) ::uImage - mcopy -i $@.boot $@.emmc ::eMMCboot.bin ./gen_banana_pi_img.sh sd $@ \ $(STAGING_DIR_IMAGE)/$(UBOOT_TARGET)-preloader.bin \ - $(STAGING_DIR_IMAGE)/$(UBOOT_TARGET)-u-boot.bin \ + $(STAGING_DIR_IMAGE)/$(UBOOT_TARGET)-u-boot*.bin \ + $(UBOOT_OFFSET) \ $@.boot \ $(IMAGE_ROOTFS) \ $(CONFIG_BANANA_PI_BOOT_PARTSIZE) \ @@ -41,6 +43,8 @@ define Device/bpi_bananapi-r2 DEVICE_DTS := mt7623n-bananapi-bpi-r2 DEVICE_PACKAGES := kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1 kmod-mmc \ mkf2fs e2fsprogs kmod-usb-ohci kmod-usb2 kmod-usb3 kmod-ata-ahci-mtk + UBOOT_ENVSIZE := 0x2000 + UBOOT_OFFSET := 320k UBOOT_TARGET := mt7623n_bpir2 IMAGES := img.gz IMAGE/img.gz := banana-pi-sdcard | gzip | append-metadata From 1113dcab05de31d52a91e99f7a63d0099415edad Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Tue, 21 Jul 2020 19:14:18 +0100 Subject: [PATCH 23/31] =?UTF-8?q?mediatek:=20mt7623:=20rename=20gen=5Fbana?= =?UTF-8?q?na=5Fpi=5Fimg.sh=20=E2=86=92=20gen=5Fmtk=5Fmmc=5Fimg.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As I buy more hardware and continue to work on consolidation, This will apply to a lot of MediaTek platforms; rename it accordingly. Signed-off-by: David Woodhouse --- target/linux/mediatek/image/Config.in | 4 ++-- .../{gen_banana_pi_img.sh => gen_mtk_mmc_img.sh} | 4 ++-- target/linux/mediatek/image/mt7623.mk | 14 +++++++------- 3 files changed, 11 insertions(+), 11 deletions(-) rename target/linux/mediatek/image/{gen_banana_pi_img.sh => gen_mtk_mmc_img.sh} (97%) diff --git a/target/linux/mediatek/image/Config.in b/target/linux/mediatek/image/Config.in index 0e5449e2f9..12d47d77b9 100644 --- a/target/linux/mediatek/image/Config.in +++ b/target/linux/mediatek/image/Config.in @@ -1,4 +1,4 @@ -config BANANA_PI_BOOT_PARTSIZE - int "Boot (SD Card) filesystem partition size (in MiB)" +config MTK_BOOT_PARTSIZE + int "Boot (SD Card/eMMC) filesystem partition size (in MiB)" depends on TARGET_mediatek_mt7623_DEVICE_bpi_bananapi-r2 || TARGET_DEVICE_mediatek_mt7623_DEVICE_bpi_bananapi-r2 default 32 diff --git a/target/linux/mediatek/image/gen_banana_pi_img.sh b/target/linux/mediatek/image/gen_mtk_mmc_img.sh similarity index 97% rename from target/linux/mediatek/image/gen_banana_pi_img.sh rename to target/linux/mediatek/image/gen_mtk_mmc_img.sh index 611a17edff..ea8a9c63a1 100755 --- a/target/linux/mediatek/image/gen_banana_pi_img.sh +++ b/target/linux/mediatek/image/gen_mtk_mmc_img.sh @@ -27,7 +27,7 @@ # The second partition is a FAT file system containing the kernel # image and a uboot.env file, which is provided to this script as # $4 (bootfs image). Its size is configurable with the -# CONFIG_BANANA_PI_BOOT_PARTSIZE option; by default 32MiB. +# CONFIG_MTK_BOOT_PARTSIZE option; by default 32MiB. # # The root filesystem comes next in the third partition. # @@ -56,7 +56,7 @@ # |----------------------| # | MBR partition #2 | # | | -# | FAT partition | ( BANANA_PI_BOOT_PARTSIZE +# | FAT partition | ( MTK_BOOT_PARTSIZE # . . default 32MiB ) # . (kernel, uEnv) . # | | diff --git a/target/linux/mediatek/image/mt7623.mk b/target/linux/mediatek/image/mt7623.mk index 1061a0d281..881092f478 100644 --- a/target/linux/mediatek/image/mt7623.mk +++ b/target/linux/mediatek/image/mt7623.mk @@ -1,30 +1,30 @@ KERNEL_LOADADDR := 0x80008000 DEVICE_VARS += UBOOT_TARGET UBOOT_OFFSET UBOOT_ENVSIZE -ifneq ($(CONFIG_BANANA_PI_BOOT_PARTSIZE),) +ifneq ($(CONFIG_MTK_BOOT_PARTSIZE),) BOOTFS_BLOCK_SIZE := 1024 -BOOTFS_BLOCKS := $(shell echo $$(($(CONFIG_BANANA_PI_BOOT_PARTSIZE)*1024*1024/$(BOOTFS_BLOCK_SIZE)))) +BOOTFS_BLOCKS := $(shell echo $$(($(CONFIG_MTK_BOOT_PARTSIZE)*1024*1024/$(BOOTFS_BLOCK_SIZE)))) endif -define Build/banana-pi-sdcard +define Build/mtk-mmc-img rm -f $@.boot mkfs.fat -C $@.boot $(BOOTFS_BLOCKS) if [ -r $(STAGING_DIR_IMAGE)/$(UBOOT_TARGET)-preloader.bin ]; then \ - ./gen_banana_pi_img.sh emmc $@.emmc \ + ./gen_mtk_mmc_img.sh emmc $@.emmc \ $(STAGING_DIR_IMAGE)/$(UBOOT_TARGET)-preloader.bin; \ mcopy -i $@.boot $@.emmc ::eMMCboot.bin; \ fi mkenvimage -s $(UBOOT_ENVSIZE) -o $(STAGING_DIR_IMAGE)/$(UBOOT_TARGET)-uboot.env $(UBOOT_TARGET)-uEnv.txt mcopy -i $@.boot $(STAGING_DIR_IMAGE)/$(UBOOT_TARGET)-uboot.env ::uboot.env mcopy -i $@.boot $(IMAGE_KERNEL) ::uImage - ./gen_banana_pi_img.sh sd $@ \ + ./gen_mtk_mmc_img.sh sd $@ \ $(STAGING_DIR_IMAGE)/$(UBOOT_TARGET)-preloader.bin \ $(STAGING_DIR_IMAGE)/$(UBOOT_TARGET)-u-boot*.bin \ $(UBOOT_OFFSET) \ $@.boot \ $(IMAGE_ROOTFS) \ - $(CONFIG_BANANA_PI_BOOT_PARTSIZE) \ + $(CONFIG_MTK_BOOT_PARTSIZE) \ $(CONFIG_TARGET_ROOTFS_PARTSIZE) endef @@ -47,7 +47,7 @@ define Device/bpi_bananapi-r2 UBOOT_OFFSET := 320k UBOOT_TARGET := mt7623n_bpir2 IMAGES := img.gz - IMAGE/img.gz := banana-pi-sdcard | gzip | append-metadata + IMAGE/img.gz := mtk-mmc-img | gzip | append-metadata ARTIFACT/preloader.bin := preloader $$(UBOOT_TARGET) ARTIFACT/scatter.txt := scatterfile $$(firstword $$(FILESYSTEMS))-$$(firstword $$(IMAGES)) ARTIFACTS = preloader.bin scatter.txt From b36422b914ef3fdc17827481b61ab7d03a1790ac Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Tue, 21 Jul 2020 19:19:40 +0100 Subject: [PATCH 24/31] mediatek: mt7623: add full system image for UniElec U7623 This adds a full eMMC image including U-Boot, which means that the kernel can inherit the true RAM size detected by the preloader. As implemented in previous commits, sysupgrade to this image from the legacy layout (and via that, from the vendor-installed image) is supported. Rename the legacy image for the 512MiB board, for clarity. Signed-off-by: David Woodhouse --- target/linux/mediatek/image/Config.in | 2 +- target/linux/mediatek/image/mt7623.mk | 30 +++++++++++++++++-- .../image/mt7623a_unielec_u7623-uEnv.txt | 20 +++++++++++++ 3 files changed, 48 insertions(+), 4 deletions(-) create mode 100644 target/linux/mediatek/image/mt7623a_unielec_u7623-uEnv.txt diff --git a/target/linux/mediatek/image/Config.in b/target/linux/mediatek/image/Config.in index 12d47d77b9..ef8536ebab 100644 --- a/target/linux/mediatek/image/Config.in +++ b/target/linux/mediatek/image/Config.in @@ -1,4 +1,4 @@ config MTK_BOOT_PARTSIZE int "Boot (SD Card/eMMC) filesystem partition size (in MiB)" - depends on TARGET_mediatek_mt7623_DEVICE_bpi_bananapi-r2 || TARGET_DEVICE_mediatek_mt7623_DEVICE_bpi_bananapi-r2 + depends on TARGET_mediatek_mt7623_DEVICE_bpi_bananapi-r2 || TARGET_DEVICE_mediatek_mt7623_DEVICE_bpi_bananapi-r2 || TARGET_mediatek_mt7623_DEVICE_unielec_u7623-emmc || TARGET_DEVICE_mediatek_mt7623_DEVICE_unielec_u7623-emmc default 32 diff --git a/target/linux/mediatek/image/mt7623.mk b/target/linux/mediatek/image/mt7623.mk index 881092f478..72758ddbaa 100644 --- a/target/linux/mediatek/image/mt7623.mk +++ b/target/linux/mediatek/image/mt7623.mk @@ -55,10 +55,33 @@ define Device/bpi_bananapi-r2 endef TARGET_DEVICES += bpi_bananapi-r2 -define Device/unielec_u7623-02-emmc-512m +# Full eMMC image including U-Boot and partition table +define Device/unielec_u7623-emmc + DEVICE_VENDOR := UniElec + DEVICE_MODEL := U7623 + DEVICE_VARIANT := eMMC + # When we use FIT images, U-Boot will populate the /memory node with the correct + # memory size discovered from the preloader, so we don't need separate builds. + DEVICE_DTS := mt7623a-unielec-u7623-02-emmc-512m + SUPPORTED_DEVICES := unielec,u7623-02-emmc-512m + UBOOT_ENVSIZE := 0x1000 + UBOOT_OFFSET := 256k + UBOOT_TARGET := mt7623a_unielec_u7623 + IMAGES := img.gz + IMAGE/img.gz := mtk-mmc-img | gzip | append-metadata + DEVICE_PACKAGES := kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1 kmod-mmc \ + mkf2fs e2fsprogs kmod-usb-ohci kmod-usb2 kmod-usb3 kmod-ata-ahci-mtk + ARTIFACT/scatter.txt := scatterfile $$(firstword $$(FILESYSTEMS))-$$(firstword $$(IMAGES)) + ARTIFACTS := scatter.txt +endef +TARGET_DEVICES += unielec_u7623-emmc + +# Legacy partial image for U7623 +# This preserves the vendor U-Boot and starts with a uImage at 0xA00 +define Device/unielec_u7623-02-emmc-512m-legacy DEVICE_VENDOR := UniElec DEVICE_MODEL := U7623-02 - DEVICE_VARIANT := eMMC/512MB RAM + DEVICE_VARIANT := eMMC/512MiB RAM (legacy image) DEVICE_DTS := mt7623a-unielec-u7623-02-emmc-512m KERNEL_NAME := zImage KERNEL := kernel-bin | append-dtb | uImage none @@ -67,5 +90,6 @@ define Device/unielec_u7623-02-emmc-512m mkf2fs e2fsprogs kmod-usb-ohci kmod-usb2 kmod-usb3 kmod-ata-ahci-mtk IMAGES := sysupgrade-emmc.bin.gz IMAGE/sysupgrade-emmc.bin.gz := sysupgrade-emmc | gzip | append-metadata + SUPPORTED_DEVICES := unielec,u7623-02-emmc-512m endef -TARGET_DEVICES += unielec_u7623-02-emmc-512m +TARGET_DEVICES += unielec_u7623-02-emmc-512m-legacy diff --git a/target/linux/mediatek/image/mt7623a_unielec_u7623-uEnv.txt b/target/linux/mediatek/image/mt7623a_unielec_u7623-uEnv.txt new file mode 100644 index 0000000000..5e5f8cae73 --- /dev/null +++ b/target/linux/mediatek/image/mt7623a_unielec_u7623-uEnv.txt @@ -0,0 +1,20 @@ +# Boot menu for UniElec U7623 +# Copyright © 2020 David Woodhouse + +kernel=uImage +loadaddr=0x88000000 +dtaddr=0x83f00000 +fdt_high=0xafffffff + +console=ttyS0,115200 +bootopts=rootfstype=squashfs,ext4 rootwait + +# Create the command line (with appropriate root=) and boot the Linux FIT image. +boot1=setenv bootargs "console=${console} root=${rootdev} ${bootopts}";printenv bootargs;\ + fatload mmc ${partition} ${loadaddr} ${kernel}; bootm + +bootmenu_0=Boot from eMMC.=setenv partition 0:2;setenv rootdev /dev/mmcblk0p3;run boot1 +bootmenu_default=0 + +bootdelay=0 +bootcmd=bootmenu From 6c57fb7aa93df862c2db201620089b2103d149aa Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Sat, 25 Jul 2020 11:08:29 +0800 Subject: [PATCH 25/31] firewall: bump to version 2020-07-05 Changes since last source version e9b90df zones: apply tcp mss clamping also on ingress path 050816a redirects: fix segmentation fault f62a52b treewide: replace unsafe string functions 23cc543 improve reload logic 9d7f49d redurects: add support to define multiple zones for dnat reflection rules f87d0b0 firewall3: defaults: fix uci flow_offloading option fe9602c rules: fix typo 7cc2a84 defaults: robustify flow table detection. Signed-off-by: Yousong Zhou --- package/network/config/firewall/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/network/config/firewall/Makefile b/package/network/config/firewall/Makefile index bf2a1060eb..16edfd3527 100644 --- a/package/network/config/firewall/Makefile +++ b/package/network/config/firewall/Makefile @@ -13,9 +13,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/firewall3.git -PKG_SOURCE_DATE:=2019-11-22 -PKG_SOURCE_VERSION:=8174814a507489ebbe8bb85c1004e1f02919ca82 -PKG_MIRROR_HASH:=84e0cca2d47470bdb1788a8ae044cc425be8ff650a1137474ba43a15040085da +PKG_SOURCE_DATE:=2020-07-25 +PKG_SOURCE_VERSION:=e9b90dfac2225927c035f6a76277b850c282dc9a +PKG_MIRROR_HASH:=9164089058b5c8d62e81806dcd2261b9f78b050fb40cd84cbd127794ad7a940e PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=ISC From ac9730c49527609e29d87e5c8600ad7313c99c19 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sun, 26 Jul 2020 18:51:56 +0200 Subject: [PATCH 26/31] mvebu: disable WRT1900AC v1 and WRT32X images for now The kernel appears to have grown too large, breaking the build for the entire target. Disable the affected images for now until the situation is dealt with. Signed-off-by: Jo-Philipp Wich --- target/linux/mvebu/image/cortexa9.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/linux/mvebu/image/cortexa9.mk b/target/linux/mvebu/image/cortexa9.mk index 5f32367431..989733df4a 100644 --- a/target/linux/mvebu/image/cortexa9.mk +++ b/target/linux/mvebu/image/cortexa9.mk @@ -109,7 +109,7 @@ define Device/linksys_wrt1900ac-v1 DEVICE_PACKAGES += mwlwifi-firmware-88w8864 KERNEL_SIZE := 3072k endef -TARGET_DEVICES += linksys_wrt1900ac-v1 +#TARGET_DEVICES += linksys_wrt1900ac-v1 define Device/linksys_wrt1900ac-v2 $(call Device/linksys) @@ -142,7 +142,7 @@ define Device/linksys_wrt32x KERNEL_SIZE := 3072k KERNEL := kernel-bin | append-dtb endef -TARGET_DEVICES += linksys_wrt32x +#TARGET_DEVICES += linksys_wrt32x define Device/marvell_a370-db $(Device/NAND-512K) From a1eb2c463352d05161a756f806e8e8a039f4490c Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Mon, 27 Jul 2020 11:05:25 +0200 Subject: [PATCH 27/31] mvebu: only disable WRT1900AC v1 and WRT32X for buildbots Use "DEFAULT := n" to only disable devices for buildbots, but keep them available for manual build. Signed-off-by: Adrian Schmutzler --- target/linux/mvebu/image/cortexa9.mk | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/target/linux/mvebu/image/cortexa9.mk b/target/linux/mvebu/image/cortexa9.mk index 989733df4a..74376f9cd7 100644 --- a/target/linux/mvebu/image/cortexa9.mk +++ b/target/linux/mvebu/image/cortexa9.mk @@ -108,8 +108,9 @@ define Device/linksys_wrt1900ac-v1 DEVICE_DTS := armada-xp-linksys-mamba DEVICE_PACKAGES += mwlwifi-firmware-88w8864 KERNEL_SIZE := 3072k + DEFAULT := n endef -#TARGET_DEVICES += linksys_wrt1900ac-v1 +TARGET_DEVICES += linksys_wrt1900ac-v1 define Device/linksys_wrt1900ac-v2 $(call Device/linksys) @@ -141,8 +142,9 @@ define Device/linksys_wrt32x DEVICE_PACKAGES += kmod-btmrvl kmod-mwifiex-sdio mwlwifi-firmware-88w8964 KERNEL_SIZE := 3072k KERNEL := kernel-bin | append-dtb + DEFAULT := n endef -#TARGET_DEVICES += linksys_wrt32x +TARGET_DEVICES += linksys_wrt32x define Device/marvell_a370-db $(Device/NAND-512K) From 0f3c3a5fb2738b25c62eb0ff8ef7d0654c0b9300 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Mon, 20 Jul 2020 15:34:04 +0200 Subject: [PATCH 28/31] layerscape: harmonize device strings OpenWrt lately has harmonized device (definition) names to the pattern vendor_model to improve overall consistency, also with other values like the DTS compatible. This patch applies that scheme to the layerscape target. Since this (intentionally) creates a bigger overlap between DTS names, compatible, and device definition name, it also moves DEVICE_DTS and SUPPORTED_DEVICES definitions to the Device/Default blocks. Apart from that, it also modifies several packages to use consistent naming in order to keep the $(1) file references working. While at it, remove one layer of complexity for the setup in tfa-layerscape package. Signed-off-by: Adrian Schmutzler --- package/boot/tfa-layerscape/Makefile | 105 ++++++++---------- package/boot/uboot-layerscape/Makefile | 54 ++++----- ...rdm-uEnv.txt => fsl_ls1012a-frdm-uEnv.txt} | 0 ...v.txt => fsl_ls1012a-frwy-sdboot-uEnv.txt} | 0 ...ardb-uEnv.txt => fsl_ls1012a-rdb-uEnv.txt} | 0 ...nv.txt => fsl_ls1021a-iot-sdboot-uEnv.txt} | 0 ...nv.txt => fsl_ls1021a-twr-sdboot-uEnv.txt} | 0 ...atwr-uEnv.txt => fsl_ls1021a-twr-uEnv.txt} | 0 ...nv.txt => fsl_ls1043a-rdb-sdboot-uEnv.txt} | 0 ...ardb-uEnv.txt => fsl_ls1043a-rdb-uEnv.txt} | 0 ...nv.txt => fsl_ls1046a-rdb-sdboot-uEnv.txt} | 0 ...ardb-uEnv.txt => fsl_ls1046a-rdb-uEnv.txt} | 0 ...nv.txt => fsl_ls1088a-rdb-sdboot-uEnv.txt} | 0 ...ardb-uEnv.txt => fsl_ls1088a-rdb-uEnv.txt} | 0 ...ardb-uEnv.txt => fsl_ls2088a-rdb-uEnv.txt} | 0 .../firmware/layerscape/fman-ucode/Makefile | 6 +- package/firmware/layerscape/ls-dpl/Makefile | 10 +- package/firmware/layerscape/ls-mc/Makefile | 6 +- package/firmware/layerscape/ls-rcw/Makefile | 48 ++++---- target/linux/layerscape/image/armv7.mk | 18 +-- target/linux/layerscape/image/armv8_64b.mk | 90 +++++++-------- 21 files changed, 155 insertions(+), 182 deletions(-) rename package/boot/uboot-layerscape/files/{ls1012afrdm-uEnv.txt => fsl_ls1012a-frdm-uEnv.txt} (100%) rename package/boot/uboot-layerscape/files/{ls1012afrwy-uEnv.txt => fsl_ls1012a-frwy-sdboot-uEnv.txt} (100%) rename package/boot/uboot-layerscape/files/{ls1012ardb-uEnv.txt => fsl_ls1012a-rdb-uEnv.txt} (100%) rename package/boot/uboot-layerscape/files/{ls1021aiot-sdboot-uEnv.txt => fsl_ls1021a-iot-sdboot-uEnv.txt} (100%) rename package/boot/uboot-layerscape/files/{ls1021atwr-sdboot-uEnv.txt => fsl_ls1021a-twr-sdboot-uEnv.txt} (100%) rename package/boot/uboot-layerscape/files/{ls1021atwr-uEnv.txt => fsl_ls1021a-twr-uEnv.txt} (100%) rename package/boot/uboot-layerscape/files/{ls1043ardb-sdboot-uEnv.txt => fsl_ls1043a-rdb-sdboot-uEnv.txt} (100%) rename package/boot/uboot-layerscape/files/{ls1043ardb-uEnv.txt => fsl_ls1043a-rdb-uEnv.txt} (100%) rename package/boot/uboot-layerscape/files/{ls1046ardb-sdboot-uEnv.txt => fsl_ls1046a-rdb-sdboot-uEnv.txt} (100%) rename package/boot/uboot-layerscape/files/{ls1046ardb-uEnv.txt => fsl_ls1046a-rdb-uEnv.txt} (100%) rename package/boot/uboot-layerscape/files/{ls1088ardb-sdboot-uEnv.txt => fsl_ls1088a-rdb-sdboot-uEnv.txt} (100%) rename package/boot/uboot-layerscape/files/{ls1088ardb-uEnv.txt => fsl_ls1088a-rdb-uEnv.txt} (100%) rename package/boot/uboot-layerscape/files/{ls2088ardb-uEnv.txt => fsl_ls2088a-rdb-uEnv.txt} (100%) diff --git a/package/boot/tfa-layerscape/Makefile b/package/boot/tfa-layerscape/Makefile index 3110a21fc3..b3e947f3b2 100644 --- a/package/boot/tfa-layerscape/Makefile +++ b/package/boot/tfa-layerscape/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=tfa-layerscape PKG_VERSION:=LSDK-20.04 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://source.codeaurora.org/external/qoriq/qoriq-components/atf @@ -37,130 +37,115 @@ define Host/Install $(INSTALL_BIN) $(HOST_BUILD_DIR)/plat/nxp/tools/byte_swap $(STAGING_DIR_HOST)/bin/tfa-byte-swap endef -define Package/tfa-layerscape/ls1012afrdm +define Package/tfa-generic + SECTION:=boot + CATEGORY:=Boot Loaders + DEPENDS:=@TARGET_layerscape_armv8_64b +layerscape-rcw +u-boot-fsl_$(subst tfa-,,$(1)) + VARIANT:=$(subst tfa-,,$(1)) +endef + +define Package/tfa-ls1012a-frdm + $(Package/tfa-generic) TITLE:=NXP LS1012AFRDM Trusted Firmware PLAT:=ls1012afrdm BOOT_MODE:=qspi - BIN_BL2:=build/ls1012afrdm/release/bl2_qspi.pbl - BIN_FIP:=build/ls1012afrdm/release/fip.bin endef -define Package/tfa-layerscape/ls1012ardb +define Package/tfa-ls1012a-rdb + $(Package/tfa-generic) TITLE:=NXP LS1012ARDB Trusted Firmware PLAT:=ls1012ardb BOOT_MODE:=qspi - BIN_BL2:=build/ls1012ardb/release/bl2_qspi.pbl - BIN_FIP:=build/ls1012ardb/release/fip.bin endef -define Package/tfa-layerscape/ls1012afrwy +define Package/tfa-ls1012a-frwy-sdboot + $(Package/tfa-generic) TITLE:=NXP LS1012AFRWY Trusted Firmware PLAT:=ls1012afrwy BOOT_MODE:=qspi - BIN_BL2:=build/ls1012afrwy/release/bl2_qspi.pbl - BIN_FIP:=build/ls1012afrwy/release/fip.bin endef -define Package/tfa-layerscape/ls1043ardb +define Package/tfa-ls1043a-rdb + $(Package/tfa-generic) TITLE:=NXP LS1043ARDB Trusted Firmware PLAT:=ls1043ardb BOOT_MODE:=nor - BIN_BL2:=build/ls1043ardb/release/bl2_nor.pbl - BIN_FIP:=build/ls1043ardb/release/fip.bin endef -define Package/tfa-layerscape/ls1043ardb-sdboot +define Package/tfa-ls1043a-rdb-sdboot + $(Package/tfa-generic) TITLE:=NXP LS1043ARDB SD Boot Trusted Firmware PLAT:=ls1043ardb BOOT_MODE:=sd - BIN_BL2:=build/ls1043ardb/release/bl2_sd.pbl - BIN_FIP:=build/ls1043ardb/release/fip.bin endef -define Package/tfa-layerscape/ls1046ardb +define Package/tfa-ls1046a-rdb + $(Package/tfa-generic) TITLE:=NXP LS1046ARDB Trusted Firmware PLAT:=ls1046ardb BOOT_MODE:=qspi - BIN_BL2:=build/ls1046ardb/release/bl2_qspi.pbl - BIN_FIP:=build/ls1046ardb/release/fip.bin endef -define Package/tfa-layerscape/ls1046ardb-sdboot +define Package/tfa-ls1046a-rdb-sdboot + $(Package/tfa-generic) TITLE:=NXP LS1046ARDB SD Boot Trusted Firmware PLAT:=ls1046ardb BOOT_MODE:=sd - BIN_BL2:=build/ls1046ardb/release/bl2_sd.pbl - BIN_FIP:=build/ls1046ardb/release/fip.bin endef -define Package/tfa-layerscape/ls1088ardb +define Package/tfa-ls1088a-rdb + $(Package/tfa-generic) TITLE:=NXP LS1088ARDB Trusted Firmware PLAT:=ls1088ardb BOOT_MODE:=qspi - BIN_BL2:=build/ls1088ardb/release/bl2_qspi.pbl - BIN_FIP:=build/ls1088ardb/release/fip.bin endef -define Package/tfa-layerscape/ls1088ardb-sdboot +define Package/tfa-ls1088a-rdb-sdboot + $(Package/tfa-generic) TITLE:=NXP LS1088ARDB SD Boot Trusted Firmware PLAT:=ls1088ardb BOOT_MODE:=sd - BIN_BL2:=build/ls1088ardb/release/bl2_sd.pbl - BIN_FIP:=build/ls1088ardb/release/fip.bin endef -define Package/tfa-layerscape/ls2088ardb +define Package/tfa-ls2088a-rdb + $(Package/tfa-generic) TITLE:=NXP LS2088ARDB Trusted Firmware PLAT:=ls2088ardb BOOT_MODE:=nor - BIN_BL2:=build/ls2088ardb/release/bl2_nor.pbl - BIN_FIP:=build/ls2088ardb/release/fip.bin -endef - -define Package/tfa-layerscape/Config - define Package/tfa-$(1) - SECTION:=boot - CATEGORY:=Boot Loaders - TITLE:=$(2) - DEPENDS:=@TARGET_layerscape_armv8_64b +layerscape-rcw +u-boot-$(1) - VARIANT:=$(1) - BIN_BL2:=$(3) - BIN_FIP:=$(4) - endef endef define Build/InstallDev $(INSTALL_DIR) $(STAGING_DIR_IMAGE) - $(CP) $(PKG_BUILD_DIR)/$(BIN_BL2) $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-bl2.pbl - $(CP) $(PKG_BUILD_DIR)/$(BIN_FIP) $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-fip.bin + $(CP) $(PKG_BUILD_DIR)/build/$(PLAT)/release/bl2_$(BOOT_MODE).pbl \ + $(STAGING_DIR_IMAGE)/fsl_$(BUILD_VARIANT)-bl2.pbl + $(CP) $(PKG_BUILD_DIR)/build/$(PLAT)/release/fip.bin \ + $(STAGING_DIR_IMAGE)/fsl_$(BUILD_VARIANT)-fip.bin endef define Build/Compile - $(eval $(Package/tfa-layerscape/$(BUILD_VARIANT))) \ + $(eval $(Package/tfa-$(BUILD_VARIANT))) \ $(MAKE) -C $(PKG_BUILD_DIR) CROSS_COMPILE=$(TARGET_CROSS) \ fip pbl PLAT=$(PLAT) BOOT_MODE=$(BOOT_MODE) \ - RCW=$(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-rcw.bin \ - BL33=$(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-uboot.bin \ + RCW=$(STAGING_DIR_IMAGE)/fsl_$(BUILD_VARIANT)-rcw.bin \ + BL33=$(STAGING_DIR_IMAGE)/fsl_$(BUILD_VARIANT)-uboot.bin \ FIPTOOL=$(STAGING_DIR_HOST)/bin/tfa-fiptool \ CREATE_PBL=$(STAGING_DIR_HOST)/bin/tfa-create-pbl \ BYTE_SWAP=$(STAGING_DIR_HOST)/bin/tfa-byte-swap endef TFAS := \ - ls1012afrdm \ - ls1012ardb \ - ls1012afrwy \ - ls1043ardb \ - ls1043ardb-sdboot \ - ls1046ardb \ - ls1046ardb-sdboot \ - ls1088ardb \ - ls1088ardb-sdboot \ - ls2088ardb + ls1012a-frdm \ + ls1012a-rdb \ + ls1012a-frwy-sdboot \ + ls1043a-rdb \ + ls1043a-rdb-sdboot \ + ls1046a-rdb \ + ls1046a-rdb-sdboot \ + ls1088a-rdb \ + ls1088a-rdb-sdboot \ + ls2088a-rdb $(eval $(call HostBuild)) $(foreach tfa,$(TFAS), \ - $(eval $(Package/tfa-layerscape/$(tfa))) \ - $(eval $(call Package/tfa-layerscape/Config,$(tfa),$(TITLE),$(BIN_BL2),$(BIN_FIP))) \ $(eval $(call BuildPackage,tfa-$(tfa))) \ ) diff --git a/package/boot/uboot-layerscape/Makefile b/package/boot/uboot-layerscape/Makefile index 1cc746f9a6..294045288b 100644 --- a/package/boot/uboot-layerscape/Makefile +++ b/package/boot/uboot-layerscape/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=uboot-layerscape PKG_VERSION:=LSDK-20.04 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://source.codeaurora.org/external/qoriq/qoriq-components/u-boot @@ -27,67 +27,67 @@ define U-Boot/Default ENV_SIZE:=0x2000 endef -define U-Boot/ls1012afrdm +define U-Boot/fsl_ls1012a-frdm NAME:=NXP LS1012AFRDM UBOOT_CONFIG:=ls1012afrdm_tfa ENV_SIZE:=0x40000 endef -define U-Boot/ls1012ardb +define U-Boot/fsl_ls1012a-rdb NAME:=NXP LS1012ARDB UBOOT_CONFIG:=ls1012ardb_tfa ENV_SIZE:=0x40000 endef -define U-Boot/ls1012afrwy +define U-Boot/fsl_ls1012a-frwy-sdboot NAME:=NXP LS1012AFRWY UBOOT_CONFIG:=ls1012afrwy_tfa ENV_SIZE:=0x10000 endef -define U-Boot/ls1043ardb +define U-Boot/fsl_ls1043a-rdb NAME:=NXP LS1043ARDB UBOOT_CONFIG:=ls1043ardb_tfa endef -define U-Boot/ls1043ardb-sdboot +define U-Boot/fsl_ls1043a-rdb-sdboot NAME:=NXP LS1043ARDB SD Card Boot UBOOT_CONFIG:=ls1043ardb_tfa endef -define U-Boot/ls1046ardb +define U-Boot/fsl_ls1046a-rdb NAME:=NXP LS1046ARDB UBOOT_CONFIG:=ls1046ardb_tfa endef -define U-Boot/ls1046ardb-sdboot +define U-Boot/fsl_ls1046a-rdb-sdboot NAME:=NXP LS1046ARDB SD Card Boot UBOOT_CONFIG:=ls1046ardb_tfa endef -define U-Boot/ls1088ardb +define U-Boot/fsl_ls1088a-rdb NAME:=NXP LS1088ARDB UBOOT_CONFIG:=ls1088ardb_tfa endef -define U-Boot/ls1088ardb-sdboot +define U-Boot/fsl_ls1088a-rdb-sdboot NAME:=NXP LS1088ARDB SD Card Boot UBOOT_CONFIG:=ls1088ardb_tfa endef -define U-Boot/ls2088ardb +define U-Boot/fsl_ls2088a-rdb NAME:=NXP LS2088ARDB UBOOT_CONFIG:=ls2088ardb_tfa endef -define U-Boot/ls1021atwr +define U-Boot/fsl_ls1021a-twr NAME:=NXP LS1021ATWR BUILD_SUBTARGET:=armv7 UBOOT_CONFIG:=ls1021atwr_nor ENV_SIZE:=0x20000 endef -define U-Boot/ls1021atwr-sdboot +define U-Boot/fsl_ls1021a-twr-sdboot NAME:=NXP LS1021ATWR SD Card Boot BUILD_SUBTARGET:=armv7 UBOOT_CONFIG:=ls1021atwr_sdcard_ifc @@ -95,7 +95,7 @@ define U-Boot/ls1021atwr-sdboot ENV_SIZE:=0x20000 endef -define U-Boot/ls1021aiot-sdboot +define U-Boot/fsl_ls1021a-iot-sdboot NAME:=NXP LS1021AIOT SD Card Boot BUILD_SUBTARGET:=armv7 UBOOT_CONFIG:=ls1021aiot_sdcard @@ -104,19 +104,19 @@ define U-Boot/ls1021aiot-sdboot endef UBOOT_TARGETS := \ - ls1012afrdm \ - ls1012ardb \ - ls1012afrwy \ - ls1043ardb \ - ls1043ardb-sdboot \ - ls1046ardb \ - ls1046ardb-sdboot \ - ls1088ardb \ - ls1088ardb-sdboot \ - ls2088ardb \ - ls1021atwr \ - ls1021atwr-sdboot \ - ls1021aiot-sdboot + fsl_ls1012a-frdm \ + fsl_ls1012a-rdb \ + fsl_ls1012a-frwy-sdboot \ + fsl_ls1043a-rdb \ + fsl_ls1043a-rdb-sdboot \ + fsl_ls1046a-rdb \ + fsl_ls1046a-rdb-sdboot \ + fsl_ls1088a-rdb \ + fsl_ls1088a-rdb-sdboot \ + fsl_ls2088a-rdb \ + fsl_ls1021a-twr \ + fsl_ls1021a-twr-sdboot \ + fsl_ls1021a-iot-sdboot define Build/InstallDev $(INSTALL_DIR) $(STAGING_DIR_IMAGE) diff --git a/package/boot/uboot-layerscape/files/ls1012afrdm-uEnv.txt b/package/boot/uboot-layerscape/files/fsl_ls1012a-frdm-uEnv.txt similarity index 100% rename from package/boot/uboot-layerscape/files/ls1012afrdm-uEnv.txt rename to package/boot/uboot-layerscape/files/fsl_ls1012a-frdm-uEnv.txt diff --git a/package/boot/uboot-layerscape/files/ls1012afrwy-uEnv.txt b/package/boot/uboot-layerscape/files/fsl_ls1012a-frwy-sdboot-uEnv.txt similarity index 100% rename from package/boot/uboot-layerscape/files/ls1012afrwy-uEnv.txt rename to package/boot/uboot-layerscape/files/fsl_ls1012a-frwy-sdboot-uEnv.txt diff --git a/package/boot/uboot-layerscape/files/ls1012ardb-uEnv.txt b/package/boot/uboot-layerscape/files/fsl_ls1012a-rdb-uEnv.txt similarity index 100% rename from package/boot/uboot-layerscape/files/ls1012ardb-uEnv.txt rename to package/boot/uboot-layerscape/files/fsl_ls1012a-rdb-uEnv.txt diff --git a/package/boot/uboot-layerscape/files/ls1021aiot-sdboot-uEnv.txt b/package/boot/uboot-layerscape/files/fsl_ls1021a-iot-sdboot-uEnv.txt similarity index 100% rename from package/boot/uboot-layerscape/files/ls1021aiot-sdboot-uEnv.txt rename to package/boot/uboot-layerscape/files/fsl_ls1021a-iot-sdboot-uEnv.txt diff --git a/package/boot/uboot-layerscape/files/ls1021atwr-sdboot-uEnv.txt b/package/boot/uboot-layerscape/files/fsl_ls1021a-twr-sdboot-uEnv.txt similarity index 100% rename from package/boot/uboot-layerscape/files/ls1021atwr-sdboot-uEnv.txt rename to package/boot/uboot-layerscape/files/fsl_ls1021a-twr-sdboot-uEnv.txt diff --git a/package/boot/uboot-layerscape/files/ls1021atwr-uEnv.txt b/package/boot/uboot-layerscape/files/fsl_ls1021a-twr-uEnv.txt similarity index 100% rename from package/boot/uboot-layerscape/files/ls1021atwr-uEnv.txt rename to package/boot/uboot-layerscape/files/fsl_ls1021a-twr-uEnv.txt diff --git a/package/boot/uboot-layerscape/files/ls1043ardb-sdboot-uEnv.txt b/package/boot/uboot-layerscape/files/fsl_ls1043a-rdb-sdboot-uEnv.txt similarity index 100% rename from package/boot/uboot-layerscape/files/ls1043ardb-sdboot-uEnv.txt rename to package/boot/uboot-layerscape/files/fsl_ls1043a-rdb-sdboot-uEnv.txt diff --git a/package/boot/uboot-layerscape/files/ls1043ardb-uEnv.txt b/package/boot/uboot-layerscape/files/fsl_ls1043a-rdb-uEnv.txt similarity index 100% rename from package/boot/uboot-layerscape/files/ls1043ardb-uEnv.txt rename to package/boot/uboot-layerscape/files/fsl_ls1043a-rdb-uEnv.txt diff --git a/package/boot/uboot-layerscape/files/ls1046ardb-sdboot-uEnv.txt b/package/boot/uboot-layerscape/files/fsl_ls1046a-rdb-sdboot-uEnv.txt similarity index 100% rename from package/boot/uboot-layerscape/files/ls1046ardb-sdboot-uEnv.txt rename to package/boot/uboot-layerscape/files/fsl_ls1046a-rdb-sdboot-uEnv.txt diff --git a/package/boot/uboot-layerscape/files/ls1046ardb-uEnv.txt b/package/boot/uboot-layerscape/files/fsl_ls1046a-rdb-uEnv.txt similarity index 100% rename from package/boot/uboot-layerscape/files/ls1046ardb-uEnv.txt rename to package/boot/uboot-layerscape/files/fsl_ls1046a-rdb-uEnv.txt diff --git a/package/boot/uboot-layerscape/files/ls1088ardb-sdboot-uEnv.txt b/package/boot/uboot-layerscape/files/fsl_ls1088a-rdb-sdboot-uEnv.txt similarity index 100% rename from package/boot/uboot-layerscape/files/ls1088ardb-sdboot-uEnv.txt rename to package/boot/uboot-layerscape/files/fsl_ls1088a-rdb-sdboot-uEnv.txt diff --git a/package/boot/uboot-layerscape/files/ls1088ardb-uEnv.txt b/package/boot/uboot-layerscape/files/fsl_ls1088a-rdb-uEnv.txt similarity index 100% rename from package/boot/uboot-layerscape/files/ls1088ardb-uEnv.txt rename to package/boot/uboot-layerscape/files/fsl_ls1088a-rdb-uEnv.txt diff --git a/package/boot/uboot-layerscape/files/ls2088ardb-uEnv.txt b/package/boot/uboot-layerscape/files/fsl_ls2088a-rdb-uEnv.txt similarity index 100% rename from package/boot/uboot-layerscape/files/ls2088ardb-uEnv.txt rename to package/boot/uboot-layerscape/files/fsl_ls2088a-rdb-uEnv.txt diff --git a/package/firmware/layerscape/fman-ucode/Makefile b/package/firmware/layerscape/fman-ucode/Makefile index ba1dcf9160..8c76774ac7 100644 --- a/package/firmware/layerscape/fman-ucode/Makefile +++ b/package/firmware/layerscape/fman-ucode/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=fman-ucode PKG_VERSION:=LSDK-20.04 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/NXP/qoriq-fm-ucode.git @@ -31,9 +31,9 @@ endef define Build/InstallDev $(INSTALL_DIR) $(STAGING_DIR_IMAGE) $(CP) $(PKG_BUILD_DIR)/fsl_fman_ucode_ls1043_r1.1_106_4_18.bin \ - $(STAGING_DIR_IMAGE)/ls1043ardb-fman.bin + $(STAGING_DIR_IMAGE)/fsl_ls1043a-rdb-fman.bin $(CP) $(PKG_BUILD_DIR)/fsl_fman_ucode_ls1046_r1.0_106_4_18.bin \ - $(STAGING_DIR_IMAGE)/ls1046ardb-fman.bin + $(STAGING_DIR_IMAGE)/fsl_ls1046a-rdb-fman.bin endef $(eval $(call BuildPackage,layerscape-fman)) diff --git a/package/firmware/layerscape/ls-dpl/Makefile b/package/firmware/layerscape/ls-dpl/Makefile index 89238dce36..d056825ac5 100644 --- a/package/firmware/layerscape/ls-dpl/Makefile +++ b/package/firmware/layerscape/ls-dpl/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ls-dpl PKG_VERSION:=LSDK-20.04 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://source.codeaurora.org/external/qoriq/qoriq-components/mc-utils @@ -33,13 +33,13 @@ MAKE_VARS+= \ define Build/InstallDev $(INSTALL_DIR) $(STAGING_DIR_IMAGE) $(CP) $(PKG_BUILD_DIR)/config/ls1088a/RDB/dpl-eth.0x1D_0x0D.dtb \ - $(STAGING_DIR_IMAGE)/ls1088ardb-dpl.dtb + $(STAGING_DIR_IMAGE)/fsl_ls1088a-rdb-dpl.dtb $(CP) $(PKG_BUILD_DIR)/config/ls1088a/RDB/dpc.0x1D-0x0D.dtb \ - $(STAGING_DIR_IMAGE)/ls1088ardb-dpc.dtb + $(STAGING_DIR_IMAGE)/fsl_ls1088a-rdb-dpc.dtb $(CP) $(PKG_BUILD_DIR)/config/ls2088a/RDB/dpl-eth.0x2A_0x41.dtb \ - $(STAGING_DIR_IMAGE)/ls2088ardb-dpl.dtb + $(STAGING_DIR_IMAGE)/fsl_ls2088a-rdb-dpl.dtb $(CP) $(PKG_BUILD_DIR)/config/ls2088a/RDB/dpc.0x2A_0x41.dtb \ - $(STAGING_DIR_IMAGE)/ls2088ardb-dpc.dtb + $(STAGING_DIR_IMAGE)/fsl_ls2088a-rdb-dpc.dtb endef $(eval $(call BuildPackage,layerscape-dpl)) diff --git a/package/firmware/layerscape/ls-mc/Makefile b/package/firmware/layerscape/ls-mc/Makefile index d7b88e01a2..0da0b91533 100644 --- a/package/firmware/layerscape/ls-mc/Makefile +++ b/package/firmware/layerscape/ls-mc/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ls-mc PKG_VERSION:=LSDK-20.04 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/NXP/qoriq-mc-binary.git @@ -31,9 +31,9 @@ endef define Build/InstallDev $(INSTALL_DIR) $(STAGING_DIR_IMAGE) $(CP) $(PKG_BUILD_DIR)/ls1088a/mc_10.20.4_ls1088a.itb \ - $(STAGING_DIR_IMAGE)/ls1088ardb-mc.itb + $(STAGING_DIR_IMAGE)/fsl_ls1088a-rdb-mc.itb $(CP) $(PKG_BUILD_DIR)/ls2088a/mc_10.20.4_ls2088a.itb \ - $(STAGING_DIR_IMAGE)/ls2088ardb-mc.itb + $(STAGING_DIR_IMAGE)/fsl_ls2088a-rdb-mc.itb endef $(eval $(call BuildPackage,layerscape-mc)) diff --git a/package/firmware/layerscape/ls-rcw/Makefile b/package/firmware/layerscape/ls-rcw/Makefile index 848c284d5c..dca0f0ff2b 100644 --- a/package/firmware/layerscape/ls-rcw/Makefile +++ b/package/firmware/layerscape/ls-rcw/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ls-rcw PKG_VERSION:=LSDK-20.04 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://source.codeaurora.org/external/qoriq/qoriq-components/rcw @@ -26,34 +26,34 @@ define Package/layerscape-rcw endef BOARDS := \ - ls1012ardb \ - ls1012afrdm \ - ls1012afrwy \ - ls1043ardb \ - ls1043ardb-sdboot \ - ls1046ardb \ - ls1046ardb-sdboot \ - ls1088ardb \ - ls1088ardb-sdboot \ - ls2088ardb \ - ls1021atwr + ls1012a-rdb \ + ls1012a-frdm \ + ls1012a-frwy-sdboot \ + ls1043a-rdb \ + ls1043a-rdb-sdboot \ + ls1046a-rdb \ + ls1046a-rdb-sdboot \ + ls1088a-rdb \ + ls1088a-rdb-sdboot \ + ls2088a-rdb \ + ls1021a-twr -RCW_ls1012ardb :=ls1012ardb/R_SPNH_3508/rcw_1000_default.bin -RCW_ls1012afrdm :=ls1012afrdm/N_SSNP_3305/rcw_800.bin -RCW_ls1012afrwy :=ls1012afrwy/N_SSNP_3305/rcw_1000_default.bin -RCW_ls1043ardb :=ls1043ardb/RR_FQPP_1455/rcw_1600.bin -RCW_ls1043ardb-sdboot :=ls1043ardb/RR_FQPP_1455/rcw_1600_sdboot.bin -RCW_ls1046ardb :=ls1046ardb/RR_FFSSPPPH_1133_5559/rcw_1800_qspiboot.bin -RCW_ls1046ardb-sdboot :=ls1046ardb/RR_FFSSPPPH_1133_5559/rcw_1800_sdboot.bin -RCW_ls1088ardb :=ls1088ardb/FCQQQQQQQQ_PPP_H_0x1d_0x0d/rcw_1600_qspi.bin -RCW_ls1088ardb-sdboot :=ls1088ardb/FCQQQQQQQQ_PPP_H_0x1d_0x0d/rcw_1600_sd.bin -RCW_ls2088ardb :=ls2088ardb/FFFFFFFF_PP_HH_0x2a_0x41/rcw_1800.bin -RCW_ls1021atwr :=ls1021atwr/SSR_PNS_30/rcw_1200.bin +RCW_ls1012a-rdb :=ls1012ardb/R_SPNH_3508/rcw_1000_default.bin +RCW_ls1012a-frdm :=ls1012afrdm/N_SSNP_3305/rcw_800.bin +RCW_ls1012a-frwy-sdboot :=ls1012afrwy/N_SSNP_3305/rcw_1000_default.bin +RCW_ls1043a-rdb :=ls1043ardb/RR_FQPP_1455/rcw_1600.bin +RCW_ls1043a-rdb-sdboot :=ls1043ardb/RR_FQPP_1455/rcw_1600_sdboot.bin +RCW_ls1046a-rdb :=ls1046ardb/RR_FFSSPPPH_1133_5559/rcw_1800_qspiboot.bin +RCW_ls1046a-rdb-sdboot :=ls1046ardb/RR_FFSSPPPH_1133_5559/rcw_1800_sdboot.bin +RCW_ls1088a-rdb :=ls1088ardb/FCQQQQQQQQ_PPP_H_0x1d_0x0d/rcw_1600_qspi.bin +RCW_ls1088a-rdb-sdboot :=ls1088ardb/FCQQQQQQQQ_PPP_H_0x1d_0x0d/rcw_1600_sd.bin +RCW_ls2088a-rdb :=ls2088ardb/FFFFFFFF_PP_HH_0x2a_0x41/rcw_1800.bin +RCW_ls1021a-twr :=ls1021atwr/SSR_PNS_30/rcw_1200.bin define Build/InstallDev $(INSTALL_DIR) $(STAGING_DIR_IMAGE) $(foreach board,$(BOARDS), \ - $(CP) $(PKG_BUILD_DIR)/$(RCW_$(board)) $(STAGING_DIR_IMAGE)/$(board)-rcw.bin;) + $(CP) $(PKG_BUILD_DIR)/$(RCW_$(board)) $(STAGING_DIR_IMAGE)/fsl_$(board)-rcw.bin;) endef $(eval $(call BuildPackage,layerscape-rcw)) diff --git a/target/linux/layerscape/image/armv7.mk b/target/linux/layerscape/image/armv7.mk index e06c99c338..8a86997399 100644 --- a/target/linux/layerscape/image/armv7.mk +++ b/target/linux/layerscape/image/armv7.mk @@ -13,18 +13,19 @@ define Device/Default KERNEL_NAME := zImage KERNEL_LOADADDR := 0x80008000 KERNEL_ENTRY_POINT := 0x80008000 + DEVICE_DTS = $(lastword $(subst _, ,$(1))) + SUPPORTED_DEVICES = $(subst _,$(comma),$(1)) IMAGE_SIZE := 64m IMAGE/sysupgrade.bin := append-kernel | pad-to 16M | \ append-rootfs | pad-rootfs | \ check-size $(LS_SYSUPGRADE_IMAGE_SIZE) | append-metadata endef -define Device/ls1021atwr +define Device/fsl_ls1021a-twr DEVICE_VENDOR := NXP DEVICE_MODEL := TWR-LS1021A DEVICE_VARIANT := Default DEVICE_PACKAGES += layerscape-rcw - DEVICE_DTS := ls1021a-twr IMAGE/firmware.bin := \ ls-clean | \ ls-append $(1)-rcw.bin | pad-to 1M | \ @@ -33,11 +34,10 @@ define Device/ls1021atwr ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to 32M | \ append-rootfs | pad-rootfs | check-size - SUPPORTED_DEVICES := fsl,ls1021a-twr endef -TARGET_DEVICES += ls1021atwr +TARGET_DEVICES += fsl_ls1021a-twr -define Device/ls1021atwr-sdboot +define Device/fsl_ls1021a-twr-sdboot DEVICE_VENDOR := NXP DEVICE_MODEL := TWR-LS1021A DEVICE_VARIANT := SD Card Boot @@ -57,16 +57,16 @@ define Device/ls1021atwr-sdboot ls-append-sdhead $(1) | pad-to 16M | \ append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \ append-rootfs | check-size $(LS_SD_IMAGE_SIZE) | append-metadata - SUPPORTED_DEVICES := fsl,ls1021a-twr-sdboot endef -TARGET_DEVICES += ls1021atwr-sdboot +TARGET_DEVICES += fsl_ls1021a-twr-sdboot -define Device/ls1021aiot-sdboot +define Device/fsl_ls1021a-iot-sdboot DEVICE_VENDOR := NXP DEVICE_MODEL := LS1021A-IoT DEVICE_VARIANT := SD Card Boot DEVICE_DTS := ls1021a-iot FILESYSTEMS := ext4 + SUPPORTED_DEVICES := IMAGES := sdcard.img IMAGE/sdcard.img := \ ls-clean | \ @@ -77,4 +77,4 @@ define Device/ls1021aiot-sdboot append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \ append-rootfs | check-size $(LS_SD_IMAGE_SIZE) endef -TARGET_DEVICES += ls1021aiot-sdboot +TARGET_DEVICES += fsl_ls1021a-iot-sdboot diff --git a/target/linux/layerscape/image/armv8_64b.mk b/target/linux/layerscape/image/armv8_64b.mk index b190e0c041..1bf956584c 100644 --- a/target/linux/layerscape/image/armv8_64b.mk +++ b/target/linux/layerscape/image/armv8_64b.mk @@ -12,20 +12,21 @@ define Device/Default KERNEL := kernel-bin | gzip | uImage gzip KERNEL_LOADADDR := 0x80080000 KERNEL_ENTRY_POINT := 0x80080000 + DEVICE_DTS = freescale/$(subst _,-,$(1)) + SUPPORTED_DEVICES = $(subst _,$(comma),$(1)) IMAGE_SIZE := 64m IMAGE/sysupgrade.bin := append-kernel | pad-to 16M | \ append-rootfs | pad-rootfs | \ check-size $(LS_SYSUPGRADE_IMAGE_SIZE) | append-metadata endef -define Device/ls1012afrdm +define Device/fsl_ls1012a-frdm DEVICE_VENDOR := NXP DEVICE_MODEL := FRDM-LS1012A DEVICE_PACKAGES += \ layerscape-ppfe \ - tfa-ls1012afrdm \ + tfa-ls1012a-frdm \ kmod-ppfe - DEVICE_DTS := freescale/fsl-ls1012a-frdm BLOCKSIZE := 256KiB IMAGE/firmware.bin := \ ls-clean | \ @@ -41,18 +42,16 @@ define Device/ls1012afrdm check-size $(LS_SYSUPGRADE_IMAGE_SIZE) | append-metadata KERNEL := kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb KERNEL_INITRAMFS := kernel-bin | fit none $$(DTS_DIR)/$$(DEVICE_DTS).dtb - SUPPORTED_DEVICES := fsl,ls1012a-frdm endef -TARGET_DEVICES += ls1012afrdm +TARGET_DEVICES += fsl_ls1012a-frdm -define Device/ls1012ardb +define Device/fsl_ls1012a-rdb DEVICE_VENDOR := NXP DEVICE_MODEL := LS1012A-RDB DEVICE_PACKAGES += \ layerscape-ppfe \ - tfa-ls1012ardb \ + tfa-ls1012a-rdb \ kmod-ppfe - DEVICE_DTS := freescale/fsl-ls1012a-rdb IMAGE/firmware.bin := \ ls-clean | \ ls-append $(1)-bl2.pbl | pad-to 1M | \ @@ -62,16 +61,15 @@ define Device/ls1012ardb ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to 32M | \ append-rootfs | pad-rootfs | check-size - SUPPORTED_DEVICES := fsl,ls1012a-rdb endef -TARGET_DEVICES += ls1012ardb +TARGET_DEVICES += fsl_ls1012a-rdb -define Device/ls1012afrwy +define Device/fsl_ls1012a-frwy-sdboot DEVICE_VENDOR := NXP DEVICE_MODEL := FRWY-LS1012A DEVICE_PACKAGES += \ layerscape-ppfe \ - tfa-ls1012afrwy \ + tfa-ls1012a-frwy-sdboot \ kmod-ppfe DEVICE_DTS := freescale/fsl-ls1012a-frwy FILESYSTEMS := ext4 @@ -94,17 +92,16 @@ define Device/ls1012afrwy ls-append-sdhead $(1) | pad-to 16M | \ append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \ append-rootfs | check-size $(LS_SD_IMAGE_SIZE) | append-metadata - SUPPORTED_DEVICES := fsl,ls1012a-frwy-sdboot endef -TARGET_DEVICES += ls1012afrwy +TARGET_DEVICES += fsl_ls1012a-frwy-sdboot -define Device/ls1043ardb +define Device/fsl_ls1043a-rdb DEVICE_VENDOR := NXP DEVICE_MODEL := LS1043A-RDB DEVICE_VARIANT := Default DEVICE_PACKAGES += \ layerscape-fman \ - tfa-ls1043ardb \ + tfa-ls1043a-rdb \ fmc fmc-eth-config DEVICE_DTS := freescale/fsl-ls1043a-rdb-sdk IMAGE/firmware.bin := \ @@ -116,17 +113,16 @@ define Device/ls1043ardb ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to 32M | \ append-rootfs | pad-rootfs | check-size - SUPPORTED_DEVICES := fsl,ls1043a-rdb endef -TARGET_DEVICES += ls1043ardb +TARGET_DEVICES += fsl_ls1043a-rdb -define Device/ls1043ardb-sdboot +define Device/fsl_ls1043a-rdb-sdboot DEVICE_VENDOR := NXP DEVICE_MODEL := LS1043A-RDB DEVICE_VARIANT := SD Card Boot DEVICE_PACKAGES += \ layerscape-fman \ - tfa-ls1043ardb-sdboot \ + tfa-ls1043a-rdb-sdboot \ fmc fmc-eth-config DEVICE_DTS := freescale/fsl-ls1043a-rdb-sdk FILESYSTEMS := ext4 @@ -137,7 +133,7 @@ define Device/ls1043ardb-sdboot ls-append $(1)-bl2.pbl | pad-to 1M | \ ls-append $(1)-fip.bin | pad-to 5M | \ ls-append $(1)-uboot-env.bin | pad-to 9M | \ - ls-append ls1043ardb-fman.bin | pad-to 15M | \ + ls-append fsl_ls1043a-rdb-fman.bin | pad-to 15M | \ ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \ append-rootfs | check-size $(LS_SD_IMAGE_SIZE) @@ -146,17 +142,16 @@ define Device/ls1043ardb-sdboot ls-append-sdhead $(1) | pad-to 16M | \ append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \ append-rootfs | check-size $(LS_SD_IMAGE_SIZE) | append-metadata - SUPPORTED_DEVICES := fsl,ls1043a-rdb-sdboot endef -TARGET_DEVICES += ls1043ardb-sdboot +TARGET_DEVICES += fsl_ls1043a-rdb-sdboot -define Device/ls1046ardb +define Device/fsl_ls1046a-rdb DEVICE_VENDOR := NXP DEVICE_MODEL := LS1046A-RDB DEVICE_VARIANT := Default DEVICE_PACKAGES += \ layerscape-fman \ - tfa-ls1046ardb \ + tfa-ls1046a-rdb \ fmc fmc-eth-config DEVICE_DTS := freescale/fsl-ls1046a-rdb-sdk IMAGE/firmware.bin := \ @@ -168,17 +163,16 @@ define Device/ls1046ardb ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to 32M | \ append-rootfs | pad-rootfs | check-size - SUPPORTED_DEVICES := fsl,ls1046a-rdb endef -TARGET_DEVICES += ls1046ardb +TARGET_DEVICES += fsl_ls1046a-rdb -define Device/ls1046ardb-sdboot +define Device/fsl_ls1046a-rdb-sdboot DEVICE_VENDOR := NXP DEVICE_MODEL := LS1046A-RDB DEVICE_VARIANT := SD Card Boot DEVICE_PACKAGES += \ layerscape-fman \ - tfa-ls1046ardb-sdboot \ + tfa-ls1046a-rdb-sdboot \ fmc fmc-eth-config DEVICE_DTS := freescale/fsl-ls1046a-rdb-sdk FILESYSTEMS := ext4 @@ -189,7 +183,7 @@ define Device/ls1046ardb-sdboot ls-append $(1)-bl2.pbl | pad-to 1M | \ ls-append $(1)-fip.bin | pad-to 5M | \ ls-append $(1)-uboot-env.bin | pad-to 9M | \ - ls-append ls1046ardb-fman.bin | pad-to 15M | \ + ls-append fsl_ls1046a-rdb-fman.bin | pad-to 15M | \ ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \ append-rootfs | check-size $(LS_SD_IMAGE_SIZE) @@ -198,20 +192,18 @@ define Device/ls1046ardb-sdboot ls-append-sdhead $(1) | pad-to 16M | \ append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \ append-rootfs | check-size $(LS_SD_IMAGE_SIZE) | append-metadata - SUPPORTED_DEVICES := fsl,ls1046a-rdb-sdboot endef -TARGET_DEVICES += ls1046ardb-sdboot +TARGET_DEVICES += fsl_ls1046a-rdb-sdboot -define Device/ls1088ardb +define Device/fsl_ls1088a-rdb DEVICE_VENDOR := NXP DEVICE_MODEL := LS1088A-RDB DEVICE_VARIANT := Default DEVICE_PACKAGES += \ layerscape-mc \ layerscape-dpl \ - tfa-ls1088ardb \ + tfa-ls1088a-rdb \ restool - DEVICE_DTS := freescale/fsl-ls1088a-rdb IMAGE/firmware.bin := \ ls-clean | \ ls-append $(1)-bl2.pbl | pad-to 1M | \ @@ -223,18 +215,17 @@ define Device/ls1088ardb ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to 32M | \ append-rootfs | pad-rootfs | check-size - SUPPORTED_DEVICES := fsl,ls1088a-rdb endef -TARGET_DEVICES += ls1088ardb +TARGET_DEVICES += fsl_ls1088a-rdb -define Device/ls1088ardb-sdboot +define Device/fsl_ls1088a-rdb-sdboot DEVICE_VENDOR := NXP DEVICE_MODEL := LS1088A-RDB DEVICE_VARIANT := SD Card Boot DEVICE_PACKAGES += \ layerscape-mc \ layerscape-dpl \ - tfa-ls1088ardb-sdboot \ + tfa-ls1088a-rdb-sdboot \ restool DEVICE_DTS := freescale/fsl-ls1088a-rdb FILESYSTEMS := ext4 @@ -245,9 +236,9 @@ define Device/ls1088ardb-sdboot ls-append $(1)-bl2.pbl | pad-to 1M | \ ls-append $(1)-fip.bin | pad-to 5M | \ ls-append $(1)-uboot-env.bin | pad-to 10M | \ - ls-append ls1088ardb-mc.itb | pad-to 13M | \ - ls-append ls1088ardb-dpl.dtb | pad-to 14M | \ - ls-append ls1088ardb-dpc.dtb | pad-to 15M | \ + ls-append fsl_ls1088a-rdb-mc.itb | pad-to 13M | \ + ls-append fsl_ls1088a-rdb-dpl.dtb | pad-to 14M | \ + ls-append fsl_ls1088a-rdb-dpc.dtb | pad-to 15M | \ ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \ append-rootfs | check-size $(LS_SD_IMAGE_SIZE) @@ -256,19 +247,17 @@ define Device/ls1088ardb-sdboot ls-append-sdhead $(1) | pad-to 16M | \ append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \ append-rootfs | check-size $(LS_SD_IMAGE_SIZE) | append-metadata - SUPPORTED_DEVICES := fsl,ls1088a-rdb-sdboot endef -TARGET_DEVICES += ls1088ardb-sdboot +TARGET_DEVICES += fsl_ls1088a-rdb-sdboot -define Device/ls2088ardb +define Device/fsl_ls2088a-rdb DEVICE_VENDOR := NXP DEVICE_MODEL := LS2088ARDB DEVICE_PACKAGES += \ layerscape-mc \ layerscape-dpl \ - tfa-ls2088ardb \ + tfa-ls2088a-rdb \ restool - DEVICE_DTS := freescale/fsl-ls2088a-rdb IMAGE/firmware.bin := \ ls-clean | \ ls-append $(1)-bl2.pbl | pad-to 1M | \ @@ -280,11 +269,10 @@ define Device/ls2088ardb ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to 32M | \ append-rootfs | pad-rootfs | check-size - SUPPORTED_DEVICES := fsl,ls2088a-rdb endef -TARGET_DEVICES += ls2088ardb +TARGET_DEVICES += fsl_ls2088a-rdb -define Device/traverse-ls1043 +define Device/traverse_ls1043 DEVICE_VENDOR := Traverse DEVICE_MODEL := LS1043 Boards KERNEL_NAME := Image @@ -314,4 +302,4 @@ define Device/traverse-ls1043 MKUBIFS_OPTS := -m 2048 -e 124KiB -c 4096 SUPPORTED_DEVICES := traverse,ls1043s traverse,ls1043v endef -TARGET_DEVICES += traverse-ls1043 +TARGET_DEVICES += traverse_ls1043 From 8126e572dd4f531c5f105b7197bc119b2b1ebb07 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Sat, 18 Jul 2020 14:59:48 +0200 Subject: [PATCH 29/31] imx6: use device-tree compatible for board name In imx6, we currently use the model from DTS to derive a board name manually in /lib/imx6.sh. However, if we have individual DTS files anyway, we can exploit generic 02_sysinfo and use the compatible as board name directly. While at it, remove the wildcards from /lib/upgrade/platform.sh as these might make code shorter, but are quite unpleasant when grepping for a specific device. Signed-off-by: Adrian Schmutzler --- package/boot/uboot-envtools/files/imx6 | 36 +++++- .../imx6/base-files/etc/board.d/02_network | 36 ++++-- target/linux/imx6/base-files/lib/imx6.sh | 103 ------------------ .../imx6/base-files/lib/preinit/01_sysinfo | 7 -- .../base-files/lib/preinit/79_move_config | 4 +- .../imx6/base-files/lib/upgrade/platform.sh | 80 ++++++++++++-- 6 files changed, 127 insertions(+), 139 deletions(-) delete mode 100644 target/linux/imx6/base-files/lib/preinit/01_sysinfo diff --git a/package/boot/uboot-envtools/files/imx6 b/package/boot/uboot-envtools/files/imx6 index 330efb2833..5d960df9cc 100644 --- a/package/boot/uboot-envtools/files/imx6 +++ b/package/boot/uboot-envtools/files/imx6 @@ -14,10 +14,31 @@ touch /etc/config/ubootenv board=$(board_name) case "$board" in -apalis*) - ubootenv_add_uci_config $(bootdev_from_uuid)boot0 -0x2200 0x2000 0x200 10 - ;; -*gw5*) +gw,imx6dl-gw51xx |\ +gw,imx6dl-gw52xx |\ +gw,imx6dl-gw53xx |\ +gw,imx6dl-gw54xx |\ +gw,imx6dl-gw551x |\ +gw,imx6dl-gw552x |\ +gw,imx6dl-gw553x |\ +gw,imx6dl-gw5904 |\ +gw,imx6dl-gw5907 |\ +gw,imx6dl-gw5910 |\ +gw,imx6dl-gw5912 |\ +gw,imx6dl-gw5913 |\ +gw,imx6q-gw51xx |\ +gw,imx6q-gw52xx |\ +gw,imx6q-gw53xx |\ +gw,imx6q-gw5400-a |\ +gw,imx6q-gw54xx |\ +gw,imx6q-gw551x |\ +gw,imx6q-gw552x |\ +gw,imx6q-gw553x |\ +gw,imx6q-gw5904 |\ +gw,imx6q-gw5907 |\ +gw,imx6q-gw5910 |\ +gw,imx6q-gw5912 |\ +gw,imx6q-gw5913 ) if [ -c /dev/mtd1 ]; then # board boots from NAND ubootenv_add_uci_config /dev/mtd1 0x0 0x20000 0x40000 @@ -28,7 +49,12 @@ apalis*) ubootenv_add_uci_config /dev/mmcblk0 0xd1400 0x20000 fi ;; -wandboard) +toradex,apalis_imx6q-eval |\ +toradex,apalis_imx6q-ixora |\ +toradex,apalis_imx6q-ixora-v1.1 ) + ubootenv_add_uci_config $(bootdev_from_uuid)boot0 -0x2200 0x2000 0x200 10 + ;; +wand,imx6dl-wandboard) ubootenv_add_uci_config "/dev/mmcblk0" "0x60000" "0x2000" "0x2000" ;; esac diff --git a/target/linux/imx6/base-files/etc/board.d/02_network b/target/linux/imx6/base-files/etc/board.d/02_network index bc0531352e..60df86e189 100755 --- a/target/linux/imx6/base-files/etc/board.d/02_network +++ b/target/linux/imx6/base-files/etc/board.d/02_network @@ -10,22 +10,34 @@ board=$(board_name) board_config_update case "$board" in -cubox-i |\ -gw51xx |\ -gw52xx |\ -gw5904 |\ -gw5907 |\ -gw5910 |\ -gw5912 |\ -gw5913) +gw,imx6dl-gw51xx |\ +gw,imx6dl-gw52xx |\ +gw,imx6dl-gw5904 |\ +gw,imx6dl-gw5907 |\ +gw,imx6dl-gw5910 |\ +gw,imx6dl-gw5912 |\ +gw,imx6dl-gw5913 |\ +gw,imx6q-gw51xx |\ +gw,imx6q-gw52xx |\ +gw,imx6q-gw5904 |\ +gw,imx6q-gw5907 |\ +gw,imx6q-gw5910 |\ +gw,imx6q-gw5912 |\ +gw,imx6q-gw5913 |\ +solidrun,cubox-i/dl |\ +solidrun,cubox-i/q ) ucidef_set_interface_lan 'eth0' ;; -gw53xx |\ -gw54xx |\ -gw552x) +gw,imx6dl-gw53xx |\ +gw,imx6dl-gw54xx |\ +gw,imx6dl-gw552x |\ +gw,imx6q-gw53xx |\ +gw,imx6q-gw5400-a |\ +gw,imx6q-gw54xx |\ +gw,imx6q-gw552x ) ucidef_set_interfaces_lan_wan 'eth0' 'eth1' ;; -wandboard) +wand,imx6dl-wandboard ) ucidef_set_interface_wan 'eth0' ;; esac diff --git a/target/linux/imx6/base-files/lib/imx6.sh b/target/linux/imx6/base-files/lib/imx6.sh index a9fd0cad94..46d2eeb006 100644 --- a/target/linux/imx6/base-files/lib/imx6.sh +++ b/target/linux/imx6/base-files/lib/imx6.sh @@ -2,9 +2,6 @@ # Copyright (C) 2010-2013 OpenWrt.org # -IMX6_BOARD_NAME= -IMX6_MODEL= - rootpartuuid() { local cmdline=$(cat /proc/cmdline) local bootpart=${cmdline##*root=} @@ -31,103 +28,3 @@ apalis_mount_boot() { mount -o rw,noatime $(bootpart_from_uuid) /boot > /dev/null } } - -imx6_board_detect() { - local machine - local name - - machine=$(cat /proc/device-tree/model) - - case "$machine" in - "Gateworks Ventana i.MX6 DualLite/Solo GW51XX" |\ - "Gateworks Ventana i.MX6 Dual/Quad GW51XX") - name="gw51xx" - ;; - - "Gateworks Ventana i.MX6 DualLite/Solo GW52XX" |\ - "Gateworks Ventana i.MX6 Dual/Quad GW52XX") - name="gw52xx" - ;; - - "Gateworks Ventana i.MX6 DualLite/Solo GW53XX" |\ - "Gateworks Ventana i.MX6 Dual/Quad GW53XX") - name="gw53xx" - ;; - - "Gateworks Ventana i.MX6 DualLite/Solo GW54XX" |\ - "Gateworks Ventana i.MX6 Dual/Quad GW54XX" |\ - "Gateworks Ventana GW5400-A") - name="gw54xx" - ;; - - "Gateworks Ventana i.MX6 Dual/Quad GW551X" |\ - "Gateworks Ventana i.MX6 DualLite/Solo GW551X") - name="gw551x" - ;; - - "Gateworks Ventana i.MX6 DualLite/Solo GW552X" |\ - "Gateworks Ventana i.MX6 Dual/Quad GW552X") - name="gw552x" - ;; - - "Gateworks Ventana i.MX6 DualLite/Solo GW553X" |\ - "Gateworks Ventana i.MX6 Dual/Quad GW553X") - name="gw553x" - ;; - - "Gateworks Ventana i.MX6 DualLite/Solo GW5904" |\ - "Gateworks Ventana i.MX6 Dual/Quad GW5904") - name="gw5904" - ;; - - "Gateworks Ventana i.MX6 DualLite/Solo GW5907" |\ - "Gateworks Ventana i.MX6 Dual/Quad GW5907") - name="gw5907" - ;; - - "Gateworks Ventana i.MX6 DualLite/Solo GW5910" |\ - "Gateworks Ventana i.MX6 Dual/Quad GW5910") - name="gw5910" - ;; - - "Gateworks Ventana i.MX6 DualLite/Solo GW5912" |\ - "Gateworks Ventana i.MX6 Dual/Quad GW5912") - name="gw5912" - ;; - - "Gateworks Ventana i.MX6 DualLite/Solo GW5913" |\ - "Gateworks Ventana i.MX6 Dual/Quad GW5913") - name="gw5913" - ;; - - "SolidRun Cubox-i Solo/DualLite" |\ - "SolidRun Cubox-i Dual/Quad") - name="cubox-i" - ;; - - "Toradex Apalis iMX6Q/D Module on Ixora Carrier Board" |\ - "Toradex Apalis iMX6Q/D Module on Ixora Carrier Board V1.1") - name="apalis,ixora" - ;; - - "Toradex Apalis iMX6Q/D Module on Apalis Evaluation Board") - name="apalis,eval" - ;; - - "Wandboard i.MX6 Dual Lite Board") - name="wandboard" - ;; - - *) - name="generic" - ;; - esac - - [ -z "$IMX6_BOARD_NAME" ] && IMX6_BOARD_NAME="$name" - [ -z "$IMX6_MODEL" ] && IMX6_MODEL="$machine" - - [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/" - - echo "$IMX6_BOARD_NAME" > /tmp/sysinfo/board_name - echo "$IMX6_MODEL" > /tmp/sysinfo/model -} diff --git a/target/linux/imx6/base-files/lib/preinit/01_sysinfo b/target/linux/imx6/base-files/lib/preinit/01_sysinfo deleted file mode 100644 index 73f9e596b2..0000000000 --- a/target/linux/imx6/base-files/lib/preinit/01_sysinfo +++ /dev/null @@ -1,7 +0,0 @@ -do_sysinfo_imx6() { - . /lib/imx6.sh - - imx6_board_detect -} - -boot_hook_add preinit_main do_sysinfo_imx6 diff --git a/target/linux/imx6/base-files/lib/preinit/79_move_config b/target/linux/imx6/base-files/lib/preinit/79_move_config index 7e30292049..baa7ffe44b 100644 --- a/target/linux/imx6/base-files/lib/preinit/79_move_config +++ b/target/linux/imx6/base-files/lib/preinit/79_move_config @@ -6,7 +6,9 @@ move_config() { local board=$(board_name) case "$board" in - apalis*) + toradex,apalis_imx6q-eval |\ + toradex,apalis_imx6q-ixora |\ + toradex,apalis_imx6q-ixora-v1.1 ) if [ -b $(bootpart_from_uuid) ]; then apalis_mount_boot [ -f "/boot/$BACKUP_FILE" ] && mv -f "/boot/$BACKUP_FILE" / diff --git a/target/linux/imx6/base-files/lib/upgrade/platform.sh b/target/linux/imx6/base-files/lib/upgrade/platform.sh index a090cc080b..79f2a5078b 100755 --- a/target/linux/imx6/base-files/lib/upgrade/platform.sh +++ b/target/linux/imx6/base-files/lib/upgrade/platform.sh @@ -8,7 +8,9 @@ RAMFS_COPY_BIN='blkid jffs2reset' enable_image_metadata_check() { case "$(board_name)" in - apalis*) + toradex,apalis_imx6q-eval |\ + toradex,apalis_imx6q-ixora |\ + toradex,apalis_imx6q-ixora-v1.1 ) REQUIRE_IMAGE_METADATA=1 ;; esac @@ -34,13 +36,39 @@ platform_check_image() { local board=$(board_name) case "$board" in - apalis*) - return 0 - ;; - *gw5*) + gw,imx6dl-gw51xx |\ + gw,imx6dl-gw52xx |\ + gw,imx6dl-gw53xx |\ + gw,imx6dl-gw54xx |\ + gw,imx6dl-gw551x |\ + gw,imx6dl-gw552x |\ + gw,imx6dl-gw553x |\ + gw,imx6dl-gw5904 |\ + gw,imx6dl-gw5907 |\ + gw,imx6dl-gw5910 |\ + gw,imx6dl-gw5912 |\ + gw,imx6dl-gw5913 |\ + gw,imx6q-gw51xx |\ + gw,imx6q-gw52xx |\ + gw,imx6q-gw53xx |\ + gw,imx6q-gw5400-a |\ + gw,imx6q-gw54xx |\ + gw,imx6q-gw551x |\ + gw,imx6q-gw552x |\ + gw,imx6q-gw553x |\ + gw,imx6q-gw5904 |\ + gw,imx6q-gw5907 |\ + gw,imx6q-gw5910 |\ + gw,imx6q-gw5912 |\ + gw,imx6q-gw5913 ) nand_do_platform_check $board $1 return $?; ;; + toradex,apalis_imx6q-eval |\ + toradex,apalis_imx6q-ixora |\ + toradex,apalis_imx6q-ixora-v1.1 ) + return 0 + ;; esac echo "Sysupgrade is not yet supported on $board." @@ -51,12 +79,38 @@ platform_do_upgrade() { local board=$(board_name) case "$board" in - apalis*) - apalis_do_upgrade "$1" - ;; - *gw5*) + gw,imx6dl-gw51xx |\ + gw,imx6dl-gw52xx |\ + gw,imx6dl-gw53xx |\ + gw,imx6dl-gw54xx |\ + gw,imx6dl-gw551x |\ + gw,imx6dl-gw552x |\ + gw,imx6dl-gw553x |\ + gw,imx6dl-gw5904 |\ + gw,imx6dl-gw5907 |\ + gw,imx6dl-gw5910 |\ + gw,imx6dl-gw5912 |\ + gw,imx6dl-gw5913 |\ + gw,imx6q-gw51xx |\ + gw,imx6q-gw52xx |\ + gw,imx6q-gw53xx |\ + gw,imx6q-gw5400-a |\ + gw,imx6q-gw54xx |\ + gw,imx6q-gw551x |\ + gw,imx6q-gw552x |\ + gw,imx6q-gw553x |\ + gw,imx6q-gw5904 |\ + gw,imx6q-gw5907 |\ + gw,imx6q-gw5910 |\ + gw,imx6q-gw5912 |\ + gw,imx6q-gw5913 ) nand_do_upgrade "$1" ;; + toradex,apalis_imx6q-eval |\ + toradex,apalis_imx6q-ixora |\ + toradex,apalis_imx6q-ixora-v1.1 ) + apalis_do_upgrade "$1" + ;; esac } @@ -64,7 +118,9 @@ platform_copy_config() { local board=$(board_name) case "$board" in - apalis*) + toradex,apalis_imx6q-eval |\ + toradex,apalis_imx6q-ixora |\ + toradex,apalis_imx6q-ixora-v1.1 ) apalis_copy_config ;; esac @@ -74,7 +130,9 @@ platform_pre_upgrade() { local board=$(board_name) case "$board" in - apalis*) + toradex,apalis_imx6q-eval |\ + toradex,apalis_imx6q-ixora |\ + toradex,apalis_imx6q-ixora-v1.1 ) [ -z "$UPGRADE_BACKUP" ] && { jffs2reset -y umount /overlay From 11bff24b3e1b10088bf6832447d18a9c9b17ef25 Mon Sep 17 00:00:00 2001 From: Josh Bendavid Date: Tue, 14 Jul 2020 17:39:21 +0200 Subject: [PATCH 30/31] ramips: add support for D-Link DIR-1960 A1 This patch adds support for D-Link DIR-1960 A1. Given the similarity with the DIR-1760/2660 A1, this patch also introduces a common DTSI which can be shared with these devices, with support to be added in future commits. Specifications: * Board: AP-MTKH7-0002 * SoC: MediaTek MT7621AT * RAM: 256 MB (DDR3) * Flash: 128 MB (NAND) * WiFi: MediaTek MT7615N (x2) * Switch: 1 WAN, 4 LAN (Gigabit) * Ports: 1 USB 3.0 * Buttons: Reset, WPS * LEDs: Power (white/orange), Internet (white/orange), WiFi 2.4G (white), WiFi 5G (white), USB 3.0 (white) Notes: * WiFi 2.4G and WiFi 5G LEDs are wired directly to the wireless chips Installation: * D-Link Recovery GUI: power down the router, press and hold the reset button, then re-plug it. Keep the reset button pressed until the power LED starts flashing orange, manually assign a static IP address under the 192.168.0.xxx subnet (e.g. 192.168.0.2) and go to http://192.168.0.1 * Some modern browsers may have problems flashing via the Recovery GUI, if that occurs consider uploading the firmware through cURL: curl -v -i -F "firmware=@file.bin" 192.168.0.1 MAC addresses: lan factory 0xe000 *:EB (label) wan factory 0xe006 *:EE 2.4 factory 0xe000 +1 *:EC 5.0 factory 0xe000 +2 *:ED Seems like vendor didn't replace the dummy entrys in the calibration data. Signed-off-by: Josh Bendavid [fix whitespace issues, create patch to merge DIR-1960 first, move special WiFi MAC settings to DTS, extend commit message] Signed-off-by: Adrian Schmutzler --- .../ramips/dts/mt7621_dlink_dir-1960-a1.dts | 57 ++++++ .../ramips/dts/mt7621_dlink_dir-xx60-a1.dtsi | 163 ++++++++++++++++++ target/linux/ramips/image/mt7621.mk | 23 +++ .../mt7621/base-files/etc/board.d/01_leds | 3 + .../mt7621/base-files/lib/upgrade/platform.sh | 1 + 5 files changed, 247 insertions(+) create mode 100644 target/linux/ramips/dts/mt7621_dlink_dir-1960-a1.dts create mode 100644 target/linux/ramips/dts/mt7621_dlink_dir-xx60-a1.dtsi diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-1960-a1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-1960-a1.dts new file mode 100644 index 0000000000..ed8b188994 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_dlink_dir-1960-a1.dts @@ -0,0 +1,57 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "mt7621_dlink_dir-xx60-a1.dtsi" + +/ { + compatible = "dlink,dir-1960-a1", "mediatek,mt7621-soc"; + model = "D-Link DIR-1960 A1"; + + aliases { + led-boot = &led_power_orange; + led-failsafe = &led_power_white; + led-running = &led_power_white; + led-upgrade = &led_net_orange; + }; + + leds { + compatible = "gpio-leds"; + + led_power_orange: power_orange { + label = "dir-1960-a1:orange:power"; + gpios = <&gpio 8 GPIO_ACTIVE_LOW>; + }; + + led_power_white: power_white { + label = "dir-1960-a1:white:power"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + + led_net_orange: net_orange { + label = "dir-1960-a1:orange:net"; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + }; + + net_white { + label = "dir-1960-a1:white:net"; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + }; + + usb_white { + label = "dir-1960-a1:white:usb"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + trigger-sources = <&xhci_ehci_port1>; + linux,default-trigger = "usbport"; + }; + }; +}; + +&wifi0 { + mtd-mac-address = <&factory 0xe000>; + mtd-mac-address-increment = <1>; +}; + +&wifi1 { + mtd-mac-address = <&factory 0xe000>; + mtd-mac-address-increment = <2>; +}; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-xx60-a1.dtsi b/target/linux/ramips/dts/mt7621_dlink_dir-xx60-a1.dtsi new file mode 100644 index 0000000000..e194592b57 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_dlink_dir-xx60-a1.dtsi @@ -0,0 +1,163 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621.dtsi" + +#include +#include + +/ { + aliases { + label-mac-device = &gmac0; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; + +&nand { + status = "okay"; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "Bootloader"; + reg = <0x0 0x80000>; + read-only; + }; + + partition@80000 { + label = "config"; + reg = <0x80000 0x80000>; + read-only; + }; + + factory: partition@100000 { + label = "factory"; + reg = <0x100000 0x40000>; + read-only; + }; + + partition@140000 { + label = "config2"; + reg = <0x140000 0x40000>; + read-only; + }; + + partition@180000 { + label = "firmware"; + compatible = "sge,uimage"; + reg = <0x180000 0x2800000>; + }; + + partition@2980000 { + label = "private"; + reg = <0x2980000 0x2000000>; + read-only; + }; + + partition@4980000 { + label = "firmware2"; + compatible = "sge,uimage"; + reg = <0x4980000 0x2800000>; + }; + + partition@7180000 { + label = "mydlink"; + reg = <0x7180000 0x600000>; + read-only; + }; + + partition@7780000 { + label = "reserved"; + reg = <0x7780000 0x880000>; + read-only; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi0: wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x0000>; + ieee80211-freq-limit = <2400000 2500000>; + + led { + led-active-low; + }; + }; +}; + +&pcie1 { + wifi1: wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + + led { + led-active-low; + }; + }; +}; + +&gmac0 { + mtd-mac-address = <&factory 0xe000>; +}; + +&switch0 { + ports { + port@0 { + status = "okay"; + label = "lan4"; + }; + + port@1 { + status = "okay"; + label = "lan3"; + }; + + port@2 { + status = "okay"; + label = "lan2"; + }; + + port@3 { + status = "okay"; + label = "lan1"; + }; + + port@4 { + status = "okay"; + label = "wan"; + mtd-mac-address = <&factory 0xe006>; + }; + }; +}; + +&state_default { + gpio { + groups = "i2c", "uart3", "jtag", "wdt"; + function = "gpio"; + }; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 6a9d49b32c..f13be3d3bc 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -232,6 +232,29 @@ define Device/dlink_dir-8xx-a1 check-size endef +define Device/dlink_dir-xx60-a1 + BLOCKSIZE := 128k + PAGESIZE := 2048 + KERNEL_SIZE := 4096k + IMAGE_SIZE := 40960k + UBINIZE_OPTS := -E 5 + DEVICE_VENDOR := D-Link + DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware wpad-basic \ + kmod-usb3 kmod-usb-ledtrig-usbport + KERNEL := $$(KERNEL) | uimage-padhdr 96 + IMAGES += factory.bin + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata + IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \ + check-size +endef + +define Device/dlink_dir-1960-a1 + $(Device/dlink_dir-xx60-a1) + DEVICE_MODEL := DIR-1960 + DEVICE_VARIANT := A1 +endef +TARGET_DEVICES += dlink_dir-1960-a1 + define Device/dlink_dir-860l-b1 $(Device/seama) BLOCKSIZE := 64k diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds index 43cd77ccd1..63c0bce083 100755 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds @@ -26,6 +26,9 @@ d-team,pbr-m1|\ gehua,ghl-r-001) ucidef_set_led_netdev "internet" "internet" "$boardname:blue:internet" "wan" ;; +dlink,dir-1960-a1) + ucidef_set_led_netdev "wan" "wan" "$boardname:white:net" "wan" + ;; dlink,dir-860l-b1|\ dlink,dir-867-a1|\ dlink,dir-878-a1|\ diff --git a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh index 01db733c98..a411a7a033 100755 --- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh @@ -44,6 +44,7 @@ platform_do_upgrade() { case "$board" in asus,rt-ac65p|\ asus,rt-ac85p|\ + dlink,dir-1960-a1|\ hiwifi,hc5962|\ linksys,ea7300-v1|\ linksys,ea7500-v2|\ From 88689da65f56e0148503b8849334e810c0baf0db Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Sat, 25 Jul 2020 20:29:14 +0200 Subject: [PATCH 31/31] lantiq: fix cosmetic issues with partition offsets and sizes This fixes a few cosmetic issues with partition offset and size that are inconsistent probably due to copy/pasting. Signed-off-by: Adrian Schmutzler --- .../arch/mips/boot/dts/lantiq/amazonse_netgear_dgn1000b.dts | 4 ++-- .../mips/boot/dts/lantiq/danube_arcadyan_arv4518pwr01.dtsi | 2 +- .../arch/mips/boot/dts/lantiq/danube_arcadyan_arv4525pw.dts | 2 +- .../arch/mips/boot/dts/lantiq/danube_arcadyan_arv7518pw.dts | 2 +- .../arch/mips/boot/dts/lantiq/danube_arcadyan_arv7525pw.dts | 2 +- .../arch/mips/boot/dts/lantiq/vr9_lantiq_easy80920.dtsi | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/amazonse_netgear_dgn1000b.dts b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/amazonse_netgear_dgn1000b.dts index 943b00f898..ca530e39d3 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/amazonse_netgear_dgn1000b.dts +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/amazonse_netgear_dgn1000b.dts @@ -136,8 +136,8 @@ read-only; }; - partition@500000 { - reg = <0x50000 0x003a0000>; + partition@50000 { + reg = <0x50000 0x3a0000>; label = "kernel"; }; }; diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4518pwr01.dtsi b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4518pwr01.dtsi index dcae06d894..3ed49e4a62 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4518pwr01.dtsi +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4518pwr01.dtsi @@ -155,7 +155,7 @@ reg = <0x20000 0x3d0000>; }; - boardconfig: partition@400000 { + boardconfig: partition@3f0000 { label = "boardconfig"; reg = <0x3f0000 0x10000>; read-only; diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4525pw.dts b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4525pw.dts index cceb42164e..fb240b2ed8 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4525pw.dts +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4525pw.dts @@ -126,7 +126,7 @@ reg = <0x20000 0x3d0000>; }; - boardconfig: partition@400000 { + boardconfig: partition@3f0000 { label = "boardconfig"; reg = <0x3f0000 0x10000>; read-only; diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7518pw.dts b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7518pw.dts index b5e8845576..5afc157036 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7518pw.dts +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7518pw.dts @@ -181,7 +181,7 @@ reg = <0x20000 0x7d0000>; }; - boardconfig: partition@400000 { + boardconfig: partition@7f0000 { label = "boardconfig"; reg = <0x7f0000 0x10000>; read-only; diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7525pw.dts b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7525pw.dts index d673c9b204..437fecec9d 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7525pw.dts +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7525pw.dts @@ -119,7 +119,7 @@ reg = <0x20000 0x3d0000>; }; - boardconfig: partition@400000 { + boardconfig: partition@3f0000 { label = "board_config"; reg = <0x3f0000 0x10000>; read-only; diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_lantiq_easy80920.dtsi b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_lantiq_easy80920.dtsi index f5ea12b7e2..223ff7dcf6 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_lantiq_easy80920.dtsi +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_lantiq_easy80920.dtsi @@ -245,8 +245,8 @@ read-only; }; - partition@500000 { - reg = <0x50000 0x003a0000>; + partition@50000 { + reg = <0x50000 0x3a0000>; label = "kernel"; }; };