kernel: fix portability issue with perf on linux 5.4
[oweals/openwrt.git] / target / linux / zynq / image / Makefile
1 #
2 # Copyright (C) 2015 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 include $(TOPDIR)/rules.mk
8 include $(INCLUDE_DIR)/image.mk
9
10 FAT32_BLOCK_SIZE=1024
11 FAT32_BLOCKS=$(shell echo $$(($(CONFIG_TARGET_KERNEL_PARTSIZE)*1024*1024/$(FAT32_BLOCK_SIZE))))
12
13 define Build/zynq-sdcard
14         rm -f $@.boot
15         mkfs.fat $@.boot -C $(FAT32_BLOCKS)
16         mcopy -i $@.boot $(STAGING_DIR_IMAGE)/$(DEVICE_NAME)-boot.bin ::boot.bin
17         mcopy -i $@.boot $(STAGING_DIR_IMAGE)/$(DEVICE_NAME)-u-boot.img ::u-boot.img
18         mcopy -i $@.boot $(STAGING_DIR_IMAGE)/$(DEVICE_NAME)-uEnv.txt ::uEnv.txt
19         mcopy -i $@.boot $(IMAGE_KERNEL) ::fit.itb
20         ./gen_zynq_sdcard_img.sh $@ \
21                 $@.boot \
22                 $(IMAGE_ROOTFS) \
23                 $(CONFIG_TARGET_KERNEL_PARTSIZE) \
24                 $(CONFIG_TARGET_ROOTFS_PARTSIZE)
25         rm -f $@.boot
26 endef
27
28 #################################################
29 # Default and templates
30 #################################################
31
32 define Device/Default
33         PROFILES := Default
34         DEVICE_DTS := $(lastword $(subst _, ,$(1)))
35         KERNEL_DEPENDS = $$(wildcard $(DTS_DIR)/$$(DEVICE_DTS).dts)
36         KERNEL_INITRAMFS_PREFIX := $$(IMG_PREFIX)-$(1)-initramfs
37         KERNEL_PREFIX := $$(IMAGE_PREFIX)
38         KERNEL_LOADADDR := 0x8000
39         IMAGES := sdcard.img.gz
40         IMAGE/sdcard.img.gz := zynq-sdcard | gzip
41 endef
42
43 define Device/FitImageGzip
44         KERNEL_SUFFIX := -fit-uImage.itb
45         KERNEL = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb
46         KERNEL_NAME := Image
47 endef
48
49 #################################################
50 # Devices
51 #################################################
52
53 define Device/avnet_zynq-zed
54         $(call Device/FitImageGzip)
55         DEVICE_VENDOR := Avnet
56         DEVICE_MODEL := ZedBoard
57 endef
58 TARGET_DEVICES += avnet_zynq-zed
59
60 define Device/digilent_zynq-zybo
61         $(call Device/FitImageGzip)
62         DEVICE_VENDOR := Digilent
63         DEVICE_MODEL := Zybo
64 endef
65 TARGET_DEVICES += digilent_zynq-zybo
66
67 define Device/digilent_zynq-zybo-z7
68         $(call Device/FitImageGzip)
69         DEVICE_VENDOR := Digilent
70         DEVICE_MODEL := Zybo Z7
71 endef
72 TARGET_DEVICES += digilent_zynq-zybo-z7
73
74 define Device/xlnx_zynq-zc702
75         $(call Device/FitImageGzip)
76         DEVICE_VENDOR := Xilinx
77         DEVICE_MODEL := ZC702
78         DEVICE_PACKAGES:=kmod-can kmod-can-xilinx-can
79 endef
80 TARGET_DEVICES += xlnx_zynq-zc702
81
82 $(eval $(call BuildImage))