config: add ARM PMUv3 for kernel 6.6
[openwrt/openwrt.git] / target / linux / sunxi / image / Makefile
1 # SPDX-License-Identifier: GPL-2.0-only
2 #
3 # Copyright (C) 2013-2016 OpenWrt.org
4 # Copyright (C) 2016 Yousong Zhou
5
6 include $(TOPDIR)/rules.mk
7 include $(INCLUDE_DIR)/image.mk
8
9 FAT32_BLOCK_SIZE=1024
10 FAT32_BLOCKS=$(shell echo $$(($(CONFIG_SUNXI_SD_BOOT_PARTSIZE)*1024*1024/$(FAT32_BLOCK_SIZE))))
11
12 DEVICE_VARS := SUNXI_DTS SUNXI_DTS_DIR
13
14 define Build/sunxi-sdcard
15 rm -f $@.boot
16 mkfs.fat $@.boot -C $(FAT32_BLOCKS)
17
18 mcopy -i $@.boot $(STAGING_DIR_IMAGE)/$(DEVICE_NAME)-boot.scr ::boot.scr
19 mcopy -i $@.boot $(DTS_DIR)/$(SUNXI_DTS).dtb ::dtb
20 mcopy -i $@.boot $(IMAGE_KERNEL) ::uImage
21 ./gen_sunxi_sdcard_img.sh $@ \
22 $@.boot \
23 $(IMAGE_ROOTFS) \
24 $(CONFIG_SUNXI_SD_BOOT_PARTSIZE) \
25 $(CONFIG_TARGET_ROOTFS_PARTSIZE) \
26 $(STAGING_DIR_IMAGE)/$(DEVICE_NAME)-u-boot-with-spl.bin
27 rm -f $@.boot
28 endef
29
30 # why \x00\x00\x00\x00 for zImage-initramfs
31 define Device/Default
32 PROFILES := Default
33 KERNEL_NAME := zImage
34 KERNEL := kernel-bin | uImage none
35 IMAGES := sdcard.img.gz
36 IMAGE/sdcard.img.gz := sunxi-sdcard | append-metadata | gzip
37 SUNXI_DTS_DIR :=allwinner/
38 SUNXI_DTS = $$(SUNXI_DTS_DIR)$$(SOC)-$(lastword $(subst _, ,$(1)))
39 endef
40
41 include $(SUBTARGET).mk
42
43 $(eval $(call BuildImage))