1# $NetBSD: Makefile.inc,v 1.131 2022/11/03 09:04:56 skrll Exp $ 2# 3# etc.evbarm/Makefile.inc -- evbarm-specific etc Makefile targets 4# 5 6MKIMAGE= ${NETBSDSRCDIR}/distrib/utils/embedded/mkimage 7 8# If you change the list of distributed kernels, don't forget 9# to update the release documentation in distrib/notes/common/contents 10EVBARM_BOARDS= 11.for i in armv4 xscale armv5t armv6 armv7 arm64 12EVBARM_BOARDS.${i}= 13.endfor 14 15.if !empty(MACHINE_ARCH:M*eb) 16IMAGEENDIAN= be 17# big endian boards 18KERNEL_SETS.armv4+= IXM1200 19 20EVBARM_BOARDS.xscale+= ADI_BRH 21KERNEL_SETS.xscale+= NSLU2 22 23EVBARM_BOARDS.armv5t+= KUROBOX_PRO 24KERNEL_SETS.armv5t+= OPENBLOCKS_A6 25# Other marvell-based machines may also work but not tested yet. 26 27EVBARM_BOARDS.armv6+= RPI 28EVBARM_BOARDS.armv6hf+= RPI 29KERNEL_SETS.armv6+= RPI2 30KERNEL_SETS.armv6hf+= RPI2 31 32KERNEL_SETS.armv7+= GENERIC 33KERNEL_SETS.armv7hf+= GENERIC 34 35KERNEL_SETS.arm64+= GENERIC64 36KERNEL_SETS.arm64+= GENERIC64_PMAPMI 37.else 38IMAGEENDIAN= le 39# little endian boards 40EVBARM_BOARDS.armv4+= GEMINI 41EVBARM_BOARDS.armv4+= INTEGRATOR 42EVBARM_BOARDS.armv4+= INTEGRATOR_CP 43KERNEL_SETS.armv4+= IXM1200 44EVBARM_BOARDS.armv4+= SMDK2410 45EVBARM_BOARDS.armv4+= SMDK2800 46EVBARM_BOARDS.armv4+= TS7200 47 48EVBARM_BOARDS.xscale+= ADI_BRH 49EVBARM_BOARDS.xscale+= CP3100 50EVBARM_BOARDS.xscale+= GUMSTIX 51KERNEL_SETS.xscale+= HDL_G 52EVBARM_BOARDS.xscale+= IQ80310 53EVBARM_BOARDS.xscale+= IQ80321 54EVBARM_BOARDS.xscale+= TEAMASA_NPWR 55EVBARM_BOARDS.xscale+= TWINTAIL 56 57EVBARM_BOARDS.armv5t+= KUROBOX_PRO 58EVBARM_BOARDS.armv5t+= MV2120 59KERNEL_SETS.armv5t+= OPENBLOCKS_A6 60EVBARM_BOARDS.armv5t+= OPENRD 61EVBARM_BOARDS.armv5t+= SHEEVAPLUG 62 63EVBARM_BOARDS.armv6+= RPI 64EVBARM_BOARDS.armv6hf+= RPI 65KERNEL_SETS.armv6+= RPI2 66KERNEL_SETS.armv6hf+= RPI2 67 68KERNEL_SETS.armv7+= GENERIC 69KERNEL_SETS.armv7hf+= GENERIC 70 71KERNEL_SETS.arm64+= GENERIC64 72KERNEL_SETS.arm64+= GENERIC64_PMAPMI 73.endif 74 75IMAGE.rel= ${RELEASEDIR}/${RELEASEMACHINEDIR} 76IMAGE.dir= ${IMAGE.rel}/binary/gzimg 77IMAGE.kern= ${IMAGE.rel}/binary/kernel 78IMAGE.instk= ${IMAGE.rel}/installation/instkernel 79 80__mkimage: .USE 81 TOOL_MAKE=${MAKE} \ 82 TOOL_MAKEFS=${TOOL_MAKEFS} \ 83 TOOL_DISKLABEL=${TOOL_DISKLABEL} \ 84 TOOL_FDISK=${TOOL_FDISK} \ 85 TOOL_GPT=${TOOL_GPT} \ 86 TOOL_GZIP=${TOOL_GZIP} \ 87 TOOL_MKNOD=${TOOL_MKNOD} \ 88 TOOL_PAX=${TOOL_PAX} \ 89 TOOL_MKUBOOTIMAGE=${TOOL_MKUBOOTIMAGE} \ 90 TOOL_MTREE=${TOOL_MTREE} \ 91 HOST_SH=${HOST_SH} \ 92 KERNOBJDIR=${KERNOBJDIR} \ 93 MACHINE=${MACHINE} \ 94 MKDTB=${MKDTB} \ 95 ${HOST_SH} ${MKIMAGE} -x -h ${.TARGET:S/smp_//} -D ${DESTDIR} \ 96 -S ${NETBSDSRCDIR} -B ${IMAGEENDIAN} ${MKI_OPTS.${.TARGET}} \ 97 ${IMAGE.dir}/${.TARGET:S/smp_//}.img.gz 98 ${TOOL_GZIP} -cd ${IMAGE.dir}/${.TARGET:S/smp_//}.img.gz \ 99 > ${IMAGE.dir}/${.TARGET:S/smp_//}.img 100.for f in ${INSTALLBOOT_BOARDS} 101 @echo "===> Making bootable image ${IMAGE.dir:T}/${.TARGET:S/smp_//}-${f}.img.gz" 102 @cp ${IMAGE.dir}/${.TARGET:S/smp_//}.img ${IMAGE.dir}/${.TARGET:S/smp_//}-${f}.img 103 @${TOOL_INSTALLBOOT} -m ${MACHINE} -o board=${f} \ 104 ${IMAGE.dir}/${.TARGET:S/smp_//}-${f}.img \ 105 && ${TOOL_GZIP} -f ${IMAGE.dir}/${.TARGET:S/smp_//}-${f}.img \ 106 || rm ${IMAGE.dir}/${.TARGET:S/smp_//}-${f}.img 107.endfor 108 rm ${IMAGE.dir}/${.TARGET:S/smp_//}.img 109 110ARCHES.earmv4= armv4 111ARCHES.earmv4eb= armv4 112ARCHES.earmv5= xscale armv5t 113ARCHES.earmv5eb= xscale armv5t 114ARCHES.earmv6= armv6 115ARCHES.earmv6hf= armv6hf 116ARCHES.earmv6eb= armv6 117ARCHES.earmv6hfeb= armv6hf 118ARCHES.earmv7= armv7 119ARCHES.earmv7hf= armv7hf 120ARCHES.earmv7eb= armv7 121ARCHES.earmv7hfeb= armv7hf 122ARCHES.aarch64= arm64 123ARCHES.aarch64eb= arm64 124.for arch in ${ARCHES.${MACHINE_ARCH}} 125.for board in ${EVBARM_BOARDS.${arch}} 126KERNEL_SETS+= ${board} 127BUILD_KERNELS+= ${board}_INSTALL 128.endfor 129KERNEL_SETS+= ${KERNEL_SETS.${arch}} 130.endfor 131 132.if !empty(MACHINE_ARCH:Maarch64*) 133smp_efibootaa64: 134 cd ${KERNSRCDIR}/stand/efiboot/bootaa64 && ${MAKE} release 135SNAP_MD_POST_DEPS+= smp_efibootaa64 136INSTALLATION_DIRS+= installation/misc 137.endif 138 139.if !empty(MACHINE_ARCH:Mearmv7hf) 140smp_efibootarm: 141 cd ${KERNSRCDIR}/stand/efiboot/bootarm && ${MAKE} release 142SNAP_MD_POST_DEPS+= smp_efibootarm 143INSTALLATION_DIRS+= installation/misc 144.endif 145 146.if !empty(MACHINE_ARCH:M*armv7*) && empty(ALL_KERNELS) 147smp_armv7: __mkimage 148MKI_OPTS.smp_armv7= -K ${IMAGE.kern} 149SNAP_MD_POST_DEPS+= smp_armv7 150.endif 151 152.if !empty(MACHINE_ARCH:Maarch64*) && empty(ALL_KERNELS) 153smp_arm64: __mkimage 154MKI_OPTS.smp_arm64= -K ${IMAGE.kern} 155SNAP_MD_POST_DEPS+= smp_arm64 156smp_arm64mbr: __mkimage 157MKI_OPTS.smp_arm64mbr= -K ${IMAGE.kern} 158SNAP_MD_POST_DEPS+= smp_arm64mbr 159.endif 160 161.if !empty(KERNEL_SETS:MRPI) 162smp_rpi: __mkimage 163.if empty(ALL_KERNELS) || !empty(ALL_KERNELS:MRPI) 164MKI_OPTS.smp_rpi= -K ${IMAGE.kern}/netbsd-RPI.img.gz 165SNAP_MD_POST_DEPS+= smp_rpi 166.endif 167smp_rpi_inst: ${IMAGE.instk}/netbsd-RPI_INSTALL.img.gz __mkimage 168.if empty(ALL_KERNELS) || !empty(ALL_KERNELS:MRPI_INSTALL) 169MKI_OPTS.smp_rpi_inst= -b -K ${IMAGE.instk}/netbsd-RPI_INSTALL.img.gz 170SNAP_MD_POST_DEPS+= smp_rpi_inst 171.endif 172.endif 173 174snap_md_post: check_DESTDIR check_RELEASEDIR snap_post .WAIT ${SNAP_MD_POST_DEPS} 175 176.if !empty(MACHINE_ARCH:Maarch64*) 177KERNEL_SUFFIXES= img 178.else 179KERNEL_SUFFIXES= bin img srec ub 180.endif 181 182INSTALLATION_DIRS+= binary/gzimg \ 183 installation/instkernel 184