2021-02-10 13:52:34 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-only
|
2016-02-12 08:29:24 +00:00
|
|
|
#
|
|
|
|
# Copyright (C) 2015 OpenWrt.org
|
2021-02-10 13:52:34 +00:00
|
|
|
|
2016-02-12 08:29:24 +00:00
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
include $(INCLUDE_DIR)/image.mk
|
|
|
|
|
2018-09-04 01:40:02 +00:00
|
|
|
FAT32_BLOCK_SIZE=1024
|
|
|
|
FAT32_BLOCKS=$(shell echo $$(($(CONFIG_TARGET_KERNEL_PARTSIZE)*1024*1024/$(FAT32_BLOCK_SIZE))))
|
|
|
|
|
|
|
|
define Build/zynq-sdcard
|
|
|
|
rm -f $@.boot
|
|
|
|
mkfs.fat $@.boot -C $(FAT32_BLOCKS)
|
|
|
|
mcopy -i $@.boot $(STAGING_DIR_IMAGE)/$(DEVICE_NAME)-boot.bin ::boot.bin
|
|
|
|
mcopy -i $@.boot $(STAGING_DIR_IMAGE)/$(DEVICE_NAME)-u-boot.img ::u-boot.img
|
|
|
|
mcopy -i $@.boot $(STAGING_DIR_IMAGE)/$(DEVICE_NAME)-uEnv.txt ::uEnv.txt
|
|
|
|
mcopy -i $@.boot $(IMAGE_KERNEL) ::fit.itb
|
|
|
|
./gen_zynq_sdcard_img.sh $@ \
|
|
|
|
$@.boot \
|
|
|
|
$(IMAGE_ROOTFS) \
|
|
|
|
$(CONFIG_TARGET_KERNEL_PARTSIZE) \
|
|
|
|
$(CONFIG_TARGET_ROOTFS_PARTSIZE)
|
|
|
|
rm -f $@.boot
|
|
|
|
endef
|
|
|
|
|
2016-02-12 08:29:24 +00:00
|
|
|
#################################################
|
2018-05-13 18:05:38 +00:00
|
|
|
# Default and templates
|
2016-02-12 08:29:24 +00:00
|
|
|
#################################################
|
|
|
|
|
2018-05-13 18:05:38 +00:00
|
|
|
define Device/Default
|
|
|
|
PROFILES := Default
|
2024-07-26 00:17:57 +00:00
|
|
|
DTS_DIR := $(DTS_DIR)/xilinx
|
2020-01-18 01:21:14 +00:00
|
|
|
DEVICE_DTS := $(lastword $(subst _, ,$(1)))
|
2018-05-13 18:05:38 +00:00
|
|
|
KERNEL_DEPENDS = $$(wildcard $(DTS_DIR)/$$(DEVICE_DTS).dts)
|
|
|
|
KERNEL_LOADADDR := 0x8000
|
2018-09-04 01:40:02 +00:00
|
|
|
IMAGES := sdcard.img.gz
|
|
|
|
IMAGE/sdcard.img.gz := zynq-sdcard | gzip
|
2016-07-28 12:19:16 +00:00
|
|
|
endef
|
2016-02-12 08:29:24 +00:00
|
|
|
|
2018-05-13 18:05:38 +00:00
|
|
|
define Device/FitImageGzip
|
|
|
|
KERNEL_SUFFIX := -fit-uImage.itb
|
|
|
|
KERNEL = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb
|
|
|
|
KERNEL_NAME := Image
|
2016-02-12 08:29:24 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
#################################################
|
|
|
|
# Devices
|
|
|
|
#################################################
|
|
|
|
|
2018-09-01 05:36:09 +00:00
|
|
|
define Device/avnet_zynq-zed
|
|
|
|
$(call Device/FitImageGzip)
|
2019-07-04 23:35:38 +00:00
|
|
|
DEVICE_VENDOR := Avnet
|
|
|
|
DEVICE_MODEL := ZedBoard
|
2018-09-01 05:36:09 +00:00
|
|
|
endef
|
|
|
|
TARGET_DEVICES += avnet_zynq-zed
|
|
|
|
|
2018-05-13 18:05:38 +00:00
|
|
|
define Device/digilent_zynq-zybo
|
|
|
|
$(call Device/FitImageGzip)
|
2019-07-04 23:35:38 +00:00
|
|
|
DEVICE_VENDOR := Digilent
|
|
|
|
DEVICE_MODEL := Zybo
|
2018-05-13 18:05:38 +00:00
|
|
|
endef
|
|
|
|
TARGET_DEVICES += digilent_zynq-zybo
|
2016-07-28 12:19:16 +00:00
|
|
|
|
2018-08-24 03:40:26 +00:00
|
|
|
define Device/digilent_zynq-zybo-z7
|
|
|
|
$(call Device/FitImageGzip)
|
2019-07-04 23:35:38 +00:00
|
|
|
DEVICE_VENDOR := Digilent
|
|
|
|
DEVICE_MODEL := Zybo Z7
|
2018-08-24 03:40:26 +00:00
|
|
|
endef
|
|
|
|
TARGET_DEVICES += digilent_zynq-zybo-z7
|
|
|
|
|
2018-05-13 18:05:38 +00:00
|
|
|
define Device/xlnx_zynq-zc702
|
|
|
|
$(call Device/FitImageGzip)
|
2019-07-04 23:35:38 +00:00
|
|
|
DEVICE_VENDOR := Xilinx
|
|
|
|
DEVICE_MODEL := ZC702
|
2019-04-01 03:33:07 +00:00
|
|
|
DEVICE_PACKAGES:=kmod-can kmod-can-xilinx-can
|
2016-03-23 12:52:38 +00:00
|
|
|
endef
|
2018-05-13 18:05:38 +00:00
|
|
|
TARGET_DEVICES += xlnx_zynq-zc702
|
2016-03-23 12:52:38 +00:00
|
|
|
|
2016-02-12 08:29:24 +00:00
|
|
|
$(eval $(call BuildImage))
|