[OpenWrt-Devel] [PATCH] mvebu: split base-files across subtargets
For the mvebu target in particular, there is a lot of files in base-files that are only relevant for one subtarget. Improve overview and reduce size per subtarget by moving/splitting base-files depending on the subtarget they belong to. While at it, consolidate 01_leds by using the model part of the board name as variable. Signed-off-by: Adrian Schmutzler --- .../mvebu/base-files/etc/board.d/01_leds | 55 - .../mvebu/base-files/lib/upgrade/platform.sh | 52 .../base-files/etc/board.d/02_network | 31 ++ .../base-files/lib/preinit/82_uDPU| 0 .../base-files/lib/upgrade/platform.sh| 52 .../base-files/lib/upgrade/uDPU.sh| 0 .../base-files/etc/board.d/02_network | 30 ++ .../base-files/lib/upgrade/platform.sh| 37 .../cortexa9/base-files/etc/board.d/01_leds | 40 + .../base-files/etc/board.d/02_network | 24 +--- .../base-files/etc/init.d/bootcount | 0 .../base-files/etc/uci-defaults/03_wireless | 0 .../base-files/etc/uci-defaults/04_mambafan | 0 .../base-files/lib/preinit/06_set_iface_mac | 0 .../base-files/lib/preinit/81_linksys_syscfg | 0 .../base-files/lib/upgrade/linksys.sh | 0 .../base-files/lib/upgrade/platform.sh| 59 +++ 17 files changed, 251 insertions(+), 129 deletions(-) delete mode 100755 target/linux/mvebu/base-files/etc/board.d/01_leds delete mode 100755 target/linux/mvebu/base-files/lib/upgrade/platform.sh create mode 100755 target/linux/mvebu/cortexa53/base-files/etc/board.d/02_network rename target/linux/mvebu/{ => cortexa53}/base-files/lib/preinit/82_uDPU (100%) create mode 100755 target/linux/mvebu/cortexa53/base-files/lib/upgrade/platform.sh rename target/linux/mvebu/{ => cortexa53}/base-files/lib/upgrade/uDPU.sh (100%) create mode 100755 target/linux/mvebu/cortexa72/base-files/etc/board.d/02_network create mode 100755 target/linux/mvebu/cortexa72/base-files/lib/upgrade/platform.sh create mode 100755 target/linux/mvebu/cortexa9/base-files/etc/board.d/01_leds rename target/linux/mvebu/{ => cortexa9}/base-files/etc/board.d/02_network (66%) rename target/linux/mvebu/{ => cortexa9}/base-files/etc/init.d/bootcount (100%) rename target/linux/mvebu/{ => cortexa9}/base-files/etc/uci-defaults/03_wireless (100%) rename target/linux/mvebu/{ => cortexa9}/base-files/etc/uci-defaults/04_mambafan (100%) rename target/linux/mvebu/{ => cortexa9}/base-files/lib/preinit/06_set_iface_mac (100%) rename target/linux/mvebu/{ => cortexa9}/base-files/lib/preinit/81_linksys_syscfg (100%) rename target/linux/mvebu/{ => cortexa9}/base-files/lib/upgrade/linksys.sh (100%) create mode 100755 target/linux/mvebu/cortexa9/base-files/lib/upgrade/platform.sh diff --git a/target/linux/mvebu/base-files/etc/board.d/01_leds b/target/linux/mvebu/base-files/etc/board.d/01_leds deleted file mode 100755 index 14313ee664..00 --- a/target/linux/mvebu/base-files/etc/board.d/01_leds +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2014-2016 OpenWrt.org -# Copyright (C) 2016 LEDE-Project.org -# - -. /lib/functions/uci-defaults.sh - -board_config_update - -board=$(board_name) - -case "$board" in -linksys,caiman) - ucidef_set_led_netdev "wan" "WAN" "pca963x:caiman:white:wan" "eth1" - ucidef_set_led_usbport "usb1" "USB 1" "pca963x:caiman:white:usb2" "usb1-port1" - ucidef_set_led_usbport "usb2" "USB 2" "pca963x:caiman:white:usb3_1" "usb2-port1" "usb3-port1" - ucidef_set_led_usbport "usb2_ss" "USB 2 SS" "pca963x:caiman:white:usb3_2" "usb3-port1" - ;; -linksys,cobra) - ucidef_set_led_netdev "wan" "WAN" "pca963x:cobra:white:wan" "eth1" - ucidef_set_led_usbport "usb1" "USB 1" "pca963x:cobra:white:usb2" "usb1-port1" - ucidef_set_led_usbport "usb2" "USB 2" "pca963x:cobra:white:usb3_1" "usb2-port1" "usb3-port1" - ucidef_set_led_usbport "usb2_ss" "USB 2 SS" "pca963x:cobra:white:usb3_2" "usb3-port1" - ;; -linksys,mamba) - ucidef_set_led_netdev "wan" "WAN" "mamba:white:wan" "eth1" - ucidef_set_led_usbport "usb1" "USB 1" "mamba:white:usb2" "usb1-port1" - ucidef_set_led_usbport "usb2" "USB 2" "mamba:white:usb3_1" "usb2-port1" "usb3-port1" - ucidef_set_led_usbport "usb2_ss" "USB 2 SS" "mamba:white:usb3_2" "usb3-port2" - ;; -linksys,rango) - ucidef_set_led_netdev "wan" "WAN" "pca963x:rango:white:wan" "eth1" - ucidef_set_led_usbport "usb1" "USB 1" "pca963x:rango:white:usb2" "usb1-port1" - ucidef_set_led_usbport "usb2" "USB 2" "pca963x:rango:white:usb3_1" "usb2-port1" "usb3-port1" - ucidef_set_led_usbport "usb2_ss" "USB 2 SS" "pca963x:rango:white:usb3_2" "usb3-port1" - ;; -linksys,shelby) - ucidef_set_led_netdev "wan" "WAN" "pca963x:shelby:white:wan" "eth1" - ucidef_set_led_usbport "usb1" "USB 1" "pca963x:shelby:white:usb2" "usb1-port
[OpenWrt-Devel] [PATCH 2/2] mvebu: use SOC to derive DEVICE_DTS
This introduces the SOC variable to mvebu target to derive some of the DEVICE_DTS variables based on the SOC prefix and the device definition name. Since DTS names and compatible are inconsistent also in the kernel for this target, the scheme cannot be applied to all devices, though. While at it, change the DTS name of the armada-3720-udpu to lower-case, which is the common practice for DTS file names. Signed-off-by: Adrian Schmutzler --- .../{armada-3720-uDPU.dts => armada-3720-udpu.dts} | 0 target/linux/mvebu/image/Makefile | 1 + target/linux/mvebu/image/cortex-a53.mk | 10 +- target/linux/mvebu/image/cortex-a9.mk | 6 +++--- .../patches-4.19/530-add_armada-3820-uDPU-dts.patch| 2 +- 5 files changed, 10 insertions(+), 9 deletions(-) rename target/linux/mvebu/files-4.19/arch/arm64/boot/dts/marvell/{armada-3720-uDPU.dts => armada-3720-udpu.dts} (100%) diff --git a/target/linux/mvebu/files-4.19/arch/arm64/boot/dts/marvell/armada-3720-uDPU.dts b/target/linux/mvebu/files-4.19/arch/arm64/boot/dts/marvell/armada-3720-udpu.dts similarity index 100% rename from target/linux/mvebu/files-4.19/arch/arm64/boot/dts/marvell/armada-3720-uDPU.dts rename to target/linux/mvebu/files-4.19/arch/arm64/boot/dts/marvell/armada-3720-udpu.dts diff --git a/target/linux/mvebu/image/Makefile b/target/linux/mvebu/image/Makefile index 6dd7bde7ae..c08b113b36 100644 --- a/target/linux/mvebu/image/Makefile +++ b/target/linux/mvebu/image/Makefile @@ -77,6 +77,7 @@ endef define Device/Default PROFILES := Default + DEVICE_DTS = $$(SOC)-$(lastword $(subst _, ,$(1))) BOARD_NAME = $$(DEVICE_DTS) KERNEL_NAME := zImage KERNEL := kernel-bin | append-dtb | uImage none diff --git a/target/linux/mvebu/image/cortex-a53.mk b/target/linux/mvebu/image/cortex-a53.mk index e58a3c42b9..c9d06ddbad 100644 --- a/target/linux/mvebu/image/cortex-a53.mk +++ b/target/linux/mvebu/image/cortex-a53.mk @@ -6,7 +6,7 @@ define Device/globalscale_espressobin DEVICE_ALT0_VENDOR := Marvell DEVICE_ALT0_MODEL := Armada 3700 Community Board DEVICE_ALT0_VARIANT := Non-eMMC - DEVICE_DTS := armada-3720-espressobin + SOC := armada-3720 endef TARGET_DEVICES += globalscale_espressobin @@ -18,7 +18,7 @@ define Device/globalscale_espressobin-emmc DEVICE_ALT0_VENDOR := Marvell DEVICE_ALT0_MODEL := Armada 3700 Community Board DEVICE_ALT0_VARIANT := eMMC - DEVICE_DTS := armada-3720-espressobin-emmc + SOC := armada-3720 endef TARGET_DEVICES += globalscale_espressobin-emmc @@ -30,7 +30,7 @@ define Device/globalscale_espressobin-v7 DEVICE_ALT0_VENDOR := Marvell DEVICE_ALT0_MODEL := Armada 3700 Community Board DEVICE_ALT0_VARIANT := V7 Non-eMMC - DEVICE_DTS := armada-3720-espressobin-v7 + SOC := armada-3720 endef TARGET_DEVICES += globalscale_espressobin-v7 @@ -42,7 +42,7 @@ define Device/globalscale_espressobin-v7-emmc DEVICE_ALT0_VENDOR := Marvell DEVICE_ALT0_MODEL := Armada 3700 Community Board DEVICE_ALT0_VARIANT := V7 eMMC - DEVICE_DTS := armada-3720-espressobin-v7-emmc + SOC := armada-3720 endef TARGET_DEVICES += globalscale_espressobin-v7-emmc @@ -58,7 +58,7 @@ define Device/methode_udpu $(call Device/Default-arm64) DEVICE_VENDOR := Methode DEVICE_MODEL := micro-DPU (uDPU) - DEVICE_DTS := armada-3720-uDPU + SOC := armada-3720 KERNEL_LOADADDR := 0x0008 KERNEL_INITRAMFS := kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb KERNEL_INITRAMFS_SUFFIX := .itb diff --git a/target/linux/mvebu/image/cortex-a9.mk b/target/linux/mvebu/image/cortex-a9.mk index 389082e426..79253049c7 100644 --- a/target/linux/mvebu/image/cortex-a9.mk +++ b/target/linux/mvebu/image/cortex-a9.mk @@ -93,7 +93,7 @@ define Device/plathome_openblocks-ax3-4 DEVICE_VENDOR := Plat'Home DEVICE_MODEL := OpenBlocks AX3 DEVICE_VARIANT := 4 ports - DEVICE_DTS := armada-xp-openblocks-ax3-4 + SOC := armada-xp SUPPORTED_DEVICES += openblocks-ax3-4 BLOCKSIZE := 128k PAGESIZE := 1 @@ -193,7 +193,7 @@ define Device/globalscale_mirabox $(Device/NAND-512K) DEVICE_VENDOR := Globalscale DEVICE_MODEL := Mirabox - DEVICE_DTS := armada-370-mirabox + SOC := armada-370 SUPPORTED_DEVICES += mirabox endef TARGET_DEVICES += globalscale_mirabox @@ -212,7 +212,7 @@ define Device/cznic_turris-omnia IMAGE/$$(IMAGE_PREFIX)-sysupgrade.img.gz := boot-img | sdcard-img | gzip | append-metadata IMAGE/omnia-medkit-$$(IMAGE_PREFIX)-initramfs.tar.gz := omnia-medkit-initramfs | gzip IMAGE_NAME = $$(2) - DEVICE_DTS := armada-385-turris-omnia + SOC := armada-385 SUPPORTED_DEVICES += armada-385-turris-omnia endef TARGET_DEVICES += cznic_turris-omnia diff --git a/target/linux/mvebu/patches-4.19/530-add_armada-3820-uDPU-dts.patch b/target/linux/mvebu/patches-4.19/530-add_armada-3820-uDPU-dts.patch index bd4f0aef9a..635e141c69 100644 --- a/target/linux/mvebu/patches-4.19/530-add_armada-3820-uDPU-dts.patch +++ b
[OpenWrt-Devel] [PATCH 1/2] mvebu: move subtarget image Makefile switch to parent Makefile
This moves the if conditions for choosing which image Makefiles are used to the parent image/Makefile. It seems more convenient to have "codeflow" in the parent while the subtarget-specific files only contain the definitions. Signed-off-by: Adrian Schmutzler --- target/linux/mvebu/image/Makefile | 8 target/linux/mvebu/image/cortex-a53.mk | 4 target/linux/mvebu/image/cortex-a72.mk | 4 target/linux/mvebu/image/cortex-a9.mk | 4 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/target/linux/mvebu/image/Makefile b/target/linux/mvebu/image/Makefile index ce1344a547..6dd7bde7ae 100644 --- a/target/linux/mvebu/image/Makefile +++ b/target/linux/mvebu/image/Makefile @@ -116,8 +116,16 @@ define Device/NAND-512K PAGESIZE := 4096 endef +ifeq ($(SUBTARGET),cortexa9) include cortex-a9.mk +endif + +ifeq ($(SUBTARGET),cortexa53) include cortex-a53.mk +endif + +ifeq ($(SUBTARGET),cortexa72) include cortex-a72.mk +endif $(eval $(call BuildImage)) diff --git a/target/linux/mvebu/image/cortex-a53.mk b/target/linux/mvebu/image/cortex-a53.mk index f5313429af..e58a3c42b9 100644 --- a/target/linux/mvebu/image/cortex-a53.mk +++ b/target/linux/mvebu/image/cortex-a53.mk @@ -1,5 +1,3 @@ -ifeq ($(SUBTARGET),cortexa53) - define Device/globalscale_espressobin $(call Device/Default-arm64) DEVICE_VENDOR := Marvell @@ -73,5 +71,3 @@ define Device/methode_udpu BOOT_SCRIPT := udpu endef TARGET_DEVICES += methode_udpu - -endif diff --git a/target/linux/mvebu/image/cortex-a72.mk b/target/linux/mvebu/image/cortex-a72.mk index 5e619804e8..6abee2d8b9 100644 --- a/target/linux/mvebu/image/cortex-a72.mk +++ b/target/linux/mvebu/image/cortex-a72.mk @@ -1,5 +1,3 @@ -ifeq ($(SUBTARGET),cortexa72) - define Device/marvell_macchiatobin $(call Device/Default-arm64) DEVICE_VENDOR := SolidRun @@ -29,5 +27,3 @@ define Device/marvell_armada7040-db IMAGE/sdcard.img.gz := boot-img-ext4 | sdcard-img-ext4 | gzip | append-metadata endef TARGET_DEVICES += marvell_armada7040-db - -endif diff --git a/target/linux/mvebu/image/cortex-a9.mk b/target/linux/mvebu/image/cortex-a9.mk index c2ada75c2d..389082e426 100644 --- a/target/linux/mvebu/image/cortex-a9.mk +++ b/target/linux/mvebu/image/cortex-a9.mk @@ -6,8 +6,6 @@ # See /LICENSE for more information. # -ifeq ($(SUBTARGET),cortexa9) - define Device/linksys $(Device/NAND-128K) DEVICE_VENDOR := Linksys @@ -218,5 +216,3 @@ define Device/cznic_turris-omnia SUPPORTED_DEVICES += armada-385-turris-omnia endef TARGET_DEVICES += cznic_turris-omnia - -endif -- 2.20.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] zynq: derive DEVICE_DTS from device definition name
In zynq target, the DEVICE_DTS variable is always set consistent with the model part of the device definition name. This patch replaces the redundant definitions for the individual devices with a common recipe. Signed-off-by: Adrian Schmutzler --- target/linux/zynq/image/Makefile | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/target/linux/zynq/image/Makefile b/target/linux/zynq/image/Makefile index 39305a6d54..7cec38ca68 100644 --- a/target/linux/zynq/image/Makefile +++ b/target/linux/zynq/image/Makefile @@ -31,6 +31,7 @@ endef define Device/Default PROFILES := Default + DEVICE_DTS := $(lastword $(subst _, ,$(1))) KERNEL_DEPENDS = $$(wildcard $(DTS_DIR)/$$(DEVICE_DTS).dts) KERNEL_INITRAMFS_PREFIX := $$(IMG_PREFIX)-$(1)-initramfs KERNEL_PREFIX := $$(IMAGE_PREFIX) @@ -53,7 +54,6 @@ define Device/avnet_zynq-zed $(call Device/FitImageGzip) DEVICE_VENDOR := Avnet DEVICE_MODEL := ZedBoard - DEVICE_DTS := zynq-zed endef TARGET_DEVICES += avnet_zynq-zed @@ -61,7 +61,6 @@ define Device/digilent_zynq-zybo $(call Device/FitImageGzip) DEVICE_VENDOR := Digilent DEVICE_MODEL := Zybo - DEVICE_DTS := zynq-zybo endef TARGET_DEVICES += digilent_zynq-zybo @@ -69,7 +68,6 @@ define Device/digilent_zynq-zybo-z7 $(call Device/FitImageGzip) DEVICE_VENDOR := Digilent DEVICE_MODEL := Zybo Z7 - DEVICE_DTS := zynq-zybo-z7 endef TARGET_DEVICES += digilent_zynq-zybo-z7 @@ -77,7 +75,6 @@ define Device/xlnx_zynq-zc702 $(call Device/FitImageGzip) DEVICE_VENDOR := Xilinx DEVICE_MODEL := ZC702 - DEVICE_DTS := zynq-zc702 DEVICE_PACKAGES:=kmod-can kmod-can-xilinx-can endef TARGET_DEVICES += xlnx_zynq-zc702 -- 2.20.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] kirkwood: exploit BOARD_NAME to set DEVICE_DTS and SUPPORTED_DEVICES
Due to the history of the target, all devices added before a certain point have the same device string in BOARD_NAME, DEVICE_DTS and added to SUPPORTED_DEVICES. Thus, we can set this one automatically for all devices where BOARD_NAME is specified, removing the explicit DEVICE_DTS and SUPPORTED_DEVICES addition there. For new devices, nothing has changed, and just DEVICE_DTS has to be set manually. Signed-off-by: Adrian Schmutzler --- target/linux/kirkwood/image/Makefile | 22 ++ 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/target/linux/kirkwood/image/Makefile b/target/linux/kirkwood/image/Makefile index 7b59b69c1d..9c5681901c 100644 --- a/target/linux/kirkwood/image/Makefile +++ b/target/linux/kirkwood/image/Makefile @@ -12,6 +12,7 @@ KERNEL_LOADADDR:=0x8000 define Device/Default PROFILES := Default + DEVICE_DTS = $$(if $$(BOARD_NAME),kirkwood-$$(BOARD_NAME),) KERNEL_DEPENDS = $$(wildcard $(DTS_DIR)/$$(DEVICE_DTS).dts) KERNEL := kernel-bin | append-dtb | uImage none KERNEL_NAME := zImage @@ -24,13 +25,12 @@ define Device/Default IMAGES := sysupgrade.bin factory.bin IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata IMAGE/factory.bin := append-ubi - SUPPORTED_DEVICES := $(subst _,$(comma),$(1)) + SUPPORTED_DEVICES = $(subst _,$(comma),$(1)) $$(BOARD_NAME) endef define Device/cisco_on100 DEVICE_VENDOR := Cisco Systems DEVICE_MODEL := ON100 - DEVICE_DTS := kirkwood-on100 DEVICE_PACKAGES := kmod-i2c-mv64xxx KERNEL_SIZE := 5376k KERNEL_IN_UBI := @@ -43,9 +43,7 @@ TARGET_DEVICES += cisco_on100 define Device/cloudengines_pogoe02 DEVICE_VENDOR := Cloud Engines DEVICE_MODEL := Pogoplug E02 - DEVICE_DTS := kirkwood-pogo_e02 BOARD_NAME := pogo_e02 - SUPPORTED_DEVICES += pogo_e02 endef TARGET_DEVICES += cloudengines_pogoe02 @@ -60,9 +58,7 @@ TARGET_DEVICES += cloudengines_pogoplugv4 define Device/iom_iconnect-1.1 DEVICE_VENDOR := Iomega DEVICE_MODEL := Iconnect - DEVICE_DTS := kirkwood-iconnect BOARD_NAME := iconnect - SUPPORTED_DEVICES += iconnect endef TARGET_DEVICES += iom_iconnect-1.1 @@ -87,7 +83,6 @@ define Device/linksys_audi DEVICE_VENDOR := Linksys DEVICE_MODEL := EA3500 (Audi) DEVICE_PACKAGES := kmod-mwl8k swconfig wpad-basic kmod-gpio-button-hotplug - DEVICE_DTS := kirkwood-linksys-audi PAGESIZE := 512 SUBPAGESIZE := 256 BLOCKSIZE := 16KiB @@ -96,7 +91,6 @@ define Device/linksys_audi UBINIZE_OPTS := -E 5 IMAGE/factory.bin := append-kernel | pad-to (KERNEL_SIZE) | append-ubi BOARD_NAME := linksys-audi - SUPPORTED_DEVICES += linksys-audi endef TARGET_DEVICES += linksys_audi @@ -104,56 +98,45 @@ define Device/linksys_viper DEVICE_VENDOR := Linksys DEVICE_MODEL := E4200v2 / EA4500 (Viper) DEVICE_PACKAGES := kmod-mwl8k swconfig wpad-basic kmod-gpio-button-hotplug - DEVICE_DTS := kirkwood-linksys-viper KERNEL_SIZE := 2688k KERNEL_IN_UBI := UBINIZE_OPTS := -E 5 IMAGE/factory.bin := append-kernel | pad-to (KERNEL_SIZE) | append-ubi BOARD_NAME := linksys-viper - SUPPORTED_DEVICES += linksys-viper endef TARGET_DEVICES += linksys_viper define Device/raidsonic_ib-nas62x0 DEVICE_VENDOR := RaidSonic DEVICE_MODEL := ICY BOX IB-NAS62x0 - DEVICE_DTS := kirkwood-ib62x0 BOARD_NAME := ib62x0 - SUPPORTED_DEVICES += ib62x0 endef TARGET_DEVICES += raidsonic_ib-nas62x0 define Device/seagate_dockstar DEVICE_VENDOR := Seagate DEVICE_MODEL := FreeAgent Dockstar - DEVICE_DTS := kirkwood-dockstar BOARD_NAME := dockstar - SUPPORTED_DEVICES += dockstar endef TARGET_DEVICES += seagate_dockstar define Device/seagate_goflexnet DEVICE_VENDOR := Seagate DEVICE_MODEL := GoFlexNet - DEVICE_DTS := kirkwood-goflexnet BOARD_NAME := goflexnet - SUPPORTED_DEVICES += goflexnet endef TARGET_DEVICES += seagate_goflexnet define Device/seagate_goflexhome DEVICE_VENDOR := Seagate DEVICE_MODEL := GoFlexHome - DEVICE_DTS := kirkwood-goflexhome BOARD_NAME := goflexhome - SUPPORTED_DEVICES += goflexhome endef TARGET_DEVICES += seagate_goflexhome define Device/zyxel_nsa310b DEVICE_VENDOR := ZyXEL DEVICE_MODEL := NSA310b - DEVICE_DTS := kirkwood-nsa310b DEVICE_PACKAGES := kmod-r8169 kmod-gpio-button-hotplug kmod-hwmon-lm85 BOARD_NAME := nsa310b endef @@ -163,7 +146,6 @@ define Device/zyxel_nsa325 DEVICE_VENDOR := ZyXEL DEVICE_MODEL := NSA325 DEVICE_VARIANT := v1/v2 - DEVICE_DTS := kirkwood-nsa325 DEVICE_PACKAGES := kmod-gpio-button-hotplug kmod-rtc-pcf8563 kmod-usb3 BOARD_NAME := nsa325 endef -- 2.20.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] octeon: apply vendor_model scheme to device definition/image name
This updates the device definition name for octeon target to provide more useful names for the images and be consistent with the increasing number of targets following that scheme. Since the target is not using device tree yet, this does not touch board_name and thus sets BOARD_NAME in image Makefile to ensure sysupgrade is still working. Signed-off-by: Adrian Schmutzler --- target/linux/octeon/image/Makefile | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/target/linux/octeon/image/Makefile b/target/linux/octeon/image/Makefile index 42bd5df1da..cb79a9ddf5 100644 --- a/target/linux/octeon/image/Makefile +++ b/target/linux/octeon/image/Makefile @@ -30,19 +30,21 @@ endef TARGET_DEVICES += generic ER_CMDLINE:=-mtdparts=phys_mapped_flash:640k(boot0)ro,640k(boot1)ro,64k(eeprom)ro root=/dev/mmcblk0p2 rootfstype=squashfs,ext4 rootwait -define Device/er +define Device/ubnt_edgerouter DEVICE_VENDOR := Ubiquiti DEVICE_MODEL := EdgeRouter - CMDLINE := $(ER_CMDLINE) + BOARD_NAME := er + CMDLINE := $(ER_CMDLINE) endef -TARGET_DEVICES += er +TARGET_DEVICES += ubnt_edgerouter ERLITE_CMDLINE:=-mtdparts=phys_mapped_flash:512k(boot0)ro,512k(boot1)ro,64k(eeprom)ro root=/dev/sda2 rootfstype=squashfs,ext4 rootwait -define Device/erlite +define Device/ubnt_edgerouter-lite DEVICE_VENDOR := Ubiquiti DEVICE_MODEL := EdgeRouter Lite - CMDLINE := $(ERLITE_CMDLINE) + BOARD_NAME := erlite + CMDLINE := $(ERLITE_CMDLINE) endef -TARGET_DEVICES += erlite +TARGET_DEVICES += ubnt_edgerouter-lite $(eval $(call BuildImage)) -- 2.20.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] octeon: remove redundant network setup
No need to have specific setup when default case does the same. Signed-off-by: Adrian Schmutzler --- target/linux/octeon/base-files/etc/board.d/01_network | 4 1 file changed, 4 deletions(-) diff --git a/target/linux/octeon/base-files/etc/board.d/01_network b/target/linux/octeon/base-files/etc/board.d/01_network index 79e508955e..f5c8175c54 100755 --- a/target/linux/octeon/base-files/etc/board.d/01_network +++ b/target/linux/octeon/base-files/etc/board.d/01_network @@ -8,10 +8,6 @@ board_config_update case "$(board_name)" in -erlite) - ucidef_set_interfaces_lan_wan "eth0" "eth1" - ;; - *) ucidef_set_interfaces_lan_wan "eth0" "eth1" ;; -- 2.20.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCHv2] 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 --- v2: enclose command -v in $(). 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 207fe96ce6..bc67e65edc 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 @@ -265,7 +265,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 -- 2.24.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCHv2] base-files/functions.sh: use grep -q instead of []
It's cleaner and faster as it does not need to do extra work. Also removed $() to avoid executing the output. The shell can handle it. https://github.com/koalaman/shellcheck/wiki/SC2143 Signed-off-by: Rosen Penev --- v2: Fixed &&/|| typo. package/base-files/files/lib/functions.sh | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh index 8e189e4f4d..207fe96ce6 100755 --- a/package/base-files/files/lib/functions.sh +++ b/package/base-files/files/lib/functions.sh @@ -326,7 +326,7 @@ group_add_next() { fi gids=$(cut -d: -f3 ${IPKG_INSTROOT}/etc/group) gid=65536 - while [ -n "$(echo "$gids" | grep "^$gid$")" ] ; do + while echo "$gids" | grep -q "^$gid$"; do gid=$((gid + 1)) done group_add $1 $gid @@ -336,8 +336,8 @@ group_add_next() { group_add_user() { local grp delim="," grp=$(grep -s "^${1}:" ${IPKG_INSTROOT}/etc/group) - [ -z "$(echo $grp | cut -d: -f4 | grep $2)" ] || return - [ -n "$(echo $grp | grep ":$")" ] && delim="" + echo "$grp" | cut -d: -f4 | grep -q $2 || return + echo "$grp" | grep -q ":$" && delim="" [ -n "$IPKG_INSTROOT" ] || lock /var/lock/passwd sed -i "s/$grp/$grp$delim$2/g" ${IPKG_INSTROOT}/etc/group [ -n "$IPKG_INSTROOT" ] || lock -u /var/lock/passwd @@ -354,7 +354,7 @@ user_add() { [ -z "$uid" ] && { uids=$(cut -d: -f3 ${IPKG_INSTROOT}/etc/passwd) uid=65536 - while [ -n "$(echo "$uids" | grep "^$uid$")" ] ; do + while echo "$uids" | grep -q "^$uid$"; do uid=$((uid + 1)) done } -- 2.24.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] OpenWrt 20.X release plans
Hello, On 1/17/20 11:14 AM, Andreas Ziegler wrote: > Hi, > > although i'm more a user than a developer, i would also prefer a sooner > release based on 4.19 over a later release based on 5.4. I have the same feeling. The state of many targets on 4.19 is pretty good IMHO. So i think a timely release somewhere around march/april is possible (as soon as the ramips situation is sorted out). I think we can aim for a 5.4 release somewhere in late autumn / winter, as targets will be gradually migrated. Best wishes David > Maybe it's the same problem, too atheros-centric ;-) > > Regards > > Andreas > > Michal Cieslakiewicz wrote on 16.01.20 19:43: >> Hi! >> >> Speaking as a small part-time contributor of some Netgear WN(D)R routers >> code, please reconsider if jumping over 4.19 straight to 5.4 is not a >> too big leap. I'm sure kernel devs here knows better than me how many >> OpenWrt drivers, quirks and enhancements can be ported without too much >> effort from 4.14 to 5.4 that will really benefit from newer 5.x code, >> but here are my 5 cents. >> >> I was able to port ar934x-nand code from ar71xx 4.4 kernels to ath79 & >> device-tree 4.19 without going too deep into low-level NAND operations >> thanks to only minor changes in kernel code. 5.4 apparently deprecates >> some functions in that area providing 'legacy' knobs for >> who-knows-how-long. If this particular flash driver won't work with 5.4 >> at the time of 20.x, routers using it (like WNDR4300 and >> other AR9344-based) effectively will not have any stable OpenWrt >> release supporting it even though they were in master since the end of >> 2019. >> >> IMHO OpenWrt should have an one final, rock-stable release based on >> latest 4.x LTS kernel (4.19 that is) with ath79 replacing ar71xx >> whenever possible. >> >> Apologies for being so Atheros-centric :-) >> >> Cheers >> Michal >> >> ___ >> openwrt-devel mailing list >> openwrt-devel@lists.openwrt.org >> https://lists.openwrt.org/mailman/listinfo/openwrt-devel >> > > ___ > openwrt-devel mailing list > openwrt-devel@lists.openwrt.org > https://lists.openwrt.org/mailman/listinfo/openwrt-devel > ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] build: Add KBUILD_HOSTLDLIBS
In Linux kernel commit 8377bd2b9ee1 ("kbuild: Rename HOST_LOADLIBES to KBUILD_HOSTLDLIBS") HOST_LOADLIBES was renamed to KBUILD_HOSTLDLIBS. This patch adapts the OpenWrt kernel build to this new variable. Without this change the kernel host tools would not link against the libraries found in the staging directory. Signed-off-by: Hauke Mehrtens --- include/kernel.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/include/kernel.mk b/include/kernel.mk index 38331768ed..b1b1e9e9c8 100644 --- a/include/kernel.mk +++ b/include/kernel.mk @@ -114,6 +114,7 @@ KERNEL_MAKE_FLAGS = \ KBUILD_BUILD_TIMESTAMP="$(KBUILD_BUILD_TIMESTAMP)" \ KBUILD_BUILD_VERSION="0" \ HOST_LOADLIBES="-L$(STAGING_DIR_HOST)/lib" \ + KBUILD_HOSTLDLIBS="-L$(STAGING_DIR_HOST)/lib" \ CONFIG_SHELL="$(BASH)" \ $(if $(findstring c,$(OPENWRT_VERBOSE)),V=1,V='') \ $(if $(PKG_BUILD_ID),LDFLAGS_MODULE=--build-id=0x$(PKG_BUILD_ID)) \ -- 2.17.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH procd v4] instance: fix pidfile and seccomp attributes double free
Commit a5af33ce9a16 ("instance: strdup string attributes") has introduced duplication of various string attributes in order to fix use-after-free, but missed handling of `pidfile` and `seccomp` attribute cases in instance_config_move() where the new value of `pidfile` or `seccomp` is being copied/assigned. Source of this values is then free()d in subsequent call to instance_free() and then again for 2nd time during the service stop command handling, leading to double free crash: #0 unmap_chunk at src/malloc/malloc.c:515 #1 free at src/malloc/malloc.c:526 #2 instance_free (in=0xd5e300) at instance.c:1100 #3 instance_delete (in=0xd5e300) at instance.c:559 #4 instance_stop (in=0xd5e300, halt=true) at instance.c:611 While at it, add missing handling of jail.name and jail.hostname attributes as well. Ref: FS#2723 Fixes: a5af33ce9a16 ("instance: strdup string attributes") Signed-off-by: Daniel Golle Signed-off-by: Petr Štetiar --- changes since v3: * prevent double free, again * follow DRY and use instance_config_move_strdup service/instance.c | 22 -- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/service/instance.c b/service/instance.c index ce5233807dbb..ee258687c3cf 100644 --- a/service/instance.c +++ b/service/instance.c @@ -1018,6 +1018,21 @@ instance_config_cleanup(struct service_instance *in) blobmsg_list_free(&in->jail.mount); } +static void +instance_config_move_strdup(char **dst, char *src) +{ + if (!*dst) + return; + + free(*dst); + *dst = NULL; + + if (!src) + return; + + *dst = strdup(src); +} + static void instance_config_move(struct service_instance *in, struct service_instance *in_src) { @@ -1031,17 +1046,20 @@ instance_config_move(struct service_instance *in, struct service_instance *in_sr blobmsg_list_move(&in->jail.mount, &in_src->jail.mount); in->trigger = in_src->trigger; in->command = in_src->command; - in->pidfile = in_src->pidfile; in->respawn = in_src->respawn; in->respawn_retry = in_src->respawn_retry; in->respawn_threshold = in_src->respawn_threshold; in->respawn_timeout = in_src->respawn_timeout; in->name = in_src->name; in->trace = in_src->trace; - in->seccomp = in_src->seccomp; in->node.avl.key = in_src->node.avl.key; in->syslog_facility = in_src->syslog_facility; + instance_config_move_strdup(&in->pidfile, in_src->pidfile); + instance_config_move_strdup(&in->seccomp, in_src->seccomp); + instance_config_move_strdup(&in->jail.name, in_src->jail.name); + instance_config_move_strdup(&in->jail.hostname, in_src->jail.hostname); + free(in->config); in->config = in_src->config; in_src->config = NULL; ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH v4] ath79: add support for TP-Link TL-MR6400
Hi, > -Original Message- > From: Filip Moc [mailto:l...@moc6.cz] > Sent: Freitag, 17. Januar 2020 13:53 > To: Adrian Schmutzler > Cc: openwrt-devel@lists.openwrt.org; Enrico Mioso > Subject: Re: [PATCH v4] ath79: add support for TP-Link TL-MR6400 > > Hi, > > thanks for patch. Good to see support for MR6400 possibly going to ath79. > > Just to clarify known issues. > The first two issues are both just the same thing. Yes, obviously ... > Problem with interface showing always as up with carrier is with eth0, not > eth1 > (eth0 is LAN1 to LAN3, eth1 is LAN4/WAN). Yes. I would adjust to the following during merge: "- LTE module does not always come up during boot (showing USB enumeration errors). Similar behavior has been reported at least from one user for ar71xx, too. Turning USB off and on again will serve as a workaround. - eth0 (LAN) always shows carrier as 1 even if no cable is plugged in (this works "correctly" on ar71xx)" Best Adrian openpgp-digital-signature.asc Description: PGP signature ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH v4] ath79: add support for TP-Link TL-MR6400
The sender domain has a DMARC Reject/Quarantine policy which disallows sending mailing list messages using the original "From" header. To mitigate this problem, the original message has been wrapped automatically by the mailing list software.--- Begin Message --- Hi, thanks for patch. Good to see support for MR6400 possibly going to ath79. Just to clarify known issues. The first two issues are both just the same thing. Problem with interface showing always as up with carrier is with eth0, not eth1 (eth0 is LAN1 to LAN3, eth1 is LAN4/WAN). Filip On Fri, Jan 17, 2020 at 01:15:52PM +0100, Adrian Schmutzler wrote: > From: Enrico Mioso > > This device is an LTE router supported in ar71xx so far. > As per original commit, hardware specifications (v1.0 EU): > - SoC: QCA9531 > - Flash: Winbond W25Q64FV (8MiB) > - RAM: EtronTech EM6AB160TSE-5G (64MiB) > - Wireless: SoC platform only (2.4GHz b/g/n, 2x internal antenna) > - Ethernet: 2NIC (3x100M + 1x100M) > - WWAN: TP-LINK LTE MODULE (2x external detachable antenna) > - Power: DC 12V 1A > > Flashing instructions: > You can flash via tftp recovery (serve factory image as > /mr6400_tp_recovery.bin > on 192.168.0.66/24, connect to any ethernet port and power on device while > holding the reset button). Flashing via OEM web interface does not work. > > Known issues: > - LTE module does not always come up during boot. This can be fixed by turning > it off and on again. > - As it happened occasionally in ar71xx, during bursty flash activity, LTE > module init will fail, with USB enumeration errors. > - eth1 (LAN) always shows carrier as 1 even if no cable is plugged in (this > works "correctly" on ar71xx) > > Signed-off-by: Enrico Mioso > [rebase and several adjustments] > Signed-off-by: Adrian Schmutzler > Tested-by: Filip Moc > --- > .../ath79/dts/qca9531_tplink_tl-mr6400-v1.dts | 167 ++ > .../generic/base-files/etc/board.d/01_leds| 5 + > .../generic/base-files/etc/board.d/02_network | 5 + > target/linux/ath79/image/generic-tp-link.mk | 12 ++ > 4 files changed, 189 insertions(+) > create mode 100644 target/linux/ath79/dts/qca9531_tplink_tl-mr6400-v1.dts > > diff --git a/target/linux/ath79/dts/qca9531_tplink_tl-mr6400-v1.dts > b/target/linux/ath79/dts/qca9531_tplink_tl-mr6400-v1.dts > new file mode 100644 > index 00..7299257cda > --- /dev/null > +++ b/target/linux/ath79/dts/qca9531_tplink_tl-mr6400-v1.dts > @@ -0,0 +1,167 @@ > +// SPDX-License-Identifier: GPL-2.0-or-later > +/dts-v1/; > + > +#include > +#include > + > +#include "qca953x.dtsi" > + > +/ { > + compatible = "tplink,tl-mr6400-v1", "qca,qca9531"; > + model = "TP-Link TL-MR6400 v1"; > + > + aliases { > + led-boot = &led_power; > + led-failsafe = &led_power; > + led-running = &led_power; > + led-upgrade = &led_power; > + label-mac-device = &wmac; > + }; > + > + leds { > + compatible = "gpio-leds"; > + > + /* D12 */ > + wan { > + label = "tp-link:white:wan"; > + gpios = <&gpio 0 GPIO_ACTIVE_HIGH>; > + }; > + > + /* D11 */ > + 4g { > + label = "tp-link:white:4g"; > + gpios = <&gpio 1 GPIO_ACTIVE_HIGH>; > + }; > + > + /* D5 */ > + wps { > + label = "tp-link:white:wps"; > + gpios = <&gpio 3 GPIO_ACTIVE_HIGH>; > + }; > + > + /* D3 */ > + wlan { > + label = "tp-link:white:wlan"; > + gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; > + linux,default-trigger = "phy0tpt"; > + }; > + > + /* D2 */ > + led_power: power { > + label = "tp-link:white:power"; > + gpios = <&gpio 13 GPIO_ACTIVE_HIGH>; > + }; > + > + /* D4 */ > + lan { > + label = "tp-link:white:lan"; > + gpios = <&gpio 16 GPIO_ACTIVE_HIGH>; > + }; > + }; > + > + keys { > + compatible = "gpio-keys"; > + > + /* SW2 */ > + reset { > + label = "Reset button"; > + linux,code = ; > + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; > + debounce-interval = <60>; > + }; > + > + /* SW3 */ > + rfkill { > + label = "RF kill button"; > + linux,code = ; > + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; > + debounce-interval = <60>; > + }; > + }; > + > + gpio-export { > + compatible = "gpio-export"; > + > + gpio_usb_power { > + gpio-export,name = "tp-link:power:lte"; > +
Re: [OpenWrt-Devel] OpenWrt 20.X release plans
On 16/01/2020, Hauke Mehrtens wrote: > Hi, > > I meet with jow about 2 weeks ago and we talked about a lot of OpenWrt > related stuff, one of the topics was the release after 19.07. > > As the 19.07 release is now done, I would like to follow up on this topic. > > We thought that the time between the 19.07 branch and the final release > was way too long, this should be much shorter in the next release, we > should target 8 weeks for that. > > My preferred timeline would the the following: > * Beginning of February: freeze master for big changes (adding new > boards is no problem) > * Beginning of March: branch off 20.3 release branch > * 1 week after the branch was created: tag and build 20.3-rc1 > * 3 weeks later tag and build 20.3-rc2 > * 3 weeks later tag and build 20.3 final > > Then we would do the next final release in May 2020. > > This plan is based on using kernel 4.19, if we use kernel 5.4 I would > assume we have to shift all dates by 3 months, so branch off in > beginning of June and final release in August. > And then come summer vacations and other reasons to not be able to finish it on time so it would be delayed probably even few more months... On 16/01/2020, Petr Štetiar wrote: > > Yeah, we're all aware about that. If we decide to skip 4.19, we're partialy > throwing away a lot of work, You said it. Thus it's better to release based on 4.19 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] ath79: add support for TP-Link TL-MR6400
Hi, I've just sent an updated patch ("v4") to the list. Some comments below. > -Original Message- > From: Filip Moc [mailto:l...@moc6.cz] > Sent: Donnerstag, 16. Januar 2020 22:27 > To: Adrian Schmutzler > Cc: 'Enrico Mioso' ; openwrt-devel@lists.openwrt.org > Subject: Re: [OpenWrt-Devel] [PATCH] ath79: add support for TP-Link TL-MR6400 > > Hi, > > > Would you provide a proper Tested-by? > Sure, you can add "Tested-by: Filip Moc " line as needed. > > > We will definitely have to use ucidef_set_led_switch here. Are you sure > > about > the port mask? > Yes I checked. > 0x2 = LAN1, 0x4 = LAN3, 0x8 = LAN2 so 0x2 | 0x4 | 0x8 = 0xE > > > What about the port order? Can you please verify the assignment of external > port number vs. internal ports (just stupidly connect a cable and check with > swconfig which port it is attached to)? > Matches ordering above. > switch0 Port 0 = SoC > switch0 Port 1 = External LAN1 > switch0 Port 2 = External LAN3 > switch0 Port 3 = External LAN2 > switch0 Port 4 = always down Okay, so my current reassignment for LuCi is correct. > > > Can you provide a detailed explanation of what you observe (what do you use > for visualization of "link status detection")? > Simply type "ip link show dev eth0". When there is a link on any port of > switch > it should be UP with carrier (not saying "NO-CARRIER"). When there is no link > on any external switch port it should say "NO-CARRIER". > This works fine on ar71xx. On ath79 it never says "NO-CARRIER" on eth0 even > when there's no cable connected to switch at all. > Another way to check for carrier is "cat /sys/class/net/eth0/carrier". > This is always 1 on ath79. > > This causes some problems such as LED not showing link status with netdev > trigger and device won't behave optimally in many obvious network situations. > And of course also breaks user scripts relying on eth0 link detection. > > Also when you're remotely troubleshooting some network issues one of first > things you do after you ssh to the device is usually typing "ip a". It can > save > you a lot of time when you see NO-CARRIER on eth0 when it shouldn't be there. > This way it's confusingly telling the opposite. I understand. I added a corresponding remark to known issues. However, I do not consider this a blocker for merging. This would be something where 981213 could enlighten us, but I think he is short on time at the moment. > > > Do you refer to something specific in the boot process when you say > "unreliable boot", or is this just backed up by the observation of the > non-working > LTE module? At the moment, this sounds to me like we could just put it in > "Known issues". Can you provide a short piece of text for that (to be put in > the > commit message)? > Sometimes after boot LTE module is not working (not visible as USB device at > all). > Relevant lines in dmesg: > [5.662821] usb 1-1: new high-speed USB device number 2 using ehci-platform > [ 10.884716] usb 1-1: device descriptor read/64, error -145 > [ 16.244841] usb 1-1: device descriptor read/64, error -71 > [ 16.574819] usb 1-1: new high-speed USB device number 3 using ehci-platform > [ 21.799081] usb 1-1: device descriptor read/64, error -145 > [ 27.174820] usb 1-1: device descriptor read/64, error -71 > [ 27.294901] usb usb1-port1: attempt power cycle > [ 28.116145] usb 1-1: new high-speed USB device number 4 using ehci-platform > [ 33.574719] usb 1-1: device not accepting address 4, error -71 > [ 33.724710] usb 1-1: new high-speed USB device number 5 using ehci-platform > [ 39.174715] usb 1-1: device not accepting address 5, error -71 > [ 39.180824] usb usb1-port1: unable to enumerate USB device > > Possible workaround is to check whether LTE module is available after boot. > E.g. interface usb0 is present, 'adb devices' shows the device, relevant > symlinks are present in /sys/bus/usb/devices/. > When LTE module is not available power-cycle it. E.g by running this command: > (cd /sys/class/gpio/tp-link\:power\:lte/ && echo 0 > value && sleep 1 && echo > 1 > > value) Same as above: I'm in favor of burying this as known issue for now. I'm not sure yet whether we should include the workaround in the commit message or whether this is too "trivial" ;-). > > > Are there bug report/discussions to link? > Enrico mentioned it earlier in this thread and also reported it to me few > years > ago (on ar71xx). He also did some research on why it does work on stock > firmware. Though he didn't seem to find any obvious workaround used by stock > firmware. Maybe Enrico could post his findings here. > I don't recall anyone else who reported this but I doubt there won't be anyone > else affected. > Since I have this problem only on ath79 and Enrico has this problem also on > ar71xx it is also possible that there are in fact two different problems. > > > And does the device have a MAC address printed on it? I would assume the > one from WiFi? > wlan0 has ex
[OpenWrt-Devel] [PATCH v4] ath79: add support for TP-Link TL-MR6400
From: Enrico Mioso This device is an LTE router supported in ar71xx so far. As per original commit, hardware specifications (v1.0 EU): - SoC: QCA9531 - Flash: Winbond W25Q64FV (8MiB) - RAM: EtronTech EM6AB160TSE-5G (64MiB) - Wireless: SoC platform only (2.4GHz b/g/n, 2x internal antenna) - Ethernet: 2NIC (3x100M + 1x100M) - WWAN: TP-LINK LTE MODULE (2x external detachable antenna) - Power: DC 12V 1A Flashing instructions: You can flash via tftp recovery (serve factory image as /mr6400_tp_recovery.bin on 192.168.0.66/24, connect to any ethernet port and power on device while holding the reset button). Flashing via OEM web interface does not work. Known issues: - LTE module does not always come up during boot. This can be fixed by turning it off and on again. - As it happened occasionally in ar71xx, during bursty flash activity, LTE module init will fail, with USB enumeration errors. - eth1 (LAN) always shows carrier as 1 even if no cable is plugged in (this works "correctly" on ar71xx) Signed-off-by: Enrico Mioso [rebase and several adjustments] Signed-off-by: Adrian Schmutzler Tested-by: Filip Moc --- .../ath79/dts/qca9531_tplink_tl-mr6400-v1.dts | 167 ++ .../generic/base-files/etc/board.d/01_leds| 5 + .../generic/base-files/etc/board.d/02_network | 5 + target/linux/ath79/image/generic-tp-link.mk | 12 ++ 4 files changed, 189 insertions(+) create mode 100644 target/linux/ath79/dts/qca9531_tplink_tl-mr6400-v1.dts diff --git a/target/linux/ath79/dts/qca9531_tplink_tl-mr6400-v1.dts b/target/linux/ath79/dts/qca9531_tplink_tl-mr6400-v1.dts new file mode 100644 index 00..7299257cda --- /dev/null +++ b/target/linux/ath79/dts/qca9531_tplink_tl-mr6400-v1.dts @@ -0,0 +1,167 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/dts-v1/; + +#include +#include + +#include "qca953x.dtsi" + +/ { + compatible = "tplink,tl-mr6400-v1", "qca,qca9531"; + model = "TP-Link TL-MR6400 v1"; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + label-mac-device = &wmac; + }; + + leds { + compatible = "gpio-leds"; + + /* D12 */ + wan { + label = "tp-link:white:wan"; + gpios = <&gpio 0 GPIO_ACTIVE_HIGH>; + }; + + /* D11 */ + 4g { + label = "tp-link:white:4g"; + gpios = <&gpio 1 GPIO_ACTIVE_HIGH>; + }; + + /* D5 */ + wps { + label = "tp-link:white:wps"; + gpios = <&gpio 3 GPIO_ACTIVE_HIGH>; + }; + + /* D3 */ + wlan { + label = "tp-link:white:wlan"; + gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy0tpt"; + }; + + /* D2 */ + led_power: power { + label = "tp-link:white:power"; + gpios = <&gpio 13 GPIO_ACTIVE_HIGH>; + }; + + /* D4 */ + lan { + label = "tp-link:white:lan"; + gpios = <&gpio 16 GPIO_ACTIVE_HIGH>; + }; + }; + + keys { + compatible = "gpio-keys"; + + /* SW2 */ + reset { + label = "Reset button"; + linux,code = ; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + /* SW3 */ + rfkill { + label = "RF kill button"; + linux,code = ; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + gpio-export { + compatible = "gpio-export"; + + gpio_usb_power { + gpio-export,name = "tp-link:power:lte"; + gpio-export,output = <0>; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&uart { + status = "okay"; +}; + +&spi { + status = "okay"; + + num-cs = <1>; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <2500>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + uboot: partition@0 { + label = "u-boot"; + reg = <0x00 0x02>; + read-only; +
Re: [OpenWrt-Devel] [PATCH 2/7] base-files/functions.sh: use grep -q instead of []
Hi, > - [ -z "$(echo $grp | cut -d: -f4 | grep $2)" ] || return > - [ -n "$(echo $grp | grep ":$")" ] && delim="" > + echo "$grp" | cut -d: -f4 | grep -q $2 || return > + echo "$grp" | grep -q ":$" || delim="" logic (&& ||) seems to be inverted here. Just send the fixed one as standalone patch, I will merge it then. Best Adrian openpgp-digital-signature.asc Description: PGP signature ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] OpenWrt 20.X release plans
Hi, although i'm more a user than a developer, i would also prefer a sooner release based on 4.19 over a later release based on 5.4. Maybe it's the same problem, too atheros-centric ;-) Regards Andreas Michal Cieslakiewicz wrote on 16.01.20 19:43: > Hi! > > Speaking as a small part-time contributor of some Netgear WN(D)R routers > code, please reconsider if jumping over 4.19 straight to 5.4 is not a > too big leap. I'm sure kernel devs here knows better than me how many > OpenWrt drivers, quirks and enhancements can be ported without too much > effort from 4.14 to 5.4 that will really benefit from newer 5.x code, > but here are my 5 cents. > > I was able to port ar934x-nand code from ar71xx 4.4 kernels to ath79 & > device-tree 4.19 without going too deep into low-level NAND operations > thanks to only minor changes in kernel code. 5.4 apparently deprecates > some functions in that area providing 'legacy' knobs for > who-knows-how-long. If this particular flash driver won't work with 5.4 > at the time of 20.x, routers using it (like WNDR4300 and > other AR9344-based) effectively will not have any stable OpenWrt > release supporting it even though they were in master since the end of > 2019. > > IMHO OpenWrt should have an one final, rock-stable release based on > latest 4.x LTS kernel (4.19 that is) with ath79 replacing ar71xx > whenever possible. > > Apologies for being so Atheros-centric :-) > > Cheers > Michal > > ___ > openwrt-devel mailing list > openwrt-devel@lists.openwrt.org > https://lists.openwrt.org/mailman/listinfo/openwrt-devel > ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH 3/7] base-files/functions.sh: use command -v instead of $(which)
On 2020-01-17 05:43, Rosen Penev wrote: > $(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 0e94162a1a..a8a4734413 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" You dropped the $() there, that looks wrong to me. - Felix ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel