1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter.git synced 2025-03-09 15:40:20 +00:00

Fix RUTX support

This commit is contained in:
Ycarus (Yannick Chabanois) 2022-03-07 20:21:35 +01:00
parent 6fc4d11e09
commit 0b14e36374
98 changed files with 11611 additions and 893 deletions

View file

@ -57,6 +57,31 @@ define Build/append-rutx-metadata
}' | fwtool -I - $@
endef
define Build/fit-rutx
$(TOPDIR)/scripts/mkits-rutx.sh \
-D $(DEVICE_NAME) -o $@.its -k $@ \
$(if $(word 2,$(1)),-d $(word 2,$(1))) -C $(word 1,$(1)) \
-a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \
$(if $(DEVICE_FDT_NUM),-n $(DEVICE_FDT_NUM)) \
-c $(if $(DEVICE_DTS_CONFIG),$(DEVICE_DTS_CONFIG),"config@1") \
-A $(LINUX_KARCH) -v $(LINUX_VERSION)
PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@.new
@mv $@.new $@
endef
define Build/UbootFw
$(CP) ./uboot_fw/ $(STAGING_DIR_HOST)/
if [ -e $(STAGING_DIR_HOST)/uboot_fw/tz.mbn ]; then \
$(SED) 's~file\.ubi~$@~g' $(STAGING_DIR_HOST)/uboot_fw/norplusnand-flash.conf; \
$(SED) 's~file\.elf~$(BIN_DIR)/openwrt-ipq40xx-u-boot-stripped.elf~g' $(STAGING_DIR_HOST)/uboot_fw/norplusnand-flash.conf; \
python $(KDIR)/uboot-1.0/tools/pack.py -t norplusnand -B -F boardconfig_premium_tlt -o $@ $(STAGING_DIR_HOST)/uboot_fw; \
else \
$(SED) 's~file\.ubi~$@~g' $(STAGING_DIR_HOST)/uboot_fw/norplusnand-apps-flash.conf; \
$(SED) 's~file\.elf~$(BIN_DIR)/openwrt-ipq40xx-u-boot-stripped.elf~g' $(STAGING_DIR_HOST)/uboot_fw/norplusnand-apps-flash.conf; \
python $(KDIR)/uboot-1.0/tools/pack.py -t norplusnand -B -F appsboardconfig_premium_tlt -o $@ $(STAGING_DIR_HOST)/uboot_fw; \
fi
endef
define Build/mkmylofw_32m
$(eval device_id=$(word 1,$(1)))
$(eval revision=$(word 2,$(1)))
@ -803,16 +828,25 @@ define Device/teltonika_rutx
$(call Device/UbiFit)
DEVICE_VENDOR := Teltonika
DEVICE_MODEL := RUTX
BOARD_NAME := rutx
SOC := qcom-ipq4018
DEVICE_DTS := qcom-ipq4018-rutx-12 qcom-ipq4018-rutx-08_10 qcom-ipq4018-rutx-09_11 qcom-ipq4018-rutx-R1 qcom-ipq4018-rutx-STM32
DEVICE_DTS_DIR := ../dts
# DEVICE_DTS := qcom-ipq4018-rutx-12 qcom-ipq4018-rutx-08_10 qcom-ipq4018-rutx-09_11 qcom-ipq4018-rutx-R1 qcom-ipq4018-rutx-STM32
# DEVICE_DTS := qcom-ipq4018-rutx-12
DEVICE_DTS := $(foreach dts,$(notdir $(wildcard $(PLATFORM_DIR)/dts/*.dts)),$(patsubst %.dts,%,$(dts)))
DEVICE_DTS_CONFIG := config@5
KERNEL = kernel-bin | gzip | fit gzip "$$(KDIR)/{$$(subst $$(space),$$(comma),$$(addprefix image-,$$(addsuffix .dtb,$$(DEVICE_DTS))))}"
KERNEL = kernel-bin | gzip | fit-rutx gzip "$$(KDIR)/{$$(subst $$(space),$$(comma),$$(addprefix image-,$$(addsuffix .dtb,$$(DEVICE_DTS))))}"
KERNEL_INSTALL := 1
BLOCKSIZE := 128k
PAGESIZE := 2048
FILESYSTEMS := squashfs
IMAGE/nand-factory.ubi := append-ubi | qsdk-ipq-factory-nand | append-rutx-metadata
DEVICE_PACKAGES := ipq-wifi-teltonika_rutx kmod-bluetooth
KERNEL_IN_UBI := 1
IMAGES := sysupgrade.bin
IMAGE/sysupgrade.bin := append-ubi | qsdk-ipq-factory-nand | append-rutx-metadata
# IMAGE/sysupgrade.bin := append-ubi | UbootFw | append-rutx-metadata
# DEVICE_PACKAGES := uboot-ipq4xx ipq-wifi-teltonika_rutx kmod-bluetooth kmod-r2ec
DEVICE_PACKAGES := ipq-wifi-teltonika_rutx kmod-bluetooth kmod-r2ec
HW_SUPPORT := io_expander%stm32:shiftreg_1
endef
TARGET_DEVICES += teltonika_rutx