freebsd-dev/sys/boot/fdt/Makefile
Oleksandr Tymoshenko 26f47fdd8f Add FDT overlays support to ubldr
FDT overlays is de-facto standard for describing expansion boards like
Beaglebone capes or Raspberry Pi shields. The ides is to have basic
DTB for base board and overlays DTB for shields/capes and to construct
final DTB either using human-readable configuration or some
self-discovery mechanism. I believe this approach can also be expanded
to support dynamically loadable FPGA bitstreams on systems like
Zedboard/Zybo.

Overlaying process is simmilar to executable link process for
binaries: each DTB has "exported" symbols and "undefined" symbols, the
latter are resolved using information for the former obtained from
base DTB or one of the overlays applied earlier (more rare case).

This symbols information is not generated by standard dtc that FreeBSD
has in base system, patched[1] version required to produces
overlay-compatible blobs. So although DTB files generated by
buildkernel do not support overlays there are enough
vendor/community-provided DTB blobs ciruclating around to justify
committing this change to ubldr.

This commit introduces handler for "fdt_overlays" variable that can be
defined either as a loader env variable or U-Boot env variable.
fdt_overlays is comma-separated list of .dtbo files located in
/boot/dtb/ directory along with base .dtb. ubldr loads files and
applies them one-by-one to base .dtb and then passes result blob to
the kernel.

[1] dd6a0533e8

Differential Revision:	https://reviews.freebsd.org/D3180
2016-04-29 22:42:59 +00:00

31 lines
629 B
Makefile

# $FreeBSD$
.PATH: ${.CURDIR}/../../contrib/libfdt/
LIB= fdt
INTERNALLIB=
# Vendor sources of libfdt.
SRCS+= fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt_strerror.c \
fdt_empty_tree.c
# Loader's fdt commands extension sources.
SRCS+= fdt_loader_cmd.c fdt_overlay.c
CFLAGS+= -I${.CURDIR}/../../contrib/libfdt/ -I${.CURDIR}/../common/
CFLAGS+= -ffreestanding
.if ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "mips"
CFLAGS+= -msoft-float
.endif
.if ${MACHINE_ARCH} == "powerpc64"
CFLAGS+= -m32
.endif
CFLAGS+= -Wformat -Wall
.include <bsd.stand.mk>
.include <bsd.lib.mk>