2016-02-18 08:22:32 +00:00
|
|
|
#
|
|
|
|
# Copyright (C) 2016 OpenWrt.org
|
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
include $(INCLUDE_DIR)/image.mk
|
|
|
|
|
2016-05-31 17:12:21 +00:00
|
|
|
# On ARC initramfs is put before entry point and so entry point moves
|
|
|
|
# in memory from build to built. Thus we need to extract EP from vmlinux
|
|
|
|
# every time before generation of uImage.
|
|
|
|
define Build/calculate-ep
|
|
|
|
$(eval KERNEL_ENTRY=$(shell $(KERNEL_CROSS)readelf -h $(LINUX_DIR)/vmlinux | grep "Entry point address" | grep -o 0x.*))
|
|
|
|
endef
|
|
|
|
|
2016-02-18 08:22:32 +00:00
|
|
|
define Build/patch-dtb
|
2016-08-16 11:49:16 +00:00
|
|
|
$(call Image/BuildDTB,$(DTS_DIR)/$(DEVICE_DTS).dts,$@.dtb)
|
2016-02-18 08:22:32 +00:00
|
|
|
$(STAGING_DIR_HOST)/bin/patch-dtb $@ $@.dtb
|
|
|
|
endef
|
|
|
|
|
|
|
|
# Shared device definition: applies to every defined device
|
|
|
|
define Device/Default
|
|
|
|
PROFILES = Default $$(DEVICE_PROFILE)
|
|
|
|
KERNEL_DEPENDS = $$(wildcard ../dts/$$(DEVICE_DTS).dts)
|
|
|
|
DEVICE_PROFILE :=
|
|
|
|
endef
|
2016-07-14 11:58:23 +00:00
|
|
|
DEVICE_VARS += DEVICE_PROFILE
|
2016-02-18 08:22:32 +00:00
|
|
|
|
2016-05-31 17:12:21 +00:00
|
|
|
define Device/vmlinux
|
|
|
|
KERNEL_SUFFIX := .elf
|
|
|
|
KERNEL_INITRAMFS := kernel-bin | patch-dtb
|
|
|
|
KERNEL_INITRAMFS_NAME = vmlinux-initramfs.elf
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Device/uImage
|
2016-08-16 11:49:17 +00:00
|
|
|
KERNEL_SUFFIX := -uImage
|
2016-05-31 17:12:21 +00:00
|
|
|
KERNEL_INITRAMFS := kernel-bin | patch-dtb | calculate-ep | uImage none
|
|
|
|
KERNEL_LOADADDR := 0x80000000
|
|
|
|
endef
|
|
|
|
|
2016-08-16 11:49:17 +00:00
|
|
|
define Device/axs103
|
|
|
|
$(call Device/uImage)
|
|
|
|
DEVICE_PROFILE := axs103
|
|
|
|
DEVICE_DTS := axs103_idu
|
2016-05-31 17:12:21 +00:00
|
|
|
endef
|
2016-08-16 11:49:17 +00:00
|
|
|
TARGET_DEVICES += axs103
|
2016-05-31 17:12:21 +00:00
|
|
|
|
2016-08-16 11:49:17 +00:00
|
|
|
define Device/nsim_hs
|
|
|
|
$(call Device/vmlinux)
|
|
|
|
DEVICE_PROFILE := nsim_hs
|
|
|
|
DEVICE_DTS := nsim_hs_idu
|
2016-02-18 08:22:32 +00:00
|
|
|
endef
|
2016-08-16 11:49:17 +00:00
|
|
|
TARGET_DEVICES += nsim_hs
|
2016-02-18 08:22:32 +00:00
|
|
|
|
|
|
|
$(eval $(call BuildImage))
|