From 361c670a468cac8def368ed95487c72cfdb4a3fa Mon Sep 17 00:00:00 2001 From: Sebastian Schaper Date: Wed, 3 Jun 2020 21:15:09 +0200 Subject: [PATCH 01/70] ath79: add support for D-Link DAP-1330/DAP-1365 A1 Port device support for DAP-1330 from the ar71xx target to ath79. Additionally, images are generated for the European through-socket case variant DAP-1365. Both devices run the same vendor firmware, the only difference being the DAP_SIGNATURE field in the factory header. The vendor's Web UI will display a model string stored in the flash. Specifications: * QCA9533, 8 MiB Flash, 64 MiB RAM * One Ethernet Port (10/100) * Wall-plug style case (DAP-1365 with additional socket) * LED bargraph RSSI indicator Installation: * Web UI: http://192.168.0.50 (or different address obtained via DHCP) There is no password set by default * Recovery Web UI: Keep reset button pressed during power-on until LED starts flashing red, upgrade via http://192.168.0.50 * Some modern browsers may have problems flashing via the Web UI, if this occurs consider booting to recovery mode and flashing via: curl -F \ files=@openwrt-ath79-generic-dlink_dap-1330-a1-squashfs-factory.bin \ http://192.168.0.50/cgi/index The device will use the same MAC address for both wired and wireless interfaces, however it is stored at two different locations in the flash. Signed-off-by: Sebastian Schaper --- .../ath79/dts/qca9533_dlink_dap-1330-a1.dts | 9 ++ .../ath79/dts/qca9533_dlink_dap-1365-a1.dts | 9 ++ .../ath79/dts/qca9533_dlink_dap-13xx.dtsi | 127 ++++++++++++++++++ .../generic/base-files/etc/board.d/01_leds | 8 ++ .../generic/base-files/etc/board.d/02_network | 10 +- .../etc/hotplug.d/ieee80211/10_fix_wifi_mac | 2 + .../etc/uci-defaults/04_led_migration | 7 + target/linux/ath79/image/generic.mk | 27 ++++ 8 files changed, 196 insertions(+), 3 deletions(-) create mode 100644 target/linux/ath79/dts/qca9533_dlink_dap-1330-a1.dts create mode 100644 target/linux/ath79/dts/qca9533_dlink_dap-1365-a1.dts create mode 100644 target/linux/ath79/dts/qca9533_dlink_dap-13xx.dtsi diff --git a/target/linux/ath79/dts/qca9533_dlink_dap-1330-a1.dts b/target/linux/ath79/dts/qca9533_dlink_dap-1330-a1.dts new file mode 100644 index 0000000000..3ec36ad9dd --- /dev/null +++ b/target/linux/ath79/dts/qca9533_dlink_dap-1330-a1.dts @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "qca9533_dlink_dap-13xx.dtsi" + +/ { + compatible = "dlink,dap-1330-a1", "qca,qca9533"; + model = "D-Link DAP-1330 A1"; +}; diff --git a/target/linux/ath79/dts/qca9533_dlink_dap-1365-a1.dts b/target/linux/ath79/dts/qca9533_dlink_dap-1365-a1.dts new file mode 100644 index 0000000000..3b153740c6 --- /dev/null +++ b/target/linux/ath79/dts/qca9533_dlink_dap-1365-a1.dts @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "qca9533_dlink_dap-13xx.dtsi" + +/ { + compatible = "dlink,dap-1365-a1", "qca,qca9533"; + model = "D-Link DAP-1365 A1"; +}; diff --git a/target/linux/ath79/dts/qca9533_dlink_dap-13xx.dtsi b/target/linux/ath79/dts/qca9533_dlink_dap-13xx.dtsi new file mode 100644 index 0000000000..8823312d08 --- /dev/null +++ b/target/linux/ath79/dts/qca9533_dlink_dap-13xx.dtsi @@ -0,0 +1,127 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include +#include + +#include "qca953x.dtsi" + +/ { + aliases { + led-boot = &led_power; + led-failsafe = &led_status; + led-running = &led_power; + led-upgrade = &led_status; + }; + + keys { + compatible = "gpio-keys"; + + wps { + label = "wps"; + linux,code = ; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + }; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "d-link:green:power"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + + led_status: status { + label = "d-link:red:status"; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + }; + + rssilow { + label = "d-link:red:rssilow"; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + }; + + rssimediumlow { + label = "d-link:green:rssimediumlow"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + rssimediumhigh { + label = "d-link:green:rssimediumhigh"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + rssihigh { + label = "d-link:green:rssihigh"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&spi { + status = "okay"; + + num-cs = <1>; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x10000>; + read-only; + }; + + art: partition@10000 { + label = "art"; + reg = <0x10000 0x10000>; + read-only; + }; + + partition@20000 { + label = "mp"; + reg = <0x20000 0x10000>; + read-only; + }; + + partition@30000 { + label = "config"; + reg = <0x30000 0x10000>; + read-only; + }; + + partition@40000 { + label = "firmware"; + reg = <0x40000 0x7c0000>; + compatible = "denx,uimage"; + }; + }; + }; +}; + +&uart { + status = "okay"; +}; + +ð0 { + status = "okay"; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; +}; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/01_leds b/target/linux/ath79/generic/base-files/etc/board.d/01_leds index f3e3b758b5..f3f8742560 100755 --- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds @@ -132,6 +132,14 @@ compex,wpj531-16m) devolo,magic-2-wifi) ucidef_set_led_netdev "plcw" "dLAN" "devolo:white:dlan" "eth0.1" "rx" ;; +dlink,dap-1330-a1|\ +dlink,dap-1365-a1) + ucidef_set_rssimon "wlan0" "200000" "1" + ucidef_set_led_rssi "rssilow" "RSSILOW" "d-link:red:rssilow" "wlan0" "1" "25" + ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "d-link:green:rssimediumlow" "wlan0" "1" "100" + ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "d-link:green:rssimediumhigh" "wlan0" "51" "100" + ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "d-link:green:rssihigh" "wlan0" "76" "100" + ;; dlink,dir-859-a1) ucidef_set_led_switch "internet" "WAN" "$boardname:green:internet" "switch0" "0x20" ;; 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 eb43788fce..f93d914374 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 @@ -23,6 +23,8 @@ ath79_setup_interfaces() devolo,dvl1750c|\ devolo,dvl1750i|\ devolo,dvl1750x|\ + dlink,dap-1330-a1|\ + dlink,dap-1365-a1|\ dlink,dir-505|\ engenius,ecb1750|\ enterasys,ws-ap3705i|\ @@ -386,13 +388,15 @@ ath79_setup_macs() devolo,magic-2-wifi) label_mac=$(macaddr_add "$(mtd_get_mac_binary art 0x1002)" 3) ;; - dlink,dap-2695-a1) - label_mac=$(mtd_get_mac_ascii bdcfg "wlanmac") - ;; + dlink,dap-1330-a1|\ + dlink,dap-1365-a1|\ dlink,dch-g020-a1) lan_mac=$(mtd_get_mac_text "mp" 0x1) label_mac=$lan_mac ;; + dlink,dap-2695-a1) + label_mac=$(mtd_get_mac_ascii bdcfg "wlanmac") + ;; dlink,dir-825-b1) lan_mac=$(mtd_get_mac_text "caldata" 0xffa0) wan_mac=$(mtd_get_mac_text "caldata" 0xffb4) diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac index cf582b8465..8ea23a8ac6 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac @@ -17,6 +17,8 @@ case "$board" in adtran,bsap1840) macaddr_add "$(mtd_get_mac_binary 'Board data' 2)" $(($PHYNBR * 8 + 1)) > /sys${DEVPATH}/macaddress ;; + dlink,dap-1330-a1|\ + dlink,dap-1365-a1|\ dlink,dch-g020-a1) mtd_get_mac_text "mp" 0x13 > /sys${DEVPATH}/macaddress ;; diff --git a/target/linux/ath79/generic/base-files/etc/uci-defaults/04_led_migration b/target/linux/ath79/generic/base-files/etc/uci-defaults/04_led_migration index 23a9c8282f..0f68209c9b 100644 --- a/target/linux/ath79/generic/base-files/etc/uci-defaults/04_led_migration +++ b/target/linux/ath79/generic/base-files/etc/uci-defaults/04_led_migration @@ -8,6 +8,13 @@ case "$board" in arduino,yun) migrate_leds "arduino:=yun:" ;; +dlink,dap-1330-a1) + migrate_leds ":red:power=:red:status" \ + ":red:wifi=:red:rssilow" \ + ":green:wifi=:green:rssimediumlow" \ + ":green:signal1=:green:rssimediumhigh" \ + ":green:signal2=:green:rssihigh" + ;; engenius,epg5000) migrate_leds ":wlan-2g=:wlan2g" ":wlan-5g=:wlan5g" ;; diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 46a8705b85..8dc16983e1 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -565,6 +565,33 @@ define Device/devolo_magic-2-wifi endef TARGET_DEVICES += devolo_magic-2-wifi +define Device/dlink_dap-13xx + SOC := qca9533 + DEVICE_VENDOR := D-Link + DEVICE_PACKAGES += rssileds + IMAGE_SIZE := 7936k + IMAGES += factory.bin + IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \ + append-rootfs | pad-rootfs | check-size | mkdapimg2 0xE0000 +endef + +define Device/dlink_dap-1330-a1 + $(Device/dlink_dap-13xx) + DEVICE_MODEL := DAP-1330 + DEVICE_VARIANT := A1 + DAP_SIGNATURE := HONEYBEE-FIRMWARE-DAP-1330 + SUPPORTED_DEVICES += dap-1330-a1 +endef +TARGET_DEVICES += dlink_dap-1330-a1 + +define Device/dlink_dap-1365-a1 + $(Device/dlink_dap-13xx) + DEVICE_MODEL := DAP-1365 + DEVICE_VARIANT := A1 + DAP_SIGNATURE := HONEYBEE-FIRMWARE-DAP-1365 +endef +TARGET_DEVICES += dlink_dap-1365-a1 + define Device/dlink_dap-2695-a1 SOC := qca9558 DEVICE_PACKAGES := ath10k-firmware-qca988x-ct kmod-ath10k-ct From c7b750e7ac833c1627d4fbe69b7cf43c6ff87f7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Thu, 9 Jul 2020 09:04:54 +0200 Subject: [PATCH 02/70] treewide: kernel: drop redundant USB_EHCI_HCD=n config symbol MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit e53ec043bae1 ("kirkwood: move usb support to modules") has moved this config symbol into generic configs, so it could be removed from other configs. Suggested-by: Aleksander Jan Bajkowski Signed-off-by: Petr Štetiar --- target/linux/bcm27xx/bcm2708/config-5.4 | 1 - target/linux/bcm27xx/bcm2709/config-5.4 | 1 - target/linux/bcm27xx/bcm2710/config-5.4 | 1 - target/linux/bcm27xx/bcm2711/config-5.4 | 1 - target/linux/ipq40xx/config-4.19 | 1 - target/linux/ipq40xx/config-5.4 | 1 - target/linux/ipq806x/config-4.19 | 1 - target/linux/lantiq/ase/config-4.19 | 1 - target/linux/lantiq/ase/config-5.4 | 1 - target/linux/lantiq/xrx200/config-4.19 | 1 - target/linux/lantiq/xrx200/config-5.4 | 1 - target/linux/lantiq/xway/config-4.19 | 1 - target/linux/lantiq/xway/config-5.4 | 1 - target/linux/lantiq/xway_legacy/config-4.19 | 1 - target/linux/lantiq/xway_legacy/config-5.4 | 1 - target/linux/mediatek/mt7622/config-4.19 | 1 - target/linux/mediatek/mt7622/config-5.4 | 1 - target/linux/mediatek/mt7623/config-4.19 | 1 - target/linux/mediatek/mt7629/config-4.19 | 1 - target/linux/mediatek/mt7629/config-5.4 | 1 - target/linux/octeontx/config-5.4 | 1 - 21 files changed, 21 deletions(-) diff --git a/target/linux/bcm27xx/bcm2708/config-5.4 b/target/linux/bcm27xx/bcm2708/config-5.4 index df69d191ce..1f3fbbdf3a 100644 --- a/target/linux/bcm27xx/bcm2708/config-5.4 +++ b/target/linux/bcm27xx/bcm2708/config-5.4 @@ -393,7 +393,6 @@ CONFIG_USB=y CONFIG_USB_ANNOUNCE_NEW_DEVICES=y CONFIG_USB_COMMON=y CONFIG_USB_DWCOTG=y -# CONFIG_USB_EHCI_HCD is not set CONFIG_USB_NET_DRIVERS=y CONFIG_USB_NET_SMSC95XX=y CONFIG_USB_STORAGE=y diff --git a/target/linux/bcm27xx/bcm2709/config-5.4 b/target/linux/bcm27xx/bcm2709/config-5.4 index 0e3170746c..2d4e438ced 100644 --- a/target/linux/bcm27xx/bcm2709/config-5.4 +++ b/target/linux/bcm27xx/bcm2709/config-5.4 @@ -501,7 +501,6 @@ CONFIG_USB=y CONFIG_USB_ANNOUNCE_NEW_DEVICES=y CONFIG_USB_COMMON=y CONFIG_USB_DWCOTG=y -# CONFIG_USB_EHCI_HCD is not set CONFIG_USB_LAN78XX=y CONFIG_USB_NET_DRIVERS=y CONFIG_USB_NET_SMSC95XX=y diff --git a/target/linux/bcm27xx/bcm2710/config-5.4 b/target/linux/bcm27xx/bcm2710/config-5.4 index 60bdd25901..aa9be56ca2 100644 --- a/target/linux/bcm27xx/bcm2710/config-5.4 +++ b/target/linux/bcm27xx/bcm2710/config-5.4 @@ -578,7 +578,6 @@ CONFIG_USB=y CONFIG_USB_ANNOUNCE_NEW_DEVICES=y CONFIG_USB_COMMON=y CONFIG_USB_DWCOTG=y -# CONFIG_USB_EHCI_HCD is not set CONFIG_USB_LAN78XX=y CONFIG_USB_NET_DRIVERS=y CONFIG_USB_NET_SMSC95XX=y diff --git a/target/linux/bcm27xx/bcm2711/config-5.4 b/target/linux/bcm27xx/bcm2711/config-5.4 index 0463dcdebf..935a06fb72 100644 --- a/target/linux/bcm27xx/bcm2711/config-5.4 +++ b/target/linux/bcm27xx/bcm2711/config-5.4 @@ -588,7 +588,6 @@ CONFIG_USB=y CONFIG_USB_ANNOUNCE_NEW_DEVICES=y CONFIG_USB_COMMON=y CONFIG_USB_DWCOTG=y -# CONFIG_USB_EHCI_HCD is not set CONFIG_USB_PCI=y CONFIG_USB_STORAGE=y CONFIG_USB_SUPPORT=y diff --git a/target/linux/ipq40xx/config-4.19 b/target/linux/ipq40xx/config-4.19 index 7cea66e50d..919f336fb7 100644 --- a/target/linux/ipq40xx/config-4.19 +++ b/target/linux/ipq40xx/config-4.19 @@ -496,7 +496,6 @@ CONFIG_UEVENT_HELPER_PATH="" CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h" CONFIG_USB=y CONFIG_USB_COMMON=y -# CONFIG_USB_EHCI_HCD is not set CONFIG_USB_SUPPORT=y CONFIG_USE_OF=y CONFIG_VDSO=y diff --git a/target/linux/ipq40xx/config-5.4 b/target/linux/ipq40xx/config-5.4 index 33551a95e7..7900c9c04c 100644 --- a/target/linux/ipq40xx/config-5.4 +++ b/target/linux/ipq40xx/config-5.4 @@ -530,7 +530,6 @@ CONFIG_UNWINDER_ARM=y # CONFIG_UNWINDER_FRAME_POINTER is not set CONFIG_USB=y CONFIG_USB_COMMON=y -# CONFIG_USB_EHCI_HCD is not set CONFIG_USB_SUPPORT=y CONFIG_USE_OF=y CONFIG_VDSO=y diff --git a/target/linux/ipq806x/config-4.19 b/target/linux/ipq806x/config-4.19 index 750057fd34..bdbfca1501 100644 --- a/target/linux/ipq806x/config-4.19 +++ b/target/linux/ipq806x/config-4.19 @@ -493,7 +493,6 @@ CONFIG_UEVENT_HELPER_PATH="" CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h" CONFIG_USB=y CONFIG_USB_COMMON=y -# CONFIG_USB_EHCI_HCD is not set CONFIG_USB_SUPPORT=y CONFIG_USE_OF=y CONFIG_VDSO=y diff --git a/target/linux/lantiq/ase/config-4.19 b/target/linux/lantiq/ase/config-4.19 index 0c211847d2..da9c1bc294 100644 --- a/target/linux/lantiq/ase/config-4.19 +++ b/target/linux/lantiq/ase/config-4.19 @@ -19,7 +19,6 @@ CONFIG_SOC_AMAZON_SE=y # CONFIG_SOC_XWAY is not set CONFIG_USB=y CONFIG_USB_COMMON=y -# CONFIG_USB_EHCI_HCD is not set CONFIG_USB_SUPPORT=y CONFIG_ZLIB_DEFLATE=y CONFIG_ZLIB_INFLATE=y diff --git a/target/linux/lantiq/ase/config-5.4 b/target/linux/lantiq/ase/config-5.4 index 455cd54d10..9b6dd41a14 100644 --- a/target/linux/lantiq/ase/config-5.4 +++ b/target/linux/lantiq/ase/config-5.4 @@ -22,7 +22,6 @@ CONFIG_SOC_AMAZON_SE=y CONFIG_TARGET_ISA_REV=1 CONFIG_USB=y CONFIG_USB_COMMON=y -# CONFIG_USB_EHCI_HCD is not set CONFIG_USB_SUPPORT=y CONFIG_ZLIB_DEFLATE=y CONFIG_ZLIB_INFLATE=y diff --git a/target/linux/lantiq/xrx200/config-4.19 b/target/linux/lantiq/xrx200/config-4.19 index c9451ec363..1c506f8ae7 100644 --- a/target/linux/lantiq/xrx200/config-4.19 +++ b/target/linux/lantiq/xrx200/config-4.19 @@ -83,7 +83,6 @@ CONFIG_UBIFS_FS_LZO=y CONFIG_UBIFS_FS_ZLIB=y CONFIG_USB=y CONFIG_USB_COMMON=y -# CONFIG_USB_EHCI_HCD is not set CONFIG_USB_SUPPORT=y CONFIG_XPS=y CONFIG_XRX200_PHY_FW=y diff --git a/target/linux/lantiq/xrx200/config-5.4 b/target/linux/lantiq/xrx200/config-5.4 index b3749b927a..7fc008b5c5 100644 --- a/target/linux/lantiq/xrx200/config-5.4 +++ b/target/linux/lantiq/xrx200/config-5.4 @@ -89,7 +89,6 @@ CONFIG_UBIFS_FS_ZLIB=y CONFIG_UBIFS_FS_ZSTD=y CONFIG_USB=y CONFIG_USB_COMMON=y -# CONFIG_USB_EHCI_HCD is not set CONFIG_USB_SUPPORT=y CONFIG_XPS=y CONFIG_XRX200_PHY_FW=y diff --git a/target/linux/lantiq/xway/config-4.19 b/target/linux/lantiq/xway/config-4.19 index 6075cec522..34cd84267a 100644 --- a/target/linux/lantiq/xway/config-4.19 +++ b/target/linux/lantiq/xway/config-4.19 @@ -41,7 +41,6 @@ CONFIG_UBIFS_FS_LZO=y CONFIG_UBIFS_FS_ZLIB=y CONFIG_USB=y CONFIG_USB_COMMON=y -# CONFIG_USB_EHCI_HCD is not set CONFIG_USB_SUPPORT=y CONFIG_ZLIB_DEFLATE=y CONFIG_ZLIB_INFLATE=y diff --git a/target/linux/lantiq/xway/config-5.4 b/target/linux/lantiq/xway/config-5.4 index 16e9de8f95..b0ce4a9043 100644 --- a/target/linux/lantiq/xway/config-5.4 +++ b/target/linux/lantiq/xway/config-5.4 @@ -43,5 +43,4 @@ CONFIG_UBIFS_FS_LZO=y # CONFIG_UBIFS_FS_ZSTD is not set CONFIG_USB=y CONFIG_USB_COMMON=y -# CONFIG_USB_EHCI_HCD is not set CONFIG_USB_SUPPORT=y diff --git a/target/linux/lantiq/xway_legacy/config-4.19 b/target/linux/lantiq/xway_legacy/config-4.19 index c4042f147f..ad949bdf8b 100644 --- a/target/linux/lantiq/xway_legacy/config-4.19 +++ b/target/linux/lantiq/xway_legacy/config-4.19 @@ -29,7 +29,6 @@ CONFIG_RTL8367B_PHY=y CONFIG_RTL8367_PHY=y CONFIG_USB=y CONFIG_USB_COMMON=y -# CONFIG_USB_EHCI_HCD is not set CONFIG_USB_SUPPORT=y CONFIG_ZLIB_DEFLATE=y CONFIG_ZLIB_INFLATE=y diff --git a/target/linux/lantiq/xway_legacy/config-5.4 b/target/linux/lantiq/xway_legacy/config-5.4 index 1d1c2f187c..2ce37051de 100644 --- a/target/linux/lantiq/xway_legacy/config-5.4 +++ b/target/linux/lantiq/xway_legacy/config-5.4 @@ -31,7 +31,6 @@ CONFIG_RTL8367_PHY=y CONFIG_SGL_ALLOC=y CONFIG_USB=y CONFIG_USB_COMMON=y -# CONFIG_USB_EHCI_HCD is not set CONFIG_USB_SUPPORT=y CONFIG_ZLIB_DEFLATE=y CONFIG_ZLIB_INFLATE=y diff --git a/target/linux/mediatek/mt7622/config-4.19 b/target/linux/mediatek/mt7622/config-4.19 index e102308a98..e72bff61e4 100644 --- a/target/linux/mediatek/mt7622/config-4.19 +++ b/target/linux/mediatek/mt7622/config-4.19 @@ -577,7 +577,6 @@ CONFIG_TREE_SRCU=y # CONFIG_UNMAP_KERNEL_AT_EL0 is not set CONFIG_USB=y CONFIG_USB_COMMON=y -# CONFIG_USB_EHCI_HCD is not set CONFIG_USB_SUPPORT=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_MTK=y diff --git a/target/linux/mediatek/mt7622/config-5.4 b/target/linux/mediatek/mt7622/config-5.4 index 1a00636968..02a8d5eaeb 100755 --- a/target/linux/mediatek/mt7622/config-5.4 +++ b/target/linux/mediatek/mt7622/config-5.4 @@ -557,7 +557,6 @@ CONFIG_TREE_SRCU=y # CONFIG_UNMAP_KERNEL_AT_EL0 is not set CONFIG_USB=y CONFIG_USB_COMMON=y -# CONFIG_USB_EHCI_HCD is not set CONFIG_USB_SUPPORT=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_MTK=y diff --git a/target/linux/mediatek/mt7623/config-4.19 b/target/linux/mediatek/mt7623/config-4.19 index 57c0148199..994768bb64 100644 --- a/target/linux/mediatek/mt7623/config-4.19 +++ b/target/linux/mediatek/mt7623/config-4.19 @@ -496,7 +496,6 @@ CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h" CONFIG_UNINLINE_SPIN_UNLOCK=y CONFIG_USB=y CONFIG_USB_COMMON=y -# CONFIG_USB_EHCI_HCD is not set CONFIG_USB_SUPPORT=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_MTK=y diff --git a/target/linux/mediatek/mt7629/config-4.19 b/target/linux/mediatek/mt7629/config-4.19 index 98d67a0fbd..7bf014d151 100644 --- a/target/linux/mediatek/mt7629/config-4.19 +++ b/target/linux/mediatek/mt7629/config-4.19 @@ -357,7 +357,6 @@ CONFIG_UBIFS_FS_ZLIB=y CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h" CONFIG_USB=y CONFIG_USB_COMMON=y -# CONFIG_USB_EHCI_HCD is not set CONFIG_USB_SUPPORT=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_MTK=y diff --git a/target/linux/mediatek/mt7629/config-5.4 b/target/linux/mediatek/mt7629/config-5.4 index 3805eba40e..1dbf1787cb 100644 --- a/target/linux/mediatek/mt7629/config-5.4 +++ b/target/linux/mediatek/mt7629/config-5.4 @@ -362,7 +362,6 @@ CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h" CONFIG_UNWINDER_ARM=y CONFIG_USB=y CONFIG_USB_COMMON=y -# CONFIG_USB_EHCI_HCD is not set CONFIG_USB_SUPPORT=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_MTK=y diff --git a/target/linux/octeontx/config-5.4 b/target/linux/octeontx/config-5.4 index cfb8b19e4e..bc7b46b879 100644 --- a/target/linux/octeontx/config-5.4 +++ b/target/linux/octeontx/config-5.4 @@ -577,7 +577,6 @@ CONFIG_TREE_SRCU=y CONFIG_UNMAP_KERNEL_AT_EL0=y CONFIG_USB=y CONFIG_USB_COMMON=y -# CONFIG_USB_EHCI_HCD is not set CONFIG_USB_PCI=y CONFIG_USB_SUPPORT=y # CONFIG_USB_UHCI_HCD is not set From 923792369e2befc2ebda6bbadc3e9a3c314e2c25 Mon Sep 17 00:00:00 2001 From: Sungbo Eo Date: Fri, 29 May 2020 20:51:01 +0900 Subject: [PATCH 03/70] mediatek: do not create device nodes in uci-defaults script Since commit 298814e6be76 ("base-files: config_generate: split macaddr with multiple ifaces") uci MAC address setup will create a device node for each member iface. But this script might override the device nodes and interfere with the MAC address setup. Signed-off-by: Sungbo Eo --- .../base-files/etc/uci-defaults/99-net-ps | 21 +++++-------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/target/linux/mediatek/base-files/etc/uci-defaults/99-net-ps b/target/linux/mediatek/base-files/etc/uci-defaults/99-net-ps index 596b33c5b4..15e9ef32a3 100755 --- a/target/linux/mediatek/base-files/etc/uci-defaults/99-net-ps +++ b/target/linux/mediatek/base-files/etc/uci-defaults/99-net-ps @@ -1,16 +1,5 @@ -uci set network.globals='globals' -uci set network.globals.packet_steering=1 -uci set network.eth0=device -uci set network.eth0.name=eth0 -uci set network.lan0=device -uci set network.lan0.name=lan0 -uci set network.lan1=device -uci set network.lan1.name=lan1 -uci set network.lan2=device -uci set network.lan2.name=lan2 -uci set network.lan3=device -uci set network.lan3.name=lan3 - -uci commit network - -exit 0 +uci -q get network.globals.packet_steering >/dev/null || { + uci set network.globals='globals' + uci set network.globals.packet_steering=1 + uci commit network +} From 36105880ee5749d85551934d36b42f7b1fc0a640 Mon Sep 17 00:00:00 2001 From: Sungbo Eo Date: Fri, 29 May 2020 22:06:35 +0900 Subject: [PATCH 04/70] mediatek: re-add u3phy2 phy-switch patch This patch is required for pcie@2,0 in mt7623 to work. The patch was originally added in kernel 4.14, but it has not been ported to 4.19 and later. Fixes: FS#3217 Tested-by: David Woodhouse Signed-off-by: Sungbo Eo --- ...-phy-phy-mtk-tphy-Add-hifsys-support.patch | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 target/linux/mediatek/patches-5.4/0226-phy-phy-mtk-tphy-Add-hifsys-support.patch diff --git a/target/linux/mediatek/patches-5.4/0226-phy-phy-mtk-tphy-Add-hifsys-support.patch b/target/linux/mediatek/patches-5.4/0226-phy-phy-mtk-tphy-Add-hifsys-support.patch new file mode 100644 index 0000000000..f2647e8ffe --- /dev/null +++ b/target/linux/mediatek/patches-5.4/0226-phy-phy-mtk-tphy-Add-hifsys-support.patch @@ -0,0 +1,66 @@ +From 28f9a5e2a3f5441ab5594669ed82da11e32277a9 Mon Sep 17 00:00:00 2001 +From: Kristian Evensen +Date: Mon, 30 Apr 2018 14:38:01 +0200 +Subject: [PATCH] phy: phy-mtk-tphy: Add hifsys-support + +--- + drivers/phy/mediatek/phy-mtk-tphy.c | 20 ++++++++++++++++++++ + 1 file changed, 20 insertions(+) + +--- a/drivers/phy/mediatek/phy-mtk-tphy.c ++++ b/drivers/phy/mediatek/phy-mtk-tphy.c +@@ -15,6 +15,8 @@ + #include + #include + #include ++#include ++#include + + /* version V1 sub-banks offset base address */ + /* banks shared by multiple phys */ +@@ -263,6 +265,9 @@ + #define RG_CDR_BIRLTD0_GEN3_MSK GENMASK(4, 0) + #define RG_CDR_BIRLTD0_GEN3_VAL(x) (0x1f & (x)) + ++#define HIF_SYSCFG1 0x14 ++#define HIF_SYSCFG1_PHY2_MASK (0x3 << 20) ++ + enum mtk_phy_version { + MTK_PHY_V1 = 1, + MTK_PHY_V2, +@@ -310,6 +315,7 @@ struct mtk_tphy { + struct clk *u3phya_ref; /* reference clock of usb3 anolog phy */ + const struct mtk_phy_pdata *pdata; + struct mtk_phy_instance **phys; ++ struct regmap *hif; + int nphys; + int src_ref_clk; /* MHZ, reference clock for slew rate calibrate */ + int src_coef; /* coefficient for slew rate calibrate */ +@@ -629,6 +635,10 @@ static void pcie_phy_instance_init(struc + if (tphy->pdata->version != MTK_PHY_V1) + return; + ++ if (tphy->hif) ++ regmap_update_bits(tphy->hif, HIF_SYSCFG1, ++ HIF_SYSCFG1_PHY2_MASK, 0); ++ + tmp = readl(u3_banks->phya + U3P_U3_PHYA_DA_REG0); + tmp &= ~(P3A_RG_XTAL_EXT_PE1H | P3A_RG_XTAL_EXT_PE2H); + tmp |= P3A_RG_XTAL_EXT_PE1H_VAL(0x2) | P3A_RG_XTAL_EXT_PE2H_VAL(0x2); +@@ -1114,6 +1124,16 @@ static int mtk_tphy_probe(struct platfor + &tphy->src_ref_clk); + device_property_read_u32(dev, "mediatek,src-coef", &tphy->src_coef); + ++ if (of_find_property(np, "mediatek,phy-switch", NULL)) { ++ tphy->hif = syscon_regmap_lookup_by_phandle(np, ++ "mediatek,phy-switch"); ++ if (IS_ERR(tphy->hif)) { ++ dev_err(&pdev->dev, ++ "missing \"mediatek,phy-switch\" phandle\n"); ++ return PTR_ERR(tphy->hif); ++ } ++ } ++ + port = 0; + for_each_child_of_node(np, child_np) { + struct mtk_phy_instance *instance; From 1337093e87b42c06cd524a253d4081f186508e1d Mon Sep 17 00:00:00 2001 From: Lucian Cristian Date: Wed, 8 Jul 2020 22:49:57 +0300 Subject: [PATCH 05/70] kernel: iscsi-initator: fix kernel config symbols MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Enable SCSI low-level drivers on targets that don't have it already in order to fix following build failures on few platforms: .config:4739:warning: symbol value 'm' invalid for SCSI_LOWLEVEL * Restart config... * SCSI low-level drivers SCSI low-level drivers (SCSI_LOWLEVEL) [Y/n] (NEW) aborted! Fixes: b88f8202c4ce ("kernel: add iscsi-initator support") Signed-off-by: Lucian Cristian [commit subject and description facelift] Signed-off-by: Petr Štetiar --- package/kernel/linux/modules/block.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/kernel/linux/modules/block.mk b/package/kernel/linux/modules/block.mk index faea5cc34e..fbd3c81911 100644 --- a/package/kernel/linux/modules/block.mk +++ b/package/kernel/linux/modules/block.mk @@ -276,9 +276,9 @@ define KernelPackage/iscsi-initiator DEPENDS:=+kmod-scsi-core +kmod-crypto-hash KCONFIG:= \ CONFIG_INET \ - CONFIG_SCSI_LOWLEVEL \ + CONFIG_SCSI_LOWLEVEL=y \ CONFIG_ISCSI_TCP \ - CONFIG_SCSI_ISCSI_ATTRS + CONFIG_SCSI_ISCSI_ATTRS=y FILES:= \ $(LINUX_DIR)/drivers/scsi/iscsi_tcp.ko \ $(LINUX_DIR)/drivers/scsi/libiscsi.ko \ From f632747704f172e5c6d3a7c5715dc8d2f50d8da8 Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Thu, 9 Jul 2020 09:56:18 +0100 Subject: [PATCH 06/70] mediatek: fix bashism in gen_banana_pi_img.sh There was a bashism in the script. This fixes the script so that it doesn't actually require bash, and can be run with any POSIX shell as its shebang suggests. Signed-off-by: David Woodhouse --- target/linux/mediatek/image/gen_banana_pi_img.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/mediatek/image/gen_banana_pi_img.sh b/target/linux/mediatek/image/gen_banana_pi_img.sh index 26fbca1388..d46e92fa42 100755 --- a/target/linux/mediatek/image/gen_banana_pi_img.sh +++ b/target/linux/mediatek/image/gen_banana_pi_img.sh @@ -78,7 +78,7 @@ # The contents of the main eMMC are identical to the SD card layout, # with the preloader loading 512KiB of U-Boot starting at 0x50000. -function usage() { +usage() { echo "SYNTAX: $0 sd " echo " OR: $0 emmc " exit 1 From 0df71e01cfe67516df63df025eb88a4d5d40f230 Mon Sep 17 00:00:00 2001 From: Willem van den Akker Date: Thu, 9 Jul 2020 14:51:19 +0200 Subject: [PATCH 07/70] lantiq: set correct gphy pins for Zyxel P-2812 This fixes the gphy LED pins for Zyxel P-2812 devices. The have been accidentally altered during a tidy-up operation (see Fixes: below). No ports were available, dmesg reported: [ 0.658577] pinctrl-xway 1e100b10.pinmux: pin io5 already requested by 1e100bb0.stp; cannot claim for 1e108000.eth [ 0.667566] pinctrl-xway 1e100b10.pinmux: pin-5 (1e108000.eth) status -22 [ 0.685238] lantiq,xrx200-net 1e108000.eth: Error applying setting, reverse things back [ 0.693270] lantiq,xrx200-net: probe of 1e108000.eth failed with error -22 Fixes: FS#3188 Fixes: 660200e53d62 ("lantiq: dts: assign the GPHY LED pins to the Ethernet controller node") Suggested-by: Mathias Kresin Signed-off-by: Willem van den Akker [commit message facelift] Signed-off-by: Adrian Schmutzler --- .../arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-fx.dtsi | 2 +- .../arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-fx.dtsi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-fx.dtsi b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-fx.dtsi index 5f8392ca44..6c30a91553 100644 --- a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-fx.dtsi +++ b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-fx.dtsi @@ -112,7 +112,7 @@ ð0 { pinctrl-0 = <&mdio_pins>, - <&gphy0_led0_pins>, <&gphy0_led2_pins>, + <&gphy0_led1_pins>, <&gphy0_led2_pins>, <&gphy1_led1_pins>, <&gphy1_led2_pins>; pinctrl-names = "default"; diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-fx.dtsi b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-fx.dtsi index 5f8392ca44..6c30a91553 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-fx.dtsi +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-fx.dtsi @@ -112,7 +112,7 @@ ð0 { pinctrl-0 = <&mdio_pins>, - <&gphy0_led0_pins>, <&gphy0_led2_pins>, + <&gphy0_led1_pins>, <&gphy0_led2_pins>, <&gphy1_led1_pins>, <&gphy1_led2_pins>; pinctrl-names = "default"; From edbc8e5512dccc2e0b6925258e34b3f21d66679c Mon Sep 17 00:00:00 2001 From: Tim Thorpe Date: Wed, 8 Jul 2020 22:07:35 -0500 Subject: [PATCH 08/70] ramips: add support for Netgear R6020 This adds support for the Netgear R6020, aka Netgear AC750. The R6020 appears to be the same hardware as the Netgear R6080, aka Netgear AC1000, but it has a slightly different flash layout, and no USB ports. Specification: SoC: MediaTek MT7628 (580 MHz) Flash: 8 MiB RAM: 64 MiB Wireless: 2.4Ghz (builtin) and 5Ghz (MT7612E) LAN speed: 10/100 LAN ports: 4 WAN speed: 10/100 WAN ports: 1 UART (57600 8N1) on PCB MAC addresses based on vendor firmware: LAN *:88 0x4 WAN *:89 WLAN2 *:88 0x4 WLAN5 *:8a 0x8004 The factory partition might have been corrupted beforehand. However, the comparison of vendor firmware and OpenWrt still allowed to retrieve a meaningful assignment that also matches the other similar devices. Installation: Flashing OpenWRT from stock firmware requires nmrpflash. Use an ethernet cable to connect to LAN port 1 of the R6020, and power the R6020 off. From the connected workstation, run `nmrpflash -i eth0 -f openwrt-ramips-mt76x8-netgear_r6020-squashfs-factory.img`, replacing eth0 with the appropriate interface (can be identified by running `nmrpflash -L`). Then power on the R6020. After flashing has finished, power cycle the R6020, and it will boot into OpenWRT. Once OpenWRT has been installed, subsequent flashes can use the web interface and sysupgrade files. Signed-off-by: Tim Thorpe [slightly extend commit message, fix whitespaces in DTS, align From: with Signed-off-by] Signed-off-by: Adrian Schmutzler --- .../ramips/dts/mt7628an_netgear_r6020.dts | 172 ++++++++++++++++++ target/linux/ramips/image/mt76x8.mk | 19 ++ .../mt76x8/base-files/etc/board.d/01_leds | 1 + .../mt76x8/base-files/etc/board.d/02_network | 2 + 4 files changed, 194 insertions(+) create mode 100644 target/linux/ramips/dts/mt7628an_netgear_r6020.dts diff --git a/target/linux/ramips/dts/mt7628an_netgear_r6020.dts b/target/linux/ramips/dts/mt7628an_netgear_r6020.dts new file mode 100644 index 0000000000..83a751c2f7 --- /dev/null +++ b/target/linux/ramips/dts/mt7628an_netgear_r6020.dts @@ -0,0 +1,172 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "mt7628an.dtsi" + +#include +#include + +/ { + compatible = "netgear,r6020", "mediatek,mt7628an-soc"; + model = "Netgear R6020"; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 38 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + lan { + label = "r6020:green:lan"; + gpios = <&gpio 44 GPIO_ACTIVE_LOW>; + }; + + led_power: power { + label = "r6020:green:power"; + gpios = <&gpio 43 GPIO_ACTIVE_LOW>; + }; + + wlan2g_green { + label = "r6020:green:wlan2g"; + gpios = <&gpio 42 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + wlan2g_orange { + label = "r6020:orange:wlan2g"; + gpios = <&gpio 41 GPIO_ACTIVE_LOW>; + }; + + wan_green { + label = "r6020:green:wan"; + gpios = <&gpio 40 GPIO_ACTIVE_LOW>; + }; + + wan_orange { + label = "r6020:orange:wan"; + gpios = <&gpio 39 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&state_default { + gpio { + groups = "p0led_an", "p1led_an", "p2led_an", + "p3led_an", "p4led_an", "wdt", + "wled_an"; + function = "gpio"; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <86000000>; + m25p,fast-read; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x40000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x20000>; + read-only; + }; + + partition@60000 { + label = "nvram"; + reg = <0x60000 0x30000>; + read-only; + }; + + partition@90000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x90000 0x6f0000>; + }; + + partition@780000 { + label = "ML"; + reg = <0x780000 0x20000>; + read-only; + }; + + partition@7a0000 { + label = "ML1"; + reg = <0x7a0000 0x20000>; + read-only; + }; + + partition@7c0000 { + label = "ML2"; + reg = <0x7c0000 0x20000>; + read-only; + }; + + partition@7e0000 { + label = "POT"; + reg = <0x7e0000 0x10000>; + read-only; + }; + + partition@7f0000 { + label = "reserved"; + reg = <0x7f0000 0x10000>; + read-only; + }; + }; + }; +}; + +&wmac { + status = "okay"; +}; + +ðernet { + mtd-mac-address = <&factory 0x4>; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi@0,0 { + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + }; +}; + +&ehci { + status = "disabled"; +}; + +&ohci { + status = "disabled"; +}; diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk index 310772932b..de92c982cc 100644 --- a/target/linux/ramips/image/mt76x8.mk +++ b/target/linux/ramips/image/mt76x8.mk @@ -189,6 +189,25 @@ define Device/mercury_mac1200r-v2 endef TARGET_DEVICES += mercury_mac1200r-v2 +define Device/netgear_r6020 + BLOCKSIZE := 64k + IMAGE_SIZE := 7104k + DEVICE_VENDOR := NETGEAR + DEVICE_MODEL := R6020 + DEVICE_PACKAGES := kmod-mt76x2 + SERCOMM_HWID := CFR + SERCOMM_HWVER := A001 + SERCOMM_SWVER := 0x0040 + IMAGES += factory.img + IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | \ + pad-rootfs + IMAGE/sysupgrade.bin := $$(IMAGE/default) | append-metadata | check-size + IMAGE/factory.img := pad-extra 576k | $$(IMAGE/default) | \ + pad-to $$$$(BLOCKSIZE) | sercom-footer | pad-to 128 | zip R6020.bin | \ + sercom-seal +endef +TARGET_DEVICES += netgear_r6020 + define Device/netgear_r6080 BLOCKSIZE := 64k IMAGE_SIZE := 7552k diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds b/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds index fcc6516c8d..1e478df4ef 100755 --- a/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds @@ -23,6 +23,7 @@ alfa-network,awusfree1) asus,rt-n10p-v3|\ asus,rt-n11p-b1|\ asus,rt-n12-vp-b1|\ +netgear,r6020|\ netgear,r6080|\ netgear,r6120) ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0xf" diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network index ecba0ccb17..e3d18b5fba 100755 --- a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network @@ -95,6 +95,7 @@ ramips_setup_interfaces() ucidef_add_switch "switch0" \ "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "0:wan" "6@eth0" ;; + netgear,r6020|\ netgear,r6080|\ netgear,r6120) ucidef_add_switch "switch0" \ @@ -151,6 +152,7 @@ ramips_setup_macs() label_mac=$(mtd_get_mac_binary factory 0x4) ;; duzun,dm06|\ + netgear,r6020|\ netgear,r6080|\ netgear,r6120|\ wrtnode,wrtnode2p|\ From 727685c317c4e59e5ac170acdf61af12afbc4b70 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Tue, 7 Jul 2020 21:51:58 +0100 Subject: [PATCH 09/70] mac80211: rt2x00: define RF5592 in init_eeprom routine Make sure RF5592 is set for RT5592 chip which apparently sometimes doesn't have RF defined (but always comes with RF5592). This patch was originally submitted on linux-wireless by Tom Psyborg but got rejected. Turns out the patch is actually needed. Reported-by: Sebastian Gottschall Signed-off-by: Daniel Golle --- ...define-RF5592-in-init_eeprom-routine.patch | 51 +++++++++++++++++++ ...0-rt2x00-change-led-polarity-from-OF.patch | 2 +- ...dd-support-for-external-PA-on-MT7620.patch | 4 +- 3 files changed, 54 insertions(+), 3 deletions(-) create mode 100644 package/kernel/mac80211/patches/rt2x00/002-rt2x00-define-RF5592-in-init_eeprom-routine.patch diff --git a/package/kernel/mac80211/patches/rt2x00/002-rt2x00-define-RF5592-in-init_eeprom-routine.patch b/package/kernel/mac80211/patches/rt2x00/002-rt2x00-define-RF5592-in-init_eeprom-routine.patch new file mode 100644 index 0000000000..a50a195285 --- /dev/null +++ b/package/kernel/mac80211/patches/rt2x00/002-rt2x00-define-RF5592-in-init_eeprom-routine.patch @@ -0,0 +1,51 @@ +From patchwork Thu Dec 27 14:05:26 2018 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 8bit +X-Patchwork-Submitter: Tom Psyborg +X-Patchwork-Id: 10743707 +X-Patchwork-Delegate: kvalo@adurom.com +From: =?utf-8?q?Tomislav_Po=C5=BEega?= +To: linux-wireless@vger.kernel.org +Cc: kvalo@codeaurora.org, hauke@hauke-m.de, nbd@nbd.name, + john@phrozen.org, sgruszka@redhat.com, daniel@makrotopia.org +Subject: [PATCH 2/2] rt2x00: define RF5592 in init_eeprom routine +Date: Thu, 27 Dec 2018 15:05:26 +0100 +Message-Id: <1545919526-4074-2-git-send-email-pozega.tomislav@gmail.com> +X-Mailer: git-send-email 1.7.0.4 +In-Reply-To: <1545919526-4074-1-git-send-email-pozega.tomislav@gmail.com> +References: <1545919526-4074-1-git-send-email-pozega.tomislav@gmail.com> +MIME-Version: 1.0 +Sender: linux-wireless-owner@vger.kernel.org +Precedence: bulk +List-ID: +X-Mailing-List: linux-wireless@vger.kernel.org +X-Virus-Scanned: ClamAV using ClamSMTP + +This patch fixes following crash on Linksys EA2750 during 5GHz wifi +init: + +[ 7.955153] rt2800pci 0000:01:00.0: card - bus=0x1, slot = 0x0 irq=4 +[ 7.962259] rt2800pci 0000:01:00.0: loaded eeprom from mtd device "Factory" +[ 7.969435] ieee80211 phy0: rt2x00_set_rt: Info - RT chipset 5592, rev 0222 detected +[ 7.977348] ieee80211 phy0: rt2800_init_eeprom: Error - Invalid RF chipset 0x0000 detected +[ 7.985793] ieee80211 phy0: rt2x00lib_probe_dev: Error - Failed to allocate device +[ 7.993569] CPU 0 Unable to handle kernel paging request at virtual address 00000024, epc == 800c8f54, ra == 80249ff8 +[ 8.004408] Oops[#1]: + +Signed-off-by: Tomislav Požega +--- + drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +@@ -9416,6 +9416,8 @@ static int rt2800_init_eeprom(struct rt2 + rf = RF3853; + else if (rt2x00_rt(rt2x00dev, RT5350)) + rf = RF5350; ++ else if (rt2x00_rt(rt2x00dev, RT5592)) ++ rf = RF5592; + else + rf = rt2x00_get_field16(eeprom, EEPROM_NIC_CONF0_RF_TYPE); + diff --git a/package/kernel/mac80211/patches/rt2x00/610-rt2x00-change-led-polarity-from-OF.patch b/package/kernel/mac80211/patches/rt2x00/610-rt2x00-change-led-polarity-from-OF.patch index 5f60b60d95..039c6f6afc 100644 --- a/package/kernel/mac80211/patches/rt2x00/610-rt2x00-change-led-polarity-from-OF.patch +++ b/package/kernel/mac80211/patches/rt2x00/610-rt2x00-change-led-polarity-from-OF.patch @@ -8,7 +8,7 @@ #include "rt2x00.h" #include "rt2800lib.h" -@@ -9528,6 +9529,17 @@ static int rt2800_init_eeprom(struct rt2 +@@ -9530,6 +9531,17 @@ static int rt2800_init_eeprom(struct rt2 rt2800_init_led(rt2x00dev, &rt2x00dev->led_assoc, LED_TYPE_ASSOC); rt2800_init_led(rt2x00dev, &rt2x00dev->led_qual, LED_TYPE_QUALITY); diff --git a/package/kernel/mac80211/patches/rt2x00/650-rt2x00-add-support-for-external-PA-on-MT7620.patch b/package/kernel/mac80211/patches/rt2x00/650-rt2x00-add-support-for-external-PA-on-MT7620.patch index 88ce5ec529..20452cd8a7 100644 --- a/package/kernel/mac80211/patches/rt2x00/650-rt2x00-add-support-for-external-PA-on-MT7620.patch +++ b/package/kernel/mac80211/patches/rt2x00/650-rt2x00-add-support-for-external-PA-on-MT7620.patch @@ -76,7 +76,7 @@ Signed-off-by: Tomislav Po=C5=BEega bbp = rt2800_bbp_read(rt2x00dev, 4); rt2x00_set_field8(&bbp, BBP4_BANDWIDTH, 2 * conf_is_ht40(conf)); rt2800_bbp_write(rt2x00dev, 4, bbp); -@@ -9557,7 +9596,8 @@ static int rt2800_init_eeprom(struct rt2 +@@ -9559,7 +9598,8 @@ static int rt2800_init_eeprom(struct rt2 */ eeprom = rt2800_eeprom_read(rt2x00dev, EEPROM_NIC_CONF1); @@ -86,7 +86,7 @@ Signed-off-by: Tomislav Po=C5=BEega if (rt2x00_get_field16(eeprom, EEPROM_NIC_CONF1_EXTERNAL_TX0_PA_3352)) __set_bit(CAPABILITY_EXTERNAL_PA_TX0, -@@ -9568,6 +9608,18 @@ static int rt2800_init_eeprom(struct rt2 +@@ -9570,6 +9610,18 @@ static int rt2800_init_eeprom(struct rt2 &rt2x00dev->cap_flags); } From b6e440a0f560330187f87d25d193c9f92baa777a Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Fri, 10 Jul 2020 18:52:28 +0100 Subject: [PATCH 10/70] procd: update to git HEAD ea7a790 jail: add support for running OCI bundle bb4a446 uxc: add container management CLI tool Signed-off-by: Daniel Golle --- package/system/procd/Makefile | 26 +++++++++++++++++++++++--- package/system/procd/files/uxc.init | 18 ++++++++++++++++++ 2 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 package/system/procd/files/uxc.init diff --git a/package/system/procd/Makefile b/package/system/procd/Makefile index 5647a47326..ca5bf5e4d4 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-05-28 -PKG_SOURCE_VERSION:=b9b39e2061d7035a9d84eecbb4a4613deaf6d03f -PKG_MIRROR_HASH:=0d6a96a2fb38f72c72b457a2a8638bee22f91009f9686152fcf4aee97846fc84 +PKG_SOURCE_DATE:=2020-07-10 +PKG_SOURCE_VERSION:=bb4a4467b1d5ccbc84d89822235a38b63134e5a4 +PKG_MIRROR_HASH:=1e6d79834ffb861450ccec4162c068d6ca29fd0227c3346203f0d02810abc940 CMAKE_INSTALL:=1 PKG_LICENSE:=GPL-2.0 @@ -70,6 +70,14 @@ define Package/procd-seccomp TITLE:=OpenWrt process seccomp helper + utrace endef +define Package/uxc + SECTION:=base + CATEGORY:=Base system + DEPENDS:=+procd-ujail +libubus +libubox +libblobmsg-json + TITLE:=OpenWrt container management + MAINTAINER:=Daniel Golle +endef + define Package/procd/config menu "Configuration" depends on PACKAGE_procd @@ -130,7 +138,19 @@ define Package/procd-seccomp/install $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libpreload-trace.so $(1)/lib endef +define Package/uxc/conffiles +/etc/uxc +endef + +define Package/uxc/install + $(INSTALL_DIR) $(1)/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/uxc $(1)/sbin/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/uxc.init $(1)/etc/init.d/uxc +endef + $(eval $(call BuildPackage,procd)) $(eval $(call BuildPackage,procd-ujail)) $(eval $(call BuildPackage,procd-ujail-console)) $(eval $(call BuildPackage,procd-seccomp)) +$(eval $(call BuildPackage,uxc)) diff --git a/package/system/procd/files/uxc.init b/package/system/procd/files/uxc.init new file mode 100644 index 0000000000..035c8b0b9e --- /dev/null +++ b/package/system/procd/files/uxc.init @@ -0,0 +1,18 @@ +#!/bin/sh /etc/rc.common + +START=99 +USE_PROCD=1 +NAME=uxc +PROG=/sbin/uxc + +start_service() { + [ "${__BOOT_UXC}" = "1" ] || return 0 + procd_open_instance "uxc" + procd_set_param command "$PROG" boot + procd_close_instance +} + +boot() { + __BOOT_UXC=1 + start +} From a6160de3f74cf2ac74974d6984eacaef6e99047a Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sat, 11 Jul 2020 00:08:04 +0100 Subject: [PATCH 11/70] procd: jail: fix build on platforms without seccomp support Fixes: b6e440a0f5 ("procd: update to git HEAD") 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 ca5bf5e4d4..439c0f26d9 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-10 -PKG_SOURCE_VERSION:=bb4a4467b1d5ccbc84d89822235a38b63134e5a4 -PKG_MIRROR_HASH:=1e6d79834ffb861450ccec4162c068d6ca29fd0227c3346203f0d02810abc940 +PKG_SOURCE_DATE:=2020-07-11 +PKG_SOURCE_VERSION:=f1aa7a79d8c0bd3f95adb782cd67575e48dc73e5 +PKG_MIRROR_HASH:=8889c0fe03f6cc7b8aa9c2c873a038a9d2613ddb3ff342751d61524fb68cdfda CMAKE_INSTALL:=1 PKG_LICENSE:=GPL-2.0 From bc85cc2b421ff9e2e32212cb189b3e2d76390e35 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Sat, 11 Jul 2020 11:43:22 +0200 Subject: [PATCH 12/70] ath79: disable TP-Link TL-WR941ND v2 The support for this device's Marvell MV88E6060 switch has been reported to be broken with kernels 4.19/5.4 (see bug report). Since this a 4/32 device and it has been confirmed to be working with stable 19.07 release (kernel 4.14), and since fixing it does not seem trivial, let's just disable it in master. Fixes: FS#2524 Signed-off-by: Adrian Schmutzler --- target/linux/ath79/image/tiny-tp-link.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/ath79/image/tiny-tp-link.mk b/target/linux/ath79/image/tiny-tp-link.mk index 0da712c5d4..128ed9882e 100644 --- a/target/linux/ath79/image/tiny-tp-link.mk +++ b/target/linux/ath79/image/tiny-tp-link.mk @@ -443,7 +443,7 @@ define Device/tplink_tl-wr941-v2 TPLINK_HWREV := 2 SUPPORTED_DEVICES += tl-wr941nd endef -TARGET_DEVICES += tplink_tl-wr941-v2 +#TARGET_DEVICES += tplink_tl-wr941-v2 define Device/tplink_tl-wr941-v4 $(Device/tplink-4m) From 560093222c6416e411a24c7f49b16a9a8114d014 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sat, 11 Jul 2020 10:52:28 +0100 Subject: [PATCH 13/70] procd: fix another seccomp-related build issue 3473671 ujail: add dependency on syscall-names-h Fixes: b6e440a0f5 ("procd: update to git HEAD") 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 439c0f26d9..8f1c8cb4c9 100644 --- a/package/system/procd/Makefile +++ b/package/system/procd/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=procd -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/procd.git PKG_SOURCE_DATE:=2020-07-11 -PKG_SOURCE_VERSION:=f1aa7a79d8c0bd3f95adb782cd67575e48dc73e5 -PKG_MIRROR_HASH:=8889c0fe03f6cc7b8aa9c2c873a038a9d2613ddb3ff342751d61524fb68cdfda +PKG_SOURCE_VERSION:=347367193dc2df7d8c2578b426089c11adbc4f6b +PKG_MIRROR_HASH:=2d0022cb6d87c911b9b20cd49051fd8edf72cb1b2ff82e02ef6f4f3cf84d78cf CMAKE_INSTALL:=1 PKG_LICENSE:=GPL-2.0 From 5115cb0501674bd613d39edab41957578565ff9e Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sat, 11 Jul 2020 11:27:33 +0100 Subject: [PATCH 14/70] procd: fix yet another build issue, this time with capabilities 3034eaf jail: use linux/capability.h instead of sys/capability.h Fixes: b6e440a0f5 ("procd: update to git HEAD") 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 8f1c8cb4c9..3b88c76144 100644 --- a/package/system/procd/Makefile +++ b/package/system/procd/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=procd -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/procd.git PKG_SOURCE_DATE:=2020-07-11 -PKG_SOURCE_VERSION:=347367193dc2df7d8c2578b426089c11adbc4f6b -PKG_MIRROR_HASH:=2d0022cb6d87c911b9b20cd49051fd8edf72cb1b2ff82e02ef6f4f3cf84d78cf +PKG_SOURCE_VERSION:=3034eaf5ceebc3b8d8461680a2cd3c61e796fc7d +PKG_MIRROR_HASH:=2f8f84c273bda817dcb0513c0d3304af98662c3eb26c9bf266da4508db04011d CMAKE_INSTALL:=1 PKG_LICENSE:=GPL-2.0 From d7d6e055e9d9d9554f59e919f37e0b6cd46b12a1 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Sun, 10 May 2020 16:47:46 +0200 Subject: [PATCH 15/70] base-files: replace backticks by $(...) This replaces deprecated backticks by more versatile $(...) syntax. This does not touch lib/upgrade/nand.sh, as there replacement is not trivial. Signed-off-by: Adrian Schmutzler --- package/base-files/files/bin/board_detect | 2 +- .../files/etc/uci-defaults/13_fix-group-user | 2 +- .../files/lib/preinit/30_failsafe_wait | 2 +- package/base-files/files/sbin/pkg_check | 16 ++++++++-------- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/package/base-files/files/bin/board_detect b/package/base-files/files/bin/board_detect index 441db6a08f..840bd0178d 100755 --- a/package/base-files/files/bin/board_detect +++ b/package/base-files/files/bin/board_detect @@ -5,7 +5,7 @@ CFG=$1 [ -n "$CFG" ] || CFG=/etc/board.json [ -d "/etc/board.d/" -a ! -s "$CFG" ] && { - for a in `ls /etc/board.d/*`; do + for a in $(ls /etc/board.d/*); do [ -x $a ] || continue; $(. $a) done diff --git a/package/base-files/files/etc/uci-defaults/13_fix-group-user b/package/base-files/files/etc/uci-defaults/13_fix-group-user index bf9febdfe4..74f501e8f7 100644 --- a/package/base-files/files/etc/uci-defaults/13_fix-group-user +++ b/package/base-files/files/etc/uci-defaults/13_fix-group-user @@ -1,6 +1,6 @@ . /lib/functions.sh -for file in `grep -sl Require-User /usr/lib/opkg/info/*.control`; do +for file in $(grep -sl Require-User /usr/lib/opkg/info/*.control); do file="${file##*/}" file="${file%.control}" add_group_and_user "${file}" diff --git a/package/base-files/files/lib/preinit/30_failsafe_wait b/package/base-files/files/lib/preinit/30_failsafe_wait index 85dca398fa..a2c2c386aa 100644 --- a/package/base-files/files/lib/preinit/30_failsafe_wait +++ b/package/base-files/files/lib/preinit/30_failsafe_wait @@ -91,7 +91,7 @@ failsafe_wait() { grep -q 'failsafe=' /proc/cmdline && FAILSAFE=true && export FAILSAFE if [ "$FAILSAFE" != "true" ]; then fs_wait_for_key f 'to enter failsafe mode' $fs_failsafe_wait_timeout && FAILSAFE=true - [ -f "/tmp/failsafe_button" ] && FAILSAFE=true && echo "- failsafe button "`cat /tmp/failsafe_button`" was pressed -" + [ -f "/tmp/failsafe_button" ] && FAILSAFE=true && echo "- failsafe button "$(cat /tmp/failsafe_button)" was pressed -" [ "$FAILSAFE" = "true" ] && export FAILSAFE && touch /tmp/failsafe fi } diff --git a/package/base-files/files/sbin/pkg_check b/package/base-files/files/sbin/pkg_check index 9968c9b78e..775e401b26 100755 --- a/package/base-files/files/sbin/pkg_check +++ b/package/base-files/files/sbin/pkg_check @@ -72,14 +72,14 @@ while [ "$1" ]; do fi [ $QUIET = yes ] || echo " * Checking package $1:" ERR="" - CHECK="`sha256sum -c /usr/lib/opkg/info/$1.files-sha256sum 2> /dev/null`" + CHECK="$(sha256sum -c /usr/lib/opkg/info/$1.files-sha256sum 2> /dev/null)" # Are the changed files config files? - if [ $? -ne 0 ] && [ "`cat "/usr/lib/opkg/info/$1.files-sha256sum"`" ]; then - NEWCHECK="`echo "$CHECK" | grep '^.*: OK$'`" - for i in `echo "$CHECK" | sed -n 's|^\(.*\): FAILED$|\1|p'`; do - if [ "`grep "^$i\$" "/usr/lib/opkg/info/$1.conffiles" 2> /dev/null`" ] || \ - [ "`echo "$i" | grep "^/etc/uci-defaults/"`" ]; then + if [ $? -ne 0 ] && [ "$(cat "/usr/lib/opkg/info/$1.files-sha256sum")" ]; then + NEWCHECK="$(echo "$CHECK" | grep '^.*: OK$')" + for i in $(echo "$CHECK" | sed -n 's|^\(.*\): FAILED$|\1|p'); do + if [ "$(grep "^$i\$" "/usr/lib/opkg/info/$1.conffiles" 2> /dev/null)" ] || \ + [ "$(echo "$i" | grep "^/etc/uci-defaults/")" ]; then NEWCHECK="${NEWCHECK}${NL}${i}: CONFIGURED" else NEWCHECK="${NEWCHECK}${NL}${i}: FAILED" @@ -91,7 +91,7 @@ while [ "$1" ]; do # Do we have changed files or not? if [ -z "$ERR" ]; then - [ $QUIET = yes ] || [ -z "`cat "/usr/lib/opkg/info/$1.files-sha256sum"`" ] || echo "$CHECK" | sed 's|^| - |' + [ $QUIET = yes ] || [ -z "$(cat "/usr/lib/opkg/info/$1.files-sha256sum")" ] || echo "$CHECK" | sed 's|^| - |' [ $QUIET = yes ] || echo " * Package $1 is ok" [ $QUIET = yes ] || echo else @@ -107,7 +107,7 @@ while [ "$1" ]; do echo "Exiting on first change found!" exit 1 fi - for i in `echo "$CHECK" | sed -n 's|^\(.*\): FAILED$|\1|p'`; do + for i in $(echo "$CHECK" | sed -n 's|^\(.*\): FAILED$|\1|p'); do SUMMARY="${SUMMARY}${NL} - $1: $i" done echo From b837216345d4f36beea9550821ee653b060864b1 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Sun, 10 May 2020 16:47:51 +0200 Subject: [PATCH 16/70] wireguard-tools: replace backticks by $(...) This replaces deprecated backticks by more versatile $(...) syntax. Signed-off-by: Adrian Schmutzler --- .../utils/wireguard-tools/files/wireguard_watchdog | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package/network/utils/wireguard-tools/files/wireguard_watchdog b/package/network/utils/wireguard-tools/files/wireguard_watchdog index 5fbbeafec1..c0a5a0aa33 100644 --- a/package/network/utils/wireguard-tools/files/wireguard_watchdog +++ b/package/network/utils/wireguard-tools/files/wireguard_watchdog @@ -27,7 +27,7 @@ check_peer_activity() { config_get public_key "${cfg}" "public_key" config_get endpoint_host "${cfg}" "endpoint_host" config_get endpoint_port "${cfg}" "endpoint_port" - persistent_keepalive=`wg show ${iface} persistent-keepalive | grep ${public_key} | awk '{print $2}'` + persistent_keepalive=$(wg show ${iface} persistent-keepalive | grep ${public_key} | awk '{print $2}') # only process peers with endpoints and keepalive set [ -z ${endpoint_host} ] && return 0; @@ -42,16 +42,16 @@ check_peer_activity() { [ -n "${IPV4}" -o -n "${IPV6}" ] && return 0; # re-resolve endpoint hostname if not responding for too long - last_handshake=`wg show ${iface} latest-handshakes | grep ${public_key} | awk '{print $2}'` + last_handshake=$(wg show ${iface} latest-handshakes | grep ${public_key} | awk '{print $2}') [ -z ${last_handshake} ] && return 0; - idle_seconds=$((`date +%s`-${last_handshake})) + idle_seconds=$(($(date +%s)-${last_handshake})) [ ${idle_seconds} -lt 150 ] && return 0; logger -t "wireguard_monitor" "${iface} endpoint ${endpoint_host}:${endpoint_port} is not responding for ${idle_seconds} seconds, trying to re-resolve hostname" wg set ${iface} peer ${public_key} endpoint "${endpoint_host}:${endpoint_port}" } # query ubus for all active wireguard interfaces -wg_ifaces=`ubus -S call network.interface dump | jsonfilter -e '@.interface[@.up=true]' | jsonfilter -a -e '@[@.proto="wireguard"].interface' | tr "\n" " "` +wg_ifaces=$(ubus -S call network.interface dump | jsonfilter -e '@.interface[@.up=true]' | jsonfilter -a -e '@[@.proto="wireguard"].interface' | tr "\n" " ") # check every peer in every active wireguard interface config_load network From 9362ea166168c79cbe8f589073350508e7216876 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Sun, 10 May 2020 16:47:54 +0200 Subject: [PATCH 17/70] base-files: remove useless cat Check file contents directly instead of using cat. Signed-off-by: Adrian Schmutzler --- package/base-files/files/sbin/pkg_check | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/base-files/files/sbin/pkg_check b/package/base-files/files/sbin/pkg_check index 775e401b26..28e87925ae 100755 --- a/package/base-files/files/sbin/pkg_check +++ b/package/base-files/files/sbin/pkg_check @@ -91,7 +91,7 @@ while [ "$1" ]; do # Do we have changed files or not? if [ -z "$ERR" ]; then - [ $QUIET = yes ] || [ -z "$(cat "/usr/lib/opkg/info/$1.files-sha256sum")" ] || echo "$CHECK" | sed 's|^| - |' + [ $QUIET = yes ] || [ ! -s "/usr/lib/opkg/info/$1.files-sha256sum" ] || echo "$CHECK" | sed 's|^| - |' [ $QUIET = yes ] || echo " * Package $1 is ok" [ $QUIET = yes ] || echo else From f93267bccff672e59ec0d0cf262e6574b00cc3e0 Mon Sep 17 00:00:00 2001 From: Pawel Dembicki Date: Tue, 30 Jun 2020 11:29:46 +0200 Subject: [PATCH 18/70] ipq806x: enable Linksys EA8500 eth1 interface At this moment Linksys EA8500 uses only eth0. This patch change switch registers, which allow to use eth1 as lan and eth0 as wan. The method work with similar Linksys EA7500V1 and it work with EA8500. Suggested-by: Sungbo Eo Tested-by: Brian Onn Tested-by: Adrian Panella Signed-off-by: Pawel Dembicki --- target/linux/ipq806x/base-files/etc/board.d/02_network | 2 +- .../files-4.19/arch/arm/boot/dts/qcom-ipq8064-ea8500.dts | 1 + .../ipq806x/files-5.4/arch/arm/boot/dts/qcom-ipq8064-ea8500.dts | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/target/linux/ipq806x/base-files/etc/board.d/02_network b/target/linux/ipq806x/base-files/etc/board.d/02_network index 65946d7ac5..529a8d9f39 100755 --- a/target/linux/ipq806x/base-files/etc/board.d/02_network +++ b/target/linux/ipq806x/base-files/etc/board.d/02_network @@ -37,7 +37,7 @@ linksys,ea7500-v1) linksys,ea8500) hw_mac_addr=$(mtd_get_mac_ascii devinfo hw_mac_addr) ucidef_add_switch "switch0" \ - "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" + "1:lan" "2:lan" "3:lan" "4:lan" "6@eth1" "5:wan" "0@eth0" ucidef_set_interface_macaddr "lan" "$hw_mac_addr" ucidef_set_interface_macaddr "wan" "$hw_mac_addr" ;; diff --git a/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-ea8500.dts b/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-ea8500.dts index b052ca6fcb..fc4d64453f 100644 --- a/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-ea8500.dts +++ b/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-ea8500.dts @@ -292,6 +292,7 @@ 0x00004 0x7600000 /* PAD0_MODE */ 0x00008 0x1000000 /* PAD5_MODE */ 0x0000c 0x80 /* PAD6_MODE */ + 0x00010 0x2613a0 /* PWS_REG */ 0x000e4 0x6a545 /* MAC_POWER_SEL */ 0x000e0 0xc74164de /* SGMII_CTRL */ 0x0007c 0x4e /* PORT0_STATUS */ diff --git a/target/linux/ipq806x/files-5.4/arch/arm/boot/dts/qcom-ipq8064-ea8500.dts b/target/linux/ipq806x/files-5.4/arch/arm/boot/dts/qcom-ipq8064-ea8500.dts index 0e4563a961..7110f8943a 100644 --- a/target/linux/ipq806x/files-5.4/arch/arm/boot/dts/qcom-ipq8064-ea8500.dts +++ b/target/linux/ipq806x/files-5.4/arch/arm/boot/dts/qcom-ipq8064-ea8500.dts @@ -279,6 +279,7 @@ 0x00004 0x7600000 /* PAD0_MODE */ 0x00008 0x1000000 /* PAD5_MODE */ 0x0000c 0x80 /* PAD6_MODE */ + 0x00010 0x2613a0 /* PWS_REG */ 0x000e4 0x6a545 /* MAC_POWER_SEL */ 0x000e0 0xc74164de /* SGMII_CTRL */ 0x0007c 0x4e /* PORT0_STATUS */ From 039fd27173236d22736feb0773da5f728f759c79 Mon Sep 17 00:00:00 2001 From: John Audia Date: Thu, 9 Jul 2020 17:22:35 -0400 Subject: [PATCH 19/70] kernel: bump 5.4 to 5.4.51 update via update_kernel.sh -v -u 5.4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Removed upstreamed patches: 350-MIPS-Add-missing-EHB-in-mtc0-mfc0-sequence-for-DSPen.patch Script refreshed patches: 902-debloat_proc.patch 904-debloat_dma_buf.patch Attempted merge conflict in following patches: 0024-MIPS-lantiq-revert-DSA-switch-driver-PMU-clock-chang.patch Build system: x86_64 Build tested: ipq806x (Netgear R7800) Signed-off-by: John Audia [fixed sha256sum of the tarball] Signed-off-by: Petr Štetiar --- include/kernel-version.mk | 4 +- .../generic/hack-5.4/902-debloat_proc.patch | 2 +- .../hack-5.4/904-debloat_dma_buf.patch | 2 +- ...-EHB-in-mtc0-mfc0-sequence-for-DSPen.patch | 61 ------------------- ...rt-DSA-switch-driver-PMU-clock-chang.patch | 8 +-- 5 files changed, 8 insertions(+), 69 deletions(-) delete mode 100644 target/linux/generic/pending-5.4/350-MIPS-Add-missing-EHB-in-mtc0-mfc0-sequence-for-DSPen.patch diff --git a/include/kernel-version.mk b/include/kernel-version.mk index b99ab180ab..624c31590d 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -8,11 +8,11 @@ endif LINUX_VERSION-4.14 = .187 LINUX_VERSION-4.19 = .131 -LINUX_VERSION-5.4 = .50 +LINUX_VERSION-5.4 = .51 LINUX_KERNEL_HASH-4.14.187 = 5b223475eaeea196aa7e127d3f253bca5c35d8afdc72ca75230ce1ecdd1454bd LINUX_KERNEL_HASH-4.19.131 = 19dfb9f6cc4ba30104b65dcce7d78240a4ae188cb366747d5f8eae35e98964ba -LINUX_KERNEL_HASH-5.4.50 = ad10f4c1e900f4e3eb4903b65dbcb4ca74250de63aa9fa7105b9b3c3f9a8a6e2 +LINUX_KERNEL_HASH-5.4.51 = 9e8bea8b4cd636726b7e495a3b467c8ffe96f8eddc159a45fe4a7e6e07a2069d remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1))))))) diff --git a/target/linux/generic/hack-5.4/902-debloat_proc.patch b/target/linux/generic/hack-5.4/902-debloat_proc.patch index 07ee52af44..a05822cbdd 100644 --- a/target/linux/generic/hack-5.4/902-debloat_proc.patch +++ b/target/linux/generic/hack-5.4/902-debloat_proc.patch @@ -29,7 +29,7 @@ Signed-off-by: Felix Fietkau --- a/fs/locks.c +++ b/fs/locks.c -@@ -2989,6 +2989,8 @@ static const struct seq_operations locks +@@ -2992,6 +2992,8 @@ static const struct seq_operations locks static int __init proc_locks_init(void) { diff --git a/target/linux/generic/hack-5.4/904-debloat_dma_buf.patch b/target/linux/generic/hack-5.4/904-debloat_dma_buf.patch index 4221e6a035..9c7c3c2c24 100644 --- a/target/linux/generic/hack-5.4/904-debloat_dma_buf.patch +++ b/target/linux/generic/hack-5.4/904-debloat_dma_buf.patch @@ -45,7 +45,7 @@ Signed-off-by: Felix Fietkau selftest.o \ --- a/drivers/dma-buf/dma-buf.c +++ b/drivers/dma-buf/dma-buf.c -@@ -1299,4 +1299,5 @@ static void __exit dma_buf_deinit(void) +@@ -1295,4 +1295,5 @@ static void __exit dma_buf_deinit(void) dma_buf_uninit_debugfs(); kern_unmount(dma_buf_mnt); } diff --git a/target/linux/generic/pending-5.4/350-MIPS-Add-missing-EHB-in-mtc0-mfc0-sequence-for-DSPen.patch b/target/linux/generic/pending-5.4/350-MIPS-Add-missing-EHB-in-mtc0-mfc0-sequence-for-DSPen.patch deleted file mode 100644 index 063ec0e9fb..0000000000 --- a/target/linux/generic/pending-5.4/350-MIPS-Add-missing-EHB-in-mtc0-mfc0-sequence-for-DSPen.patch +++ /dev/null @@ -1,61 +0,0 @@ -From db4603e30effd74d4adb6bcdf73072b2c06fafcd Mon Sep 17 00:00:00 2001 -From: Hauke Mehrtens -Date: Fri, 3 Jul 2020 00:07:15 +0200 -Subject: [PATCH] MIPS: Add missing EHB in mtc0 -> mfc0 sequence for DSPen - -This resolves the hazard between the mtc0 in the change_c0_status() and -the mfc0 in configure_exception_vector(). Without resolving this hazard -configure_exception_vector() could read an old value and would restore -this old value again. This would revert the changes change_c0_status() -did. I checked this by printing out the read_c0_status() at the end of -per_cpu_trap_init() and the ST0_MX is not set without this patch. - -The hazard is documented in the MIPS Architecture Reference Manual Vol. -III: MIPS32/microMIPS32 Privileged Resource Architecture (MD00088), rev -6.03 table 8.1 which includes: - - Producer | Consumer | Hazard - ----------|----------|---------------------------- - mtc0 | mfc0 | any coprocessor 0 register - -I saw this hazard on an Atheros AR9344 rev 2 SoC with a MIPS 74Kc CPU. -There the change_c0_status() function would activate the DSPen by -setting ST0_MX in the c0_status register. This was reverted and then the -system got a DSP exception when the DSP registers were saved in -save_dsp() in the first process switch. The crash looks like this: - -[ 0.089999] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear) -[ 0.097796] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear) -[ 0.107070] Kernel panic - not syncing: Unexpected DSP exception -[ 0.113470] Rebooting in 1 seconds.. - -We saw this problem in OpenWrt only on the MIPS 74Kc based Atheros SoCs, -not on the 24Kc based SoCs. We only saw it with kernel 5.4 not with -kernel 4.19, in addition we had to use GCC 8.4 or 9.X, with GCC 8.3 it -did not happen. - -In the kernel I bisected this problem to commit 9012d011660e ("compiler: -allow all arches to enable CONFIG_OPTIMIZE_INLINING"), but when this was -reverted it also happened after commit 172dcd935c34b ("MIPS: Always -allocate exception vector for MIPSr2+"). - -Commit 0b24cae4d535 ("MIPS: Add missing EHB in mtc0 -> mfc0 sequence.") -does similar changes to a different file. I am not sure if there are -more places affected by this problem. - -Signed-off-by: Hauke Mehrtens -Cc: ---- - arch/mips/kernel/traps.c | 1 + - 1 file changed, 1 insertion(+) - ---- a/arch/mips/kernel/traps.c -+++ b/arch/mips/kernel/traps.c -@@ -2126,6 +2126,7 @@ static void configure_status(void) - - change_c0_status(ST0_CU|ST0_MX|ST0_RE|ST0_FR|ST0_BEV|ST0_TS|ST0_KX|ST0_SX|ST0_UX, - status_set); -+ back_to_back_c0_hazard(); - } - - unsigned int hwrena; diff --git a/target/linux/lantiq/patches-5.4/0024-MIPS-lantiq-revert-DSA-switch-driver-PMU-clock-chang.patch b/target/linux/lantiq/patches-5.4/0024-MIPS-lantiq-revert-DSA-switch-driver-PMU-clock-chang.patch index a364d6d67b..9b326c50d1 100644 --- a/target/linux/lantiq/patches-5.4/0024-MIPS-lantiq-revert-DSA-switch-driver-PMU-clock-chang.patch +++ b/target/linux/lantiq/patches-5.4/0024-MIPS-lantiq-revert-DSA-switch-driver-PMU-clock-chang.patch @@ -30,8 +30,8 @@ Signed-off-by: Mathias Kresin + clkdev_add_pmu("1e108000.eth", NULL, 0, 0, PMU_SWITCH | PMU_PPE_DP | PMU_PPE_TC); clkdev_add_pmu("1da00000.usif", "NULL", 1, 0, PMU_USIF); -- clkdev_add_pmu("1e108000.gswip", "gphy0", 0, 0, PMU_GPHY); -- clkdev_add_pmu("1e108000.gswip", "gphy1", 0, 0, PMU_GPHY); +- clkdev_add_pmu("1e108000.switch", "gphy0", 0, 0, PMU_GPHY); +- clkdev_add_pmu("1e108000.switch", "gphy1", 0, 0, PMU_GPHY); + clkdev_add_pmu("1f203020.gphy", NULL, 1, 0, PMU_GPHY); + clkdev_add_pmu("1f203068.gphy", NULL, 1, 0, PMU_GPHY); clkdev_add_pmu("1e103100.deu", NULL, 1, 0, PMU_DEU); @@ -46,8 +46,8 @@ Signed-off-by: Mathias Kresin PMU_SWITCH | PMU_PPE_DPLUS | PMU_PPE_DPLUM | PMU_PPE_EMA | PMU_PPE_TC | PMU_PPE_SLL01 | PMU_PPE_QSB | PMU_PPE_TOP); -- clkdev_add_pmu("1e108000.gswip", "gphy0", 0, 0, PMU_GPHY); -- clkdev_add_pmu("1e108000.gswip", "gphy1", 0, 0, PMU_GPHY); +- clkdev_add_pmu("1e108000.switch", "gphy0", 0, 0, PMU_GPHY); +- clkdev_add_pmu("1e108000.switch", "gphy1", 0, 0, PMU_GPHY); + clkdev_add_pmu("1f203020.gphy", NULL, 0, 0, PMU_GPHY); + clkdev_add_pmu("1f203068.gphy", NULL, 0, 0, PMU_GPHY); clkdev_add_pmu("1e103000.sdio", NULL, 1, 0, PMU_SDIO); From 7d97fe55f422d37ec6907b9c1609b42688315dd7 Mon Sep 17 00:00:00 2001 From: Huangbin Zhan Date: Thu, 9 Jul 2020 05:01:54 +0800 Subject: [PATCH 20/70] uboot-envtools: ath79: update ubootenv partion index for gl-ar300m The block index of u-boot-env changed from mtd1 to mtd3 after upgrading kernel to 5.4. This patch search the mtd block by label name, work as expect when perform a clean flash. Signed-off-by: Huangbin Zhan --- package/boot/uboot-envtools/files/ath79 | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79 index 5f5a448861..5cd64f4ffd 100644 --- a/package/boot/uboot-envtools/files/ath79 +++ b/package/boot/uboot-envtools/files/ath79 @@ -19,10 +19,6 @@ buffalo,bhr-4grv2|\ devolo,magic-2-wifi|\ engenius,ecb1750|\ etactica,eg200|\ -glinet,gl-ar300m-lite|\ -glinet,gl-ar300m-nand|\ -glinet,gl-ar300m-nor|\ -glinet,gl-ar300m16|\ glinet,gl-ar750s-nor|\ glinet,gl-ar750s-nor-nand|\ librerouter,librerouter-v1|\ @@ -52,6 +48,14 @@ domywifi,dw33d) glinet,gl-ar150) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x8000" "0x10000" ;; +glinet,gl-ar300m-lite|\ +glinet,gl-ar300m-nand|\ +glinet,gl-ar300m-nor|\ +glinet,gl-ar300m16) + idx="$(find_mtd_index u-boot-env)" + [ -n "$idx" ] && \ + ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x10000" + ;; netgear,wndr3700|\ netgear,wndr3700-v2|\ netgear,wndrmac-v1) From 9c99187e616ac54aed572a0eb310aadd06ac8e4b Mon Sep 17 00:00:00 2001 From: Pawel Dembicki Date: Fri, 24 Jan 2020 07:25:54 +0100 Subject: [PATCH 21/70] kernel: add package for Seiko S-35390A I2C RTC This patch adds kernel package for Seiko Instruments S-35390A. Signed-off-by: Pawel Dembicki --- package/kernel/linux/modules/other.mk | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/package/kernel/linux/modules/other.mk b/package/kernel/linux/modules/other.mk index 15d67b4679..f74c622ed7 100644 --- a/package/kernel/linux/modules/other.mk +++ b/package/kernel/linux/modules/other.mk @@ -732,6 +732,23 @@ endef $(eval $(call KernelPackage,rtc-rx8025)) +define KernelPackage/rtc-s35390a + SUBMENU:=$(OTHER_MENU) + TITLE:=Seico S-35390A + DEFAULT:=m if ALL_KMODS && RTC_SUPPORT + DEPENDS:=+kmod-i2c-core + KCONFIG:=CONFIG_RTC_DRV_S35390A \ + CONFIG_RTC_CLASS=y + FILES:=$(LINUX_DIR)/drivers/rtc/rtc-s35390a.ko + AUTOLOAD:=$(call AutoLoad,50,rtc-s35390a,1) +endef + +define KernelPackage/rtc-s35390a/description + Kernel module for Seiko Instruments S-35390A I2C RTC chip +endef + +$(eval $(call KernelPackage,rtc-s35390a)) + define KernelPackage/mtdtests SUBMENU:=$(OTHER_MENU) From c881d7ab039022aac91a3524227df9cc5f60dd16 Mon Sep 17 00:00:00 2001 From: Pawel Dembicki Date: Fri, 24 Jan 2020 07:13:24 +0100 Subject: [PATCH 22/70] uboot-kirkwood: add uboot for CheckPoint L-50 This patch add u-boot for CheckPoint L-50 routers. Signed-off-by: Pawel Dembicki --- package/boot/uboot-kirkwood/Makefile | 6 + ...-kirkwood-add-CheckPoint-L-50-device.patch | 928 ++++++++++++++++++ .../patches/200-openwrt-config.patch | 26 +- ...xx-add-support-for-RGMII-TX-RX-delay.patch | 53 + ...-mv88e61xx-add-support-for-MV88E6171.patch | 67 ++ 5 files changed, 1078 insertions(+), 2 deletions(-) create mode 100644 package/boot/uboot-kirkwood/patches/151-arm-kirkwood-add-CheckPoint-L-50-device.patch create mode 100644 package/boot/uboot-kirkwood/patches/701-phy-mv88e61xx-add-support-for-RGMII-TX-RX-delay.patch create mode 100644 package/boot/uboot-kirkwood/patches/702-phy-mv88e61xx-add-support-for-MV88E6171.patch diff --git a/package/boot/uboot-kirkwood/Makefile b/package/boot/uboot-kirkwood/Makefile index d2cbc1041b..e1493bf0e8 100644 --- a/package/boot/uboot-kirkwood/Makefile +++ b/package/boot/uboot-kirkwood/Makefile @@ -54,6 +54,11 @@ define U-Boot/iconnect_second_stage BUILD_DEVICES:=iom_iconnect-1.1 endef +define U-Boot/l-50 + NAME:=CheckPoint L-50 + BUILD_DEVICES:=checkpoint_l-50 +endef + define U-Boot/nsa310 NAME:=Zyxel NSA310 BUILD_DEVICES:=zyxel_nsa310b @@ -89,6 +94,7 @@ UBOOT_TARGETS := \ goflexhome \ ib62x0 ib62x0_second_stage \ iconnect iconnect_second_stage \ + l-50 \ nsa310 \ nsa310s \ nsa325 \ diff --git a/package/boot/uboot-kirkwood/patches/151-arm-kirkwood-add-CheckPoint-L-50-device.patch b/package/boot/uboot-kirkwood/patches/151-arm-kirkwood-add-CheckPoint-L-50-device.patch new file mode 100644 index 0000000000..b228be6aa6 --- /dev/null +++ b/package/boot/uboot-kirkwood/patches/151-arm-kirkwood-add-CheckPoint-L-50-device.patch @@ -0,0 +1,928 @@ +From 742f780f62ace452b83e2463f1f1afdda4b724ea Mon Sep 17 00:00:00 2001 +From: Pawel Dembicki +Date: Sun, 26 Jan 2020 07:27:24 +0100 +Subject: [PATCH] arm: kirkwood: add CheckPoint L-50 device + +This patch adds support for the Check Point L-50 from 600/1100 series +routers. + +Specification: +-CPU: Marvell Kirkwood 88F6821 1200MHz +-RAM: 512MB +-Flash: NAND 512MB +-WiFi: mPCIe card based on Atheros AR9287 b/g/n +-WAN: 1 Gigabit Port (Marvell 88E1116R PHY) +-LAN: 9 Gigabit Ports (2x Marvell 88E6171(5+4)) +-USB: 2x USB2.0 +-Express card slot +-SD card slot +-Serial console: RJ-45 115200 8n1 +-Unsupported DSL + +Known limitations: +- In board is used two switches in chain. Second Marvell is not used + in u-Boot. + +Signed-off-by: Pawel Dembicki +--- + arch/arm/dts/Makefile | 1 + + arch/arm/dts/kirkwood-l-50.dts | 439 +++++++++++++++++++++++++++++ + arch/arm/mach-kirkwood/Kconfig | 4 + + board/checkpoint/l-50/Kconfig | 12 + + board/checkpoint/l-50/MAINTAINERS | 6 + + board/checkpoint/l-50/Makefile | 11 + + board/checkpoint/l-50/kwbimage.cfg | 36 +++ + board/checkpoint/l-50/l-50.c | 172 +++++++++++ + board/checkpoint/l-50/l-50.h | 29 ++ + configs/l-50_defconfig | 59 ++++ + include/configs/l-50.h | 59 ++++ + 11 files changed, 828 insertions(+) + create mode 100644 arch/arm/dts/kirkwood-l-50.dts + create mode 100644 board/checkpoint/l-50/Kconfig + create mode 100644 board/checkpoint/l-50/MAINTAINERS + create mode 100644 board/checkpoint/l-50/Makefile + create mode 100644 board/checkpoint/l-50/kwbimage.cfg + create mode 100644 board/checkpoint/l-50/l-50.c + create mode 100644 board/checkpoint/l-50/l-50.h + create mode 100644 configs/l-50_defconfig + create mode 100644 include/configs/l-50.h + +--- a/arch/arm/dts/Makefile ++++ b/arch/arm/dts/Makefile +@@ -51,6 +51,7 @@ dtb-$(CONFIG_KIRKWOOD) += \ + kirkwood-iconnect.dtb \ + kirkwood-is2.dtb \ + kirkwood-km_kirkwood.dtb \ ++ kirkwood-l-50.dtb \ + kirkwood-lsxhl.dtb \ + kirkwood-lschlv2.dtb \ + kirkwood-net2big.dtb \ +--- /dev/null ++++ b/arch/arm/dts/kirkwood-l-50.dts +@@ -0,0 +1,439 @@ ++// SPDX-License-Identifier: GPL-2.0 ++/* ++ * Check Point L-50 Board Description ++ * Copyright 2020 Pawel Dembicki ++ */ ++ ++/dts-v1/; ++ ++#include "kirkwood.dtsi" ++#include "kirkwood-6281.dtsi" ++ ++/ { ++ model = "Check Point L-50"; ++ compatible = "checkpoint,l-50", "marvell,kirkwood-88f6281", "marvell,kirkwood"; ++ ++ memory { ++ device_type = "memory"; ++ reg = <0x00000000 0x20000000>; ++ }; ++ ++ chosen { ++ bootargs = "console=ttyS0,115200n8"; ++ stdout-path = &uart0; ++ }; ++ ++ ocp@f1000000 { ++ pinctrl: pin-controller@10000 { ++ pinctrl-0 = <&pmx_led38 &pmx_sysrst &pmx_button29>; ++ pinctrl-names = "default"; ++ ++ pmx_sysrst: pmx-sysrst { ++ marvell,pins = "mpp6"; ++ marvell,function = "sysrst"; ++ }; ++ ++ pmx_button29: pmx_button29 { ++ marvell,pins = "mpp29"; ++ marvell,function = "gpio"; ++ }; ++ ++ pmx_led38: pmx_led38 { ++ marvell,pins = "mpp38"; ++ marvell,function = "gpio"; ++ }; ++ ++ pmx_sdio_cd: pmx-sdio-cd { ++ marvell,pins = "mpp46"; ++ marvell,function = "gpio"; ++ }; ++ }; ++ ++ serial@12000 { ++ status = "okay"; ++ }; ++ ++ mvsdio@90000 { ++ status = "okay"; ++ cd-gpios = <&gpio1 14 9>; ++ }; ++ ++ i2c@11000 { ++ status = "okay"; ++ clock-frequency = <400000>; ++ ++ gpio2: gpio-expander@20{ ++ #gpio-cells = <2>; ++ #interrupt-cells = <2>; ++ compatible = "semtech,sx1505q"; ++ reg = <0x20>; ++ ++ gpio-controller; ++ }; ++ ++ /* Three GPIOs from 0x21 exp. are undescribed in dts: ++ * 1: DSL module reset (active low) ++ * 5: mPCIE reset (active low) ++ * 6: Express card reset (active low) ++ */ ++ gpio3: gpio-expander@21{ ++ #gpio-cells = <2>; ++ #interrupt-cells = <2>; ++ compatible = "semtech,sx1505q"; ++ reg = <0x21>; ++ ++ gpio-controller; ++ }; ++ ++ rtc@30 { ++ compatible = "s35390a"; ++ reg = <0x30>; ++ }; ++ }; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ status_green { ++ label = "l-50:green:status"; ++ gpios = <&gpio1 6 GPIO_ACTIVE_LOW>; ++ }; ++ ++ status_red { ++ label = "l-50:red:status"; ++ gpios = <&gpio3 2 GPIO_ACTIVE_LOW>; ++ }; ++ ++ wifi { ++ label = "l-50:green:wifi"; ++ gpios = <&gpio2 7 GPIO_ACTIVE_LOW>; ++ linux,default-trigger = "phy0tpt"; ++ }; ++ ++ internet_green { ++ label = "l-50:green:internet"; ++ gpios = <&gpio2 3 GPIO_ACTIVE_LOW>; ++ }; ++ ++ internet_red { ++ label = "l-50:red:internet"; ++ gpios = <&gpio2 1 GPIO_ACTIVE_LOW>; ++ }; ++ ++ usb1_green { ++ label = "l-50:green:usb1"; ++ gpios = <&gpio2 0 GPIO_ACTIVE_LOW>; ++ linux,default-trigger = "usbport"; ++ trigger-sources = <&hub_port3>; ++ }; ++ ++ usb1_red { ++ label = "l-50:red:usb1"; ++ gpios = <&gpio2 4 GPIO_ACTIVE_LOW>; ++ }; ++ ++ usb2_green { ++ label = "l-50:green:usb2"; ++ gpios = <&gpio2 2 GPIO_ACTIVE_LOW>; ++ linux,default-trigger = "usbport"; ++ trigger-sources = <&hub_port1>; ++ }; ++ ++ usb2_red { ++ label = "l-50:red:usb2"; ++ gpios = <&gpio2 5 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ usb2_pwr { ++ compatible = "regulator-fixed"; ++ regulator-name = "usb2_pwr"; ++ ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ gpio = <&gpio3 3 GPIO_ACTIVE_LOW>; ++ regulator-always-on; ++ }; ++ ++ usb1_pwr { ++ compatible = "regulator-fixed"; ++ regulator-name = "usb1_pwr"; ++ ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ gpio = <&gpio3 4 GPIO_ACTIVE_LOW>; ++ regulator-always-on; ++ }; ++ ++ mpcie_pwr { ++ compatible = "regulator-fixed"; ++ regulator-name = "mpcie_pwr"; ++ ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ gpio = <&gpio3 5 GPIO_ACTIVE_HIGH>; ++ enable-active-high; ++ regulator-always-on; ++ }; ++ ++ express_card_pwr { ++ compatible = "regulator-fixed"; ++ regulator-name = "express_card_pwr"; ++ ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ gpio = <&gpio3 7 GPIO_ACTIVE_HIGH>; ++ enable-active-high; ++ regulator-always-on; ++ }; ++ ++ keys { ++ compatible = "gpio-keys"; ++ ++ factory_defaults { ++ label = "factory_defaults"; ++ gpios = <&gpio0 29 GPIO_ACTIVE_LOW>; ++ linux,code = ; ++ }; ++ }; ++}; ++ ++&mdio { ++ status = "okay"; ++ ++ ethphy8: ethernet-phy@8 { ++ reg = <0x08>; ++ }; ++ ++ switch0: switch@10 { ++ compatible = "marvell,mv88e6085"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <0x10>; ++ dsa,member = <0 0>; ++ ++ ports { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ port@0 { ++ reg = <0>; ++ label = "lan5"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan1"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan6"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan2"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "lan7"; ++ }; ++ ++ switch0port5: port@5 { ++ reg = <5>; ++ phy-mode = "rgmii-txid"; ++ link = <&switch1port5>; ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++ ++ port@6 { ++ reg = <6>; ++ label = "cpu"; ++ phy-mode = "rgmii-id"; ++ ethernet = <ð1port>; ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++ }; ++ }; ++ ++ switch@11 { ++ compatible = "marvell,mv88e6085"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <0x11>; ++ dsa,member = <0 1>; ++ ++ ports { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ port@0 { ++ reg = <0>; ++ label = "lan3"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan8"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan4"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "dmz"; ++ }; ++ ++ switch1port5: port@5 { ++ reg = <5>; ++ phy-mode = "rgmii-txid"; ++ link = <&switch0port5>; ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++ ++ port@6 { ++ reg = <6>; ++ label = "dsl"; ++ fixed-link { ++ speed = <100>; ++ full-duplex; ++ }; ++ }; ++ }; ++ }; ++}; ++ ++ð0 { ++ status = "okay"; ++ ethernet0-port@0 { ++ phy-handle = <ðphy8>; ++ }; ++}; ++ ++ð1 { ++ status = "okay"; ++ ethernet1-port@0 { ++ speed = <1000>; ++ duplex = <1>; ++ phy-handle = <&switch0>; ++ }; ++}; ++ ++&nand { ++ status = "okay"; ++ pinctrl-0 = <&pmx_nand>; ++ pinctrl-names = "default"; ++ ++ partition@0 { ++ label = "u-boot"; ++ reg = <0x00000000 0x000c0000>; ++ }; ++ ++ partition@a0000 { ++ label = "bootldr-env"; ++ reg = <0x000c0000 0x00040000>; ++ }; ++ ++ partition@100000 { ++ label = "kernel-1"; ++ reg = <0x00100000 0x00800000>; ++ }; ++ ++ partition@900000 { ++ label = "rootfs-1"; ++ reg = <0x00900000 0x07100000>; ++ }; ++ ++ partition@7a00000 { ++ label = "kernel-2"; ++ reg = <0x07a00000 0x00800000>; ++ }; ++ ++ partition@8200000 { ++ label = "rootfs-2"; ++ reg = <0x08200000 0x07100000>; ++ }; ++ ++ partition@f300000 { ++ label = "default_sw"; ++ reg = <0x0f300000 0x07900000>; ++ }; ++ ++ partition@16c00000 { ++ label = "logs"; ++ reg = <0x16c00000 0x01800000>; ++ }; ++ ++ partition@18400000 { ++ label = "preset_cfg"; ++ reg = <0x18400000 0x00100000>; ++ }; ++ ++ partition@18500000 { ++ label = "adsl"; ++ reg = <0x18500000 0x00100000>; ++ }; ++ ++ partition@18600000 { ++ label = "storage"; ++ reg = <0x18600000 0x07a00000>; ++ }; ++}; ++ ++&rtc { ++ status = "disabled"; ++}; ++ ++&pciec { ++ status = "okay"; ++}; ++ ++&pcie0 { ++ status = "okay"; ++}; ++ ++&sata_phy0 { ++ status = "disabled"; ++}; ++ ++&sata_phy1 { ++ status = "disabled"; ++}; ++ ++&usb0 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ port@1 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <1>; ++ #trigger-source-cells = <0>; ++ ++ hub_port1: port@1 { ++ reg = <1>; ++ #trigger-source-cells = <0>; ++ }; ++ ++ hub_port3: port@3 { ++ reg = <3>; ++ #trigger-source-cells = <0>; ++ }; ++ }; ++}; +--- a/arch/arm/mach-kirkwood/Kconfig ++++ b/arch/arm/mach-kirkwood/Kconfig +@@ -74,6 +74,9 @@ config TARGET_DB_88F6281_BP + config TARGET_NSA325 + bool "Zyxel NSA325 board" + ++config TARGET_L50 ++ bool "Check Point L-50" ++ + endchoice + + config SYS_SOC +@@ -102,5 +105,6 @@ source "board/zyxel/nsa325/Kconfig" + source "board/alliedtelesis/SBx81LIFKW/Kconfig" + source "board/alliedtelesis/SBx81LIFXCAT/Kconfig" + source "board/Marvell/db-88f6281-bp/Kconfig" ++source "board/checkpoint/l-50/Kconfig" + + endif +--- /dev/null ++++ b/board/checkpoint/l-50/Kconfig +@@ -0,0 +1,12 @@ ++if TARGET_L50 ++ ++config SYS_BOARD ++ default "l-50" ++ ++config SYS_VENDOR ++ default "checkpoint" ++ ++config SYS_CONFIG_NAME ++ default "l-50" ++ ++endif +--- /dev/null ++++ b/board/checkpoint/l-50/MAINTAINERS +@@ -0,0 +1,6 @@ ++L50 BOARD ++M: Pawel Dembicki ++S: Maintained ++F: board/checkpoint/l-50/ ++F: include/configs/l-50.h ++F: configs/l-50_defconfig +--- /dev/null ++++ b/board/checkpoint/l-50/Makefile +@@ -0,0 +1,11 @@ ++# SPDX-License-Identifier: GPL-2.0+ ++# ++# (C) Copyright 2020 ++# Pawel Dembicki ++# ++# Based on Kirkwood support: ++# (C) Copyright 2009 ++# Marvell Semiconductor ++# Written-by: Prafulla Wadaskar ++ ++obj-y := l-50.o +--- /dev/null ++++ b/board/checkpoint/l-50/kwbimage.cfg +@@ -0,0 +1,36 @@ ++# SPDX-License-Identifier: GPL-2.0+ ++# ++# Values taken from original bootloader source. ++# Based on: ++# dramregs_seattle_400rd_A.txt from uboot_src_CP600_1100. ++ ++# Boot Media configurations ++BOOT_FROM nand ++NAND_ECC_MODE default ++NAND_PAGE_SIZE 0x0800 ++ ++DATA 0xFFD100e0 0x1b1b1b9b ++DATA 0xFFD01400 0x43000c30 ++DATA 0xFFD01404 0x39543000 ++DATA 0xFFD01408 0x22125451 ++DATA 0xFFD0140C 0x00000833 ++DATA 0xFFD01410 0x000000cc ++DATA 0xFFD01414 0x00000000 ++DATA 0xFFD01418 0x00000000 ++DATA 0xFFD0141C 0x00000C52 ++DATA 0xFFD01420 0x00000004 ++DATA 0xFFD01424 0x0000F17F ++DATA 0xFFD01428 0x00085520 ++DATA 0xFFD0147C 0x00008552 ++DATA 0xFFD01504 0x0FFFFFF1 ++DATA 0xFFD01508 0x10000000 ++DATA 0xFFD0150C 0x0FFFFFF5 ++DATA 0xFFD01514 0x00000000 ++DATA 0xFFD0151C 0x00000000 ++DATA 0xFFD01494 0x00120012 ++DATA 0xFFD01498 0x00000000 ++DATA 0xFFD0149C 0x0000E40F ++DATA 0xFFD01480 0x00000001 ++DATA 0xFFD20134 0x66666666 ++DATA 0xFFD20138 0x66666666 ++DATA 0x0 0x0 +--- /dev/null ++++ b/board/checkpoint/l-50/l-50.c +@@ -0,0 +1,172 @@ ++// SPDX-License-Identifier: GPL-2.0+ ++/* ++ * Copyright (C) 2020 ++ * Pawel Dembicki ++ * ++ * Based on Kirkwood support: ++ * (C) Copyright 2009 ++ * Marvell Semiconductor ++ * Written-by: Prafulla Wadaskar ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include "l-50.h" ++ ++DECLARE_GLOBAL_DATA_PTR; ++ ++int board_early_init_f(void) ++{ ++ /* Gpio configuration */ ++ mvebu_config_gpio(L50_OE_VAL_LOW, L50_OE_VAL_HIGH, ++ L50_OE_LOW, L50_OE_HIGH); ++ ++ /* Multi-Purpose Pins Functionality configuration */ ++ static const u32 kwmpp_config[] = { ++ MPP0_NF_IO2, ++ MPP1_NF_IO3, ++ MPP2_NF_IO4, ++ MPP3_NF_IO5, ++ MPP4_NF_IO6, ++ MPP5_NF_IO7, ++ MPP6_SYSRST_OUTn, ++ MPP7_SPI_SCn, ++ MPP8_TW_SDA, ++ MPP9_TW_SCK, ++ MPP10_UART0_TXD, ++ MPP11_UART0_RXD, ++ MPP12_SD_CLK, ++ MPP13_SD_CMD, ++ MPP14_SD_D0, ++ MPP15_SD_D1, ++ MPP16_SD_D2, ++ MPP17_SD_D3, ++ MPP18_NF_IO0, ++ MPP19_NF_IO1, ++ MPP20_GE1_0, ++ MPP21_GE1_1, ++ MPP22_GE1_2, ++ MPP23_GE1_3, ++ MPP24_GE1_4, ++ MPP25_GE1_5, ++ MPP26_GE1_6, ++ MPP27_GE1_7, ++ MPP28_GPIO, ++ MPP29_GPIO, ++ MPP30_GE1_10, ++ MPP31_GE1_11, ++ MPP32_GE1_12, ++ MPP33_GE1_13, ++ MPP34_GPIO, ++ MPP35_GPIO, ++ MPP36_AUDIO_SPDIFI, /* value from stock u-boot */ ++ MPP37_GPIO, ++ MPP38_GPIO, ++ MPP39_TDM_SPI_CS0, ++ MPP40_GPIO, ++ MPP41_GPIO, ++ MPP42_TDM_SPI_MOSI, ++ MPP43_TDM_CODEC_INTn, ++ MPP44_GPIO, ++ MPP45_TDM_PCLK, ++ MPP46_GPIO, ++ MPP47_TDM_DRX, ++ MPP48_GPIO, ++ MPP49_GPIO, ++ 0 ++ }; ++ kirkwood_mpp_conf(kwmpp_config, NULL); ++ ++ return 0; ++} ++ ++void board_gpio_expander_init(void) ++{ ++ struct udevice *dev0, *dev1; ++ uchar data_buffer; ++ int ret; ++ ++ ret = i2c_get_chip_for_busnum(0, L50_GPIO0_I2C_ADDRESS, 1, &dev0); ++ if (ret) { ++ debug("%s: Cannot find I2C GPIO expander chip 0x02%X\n", ++ __func__, L50_GPIO0_I2C_ADDRESS); ++ return; ++ } ++ ++ ret = i2c_get_chip_for_busnum(0, L50_GPIO1_I2C_ADDRESS, 1, &dev1); ++ if (ret) { ++ debug("%s: Cannot find I2C GPIO expander chip 0x02%X\n", ++ __func__, L50_GPIO1_I2C_ADDRESS); ++ return; ++ } ++ ++ /* Set IO as output */ ++ data_buffer = 0x0; ++ dm_i2c_write(dev0, 1, &data_buffer, 1); ++ dm_i2c_write(dev1, 1, &data_buffer, 1); ++ ++ /* Set all leds off, reset asserted, pwr off */ ++ data_buffer = 0xbf; ++ dm_i2c_write(dev0, 0, &data_buffer, 1); ++ data_buffer = 0x1c; ++ dm_i2c_write(dev1, 0, &data_buffer, 1); ++ ++ mdelay(100); ++ ++ /* Set pwr on */ ++ data_buffer = 0xa5; ++ dm_i2c_write(dev1, 0, &data_buffer, 1); ++ ++ mdelay(100); ++ ++ /* Set reset deasserted, status red led enabled*/ ++ data_buffer = 0xff; ++ dm_i2c_write(dev0, 0, &data_buffer, 1); ++ data_buffer = 0xe3; ++ dm_i2c_write(dev1, 0, &data_buffer, 1); ++} ++ ++int board_init(void) ++{ ++ /* Boot parameters address */ ++ gd->bd->bi_boot_params = mvebu_sdram_bar(0) + 0x100; ++ ++ board_gpio_expander_init(); ++ ++ return 0; ++} ++ ++#ifdef CONFIG_RESET_PHY_R ++/* Configure and initialize PHY */ ++void reset_phy(void) ++{ ++ u16 devadr; ++ char *name = "ethernet-controller@72000"; ++ ++ if (miiphy_set_current_dev(name)) ++ return; ++ ++ /* command to read PHY dev address */ ++ if (miiphy_read(name, 0xEE, 0xEE, (u16 *)&devadr)) { ++ printf("Err..(%s) could not read PHY dev address\n", __func__); ++ return; ++ } ++ ++ /* ++ * Fix PHY led configuration ++ */ ++ miiphy_write(name, devadr, MV88E1116_PGADR_REG, 3); ++ miiphy_write(name, devadr, 0x10, 0x1177); ++ miiphy_write(name, devadr, 0x11, 0x4417); ++ miiphy_write(name, devadr, MV88E1116_PGADR_REG, 0); ++ ++ debug("88E1116 Initialized on %s\n", name); ++} ++#endif /* CONFIG_RESET_PHY_R */ +--- /dev/null ++++ b/board/checkpoint/l-50/l-50.h +@@ -0,0 +1,29 @@ ++/* SPDX-License-Identifier: GPL-2.0+ */ ++/* ++ * Copyright (C) 2020 ++ * Pawel Dembicki ++ * ++ * Based on Kirkwood support: ++ * (C) Copyright 2009 ++ * Marvell Semiconductor ++ * Written-by: Prafulla Wadaskar ++ */ ++ ++#ifndef __L50_H ++#define __L50_H ++ ++/* GPIO configuration */ ++#define L50_OE_LOW 0x30000000 ++#define L50_OE_HIGH 0x0000004c ++#define L50_OE_VAL_LOW 0x00000000 ++#define L50_OE_VAL_HIGH 0x00000000 ++ ++/* Expander GPIO addresses */ ++ ++#define L50_GPIO0_I2C_ADDRESS 0x20 ++#define L50_GPIO1_I2C_ADDRESS 0x21 ++ ++/* PHY register */ ++#define MV88E1116_PGADR_REG 22 ++ ++#endif /* __L50_H */ +--- /dev/null ++++ b/configs/l-50_defconfig +@@ -0,0 +1,59 @@ ++CONFIG_ARM=y ++CONFIG_SYS_DCACHE_OFF=y ++CONFIG_ARCH_CPU_INIT=y ++CONFIG_KIRKWOOD=y ++CONFIG_SYS_TEXT_BASE=0x600000 ++CONFIG_TARGET_L50=y ++CONFIG_ENV_SIZE=0x20000 ++CONFIG_ENV_OFFSET=0xC0000 ++CONFIG_ENV_SECT_SIZE=0x20000 ++CONFIG_ENV_ADDR=0xC0000 ++CONFIG_IDENT_STRING="\nCheck Point L-50" ++CONFIG_NR_DRAM_BANKS=2 ++# CONFIG_SYS_MALLOC_F is not set ++CONFIG_BOOTDELAY=1 ++CONFIG_CONSOLE_MUX=y ++CONFIG_DISPLAY_BOARDINFO=y ++CONFIG_HUSH_PARSER=y ++# CONFIG_CMD_FLASH is not set ++#CONFIG_CMD_IDE=y ++CONFIG_CMD_I2C=y ++CONFIG_CMD_NAND=y ++CONFIG_CMD_USB=y ++# CONFIG_CMD_SETEXPR is not set ++CONFIG_CMD_DHCP=y ++CONFIG_CMD_MII=y ++CONFIG_CMD_PING=y ++CONFIG_CMD_EXT2=y ++CONFIG_CMD_FAT=y ++CONFIG_CMD_JFFS2=y ++CONFIG_CMD_MTDPARTS=y ++CONFIG_MTD=y ++CONFIG_MTD_RAW_NAND=y ++CONFIG_MTDIDS_DEFAULT="nand0=orion_nand" ++CONFIG_MTDPARTS_DEFAULT="mtdparts=orion_nand:0xc0000@0x0(u-boot)ro,0x40000@0xc0000(bootldr-env),0x7900000@0x100000(ubi),0x800000@0x7a00000(kernel-2),0x7100000@0x8200000(rootfs-2),0x7900000@0xf300000(default_sw),0x1800000@0x16c00000(logs),0x100000@0x18400000(preset_cfg),0x100000@0x18500000(adsl),-@0x18600000(storage)" ++CONFIG_CMD_UBI=y ++CONFIG_ISO_PARTITION=y ++CONFIG_OF_CONTROL=y ++CONFIG_DEFAULT_DEVICE_TREE="kirkwood-l-50" ++CONFIG_ENV_IS_IN_NAND=y ++CONFIG_DM=y ++CONFIG_DM_ETH=y ++#CONFIG_MVSATA_IDE=y ++CONFIG_MMC=y ++CONFIG_MVGBE=y ++CONFIG_MII=y ++CONFIG_PHYLIB=y ++CONFIG_PHY_MARVELL=y ++CONFIG_MV88E61XX_SWITCH=y ++CONFIG_MV88E61XX_CPU_PORT=6 ++CONFIG_MV88E61XX_PHY_PORTS=0x01f ++CONFIG_MV88E61XX_FIXED_PORTS=0 ++#CONFIG_DM_RTC=y ++#CONFIG_RTC_MV=y ++CONFIG_SYS_NS16550=y ++CONFIG_DM_I2C=y ++CONFIG_SYS_I2C_MVTWSI=y ++CONFIG_USB=y ++CONFIG_USB_EHCI_HCD=y ++CONFIG_USB_STORAGE=y +--- /dev/null ++++ b/include/configs/l-50.h +@@ -0,0 +1,59 @@ ++/* SPDX-License-Identifier: GPL-2.0+ */ ++/* ++ * Copyright (C) 2020 ++ * Pawel Dembicki ++ * ++ * Based on Kirkwood support: ++ * (C) Copyright 2009 ++ * Marvell Semiconductor ++ * Written-by: Prafulla Wadaskar ++ */ ++ ++#ifndef _CONFIG_L50_H ++#define _CONFIG_L50_H ++ ++/* ++ * High Level Configuration Options (easy to change) ++ */ ++#define CONFIG_FEROCEON_88FR131 /* CPU Core subversion */ ++#define CONFIG_KW88F6281 /* SOC Name */ ++#define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */ ++ ++/* ++ * mv-common.h should be defined after CMD configs since it used them ++ * to enable certain macros ++ */ ++#include "mv-common.h" ++ ++/* Remove or override few declarations from mv-common.h */ ++ ++/* ++ * Ethernet Driver configuration ++ */ ++#ifdef CONFIG_CMD_NET ++#define CONFIG_MVGBE_PORTS {1, 1} /* enable port 0 only */ ++#define CONFIG_NETCONSOLE ++#endif ++ ++#define CONFIG_MV88E61XX_CPU_PORT_RX_DELAY ++#define CONFIG_MV88E61XX_CPU_PORT_TX_DELAY ++ ++/* ++ * Enable GPI0 support ++ */ ++#define CONFIG_KIRKWOOD_GPIO ++ ++/* ++ * Default environment variables ++ */ ++#define CONFIG_BOOTCOMMAND \ ++ "ubi part ubi; " \ ++ "ubi read 0x800000 kernel; " \ ++ "bootm 0x800000" ++ ++#define CONFIG_EXTRA_ENV_SETTINGS \ ++ "bootargs=console=ttyS0,115200\0" \ ++ "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \ ++ "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \ ++ "bootargs_root=\0" ++#endif /* _CONFIG_L50_H */ diff --git a/package/boot/uboot-kirkwood/patches/200-openwrt-config.patch b/package/boot/uboot-kirkwood/patches/200-openwrt-config.patch index c7c811cee1..83eb0f9d2c 100644 --- a/package/boot/uboot-kirkwood/patches/200-openwrt-config.patch +++ b/package/boot/uboot-kirkwood/patches/200-openwrt-config.patch @@ -1,8 +1,8 @@ --- a/arch/arm/mach-kirkwood/Kconfig +++ b/arch/arm/mach-kirkwood/Kconfig -@@ -103,4 +103,7 @@ source "board/alliedtelesis/SBx81LIFKW/K - source "board/alliedtelesis/SBx81LIFXCAT/Kconfig" +@@ -107,4 +107,7 @@ source "board/alliedtelesis/SBx81LIFXCAT source "board/Marvell/db-88f6281-bp/Kconfig" + source "board/checkpoint/l-50/Kconfig" +config SECOND_STAGE + bool "OpenWrt second stage hack" @@ -35,6 +35,17 @@ +#include "openwrt-kirkwood-common.h" + #endif /* _CONFIG_ICONNECT_H */ +--- a/include/configs/l-50.h ++++ b/include/configs/l-50.h +@@ -12,6 +12,8 @@ + #ifndef _CONFIG_L50_H + #define _CONFIG_L50_H + ++#include "openwrt-kirkwood-common.h" ++ + /* + * High Level Configuration Options (easy to change) + */ --- /dev/null +++ b/include/configs/openwrt-kirkwood-common.h @@ -0,0 +1,31 @@ @@ -139,6 +150,17 @@ +CONFIG_FIT_VERBOSE=y CONFIG_LZMA=y +CONFIG_LZO=y +--- a/configs/l-50_defconfig ++++ b/configs/l-50_defconfig +@@ -57,3 +57,8 @@ CONFIG_SYS_I2C_MVTWSI=y + CONFIG_USB=y + CONFIG_USB_EHCI_HCD=y + CONFIG_USB_STORAGE=y ++CONFIG_CMD_BOOTZ=y ++CONFIG_FIT=y ++CONFIG_FIT_VERBOSE=y ++CONFIG_LZMA=y ++CONFIG_LZO=y --- a/configs/nsa310_defconfig +++ b/configs/nsa310_defconfig @@ -43,6 +43,9 @@ CONFIG_CMD_UBI=y diff --git a/package/boot/uboot-kirkwood/patches/701-phy-mv88e61xx-add-support-for-RGMII-TX-RX-delay.patch b/package/boot/uboot-kirkwood/patches/701-phy-mv88e61xx-add-support-for-RGMII-TX-RX-delay.patch new file mode 100644 index 0000000000..6e358857b7 --- /dev/null +++ b/package/boot/uboot-kirkwood/patches/701-phy-mv88e61xx-add-support-for-RGMII-TX-RX-delay.patch @@ -0,0 +1,53 @@ +From 940e9a5828480e4185c9a276ad7f35a4069a2393 Mon Sep 17 00:00:00 2001 +From: Pawel Dembicki +Date: Thu, 23 Jan 2020 22:04:15 +0100 +Subject: [PATCH 1/2] phy: mv88e61xx: add support for RGMII TX/RX delay + +Clock delay in RGMII is required for some boards. +This patch introduce CONFIG_MV88E61XX_CPU_PORT_TX_DELAY and +CONFIG_MV88E61XX_CPU_PORT_RX_DELAY defines, which are setting +proper bits in PORT_REG_PHYS_CTRL register. + +Cc: Chris Packham +Cc: Joe Hershberger +Cc: Anatolij Gustschin +Cc: Tim Harvey +Signed-off-by: Pawel Dembicki +--- + drivers/net/phy/mv88e61xx.c | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/phy/mv88e61xx.c b/drivers/net/phy/mv88e61xx.c +index 5aff7ed397..889327639d 100644 +--- a/drivers/net/phy/mv88e61xx.c ++++ b/drivers/net/phy/mv88e61xx.c +@@ -94,6 +94,8 @@ + #define PORT_REG_STATUS_CMODE_1000BASE_X 0x9 + #define PORT_REG_STATUS_CMODE_SGMII 0xa + ++#define PORT_REG_PHYS_CTRL_RGMII_RX_DELAY BIT(15) ++#define PORT_REG_PHYS_CTRL_RGMII_TX_DELAY BIT(14) + #define PORT_REG_PHYS_CTRL_PCS_AN_EN BIT(10) + #define PORT_REG_PHYS_CTRL_PCS_AN_RST BIT(9) + #define PORT_REG_PHYS_CTRL_FC_VALUE BIT(7) +@@ -747,9 +749,16 @@ static int mv88e61xx_fixed_port_setup(struct phy_device *phydev, u8 port) + PORT_REG_PHYS_CTRL_SPD1000; + } + +- if (port == CONFIG_MV88E61XX_CPU_PORT) ++ if (port == CONFIG_MV88E61XX_CPU_PORT) { + val |= PORT_REG_PHYS_CTRL_LINK_VALUE | + PORT_REG_PHYS_CTRL_LINK_FORCE; ++#if defined(CONFIG_MV88E61XX_CPU_PORT_RX_DELAY) ++ val |= PORT_REG_PHYS_CTRL_RGMII_RX_DELAY; ++#endif ++#if defined(CONFIG_MV88E61XX_CPU_PORT_TX_DELAY) ++ val |= PORT_REG_PHYS_CTRL_RGMII_TX_DELAY; ++#endif ++ } + + return mv88e61xx_port_write(phydev, port, PORT_REG_PHYS_CTRL, + val); +-- +2.20.1 + diff --git a/package/boot/uboot-kirkwood/patches/702-phy-mv88e61xx-add-support-for-MV88E6171.patch b/package/boot/uboot-kirkwood/patches/702-phy-mv88e61xx-add-support-for-MV88E6171.patch new file mode 100644 index 0000000000..c91a06cbed --- /dev/null +++ b/package/boot/uboot-kirkwood/patches/702-phy-mv88e61xx-add-support-for-MV88E6171.patch @@ -0,0 +1,67 @@ +From 7ffab66a99831ce5e3037b608d73565c9d1abd20 Mon Sep 17 00:00:00 2001 +From: Pawel Dembicki +Date: Thu, 23 Jan 2020 22:09:51 +0100 +Subject: [PATCH 2/2] phy: mv88e61xx: add support for MV88E6171 + +This patch add MV88E6171 id to driver data. + +Tested on Checkpoint L-50 board. + +Cc: Chris Packham +Cc: Joe Hershberger +Cc: Anatolij Gustschin +Cc: Tim Harvey +Signed-off-by: Pawel Dembicki +--- + drivers/net/phy/mv88e61xx.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +diff --git a/drivers/net/phy/mv88e61xx.c b/drivers/net/phy/mv88e61xx.c +index 889327639d..e0b648a54e 100644 +--- a/drivers/net/phy/mv88e61xx.c ++++ b/drivers/net/phy/mv88e61xx.c +@@ -180,6 +180,7 @@ + #define PORT_SWITCH_ID_6071 0x0710 + #define PORT_SWITCH_ID_6096 0x0980 + #define PORT_SWITCH_ID_6097 0x0990 ++#define PORT_SWITCH_ID_6171 0x1710 + #define PORT_SWITCH_ID_6172 0x1720 + #define PORT_SWITCH_ID_6176 0x1760 + #define PORT_SWITCH_ID_6220 0x2200 +@@ -997,6 +998,7 @@ static int mv88e61xx_probe(struct phy_device *phydev) + switch (priv->id) { + case PORT_SWITCH_ID_6096: + case PORT_SWITCH_ID_6097: ++ case PORT_SWITCH_ID_6171: + case PORT_SWITCH_ID_6172: + case PORT_SWITCH_ID_6176: + case PORT_SWITCH_ID_6240: +@@ -1152,6 +1154,17 @@ static struct phy_driver mv88e61xx_driver = { + .shutdown = &genphy_shutdown, + }; + ++static struct phy_driver mv88e617x_driver = { ++ .name = "Marvell MV88E617x", ++ .uid = 0x01410e70, ++ .mask = 0xfffffff0, ++ .features = PHY_GBIT_FEATURES, ++ .probe = mv88e61xx_probe, ++ .config = mv88e61xx_phy_config, ++ .startup = mv88e61xx_phy_startup, ++ .shutdown = &genphy_shutdown, ++}; ++ + static struct phy_driver mv88e609x_driver = { + .name = "Marvell MV88E609x", + .uid = 0x1410c89, +@@ -1177,6 +1190,7 @@ static struct phy_driver mv88e6071_driver = { + int phy_mv88e61xx_init(void) + { + phy_register(&mv88e61xx_driver); ++ phy_register(&mv88e617x_driver); + phy_register(&mv88e609x_driver); + phy_register(&mv88e6071_driver); + +-- +2.20.1 + From 67ce9aedd6d3f7995351f478e79e570c01ea71fc Mon Sep 17 00:00:00 2001 From: Pawel Dembicki Date: Sun, 26 Jan 2020 17:22:28 +0100 Subject: [PATCH 23/70] kirkwood: add support for Check Point L-50 This patch adds support for the Check Point L-50 from 600/1100 series routers. Specification: -CPU: Marvell Kirkwood 88F6281 1200MHz -RAM: 512MB -Flash: NAND 512MB -WiFi: mPCIe card based on Atheros AR9287 b/g/n -WAN: 1 Gigabit Port (Marvell 88E1116R PHY) -LAN: 9 Gigabit Ports (2x Marvell 88E6171(5+4)) -USB: 2x USB2.0 -Express card slot -SD card slot -Serial console: RJ-45 115200 8n1 -Unsupported DSL Known issues: -DSL not supported -Expresscard not tested Installation: Step one -> backup: make backup u-boot and env for revert stock posibility make backup dsl_mac_addr, dmz_mac_addr, eth1addr, ethaddr and all lanX_mac_addr Step two -> Use kwboot tool to upload openwrt u-boot to RAM: run kwboot: "kwboot -B 115200 /dev/ttyUSB0 -b u-boot.kwb -p -t" end start u-boot Step three -> Restore macs (e.g. below): setenv eth1addr 00:1C:XX:XX:XX:6C setenv ethaddr 00:1C:XX:XX:XX:6B setenv lan1_mac_addr 00:1C:XX:XX:XX:6C setenv lan2_mac_addr 00:1C:XX:XX:XX:6D setenv lan3_mac_addr 00:1C:XX:XX:XX:6E setenv lan4_mac_addr 00:1C:XX:XX:XX:6F setenv lan5_mac_addr 00:1C:XX:XX:XX:70 setenv lan6_mac_addr 00:1C:XX:XX:XX:71 setenv lan7_mac_addr 00:1C:XX:XX:XX:72 setenv lan8_mac_addr 00:1C:XX:XX:XX:73 setenv dmz_mac_addr 00:1C:XX:XX:XX:74 setenv dsl_mac_addr 00:1C:XX:XX:XX:75 Step four -> flash u-boot: mw 0x0800000 0xffff 0x100000 nand erase 0x0 100000 tftp 0x0800000 openwrt-kirkwood-l50-u-boot.kwb nand write 0x0800000 0x0 0x100000 saveenv Step five -> run initramfs image: tftpboot 0x02000000 openwrt.bin; bootm 0x02000000; Step six -> install sysupgrade OpenWrt image: copy to /tmp/ sysupgrade image run sysupgrade Back to stock: Restore original u-boot end env. Install factory image via stock u-boot. Signed-off-by: Pawel Dembicki --- package/boot/uboot-envtools/files/kirkwood | 1 + .../base-files/etc/board.d/02_network | 3 + .../base-files/etc/board.d/03_gpio_switches | 18 + .../base-files/lib/preinit/07_set_iface_mac | 25 + target/linux/kirkwood/config-5.4 | 1 + target/linux/kirkwood/image/Makefile | 10 + ...-kirkwood-Add-Check-Point-L-50-board.patch | 485 ++++++++++++++++++ .../linux/kirkwood/patches-5.4/111-l-50.patch | 47 ++ 8 files changed, 590 insertions(+) create mode 100755 target/linux/kirkwood/base-files/etc/board.d/03_gpio_switches create mode 100644 target/linux/kirkwood/base-files/lib/preinit/07_set_iface_mac create mode 100644 target/linux/kirkwood/patches-5.4/001-ARM-dts-kirkwood-Add-Check-Point-L-50-board.patch create mode 100644 target/linux/kirkwood/patches-5.4/111-l-50.patch diff --git a/package/boot/uboot-envtools/files/kirkwood b/package/boot/uboot-envtools/files/kirkwood index 5e87dd1d62..a099c925ea 100644 --- a/package/boot/uboot-envtools/files/kirkwood +++ b/package/boot/uboot-envtools/files/kirkwood @@ -13,6 +13,7 @@ touch /etc/config/ubootenv board=$(board_name) case "$board" in +checkpoint,l-50|\ cloudengines,pogoe02|\ cloudengines,pogoplugv4|\ iom,ix2-200|\ diff --git a/target/linux/kirkwood/base-files/etc/board.d/02_network b/target/linux/kirkwood/base-files/etc/board.d/02_network index a86c57117d..658ce13346 100755 --- a/target/linux/kirkwood/base-files/etc/board.d/02_network +++ b/target/linux/kirkwood/base-files/etc/board.d/02_network @@ -11,6 +11,9 @@ board_config_update board=$(board_name) case "$board" in +"checkpoint,l-50") + ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 lan5 lan6 lan7 lan8 dmz" "eth0" + ;; "cisco,on100") ucidef_set_interface_lan "eth0 eth1" ;; diff --git a/target/linux/kirkwood/base-files/etc/board.d/03_gpio_switches b/target/linux/kirkwood/base-files/etc/board.d/03_gpio_switches new file mode 100755 index 0000000000..046f8d4d20 --- /dev/null +++ b/target/linux/kirkwood/base-files/etc/board.d/03_gpio_switches @@ -0,0 +1,18 @@ +#!/bin/sh + +. /lib/functions/uci-defaults.sh + +board_config_update + +board=$(board_name) + +case "$board" in +checkpoint,l-50) + ucidef_add_gpio_switch "mpcie-rst" "mPCIE Card reset" "502" "1" + ucidef_add_gpio_switch "exp-card-rst" "Express Card reset" "497" "1" + ;; +esac + +board_config_flush + +exit 0 diff --git a/target/linux/kirkwood/base-files/lib/preinit/07_set_iface_mac b/target/linux/kirkwood/base-files/lib/preinit/07_set_iface_mac new file mode 100644 index 0000000000..75e9e886d9 --- /dev/null +++ b/target/linux/kirkwood/base-files/lib/preinit/07_set_iface_mac @@ -0,0 +1,25 @@ +. /lib/functions.sh +. /lib/functions/system.sh + +preinit_set_mac_address() { + local mac + + case $(board_name) in + checkpoint,l-50) + mac=$(mtd_get_mac_ascii bootldr-env lan1_mac_addr) + + ip link set dev lan1 address $mac 2>/dev/null + ip link set dev lan2 address $(macaddr_add $mac 1) 2>/dev/null + ip link set dev lan3 address $(macaddr_add $mac 2) 2>/dev/null + ip link set dev lan4 address $(macaddr_add $mac 3) 2>/dev/null + ip link set dev lan5 address $(macaddr_add $mac 4) 2>/dev/null + ip link set dev lan6 address $(macaddr_add $mac 5) 2>/dev/null + ip link set dev lan7 address $(macaddr_add $mac 6) 2>/dev/null + ip link set dev lan8 address $(macaddr_add $mac 7) 2>/dev/null + ip link set dev dmz address $(macaddr_add $mac 8) 2>/dev/null + ip link set dev dsl address $(macaddr_add $mac 9) 2>/dev/null + ;; + esac +} + +boot_hook_add preinit_main preinit_set_mac_address diff --git a/target/linux/kirkwood/config-5.4 b/target/linux/kirkwood/config-5.4 index 5529bf89df..61efa07d91 100644 --- a/target/linux/kirkwood/config-5.4 +++ b/target/linux/kirkwood/config-5.4 @@ -282,6 +282,7 @@ CONFIG_PINCTRL=y CONFIG_PINCTRL_KIRKWOOD=y CONFIG_PINCTRL_MVEBU=y # CONFIG_PINCTRL_SINGLE is not set +CONFIG_PINCTRL_SX150X=y CONFIG_PLAT_ORION=y CONFIG_POWER_RESET=y CONFIG_POWER_RESET_GPIO=y diff --git a/target/linux/kirkwood/image/Makefile b/target/linux/kirkwood/image/Makefile index 8cc69195b4..ba93fffeb2 100644 --- a/target/linux/kirkwood/image/Makefile +++ b/target/linux/kirkwood/image/Makefile @@ -28,6 +28,16 @@ define Device/Default SUPPORTED_DEVICES = $(subst _,$(comma),$(1)) $$(BOARD_NAME) endef +define Device/checkpoint_l-50 + DEVICE_VENDOR := Check Point + DEVICE_MODEL := L-50 + DEVICE_DTS := kirkwood-l-50 + DEVICE_PACKAGES := kmod-ath9k kmod-gpio-button-hotplug kmod-mvsdio \ + kmod-rtc-s35390a kmod-usb-ledtrig-usbport wpad-basic + IMAGES := sysupgrade.bin +endef +TARGET_DEVICES += checkpoint_l-50 + define Device/cisco_on100 DEVICE_VENDOR := Cisco Systems DEVICE_MODEL := ON100 diff --git a/target/linux/kirkwood/patches-5.4/001-ARM-dts-kirkwood-Add-Check-Point-L-50-board.patch b/target/linux/kirkwood/patches-5.4/001-ARM-dts-kirkwood-Add-Check-Point-L-50-board.patch new file mode 100644 index 0000000000..52caee7b40 --- /dev/null +++ b/target/linux/kirkwood/patches-5.4/001-ARM-dts-kirkwood-Add-Check-Point-L-50-board.patch @@ -0,0 +1,485 @@ +From efa968c18abab78c5e0c40a853caf286c3629a59 Mon Sep 17 00:00:00 2001 +From: Pawel Dembicki +Date: Tue, 17 Mar 2020 21:28:01 +0100 +Subject: [PATCH v3] ARM: dts: kirkwood: Add Check Point L-50 board + +This patch adds dts for the Check Point L-50 from 600/1100 series +routers. + +Specification: +-CPU: Marvell Kirkwood 88F6821 1200MHz +-RAM: 512MB +-Flash: NAND 512MB +-WiFi: mPCIe card based on Atheros AR9287 b/g/n +-WAN: 1 Gigabit Port (Marvell 88E1116R PHY) +-LAN: 9 Gigabit Ports (2x Marvell 88E6171(5+3)) +-USB: 2x USB2.0 +-Express card slot +-SD card slot +-Serial console: RJ-45 115200 8n1 +-Unsupported DSL + +Reviewed-by: Andrew Lunn +Signed-off-by: Pawel Dembicki +--- +Changes in v3: +- fix typo and code style issues pointed by OpenWrt guys +Changes in v2: +- none + + arch/arm/boot/dts/Makefile | 1 + + arch/arm/boot/dts/kirkwood-l-50.dts | 438 ++++++++++++++++++++++++++++ + 2 files changed, 439 insertions(+) + create mode 100644 arch/arm/boot/dts/kirkwood-l-50.dts + +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -270,6 +270,7 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += \ + kirkwood-iomega_ix2_200.dtb \ + kirkwood-is2.dtb \ + kirkwood-km_kirkwood.dtb \ ++ kirkwood-l-50.dtb \ + kirkwood-laplug.dtb \ + kirkwood-linkstation-lsqvl.dtb \ + kirkwood-linkstation-lsvl.dtb \ +--- /dev/null ++++ b/arch/arm/boot/dts/kirkwood-l-50.dts +@@ -0,0 +1,438 @@ ++// SPDX-License-Identifier: GPL-2.0 ++/* ++ * Check Point L-50 Board Description ++ * Copyright 2020 Pawel Dembicki ++ */ ++ ++/dts-v1/; ++ ++#include "kirkwood.dtsi" ++#include "kirkwood-6281.dtsi" ++ ++/ { ++ model = "Check Point L-50"; ++ compatible = "checkpoint,l-50", "marvell,kirkwood-88f6281", "marvell,kirkwood"; ++ ++ memory { ++ device_type = "memory"; ++ reg = <0x00000000 0x20000000>; ++ }; ++ ++ chosen { ++ bootargs = "console=ttyS0,115200n8"; ++ stdout-path = &uart0; ++ }; ++ ++ ocp@f1000000 { ++ pinctrl: pin-controller@10000 { ++ pinctrl-0 = <&pmx_led38 &pmx_sysrst &pmx_button29>; ++ pinctrl-names = "default"; ++ ++ pmx_sysrst: pmx-sysrst { ++ marvell,pins = "mpp6"; ++ marvell,function = "sysrst"; ++ }; ++ ++ pmx_button29: pmx_button29 { ++ marvell,pins = "mpp29"; ++ marvell,function = "gpio"; ++ }; ++ ++ pmx_led38: pmx_led38 { ++ marvell,pins = "mpp38"; ++ marvell,function = "gpio"; ++ }; ++ ++ pmx_sdio_cd: pmx-sdio-cd { ++ marvell,pins = "mpp46"; ++ marvell,function = "gpio"; ++ }; ++ }; ++ ++ serial@12000 { ++ status = "okay"; ++ }; ++ ++ mvsdio@90000 { ++ status = "okay"; ++ cd-gpios = <&gpio1 14 9>; ++ }; ++ ++ i2c@11000 { ++ status = "okay"; ++ clock-frequency = <400000>; ++ ++ gpio2: gpio-expander@20{ ++ #gpio-cells = <2>; ++ #interrupt-cells = <2>; ++ compatible = "semtech,sx1505q"; ++ reg = <0x20>; ++ ++ gpio-controller; ++ }; ++ ++ /* Three GPIOs from 0x21 exp. are undescribed in dts: ++ * 1: DSL module reset (active low) ++ * 5: mPCIE reset (active low) ++ * 6: Express card reset (active low) ++ */ ++ gpio3: gpio-expander@21{ ++ #gpio-cells = <2>; ++ #interrupt-cells = <2>; ++ compatible = "semtech,sx1505q"; ++ reg = <0x21>; ++ ++ gpio-controller; ++ }; ++ ++ rtc@30 { ++ compatible = "s35390a"; ++ reg = <0x30>; ++ }; ++ }; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ status_green { ++ label = "l-50:green:status"; ++ gpios = <&gpio1 6 GPIO_ACTIVE_LOW>; ++ }; ++ ++ status_red { ++ label = "l-50:red:status"; ++ gpios = <&gpio3 2 GPIO_ACTIVE_LOW>; ++ }; ++ ++ wifi { ++ label = "l-50:green:wifi"; ++ gpios = <&gpio2 7 GPIO_ACTIVE_LOW>; ++ linux,default-trigger = "phy0tpt"; ++ }; ++ ++ internet_green { ++ label = "l-50:green:internet"; ++ gpios = <&gpio2 3 GPIO_ACTIVE_LOW>; ++ }; ++ ++ internet_red { ++ label = "l-50:red:internet"; ++ gpios = <&gpio2 1 GPIO_ACTIVE_LOW>; ++ }; ++ ++ usb1_green { ++ label = "l-50:green:usb1"; ++ gpios = <&gpio2 0 GPIO_ACTIVE_LOW>; ++ linux,default-trigger = "usbport"; ++ trigger-sources = <&hub_port3>; ++ }; ++ ++ usb1_red { ++ label = "l-50:red:usb1"; ++ gpios = <&gpio2 4 GPIO_ACTIVE_LOW>; ++ }; ++ ++ usb2_green { ++ label = "l-50:green:usb2"; ++ gpios = <&gpio2 2 GPIO_ACTIVE_LOW>; ++ linux,default-trigger = "usbport"; ++ trigger-sources = <&hub_port1>; ++ }; ++ ++ usb2_red { ++ label = "l-50:red:usb2"; ++ gpios = <&gpio2 5 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ usb2_pwr { ++ compatible = "regulator-fixed"; ++ regulator-name = "usb2_pwr"; ++ ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ gpio = <&gpio3 3 GPIO_ACTIVE_LOW>; ++ regulator-always-on; ++ }; ++ ++ usb1_pwr { ++ compatible = "regulator-fixed"; ++ regulator-name = "usb1_pwr"; ++ ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ gpio = <&gpio3 4 GPIO_ACTIVE_LOW>; ++ regulator-always-on; ++ }; ++ ++ mpcie_pwr { ++ compatible = "regulator-fixed"; ++ regulator-name = "mpcie_pwr"; ++ ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ gpio = <&gpio3 5 GPIO_ACTIVE_HIGH>; ++ enable-active-high; ++ regulator-always-on; ++ }; ++ ++ express_card_pwr { ++ compatible = "regulator-fixed"; ++ regulator-name = "express_card_pwr"; ++ ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ gpio = <&gpio3 7 GPIO_ACTIVE_HIGH>; ++ enable-active-high; ++ regulator-always-on; ++ }; ++ ++ keys { ++ compatible = "gpio-keys"; ++ ++ factory_defaults { ++ label = "factory_defaults"; ++ gpios = <&gpio0 29 GPIO_ACTIVE_LOW>; ++ linux,code = ; ++ }; ++ }; ++}; ++ ++&mdio { ++ status = "okay"; ++ ++ ethphy8: ethernet-phy@8 { ++ reg = <0x08>; ++ }; ++ ++ switch0: switch@10 { ++ compatible = "marvell,mv88e6085"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <0x10>; ++ dsa,member = <0 0>; ++ ++ ports { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ port@0 { ++ reg = <0>; ++ label = "lan5"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan1"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan6"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan2"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "lan7"; ++ }; ++ ++ switch0port5: port@5 { ++ reg = <5>; ++ phy-mode = "rgmii-txid"; ++ link = <&switch1port5>; ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++ ++ port@6 { ++ reg = <6>; ++ label = "cpu"; ++ phy-mode = "rgmii-id"; ++ ethernet = <ð1port>; ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++ }; ++ }; ++ ++ switch@11 { ++ compatible = "marvell,mv88e6085"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <0x11>; ++ dsa,member = <0 1>; ++ ++ ports { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ port@0 { ++ reg = <0>; ++ label = "lan3"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan8"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan4"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "dmz"; ++ }; ++ ++ switch1port5: port@5 { ++ reg = <5>; ++ phy-mode = "rgmii-txid"; ++ link = <&switch0port5>; ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++ ++ port@6 { ++ reg = <6>; ++ label = "dsl"; ++ fixed-link { ++ speed = <100>; ++ full-duplex; ++ }; ++ }; ++ }; ++ }; ++}; ++ ++ð0 { ++ status = "okay"; ++ ethernet0-port@0 { ++ phy-handle = <ðphy8>; ++ }; ++}; ++ ++ð1 { ++ status = "okay"; ++ ethernet1-port@0 { ++ speed = <1000>; ++ duplex = <1>; ++ }; ++}; ++ ++&nand { ++ status = "okay"; ++ pinctrl-0 = <&pmx_nand>; ++ pinctrl-names = "default"; ++ ++ partition@0 { ++ label = "u-boot"; ++ reg = <0x00000000 0x000c0000>; ++ }; ++ ++ partition@a0000 { ++ label = "bootldr-env"; ++ reg = <0x000c0000 0x00040000>; ++ }; ++ ++ partition@100000 { ++ label = "kernel-1"; ++ reg = <0x00100000 0x00800000>; ++ }; ++ ++ partition@900000 { ++ label = "rootfs-1"; ++ reg = <0x00900000 0x07100000>; ++ }; ++ ++ partition@7a00000 { ++ label = "kernel-2"; ++ reg = <0x07a00000 0x00800000>; ++ }; ++ ++ partition@8200000 { ++ label = "rootfs-2"; ++ reg = <0x08200000 0x07100000>; ++ }; ++ ++ partition@f300000 { ++ label = "default_sw"; ++ reg = <0x0f300000 0x07900000>; ++ }; ++ ++ partition@16c00000 { ++ label = "logs"; ++ reg = <0x16c00000 0x01800000>; ++ }; ++ ++ partition@18400000 { ++ label = "preset_cfg"; ++ reg = <0x18400000 0x00100000>; ++ }; ++ ++ partition@18500000 { ++ label = "adsl"; ++ reg = <0x18500000 0x00100000>; ++ }; ++ ++ partition@18600000 { ++ label = "storage"; ++ reg = <0x18600000 0x07a00000>; ++ }; ++}; ++ ++&rtc { ++ status = "disabled"; ++}; ++ ++&pciec { ++ status = "okay"; ++}; ++ ++&pcie0 { ++ status = "okay"; ++}; ++ ++&sata_phy0 { ++ status = "disabled"; ++}; ++ ++&sata_phy1 { ++ status = "disabled"; ++}; ++ ++&usb0 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ port@1 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <1>; ++ #trigger-source-cells = <0>; ++ ++ hub_port1: port@1 { ++ reg = <1>; ++ #trigger-source-cells = <0>; ++ }; ++ ++ hub_port3: port@3 { ++ reg = <3>; ++ #trigger-source-cells = <0>; ++ }; ++ }; ++}; diff --git a/target/linux/kirkwood/patches-5.4/111-l-50.patch b/target/linux/kirkwood/patches-5.4/111-l-50.patch new file mode 100644 index 0000000000..b1679885ad --- /dev/null +++ b/target/linux/kirkwood/patches-5.4/111-l-50.patch @@ -0,0 +1,47 @@ +--- a/arch/arm/boot/dts/kirkwood-l-50.dts ++++ b/arch/arm/boot/dts/kirkwood-l-50.dts +@@ -18,6 +18,13 @@ + reg = <0x00000000 0x20000000>; + }; + ++ aliases { ++ led-boot = &led_status_green; ++ led-failsafe = &led_status_red; ++ led-running = &led_status_green; ++ led-upgrade = &led_status_red; ++ }; ++ + chosen { + bootargs = "console=ttyS0,115200n8"; + stdout-path = &uart0; +@@ -95,12 +102,12 @@ + leds { + compatible = "gpio-leds"; + +- status_green { ++ led_status_green: status_green { + label = "l-50:green:status"; + gpios = <&gpio1 6 GPIO_ACTIVE_LOW>; + }; + +- status_red { ++ led_status_red: status_red { + label = "l-50:red:status"; + gpios = <&gpio3 2 GPIO_ACTIVE_LOW>; + }; +@@ -349,13 +356,8 @@ + }; + + partition@100000 { +- label = "kernel-1"; +- reg = <0x00100000 0x00800000>; +- }; +- +- partition@900000 { +- label = "rootfs-1"; +- reg = <0x00900000 0x07100000>; ++ label = "ubi"; ++ reg = <0x00100000 0x07900000>; + }; + + partition@7a00000 { From d0b25301d3d86c4b011ca45af67abc90d7373f30 Mon Sep 17 00:00:00 2001 From: Syrone Wong Date: Wed, 8 Jul 2020 06:40:24 +0800 Subject: [PATCH 24/70] toolchain/gcc: Copy patches from 9.3.0 to 10.1.0 No content changes in this commit Signed-off-by: Syrone Wong --- .../patches/10.1.0/002-case_insensitive.patch | 24 +++ .../patches/10.1.0/010-documentation.patch | 35 ++++ .../10.1.0/110-Fix-MIPS-PR-84790.patch | 20 +++ .../gcc/patches/10.1.0/230-musl_libssp.patch | 13 ++ .../300-mips_Os_cpu_rtx_cost_model.patch | 21 +++ .../10.1.0/810-arm-softfloat-libgcc.patch | 33 ++++ .../gcc/patches/10.1.0/820-libgcc_pic.patch | 44 +++++ .../840-armv4_pass_fix-v4bx_to_ld.patch | 28 +++ .../10.1.0/850-use_shared_libgcc.patch | 54 ++++++ .../patches/10.1.0/851-libgcc_no_compat.patch | 22 +++ .../patches/10.1.0/870-ppc_no_crtsavres.patch | 11 ++ .../patches/10.1.0/881-no_tm_section.patch | 11 ++ .../patches/10.1.0/900-bad-mips16-crt.patch | 9 + .../gcc/patches/10.1.0/910-mbsd_multi.patch | 146 +++++++++++++++ .../10.1.0/920-specs_nonfatal_getenv.patch | 22 +++ .../10.1.0/930-fix-mips-noexecstack.patch | 111 ++++++++++++ ...ibffi-fix-MIPS-softfloat-build-issue.patch | 168 ++++++++++++++++++ ...mpilation-when-making-cross-compiler.patch | 67 +++++++ 18 files changed, 839 insertions(+) create mode 100644 toolchain/gcc/patches/10.1.0/002-case_insensitive.patch create mode 100644 toolchain/gcc/patches/10.1.0/010-documentation.patch create mode 100644 toolchain/gcc/patches/10.1.0/110-Fix-MIPS-PR-84790.patch create mode 100644 toolchain/gcc/patches/10.1.0/230-musl_libssp.patch create mode 100644 toolchain/gcc/patches/10.1.0/300-mips_Os_cpu_rtx_cost_model.patch create mode 100644 toolchain/gcc/patches/10.1.0/810-arm-softfloat-libgcc.patch create mode 100644 toolchain/gcc/patches/10.1.0/820-libgcc_pic.patch create mode 100644 toolchain/gcc/patches/10.1.0/840-armv4_pass_fix-v4bx_to_ld.patch create mode 100644 toolchain/gcc/patches/10.1.0/850-use_shared_libgcc.patch create mode 100644 toolchain/gcc/patches/10.1.0/851-libgcc_no_compat.patch create mode 100644 toolchain/gcc/patches/10.1.0/870-ppc_no_crtsavres.patch create mode 100644 toolchain/gcc/patches/10.1.0/881-no_tm_section.patch create mode 100644 toolchain/gcc/patches/10.1.0/900-bad-mips16-crt.patch create mode 100644 toolchain/gcc/patches/10.1.0/910-mbsd_multi.patch create mode 100644 toolchain/gcc/patches/10.1.0/920-specs_nonfatal_getenv.patch create mode 100644 toolchain/gcc/patches/10.1.0/930-fix-mips-noexecstack.patch create mode 100644 toolchain/gcc/patches/10.1.0/931-libffi-fix-MIPS-softfloat-build-issue.patch create mode 100644 toolchain/gcc/patches/10.1.0/960-gotools-fix-compilation-when-making-cross-compiler.patch diff --git a/toolchain/gcc/patches/10.1.0/002-case_insensitive.patch b/toolchain/gcc/patches/10.1.0/002-case_insensitive.patch new file mode 100644 index 0000000000..3442076d7d --- /dev/null +++ b/toolchain/gcc/patches/10.1.0/002-case_insensitive.patch @@ -0,0 +1,24 @@ +commit 81cc26c706b2bc8c8c1eb1a322e5c5157900836e +Author: Felix Fietkau +Date: Sun Oct 19 21:45:51 2014 +0000 + + gcc: do not assume that the Mac OS X filesystem is case insensitive + + Signed-off-by: Felix Fietkau + + SVN-Revision: 42973 + +--- a/include/filenames.h ++++ b/include/filenames.h +@@ -43,11 +43,6 @@ extern "C" { + # define IS_DIR_SEPARATOR(c) IS_DOS_DIR_SEPARATOR (c) + # define IS_ABSOLUTE_PATH(f) IS_DOS_ABSOLUTE_PATH (f) + #else /* not DOSish */ +-# if defined(__APPLE__) +-# ifndef HAVE_CASE_INSENSITIVE_FILE_SYSTEM +-# define HAVE_CASE_INSENSITIVE_FILE_SYSTEM 1 +-# endif +-# endif /* __APPLE__ */ + # define HAS_DRIVE_SPEC(f) (0) + # define IS_DIR_SEPARATOR(c) IS_UNIX_DIR_SEPARATOR (c) + # define IS_ABSOLUTE_PATH(f) IS_UNIX_ABSOLUTE_PATH (f) diff --git a/toolchain/gcc/patches/10.1.0/010-documentation.patch b/toolchain/gcc/patches/10.1.0/010-documentation.patch new file mode 100644 index 0000000000..c3a6a15901 --- /dev/null +++ b/toolchain/gcc/patches/10.1.0/010-documentation.patch @@ -0,0 +1,35 @@ +commit 098bd91f5eae625c7d2ee621e10930fc4434e5e2 +Author: Luka Perkov +Date: Tue Feb 26 16:16:33 2013 +0000 + + gcc: don't build documentation + + This closes #13039. + + Signed-off-by: Luka Perkov + + SVN-Revision: 35807 + +--- a/gcc/Makefile.in ++++ b/gcc/Makefile.in +@@ -3203,18 +3203,10 @@ doc/gcc.info: $(TEXI_GCC_FILES) + doc/gccint.info: $(TEXI_GCCINT_FILES) + doc/cppinternals.info: $(TEXI_CPPINT_FILES) + +-doc/%.info: %.texi +- if [ x$(BUILD_INFO) = xinfo ]; then \ +- $(MAKEINFO) $(MAKEINFOFLAGS) -I . -I $(gcc_docdir) \ +- -I $(gcc_docdir)/include -o $@ $<; \ +- fi ++doc/%.info: + + # Duplicate entry to handle renaming of gccinstall.info +-doc/gccinstall.info: $(TEXI_GCCINSTALL_FILES) +- if [ x$(BUILD_INFO) = xinfo ]; then \ +- $(MAKEINFO) $(MAKEINFOFLAGS) -I $(gcc_docdir) \ +- -I $(gcc_docdir)/include -o $@ $<; \ +- fi ++doc/gccinstall.info: + + doc/cpp.dvi: $(TEXI_CPP_FILES) + doc/gcc.dvi: $(TEXI_GCC_FILES) diff --git a/toolchain/gcc/patches/10.1.0/110-Fix-MIPS-PR-84790.patch b/toolchain/gcc/patches/10.1.0/110-Fix-MIPS-PR-84790.patch new file mode 100644 index 0000000000..c7e60e3157 --- /dev/null +++ b/toolchain/gcc/patches/10.1.0/110-Fix-MIPS-PR-84790.patch @@ -0,0 +1,20 @@ +Fix https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84790. +MIPS16 functions have a static assembler prologue which clobbers +registers v0 and v1. Add these register clobbers to function call +instructions. + +--- a/gcc/config/mips/mips.c ++++ b/gcc/config/mips/mips.c +@@ -3131,6 +3131,12 @@ mips_emit_call_insn (rtx pattern, rtx or + emit_insn (gen_update_got_version ()); + } + ++ if (TARGET_MIPS16 && TARGET_USE_GOT) ++ { ++ clobber_reg (&CALL_INSN_FUNCTION_USAGE (insn), MIPS16_PIC_TEMP); ++ clobber_reg (&CALL_INSN_FUNCTION_USAGE (insn), MIPS_PROLOGUE_TEMP (word_mode)); ++ } ++ + if (TARGET_MIPS16 + && TARGET_EXPLICIT_RELOCS + && TARGET_CALL_CLOBBERED_GP) diff --git a/toolchain/gcc/patches/10.1.0/230-musl_libssp.patch b/toolchain/gcc/patches/10.1.0/230-musl_libssp.patch new file mode 100644 index 0000000000..41d75b0206 --- /dev/null +++ b/toolchain/gcc/patches/10.1.0/230-musl_libssp.patch @@ -0,0 +1,13 @@ +--- a/gcc/gcc.c ++++ b/gcc/gcc.c +@@ -876,7 +876,9 @@ proper position among the other output f + #endif + + #ifndef LINK_SSP_SPEC +-#ifdef TARGET_LIBC_PROVIDES_SSP ++#if DEFAULT_LIBC == LIBC_MUSL ++#define LINK_SSP_SPEC "-lssp_nonshared" ++#elif defined(TARGET_LIBC_PROVIDES_SSP) + #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ + "|fstack-protector-strong|fstack-protector-explicit:}" + #else diff --git a/toolchain/gcc/patches/10.1.0/300-mips_Os_cpu_rtx_cost_model.patch b/toolchain/gcc/patches/10.1.0/300-mips_Os_cpu_rtx_cost_model.patch new file mode 100644 index 0000000000..5caa852a16 --- /dev/null +++ b/toolchain/gcc/patches/10.1.0/300-mips_Os_cpu_rtx_cost_model.patch @@ -0,0 +1,21 @@ +commit ecf7671b769fe96f7b5134be442089f8bdba55d2 +Author: Felix Fietkau +Date: Thu Aug 4 20:29:45 2016 +0200 + +gcc: add a patch to generate better code with Os on mips + +Also happens to reduce compressed code size a bit + +Signed-off-by: Felix Fietkau + +--- a/gcc/config/mips/mips.c ++++ b/gcc/config/mips/mips.c +@@ -19994,7 +19994,7 @@ mips_option_override (void) + flag_pcc_struct_return = 0; + + /* Decide which rtx_costs structure to use. */ +- if (optimize_size) ++ if (0 && optimize_size) + mips_cost = &mips_rtx_cost_optimize_size; + else + mips_cost = &mips_rtx_cost_data[mips_tune]; diff --git a/toolchain/gcc/patches/10.1.0/810-arm-softfloat-libgcc.patch b/toolchain/gcc/patches/10.1.0/810-arm-softfloat-libgcc.patch new file mode 100644 index 0000000000..5c9d86aead --- /dev/null +++ b/toolchain/gcc/patches/10.1.0/810-arm-softfloat-libgcc.patch @@ -0,0 +1,33 @@ +commit 8570c4be394cff7282f332f97da2ff569a927ddb +Author: Imre Kaloz +Date: Wed Feb 2 20:06:12 2011 +0000 + + fixup arm soft-float symbols + + SVN-Revision: 25325 + +--- a/libgcc/config/arm/t-linux ++++ b/libgcc/config/arm/t-linux +@@ -1,6 +1,10 @@ + LIB1ASMSRC = arm/lib1funcs.S + LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx _clzsi2 _clzdi2 \ +- _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 ++ _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 \ ++ _arm_negdf2 _arm_muldivdf3 _arm_cmpdf2 _arm_unorddf2 \ ++ _arm_fixdfsi _arm_fixunsdfsi _arm_truncdfsf2 \ ++ _arm_negsf2 _arm_muldivsf3 _arm_cmpsf2 _arm_unordsf2 \ ++ _arm_fixsfsi _arm_fixunssfsi + + # Just for these, we omit the frame pointer since it makes such a big + # difference. +--- a/gcc/config/arm/linux-elf.h ++++ b/gcc/config/arm/linux-elf.h +@@ -58,8 +58,6 @@ + %{shared:-lc} \ + %{!shared:%{profile:-lc_p}%{!profile:-lc}}" + +-#define LIBGCC_SPEC "%{mfloat-abi=soft*:-lfloat} -lgcc" +- + #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" + + #define LINUX_TARGET_LINK_SPEC "%{h*} \ diff --git a/toolchain/gcc/patches/10.1.0/820-libgcc_pic.patch b/toolchain/gcc/patches/10.1.0/820-libgcc_pic.patch new file mode 100644 index 0000000000..0a316d35bf --- /dev/null +++ b/toolchain/gcc/patches/10.1.0/820-libgcc_pic.patch @@ -0,0 +1,44 @@ +commit c96312958c0621e72c9b32da5bc224ffe2161384 +Author: Felix Fietkau +Date: Mon Oct 19 23:26:09 2009 +0000 + + gcc: create a proper libgcc_pic.a static library for relinking (4.3.3+ for now, backport will follow) + + SVN-Revision: 18086 + +--- a/libgcc/Makefile.in ++++ b/libgcc/Makefile.in +@@ -927,11 +927,12 @@ $(libgcov-driver-objects): %$(objext): $ + + # Static libraries. + libgcc.a: $(libgcc-objects) ++libgcc_pic.a: $(libgcc-s-objects) + libgcov.a: $(libgcov-objects) + libunwind.a: $(libunwind-objects) + libgcc_eh.a: $(libgcc-eh-objects) + +-libgcc.a libgcov.a libunwind.a libgcc_eh.a: ++libgcc.a libgcov.a libunwind.a libgcc_eh.a libgcc_pic.a: + -rm -f $@ + + objects="$(objects)"; \ +@@ -955,7 +956,7 @@ all: libunwind.a + endif + + ifeq ($(enable_shared),yes) +-all: libgcc_eh.a libgcc_s$(SHLIB_EXT) ++all: libgcc_eh.a libgcc_pic.a libgcc_s$(SHLIB_EXT) + ifneq ($(LIBUNWIND),) + all: libunwind$(SHLIB_EXT) + libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_EXT) +@@ -1161,6 +1162,10 @@ install-shared: + chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a + $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a + ++ $(INSTALL_DATA) libgcc_pic.a $(mapfile) $(DESTDIR)$(inst_libdir)/ ++ chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_pic.a ++ $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_pic.a ++ + $(subst @multilib_dir@,$(MULTIDIR),$(subst \ + @shlib_base_name@,libgcc_s,$(subst \ + @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL)))) diff --git a/toolchain/gcc/patches/10.1.0/840-armv4_pass_fix-v4bx_to_ld.patch b/toolchain/gcc/patches/10.1.0/840-armv4_pass_fix-v4bx_to_ld.patch new file mode 100644 index 0000000000..18aa021b93 --- /dev/null +++ b/toolchain/gcc/patches/10.1.0/840-armv4_pass_fix-v4bx_to_ld.patch @@ -0,0 +1,28 @@ +commit 7edc8ca5456d9743dd0075eb3cc5b04f4f24c8cc +Author: Imre Kaloz +Date: Wed Feb 2 19:34:36 2011 +0000 + + add armv4 fixup patches + + SVN-Revision: 25322 + + +--- a/gcc/config/arm/linux-eabi.h ++++ b/gcc/config/arm/linux-eabi.h +@@ -91,10 +91,15 @@ + #define MUSL_DYNAMIC_LINKER \ + "/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}.so.1" + ++/* For armv4 we pass --fix-v4bx to linker to support EABI */ ++#undef TARGET_FIX_V4BX_SPEC ++#define TARGET_FIX_V4BX_SPEC " %{mcpu=arm8|mcpu=arm810|mcpu=strongarm*"\ ++ "|march=armv4|mcpu=fa526|mcpu=fa626:--fix-v4bx}" ++ + /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to + use the GNU/Linux version, not the generic BPABI version. */ + #undef LINK_SPEC +-#define LINK_SPEC EABI_LINK_SPEC \ ++#define LINK_SPEC EABI_LINK_SPEC TARGET_FIX_V4BX_SPEC \ + LINUX_OR_ANDROID_LD (LINUX_TARGET_LINK_SPEC, \ + LINUX_TARGET_LINK_SPEC " " ANDROID_LINK_SPEC) + diff --git a/toolchain/gcc/patches/10.1.0/850-use_shared_libgcc.patch b/toolchain/gcc/patches/10.1.0/850-use_shared_libgcc.patch new file mode 100644 index 0000000000..a765e55a46 --- /dev/null +++ b/toolchain/gcc/patches/10.1.0/850-use_shared_libgcc.patch @@ -0,0 +1,54 @@ +commit dcfc40358b5a3cae7320c17f8d1cebd5ad5540cd +Author: Felix Fietkau +Date: Sun Feb 12 20:25:47 2012 +0000 + + gcc 4.6: port over the missing patch 850-use_shared_libgcc.patch to prevent libgcc crap from leaking into every single binary + + SVN-Revision: 30486 +--- a/gcc/config/arm/linux-eabi.h ++++ b/gcc/config/arm/linux-eabi.h +@@ -129,10 +129,6 @@ + "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} " \ + LINUX_OR_ANDROID_LD (GNU_USER_TARGET_ENDFILE_SPEC, ANDROID_ENDFILE_SPEC) + +-/* Use the default LIBGCC_SPEC, not the version in linux-elf.h, as we +- do not use -lfloat. */ +-#undef LIBGCC_SPEC +- + /* Clear the instruction cache from `beg' to `end'. This is + implemented in lib1funcs.S, so ensure an error if this definition + is used. */ +--- a/gcc/config/linux.h ++++ b/gcc/config/linux.h +@@ -66,6 +66,10 @@ see the files COPYING3 and COPYING.RUNTI + builtin_version ("CRuntime_Musl"); \ + } while (0) + ++#ifndef LIBGCC_SPEC ++#define LIBGCC_SPEC "%{static|static-libgcc:-lgcc}%{!static:%{!static-libgcc:-lgcc_s}}" ++#endif ++ + /* Determine which dynamic linker to use depending on whether GLIBC or + uClibc or Bionic or musl is the default C library and whether + -muclibc or -mglibc or -mbionic or -mmusl has been passed to change +--- a/libgcc/mkmap-symver.awk ++++ b/libgcc/mkmap-symver.awk +@@ -136,5 +136,5 @@ function output(lib) { + else if (inherit[lib]) + printf("} %s;\n", inherit[lib]); + else +- printf ("\n local:\n\t*;\n};\n"); ++ printf ("\n\t*;\n};\n"); + } +--- a/gcc/config/rs6000/linux.h ++++ b/gcc/config/rs6000/linux.h +@@ -62,6 +62,9 @@ + #undef CPP_OS_DEFAULT_SPEC + #define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux)" + ++#undef LIBGCC_SPEC ++#define LIBGCC_SPEC "%{!static:%{!static-libgcc:-lgcc_s}} -lgcc" ++ + #undef LINK_SHLIB_SPEC + #define LINK_SHLIB_SPEC "%{shared:-shared} %{!shared: %{static:-static}} \ + %{static-pie:-static -pie --no-dynamic-linker -z text}" diff --git a/toolchain/gcc/patches/10.1.0/851-libgcc_no_compat.patch b/toolchain/gcc/patches/10.1.0/851-libgcc_no_compat.patch new file mode 100644 index 0000000000..d710e40717 --- /dev/null +++ b/toolchain/gcc/patches/10.1.0/851-libgcc_no_compat.patch @@ -0,0 +1,22 @@ +commit 64661de100da1ec1061ef3e5e400285dce115e6b +Author: Felix Fietkau +Date: Sun May 10 13:16:35 2015 +0000 + + gcc: add some size optimization patches + + Signed-off-by: Felix Fietkau + + SVN-Revision: 45664 + +--- a/libgcc/config/t-libunwind ++++ b/libgcc/config/t-libunwind +@@ -2,8 +2,7 @@ + + HOST_LIBGCC2_CFLAGS += -DUSE_GAS_SYMVER + +-LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c \ +- $(srcdir)/unwind-compat.c $(srcdir)/unwind-dw2-fde-compat.c ++LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c + LIB2ADDEHSTATIC = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c + + # Override the default value from t-slibgcc-elf-ver and mention -lunwind diff --git a/toolchain/gcc/patches/10.1.0/870-ppc_no_crtsavres.patch b/toolchain/gcc/patches/10.1.0/870-ppc_no_crtsavres.patch new file mode 100644 index 0000000000..6ec22dd201 --- /dev/null +++ b/toolchain/gcc/patches/10.1.0/870-ppc_no_crtsavres.patch @@ -0,0 +1,11 @@ +--- a/gcc/config/rs6000/rs6000.c ++++ b/gcc/config/rs6000/rs6000.c +@@ -24474,7 +24474,7 @@ rs6000_savres_strategy (rs6000_stack_t * + /* Define cutoff for using out-of-line functions to save registers. */ + if (DEFAULT_ABI == ABI_V4 || TARGET_ELF) + { +- if (!optimize_size) ++ if (1) + { + strategy |= SAVE_INLINE_FPRS | REST_INLINE_FPRS; + strategy |= SAVE_INLINE_GPRS | REST_INLINE_GPRS; diff --git a/toolchain/gcc/patches/10.1.0/881-no_tm_section.patch b/toolchain/gcc/patches/10.1.0/881-no_tm_section.patch new file mode 100644 index 0000000000..fab5db3be5 --- /dev/null +++ b/toolchain/gcc/patches/10.1.0/881-no_tm_section.patch @@ -0,0 +1,11 @@ +--- a/libgcc/crtstuff.c ++++ b/libgcc/crtstuff.c +@@ -152,7 +152,7 @@ call_ ## FUNC (void) \ + #endif + + #if !defined(USE_TM_CLONE_REGISTRY) && defined(OBJECT_FORMAT_ELF) +-# define USE_TM_CLONE_REGISTRY 1 ++# define USE_TM_CLONE_REGISTRY 0 + #endif + + /* We do not want to add the weak attribute to the declarations of these diff --git a/toolchain/gcc/patches/10.1.0/900-bad-mips16-crt.patch b/toolchain/gcc/patches/10.1.0/900-bad-mips16-crt.patch new file mode 100644 index 0000000000..dd6e9dc889 --- /dev/null +++ b/toolchain/gcc/patches/10.1.0/900-bad-mips16-crt.patch @@ -0,0 +1,9 @@ +--- a/libgcc/config/mips/t-mips16 ++++ b/libgcc/config/mips/t-mips16 +@@ -43,3 +43,6 @@ SYNC_CFLAGS = -mno-mips16 + + # Version these symbols if building libgcc.so. + SHLIB_MAPFILES += $(srcdir)/config/mips/libgcc-mips16.ver ++ ++CRTSTUFF_T_CFLAGS += -mno-mips16 ++CRTSTUFF_T_CFLAGS_S += -mno-mips16 diff --git a/toolchain/gcc/patches/10.1.0/910-mbsd_multi.patch b/toolchain/gcc/patches/10.1.0/910-mbsd_multi.patch new file mode 100644 index 0000000000..8908e7bfcf --- /dev/null +++ b/toolchain/gcc/patches/10.1.0/910-mbsd_multi.patch @@ -0,0 +1,146 @@ +commit 99368862e44740ff4fd33760893f04e14f9dbdf1 +Author: Felix Fietkau +Date: Tue Jul 31 00:52:27 2007 +0000 + + Port the mbsd_multi patch from freewrt, which adds -fhonour-copts. This will emit warnings in packages that don't use our target cflags properly + + SVN-Revision: 8256 + + This patch brings over a feature from MirBSD: + * -fhonour-copts + If this option is not given, it's warned (depending + on environment variables). This is to catch errors + of misbuilt packages which override CFLAGS themselves. + + This patch was authored by Thorsten Glaser + with copyright assignment to the FSF in effect. + +--- a/gcc/c-family/c-opts.c ++++ b/gcc/c-family/c-opts.c +@@ -107,6 +107,9 @@ static dump_flags_t original_dump_flags; + /* Whether any standard preincluded header has been preincluded. */ + static bool done_preinclude; + ++/* Check if a port honours COPTS. */ ++static int honour_copts = 0; ++ + static void handle_OPT_d (const char *); + static void set_std_cxx98 (int); + static void set_std_cxx11 (int); +@@ -452,6 +455,12 @@ c_common_handle_option (size_t scode, co + flag_no_builtin = !value; + break; + ++ case OPT_fhonour_copts: ++ if (c_language == clk_c) { ++ honour_copts++; ++ } ++ break; ++ + case OPT_fconstant_string_class_: + constant_string_class_name = arg; + break; +@@ -1138,6 +1147,47 @@ c_common_init (void) + return false; + } + ++ if (c_language == clk_c) { ++ char *ev = getenv ("GCC_HONOUR_COPTS"); ++ int evv; ++ if (ev == NULL) ++ evv = -1; ++ else if ((*ev == '0') || (*ev == '\0')) ++ evv = 0; ++ else if (*ev == '1') ++ evv = 1; ++ else if (*ev == '2') ++ evv = 2; ++ else if (*ev == 's') ++ evv = -1; ++ else { ++ warning (0, "unknown GCC_HONOUR_COPTS value, assuming 1"); ++ evv = 1; /* maybe depend this on something like MIRBSD_NATIVE? */ ++ } ++ if (evv == 1) { ++ if (honour_copts == 0) { ++ error ("someone does not honour COPTS at all in lenient mode"); ++ return false; ++ } else if (honour_copts != 1) { ++ warning (0, "someone does not honour COPTS correctly, passed %d times", ++ honour_copts); ++ } ++ } else if (evv == 2) { ++ if (honour_copts == 0) { ++ error ("someone does not honour COPTS at all in strict mode"); ++ return false; ++ } else if (honour_copts != 1) { ++ error ("someone does not honour COPTS correctly, passed %d times", ++ honour_copts); ++ return false; ++ } ++ } else if (evv == 0) { ++ if (honour_copts != 1) ++ inform (UNKNOWN_LOCATION, "someone does not honour COPTS correctly, passed %d times", ++ honour_copts); ++ } ++ } ++ + return true; + } + +--- a/gcc/c-family/c.opt ++++ b/gcc/c-family/c.opt +@@ -1521,6 +1521,9 @@ C++ ObjC++ Optimization Alias(fexception + fhonor-std + C++ ObjC++ Deprecated + ++fhonour-copts ++C ObjC C++ ObjC++ RejectNegative ++ + fhosted + C ObjC + Assume normal C execution environment. +--- a/gcc/common.opt ++++ b/gcc/common.opt +@@ -1589,6 +1589,9 @@ fguess-branch-probability + Common Report Var(flag_guess_branch_prob) Optimization + Enable guessing of branch probabilities. + ++fhonour-copts ++Common RejectNegative ++ + ; Nonzero means ignore `#ident' directives. 0 means handle them. + ; Generate position-independent code for executables if possible + ; On SVR4 targets, it also controls whether or not to emit a +--- a/gcc/doc/invoke.texi ++++ b/gcc/doc/invoke.texi +@@ -7666,6 +7666,17 @@ This option is only supported for C and + @option{-Wall} and by @option{-Wpedantic}, which can be disabled with + @option{-Wno-pointer-sign}. + ++@item -fhonour-copts ++@opindex fhonour-copts ++If @env{GCC_HONOUR_COPTS} is set to 1, abort if this option is not ++given at least once, and warn if it is given more than once. ++If @env{GCC_HONOUR_COPTS} is set to 2, abort if this option is not ++given exactly once. ++If @env{GCC_HONOUR_COPTS} is set to 0 or unset, warn if this option ++is not given exactly once. ++The warning is quelled if @env{GCC_HONOUR_COPTS} is set to @samp{s}. ++This flag and environment variable only affect the C language. ++ + @item -Wstack-protector + @opindex Wstack-protector + @opindex Wno-stack-protector +--- a/gcc/opts.c ++++ b/gcc/opts.c +@@ -2314,6 +2314,9 @@ common_handle_option (struct gcc_options + /* Currently handled in a prescan. */ + break; + ++ case OPT_fhonour_copts: ++ break; ++ + case OPT_Werror: + dc->warning_as_error_requested = value; + break; diff --git a/toolchain/gcc/patches/10.1.0/920-specs_nonfatal_getenv.patch b/toolchain/gcc/patches/10.1.0/920-specs_nonfatal_getenv.patch new file mode 100644 index 0000000000..db27950de8 --- /dev/null +++ b/toolchain/gcc/patches/10.1.0/920-specs_nonfatal_getenv.patch @@ -0,0 +1,22 @@ +Author: Jo-Philipp Wich +Date: Sat Apr 21 03:02:39 2012 +0000 + + gcc: add patch to make the getenv() spec function nonfatal if requested environment variable is unset + + SVN-Revision: 31390 + +--- a/gcc/gcc.c ++++ b/gcc/gcc.c +@@ -9318,8 +9318,10 @@ getenv_spec_function (int argc, const ch + } + + if (!value) +- fatal_error (input_location, +- "environment variable %qs not defined", varname); ++ { ++ warning (input_location, "environment variable %qs not defined", varname); ++ value = ""; ++ } + + /* We have to escape every character of the environment variable so + they are not interpreted as active spec characters. A diff --git a/toolchain/gcc/patches/10.1.0/930-fix-mips-noexecstack.patch b/toolchain/gcc/patches/10.1.0/930-fix-mips-noexecstack.patch new file mode 100644 index 0000000000..95d13abad0 --- /dev/null +++ b/toolchain/gcc/patches/10.1.0/930-fix-mips-noexecstack.patch @@ -0,0 +1,111 @@ +From da45b3fde60095756f5f6030f6012c23a3d34429 Mon Sep 17 00:00:00 2001 +From: Andrew McDonnell +Date: Fri, 3 Oct 2014 19:09:00 +0930 +Subject: Add .note.GNU-stack section + +See http://lists.busybox.net/pipermail/uclibc/2014-October/048671.html +Below copied from https://gcc.gnu.org/ml/gcc-patches/2014-09/msg02430.html + +Re: [Patch, MIPS] Add .note.GNU-stack section + + From: Steve Ellcey + +On Wed, 2014-09-10 at 10:15 -0700, Eric Christopher wrote: +> +> +> On Wed, Sep 10, 2014 at 9:27 AM, wrote: + +> This works except you did not update the assembly files in +> libgcc or glibc. We (Cavium) have the same patch in our tree +> for a few released versions. + +> Mind just checking yours in then Andrew? + +> Thanks! +> -eric + +I talked to Andrew about what files he changed in GCC and created and +tested this new patch. Andrew also mentioned changing some assembly +files in glibc but I don't see any use of '.section .note.GNU-stack' in +any assembly files in glibc (for any platform) so I wasn't planning on +creating a glibc to add them to mips glibc assembly language files. + +OK to check in this patch? + +Steve Ellcey +sellcey@mips.com + + + +2014-09-26 Steve Ellcey +--- + gcc/config/mips/mips.c | 3 +++ + libgcc/config/mips/crti.S | 4 ++++ + libgcc/config/mips/crtn.S | 3 +++ + libgcc/config/mips/mips16.S | 4 ++++ + libgcc/config/mips/vr4120-div.S | 4 ++++ + 5 files changed, 18 insertions(+) + +--- a/gcc/config/mips/mips.c ++++ b/gcc/config/mips/mips.c +@@ -22822,6 +22822,9 @@ mips_starting_frame_offset (void) + #undef TARGET_STARTING_FRAME_OFFSET + #define TARGET_STARTING_FRAME_OFFSET mips_starting_frame_offset + ++#undef TARGET_ASM_FILE_END ++#define TARGET_ASM_FILE_END file_end_indicate_exec_stack ++ + struct gcc_target targetm = TARGET_INITIALIZER; + + #include "gt-mips.h" +--- a/libgcc/config/mips/crti.S ++++ b/libgcc/config/mips/crti.S +@@ -21,6 +21,10 @@ a copy of the GCC Runtime Library Except + see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + . */ + ++ ++/* An executable stack is *not* required for these functions. */ ++ .section .note.GNU-stack,"",%progbits ++ + /* 4 slots for argument spill area. 1 for cpreturn, 1 for stack. + Return spill offset of 40 and 20. Aligned to 16 bytes for n32. */ + +--- a/libgcc/config/mips/crtn.S ++++ b/libgcc/config/mips/crtn.S +@@ -21,6 +21,9 @@ a copy of the GCC Runtime Library Except + see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + . */ + ++/* An executable stack is *not* required for these functions. */ ++ .section .note.GNU-stack,"",%progbits ++ + /* 4 slots for argument spill area. 1 for cpreturn, 1 for stack. + Return spill offset of 40 and 20. Aligned to 16 bytes for n32. */ + +--- a/libgcc/config/mips/mips16.S ++++ b/libgcc/config/mips/mips16.S +@@ -48,6 +48,10 @@ see the files COPYING3 and COPYING.RUNTI + values using the soft-float calling convention, but do the actual + operation using the hard floating point instructions. */ + ++/* An executable stack is *not* required for these functions. */ ++ .section .note.GNU-stack,"",%progbits ++ .previous ++ + #if defined _MIPS_SIM && (_MIPS_SIM == _ABIO32 || _MIPS_SIM == _ABIO64) + + /* This file contains 32-bit assembly code. */ +--- a/libgcc/config/mips/vr4120-div.S ++++ b/libgcc/config/mips/vr4120-div.S +@@ -26,6 +26,10 @@ see the files COPYING3 and COPYING.RUNTI + -mfix-vr4120. div and ddiv do not give the correct result when one + of the operands is negative. */ + ++/* An executable stack is *not* required for these functions. */ ++ .section .note.GNU-stack,"",%progbits ++ .previous ++ + .set nomips16 + + #define DIV \ diff --git a/toolchain/gcc/patches/10.1.0/931-libffi-fix-MIPS-softfloat-build-issue.patch b/toolchain/gcc/patches/10.1.0/931-libffi-fix-MIPS-softfloat-build-issue.patch new file mode 100644 index 0000000000..fb4cb1533a --- /dev/null +++ b/toolchain/gcc/patches/10.1.0/931-libffi-fix-MIPS-softfloat-build-issue.patch @@ -0,0 +1,168 @@ +From c0c62fa4256f805389f16ebfc4a60cf789129b50 Mon Sep 17 00:00:00 2001 +From: BangLang Huang +Date: Wed, 9 Nov 2016 10:36:49 +0800 +Subject: [PATCH] libffi: fix MIPS softfloat build issue + +Backported from github.com/libffi/libffi#272 + +Signed-off-by: BangLang Huang +Signed-off-by: Yousong Zhou +--- + libffi/src/mips/n32.S | 17 +++++++++++++++++ + libffi/src/mips/o32.S | 17 +++++++++++++++++ + 2 files changed, 34 insertions(+) + +--- a/libffi/src/mips/n32.S ++++ b/libffi/src/mips/n32.S +@@ -107,6 +107,16 @@ loadregs: + + REG_L t6, 3*FFI_SIZEOF_ARG($fp) # load the flags word into t6. + ++#ifdef __mips_soft_float ++ REG_L a0, 0*FFI_SIZEOF_ARG(t9) ++ REG_L a1, 1*FFI_SIZEOF_ARG(t9) ++ REG_L a2, 2*FFI_SIZEOF_ARG(t9) ++ REG_L a3, 3*FFI_SIZEOF_ARG(t9) ++ REG_L a4, 4*FFI_SIZEOF_ARG(t9) ++ REG_L a5, 5*FFI_SIZEOF_ARG(t9) ++ REG_L a6, 6*FFI_SIZEOF_ARG(t9) ++ REG_L a7, 7*FFI_SIZEOF_ARG(t9) ++#else + and t4, t6, ((1< +Date: Fri, 4 May 2018 18:20:53 +0800 +Subject: [PATCH] gotools: fix compilation when making cross compiler + +libgo is "the runtime support library for the Go programming language. +This library is intended for use with the Go frontend." + +gccgo will link target files with libgo.so which depends on libgcc_s.so.1, but +the linker will complain that it cannot find it. That's because shared libgcc +is not present in the install directory yet. libgo.so was made without problem +because gcc will emit -lgcc_s when compiled with -shared option. When gotools +were being made, it was supplied with -static-libgcc thus no link option was +provided. Check LIBGO in gcc/go/gcc-spec.c for how gccgo make a builtin spec +for linking with libgo.so + +- GccgoCrossCompilation, https://github.com/golang/go/wiki/GccgoCrossCompilation +- Cross-building instructions, http://www.eglibc.org/archives/patches/msg00078.html + +When 3-pass GCC compilation is used, shared libgcc runtime libraries will be +available after gcc pass2 completed and will meet the gotools link requirement +at gcc pass3 +--- + gotools/Makefile.am | 4 +++- + gotools/Makefile.in | 4 +++- + 2 files changed, 6 insertions(+), 2 deletions(-) + +--- a/gotools/Makefile.am ++++ b/gotools/Makefile.am +@@ -26,6 +26,7 @@ PWD_COMMAND = $${PWDCMD-pwd} + STAMP = echo timestamp > + + libgodir = ../$(target_noncanonical)/libgo ++libgccdir = ../$(target_noncanonical)/libgcc + LIBGODEP = $(libgodir)/libgo.la + + LIBGOTOOL = $(libgodir)/libgotool.a +@@ -41,7 +42,8 @@ GOCFLAGS = $(CFLAGS_FOR_TARGET) + GOCOMPILE = $(GOCOMPILER) $(GOCFLAGS) + + AM_GOCFLAGS = -I $(libgodir) +-AM_LDFLAGS = -L $(libgodir) -L $(libgodir)/.libs ++AM_LDFLAGS = -L $(libgodir) -L $(libgodir)/.libs \ ++ -L $(libgccdir) -L $(libgccdir)/.libs -lgcc_s + GOLINK = $(GOCOMPILER) $(GOCFLAGS) $(AM_GOCFLAGS) $(LDFLAGS) $(AM_LDFLAGS) -o $@ + + libgosrcdir = $(srcdir)/../libgo/go +--- a/gotools/Makefile.in ++++ b/gotools/Makefile.in +@@ -337,6 +337,7 @@ mkinstalldirs = $(SHELL) $(toplevel_srcd + PWD_COMMAND = $${PWDCMD-pwd} + STAMP = echo timestamp > + libgodir = ../$(target_noncanonical)/libgo ++libgccdir = ../$(target_noncanonical)/libgcc + LIBGODEP = $(libgodir)/libgo.la + LIBGOTOOL = $(libgodir)/libgotool.a + @NATIVE_FALSE@GOCOMPILER = $(GOC) +@@ -346,7 +347,8 @@ LIBGOTOOL = $(libgodir)/libgotool.a + GOCFLAGS = $(CFLAGS_FOR_TARGET) + GOCOMPILE = $(GOCOMPILER) $(GOCFLAGS) + AM_GOCFLAGS = -I $(libgodir) +-AM_LDFLAGS = -L $(libgodir) -L $(libgodir)/.libs ++AM_LDFLAGS = -L $(libgodir) -L $(libgodir)/.libs \ ++ -L $(libgccdir) -L $(libgccdir)/.libs -lgcc_s + GOLINK = $(GOCOMPILER) $(GOCFLAGS) $(AM_GOCFLAGS) $(LDFLAGS) $(AM_LDFLAGS) -o $@ + libgosrcdir = $(srcdir)/../libgo/go + cmdsrcdir = $(libgosrcdir)/cmd From bf540f333ce6426b353d1f025455c1dfc0d089f6 Mon Sep 17 00:00:00 2001 From: Syrone Wong Date: Wed, 8 Jul 2020 06:41:21 +0800 Subject: [PATCH 25/70] toolchain/gcc: Add GCC 10.1.0 config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add needed config changes and tarball hash for new GCC version. Signed-off-by: Syrone Wong [added missing commit description] Signed-off-by: Petr Štetiar --- toolchain/gcc/Config.in | 3 +++ toolchain/gcc/Config.version | 5 +++++ toolchain/gcc/common.mk | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/toolchain/gcc/Config.in b/toolchain/gcc/Config.in index 4b2ba7aaae..1aadae6839 100644 --- a/toolchain/gcc/Config.in +++ b/toolchain/gcc/Config.in @@ -19,6 +19,9 @@ choice config GCC_USE_VERSION_9 bool "gcc 9.x" + + config GCC_USE_VERSION_10 + bool "gcc 10.x" endchoice config GCC_USE_GRAPHITE diff --git a/toolchain/gcc/Config.version b/toolchain/gcc/Config.version index 6fbc6d9804..ccc7b273fa 100644 --- a/toolchain/gcc/Config.version +++ b/toolchain/gcc/Config.version @@ -10,11 +10,16 @@ config GCC_VERSION_9 default y if GCC_USE_VERSION_9 bool +config GCC_VERSION_10 + default y if GCC_USE_VERSION_10 + bool + config GCC_VERSION string default "5.5.0" if GCC_VERSION_5 default "7.5.0" if GCC_VERSION_7 default "9.3.0" if GCC_VERSION_9 + default "10.1.0" if GCC_VERSION_10 default "8.4.0" config GCC_USE_IREMAP diff --git a/toolchain/gcc/common.mk b/toolchain/gcc/common.mk index ec3ea8fff1..eb0ddbf2d9 100644 --- a/toolchain/gcc/common.mk +++ b/toolchain/gcc/common.mk @@ -44,6 +44,10 @@ ifeq ($(PKG_VERSION),9.3.0) PKG_HASH:=71e197867611f6054aa1119b13a0c0abac12834765fe2d81f35ac57f84f742d1 endif +ifeq ($(PKG_VERSION),10.1.0) + PKG_HASH:=b6898a23844b656f1b68691c5c012036c2e694ac4b53a8918d4712ad876e7ea2 +endif + PATCH_DIR=../patches/$(GCC_VERSION) BUGURL=http://bugs.openwrt.org/ From e027df97fc69dbdf0e770d5e3cf1f85228116ef9 Mon Sep 17 00:00:00 2001 From: Syrone Wong Date: Wed, 8 Jul 2020 06:46:22 +0800 Subject: [PATCH 26/70] toolchain/gcc: Add GCC 10.1.0 patches Compared to GCC 9: 870-ppc_no_crtsavres.patch changes moved to another file following upstream 881-no_tm_section.patch keep the tm section disabled patches refreshed to apply cleanly See https://gcc.gnu.org/gcc-10/porting_to.html for more info Compiled and run tested on x86_64 Signed-off-by: Syrone Wong --- .../patches/10.1.0/002-case_insensitive.patch | 2 +- .../patches/10.1.0/010-documentation.patch | 2 +- .../10.1.0/110-Fix-MIPS-PR-84790.patch | 2 +- .../gcc/patches/10.1.0/230-musl_libssp.patch | 2 +- .../300-mips_Os_cpu_rtx_cost_model.patch | 2 +- .../gcc/patches/10.1.0/820-libgcc_pic.patch | 6 ++--- .../840-armv4_pass_fix-v4bx_to_ld.patch | 2 +- .../10.1.0/850-use_shared_libgcc.patch | 2 +- .../patches/10.1.0/870-ppc_no_crtsavres.patch | 6 ++--- .../patches/10.1.0/881-no_tm_section.patch | 4 ++-- .../gcc/patches/10.1.0/910-mbsd_multi.patch | 14 ++++++------ .../10.1.0/920-specs_nonfatal_getenv.patch | 2 +- .../10.1.0/930-fix-mips-noexecstack.patch | 22 +++++++++---------- 13 files changed, 34 insertions(+), 34 deletions(-) diff --git a/toolchain/gcc/patches/10.1.0/002-case_insensitive.patch b/toolchain/gcc/patches/10.1.0/002-case_insensitive.patch index 3442076d7d..409497e5a3 100644 --- a/toolchain/gcc/patches/10.1.0/002-case_insensitive.patch +++ b/toolchain/gcc/patches/10.1.0/002-case_insensitive.patch @@ -10,7 +10,7 @@ Date: Sun Oct 19 21:45:51 2014 +0000 --- a/include/filenames.h +++ b/include/filenames.h -@@ -43,11 +43,6 @@ extern "C" { +@@ -44,11 +44,6 @@ extern "C" { # define IS_DIR_SEPARATOR(c) IS_DOS_DIR_SEPARATOR (c) # define IS_ABSOLUTE_PATH(f) IS_DOS_ABSOLUTE_PATH (f) #else /* not DOSish */ diff --git a/toolchain/gcc/patches/10.1.0/010-documentation.patch b/toolchain/gcc/patches/10.1.0/010-documentation.patch index c3a6a15901..9783ff1ef0 100644 --- a/toolchain/gcc/patches/10.1.0/010-documentation.patch +++ b/toolchain/gcc/patches/10.1.0/010-documentation.patch @@ -12,7 +12,7 @@ Date: Tue Feb 26 16:16:33 2013 +0000 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in -@@ -3203,18 +3203,10 @@ doc/gcc.info: $(TEXI_GCC_FILES) +@@ -3283,18 +3283,10 @@ doc/gcc.info: $(TEXI_GCC_FILES) doc/gccint.info: $(TEXI_GCCINT_FILES) doc/cppinternals.info: $(TEXI_CPPINT_FILES) diff --git a/toolchain/gcc/patches/10.1.0/110-Fix-MIPS-PR-84790.patch b/toolchain/gcc/patches/10.1.0/110-Fix-MIPS-PR-84790.patch index c7e60e3157..82ac013d30 100644 --- a/toolchain/gcc/patches/10.1.0/110-Fix-MIPS-PR-84790.patch +++ b/toolchain/gcc/patches/10.1.0/110-Fix-MIPS-PR-84790.patch @@ -5,7 +5,7 @@ instructions. --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c -@@ -3131,6 +3131,12 @@ mips_emit_call_insn (rtx pattern, rtx or +@@ -3132,6 +3132,12 @@ mips_emit_call_insn (rtx pattern, rtx or emit_insn (gen_update_got_version ()); } diff --git a/toolchain/gcc/patches/10.1.0/230-musl_libssp.patch b/toolchain/gcc/patches/10.1.0/230-musl_libssp.patch index 41d75b0206..63f37662f4 100644 --- a/toolchain/gcc/patches/10.1.0/230-musl_libssp.patch +++ b/toolchain/gcc/patches/10.1.0/230-musl_libssp.patch @@ -1,6 +1,6 @@ --- a/gcc/gcc.c +++ b/gcc/gcc.c -@@ -876,7 +876,9 @@ proper position among the other output f +@@ -875,7 +875,9 @@ proper position among the other output f #endif #ifndef LINK_SSP_SPEC diff --git a/toolchain/gcc/patches/10.1.0/300-mips_Os_cpu_rtx_cost_model.patch b/toolchain/gcc/patches/10.1.0/300-mips_Os_cpu_rtx_cost_model.patch index 5caa852a16..8c4a5fce19 100644 --- a/toolchain/gcc/patches/10.1.0/300-mips_Os_cpu_rtx_cost_model.patch +++ b/toolchain/gcc/patches/10.1.0/300-mips_Os_cpu_rtx_cost_model.patch @@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c -@@ -19994,7 +19994,7 @@ mips_option_override (void) +@@ -20041,7 +20041,7 @@ mips_option_override (void) flag_pcc_struct_return = 0; /* Decide which rtx_costs structure to use. */ diff --git a/toolchain/gcc/patches/10.1.0/820-libgcc_pic.patch b/toolchain/gcc/patches/10.1.0/820-libgcc_pic.patch index 0a316d35bf..ddd6cf8732 100644 --- a/toolchain/gcc/patches/10.1.0/820-libgcc_pic.patch +++ b/toolchain/gcc/patches/10.1.0/820-libgcc_pic.patch @@ -8,7 +8,7 @@ Date: Mon Oct 19 23:26:09 2009 +0000 --- a/libgcc/Makefile.in +++ b/libgcc/Makefile.in -@@ -927,11 +927,12 @@ $(libgcov-driver-objects): %$(objext): $ +@@ -929,11 +929,12 @@ $(libgcov-driver-objects): %$(objext): $ # Static libraries. libgcc.a: $(libgcc-objects) @@ -22,7 +22,7 @@ Date: Mon Oct 19 23:26:09 2009 +0000 -rm -f $@ objects="$(objects)"; \ -@@ -955,7 +956,7 @@ all: libunwind.a +@@ -957,7 +958,7 @@ all: libunwind.a endif ifeq ($(enable_shared),yes) @@ -31,7 +31,7 @@ Date: Mon Oct 19 23:26:09 2009 +0000 ifneq ($(LIBUNWIND),) all: libunwind$(SHLIB_EXT) libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_EXT) -@@ -1161,6 +1162,10 @@ install-shared: +@@ -1163,6 +1164,10 @@ install-shared: chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a diff --git a/toolchain/gcc/patches/10.1.0/840-armv4_pass_fix-v4bx_to_ld.patch b/toolchain/gcc/patches/10.1.0/840-armv4_pass_fix-v4bx_to_ld.patch index 18aa021b93..e3cb616c4e 100644 --- a/toolchain/gcc/patches/10.1.0/840-armv4_pass_fix-v4bx_to_ld.patch +++ b/toolchain/gcc/patches/10.1.0/840-armv4_pass_fix-v4bx_to_ld.patch @@ -11,7 +11,7 @@ Date: Wed Feb 2 19:34:36 2011 +0000 +++ b/gcc/config/arm/linux-eabi.h @@ -91,10 +91,15 @@ #define MUSL_DYNAMIC_LINKER \ - "/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}.so.1" + "/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}%{mfdpic:-fdpic}.so.1" +/* For armv4 we pass --fix-v4bx to linker to support EABI */ +#undef TARGET_FIX_V4BX_SPEC diff --git a/toolchain/gcc/patches/10.1.0/850-use_shared_libgcc.patch b/toolchain/gcc/patches/10.1.0/850-use_shared_libgcc.patch index a765e55a46..8b17f1374f 100644 --- a/toolchain/gcc/patches/10.1.0/850-use_shared_libgcc.patch +++ b/toolchain/gcc/patches/10.1.0/850-use_shared_libgcc.patch @@ -7,7 +7,7 @@ Date: Sun Feb 12 20:25:47 2012 +0000 SVN-Revision: 30486 --- a/gcc/config/arm/linux-eabi.h +++ b/gcc/config/arm/linux-eabi.h -@@ -129,10 +129,6 @@ +@@ -132,10 +132,6 @@ "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} " \ LINUX_OR_ANDROID_LD (GNU_USER_TARGET_ENDFILE_SPEC, ANDROID_ENDFILE_SPEC) diff --git a/toolchain/gcc/patches/10.1.0/870-ppc_no_crtsavres.patch b/toolchain/gcc/patches/10.1.0/870-ppc_no_crtsavres.patch index 6ec22dd201..bc182f0cec 100644 --- a/toolchain/gcc/patches/10.1.0/870-ppc_no_crtsavres.patch +++ b/toolchain/gcc/patches/10.1.0/870-ppc_no_crtsavres.patch @@ -1,6 +1,6 @@ ---- a/gcc/config/rs6000/rs6000.c -+++ b/gcc/config/rs6000/rs6000.c -@@ -24474,7 +24474,7 @@ rs6000_savres_strategy (rs6000_stack_t * +--- a/gcc/config/rs6000/rs6000-logue.c ++++ b/gcc/config/rs6000/rs6000-logue.c +@@ -348,7 +348,7 @@ rs6000_savres_strategy (rs6000_stack_t * /* Define cutoff for using out-of-line functions to save registers. */ if (DEFAULT_ABI == ABI_V4 || TARGET_ELF) { diff --git a/toolchain/gcc/patches/10.1.0/881-no_tm_section.patch b/toolchain/gcc/patches/10.1.0/881-no_tm_section.patch index fab5db3be5..2029910fd0 100644 --- a/toolchain/gcc/patches/10.1.0/881-no_tm_section.patch +++ b/toolchain/gcc/patches/10.1.0/881-no_tm_section.patch @@ -6,6 +6,6 @@ #if !defined(USE_TM_CLONE_REGISTRY) && defined(OBJECT_FORMAT_ELF) -# define USE_TM_CLONE_REGISTRY 1 +# define USE_TM_CLONE_REGISTRY 0 + #elif !defined(USE_TM_CLONE_REGISTRY) + # define USE_TM_CLONE_REGISTRY 0 #endif - - /* We do not want to add the weak attribute to the declarations of these diff --git a/toolchain/gcc/patches/10.1.0/910-mbsd_multi.patch b/toolchain/gcc/patches/10.1.0/910-mbsd_multi.patch index 8908e7bfcf..452cc1cb4e 100644 --- a/toolchain/gcc/patches/10.1.0/910-mbsd_multi.patch +++ b/toolchain/gcc/patches/10.1.0/910-mbsd_multi.patch @@ -27,7 +27,7 @@ Date: Tue Jul 31 00:52:27 2007 +0000 static void handle_OPT_d (const char *); static void set_std_cxx98 (int); static void set_std_cxx11 (int); -@@ -452,6 +455,12 @@ c_common_handle_option (size_t scode, co +@@ -455,6 +458,12 @@ c_common_handle_option (size_t scode, co flag_no_builtin = !value; break; @@ -40,7 +40,7 @@ Date: Tue Jul 31 00:52:27 2007 +0000 case OPT_fconstant_string_class_: constant_string_class_name = arg; break; -@@ -1138,6 +1147,47 @@ c_common_init (void) +@@ -1168,6 +1177,47 @@ c_common_init (void) return false; } @@ -90,9 +90,9 @@ Date: Tue Jul 31 00:52:27 2007 +0000 --- a/gcc/c-family/c.opt +++ b/gcc/c-family/c.opt -@@ -1521,6 +1521,9 @@ C++ ObjC++ Optimization Alias(fexception +@@ -1590,6 +1590,9 @@ C++ ObjC++ Optimization Alias(fexception fhonor-std - C++ ObjC++ Deprecated + C++ ObjC++ WarnRemoved +fhonour-copts +C ObjC C++ ObjC++ RejectNegative @@ -102,7 +102,7 @@ Date: Tue Jul 31 00:52:27 2007 +0000 Assume normal C execution environment. --- a/gcc/common.opt +++ b/gcc/common.opt -@@ -1589,6 +1589,9 @@ fguess-branch-probability +@@ -1657,6 +1657,9 @@ fguess-branch-probability Common Report Var(flag_guess_branch_prob) Optimization Enable guessing of branch probabilities. @@ -114,7 +114,7 @@ Date: Tue Jul 31 00:52:27 2007 +0000 ; On SVR4 targets, it also controls whether or not to emit a --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi -@@ -7666,6 +7666,17 @@ This option is only supported for C and +@@ -8169,6 +8169,17 @@ This option is only supported for C and @option{-Wall} and by @option{-Wpedantic}, which can be disabled with @option{-Wno-pointer-sign}. @@ -134,7 +134,7 @@ Date: Tue Jul 31 00:52:27 2007 +0000 @opindex Wno-stack-protector --- a/gcc/opts.c +++ b/gcc/opts.c -@@ -2314,6 +2314,9 @@ common_handle_option (struct gcc_options +@@ -2308,6 +2308,9 @@ common_handle_option (struct gcc_options /* Currently handled in a prescan. */ break; diff --git a/toolchain/gcc/patches/10.1.0/920-specs_nonfatal_getenv.patch b/toolchain/gcc/patches/10.1.0/920-specs_nonfatal_getenv.patch index db27950de8..487b9e47cb 100644 --- a/toolchain/gcc/patches/10.1.0/920-specs_nonfatal_getenv.patch +++ b/toolchain/gcc/patches/10.1.0/920-specs_nonfatal_getenv.patch @@ -7,7 +7,7 @@ Date: Sat Apr 21 03:02:39 2012 +0000 --- a/gcc/gcc.c +++ b/gcc/gcc.c -@@ -9318,8 +9318,10 @@ getenv_spec_function (int argc, const ch +@@ -9396,8 +9396,10 @@ getenv_spec_function (int argc, const ch } if (!value) diff --git a/toolchain/gcc/patches/10.1.0/930-fix-mips-noexecstack.patch b/toolchain/gcc/patches/10.1.0/930-fix-mips-noexecstack.patch index 95d13abad0..e795acd1de 100644 --- a/toolchain/gcc/patches/10.1.0/930-fix-mips-noexecstack.patch +++ b/toolchain/gcc/patches/10.1.0/930-fix-mips-noexecstack.patch @@ -48,9 +48,9 @@ sellcey@mips.com --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c -@@ -22822,6 +22822,9 @@ mips_starting_frame_offset (void) - #undef TARGET_STARTING_FRAME_OFFSET - #define TARGET_STARTING_FRAME_OFFSET mips_starting_frame_offset +@@ -22881,6 +22881,9 @@ mips_asm_file_end (void) + #define TARGET_ASM_FILE_END mips_asm_file_end + +#undef TARGET_ASM_FILE_END +#define TARGET_ASM_FILE_END file_end_indicate_exec_stack @@ -60,9 +60,9 @@ sellcey@mips.com #include "gt-mips.h" --- a/libgcc/config/mips/crti.S +++ b/libgcc/config/mips/crti.S -@@ -21,6 +21,10 @@ a copy of the GCC Runtime Library Except - see the files COPYING3 and COPYING.RUNTIME respectively. If not, see - . */ +@@ -24,6 +24,10 @@ see the files COPYING3 and COPYING.RUNTI + /* An executable stack is *not* required for these functions. */ + #include "gnustack.h" + +/* An executable stack is *not* required for these functions. */ @@ -73,9 +73,9 @@ sellcey@mips.com --- a/libgcc/config/mips/crtn.S +++ b/libgcc/config/mips/crtn.S -@@ -21,6 +21,9 @@ a copy of the GCC Runtime Library Except - see the files COPYING3 and COPYING.RUNTIME respectively. If not, see - . */ +@@ -24,6 +24,9 @@ see the files COPYING3 and COPYING.RUNTI + /* An executable stack is *not* required for these functions. */ + #include "gnustack.h" +/* An executable stack is *not* required for these functions. */ + .section .note.GNU-stack,"",%progbits @@ -85,7 +85,7 @@ sellcey@mips.com --- a/libgcc/config/mips/mips16.S +++ b/libgcc/config/mips/mips16.S -@@ -48,6 +48,10 @@ see the files COPYING3 and COPYING.RUNTI +@@ -51,6 +51,10 @@ see the files COPYING3 and COPYING.RUNTI values using the soft-float calling convention, but do the actual operation using the hard floating point instructions. */ @@ -98,7 +98,7 @@ sellcey@mips.com /* This file contains 32-bit assembly code. */ --- a/libgcc/config/mips/vr4120-div.S +++ b/libgcc/config/mips/vr4120-div.S -@@ -26,6 +26,10 @@ see the files COPYING3 and COPYING.RUNTI +@@ -29,6 +29,10 @@ see the files COPYING3 and COPYING.RUNTI -mfix-vr4120. div and ddiv do not give the correct result when one of the operands is negative. */ From 61b36ee9ba8dcf2b7a935900af603a946408c6ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Fri, 26 Jul 2019 14:45:32 +0200 Subject: [PATCH 27/70] firmware-utils: mkfwimage: fix memcpy and strncpy usage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Firmware is binary blob, so there are barely any NULL terminated strings expected, so we should probably convert all chars into u8 types, and after that it's clear, that using strcpy doesn't make sense anymore. This is rather theoretical stuff, but `uint8_t name[PART_NAME_LENGTH]` means, that you can supply PART_NAME_LENGTH sized name, not PART_NAME_LENGTH-1 name when NULL terminated. Ref: https://github.com/openwrt/openwrt/pull/2274 Fixes: 04cb651376f9 ("firmware-utils: mkfwimage: fix more errors reported by gcc-6/7/9") Signed-off-by: Petr Štetiar --- tools/firmware-utils/src/fw.h | 15 ++++++++------- tools/firmware-utils/src/mkfwimage.c | 18 +++++++++--------- tools/firmware-utils/src/utils.h | 11 +++++++++++ 3 files changed, 28 insertions(+), 16 deletions(-) create mode 100644 tools/firmware-utils/src/utils.h diff --git a/tools/firmware-utils/src/fw.h b/tools/firmware-utils/src/fw.h index 53a92a573c..778143d2c4 100644 --- a/tools/firmware-utils/src/fw.h +++ b/tools/firmware-utils/src/fw.h @@ -19,6 +19,7 @@ #ifndef FW_INCLUDED #define FW_INCLUDED +#include #include #define MAGIC_HEADER "OPEN" @@ -30,16 +31,16 @@ #define PART_NAME_LENGTH 16 typedef struct header { - char magic[MAGIC_LENGTH]; - char version[256]; + uint8_t magic[MAGIC_LENGTH]; + uint8_t version[256]; u_int32_t crc; u_int32_t pad; } __attribute__ ((packed)) header_t; typedef struct part { - char magic[MAGIC_LENGTH]; - char name[PART_NAME_LENGTH]; - char pad[12]; + uint8_t magic[MAGIC_LENGTH]; + uint8_t name[PART_NAME_LENGTH]; + uint8_t pad[12]; u_int32_t memaddr; u_int32_t index; u_int32_t baseaddr; @@ -54,13 +55,13 @@ typedef struct part_crc { } __attribute__ ((packed)) part_crc_t; typedef struct signature { - char magic[MAGIC_LENGTH]; + uint8_t magic[MAGIC_LENGTH]; u_int32_t crc; u_int32_t pad; } __attribute__ ((packed)) signature_t; typedef struct signature_rsa { - char magic[MAGIC_LENGTH]; + uint8_t magic[MAGIC_LENGTH]; // u_int32_t crc; unsigned char rsa_signature[256]; u_int32_t pad; diff --git a/tools/firmware-utils/src/mkfwimage.c b/tools/firmware-utils/src/mkfwimage.c index ff9011a0c4..591ce44a78 100644 --- a/tools/firmware-utils/src/mkfwimage.c +++ b/tools/firmware-utils/src/mkfwimage.c @@ -32,6 +32,7 @@ #include #include #include "fw.h" +#include "utils.h" typedef struct fw_layout_data { u_int32_t kern_start; @@ -204,21 +205,20 @@ static void write_header(void* mem, const char *magic, const char* version) header_t* header = mem; memset(header, 0, sizeof(header_t)); - memcpy(header->magic, magic, MAGIC_LENGTH); - strncpy(header->version, version, sizeof(header->version)); - header->crc = htonl(crc32(0L, (unsigned char *)header, - sizeof(header_t) - 2 * sizeof(u_int32_t))); + FW_MEMCPY_STR(header->magic, magic); + FW_MEMCPY_STR(header->version, version); + header->crc = htonl(crc32(0L, (uint8_t*) header, + sizeof(header_t) - 2 * sizeof(u_int32_t))); header->pad = 0L; } - static void write_signature(void* mem, u_int32_t sig_offset) { /* write signature */ signature_t* sign = (signature_t*)(mem + sig_offset); memset(sign, 0, sizeof(signature_t)); - memcpy(sign->magic, MAGIC_END, MAGIC_LENGTH); + FW_MEMCPY_STR(sign->magic, MAGIC_END); sign->crc = htonl(crc32(0L,(unsigned char *)mem, sig_offset)); sign->pad = 0L; } @@ -229,7 +229,7 @@ static void write_signature_rsa(void* mem, u_int32_t sig_offset) signature_rsa_t* sign = (signature_rsa_t*)(mem + sig_offset); memset(sign, 0, sizeof(signature_rsa_t)); - memcpy(sign->magic, MAGIC_ENDS, MAGIC_LENGTH); + FW_MEMCPY_STR(sign->magic, MAGIC_ENDS); // sign->crc = htonl(crc32(0L,(unsigned char *)mem, sig_offset)); sign->pad = 0L; } @@ -259,8 +259,8 @@ static int write_part(void* mem, part_data_t* d) munmap(addr, d->stats.st_size); memset(p->name, 0, PART_NAME_LENGTH); - memcpy(p->magic, MAGIC_PART, MAGIC_LENGTH); - memcpy(p->name, d->partition_name, PART_NAME_LENGTH); + FW_MEMCPY_STR(p->magic, MAGIC_PART); + FW_MEMCPY_STR(p->name, d->partition_name); p->index = htonl(d->partition_index); p->data_size = htonl(d->stats.st_size); diff --git a/tools/firmware-utils/src/utils.h b/tools/firmware-utils/src/utils.h new file mode 100644 index 0000000000..11ec740069 --- /dev/null +++ b/tools/firmware-utils/src/utils.h @@ -0,0 +1,11 @@ +#include +#include + +#pragma once + +#define FW_MEMCPY_STR(dst, src) \ + do { \ + size_t slen = strlen(src); \ + size_t dlen = sizeof(dst); \ + memcpy(dst, src, slen > dlen ? dlen : slen); \ + } while (0); From 4d92a558f26b910de84661b3c273ae2ff9b2f3e1 Mon Sep 17 00:00:00 2001 From: Tomasz Maciej Nowak Date: Thu, 9 Jul 2020 21:16:15 +0200 Subject: [PATCH 28/70] linux-firmware: package EIP197 mini firmware Quoting part of original message from eefb5f741015 commit in linux-firmware repository: This adds the "minifw" version of the EIP197 firmware, which the inside- secure driver will use as a fallback if the original full-featured firmware cannot be found. This allows for using the inside-secure driver and hardware without access to "official" firmware only available under NDA. Signed-off-by: Tomasz Maciej Nowak --- package/firmware/linux-firmware/misc.mk | 9 +++++++++ package/kernel/linux/modules/crypto.mk | 10 ++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 package/firmware/linux-firmware/misc.mk diff --git a/package/firmware/linux-firmware/misc.mk b/package/firmware/linux-firmware/misc.mk new file mode 100644 index 0000000000..d0956f77b3 --- /dev/null +++ b/package/firmware/linux-firmware/misc.mk @@ -0,0 +1,9 @@ +Package/eip197-mini-firmware = $(call Package/firmware-default,Inside Secure EIP197 mini firmware) +define Package/eip197-mini-firmware/install + $(INSTALL_DIR) $(1)/lib/firmware/inside-secure/eip197_minifw + $(INSTALL_DATA) \ + $(PKG_BUILD_DIR)/inside-secure/eip197_minifw/ifpp.bin \ + $(PKG_BUILD_DIR)/inside-secure/eip197_minifw/ipue.bin \ + $(1)/lib/firmware/inside-secure/eip197_minifw +endef +$(eval $(call BuildPackage,eip197-mini-firmware)) diff --git a/package/kernel/linux/modules/crypto.mk b/package/kernel/linux/modules/crypto.mk index 9001721792..48777764a8 100644 --- a/package/kernel/linux/modules/crypto.mk +++ b/package/kernel/linux/modules/crypto.mk @@ -377,7 +377,7 @@ $(eval $(call KernelPackage,crypto-hw-padlock)) define KernelPackage/crypto-hw-safexcel TITLE:= MVEBU SafeXcel Crypto Engine module - DEPENDS:=@!LINUX_4_14 @(TARGET_mvebu_cortexa53||TARGET_mvebu_cortexa72) \ + DEPENDS:=@!LINUX_4_14 @(TARGET_mvebu_cortexa53||TARGET_mvebu_cortexa72) +eip197-mini-firmware \ +kmod-crypto-authenc +kmod-crypto-md5 +kmod-crypto-hmac +kmod-crypto-sha256 +kmod-crypto-sha512 KCONFIG:= \ CONFIG_CRYPTO_HW=y \ @@ -392,9 +392,11 @@ MVEBU's EIP97 and EIP197 Cryptographic Engine driver designed by Inside Secure. This is found on Marvell Armada 37xx/7k/8k SoCs. Particular version of these IP (EIP197B and EIP197D) require firmware. -Unfortunately it's not freely available and needs signed Non-Disclosure -Agreement (NDA) with Marvell. For those who have signed NDA the firmware can be -obtained at https://extranet.marvell.com. +The mini firmware package provides limited functionality, for most operations +a full-featured firmware is required. Unfortunately the "full" firmware is not +freely available and needs signed Non-Disclosure Agreement (NDA) with Marvell. +For those who have signed NDA the firmware can be obtained at +https://extranet.marvell.com. endef $(eval $(call KernelPackage,crypto-hw-safexcel)) From ecda6b791b34231fd0bb2c2a86be9f937ef43602 Mon Sep 17 00:00:00 2001 From: Alexey Dobrovolsky Date: Wed, 6 May 2020 23:48:15 +0300 Subject: [PATCH 29/70] ramips: kernel: fix awake-rt305x-dwc2 patch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit At this point in v5.4 kernel we cannot use dwc2_readl() and dwc2_writel() since they rely on the value hsotg->needs_byte_swap which cannot be obtained before the controller wakes up. We should use readl() and writel() to wake up the controller before calling dwc2_check_core_endianness(). Fixes: 6be0da90a165 ("ramips: refresh patches") Signed-off-by: Alexey Dobrovolsky [fixed Fixes: tag] Signed-off-by: Petr Štetiar --- .../0069-awake-rt305x-dwc2-controller.patch | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/target/linux/ramips/patches-5.4/0069-awake-rt305x-dwc2-controller.patch b/target/linux/ramips/patches-5.4/0069-awake-rt305x-dwc2-controller.patch index 1ce8fac682..1ce7102a4e 100644 --- a/target/linux/ramips/patches-5.4/0069-awake-rt305x-dwc2-controller.patch +++ b/target/linux/ramips/patches-5.4/0069-awake-rt305x-dwc2-controller.patch @@ -1,15 +1,15 @@ --- a/drivers/usb/dwc2/platform.c +++ b/drivers/usb/dwc2/platform.c -@@ -432,6 +432,12 @@ static int dwc2_driver_probe(struct plat - - hsotg->needs_byte_swap = dwc2_check_core_endianness(hsotg); +@@ -430,6 +430,12 @@ static int dwc2_driver_probe(struct plat + if (retval) + return retval; + /* Enable USB port before any regs access */ -+ if (dwc2_readl(hsotg, PCGCTL) & 0x0f) { -+ dwc2_writel(0x00, hsotg, PCGCTL); ++ if (readl(hsotg->regs + PCGCTL) & 0x0f) { ++ writel(0x00, hsotg->regs + PCGCTL); + /* TODO: mdelay(25) here? vendor driver don't use it */ + } + + hsotg->needs_byte_swap = dwc2_check_core_endianness(hsotg); + retval = dwc2_get_dr_mode(hsotg); - if (retval) - goto error; From 0b76410231597d2c793421040ce20a3152c65fdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Mon, 20 Jan 2020 16:22:07 +0100 Subject: [PATCH 30/70] libubox: update to version 2020-07-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit f4e9bf73ac5c examples/lua: attempt to highlight some traps 53b9a2123fc6 lua/uloop: fd_add: use absolute indices for arguments c0941d3289fc lua/uloop: make get_sock_fd capable of absolute addresses 161c25960ba2 lua/uloop: fd_add() better args checking Signed-off-by: Petr Štetiar --- package/libs/libubox/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/libs/libubox/Makefile b/package/libs/libubox/Makefile index 49bf583742..025f6489e7 100644 --- a/package/libs/libubox/Makefile +++ b/package/libs/libubox/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/libubox.git -PKG_MIRROR_HASH:=3d58def8e415ceda8aacfd8453813d8bf2a05991c0df0c074744639ab04321ba -PKG_SOURCE_DATE:=2020-05-25 -PKG_SOURCE_VERSION:=66195aee50424cbda0c2d858014e4cc58a2dc029 +PKG_MIRROR_HASH:=cb941cd33f43b38ef1a1f2b4fd212e0bb21c100dcdd2ab1976f8cc2071566d32 +PKG_SOURCE_DATE:=2020-07-11 +PKG_SOURCE_VERSION:=f4e9bf73ac5c0ee6b8f240e2a2100e70ca56d705 CMAKE_INSTALL:=1 PKG_LICENSE:=ISC From f61110e8f21c0d205ba73f2b8ced9dd8fbc50853 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Fri, 10 Jul 2020 16:13:10 -0700 Subject: [PATCH 31/70] lzo: switch to building with CMake CMake is less error prone that autotools and also compiles faster. Fixed license information. Added pkgconfig file to InstallDev so that packages that use it can find lzo. Before: time make package/lzo/compile -j 12 ________________________________________________________ Executed in 20.87 secs fish external usr time 26.95 secs 0.00 micros 26.95 secs sys time 5.49 secs 305.00 micros 5.49 secs After: time make package/lzo/compile -j 12 ________________________________________________________ Executed in 13.22 secs fish external usr time 19.59 secs 328.00 micros 19.59 secs sys time 4.03 secs 10.00 micros 4.03 secs Time output is with fish shell. make clean was ran before both attempts. Signed-off-by: Rosen Penev --- package/libs/lzo/Makefile | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/package/libs/lzo/Makefile b/package/libs/lzo/Makefile index 1ae2f3ce05..3ce5f53349 100644 --- a/package/libs/lzo/Makefile +++ b/package/libs/lzo/Makefile @@ -9,19 +9,20 @@ include $(TOPDIR)/rules.mk PKG_NAME:=lzo PKG_VERSION:=2.10 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://www.oberhumer.com/opensource/lzo/download/ PKG_HASH:=c0f892943208266f9b6543b3ae308fab6284c5c90e627931446fb49b4221a072 -PKG_FIXUP:=autoreconf -PKG_INSTALL:=1 -PKG_LICENSE:=GPL-2.0+ +PKG_LICENSE:=GPL-2.0-or-later +PKG_LICENSE_FILES:=COPYING PKG_BUILD_PARALLEL:=1 +CMAKE_BINARY_SUBDIR:=openwrt-build include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/cmake.mk define Package/liblzo SECTION:=libs @@ -36,17 +37,18 @@ define Package/liblzo/description in real-time. This means it favours speed over compression ratio. endef -CONFIGURE_ARGS += \ - --enable-shared \ - --enable-static \ - -TARGET_CFLAGS += $(FPIC) -MAKE_FLAGS += CFLAGS_O="$(TARGET_CFLAGS)" +CMAKE_OPTIONS += \ + -DENABLE_SHARED=ON \ + -DENABLE_STATIC=ON \ + \ + -DBUILD_TESTING=OFF \ + -DCMAKE_SKIP_INSTALL_RPATH=ON define Build/InstallDev - $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib + $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib $(1)/usr/lib/pkgconfig $(CP) $(PKG_INSTALL_DIR)/usr/include/lzo $(1)/usr/include/ $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblzo2.{a,so*} $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lzo2.pc $(1)/usr/lib/pkgconfig endef define Package/liblzo/install From c5c652e5ad97335eb3968dab6be0d7152e22893b Mon Sep 17 00:00:00 2001 From: Rui Salvaterra Date: Wed, 8 Jul 2020 09:18:14 +0100 Subject: [PATCH 32/70] busybox: use CLOCK_MONOTONIC instead of gettimeofday The clock_gettime(CLOCK_MONOTONIC) syscall exists for so long that the first kernel version to support it is not even specified in the man page [1]. Let's enable it on BusyBox by default. Otherwise, gettimeofday will be used instead, which will give wrong results if the date/time is reset (time moving backwards). [1] https://linux.die.net/man/2/clock_gettime Signed-off-by: Rui Salvaterra --- package/utils/busybox/Config-defaults.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/utils/busybox/Config-defaults.in b/package/utils/busybox/Config-defaults.in index 91c9b9b5b9..89da7ace8d 100644 --- a/package/utils/busybox/Config-defaults.in +++ b/package/utils/busybox/Config-defaults.in @@ -303,7 +303,7 @@ config BUSYBOX_DEFAULT_FEATURE_SKIP_ROOTFS default n config BUSYBOX_DEFAULT_MONOTONIC_SYSCALL bool - default n + default y config BUSYBOX_DEFAULT_IOCTL_HEX2STR_ERROR bool default y From 0bd7dfa3ed60588ec83a8f60f48b6991ebb16940 Mon Sep 17 00:00:00 2001 From: Rui Salvaterra Date: Tue, 23 Jun 2020 12:29:54 +0100 Subject: [PATCH 33/70] zram-swap: enable swap discard Zram block devices have supported trim/discard for over six years, let's enable it. This allows the zram device to actually free up allocated memory when it's marked as unused in the filesystem metadata, as explained in more detail in the original commit message [1]. [1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/drivers/block/zram/zram_drv.c?h=linux-4.14.y&id=f4659d8e620d08bd1a84a8aec5d2f5294a242764 Signed-off-by: Rui Salvaterra --- package/system/zram-swap/files/zram.init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/system/zram-swap/files/zram.init b/package/system/zram-swap/files/zram.init index c855bbc087..a6126e578f 100755 --- a/package/system/zram-swap/files/zram.init +++ b/package/system/zram-swap/files/zram.init @@ -182,7 +182,7 @@ start() zram_comp_streams "$zram_dev" echo $(( $zram_size * 1024 * 1024 )) >"/sys/block/$( basename "$zram_dev" )/disksize" mkswap "$zram_dev" - swapon $zram_priority "$zram_dev" + swapon -d $zram_priority "$zram_dev" } stop() From 0b6155de0ba0aa9e6942522ec6666c56a2f5aff1 Mon Sep 17 00:00:00 2001 From: Rui Salvaterra Date: Wed, 8 Jul 2020 17:20:28 +0100 Subject: [PATCH 34/70] zram-swap: correctly express the required dependencies The block-mount swapon implementation doesn't support discard, so make zram-swap depend only on the default BusyBox implementation or, when unavailable, on the one present in the swap-utils package. Signed-off-by: Rui Salvaterra --- package/system/zram-swap/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/system/zram-swap/Makefile b/package/system/zram-swap/Makefile index ee5e85927f..a6661ce5e9 100644 --- a/package/system/zram-swap/Makefile +++ b/package/system/zram-swap/Makefile @@ -18,7 +18,7 @@ include $(INCLUDE_DIR)/package.mk define Package/zram-swap SECTION:=utils CATEGORY:=Base system - DEPENDS:=+kmod-zram +!(BUSYBOX_DEFAULT_MKSWAP||BUSYBOX_CONFIG_MKSWAP):swap-utils +!((BUSYBOX_DEFAULT_SWAPON||BUSYBOX_CONFIG_SWAPON)&&(BUSYBOX_DEFAULT_SWAPOFF||BUSYBOX_CONFIG_SWAPOFF)):block-mount + DEPENDS:=+kmod-zram +!(BUSYBOX_CONFIG_MKSWAP&&BUSYBOX_CONFIG_SWAPON&&BUSYBOX_CONFIG_SWAPOFF):swap-utils TITLE:=ZRAM swap scripts PKGARCH:=all endef From 99dae00fa86203effc3e7e41cbc8d89b9518848c Mon Sep 17 00:00:00 2001 From: Rui Salvaterra Date: Thu, 25 Jun 2020 15:20:23 +0100 Subject: [PATCH 35/70] kernel: kmod-zram: break the strict dependency from lz4 Zram is only strictly dependent on lzo, not lz4. Break this dependency and make the lz4 module visible in the configuration, in order for the user to have the choice of enabling/disabling it, if (s)he sees fit. Signed-off-by: Rui Salvaterra --- package/kernel/linux/modules/lib.mk | 1 - package/kernel/linux/modules/other.mk | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/package/kernel/linux/modules/lib.mk b/package/kernel/linux/modules/lib.mk index e14c6b31c0..1289cc1f25 100644 --- a/package/kernel/linux/modules/lib.mk +++ b/package/kernel/linux/modules/lib.mk @@ -147,7 +147,6 @@ define KernelPackage/lib-lz4 SUBMENU:=$(LIB_MENU) TITLE:=LZ4 support DEPENDS:=+kmod-crypto-acompress - HIDDEN:=1 KCONFIG:= \ CONFIG_CRYPTO_LZ4 \ CONFIG_LZ4_COMPRESS \ diff --git a/package/kernel/linux/modules/other.mk b/package/kernel/linux/modules/other.mk index f74c622ed7..6eb9404837 100644 --- a/package/kernel/linux/modules/other.mk +++ b/package/kernel/linux/modules/other.mk @@ -930,15 +930,14 @@ $(eval $(call KernelPackage,ikconfig)) define KernelPackage/zram SUBMENU:=$(OTHER_MENU) TITLE:=ZRAM - DEPENDS:=+kmod-lib-lzo +kmod-lib-lz4 + DEPENDS:=+kmod-lib-lzo KCONFIG:= \ CONFIG_ZSMALLOC \ CONFIG_ZRAM \ CONFIG_ZRAM_DEBUG=n \ CONFIG_PGTABLE_MAPPING=n \ CONFIG_ZRAM_WRITEBACK=n \ - CONFIG_ZSMALLOC_STAT=n \ - CONFIG_ZRAM_LZ4_COMPRESS=y + CONFIG_ZSMALLOC_STAT=n FILES:= \ $(LINUX_DIR)/mm/zsmalloc.ko \ $(LINUX_DIR)/drivers/block/zram/zram.ko From 969690b33c56fd8f11ba2ce517e4dd70d9acaefa Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Fri, 22 Nov 2019 15:09:01 -0800 Subject: [PATCH 36/70] toolchain/gdb: Don't use gdb-arc GDB got support for ARC with version 8.2. No need for this fork. Signed-off-by: Rosen Penev --- toolchain/gdb/Makefile | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/toolchain/gdb/Makefile b/toolchain/gdb/Makefile index 41ba9853fd..c25d181990 100644 --- a/toolchain/gdb/Makefile +++ b/toolchain/gdb/Makefile @@ -7,23 +7,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=gdb - -ifeq ($(CONFIG_arc),y) -PKG_VERSION:=arc-2017.09-gdb - -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/archive/arc-2017.09-gdb -PKG_HASH:=7e3c2a763bf500a40c5c4591a7e22c591dafc1f214b1d514895c1096e85c883a -GDB_DIR:=binutils-$(PKG_NAME)-$(PKG_VERSION) -PATCH_DIR:=./patches-arc -else PKG_VERSION:=8.3.1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNU/gdb PKG_HASH:=1e55b4d7cdca7b34be12f4ceae651623aa73b2fd640152313f9f66a7149757c4 GDB_DIR:=$(PKG_NAME)-$(PKG_VERSION) -endif HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(GDB_DIR) From d8e6a92e7cd83380448f73911fff4f5fff33ef01 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 29 Dec 2019 19:41:17 -0800 Subject: [PATCH 37/70] toolchain/wrapper.sh: Replace read with read -r Without -r, backslashes would get mangled. Found with shellcheck. Signed-off-by: Rosen Penev --- target/toolchain/files/wrapper.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/toolchain/files/wrapper.sh b/target/toolchain/files/wrapper.sh index 2cbcc8c1e6..6078d91973 100755 --- a/target/toolchain/files/wrapper.sh +++ b/target/toolchain/files/wrapper.sh @@ -30,7 +30,7 @@ TARGET_TOOLCHAIN_TRIPLET=${REALNAME_BASE%-*} BINARY=${PROGNAME##*-} # Parse our tool name, splitting it at '-' characters. -IFS=- read TOOLCHAIN_ARCH TOOLCHAIN_BUILDROOT TOOLCHAIN_OS TOOLCHAIN_PLATFORM PROGNAME << EOF +IFS=- read -r TOOLCHAIN_ARCH TOOLCHAIN_BUILDROOT TOOLCHAIN_OS TOOLCHAIN_PLATFORM PROGNAME << EOF $REALNAME_BASE EOF From df09cc6ddb85aeaad616aba74810c4be44284fe7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Sat, 11 Jul 2020 13:06:36 +0200 Subject: [PATCH 38/70] toolchain/wrapper.sh: fix remaining shellcheck warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes following warnings: In target/toolchain/files/wrapper.sh line 18: REALNAME=$(readlink -f $0) ^-- SC2086: Double quote to prevent globbing and word splitting. -- In target/toolchain/files/wrapper.sh line 20: REALNAME_BASE=$(basename $REALNAME) ^-------^ SC2086: Double quote to prevent globbing and word splitting. -- In target/toolchain/files/wrapper.sh line 21: REALNAME_DIR=$(dirname $REALNAME) ^-------^ SC2086: Double quote to prevent globbing and word splitting. -- In target/toolchain/files/wrapper.sh line 74: exec $TARGET_TOOLCHAIN_TRIPLET-$BINARY.bin $GCC_SYSROOT_FLAGS $TARGET_FUNDAMENTAL_CFLAGS $TARGET_ROOTFS_CFLAGS "$@" ^-----------------------^ SC2086: Double quote to prevent globbing and word splitting. -- In target/toolchain/files/wrapper.sh line 77: exec $TARGET_TOOLCHAIN_TRIPLET-$BINARY.bin $LD_SYSROOT_FLAGS $TARGET_FUNDAMENTAL_LDFLAGS "$@" ^-----------------------^ SC2086: Double quote to prevent globbing and word splitting. -- In target/toolchain/files/wrapper.sh line 80: exec $TARGET_TOOLCHAIN_TRIPLET-$BINARY.bin $TARGET_FUNDAMENTAL_ASFLAGS "$@" ^-----------------------^ SC2086: Double quote to prevent globbing and word splitting. -- In target/toolchain/files/wrapper.sh line 83: exec $TARGET_TOOLCHAIN_TRIPLET-$BINARY.bin "$@" ^-----------------------^ SC2086: Double quote to prevent globbing and word splitting. Signed-off-by: Petr Štetiar --- target/toolchain/files/wrapper.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/target/toolchain/files/wrapper.sh b/target/toolchain/files/wrapper.sh index 6078d91973..6a0cdfff6c 100755 --- a/target/toolchain/files/wrapper.sh +++ b/target/toolchain/files/wrapper.sh @@ -15,10 +15,10 @@ # PROGNAME=$0 -REALNAME=$(readlink -f $0) +REALNAME=$(readlink -f "$0") -REALNAME_BASE=$(basename $REALNAME) -REALNAME_DIR=$(dirname $REALNAME) +REALNAME_BASE=$(basename "$REALNAME") +REALNAME_DIR=$(dirname "$REALNAME") TARGET_FUNDAMENTAL_ASFLAGS='' TARGET_FUNDAMENTAL_CFLAGS='' @@ -30,7 +30,7 @@ TARGET_TOOLCHAIN_TRIPLET=${REALNAME_BASE%-*} BINARY=${PROGNAME##*-} # Parse our tool name, splitting it at '-' characters. -IFS=- read -r TOOLCHAIN_ARCH TOOLCHAIN_BUILDROOT TOOLCHAIN_OS TOOLCHAIN_PLATFORM PROGNAME << EOF +IFS=- read -r _ _ _ TOOLCHAIN_PLATFORM PROGNAME << EOF $REALNAME_BASE EOF @@ -71,16 +71,16 @@ esac # case $BINARY in cc|gcc|g++|c++|cpp) - exec $TARGET_TOOLCHAIN_TRIPLET-$BINARY.bin $GCC_SYSROOT_FLAGS $TARGET_FUNDAMENTAL_CFLAGS $TARGET_ROOTFS_CFLAGS "$@" + exec "$TARGET_TOOLCHAIN_TRIPLET-$BINARY.bin" $GCC_SYSROOT_FLAGS $TARGET_FUNDAMENTAL_CFLAGS $TARGET_ROOTFS_CFLAGS "$@" ;; ld) - exec $TARGET_TOOLCHAIN_TRIPLET-$BINARY.bin $LD_SYSROOT_FLAGS $TARGET_FUNDAMENTAL_LDFLAGS "$@" + exec "$TARGET_TOOLCHAIN_TRIPLET-$BINARY.bin" $LD_SYSROOT_FLAGS $TARGET_FUNDAMENTAL_LDFLAGS "$@" ;; as) - exec $TARGET_TOOLCHAIN_TRIPLET-$BINARY.bin $TARGET_FUNDAMENTAL_ASFLAGS "$@" + exec "$TARGET_TOOLCHAIN_TRIPLET-$BINARY.bin" $TARGET_FUNDAMENTAL_ASFLAGS "$@" ;; *) - exec $TARGET_TOOLCHAIN_TRIPLET-$BINARY.bin "$@" + exec "$TARGET_TOOLCHAIN_TRIPLET-$BINARY.bin" "$@" ;; esac From 40acc13ca72ca7d2815dc5d94549d5dc48e16e98 Mon Sep 17 00:00:00 2001 From: Eneas U de Queiroz Date: Thu, 20 Feb 2020 18:29:02 -0300 Subject: [PATCH 39/70] build: package-ipkg: avoid calling wildcard twice Instead of calling $(wildcard) to check if the removal list is empty, then calling it again to actually remove the files, define a function so that the arguments are expanded only once when it gets called. Signed-off-by: Eneas U de Queiroz --- include/package-ipkg.mk | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/include/package-ipkg.mk b/include/package-ipkg.mk index 569edcbf03..fa39c0927c 100644 --- a/include/package-ipkg.mk +++ b/include/package-ipkg.mk @@ -18,6 +18,12 @@ IPKG_REMOVE:= \ IPKG_STATE_DIR:=$(TARGET_DIR)/usr/lib/opkg +# 1: package name +# 2: candidate ipk files +define remove_ipkg_files + $(if $(strip $(2)),$(IPKG_REMOVE) $(1) $(2)) +endef + # 1: package name # 2: variable name # 3: variable suffix @@ -185,7 +191,7 @@ $(_endef) $$(IPKG_$(1)) : export DESCRIPTION=$$(Package/$(1)/description) $$(IPKG_$(1)) : export PATH=$$(TARGET_PATH_PKG) $(PKG_INFO_DIR)/$(1).provides $$(IPKG_$(1)): $(STAMP_BUILT) $(INCLUDE_DIR)/package-ipkg.mk - @rm -rf $$(IDIR_$(1)) $$(if $$(call opkg_package_files,$(1)*),; $$(IPKG_REMOVE) $(1) $$(call opkg_package_files,$(1)*)) + @rm -rf $$(IDIR_$(1)); $$(call remove_ipkg_files,$(1),$$(call opkg_package_files,$(1)*)) mkdir -p $(PACKAGE_DIR) $$(IDIR_$(1))/CONTROL $(PKG_INFO_DIR) $(call Package/$(1)/install,$$(IDIR_$(1))) $(if $(Package/$(1)/install-overlay),mkdir -p $(PACKAGE_DIR) $$(IDIR_$(1))/rootfs-overlay) @@ -253,7 +259,7 @@ $(_endef) @[ -f $$(IPKG_$(1)) ] $(1)-clean: - $$(if $$(call opkg_package_files,$(1)*),$$(IPKG_REMOVE) $(1) $$(call opkg_package_files,$(1)*)) + $$(call remove_ipkg_files,$(1),$$(call opkg_package_files,$(1)*)) clean: $(1)-clean From 78d1f3ac61b1740f2a45c40bcde0e83246308a18 Mon Sep 17 00:00:00 2001 From: Eneas U de Queiroz Date: Thu, 20 Feb 2020 18:29:03 -0300 Subject: [PATCH 40/70] build: call ipkg-remove using xargs if #args>=512 The wildcard call to clean up luci package (luci*) can pick up over 2,300 files when the full tree is built. Running make package/luci/clean or a second run of make package/luci/compile would fail with an 'Argument list too long' error. To avoid that, a maybe_use_xargs function was created that runs the command straight as usual if the number of arguments is < 512, or saves the list in a temporary file and feeds it to xargs otherwise. Signed-off-by: Eneas U de Queiroz --- include/package-ipkg.mk | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/include/package-ipkg.mk b/include/package-ipkg.mk index fa39c0927c..7fc0f86124 100644 --- a/include/package-ipkg.mk +++ b/include/package-ipkg.mk @@ -18,10 +18,20 @@ IPKG_REMOVE:= \ IPKG_STATE_DIR:=$(TARGET_DIR)/usr/lib/opkg +# 1: command and initial arguments +# 2: arguments list +# 3: tmp filename +define maybe_use_xargs + $(if $(word 512,$(2)), \ + $(file >$(3),$(2)) $(XARGS) $(1) < "$(3)"; rm "$(3)", \ + $(1) $(2)) +endef + # 1: package name # 2: candidate ipk files define remove_ipkg_files - $(if $(strip $(2)),$(IPKG_REMOVE) $(1) $(2)) + $(if $(strip $(2)), \ + $(call maybe_use_xargs,$(IPKG_REMOVE) $(1),$(2),$(TMP_DIR)/$(1).in)) endef # 1: package name From 11192484fa320cd233849441bd00ddf58964de42 Mon Sep 17 00:00:00 2001 From: Eneas U de Queiroz Date: Thu, 20 Feb 2020 18:29:04 -0300 Subject: [PATCH 41/70] build: reduce number of files passed to ipk-remove Instead of using xargs to pass a huge number of files to script/ipkg-remove, which will usually pick only one, use a more restrictive wildcard so that, currently, at the most 325 files are examined, instead of up to over 2,300. The 325-file package is python, which is picking up python3* ipks. It is about to be removed. Runner-up is ddns-scripts with 7 files. This makes a second run of make package/luci/compile go from real 16.40s; user 17.42s; sys 2.73s to real 10.71s; user 9.51s; sys 1.27s There is a caveat though: if one were to remove the ABI_VERSION of a package that ends in a digit [0-9], then the old package ipk will not be removed from the bin directory by make package/abc2/clean. Signed-off-by: Eneas U de Queiroz --- include/package-ipkg.mk | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/include/package-ipkg.mk b/include/package-ipkg.mk index 7fc0f86124..622cbf3223 100644 --- a/include/package-ipkg.mk +++ b/include/package-ipkg.mk @@ -18,20 +18,16 @@ IPKG_REMOVE:= \ IPKG_STATE_DIR:=$(TARGET_DIR)/usr/lib/opkg -# 1: command and initial arguments -# 2: arguments list -# 3: tmp filename -define maybe_use_xargs - $(if $(word 512,$(2)), \ - $(file >$(3),$(2)) $(XARGS) $(1) < "$(3)"; rm "$(3)", \ - $(1) $(2)) +# Generates a make statement to return a wildcard for candidate ipkg files +# 1: package name +define gen_ipkg_wildcard + $(1)$$(if $$(filter -%,$$(ABIV_$(1))),,[^a-z-])* endef # 1: package name # 2: candidate ipk files define remove_ipkg_files - $(if $(strip $(2)), \ - $(call maybe_use_xargs,$(IPKG_REMOVE) $(1),$(2),$(TMP_DIR)/$(1).in)) + $(if $(strip $(2)),$(IPKG_REMOVE) $(1) $(2)) endef # 1: package name @@ -201,7 +197,8 @@ $(_endef) $$(IPKG_$(1)) : export DESCRIPTION=$$(Package/$(1)/description) $$(IPKG_$(1)) : export PATH=$$(TARGET_PATH_PKG) $(PKG_INFO_DIR)/$(1).provides $$(IPKG_$(1)): $(STAMP_BUILT) $(INCLUDE_DIR)/package-ipkg.mk - @rm -rf $$(IDIR_$(1)); $$(call remove_ipkg_files,$(1),$$(call opkg_package_files,$(1)*)) + @rm -rf $$(IDIR_$(1)); \ + $$(call remove_ipkg_files,$(1),$$(call opkg_package_files,$(call gen_ipkg_wildcard,$(1)))) mkdir -p $(PACKAGE_DIR) $$(IDIR_$(1))/CONTROL $(PKG_INFO_DIR) $(call Package/$(1)/install,$$(IDIR_$(1))) $(if $(Package/$(1)/install-overlay),mkdir -p $(PACKAGE_DIR) $$(IDIR_$(1))/rootfs-overlay) @@ -269,7 +266,7 @@ $(_endef) @[ -f $$(IPKG_$(1)) ] $(1)-clean: - $$(call remove_ipkg_files,$(1),$$(call opkg_package_files,$(1)*)) + $$(call remove_ipkg_files,$(1),$$(call opkg_package_files,$(call gen_ipkg_wildcard,$(1)))) clean: $(1)-clean From 56f813674a912490df327304033bf667b285930a Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 5 Jan 2020 18:32:35 -0800 Subject: [PATCH 42/70] scripts/env: use command -v instead of which Simpler and built in to the shell. Found with shellcheck. Signed-off-by: Rosen Penev --- scripts/env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/env b/scripts/env index 7bfca58c5d..563f39c1cf 100755 --- a/scripts/env +++ b/scripts/env @@ -57,7 +57,7 @@ env_init() { if [ -z "$CREATE" ]; then [ -d "$ENVDIR" ] || exit 0 fi - [ -x "$(which git 2>/dev/null)" ] || error "Git is not installed" + command -v git || error "Git is not installed" mkdir -p "$ENVDIR" || error "Failed to create the environment directory" cd "$ENVDIR" || error "Failed to switch to the environment directory" [ -d .git ] || { From e68810ba5352d7db89a9975f2a2a8951fc9d5b2b Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 5 Jan 2020 18:32:36 -0800 Subject: [PATCH 43/70] scripts/env: replace \! with ! The latter is more standard. The former throws an error under shellcheck. Signed-off-by: Rosen Penev --- scripts/env | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/env b/scripts/env index 563f39c1cf..19cfa13841 100755 --- a/scripts/env +++ b/scripts/env @@ -73,7 +73,7 @@ env_init() { } env_sync_data() { - [ \! -L "$BASEDIR/.config" ] && [ -f "$BASEDIR/.config" ] && mv "$BASEDIR/.config" "$ENVDIR" + [ ! -L "$BASEDIR/.config" ] && [ -f "$BASEDIR/.config" ] && mv "$BASEDIR/.config" "$ENVDIR" git add . git add -u } @@ -195,7 +195,7 @@ env_new() { git checkout -b "$1" "$from" if [ -f "$BASEDIR/.config" ] || [ -d "$BASEDIR/files" ]; then if ask_bool 1 "Do you want to start your configuration repository with the current configuration?"; then - if [ -d "$BASEDIR/files" ] && [ \! -L "$BASEDIR/files" ]; then + if [ -d "$BASEDIR/files" ] && [ ! -L "$BASEDIR/files" ]; then mkdir -p "$ENVDIR/files" shopt -s dotglob mv "$BASEDIR/files/"* "$ENVDIR/files/" 2>/dev/null From f80a540dbf9bf87e15f0f29da7f4019064ee207d Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 5 Jan 2020 18:32:37 -0800 Subject: [PATCH 44/70] scripts/env: exit in case of failure to cd Found with shellcheck. Signed-off-by: Rosen Penev --- scripts/env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/env b/scripts/env index 19cfa13841..848850a778 100755 --- a/scripts/env +++ b/scripts/env @@ -147,7 +147,7 @@ env_clear() { else rm -rf "$BASEDIR/files" "$BASEDIR/.config" fi - cd "$BASEDIR" + cd "$BASEDIR" || exit 1 rm -rf "$ENVDIR" } From 5b7cace9e3f553ca54e1e0ec5f7651b7d7a2052d Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 5 Jan 2020 18:32:38 -0800 Subject: [PATCH 45/70] scripts/env: use read -r instead of read read mangles backslashes. Found with shellcheck. Signed-off-by: Rosen Penev --- scripts/env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/env b/scripts/env index 848850a778..c81fbf8ddc 100755 --- a/scripts/env +++ b/scripts/env @@ -42,7 +42,7 @@ ask_bool() { local VAL echo -n "$* ($defstr): " - read VAL + read -r VAL case "$VAL" in y*|Y*) val=0;; n*|N*) val=1;; From 227e47b3ca964939f41c3564dd7da72d60044d00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Sat, 11 Jul 2020 13:20:34 +0200 Subject: [PATCH 46/70] scripts/env: fix remaining shellcheck warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes following shellcheck warning: In scripts/env line 25: exit ${1:-1} ^-----^ SC2086: Double quote to prevent globbing and word splitting. Signed-off-by: Petr Štetiar --- scripts/env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/env b/scripts/env index c81fbf8ddc..726a354b57 100755 --- a/scripts/env +++ b/scripts/env @@ -22,7 +22,7 @@ Commands: Options: EOF - exit ${1:-1} + exit "${1:-1}" } error() { From 3819337cdf8c0c8f0807c000b01ac0c2f13c02c7 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 5 Jan 2020 18:22:54 -0800 Subject: [PATCH 47/70] scripts/gen_image_generic.sh: replace -o with if/&& -o is not well defined. Found with shellcheck. Signed-off-by: Rosen Penev --- scripts/gen_image_generic.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/gen_image_generic.sh b/scripts/gen_image_generic.sh index 53f73dc6e1..8091d95575 100755 --- a/scripts/gen_image_generic.sh +++ b/scripts/gen_image_generic.sh @@ -1,10 +1,10 @@ #!/usr/bin/env bash # Copyright (C) 2006-2012 OpenWrt.org set -e -x -[ $# == 5 -o $# == 6 ] || { +if [ $# -ne 5 ] && [ $# -ne 6 ]; then echo "SYNTAX: $0 []" exit 1 -} +fi OUTPUT="$1" KERNELSIZE="$2" From aee169b06d72c1a1f42be4809e8e6c8368ca2532 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 5 Jan 2020 18:22:55 -0800 Subject: [PATCH 48/70] scripts/gen_image_generic.sh: use /bin/sh This has nothing bash specific. Signed-off-by: Rosen Penev --- scripts/gen_image_generic.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/gen_image_generic.sh b/scripts/gen_image_generic.sh index 8091d95575..9d05b6254e 100755 --- a/scripts/gen_image_generic.sh +++ b/scripts/gen_image_generic.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/sh # Copyright (C) 2006-2012 OpenWrt.org set -e -x if [ $# -ne 5 ] && [ $# -ne 6 ]; then From 92d7cedcad73ff9845ea3f635ea82bd925078c1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Sat, 11 Jul 2020 13:24:17 +0200 Subject: [PATCH 49/70] scripts/gen_image_generic.sh: fix more shellcheck warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes following shellcheck warnings: In scripts/gen_image_generic.sh line 20: cyl=$(( (KERNELSIZE + ROOTFSSIZE) * 1024 * 1024 / (head * sect * 512))) ^-^ SC2034: cyl appears unused. Verify use (or export if used externally). -- In scripts/gen_image_generic.sh line 34: [ -n "$PADDING" ] && dd if=/dev/zero of="$OUTPUT" bs=512 seek="$(($ROOTFSOFFSET + $ROOTFSSIZE))" conv=notrunc count="$sect" ^-----------^ SC2004: $/${} is unnecessary on arithmetic variables. -- In scripts/gen_image_generic.sh line 35: mkfs.fat -n kernel -C "$OUTPUT.kernel" -S 512 "$(($KERNELSIZE / 1024))" ^---------^ SC2004: $/${} is unnecessary on arithmetic variables. Signed-off-by: Petr Štetiar --- scripts/gen_image_generic.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/gen_image_generic.sh b/scripts/gen_image_generic.sh index 9d05b6254e..17888eac60 100755 --- a/scripts/gen_image_generic.sh +++ b/scripts/gen_image_generic.sh @@ -17,10 +17,9 @@ rm -f "$OUTPUT" head=16 sect=63 -cyl=$(( (KERNELSIZE + ROOTFSSIZE) * 1024 * 1024 / (head * sect * 512))) # create partition table -set $(ptgen -o "$OUTPUT" -h $head -s $sect ${GUID:+-g} -p ${KERNELSIZE}m -p ${ROOTFSSIZE}m ${ALIGN:+-l $ALIGN} ${SIGNATURE:+-S 0x$SIGNATURE} ${GUID:+-G $GUID}) +set $(ptgen -o "$OUTPUT" -h $head -s $sect ${GUID:+-g} -p "${KERNELSIZE}m" -p "${ROOTFSSIZE}m" ${ALIGN:+-l $ALIGN} ${SIGNATURE:+-S 0x$SIGNATURE} ${GUID:+-G $GUID}) KERNELOFFSET="$(($1 / 512))" KERNELSIZE="$2" @@ -31,8 +30,8 @@ ROOTFSSIZE="$(($4 / 512))" dd if="$ROOTFSIMAGE" of="$OUTPUT" bs=512 seek="$ROOTFSOFFSET" conv=notrunc if [ -n "$GUID" ]; then - [ -n "$PADDING" ] && dd if=/dev/zero of="$OUTPUT" bs=512 seek="$(($ROOTFSOFFSET + $ROOTFSSIZE))" conv=notrunc count="$sect" - mkfs.fat -n kernel -C "$OUTPUT.kernel" -S 512 "$(($KERNELSIZE / 1024))" + [ -n "$PADDING" ] && dd if=/dev/zero of="$OUTPUT" bs=512 seek="$((ROOTFSOFFSET + ROOTFSSIZE))" conv=notrunc count="$sect" + mkfs.fat -n kernel -C "$OUTPUT.kernel" -S 512 "$((KERNELSIZE / 1024))" mcopy -s -i "$OUTPUT.kernel" "$KERNELDIR"/* ::/ else make_ext4fs -J -L kernel -l "$KERNELSIZE" "$OUTPUT.kernel" "$KERNELDIR" From 907053193a1c64306247cc43b8677ce765933ca2 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 5 Jan 2020 18:31:17 -0800 Subject: [PATCH 50/70] scripts/mkits.sh: replace echo -e with printf echo flags are not POSIX. printf does the same with added \n. Signed-off-by: Rosen Penev --- scripts/mkits.sh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/scripts/mkits.sh b/scripts/mkits.sh index 32a978e18d..def3d3c7c2 100755 --- a/scripts/mkits.sh +++ b/scripts/mkits.sh @@ -15,18 +15,18 @@ # usage() { - echo "Usage: $(basename $0) -A arch -C comp -a addr -e entry" \ - "-v version -k kernel [-D name -d dtb] -o its_file" - echo -e "\t-A ==> set architecture to 'arch'" - echo -e "\t-C ==> set compression type 'comp'" - echo -e "\t-c ==> set config name 'config'" - echo -e "\t-a ==> set load address to 'addr' (hex)" - echo -e "\t-e ==> set entry point to 'entry' (hex)" - echo -e "\t-v ==> set kernel version to 'version'" - echo -e "\t-k ==> include kernel image 'kernel'" - echo -e "\t-D ==> human friendly Device Tree Blob 'name'" - echo -e "\t-d ==> include Device Tree Blob 'dtb'" - echo -e "\t-o ==> create output file 'its_file'" + printf "Usage: %s -A arch -C comp -a addr -e entry -v version"\ + "-k kernel [-D name -d dtb] -o its_file" "$(basename $0)" + printf "\n\t-A ==> set architecture to 'arch'" + printf "\n\t-C ==> set compression type 'comp'" + printf "\n\t-c ==> set config name 'config'" + printf "\n\t-a ==> set load address to 'addr' (hex)" + printf "\n\t-e ==> set entry point to 'entry' (hex)" + printf "\n\t-v ==> set kernel version to 'version'" + printf "\n\t-k ==> include kernel image 'kernel'" + printf "\n\t-D ==> human friendly Device Tree Blob 'name'" + printf "\n\t-d ==> include Device Tree Blob 'dtb'" + printf "\n\t-o ==> create output file 'its_file'\n" exit 1 } From 765858f7ad77d1c88ad2b0f6f01839db105a1e36 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 5 Jan 2020 18:31:18 -0800 Subject: [PATCH 51/70] scripts/mkits.sh: add missing quotes Found with shellcheck. Signed-off-by: Rosen Penev --- scripts/mkits.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/mkits.sh b/scripts/mkits.sh index def3d3c7c2..53b9ec5f20 100755 --- a/scripts/mkits.sh +++ b/scripts/mkits.sh @@ -55,7 +55,7 @@ if [ -z "${ARCH}" ] || [ -z "${COMPRESS}" ] || [ -z "${LOAD_ADDR}" ] || \ usage fi -ARCH_UPPER=$(echo $ARCH | tr '[:lower:]' '[:upper:]') +ARCH_UPPER=$(echo "$ARCH" | tr '[:lower:]' '[:upper:]') # Conditionally create fdt information if [ -n "${DTB}" ]; then @@ -115,4 +115,4 @@ ${FDT_NODE} };" # Write .its file to disk -echo "$DATA" > ${OUTPUT} +echo "$DATA" > "${OUTPUT}" From 7aefc85cab8c924565ae002481f0f43164e1d3d1 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 5 Jan 2020 18:31:19 -0800 Subject: [PATCH 52/70] scripts/mkits.sh: fix improper string and array concatenation Found with shellcheck. Signed-off-by: Rosen Penev --- scripts/mkits.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/mkits.sh b/scripts/mkits.sh index 53b9ec5f20..c09e537dbd 100755 --- a/scripts/mkits.sh +++ b/scripts/mkits.sh @@ -43,7 +43,7 @@ do k ) KERNEL=$OPTARG;; o ) OUTPUT=$OPTARG;; v ) VERSION=$OPTARG;; - * ) echo "Invalid option passed to '$0' (options:$@)" + * ) echo "Invalid option passed to '$0' (options:$*)" usage;; esac done From 3d418dd51ed217317fd5c4815cd1919ba1875dfb Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 5 Jan 2020 18:31:20 -0800 Subject: [PATCH 53/70] scripts/mkits.sh: switch from bash to sh This no longer needs bash. Signed-off-by: Rosen Penev --- scripts/mkits.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/mkits.sh b/scripts/mkits.sh index c09e537dbd..62cfc21c6b 100755 --- a/scripts/mkits.sh +++ b/scripts/mkits.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/sh # # Licensed under the terms of the GNU GPL License version 2 or later. # From dec9ae6d9e8352498b19287b6361c83701308662 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Sat, 11 Jul 2020 13:31:35 +0200 Subject: [PATCH 54/70] scripts/mkits.sh: fix remaining shellcheck warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes following shellcheck warning: In scripts/mkits.sh line 19: "-k kernel [-D name -d dtb] -o its_file" "$(basename $0)" ^-- SC2086: Double quote to prevent globbing and word splitting. Signed-off-by: Petr Štetiar --- scripts/mkits.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/mkits.sh b/scripts/mkits.sh index 62cfc21c6b..65071e13ee 100755 --- a/scripts/mkits.sh +++ b/scripts/mkits.sh @@ -16,7 +16,7 @@ usage() { printf "Usage: %s -A arch -C comp -a addr -e entry -v version"\ - "-k kernel [-D name -d dtb] -o its_file" "$(basename $0)" + "-k kernel [-D name -d dtb] -o its_file" "$(basename "$0")" printf "\n\t-A ==> set architecture to 'arch'" printf "\n\t-C ==> set compression type 'comp'" printf "\n\t-c ==> set config name 'config'" From 8e6f2c029f72d79d263290a415dc8063307a9a42 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Fri, 17 Jan 2020 14:38:19 -0800 Subject: [PATCH 55/70] base-files/functions.sh: use command -v instead of which which must be executed. command -v is a shell builtin. https://github.com/koalaman/shellcheck/wiki/SC2230 Signed-off-by: Rosen Penev --- package/base-files/files/lib/functions.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh index a77b669709..323e057451 100755 --- a/package/base-files/files/lib/functions.sh +++ b/package/base-files/files/lib/functions.sh @@ -176,7 +176,7 @@ default_prerm() { ret=$? fi - local shell="$(which bash)" + local shell="$(command -v bash)" for i in $(grep -s "^/etc/init.d/" "$root/usr/lib/opkg/info/${pkgname}.list"); do if [ -n "$root" ]; then ${shell:-/bin/sh} "$root/etc/rc.common" "$root$i" disable @@ -264,7 +264,7 @@ default_postinst() { rm -f /tmp/luci-indexcache fi - local shell="$(which bash)" + local shell="$(command -v bash)" for i in $(grep -s "^/etc/init.d/" "$root$filelist"); do if [ -n "$root" ]; then ${shell:-/bin/sh} "$root/etc/rc.common" "$root$i" enable From eb24a57b7ff84242bfb717ce947f9d3e1c0518ee Mon Sep 17 00:00:00 2001 From: Rui Salvaterra Date: Tue, 7 Jul 2020 14:16:47 +0100 Subject: [PATCH 56/70] busybox: store applet usage messages uncompressed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The rootfs squashfs is already highly (XZ) compressed. Storing the applet messages in compressed form will increase the entropy and reduce the overall image compression ratio. Size diffs (compressed vs uncompressed): busybox (the executable): 364596 vs 384804 bytes. OpenWrt target images (the kernel image is unchanged, obviously): omnia-medkit-openwrt-mvebu-cortexa9-cznic_turris-omnia-initramfs.tar.gz: 9163597 vs 9162531 bytes (1066 bytes difference). openwrt-mvebu-cortexa9-cznic_turris-omnia-initramfs-kernel.bin: 9161688 vs 9160600 bytes (1088 bytes difference). openwrt-mvebu-cortexa9-cznic_turris-omnia-sysupgrade.img.gz: 9729550 vs 9729230 bytes (320 bytes difference). All in all, we save just a little bit over 1 kiB. As an added bonus, we also don't have to decompress the messages twice, (first from squashfs, then from the bzip2 message storage). Signed-off-by: Rui Salvaterra [added additional size comparision diff detaisl] Signed-off-by: Petr Štetiar --- package/utils/busybox/Config-defaults.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/utils/busybox/Config-defaults.in b/package/utils/busybox/Config-defaults.in index 89da7ace8d..29724041f4 100644 --- a/package/utils/busybox/Config-defaults.in +++ b/package/utils/busybox/Config-defaults.in @@ -24,7 +24,7 @@ config BUSYBOX_DEFAULT_FEATURE_VERBOSE_USAGE default y config BUSYBOX_DEFAULT_FEATURE_COMPRESS_USAGE bool - default y + default n config BUSYBOX_DEFAULT_LFS bool default y From 5ca89036316b15781ed476dc4a7195b791594bce Mon Sep 17 00:00:00 2001 From: Yangbo Lu Date: Wed, 27 May 2020 11:10:19 +0800 Subject: [PATCH 57/70] layerscape: convert to squashfs rootfs for QSPI NOR boot There had been an issue in Layerscape QSPI driver for very long time, which made squashfs,jffs2 rootfs not work on QSPI NOR. And the ubifs had been used as a workaround. Now the issue has been fixed. So convert to use squashfs,jffs2 rootfs on QSPI NOR for Layerscape boards (LS1012ARDB/LS1046ARDB/ LS1088ARDB), and update u-boot bootargs for booting. Signed-off-by: Yangbo Lu --- .../files/ls1012ardb-uEnv.txt | 2 +- .../files/ls1046ardb-uEnv.txt | 2 +- .../files/ls1088ardb-uEnv.txt | 2 +- target/linux/layerscape/image/armv8_64b.mk | 22 +++++-------------- 4 files changed, 8 insertions(+), 20 deletions(-) diff --git a/package/boot/uboot-layerscape/files/ls1012ardb-uEnv.txt b/package/boot/uboot-layerscape/files/ls1012ardb-uEnv.txt index 99e61ff119..5acd5406ce 100644 --- a/package/boot/uboot-layerscape/files/ls1012ardb-uEnv.txt +++ b/package/boot/uboot-layerscape/files/ls1012ardb-uEnv.txt @@ -3,6 +3,6 @@ loadaddr=0x81000000 fdt_high=0xffffffffffffffff initrd_high=0xffffffffffffffff qspi_boot=sf probe 0:0;sf read $fdtaddr f00000 100000;sf read $loadaddr 1000000 1000000;bootm $loadaddr - $fdtaddr -bootargs=ubi.mtd=8 root=ubi0:rootfs rw rootfstype=ubifs noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=1550000.spi:1m(bl2),4m(fip),1m(u-boot-env),4m(reserved-1),3m(pfe),2m(reserved-2),1m(dtb),16m(kernel),32m(ubifs) +bootargs=root=/dev/mtdblock8 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=1550000.spi:1m(bl2),4m(fip),1m(u-boot-env),4m(reserved-1),3m(pfe),2m(reserved-2),1m(dtb),16m(kernel),32m(rootfs) bootcmd=echo starting openwrt ...;pfe stop;run qspi_boot bootdelay=3 diff --git a/package/boot/uboot-layerscape/files/ls1046ardb-uEnv.txt b/package/boot/uboot-layerscape/files/ls1046ardb-uEnv.txt index 7bc7e2c972..89acac2a82 100644 --- a/package/boot/uboot-layerscape/files/ls1046ardb-uEnv.txt +++ b/package/boot/uboot-layerscape/files/ls1046ardb-uEnv.txt @@ -4,6 +4,6 @@ fdt_high=0xffffffffffffffff initrd_high=0xffffffffffffffff hwconfig=fsl_ddr:bank_intlv=auto qspi_boot=sf probe 0:0;sf read $fdtaddr f00000 100000;sf read $loadaddr 1000000 1000000;bootm $loadaddr - $fdtaddr -bootargs=ubi.mtd=9 root=ubi0:rootfs rw rootfstype=ubifs noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=1550000.spi-0:1m(bl2),4m(fip),1m(u-boot-env),3m(reserved-1),256k(fman),5888k(reserved-2),1m(dtb),16m(kernel),32m(ubifs) +bootargs=root=/dev/mtdblock9 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=1550000.spi-0:1m(bl2),4m(fip),1m(u-boot-env),3m(reserved-1),256k(fman),5888k(reserved-2),1m(dtb),16m(kernel),32m(rootfs) bootcmd=echo starting openwrt ...;run qspi_boot bootdelay=3 diff --git a/package/boot/uboot-layerscape/files/ls1088ardb-uEnv.txt b/package/boot/uboot-layerscape/files/ls1088ardb-uEnv.txt index 89004d2475..78556f3165 100644 --- a/package/boot/uboot-layerscape/files/ls1088ardb-uEnv.txt +++ b/package/boot/uboot-layerscape/files/ls1088ardb-uEnv.txt @@ -5,6 +5,6 @@ initrd_high=0xffffffffffffffff hwconfig=fsl_ddr:bank_intlv=auto mc_init=sf probe 0:0;sf read 80000000 a00000 300000;sf read 80300000 e00000 100000;fsl_mc start mc 80000000 80300000;sf read 80400000 d00000 100000;fsl_mc apply dpl 80400000 qspi_boot=sf probe 0:0;sf read $fdtaddr f00000 100000;sf read $loadaddr 1000000 1000000;bootm $loadaddr - $fdtaddr -bootargs=ubi.mtd=10 root=ubi0:rootfs rw rootfstype=ubifs noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=20c0000.spi-0:1m(bl2),4m(fip),1m(u-boot-env),4m(reserved-1),3m(mc),1m(dpl),1m(dpc),1m(dtb),16m(kernel),32m(ubifs) +bootargs=root=/dev/mtdblock10 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=20c0000.spi-0:1m(bl2),4m(fip),1m(u-boot-env),4m(reserved-1),3m(mc),1m(dpl),1m(dpc),1m(dtb),16m(kernel),32m(rootfs) bootcmd=echo starting openwrt ...;run mc_init;run qspi_boot bootdelay=3 diff --git a/target/linux/layerscape/image/armv8_64b.mk b/target/linux/layerscape/image/armv8_64b.mk index ffc8346d24..3ad831b0b1 100644 --- a/target/linux/layerscape/image/armv8_64b.mk +++ b/target/linux/layerscape/image/armv8_64b.mk @@ -8,8 +8,7 @@ define Device/Default PROFILES := Default IMAGES := firmware.bin - FILESYSTEMS := ubifs - MKUBIFS_OPTS := -m 1 -e 262016 -c 128 + FILESYSTEMS := squashfs KERNEL := kernel-bin | gzip | uImage gzip KERNEL_LOADADDR := 0x80080000 KERNEL_ENTRY_POINT := 0x80080000 @@ -24,7 +23,6 @@ define Device/ls1012afrdm kmod-ppfe DEVICE_DTS := freescale/fsl-ls1012a-frdm BLOCKSIZE := 256KiB - FILESYSTEMS := squashfs IMAGES += sysupgrade.bin IMAGE/firmware.bin := \ ls-clean | \ @@ -51,9 +49,6 @@ define Device/ls1012ardb tfa-ls1012ardb \ kmod-ppfe DEVICE_DTS := freescale/fsl-ls1012a-rdb - UBINIZE_OPTS := -E 5 - BLOCKSIZE := 256KiB - PAGESIZE := 1 IMAGE/firmware.bin := \ ls-clean | \ ls-append $(1)-bl2.pbl | pad-to 1M | \ @@ -62,7 +57,7 @@ define Device/ls1012ardb ls-append pfe.itb | pad-to 15M | \ ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to 32M | \ - append-ubi | check-size 67108865 + append-rootfs | pad-rootfs | check-size 67108865 endef TARGET_DEVICES += ls1012ardb @@ -101,7 +96,6 @@ define Device/ls1043ardb tfa-ls1043ardb \ fmc fmc-eth-config DEVICE_DTS := freescale/fsl-ls1043a-rdb-sdk - FILESYSTEMS := squashfs IMAGE/firmware.bin := \ ls-clean | \ ls-append $(1)-bl2.pbl | pad-to 1M | \ @@ -147,9 +141,6 @@ define Device/ls1046ardb tfa-ls1046ardb \ fmc fmc-eth-config DEVICE_DTS := freescale/fsl-ls1046a-rdb-sdk - UBINIZE_OPTS := -E 5 - BLOCKSIZE := 256KiB - PAGESIZE := 1 IMAGE/firmware.bin := \ ls-clean | \ ls-append $(1)-bl2.pbl | pad-to 1M | \ @@ -158,7 +149,7 @@ define Device/ls1046ardb ls-append $(1)-fman.bin | pad-to 15M | \ ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to 32M | \ - append-ubi | check-size 67108865 + append-rootfs | pad-rootfs | check-size 67108865 endef TARGET_DEVICES += ls1046ardb @@ -196,9 +187,6 @@ define Device/ls1088ardb tfa-ls1088ardb \ restool DEVICE_DTS := freescale/fsl-ls1088a-rdb - UBINIZE_OPTS := -E 5 - BLOCKSIZE := 256KiB - PAGESIZE := 1 IMAGE/firmware.bin := \ ls-clean | \ ls-append $(1)-bl2.pbl | pad-to 1M | \ @@ -209,7 +197,7 @@ define Device/ls1088ardb ls-append $(1)-dpc.dtb | pad-to 15M | \ ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to 32M | \ - append-ubi | check-size 67108865 + append-rootfs | pad-rootfs | check-size 67108865 endef TARGET_DEVICES += ls1088ardb @@ -249,7 +237,6 @@ define Device/ls2088ardb tfa-ls2088ardb \ restool DEVICE_DTS := freescale/fsl-ls2088a-rdb - FILESYSTEMS := squashfs IMAGE/firmware.bin := \ ls-clean | \ ls-append $(1)-bl2.pbl | pad-to 1M | \ @@ -272,6 +259,7 @@ define Device/traverse-ls1043 KERNEL_INSTALL := 1 FDT_LOADADDR = 0x90000000 FILESYSTEMS := ubifs + MKUBIFS_OPTS := -m 1 -e 262016 -c 128 DEVICE_PACKAGES += \ layerscape-fman \ uboot-envtools \ From 3a3b9ded50d25444b9acae6e0a2099db93232c11 Mon Sep 17 00:00:00 2001 From: Yangbo Lu Date: Thu, 28 May 2020 12:06:20 +0800 Subject: [PATCH 58/70] layerscape: add compatible for board ls1043ardb Backport a dts patch which added compatible for ls1043ardb. Signed-off-by: Yangbo Lu --- ...ls1043a-rdb-add-compatible-for-board.patch | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 target/linux/layerscape/patches-5.4/302-v5.7-dts-0119-arm64-dts-ls1043a-rdb-add-compatible-for-board.patch diff --git a/target/linux/layerscape/patches-5.4/302-v5.7-dts-0119-arm64-dts-ls1043a-rdb-add-compatible-for-board.patch b/target/linux/layerscape/patches-5.4/302-v5.7-dts-0119-arm64-dts-ls1043a-rdb-add-compatible-for-board.patch new file mode 100644 index 0000000000..3de20a1f3d --- /dev/null +++ b/target/linux/layerscape/patches-5.4/302-v5.7-dts-0119-arm64-dts-ls1043a-rdb-add-compatible-for-board.patch @@ -0,0 +1,28 @@ +From fa578d4e9fbef8928a45edd904dafb1e3334417e Mon Sep 17 00:00:00 2001 +From: Yangbo Lu +Date: Thu, 30 Apr 2020 10:56:46 +0800 +Subject: [PATCH] arm64: dts: ls1043a-rdb: add compatible for board + +Add compatible for board to identify. + +Signed-off-by: Yangbo Lu +Signed-off-by: Shawn Guo +--- + arch/arm64/boot/dts/freescale/fsl-ls1043a-rdb.dts | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1043a-rdb.dts b/arch/arm64/boot/dts/freescale/fsl-ls1043a-rdb.dts +index dde50c8..9a93e9a 100644 +--- a/arch/arm64/boot/dts/freescale/fsl-ls1043a-rdb.dts ++++ b/arch/arm64/boot/dts/freescale/fsl-ls1043a-rdb.dts +@@ -13,6 +13,7 @@ + + / { + model = "LS1043A RDB Board"; ++ compatible = "fsl,ls1043a-rdb", "fsl,ls1043a"; + + aliases { + serial0 = &duart0; +-- +2.7.4 + From 3a99b624d87b32a95210ae58bd782a144ba12fc2 Mon Sep 17 00:00:00 2001 From: Yangbo Lu Date: Thu, 28 May 2020 13:50:42 +0800 Subject: [PATCH 59/70] layerscape: fix board name for SD card boot Many Layerscape boards support both flash boot and SD card boot. And different firmware and sysupgrade.bin are built for the two boot methods. To identify them, a fix could be done on board name by adding a postfix "-sdboot" for SD card boot. Signed-off-by: Yangbo Lu --- .../base-files/lib/preinit/02_sysinfo_fixup | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 target/linux/layerscape/base-files/lib/preinit/02_sysinfo_fixup diff --git a/target/linux/layerscape/base-files/lib/preinit/02_sysinfo_fixup b/target/linux/layerscape/base-files/lib/preinit/02_sysinfo_fixup new file mode 100644 index 0000000000..1bbd8efbc6 --- /dev/null +++ b/target/linux/layerscape/base-files/lib/preinit/02_sysinfo_fixup @@ -0,0 +1,13 @@ +do_sysinfo_layerscape_fixup() { + [ -e /tmp/sysinfo/board_name ] || return + [ -e /proc/cmdline ] || return + cmdline=$(strings /proc/cmdline) + case "${cmdline}" in + *root=/dev/mmcblk*) + board="$(strings /tmp/sysinfo/board_name)-sdboot" + echo ${board} > /tmp/sysinfo/board_name + ;; + esac +} + +boot_hook_add preinit_main do_sysinfo_layerscape_fixup From c4d0e57e160e9d5c9ada8c99e385cdd5f742e79e Mon Sep 17 00:00:00 2001 From: Yangbo Lu Date: Thu, 28 May 2020 12:48:29 +0800 Subject: [PATCH 60/70] layerscape: support sysupgrade for squashfs rootfs Support sysupgrade for all Layerscape boards with squashfs rootfs. Signed-off-by: Yangbo Lu --- .../uboot-layerscape/files/ls1012ardb-uEnv.txt | 2 +- .../uboot-layerscape/files/ls1021atwr-uEnv.txt | 2 +- .../uboot-layerscape/files/ls1043ardb-uEnv.txt | 2 +- .../uboot-layerscape/files/ls1046ardb-uEnv.txt | 2 +- .../uboot-layerscape/files/ls1088ardb-uEnv.txt | 2 +- .../uboot-layerscape/files/ls2088ardb-uEnv.txt | 2 +- .../base-files/lib/upgrade/platform.sh | 17 +++++++++++++++-- target/linux/layerscape/image/armv7.mk | 7 +++++-- target/linux/layerscape/image/armv8_64b.mk | 12 +++++++++--- 9 files changed, 35 insertions(+), 13 deletions(-) diff --git a/package/boot/uboot-layerscape/files/ls1012ardb-uEnv.txt b/package/boot/uboot-layerscape/files/ls1012ardb-uEnv.txt index 5acd5406ce..f109a98b85 100644 --- a/package/boot/uboot-layerscape/files/ls1012ardb-uEnv.txt +++ b/package/boot/uboot-layerscape/files/ls1012ardb-uEnv.txt @@ -3,6 +3,6 @@ loadaddr=0x81000000 fdt_high=0xffffffffffffffff initrd_high=0xffffffffffffffff qspi_boot=sf probe 0:0;sf read $fdtaddr f00000 100000;sf read $loadaddr 1000000 1000000;bootm $loadaddr - $fdtaddr -bootargs=root=/dev/mtdblock8 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=1550000.spi:1m(bl2),4m(fip),1m(u-boot-env),4m(reserved-1),3m(pfe),2m(reserved-2),1m(dtb),16m(kernel),32m(rootfs) +bootargs=root=/dev/mtdblock8 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=1550000.spi:1m(bl2),4m(fip),1m(u-boot-env),4m(reserved-1),3m(pfe),2m(reserved-2),1m(dtb),16m(kernel),32m(rootfs),48m@0x1000000(firmware) bootcmd=echo starting openwrt ...;pfe stop;run qspi_boot bootdelay=3 diff --git a/package/boot/uboot-layerscape/files/ls1021atwr-uEnv.txt b/package/boot/uboot-layerscape/files/ls1021atwr-uEnv.txt index 387cfeb9ff..d6c5f56fd9 100644 --- a/package/boot/uboot-layerscape/files/ls1021atwr-uEnv.txt +++ b/package/boot/uboot-layerscape/files/ls1021atwr-uEnv.txt @@ -3,6 +3,6 @@ loadaddr=0x81000000 fdt_high=0xffffffff initrd_high=0xffffffff nor_boot=cp.b 60f00000 $fdtaddr 100000;cp.b 61000000 $loadaddr 1000000;bootm $loadaddr - $fdtaddr -bootargs=root=/dev/mtdblock6 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=60000000.nor:1m(rcw),2m(u-boot),1m(u-boot-env),11m(reserved-1),1m(dtb),16m(kernel),32m(rootfs) cma=64M@0x0-0xb0000000 +bootargs=root=/dev/mtdblock6 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=60000000.nor:1m(rcw),2m(u-boot),1m(u-boot-env),11m(reserved-1),1m(dtb),16m(kernel),32m(rootfs),48m@0x1000000(firmware) cma=64M@0x0-0xb0000000 bootcmd=echo starting openwrt ...;run nor_boot bootdelay=3 diff --git a/package/boot/uboot-layerscape/files/ls1043ardb-uEnv.txt b/package/boot/uboot-layerscape/files/ls1043ardb-uEnv.txt index b040cffdbf..1214bf40c2 100644 --- a/package/boot/uboot-layerscape/files/ls1043ardb-uEnv.txt +++ b/package/boot/uboot-layerscape/files/ls1043ardb-uEnv.txt @@ -4,6 +4,6 @@ fdt_high=0xffffffffffffffff initrd_high=0xffffffffffffffff hwconfig=fsl_ddr:bank_intlv=auto nor_boot=cp.b 60f00000 $fdtaddr 100000;cp.b 61000000 $loadaddr 1000000;bootm $loadaddr - $fdtaddr -bootargs=root=/dev/mtdblock8 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=60000000.nor:1m(bl2),4m(fip),1m(u-boot-env),3m(reserved-1),256k(fman),5888k(reserved-2),1m(dtb),16m(kernel),32m(rootfs) +bootargs=root=/dev/mtdblock8 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=60000000.nor:1m(bl2),4m(fip),1m(u-boot-env),3m(reserved-1),256k(fman),5888k(reserved-2),1m(dtb),16m(kernel),32m(rootfs),48m@0x1000000(firmware) bootcmd=echo starting openwrt ...;run nor_boot bootdelay=3 diff --git a/package/boot/uboot-layerscape/files/ls1046ardb-uEnv.txt b/package/boot/uboot-layerscape/files/ls1046ardb-uEnv.txt index 89acac2a82..975b1c1e7f 100644 --- a/package/boot/uboot-layerscape/files/ls1046ardb-uEnv.txt +++ b/package/boot/uboot-layerscape/files/ls1046ardb-uEnv.txt @@ -4,6 +4,6 @@ fdt_high=0xffffffffffffffff initrd_high=0xffffffffffffffff hwconfig=fsl_ddr:bank_intlv=auto qspi_boot=sf probe 0:0;sf read $fdtaddr f00000 100000;sf read $loadaddr 1000000 1000000;bootm $loadaddr - $fdtaddr -bootargs=root=/dev/mtdblock9 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=1550000.spi-0:1m(bl2),4m(fip),1m(u-boot-env),3m(reserved-1),256k(fman),5888k(reserved-2),1m(dtb),16m(kernel),32m(rootfs) +bootargs=root=/dev/mtdblock9 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=1550000.spi-0:1m(bl2),4m(fip),1m(u-boot-env),3m(reserved-1),256k(fman),5888k(reserved-2),1m(dtb),16m(kernel),32m(rootfs),48m@0x1000000(firmware) bootcmd=echo starting openwrt ...;run qspi_boot bootdelay=3 diff --git a/package/boot/uboot-layerscape/files/ls1088ardb-uEnv.txt b/package/boot/uboot-layerscape/files/ls1088ardb-uEnv.txt index 78556f3165..7ab5550405 100644 --- a/package/boot/uboot-layerscape/files/ls1088ardb-uEnv.txt +++ b/package/boot/uboot-layerscape/files/ls1088ardb-uEnv.txt @@ -5,6 +5,6 @@ initrd_high=0xffffffffffffffff hwconfig=fsl_ddr:bank_intlv=auto mc_init=sf probe 0:0;sf read 80000000 a00000 300000;sf read 80300000 e00000 100000;fsl_mc start mc 80000000 80300000;sf read 80400000 d00000 100000;fsl_mc apply dpl 80400000 qspi_boot=sf probe 0:0;sf read $fdtaddr f00000 100000;sf read $loadaddr 1000000 1000000;bootm $loadaddr - $fdtaddr -bootargs=root=/dev/mtdblock10 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=20c0000.spi-0:1m(bl2),4m(fip),1m(u-boot-env),4m(reserved-1),3m(mc),1m(dpl),1m(dpc),1m(dtb),16m(kernel),32m(rootfs) +bootargs=root=/dev/mtdblock10 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=20c0000.spi-0:1m(bl2),4m(fip),1m(u-boot-env),4m(reserved-1),3m(mc),1m(dpl),1m(dpc),1m(dtb),16m(kernel),32m(rootfs),48m@0x1000000(firmware) bootcmd=echo starting openwrt ...;run mc_init;run qspi_boot bootdelay=3 diff --git a/package/boot/uboot-layerscape/files/ls2088ardb-uEnv.txt b/package/boot/uboot-layerscape/files/ls2088ardb-uEnv.txt index 31e937ffcb..fe2febd2ce 100644 --- a/package/boot/uboot-layerscape/files/ls2088ardb-uEnv.txt +++ b/package/boot/uboot-layerscape/files/ls2088ardb-uEnv.txt @@ -5,6 +5,6 @@ initrd_high=0xffffffffffffffff hwconfig=fsl_ddr:bank_intlv=auto mc_init=fsl_mc start mc 580a00000 580e00000;fsl_mc apply dpl 580d00000 nor_boot=cp.b 580f00000 $fdtaddr 100000;cp.b 581000000 $loadaddr 1000000;bootm $loadaddr - $fdtaddr -bootargs=root=/dev/mtdblock9 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS1,115200 mtdparts=580000000.nor:1m(bl2),4m(fip),1m(u-boot-env),4m(reserved-1),3m(mc),1m(dpl),1m(dpc),1m(dtb),16m(kernel),32m(rootfs) +bootargs=root=/dev/mtdblock9 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS1,115200 mtdparts=580000000.nor:1m(bl2),4m(fip),1m(u-boot-env),4m(reserved-1),3m(mc),1m(dpl),1m(dpc),1m(dtb),16m(kernel),32m(rootfs),48m@0x1000000(firmware) bootcmd=echo starting openwrt ...;run mc_init;run nor_boot bootdelay=3 diff --git a/target/linux/layerscape/base-files/lib/upgrade/platform.sh b/target/linux/layerscape/base-files/lib/upgrade/platform.sh index 1e1e28987b..9b8c07138f 100644 --- a/target/linux/layerscape/base-files/lib/upgrade/platform.sh +++ b/target/linux/layerscape/base-files/lib/upgrade/platform.sh @@ -1,5 +1,6 @@ # # Copyright 2015-2019 Traverse Technologies +# Copyright 2020 NXP # RAMFS_COPY_BIN="/usr/sbin/fw_printenv /usr/sbin/fw_setenv /usr/sbin/ubinfo /bin/echo" @@ -33,7 +34,13 @@ platform_check_image() { nand_do_platform_check "traverse-ls1043" $1 return $? ;; - fsl,ls1012a-frdm) + fsl,ls1012a-frdm | \ + fsl,ls1012a-rdb | \ + fsl,ls1021a-twr | \ + fsl,ls1043a-rdb | \ + fsl,ls1046a-rdb | \ + fsl,ls1088a-rdb | \ + fsl,ls2088a-rdb) return 0 ;; *) @@ -55,7 +62,13 @@ platform_do_upgrade() { traverse,ls1043s) platform_do_upgrade_traverse_nandubi "$1" ;; - fsl,ls1012a-frdm) + fsl,ls1012a-frdm | \ + fsl,ls1012a-rdb | \ + fsl,ls1021a-twr | \ + fsl,ls1043a-rdb | \ + fsl,ls1046a-rdb | \ + fsl,ls1088a-rdb | \ + fsl,ls2088a-rdb) PART_NAME=firmware default_do_upgrade "$1" ;; diff --git a/target/linux/layerscape/image/armv7.mk b/target/linux/layerscape/image/armv7.mk index e1a9efb8b6..27246740d5 100644 --- a/target/linux/layerscape/image/armv7.mk +++ b/target/linux/layerscape/image/armv7.mk @@ -1,5 +1,5 @@ # -# Copyright 2018 NXP +# Copyright 2018-2020 NXP # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -8,11 +8,13 @@ define Device/Default PROFILES := Default FILESYSTEMS := squashfs - IMAGES := firmware.bin + IMAGES := firmware.bin sysupgrade.bin KERNEL := kernel-bin | uImage none KERNEL_NAME := zImage KERNEL_LOADADDR := 0x80008000 KERNEL_ENTRY_POINT := 0x80008000 + IMAGE/sysupgrade.bin := append-kernel | pad-to 16M | \ + append-rootfs | pad-rootfs | check-size 50331649 | append-metadata endef define Device/ls1021atwr @@ -29,6 +31,7 @@ define Device/ls1021atwr ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to 32M | \ append-rootfs | pad-rootfs | check-size 67108865 + SUPPORTED_DEVICES := fsl,ls1021a-twr endef TARGET_DEVICES += ls1021atwr diff --git a/target/linux/layerscape/image/armv8_64b.mk b/target/linux/layerscape/image/armv8_64b.mk index 3ad831b0b1..b7208b4c8f 100644 --- a/target/linux/layerscape/image/armv8_64b.mk +++ b/target/linux/layerscape/image/armv8_64b.mk @@ -1,5 +1,5 @@ # -# Copyright 2018 NXP +# Copyright 2018-2020 NXP # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -7,11 +7,13 @@ define Device/Default PROFILES := Default - IMAGES := firmware.bin + IMAGES := firmware.bin sysupgrade.bin FILESYSTEMS := squashfs KERNEL := kernel-bin | gzip | uImage gzip KERNEL_LOADADDR := 0x80080000 KERNEL_ENTRY_POINT := 0x80080000 + IMAGE/sysupgrade.bin := append-kernel | pad-to 16M | \ + append-rootfs | pad-rootfs | check-size 50331649 | append-metadata endef define Device/ls1012afrdm @@ -23,7 +25,6 @@ define Device/ls1012afrdm kmod-ppfe DEVICE_DTS := freescale/fsl-ls1012a-frdm BLOCKSIZE := 256KiB - IMAGES += sysupgrade.bin IMAGE/firmware.bin := \ ls-clean | \ ls-append $(1)-bl2.pbl | pad-to 1M | \ @@ -58,6 +59,7 @@ define Device/ls1012ardb ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to 32M | \ append-rootfs | pad-rootfs | check-size 67108865 + SUPPORTED_DEVICES := fsl,ls1012a-rdb endef TARGET_DEVICES += ls1012ardb @@ -105,6 +107,7 @@ define Device/ls1043ardb ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to 32M | \ append-rootfs | pad-rootfs | check-size 67108865 + SUPPORTED_DEVICES := fsl,ls1043a-rdb endef TARGET_DEVICES += ls1043ardb @@ -150,6 +153,7 @@ define Device/ls1046ardb ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to 32M | \ append-rootfs | pad-rootfs | check-size 67108865 + SUPPORTED_DEVICES := fsl,ls1046a-rdb endef TARGET_DEVICES += ls1046ardb @@ -198,6 +202,7 @@ define Device/ls1088ardb ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to 32M | \ append-rootfs | pad-rootfs | check-size 67108865 + SUPPORTED_DEVICES := fsl,ls1088a-rdb endef TARGET_DEVICES += ls1088ardb @@ -248,6 +253,7 @@ define Device/ls2088ardb ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to 32M | \ append-rootfs | pad-rootfs | check-size 67108865 + SUPPORTED_DEVICES := fsl,ls2088a-rdb endef TARGET_DEVICES += ls2088ardb From 0841b68c91d3536dffc4aca67a58adf37720be6d Mon Sep 17 00:00:00 2001 From: Yangbo Lu Date: Thu, 28 May 2020 16:02:28 +0800 Subject: [PATCH 61/70] layerscape: support sysupgrade for SD card ext4 rootfs Support sysupgrade for SD card ext4 rootfs. Signed-off-by: Yangbo Lu --- target/linux/layerscape/Makefile | 3 +- .../base-files/lib/upgrade/platform.sh | 104 ++++++++++++++++++ target/linux/layerscape/image/armv7.mk | 8 +- target/linux/layerscape/image/armv8_64b.mk | 32 +++++- 4 files changed, 141 insertions(+), 6 deletions(-) diff --git a/target/linux/layerscape/Makefile b/target/linux/layerscape/Makefile index 476297a678..c5b27ad0c7 100644 --- a/target/linux/layerscape/Makefile +++ b/target/linux/layerscape/Makefile @@ -18,6 +18,7 @@ endef include $(INCLUDE_DIR)/target.mk -DEFAULT_PACKAGES += kmod-usb3 kmod-usb-dwc3 kmod-usb-storage +DEFAULT_PACKAGES += kmod-usb3 kmod-usb-dwc3 kmod-usb-storage \ + partx-utils $(eval $(call BuildTarget)) diff --git a/target/linux/layerscape/base-files/lib/upgrade/platform.sh b/target/linux/layerscape/base-files/lib/upgrade/platform.sh index 9b8c07138f..8a136d9439 100644 --- a/target/linux/layerscape/base-files/lib/upgrade/platform.sh +++ b/target/linux/layerscape/base-files/lib/upgrade/platform.sh @@ -8,6 +8,85 @@ RAMFS_COPY_DATA="/etc/fw_env.config /var/lock/fw_printenv.lock" REQUIRE_IMAGE_METADATA=1 +platform_check_image_sdboot() { + local diskdev partdev diff + + export_bootdevice && export_partdevice diskdev 0 || { + echo "Unable to determine upgrade device" + return 1 + } + + # get partitions table from boot device + get_partitions "/dev/$diskdev" bootdisk + + # get partitions table from sysupgrade.bin + dd if="$1" of=/tmp/image.bs bs=512b count=1 > /dev/null 2>&1 + sync + get_partitions /tmp/image.bs image + + # compare tables + diff="$(grep -F -x -v -f /tmp/partmap.bootdisk /tmp/partmap.image)" + + rm -f /tmp/image.bs /tmp/partmap.bootdisk /tmp/partmap.image + + if [ -n "$diff" ]; then + echo "Partition layout has changed. Full image will be written." + ask_bool 0 "Abort" && exit 1 + return 0 + fi +} +platform_do_upgrade_sdboot() { + local diskdev partdev diff + + export_bootdevice && export_partdevice diskdev 0 || { + echo "Unable to determine upgrade device" + return 1 + } + + if [ "$UPGRADE_OPT_SAVE_PARTITIONS" = "1" ]; then + # get partitions table from boot device + get_partitions "/dev/$diskdev" bootdisk + + # get partitions table from sysupgrade.bin + dd if="$1" of=/tmp/image.bs bs=512b count=1 > /dev/null 2>&1 + sync + 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 + dd if="$1" of="/dev/$diskdev" bs=1024 count=4 > /dev/null 2>&1 + dd if="$1" of="$diskdev" bs=1024 skip=4 seek=16384 > /dev/null 2>&1 + sync + + # 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" + + return 0 + fi + + # write kernel image + dd if="$1" of="$diskdev" bs=1024 skip=4 seek=16384 count=16384 > /dev/null 2>&1 + sync + + # iterate over each partition from the image and write it to the boot disk + while read part start size; do + if export_partdevice partdev $part; then + echo "Writing image to /dev/$partdev..." + dd if="$1" of="/dev/$partdev" bs=512 skip="$start" count="$size" > /dev/null 2>&1 + sync + else + echo "Unable to find partition $part device, skipped." + fi + done < /tmp/partmap.image + +} platform_do_upgrade_traverse_nandubi() { bootsys=$(fw_printenv bootsys | awk -F= '{{print $2}}') newbootsys=2 @@ -25,6 +104,15 @@ platform_do_upgrade_traverse_nandubi() { nand_do_upgrade "$1" || (echo "Upgrade failed, setting bootsys ${bootsys}" && fw_setenv bootsys $bootsys) } +platform_copy_config() { + local partdev parttype=ext4 + + if export_partdevice partdev 1; then + mount -t $parttype -o rw,noatime "/dev/$partdev" /mnt + cp -af "$UPGRADE_BACKUP" "/mnt/$BACKUP_FILE" + umount /mnt + fi +} platform_check_image() { local board=$(board_name) @@ -43,6 +131,14 @@ platform_check_image() { fsl,ls2088a-rdb) return 0 ;; + fsl,ls1012a-frwy-sdboot | \ + fsl,ls1021a-twr-sdboot | \ + fsl,ls1043a-rdb-sdboot | \ + fsl,ls1046a-rdb-sdboot | \ + fsl,ls1088a-rdb-sdboot) + platform_check_image_sdboot "$1" + return 0 + ;; *) echo "Sysupgrade is not currently supported on $board" ;; @@ -72,6 +168,14 @@ platform_do_upgrade() { PART_NAME=firmware default_do_upgrade "$1" ;; + fsl,ls1012a-frwy-sdboot | \ + fsl,ls1021a-twr-sdboot | \ + fsl,ls1043a-rdb-sdboot | \ + fsl,ls1046a-rdb-sdboot | \ + fsl,ls1088a-rdb-sdboot) + platform_do_upgrade_sdboot "$1" + return 0 + ;; *) echo "Sysupgrade is not currently supported on $board" ;; diff --git a/target/linux/layerscape/image/armv7.mk b/target/linux/layerscape/image/armv7.mk index 27246740d5..9bcf72f2cb 100644 --- a/target/linux/layerscape/image/armv7.mk +++ b/target/linux/layerscape/image/armv7.mk @@ -41,7 +41,7 @@ define Device/ls1021atwr-sdboot DEVICE_VARIANT := SD Card Boot DEVICE_DTS := ls1021a-twr FILESYSTEMS := ext4 - IMAGES := sdcard.img + IMAGES := sdcard.img sysupgrade.bin IMAGE/sdcard.img := \ ls-clean | \ ls-append-sdhead $(1) | pad-to 4K | \ @@ -50,6 +50,12 @@ define Device/ls1021atwr-sdboot 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) + IMAGE/sysupgrade.bin := \ + ls-clean | \ + 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 diff --git a/target/linux/layerscape/image/armv8_64b.mk b/target/linux/layerscape/image/armv8_64b.mk index b7208b4c8f..9512e0d8ad 100644 --- a/target/linux/layerscape/image/armv8_64b.mk +++ b/target/linux/layerscape/image/armv8_64b.mk @@ -72,7 +72,7 @@ define Device/ls1012afrwy kmod-ppfe DEVICE_DTS := freescale/fsl-ls1012a-frwy FILESYSTEMS := ext4 - IMAGES := firmware.bin sdcard.img + IMAGES := firmware.bin sdcard.img sysupgrade.bin IMAGE/firmware.bin := \ ls-clean | \ ls-append $(1)-bl2.pbl | pad-to 128K | \ @@ -86,6 +86,12 @@ define Device/ls1012afrwy 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) + IMAGE/sysupgrade.bin := \ + ls-clean | \ + 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 @@ -121,7 +127,7 @@ define Device/ls1043ardb-sdboot fmc fmc-eth-config DEVICE_DTS := freescale/fsl-ls1043a-rdb-sdk FILESYSTEMS := ext4 - IMAGES := sdcard.img + IMAGES := sdcard.img sysupgrade.bin IMAGE/sdcard.img := \ ls-clean | \ ls-append-sdhead $(1) | pad-to 4K | \ @@ -132,6 +138,12 @@ define Device/ls1043ardb-sdboot 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) + IMAGE/sysupgrade.bin := \ + ls-clean | \ + 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 @@ -167,7 +179,7 @@ define Device/ls1046ardb-sdboot fmc fmc-eth-config DEVICE_DTS := freescale/fsl-ls1046a-rdb-sdk FILESYSTEMS := ext4 - IMAGES := sdcard.img + IMAGES := sdcard.img sysupgrade.bin IMAGE/sdcard.img := \ ls-clean | \ ls-append-sdhead $(1) | pad-to 4K | \ @@ -178,6 +190,12 @@ define Device/ls1046ardb-sdboot 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) + IMAGE/sysupgrade.bin := \ + ls-clean | \ + 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 @@ -217,7 +235,7 @@ define Device/ls1088ardb-sdboot restool DEVICE_DTS := freescale/fsl-ls1088a-rdb FILESYSTEMS := ext4 - IMAGES := sdcard.img + IMAGES := sdcard.img sysupgrade.bin IMAGE/sdcard.img := \ ls-clean | \ ls-append-sdhead $(1) | pad-to 4K | \ @@ -230,6 +248,12 @@ define Device/ls1088ardb-sdboot 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) + IMAGE/sysupgrade.bin := \ + ls-clean | \ + 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 From 2a5460b11b9718ed5f398fcc381edc89bce72695 Mon Sep 17 00:00:00 2001 From: Yangbo Lu Date: Mon, 29 Jun 2020 16:18:57 +0800 Subject: [PATCH 62/70] layerscape: define IMAGE_SIZE and LS_SYSUPGRADE_IMAGE_SIZE Define 64m IMAGE_SIZE for flash firmware.bin since the flash size is 64MB. Define 48m LS_SYSUPGRADE_IMAGE_SIZE for flash sysupgrade.bin which contains maximum 16MB kernel and 32MB rootfs according to memory map. Signed-off-by: Yangbo Lu --- target/linux/layerscape/image/Makefile | 3 +++ target/linux/layerscape/image/armv7.mk | 6 ++++-- target/linux/layerscape/image/armv8_64b.mk | 19 +++++++++++-------- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/target/linux/layerscape/image/Makefile b/target/linux/layerscape/image/Makefile index f5a5ad9980..8a38a25041 100644 --- a/target/linux/layerscape/image/Makefile +++ b/target/linux/layerscape/image/Makefile @@ -11,6 +11,9 @@ LS_SD_ROOTFSPART_OFFSET = 64 LS_SD_IMAGE_SIZE = $(shell echo $$((($(LS_SD_ROOTFSPART_OFFSET) + \ $(CONFIG_TARGET_ROOTFS_PARTSIZE)) * 1024 * 1024))) +# The limitation of flash sysupgrade.bin is 16MB kernel + 32MB rootfs +LS_SYSUPGRADE_IMAGE_SIZE = 48m + define Build/ls-clean rm -f $@ endef diff --git a/target/linux/layerscape/image/armv7.mk b/target/linux/layerscape/image/armv7.mk index 9bcf72f2cb..e06c99c338 100644 --- a/target/linux/layerscape/image/armv7.mk +++ b/target/linux/layerscape/image/armv7.mk @@ -13,8 +13,10 @@ define Device/Default KERNEL_NAME := zImage KERNEL_LOADADDR := 0x80008000 KERNEL_ENTRY_POINT := 0x80008000 + IMAGE_SIZE := 64m IMAGE/sysupgrade.bin := append-kernel | pad-to 16M | \ - append-rootfs | pad-rootfs | check-size 50331649 | append-metadata + append-rootfs | pad-rootfs | \ + check-size $(LS_SYSUPGRADE_IMAGE_SIZE) | append-metadata endef define Device/ls1021atwr @@ -30,7 +32,7 @@ define Device/ls1021atwr ls-append $(1)-uboot-env.bin | pad-to 15M | \ ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to 32M | \ - append-rootfs | pad-rootfs | check-size 67108865 + append-rootfs | pad-rootfs | check-size SUPPORTED_DEVICES := fsl,ls1021a-twr endef TARGET_DEVICES += ls1021atwr diff --git a/target/linux/layerscape/image/armv8_64b.mk b/target/linux/layerscape/image/armv8_64b.mk index 9512e0d8ad..ea17e02c52 100644 --- a/target/linux/layerscape/image/armv8_64b.mk +++ b/target/linux/layerscape/image/armv8_64b.mk @@ -12,8 +12,10 @@ define Device/Default KERNEL := kernel-bin | gzip | uImage gzip KERNEL_LOADADDR := 0x80080000 KERNEL_ENTRY_POINT := 0x80080000 + IMAGE_SIZE := 64m IMAGE/sysupgrade.bin := append-kernel | pad-to 16M | \ - append-rootfs | pad-rootfs | check-size 50331649 | append-metadata + append-rootfs | pad-rootfs | \ + check-size $(LS_SYSUPGRADE_IMAGE_SIZE) | append-metadata endef define Device/ls1012afrdm @@ -33,9 +35,10 @@ define Device/ls1012afrdm ls-append pfe.itb | pad-to 15M | \ ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to $$(BLOCKSIZE) | \ - append-rootfs | pad-rootfs | check-size 67108865 + append-rootfs | pad-rootfs | check-size IMAGE/sysupgrade.bin := append-kernel | pad-to $$(BLOCKSIZE) | \ - append-rootfs | pad-rootfs | check-size 50331648 | append-metadata + append-rootfs | pad-rootfs | \ + 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 @@ -58,7 +61,7 @@ define Device/ls1012ardb ls-append pfe.itb | pad-to 15M | \ ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to 32M | \ - append-rootfs | pad-rootfs | check-size 67108865 + append-rootfs | pad-rootfs | check-size SUPPORTED_DEVICES := fsl,ls1012a-rdb endef TARGET_DEVICES += ls1012ardb @@ -112,7 +115,7 @@ define Device/ls1043ardb ls-append $(1)-fman.bin | pad-to 15M | \ ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to 32M | \ - append-rootfs | pad-rootfs | check-size 67108865 + append-rootfs | pad-rootfs | check-size SUPPORTED_DEVICES := fsl,ls1043a-rdb endef TARGET_DEVICES += ls1043ardb @@ -164,7 +167,7 @@ define Device/ls1046ardb ls-append $(1)-fman.bin | pad-to 15M | \ ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to 32M | \ - append-rootfs | pad-rootfs | check-size 67108865 + append-rootfs | pad-rootfs | check-size SUPPORTED_DEVICES := fsl,ls1046a-rdb endef TARGET_DEVICES += ls1046ardb @@ -219,7 +222,7 @@ define Device/ls1088ardb ls-append $(1)-dpc.dtb | pad-to 15M | \ ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to 32M | \ - append-rootfs | pad-rootfs | check-size 67108865 + append-rootfs | pad-rootfs | check-size SUPPORTED_DEVICES := fsl,ls1088a-rdb endef TARGET_DEVICES += ls1088ardb @@ -276,7 +279,7 @@ define Device/ls2088ardb ls-append $(1)-dpc.dtb | pad-to 15M | \ ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to 32M | \ - append-rootfs | pad-rootfs | check-size 67108865 + append-rootfs | pad-rootfs | check-size SUPPORTED_DEVICES := fsl,ls2088a-rdb endef TARGET_DEVICES += ls2088ardb From ff8b8fee890dae345d6a5189a8633214f6a4da3a Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Tue, 9 Jun 2020 19:18:55 +0200 Subject: [PATCH 63/70] ltq-vmmc: update permission handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The firmware is currently just copied. It can end up with o= on the device (this is the case for voice_ar9_firmware.bin for instance). Instead of copying it the Makefile is changed to use the macro "$(INSTALL_DATA)" in order for the file to be world-readable. While at it refactor the device node creation in the init script with loop. Signed-off-by: Sebastian Kemper [removed 2nd part with custom group handling for device nodes] Signed-off-by: Petr Štetiar --- package/kernel/lantiq/ltq-vmmc/Makefile | 4 ++-- package/kernel/lantiq/ltq-vmmc/files/vmmc.init | 16 +++++----------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/package/kernel/lantiq/ltq-vmmc/Makefile b/package/kernel/lantiq/ltq-vmmc/Makefile index 99263cce43..def676b833 100644 --- a/package/kernel/lantiq/ltq-vmmc/Makefile +++ b/package/kernel/lantiq/ltq-vmmc/Makefile @@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=drv_vmmc PKG_VERSION:=1.9.0 -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_HASH:=707f515eb727c032418c4da67d7e86884bb56cdc2a606e8f6ded6057d8767e57 @@ -170,7 +170,7 @@ endef define KernelPackage/ltq-vmmc/install $(INSTALL_DIR) $(1)/etc/init.d $(1)/$(FW_DIR) $(INSTALL_BIN) ./files/vmmc.init $(1)/etc/init.d/vmmc - $(CP) $(PKG_BUILD_DIR)/firmware/$(FW_SOURCE) $(1)/$(FW_DIR)/$(FW_TARGET) + $(INSTALL_DATA) $(PKG_BUILD_DIR)/firmware/$(FW_SOURCE) $(1)/$(FW_DIR)/$(FW_TARGET) ln -s /$(FW_DIR)/$(FW_TARGET) $(1)/$(FW_DIR)/$(FW_TARGET_GENERIC) $(CP) $(PKG_BUILD_DIR)/coef/$(COEF_SRC) $(1)/$(FW_DIR)/$(COEF_TARGET) $(CP) $(PKG_BUILD_DIR)/coef/$(COEF_SRC_FXO) $(1)/$(FW_DIR)/$(COEF_TARGET_FXO) diff --git a/package/kernel/lantiq/ltq-vmmc/files/vmmc.init b/package/kernel/lantiq/ltq-vmmc/files/vmmc.init index 100a97dc45..402376e294 100644 --- a/package/kernel/lantiq/ltq-vmmc/files/vmmc.init +++ b/package/kernel/lantiq/ltq-vmmc/files/vmmc.init @@ -5,15 +5,9 @@ START=31 start() { - [ ! -c /dev/vmmc10 ] && { - mknod /dev/vmmc10 c 122 10 - mknod /dev/vmmc11 c 122 11 - mknod /dev/vmmc12 c 122 12 - mknod /dev/vmmc13 c 122 13 - mknod /dev/vmmc14 c 122 14 - mknod /dev/vmmc15 c 122 15 - mknod /dev/vmmc16 c 122 16 - mknod /dev/vmmc17 c 122 17 - mknod /dev/vmmc18 c 122 18 - } + for i in 10 11 12 13 14 15 16 17 18; do + if ! [ -e /dev/vmmc$i ]; then + mknod -m 664 /dev/vmmc$i c 122 $i + fi + done } From 23de93a5216bf1c24c4e4c71f6cad4455c3cfa2c Mon Sep 17 00:00:00 2001 From: DENG Qingfang Date: Thu, 4 Jun 2020 12:00:44 +0800 Subject: [PATCH 64/70] ramips: mt7621: refactor set affinity script The current one only looks for mt76x2e and mt7603e, and does not work for 2 or more same Wi-Fi chips. Refactor the script to cover those cases. Signed-off-by: DENG Qingfang --- .../base-files/etc/init.d/set-irq-affinity | 26 +++++-------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/target/linux/ramips/mt7621/base-files/etc/init.d/set-irq-affinity b/target/linux/ramips/mt7621/base-files/etc/init.d/set-irq-affinity index 9a3afefa5a..c118d928a7 100755 --- a/target/linux/ramips/mt7621/base-files/etc/init.d/set-irq-affinity +++ b/target/linux/ramips/mt7621/base-files/etc/init.d/set-irq-affinity @@ -2,30 +2,18 @@ START=99 -get_irq() { - local name="$1" - grep -m 1 "$name" /proc/interrupts | cut -d: -f1 | sed 's, *,,' -} - -set_irq_affinity() { - local name="$1" - local val="$2" - local irq="$(get_irq "$name")" - [ -n "$irq" ] || return - echo "$val" > "/proc/irq/$irq/smp_affinity" -} - start() { if grep -q 'processor.*: 2' /proc/cpuinfo; then - mask1=4 - mask2=8 + mask=4 elif grep -q 'processor.*: 1' /proc/cpuinfo; then - mask1=2 - mask2=2 + mask=2 else return fi - set_irq_affinity mt76x2e $mask1 - set_irq_affinity mt7603e $mask2 + for irq in $(grep "mt76..e" /proc/interrupts | cut -d: -f1 | sed 's, *,,') + do + echo "$mask" > "/proc/irq/$irq/smp_affinity" + [ $mask = 4 ] && mask=8 + done } From 2ca084ccaae619ac8031e902c66817d021ac6fd5 Mon Sep 17 00:00:00 2001 From: Roman Yeryomin Date: Fri, 12 Jun 2020 21:43:46 +0300 Subject: [PATCH 65/70] build: improve ccache support Set CCACHE_DIR to $(TOPDIR)/.ccache and CCACHE_BASEDIR to $(TOPDIR). This allows to do clean and dirclean. Cache hit rate for test build after dirclean is ~65%. If CCACHE is enabled stats are printed out at the end of building process. CCACHE_DIR config variable allows to override default, which could be useful when sharing cache with many builds. cacheclean make target allows to clean the cache. Changes from v1: - remove ccache directory using CCACHE_DIR variable - remove ccache leftovers from sdk and toolchain make files - introduce CONFIG_CCACHE_DIR variable - introduce cacheclean make target Signed-off-by: Roman Yeryomin --- .gitignore | 1 + Makefile | 8 ++++++++ config/Config-devel.in | 7 +++++++ include/host-build.mk | 4 +++- include/package.mk | 4 +++- include/toplevel.mk | 2 +- rules.mk | 3 +++ target/sdk/Makefile | 8 ++------ target/toolchain/Makefile | 2 +- 9 files changed, 29 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index 6549af83be..b6bfe1a525 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,4 @@ TAGS*~ git-src .project .cproject +.ccache diff --git a/Makefile b/Makefile index 32c050bb48..24f5955c90 100644 --- a/Makefile +++ b/Makefile @@ -62,6 +62,11 @@ dirclean: clean rm -rf $(TMP_DIR) $(MAKE) -C $(TOPDIR)/scripts/config clean +cacheclean: +ifneq ($(CONFIG_CCACHE),) + rm -rf $(if $(call qstrip,$(CONFIG_CCACHE_DIR)),$(call qstrip,$(CONFIG_CCACHE_DIR)),$(TOPDIR)/.ccache) +endif + ifndef DUMP_TARGET_DB $(BUILD_DIR)/.prepared: Makefile @mkdir -p $$(dirname $@) @@ -119,6 +124,9 @@ world: prepare $(target/stamp-compile) $(package/stamp-compile) $(package/stamp- $(_SINGLE)$(SUBMAKE) -r package/index $(_SINGLE)$(SUBMAKE) -r json_overview_image_info $(_SINGLE)$(SUBMAKE) -r checksum +ifneq ($(CONFIG_CCACHE),) + $(STAGING_DIR_HOST)/bin/ccache -s +endif .PHONY: clean dirclean prereq prepare world package/symlinks package/symlinks-install package/symlinks-clean diff --git a/config/Config-devel.in b/config/Config-devel.in index 70ec0ce9a7..11741c7070 100644 --- a/config/Config-devel.in +++ b/config/Config-devel.in @@ -69,6 +69,13 @@ menuconfig DEVEL help Compiler cache; see https://ccache.samba.org/ + config CCACHE_DIR + string "Set ccache directory" if CCACHE + default "" + help + Store ccache in this directory. + If not set, uses './.ccache' + config EXTERNAL_KERNEL_TREE string "Use external kernel tree" if DEVEL default "" diff --git a/include/host-build.mk b/include/host-build.mk index 9fc14241c6..7d84ab0f5f 100644 --- a/include/host-build.mk +++ b/include/host-build.mk @@ -132,7 +132,9 @@ define Host/Exports/Default $(1) : export STAGING_PREFIX=$$(HOST_BUILD_PREFIX) $(1) : export PKG_CONFIG_PATH=$$(STAGING_DIR_HOST)/lib/pkgconfig:$$(HOST_BUILD_PREFIX)/lib/pkgconfig $(1) : export PKG_CONFIG_LIBDIR=$$(HOST_BUILD_PREFIX)/lib/pkgconfig - $(if $(CONFIG_CCACHE),$(1) : export CCACHE_DIR:=$(STAGING_DIR_HOST)/ccache) + $(if $(CONFIG_CCACHE),$(1) : export CCACHE_BASEDIR:=$(TOPDIR)) + $(if $(CONFIG_CCACHE),$(1) : export CCACHE_DIR:=$(if $(call qstrip,$(CONFIG_CCACHE_DIR)),$(call qstrip,$(CONFIG_CCACHE_DIR)),$(TOPDIR)/.ccache)) + $(if $(CONFIG_CCACHE),$(1) : export CCACHE_COMPILERCHECK:=%compiler% -dumpmachine; %compiler% -dumpversion) $(if $(HOST_CONFIG_SITE),$(1) : export CONFIG_SITE:=$(HOST_CONFIG_SITE)) $(if $(IS_PACKAGE_BUILD),$(1) : export PATH=$$(TARGET_PATH_PKG)) endef diff --git a/include/package.mk b/include/package.mk index 0575692742..a93d6b78f3 100644 --- a/include/package.mk +++ b/include/package.mk @@ -173,7 +173,9 @@ define Build/Exports/Default $(1) : export CONFIG_SITE:=$$(CONFIG_SITE) $(1) : export PKG_CONFIG_PATH:=$$(PKG_CONFIG_PATH) $(1) : export PKG_CONFIG_LIBDIR:=$$(PKG_CONFIG_PATH) - $(if $(CONFIG_CCACHE),$(1) : export CCACHE_DIR:=$(STAGING_DIR)/ccache) + $(if $(CONFIG_CCACHE),$(1) : export CCACHE_BASEDIR:=$(TOPDIR)) + $(if $(CONFIG_CCACHE),$(1) : export CCACHE_DIR:=$(if $(call qstrip,$(CONFIG_CCACHE_DIR)),$(call qstrip,$(CONFIG_CCACHE_DIR)),$(TOPDIR)/.ccache)) + $(if $(CONFIG_CCACHE),$(1) : export CCACHE_COMPILERCHECK:=%compiler% -dumpmachine; %compiler% -dumpversion) endef Build/Exports=$(Build/Exports/Default) diff --git a/include/toplevel.mk b/include/toplevel.mk index 8564a4de73..0a64afe153 100644 --- a/include/toplevel.mk +++ b/include/toplevel.mk @@ -262,7 +262,7 @@ package/symlinks-clean: help: cat README -distclean: +distclean: cacheclean rm -rf bin build_dir .config* dl feeds key-build* logs package/feeds package/openwrt-packages staging_dir tmp @$(_SINGLE)$(SUBMAKE) -C scripts/config clean diff --git a/rules.mk b/rules.mk index 66ddea2883..e734b4a582 100644 --- a/rules.mk +++ b/rules.mk @@ -298,6 +298,9 @@ ifneq ($(CONFIG_CCACHE),) TARGET_CXX:= ccache_cxx HOSTCC:= ccache $(HOSTCC) HOSTCXX:= ccache $(HOSTCXX) + export CCACHE_BASEDIR:=$(TOPDIR) + export CCACHE_DIR:=$(if $(call qstrip,$(CONFIG_CCACHE_DIR)),$(call qstrip,$(CONFIG_CCACHE_DIR)),$(TOPDIR)/.ccache) + export CCACHE_COMPILERCHECK:=%compiler% -dumpmachine; %compiler% -dumpversion endif TARGET_CONFIGURE_OPTS = \ diff --git a/target/sdk/Makefile b/target/sdk/Makefile index 6d81834720..d3552b47eb 100644 --- a/target/sdk/Makefile +++ b/target/sdk/Makefile @@ -20,7 +20,7 @@ STAGING_SUBDIR_HOST := staging_dir/host STAGING_SUBDIR_TARGET := staging_dir/$(TARGET_DIR_NAME) STAGING_SUBDIR_TOOLCHAIN := staging_dir/toolchain-$(ARCH)$(ARCH_SUFFIX)_gcc-$(GCCV)_$(LIBC)$(if $(CONFIG_arm),_eabi) -EXCLUDE_DIRS:=*/ccache/* \ +EXCLUDE_DIRS:= \ */stamp \ */stampfiles \ */man \ @@ -135,11 +135,7 @@ $(BIN_DIR)/$(SDK_NAME).tar.xz: clean $(TOPDIR)/package/kernel/linux \ $(SDK_BUILD_DIR)/package/ - -rm -rf \ - $(SDK_BUILD_DIR)/$(STAGING_SUBDIR_HOST)/ccache \ - $(SDK_BUILD_DIR)/$(STAGING_SUBDIR_TARGET)/ccache \ - $(SDK_BUILD_DIR)/$(STAGING_SUBDIR_TOOLCHAIN)/ccache \ - $(SDK_BUILD_DIR)/$(STAGING_SUBDIR_HOST)/.prereq-build + -rm -rf $(SDK_BUILD_DIR)/$(STAGING_SUBDIR_HOST)/.prereq-build -rm -f $(SDK_BUILD_DIR)/feeds.conf.default $(if $(BASE_FEED),echo "$(BASE_FEED)" > $(SDK_BUILD_DIR)/feeds.conf.default) diff --git a/target/toolchain/Makefile b/target/toolchain/Makefile index ef2dc68a97..5002ff7835 100644 --- a/target/toolchain/Makefile +++ b/target/toolchain/Makefile @@ -15,7 +15,7 @@ override MAKEFLAGS= TOOLCHAIN_NAME:=$(VERSION_DIST_SANITIZED)-toolchain-$(if $(CONFIG_VERSION_FILENAMES),$(VERSION_NUMBER)-)$(BOARD)$(if $(SUBTARGET),-$(SUBTARGET))_gcc-$(GCCV)$(DIR_SUFFIX).$(HOST_OS)-$(HOST_ARCH) TOOLCHAIN_BUILD_DIR:=$(BUILD_DIR)/$(TOOLCHAIN_NAME) -EXCLUDE_DIRS:=*/ccache \ +EXCLUDE_DIRS:= \ */initial \ */stamp \ */stampfiles \ From cef9e5a49f496b64449fca6814fc1b66a45601c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gonz=C3=A1lez=20Cabanelas?= Date: Mon, 22 Jun 2020 21:44:44 +0200 Subject: [PATCH 66/70] bcm63xx: R5010UNv2: fix flash partitions for 16MB flash MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The router Nucom R5010UN v2 has the partitions defined for a 8MB flash, but the flash chip is 16MB size. We are wasting half of the flash. Fix it and use generic names for partitions. Fixes: 474cde61234c ("brcm63xx: probe SPI flash through DT") Signed-off-by: Daniel González Cabanelas --- target/linux/bcm63xx/dts/bcm6328-nucom-r5010un-v2.dts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/target/linux/bcm63xx/dts/bcm6328-nucom-r5010un-v2.dts b/target/linux/bcm63xx/dts/bcm6328-nucom-r5010un-v2.dts index 639cef3a7e..365a4552f2 100644 --- a/target/linux/bcm63xx/dts/bcm6328-nucom-r5010un-v2.dts +++ b/target/linux/bcm63xx/dts/bcm6328-nucom-r5010un-v2.dts @@ -94,20 +94,20 @@ #address-cells = <1>; #size-cells = <1>; - cfe@0 { + partition@0 { reg = <0x000000 0x010000>; label = "cfe"; read-only; }; - linux@10000 { - reg = <0x010000 0x7e0000>; + partition@10000 { + reg = <0x010000 0xfe0000>; label = "linux"; compatible = "brcm,bcm963xx-imagetag"; }; - nvram@7f0000 { - reg = <0x7f0000 0x010000>; + partition@ff0000 { + reg = <0xff0000 0x010000>; label = "nvram"; }; }; From 9faf9f8f23f43300bfb892abe6513ead30374e20 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Fri, 10 Jul 2020 10:28:13 +0200 Subject: [PATCH 67/70] mvebu: fix support for Marvell 8040 MACCHIATOBin Between kernels 4.20 and 5.0, a new variant of this board has been introduced ("Single Shot"), and the existing one has been renamed with the appendix "Double Shot". [1] This also adjusted the first compatible in the list: marvell,armada8040-mcbin -> marvell,armada8040-mcbin-doubleshot This patch updates the OpenWrt implementation of this device by adjusting the relevant references to that compatible (i.e., our board name). To still provide support for 4.19 with our setup, this adds a small patch to change the compatible there as well. [1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=b1f0bbe2700051886b954192b6c1751233fe0f52 Cc: Tomasz Maciej Nowak Signed-off-by: Adrian Schmutzler Reviewed-by: Tomasz Maciej Nowak --- package/boot/uboot-envtools/files/mvebu | 2 +- .../cortexa72/base-files/etc/board.d/02_network | 2 +- .../cortexa72/base-files/lib/upgrade/platform.sh | 6 +++--- target/linux/mvebu/image/cortexa72.mk | 2 +- .../260-align-mcbin-compatible-with-5.4.patch | 14 ++++++++++++++ 5 files changed, 20 insertions(+), 6 deletions(-) create mode 100644 target/linux/mvebu/patches-4.19/260-align-mcbin-compatible-with-5.4.patch diff --git a/package/boot/uboot-envtools/files/mvebu b/package/boot/uboot-envtools/files/mvebu index 72e2df5d19..590000aae7 100644 --- a/package/boot/uboot-envtools/files/mvebu +++ b/package/boot/uboot-envtools/files/mvebu @@ -24,7 +24,7 @@ globalscale,espressobin|\ globalscale,espressobin-emmc|\ globalscale,espressobin-v7|\ globalscale,espressobin-v7-emmc|\ -marvell,armada8040-mcbin) +marvell,armada8040-mcbin-doubleshot) ubootenv_add_uci_config "/dev/mtd0" "0x3f0000" "0x10000" "0x10000" "1" ;; linksys,wrt1200ac|\ diff --git a/target/linux/mvebu/cortexa72/base-files/etc/board.d/02_network b/target/linux/mvebu/cortexa72/base-files/etc/board.d/02_network index 080e32ada3..32053d74e8 100755 --- a/target/linux/mvebu/cortexa72/base-files/etc/board.d/02_network +++ b/target/linux/mvebu/cortexa72/base-files/etc/board.d/02_network @@ -11,7 +11,7 @@ board_config_update board=$(board_name) case "$board" in -marvell,armada8040-mcbin) +marvell,armada8040-mcbin-doubleshot) ucidef_set_interfaces_lan_wan "eth0 eth1 eth3" "eth2" ;; marvell,armada8040-db) diff --git a/target/linux/mvebu/cortexa72/base-files/lib/upgrade/platform.sh b/target/linux/mvebu/cortexa72/base-files/lib/upgrade/platform.sh index 2428de08c4..75d2933f05 100755 --- a/target/linux/mvebu/cortexa72/base-files/lib/upgrade/platform.sh +++ b/target/linux/mvebu/cortexa72/base-files/lib/upgrade/platform.sh @@ -9,7 +9,7 @@ REQUIRE_IMAGE_METADATA=1 platform_check_image() { case "$(board_name)" in - marvell,armada8040-mcbin) + marvell,armada8040-mcbin-doubleshot) platform_check_image_sdcard "$1" ;; *) @@ -20,7 +20,7 @@ platform_check_image() { platform_do_upgrade() { case "$(board_name)" in - marvell,armada8040-mcbin) + marvell,armada8040-mcbin-doubleshot) platform_do_upgrade_sdcard "$1" ;; *) @@ -30,7 +30,7 @@ platform_do_upgrade() { } platform_copy_config() { case "$(board_name)" in - marvell,armada8040-mcbin) + marvell,armada8040-mcbin-doubleshot) platform_copy_config_sdcard ;; esac diff --git a/target/linux/mvebu/image/cortexa72.mk b/target/linux/mvebu/image/cortexa72.mk index 50233540ed..6e52109237 100644 --- a/target/linux/mvebu/image/cortexa72.mk +++ b/target/linux/mvebu/image/cortexa72.mk @@ -24,6 +24,6 @@ define Device/marvell_macchiatobin DEVICE_ALT0_MODEL := Armada 8040 Community Board DEVICE_PACKAGES += kmod-i2c-mux-pca954x DEVICE_DTS := armada-8040-mcbin - SUPPORTED_DEVICES := marvell,armada8040-mcbin + SUPPORTED_DEVICES := marvell,armada8040-mcbin-doubleshot marvell,armada8040-mcbin endef TARGET_DEVICES += marvell_macchiatobin diff --git a/target/linux/mvebu/patches-4.19/260-align-mcbin-compatible-with-5.4.patch b/target/linux/mvebu/patches-4.19/260-align-mcbin-compatible-with-5.4.patch new file mode 100644 index 0000000000..53e34300db --- /dev/null +++ b/target/linux/mvebu/patches-4.19/260-align-mcbin-compatible-with-5.4.patch @@ -0,0 +1,14 @@ +--- a/arch/arm64/boot/dts/marvell/armada-8040-mcbin.dts ++++ b/arch/arm64/boot/dts/marvell/armada-8040-mcbin.dts +@@ -10,8 +10,9 @@ + #include + + / { +- model = "Marvell 8040 MACCHIATOBin"; +- compatible = "marvell,armada8040-mcbin", "marvell,armada8040", ++ model = "Marvell 8040 MACCHIATOBin Double-shot"; ++ compatible = "marvell,armada8040-mcbin-doubleshot", ++ "marvell,armada8040-mcbin", "marvell,armada8040", + "marvell,armada-ap806-quad", "marvell,armada-ap806"; + + chosen { From 479adb0929f8afbd1935a0d71832df1e2cea18b2 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Fri, 10 Jul 2020 14:16:23 +0200 Subject: [PATCH 68/70] ramips: consolidate recipes with uimage_padhdr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There are already two very similar recipes using uimage_padhdr in ramips target, and a third one is about to be added. Make the recipe more generic, so redefinitions are not necessary anymore. Signed-off-by: Adrian Schmutzler Tested-by: Bjørn Mork [Zyxel WAP6805] --- target/linux/ramips/image/Makefile | 10 +++++----- target/linux/ramips/image/mt7620.mk | 4 ++-- target/linux/ramips/image/mt7621.mk | 7 +------ 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile index 93ce59e262..3ee9828a64 100644 --- a/target/linux/ramips/image/Makefile +++ b/target/linux/ramips/image/Makefile @@ -51,11 +51,6 @@ define Build/elx-header rm -rf $(KDIR)/tmp/$(DEVICE_NAME).header endef -define Build/fonfxcimage - uimage_padhdr -i $@ -o $@.new - mv $@.new $@ -endef - define Build/jcg-header $(STAGING_DIR_HOST)/bin/jcgimage -v $(1) \ $(if $(JCG_MAXSIZE), -m $$(($(subst k, * 1024,$(JCG_MAXSIZE)))),) \ @@ -151,6 +146,11 @@ define Build/trx -a 4 -f $(IMAGE_ROOTFS) endef +define Build/uimage-padhdr + uimage_padhdr $(if $(1),-l $(1)) -i $@ -o $@.new + mv $@.new $@ +endef + define Build/umedia-header fix-u-media-header -T 0x46 -B $(1) -i $@ -o $@.new && mv $@.new $@ endef diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk index df3f050048..34e2e42c33 100644 --- a/target/linux/ramips/image/mt7620.mk +++ b/target/linux/ramips/image/mt7620.mk @@ -400,8 +400,8 @@ define Device/fon_fon2601 DEVICE_VENDOR := Fon DEVICE_MODEL := FON2601 DEVICE_PACKAGES := kmod-mt76x2 kmod-usb2 kmod-usb-ohci - KERNEL_INITRAMFS := $$(KERNEL) | fonfxcimage - IMAGE/sysupgrade.bin := append-kernel | append-rootfs | fonfxcimage | \ + KERNEL_INITRAMFS := $$(KERNEL) | uimage-padhdr + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | uimage-padhdr | \ pad-rootfs | append-metadata | check-size endef TARGET_DEVICES += fon_fon2601 diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 0215683671..25de2fa597 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -81,11 +81,6 @@ define Build/iodata-mstc-header ) endef -define Build/mitrastarimage - uimage_padhdr -l 160 -i $@ -o $@.new - mv $@.new $@ -endef - define Build/ubnt-erx-factory-image if [ -e $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE) -a "$$(stat -c%s $@)" -lt "$(KERNEL_SIZE)" ]; then \ echo '21001:7' > $(1).compat; \ @@ -1146,7 +1141,7 @@ define Device/zyxel_wap6805 DEVICE_VENDOR := ZyXEL DEVICE_MODEL := WAP6805 DEVICE_PACKAGES := kmod-mt7603 wpad-basic kmod-mt7621-qtn-rgmii - KERNEL := $(KERNEL_DTB) | uImage lzma | mitrastarimage + KERNEL := $(KERNEL_DTB) | uImage lzma | uimage-padhdr 160 IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata endef TARGET_DEVICES += zyxel_wap6805 From 52cdd6185ec3320fe58de992c4a1750794082bfd Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Sat, 11 Jul 2020 18:46:53 +0200 Subject: [PATCH 69/70] scripts/mkits.sh: fix use of printf Due to a line break, printf was accidentally called with three arguments instead of two, causing a different output than before. Fix it by splitting the printf command into two lines. Fixes: 907053193a1c ("scripts/mkits.sh: replace echo -e with printf") Signed-off-by: Adrian Schmutzler --- scripts/mkits.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/mkits.sh b/scripts/mkits.sh index 65071e13ee..468ef670e6 100755 --- a/scripts/mkits.sh +++ b/scripts/mkits.sh @@ -15,8 +15,9 @@ # usage() { - printf "Usage: %s -A arch -C comp -a addr -e entry -v version"\ - "-k kernel [-D name -d dtb] -o its_file" "$(basename "$0")" + printf "Usage: %s -A arch -C comp -a addr -e entry" "$(basename "$0")" + printf " -v version -k kernel [-D name -d dtb] -o its_file" + printf "\n\t-A ==> set architecture to 'arch'" printf "\n\t-C ==> set compression type 'comp'" printf "\n\t-c ==> set config name 'config'" From 2dc5ce622a35f8924accbfbeda689c763f517f5d Mon Sep 17 00:00:00 2001 From: Tomasz Maciej Nowak Date: Fri, 10 Jul 2020 19:35:22 +0200 Subject: [PATCH 70/70] mvebu: add support for MACCHIATObin Single Shot Add support for Marvell MACCHIATObin Single Shot, cortex-a72 based Marvell ARMADA 8040 Community board. Single Shot was broken as the device tree is different on the Double Shot Board. Specifications: - Quad core Cortex-A72 (up to 2GHz) - DDR4 DIMM slot with optional ECC and single/dual chip select support - Dual 10GbE (1/2.5/10GbE) SFP+ 2.5GbE (1/2.5GbE) via SFP 1GbE via copper - SPI Flash - 3 X SATA 3.0 connectors - MicroSD connector - eMMC - PCI x4 3.0 slot - USB 2.0 Headers (Internal) - USB 3.0 connector - Console port (UART) over microUSB connector - 20-pin Connector for CPU JTAG debugger - 2 X UART Headers - 12V input via DC Jack - ATX type power connector - Form Factor: Mini-ITX (170 mm x 170 mm) More details at http://macchiatobin.net Installation: Write the Image to your Micro SD Card and insert it in the MACCHIATObin Single Shot SD Card Slot. In the U-Boot Environment: 1. reset U-Boot environment: env default -a saveenv 2. prepare U-Boot with boot script: setenv bootcmd "load mmc 1:1 0x4d00000 boot.scr; source 0x4d00000" saveenv or manually (hanging lines indicate wrapped one-line command): setenv fdt_name armada-8040-mcbin-singleshot.dtb setenv image_name Image setenv bootcmd 'mmc dev 1; ext4load mmc 1:1 $kernel_addr $image_name;ext4load mmc 1:1 $fdt_addr $fdt_name;setenv bootargs $console root=/dev/mmcblk1p2 rw rootwait; booti $kernel_addr - $fdt_addr' saveenv On newer Bootloaders (18.12) the Variables have been changed, use: setenv fdt_name armada-8040-mcbin-singleshot.dtb setenv image_name Image setenv bootcmd 'mmc dev 1; ext4load mmc 1:1 $kernel_addr_r $image_name;ext4load mmc 1:1 $fdt_addr_r $fdt_name;setenv bootargs $console root=/dev/mmcblk1p2 rw rootwait; booti $kernel_addr_r - $fdt_addr_r' Reported-by: Alexandra Alth Signed-off-by: Tomasz Maciej Nowak Tested-by: Alexandra Alth [add specs and installation as provided by Alexandra Alth] Signed-off-by: Adrian Schmutzler --- package/boot/uboot-envtools/files/mvebu | 3 ++- .../base-files/etc/board.d/02_network | 3 ++- .../base-files/lib/upgrade/platform.sh | 9 ++++++--- target/linux/mvebu/image/cortexa72.mk | 20 +++++++++++++++++-- 4 files changed, 28 insertions(+), 7 deletions(-) diff --git a/package/boot/uboot-envtools/files/mvebu b/package/boot/uboot-envtools/files/mvebu index 590000aae7..8ed1f87ead 100644 --- a/package/boot/uboot-envtools/files/mvebu +++ b/package/boot/uboot-envtools/files/mvebu @@ -24,7 +24,8 @@ globalscale,espressobin|\ globalscale,espressobin-emmc|\ globalscale,espressobin-v7|\ globalscale,espressobin-v7-emmc|\ -marvell,armada8040-mcbin-doubleshot) +marvell,armada8040-mcbin-doubleshot|\ +marvell,armada8040-mcbin-singleshot) ubootenv_add_uci_config "/dev/mtd0" "0x3f0000" "0x10000" "0x10000" "1" ;; linksys,wrt1200ac|\ diff --git a/target/linux/mvebu/cortexa72/base-files/etc/board.d/02_network b/target/linux/mvebu/cortexa72/base-files/etc/board.d/02_network index 32053d74e8..9ab3c8174d 100755 --- a/target/linux/mvebu/cortexa72/base-files/etc/board.d/02_network +++ b/target/linux/mvebu/cortexa72/base-files/etc/board.d/02_network @@ -11,7 +11,8 @@ board_config_update board=$(board_name) case "$board" in -marvell,armada8040-mcbin-doubleshot) +marvell,armada8040-mcbin-doubleshot|\ +marvell,armada8040-mcbin-singleshot) ucidef_set_interfaces_lan_wan "eth0 eth1 eth3" "eth2" ;; marvell,armada8040-db) diff --git a/target/linux/mvebu/cortexa72/base-files/lib/upgrade/platform.sh b/target/linux/mvebu/cortexa72/base-files/lib/upgrade/platform.sh index 75d2933f05..04ea634097 100755 --- a/target/linux/mvebu/cortexa72/base-files/lib/upgrade/platform.sh +++ b/target/linux/mvebu/cortexa72/base-files/lib/upgrade/platform.sh @@ -9,7 +9,8 @@ REQUIRE_IMAGE_METADATA=1 platform_check_image() { case "$(board_name)" in - marvell,armada8040-mcbin-doubleshot) + marvell,armada8040-mcbin-doubleshot|\ + marvell,armada8040-mcbin-singleshot) platform_check_image_sdcard "$1" ;; *) @@ -20,7 +21,8 @@ platform_check_image() { platform_do_upgrade() { case "$(board_name)" in - marvell,armada8040-mcbin-doubleshot) + marvell,armada8040-mcbin-doubleshot|\ + marvell,armada8040-mcbin-singleshot) platform_do_upgrade_sdcard "$1" ;; *) @@ -30,7 +32,8 @@ platform_do_upgrade() { } platform_copy_config() { case "$(board_name)" in - marvell,armada8040-mcbin-doubleshot) + marvell,armada8040-mcbin-doubleshot|\ + marvell,armada8040-mcbin-singleshot) platform_copy_config_sdcard ;; esac diff --git a/target/linux/mvebu/image/cortexa72.mk b/target/linux/mvebu/image/cortexa72.mk index 6e52109237..1440c07a0b 100644 --- a/target/linux/mvebu/image/cortexa72.mk +++ b/target/linux/mvebu/image/cortexa72.mk @@ -16,14 +16,30 @@ define Device/marvell_armada8040-db endef TARGET_DEVICES += marvell_armada8040-db -define Device/marvell_macchiatobin +define Device/marvell_macchiatobin-doubleshot $(call Device/Default-arm64) DEVICE_VENDOR := SolidRun DEVICE_MODEL := MACCHIATObin + DEVICE_VARIANT := Double Shot DEVICE_ALT0_VENDOR := SolidRun DEVICE_ALT0_MODEL := Armada 8040 Community Board + DEVICE_ALT0_VARIANT := Double Shot DEVICE_PACKAGES += kmod-i2c-mux-pca954x DEVICE_DTS := armada-8040-mcbin SUPPORTED_DEVICES := marvell,armada8040-mcbin-doubleshot marvell,armada8040-mcbin endef -TARGET_DEVICES += marvell_macchiatobin +TARGET_DEVICES += marvell_macchiatobin-doubleshot + +define Device/marvell_macchiatobin-singleshot + $(call Device/Default-arm64) + DEVICE_VENDOR := SolidRun + DEVICE_MODEL := MACCHIATObin + DEVICE_VARIANT := Single Shot + DEVICE_ALT0_VENDOR := SolidRun + DEVICE_ALT0_MODEL := Armada 8040 Community Board + DEVICE_ALT0_VARIANT := Single Shot + DEVICE_PACKAGES += kmod-i2c-mux-pca954x + DEVICE_DTS := armada-8040-mcbin-singleshot + SUPPORTED_DEVICES := marvell,armada8040-mcbin-singleshot +endef +TARGET_DEVICES += marvell_macchiatobin-singleshot