Index: head/sys/boot/arm/uboot/Makefile =================================================================== --- head/sys/boot/arm/uboot/Makefile (revision 325688) +++ head/sys/boot/arm/uboot/Makefile (revision 325689) @@ -1,87 +1,86 @@ # $FreeBSD$ LOADER_UFS_SUPPORT?= yes LOADER_CD9660_SUPPORT?= no LOADER_MSDOS_SUPPORT?= no LOADER_EXT2FS_SUPPORT?= no LOADER_NET_SUPPORT?= yes LOADER_NFS_SUPPORT?= yes LOADER_TFTP_SUPPORT?= no LOADER_GZIP_SUPPORT?= no LOADER_BZIP2_SUPPORT?= no -LOADER_FDT_SUPPORT= ${MK_FDT} .include FILES= ubldr ubldr.bin NEWVERSWHAT= "U-Boot loader" ${MACHINE_ARCH} INSTALLFLAGS= -b WARNS?= 1 # Address at which ubldr will be loaded. # This varies for different boards and SOCs. UBLDR_LOADADDR?= 0x1000000 # Architecture-specific loader code SRCS= start.S conf.c self_reloc.c vers.c .if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} > 40201 CWARNFLAGS.self_reloc.c+= -Wno-error=maybe-uninitialized .endif # Always add MI sources .include "${BOOTSRC}/loader.mk" CFLAGS+= -I. CLEANFILES+= loader.help CFLAGS+= -ffreestanding -msoft-float LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.${MACHINE_CPUARCH} LDFLAGS+= -Wl,-znotext # Pull in common loader code .include "${BOOTSRC}/uboot.mk" CFLAGS+= -fPIC DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} OBJS+= ${SRCS:N*.h:R:S/$/.o/g} loader.help: help.common help.uboot ${BOOTSRC}/fdt/help.fdt cat ${.ALLSRC} | \ awk -f ${LDRSRC}/merge_help.awk > ${.TARGET} ldscript.abs: echo "UBLDR_LOADADDR = ${UBLDR_LOADADDR};" >${.TARGET} ldscript.pie: echo "UBLDR_LOADADDR = 0;" >${.TARGET} ubldr: ${OBJS} ldscript.abs ${.CURDIR}/ldscript.${MACHINE_CPUARCH} ${DPADD} ${CC} ${CFLAGS} -T ldscript.abs ${LDFLAGS} \ -o ${.TARGET} ${OBJS} ${LDADD} ubldr.pie: ${OBJS} ldscript.pie ${.CURDIR}/ldscript.${MACHINE_CPUARCH} ${DPADD} ${CC} ${CFLAGS} -T ldscript.pie ${LDFLAGS} -pie -Wl,-Bsymbolic \ -o ${.TARGET} ${OBJS} ${LDADD} ubldr.bin: ubldr.pie ${OBJCOPY} -S -O binary ubldr.pie ${.TARGET} CLEANFILES+= ldscript.abs ldscript.pie ubldr ubldr.pie ubldr.bin .if !defined(LOADER_ONLY) .PATH: ${BOOTSRC}/forth .include "${BOOTSRC}/forth/Makefile.inc" # Install loader.rc. FILES+= loader.rc # Put sample menu.rc on disk but don't enable it by default. FILES+= menu.rc FILESNAME_menu.rc= menu.rc.sample .endif .include Index: head/sys/boot/efi/loader/Makefile =================================================================== --- head/sys/boot/efi/loader/Makefile (revision 325688) +++ head/sys/boot/efi/loader/Makefile (revision 325689) @@ -1,135 +1,131 @@ # $FreeBSD$ MAN= LOADER_NET_SUPPORT?= yes LOADER_MSDOS_SUPPORT?= yes LOADER_UFS_SUPPORT?= yes LOADER_CD9660_SUPPORT?= no LOADER_EXT2FS_SUPPORT?= no .include MK_SSP= no PROG= loader.sym INTERNALPROG= WARNS?= 3 # architecture-specific loader code SRCS= autoload.c \ bootinfo.c \ conf.c \ copy.c \ efi_main.c \ framebuffer.c \ main.c \ self_reloc.c \ smbios.c \ vers.c .if ${MK_ZFS} != "no" LIBZFSBOOT= ${BOOTOBJ}/zfs/libzfsboot.a CFLAGS+= -I${ZFSSRC} CFLAGS+= -DEFI_ZFS_BOOT .endif .if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} > 40201 CWARNFLAGS.self_reloc.c+= -Wno-error=maybe-uninitialized .endif # We implement a slightly non-standard %S in that it always takes a # CHAR16 that's common in UEFI-land instead of a wchar_t. This only # seems to matter on arm64 where wchar_t defaults to an int instead # of a short. There's no good cast to use here so just ignore the # warnings for now. CWARNFLAGS.main.c+= -Wno-format .PATH: ${.CURDIR}/arch/${MACHINE} # For smbios.c .PATH: ${BOOTSRC}/i386/libi386 .include "${.CURDIR}/arch/${MACHINE}/Makefile.inc" CFLAGS+= -I${.CURDIR} CFLAGS+= -I${.CURDIR}/arch/${MACHINE} CFLAGS+= -I${EFISRC}/include CFLAGS+= -I${EFISRC}/include/${MACHINE} CFLAGS+= -I${SYSDIR}/contrib/dev/acpica/include CFLAGS+= -I${SYSDIR} CFLAGS+= -I${BOOTSRC}/i386/libi386 CFLAGS+= -DNO_PCI -DEFI .if !defined(BOOT_HIDE_SERIAL_NUMBERS) # Export serial numbers, UUID, and asset tag from loader. CFLAGS+= -DSMBIOS_SERIAL_NUMBERS .if defined(BOOT_LITTLE_ENDIAN_UUID) # Use little-endian UUID format as defined in SMBIOS 2.6. CFLAGS+= -DSMBIOS_LITTLE_ENDIAN_UUID .elif defined(BOOT_NETWORK_ENDIAN_UUID) # Use network-endian UUID format for backward compatibility. CFLAGS+= -DSMBIOS_NETWORK_ENDIAN_UUID .endif .endif -LOADER_FDT_SUPPORT?= no -.if ${MK_FDT} != "no" && ${LOADER_FDT_SUPPORT} != "no" -CFLAGS+= -I${BOOTSRC}/fdt -CFLAGS+= -I${BOOTSRC}/fdt -CFLAGS+= -DLOADER_FDT_SUPPORT +.if defined(HAVE_FDT) && ${MK_FDT} != "no" +.include "${BOOTSRC}/fdt.mk" LIBEFI_FDT= ${BOOTOBJ}/efi/fdt/libefi_fdt.a -LIBFDT= ${BOOTOBJ}/fdt/libfdt.a .endif # Include bcache code. HAVE_BCACHE= yes .if defined(EFI_STAGING_SIZE) CFLAGS+= -DEFI_STAGING_SIZE=${EFI_STAGING_SIZE} .endif # Always add MI sources .include "${BOOTSRC}/loader.mk" FILES+= loader.efi FILESMODE_loader.efi= ${BINMODE} LDSCRIPT= ${.CURDIR}/arch/${MACHINE}/ldscript.${MACHINE} LDFLAGS+= -Wl,-T${LDSCRIPT},-Bsymbolic,-znotext -shared CLEANFILES+= loader.efi NEWVERSWHAT= "EFI loader" ${MACHINE} NM?= nm OBJCOPY?= objcopy .if ${MACHINE_CPUARCH} == "amd64" EFI_TARGET= efi-app-x86_64 .elif ${MACHINE_CPUARCH} == "i386" EFI_TARGET= efi-app-ia32 .else EFI_TARGET= binary .endif # Arbitrarily set the PE/COFF header timestamps to 1 Jan 2016 00:00:00 # for build reproducibility. SOURCE_DATE_EPOCH?=1451606400 loader.efi: ${PROG} if ${NM} ${.ALLSRC} | grep ' U '; then \ echo "Undefined symbols in ${.ALLSRC}"; \ exit 1; \ fi SOURCE_DATE_EPOCH=${SOURCE_DATE_EPOCH} \ ${OBJCOPY} -j .peheader -j .text -j .sdata -j .data \ -j .dynamic -j .dynsym -j .rel.dyn \ -j .rela.dyn -j .reloc -j .eh_frame -j set_Xcommand_set \ -j set_Xficl_compile_set \ --output-target=${EFI_TARGET} ${.ALLSRC} ${.TARGET} LIBEFI= ${BOOTOBJ}/efi/libefi/libefi.a DPADD= ${LIBFICL} ${LIBEFI} ${LIBFDT} ${LIBEFI_FDT} ${LIBZFSBOOT} ${LIBSA} \ ${LDSCRIPT} LDADD= ${LIBFICL} ${LIBEFI} ${LIBFDT} ${LIBEFI_FDT} ${LIBZFSBOOT} ${LIBSA} .include Index: head/sys/boot/efi/loader/arch/arm/Makefile.inc =================================================================== --- head/sys/boot/efi/loader/arch/arm/Makefile.inc (revision 325688) +++ head/sys/boot/efi/loader/arch/arm/Makefile.inc (revision 325689) @@ -1,6 +1,6 @@ # $FreeBSD$ SRCS+= exec.c \ start.S -LOADER_FDT_SUPPORT=yes +HAVE_FDT=yes Index: head/sys/boot/efi/loader/arch/arm64/Makefile.inc =================================================================== --- head/sys/boot/efi/loader/arch/arm64/Makefile.inc (revision 325688) +++ head/sys/boot/efi/loader/arch/arm64/Makefile.inc (revision 325689) @@ -1,24 +1,25 @@ # $FreeBSD$ -LOADER_FDT_SUPPORT=yes +HAVE_FDT=yes + SRCS+= exec.c \ start.S .PATH: ${BOOTSRC}/arm64/libarm64 CFLAGS+=-I${BOOTSRC}/arm64/libarm64 SRCS+= cache.c CFLAGS+= -mgeneral-regs-only CLEANFILES+= loader.help loader.help: help.common cat ${.ALLSRC} | \ awk -f ${LDRSRC}/merge_help.awk > ${.TARGET} .if !defined(LOADER_ONLY) .PATH: ${BOOTSRC}/forth .include "${BOOTSRC}/forth/Makefile.inc" FILES+= loader.rc .endif Index: head/sys/boot/fdt.mk =================================================================== --- head/sys/boot/fdt.mk (nonexistent) +++ head/sys/boot/fdt.mk (revision 325689) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +.if ${MK_FDT} == "yes" +CFLAGS+= -I${FDTSRC} +CFLAGS+= -I${BOOTOBJ}/fdt +CFLAGS+= -I${SYSDIR}/contrib/libfdt +CFLAGS+= -DLOADER_FDT_SUPPORT +LIBFDT= ${BOOTOBJ}/fdt/libfdt.a +.endif Property changes on: head/sys/boot/fdt.mk ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/sys/boot/mips/uboot/Makefile =================================================================== --- head/sys/boot/mips/uboot/Makefile (revision 325688) +++ head/sys/boot/mips/uboot/Makefile (revision 325689) @@ -1,74 +1,73 @@ # $FreeBSD$ LOADER_CD9660_SUPPORT?= no LOADER_EXT2FS_SUPPORT?= no LOADER_MSDOS_SUPPORT?= yes LOADER_UFS_SUPPORT?= yes LOADER_NET_SUPPORT?= yes LOADER_NFS_SUPPORT?= yes LOADER_TFTP_SUPPORT?= no LOADER_GZIP_SUPPORT?= no LOADER_BZIP2_SUPPORT?= no -LOADER_FDT_SUPPORT= ${MK_FDT} .include FILES= ubldr NEWVERSWHAT= "U-Boot loader" ${MACHINE_ARCH} INSTALLFLAGS= -b WARNS?= 1 # Address at which ubldr will be loaded. # This varies for different boards and SOCs. UBLDR_LOADADDR?= 0xffffffff80800000 # Architecture-specific loader code SRCS= start.S conf.c vers.c # Always add MI sources .include "${BOOTSRC}/loader.mk" CFLAGS+= -I. CLEANFILES+= loader.help CFLAGS+= -ffreestanding -msoft-float -g LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.${MACHINE_CPUARCH} .include "${BOOTSRC}/uboot.mk" DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} OBJS+= ${SRCS:N*.h:R:S/$/.o/g} loader.help: help.common help.uboot ${BOOTSRC}/fdt/help.fdt cat ${.ALLSRC} | \ awk -f ${LDRSRC}/merge_help.awk > ${.TARGET} ldscript.abs: echo "UBLDR_LOADADDR = ${UBLDR_LOADADDR};" >${.TARGET} ldscript.pie: echo "UBLDR_LOADADDR = 0;" >${.TARGET} ubldr: ${OBJS} ldscript.abs ${.CURDIR}/ldscript.${MACHINE_CPUARCH} ${DPADD} ${CC} ${CFLAGS} -T ldscript.abs ${LDFLAGS} \ -o ${.TARGET} ${OBJS} ${LDADD} ${OBJCOPY} -S -O binary ubldr ubldr.bin CLEANFILES+= ldscript.abs ldscript.pie ubldr ubldr.pie ubldr.bin .if !defined(LOADER_ONLY) .PATH: ${BOOTSRC}/forth .include "${BOOTSRC}/forth/Makefile.inc" # Install loader.rc. FILES+= loader.rc # Put sample menu.rc on disk but don't enable it by default. FILES+= menu.rc FILESNAME_menu.rc= menu.rc.sample .endif .include .include Index: head/sys/boot/powerpc/Makefile =================================================================== --- head/sys/boot/powerpc/Makefile (revision 325688) +++ head/sys/boot/powerpc/Makefile (revision 325689) @@ -1,8 +1,13 @@ # $FreeBSD$ -SUBDIR= boot1.chrp kboot ofw uboot +.include + +SUBDIR= boot1.chrp ofw uboot .if ${MACHINE_ARCH} != "powerpcspe" SUBDIR+= ps3 +.endif +.if ${MK_FDT} == "yes" +SUBDIR+= kboot .endif .include Index: head/sys/boot/powerpc/kboot/Makefile =================================================================== --- head/sys/boot/powerpc/kboot/Makefile (revision 325688) +++ head/sys/boot/powerpc/kboot/Makefile (revision 325689) @@ -1,66 +1,60 @@ # $FreeBSD$ LOADER_CD9660_SUPPORT?= yes LOADER_MSDOS_SUPPORT?= no LOADER_EXT2FS_SUPPORT?= yes LOADER_UFS_SUPPORT?= yes LOADER_NET_SUPPORT?= yes LOADER_NFS_SUPPORT?= yes LOADER_TFTP_SUPPORT?= no LOADER_GZIP_SUPPORT?= yes -LOADER_FDT_SUPPORT= yes LOADER_BZIP2_SUPPORT?= no .include MK_SSP= no MAN= PROG= loader.kboot NEWVERSWHAT= "kboot loader" ${MACHINE_ARCH} INSTALLFLAGS= -b # Architecture-specific loader code SRCS= conf.c metadata.c vers.c main.c ppc64_elf_freebsd.c SRCS+= host_syscall.S hostcons.c hostdisk.c kerneltramp.S kbootfdt.c SRCS+= ucmpdi2.c -.if ${LOADER_FDT_SUPPORT} == "yes" -CFLAGS+= -I${FDTSRC} -CFLAGS+= -I${SYSDIR}/contrib/libfdt -CFLAGS+= -DLOADER_FDT_SUPPORT -LIBFDT= ${BOOTOBJ}/fdt/libfdt.a -.endif +.include "${BOOTSRC}/fdt.mk" CFLAGS+= -mcpu=powerpc64 # Always add MI sources .include "${BOOTSRC}/loader.mk" .PATH: ${SYSDIR}/libkern CFLAGS+= -I${SYSDIR} CFLAGS+= -I. CLEANFILES+= loader.help CFLAGS+= -Wall -ffreestanding -msoft-float -DAIM # load address. set in linker script RELOC?= 0x0 CFLAGS+= -DRELOC=${RELOC} LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.powerpc # 64-bit bridge extensions CFLAGS+= -Wa,-mppc64bridge DPADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA} LDADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA} loader.help: help.common ${FDTSRC}/help.fdt cat ${.ALLSRC} | \ awk -f ${LDRSRC}/merge_help.awk > ${.TARGET} .PATH: ${BOOTSRC}/forth .include "${BOOTSRC}/forth/Makefile.inc" FILES+= loader.rc menu.rc .include Index: head/sys/boot/powerpc/ofw/Makefile =================================================================== --- head/sys/boot/powerpc/ofw/Makefile (revision 325688) +++ head/sys/boot/powerpc/ofw/Makefile (revision 325689) @@ -1,70 +1,66 @@ # $FreeBSD$ LOADER_CD9660_SUPPORT?= yes LOADER_EXT2FS_SUPPORT?= no LOADER_MSDOS_SUPPORT?= no LOADER_UFS_SUPPORT?= yes LOADER_NET_SUPPORT?= yes LOADER_NFS_SUPPORT?= yes LOADER_TFTP_SUPPORT?= no LOADER_GZIP_SUPPORT?= yes LOADER_BZIP2_SUPPORT?= no -LOADER_FDT_SUPPORT?= yes .include MK_SSP= no MAN= PROG= loader NEWVERSWHAT= "Open Firmware loader" ${MACHINE_ARCH} INSTALLFLAGS= -b # Architecture-specific loader code SRCS= conf.c metadata.c vers.c start.c SRCS+= ucmpdi2.c -.if ${LOADER_FDT_SUPPORT} == "yes" +.include "${BOOTSRC}/fdt.mk" +.if ${MK_FDT} == "yes" SRCS+= ofwfdt.c -CFLAGS+= -I${FDTSRC} -CFLAGS+= -I${SYSDIR}/contrib/libfdt -CFLAGS+= -DLOADER_FDT_SUPPORT -LIBFDT= ${BOOTOBJ}/fdt/libfdt.a .endif # Always add MI sources .include "${BOOTSRC}/loader.mk" .PATH: ${SYSDIR}/libkern CFLAGS+= -I${SYSDIR} CFLAGS+= -I. CLEANFILES+= loader.help CFLAGS+= -ffreestanding -msoft-float # load address. set in linker script RELOC?= 0x1C00000 CFLAGS+= -DRELOC=${RELOC} LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.powerpc # Pull in common loader code .PATH: ${BOOTSRC}/ofw/common .include "${BOOTSRC}/ofw/common/Makefile.inc" # Open Firmware standalone support library LIBOFW= ${BOOTOBJ}/ofw/libofw/libofw.a CFLAGS+= -I${BOOTSRC}/ofw/libofw DPADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA} LDADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA} loader.help: help.common ${FDTSRC}/help.fdt cat ${.ALLSRC} | \ awk -f ${LDRSRC}/merge_help.awk > ${.TARGET} .PATH: ${BOOTSRC}/forth .include "${BOOTSRC}/forth/Makefile.inc" FILES+= loader.rc menu.rc .include Index: head/sys/boot/powerpc/uboot/Makefile =================================================================== --- head/sys/boot/powerpc/uboot/Makefile (revision 325688) +++ head/sys/boot/powerpc/uboot/Makefile (revision 325689) @@ -1,48 +1,47 @@ # $FreeBSD$ LOADER_UFS_SUPPORT?= yes LOADER_CD9660_SUPPORT?= no LOADER_EXT2FS_SUPPORT?= no LOADER_NET_SUPPORT?= yes LOADER_NFS_SUPPORT?= yes LOADER_TFTP_SUPPORT?= no LOADER_GZIP_SUPPORT?= no LOADER_BZIP2_SUPPORT?= no -LOADER_FDT_SUPPORT= ${MK_FDT} .include PROG= ubldr NEWVERSWHAT= "U-Boot loader" ${MACHINE_ARCH} INSTALLFLAGS= -b MAN= # Architecture-specific loader code SRCS= start.S conf.c vers.c SRCS+= ucmpdi2.c # Always add MI sources .include "${BOOTSRC}/loader.mk" .PATH: ${SYSDIR}/libkern CFLAGS+= -I${SYSDIR} CFLAGS+= -I. CLEANFILES+= ${PROG}.help CFLAGS+= -ffreestanding LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.powerpc .include "${BOOTSRC}/uboot.mk" DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} loader.help: help.common ${BOOTSRC}/fdt/help.fdt cat ${.ALLSRC} | \ awk -f ${LDRSRC}/merge_help.awk > ${.TARGET} .PATH: ${BOOTSRC}/forth FILES= loader.help .include Index: head/sys/boot/uboot/lib/Makefile =================================================================== --- head/sys/boot/uboot/lib/Makefile (revision 325688) +++ head/sys/boot/uboot/lib/Makefile (revision 325689) @@ -1,38 +1,31 @@ # $FreeBSD$ .include .PATH: ${LDRSRC} LIB= uboot INTERNALLIB= WARNS?= 2 SRCS= console.c copy.c devicename.c elf_freebsd.c glue.c SRCS+= module.c net.c reboot.c time.c CFLAGS+= -ffreestanding -msoft-float .if ${LOADER_DISK_SUPPORT:Uyes} == "yes" SRCS+= disk.c .endif -LOADER_FDT_SUPPORT= ${MK_FDT} - -.if ${LOADER_FDT_SUPPORT} == "yes" -CFLAGS+= -DLOADER_FDT_SUPPORT -I${FDTSRC} -.endif - -# Pick up FDT includes -CFLAGS+= -I${SYSDIR}/contrib/libfdt/ +.include "${BOOTSRC}/fdt.mk" # Pick up the bootstrap header for some interface items CFLAGS+= -I${LDRSRC} -I${SYSDIR} -I. .ifdef(BOOT_DISK_DEBUG) # Make the disk code more talkative CFLAGS+= -DDISK_DEBUG .endif .include .include Index: head/sys/boot/uboot.mk =================================================================== --- head/sys/boot/uboot.mk (revision 325688) +++ head/sys/boot/uboot.mk (revision 325689) @@ -1,20 +1,18 @@ # $FreeBSD$ SRCS+= main.c metadata.c .PATH: ${UBOOTSRC}/common CFLAGS+= -I${UBOOTSRC}/common # U-Boot standalone support library LIBUBOOT= ${BOOTOBJ}/uboot/lib/libuboot.a CFLAGS+= -I${UBOOTSRC}/lib CFLAGS+= -I${BOOTOBJ}/uboot/lib -.if ${LOADER_FDT_SUPPORT} == "yes" -CFLAGS+= -I${FDTSRC} -CFLAGS+= -I${BOOTOBJ}/fdt -CFLAGS+= -DLOADER_FDT_SUPPORT +.include "${BOOTSRC}/fdt.mk" + +.if ${MK_FDT} == "yes" LIBUBOOT_FDT= ${BOOTOBJ}/uboot/fdt/libuboot_fdt.a -LIBFDT= ${BOOTOBJ}/fdt/libfdt.a .endif