[OpenWrt-Devel,v2] ath79: fix several issues for ZyXEL NBG6716
diff mbox series

Message ID 20191027233051.7840-1-freifunk@adrianschmutzler.de
State Accepted
Delegated to: John Crispin
Headers show
Series
  • [OpenWrt-Devel,v2] ath79: fix several issues for ZyXEL NBG6716
Related show

Commit Message

Adrian Schmutzler Oct. 27, 2019, 11:30 p.m. UTC
This fixes several issues introduced with ZyXEL NBG6716 support:
- Inhomogeneous indent
- Wrong ath10k MAC patching function
- Wrong brackets for pad-to in nand.mk
- Add missing DEVICE_MODEL
- Remove k2t.sh include (copy/paste leftover)

Fixes: 99835e09992b ("ath79: add support for ZyXEL NBG6716")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
---
 .../linux/ath79/dts/qca9558_zyxel_nbg6716.dts | 22 +++++++++----------
 target/linux/ath79/image/nand.mk              | 21 +++++++++---------
 .../etc/hotplug.d/firmware/11-ath10k-caldata  |  3 +--
 3 files changed, 23 insertions(+), 23 deletions(-)

Comments

Jeff Kletsky Oct. 29, 2019, 2:12 p.m. UTC | #1
On 10/27/19 4:30 PM, Adrian Schmutzler wrote:
> This fixes several issues introduced with ZyXEL NBG6716 support:
> - Inhomogeneous indent
> - Wrong ath10k MAC patching function
> - Wrong brackets for pad-to in nand.mk
> - Add missing DEVICE_MODEL
> - Remove k2t.sh include (copy/paste leftover)
>
> Fixes: 99835e09992b ("ath79: add support for ZyXEL NBG6716")
>
> Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
> ---
>   .../linux/ath79/dts/qca9558_zyxel_nbg6716.dts | 22 +++++++++----------
>   target/linux/ath79/image/nand.mk              | 21 +++++++++---------
>   .../etc/hotplug.d/firmware/11-ath10k-caldata  |  3 +--
>   3 files changed, 23 insertions(+), 23 deletions(-)
>
> [...]
>
> diff --git a/target/linux/ath79/image/nand.mk b/target/linux/ath79/image/nand.mk
> index c11ff6a257..049701a971 100644
> --- a/target/linux/ath79/image/nand.mk
> +++ b/target/linux/ath79/image/nand.mk
> @@ -1,13 +1,13 @@
>   # attention: only zlib compression is allowed for the boot fs
> -define  Build/zyxel-buildkerneljffs
> -        rm -rf  $(KDIR_TMP)/zyxelnbg6716
> -        mkdir -p $(KDIR_TMP)/zyxelnbg6716/image/boot
> -        cp $@ $(KDIR_TMP)/zyxelnbg6716/image/boot/vmlinux.lzma.uImage
> -        $(STAGING_DIR_HOST)/bin/mkfs.jffs2 \
> -                --big-endian --squash-uids -v -e 128KiB -q -f -n -x lzma -x rtime \
> -                -o $@ \
> -                -d $(KDIR_TMP)/zyxelnbg6716/image
> -        rm -rf $(KDIR_TMP)/zyxelnbg6716
> +define Build/zyxel-buildkerneljffs
> +	rm -rf  $(KDIR_TMP)/zyxelnbg6716
> +	mkdir -p $(KDIR_TMP)/zyxelnbg6716/image/boot
> +	cp $@ $(KDIR_TMP)/zyxelnbg6716/image/boot/vmlinux.lzma.uImage
> +	$(STAGING_DIR_HOST)/bin/mkfs.jffs2 \
> +		--big-endian --squash-uids -v -e 128KiB -q -f -n -x lzma -x rtime \
> +		-o $@ \
> +		-d $(KDIR_TMP)/zyxelnbg6716/image
> +	rm -rf $(KDIR_TMP)/zyxelnbg6716
>   endef
>   
>   define Build/zyxel-factory
> [...]

"Build/zyxel-buildkerneljffs" looks to be a "generic", however it is
using a device-specific name for its temp directory.

At least in my opinion, the directory should either be created as a
result of a call to mktemp(1), or generically named.

Jeff Kletsky
Adrian Schmutzler Oct. 29, 2019, 2:20 p.m. UTC | #2
Hi,

> > +define Build/zyxel-buildkerneljffs
> > +	rm -rf  $(KDIR_TMP)/zyxelnbg6716
> > +	mkdir -p $(KDIR_TMP)/zyxelnbg6716/image/boot
> > +	cp $@ $(KDIR_TMP)/zyxelnbg6716/image/boot/vmlinux.lzma.uImage
> > +	$(STAGING_DIR_HOST)/bin/mkfs.jffs2 \
> > +		--big-endian --squash-uids -v -e 128KiB -q -f -n -x lzma -x rtime \
> > +		-o $@ \
> > +		-d $(KDIR_TMP)/zyxelnbg6716/image
> > +	rm -rf $(KDIR_TMP)/zyxelnbg6716
> >   endef
> >
> >   define Build/zyxel-factory
> > [...]
> 
> "Build/zyxel-buildkerneljffs" looks to be a "generic", however it is
> using a device-specific name for its temp directory.
> 
> At least in my opinion, the directory should either be created as a
> result of a call to mktemp(1), or generically named.

That's neither a simple cosmetic change nor a fix, so IMO it should be a patch of its own.

Feel invited to submit it, but note that I won't review/merge it due to my limited expertise in this field.

Best

Adrian

Patch
diff mbox series

