From 8e0f468729c89510b4c7defcf928df3b7dd7c218 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Wed, 30 Jun 2021 13:28:09 +0800 Subject: [PATCH] ath79: add support for domywifi_dw33d-nor --- .../ath79/dts/qca9558_domywifi_dw33d-nor.dts | 21 ++++++++++++++ .../ath79/dts/qca9558_domywifi_dw33d.dts | 28 +++++++++++++++++-- target/linux/ath79/image/nand.mk | 19 +++++++++++++ .../nand/base-files/etc/board.d/02_network | 1 + .../etc/hotplug.d/firmware/11-ath10k-caldata | 1 + 5 files changed, 68 insertions(+), 2 deletions(-) create mode 100644 target/linux/ath79/dts/qca9558_domywifi_dw33d-nor.dts diff --git a/target/linux/ath79/dts/qca9558_domywifi_dw33d-nor.dts b/target/linux/ath79/dts/qca9558_domywifi_dw33d-nor.dts new file mode 100644 index 000000000..df80e3969 --- /dev/null +++ b/target/linux/ath79/dts/qca9558_domywifi_dw33d-nor.dts @@ -0,0 +1,21 @@ +#include +#include "qca9558_domywifi_dw33d.dts" + +/ { + compatible = "domywifi,dw33d-nor", "qca,qca9558"; + model = "DomyWifi DW33D (NOR)"; +}; + +&okli_firmware { + compatible = "openwrt,uimage", "denx,uimage"; + openwrt,ih-magic = ; + label = "firmware"; +}; + +&nand_kernel { + label = "nand-kernel"; +}; + +&nand_ubi { + label = "nand-ubi"; +}; diff --git a/target/linux/ath79/dts/qca9558_domywifi_dw33d.dts b/target/linux/ath79/dts/qca9558_domywifi_dw33d.dts index 0c42208c2..63eb0b1d3 100644 --- a/target/linux/ath79/dts/qca9558_domywifi_dw33d.dts +++ b/target/linux/ath79/dts/qca9558_domywifi_dw33d.dts @@ -126,6 +126,30 @@ }; partition@50000 { + label = "loader1"; + reg = <0x50000 0x10000>; + }; + + okli_firmware: partition@60000 { + label = "okli-firmware"; + reg = <0x60000 0xe20000>; + }; + + partition@e80000 { + label = "loader2"; + reg = <0xe80000 0x10000>; + }; + + partition@e90000 { + label = "unused"; + reg = <0xe90000 0x160000>; + }; + + /* firmware + * oem-rootfs: 0x50000 0xe30000 ->loader1(64k) + kernel + rootfs + * oem-kernel: 0xe80000 0x170000 ->loader2(64k) + */ + partition@1 { label = "oem-firmware"; reg = <0x50000 0xfa0000>; }; @@ -147,12 +171,12 @@ #address-cells = <1>; #size-cells = <1>; - partition@0 { + nand_kernel: partition@0 { label = "kernel"; reg = <0x0 0x500000>; }; - partition@500000 { + nand_ubi: partition@500000 { label = "ubi"; reg = <0x500000 0x5b00000>; }; diff --git a/target/linux/ath79/image/nand.mk b/target/linux/ath79/image/nand.mk index 2dff368a2..1451e34ea 100644 --- a/target/linux/ath79/image/nand.mk +++ b/target/linux/ath79/image/nand.mk @@ -96,6 +96,25 @@ define Device/domywifi_dw33d endef TARGET_DEVICES += domywifi_dw33d +define Device/domywifi_dw33d-nor + $(Device/domywifi_dw33d) + DEVICE_VARIANT := NOR + IMAGE_SIZE := 14464k + BLOCKSIZE := 64k + LOADER_TYPE := bin + LOADER_FLASH_OFFS := 0x60000 + COMPILE := loader-$(1).bin loader-$(1).uImage + COMPILE/loader-$(1).bin := loader-okli-compile + COMPILE/loader-$(1).uImage := append-loader-okli $(1) | pad-to 64k | lzma | uImage lzma + KERNEL := kernel-bin | append-dtb | lzma | uImage lzma -M 0x4f4b4c49 + IMAGES := sysupgrade.bin breed-factory.bin + IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | \ + append-metadata | check-size + IMAGE/breed-factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | \ + prepad-okli-kernel $(1) | pad-to 14528k | append-okli-kernel $(1) +endef +TARGET_DEVICES += domywifi_dw33d-nor + define Device/glinet_gl-ar300m-common-nand SOC := qca9531 DEVICE_VENDOR := GL.iNet diff --git a/target/linux/ath79/nand/base-files/etc/board.d/02_network b/target/linux/ath79/nand/base-files/etc/board.d/02_network index eeb6d7e26..1d08d35b9 100644 --- a/target/linux/ath79/nand/base-files/etc/board.d/02_network +++ b/target/linux/ath79/nand/base-files/etc/board.d/02_network @@ -11,6 +11,7 @@ ath79_setup_interfaces() glinet,gl-e750) ucidef_set_interface_lan "eth0" ;; + domywifi,dw33d-nor|\ domywifi,dw33d) ucidef_add_switch "switch0" \ "0@eth0" "1:wan" "2:lan" "3:lan" "4:lan" "5:lan" "6@eth1" 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 3ee0aa818..1ae873c1e 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 @@ -13,6 +13,7 @@ case "$FIRMWARE" in caldata_extract "caldata" 0x5000 0x844 ath10k_patch_mac $(mtd_get_mac_binary ft 0x12) ;; + domywifi,dw33d-nor|\ domywifi,dw33d) caldata_extract "art" 0x5000 0x844 ath10k_patch_mac $(mtd_get_mac_binary art 0x12)