ath79: add support for domywifi_dw33d-nor

This commit is contained in:
Chen Minqiang 2020-10-14 05:08:52 +08:00 committed by CN_SZTL
parent d28b48af3b
commit cefad01346
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
5 changed files with 79 additions and 4 deletions

View File

@ -0,0 +1,19 @@
#include "qca9558_domywifi_dw33d.dts"
/ {
compatible = "domywifi,dw33d-nor", "qca,qca9558";
model = "DomyWifi DW33D (NOR)";
};
&okli_firmware {
compatible = "openwrt,okli";
label = "firmware";
};
&nand_kernel {
label = "nand-kernel";
};
&nand_ubi {
label = "nand-ubi";
};

View File

@ -132,6 +132,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>;
};
@ -153,12 +177,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>;
};

View File

@ -2,6 +2,17 @@ include ./common-netgear.mk # for netgear-uImage
DEVICE_VARS += RAS_ROOTFS_SIZE RAS_BOARD RAS_VERSION
define Build/append-okli-kernel
dd if="$(KDIR)/loader-$(word 1,$(1)).uImage" >> "$@"
endef
define Build/prepad-okli-kernel
-[ -f "$@" ] && \
dd if="$(KDIR)/loader-$(word 1,$(1)).uImage" of="$@".tmp bs=64k conv=sync && \
cat "$@" >>"$@".tmp && \
mv "$@".tmp "$@"
endef
# attention: only zlib compression is allowed for the boot fs
define Build/zyxel-buildkerneljffs
rm -rf $(KDIR_TMP)/zyxelnbg6716
@ -81,6 +92,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

View File

@ -12,7 +12,8 @@ ath79_setup_interfaces()
glinet,gl-e750)
ucidef_set_interface_lan "eth0"
;;
domywifi,dw33d)
domywifi,dw33d|\
domywifi,dw33d-nor)
ucidef_add_switch "switch0" \
"0@eth0" "1:wan" "2:lan" "3:lan" "4:lan" "5:lan" "6@eth1"
;;

View File

@ -32,7 +32,8 @@ board=$(board_name)
case "$FIRMWARE" in
"ath10k/cal-pci-0000:00:00.0.bin")
case $board in
domywifi,dw33d)
domywifi,dw33d|\
domywifi,dw33d-nor)
ath10kcal_extract "art" 0x5000 0x844
ath10kcal_patch_mac $(mtd_get_mac_binary art 0x12)
;;