MFC 262614, 262625, 262626, 262627, 262682, 262714, 262725, 262736
Integrate device-tree upstream files into the build process: (1) Invoke cpp to bring in files via #include (although the old /include/ stuff is supported still). (2) bring in files from either vendor tree or freebsd-custom files when building. (3) move all dts* files from sys/boot/fdt/dts to sys/boot/fdt/dts/${MACHINE} as appropriate. (4) encode all the magic to do the build in sys/tools/fdt/make_dtb.sh so that the different places in the tree use the exact same logic. (5) switch back to gpl dtc by default. the bsdl one in the tree has significant issues not easily addressed by those unfamiliar with the code. Only try to build the static dtb when we're building a static dtb. Use proper include path for dtc as well as cpp. Fix syntax errors (missing ; other minor glitches) in existing dts files.
This commit is contained in:
parent
0e330f2d70
commit
6c4033c89f
@ -1266,7 +1266,7 @@ _dtrace_tools= cddl/usr.bin/sgsmsg cddl/lib/libctf lib/libelf \
|
||||
lib/libdwarf cddl/usr.bin/ctfconvert cddl/usr.bin/ctfmerge
|
||||
.endif
|
||||
|
||||
# Default to building the BSDL DTC, but build the GPL one if users explicitly
|
||||
# Default to building the GPL DTC, but build the BSDL one if users explicitly
|
||||
# request it.
|
||||
_dtc= usr.bin/dtc
|
||||
.if ${MK_GPL_DTC} != "no"
|
||||
@ -1849,7 +1849,7 @@ builddtb:
|
||||
echo "ERROR: FDT_DTS_FILE must be specified!"; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
if [ ! -f ${.CURDIR}/sys/boot/fdt/dts/${FDT_DTS_FILE} ]; then \
|
||||
if [ ! -f ${.CURDIR}/sys/boot/fdt/dts/${MACHINE}/${FDT_DTS_FILE} ]; then \
|
||||
echo "ERROR: Specified DTS file (${FDT_DTS_FILE}) does not \
|
||||
exist!"; \
|
||||
exit 1; \
|
||||
@ -1859,9 +1859,9 @@ builddtb:
|
||||
directory"; \
|
||||
fi
|
||||
@PATH=${TMPPATH} \
|
||||
dtc -O dtb -o \
|
||||
${DTBOUTPUTPATH}/`echo ${FDT_DTS_FILE} | cut -d. -f1`.dtb -b 0 \
|
||||
-p 1024 ${.CURDIR}/sys/boot/fdt/dts/${FDT_DTS_FILE}
|
||||
${.CURDIR}/sys/tools/fdt/make_dtb.sh ${.CURDIR}/sys \
|
||||
${FDT_DTS_FILE} \
|
||||
${DTBOUTPUTPATH}/`basename ${FDT_DTS_FILE} .dts`
|
||||
|
||||
###############
|
||||
|
||||
|
@ -285,6 +285,7 @@ __DEFAULT_YES_OPTIONS = \
|
||||
GNU \
|
||||
GPIB \
|
||||
GPIO \
|
||||
GPL_DTC \
|
||||
GROFF \
|
||||
HTML \
|
||||
ICONV \
|
||||
@ -367,7 +368,6 @@ __DEFAULT_NO_OPTIONS = \
|
||||
CLANG_EXTRAS \
|
||||
CTF \
|
||||
DEBUG_FILES \
|
||||
GPL_DTC \
|
||||
HESIOD \
|
||||
INSTALL_AS_USER \
|
||||
LLDB \
|
||||
|
@ -150,7 +150,7 @@
|
||||
compatible = "ti,am335x-pmic";
|
||||
reg = <0x24>;
|
||||
};
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
leds {
|
@ -105,7 +105,7 @@
|
||||
ethernet@63fec000 {
|
||||
status = "okay";
|
||||
phy-mode = "rmii";
|
||||
}
|
||||
};
|
||||
i2c@63fc4000 {
|
||||
status = "okay";
|
||||
};
|
@ -95,7 +95,7 @@
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
interrupt-parent = <&tzic>;
|
||||
ranges = <0x50000000 0x14000000>;
|
||||
ranges;
|
||||
|
||||
aips@50000000 { /* AIPS1 */
|
||||
compatible = "fsl,aips-bus", "simple-bus";
|
@ -99,7 +99,7 @@
|
||||
reg = <0x020c8000 0x1000>;
|
||||
interrupt-parent = <&gic>;
|
||||
interrupts = <49>;
|
||||
}
|
||||
};
|
||||
|
||||
gpt: timer@02098000 {
|
||||
compatible = "fsl,imx6q-gpt", "fsl,imx51-gpt";
|
||||
@ -343,7 +343,7 @@
|
||||
ocotp0: ocotp@021bc000 {
|
||||
compatible = "fsl,imx6q-ocotp";
|
||||
reg = <0x021bc000 0x4000>;
|
||||
}
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
@ -77,7 +77,6 @@
|
||||
|
||||
timer@20038000 {
|
||||
compatible = "rockchip,rk30xx-timer";
|
||||
compatible = "rockchip,rk3188-dw-apb-timer-osc";
|
||||
reg = <0x20038000 0x20>;
|
||||
interrupts = <76>;
|
||||
clock-frequency = <24000000>;
|
@ -28,13 +28,13 @@
|
||||
|
||||
/include/ "bcm2835.dtsi"
|
||||
|
||||
/memreserve/ 0x08000000 0x08000000; /* Set by VideoCore */
|
||||
|
||||
/ {
|
||||
model = "Raspberry Pi (BCM2835)";
|
||||
compatible = "raspberrypi,model-a", "raspberrypi,model-b",
|
||||
"broadcom,bcm2835-vc", "broadcom,bcm2708-vc";
|
||||
|
||||
memreserve = <0x08000000 0x08000000>; /* Set by VideoCore */
|
||||
|
||||
memory {
|
||||
device_type = "memory";
|
||||
reg = <0 0x8000000>; /* 128MB, Set by VideoCore */
|
@ -66,7 +66,7 @@
|
||||
device-type = "cpu";
|
||||
compatible = "sri-cambridge,beri";
|
||||
|
||||
reg = <0>;
|
||||
reg = <0 1>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
@ -75,7 +75,7 @@
|
||||
device-type = "cpu";
|
||||
compatible = "sri-cambridge,beri";
|
||||
|
||||
reg = <1>;
|
||||
reg = <1 1>;
|
||||
// XXX: should we need cached prefix?
|
||||
cpu-release-addr = <0xffffffff 0x800fffe0>;
|
||||
};
|
@ -64,7 +64,7 @@
|
||||
device-type = "cpu";
|
||||
compatible = "sri-cambridge,beri";
|
||||
|
||||
reg = <0>;
|
||||
reg = <0 1>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
@ -73,7 +73,7 @@
|
||||
device-type = "cpu";
|
||||
compatible = "sri-cambridge,beri";
|
||||
|
||||
reg = <1>;
|
||||
reg = <1 1>;
|
||||
// XXX: should we need cached prefix?
|
||||
cpu-release-addr = <0xffffffff 0x800fffe0>;
|
||||
};
|
@ -64,7 +64,7 @@
|
||||
device-type = "cpu";
|
||||
compatible = "sri-cambridge,beri";
|
||||
|
||||
reg = <0>;
|
||||
reg = <0 1>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
@ -73,7 +73,7 @@
|
||||
device-type = "cpu";
|
||||
compatible = "sri-cambridge,beri";
|
||||
|
||||
reg = <1>;
|
||||
reg = <1 1>;
|
||||
// XXX: should we need cached prefix?
|
||||
cpu-release-addr = <0xffffffff 0x800fffe0>;
|
||||
};
|
@ -54,12 +54,13 @@ aic79xx_reg_print.o optional ahd pci ahd_reg_pretty_print \
|
||||
# The 'fdt_dtb_file' target covers an actual DTB file name, which is derived
|
||||
# from the specified source (DTS) file: <platform>.dts -> <platform>.dtb
|
||||
#
|
||||
fdt_dtb_file optional fdt \
|
||||
compile-with "if [ -f $S/boot/fdt/dts/${FDT_DTS_FILE} ]; then dtc -O dtb -o ${FDT_DTS_FILE:R}.dtb -b 0 -p 1024 $S/boot/fdt/dts/${FDT_DTS_FILE}; fi" \
|
||||
fdt_dtb_file optional fdt fdt_dtb_static \
|
||||
compile-with "sh $S/tools/fdt/make_dtb.sh $S ${FDT_DTS_FILE} ${.CURDIR}/${FDT_DTS_FILE:R}.dtb" \
|
||||
no-obj no-implicit-rule before-depend \
|
||||
clean "${FDT_DTS_FILE:R}.dtb"
|
||||
fdt_static_dtb.h optional fdt fdt_dtb_static \
|
||||
compile-with "sh $S/tools/fdt/make_dtbh.sh ${FDT_DTS_FILE} ." \
|
||||
compile-with "sh $S/tools/fdt/make_dtbh.sh ${FDT_DTS_FILE} ${.CURDIR}" \
|
||||
dependency "fdt_dtb_file" \
|
||||
no-obj no-implicit-rule before-depend \
|
||||
clean "fdt_static_dtb.h"
|
||||
feeder_eq_gen.h optional sound \
|
||||
@ -1406,7 +1407,7 @@ dev/fb/splash.c optional sc splash
|
||||
dev/fdt/fdt_common.c optional fdt
|
||||
dev/fdt/fdt_slicer.c optional fdt cfi | fdt nand
|
||||
dev/fdt/fdt_static_dtb.S optional fdt fdt_dtb_static \
|
||||
dependency "$S/boot/fdt/dts/${FDT_DTS_FILE}"
|
||||
dependency "$S/boot/fdt/dts/${MACHINE}/${FDT_DTS_FILE}"
|
||||
dev/fdt/simplebus.c optional fdt
|
||||
dev/fe/if_fe.c optional fe
|
||||
dev/fe/if_fe_pccard.c optional fe pccard
|
||||
|
11
sys/tools/fdt/make_dtb.sh
Executable file
11
sys/tools/fdt/make_dtb.sh
Executable file
@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# $FreeBSD$
|
||||
|
||||
# Script generates dtb file ($3) from dts source ($2) in build tree S ($1)
|
||||
S=$1
|
||||
dts=$2
|
||||
dtb=$3
|
||||
|
||||
cpp -x assembler-with-cpp -I $S/gnu/dts/include -I $S/boot/fdt/dts/${MACHINE} -I $S/gnu/dts/${MACHINE} -include $dts /dev/null |
|
||||
dtc -O dtb -o $dtb -b 0 -p 1024 -i $S/boot/fdt/dts/${MACHINE} -i $S/gnu/dts/${MACHINE}
|
Loading…
Reference in New Issue
Block a user