diff options
| author | skrll <skrll@NetBSD.org> | 2023-05-07 12:41:45 +0000 |
|---|---|---|
| committer | skrll <skrll@NetBSD.org> | 2023-05-07 12:41:45 +0000 |
| commit | 0cdd33139a1c60797bd5002b4944b2faa9e2f9c6 (patch) | |
| tree | 6358f451321d60c76649dcd34633a6c1799fdb77 /etc | |
| parent | 67090cda0ba82dccb26f986c355d2b5926cf73c4 (diff) | |
RISC-V support that works on QEMU with a single hart.
Thanks for Simon Burge for plic(4).
Diffstat (limited to 'etc')
| -rw-r--r-- | etc/etc.riscv/Makefile.inc | 60 |
1 files changed, 53 insertions, 7 deletions
diff --git a/etc/etc.riscv/Makefile.inc b/etc/etc.riscv/Makefile.inc index 584f326cf23..3ea566f857a 100644 --- a/etc/etc.riscv/Makefile.inc +++ b/etc/etc.riscv/Makefile.inc @@ -1,17 +1,63 @@ -# $NetBSD: Makefile.inc,v 1.3 2021/10/04 06:50:35 skrll Exp $ +# $NetBSD: Makefile.inc,v 1.4 2023/05/07 12:41:46 skrll Exp $ # # etc.riscv/Makefile.inc -- riscv-specific etc Makefile targets # +.if ${MACHINE_ARCH} == "riscv64" +KERNEL_SETS= GENERIC64 +.else KERNEL_SETS= GENERIC -EXTRA_KERNELS= INSTALL - -.if ${MACHINE_ARCH} == "riscv64" && ${HAVE_UEFI} == "yes" -INSTALLATION_DIRS+= installation/misc .endif -snap_md_post: -.if ${MACHINE_ARCH} == "riscv64" && ${HAVE_UEFI} == "yes" +# Support for mkimage +MKIMAGE= ${NETBSDSRCDIR}/distrib/utils/embedded/mkimage +IMAGE.rel= ${RELEASEDIR}/${RELEASEMACHINEDIR} +IMAGE.dir= ${IMAGE.rel}/binary/gzimg +IMAGE.kern= ${IMAGE.rel}/binary/kernel + +# TOOL_MKUBOOTIMAGE=${TOOL_MKUBOOTIMAGE} \ + +__mkimage: .USE + TOOL_MAKE=${MAKE} \ + TOOL_MAKEFS=${TOOL_MAKEFS} \ + TOOL_DISKLABEL=${TOOL_DISKLABEL} \ + TOOL_FDISK=${TOOL_FDISK} \ + TOOL_GPT=${TOOL_GPT} \ + TOOL_GZIP=${TOOL_GZIP} \ + TOOL_MKNOD=${TOOL_MKNOD} \ + TOOL_PAX=${TOOL_PAX} \ + TOOL_MTREE=${TOOL_MTREE} \ + HOST_SH=${HOST_SH} \ + KERNOBJDIR=${KERNOBJDIR} \ + MACHINE=${MACHINE} \ + MKDTB=${MKDTB} \ + ${HOST_SH} ${MKIMAGE} -h ${.TARGET:S/smp_//} -D ${DESTDIR} \ + -S ${NETBSDSRCDIR} ${MKI_OPTS.${.TARGET}} \ + ${IMAGE.dir}/${.TARGET:S/smp_//}.img.gz + + +.if ${MACHINE_ARCH} == "riscv64" +.if ${HAVE_UEFI} == "yes" +smp_efibootriscv64: cd ${KERNSRCDIR}/stand/efiboot/bootriscv64 && ${MAKE} release ${MAKESUMS} -t ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/misc '*.efi' +SNAP_MD_POST_DEPS+= smp_efibootriscv64 +INSTALLATION_DIRS+= installation/misc .endif + +smp_riscv64: __mkimage +MKI_OPTS.smp_riscv64= -K ${IMAGE.kern} +SNAP_MD_POST_DEPS+= smp_riscv64 +.endif + + +.if ${MACHINE_ARCH} == "riscv32" +smp_riscv32: __mkimage +MKI_OPTS.smp_riscv32= -K ${IMAGE.kern} +SNAP_MD_POST_DEPS+= smp_riscv32 +.endif + +snap_md_post: check_DESTDIR check_RELEASEDIR snap_post .WAIT ${SNAP_MD_POST_DEPS} + +INSTALLATION_DIRS+= binary/gzimg \ + installation/instkernel |
