linux: update to 6.10.x, 6.9.x is EOL
[openadk.git] / target / aarch64 / Makefile
bloba461cf4d34186328d0e7cb6b5e73256e89431a70
1 # This file is part of the OpenADK project. OpenADK is copyrighted
2 # material, please see the LICENCE file in the top-level directory.
4 include $(ADK_TOPDIR)/rules.mk
5 include $(ADK_TOPDIR)/mk/kernel-build.mk
6 include $(ADK_TOPDIR)/mk/image.mk
8 KERNEL:=${LINUX_DIR}/arch/arm64/boot/Image
10 QEMU_ARGS:=${ADK_QEMU_ARGS}
11 QEMU_ARGS+=-M virt -cpu cortex-a57 -smp 1
12 ifeq ($(ADK_TARGET_QEMU_WITH_VIRTIO),y)
13 QEMU_ARGS+=-netdev user,id=eth0 -device virtio-net-device,netdev=eth0
14 endif
15 ifeq ($(ADK_TARGET_FS),archive)
16 QEMU_ARGS+=-device virtio-blk-device,drive=vda -drive file=qemu-${ADK_TARGET_CPU_ARCH}.img,if=none,id=vda,format=raw
17 endif
19 # target helper text
20 ifeq ($(ADK_TARGET_FS),archive)
21 targethelp:
22 @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
23 ifeq ($(ADK_TARGET_BOARD_BCM28XX),y)
24 @echo "Use following command to install it on SD card:"
25 @echo "sudo ./scripts/install.sh $(ADK_TARGET_SYSTEM) /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
26 endif
27 ifeq ($(ADK_TARGET_SYSTEM_ROCKPI4_PLUS)$(ADK_TARGET_SYSTEM_RASPBERRY_PI5),y)
28 ifeq ($(ADK_RUNTIME_DATA_PARTITION),y)
29 @echo "Use following command to install with a writable data partition"
30 @echo "sudo ./scripts/install.sh -d 256 $(ADK_TARGET_SYSTEM) /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
31 @echo "If you want to update a card without loosing existing data on the writable partition use:"
32 @echo "sudo ./scripts/install.sh -k -d 256 $(ADK_TARGET_SYSTEM) /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
33 @echo "In both cases the cfgfs partition is _not_ removed!"
34 else
35 @echo "Use following command to install it on SD card:"
36 @echo "sudo ./scripts/install.sh $(ADK_TARGET_SYSTEM) /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
37 endif
38 endif
39 ifeq ($(ADK_TARGET_QEMU),y)
40 @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
41 @echo "Use following command to create a QEMU Image:"
42 @echo "./scripts/create.sh qemu-${ADK_TARGET_CPU_ARCH}.img $(FW_DIR)/$(ROOTFSTARBALL)"
43 @echo "Start qemu with following options:"
44 @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL)'
45 endif
46 endif
47 ifeq ($(ADK_TARGET_FS),initramfs)
48 targethelp:
49 @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
50 @echo 'The initramfs image is: ${FW_DIR}/${INITRAMFS}'
51 ifeq ($(ADK_TARGET_QEMU),y)
52 @echo "Start qemu with following command line:"
53 @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) -initrd ${FW_DIR}/${INITRAMFS}'
54 endif
55 endif
56 ifeq ($(ADK_TARGET_FS),initramfsarchive)
57 targethelp:
58 @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
59 @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
60 endif
61 ifeq ($(ADK_TARGET_FS),initramfspiggyback)
62 targethelp:
63 @echo 'The kernel+initramfs file is: $(FW_DIR)/${TARGET_KERNEL}'
64 ifeq ($(ADK_TARGET_QEMU),y)
65 @echo "Start qemu with following command line:"
66 @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL)'
67 endif
68 endif
69 ifeq ($(ADK_TARGET_FS),nfsroot)
70 targethelp:
71 @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
72 @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
73 endif
74 ifeq ($(ADK_TARGET_FS),genimage)
75 targethelp:
76 @echo "The disk image is: $(FW_DIR)/sdcard.img"
77 @echo "Use following command to install it on SD card:"
78 @echo 'sudo dd if=$(FW_DIR)/sdcard.img of=/dev/sdX bs=2048k'
79 endif
80 ifeq ($(ADK_TARGET_FS),nfsroot)
81 imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
82 endif
84 kernel-strip:
85 @cp $(KERNEL) $(BUILD_DIR)/$(TARGET_KERNEL)
87 kernel-install: kernel-strip
88 @cp $(BUILD_DIR)/$(TARGET_KERNEL) $(FW_DIR)/$(TARGET_KERNEL)
90 dtb-install:
91 ifeq ($(ADK_TARGET_BOARD_BCM28XX),y)
92 ${KERNEL_MAKE} dtbs $(MAKE_TRACE)
93 mkdir -p $(FW_DIR)/overlays
94 for x in $(LINUX_DIR)/arch/arm64/boot/dts/overlays/*.dtbo; do \
95 [[ -e "$$x" ]] && cp $(LINUX_DIR)/arch/arm64/boot/dts/overlays/*.dtbo $(FW_DIR)/overlays; \
96 break; \
97 done
98 for x in $(LINUX_DIR)/arch/arm64/boot/dts/broadcom/*.dtb; do \
99 [[ -e "$$x" ]] && cp $(LINUX_DIR)/arch/arm64/boot/dts/broadcom/*.dtb $(FW_DIR); \
100 break; \
101 done
102 endif
103 ifeq ($(ADK_TARGET_SYSTEM_ROCKPI4_PLUS),y)
104 ${KERNEL_MAKE} rockchip/rk3399-rock-pi-4b-plus.dtb $(MAKE_TRACE)
105 endif
106 for x in $(LINUX_DIR)/arch/arm64/boot/dts/*/*.dtb; do \
107 [[ -e "$$x" ]] && cp $(LINUX_DIR)/arch/arm64/boot/dts/*/*.dtb $(FW_DIR); \
108 break; \
109 done
111 # filesystem specific targets
112 ifeq ($(ADK_TARGET_FS),archive)
113 imageinstall: dtb-install $(FW_DIR)/$(ROOTFSTARBALL) targethelp
114 endif
115 ifeq ($(ADK_TARGET_FS),initramfs)
116 imageinstall: kernel-install $(FW_DIR)/$(INITRAMFS) targethelp
117 endif
118 ifeq ($(ADK_TARGET_FS),initramfsarchive)
119 imageinstall: kernel-install $(FW_DIR)/$(ROOTFSUSERTARBALL) targethelp
120 endif
121 ifeq ($(ADK_TARGET_FS),initramfspiggyback)
122 imageinstall: createinitramfs targethelp
123 endif
124 ifeq ($(ADK_TARGET_FS),genimage)
125 imageinstall: dtb-install $(FW_DIR)/$(GENIMAGE) targethelp
126 endif