diff --git a/target/linux/ath79/dts/qca9558_zyxel_nbg6716.dts b/target/linux/ath79/dts/qca9558_zyxel_nbg6716.dts
index ea153d9f77..3e373928da 100644
--- a/target/linux/ath79/dts/qca9558_zyxel_nbg6716.dts
+++ b/target/linux/ath79/dts/qca9558_zyxel_nbg6716.dts
@@ -76,21 +76,21 @@ 
 			debounce-interval = <60>;
 		};
 
-	        wifi_button {
-                        label = "WiFi button";
+		wifi_button {
+			label = "WiFi button";
 			linux,code = <KEY_RFKILL>;
 			gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
 			debounce-interval = <60>;
 		};
 
-	        usb1 {
+		usb1 {
 			label = "USB1 eject button";
 			gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
 			debounce-interval = <60>;
 		};
 
-	        usb2 {
-                        label = "USB2 eject button";
+		usb2 {
+			label = "USB2 eject button";
 			gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
 			debounce-interval = <60>;
 		};
@@ -105,7 +105,7 @@ 
 };
 
 &gpio {
-	gpio_usb_power {
+	usb_power {
 		gpio-hog;
 		gpios = <16 0>;
 		output-high;
@@ -262,7 +262,7 @@ 
 };
 
 &pcie1 {
-        status = "okay";
+	status = "okay";
 
 	wifi@0,0 {
 		compatible = "qcom,ath10k";
@@ -272,15 +272,15 @@ 
 };
 
 &usb_phy0 {
-        status = "okay";
+	status = "okay";
 };
 
 &usb_phy1 {
-        status = "okay";
+	status = "okay";
 };
 
 &usb0 {
-        status = "okay";
+	status = "okay";
 
 	hub_port0: port@1 {
 		reg = <1>;
@@ -290,7 +290,7 @@ 
 };
 
 &usb1 {
-        status = "okay";
+	status = "okay";
 
 	hub_port1: port@1 {
 		reg = <1>;
diff --git a/target/linux/ath79/image/nand.mk b/target/linux/ath79/image/nand.mk
index c11ff6a257..049701a971 100644
--- a/target/linux/ath79/image/nand.mk
+++ b/target/linux/ath79/image/nand.mk
@@ -1,13 +1,13 @@ 
 # attention: only zlib compression is allowed for the boot fs
-define  Build/zyxel-buildkerneljffs
-        rm -rf  $(KDIR_TMP)/zyxelnbg6716
-        mkdir -p $(KDIR_TMP)/zyxelnbg6716/image/boot
-        cp $@ $(KDIR_TMP)/zyxelnbg6716/image/boot/vmlinux.lzma.uImage
-        $(STAGING_DIR_HOST)/bin/mkfs.jffs2 \
-                --big-endian --squash-uids -v -e 128KiB -q -f -n -x lzma -x rtime \
-                -o $@ \
-                -d $(KDIR_TMP)/zyxelnbg6716/image
-        rm -rf $(KDIR_TMP)/zyxelnbg6716
+define Build/zyxel-buildkerneljffs
+	rm -rf  $(KDIR_TMP)/zyxelnbg6716
+	mkdir -p $(KDIR_TMP)/zyxelnbg6716/image/boot
+	cp $@ $(KDIR_TMP)/zyxelnbg6716/image/boot/vmlinux.lzma.uImage
+	$(STAGING_DIR_HOST)/bin/mkfs.jffs2 \
+		--big-endian --squash-uids -v -e 128KiB -q -f -n -x lzma -x rtime \
+		-o $@ \
+		-d $(KDIR_TMP)/zyxelnbg6716/image
+	rm -rf $(KDIR_TMP)/zyxelnbg6716
 endef
 
 define Build/zyxel-factory
@@ -62,6 +62,7 @@  TARGET_DEVICES += glinet_gl-ar300m-nand
 define Device/zyxel_nbg6716
   ATH_SOC := qca9558
   DEVICE_VENDOR := ZyXEL
+  DEVICE_MODEL := NBG6716
   DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k-ct ath10k-firmware-qca988x-ct
   RAS_BOARD := NBG6716
   RAS_ROOTFS_SIZE := 29696k
@@ -72,7 +73,7 @@  define Device/zyxel_nbg6716
   KERNEL := kernel-bin | append-dtb | uImage none | \
 	zyxel-buildkerneljffs | check-size 4096k
   IMAGES := sysupgrade.tar sysupgrade-4M-Kernel.bin factory.bin
-  IMAGE/sysupgrade.tar/squashfs := append-rootfs | pad-to $$$${BLOCKSIZE} | sysupgrade-tar rootfs=$$$$@ | append-metadata
+  IMAGE/sysupgrade.tar/squashfs := append-rootfs | pad-to $$$$(BLOCKSIZE) | sysupgrade-tar rootfs=$$$$@ | append-metadata
   IMAGE/sysupgrade-4M-Kernel.bin/squashfs := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | pad-to 263192576 | gzip
   IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | zyxel-factory
   UBINIZE_OPTS := -E 5
diff --git a/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index 75fdd42cdd..433d6475dd 100644
--- a/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -3,7 +3,6 @@ 
 [ -e /lib/firmware/$FIRMWARE ] && exit 0
 
 . /lib/functions/caldata.sh
-. /lib/functions/k2t.sh
 
 board=$(board_name)
 
@@ -12,7 +11,7 @@  case "$FIRMWARE" in
 	case $board in
 	zyxel,nbg6716)
 		caldata_extract "art" 0x5000 0x844
-		ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +1)
+		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +1)
 		;;
 	esac
 	;;