2021-02-10 13:52:34 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-only
|
2013-09-19 00:50:49 +00:00
|
|
|
#
|
2016-04-21 19:46:53 +00:00
|
|
|
# Copyright (C) 2010-2016 OpenWrt.org
|
2012-12-15 02:00:20 +00:00
|
|
|
|
|
|
|
# boards missing since devicetree update
|
2014-04-03 14:26:54 +00:00
|
|
|
#EASY50712 ARV3527P
|
2012-12-15 02:00:20 +00:00
|
|
|
|
2016-04-21 19:46:53 +00:00
|
|
|
KERNEL_LOADADDR = 0x80002000
|
2016-04-26 11:43:15 +00:00
|
|
|
KERNEL_ENTRY = 0x80002000
|
2016-04-21 19:46:53 +00:00
|
|
|
|
2010-12-12 22:57:16 +00:00
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
include $(INCLUDE_DIR)/image.mk
|
|
|
|
|
2016-07-19 12:55:43 +00:00
|
|
|
ifeq ($(SUBTARGET),xway)
|
2020-01-24 17:51:36 +00:00
|
|
|
UBIFS_OPTS := -m 512 -e 15872 -c 1959
|
2016-07-19 12:55:43 +00:00
|
|
|
else
|
2020-01-24 17:51:36 +00:00
|
|
|
UBIFS_OPTS := -m 2048 -e 126KiB -c 4096
|
2016-07-19 12:55:43 +00:00
|
|
|
endif
|
|
|
|
|
2017-03-25 18:18:37 +00:00
|
|
|
define Build/append-avm-fakeroot
|
|
|
|
cat ./eva.dummy.squashfs >> $@
|
2016-07-19 13:36:40 +00:00
|
|
|
endef
|
|
|
|
|
2016-10-01 07:59:00 +00:00
|
|
|
define Build/dgn3500-sercom-footer
|
|
|
|
$(STAGING_DIR_HOST)/bin/dgn3500sum $@ $(1) $(2)
|
2010-12-12 22:57:16 +00:00
|
|
|
endef
|
|
|
|
|
2016-04-26 11:43:28 +00:00
|
|
|
define Build/mkbrncmdline
|
2020-01-24 17:51:36 +00:00
|
|
|
mkbrncmdline -i $@ -o $@.new BRN-BOOT
|
|
|
|
mv $@.new $@
|
2016-04-26 11:43:28 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Build/mkbrnimg
|
2020-01-24 17:51:36 +00:00
|
|
|
mkbrnimg -s $(SIGNATURE) -m $(MAGIC) -p $(CRC32_POLY) -o $@ $(IMAGE_KERNEL) $(IMAGE_ROOTFS)
|
2016-04-26 11:43:28 +00:00
|
|
|
endef
|
2012-12-15 02:00:20 +00:00
|
|
|
|
2016-06-11 14:14:52 +00:00
|
|
|
define Build/fullimage
|
|
|
|
mkimage -A mips -O linux -C lzma -T filesystem -a 0x00 \
|
2017-11-08 17:40:37 +00:00
|
|
|
-e 0x00 -n '$(VERSION_DIST) RootFS' \
|
2016-07-30 12:19:11 +00:00
|
|
|
-d $(IMAGE_ROOTFS) $(IMAGE_ROOTFS).new
|
2016-06-11 14:14:52 +00:00
|
|
|
|
2016-07-30 12:19:11 +00:00
|
|
|
cat $(IMAGE_KERNEL) $(IMAGE_ROOTFS).new > $@.tmp
|
2016-06-11 14:14:52 +00:00
|
|
|
|
|
|
|
mkimage -A mips -O linux -T multi -a 0x00 -C none \
|
|
|
|
-e 0x00 -n 'OpenWrt fullimage' \
|
|
|
|
-d $@.tmp $@
|
|
|
|
|
2016-07-30 12:19:11 +00:00
|
|
|
rm $(IMAGE_ROOTFS).new
|
2016-06-11 14:14:52 +00:00
|
|
|
rm $@.tmp
|
|
|
|
endef
|
|
|
|
|
2023-01-08 17:35:10 +00:00
|
|
|
define Build/loader-common
|
2021-11-14 20:53:45 +00:00
|
|
|
rm -rf $@.src
|
|
|
|
$(MAKE) -C lzma-loader \
|
|
|
|
PKG_BUILD_DIR="$@.src" \
|
|
|
|
TARGET_DIR="$(dir $@)" LOADER_NAME="$(notdir $@)" \
|
2023-01-08 17:35:10 +00:00
|
|
|
BOARD="$(BOARDNAME)" PLATFORM="lantiq" \
|
2021-11-14 20:53:45 +00:00
|
|
|
LZMA_TEXT_START=0x82000000 \
|
|
|
|
LOADADDR=0x80002000 \
|
|
|
|
$(1) compile loader.bin
|
|
|
|
mv "$@.bin" "$@"
|
|
|
|
rm -rf $@.src
|
|
|
|
endef
|
|
|
|
|
2023-01-08 17:35:10 +00:00
|
|
|
define Build/loader-kernel
|
|
|
|
$(call Build/loader-common,LOADER_DATA="$@")
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Build/loader-okli-compile
|
|
|
|
$(call Build/loader-common, \
|
|
|
|
FLASH_START=0x10000000 \
|
|
|
|
FLASH_OFFS=$(LOADER_FLASH_OFFS) \
|
|
|
|
FLASH_MAX=0x0 \
|
|
|
|
)
|
|
|
|
endef
|
|
|
|
|
2021-11-14 20:53:45 +00:00
|
|
|
define Build/prepend-loader-okli
|
|
|
|
cat "$(KDIR)/loader-$(word 1,$(1)).bin" "$@" >> "$@.new"
|
|
|
|
mv "$@.new" "$@"
|
|
|
|
endef
|
|
|
|
|
|
|
|
DEVICE_VARS += SIGNATURE MAGIC CRC32_POLY LOADER_FLASH_OFFS
|
|
|
|
|
2020-01-24 17:35:25 +00:00
|
|
|
DTS_DIR := $(DTS_DIR)/lantiq
|
|
|
|
|
2016-04-21 19:46:53 +00:00
|
|
|
# Shared device definition: applies to every defined device
|
|
|
|
define Device/Default
|
2016-07-19 13:07:56 +00:00
|
|
|
PROFILES = Default
|
2021-11-14 20:53:45 +00:00
|
|
|
COMPILE :=
|
2017-12-31 11:11:57 +00:00
|
|
|
KERNEL_DEPENDS = $$(wildcard $(DTS_DIR)/$$(DEVICE_DTS).dts)
|
2016-04-21 19:46:53 +00:00
|
|
|
KERNEL_INITRAMFS_NAME = $$(KERNEL_NAME)-initramfs
|
|
|
|
KERNEL := kernel-bin | append-dtb | lzma | uImage lzma
|
|
|
|
KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | uImage lzma
|
|
|
|
FILESYSTEMS := squashfs
|
2020-01-24 17:48:47 +00:00
|
|
|
SOC := $(DEFAULT_SOC)
|
2019-12-15 23:21:33 +00:00
|
|
|
DEVICE_DTS = $$(SOC)_$(1)
|
2016-04-26 11:43:18 +00:00
|
|
|
IMAGES := sysupgrade.bin
|
2021-06-20 16:54:36 +00:00
|
|
|
IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | check-size | append-metadata
|
2016-04-21 19:46:53 +00:00
|
|
|
endef
|
2013-03-12 13:52:54 +00:00
|
|
|
|
2016-07-19 13:23:56 +00:00
|
|
|
define Device/NAND/xway
|
2016-09-04 06:56:05 +00:00
|
|
|
BLOCKSIZE := 16k
|
2016-07-19 13:23:56 +00:00
|
|
|
PAGESIZE := 512
|
|
|
|
SUBPAGESIZE := 256
|
|
|
|
FILESYSTEMS += ubifs
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Device/NAND/xrx200
|
2016-09-04 06:56:05 +00:00
|
|
|
BLOCKSIZE := 128k
|
2016-07-19 13:23:56 +00:00
|
|
|
PAGESIZE := 2048
|
|
|
|
SUBPAGESIZE := 512
|
|
|
|
FILESYSTEMS += ubifs
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Device/NAND
|
|
|
|
$(Device/NAND/$(SUBTARGET))
|
2016-11-17 10:41:08 +00:00
|
|
|
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
2016-07-19 13:23:56 +00:00
|
|
|
endef
|
|
|
|
|
2016-04-26 11:43:28 +00:00
|
|
|
define Device/lantiqBrnImage
|
|
|
|
KERNEL := kernel-bin | append-dtb | mkbrncmdline | lzma-no-dict
|
|
|
|
IMAGES := factory.bin
|
2020-03-10 13:58:27 +00:00
|
|
|
IMAGE/factory.bin := mkbrnimg | check-size
|
2016-04-26 11:43:28 +00:00
|
|
|
endef
|
|
|
|
|
2016-06-11 14:14:52 +00:00
|
|
|
define Device/lantiqFullImage
|
|
|
|
KERNEL := kernel-bin | append-dtb | lzma | uImage lzma | pad-offset 4 0
|
2017-12-08 07:42:11 +00:00
|
|
|
IMAGES := sysupgrade.bin fullimage.bin
|
2020-03-10 13:58:27 +00:00
|
|
|
IMAGE/fullimage.bin := fullimage | check-size
|
2016-06-11 14:14:52 +00:00
|
|
|
endef
|
|
|
|
|
2016-07-19 13:36:40 +00:00
|
|
|
define Device/AVM
|
2019-07-11 10:47:56 +00:00
|
|
|
DEVICE_VENDOR := AVM
|
2016-07-19 13:36:40 +00:00
|
|
|
KERNEL := kernel-bin | append-dtb | lzma | eva-image
|
2018-03-18 19:27:50 +00:00
|
|
|
KERNEL_INITRAMFS := $$(KERNEL)
|
2017-03-25 18:18:37 +00:00
|
|
|
IMAGE/sysupgrade.bin := append-kernel | pad-to 64k | append-avm-fakeroot | \
|
2021-06-20 16:54:36 +00:00
|
|
|
append-rootfs | pad-rootfs | check-size | append-metadata
|
2016-07-19 13:36:40 +00:00
|
|
|
endef
|
|
|
|
|
2021-11-14 20:53:45 +00:00
|
|
|
define Device/AVM_preloader
|
|
|
|
DEVICE_VENDOR := AVM
|
|
|
|
COMPILE := loader-$(1).bin
|
|
|
|
COMPILE/loader-$(1).bin := loader-okli-compile | lzma | eva-image | \
|
|
|
|
pad-to 64k | append-avm-fakeroot | pad-to 4k
|
|
|
|
KERNEL := kernel-bin | append-dtb | lzma | uImage lzma -M 0x4f4b4c49 | \
|
|
|
|
prepend-loader-okli $(1)
|
|
|
|
KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | eva-image
|
|
|
|
endef
|
|
|
|
|
2017-02-26 20:28:28 +00:00
|
|
|
ifeq ($(SUBTARGET),ase)
|
2020-01-24 17:38:53 +00:00
|
|
|
DEFAULT_SOC := amazonse
|
2019-12-15 21:58:34 +00:00
|
|
|
include amazonse.mk
|
2017-02-26 20:28:28 +00:00
|
|
|
endif
|
|
|
|
|
2016-06-13 17:04:20 +00:00
|
|
|
ifeq ($(SUBTARGET),xway_legacy)
|
2020-01-24 17:38:53 +00:00
|
|
|
DEFAULT_SOC := danube
|
2019-12-15 21:58:34 +00:00
|
|
|
include xway_legacy.mk
|
2016-06-13 17:04:20 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(SUBTARGET),xway)
|
2019-12-15 21:58:34 +00:00
|
|
|
include danube.mk
|
|
|
|
include ar9.mk
|
2013-09-17 21:46:00 +00:00
|
|
|
endif
|
|
|
|
|
2016-06-01 20:43:58 +00:00
|
|
|
ifeq ($(SUBTARGET),xrx200)
|
2020-01-24 17:38:53 +00:00
|
|
|
DEFAULT_SOC := vr9
|
2019-08-22 12:09:50 +00:00
|
|
|
include tp-link.mk
|
2019-12-15 21:58:34 +00:00
|
|
|
include vr9.mk
|
2016-06-17 16:50:07 +00:00
|
|
|
endif
|
|
|
|
|
2016-10-02 16:39:50 +00:00
|
|
|
ifeq ($(SUBTARGET),falcon)
|
2020-01-24 17:38:53 +00:00
|
|
|
DEFAULT_SOC := falcon
|
2019-12-15 21:58:34 +00:00
|
|
|
include falcon.mk
|
2016-10-02 16:39:50 +00:00
|
|
|
endif
|
|
|
|
|
2010-12-12 22:57:16 +00:00
|
|
|
$(eval $(call BuildImage))
|